用户评审功能
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-08-25 14:17:22 +08:00
parent 64581a3e07
commit f101478135
3 changed files with 434 additions and 343 deletions

View File

@ -0,0 +1,111 @@
<template>
<base-model v-if="config.visible" :config="config">
<template slot="dialog-body">
<el-table :data="curData" border style="width: 100%" size="small">
<el-table-column
prop="key"
:label="$t('system:loginLog:table:cfgItem')"
show-overflow-tooltip
/>
<el-table-column
prop="value"
:label="$t('system:loginLog:table:cfgVal')"
show-overflow-tooltip
>
<template slot-scope="scope">
<span v-if="scope.row.prop !== 'UserRoleList'">{{
scope.row.value
}}</span>
<template v-else>
<div
v-for="item in scope.row.value"
:key="item.UserTypeEnum"
style="margin: 0"
>
{{ item.UserTypeShortName
}}{{ $t('system:loginLog:form:symbol')
}}{{ $fd('IsEnable', !item.IsUserRoleDisabled) }}
</div>
</template>
</template>
</el-table-column>
</el-table>
</template>
<template slot="dialog-footer">
<el-button type="primary" @click="config.visible = false">
{{ $t('common:button:confirm') }}
</el-button>
</template>
</base-model>
</template>
<script>
import BaseModel from '@/components/BaseModel'
export default {
components: { BaseModel },
props: {
JsonObj: {
type: String,
default: '',
},
config: {
type: Object,
default: () => {
return {
visible: false,
title: this.$t('system:loginLog:dialog:title'),
width: '500px',
top: '10vh',
appendToBody: true,
bodyStyle: `min-height: 100px; max-height: 650px;overflow-y: auto;padding: 10px;border: 1px solid #e0e0e0;`,
}
},
},
},
data() {
return {
curKeys: [
'UserName',
'FirstName',
'LastName',
'EMail',
'Phone',
'Status',
'OrganizationName',
'PositionName',
'DepartmentName',
'UserRoleList',
],
}
},
computed: {
curDataArr() {
if (!this.curData) return []
return Object.keys(this.curData)
},
curData() {
if (!this.JsonObj) return []
let obj = JSON.parse(this.JsonObj)
let curData = []
Object.keys(obj).forEach((key) => {
if (this.curKeys.includes(key)) {
let o = {
key: this.$t(`system:loginLog:form:${key}`),
value: obj[key],
prop: key,
}
if (key === 'Status') {
o.value = this.$fd('IsUserEnable', obj[key])
}
curData.push(o)
}
})
return curData
},
},
}
</script>
<style lang="scss" scoped>
::v-deep .el-form-item__label {
font-weight: bold;
}
</style>

View File

@ -2,179 +2,153 @@
<div class="log">
<div ref="leftContainer" class="left">
<el-form :inline="true">
<el-form-item
label="操作类型"
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-form-item label="IP" prop="IP">
<el-input v-model="searchData.IP" size="small" clearable style="width: 120px" />
</el-form-item>
<el-form-item
label="错误用户名"
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="创建时间"
>
<el-date-picker
v-model="datetimerange"
type="datetimerange"
range-separator="-"
:start-placeholder="$t('trials:uploadClinicalData:table:beginDate')"
:end-placeholder="$t('trials:uploadClinicalData:table:endDate')"
value-format="yyyy-MM-dd HH:mm:ss"
:default-time="['00:00:00', '23:59:59']"
@change="handleDatetimeChange"
/>
<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-select>
</el-form-item> -->
<el-form-item :label="$t('system:loginLog:label:IsLoginUncommonly')" prop="IsLoginUncommonly ">
<el-select v-model="searchData.IsLoginUncommonly" clearable style="width: 120px">
<el-option v-for="item of $d.YesOrNo" :key="item.id" :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-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="getList"
>
查询
<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">
{{ $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"
:default-sort="{ prop: 'CreateTime', order: 'descending' }"
>
<el-table-column
type="index"
width="50"
/>
<el-table-column
label="操作类型"
prop="OptType"
min-width="90"
show-overflow-tooltip
sortable="custom"
>
<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">
{{ $fd('UserOptType',scope.row.OptType) }}
<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.IsIgnoreUncommonly">
<i v-if="scope.row.IsLoginUncommonly" class="el-icon-warning icon-i icon-success"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" :content="$t('system:loginLog:label:IsLoginUncommonly')"
placement="top" style="margin-right: 3px" v-else-if="scope.row.IsLoginUncommonly">
<i v-if="scope.row.IsLoginUncommonly" class="el-icon-warning icon-i"
@click.stop="setIsIgnoreUncommonly(scope.row)"></i>
</el-tooltip>
<span>{{ scope.$index + 1 }}</span>
</span>
</template>
</el-table-column>
<el-table-column
label="IP"
prop="IP"
min-width="90"
sortable="custom"
show-overflow-tooltip
/>
<el-table-column
label="错误用户名"
<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="$t('system:loginLog:table:LoginFaildName')"
prop="LoginFaildName"
min-width="90"
min-width="180"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
label="用户名"
prop="LoginUserName"
min-width="90"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
label="用户类型"
/> -->
<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"
min-width="90"
min-width="120"
sortable="custom"
show-overflow-tooltip
>
<template slot-scope="scope">
{{ $fd('UserType',scope.row.LoginUserTypeEnum) }}
{{ $fd("UserType", scope.row.LoginUserTypeEnum) }}
</template>
</el-table-column>
<el-table-column
label="操作用户名"
prop="OptUserName"
min-width="90"
sortable="custom"
show-overflow-tooltip
/>
<el-table-column
label="操作用户类型"
</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:OptUserType')"
prop="OptUserTypeEnum"
min-width="90"
min-width="200"
sortable="custom"
show-overflow-tooltip
>
<template slot-scope="scope">
{{ $fd('UserType',scope.row.OptUserTypeEnum) }}
{{ $fd("UserType", scope.row.OptUserTypeEnum) }}
</template>
</el-table-column> -->
<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)">
<span>{{ $t('system:loginLog:message:detail') }}</span>
</el-button>
</template>
</el-table-column>
<el-table-column
label="创建时间"
prop="CreateTime"
min-width="90"
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"
/>
<div class="pagination" style="text-align: right; margin-top: 5px">
<pagination :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize"
@pagination="getList" />
</div>
</div>
<detail :config="config" :JsonObj="JsonObj" />
</div>
</template>
<script>
import { getUserLogList } from '@/api/user'
import { getUserLogList, setIsIgnoreUncommonly } from '@/api/user'
import Pagination from '@/components/Pagination'
import detail from './detail.vue'
import moment from 'moment'
const searchDataDefault = () => {
return {
OptType: null,
OptTypeList: [],
Ip: '',
LoginFaildName: '',
IsLoginUncommonly: null,
LoginUserName: '',
LoginUserTypeEnum: null,
BeginDate: '',
EndDate: '',
Asc: false,
SortField: 'CreateTime',
PageIndex: 1,
PageSize: 20
PageSize: 20,
}
}
export default {
components: { Pagination },
components: { Pagination, detail },
data() {
return {
moment,
@ -182,22 +156,61 @@ export default {
list: [],
total: 0,
loading: false,
datetimerange: []
datetimerange: [],
config: {
visible: false,
title: this.$t('system:loginLog:dialog:title'),
width: '500px',
top: '10vh',
},
JsonObj: null,
}
},
mounted() {
this.getList()
},
methods: {
//
async setIsIgnoreUncommonly(row) {
try {
let confirm = await this.$confirm(this.$t("system:loginLog:confirmMessage:setIsIgnoreUncommonly"))
if (!confirm) return false
let data = {
IsIgnoreUncommonly: true,
Id: row.Id
}
this.loading = true
let res = await setIsIgnoreUncommonly(data)
this.loading = false
if (res.IsSuccess) {
this.getList()
}
} catch (err) {
this.loading = false
console.log(err)
}
},
handleOpenDialog(row) {
if (!row.JsonObj)
return this.$message.warning(this.$t('system:loginLog:message:noJSON'))
this.config.title = this.$t('system:loginLog:dialog:title').replace(
'xxx',
this.$fd('UserOptType', row.OptType)
)
this.JsonObj = row.JsonObj
this.config.visible = true
},
getList() {
this.loading = true
getUserLogList(this.searchData).then((res) => {
this.loading = false
this.list = res.Result.CurrentPageData
this.total = res.Result.TotalCount
}).catch(() => {
this.loading = false
})
getUserLogList(this.searchData)
.then((res) => {
this.loading = false
this.list = res.Result.CurrentPageData
this.total = res.Result.TotalCount
})
.catch(() => {
this.loading = false
})
},
handleDatetimeChange(val) {
if (val) {
@ -210,6 +223,7 @@ export default {
},
//
handleReset() {
this.datetimerange = []
this.searchData = searchDataDefault()
this.getList()
},
@ -223,35 +237,48 @@ export default {
this.searchData.SortField = column.prop
this.searchData.PageIndex = 1
this.getList()
}
}
},
},
}
</script>
<style lang="scss">
.log {
height: 100%;
box-sizing: border-box;
.log {
height: 100%;
box-sizing: border-box;
display: flex;
padding: 10px;
border-radius: 5px;
.left {
display: flex;
padding: 10px;
border-radius: 5px;
.left {
flex-direction: column;
width: 0;
flex-grow: 4;
// border-right: 1px solid #ccc;
.filter-container {
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;
}
align-items: center;
margin: 5px;
}
.data-table {
flex: 1;
padding: 5px 0px;
}
.pagination-container {
text-align: right;
}
}
.icon-i {
color: #f56c6c;
cursor: pointer;
}
.icon-success {
color: #67C23A
}
}
</style>

View File

@ -2,34 +2,16 @@
<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"
>
<template v-for="item of $d.UserOptType">
<el-option
:key="'UserOptType' + item.label"
:value="item.value"
:label="item.label"
v-if="item.value !== 9 && item.value !== 10"
/>
</template>
<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
<!-- <el-form-item
:label="$t('trials:loginLog:table:incorrectUserName')"
prop="LoginFaildName"
v-if="!isMine"
@ -40,109 +22,73 @@
clearable
style="width: 120px"
/>
</el-form-item> -->
<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-select>
</el-form-item>
<el-form-item
:label="$t('trials:loginLog:table:userName')"
prop="LoginUserName"
v-if="!isMine"
>
<el-input
v-model="searchData.LoginUserName"
size="small"
clearable
style="width: 120px"
/>
<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-select>
</el-form-item>
<el-form-item
:label="$t('trials:loginLog:table:userType')"
prop="OptType"
v-if="!isMine"
>
<el-select
v-model="searchData.UserTypeId"
clearable
style="width: 120px"
>
<el-option
v-for="item of userTypeOptions"
:key="item.Id"
:label="item.UserType"
:value="item.Id"
/>
<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
clearable
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") }}
{{ $t('common:button:search') }}
</el-button>
<!-- 重置 -->
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t("common:button:reset") }}
<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) }}
{{ $fd('UserOptType', scope.row.OptType) }}
</template>
</el-table-column>
<el-table-column
label="IP"
prop="IP"
<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"
min-width="90"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
/> -->
<!-- <el-table-column
v-if="!isMine"
:label="$t('trials:loginLog:table:incorrectUserName')"
prop="LoginFaildName"
min-width="90"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
:label="$t('trials:loginLog:table:userName')"
prop="LoginUserName"
min-width="90"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
/> -->
<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"
min-width="90"
@ -150,73 +96,67 @@
sortable="custom"
>
<template slot-scope="scope">
{{ $fd("UserType", scope.row.LoginUserTypeEnum) }}
{{ $fd('UserType', scope.row.LoginUserTypeEnum) }}
</template>
</el-table-column>
<!-- <el-table-column
v-if="!isMine"
:label="$t('trials:loginLog:table:optUserName')"
prop="optUserName"
min-width="90"
show-overflow-tooltip
sortable="custom"
/> -->
</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:optUserType')"
prop="OptUserTypeEnum"
min-width="90"
min-width="160"
show-overflow-tooltip
sortable="custom"
>
<template slot-scope="scope">
{{ $fd("UserType", scope.row.OptUserTypeEnum) }}
{{ $fd('UserType', scope.row.OptUserTypeEnum) }}
</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:detail')" min-width="80" show-overflow-tooltip>
<template slot-scope="scope">
<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>
<!-- 分页组件 -->
<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>
</template>
<script>
import { getUserLogList } from "@/api/user";
import { getUserTypeListByUserType } from "@/api/admin";
import BaseContainer from "@/components/BaseContainer";
import Pagination from "@/components/Pagination";
import moment from "moment";
import { getUserLogList, getTrialUserList } from '@/api/user'
import BaseContainer from '@/components/BaseContainer'
import Pagination from '@/components/Pagination'
import moment from 'moment'
import detail from '@/views/system/login-log/detail.vue'
const searchDataDefault = () => {
return {
TrialId: "",
TrialId: '',
OptType: null,
Ip: "",
LoginFaildName: "",
BeginDate: "",
EndDate: "",
OptTypeList: [],
Ip: '',
LoginFaildName: '',
LoginUserName: '',
LoginUserType: null,
BeginDate: '',
EndDate: '',
Asc: false,
SortField: "CreateTime",
UserTypeId: null,
LoginUserName: null,
SortField: 'CreateTime',
PageIndex: 1,
PageSize: 20,
UserId: "",
};
};
UserId: '',
TargetIdentityUserId: ''
}
}
export default {
components: { BaseContainer, Pagination },
components: { BaseContainer, Pagination, detail },
props: {
isMine: {
type: Boolean,
@ -224,91 +164,104 @@ export default {
},
id: {
type: String,
default: "",
default: '',
},
},
data() {
return {
userTypeOptions: [],
moment,
searchData: searchDataDefault(),
list: [],
total: 0,
loading: false,
datetimerange: [],
};
trialUserList: [],
config: {
visible: false,
title: this.$t('trials:loginLog:dialog:title'),
width: '500px',
top: '10vh',
},
JsonObj: null,
}
},
mounted() {
this.getList();
this.getUserType();
if (!this.isMine) {
this.getTrialUserList()
}
this.getList()
},
methods: {
//
getUserType() {
getUserTypeListByUserType(0).then((res) => {
let arr = [];
if (this.hasPermi(["role:admin"])) {
arr = [1];
handleOpenDialog(row) {
if (!row.JsonObj)
return this.$message.warning(this.$t('trials:loginLog:message:noJSON'))
this.config.title = this.$t('trials:loginLog:dialog:title').replace(
'xxx',
this.$fd('UserOptType', row.OptType)
)
this.JsonObj = row.JsonObj
this.config.visible = true
},
//
async getTrialUserList() {
try {
let params = {
TrialId: this.$route.query.trialId,
}
if (this.hasPermi(["role:oa"])) {
arr = [1, 2];
let res = await getTrialUserList(params)
if (res.IsSuccess) {
this.trialUserList = res.Result
}
if (this.hasPermi(["role:pm"])) {
arr = [1, 2, 14];
}
this.userTypeOptions = res.Result.map((item) => {
if (!arr.includes(item.UserTypeEnum)) {
return item;
}
}).filter((item) => item);
});
} catch (err) {
console.log(err)
}
},
getList() {
this.loading = true;
this.searchData.TrialId = this.$route.query.trialId;
this.loading = true
this.searchData.TrialId = this.$route.query.trialId
if (this.isMine) {
this.searchData.UserId = this.id;
this.searchData.IdentityUserId = this.id
}
getUserLogList(this.searchData)
.then((res) => {
this.loading = false;
this.list = res.Result.CurrentPageData;
this.total = res.Result.TotalCount;
this.loading = false
this.list = res.Result.CurrentPageData
this.total = res.Result.TotalCount
})
.catch(() => {
this.loading = false;
});
this.loading = false
})
},
handleDatetimeChange(val) {
if (val) {
this.searchData.BeginDate = val[0];
this.searchData.EndDate = val[1];
this.searchData.BeginDate = val[0]
this.searchData.EndDate = val[1]
} else {
this.searchData.BeginDate = "";
this.searchData.EndDate = "";
this.searchData.BeginDate = ''
this.searchData.EndDate = ''
}
},
handleSearch() {
this.searchData.PageIndex = 1;
this.getList();
this.searchData.PageIndex = 1
this.getList()
},
//
handleReset() {
this.searchData = searchDataDefault();
this.datetimerange = [];
this.getList();
this.datetimerange = null
this.searchData = searchDataDefault()
this.getList()
},
//
handleSortByColumn(column) {
if (column.order === "ascending") {
this.searchData.Asc = true;
if (column.order === 'ascending') {
this.searchData.Asc = true
} else {
this.searchData.Asc = false;
this.searchData.Asc = false
}
this.searchData.SortField = column.prop;
this.searchData.PageIndex = 1;
this.getList();
this.searchData.SortField = column.prop
this.searchData.PageIndex = 1
this.getList()
},
},
};
}
</script>