Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web into main
continuous-integration/drone/push Build is passing Details

uat_us
caiyiling 2024-05-15 13:52:46 +08:00
commit 747eadb7f1
7 changed files with 198 additions and 145 deletions

View File

@ -157,3 +157,12 @@ export function getUserLogList(params) {
data: params data: params
}) })
} }
// 获取登录用户
export function getTrialUserList(params) {
return request({
url: `/TrialMaintenance/getTrialUserList`,
method: 'get',
params
})
}

View File

@ -63,8 +63,8 @@ Vue.use(adaptive)
import dialogDrag from '@/directive/dialogDrag' import dialogDrag from '@/directive/dialogDrag'
// 窗口拖拽 // 窗口拖拽
Vue.use(dialogDrag) Vue.use(dialogDrag)
if(!String.prototype.replaceAll){ if (!String.prototype.replaceAll) {
String.prototype.replaceAll = function(str, newStr){ String.prototype.replaceAll = function (str, newStr) {
// 正则表达式 // 正则表达式
if (Object.prototype.toString.call(str).toLowerCase() === '[object regexp]') { if (Object.prototype.toString.call(str).toLowerCase() === '[object regexp]') {
return this.replace(str, newStr) return this.replace(str, newStr)
@ -96,12 +96,24 @@ Vue.prototype.selectDictLabel = selectDictLabel
// Vue.prototype.download = download // Vue.prototype.download = download
Vue.prototype.handleTree = handleTree Vue.prototype.handleTree = handleTree
Vue.prototype.$getObjectName = (url) => { Vue.prototype.$getObjectName = (url) => {
// console.log(Vue.prototype.)
// console.log(url) // console.log(url)
var value = url var value = url
var str = value.split("//"); //https://进行分割, // var str = value.split("//"); //https://进行分割,
var index = str[1].indexOf("/")+1; //indexOf 获取第一个斜杠的索引, // var index = str[1].indexOf("/")+1; //indexOf 获取第一个斜杠的索引,
// console.log(str[1].substring(index)); //substring 截取, // // console.log(str[1].substring(index)); //substring 截取,
return '/' + str[1].substring(index) // return '/' + str[1].substring(index)
let basePath = Vue.prototype.OSSclientConfig.viewEndpoint;
let basePathHttp = Vue.prototype.OSSclientConfig.viewEndpoint.replace("https", 'http')
let arr = value.split(basePath);
let name = null;
if (arr.length > 1) {
name = arr[1];
} else {
name = value.split(basePathHttp)[1];
}
// console.log(name)
return name;
} }
Vue.prototype.getGuid = (text) => { Vue.prototype.getGuid = (text) => {
text = md5(text) text = md5(text)
@ -117,14 +129,14 @@ Vue.prototype.getGuid = (text) => {
t9 = text.substr(16, 4) t9 = text.substr(16, 4)
t10 = text.substr(20, 12) t10 = text.substr(20, 12)
// console.log(`${t4+t3+t2+t1}-${t6+t5}-${t8+t7}-${t9}-${t10}`) // console.log(`${t4+t3+t2+t1}-${t6+t5}-${t8+t7}-${t9}-${t10}`)
return `${t4+t3+t2+t1}-${t6+t5}-${t8+t7}-${t9}-${t10}` return `${t4 + t3 + t2 + t1}-${t6 + t5}-${t8 + t7}-${t9}-${t10}`
} }
Vue.prototype.$validatePassword = (rule, value, callback) => { Vue.prototype.$validatePassword = (rule, value, callback) => {
var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh' var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh'
/* eslint-disable */ /* eslint-disable */
var reg1 = eval(process.env.VUE_APP_PASSWORD_FOR_PERMISSION) ? new RegExp(`${process.env.VUE_APP_PASSWORD_FOR_REGULAR}`) : /.*/g; //密码必须是8位以上、必须含有字母、数字、特殊符号 var reg1 = eval(process.env.VUE_APP_PASSWORD_FOR_PERMISSION) ? new RegExp(`${process.env.VUE_APP_PASSWORD_FOR_REGULAR}`) : /.*/g; //密码必须是8位以上、必须含有字母、数字、特殊符号
if (!reg1.test(value)) { if (!reg1.test(value)) {
callback(lang==='zh' ? new Error("密码必须包含18 32 个字符2至少1个数字3) 至少1个大写字母4至少1个小写字母5至少1个特殊字符 (~!-@#$%^&*_+?)") : new Error('Passwords must have: 1) 8 - 32 characters; 2) At least 1 number; 3) At least 1 uppercase letter; 4) At least 1 lowercase letter; 5) At least 1 special character (~!-@#$%^&*_+?) ')) callback(lang === 'zh' ? new Error("密码必须包含18 32 个字符2至少1个数字3) 至少1个大写字母4至少1个小写字母5至少1个特殊字符 (~!-@#$%^&*_+?)") : new Error('Passwords must have: 1) 8 - 32 characters; 2) At least 1 number; 3) At least 1 uppercase letter; 4) At least 1 lowercase letter; 5) At least 1 special character (~!-@#$%^&*_+?) '))
} else { } else {
callback(); callback();
} }
@ -158,7 +170,7 @@ Vue.prototype.fileToBlob = (file) => {
} }
var _vm var _vm
async function VueInit () { async function VueInit() {
var params var params
var res var res
if (~window.location.href.indexOf('/readingDicoms') || ~window.location.href.indexOf('/noneDicomReading') || ~window.location.href.indexOf('/criterionquestions') || ~window.location.href.indexOf('/petct')) { if (~window.location.href.indexOf('/readingDicoms') || ~window.location.href.indexOf('/noneDicomReading') || ~window.location.href.indexOf('/criterionquestions') || ~window.location.href.indexOf('/petct')) {
@ -187,14 +199,14 @@ async function VueInit () {
}) })
let d = function (code) { let d = function (code) {
var dictInfo = res.Result var dictInfo = res.Result
var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh' var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh'
try { try {
for (var code in dictInfo) { for (var code in dictInfo) {
var dictList = (dictInfo[code] && dictInfo[code].length > 0) ? dictInfo[code].map(dict => { var dictList = (dictInfo[code] && dictInfo[code].length > 0) ? dictInfo[code].map(dict => {
return { return {
id: dict.Id, id: dict.Id,
label: lang==='zh' ? dict.ValueCN : dict.Value, label: lang === 'zh' ? dict.ValueCN : dict.Value,
value: dict.DataTypeEnum === 3 ? eval(dict.Code) : dict.IsEnumInt ? parseInt(dict.Code): dict.Code, value: dict.DataTypeEnum === 3 ? eval(dict.Code) : dict.IsEnumInt ? parseInt(dict.Code) : dict.Code,
raw: Object.assign({}, dict), raw: Object.assign({}, dict),
IsBaseLineUse: false, IsBaseLineUse: false,
IsFollowVisitUse: false IsFollowVisitUse: false
@ -202,7 +214,7 @@ async function VueInit () {
}) : [] }) : []
dictInfo[code] = dictList dictInfo[code] = dictList
} }
} catch (e){ } catch (e) {
console.error(e) console.error(e)
} }
return dictInfo return dictInfo
@ -220,17 +232,17 @@ async function VueInit () {
} catch (e) { } catch (e) {
} }
} }
Vue.prototype.$updateDictionary = function() { Vue.prototype.$updateDictionary = function () {
Vue.prototype.$d = function (code) { Vue.prototype.$d = function (code) {
var dictInfo = res.Result var dictInfo = res.Result
var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh' var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh'
try { try {
for (var code in dictInfo) { for (var code in dictInfo) {
var dictList = (dictInfo[code] && dictInfo[code].length > 0) ? dictInfo[code].map(dict => { var dictList = (dictInfo[code] && dictInfo[code].length > 0) ? dictInfo[code].map(dict => {
return { return {
id: dict.raw.Id, id: dict.raw.Id,
label: lang==='zh' ? dict.raw.ValueCN : dict.raw.Value, label: lang === 'zh' ? dict.raw.ValueCN : dict.raw.Value,
value: dict.raw.DataTypeEnum === 3 ? eval(dict.raw.Code) : dict.raw.IsEnumInt ? parseInt(dict.raw.Code): dict.raw.Code, value: dict.raw.DataTypeEnum === 3 ? eval(dict.raw.Code) : dict.raw.IsEnumInt ? parseInt(dict.raw.Code) : dict.raw.Code,
raw: Object.assign({}, dict.raw), raw: Object.assign({}, dict.raw),
IsBaseLineUse: false, IsBaseLineUse: false,
IsFollowVisitUse: false IsFollowVisitUse: false
@ -238,7 +250,7 @@ async function VueInit () {
}) : [] }) : []
_vm.$set(dictInfo, code, dictList) _vm.$set(dictInfo, code, dictList)
} }
} catch (e){ } catch (e) {
console.error(e) console.error(e)
} }
return dictInfo return dictInfo
@ -274,14 +286,14 @@ async function VueInit () {
let count = 0; let count = 0;
if (eval(process.env.VUE_APP_LOGIN_FOR_PERMISSION)) { if (eval(process.env.VUE_APP_LOGIN_FOR_PERMISSION)) {
setInterval(() => { setInterval(() => {
var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh' var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh'
if ( _vm.$route.path === '/ReviewersResearchForm' || _vm.$route.path === '/ReviewersResearch' || _vm.$route.path === '/login' || _vm.$route.path === '/researchForm' || _vm.$route.path === '/researchLogin' || _vm.$route.path === '/email-recompose' || _vm.$route.path === '/recompose' || _vm.$route.path === '/resetpassword' || _vm.$route.path === '/error') { if (_vm.$route.path === '/ReviewersResearchForm' || _vm.$route.path === '/ReviewersResearch' || _vm.$route.path === '/login' || _vm.$route.path === '/researchForm' || _vm.$route.path === '/researchLogin' || _vm.$route.path === '/email-recompose' || _vm.$route.path === '/recompose' || _vm.$route.path === '/resetpassword' || _vm.$route.path === '/error') {
return return
} }
if (_vm.$store.state.user.userId !== zzSessionStorage.getItem('userId')) { if (_vm.$store.state.user.userId !== zzSessionStorage.getItem('userId')) {
window.location.href = `/login` window.location.href = `/login`
zzSessionStorage.removeItem('lastWorkbench') zzSessionStorage.removeItem('lastWorkbench')
_vm.$alert(lang === 'en'? 'The same browser only allows one user account to be logged in at a time.' : '同一浏览器只允许同时登陆一个账户', { _vm.$alert(lang === 'en' ? 'The same browser only allows one user account to be logged in at a time.' : '同一浏览器只允许同时登陆一个账户', {
type: 'warning', type: 'warning',
}) })
} }
@ -295,10 +307,10 @@ async function VueInit () {
function countTime() { function countTime() {
count++ count++
localStorage.setItem('count', count) localStorage.setItem('count', count)
if (count == parseInt(second2) || isLock === 'true') { if (count == parseInt(second2) || isLock === 'true') {
callback2(); callback2();
} }
if (count >= second) { if (count >= second) {
callback(); callback();
count = 0; count = 0;
localStorage.removeItem('count') localStorage.removeItem('count')
@ -334,23 +346,23 @@ async function VueInit () {
/* eslint-disable */ /* eslint-disable */
window.VUE_APP_COMPANY_NAME = process.env.VUE_APP_COMPANY_NAME; window.VUE_APP_COMPANY_NAME = process.env.VUE_APP_COMPANY_NAME;
waitOperate(eval(process.env.VUE_APP_LOGOUT_FOR_PERMISSION) ? () => { waitOperate(eval(process.env.VUE_APP_LOGOUT_FOR_PERMISSION) ? () => {
var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh' var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh'
if ( _vm.$route.path === '/ReviewersResearchForm' || _vm.$route.path === '/ReviewersResearch' || _vm.$route.path === '/login' || _vm.$route.path === '/researchForm' || _vm.$route.path === '/researchLogin' || _vm.$route.path === '/email-recompose' || _vm.$route.path === '/recompose' || _vm.$route.path === '/resetpassword' || _vm.$route.path === '/error') { if (_vm.$route.path === '/ReviewersResearchForm' || _vm.$route.path === '/ReviewersResearch' || _vm.$route.path === '/login' || _vm.$route.path === '/researchForm' || _vm.$route.path === '/researchLogin' || _vm.$route.path === '/email-recompose' || _vm.$route.path === '/recompose' || _vm.$route.path === '/resetpassword' || _vm.$route.path === '/error') {
count = 0; count = 0;
localStorage.setItem('count', '0') localStorage.setItem('count', '0')
return return
} }
_vm.$store.dispatch('user/logout').then(res => { _vm.$store.dispatch('user/logout').then(res => {
window.location.href = `/login` window.location.href = `/login`
}) })
_vm.$alert(lang === 'zh' ? '由于您长时间未操作,为保护您的数据安全已强制将您下线,如果需要继续操作请重新登陆!' : 'No operation for a long time non-operation, you have been forced logout to protect data security. If continue to operate, please login again!', { _vm.$alert(lang === 'zh' ? '由于您长时间未操作,为保护您的数据安全已强制将您下线,如果需要继续操作请重新登陆!' : 'No operation for a long time non-operation, you have been forced logout to protect data security. If continue to operate, please login again!', {
type: 'warning', type: 'warning',
}) })
} : () => {}, process.env.VUE_APP_LOGOUT_FOR_TIME, } : () => { }, process.env.VUE_APP_LOGOUT_FOR_TIME,
eval(process.env.VUE_APP_LOCK_FOR_PERMISSION) ? () => { eval(process.env.VUE_APP_LOCK_FOR_PERMISSION) ? () => {
var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh' var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh'
if ( _vm.$route.path === '/ReviewersResearchForm' || _vm.$route.path === '/ReviewersResearch' || _vm.$route.path === '/login' || _vm.$route.path === '/researchForm' || _vm.$route.path === '/researchLogin' || _vm.$route.path === '/email-recompose' || _vm.$route.path === '/recompose' || _vm.$route.path === '/resetpassword' || _vm.$route.path === '/error') { if (_vm.$route.path === '/ReviewersResearchForm' || _vm.$route.path === '/ReviewersResearch' || _vm.$route.path === '/login' || _vm.$route.path === '/researchForm' || _vm.$route.path === '/researchLogin' || _vm.$route.path === '/email-recompose' || _vm.$route.path === '/recompose' || _vm.$route.path === '/resetpassword' || _vm.$route.path === '/error') {
count = 0; count = 0;
localStorage.setItem('count', '0') localStorage.setItem('count', '0')
if (_vm.$route.path === '/login') { if (_vm.$route.path === '/login') {
@ -405,14 +417,14 @@ async function VueInit () {
} }
} }
}, },
message: h('div', {} , [ message: h('div', {}, [
h('el-form', { h('el-form', {
props: { labelWidth: "80px" } props: { labelWidth: "80px" }
}, [ }, [
h('el-form-item', { h('el-form-item', {
props: {label: lang === 'zh' ? '用户名' : 'Username'}, props: { label: lang === 'zh' ? '用户名' : 'Username' },
}, [ }, [
h('input',{ h('input', {
props: { props: {
value: _vm.unlock.my_username value: _vm.unlock.my_username
}, },
@ -432,7 +444,7 @@ async function VueInit () {
}) })
]), ]),
h('el-form-item', { h('el-form-item', {
props: {label: lang === 'zh' ? '密码' : 'Password'}, props: { label: lang === 'zh' ? '密码' : 'Password' },
}, [ }, [
h('input', { h('input', {
props: { props: {
@ -457,7 +469,7 @@ async function VueInit () {
]) ])
]) ])
}) })
} : () => {}, process.env.VUE_APP_LOCK_FOR_TIME) } : () => { }, process.env.VUE_APP_LOCK_FOR_TIME)
} }
VueInit() VueInit()

View File

@ -181,12 +181,12 @@ const actions = {
// user logout // user logout
async logout({ commit, state }) { async logout({ commit, state }) {
try{ try{
await loginOut()
removeToken() // must remove token first removeToken() // must remove token first
resetRouter() resetRouter()
removeName() removeName()
zzSessionStorage.clear() zzSessionStorage.clear()
commit('RESET_STATE') commit('RESET_STATE')
await loginOut()
}catch(e){ }catch(e){
console.log(e) console.log(e)
} }

View File

@ -21,6 +21,7 @@ async function ossGenerateSTS() {
let res = await GetObjectStoreToken() let res = await GetObjectStoreToken()
Vue.prototype.OSSclientConfig = { ...res.Result[res.Result.ObjectStoreUse] } Vue.prototype.OSSclientConfig = { ...res.Result[res.Result.ObjectStoreUse] }
Vue.prototype.OSSclientConfig.basePath = Vue.prototype.OSSclientConfig.viewEndpoint Vue.prototype.OSSclientConfig.basePath = Vue.prototype.OSSclientConfig.viewEndpoint
console.log(Vue.prototype.OSSclientConfig.basePath)
switch (res.Result.ObjectStoreUse) { switch (res.Result.ObjectStoreUse) {
case 'AliyunOSS': case 'AliyunOSS':
Vue.prototype.OSSclientConfig.bucket = Vue.prototype.OSSclientConfig.bucketName Vue.prototype.OSSclientConfig.bucket = Vue.prototype.OSSclientConfig.bucketName
@ -40,7 +41,7 @@ async function ossGenerateSTS() {
if (res && res.url) { if (res && res.url) {
resolve({ resolve({
name: objectName, name: objectName,
url: Vue.prototype.OSSclientConfig.viewEndpoint + objectName url: res.url
}) })
} else { } else {
reject() reject()

View File

@ -6,7 +6,11 @@
:label="$t('system:loginLog:label:OptType')" :label="$t('system:loginLog:label:OptType')"
prop="OptType" prop="OptType"
> >
<el-select v-model="searchData.OptType" clearable style="width:120px;"> <el-select
v-model="searchData.OptType"
clearable
style="width: 120px"
>
<el-option <el-option
v-for="item of $d.UserOptType" v-for="item of $d.UserOptType"
:key="'UserOptType' + item.label" :key="'UserOptType' + item.label"
@ -15,15 +19,12 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="IP" prop="IP">
label="IP"
prop="IP"
>
<el-input <el-input
v-model="searchData.IP" v-model="searchData.IP"
size="small" size="small"
clearable clearable
style="width:120px;" style="width: 120px"
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
@ -34,12 +35,10 @@
v-model="searchData.LoginFaildName" v-model="searchData.LoginFaildName"
size="small" size="small"
clearable clearable
style="width:120px;" style="width: 120px"
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('system:loginLog:label:CreateTime')">
:label="$t('system:loginLog:label:CreateTime')"
>
<el-date-picker <el-date-picker
v-model="datetimerange" v-model="datetimerange"
type="datetimerange" type="datetimerange"
@ -55,22 +54,19 @@
size="mini" size="mini"
@click="getList" @click="getList"
> >
{{ $t('common:button:search') }} {{ $t("common:button:search") }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
v-loading="loading" v-loading="loading"
v-adaptive="{bottomOffset:45}" v-adaptive="{ bottomOffset: 45 }"
height="100" height="100"
:data="list" :data="list"
class="table" class="table"
@sort-change="handleSortByColumn" @sort-change="handleSortByColumn"
> >
<el-table-column <el-table-column type="index" width="50" />
type="index"
width="50"
/>
<el-table-column <el-table-column
:label="$t('system:loginLog:table:OptType')" :label="$t('system:loginLog:table:OptType')"
prop="OptType" prop="OptType"
@ -79,7 +75,7 @@
sortable="custom" sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ $fd('UserOptType',scope.row.OptType) }} {{ $fd("UserOptType", scope.row.OptType) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -89,6 +85,13 @@
sortable="custom" sortable="custom"
show-overflow-tooltip 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 <el-table-column
:label="$t('system:loginLog:table:LoginFaildName')" :label="$t('system:loginLog:table:LoginFaildName')"
prop="LoginFaildName" prop="LoginFaildName"
@ -111,7 +114,7 @@
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ $fd('UserType',scope.row.LoginUserTypeEnum) }} {{ $fd("UserType", scope.row.LoginUserTypeEnum) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -129,7 +132,7 @@
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ $fd('UserType',scope.row.OptUserTypeEnum) }} {{ $fd("UserType", scope.row.OptUserTypeEnum) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -140,7 +143,7 @@
show-overflow-tooltip show-overflow-tooltip
/> />
</el-table> </el-table>
<div class="pagination" style="text-align: right;margin-top:5px;"> <div class="pagination" style="text-align: right; margin-top: 5px">
<pagination <pagination
:total="total" :total="total"
:page.sync="searchData.PageIndex" :page.sync="searchData.PageIndex"
@ -148,27 +151,26 @@
@pagination="getList" @pagination="getList"
/> />
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { getUserLogList } from '@/api/user' import { getUserLogList } from "@/api/user";
import Pagination from '@/components/Pagination' import Pagination from "@/components/Pagination";
import moment from 'moment' import moment from "moment";
const searchDataDefault = () => { const searchDataDefault = () => {
return { return {
OptType: null, OptType: null,
Ip: '', Ip: "",
LoginFaildName: '', LoginFaildName: "",
BeginDate: '', BeginDate: "",
EndDate: '', EndDate: "",
Asc: false, Asc: false,
SortField: 'CreateTime', SortField: "CreateTime",
PageIndex: 1, PageIndex: 1,
PageSize: 20 PageSize: 20,
} };
} };
export default { export default {
components: { Pagination }, components: { Pagination },
data() { data() {
@ -178,76 +180,78 @@ export default {
list: [], list: [],
total: 0, total: 0,
loading: false, loading: false,
datetimerange: [] datetimerange: [],
} };
}, },
mounted() { mounted() {
this.getList() this.getList();
}, },
methods: { methods: {
getList() { getList() {
this.loading = true this.loading = true;
getUserLogList(this.searchData).then((res) => { getUserLogList(this.searchData)
this.loading = false .then((res) => {
this.list = res.Result.CurrentPageData this.loading = false;
this.total = res.Result.TotalCount this.list = res.Result.CurrentPageData;
}).catch(() => { this.total = res.Result.TotalCount;
this.loading = false })
}) .catch(() => {
this.loading = false;
});
}, },
handleDatetimeChange(val) { handleDatetimeChange(val) {
if (val) { if (val) {
this.searchData.BeginDate = val[0] this.searchData.BeginDate = val[0];
this.searchData.EndDate = val[1] this.searchData.EndDate = val[1];
} else { } else {
this.searchData.BeginDate = '' this.searchData.BeginDate = "";
this.searchData.EndDate = '' this.searchData.EndDate = "";
} }
}, },
// //
handleReset() { handleReset() {
this.searchData = searchDataDefault() this.searchData = searchDataDefault();
this.getList() this.getList();
}, },
// //
handleSortByColumn(column) { handleSortByColumn(column) {
if (column.order === 'ascending') { if (column.order === "ascending") {
this.searchData.Asc = true this.searchData.Asc = true;
} else { } else {
this.searchData.Asc = false this.searchData.Asc = false;
} }
this.searchData.SortField = column.prop this.searchData.SortField = column.prop;
this.searchData.PageIndex = 1 this.searchData.PageIndex = 1;
this.getList() this.getList();
},
},
};
</script>
<style lang="scss">
.log {
height: 100%;
box-sizing: border-box;
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;
} }
} }
} }
</script>
<style lang="scss">
.log {
height: 100%;
box-sizing: border-box;
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;
}
}
}
</style> </style>

View File

@ -29,7 +29,7 @@
:IsCanConnectInternet="IsCanConnectInternet" :IsCanConnectInternet="IsCanConnectInternet"
v-if="activeIndex === '2'" v-if="activeIndex === '2'"
/> />
<login-log v-if="activeIndex === '3'" :name="userName" :isMine="true" /> <login-log v-if="activeIndex === '3'" :id="userId" :isMine="true" />
</div> </div>
</div> </div>
</template> </template>

View File

@ -13,7 +13,7 @@
> >
<el-option <el-option
v-for="item of $d.UserOptType" v-for="item of $d.UserOptType"
v-show="item.value !== 3 && item.value !== 10" v-show="item.value !== 3 && item.value !== 10 && item.value !== 9"
:key="'UserOptType' + item.label" :key="'UserOptType' + item.label"
:value="item.value" :value="item.value"
:label="item.label" :label="item.label"
@ -45,12 +45,14 @@
prop="LoginUserName" prop="LoginUserName"
v-if="!isMine" v-if="!isMine"
> >
<el-input <el-select v-model="searchData.UserId" clearable style="width: 120px">
v-model="searchData.LoginUserName" <el-option
size="small" v-for="item of trialUserList"
clearable :key="item.UserId"
style="width: 120px" :value="item.UserId"
/> :label="item.UserName"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="$t('trials:loginLog:table:userType')" :label="$t('trials:loginLog:table:userType')"
@ -126,6 +128,13 @@
show-overflow-tooltip show-overflow-tooltip
sortable="custom" 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" v-if="!isMine"
:label="$t('trials:loginLog:table:incorrectUserName')" :label="$t('trials:loginLog:table:incorrectUserName')"
@ -156,7 +165,7 @@
v-if="!isMine" v-if="!isMine"
:label="$t('trials:loginLog:table:optUserName')" :label="$t('trials:loginLog:table:optUserName')"
prop="OptUserName" prop="OptUserName"
min-width="90" min-width="160"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> />
@ -164,7 +173,7 @@
v-if="!isMine" v-if="!isMine"
:label="$t('trials:loginLog:table:optUserType')" :label="$t('trials:loginLog:table:optUserType')"
prop="OptUserTypeEnum" prop="OptUserTypeEnum"
min-width="90" min-width="160"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
> >
@ -192,7 +201,7 @@
</BaseContainer> </BaseContainer>
</template> </template>
<script> <script>
import { getUserLogList } from "@/api/user"; import { getUserLogList, getTrialUserList } from "@/api/user";
import BaseContainer from "@/components/BaseContainer"; import BaseContainer from "@/components/BaseContainer";
import Pagination from "@/components/Pagination"; import Pagination from "@/components/Pagination";
import moment from "moment"; import moment from "moment";
@ -210,6 +219,7 @@ const searchDataDefault = () => {
SortField: "CreateTime", SortField: "CreateTime",
PageIndex: 1, PageIndex: 1,
PageSize: 20, PageSize: 20,
UserId: "",
}; };
}; };
export default { export default {
@ -219,7 +229,7 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
name: { id: {
type: String, type: String,
default: "", default: "",
}, },
@ -232,18 +242,35 @@ export default {
total: 0, total: 0,
loading: false, loading: false,
datetimerange: [], datetimerange: [],
trialUserList: [],
}; };
}, },
mounted() { mounted() {
console.log(this.$d.UserOptType); if (!this.isMine) {
this.getTrialUserList();
}
this.getList(); this.getList();
}, },
methods: { methods: {
//
async getTrialUserList() {
try {
let params = {
TrialId: this.$route.query.trialId,
};
let res = await getTrialUserList(params);
if (res.IsSuccess) {
this.trialUserList = res.Result;
}
} catch (err) {
console.log(err);
}
},
getList() { getList() {
this.loading = true; this.loading = true;
this.searchData.TrialId = this.$route.query.trialId; this.searchData.TrialId = this.$route.query.trialId;
if (this.isMine) { if (this.isMine) {
this.searchData.LoginUserName = this.name; this.searchData.UserId = this.id;
} }
getUserLogList(this.searchData) getUserLogList(this.searchData)
.then((res) => { .then((res) => {