账户日志的操作类型支持多选
continuous-integration/drone/push Build is passing Details

uat
wangxiaoshuang 2025-04-09 13:43:47 +08:00
parent 1d6ebe6388
commit 1bddd30709
2 changed files with 83 additions and 301 deletions

View File

@ -2,152 +2,66 @@
<div class="log">
<div ref="leftContainer" class="left">
<el-form :inline="true">
<el-form-item
:label="$t('system:loginLog:label:OptType')"
prop="OptType"
>
<el-select
v-model="searchData.OptType"
clearable
style="width: 120px"
>
<el-option
v-for="item of $d.UserOptType"
:key="'UserOptType' + item.label"
:value="item.value"
:label="item.label"
/>
<el-form-item :label="$t('system:loginLog:label:OptType')" prop="OptType">
<el-select v-model="searchData.OptTypeList" clearable style="width: 200px" multiple :collapse-tags="true">
<el-option v-for="item of $d.UserOptType" :key="'UserOptType' + item.label" :value="item.value"
:label="item.label" />
</el-select>
</el-form-item>
<el-form-item label="IP" prop="IP">
<el-input
v-model="searchData.IP"
size="small"
clearable
style="width: 120px"
/>
<el-input v-model="searchData.IP" size="small" clearable style="width: 120px" />
</el-form-item>
<el-form-item
:label="$t('system:loginLog:label:LoginFaildName')"
prop="LoginFaildName"
>
<el-input
v-model="searchData.LoginFaildName"
size="small"
clearable
style="width: 120px"
/>
<el-form-item :label="$t('system:loginLog:label:LoginFaildName')" prop="LoginFaildName">
<el-input v-model="searchData.LoginFaildName" size="small" clearable style="width: 120px" />
</el-form-item>
<el-form-item
:label="$t('system:loginLog:table:LoginUserName')"
prop="LoginFaildName"
>
<el-input
v-model="searchData.LoginUserName"
size="small"
clearable
style="width: 120px"
/>
<el-form-item :label="$t('system:loginLog:table:LoginUserName')" prop="LoginFaildName">
<el-input v-model="searchData.LoginUserName" size="small" clearable style="width: 120px" />
</el-form-item>
<el-form-item
:label="$t('system:loginLog:table:LoginUserType')"
prop="LoginUserTypeEnum"
>
<el-select
v-model="searchData.LoginUserTypeEnum"
clearable
style="width: 120px"
>
<el-option
v-for="item of $d.UserType"
:key="'UserType' + item.label"
:value="item.value"
:label="item.label"
/>
<el-form-item :label="$t('system:loginLog:table:LoginUserType')" prop="LoginUserTypeEnum">
<el-select v-model="searchData.LoginUserTypeEnum" clearable style="width: 120px">
<el-option v-for="item of $d.UserType" :key="'UserType' + item.label" :value="item.value"
:label="item.label" />
</el-select>
</el-form-item>
<el-form-item :label="$t('system:loginLog:label:CreateTime')">
<el-date-picker
v-model="datetimerange"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
:default-time="['00:00:00', '23:59:59']"
@change="handleDatetimeChange"
style="width: 380px"
/>
<el-date-picker v-model="datetimerange" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss"
:default-time="['00:00:00', '23:59:59']" @change="handleDatetimeChange" style="width: 380px" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList">
{{ $t('common:button:search') }}
</el-button>
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
<el-button type="primary" icon="el-icon-refresh-left" @click="handleReset">
{{ $t('common:button:reset') }}
</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
v-adaptive="{ bottomOffset: 45 }"
height="100"
:data="list"
class="table"
@sort-change="handleSortByColumn"
>
<el-table v-loading="loading" v-adaptive="{ bottomOffset: 45 }" height="100" :data="list" class="table"
@sort-change="handleSortByColumn">
<el-table-column type="index" width="50">
<template slot-scope="scope">
<span
style="
<span style="
display: flex;
align-items: center;
justify-content: flex-end;
"
>
<el-tooltip
class="item"
effect="dark"
:content="$t('system:loginLog:label:IsLoginUncommonly')"
placement="top"
style="margin-right: 3px"
v-if="scope.row.IsLoginUncommonly"
>
<i
v-if="scope.row.IsLoginUncommonly"
class="el-icon-warning icon-i"
></i>
">
<el-tooltip class="item" effect="dark" :content="$t('system:loginLog:label:IsLoginUncommonly')"
placement="top" style="margin-right: 3px" v-if="scope.row.IsLoginUncommonly">
<i v-if="scope.row.IsLoginUncommonly" class="el-icon-warning icon-i"></i>
</el-tooltip>
<span>{{ scope.$index + 1 }}</span>
</span>
</template>
</el-table-column>
<el-table-column
:label="$t('system:loginLog:table:OptType')"
prop="OptType"
min-width="150"
show-overflow-tooltip
sortable="custom"
>
<el-table-column :label="$t('system:loginLog:table:OptType')" prop="OptType" min-width="150"
show-overflow-tooltip sortable="custom">
<template slot-scope="scope">
{{ $fd('UserOptType', scope.row.OptType) }}
</template>
</el-table-column>
<el-table-column
label="IP"
prop="IP"
min-width="150"
sortable="custom"
show-overflow-tooltip
/>
<el-table-column
:label="$t('trials:loginLog:table:IPRegion')"
prop="IPRegion"
min-width="120"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column label="IP" prop="IP" min-width="150" sortable="custom" show-overflow-tooltip />
<el-table-column :label="$t('trials:loginLog:table:IPRegion')" prop="IPRegion" min-width="120"
show-overflow-tooltip sortable="custom" />
<!-- <el-table-column
:label="$t('system:loginLog:table:LoginFaildName')"
prop="LoginFaildName"
@ -155,20 +69,10 @@
show-overflow-tooltip
sortable="custom"
/> -->
<el-table-column
:label="$t('system:loginLog:table:LoginUserName')"
prop="ActionUserName"
min-width="140"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
:label="$t('system:loginLog:table:Aetionlserlype')"
prop="ActionUserType"
min-width="100"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column :label="$t('system:loginLog:table:LoginUserName')" prop="ActionUserName" min-width="140"
show-overflow-tooltip sortable="custom" />
<el-table-column :label="$t('system:loginLog:table:Aetionlserlype')" prop="ActionUserType" min-width="100"
show-overflow-tooltip sortable="custom" />
<!-- <el-table-column
:label="$t('system:loginLog:table:LoginUserType')"
prop="LoginUserTypeEnum"
@ -180,13 +84,8 @@
{{ $fd("UserType", scope.row.LoginUserTypeEnum) }}
</template>
</el-table-column> -->
<el-table-column
:label="$t('system:loginLog:table:OptUserName')"
prop="TargetIdentityUserName"
min-width="200"
sortable="custom"
show-overflow-tooltip
/>
<el-table-column :label="$t('system:loginLog:table:OptUserName')" prop="TargetIdentityUserName" min-width="200"
sortable="custom" show-overflow-tooltip />
<!-- <el-table-column
:label="$t('system:loginLog:table:OptUserType')"
prop="OptUserTypeEnum"
@ -198,36 +97,19 @@
{{ $fd("UserType", scope.row.OptUserTypeEnum) }}
</template>
</el-table-column> -->
<el-table-column
:label="$t('system:loginLog:table:detail')"
min-width="120"
show-overflow-tooltip
>
<el-table-column :label="$t('system:loginLog:table:detail')" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<el-button
v-if="scope.row.JsonObj"
type="text"
@click="handleOpenDialog(scope.row)"
>
<el-button v-if="scope.row.JsonObj" type="text" @click="handleOpenDialog(scope.row)">
<span>{{ $t('system:loginLog:message:detail') }}</span>
</el-button>
</template>
</el-table-column>
<el-table-column
:label="$t('system:loginLog:table:CreateTime')"
prop="CreateTime"
min-width="180"
sortable="custom"
show-overflow-tooltip
/>
<el-table-column :label="$t('system:loginLog:table:CreateTime')" prop="CreateTime" min-width="180"
sortable="custom" show-overflow-tooltip />
</el-table>
<div class="pagination" style="text-align: right; margin-top: 5px">
<pagination
:total="total"
:page.sync="searchData.PageIndex"
:limit.sync="searchData.PageSize"
@pagination="getList"
/>
<pagination :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize"
@pagination="getList" />
</div>
</div>
<detail :config="config" :JsonObj="JsonObj" />
@ -241,6 +123,7 @@ import moment from 'moment'
const searchDataDefault = () => {
return {
OptType: null,
OptTypeList: [],
Ip: '',
LoginFaildName: '',
LoginUserName: '',
@ -334,25 +217,30 @@ export default {
display: flex;
padding: 10px;
border-radius: 5px;
.left {
display: flex;
flex-direction: column;
width: 0;
flex-grow: 4;
// border-right: 1px solid #ccc;
.filter-container {
display: flex;
align-items: center;
margin: 5px;
}
.data-table {
flex: 1;
padding: 5px 0px;
}
.pagination-container {
text-align: right;
}
}
.icon-i {
color: #f56c6c;
cursor: pointer;

View File

@ -2,31 +2,14 @@
<BaseContainer>
<template slot="search-container">
<el-form :inline="true">
<el-form-item
:label="$t('trials:loginLog:table:optType')"
prop="OptType"
>
<el-select
v-model="searchData.OptType"
clearable
style="width: 120px"
>
<el-option
v-for="item of $d.UserOptType"
v-show="item.value !== 3 && item.value !== 10 && item.value !== 9"
:key="'UserOptType' + item.label"
:value="item.value"
:label="item.label"
/>
<el-form-item :label="$t('trials:loginLog:table:optType')" prop="OptType">
<el-select v-model="searchData.OptTypeList" clearable multiple :collapse-tags="true" style="width: 200px">
<el-option v-for="item of $d.UserOptType" v-show="item.value !== 3 && item.value !== 10 && item.value !== 9"
:key="'UserOptType' + item.label" :value="item.value" :label="item.label" />
</el-select>
</el-form-item>
<el-form-item label="IP" prop="IP">
<el-input
v-model="searchData.IP"
size="small"
clearable
style="width: 120px"
/>
<el-input v-model="searchData.IP" size="small" clearable style="width: 120px" />
</el-form-item>
<!-- <el-form-item
:label="$t('trials:loginLog:table:incorrectUserName')"
@ -40,108 +23,52 @@
style="width: 120px"
/>
</el-form-item> -->
<el-form-item
:label="$t('trials:loginLog:table:userName')"
prop="LoginUserName"
v-if="!isMine"
>
<el-form-item :label="$t('trials:loginLog:table:userName')" prop="LoginUserName" v-if="!isMine">
<el-select v-model="searchData.IdentityUserId" clearable style="width: 120px">
<el-option
v-for="item of trialUserList"
:key="item.IdentityUserId"
:value="item.IdentityUserId"
:label="item.UserName"
/>
<el-option v-for="item of trialUserList" :key="item.IdentityUserId" :value="item.IdentityUserId"
:label="item.UserName" />
</el-select>
</el-form-item>
<el-form-item
:label="$t('trials:loginLog:table:optUserName')"
prop="TargetIdentityUserId"
v-if="!isMine"
>
<el-form-item :label="$t('trials:loginLog:table:optUserName')" prop="TargetIdentityUserId" v-if="!isMine">
<el-select v-model="searchData.TargetIdentityUserId" clearable style="width: 120px">
<el-option
v-for="item of trialUserList"
:key="item.IdentityUserId"
:value="item.IdentityUserId"
:label="item.UserName"
/>
<el-option v-for="item of trialUserList" :key="item.IdentityUserId" :value="item.IdentityUserId"
:label="item.UserName" />
</el-select>
</el-form-item>
<el-form-item
:label="$t('trials:loginLog:table:userType')"
prop="OptType"
v-if="!isMine"
>
<el-select
v-model="searchData.LoginUserType"
clearable
style="width: 120px"
>
<el-option
v-for="item of $d.UserType"
v-show="item.value !== 7 && item.value !== 8"
:key="'UserType' + item.label"
:value="item.label"
:label="item.label"
/>
<el-form-item :label="$t('trials:loginLog:table:userType')" prop="OptType" v-if="!isMine">
<el-select v-model="searchData.LoginUserType" clearable style="width: 120px">
<el-option v-for="item of $d.UserType" v-show="item.value !== 7 && item.value !== 8"
:key="'UserType' + item.label" :value="item.label" :label="item.label" />
</el-select>
</el-form-item>
<el-form-item :label="$t('trials:loginLog:table:createTime')">
<el-date-picker
v-model="datetimerange"
type="datetimerange"
:default-time="['00:00:00', '23:59:59']"
<el-date-picker v-model="datetimerange" type="datetimerange" :default-time="['00:00:00', '23:59:59']"
:start-placeholder="$t('trials:loginLog:table:beginTime')"
:end-placeholder="$t('trials:loginLog:table:endTime')"
value-format="yyyy-MM-dd HH:mm:ss"
@change="handleDatetimeChange"
/>
:end-placeholder="$t('trials:loginLog:table:endTime')" value-format="yyyy-MM-dd HH:mm:ss"
@change="handleDatetimeChange" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleSearch">
{{ $t('common:button:search') }}
</el-button>
<!-- 重置 -->
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
<el-button type="primary" icon="el-icon-refresh-left" @click="handleReset">
{{ $t('common:button:reset') }}
</el-button>
</el-form-item>
</el-form>
</template>
<template slot="main-container">
<el-table
v-loading="loading"
v-adaptive="{ bottomOffset: isMine ? 80 : 60 }"
height="100"
:data="list"
class="table"
@sort-change="handleSortByColumn"
:default-sort="{ prop: 'CreateTime', order: 'descending' }"
>
<el-table v-loading="loading" v-adaptive="{ bottomOffset: isMine ? 80 : 60 }" height="100" :data="list"
class="table" @sort-change="handleSortByColumn" :default-sort="{ prop: 'CreateTime', order: 'descending' }">
<el-table-column type="index" width="50" />
<el-table-column
:label="$t('trials:loginLog:table:optType')"
prop="OptType"
min-width="90"
show-overflow-tooltip
sortable="custom"
>
<el-table-column :label="$t('trials:loginLog:table:optType')" prop="OptType" min-width="90"
show-overflow-tooltip sortable="custom">
<template slot-scope="scope">
{{ $fd('UserOptType', scope.row.OptType) }}
</template>
</el-table-column>
<el-table-column
label="IP"
prop="IP"
min-width="90"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column label="IP" prop="IP" min-width="90" show-overflow-tooltip sortable="custom" />
<!-- <el-table-column
:label="$t('trials:loginLog:table:IPRegion')"
prop="IPRegion"
@ -157,20 +84,10 @@
show-overflow-tooltip
sortable="custom"
/> -->
<el-table-column
:label="$t('trials:loginLog:table:userName')"
prop="ActionUserName"
min-width="90"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
:label="$t('trials:loginLog:table:Aetionlserlype')"
prop="ActionUserType"
min-width="100"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column :label="$t('trials:loginLog:table:userName')" prop="ActionUserName" min-width="90"
show-overflow-tooltip sortable="custom" />
<el-table-column :label="$t('trials:loginLog:table:Aetionlserlype')" prop="ActionUserType" min-width="100"
show-overflow-tooltip sortable="custom" />
<!-- <el-table-column
:label="$t('trials:loginLog:table:userType')"
prop="LoginUserTypeEnum"
@ -182,14 +99,8 @@
{{ $fd('UserType', scope.row.LoginUserTypeEnum) }}
</template>
</el-table-column> -->
<el-table-column
v-if="!isMine"
:label="$t('trials:loginLog:table:optUserName')"
prop="TargetIdentityUserName"
min-width="120"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column v-if="!isMine" :label="$t('trials:loginLog:table:optUserName')" prop="TargetIdentityUserName"
min-width="120" show-overflow-tooltip sortable="custom" />
<!-- <el-table-column
v-if="!isMine"
:label="$t('trials:loginLog:table:optUserType')"
@ -202,37 +113,19 @@
{{ $fd('UserType', scope.row.OptUserTypeEnum) }}
</template>
</el-table-column> -->
<el-table-column
:label="$t('trials:loginLog:table:detail')"
min-width="80"
show-overflow-tooltip
>
<el-table-column :label="$t('trials:loginLog:table:detail')" min-width="80" show-overflow-tooltip>
<template slot-scope="scope">
<el-button
v-if="scope.row.JsonObj"
type="text"
@click="handleOpenDialog(scope.row)"
>
<el-button v-if="scope.row.JsonObj" type="text" @click="handleOpenDialog(scope.row)">
<span>{{ $t('trials:loginLog:message:detail') }}</span>
</el-button>
</template>
</el-table-column>
<el-table-column
:label="$t('trials:loginLog:table:createTime')"
prop="CreateTime"
min-width="90"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column :label="$t('trials:loginLog:table:createTime')" prop="CreateTime" min-width="90"
show-overflow-tooltip sortable="custom" />
</el-table>
<!-- 分页组件 -->
<pagination
class="page"
:total="total"
:page.sync="searchData.PageIndex"
:limit.sync="searchData.PageSize"
@pagination="getList"
/>
<pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize"
@pagination="getList" />
</template>
<detail :config="config" :JsonObj="JsonObj" />
</BaseContainer>
@ -247,6 +140,7 @@ const searchDataDefault = () => {
return {
TrialId: '',
OptType: null,
OptTypeList: [],
Ip: '',
LoginFaildName: '',
LoginUserName: '',