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
})
}
// 获取登录用户
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'
// 窗口拖拽
Vue.use(dialogDrag)
if(!String.prototype.replaceAll){
String.prototype.replaceAll = function(str, newStr){
if (!String.prototype.replaceAll) {
String.prototype.replaceAll = function (str, newStr) {
// 正则表达式
if (Object.prototype.toString.call(str).toLowerCase() === '[object regexp]') {
return this.replace(str, newStr)
@ -96,12 +96,24 @@ Vue.prototype.selectDictLabel = selectDictLabel
// Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
Vue.prototype.$getObjectName = (url) => {
// console.log(Vue.prototype.)
// console.log(url)
var value = url
var str = value.split("//"); //https://进行分割,
var index = str[1].indexOf("/")+1; //indexOf 获取第一个斜杠的索引,
// console.log(str[1].substring(index)); //substring 截取,
return '/' + str[1].substring(index)
// var str = value.split("//"); //https://进行分割,
// var index = str[1].indexOf("/")+1; //indexOf 获取第一个斜杠的索引,
// // console.log(str[1].substring(index)); //substring 截取,
// 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) => {
text = md5(text)
@ -117,14 +129,14 @@ Vue.prototype.getGuid = (text) => {
t9 = text.substr(16, 4)
t10 = text.substr(20, 12)
// 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) => {
var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh'
var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh'
/* eslint-disable */
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)) {
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 {
callback();
}
@ -158,7 +170,7 @@ Vue.prototype.fileToBlob = (file) => {
}
var _vm
async function VueInit () {
async function VueInit() {
var params
var res
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) {
var dictInfo = res.Result
var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh'
var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh'
try {
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 {
id: dict.Id,
label: lang==='zh' ? dict.ValueCN : dict.Value,
value: dict.DataTypeEnum === 3 ? eval(dict.Code) : dict.IsEnumInt ? parseInt(dict.Code): dict.Code,
label: lang === 'zh' ? dict.ValueCN : dict.Value,
value: dict.DataTypeEnum === 3 ? eval(dict.Code) : dict.IsEnumInt ? parseInt(dict.Code) : dict.Code,
raw: Object.assign({}, dict),
IsBaseLineUse: false,
IsFollowVisitUse: false
@ -202,7 +214,7 @@ async function VueInit () {
}) : []
dictInfo[code] = dictList
}
} catch (e){
} catch (e) {
console.error(e)
}
return dictInfo
@ -220,17 +232,17 @@ async function VueInit () {
} catch (e) {
}
}
Vue.prototype.$updateDictionary = function() {
Vue.prototype.$updateDictionary = function () {
Vue.prototype.$d = function (code) {
var dictInfo = res.Result
var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh'
var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh'
try {
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 {
id: dict.raw.Id,
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,
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,
raw: Object.assign({}, dict.raw),
IsBaseLineUse: false,
IsFollowVisitUse: false
@ -238,7 +250,7 @@ async function VueInit () {
}) : []
_vm.$set(dictInfo, code, dictList)
}
} catch (e){
} catch (e) {
console.error(e)
}
return dictInfo
@ -274,14 +286,14 @@ async function VueInit () {
let count = 0;
if (eval(process.env.VUE_APP_LOGIN_FOR_PERMISSION)) {
setInterval(() => {
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') {
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') {
return
}
if (_vm.$store.state.user.userId !== zzSessionStorage.getItem('userId')) {
window.location.href = `/login`
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',
})
}
@ -295,10 +307,10 @@ async function VueInit () {
function countTime() {
count++
localStorage.setItem('count', count)
if (count == parseInt(second2) || isLock === 'true') {
if (count == parseInt(second2) || isLock === 'true') {
callback2();
}
if (count >= second) {
if (count >= second) {
callback();
count = 0;
localStorage.removeItem('count')
@ -334,23 +346,23 @@ async function VueInit () {
/* eslint-disable */
window.VUE_APP_COMPANY_NAME = process.env.VUE_APP_COMPANY_NAME;
waitOperate(eval(process.env.VUE_APP_LOGOUT_FOR_PERMISSION) ? () => {
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') {
count = 0;
localStorage.setItem('count', '0')
return
}
_vm.$store.dispatch('user/logout').then(res => {
window.location.href = `/login`
})
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') {
count = 0;
localStorage.setItem('count', '0')
return
}
_vm.$store.dispatch('user/logout').then(res => {
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!', {
type: 'warning',
})
} : () => {}, process.env.VUE_APP_LOGOUT_FOR_TIME,
_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',
})
} : () => { }, process.env.VUE_APP_LOGOUT_FOR_TIME,
eval(process.env.VUE_APP_LOCK_FOR_PERMISSION) ? () => {
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') {
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') {
count = 0;
localStorage.setItem('count', '0')
if (_vm.$route.path === '/login') {
@ -405,14 +417,14 @@ async function VueInit () {
}
}
},
message: h('div', {} , [
message: h('div', {}, [
h('el-form', {
props: { labelWidth: "80px" }
}, [
h('el-form-item', {
props: {label: lang === 'zh' ? '用户名' : 'Username'},
props: { label: lang === 'zh' ? '用户名' : 'Username' },
}, [
h('input',{
h('input', {
props: {
value: _vm.unlock.my_username
},
@ -432,7 +444,7 @@ async function VueInit () {
})
]),
h('el-form-item', {
props: {label: lang === 'zh' ? '密码' : 'Password'},
props: { label: lang === 'zh' ? '密码' : 'Password' },
}, [
h('input', {
props: {
@ -457,7 +469,7 @@ async function VueInit () {
])
])
})
} : () => {}, process.env.VUE_APP_LOCK_FOR_TIME)
} : () => { }, process.env.VUE_APP_LOCK_FOR_TIME)
}
VueInit()

View File

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

View File

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

View File

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

View File

@ -29,7 +29,7 @@
:IsCanConnectInternet="IsCanConnectInternet"
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>
</template>

View File

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