Compare commits
62 Commits
v1.8.0
...
4defa157ee
| Author | SHA1 | Date | |
|---|---|---|---|
| 4defa157ee | |||
| 13ba919484 | |||
| bf407a49fd | |||
| 3c50254a2d | |||
| 41ac3d562a | |||
| d790a95952 | |||
| 328359dfde | |||
| 1286cd1212 | |||
| f739563fe9 | |||
| 2f4ace45b8 | |||
| 407f0b85d2 | |||
| 3052b269e9 | |||
| a7c3bf09f8 | |||
| 65d9c7b711 | |||
| 3ca1e9d8ed | |||
| f27fda4a5f | |||
| 27352f572c | |||
| 47c6b30d4a | |||
| 91bd50d565 | |||
| d1ed8b39f0 | |||
| 3925652428 | |||
| 37f8f2fff1 | |||
| 32551e3faa | |||
| 43f99b02c4 | |||
| 9c22809bae | |||
| be9e78ec73 | |||
| d645df58c2 | |||
| 5d9adab706 | |||
| 291f9b5d66 | |||
| 5dedcbc2ef | |||
| 940a860352 | |||
| 9cd540d1ec | |||
| 9e8d537358 | |||
| 7882c9b631 | |||
| 5dd1935997 | |||
| 47d60769be | |||
| 8225eacb7e | |||
| 57a8bb4e24 | |||
| 36ffd8b371 | |||
| 7fc6f4494b | |||
| 9d3ba7eb57 | |||
| 7ed4dd7e24 | |||
| b233535d95 | |||
| 9bdb8f64b3 | |||
| f637f746cb | |||
| dec01d779d | |||
| 7363b0049d | |||
| a95a129dde | |||
| 177510643d | |||
| eeac5b76c4 | |||
| a17359a56e | |||
| 28c7cf7d67 | |||
| d9091fbb79 | |||
| 7e52005dab | |||
| 5866535fb5 | |||
| 862c6d64cc | |||
| 2c0c2e8111 | |||
| c24c98b334 | |||
| 97caeae753 | |||
| 6725f6e276 | |||
| 38ad4e72a2 | |||
| c9c4826274 |
@@ -5,3 +5,6 @@ npm install
|
||||
# 启动服务
|
||||
npm run dev
|
||||
|
||||
# v1.9.0修改
|
||||
1. 角色修改,全局userId实际意义修改为userRoleId(用户角色id),新增identityUserId(新的用户id)
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
</script>
|
||||
<% } else { %>
|
||||
<script>
|
||||
console.log(2)
|
||||
window.zzSessionStorage = {
|
||||
setItem: (item, value) => {
|
||||
return sessionStorage.setItem(item, value)
|
||||
|
||||
+21
-4
@@ -44,11 +44,19 @@ export function updateUser(param) {
|
||||
data: param
|
||||
})
|
||||
}
|
||||
|
||||
export function getUser(userId) {
|
||||
export function updateUserBasicInfo(param) {
|
||||
return request({
|
||||
url: `/user/getUser/${userId}`,
|
||||
method: 'get'
|
||||
url: `/user/updateUserBasicInfo`,
|
||||
method: 'put',
|
||||
data: param
|
||||
})
|
||||
}
|
||||
|
||||
export function getUser(params) {
|
||||
return request({
|
||||
url: `/user/getUser`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
@@ -317,3 +325,12 @@ export function useUserIDGetDoctorID(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 管理端修改用户角色
|
||||
export function updateUserRoleInfo(data) {
|
||||
return request({
|
||||
url: `/User/updateUserRoleInfo`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -251,3 +251,19 @@ export function uploadOCTLipidAngleTemplate(param) {
|
||||
data: param
|
||||
})
|
||||
}
|
||||
|
||||
export function saveTableQuestionMark(param) {
|
||||
return request({
|
||||
url: `/ReadingImageTask/saveTableQuestionMark`,
|
||||
method: 'post',
|
||||
data: param
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteTableQuestionMark(param) {
|
||||
return request({
|
||||
url: `/ReadingImageTask/deleteTableQuestionMark`,
|
||||
method: 'post',
|
||||
data: param
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3914,4 +3914,21 @@ export function getVisitClinicalDataName(data) {
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 修改外部人员权限配置
|
||||
export function configTrialSPMInfo(data) {
|
||||
return request({
|
||||
url: `/TrialConfig/configTrialSPMInfo`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 项目添加角色修改权限
|
||||
export function updateTrialUserRole(data) {
|
||||
return request({
|
||||
url: `/TrialMaintenance/updateTrialUserRole`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
@@ -193,3 +193,19 @@ export function getPublicKey() {
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
// 登陆获取角色
|
||||
export function getUserLoginRoleList(data) {
|
||||
return request({
|
||||
url: `/User/getUserLoginRoleList`,
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
// 登陆角色id获取token
|
||||
export function loginSelectUserRole(params) {
|
||||
return request({
|
||||
url: `/User/loginSelectUserRole`,
|
||||
method: 'get',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -120,6 +120,7 @@
|
||||
v-if="item.type === 'Daterange'"
|
||||
v-model="searchData[item.prop]"
|
||||
type="datetimerange"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
:range-separator="$t('baseForm:daterange:rangeSeparator')"
|
||||
:start-placeholder="$t('baseForm:daterange:startPlaceholder')"
|
||||
:end-placeholder="$t('baseForm:daterange:startendPlaceholder')"
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
:show-overflow-tooltip="column.showOverflowTooltip || false"
|
||||
:sortable="column.sortable || false"
|
||||
:prop="column.prop"
|
||||
:fixed="column.fixed"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<!-- 仅仅显示文字 -->
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-if="visible"
|
||||
:visible.sync="visible"
|
||||
v-dialogDrag
|
||||
width="540px"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
append-to-body
|
||||
:title="$t('toggleRole:tip:title')"
|
||||
center
|
||||
top="30vh"
|
||||
:show-close="false"
|
||||
:before-close="cancel"
|
||||
>
|
||||
<template v-if="hasRole">
|
||||
<el-radio-group v-model="form.userRoleId" class="roles">
|
||||
<el-radio
|
||||
v-for="item in roles"
|
||||
:key="item.Id"
|
||||
:label="item.Id"
|
||||
:disabled="item.IsUserRoleDisabled"
|
||||
style="margin-bottom: 10px"
|
||||
>
|
||||
{{ item.UserTypeShortName }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
|
||||
<div v-else style="text-align: center">
|
||||
{{ $t('toggleRole:tip:noRole') }}
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<!-- 取消 -->
|
||||
<el-button size="small" @click="cancel()">
|
||||
{{ $t('common:button:cancel') }}
|
||||
</el-button>
|
||||
<!-- 保存 -->
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="save"
|
||||
:disabled="saveDisabled"
|
||||
:loading="loading"
|
||||
v-if="hasRole"
|
||||
>
|
||||
{{ $t('common:button:confirm') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'toggleRole',
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
userRoleId: null,
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.form.userRoleId = zzSessionStorage.getItem('userId')
|
||||
},
|
||||
computed: {
|
||||
roles() {
|
||||
return this.$store.state.user.roles
|
||||
},
|
||||
hasRole() {
|
||||
return this.roles && this.roles.length > 0
|
||||
},
|
||||
saveDisabled() {
|
||||
return this.form.userRoleId === zzSessionStorage.getItem('userId')
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.$emit('update:visible', false)
|
||||
this.$emit('cancel')
|
||||
},
|
||||
async save() {
|
||||
try {
|
||||
if (!this.form.userRoleId)
|
||||
return this.$message.warning(this.$t('toggleRole:ruleMessage:select'))
|
||||
this.$emit('save', this.form.userRoleId)
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.roles {
|
||||
max-width: 365px;
|
||||
width: fit-content;
|
||||
display: flex;
|
||||
align-content: center;
|
||||
// justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
/deep/ .el-radio__original {
|
||||
display: none !important; /* 隐藏原生 radio 输入,但仍然允许交互 */
|
||||
}
|
||||
|
||||
/deep/.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled)
|
||||
.el-radio__inner {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
.el-radio {
|
||||
width: 60px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,5 @@
|
||||
import { SubjectCheckConfig } from './module/Subject'
|
||||
|
||||
console.log(SubjectCheckConfig.moduleType)
|
||||
export const checkConfig = {
|
||||
ModuleType: {
|
||||
...SubjectCheckConfig.ModuleType
|
||||
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
...mapGetters(['sidebar', 'name', 'device'])
|
||||
},
|
||||
created() {
|
||||
this.isReviewer = JSON.parse(zzSessionStorage.getItem('IsReviewer'))
|
||||
// this.isReviewer = JSON.parse(zzSessionStorage.getItem('IsReviewer'))
|
||||
},
|
||||
methods: {
|
||||
...mapMutations({ setLanguage: 'lang/setLanguage' }),
|
||||
|
||||
@@ -293,6 +293,7 @@ async function VueInit() {
|
||||
}()
|
||||
_vm.$forceUpdate()
|
||||
}
|
||||
Vue.prototype.$EventBus = new Vue()
|
||||
Vue.prototype.$path = []
|
||||
var t = function (key) {
|
||||
if (!~Vue.prototype.$path.indexOf(key)) {
|
||||
|
||||
+3
-1
@@ -1,4 +1,5 @@
|
||||
import router from './router'
|
||||
import { resetRouter } from '@/router'
|
||||
import store from './store'
|
||||
// import { Message } from 'element-ui'
|
||||
import NProgress from 'nprogress'
|
||||
@@ -26,7 +27,6 @@ router.beforeEach(async (to, from, next) => {
|
||||
to.query.trialId !==
|
||||
store.state.trials.config.trialId
|
||||
) {
|
||||
console.log(to.query.path)
|
||||
let res = await getTrialExtralConfig({
|
||||
TrialId: to.query.trialId,
|
||||
})
|
||||
@@ -79,7 +79,9 @@ router.beforeEach(async (to, from, next) => {
|
||||
try {
|
||||
// 获取用户信息
|
||||
await store.dispatch('user/getInfo')
|
||||
await store.dispatch('user/getUserInfo')
|
||||
const accessRoutes = await store.dispatch('permission/generateRoutes')
|
||||
resetRouter()
|
||||
router.addRoutes(accessRoutes)
|
||||
next({ ...to, replace: true })
|
||||
} catch (error) {
|
||||
|
||||
@@ -3,10 +3,12 @@ const getters = {
|
||||
device: state => state.app.device,
|
||||
token: state => state.user.token,
|
||||
name: state => state.user.name,
|
||||
userTypeShortName: state => state.user.userTypeShortName,
|
||||
permissions: state => state.user.permissions,
|
||||
tree: state => state.user.tree,
|
||||
userName: state => state.user.userName,
|
||||
userId: state => state.user.userId,
|
||||
identityUserId: state => state.user.identityUserId,
|
||||
routes: state => state.permission.routes,
|
||||
asyncRoutes: state => state.permission.addRoutes,
|
||||
visitedViews: state => state.tagsView.visitedViews,
|
||||
|
||||
@@ -70,6 +70,12 @@ function getQuestions(questions) {
|
||||
answerObj.angle = angle
|
||||
answerObj.saveTypeEnum = isNaN(parseFloat(angle)) ? 1 : 2
|
||||
}
|
||||
} else if (criterionType === 21) {
|
||||
// MRI-PDFF
|
||||
let isMeasurable = getQuestionAnswer(item.TableQuestions.Questions, 1105, answerObj)
|
||||
answerObj.isMeasurable = isMeasurable
|
||||
answerObj.mean = getQuestionAnswer(item.TableQuestions.Questions, 1104, answerObj)
|
||||
answerObj.saveTypeEnum = isNaN(parseFloat(isMeasurable)) ? 1 : 2
|
||||
} else {
|
||||
answerObj.lesionPart = getQuestionAnswer(item.TableQuestions.Questions, 8, answerObj)
|
||||
answerObj.loctation = getQuestionAnswer(item.TableQuestions.Questions, 6, answerObj)
|
||||
@@ -507,6 +513,7 @@ const actions = {
|
||||
})
|
||||
},
|
||||
getMeasuredData({ state }, visitTaskId) {
|
||||
console.log('getMeasuredData')
|
||||
return new Promise(resolve => {
|
||||
var index = state.visitTaskList.findIndex(i => i.VisitTaskId === visitTaskId)
|
||||
if (state.visitTaskList[index].measureDataInit) {
|
||||
@@ -523,6 +530,13 @@ const actions = {
|
||||
el.OtherMeasureData = JSON.parse(el.OtherMeasureData)
|
||||
el.OtherMeasureData.data.remark = el.OrderMarkName
|
||||
}
|
||||
// if (el.TableQuestionMarkList.length > 0) {
|
||||
// let list = el.TableQuestionMarkList.map(i=>{
|
||||
// i.MeasureData = i.MeasureData ? JSON.parse(i.MeasureData) : ''
|
||||
// return i
|
||||
// })
|
||||
// el.TableQuestionMarkList = list
|
||||
// }
|
||||
arr.push(el)
|
||||
})
|
||||
state.visitTaskList[index].MeasureData = arr
|
||||
@@ -606,6 +620,13 @@ const actions = {
|
||||
el.MeasureData = JSON.parse(el.MeasureData)
|
||||
el.MeasureData.data.remark = el.OrderMarkName
|
||||
}
|
||||
// if (el.TableQuestionMarkList.length > 0) {
|
||||
// let list = el.TableQuestionMarkList.map(i=>{
|
||||
// i.MeasureData = i.MeasureData ? JSON.parse(i.MeasureData) : ''
|
||||
// return i
|
||||
// })
|
||||
// el.TableQuestionMarkList = list
|
||||
// }
|
||||
arr.push(el)
|
||||
})
|
||||
state.visitTaskList[index].MeasureData = arr
|
||||
@@ -623,27 +644,40 @@ const actions = {
|
||||
resolve(noneDicomMeasureData)
|
||||
})
|
||||
},
|
||||
addMeasuredData({ state }, obj) {
|
||||
addMeasuredData({ state }, obj) {
|
||||
return new Promise(resolve => {
|
||||
const criterionType = parseInt(localStorage.getItem('CriterionType'))
|
||||
var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
|
||||
var measureData = state.visitTaskList[index].MeasureData
|
||||
// var idx = measureData.findIndex(item => item.MeasureData.uuid === obj.data.MeasureData.data.uuid)
|
||||
var idx = measureData.findIndex(item => item.QuestionId === obj.data.QuestionId && item.RowIndex === obj.data.RowIndex)
|
||||
if (idx > -1) {
|
||||
for (const k in state.visitTaskList[index].MeasureData[idx]) {
|
||||
if (k !== 'Id' && obj.data[k]) {
|
||||
state.visitTaskList[index].MeasureData[idx][k] = obj.data[k]
|
||||
|
||||
if (criterionType === 21) {
|
||||
let i = measureData.findIndex(i=>i.TableQuestionId === obj.data.TableQuestionId)
|
||||
if (i > -1) {
|
||||
for (const k in state.visitTaskList[index].MeasureData[i]) {
|
||||
if (k !== 'Id' && obj.data[k]) {
|
||||
state.visitTaskList[index].MeasureData[i][k] = obj.data[k]
|
||||
}
|
||||
}
|
||||
} else {
|
||||
state.visitTaskList[index].MeasureData.push(obj.data)
|
||||
}
|
||||
|
||||
// state.visitTaskList[index].MeasureData[idx].MeasureData = obj.data.MeasureData
|
||||
console.log('更新标记成功', idx)
|
||||
} else {
|
||||
state.visitTaskList[index].MeasureData.push(obj.data)
|
||||
console.log('新增标记成功')
|
||||
var idx = measureData.findIndex(item => item.QuestionId === obj.data.QuestionId && item.RowIndex === obj.data.RowIndex)
|
||||
if (idx > -1) {
|
||||
for (const k in state.visitTaskList[index].MeasureData[idx]) {
|
||||
if (k !== 'Id' && obj.data[k]) {
|
||||
state.visitTaskList[index].MeasureData[idx][k] = obj.data[k]
|
||||
}
|
||||
}
|
||||
console.log('更新标记成功', idx)
|
||||
} else {
|
||||
state.visitTaskList[index].MeasureData.push(obj.data)
|
||||
console.log('新增标记成功')
|
||||
}
|
||||
}
|
||||
|
||||
// sessionStorage.setItem('visitTaskList', state.visitTaskList.length > 0 ? JSON.stringify(state.visitTaskList) : '')
|
||||
console.log(state.visitTaskList)
|
||||
resolve()
|
||||
})
|
||||
},
|
||||
@@ -738,32 +772,45 @@ const actions = {
|
||||
return new Promise(resolve => {
|
||||
var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
|
||||
var measureData = state.visitTaskList[index].MeasureData
|
||||
|
||||
// var uuid = obj.measureData.data.uuid
|
||||
// var idx = measureData.findIndex(item => item.MeasureData && item.MeasureData.data && item.MeasureData.data.uuid === uuid)
|
||||
var idx = measureData.findIndex(item => item.QuestionId === obj.questionId && item.RowIndex === obj.rowIndex)
|
||||
if (idx > -1) {
|
||||
if (measureData[idx].FristAddTaskId) {
|
||||
measureData[idx].MeasureData = ''
|
||||
console.log('清除标记成功', idx)
|
||||
} else {
|
||||
measureData.splice(idx, 1)
|
||||
console.log('移除标记成功', idx)
|
||||
}
|
||||
state.visitTaskList[index].MeasureData = measureData
|
||||
} else if (obj.orderMarkName) {
|
||||
const criterionType = parseInt(localStorage.getItem('CriterionType'))
|
||||
if (criterionType === 21) {
|
||||
const i = measureData.findIndex(item => item.QuestionId === obj.questionId && item.OrderMarkName === obj.orderMarkName)
|
||||
if (i > -1) {
|
||||
if (measureData[i].FristAddTaskId) {
|
||||
measureData[i].MeasureData = ''
|
||||
console.log('清除标记成功', i)
|
||||
} else {
|
||||
measureData.splice(i, 1)
|
||||
console.log('移除标记成功', i)
|
||||
if (i > -1) {
|
||||
if (measureData[i].FristAddTaskId) {
|
||||
measureData[i].MeasureData = ''
|
||||
console.log('清除标记成功', i)
|
||||
} else {
|
||||
measureData.splice(i, 1)
|
||||
console.log('移除标记成功', i)
|
||||
}
|
||||
}
|
||||
}
|
||||
state.visitTaskList[index].MeasureData = measureData
|
||||
} else {
|
||||
var idx = measureData.findIndex(item => item.QuestionId === obj.questionId && item.RowIndex === obj.rowIndex)
|
||||
if (idx > -1) {
|
||||
if (measureData[idx].FristAddTaskId) {
|
||||
measureData[idx].MeasureData = ''
|
||||
console.log('清除标记成功', idx)
|
||||
} else {
|
||||
measureData.splice(idx, 1)
|
||||
console.log('移除标记成功', idx)
|
||||
}
|
||||
state.visitTaskList[index].MeasureData = measureData
|
||||
} else if (obj.orderMarkName) {
|
||||
const i = measureData.findIndex(item => item.QuestionId === obj.questionId && item.OrderMarkName === obj.orderMarkName)
|
||||
if (i > -1) {
|
||||
if (measureData[i].FristAddTaskId) {
|
||||
measureData[i].MeasureData = ''
|
||||
console.log('清除标记成功', i)
|
||||
} else {
|
||||
measureData.splice(i, 1)
|
||||
console.log('移除标记成功', i)
|
||||
}
|
||||
}
|
||||
state.visitTaskList[index].MeasureData = measureData
|
||||
}
|
||||
}
|
||||
|
||||
// if (idx > -1) {
|
||||
// measureData.splice(idx, 1)
|
||||
|
||||
@@ -1034,7 +1081,7 @@ const actions = {
|
||||
}
|
||||
},
|
||||
setImageloadedInfo({ state }, obj) {
|
||||
console.log('setImageloadedInfo', obj)
|
||||
// console.log('setImageloadedInfo', obj)
|
||||
// if(obj.instance === '20dd8fc9-51b0-ec63-942b-cb3006c72650')
|
||||
// var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
|
||||
// // const prefetchInstanceCount = state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].prefetchInstanceCount
|
||||
|
||||
+110
-22
@@ -1,5 +1,6 @@
|
||||
import { getToken, setToken, removeToken, setName, removeName } from '@/utils/auth'
|
||||
import { login, loginOut, getUserMenuTree, getUserPermissions } from '@/api/user'
|
||||
import { login, loginOut, getUserMenuTree, getUserPermissions, getUserLoginRoleList, loginSelectUserRole } from '@/api/user'
|
||||
import { getUser } from '@/api/admin'
|
||||
|
||||
import { resetRouter } from '@/router'
|
||||
import md5 from 'js-md5'
|
||||
@@ -7,8 +8,10 @@ const getDefaultState = () => {
|
||||
return {
|
||||
token: getToken(),
|
||||
name: '',
|
||||
userTypeShortName: "",
|
||||
userName: '',
|
||||
userId: '',
|
||||
identityUserId: '',
|
||||
avatar: '',
|
||||
permissions: [],
|
||||
tree: [],
|
||||
@@ -16,13 +19,17 @@ const getDefaultState = () => {
|
||||
TotalNeedSignSystemDocCount: eval(process.env.VUE_APP_WORD_FOR_PERMISSION) ? null : 0,
|
||||
TotalNeedSignTrialDocCount: eval(process.env.VUE_APP_WORD_FOR_PERMISSION) ? null : 0,
|
||||
TrialStatusStr: null,
|
||||
isTestUser: false
|
||||
isTestUser: false,
|
||||
roles: []
|
||||
}
|
||||
}
|
||||
|
||||
const state = getDefaultState()
|
||||
|
||||
const mutations = {
|
||||
SET_ROLES: (state, roles) => {
|
||||
state.roles = roles
|
||||
},
|
||||
RESET_STATE: (state) => {
|
||||
Object.assign(state, getDefaultState())
|
||||
},
|
||||
@@ -34,6 +41,9 @@ const mutations = {
|
||||
SET_NAME: (state, name) => {
|
||||
state.name = name
|
||||
},
|
||||
SET_USERTYPESHORTNAME: (state, userTypeShortName) => {
|
||||
state.userTypeShortName = userTypeShortName
|
||||
},
|
||||
SET_USERNAME: (state, name) => {
|
||||
state.userName = name
|
||||
},
|
||||
@@ -49,6 +59,9 @@ const mutations = {
|
||||
SET_USERID: (state, id) => {
|
||||
state.userId = id
|
||||
},
|
||||
SET_IDENTITYUSERID: (state, id) => {
|
||||
state.identityUserId = id
|
||||
},
|
||||
SET_ISTESTUSER: (state, isTestUser) => {
|
||||
state.isTestUser = eval(isTestUser)
|
||||
},
|
||||
@@ -78,6 +91,9 @@ const mutations = {
|
||||
}
|
||||
|
||||
const actions = {
|
||||
setRoles({ commit }, roles) {
|
||||
commit('SET_ROLES', roles)
|
||||
},
|
||||
changeUserName({ commit }, userName) {
|
||||
commit('SET_USERNAME', userName)
|
||||
},
|
||||
@@ -91,7 +107,7 @@ const actions = {
|
||||
if (UserId) {
|
||||
data.UserId = UserId;
|
||||
}
|
||||
login(data).then(async response => {
|
||||
getUserLoginRoleList(data).then(async response => {
|
||||
if (response.IsSuccess) {
|
||||
zzSessionStorage.removeItem('lastWorkbench')
|
||||
zzSessionStorage.setItem('my_username', username.trim())
|
||||
@@ -99,6 +115,7 @@ const actions = {
|
||||
zzSessionStorage.setItem('my_EMail', response.Result.BasicInfo.EMail)
|
||||
localStorage.setItem('CompanyInfo', JSON.stringify(response.Result.CompanyInfo))
|
||||
const data = response.Result
|
||||
commit('SET_ROLES', data.BasicInfo.AccountList)
|
||||
if (data.BasicInfo.IsFirstAdd || data.BasicInfo.LoginState === 1) {
|
||||
try {
|
||||
zzSessionStorage.setItem('userId', data.BasicInfo.Id)
|
||||
@@ -114,25 +131,24 @@ const actions = {
|
||||
zzSessionStorage.setItem('IsReviewer', data.BasicInfo.IsReviewer)
|
||||
zzSessionStorage.setItem('userName', data.BasicInfo.UserName)
|
||||
commit('SET_TOKEN', data.JWTStr)
|
||||
commit('SET_NAME', data.BasicInfo.RealName)
|
||||
zzSessionStorage.setItem('realName', data.BasicInfo.RealName)
|
||||
// commit('SET_NAME', data.BasicInfo.UserName)
|
||||
zzSessionStorage.setItem('isTestUser', data.BasicInfo.IsTestUser)
|
||||
commit('SET_ISTESTUSER', data.BasicInfo.IsTestUser)
|
||||
commit('SET_USERNAME', data.BasicInfo.UserName)
|
||||
commit('SET_USERID', data.BasicInfo.Id)
|
||||
setToken(data.JWTStr)
|
||||
setName(data.BasicInfo.RealName)
|
||||
// setName(data.BasicInfo.RealName)
|
||||
const userString = decodeURIComponent(escape(window.atob(data.JWTStr.split('.')[1].replace(/-/g, '+').replace(/_/g, '/'))))
|
||||
const user = JSON.parse(userString)
|
||||
zzSessionStorage.setItem('userTypeShortName', user.userTypeShortName)
|
||||
zzSessionStorage.setItem('userId', user.id)
|
||||
// zzSessionStorage.setItem('userId', user.identityUserId)
|
||||
commit('SET_IDENTITYUSERID', user.identityUserId)
|
||||
zzSessionStorage.setItem('identityUserId', user.identityUserId)
|
||||
zzSessionStorage.setItem('userTypeEnumInt', user.userTypeEnumInt)
|
||||
var permissions = await getUserPermissions()
|
||||
var menuTree = await getUserMenuTree()
|
||||
commit('SET_TREE', menuTree.Result)
|
||||
commit('SET_PERMISSIONS', permissions.Result)
|
||||
zzSessionStorage.setItem('newTree', JSON.stringify(menuTree.Result))
|
||||
zzSessionStorage.setItem('permissions', JSON.stringify(permissions.Result))
|
||||
// var permissions = await getUserPermissions()
|
||||
// var menuTree = await getUserMenuTree()
|
||||
// commit('SET_TREE', menuTree.Result)
|
||||
// commit('SET_PERMISSIONS', permissions.Result)
|
||||
// zzSessionStorage.setItem('newTree', JSON.stringify(menuTree.Result))
|
||||
// zzSessionStorage.setItem('permissions', JSON.stringify(permissions.Result))
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
@@ -146,6 +162,48 @@ const actions = {
|
||||
})
|
||||
})
|
||||
},
|
||||
loginByRole({ commit }, userInfo) {
|
||||
const { userRoleId } = userInfo
|
||||
let params = {
|
||||
userRoleId
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
loginSelectUserRole(params).then(async response => {
|
||||
if (response.IsSuccess) {
|
||||
const data = response.Result
|
||||
|
||||
try {
|
||||
commit('SET_TOKEN', data)
|
||||
setToken(data)
|
||||
commit('SET_USERID', userRoleId)
|
||||
zzSessionStorage.setItem('userId', userRoleId)
|
||||
const userString = decodeURIComponent(escape(window.atob(data.split('.')[1].replace(/-/g, '+').replace(/_/g, '/'))))
|
||||
const user = JSON.parse(userString)
|
||||
zzSessionStorage.setItem('userTypeShortName', user.userTypeShortName)
|
||||
commit('SET_USERTYPESHORTNAME', user.userTypeShortName)
|
||||
commit('SET_NAME', user.fullName)
|
||||
setName(user.fullName)
|
||||
var permissions = await getUserPermissions()
|
||||
var menuTree = await getUserMenuTree()
|
||||
commit('SET_TREE', menuTree.Result)
|
||||
commit('SET_PERMISSIONS', permissions.Result)
|
||||
zzSessionStorage.setItem('newTree', JSON.stringify(menuTree.Result))
|
||||
zzSessionStorage.setItem('permissions', JSON.stringify(permissions.Result))
|
||||
zzSessionStorage.removeItem('lastWorkbench')
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
resolve(response.Result)
|
||||
|
||||
} else {
|
||||
reject(response.ErrorMessage)
|
||||
}
|
||||
}).catch(() => {
|
||||
reject()
|
||||
})
|
||||
})
|
||||
},
|
||||
setTree({ commit }, tree) {
|
||||
commit('SET_TREE', tree)
|
||||
},
|
||||
@@ -170,28 +228,43 @@ const actions = {
|
||||
commit('SET_PERMISSIONS', JSON.parse(zzSessionStorage.getItem('permissions')))
|
||||
commit('SET_ISTESTUSER', zzSessionStorage.getItem('isTestUser'))
|
||||
const user = JSON.parse(userString)
|
||||
commit('SET_NAME', zzSessionStorage.getItem('realName'))
|
||||
commit('SET_USERID', user.id)
|
||||
commit('SET_NAME', zzSessionStorage.getItem('Name'))
|
||||
commit('SET_USERTYPESHORTNAME', user.userTypeShortName)
|
||||
commit('SET_IDENTITYUSERID', user.identityUserId)
|
||||
commit('SET_USERID', user.userRoleId)
|
||||
commit('SET_USERNAME', zzSessionStorage.getItem('userName'))
|
||||
commit('SET_NEED_SIGN_SYSTEM_DOC_COUNT', parseInt(zzSessionStorage.getItem('TotalNeedSignSystemDocCount')))
|
||||
commit('SET_NEED_SIGN_TRIALS_DOC_COUNT', parseInt(zzSessionStorage.getItem('TotalNeedSignTrialDocCount')))
|
||||
console.log(zzSessionStorage.getItem('TotalNeedSignSystemDocCount'))
|
||||
console.log(zzSessionStorage.getItem('TotalNeedSignTrialDocCount'))
|
||||
// console.log(zzSessionStorage.getItem('TotalNeedSignSystemDocCount'))
|
||||
// console.log(zzSessionStorage.getItem('TotalNeedSignTrialDocCount'))
|
||||
zzSessionStorage.setItem('userName', user.name)
|
||||
zzSessionStorage.setItem('userId', user.id)
|
||||
zzSessionStorage.setItem('userId', user.userRoleId)
|
||||
zzSessionStorage.setItem('identityUserId', user.identityUserId)
|
||||
zzSessionStorage.setItem('userTypeShortName', user.userTypeShortName)
|
||||
zzSessionStorage.setItem('userTypeEnumInt', user.userTypeEnumInt)
|
||||
return user
|
||||
},
|
||||
updateInfo({ commit, state }) {
|
||||
commit('SET_NAME', zzSessionStorage.getItem('realName'))
|
||||
commit('SET_NAME', zzSessionStorage.getItem('Name'))
|
||||
},
|
||||
// 获取用户信息
|
||||
getUserInfo({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
getUser().then(res => {
|
||||
commit('SET_ROLES', res.Result.AccountList)
|
||||
resolve(res.Result)
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
},
|
||||
// user logout
|
||||
async logout({ commit, state }) {
|
||||
try {
|
||||
removeToken() // must remove token first
|
||||
await loginOut({
|
||||
Userd: zzSessionStorage.getItem('userId')
|
||||
UserRoleId: zzSessionStorage.getItem('userId'),
|
||||
IdentityUserId: zzSessionStorage.getItem('identityUserId'),
|
||||
})
|
||||
resetRouter()
|
||||
removeName()
|
||||
@@ -201,6 +274,21 @@ const actions = {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async resetData({ commit, state }) {
|
||||
try {
|
||||
removeToken() // must remove token first
|
||||
// await loginOut({
|
||||
// UserRoleId: zzSessionStorage.getItem('userId'),
|
||||
// IdentityUserId: zzSessionStorage.getItem('identityUserId'),
|
||||
// })
|
||||
resetRouter()
|
||||
removeName()
|
||||
zzSessionStorage.clear()
|
||||
commit('RESET_STATE')
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
setToken({ commit }, token) {
|
||||
commit('SET_TOKEN', token)
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
:model="user"
|
||||
:rules="userFormRules"
|
||||
label-width="150px"
|
||||
style="width:800px;"
|
||||
style="width: 800px"
|
||||
>
|
||||
<el-card class="Basic" shadow="never" size="small">
|
||||
<div slot="header" class="clearfix">
|
||||
@@ -25,7 +25,7 @@
|
||||
<el-form-item label="Given Name: " prop="FirstName">
|
||||
<el-input v-model="user.FirstName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Gender: " prop="Sex" style="margin-right:40px;">
|
||||
<el-form-item label="Gender: " prop="Sex" style="margin-right: 40px">
|
||||
<el-radio-group v-model="user.Sex">
|
||||
<el-radio :label="1">Male</el-radio>
|
||||
<el-radio :label="0">Female</el-radio>
|
||||
@@ -37,13 +37,24 @@
|
||||
<el-form-item label="Phone: " prop="Phone">
|
||||
<el-input v-model="user.Phone" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="type==1" label="Disable:">
|
||||
<el-switch v-model="user.Status" :active-value="0" :inactive-value="1" />
|
||||
<el-form-item v-if="type == 1" label="Disable:">
|
||||
<el-switch
|
||||
v-model="user.Status"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="User Type: " prop="UserTypeId">
|
||||
<el-select ref="userType" v-model="user.UserTypeId" size="small" placeholder="Please select" style="width:100%;" :disabled="user.CanEditUserType === false">
|
||||
<el-select
|
||||
ref="userType"
|
||||
v-model="user.UserTypeId"
|
||||
size="small"
|
||||
placeholder="Please select"
|
||||
style="width: 100%"
|
||||
:disabled="user.CanEditUserType === false"
|
||||
>
|
||||
<el-option
|
||||
v-for="(userType,key) of userTypeOptions"
|
||||
v-for="(userType, key) of userTypeOptions"
|
||||
:key="key"
|
||||
:label="userType.UserType"
|
||||
:value="userType.Id"
|
||||
@@ -52,17 +63,28 @@
|
||||
</el-form-item>
|
||||
</el-card>
|
||||
|
||||
<el-card class="Affiliation" shadow="never" style="margin-top:10px;" size="small">
|
||||
<el-card
|
||||
class="Affiliation"
|
||||
shadow="never"
|
||||
style="margin-top: 10px"
|
||||
size="small"
|
||||
>
|
||||
<div slot="header" class="clearfix">
|
||||
<span>Affiliation</span>
|
||||
</div>
|
||||
<el-form-item prop="IsZhiZhun">
|
||||
<el-radio-group v-model="user.IsZhiZhun" @change="OrgnizationTypeChanged">
|
||||
<el-radio-group
|
||||
v-model="user.IsZhiZhun"
|
||||
@change="OrgnizationTypeChanged"
|
||||
>
|
||||
<el-radio :label="true">Internal</el-radio>
|
||||
<el-radio :label="false">External</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="user.IsZhiZhun === false" label="Organization Name: ">
|
||||
<el-form-item
|
||||
v-show="user.IsZhiZhun === false"
|
||||
label="Organization Name: "
|
||||
>
|
||||
<el-input v-model="user.OrganizationName" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -78,19 +100,24 @@
|
||||
type="primary"
|
||||
size="small"
|
||||
:disabled="isDisabled"
|
||||
style="margin:10px 15px"
|
||||
style="margin: 10px 15px"
|
||||
@click="handleSave"
|
||||
>Save</el-button>
|
||||
>Save</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { getUser, addUser, updateUser, getUserTypeListByUserType } from '@/api/admin.js'
|
||||
import {
|
||||
getUser,
|
||||
addUser,
|
||||
updateUser,
|
||||
getUserTypeListByUserType,
|
||||
} from '@/api/admin.js'
|
||||
export default {
|
||||
name: 'UserInfo',
|
||||
props: {
|
||||
userId: { type: String, default: '' }
|
||||
userId: { type: String, default: '' },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -105,60 +132,69 @@ export default {
|
||||
IsZhiZhun: '',
|
||||
OrganizationName: '',
|
||||
DepartmentName: '',
|
||||
PositionName: ''
|
||||
PositionName: '',
|
||||
},
|
||||
userFormRules: {
|
||||
UserName: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
{ max: 50, message: 'The maximum length is 50' }
|
||||
{ max: 50, message: 'The maximum length is 50' },
|
||||
],
|
||||
UserTypeId: [
|
||||
{ required: true, message: 'Please Select', trigger: ['blur', 'change'] }
|
||||
{
|
||||
required: true,
|
||||
message: 'Please Select',
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
IsZhiZhun: [
|
||||
{ required: true, message: 'Please Select', trigger: ['blur', 'change'] }
|
||||
{
|
||||
required: true,
|
||||
message: 'Please Select',
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
OrganizationName: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' }
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
],
|
||||
LastName: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
{ max: 50, message: 'The maximum length is 50' }
|
||||
{ max: 50, message: 'The maximum length is 50' },
|
||||
],
|
||||
FirstName: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
{ max: 50, message: 'The maximum length is 50' }
|
||||
{ max: 50, message: 'The maximum length is 50' },
|
||||
],
|
||||
Phone: [
|
||||
{ max: 20, min: 7, message: 'The length is 7 to 20', trigger: ['blur'] }
|
||||
{
|
||||
max: 20,
|
||||
min: 7,
|
||||
message: 'The length is 7 to 20',
|
||||
trigger: ['blur'],
|
||||
},
|
||||
],
|
||||
EMail: [
|
||||
{
|
||||
required: true,
|
||||
message: 'Please input the email address',
|
||||
trigger: 'blur'
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
type: 'email',
|
||||
message: 'Please input the correct email address',
|
||||
trigger: ['blur']
|
||||
trigger: ['blur'],
|
||||
},
|
||||
{ max: 50, message: 'The maximum length is 50' }
|
||||
],
|
||||
Sex: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' }
|
||||
{ max: 50, message: 'The maximum length is 50' },
|
||||
],
|
||||
Sex: [{ required: true, message: 'Please specify', trigger: 'blur' }],
|
||||
Status: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' }
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
],
|
||||
DepartmentName: [
|
||||
{ max: 50, message: 'The maximum length is 50' }],
|
||||
PositionName: [{ max: 50, message: 'The maximum length is 50' }
|
||||
]
|
||||
DepartmentName: [{ max: 50, message: 'The maximum length is 50' }],
|
||||
PositionName: [{ max: 50, message: 'The maximum length is 50' }],
|
||||
},
|
||||
userTypeOptions: [],
|
||||
isDisabled: false,
|
||||
type: 0 // 1为编辑,0为新增
|
||||
type: 0, // 1为编辑,0为新增
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -172,46 +208,58 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleSave() {
|
||||
this.$refs.userForm.validate(valid => {
|
||||
this.$refs.userForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.isDisabled = true
|
||||
const selectedUserType = this.userTypeOptions.filter(item => item.Id === this.user.UserTypeId)
|
||||
const selectedUserType = this.userTypeOptions.filter(
|
||||
(item) => item.Id === this.user.UserTypeId
|
||||
)
|
||||
if (selectedUserType.length > 0) {
|
||||
this.user.UserTypeEnum = selectedUserType[0].UserTypeEnum
|
||||
}
|
||||
if (this.user.Id) {
|
||||
updateUser(this.user).then(res => {
|
||||
this.isDisabled = false
|
||||
this.$message.success('Updated successfully')
|
||||
}).catch(() => { this.isDisabled = false })
|
||||
updateUser(this.user)
|
||||
.then((res) => {
|
||||
this.isDisabled = false
|
||||
this.$message.success('Updated successfully')
|
||||
})
|
||||
.catch(() => {
|
||||
this.isDisabled = false
|
||||
})
|
||||
} else {
|
||||
addUser(this.user).then(res => {
|
||||
this.isDisabled = false
|
||||
this.user.Id = res.Result.Id
|
||||
this.user.UserCode = res.Result.UserCode
|
||||
this.$emit('getUserId', res.Result.Id)
|
||||
this.$message.success('Added successfully')
|
||||
this.$router.push({ path: '/system/user/list' })
|
||||
}).catch(() => { this.isDisabled = false })
|
||||
addUser(this.user)
|
||||
.then((res) => {
|
||||
this.isDisabled = false
|
||||
this.user.Id = res.Result.Id
|
||||
this.user.UserCode = res.Result.UserCode
|
||||
this.$emit('getUserId', res.Result.Id)
|
||||
this.$message.success('Added successfully')
|
||||
this.$router.push({ path: '/system/user/list' })
|
||||
})
|
||||
.catch(() => {
|
||||
this.isDisabled = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserTypeList() {
|
||||
getUserTypeListByUserType(0).then(res => {
|
||||
getUserTypeListByUserType(0).then((res) => {
|
||||
if (res.IsSuccess) {
|
||||
this.userTypeOptions = res.Result
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserInfo() {
|
||||
getUser(this.userId).then(res => {
|
||||
getUser({
|
||||
IdentityUserId: this.userId,
|
||||
}).then((res) => {
|
||||
this.user = res.Result
|
||||
})
|
||||
},
|
||||
OrgnizationTypeChanged(val) {
|
||||
this.user.OrganizationName = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="UpdateTime"
|
||||
label="更新时间"
|
||||
label="上传时间"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
/>
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="UpdateTime"
|
||||
label="更新时间"
|
||||
label="上传时间"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
/>
|
||||
|
||||
@@ -104,8 +104,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="UpdateTime"
|
||||
label="更新时间"
|
||||
prop="CreateTime"
|
||||
label="创建时间"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
/>
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="UpdateTime"
|
||||
label="更新时间"
|
||||
label="上传时间"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
/>
|
||||
|
||||
@@ -9,8 +9,19 @@
|
||||
>
|
||||
<div class="base-dialog-body">
|
||||
<el-form-item label="Site: ">
|
||||
<el-select v-model="form.SiteId" style="width: 100%" clearable filterable @change="siteChange">
|
||||
<el-option v-for="item of siteList" :value="item.Id" :key="item.Id" :label="item.SiteName">
|
||||
<el-select
|
||||
v-model="form.SiteId"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
filterable
|
||||
@change="siteChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item of siteList"
|
||||
:value="item.Id"
|
||||
:key="item.Id"
|
||||
:label="item.SiteName"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -20,10 +31,16 @@
|
||||
<el-form-item label="Hospital EN: " prop="HospitalName">
|
||||
<el-input v-model="form.HospitalName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Affiliated University CN: " prop="UniversityAffiliatedCN">
|
||||
<el-form-item
|
||||
label="Affiliated University CN: "
|
||||
prop="UniversityAffiliatedCN"
|
||||
>
|
||||
<el-input v-model="form.UniversityAffiliatedCN" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Affiliated University EN: " prop="UniversityAffiliated">
|
||||
<el-form-item
|
||||
label="Affiliated University EN: "
|
||||
prop="UniversityAffiliated"
|
||||
>
|
||||
<el-input v-model="form.UniversityAffiliated" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Country CN: " prop="CountryCN">
|
||||
@@ -45,10 +62,22 @@
|
||||
<el-input v-model="form.City" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="base-dialog-footer" style="text-align:right;margin-top:10px;">
|
||||
<div class="base-dialog-footer" style="text-align: right; margin-top: 10px">
|
||||
<el-form-item>
|
||||
<el-button :disabled="btnLoading" size="small" type="primary" @click="handleCancel">Cancel</el-button>
|
||||
<el-button size="small" type="primary" :loading="btnLoading" @click="handleSave">Save</el-button>
|
||||
<el-button
|
||||
:disabled="btnLoading"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handleCancel"
|
||||
>Cancel</el-button
|
||||
>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
:loading="btnLoading"
|
||||
@click="handleSave"
|
||||
>Save</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
@@ -63,14 +92,14 @@ export default {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
},
|
||||
model: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -87,23 +116,36 @@ export default {
|
||||
Province: '',
|
||||
ProvinceCN: '',
|
||||
City: '',
|
||||
CityCN: ''
|
||||
CityCN: '',
|
||||
},
|
||||
siteList: [],
|
||||
rules: {
|
||||
HospitalNameCN: [{ required: true, message: 'Please specify', trigger: 'blur' }, { max: 50, message: 'The maximum length is 50' }],
|
||||
UniversityAffiliated: [{ max: 100, message: 'The maximum length is 100' }],
|
||||
UniversityAffiliatedCN: [{ max: 100, message: 'The maximum length is 100' }],
|
||||
Country: [{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
{ max: 50, message: 'The maximum length is 50' }],
|
||||
CountryCN: [{ max: 50, message: 'The maximum length is 50' }],
|
||||
Province: [{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
{ max: 50, message: 'The maximum length is 50' }],
|
||||
ProvinceCN: [{ max: 50, message: 'The maximum length is 50' }],
|
||||
City: [{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
{ max: 50, message: 'The maximum length is 50' }],
|
||||
CityCN: [{ max: 50, message: 'The maximum length is 50' }]
|
||||
}
|
||||
HospitalNameCN: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
{ max: 50, message: 'The maximum length is 50' },
|
||||
],
|
||||
UniversityAffiliated: [
|
||||
{ max: 100, message: 'The maximum length is 100' },
|
||||
],
|
||||
UniversityAffiliatedCN: [
|
||||
{ max: 100, message: 'The maximum length is 100' },
|
||||
],
|
||||
Country: [{ max: 50, message: 'The maximum length is 50' }],
|
||||
CountryCN: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
{ max: 50, message: 'The maximum length is 50' },
|
||||
],
|
||||
Province: [{ max: 50, message: 'The maximum length is 50' }],
|
||||
ProvinceCN: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
{ max: 50, message: 'The maximum length is 50' },
|
||||
],
|
||||
City: [{ max: 50, message: 'The maximum length is 50' }],
|
||||
CityCN: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
{ max: 50, message: 'The maximum length is 50' },
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -114,7 +156,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
siteChange(v) {
|
||||
this.siteList.forEach(o => {
|
||||
this.siteList.forEach((o) => {
|
||||
if (o.Id === v) {
|
||||
this.form.CityCN = o.City
|
||||
this.form.HospitalNameCN = o.SiteNameCN
|
||||
@@ -125,34 +167,37 @@ export default {
|
||||
})
|
||||
},
|
||||
getAllSiteList() {
|
||||
getAllSiteList().then(res => {
|
||||
this.siteList = res.Result
|
||||
console.log(this.siteList)
|
||||
}).catch(() => {
|
||||
reject()
|
||||
})
|
||||
getAllSiteList()
|
||||
.then((res) => {
|
||||
this.siteList = res.Result
|
||||
console.log(this.siteList)
|
||||
})
|
||||
.catch(() => {
|
||||
reject()
|
||||
})
|
||||
},
|
||||
handleSave() {
|
||||
this.$refs.hospitalForm.validate(valid => {
|
||||
this.$refs.hospitalForm.validate((valid) => {
|
||||
if (!valid) return
|
||||
this.btnLoading = true
|
||||
addOrUpdateHospital(this.form).then(res => {
|
||||
this.btnLoading = false
|
||||
if (res.IsSuccess) {
|
||||
this.$message.success('Saved successfully')
|
||||
this.$refs['hospitalForm'].resetFields()
|
||||
this.$emit('getList')
|
||||
this.$emit('close')
|
||||
}
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
})
|
||||
addOrUpdateHospital(this.form)
|
||||
.then((res) => {
|
||||
this.btnLoading = false
|
||||
if (res.IsSuccess) {
|
||||
this.$message.success('Saved successfully')
|
||||
this.$refs['hospitalForm'].resetFields()
|
||||
this.$emit('getList')
|
||||
this.$emit('close')
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.btnLoading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
this.$emit('close')
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -446,6 +446,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="form.QuestionGenre === 3" label="默认值">
|
||||
<el-select v-model="form.DefaultValue" clearable>
|
||||
<el-option
|
||||
@@ -598,6 +599,27 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="form.Type === 'table' || form.Type === 'basicTable'"
|
||||
label="关联字典"
|
||||
>
|
||||
<el-select
|
||||
v-model="form.DictionaryCode"
|
||||
clearable
|
||||
@change="
|
||||
() => {
|
||||
form.DefaultValue = null
|
||||
}
|
||||
"
|
||||
>
|
||||
<el-option
|
||||
v-for="item of dicList"
|
||||
:key="item.Id"
|
||||
:label="item.Code"
|
||||
:value="item.Code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="form.Type === 'upload'"
|
||||
label="最大上传个数"
|
||||
@@ -855,6 +877,7 @@ export default {
|
||||
btnLoading: false,
|
||||
parentOptions: [],
|
||||
parentTriggerValOptions: [],
|
||||
reParentTriggerValOptions: [],
|
||||
groupOptions: [],
|
||||
isParentExistGroup: false,
|
||||
lesionTypes: [],
|
||||
@@ -890,6 +913,7 @@ export default {
|
||||
mounted() {
|
||||
this.initForm()
|
||||
this.getCalculateQuestions('number')
|
||||
|
||||
},
|
||||
methods: {
|
||||
typeValueChange(v) {
|
||||
@@ -905,6 +929,14 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
getBasicConfigSelect() {
|
||||
getCriterionDictionaryList({
|
||||
CriterionId: this.criterionId,
|
||||
SystemCriterionId: this.criterionId
|
||||
}).then(res => {
|
||||
this.dicList = res.Result
|
||||
})
|
||||
},
|
||||
getCalculateQuestions(type) {
|
||||
getSystemCalculateQuestions({
|
||||
systemCriterionId: this.criterionId,
|
||||
@@ -944,6 +976,7 @@ export default {
|
||||
await this.getParentQuestions()
|
||||
await this.getLesionTypeDictionary()
|
||||
await this.getLesionType()
|
||||
await this.getBasicConfigSelect()
|
||||
if (Object.keys(this.data).length > 0) {
|
||||
for (const k in this.form) {
|
||||
if (this.data.hasOwnProperty(k)) {
|
||||
@@ -969,8 +1002,15 @@ export default {
|
||||
})
|
||||
if (index !== -1) {
|
||||
if (this.parentOptions[index].QuestionGenre === 3) {
|
||||
this.parentTriggerValOptions =
|
||||
this.$d[this.parentOptions[index].DictionaryCode]
|
||||
// this.parentTriggerValOptions =
|
||||
// this.$d[this.parentOptions[index].DictionaryCode]
|
||||
let dicCode = this.parentOptions[index].DictionaryCode
|
||||
let res = await getCriterionDictionary({ReadingCriterionId: this.data.ReadingQuestionCriterionSystemId,DictionaryCode: dicCode})
|
||||
|
||||
this.parentTriggerValOptions = res.Result[dicCode].map(i=>{
|
||||
return {id: i.Id, label: this.$i18n.locale === 'zh' ? i.ValueCN : i.Value, value: i.Code}
|
||||
})
|
||||
|
||||
} else {
|
||||
const options = []
|
||||
this.parentOptions[index].TypeValue.split('|').forEach(
|
||||
@@ -988,8 +1028,13 @@ export default {
|
||||
})
|
||||
if (index !== -1) {
|
||||
if (this.parentOptions[index].QuestionGenre === 3) {
|
||||
this.reParentTriggerValOptions =
|
||||
this.$d[this.parentOptions[index].DictionaryCode]
|
||||
// this.reParentTriggerValOptions =
|
||||
// this.$d[this.parentOptions[index].DictionaryCode]
|
||||
let dicCode = this.parentOptions[index].DictionaryCode
|
||||
let res = await getCriterionDictionary({ReadingCriterionId: this.data.ReadingQuestionCriterionSystemId,DictionaryCode: dicCode})
|
||||
this.reParentTriggerValOptions = res.Result[dicCode].map(i=>{
|
||||
return {id: i.Id, label: this.$i18n.locale === 'zh' ? i.ValueCN : i.Value, value: i.Code}
|
||||
})
|
||||
} else {
|
||||
const options = []
|
||||
this.parentOptions[index].TypeValue.split('|').forEach(
|
||||
@@ -1180,15 +1225,21 @@ export default {
|
||||
}
|
||||
form.ParentTriggerValue = ''
|
||||
},
|
||||
relevanceQuestionChange(val, form) {
|
||||
async relevanceQuestionChange(val, form) {
|
||||
if (val) {
|
||||
var index = this.parentOptions.findIndex((item) => {
|
||||
return item.QuestionId === val
|
||||
})
|
||||
if (index !== -1) {
|
||||
if (this.parentOptions[index].QuestionGenre === 3) {
|
||||
this.reParentTriggerValOptions =
|
||||
this.$d[this.parentOptions[index].DictionaryCode]
|
||||
// this.reParentTriggerValOptions =
|
||||
// this.$d[this.parentOptions[index].DictionaryCode]
|
||||
let dicCode = this.parentOptions[index].DictionaryCode
|
||||
let res = await getCriterionDictionary({ReadingCriterionId: this.data.ReadingQuestionCriterionSystemId,DictionaryCode: dicCode})
|
||||
|
||||
this.reParentTriggerValOptions = res.Result[dicCode].map(i=>{
|
||||
return {id: i.Id, label: this.$i18n.locale === 'zh' ? i.ValueCN : i.Value, value: i.Code}
|
||||
})
|
||||
} else {
|
||||
var options = []
|
||||
this.parentOptions[index].TypeValue.split('|').forEach(
|
||||
|
||||
@@ -710,7 +710,13 @@ export default {
|
||||
})
|
||||
if (index !== -1) {
|
||||
if (this.parentOptions[index].QuestionGenre === 3) {
|
||||
this.parentTriggerValOptions = this.$d[this.parentOptions[index].DictionaryCode]
|
||||
// this.parentTriggerValOptions = this.$d[this.parentOptions[index].DictionaryCode]
|
||||
let dicCode = this.parentOptions[index].DictionaryCode
|
||||
let res = await getCriterionDictionary({ReadingCriterionId: this.criterionId, DictionaryCode: dicCode})
|
||||
|
||||
this.parentTriggerValOptions = res.Result[dicCode].map(i=>{
|
||||
return {id: i.Id, label: this.$i18n.locale === 'zh' ? i.ValueCN : i.Value, value: i.Code}
|
||||
})
|
||||
} else {
|
||||
const options = []
|
||||
this.parentOptions[index].TypeValue.split('|').forEach((item, index) => {
|
||||
@@ -726,8 +732,12 @@ export default {
|
||||
})
|
||||
if (i !== -1) {
|
||||
if (this.parentOptions[i].QuestionGenre === 3) {
|
||||
console.log(this.$d[this.parentOptions[i].DictionaryCode])
|
||||
this.reParentTriggerValOptions = this.$d[this.parentOptions[i].DictionaryCode]
|
||||
// this.reParentTriggerValOptions = this.$d[this.parentOptions[i].DictionaryCode]
|
||||
let dicCode = this.parentOptions[i].DictionaryCode
|
||||
let res = await getCriterionDictionary({ReadingCriterionId: this.criterionId, DictionaryCode: dicCode})
|
||||
this.reParentTriggerValOptions = res.Result[dicCode].map(i=>{
|
||||
return {id: i.Id, label: this.$i18n.locale === 'zh' ? i.ValueCN : i.Value, value: i.Code}
|
||||
})
|
||||
} else {
|
||||
const options = []
|
||||
this.parentOptions[i].TypeValue.split('|').forEach((item, index) => {
|
||||
@@ -805,14 +815,20 @@ export default {
|
||||
form.RelevanceValue = ''
|
||||
}
|
||||
},
|
||||
parentQuestionChange(val, form) {
|
||||
async parentQuestionChange(val, form) {
|
||||
if (val) {
|
||||
var index = this.parentOptions.findIndex(item => {
|
||||
return item.QuestionId === val
|
||||
})
|
||||
if (index !== -1) {
|
||||
if (this.parentOptions[index].QuestionGenre === 3) {
|
||||
this.parentTriggerValOptions = this.$d[this.parentOptions[index].DictionaryCode]
|
||||
// this.parentTriggerValOptions = this.$d[this.parentOptions[index].DictionaryCode]
|
||||
let dicCode = this.parentOptions[index].DictionaryCode
|
||||
let res = await getCriterionDictionary({ReadingCriterionId: this.criterionId, DictionaryCode: dicCode})
|
||||
|
||||
this.parentTriggerValOptions = res.Result[dicCode].map(i=>{
|
||||
return {id: i.Id, label: this.$i18n.locale === 'zh' ? i.ValueCN : i.Value, value: i.Code}
|
||||
})
|
||||
} else {
|
||||
const options = []
|
||||
this.parentOptions[index].TypeValue.split('|').forEach((item, index) => {
|
||||
@@ -824,16 +840,20 @@ export default {
|
||||
}
|
||||
form.ParentTriggerValue = ''
|
||||
},
|
||||
relevanceQuestionChange(val, form) {
|
||||
async relevanceQuestionChange(val, form) {
|
||||
if (val) {
|
||||
var index = this.parentOptions.findIndex(item => {
|
||||
return item.QuestionId === val
|
||||
})
|
||||
console.log(this.$d[this.parentOptions[index].DictionaryCode], this.parentOptions[index].QuestionGenre)
|
||||
if (index !== -1) {
|
||||
if (this.parentOptions[index].QuestionGenre === 3) {
|
||||
console.log(this.$d[this.parentOptions[index].DictionaryCode])
|
||||
this.reParentTriggerValOptions = this.$d[this.parentOptions[index].DictionaryCode]
|
||||
// this.reParentTriggerValOptions = this.$d[this.parentOptions[index].DictionaryCode]
|
||||
let dicCode = this.parentOptions[index].DictionaryCode
|
||||
let res = await getCriterionDictionary({ReadingCriterionId: this.criterionId, DictionaryCode: dicCode})
|
||||
|
||||
this.reParentTriggerValOptions = res.Result[dicCode].map(i=>{
|
||||
return {id: i.Id, label: this.$i18n.locale === 'zh' ? i.ValueCN : i.Value, value: i.Code}
|
||||
})
|
||||
} else {
|
||||
const options = []
|
||||
this.parentOptions[index].TypeValue.split('|').forEach((item, index) => {
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
<el-input v-model="password.Email" disabled />
|
||||
</el-form-item>
|
||||
<!-- 用户名 -->
|
||||
<el-form-item :label="$t('recompose:form:role')" prop="UserType">
|
||||
<!-- <el-form-item :label="$t('recompose:form:role')" prop="UserType">
|
||||
<el-input v-model="password.UserType" disabled />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<!-- 用户名 -->
|
||||
<el-form-item :label="$t('recompose:form:userName')" prop="NewUserName">
|
||||
<el-input v-model="password.NewUserName" />
|
||||
@@ -95,7 +95,6 @@ export default {
|
||||
: 'zh'
|
||||
/* eslint-disable */
|
||||
var reg1 = /^[a-zA-Z0-9_]{4,16}$/ //密码必须是8位以上、必须含有字母、数字、特殊符号
|
||||
console.log(!reg1.test(value))
|
||||
if (!reg1.test(value)) {
|
||||
callback(
|
||||
lang === 'zh'
|
||||
|
||||
@@ -76,7 +76,8 @@
|
||||
>
|
||||
<!-- 用户名 -->
|
||||
<el-form-item :label="$t('passwordReset:form:userName')" prop="UserId">
|
||||
<el-select
|
||||
<el-input v-model="form.UserName" disabled />
|
||||
<!-- <el-select
|
||||
v-model="form.UserId"
|
||||
clearable
|
||||
filterable
|
||||
@@ -94,15 +95,15 @@
|
||||
item.UserType
|
||||
}}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
<!-- 用户类型 -->
|
||||
<el-form-item
|
||||
<!-- <el-form-item
|
||||
v-if="form.UserId"
|
||||
:label="$t('passwordReset:form:userType')"
|
||||
>
|
||||
<el-input v-model="form.UserType" disabled />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<!-- 新密码 -->
|
||||
<el-form-item
|
||||
class="my_new_pwd"
|
||||
@@ -338,11 +339,13 @@ export default {
|
||||
)
|
||||
.then((res) => {
|
||||
this.formLoading = false
|
||||
this.users = res.Result
|
||||
if (this.users.length === 1) {
|
||||
this.form.UserId = this.users[0].UserId
|
||||
this.form.UserType = this.users[0].UserType
|
||||
}
|
||||
this.form.UserId = res.Result.Id
|
||||
this.form.UserName = res.Result.UserName
|
||||
// this.users = res.Result
|
||||
// if (this.users.length === 1) {
|
||||
// this.form.UserId = this.users[0].UserId
|
||||
// this.form.UserType = this.users[0].UserType
|
||||
// }
|
||||
// 验证成功
|
||||
this.$message.success(
|
||||
this.$t('passwordReset:message:verifiedSuccessfully')
|
||||
|
||||
+95
-35
@@ -83,7 +83,7 @@
|
||||
<svg-icon icon-class="password" />
|
||||
</span>
|
||||
<!-- password -->
|
||||
<!-- <el-input
|
||||
<el-input
|
||||
:key="passwordType"
|
||||
ref="password"
|
||||
v-model="loginForm.password"
|
||||
@@ -100,8 +100,8 @@
|
||||
<svg-icon
|
||||
:icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"
|
||||
/>
|
||||
</span> -->
|
||||
<el-input
|
||||
</span>
|
||||
<!-- <el-input
|
||||
:key="passwordType"
|
||||
ref="password"
|
||||
v-model="pwdCover"
|
||||
@@ -115,7 +115,7 @@
|
||||
/>
|
||||
<span class="show-pwd" @click="hidePassword">
|
||||
<svg-icon :icon-class="!isShowPassword ? 'eye' : 'eye-open'" />
|
||||
</span>
|
||||
</span> -->
|
||||
</el-form-item>
|
||||
<!-- Login -->
|
||||
<el-button
|
||||
@@ -243,6 +243,13 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
<browserTip ref="browserTip" />
|
||||
<toggleRole
|
||||
v-if="toggleRoleVisible"
|
||||
:visible.sync="toggleRoleVisible"
|
||||
:loading="toggleRoleLoading"
|
||||
@save="loginByRole"
|
||||
@cancel="cancel"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -253,9 +260,10 @@ import TopLang from './topLang'
|
||||
import Vcode from 'vue-puzzle-vcode'
|
||||
import browserTip from '@/views/dictionary/template/browser/tip.vue'
|
||||
import Img1 from '@/assets/pic-2.png'
|
||||
import toggleRole from '@/components/toggleRole'
|
||||
export default {
|
||||
name: 'Login',
|
||||
components: { TopLang, Vcode, browserTip },
|
||||
components: { TopLang, Vcode, browserTip, toggleRole },
|
||||
data() {
|
||||
return {
|
||||
NODE_ENV: process.env.NODE_ENV, // process.env.NODE_ENV
|
||||
@@ -298,6 +306,10 @@ export default {
|
||||
isShow: false,
|
||||
showCode: false,
|
||||
Img1,
|
||||
toggleRoleVisible: false,
|
||||
toggleRoleLoading: false,
|
||||
|
||||
LoginState: 0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -318,6 +330,7 @@ export default {
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
zzSessionStorage.clear()
|
||||
this.loginType = this.$route.query.loginType
|
||||
this.location = this.$route.query.location
|
||||
zzSessionStorage.setItem('loginType', this.loginType)
|
||||
@@ -372,10 +385,12 @@ export default {
|
||||
loginIn(Id) {
|
||||
this.loading = true
|
||||
this.showCode = false
|
||||
this.LoginState = 0
|
||||
if (Id) this.loginForm.UserId = Id
|
||||
this.$store
|
||||
.dispatch('user/login', this.loginForm)
|
||||
.then((res) => {
|
||||
this.LoginState = res.BasicInfo.LoginState
|
||||
if (res.BasicInfo.IsFirstAdd) {
|
||||
// 当前用户为首次登录,请先修改密码之后再次登录
|
||||
this.$message.success(this.$t('login:message:login1'))
|
||||
@@ -411,42 +426,88 @@ export default {
|
||||
},
|
||||
})
|
||||
return
|
||||
} else if (res.BasicInfo.LoginState === 2) {
|
||||
// 本次登录的IP或设备与上次不一致,请确认'
|
||||
// this.$alert(this.$t('login:message:login4'), this.$t('common:title:warning'))
|
||||
this.$message.warning(this.$t('login:message:login4'))
|
||||
}
|
||||
this.$store.dispatch('permission/generateRoutes').then((res) => {
|
||||
this.loading = false
|
||||
if (res && res.length > 0) {
|
||||
this.$store.dispatch('global/getNoticeList')
|
||||
this.$router.addRoutes(res)
|
||||
if (this.loginType === 'DevOps') {
|
||||
this.$router.replace({ path: res[0].path })
|
||||
return
|
||||
}
|
||||
if (this.hasPermi(['role:radmin'])) {
|
||||
this.$router.replace({ path: res[0].path })
|
||||
return
|
||||
}
|
||||
if (
|
||||
this.hasPermi(['role:air', 'role:rpm', 'role:rcrc', 'role:rir'])
|
||||
) {
|
||||
this.$router.replace({ path: '/trials/trials-list' })
|
||||
} else {
|
||||
this.$router.replace({ path: '/trials' })
|
||||
}
|
||||
} else {
|
||||
// 此账户暂未配置菜单权限,请联系管理员处理后再登录。
|
||||
this.$message.warning(this.$t('login:message:login2'))
|
||||
}
|
||||
})
|
||||
// else if (res.BasicInfo.LoginState === 2) {
|
||||
// // 本次登录的IP或设备与上次不一致,请确认'
|
||||
// // this.$alert(this.$t('login:message:login4'), this.$t('common:title:warning'))
|
||||
// this.$message.warning(this.$t('login:message:login4'))
|
||||
// }
|
||||
if (
|
||||
Array.isArray(this.$store.state.user.roles) &&
|
||||
this.$store.state.user.roles.length === 1
|
||||
) {
|
||||
this.loginByRole(this.$store.state.user.roles[0].Id)
|
||||
return
|
||||
}
|
||||
return (this.toggleRoleVisible = true)
|
||||
})
|
||||
.catch(() => {
|
||||
this.showCode = true
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
loginByRole(userRoleId) {
|
||||
this.toggleRoleLoading = true
|
||||
this.$store
|
||||
.dispatch('user/loginByRole', { userRoleId })
|
||||
.then((res) => {
|
||||
this.toggleRoleLoading = false
|
||||
if (res) {
|
||||
this.$store
|
||||
.dispatch('permission/generateRoutes')
|
||||
.then((res) => {
|
||||
this.loading = false
|
||||
if (res && res.length > 0) {
|
||||
this.$store.dispatch('global/getNoticeList')
|
||||
this.$router.addRoutes(res)
|
||||
if (this.LoginState === 2) {
|
||||
this.$message.warning(this.$t('login:message:login4'))
|
||||
}
|
||||
if (this.loginType === 'DevOps') {
|
||||
this.$router.replace({ path: res[0].path })
|
||||
return
|
||||
}
|
||||
if (this.hasPermi(['role:radmin'])) {
|
||||
this.$router.replace({ path: res[0].path })
|
||||
return
|
||||
}
|
||||
if (
|
||||
this.hasPermi([
|
||||
'role:air',
|
||||
'role:rpm',
|
||||
'role:rcrc',
|
||||
'role:rir',
|
||||
])
|
||||
) {
|
||||
this.$router.replace({ path: '/trials/trials-list' })
|
||||
} else {
|
||||
this.$router.replace({ path: '/trials' })
|
||||
}
|
||||
} else {
|
||||
this.toggleRoleLoading = false
|
||||
// 此账户暂未配置菜单权限,请联系管理员处理后再登录。
|
||||
this.$message.warning(this.$t('login:message:login2'))
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
this.toggleRoleLoading = false
|
||||
})
|
||||
} else {
|
||||
this.toggleRoleLoading = false
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.showCode = true
|
||||
this.loading = false
|
||||
this.toggleRoleLoading = false
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.showCode = true
|
||||
this.loading = false
|
||||
this.toggleRoleLoading = false
|
||||
// this.toggleRoleVisible = false
|
||||
},
|
||||
onSuccess() {
|
||||
this.isShow = false
|
||||
this.loginIn()
|
||||
@@ -456,7 +517,6 @@ export default {
|
||||
},
|
||||
// 输入框输入事件
|
||||
setPassword(val) {
|
||||
console.log(val)
|
||||
if (this.isShowPassword) {
|
||||
this.loginForm.password = val
|
||||
} else {
|
||||
|
||||
@@ -138,7 +138,7 @@ export default {
|
||||
...mapMutations({ setLanguage: 'lang/setLanguage' }),
|
||||
async logout() {
|
||||
var loginType = zzSessionStorage.getItem('loginType')
|
||||
await this.$store.dispatch('user/logout')
|
||||
await this.$store.dispatch('user/resetData')
|
||||
if (loginType) {
|
||||
this.$router.push(`/login?loginType=${loginType}`)
|
||||
} else {
|
||||
|
||||
@@ -569,22 +569,30 @@
|
||||
:label="$t('system:EducationTraining:table:Hospital')"
|
||||
prop="Hospital"
|
||||
>
|
||||
<el-select
|
||||
v-model="postgraduateForm.HospitalId"
|
||||
filterable
|
||||
placeholder=""
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in hospitalList"
|
||||
:key="index"
|
||||
:label="isEN ? item.HospitalName : item.HospitalNameCN"
|
||||
:value="item.Id"
|
||||
>
|
||||
<span>
|
||||
{{ isEN ? item.HospitalName : item.HospitalNameCN }}
|
||||
</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-row type="flex" justify="space-between">
|
||||
<el-col :span="11">
|
||||
<el-autocomplete
|
||||
clearable
|
||||
class="inline-input"
|
||||
style="width: 100%"
|
||||
v-model="postgraduateForm.Hospital"
|
||||
:fetch-suggestions="querySearch"
|
||||
@select="handleSelect"
|
||||
placeholder="Please specify in English"
|
||||
></el-autocomplete>
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
<el-autocomplete
|
||||
clearable
|
||||
class="inline-input"
|
||||
style="width: 100%"
|
||||
v-model="postgraduateForm.HospitalCN"
|
||||
:fetch-suggestions="querySearchCN"
|
||||
@select="handleSelect"
|
||||
placeholder="请用中文注明"
|
||||
></el-autocomplete>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('system:EducationTraining:table:University')"
|
||||
@@ -1043,6 +1051,8 @@ export default {
|
||||
},
|
||||
isDisabled: false,
|
||||
loading: false,
|
||||
hospitalSelectList: [],
|
||||
hospitalSelectListCN: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -1051,11 +1061,71 @@ export default {
|
||||
return this.$i18n.locale !== 'zh'
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
hospitalList: {
|
||||
handler() {
|
||||
if (!Array.isArray(this.hospitalList) || this.hospitalList.length <= 0)
|
||||
return false
|
||||
this.hospitalSelectList = []
|
||||
this.hospitalList.forEach((item) => {
|
||||
this.hospitalSelectList.push({
|
||||
value: item.HospitalName,
|
||||
...item,
|
||||
})
|
||||
this.hospitalSelectListCN.push({
|
||||
value: item.HospitalNameCN,
|
||||
...item,
|
||||
})
|
||||
})
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.initPage()
|
||||
store.dispatch('global/getHospital')
|
||||
},
|
||||
methods: {
|
||||
handleSelect(value) {
|
||||
const item = value
|
||||
if (item) {
|
||||
this.postgraduateForm.Hospital = item.HospitalName
|
||||
this.postgraduateForm.HospitalCN = item.HospitalNameCN
|
||||
}
|
||||
},
|
||||
querySearch(queryString, cb) {
|
||||
var hospitalList = this.hospitalSelectList
|
||||
var results = queryString
|
||||
? hospitalList.filter(this.createFilter(queryString))
|
||||
: hospitalList
|
||||
// 调用 callback 返回建议列表的数据
|
||||
cb(results)
|
||||
},
|
||||
querySearchCN(queryString, cb) {
|
||||
var hospitalList = this.hospitalSelectListCN
|
||||
var results = queryString
|
||||
? hospitalList.filter(this.createFilter(queryString, false))
|
||||
: hospitalList
|
||||
// 调用 callback 返回建议列表的数据
|
||||
cb(results)
|
||||
},
|
||||
createFilter(queryString, isEN = true) {
|
||||
return (hospitalList) => {
|
||||
if (isEN) {
|
||||
return (
|
||||
hospitalList.HospitalName.toLowerCase().indexOf(
|
||||
queryString.toLowerCase()
|
||||
) >= 0
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
hospitalList.HospitalNameCN.toLowerCase().indexOf(
|
||||
queryString.toLowerCase()
|
||||
) >= 0
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
initPage() {
|
||||
const id = this.$route.query.Id || this.reviewerId
|
||||
if (id) {
|
||||
|
||||
@@ -14,27 +14,32 @@
|
||||
<el-col :span="14">
|
||||
<el-form-item
|
||||
:label="$t('system:reviewer:label:Hospital')"
|
||||
prop="HospitalId"
|
||||
prop="HospitalName"
|
||||
>
|
||||
<el-select
|
||||
v-model="employmentForm.HospitalId"
|
||||
placeholder="select"
|
||||
:disabled="$route.query.ReviewStatus === '1'"
|
||||
<el-autocomplete
|
||||
clearable
|
||||
class="inline-input"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
@change="handleHospitalChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in hospitalList"
|
||||
:key="index"
|
||||
:label="isEN ? item.HospitalName : item.HospitalNameCN"
|
||||
:value="item.Id"
|
||||
>
|
||||
<span>
|
||||
{{ isEN ? item.HospitalName : item.HospitalNameCN }}
|
||||
</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
v-model="employmentForm.HospitalName"
|
||||
:fetch-suggestions="querySearch"
|
||||
@select="handleSelect"
|
||||
placeholder="Please specify in English"
|
||||
@change="handleChange"
|
||||
></el-autocomplete>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-form-item prop="HospitalNameCN">
|
||||
<el-autocomplete
|
||||
clearable
|
||||
class="inline-input"
|
||||
style="width: 100%"
|
||||
v-model="employmentForm.HospitalNameCN"
|
||||
:fetch-suggestions="querySearchCN"
|
||||
@select="handleSelect"
|
||||
placeholder="请用中文注明"
|
||||
@change="handleChange"
|
||||
></el-autocomplete>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -43,12 +48,25 @@
|
||||
<el-col :span="14">
|
||||
<el-form-item
|
||||
:label="$t('system:reviewer:label:AffiliatedUniversity')"
|
||||
prop="UniversityAffiliated"
|
||||
>
|
||||
<el-input
|
||||
disabled
|
||||
v-model="UniversityAffiliated"
|
||||
v-model="employmentForm.UniversityAffiliated"
|
||||
type="textarea"
|
||||
autosize
|
||||
placeholder="Please specify in English"
|
||||
size="small"
|
||||
:maxlength="4000"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-form-item prop="UniversityAffiliated">
|
||||
<el-input
|
||||
v-model="employmentForm.UniversityAffiliatedCN"
|
||||
type="textarea"
|
||||
autosize
|
||||
placeholder="请用中文注明"
|
||||
size="small"
|
||||
:maxlength="4000"
|
||||
/>
|
||||
@@ -59,15 +77,23 @@
|
||||
<el-col :span="14">
|
||||
<el-form-item :label="$t('system:reviewer:label:City')">
|
||||
<el-input
|
||||
disabled
|
||||
v-model="City"
|
||||
v-model="employmentForm.City"
|
||||
size="small"
|
||||
:maxlength="400"
|
||||
placeholder="Please specify in English"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="employmentForm.CityCN"
|
||||
size="small"
|
||||
placeholder="请用中文注明"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="14">
|
||||
<el-form-item :label="$t('system:reviewer:label:State/Province')">
|
||||
<el-input
|
||||
@@ -90,7 +116,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
|
||||
<el-row>
|
||||
<el-col :span="14">
|
||||
@@ -321,14 +347,34 @@ export default {
|
||||
Physician: '',
|
||||
PhysicianCN: '',
|
||||
PhysicianOriginal: null,
|
||||
HospitalName: '',
|
||||
HospitalNameCN: '',
|
||||
WorkPartTime: null,
|
||||
WorkPartTimeEn: null,
|
||||
UniversityAffiliated: null,
|
||||
UniversityAffiliatedCN: null,
|
||||
City: null,
|
||||
CityCN: null,
|
||||
},
|
||||
UniversityAffiliated: '',
|
||||
City: '',
|
||||
Province: '',
|
||||
Country: '',
|
||||
employmentRules: {
|
||||
HospitalName: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
HospitalNameCN: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
DepartmentId: [
|
||||
{
|
||||
required: true,
|
||||
@@ -435,6 +481,8 @@ export default {
|
||||
otherId: 'ef84e9cb-f1a6-49d7-b6da-34be2c12abd5',
|
||||
loading: false,
|
||||
dictionaryList: {},
|
||||
hospitalSelectList: [],
|
||||
hospitalSelectListCN: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -446,7 +494,83 @@ export default {
|
||||
mounted() {
|
||||
this.initEmployment()
|
||||
},
|
||||
watch: {
|
||||
hospitalList: {
|
||||
handler() {
|
||||
if (!Array.isArray(this.hospitalList) || this.hospitalList.length <= 0)
|
||||
return false
|
||||
this.hospitalSelectList = []
|
||||
this.hospitalList.forEach((item) => {
|
||||
this.hospitalSelectList.push({
|
||||
value: item.HospitalName,
|
||||
...item,
|
||||
})
|
||||
this.hospitalSelectListCN.push({
|
||||
value: item.HospitalNameCN,
|
||||
...item,
|
||||
})
|
||||
})
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleSelect(value) {
|
||||
const item = value
|
||||
if (item) {
|
||||
this.employmentForm.HospitalName = item.HospitalName
|
||||
this.employmentForm.HospitalNameCN = item.HospitalNameCN
|
||||
this.employmentForm.UniversityAffiliated = item.UniversityAffiliated
|
||||
this.employmentForm.City = item.City
|
||||
this.employmentForm.UniversityAffiliatedCN = item.UniversityAffiliatedCN
|
||||
this.employmentForm.CityCN = item.CityCN
|
||||
} else {
|
||||
this.employmentForm.UniversityAffiliated = null
|
||||
this.employmentForm.City = null
|
||||
this.employmentForm.UniversityAffiliatedCN = null
|
||||
this.employmentForm.CityCN = null
|
||||
}
|
||||
},
|
||||
handleChange(v) {
|
||||
if (v) return
|
||||
this.employmentForm.UniversityAffiliated = null
|
||||
this.employmentForm.City = null
|
||||
this.employmentForm.UniversityAffiliatedCN = null
|
||||
this.employmentForm.CityCN = null
|
||||
},
|
||||
querySearch(queryString, cb) {
|
||||
var hospitalList = this.hospitalSelectList
|
||||
var results = queryString
|
||||
? hospitalList.filter(this.createFilter(queryString))
|
||||
: hospitalList
|
||||
// 调用 callback 返回建议列表的数据
|
||||
cb(results)
|
||||
},
|
||||
querySearchCN(queryString, cb) {
|
||||
var hospitalList = this.hospitalSelectListCN
|
||||
var results = queryString
|
||||
? hospitalList.filter(this.createFilter(queryString, false))
|
||||
: hospitalList
|
||||
// 调用 callback 返回建议列表的数据
|
||||
cb(results)
|
||||
},
|
||||
createFilter(queryString, isEN = true) {
|
||||
return (hospitalList) => {
|
||||
if (isEN) {
|
||||
return (
|
||||
hospitalList.HospitalName.toLowerCase().indexOf(
|
||||
queryString.toLowerCase()
|
||||
) >= 0
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
hospitalList.HospitalNameCN.toLowerCase().indexOf(
|
||||
queryString.toLowerCase()
|
||||
) >= 0
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
RankChange(val) {
|
||||
var o = this.$d.Rank.find((v) => {
|
||||
return v.id === val
|
||||
@@ -515,6 +639,14 @@ export default {
|
||||
: ''
|
||||
param.HospitalId = this.employmentForm.HospitalId
|
||||
|
||||
param.HospitalName = this.employmentForm.HospitalName
|
||||
param.HospitalNameCN = this.employmentForm.HospitalNameCN
|
||||
param.UniversityAffiliated = this.employmentForm.UniversityAffiliated
|
||||
param.UniversityAffiliatedCN =
|
||||
this.employmentForm.UniversityAffiliatedCN
|
||||
param.City = this.employmentForm.City
|
||||
param.CityCN = this.employmentForm.CityCN
|
||||
|
||||
updateEmploymentInfo(param)
|
||||
.then((res) => {
|
||||
this.isDisabled = false
|
||||
@@ -551,9 +683,22 @@ export default {
|
||||
PositionOther,
|
||||
PositionOtherCN,
|
||||
HospitalId,
|
||||
HospitalName,
|
||||
HospitalNameCN,
|
||||
WorkPartTime,
|
||||
WorkPartTimeEn,
|
||||
UniversityAffiliated,
|
||||
UniversityAffiliatedCN,
|
||||
City,
|
||||
CityCN,
|
||||
} = res.Result
|
||||
this.employmentForm.HospitalName = HospitalName
|
||||
this.employmentForm.HospitalNameCN = HospitalNameCN
|
||||
this.employmentForm.UniversityAffiliated = UniversityAffiliated
|
||||
this.employmentForm.UniversityAffiliatedCN = UniversityAffiliatedCN
|
||||
this.employmentForm.City = City
|
||||
this.employmentForm.CityCN = CityCN
|
||||
|
||||
this.employmentForm.WorkPartTime = WorkPartTime
|
||||
this.employmentForm.WorkPartTimeEn = WorkPartTimeEn
|
||||
this.employmentForm.Id = id
|
||||
|
||||
@@ -150,20 +150,32 @@
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('curriculumVitae:continuingTraining:form:hospital')"
|
||||
prop="HospitalId"
|
||||
prop="Hospital"
|
||||
v-if="isEN"
|
||||
>
|
||||
<el-select v-model="form.HospitalId" filterable placeholder="">
|
||||
<el-option
|
||||
v-for="(item, index) in hospitalList"
|
||||
:key="index"
|
||||
:label="isEN ? item.HospitalName : item.HospitalNameCN"
|
||||
:value="item.Id"
|
||||
>
|
||||
<span>
|
||||
{{ isEN ? item.HospitalName : item.HospitalNameCN }}
|
||||
</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-autocomplete
|
||||
clearable
|
||||
class="inline-input"
|
||||
style="width: 100%"
|
||||
v-model="form.Hospital"
|
||||
:fetch-suggestions="querySearch"
|
||||
@select="handleSelect"
|
||||
placeholder=""
|
||||
></el-autocomplete>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('curriculumVitae:continuingTraining:form:hospital')"
|
||||
prop="Hospital"
|
||||
v-else
|
||||
>
|
||||
<el-autocomplete
|
||||
clearable
|
||||
class="inline-input"
|
||||
style="width: 100%"
|
||||
v-model="form.HospitalCN"
|
||||
:fetch-suggestions="querySearch"
|
||||
placeholder=""
|
||||
></el-autocomplete>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('curriculumVitae:continuingTraining:form:school')"
|
||||
@@ -283,6 +295,8 @@ const defaultForm = () => {
|
||||
Major: '',
|
||||
MajorCN: '',
|
||||
HospitalId: null,
|
||||
HospitalCN: null,
|
||||
Hospital: null,
|
||||
School: '',
|
||||
SchoolCN: '',
|
||||
City: '',
|
||||
@@ -418,6 +432,7 @@ export default {
|
||||
},
|
||||
loading: false,
|
||||
daterange: [],
|
||||
hospitalSelectList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -426,7 +441,55 @@ export default {
|
||||
mounted() {
|
||||
store.dispatch('global/getHospital')
|
||||
},
|
||||
watch: {
|
||||
hospitalList: {
|
||||
handler() {
|
||||
if (!Array.isArray(this.hospitalList) || this.hospitalList.length <= 0)
|
||||
return false
|
||||
this.hospitalSelectList = []
|
||||
this.hospitalList.forEach((item) => {
|
||||
if (this.isEN) {
|
||||
this.hospitalSelectList.push({
|
||||
value: item.HospitalName,
|
||||
...item,
|
||||
})
|
||||
} else {
|
||||
this.hospitalSelectList.push({
|
||||
value: item.HospitalNameCN,
|
||||
...item,
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
querySearch(queryString, cb) {
|
||||
var hospitalList = this.hospitalSelectList
|
||||
var results = queryString
|
||||
? hospitalList.filter(this.createFilter(queryString))
|
||||
: hospitalList
|
||||
// 调用 callback 返回建议列表的数据
|
||||
cb(results)
|
||||
},
|
||||
createFilter(queryString) {
|
||||
return (hospitalList) => {
|
||||
if (this.isEN) {
|
||||
return (
|
||||
hospitalList.HospitalName.toLowerCase().indexOf(
|
||||
queryString.toLowerCase()
|
||||
) >= 0
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
hospitalList.HospitalNameCN.toLowerCase().indexOf(
|
||||
queryString.toLowerCase()
|
||||
) >= 0
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
openEdit(row) {
|
||||
this.form = defaultForm()
|
||||
this.daterange = []
|
||||
@@ -458,6 +521,11 @@ export default {
|
||||
if (this.reviewerId) {
|
||||
this.form.DoctorId = this.reviewerId
|
||||
}
|
||||
let data = Object.assign({}, this.form)
|
||||
if (!this.hospitalList.find((item) => item.Id === data.HospitalId)) {
|
||||
data.Hospital = data.HospitalId
|
||||
data.HospitalId = null
|
||||
}
|
||||
this.loading = true
|
||||
let res = await addOrUpdatePostgraduateInfo(this.form)
|
||||
this.loading = false
|
||||
|
||||
@@ -209,25 +209,35 @@
|
||||
</div>
|
||||
<el-form-item
|
||||
:label="$t('curriculumVitae:info:form:hospital')"
|
||||
prop="HospitalId"
|
||||
prop="HospitalName"
|
||||
v-if="isEN"
|
||||
>
|
||||
<el-select
|
||||
v-model="form.HospitalId"
|
||||
filterable
|
||||
<el-autocomplete
|
||||
clearable
|
||||
class="inline-input"
|
||||
style="width: 100%"
|
||||
v-model="form.HospitalName"
|
||||
:fetch-suggestions="querySearch"
|
||||
@select="handleSelect"
|
||||
placeholder=""
|
||||
@change="handleHospitalChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in hospitalList"
|
||||
:key="index"
|
||||
:label="isEN ? item.HospitalName : item.HospitalNameCN"
|
||||
:value="item.Id"
|
||||
>
|
||||
<span>
|
||||
{{ isEN ? item.HospitalName : item.HospitalNameCN }}
|
||||
</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@change="handleChange"
|
||||
></el-autocomplete>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('curriculumVitae:info:form:hospital')"
|
||||
prop="HospitalNameCN"
|
||||
v-else
|
||||
>
|
||||
<el-autocomplete
|
||||
clearable
|
||||
class="inline-input"
|
||||
style="width: 100%"
|
||||
v-model="form.HospitalNameCN"
|
||||
:fetch-suggestions="querySearch"
|
||||
@select="handleSelect"
|
||||
placeholder=""
|
||||
@change="handleChange"
|
||||
></el-autocomplete>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('curriculumVitae:info:form:AffiliatedUniversity')"
|
||||
@@ -235,7 +245,6 @@
|
||||
v-if="isEN"
|
||||
>
|
||||
<el-input
|
||||
disabled
|
||||
v-model="form.UniversityAffiliated"
|
||||
type="textarea"
|
||||
autosize
|
||||
@@ -249,7 +258,6 @@
|
||||
v-else
|
||||
>
|
||||
<el-input
|
||||
disabled
|
||||
v-model="form.UniversityAffiliatedCN"
|
||||
type="textarea"
|
||||
autosize
|
||||
@@ -261,10 +269,16 @@
|
||||
:label="$t('curriculumVitae:info:form:City')"
|
||||
v-if="isEN"
|
||||
>
|
||||
<el-input disabled v-model="form.City" size="small" />
|
||||
<el-input
|
||||
v-model="form.City"
|
||||
size="small"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('curriculumVitae:info:form:City')" v-else>
|
||||
<el-input disabled v-model="form.CityCN" size="small" />
|
||||
<el-input
|
||||
v-model="form.CityCN"
|
||||
size="small"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('curriculumVitae:info:form:department')"
|
||||
@@ -433,6 +447,8 @@ const defaultForm = () => {
|
||||
RankOther: '',
|
||||
RankOtherCN: '',
|
||||
HospitalId: '',
|
||||
HospitalName: null,
|
||||
HospitalNameCN: null,
|
||||
WorkPartTime: null,
|
||||
WorkPartTimeEn: null,
|
||||
UniversityAffiliated: null,
|
||||
@@ -616,11 +632,18 @@ export default {
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
HospitalId: [
|
||||
HospitalName: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:select'),
|
||||
trigger: 'blur',
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
HospitalNameCN: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
UniversityAffiliated: [
|
||||
@@ -648,16 +671,72 @@ export default {
|
||||
loading: false,
|
||||
dictionaryList: {},
|
||||
otherId: 'ef84e9cb-f1a6-49d7-b6da-34be2c12abd5',
|
||||
hospitalSelectList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['hospitalList']),
|
||||
},
|
||||
watch: {
|
||||
hospitalList: {
|
||||
handler() {
|
||||
if (!Array.isArray(this.hospitalList) || this.hospitalList.length <= 0)
|
||||
return false
|
||||
this.hospitalSelectList = []
|
||||
this.hospitalList.forEach((item) => {
|
||||
if (this.isEN) {
|
||||
this.hospitalSelectList.push({
|
||||
value: item.HospitalName,
|
||||
...item,
|
||||
})
|
||||
} else {
|
||||
this.hospitalSelectList.push({
|
||||
value: item.HospitalNameCN,
|
||||
...item,
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getDicData()
|
||||
store.dispatch('global/getHospital')
|
||||
},
|
||||
methods: {
|
||||
handleChange(v) {
|
||||
if (v) return
|
||||
this.form.UniversityAffiliated = null
|
||||
this.form.City = null
|
||||
this.form.UniversityAffiliatedCN = null
|
||||
this.form.CityCN = null
|
||||
},
|
||||
querySearch(queryString, cb) {
|
||||
var hospitalList = this.hospitalSelectList
|
||||
var results = queryString
|
||||
? hospitalList.filter(this.createFilter(queryString))
|
||||
: hospitalList
|
||||
// 调用 callback 返回建议列表的数据
|
||||
cb(results)
|
||||
},
|
||||
createFilter(queryString) {
|
||||
return (hospitalList) => {
|
||||
if (this.isEN) {
|
||||
return (
|
||||
hospitalList.HospitalName.toLowerCase().indexOf(
|
||||
queryString.toLowerCase()
|
||||
) >= 0
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
hospitalList.HospitalNameCN.toLowerCase().indexOf(
|
||||
queryString.toLowerCase()
|
||||
) >= 0
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
openEdit() {
|
||||
this.form = defaultForm()
|
||||
Object.keys(this.form).forEach((key) => {
|
||||
@@ -666,8 +745,6 @@ export default {
|
||||
}
|
||||
})
|
||||
this.model_cfg.visible = true
|
||||
console.log(this.form)
|
||||
console.log(this.DATA)
|
||||
},
|
||||
handleCancle() {
|
||||
this.form = defaultForm()
|
||||
@@ -680,8 +757,13 @@ export default {
|
||||
if (this.reviewerId) {
|
||||
this.form.Id = this.reviewerId
|
||||
}
|
||||
let data = Object.assign({}, this.form)
|
||||
if (!this.hospitalList.find((item) => item.Id === data.HospitalId)) {
|
||||
data.HospitalName = data.HospitalId
|
||||
data.HospitalId = null
|
||||
}
|
||||
this.loading = true
|
||||
let res = await addOrUpdateDoctorBasicInfoAndEmployment(this.form)
|
||||
let res = await addOrUpdateDoctorBasicInfoAndEmployment(data)
|
||||
this.loading = false
|
||||
if (res.IsSuccess) {
|
||||
this.$emit('update:reviewerId', res.Result.Id)
|
||||
@@ -701,13 +783,18 @@ export default {
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
handleHospitalChange(value) {
|
||||
const item = this.hospitalList.filter((item) => item.Id === value)
|
||||
if (item.length) {
|
||||
this.form.UniversityAffiliated = item[0].UniversityAffiliated
|
||||
this.form.City = item[0].City
|
||||
this.form.UniversityAffiliatedCN = item[0].UniversityAffiliatedCN
|
||||
this.form.CityCN = item[0].CityCN
|
||||
handleSelect(value) {
|
||||
const item = value
|
||||
if (item) {
|
||||
this.form.UniversityAffiliated = item.UniversityAffiliated
|
||||
this.form.City = item.City
|
||||
this.form.UniversityAffiliatedCN = item.UniversityAffiliatedCN
|
||||
this.form.CityCN = item.CityCN
|
||||
} else {
|
||||
this.form.UniversityAffiliated = null
|
||||
this.form.City = null
|
||||
this.form.UniversityAffiliatedCN = null
|
||||
this.form.CityCN = null
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
<template>
|
||||
<base-model v-if="config.visible" :config="config">
|
||||
<template slot="dialog-body">
|
||||
<el-form ref="form" :model="curData" max-height="500px">
|
||||
<template v-for="key in curDataArr">
|
||||
<el-form-item
|
||||
:key="key"
|
||||
:label="$t(`system:loginLog:form:${key}`)"
|
||||
label-width="120px"
|
||||
style="margin-bottom: 0px"
|
||||
>
|
||||
<span v-if="key !== 'UserRoleList'">{{ curData[key] }}</span>
|
||||
<template v-else>
|
||||
<div
|
||||
v-for="item in curData[key]"
|
||||
:key="item.UserTypeEnum"
|
||||
style="margin: 0"
|
||||
>
|
||||
{{ item.UserTypeShortName
|
||||
}}{{ $t('system:loginLog:form:symbol')
|
||||
}}{{ $fd('IsEnable', !item.IsUserRoleDisabled) }}
|
||||
</div>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
</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',
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
curKeys: [
|
||||
'UserName',
|
||||
'FirstName',
|
||||
'LastName',
|
||||
'EMail',
|
||||
'Phone',
|
||||
'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)) {
|
||||
curData[key] = obj[key]
|
||||
}
|
||||
})
|
||||
return curData
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -50,7 +50,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label=" $t('system:loginLog:table:LoginUserType')"
|
||||
:label="$t('system:loginLog:table:LoginUserType')"
|
||||
prop="LoginUserTypeEnum"
|
||||
>
|
||||
<el-select
|
||||
@@ -77,19 +77,15 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="getList"
|
||||
>
|
||||
{{ $t("common:button:search") }}
|
||||
<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") }}
|
||||
{{ $t('common:button:reset') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -110,7 +106,7 @@
|
||||
sortable="custom"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ $fd("UserOptType", scope.row.OptType) }}
|
||||
{{ $fd('UserOptType', scope.row.OptType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -136,12 +132,12 @@
|
||||
/>
|
||||
<el-table-column
|
||||
:label="$t('system:loginLog:table:LoginUserName')"
|
||||
prop="LoginUserName"
|
||||
prop="ActionUserName"
|
||||
min-width="140"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
/>
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
:label="$t('system:loginLog:table:LoginUserType')"
|
||||
prop="LoginUserTypeEnum"
|
||||
min-width="120"
|
||||
@@ -151,15 +147,15 @@
|
||||
<template slot-scope="scope">
|
||||
{{ $fd("UserType", scope.row.LoginUserTypeEnum) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
:label="$t('system:loginLog:table:OptUserName')"
|
||||
prop="OptUserName"
|
||||
prop="TargetIdentityUserName"
|
||||
min-width="200"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
:label="$t('system:loginLog:table:OptUserType')"
|
||||
prop="OptUserTypeEnum"
|
||||
min-width="200"
|
||||
@@ -169,6 +165,21 @@
|
||||
<template slot-scope="scope">
|
||||
{{ $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="$t('system:loginLog:table:CreateTime')"
|
||||
@@ -187,29 +198,31 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<detail :config="config" :JsonObj="JsonObj" />
|
||||
</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 detail from './detail.vue'
|
||||
import moment from 'moment'
|
||||
const searchDataDefault = () => {
|
||||
return {
|
||||
OptType: null,
|
||||
Ip: "",
|
||||
LoginFaildName: "",
|
||||
Ip: '',
|
||||
LoginFaildName: '',
|
||||
LoginUserName: '',
|
||||
LoginUserTypeEnum: null,
|
||||
BeginDate: "",
|
||||
EndDate: "",
|
||||
BeginDate: '',
|
||||
EndDate: '',
|
||||
Asc: false,
|
||||
SortField: "CreateTime",
|
||||
SortField: 'CreateTime',
|
||||
PageIndex: 1,
|
||||
PageSize: 20,
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
export default {
|
||||
components: { Pagination },
|
||||
components: { Pagination, detail },
|
||||
data() {
|
||||
return {
|
||||
moment,
|
||||
@@ -218,52 +231,69 @@ export default {
|
||||
total: 0,
|
||||
loading: false,
|
||||
datetimerange: [],
|
||||
};
|
||||
config: {
|
||||
visible: false,
|
||||
title: this.$t('system:loginLog:dialog:title'),
|
||||
width: '500px',
|
||||
top: '10vh',
|
||||
},
|
||||
JsonObj: null,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
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;
|
||||
this.loading = true
|
||||
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 = ''
|
||||
}
|
||||
},
|
||||
// 重置列表查询
|
||||
handleReset() {
|
||||
this.datetimerange = []
|
||||
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 {
|
||||
|
||||
@@ -5,24 +5,38 @@
|
||||
:model="user"
|
||||
:rules="userFormRules"
|
||||
label-width="150px"
|
||||
style="width:800px;"
|
||||
style="width: 800px"
|
||||
>
|
||||
<el-card class="Basic" shadow="never" size="small">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ $t('system:userlist:title:Information') }}</span>
|
||||
</div>
|
||||
<el-form-item v-if="user.UserCode" :label="$t('system:userlist:table:S/N')" prop="UserCode">
|
||||
<el-form-item
|
||||
v-if="user.UserCode"
|
||||
:label="$t('system:userlist:table:S/N')"
|
||||
prop="UserCode"
|
||||
>
|
||||
<el-input v-model="user.UserCode" disabled />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('system:userlist:table:UserName')" class="my_new_pwd" prop="UserName">
|
||||
<el-form-item
|
||||
:label="$t('system:userlist:table:UserName')"
|
||||
class="my_new_pwd"
|
||||
prop="UserName"
|
||||
>
|
||||
<el-input v-model="user.UserName" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('system:userlist:table:LastName')" prop="LastName">
|
||||
<el-form-item
|
||||
:label="$t('system:userlist:table:LastName')"
|
||||
prop="LastName"
|
||||
>
|
||||
<el-input v-model="user.LastName" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:userlist:table:FirstName')" prop="FirstName">
|
||||
<el-form-item
|
||||
:label="$t('system:userlist:table:FirstName')"
|
||||
prop="FirstName"
|
||||
>
|
||||
<el-input v-model="user.FirstName" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('system:userlist:table:Gender')" prop="Sex" style="margin-right:40px;">
|
||||
@@ -37,44 +51,122 @@
|
||||
<el-form-item :label="$t('system:userlist:table:Phone')" prop="Phone">
|
||||
<el-input v-model="user.Phone" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="type==1" :label="$t('system:userlist:table:Disable')">
|
||||
<el-switch v-model="user.Status" :active-value="1" :inactive-value="0" />
|
||||
<el-form-item
|
||||
v-if="type == 1"
|
||||
:label="$t('system:userlist:table:Disable')"
|
||||
>
|
||||
<el-switch
|
||||
v-model="user.Status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:userlist:table:IsTestUser')">
|
||||
<el-radio-group v-model="user.IsTestUser">
|
||||
<el-radio v-for="item of $d.YesOrNo" :label="item.value">{{ item.label }}</el-radio>
|
||||
<el-radio
|
||||
v-for="item of $d.YesOrNo"
|
||||
:key="item.id"
|
||||
:label="item.value"
|
||||
>{{ item.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:userlist:table:UserType')" prop="UserTypeId">
|
||||
<el-select ref="userType" v-model="user.UserTypeId" size="small" placeholder="Please select" style="width:100%;" :disabled="user.CanEditUserType === false">
|
||||
<el-option
|
||||
v-for="(userType,key) of userTypeOptions"
|
||||
v-if="userType.UserTypeEnum !== 20"
|
||||
:key="key"
|
||||
:label="userType.UserType"
|
||||
:value="userType.Id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-form-item
|
||||
:label="$t('system:userlist:table:UserType')"
|
||||
prop="UserTypeId"
|
||||
>
|
||||
<div style="display: flex; align-items: center">
|
||||
<el-select
|
||||
ref="userType"
|
||||
v-model="user.Roles"
|
||||
size="small"
|
||||
placeholder="Please select"
|
||||
multiple
|
||||
style="width: 100%"
|
||||
:disabled="user.CanEditUserType === false || type === 1"
|
||||
@change="handleChange"
|
||||
v-if="type === 0"
|
||||
>
|
||||
<template v-for="userType of userTypeOptions">
|
||||
<el-option
|
||||
v-if="![4, 6, 20].includes(userType.UserTypeEnum)"
|
||||
:key="userType.Id"
|
||||
:label="userType.UserType"
|
||||
:value="userType.Id"
|
||||
/>
|
||||
</template>
|
||||
</el-select>
|
||||
<el-select
|
||||
ref="userType"
|
||||
v-model="Roles"
|
||||
size="small"
|
||||
placeholder="Please select"
|
||||
multiple
|
||||
style="width: 100%"
|
||||
:disabled="user.CanEditUserType === false || type === 1"
|
||||
@change="handleChange"
|
||||
v-else
|
||||
>
|
||||
<template v-for="userType of userTypeOptions">
|
||||
<el-option
|
||||
v-if="![4, 6, 20].includes(userType.UserTypeEnum)"
|
||||
:key="userType.Id"
|
||||
:label="userType.UserType"
|
||||
:value="userType.Id"
|
||||
/>
|
||||
</template>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
style="margin-left: 5px"
|
||||
v-if="type === 1"
|
||||
@click.stop="openRoleList"
|
||||
>
|
||||
{{ $t('system:userlist:button:roles') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-card>
|
||||
|
||||
<el-card class="Affiliation" shadow="never" style="margin-top:10px;" size="small">
|
||||
<el-card
|
||||
class="Affiliation"
|
||||
shadow="never"
|
||||
style="margin-top: 10px"
|
||||
size="small"
|
||||
>
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ $t('system:userlist:title:Affiliation') }}</span>
|
||||
</div>
|
||||
<el-form-item prop="IsZhiZhun">
|
||||
<el-radio-group v-model="user.IsZhiZhun" @change="OrgnizationTypeChanged">
|
||||
<el-radio :label="true">{{ $t('system:userlist:title:Internal') }}</el-radio>
|
||||
<el-radio :label="false">{{ $t('system:userlist:title:External') }}</el-radio>
|
||||
<el-radio-group
|
||||
v-model="user.IsZhiZhun"
|
||||
@change="OrgnizationTypeChanged"
|
||||
>
|
||||
<el-radio :label="true">{{
|
||||
$t('system:userlist:title:Internal')
|
||||
}}</el-radio>
|
||||
<el-radio :label="false">{{
|
||||
$t('system:userlist:title:External')
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="user.IsZhiZhun === false" :label="$t('system:userlist:table:OrganizationName')">
|
||||
<el-form-item
|
||||
v-show="user.IsZhiZhun === false"
|
||||
:label="$t('system:userlist:table:OrganizationName')"
|
||||
>
|
||||
<el-input v-model="user.OrganizationName" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:userlist:table:Department')" prop="DepartmentName">
|
||||
<el-form-item
|
||||
:label="$t('system:userlist:table:Department')"
|
||||
prop="DepartmentName"
|
||||
>
|
||||
<el-input v-model="user.DepartmentName" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:userlist:table:Position')" prop="PositionName">
|
||||
<el-form-item
|
||||
:label="$t('system:userlist:table:Position')"
|
||||
prop="PositionName"
|
||||
>
|
||||
<el-input v-model="user.PositionName" />
|
||||
</el-form-item>
|
||||
</el-card>
|
||||
@@ -83,20 +175,35 @@
|
||||
type="primary"
|
||||
size="small"
|
||||
:disabled="isDisabled"
|
||||
style="margin:10px 15px"
|
||||
style="margin: 10px 15px"
|
||||
@click="handleSave"
|
||||
>Save</el-button>
|
||||
>Save</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
|
||||
<roleList
|
||||
v-if="visible"
|
||||
:visible.sync="visible"
|
||||
:userId="userId"
|
||||
:list="userRoleList"
|
||||
:userTypeOptions="userTypeOptions"
|
||||
@getRoleList="getRoleList"
|
||||
/>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { getUser, addUser, updateUser, getUserTypeListByUserType } from '@/api/admin.js'
|
||||
import {
|
||||
getUser,
|
||||
addUser,
|
||||
updateUser,
|
||||
getUserTypeListByUserType,
|
||||
} from '@/api/admin.js'
|
||||
import roleList from './roleList.vue'
|
||||
export default {
|
||||
name: 'UserInfo',
|
||||
props: {
|
||||
userId: { type: String, default: '' }
|
||||
userId: { type: String, default: '' },
|
||||
},
|
||||
components: { roleList },
|
||||
created() {
|
||||
this.getUserTypeList()
|
||||
if (this.userId !== '') {
|
||||
@@ -107,26 +214,46 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateQueryParam(param, newValue,wurl) {
|
||||
openRoleList() {
|
||||
this.userRoleList = []
|
||||
this.user.UserRoleList.forEach((item) => {
|
||||
this.userRoleList.push(Object.assign({}, item))
|
||||
})
|
||||
this.visible = true
|
||||
},
|
||||
handleChange(val) {
|
||||
this.user.UserRoleList = []
|
||||
val.forEach((item) => {
|
||||
let data = this.userTypeOptions.find((d) => d.Id === item)
|
||||
this.user.UserRoleList.push({
|
||||
UserTypeEnum: data.UserTypeEnum,
|
||||
UserTypeId: data.Id,
|
||||
IsUserRoleDisabled: false,
|
||||
})
|
||||
})
|
||||
},
|
||||
updateQueryParam(param, newValue, wurl) {
|
||||
// 获取当前URL
|
||||
let url = wurl || window.location.href;
|
||||
let url = wurl || window.location.href
|
||||
|
||||
// 正则表达式匹配参数
|
||||
let regex = new RegExp('([?&])' + param + '=.*?(&|$)');
|
||||
let separator = url.indexOf('?') !== -1 ? '&' : '?';
|
||||
let regex = new RegExp('([?&])' + param + '=.*?(&|$)')
|
||||
let separator = url.indexOf('?') !== -1 ? '&' : '?'
|
||||
|
||||
// 如果参数存在,替换它,如果不存在,添加它
|
||||
if (regex.test(url)) {
|
||||
return url.replace(regex, '$1' + param + '=' + newValue + '$2');
|
||||
return url.replace(regex, '$1' + param + '=' + newValue + '$2')
|
||||
} else {
|
||||
return url + separator + param + '=' + newValue;
|
||||
return url + separator + param + '=' + newValue
|
||||
}
|
||||
},
|
||||
handleSave() {
|
||||
this.$refs.userForm.validate(valid => {
|
||||
this.$refs.userForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.isDisabled = true
|
||||
const selectedUserType = this.userTypeOptions.filter(item => item.Id === this.user.UserTypeId)
|
||||
const selectedUserType = this.userTypeOptions.filter(
|
||||
(item) => item.Id === this.user.UserTypeId
|
||||
)
|
||||
let newUrl = this.updateQueryParam('userName', this.user.UserName)
|
||||
newUrl = this.updateQueryParam('email', this.user.EMail, newUrl)
|
||||
window.history.pushState({ path: newUrl }, '', newUrl)
|
||||
@@ -136,53 +263,112 @@ export default {
|
||||
this.user.BaseUrl = `${location.protocol}//${location.host}/login`
|
||||
this.user.RouteUrl = `${location.protocol}//${location.host}/email-recompose`
|
||||
if (this.user.Id) {
|
||||
updateUser(this.user).then(res => {
|
||||
this.isDisabled = false
|
||||
this.$message.success('Updated successfully')
|
||||
}).catch(() => { this.isDisabled = false })
|
||||
updateUser(this.user)
|
||||
.then((res) => {
|
||||
this.isDisabled = false
|
||||
this.$message.success('Updated successfully')
|
||||
})
|
||||
.catch(() => {
|
||||
this.isDisabled = false
|
||||
})
|
||||
} else {
|
||||
addUser(this.user).then(res => {
|
||||
this.isDisabled = false
|
||||
this.user.Id = res.Result.Id
|
||||
this.user.UserCode = res.Result.UserCode
|
||||
this.$emit('getUserId', res.Result.Id)
|
||||
this.$message.success('Added successfully')
|
||||
this.$router.push({ path: '/system/user/list' })
|
||||
}).catch(() => { this.isDisabled = false })
|
||||
addUser(this.user)
|
||||
.then((res) => {
|
||||
this.isDisabled = false
|
||||
this.user.Id = res.Result.Id
|
||||
this.user.UserCode = res.Result.UserCode
|
||||
this.$emit('getUserId', res.Result.Id)
|
||||
this.$message.success('Added successfully')
|
||||
this.$router.push({ path: '/system/user/list' })
|
||||
})
|
||||
.catch(() => {
|
||||
this.isDisabled = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserTypeList() {
|
||||
getUserTypeListByUserType(0).then(res => {
|
||||
getUserTypeListByUserType(0).then((res) => {
|
||||
if (res.IsSuccess) {
|
||||
this.userTypeOptions = res.Result
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserInfo() {
|
||||
getUser(this.userId).then(res => {
|
||||
getUser({
|
||||
IdentityUserId: this.userId,
|
||||
}).then((res) => {
|
||||
this.user = res.Result
|
||||
this.Roles = []
|
||||
this.user.Roles = []
|
||||
this.user.UserRoleList = []
|
||||
res.Result.AccountList.forEach((item) => {
|
||||
if (!item.IsUserRoleDisabled) {
|
||||
this.Roles.push(item.UserTypeId)
|
||||
this.user.Roles.push(item.UserTypeId)
|
||||
}
|
||||
this.user.UserRoleList.push({
|
||||
UserTypeEnum: item.UserTypeEnum,
|
||||
UserTypeId: item.UserTypeId,
|
||||
IsUserRoleDisabled: item.IsUserRoleDisabled,
|
||||
UserTypeShortName: item.UserTypeShortName,
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
getRoleList() {
|
||||
getUser({
|
||||
IdentityUserId: this.userId,
|
||||
}).then((res) => {
|
||||
this.Roles = []
|
||||
this.user.Roles = []
|
||||
this.user.UserRoleList = []
|
||||
res.Result.AccountList.forEach((item) => {
|
||||
if (!item.IsUserRoleDisabled) {
|
||||
this.Roles.push(item.UserTypeId)
|
||||
this.user.Roles.push(item.UserTypeId)
|
||||
}
|
||||
this.user.UserRoleList.push({
|
||||
UserTypeEnum: item.UserTypeEnum,
|
||||
UserTypeId: item.UserTypeId,
|
||||
IsUserRoleDisabled: item.IsUserRoleDisabled,
|
||||
UserTypeShortName: item.UserTypeShortName,
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
OrgnizationTypeChanged(val) {
|
||||
this.user.OrganizationName = ''
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
var 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 = /^[a-zA-Z0-9_]{4,16}$/; //密码必须是8位以上、必须含有字母、数字、特殊符号
|
||||
console.log(!reg1.test(value))
|
||||
var reg1 = /^[a-zA-Z0-9_]{4,16}$/ //密码必须是8位以上、必须含有字母、数字、特殊符号
|
||||
if (!reg1.test(value)) {
|
||||
callback(lang==='zh' ? new Error("1)新建账号,用户名字符长度最小为4个字符,最大为16个字符,只可使用字母、数字、下划线;") : new Error('For a new account, the username must have:1) At least 4 characters;2) At most 16 characters;3)Only letters, numbers, and underscores are allowed.'))
|
||||
callback(
|
||||
lang === 'zh'
|
||||
? new Error(
|
||||
'1)新建账号,用户名字符长度最小为4个字符,最大为16个字符,只可使用字母、数字、下划线;'
|
||||
)
|
||||
: new Error(
|
||||
'For a new account, the username must have:1) At least 4 characters;2) At most 16 characters;3)Only letters, numbers, and underscores are allowed.'
|
||||
)
|
||||
)
|
||||
} else {
|
||||
callback();
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
userRoleList: [],
|
||||
Roles: [],
|
||||
user: {
|
||||
Roles: [],
|
||||
UserRoleList: [],
|
||||
UserName: '',
|
||||
LastName: '',
|
||||
FirstName: '',
|
||||
@@ -194,65 +380,75 @@ export default {
|
||||
OrganizationName: '',
|
||||
DepartmentName: '',
|
||||
PositionName: '',
|
||||
IsTestUser: false
|
||||
IsTestUser: false,
|
||||
},
|
||||
visible: false,
|
||||
userFormRules: {
|
||||
UserName: [
|
||||
{ required: true, validator: validatePassword, trigger: 'blur' }
|
||||
{ required: true, validator: validatePassword, trigger: 'blur' },
|
||||
],
|
||||
UserTypeId: [
|
||||
{ required: true, message: 'Please Select', trigger: ['blur', 'change'] }
|
||||
Roles: [
|
||||
{
|
||||
required: true,
|
||||
message: 'Please Select',
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
IsZhiZhun: [
|
||||
{ required: true, message: 'Please Select', trigger: ['blur', 'change'] }
|
||||
{
|
||||
required: true,
|
||||
message: 'Please Select',
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
OrganizationName: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' }
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
],
|
||||
LastName: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
{ max: 50, message: 'The maximum length is 50' }
|
||||
{ max: 50, message: 'The maximum length is 50' },
|
||||
],
|
||||
FirstName: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
{ max: 50, message: 'The maximum length is 50' }
|
||||
{ max: 50, message: 'The maximum length is 50' },
|
||||
],
|
||||
Phone: [
|
||||
{ max: 20, min: 7, message: 'The length is 7 to 20', trigger: ['blur'] }
|
||||
{
|
||||
max: 20,
|
||||
min: 7,
|
||||
message: 'The length is 7 to 20',
|
||||
trigger: ['blur'],
|
||||
},
|
||||
],
|
||||
EMail: [
|
||||
{
|
||||
required: true,
|
||||
message: 'Please input the email address',
|
||||
trigger: 'blur'
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
type: 'email',
|
||||
message: 'Please input the correct email address',
|
||||
trigger: ['blur']
|
||||
trigger: ['blur'],
|
||||
},
|
||||
{ max: 50, message: 'The maximum length is 50' }
|
||||
],
|
||||
Sex: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' }
|
||||
{ max: 50, message: 'The maximum length is 50' },
|
||||
],
|
||||
Sex: [{ required: true, message: 'Please specify', trigger: 'blur' }],
|
||||
Status: [
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' }
|
||||
{ required: true, message: 'Please specify', trigger: 'blur' },
|
||||
],
|
||||
DepartmentName: [
|
||||
{ max: 50, message: 'The maximum length is 50' }],
|
||||
PositionName: [{ max: 50, message: 'The maximum length is 50' }
|
||||
]
|
||||
DepartmentName: [{ max: 50, message: 'The maximum length is 50' }],
|
||||
PositionName: [{ max: 50, message: 'The maximum length is 50' }],
|
||||
},
|
||||
userTypeOptions: [],
|
||||
isDisabled: false,
|
||||
type: 0 // 1为编辑,0为新增
|
||||
type: 0, // 1为编辑,0为新增
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .is-error.my_new_pwd{
|
||||
::v-deep .is-error.my_new_pwd {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-if="visible"
|
||||
:visible.sync="visible"
|
||||
v-dialogDrag
|
||||
width="540px"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
append-to-body
|
||||
:title="$t('system:userlist:roleList:title')"
|
||||
:before-close="cancel"
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click.stop="openAdd"
|
||||
style="float: right"
|
||||
>
|
||||
{{ $t('common:button:new') }}
|
||||
</el-button>
|
||||
<el-table
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
max-height="300px"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-table-column type="index" width="40" />
|
||||
<el-table-column
|
||||
prop="UserTypeShortName"
|
||||
:label="$t('system:userlist:roleList:table:UserTypeShortName')"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="IsUserRoleDisabled"
|
||||
:label="$t('system:userlist:roleList:table:IsUserRoleDisabled')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span> {{ $fd('IsEnable', !scope.row.IsUserRoleDisabled) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('common:action:action')" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
:disabled="scope.row.IsUserRoleDisabled"
|
||||
@click.stop="scope.row.IsUserRoleDisabled = true"
|
||||
>
|
||||
{{ $fd('IsEnable', false) }}
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
:disabled="!scope.row.IsUserRoleDisabled"
|
||||
@click.stop="scope.row.IsUserRoleDisabled = false"
|
||||
>
|
||||
{{ $fd('IsEnable', true) }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer">
|
||||
<!-- 保存 -->
|
||||
<el-button type="primary" :loading="loading" size="small" @click="save">
|
||||
{{ $t('common:button:confirm') }}
|
||||
</el-button>
|
||||
<!-- 取消 -->
|
||||
<el-button size="small" @click="cancel">
|
||||
{{ $t('common:button:cancel') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<el-dialog
|
||||
v-if="addVisible"
|
||||
:visible.sync="addVisible"
|
||||
v-dialogDrag
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
append-to-body
|
||||
width="540px"
|
||||
:title="$t('system:userlist:roleList:addTitle')"
|
||||
>
|
||||
<el-form ref="addForm" :model="form" :rules="rule" label-width="80px">
|
||||
<el-form-item :label="$t('system:userlist:table:UserType')">
|
||||
<el-select
|
||||
v-model="form.roles"
|
||||
size="small"
|
||||
placeholder=""
|
||||
multiple
|
||||
style="width: 100%"
|
||||
>
|
||||
<template v-for="item of roleList">
|
||||
<el-option
|
||||
:key="item.Id"
|
||||
:label="item.UserType"
|
||||
:value="item.Id"
|
||||
/>
|
||||
</template>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<!-- 保存 -->
|
||||
<el-button type="primary" size="small" @click="saveAdd">
|
||||
{{ $t('common:button:confirm') }}
|
||||
</el-button>
|
||||
<!-- 取消 -->
|
||||
<el-button size="small" @click="addVisible = false">
|
||||
{{ $t('common:button:cancel') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { updateUserRoleInfo } from '@/api/admin.js'
|
||||
export default {
|
||||
name: 'roleList',
|
||||
props: {
|
||||
userId: { type: String, default: '' },
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
list: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
},
|
||||
},
|
||||
userTypeOptions: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addVisible: false,
|
||||
loading: false,
|
||||
form: {
|
||||
roles: [],
|
||||
},
|
||||
rule: {
|
||||
roles: [
|
||||
{
|
||||
required: true,
|
||||
message: 'Please Select',
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
roleList() {
|
||||
let arr = this.list.map((item) => item.UserTypeId)
|
||||
return this.userTypeOptions.filter(
|
||||
(item) =>
|
||||
!arr.includes(item.Id) && ![4, 6, 20].includes(userType.UserTypeEnum)
|
||||
)
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.$emit('update:visible', false)
|
||||
},
|
||||
openAdd() {
|
||||
this.addVisible = true
|
||||
},
|
||||
async save() {
|
||||
try {
|
||||
let data = {
|
||||
Id: this.userId,
|
||||
UserRoleList: this.list,
|
||||
}
|
||||
this.loading = true
|
||||
let res = await updateUserRoleInfo(data)
|
||||
this.loading = false
|
||||
if (res.IsSuccess) {
|
||||
this.$message.success(this.$t('common:message:updatedSuccessfully'))
|
||||
this.$emit('update:visible', false)
|
||||
this.$emit('getRoleList')
|
||||
}
|
||||
} catch (err) {
|
||||
this.loading = false
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
async saveAdd() {
|
||||
try {
|
||||
let validate = await this.$refs.addForm.validate()
|
||||
if (!validate) return
|
||||
let arr = this.userTypeOptions.filter((item) =>
|
||||
this.form.roles.includes(item.Id)
|
||||
)
|
||||
arr.forEach((item) => {
|
||||
this.list.push({
|
||||
UserTypeEnum: item.UserTypeEnum,
|
||||
UserTypeId: item.Id,
|
||||
IsUserRoleDisabled: false,
|
||||
UserTypeShortName: item.UserTypeShortName,
|
||||
})
|
||||
})
|
||||
this.addVisible = false
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -35,6 +35,16 @@
|
||||
<template slot="genderSlot" slot-scope="{ scope }">
|
||||
{{ scope.row.Sex ? 'Male' : 'Female' }}
|
||||
</template>
|
||||
<template slot="UserTypeSlot" slot-scope="{ scope }">
|
||||
{{
|
||||
Array.isArray(scope.row.UserRoleList) &&
|
||||
scope.row.UserRoleList.length > 0
|
||||
? scope.row.UserRoleList.map((item) => item.UserTypeShortName).join(
|
||||
','
|
||||
)
|
||||
: ''
|
||||
}}
|
||||
</template>
|
||||
<template slot="roleSlot" slot-scope="{ scope }">
|
||||
{{ scope.row.RoleNameList.map((role) => role.RoleName).join(',') }}
|
||||
</template>
|
||||
@@ -85,8 +95,12 @@ const searchDataDefault = () => {
|
||||
RealName: '',
|
||||
BeginCreateTime: '',
|
||||
EndCreateTime: '',
|
||||
EndLastLoginTime: null,
|
||||
EndLastChangePassWordTime: null,
|
||||
BeginLastChangePassWordTime: null,
|
||||
CreateTimeArr: [],
|
||||
LastLoginTimeArr: [],
|
||||
LastChangePassWordTimeArr: [],
|
||||
SortField: 'CreateTime',
|
||||
}
|
||||
}
|
||||
@@ -115,7 +129,7 @@ export default {
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'RealName',
|
||||
prop: 'FullName',
|
||||
label: this.$t('system:userlist:table:RealName'),
|
||||
minWidth: 120,
|
||||
sortable: 'custom',
|
||||
@@ -154,6 +168,7 @@ export default {
|
||||
prop: 'UserType',
|
||||
label: this.$t('system:userlist:table:UserType'),
|
||||
minWidth: 100,
|
||||
slot: 'UserTypeSlot',
|
||||
sortable: 'custom',
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
@@ -191,6 +206,13 @@ export default {
|
||||
sortable: 'custom',
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'LastChangePassWordTime',
|
||||
label: this.$t('system:userlist:table:LastChangePassWordTime'),
|
||||
minWidth: 250,
|
||||
sortable: 'custom',
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'CreateTime',
|
||||
label: this.$t('system:userlist:table:createTime'),
|
||||
@@ -202,6 +224,7 @@ export default {
|
||||
type: 'operate',
|
||||
label: this.$t('common:action:action'),
|
||||
minWidth: 200,
|
||||
fixed: 'right',
|
||||
operates: [
|
||||
{
|
||||
name: this.$t('common:button:edit'),
|
||||
@@ -326,6 +349,13 @@ export default {
|
||||
width: '400px',
|
||||
placeholder: '',
|
||||
},
|
||||
{
|
||||
type: 'Daterange',
|
||||
label: this.$t('system:userlist:label:LastChangePassWordTime'),
|
||||
prop: 'LastChangePassWordTimeArr',
|
||||
width: '400px',
|
||||
placeholder: '',
|
||||
},
|
||||
{
|
||||
type: 'Daterange',
|
||||
label: this.$t('system:userlist:label:CreateTime'),
|
||||
@@ -430,6 +460,12 @@ export default {
|
||||
this.searchData.BeginLastLoginTime = this.searchData.LastLoginTimeArr[0]
|
||||
this.searchData.EndLastLoginTime = this.searchData.LastLoginTimeArr[1]
|
||||
}
|
||||
if (this.searchData.LastChangePassWordTimeArr.length > 0) {
|
||||
this.searchData.BeginLastChangePassWordTime =
|
||||
this.searchData.LastChangePassWordTimeArr[0]
|
||||
this.searchData.EndLastChangePassWordTime =
|
||||
this.searchData.LastChangePassWordTimeArr[1]
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
},
|
||||
|
||||
@@ -44,7 +44,6 @@ export default {
|
||||
this.$i18n.locale = lang
|
||||
this.setLanguage(lang)
|
||||
this.$updateDictionary()
|
||||
console.log(Vue)
|
||||
this.$upload()
|
||||
window.location.reload()
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<img v-else src="@/assets/zzlogo4.png" alt="" />
|
||||
<span style="white-space: nowrap" v-if="NODE_ENV !== 'usa'">
|
||||
<!-- 中心影像系统(EICS) -->
|
||||
{{ $t("trials:trials:title:eics") }}
|
||||
{{ $t('trials:trials:title:eics') }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="center-menu">
|
||||
@@ -39,13 +39,17 @@
|
||||
>
|
||||
<i class="el-icon-odometer" />
|
||||
<!-- 工作台 -->
|
||||
<span slot="title">{{ $t("trials:menuTitle:workbench") }}</span>
|
||||
<span slot="title">{{ $t('trials:menuTitle:workbench') }}</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item v-if="!hasPermi(['role:zys','role:zyss','role:zybs'])" index="2" :disabled="TotalNeedSignSystemDocCount !== 0">
|
||||
<el-menu-item
|
||||
v-if="!hasPermi(['role:zys', 'role:zyss', 'role:zybs'])"
|
||||
index="2"
|
||||
:disabled="TotalNeedSignSystemDocCount !== 0"
|
||||
>
|
||||
<i class="el-icon-box" />
|
||||
<!-- 我的项目 -->
|
||||
<span slot="title">
|
||||
{{ $t("trials:tab:trials") }}
|
||||
{{ $t('trials:tab:trials') }}
|
||||
</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item
|
||||
@@ -63,7 +67,7 @@
|
||||
>
|
||||
<i class="el-icon-chat-dot-square" />
|
||||
<!-- 通知消息 -->
|
||||
<span slot="title">{{ $t("trials:tab:notice") }}</span>
|
||||
<span slot="title">{{ $t('trials:tab:notice') }}</span>
|
||||
</el-menu-item>
|
||||
|
||||
<el-submenu index="4" class="my_info">
|
||||
@@ -75,128 +79,226 @@
|
||||
</span>
|
||||
<!-- 账户信息 -->
|
||||
<el-menu-item v-if="!hasPermi(['role:air'])" index="4-2">{{
|
||||
$t("trials:trials-myinfo:title:accountInfo")
|
||||
$t('trials:trials-myinfo:title:accountInfo')
|
||||
}}</el-menu-item>
|
||||
<!-- 管理后台 -->
|
||||
<el-menu-item
|
||||
v-if="hasPermi(['role:dev', 'role:oa', 'role:admin'])"
|
||||
index="4-4"
|
||||
>{{ $t("trials:trials-myinfo:title:system") }}</el-menu-item
|
||||
>{{ $t('trials:trials-myinfo:title:system') }}</el-menu-item
|
||||
>
|
||||
<!-- 切换角色 -->
|
||||
<el-menu-item index="4-5" v-if="hasRole">{{
|
||||
$t('trials:trials-myinfo:title:toggleRole')
|
||||
}}</el-menu-item>
|
||||
<!-- 退出 -->
|
||||
<el-menu-item index="4-3">{{
|
||||
$t("trials:trials-myinfo:button:loginout")
|
||||
$t('trials:trials-myinfo:button:loginout')
|
||||
}}</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-menu>
|
||||
<TopLang v-if="VUE_APP_OSS_CONFIG_REGION !== 'oss-us-west-1'&& NODE_ENV !== 'usa'" />
|
||||
<TopLang
|
||||
v-if="
|
||||
VUE_APP_OSS_CONFIG_REGION !== 'oss-us-west-1' && NODE_ENV !== 'usa'
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<toggleRole
|
||||
v-if="toggleRoleVisible"
|
||||
:visible.sync="toggleRoleVisible"
|
||||
:loading="toggleRoleLoading"
|
||||
@save="loginByRole"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters, mapMutations } from "vuex";
|
||||
import TopLang from "./topLang";
|
||||
import NoticeMarquee from "./noticeMarquee";
|
||||
import { mapGetters, mapMutations } from 'vuex'
|
||||
import TopLang from './topLang'
|
||||
import NoticeMarquee from './noticeMarquee'
|
||||
import { resetRouter } from '@/router'
|
||||
import toggleRole from '@/components/toggleRole'
|
||||
export default {
|
||||
components: { TopLang, NoticeMarquee },
|
||||
components: { TopLang, NoticeMarquee, toggleRole },
|
||||
data() {
|
||||
return {
|
||||
activeIndex: "2",
|
||||
activeIndex: '2',
|
||||
isReviewer: false,
|
||||
userTypeShortName: zzSessionStorage.getItem("userTypeShortName"),
|
||||
notice: "",
|
||||
// userTypeShortName: zzSessionStorage.getItem('userTypeShortName'),
|
||||
notice: '',
|
||||
VUE_APP_OSS_CONFIG_REGION: process.env.VUE_APP_OSS_CONFIG_REGION,
|
||||
NODE_ENV: process.env.NODE_ENV,
|
||||
};
|
||||
toggleRoleVisible: false,
|
||||
toggleRoleLoading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
"sidebar",
|
||||
"name",
|
||||
"userName",
|
||||
"device",
|
||||
"TotalNeedSignSystemDocCount",
|
||||
"language",
|
||||
'sidebar',
|
||||
'name',
|
||||
'userName',
|
||||
'device',
|
||||
'TotalNeedSignSystemDocCount',
|
||||
'language',
|
||||
'userTypeShortName',
|
||||
]),
|
||||
roles() {
|
||||
return this.$store.state.user.roles
|
||||
},
|
||||
hasRole() {
|
||||
return this.roles && this.roles.length > 1
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
$route(v) {
|
||||
this.changeRoute(v);
|
||||
this.changeRoute(v)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
console.log(!this.hasPermi(["role:air"]));
|
||||
this.isReviewer = JSON.parse(zzSessionStorage.getItem("IsReviewer"));
|
||||
this.changeRoute(this.$route);
|
||||
// this.isReviewer = JSON.parse(zzSessionStorage.getItem('IsReviewer'))
|
||||
this.changeRoute(this.$route)
|
||||
},
|
||||
methods: {
|
||||
...mapMutations({ setLanguage: "lang/setLanguage" }),
|
||||
...mapMutations({ setLanguage: 'lang/setLanguage' }),
|
||||
changeRoute(v) {
|
||||
if (v.path === "/trials/trials-workbench") {
|
||||
this.activeIndex = "1";
|
||||
if (v.path === '/trials/trials-workbench') {
|
||||
this.activeIndex = '1'
|
||||
}
|
||||
if (
|
||||
v.path === "/trials/trials-list" ||
|
||||
~v.path.indexOf("/trials/trials-panel")
|
||||
v.path === '/trials/trials-list' ||
|
||||
~v.path.indexOf('/trials/trials-panel')
|
||||
) {
|
||||
this.activeIndex = "2";
|
||||
this.activeIndex = '2'
|
||||
}
|
||||
if (v.path === "/trials/trials-notice") {
|
||||
this.activeIndex = "3";
|
||||
if (v.path === '/trials/trials-notice') {
|
||||
this.activeIndex = '3'
|
||||
}
|
||||
if (v.path === "/trials/trials-myinfo") {
|
||||
this.activeIndex = "4-2";
|
||||
if (v.path === '/trials/trials-myinfo') {
|
||||
this.activeIndex = '4-2'
|
||||
}
|
||||
},
|
||||
handleSelect(key, keyPath) {
|
||||
switch (key) {
|
||||
case "4-2":
|
||||
this.go("/trials/trials-myinfo");
|
||||
break;
|
||||
case "4-3":
|
||||
this.logout();
|
||||
break;
|
||||
case "4-4":
|
||||
this.go("/dashboard/list");
|
||||
break;
|
||||
case "1":
|
||||
this.go("/trials/trials-workbench");
|
||||
break;
|
||||
case "2":
|
||||
if (~this.$route.path.indexOf("/trials/trials-panel")) {
|
||||
return;
|
||||
case '4-2':
|
||||
this.go('/trials/trials-myinfo')
|
||||
break
|
||||
case '4-3':
|
||||
this.logout()
|
||||
break
|
||||
case '4-4':
|
||||
this.go('/dashboard/list')
|
||||
break
|
||||
case '4-5':
|
||||
// this.go('/dashboard/list')
|
||||
// console.log('切换角色')
|
||||
this.$store.dispatch('user/getUserInfo').then((res) => {
|
||||
this.toggleRoleVisible = true
|
||||
})
|
||||
|
||||
break
|
||||
case '1':
|
||||
this.go('/trials/trials-workbench')
|
||||
break
|
||||
case '2':
|
||||
if (~this.$route.path.indexOf('/trials/trials-panel')) {
|
||||
return
|
||||
}
|
||||
var lastWorkbench = zzSessionStorage.getItem("lastWorkbench");
|
||||
var lastWorkbench = zzSessionStorage.getItem('lastWorkbench')
|
||||
if (lastWorkbench) {
|
||||
this.go(lastWorkbench);
|
||||
this.go(lastWorkbench)
|
||||
} else {
|
||||
this.go("/trials/trials-list");
|
||||
this.go('/trials/trials-list')
|
||||
}
|
||||
break;
|
||||
case "3":
|
||||
this.go("/trials/trials-notice");
|
||||
break;
|
||||
break
|
||||
case '3':
|
||||
this.go('/trials/trials-notice')
|
||||
break
|
||||
}
|
||||
},
|
||||
toggleSideBar() {
|
||||
this.$store.dispatch("app/toggleSideBar");
|
||||
this.$store.dispatch('app/toggleSideBar')
|
||||
},
|
||||
async logout() {
|
||||
await this.$store.dispatch("user/logout");
|
||||
this.$router.push(`/login`);
|
||||
this.$i18n.locale = "zh";
|
||||
this.setLanguage("zh");
|
||||
this.$updateDictionary();
|
||||
await this.$store.dispatch('user/logout')
|
||||
this.$router.push(`/login`)
|
||||
this.$i18n.locale = 'zh'
|
||||
this.setLanguage('zh')
|
||||
this.$updateDictionary()
|
||||
},
|
||||
go(value) {
|
||||
this.$router.push({ path: value });
|
||||
this.$router.push({ path: value })
|
||||
},
|
||||
account() {
|
||||
this.$router.push({ name: "Account" });
|
||||
this.$router.push({ name: 'Account' })
|
||||
},
|
||||
loginByRole(userRoleId) {
|
||||
if (this.$store.state.user.userId === userRoleId) {
|
||||
this.toggleRoleVisible = false
|
||||
this.toggleRoleLoading = false
|
||||
return false
|
||||
}
|
||||
this.toggleRoleLoading = true
|
||||
this.$store
|
||||
.dispatch('user/loginByRole', { userRoleId })
|
||||
.then((res) => {
|
||||
if (res) {
|
||||
this.$store
|
||||
.dispatch('permission/generateRoutes')
|
||||
.then(async (res) => {
|
||||
if (res && res.length > 0) {
|
||||
resetRouter()
|
||||
await this.$store.dispatch('global/getNoticeList')
|
||||
this.$router.addRoutes(res)
|
||||
this.toggleRoleLoading = false
|
||||
if (this.loginType === 'DevOps') {
|
||||
this.$router.replace({ path: res[0].path })
|
||||
return
|
||||
}
|
||||
if (this.hasPermi(['role:radmin'])) {
|
||||
this.$router.replace({ path: res[0].path })
|
||||
return
|
||||
}
|
||||
if (
|
||||
this.hasPermi([
|
||||
'role:air',
|
||||
'role:rpm',
|
||||
'role:rcrc',
|
||||
'role:rir',
|
||||
])
|
||||
) {
|
||||
history.replaceState(null, null, '/trials/trials-list')
|
||||
history.go(0)
|
||||
// this.$router.replace({ path: '/trials/trials-list' })
|
||||
} else {
|
||||
history.replaceState(null, null, '/trials/trials-workbench')
|
||||
history.go(0)
|
||||
// this.$router.replace({ path: '/trials/trials-workbench' })
|
||||
}
|
||||
this.toggleRoleVisible = false
|
||||
this.toggleRoleLoading = false
|
||||
this.$EventBus.$emit('reload')
|
||||
// this.$nextTick(() => {
|
||||
// window.location.reload()
|
||||
// })
|
||||
} else {
|
||||
// 此账户暂未配置菜单权限,请联系管理员处理后再登录。
|
||||
this.toggleRoleLoading = false
|
||||
this.$message.warning(this.$t('login:message:login2'))
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
this.toggleRoleLoading = false
|
||||
})
|
||||
} else {
|
||||
this.toggleRoleLoading = false
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.toggleRoleLoading = false
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -788,6 +788,11 @@ export default {
|
||||
created() {
|
||||
this.initPage()
|
||||
},
|
||||
mounted(){
|
||||
this.$EventBus.$on("reload", (data) => {
|
||||
window.location.reload()
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initPage() {
|
||||
this.getList()
|
||||
|
||||
@@ -108,6 +108,35 @@
|
||||
{{ $t('trials:trials-myinfo:button:update') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('trials:trials-myinfo:form:toggleRole')"
|
||||
style="position: relative"
|
||||
prop="VerificationCode"
|
||||
v-if="hasRole"
|
||||
>
|
||||
<el-radio-group v-model="userRoleId" class="roles" v-if="hasRole">
|
||||
<el-radio
|
||||
v-for="item in roles"
|
||||
:key="item.Id"
|
||||
:label="item.Id"
|
||||
:disabled="item.isUserRoleDisabled"
|
||||
style="margin-bottom: 10px"
|
||||
>
|
||||
{{ item.UserTypeShortName }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<!-- 修改 -->
|
||||
<el-button
|
||||
:disabled="!userRoleId || saveDisabled"
|
||||
class="saveBtn"
|
||||
:loading="toggleRoleLoading"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="toggleRole"
|
||||
>
|
||||
{{ $t('trials:trials-myinfo:button:toggleRole') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<password />
|
||||
@@ -142,6 +171,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
userForm: {},
|
||||
userRoleId: null,
|
||||
toggleRoleLoading: false,
|
||||
sendDisabled: true,
|
||||
sendTitle: this.$t('trials:trials-myinfo:button:getVCode'),
|
||||
rule: {
|
||||
@@ -174,7 +205,38 @@ export default {
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.userRoleId = zzSessionStorage.getItem('userId')
|
||||
},
|
||||
computed: {
|
||||
roles() {
|
||||
return this.$store.state.user.roles
|
||||
},
|
||||
hasRole() {
|
||||
return this.roles && this.roles.length > 1
|
||||
},
|
||||
saveDisabled() {
|
||||
return this.userRoleId === zzSessionStorage.getItem('userId')
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 切换角色
|
||||
toggleRole() {
|
||||
if (
|
||||
this.userRoleId === zzSessionStorage.getItem('userId') ||
|
||||
this.toggleRoleLoading
|
||||
)
|
||||
return false
|
||||
this.toggleRoleLoading = true
|
||||
this.$store
|
||||
.dispatch('user/loginByRole', { userRoleId: this.userRoleId })
|
||||
.then((res) => {
|
||||
window.location.reload()
|
||||
})
|
||||
.catch(() => {
|
||||
this.toggleRoleLoading = false
|
||||
})
|
||||
},
|
||||
setNewEmail() {
|
||||
setNewEmail(this.userForm.EMail, this.userForm.VerificationCode).then(
|
||||
() => {
|
||||
@@ -277,4 +339,12 @@ export default {
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.el-radio-group {
|
||||
margin-top: 12px;
|
||||
}
|
||||
.el-radio {
|
||||
width: 60px;
|
||||
}
|
||||
</style>
|
||||
@@ -107,11 +107,11 @@ export default {
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.07)',
|
||||
})
|
||||
getUser(this.userId)
|
||||
getUser()
|
||||
.then(async (res) => {
|
||||
this.user = res.Result
|
||||
/* eslint-disable */
|
||||
zzSessionStorage.setItem('realName', this.user.RealName)
|
||||
zzSessionStorage.setItem('Name', this.user.FullName)
|
||||
await store.dispatch('user/updateInfo')
|
||||
loading.close()
|
||||
})
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { updateUser } from "@/api/admin.js";
|
||||
import { updateUserBasicInfo } from "@/api/admin.js";
|
||||
export default {
|
||||
name: "mine",
|
||||
props: {
|
||||
@@ -179,7 +179,7 @@ export default {
|
||||
// this.user.OrganizationName = 'ZhiZhun'
|
||||
// }
|
||||
if (this.user.Id) {
|
||||
updateUser(this.user)
|
||||
updateUserBasicInfo(this.user)
|
||||
.then((res) => {
|
||||
this.isDisabled = false;
|
||||
this.$message.success(
|
||||
|
||||
@@ -525,7 +525,7 @@ export default {
|
||||
.getElementsByTagName('canvas')
|
||||
let a = document.createElement('a')
|
||||
a.href = qrCodeCanvas[0].toDataURL('image/url')
|
||||
a.download = `${this.$t('trials:researchRecord:title:code')}.png`
|
||||
a.download = `${this.$route.query.researchProgramNo}${this.$t('trials:researchRecord:title:code')}.png`
|
||||
a.click()
|
||||
},
|
||||
// 复制二维码
|
||||
|
||||
@@ -307,23 +307,21 @@
|
||||
</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="adInfo.ReadingTaskState < 2">
|
||||
<div style="text-align: center">
|
||||
<el-button type="primary" @click="skipTask">
|
||||
<!-- 跳过 -->
|
||||
{{ $t("trials:readingReport:button:skip") }}
|
||||
</el-button>
|
||||
<!-- 保存 -->
|
||||
<el-button type="primary" @click="handleSave">{{
|
||||
$t("common:button:save")
|
||||
}}</el-button>
|
||||
<!-- 提交 -->
|
||||
<el-button type="primary" @click="handleSubmit">{{
|
||||
$t("common:button:submit")
|
||||
}}</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="text-align: center;width:100%" v-if="adInfo.ReadingTaskState < 2">
|
||||
<el-button type="primary" @click="skipTask">
|
||||
<!-- 跳过 -->
|
||||
{{ $t("trials:readingReport:button:skip") }}
|
||||
</el-button>
|
||||
<!-- 保存 -->
|
||||
<el-button type="primary" @click="handleSave">{{
|
||||
$t("common:button:save")
|
||||
}}</el-button>
|
||||
<!-- 提交 -->
|
||||
<el-button type="primary" @click="handleSubmit">{{
|
||||
$t("common:button:submit")
|
||||
}}</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card
|
||||
|
||||
@@ -148,12 +148,14 @@ import LengthTool from '@/views/trials/trials-panel/reading/dicoms/tools/Length/
|
||||
import BidirectionalTool from '@/views/trials/trials-panel/reading/dicoms/tools/Bidirectional/BidirectionalTool'
|
||||
import ArrowAnnotateTool from '@/views/trials/trials-panel/reading/dicoms/tools/ArrowAnnotate/ArrowAnnotateTool'
|
||||
import RectangleRoiTool from '@/views/trials/trials-panel/reading/dicoms/tools/RectangleRoi/RectangleRoiTool'
|
||||
import ProbeTool from '@/views/trials/trials-panel/reading/dicoms/tools/Probe/ProbeTool'
|
||||
// import OrientationMarkersTool from '@/views/trials/trials-panel/reading/dicoms/tools/OrientationMarkers/OrientationMarkersTool'
|
||||
import ScaleOverlayTool from '@/views/trials/trials-panel/reading/dicoms/tools/ScaleOverlay/ScaleOverlayTool'
|
||||
import getOrientationString from '@/views/trials/trials-panel/reading/dicoms/tools/OrientationMarkers/getOrientationString'
|
||||
import invertOrientationString from '@/views/trials/trials-panel/reading/dicoms/tools/OrientationMarkers/invertOrientationString'
|
||||
// import calculateLongestAndShortestDiameters from '@/views/trials/trials-panel/reading/dicoms/tools/Bidirectional/calculateLongestAndShortestDiameters'
|
||||
import calculateSUV from '@/views/trials/trials-panel/reading/dicoms/tools/calculateSUV'
|
||||
// import { ProbeTool } from '@cornerstonejs/tools'
|
||||
cornerstoneTools.external.cornerstone = cornerstone
|
||||
cornerstoneTools.external.Hammer = Hammer
|
||||
cornerstoneTools.external.cornerstoneMath = cornerstoneMath
|
||||
@@ -799,8 +801,8 @@ export default {
|
||||
measureData.ww = Math.round(viewport.voi.windowWidth)
|
||||
measureData.wc = Math.round(viewport.voi.windowCenter)
|
||||
var questionInfo = this.measureData[idx]
|
||||
const canvas = this.canvas.querySelector('canvas')
|
||||
measureData.pictureBaseStr = canvas.toDataURL('image/png', 1)
|
||||
// const canvas = this.canvas.querySelector('canvas')
|
||||
// measureData.pictureBaseStr = canvas.toDataURL('image/png', 1)
|
||||
measureData.data.active = false
|
||||
this.$emit('modifyMeasureData', { measureData, questionInfo })
|
||||
// e.stopImmediatePropagation()
|
||||
@@ -1000,26 +1002,14 @@ export default {
|
||||
if (i > -1) {
|
||||
var idx = this.measureData.findIndex(item => item.MeasureData && item.MeasureData.data && item.MeasureData.data.uuid === toolState.data[i].uuid)
|
||||
if (idx > -1) {
|
||||
// console.log('mouseClick')
|
||||
DicomEvent.$emit('setCollapseActive', this.measureData[idx])
|
||||
if (this.readingTaskState < 2) {
|
||||
const measureData = {}
|
||||
var markName = this.measureData[idx].OrderMarkName
|
||||
if (this.disabledMarks.indexOf(markName) === -1 || !this.disabledMarks) {
|
||||
// if (toolType === 'Bidirectional') {
|
||||
// const {
|
||||
// longestDiameter,
|
||||
// shortestDiameter
|
||||
// } = calculateLongestAndShortestDiameters(toolState.data[i], image, this.digitPlaces)
|
||||
// toolState.data[i].longestDiameter = longestDiameter
|
||||
// toolState.data[i].shortestDiameter = shortestDiameter
|
||||
// }
|
||||
// if (toolType === 'Length') {
|
||||
// toolState.data[i].length = this.calculateLenth(toolState.data[i])
|
||||
// }
|
||||
var questionInfo = this.measureData[idx]
|
||||
const canvas = this.canvas.querySelector('canvas')
|
||||
measureData.pictureBaseStr = canvas.toDataURL('image/png', 1)
|
||||
// const canvas = this.canvas.querySelector('canvas')
|
||||
// measureData.pictureBaseStr = canvas.toDataURL('image/png', 1)
|
||||
measureData.studyId = this.stack.studyId
|
||||
measureData.seriesId = this.stack.seriesId
|
||||
measureData.instanceId = instanceId
|
||||
@@ -1031,6 +1021,10 @@ export default {
|
||||
measureData.ww = Math.round(viewport.voi.windowWidth)
|
||||
measureData.wc = Math.round(viewport.voi.windowCenter)
|
||||
measureData.data.active = false
|
||||
var criterionType = parseInt(localStorage.getItem('CriterionType'))
|
||||
if (criterionType === 21) {
|
||||
measureData.tableQuestionId = this.measureData[idx].TableQuestionId
|
||||
}
|
||||
this.$emit('modifyMeasureData', { measureData, questionInfo })
|
||||
}
|
||||
}
|
||||
@@ -1161,6 +1155,8 @@ export default {
|
||||
cornerstoneTools.addToolForElement(element, ArrowAnnotateTool, { configuration: { allowEmptyLabel: true, handleRadius: false, drawHandlesOnHover: true, hideHandlesIfMoving: true }})
|
||||
} else if (toolName === 'RectangleRoi') {
|
||||
cornerstoneTools.addToolForElement(element, RectangleRoiTool, { configuration: { allowEmptyLabel: true, handleRadius: false, drawHandlesOnHover: true, hideHandlesIfMoving: true }})
|
||||
} else if (toolName === 'Probe' && parseInt(localStorage.getItem('CriterionType')) === 21) {
|
||||
cornerstoneTools.addToolForElement(element, ProbeTool, { configuration: { fixedRadius: 5, handleRadius: true, drawHandlesOnHover: true, hideHandlesIfMoving: true, digits: this.digitPlaces }})
|
||||
} else {
|
||||
cornerstoneTools.addToolForElement(element, apiTool)
|
||||
}
|
||||
@@ -1351,8 +1347,8 @@ export default {
|
||||
measureData.ww = Math.round(viewport.voi.windowWidth)
|
||||
measureData.wc = Math.round(viewport.voi.windowCenter)
|
||||
|
||||
const canvas = this.canvas.querySelector('canvas')
|
||||
measureData.pictureBaseStr = canvas.toDataURL('image/png', 1)
|
||||
// const canvas = this.canvas.querySelector('canvas')
|
||||
// measureData.pictureBaseStr = canvas.toDataURL('image/png', 1)
|
||||
this.$emit('setMeasureData', measureData)
|
||||
cornerstoneTools.setToolPassiveForElement(this.canvas, e.detail.toolName)
|
||||
} else if (e.detail.toolName === 'Bidirectional') {
|
||||
@@ -1367,8 +1363,22 @@ export default {
|
||||
measureData.location = this.dicomInfo.location
|
||||
measureData.ww = Math.round(viewport.voi.windowWidth)
|
||||
measureData.wc = Math.round(viewport.voi.windowCenter)
|
||||
const canvas = this.canvas.querySelector('canvas')
|
||||
measureData.pictureBaseStr = canvas.toDataURL('image/png', 1)
|
||||
// const canvas = this.canvas.querySelector('canvas')
|
||||
// measureData.pictureBaseStr = canvas.toDataURL('image/png', 1)
|
||||
this.$emit('setMeasureData', measureData)
|
||||
cornerstoneTools.setToolPassiveForElement(this.canvas, e.detail.toolName)
|
||||
} else if (e.detail.toolName === 'Probe') {
|
||||
const measureData = {}
|
||||
measureData.studyId = this.stack.studyId
|
||||
measureData.seriesId = this.stack.seriesId
|
||||
measureData.instanceId = instanceId
|
||||
measureData.frame = this.stack.frame ? this.stack.frame : 0
|
||||
measureData.data = e.detail.measurementData
|
||||
measureData.type = e.detail.toolName
|
||||
measureData.thick = this.dicomInfo.thick
|
||||
measureData.location = this.dicomInfo.location
|
||||
measureData.ww = Math.round(viewport.voi.windowWidth)
|
||||
measureData.wc = Math.round(viewport.voi.windowCenter)
|
||||
this.$emit('setMeasureData', measureData)
|
||||
cornerstoneTools.setToolPassiveForElement(this.canvas, e.detail.toolName)
|
||||
} else if (!e.detail.toolName) {
|
||||
@@ -1448,7 +1458,7 @@ export default {
|
||||
},
|
||||
onMeasurementmodified(e) {
|
||||
// 移动
|
||||
// console.log('modified')
|
||||
console.log('modified')
|
||||
if (this.readingTaskState >= 2) return
|
||||
const { measurementData, toolType } = e.detail
|
||||
var element = cornerstone.getEnabledElement(this.canvas)
|
||||
@@ -1466,8 +1476,8 @@ export default {
|
||||
var markName = this.measureData[idx].OrderMarkName
|
||||
if (this.disabledMarks.indexOf(markName) === -1 || !this.disabledMarks) {
|
||||
var questionInfo = this.measureData[idx]
|
||||
const canvas = this.canvas.querySelector('canvas')
|
||||
measureData.pictureBaseStr = canvas.toDataURL('image/png', 1)
|
||||
// const canvas = this.canvas.querySelector('canvas')
|
||||
// measureData.pictureBaseStr = canvas.toDataURL('image/png', 1)
|
||||
measureData.studyId = this.stack.studyId
|
||||
measureData.seriesId = this.stack.seriesId
|
||||
measureData.instanceId = instanceId
|
||||
@@ -1479,6 +1489,10 @@ export default {
|
||||
measureData.ww = Math.round(viewport.voi.windowWidth)
|
||||
measureData.wc = Math.round(viewport.voi.windowCenter)
|
||||
measureData.data.active = false
|
||||
var criterionType = parseInt(localStorage.getItem('CriterionType'))
|
||||
if (criterionType === 21) {
|
||||
measureData.tableQuestionId = this.measureData[idx].TableQuestionId
|
||||
}
|
||||
this.$emit('modifyMeasureData', { measureData, questionInfo })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -493,6 +493,14 @@
|
||||
:is-show="isShow"
|
||||
:is-reading-show-subject-info="isReadingShowSubjectInfo"
|
||||
/>
|
||||
<MRIPDFF
|
||||
v-else-if="CriterionType === 21"
|
||||
ref="measurementList"
|
||||
:question-form-change-state="questionFormChangeState"
|
||||
:question-form-change-num="questionFormChangeNum"
|
||||
:is-show="isShow"
|
||||
:is-reading-show-subject-info="isReadingShowSubjectInfo"
|
||||
/>
|
||||
<h2 v-else style="color:#ddd">
|
||||
Developing...
|
||||
</h2>
|
||||
@@ -786,6 +794,7 @@ import PCWGQuestionList from './PCWG/QuestionList'
|
||||
import LuganoQuestionList from './Lugano/QuestionList'
|
||||
import IVUSList from './IVUS/QuestionList'
|
||||
import OCTList from './OCT/QuestionList'
|
||||
import MRIPDFF from './MRIPDFF/QuestionList'
|
||||
import CustomWwwcForm from './CustomWwwcForm'
|
||||
import Manuals from './Manuals'
|
||||
import Hotkeys from './Hotkeys'
|
||||
@@ -818,6 +827,7 @@ export default {
|
||||
LuganoQuestionList,
|
||||
IVUSList,
|
||||
OCTList,
|
||||
MRIPDFF,
|
||||
'download-dicom-and-nonedicom': downloadDicomAndNonedicom,
|
||||
'upload-dicom-and-nonedicom': uploadDicomAndNonedicom,
|
||||
SignForm
|
||||
@@ -978,7 +988,8 @@ export default {
|
||||
taskId: '',
|
||||
signVisible: false,
|
||||
signCode: null,
|
||||
currentUser: zzSessionStorage.getItem('userName')
|
||||
currentUser: zzSessionStorage.getItem('userName'),
|
||||
tmpData: null
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1067,6 +1078,10 @@ export default {
|
||||
this.measuredTools = []
|
||||
} else if (this.CriterionType === 20) {
|
||||
this.measuredTools = []
|
||||
} else if (this.CriterionType === 21) {
|
||||
this.measuredTools = [{
|
||||
toolName: 'Probe', text: this.$t('trials:reading:button:circle'), icon: 'oval', isDisabled: false, disabledReason: ''
|
||||
}]
|
||||
}
|
||||
this.rotateList[0] = '1'
|
||||
this.colorList[0] = ''
|
||||
@@ -1178,6 +1193,11 @@ export default {
|
||||
this.petctWindow.close()
|
||||
}
|
||||
})
|
||||
DicomEvent.$on('addAnnotation', async obj => {
|
||||
this.tmpData = Object.assign({}, obj.question)
|
||||
await this.imageLocation(obj.locateInfo)
|
||||
this.setToolActive('Probe', true, null, 'tableQuestion')
|
||||
})
|
||||
window.addEventListener('beforeunload', () => {
|
||||
if (this.petctWindow) {
|
||||
this.petctWindow.close()
|
||||
@@ -1600,7 +1620,7 @@ export default {
|
||||
var activeCanvasTaskId = obj.visitTaskId
|
||||
|
||||
var index = this.visitTaskList.findIndex(i => i.VisitTaskId === activeCanvasTaskId)
|
||||
if (index === -1) {
|
||||
if (index === -1) {
|
||||
resolve()
|
||||
return
|
||||
}
|
||||
@@ -2046,6 +2066,9 @@ export default {
|
||||
},
|
||||
// 设置测量工具启用(不会对输入作出反应)
|
||||
setToolActive(toolName, isMeasuredTool, e, type) {
|
||||
if (!type) {
|
||||
this.tmpData = null
|
||||
}
|
||||
if (isMeasuredTool) {
|
||||
// var i = this.measuredTools.findIndex(item => item.toolName === toolName)
|
||||
// if (i === -1 && this.measuredTools[i].isDisabled) return
|
||||
@@ -2144,13 +2167,27 @@ export default {
|
||||
},
|
||||
// 添加标记
|
||||
setMeasureData(data) {
|
||||
this.$refs['measurementList'].setMeasuredData(data)
|
||||
if (this.CriterionType === 21) {
|
||||
if (this.tmpData) {
|
||||
data.tableQuestionId = this.tmpData.Id
|
||||
data.tableQuestionMark = this.tmpData.QuestionMark
|
||||
this.$refs['measurementList'].setMeasuredData(data)
|
||||
}
|
||||
} else {
|
||||
this.$refs['measurementList'].setMeasuredData(data)
|
||||
}
|
||||
this.activeTool = ''
|
||||
|
||||
},
|
||||
// 修改标记
|
||||
modifyMeasureData(data) {
|
||||
this.$refs['measurementList'].modifyMeasuredData(data)
|
||||
if (this.CriterionType === 21 && data.measureData.tableQuestionId) {
|
||||
this.$refs['measurementList'].modifyMeasuredData(data)
|
||||
} else {
|
||||
this.$refs['measurementList'].modifyMeasuredData(data)
|
||||
}
|
||||
this.activeTool = ''
|
||||
|
||||
},
|
||||
async saveImage() {
|
||||
// this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].saveImage()
|
||||
|
||||
@@ -0,0 +1,814 @@
|
||||
<template>
|
||||
<el-form
|
||||
v-if="isRender"
|
||||
ref="measurementForm"
|
||||
v-loading="loading"
|
||||
:model="questionForm"
|
||||
size="mini"
|
||||
class="measurement-form"
|
||||
>
|
||||
<div class="base-dialog-body">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<h3 v-if="questionName" style="color: #ddd;padding: 5px 0px;margin: 0;">
|
||||
<!-- {{ lesionName }} -->
|
||||
</h3>
|
||||
<!-- 关闭 -->
|
||||
<div>
|
||||
<i class="el-icon-circle-close" style="font-size: 25px;cursor: pointer;" @click="handleClose" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<el-form-item
|
||||
v-for="qs in questions"
|
||||
v-show="qs.ShowQuestion!==2"
|
||||
:key="qs.Id"
|
||||
:label="`${qs.QuestionName}`"
|
||||
:prop="qs.Id"
|
||||
:rules="[
|
||||
{ required: (qs.IsRequired === 0 || (qs.IsRequired ===1 && qs.RelevanceId && (String(questionForm[qs.RelevanceId]) === qs.RelevanceValue)) || (qs.QuestionMark === 6 && questionForm.IsCanEditPosition === true) || (questionForm.IsCanEditPosition && qs.QuestionMark === 10)) && qs.Type!=='group' && qs.Type!=='summary',
|
||||
message:['radio', 'select', 'checkbox'].includes(qs.Type) ? $t('common:ruleMessage:select') : $t('common:ruleMessage:specify'), trigger: ['blur','change']},
|
||||
]"
|
||||
style="flex-wrap: wrap"
|
||||
>
|
||||
|
||||
<!-- 输入框 -->
|
||||
<template v-if="(qs.Type==='input' || qs.Type==='number') && (qs.QuestionMark === 1101 || qs.QuestionMark === 1102 || qs.QuestionMark === 1103)">
|
||||
<div style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center;">
|
||||
<el-input
|
||||
v-model="questionForm[qs.Id]"
|
||||
disabled
|
||||
style="width: 100px;"
|
||||
>
|
||||
<template v-if="qs.Unit" slot="append">
|
||||
{{ $fd('ValueUnit', parseInt(qs.Unit)) }}
|
||||
</template>
|
||||
</el-input>
|
||||
<!-- 测量 -->
|
||||
<el-button
|
||||
v-if="questionForm[isMeasurableId] && parseInt(questionForm[isMeasurableId]) === 1 && !questionForm[qs.Id] && readingTaskState!== 2"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="addAnnotation(qs)"
|
||||
>
|
||||
{{$t('trials:MRIPDFF:button:measure')}}
|
||||
</el-button>
|
||||
<!-- 清除标记 -->
|
||||
<el-button
|
||||
v-if="getAnnotationStatus(qs) && readingTaskState!== 2"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="removeAnnotation(qs)"
|
||||
style="margin-left: 0px"
|
||||
>
|
||||
{{$t('trials:MRIPDFF:button:clear')}}
|
||||
</el-button>
|
||||
<!-- 返回 -->
|
||||
<el-button
|
||||
v-if="questionForm[qs.Id]"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="locateAnnotation(qs)"
|
||||
style="margin-left: 0px"
|
||||
>
|
||||
{{$t('trials:MRIPDFF:button:return')}}
|
||||
</el-button>
|
||||
<!-- 保存 -->
|
||||
<el-button
|
||||
v-if="questionForm[isMeasurableId] && parseInt(questionForm[isMeasurableId]) === 1 && questionForm[qs.Id] && readingTaskState!== 2"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="saveAnnotation(qs)"
|
||||
style="margin-left: 0px"
|
||||
>
|
||||
<!-- 未保存 -->
|
||||
<el-tooltip v-if="getAnnotationSaveEnum(qs) === 0" class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom">
|
||||
<i class="el-icon-warning" style="color:red" />
|
||||
</el-tooltip>
|
||||
{{ $t('common:button:save') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="qs.Type==='input' || qs.Type==='number'">
|
||||
<el-input
|
||||
v-model="questionForm[qs.Id]"
|
||||
:disabled="!isCurrentTask || readingTaskState>=2"
|
||||
@change="((val)=>{formItemChange(val, qs)})"
|
||||
>
|
||||
<template v-if="(qs.QuestionMark===0 || qs.QuestionMark===1) && qs.Unit" slot="append">
|
||||
{{ $fd('ValueUnit', parseInt(qs.Unit)) }}
|
||||
</template>
|
||||
</el-input>
|
||||
</template>
|
||||
<!-- 多行文本输入框 -->
|
||||
<el-input
|
||||
v-else-if="qs.Type==='textarea'"
|
||||
v-model="questionForm[qs.Id]"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
:disabled="!isCurrentTask || readingTaskState>=2"
|
||||
@change="((val)=>{formItemChange(val, qs)})"
|
||||
/>
|
||||
<!-- 下拉框 -->
|
||||
|
||||
<el-select
|
||||
v-else-if="qs.Type==='select'"
|
||||
v-model="questionForm[qs.Id]"
|
||||
filterable
|
||||
:placeholder="$t('common:placeholder:select')"
|
||||
:disabled="!isCurrentTask || readingTaskState>=2 || qs.QuestionMark === 1106"
|
||||
@change="((val)=>{formItemChange(val, qs)})"
|
||||
>
|
||||
<template v-if="qs.TableQuestionType === 1">
|
||||
<el-option
|
||||
v-for="item in organList"
|
||||
:key="item.Id"
|
||||
:label="item[qs.DataTableColumn]"
|
||||
:value="item[qs.DataTableColumn]"
|
||||
/>
|
||||
</template>
|
||||
<template v-else-if="qs.DictionaryCode">
|
||||
<el-option
|
||||
v-for="item of $d[qs.DictionaryCode]"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-option
|
||||
v-for="val in qs.TypeValue.split('|')"
|
||||
:key="val"
|
||||
:label="val"
|
||||
:value="val"
|
||||
/>
|
||||
</template>
|
||||
|
||||
</el-select>
|
||||
<!-- 单选 -->
|
||||
<el-radio-group
|
||||
v-else-if="qs.Type==='radio'"
|
||||
v-model="questionForm[qs.Id]"
|
||||
:disabled="!isCurrentTask || readingTaskState>=2"
|
||||
@change="((val)=>{formItemChange(val, qs)})"
|
||||
>
|
||||
<template v-if="qs.DictionaryCode.length > 0">
|
||||
<el-radio
|
||||
v-for="item in $d[qs.DictionaryCode]"
|
||||
:key="item.id"
|
||||
:label="item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
</template>
|
||||
<template v-else-if="qs.options.length > 0">
|
||||
<el-radio
|
||||
v-for="val in qs.options.split('|')"
|
||||
:key="val"
|
||||
:label="val"
|
||||
>
|
||||
{{ val }}
|
||||
</el-radio>
|
||||
</template>
|
||||
</el-radio-group>
|
||||
<!-- 自动计算 -->
|
||||
<el-input
|
||||
v-else-if="qs.Type==='calculation'"
|
||||
v-model="questionForm[qs.Id]"
|
||||
disabled
|
||||
@change="((val)=>{formItemChange(val, qs)})"
|
||||
>
|
||||
<template v-if="qs.Unit" slot="append">
|
||||
{{ $fd('ValueUnit', parseInt(qs.Unit)) }}
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="isCurrentTask && readingTaskState<2"
|
||||
class="base-dialog-footer"
|
||||
style="text-align:right;margin-top:10px;"
|
||||
>
|
||||
<!-- 保存 -->
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleSave"
|
||||
>
|
||||
{{ $t('common:button:save') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { submitTableQuestion } from '@/api/trials'
|
||||
import { saveTableQuestionMark, deleteTableQuestionMark } from '@/api/reading'
|
||||
import DicomEvent from './../DicomEvent'
|
||||
import store from '@/store'
|
||||
export default {
|
||||
name: 'MeasurementForm',
|
||||
props: {
|
||||
questions: {
|
||||
type: Array,
|
||||
default() { return [] }
|
||||
},
|
||||
answers: {
|
||||
type: Object,
|
||||
default() { return {} }
|
||||
},
|
||||
lesionType: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
visitTaskId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
parentQsId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
isCurrentTask: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
readingTaskState: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
isBaseLineTask: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
orderMark: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
questionName: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
rowIndex: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
tableQuestions: {
|
||||
type: Array,
|
||||
default() { return [] }
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
questionForm: {},
|
||||
loading: false,
|
||||
trialId: '',
|
||||
originalQuestionForm: {},
|
||||
isRender: false,
|
||||
lesionName: '',
|
||||
lesionMark: '',
|
||||
activeQuestionId: '',
|
||||
activeQuestionMark: '',
|
||||
markList: [],
|
||||
digitPlaces: 2,
|
||||
isMeasurableId: '',
|
||||
isExitsMarks: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.trialId = this.$route.query.trialId
|
||||
let digitPlaces = Number(localStorage.getItem('digitPlaces'))
|
||||
this.digitPlaces = digitPlaces === -1 ? this.digitPlaces : digitPlaces
|
||||
this.initForm()
|
||||
DicomEvent.$on('handleImageQualityAbnormal', () => {
|
||||
this.setState()
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
DicomEvent.$off('handleImageQualityAbnormal')
|
||||
},
|
||||
methods: {
|
||||
async initForm() {
|
||||
this.isRender = false
|
||||
this.isMeasurableId = this.getQuestionId(1105)
|
||||
// const loading = this.$loading({ fullscreen: true })
|
||||
this.questions.forEach(item => {
|
||||
var val = this.answers[item.Id]
|
||||
if (item.DictionaryCode) {
|
||||
val = isNaN(parseInt(this.answers[item.Id])) ? this.answers[item.Id] : parseInt(this.answers[item.Id])
|
||||
}
|
||||
if (item.Id === this.isMeasurableId && !isNaN(parseInt(this.questionForm[item.Id]))) {
|
||||
// 不做处理?
|
||||
console.log(this.questionForm[item.Id])
|
||||
} else {
|
||||
this.$set(this.questionForm, item.Id, val)
|
||||
}
|
||||
|
||||
})
|
||||
this.$set(this.questionForm, 'MeasureData', this.answers.MeasureData ? JSON.parse(this.answers.MeasureData) : '')
|
||||
this.$set(this.questionForm, 'RowIndex', this.answers.RowIndex ? this.answers.RowIndex : '')
|
||||
this.$set(this.questionForm, 'RowId', this.answers.RowId ? this.answers.RowId : '')
|
||||
|
||||
// saveTypeEnum 0:未保存过(新建病灶);1:已保存,信息不完整(随访初始化病灶/分裂病灶,通过状态判断);2:已保存,信息完整
|
||||
let isMeasurable = this.getQuestionVal(1105)
|
||||
this.$set(this.questionForm, 'saveTypeEnum', isMeasurable === '' ? 1 : 2)
|
||||
|
||||
this.lesionName = this.getLesionInfo(this.orderMark, this.rowIndex)
|
||||
this.lesionMark = this.getLesionName(this.orderMark, 1101)
|
||||
this.originalQuestionForm = { ...this.questionForm }
|
||||
this.markList = []
|
||||
this.isExitsMarks = false
|
||||
if (this.answers.TableQuestionMarkList) {
|
||||
let arr = JSON.parse(this.answers.TableQuestionMarkList)
|
||||
arr.map(i=>{
|
||||
if (i.MeasureData) {
|
||||
this.isExitsMarks = true
|
||||
}
|
||||
this.markList.push({tableQuestionId: i.TableQuestionId, measureData: i, saveEnum: 1})
|
||||
})
|
||||
}
|
||||
|
||||
this.isRender = true
|
||||
// loading.close()
|
||||
},
|
||||
getLesionName(orderMark, questionMark) {
|
||||
// 根据肝脏分段枚举和第一次(或第二次或第三次)测量问题标识定义标记名称
|
||||
// I II III IV V VI VII VIII
|
||||
// L-I-01 L-I-02 L-I-03
|
||||
// L-II-01 L-II-02 L-II-03
|
||||
let segArr = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII']
|
||||
let lessionName = ''
|
||||
let segmentId = this.getQuestionId(1106)
|
||||
let segmentVal = this.answers[segmentId]
|
||||
segmentVal = segmentVal ? parseInt(segmentVal) : null
|
||||
if (segmentVal) {
|
||||
let i = questionMark === 1101 ? '01' : questionMark === 1102 ? '02' : questionMark === 1103 ? '03' : ''
|
||||
lessionName = `${orderMark}-${segArr[segmentVal - 1]}-${i}`
|
||||
}
|
||||
return lessionName
|
||||
},
|
||||
getLesionInfo(orderMark, rowIndex) {
|
||||
var arr = []
|
||||
var lessionName = ''
|
||||
var rowIndexArr = rowIndex.split('.')
|
||||
var x = parseInt(rowIndexArr[0])
|
||||
var y = parseInt(rowIndexArr[1])
|
||||
if (y > 0) {
|
||||
y = String.fromCharCode(parseInt(rowIndexArr[1]) - 1 + 65 + 32)
|
||||
lessionName = `${orderMark}${String(x).padStart(2, '0')}${y}`
|
||||
arr.push(lessionName)
|
||||
} else {
|
||||
lessionName = `${orderMark}${String(x).padStart(2, '0')}`
|
||||
arr.push(lessionName)
|
||||
}
|
||||
return arr.join(' ')
|
||||
},
|
||||
getQuestionId(questionMark) {
|
||||
var idx = this.questions.findIndex(i => i.QuestionMark === questionMark)
|
||||
if (idx > -1) {
|
||||
return this.questions[idx].Id
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
getOrganInfoList(isLymphNodes = null) {
|
||||
return new Promise(async resolve => {
|
||||
// var param = {
|
||||
// trialId: this.trialId,
|
||||
// visitTaskId: this.visitTaskId,
|
||||
// lesionType: this.lesionType,
|
||||
// isEnable: true
|
||||
// }
|
||||
// if (isLymphNodes !== undefined && isLymphNodes !== null) {
|
||||
// param.isLymphNodes = isLymphNodes
|
||||
// }
|
||||
// getTrialOrganList(param).then(res => {
|
||||
// this.organList = res.Result
|
||||
// resolve()
|
||||
// })
|
||||
if (!sessionStorage.getItem('organList')) {
|
||||
await store.dispatch('reading/getOrganInfo', this.visitTaskId)
|
||||
}
|
||||
var organList = sessionStorage.getItem('organList') ? JSON.parse(sessionStorage.getItem('organList')) : []
|
||||
var idx = organList.findIndex(i => i.LesionType === this.lesionType)
|
||||
if (idx > -1) {
|
||||
organList = organList[idx].OrganList
|
||||
|
||||
if (!isNaN(parseInt(isLymphNodes))) {
|
||||
this.organList = organList.filter((item) => item.IsLymphNodes === parseInt(isLymphNodes))
|
||||
} else {
|
||||
this.organList = organList
|
||||
}
|
||||
}
|
||||
resolve()
|
||||
})
|
||||
},
|
||||
async formItemChange(v, qs) {
|
||||
// 维护平均值、是否可测量等信息
|
||||
this.$set(this.questionForm, 'saveTypeEnum', 1)
|
||||
const mean = this.getQuestionVal(1104)
|
||||
if (qs.QuestionMark === 1101 || qs.QuestionMark === 1102 || qs.QuestionMark === 1103) {
|
||||
let newMean = this.getMean()
|
||||
if (newMean !== mean) {
|
||||
let meanId = this.getQuestionId(1104)
|
||||
this.$set(this.questionForm, meanId, newMean ? newMean : '')
|
||||
}
|
||||
}
|
||||
const isMeasurable = this.getQuestionVal(1105)
|
||||
this.$emit('resetQuestions', { mean, isMeasurable, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
|
||||
},
|
||||
getMean() {
|
||||
let mean = null
|
||||
let l1 = this.getQuestionVal(1101)
|
||||
let l2 = this.getQuestionVal(1102)
|
||||
let l3 = this.getQuestionVal(1103)
|
||||
if (!isNaN(parseFloat(l1)) && !isNaN(parseFloat(l2)) && !isNaN(parseFloat(l3))) {
|
||||
const sum = l1 + l2 + l3
|
||||
mean = sum / 3
|
||||
}
|
||||
|
||||
return mean ? mean.toFixed(this.digitPlaces) : null;
|
||||
},
|
||||
setMeasureData(measureData, isInit = false) {
|
||||
return new Promise(resolve => {
|
||||
if (!measureData || (measureData && measureData.tableQuestionId !== this.activeQuestionId)) {
|
||||
resolve()
|
||||
}
|
||||
var data = {}
|
||||
// 创建标记
|
||||
if (!measureData.data.remark) {
|
||||
// 维护标记信息
|
||||
measureData.data.remark = this.getLesionName(this.orderMark, this.activeQuestionMark)
|
||||
}
|
||||
this.$set(this.questionForm, measureData.tableQuestionId, measureData.data.cachedStats.mean)
|
||||
data = {
|
||||
Id: '',
|
||||
StudyId: measureData.studyId,
|
||||
InstanceId: measureData.instanceId,
|
||||
SeriesId: measureData.seriesId,
|
||||
MeasureData: measureData,
|
||||
QuestionId: this.parentQsId,
|
||||
RowIndex: this.questionForm.RowIndex,
|
||||
RowId: this.questionForm.RowId,
|
||||
VisitTaskId: this.visitTaskId,
|
||||
NumberOfFrames: isNaN(parseInt(measureData.frame)) ? 0 : measureData.frame,
|
||||
frame: isNaN(parseInt(measureData.frame)) ? 0 : measureData.frame,
|
||||
OrderMarkName: measureData.data.remark,
|
||||
TableQuestionId: measureData.tableQuestionId
|
||||
}
|
||||
store.dispatch('reading/addMeasuredData', { visitTaskId: this.visitTaskId, data: data })
|
||||
let mean = this.getQuestionVal(1104)
|
||||
let newMean = this.getMean()
|
||||
if (newMean !== mean) {
|
||||
mean = newMean
|
||||
let meanId = this.getQuestionId(1104)
|
||||
this.$set(this.questionForm, meanId, newMean ? newMean : '')
|
||||
}
|
||||
const isMeasurable = this.getQuestionVal(1105)
|
||||
this.$emit('resetQuestions', { mean, isMeasurable, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
|
||||
|
||||
DicomEvent.$emit('refreshStudyListMeasureData')
|
||||
let i = this.markList.findIndex(i=>i.tableQuestionId === measureData.tableQuestionId)
|
||||
if (i === -1) {
|
||||
this.markList.push({tableQuestionId: measureData.tableQuestionId, measureData: data, saveEnum: 0})
|
||||
} else {
|
||||
this.markList[i].saveEnum = 0
|
||||
this.markList[i].measureData = data
|
||||
}
|
||||
|
||||
resolve()
|
||||
})
|
||||
},
|
||||
addAnnotation(qs) {
|
||||
let orderMarkName = this.getLesionName(this.orderMark, qs.QuestionMark)
|
||||
this.activeQuestionId = qs.Id
|
||||
this.activeQuestionMark= qs.QuestionMark
|
||||
DicomEvent.$emit('addAnnotation', {question: qs, locateInfo: { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: orderMarkName, lesionType: null, markTool: 'Probe', readingTaskState: this.readingTaskState, isMarked: true }})
|
||||
},
|
||||
getAnnotationSaveEnum(qs) {
|
||||
let i = this.markList.findIndex(i=>i.tableQuestionId === qs.Id)
|
||||
if (i > -1) {
|
||||
return this.markList[i].saveEnum
|
||||
} else {
|
||||
return 1
|
||||
}
|
||||
},
|
||||
getAnnotationStatus(qs) {
|
||||
let i = this.markList.findIndex(i=>i.tableQuestionId === qs.Id)
|
||||
if (i > -1 && this.markList[i].measureData && this.markList[i].measureData.MeasureData) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
async removeAnnotation(qs) {
|
||||
let i = this.markList.findIndex(i=>i.tableQuestionId === qs.Id)
|
||||
DicomEvent.$emit('imageLocation', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.markList[i].measureData.OrderMarkName, lesionType: null, markTool: 'Probe', readingTaskState: this.readingTaskState, isMarked: true })
|
||||
// 是否确认清除标记?
|
||||
const confirm = await this.$confirm(
|
||||
this.$t('trials:reading:warnning:msg47'),
|
||||
{
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
}
|
||||
)
|
||||
if (confirm !== 'confirm') return
|
||||
|
||||
let measureData = Object.assign({}, this.markList[i].measureData)
|
||||
// 移除缓存中的measureData
|
||||
await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: measureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, orderMarkName: measureData.OrderMarkName})
|
||||
DicomEvent.$emit('getMeasureData')
|
||||
this.markList[i].measureData = null
|
||||
this.markList[i].saveEnum = 0
|
||||
// 清除测量值、清除平均值
|
||||
this.$set(this.questionForm, this.markList[i].tableQuestionId, '')
|
||||
let meanId = this.getQuestionId(1104)
|
||||
this.$set(this.questionForm, meanId, '')
|
||||
},
|
||||
locateAnnotation(qs) {
|
||||
let i = this.markList.findIndex(i=>i.tableQuestionId === qs.Id)
|
||||
let measureData = this.markList[i].measureData
|
||||
// 定位
|
||||
var markTool = 'Probe'
|
||||
var readingTaskState = this.readingTaskState
|
||||
var isMarked = !!measureData
|
||||
DicomEvent.$emit('imageLocation', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: measureData.OrderMarkName, lesionType: null, markTool, readingTaskState, isMarked })
|
||||
},
|
||||
async saveAnnotation(qs) {
|
||||
const loading = this.$loading({ fullscreen: true })
|
||||
try {
|
||||
let i = this.markList.findIndex(i=>i.tableQuestionId === qs.Id)
|
||||
let params = {}
|
||||
if (i > -1 && this.markList[i].measureData && this.markList[i].measureData.MeasureData) {
|
||||
let measureData = this.markList[i].measureData.MeasureData
|
||||
// 上传截图
|
||||
DicomEvent.$emit('getScreenshots', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: measureData.OrderMarkName, lesionType: null, isMarked: !!measureData }, async val => {
|
||||
params = Object.assign({}, this.markList[i].measureData)
|
||||
if (val) {
|
||||
let pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val)
|
||||
params.PicturePath = pictureObj.isSuccess ? this.$getObjectName(pictureObj.result.url) : ''
|
||||
}
|
||||
let tableQuestionId = this.markList[i].tableQuestionId
|
||||
params.Answer = this.questionForm[tableQuestionId]
|
||||
params.MeasureData = JSON.stringify(this.markList[i].measureData.MeasureData)
|
||||
loading.close()
|
||||
this.saveTableQuestionInfo(params, qs)
|
||||
})
|
||||
} else {
|
||||
params = {
|
||||
Answer: "",
|
||||
VisitTaskId: this.visitTaskId,
|
||||
QuestionId: this.parentQsId,
|
||||
InstanceId: '',
|
||||
SeriesId: '',
|
||||
StudyId: '',
|
||||
MarkTool:'',
|
||||
PicturePath: '',
|
||||
NumberOfFrames: 0,
|
||||
MeasureData: '',
|
||||
QuestionType: 0,
|
||||
OrderMarkName: '',
|
||||
RowId: this.questionForm.RowId,
|
||||
TableQuestionId: qs.Id,
|
||||
RowIndex: this.questionForm.RowIndex
|
||||
}
|
||||
loading.close()
|
||||
this.saveTableQuestionInfo(params, qs)
|
||||
}
|
||||
|
||||
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
loading.close()
|
||||
}
|
||||
},
|
||||
async saveTableQuestionInfo(params, qs) {
|
||||
const loading = this.$loading({ fullscreen: true })
|
||||
try {
|
||||
let res = await saveTableQuestionMark(params)
|
||||
if (res.IsSuccess) {
|
||||
// 保存后设置保存状态
|
||||
let i = this.markList.findIndex(i=>i.tableQuestionId === qs.Id)
|
||||
this.markList[i].saveEnum = 1
|
||||
// 保存成功
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
// 刷新表格、刷新标记信息
|
||||
this.$emit('getReadingQuestionAndAnswer')
|
||||
loading.close()
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
loading.close()
|
||||
}
|
||||
},
|
||||
returnFloat(num) {
|
||||
if (num) return
|
||||
var value = Math.round(parseFloat(num) * 100) / 100
|
||||
var s = value.toString().split('.')
|
||||
if (s.length === 1) {
|
||||
value = value.toString() + '.00'
|
||||
return value
|
||||
}
|
||||
if (s.length > 1) {
|
||||
if (s[1].length < 2) {
|
||||
value = value.toString() + '0'
|
||||
}
|
||||
return value
|
||||
}
|
||||
},
|
||||
getQuestionVal(questionMark) {
|
||||
const idx = this.questions.findIndex(i => i.QuestionMark === questionMark)
|
||||
if (idx > -1) {
|
||||
const questionId = this.questions[idx].Id
|
||||
const answer = this.questionForm[questionId]
|
||||
if (isNaN(parseFloat(answer))) {
|
||||
return answer
|
||||
} else {
|
||||
return parseFloat(answer)
|
||||
}
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
async uploadScreenshots(fileName, file) {
|
||||
try {
|
||||
file = this.convertBase64ToBlob(file)
|
||||
var trialId = this.$route.query.trialId
|
||||
var subjectId = this.$route.query.trialId
|
||||
const result = await this.OSSclient.put(`/${trialId}/Read/${subjectId}/Visit/${fileName}.png`, file)
|
||||
return { isSuccess: true, result: result }
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
return { isSuccess: false, result: e }
|
||||
}
|
||||
},
|
||||
convertBase64ToBlob(imageEditorBase64) {
|
||||
var base64Arr = imageEditorBase64.split(',')
|
||||
var imgtype = ''
|
||||
var base64String = ''
|
||||
if (base64Arr.length > 1) {
|
||||
// 如果是图片base64,去掉头信息
|
||||
base64String = base64Arr[1]
|
||||
imgtype = base64Arr[0].substring(
|
||||
base64Arr[0].indexOf(':') + 1,
|
||||
base64Arr[0].indexOf(';')
|
||||
)
|
||||
}
|
||||
// 将base64解码
|
||||
var bytes = atob(base64String)
|
||||
// var bytes = base64;
|
||||
var bytesCode = new ArrayBuffer(bytes.length)
|
||||
// 转换为类型化数组
|
||||
var byteArray = new Uint8Array(bytesCode)
|
||||
|
||||
// 将base64转换为ascii码
|
||||
for (var i = 0; i < bytes.length; i++) {
|
||||
byteArray[i] = bytes.charCodeAt(i)
|
||||
}
|
||||
|
||||
// 生成Blob对象(文件对象)
|
||||
return new Blob([bytesCode], { type: imgtype })
|
||||
},
|
||||
async handleSave() {
|
||||
const valid = await this.$refs.measurementForm.validate()
|
||||
if (!valid) return
|
||||
if (parseInt(this.questionForm[this.isMeasurableId]) === 1) {
|
||||
// 检验是否有标记为保存
|
||||
let i = this.markList.findIndex(i=>i.saveEnum === 0)
|
||||
if (i > -1) {
|
||||
// 请先保存标注信息!
|
||||
this.$message.warning(this.$t('trials:MRIPDFF:message:message1'))
|
||||
return
|
||||
}
|
||||
} else {
|
||||
// 不可测量时,清空测量值,平均值
|
||||
// '是否确认不可测量?'
|
||||
const confirm = await this.$confirm(
|
||||
this.$t('trials:MRIPDFF:message:message2'),
|
||||
{
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
}
|
||||
)
|
||||
if (confirm !== 'confirm') return
|
||||
let l1Id = this.getQuestionId(1101)
|
||||
this.$set(this.questionForm, l1Id, '')
|
||||
let l2Id = this.getQuestionId(1102)
|
||||
this.$set(this.questionForm, l2Id, '')
|
||||
let l3Id = this.getQuestionId(1103)
|
||||
this.$set(this.questionForm, l3Id, '')
|
||||
let meanId = this.getQuestionId(1104)
|
||||
this.$set(this.questionForm, meanId, '')
|
||||
}
|
||||
|
||||
const loading = this.$loading({ fullscreen: true })
|
||||
|
||||
try {
|
||||
let isResetMarks = this.markList.findIndex(i=>i.measureData && i.measureData.MeasureData) > -1 ? true : false
|
||||
if (parseInt(this.questionForm[this.isMeasurableId]) === 0 && this.isExitsMarks) {
|
||||
await deleteTableQuestionMark({rowId: this.questionForm.RowId})
|
||||
this.markList.forEach(i => {
|
||||
if (i.measureData && i.measureData.MeasureData) {
|
||||
i.measureData = ''
|
||||
}
|
||||
})
|
||||
this.isExitsMarks = false
|
||||
}
|
||||
var answers = []
|
||||
var reg = new RegExp(/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/)
|
||||
for (const k in this.questionForm) {
|
||||
if (reg.test(k)) {
|
||||
if (answers.findIndex(i => i.tableQuestionId === k) === -1) {
|
||||
answers.push({ tableQuestionId: k, answer: this.questionForm[k] })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var params = {
|
||||
questionId: this.parentQsId,
|
||||
rowId: this.questionForm.RowId,
|
||||
rowIndex: this.answers.RowIndex,
|
||||
visitTaskId: this.visitTaskId,
|
||||
trialId: this.trialId,
|
||||
answerList: answers,
|
||||
isDicomReading: true
|
||||
}
|
||||
const res = await submitTableQuestion(params)
|
||||
if (res.IsSuccess) {
|
||||
// 保存成功!
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
this.$set(this.questionForm, 'saveTypeEnum', 2)
|
||||
this.originalQuestionForm = { ...this.questionForm }
|
||||
this.$set(this.questionForm, 'RowId', res.Result.RowId)
|
||||
// 维护平均值、是否可测量数据
|
||||
const isMeasurable = this.getQuestionVal(1105)
|
||||
const mean = this.getQuestionVal(1104)
|
||||
this.$emit('resetQuestions', { isMeasurable, mean, saveTypeEnum: this.questionForm.saveTypeEnum,rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
|
||||
// this.$emit('close')
|
||||
DicomEvent.$emit('getReportInfo', true)
|
||||
DicomEvent.$emit('setMeasuredToolsPassive')
|
||||
if (parseInt(this.questionForm[this.isMeasurableId]) === 0 && isResetMarks) {
|
||||
// this.$emit('getReadingQuestionAndAnswer')
|
||||
await store.dispatch('reading/refreshMeasuredData', this.visitTaskId)
|
||||
DicomEvent.$emit('getMeasureData')
|
||||
}
|
||||
}
|
||||
loading.close()
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
loading.close()
|
||||
}
|
||||
},
|
||||
async handleClose() {
|
||||
this.$emit('close')
|
||||
},
|
||||
setState() {
|
||||
this.$nextTick(() => {
|
||||
if (this.isCurrentTask && this.readingTaskState < 2) {
|
||||
// 是否要将是否可测量设置为否?
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.measurement-form{
|
||||
/deep/ .el-form-item__label{
|
||||
color: #c3c3c3;
|
||||
}
|
||||
/deep/ .el-input .el-input__inner{
|
||||
background-color: transparent;
|
||||
color: #ddd;
|
||||
border: 1px solid #5e5e5e;
|
||||
}
|
||||
/deep/ .el-form-item{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
/deep/ .el-form-item__content{
|
||||
flex: 1;
|
||||
}
|
||||
/deep/ .el-input.is-disabled .el-input__inner{
|
||||
background-color: #646464a1;
|
||||
}
|
||||
/deep/ .el-select.is-disabled .el-input__inner{
|
||||
background-color: #646464a1;
|
||||
}
|
||||
/deep/ .el-button--mini, .el-button--mini.is-round {
|
||||
padding: 7px 10px;
|
||||
}
|
||||
.el-form-item__content
|
||||
.el-select{
|
||||
width: 100%;
|
||||
}
|
||||
.input-width1{
|
||||
width: calc(100% -60px)!important;
|
||||
}
|
||||
.input-width2{
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,618 @@
|
||||
<template>
|
||||
<div class="measurement-wrapper">
|
||||
|
||||
<div class="container">
|
||||
<div class="basic-info">
|
||||
<h3 v-if="isReadingShowSubjectInfo">
|
||||
<span v-if="subjectCode">{{ subjectCode }} </span>
|
||||
<span style="margin-left:5px;">{{ taskBlindName }}</span>
|
||||
</h3>
|
||||
<div v-if="readingTaskState < 2">
|
||||
<el-tooltip class="item" effect="dark" :content="$t('trials:dicomReading:message:confirmReset')" placement="bottom">
|
||||
<i
|
||||
class="el-icon-refresh-left"
|
||||
@click="resetMeasuredData"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 非测量问题 -->
|
||||
<div class="lesions">
|
||||
<Questions ref="ecrf" :groupClassify="1" :question-form-change-state="questionFormChangeState" :question-form-change-num="questionFormChangeNum" />
|
||||
</div>
|
||||
<!-- 测量问题 -->
|
||||
<template >
|
||||
<div v-for="(qs,index) in questions" :key="index" v-loading="loading" class="lesions lesions_wrapper">
|
||||
<h4 v-if="qs.Type === 'group'" style="color: #ddd;padding: 5px 0px;margin: 0;">
|
||||
{{ language==='en'?qs.GroupEnName:qs.GroupName }}
|
||||
</h4>
|
||||
<div class="lesion_list">
|
||||
<div v-for="item in qs.Childrens" v-show="!(isBaseLineTask && item.LesionType === 2)" :key="item.Id">
|
||||
<div v-if="item.Type === 'table'" class="flex-row" style="margin:3px 0;">
|
||||
<div class="title">{{ item.QuestionName }}</div>
|
||||
</div>
|
||||
<div style="color: #ddd;text-align: left;padding: 5px 10px;border-bottom: 1px solid #5a5a5a; font-size: 15px;">
|
||||
<el-row :gutter="20">
|
||||
<!-- 分段 -->
|
||||
<el-col :span="7">{{$t('trials:MRIPDFF:label:col1')}}</el-col>
|
||||
<!-- 是否可测量 -->
|
||||
<el-col :span="8">{{$t('trials:MRIPDFF:label:col2')}}</el-col>
|
||||
<!-- 平均值 -->
|
||||
<el-col :span="6">{{$t('trials:MRIPDFF:label:col3')}}</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-collapse
|
||||
v-if="item.Type === 'table' && item.TableQuestions"
|
||||
v-model="activeName"
|
||||
accordion
|
||||
@change="handleCollapseChange"
|
||||
>
|
||||
<el-collapse-item
|
||||
v-for="(q,i) in item.TableQuestions.Answers"
|
||||
:key="`${item.Id}_${q.RowIndex}`"
|
||||
:name="`${item.Id}_${q.RowIndex}`"
|
||||
@contextmenu.prevent.native="collapseRightClick($event,q,item.Id,q.RowIndex)"
|
||||
>
|
||||
<template slot="title">
|
||||
<div style="width:300px;position: relative;" :style="{color:(activeName===item.Id+q.RowIndex?'#ffeb3b':'#fff')}">
|
||||
|
||||
{{ getLesionName(item.TableQuestions.Questions, q) }}
|
||||
<!-- 未保存 -->
|
||||
<el-tooltip v-if="readingTaskState<2 && parseInt(item.TableQuestions.Answers[i].saveTypeEnum) === 0" class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom">
|
||||
<i class="el-icon-warning" style="color:red" />
|
||||
</el-tooltip>
|
||||
<!-- 信息不完整 -->
|
||||
<el-tooltip v-if="readingTaskState<2 && parseInt(item.TableQuestions.Answers[i].saveTypeEnum) ===1" class="item" effect="dark" :content="$t('trials:reading:button:incompleteInfor')" placement="bottom">
|
||||
<i class="el-icon-warning" style="color:#ff9800" />
|
||||
</el-tooltip>
|
||||
<div style="position: absolute;left: 90px;top: 2px;">
|
||||
<!-- white-space: nowrap;overflow: hidden;text-overflow: ellipsis; -->
|
||||
<div style="font-size: 13px;width:220px;height: 30px;">
|
||||
<div style="display: inline-block;margin-left:10px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width:110px">
|
||||
{{ $fd('ReadingYesOrNo', parseInt(item.TableQuestions.Answers[i].isMeasurable)) }}
|
||||
</div>
|
||||
<div style="display: inline-block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width:80px">
|
||||
{{ item.TableQuestions.Answers[i].mean }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<QuestionForm
|
||||
:ref="`${item.Id}_${q.RowIndex}`"
|
||||
:questions="item.TableQuestions.Questions"
|
||||
:answers="item.TableQuestions.Answers[i]"
|
||||
:lesion-type="item.LesionType"
|
||||
:order-mark="item.OrderMark"
|
||||
:table-questions="tableQuestions"
|
||||
:row-index="String(q.RowIndex)"
|
||||
:question-name="item.QuestionName"
|
||||
:parent-qs-id="item.Id"
|
||||
:visit-task-id="visitTaskId"
|
||||
:is-current-task="isCurrentTask"
|
||||
:reading-task-state="readingTaskState"
|
||||
:is-base-line-task="isBaseLineTask"
|
||||
@getReadingQuestionAndAnswer="getReadingQuestionAndAnswer"
|
||||
@resetQuestions="resetQuestions"
|
||||
@close="close"
|
||||
/>
|
||||
</el-collapse-item>
|
||||
|
||||
</el-collapse>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { resetReadingTask } from '@/api/reading'
|
||||
import DicomEvent from './../DicomEvent'
|
||||
import store from '@/store'
|
||||
import { mapGetters } from 'vuex'
|
||||
import Questions from './../Questions'
|
||||
import QuestionForm from './QuestionForm'
|
||||
export default {
|
||||
name: 'MeasurementList',
|
||||
components: {
|
||||
Questions,
|
||||
QuestionForm
|
||||
},
|
||||
props: {
|
||||
isShow: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
isReadingShowSubjectInfo: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
questionFormChangeState: {
|
||||
type: Boolean,
|
||||
default() {
|
||||
return false
|
||||
}
|
||||
},
|
||||
questionFormChangeNum: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
questions: [],
|
||||
activeName: '',
|
||||
activeItem: {
|
||||
activeRowIndex: null,
|
||||
activeCollapseId: null
|
||||
},
|
||||
visitTaskId: '',
|
||||
isCurrentTask: false,
|
||||
loading: false,
|
||||
unSaveTargets: [],
|
||||
temporaryLesions: [],
|
||||
readingTaskState: 2,
|
||||
isBaseLineTask: false,
|
||||
taskBlindName: '',
|
||||
tableQuestions: [],
|
||||
isFirstRender: false,
|
||||
CriterionType: null,
|
||||
subjectCode: '',
|
||||
liverSegmentId: '',
|
||||
liverSegmentDicCode: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['visitTaskList', 'language', 'lastCanvasTaskId', 'currentReadingTaskState'])
|
||||
},
|
||||
watch: {
|
||||
lastCanvasTaskId: {
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
if (val) {
|
||||
this.initList()
|
||||
}
|
||||
console.log('lastCanvasTaskId', val)
|
||||
}
|
||||
},
|
||||
currentReadingTaskState: {
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
if (val) {
|
||||
this.readingTaskState = val
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.subjectCode = this.$router.currentRoute.query.subjectCode
|
||||
this.subjectCode = localStorage.getItem('subjectCode')
|
||||
this.CriterionType = parseInt(localStorage.getItem('CriterionType'))
|
||||
DicomEvent.$on('setCollapseActive', measureData => {
|
||||
this.setCollapseActive(measureData)
|
||||
console.log('setCollapseActive')
|
||||
})
|
||||
DicomEvent.$on('getAllUnSaveLesions', (callback) => {
|
||||
var list = this.getAllUnSaveLesions()
|
||||
callback(list)
|
||||
console.log('getAllUnSaveLesions')
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
DicomEvent.$off('setCollapseActive')
|
||||
DicomEvent.$off('getUnSaveTarget')
|
||||
DicomEvent.$off('getAllUnSaveLesions')
|
||||
},
|
||||
methods: {
|
||||
async initList() {
|
||||
var i = this.visitTaskList.findIndex(i => i.VisitTaskId === this.lastCanvasTaskId)
|
||||
if (i > -1) {
|
||||
this.visitTaskId = this.visitTaskList[i].VisitTaskId
|
||||
this.taskBlindName = this.visitTaskList[i].TaskBlindName
|
||||
this.readingTaskState = this.visitTaskList[i].ReadingTaskState
|
||||
this.isBaseLineTask = this.visitTaskList[i].IsBaseLineTask
|
||||
this.isCurrentTask = this.visitTaskList[i].IsCurrentTask
|
||||
this.activeName = ''
|
||||
this.activeItem.activeRowIndex = null
|
||||
this.activeItem.activeCollapseId = null
|
||||
if (!this.visitTaskList[i].IsInit) {
|
||||
var loading = this.$loading({ fullscreen: true })
|
||||
var triald = this.trialId = this.$router.currentRoute.query.trialId
|
||||
if (!this.visitTaskList[i].measureDataInit) {
|
||||
await store.dispatch('reading/getMeasuredData', this.visitTaskList[i].VisitTaskId)
|
||||
}
|
||||
if (!this.visitTaskList[i].studyListInit) {
|
||||
await store.dispatch('reading/getStudyInfo', { trialId: triald, subjectVisitId: this.visitTaskList[i].VisitId, visitTaskId: this.visitTaskList[i].VisitTaskId, taskBlindName: this.visitTaskList[i].TaskBlindName })
|
||||
}
|
||||
if (!this.visitTaskList[i].readingQuestionsInit) {
|
||||
await store.dispatch('reading/getReadingQuestionAndAnswer', { trialId: triald, visitTaskId: this.visitTaskList[i].VisitTaskId })
|
||||
}
|
||||
if (!this.visitTaskList[i].questionsInit) {
|
||||
await store.dispatch('reading/getDicomReadingQuestionAnswer', { trialId: triald, visitTaskId: this.visitTaskList[i].VisitTaskId })
|
||||
}
|
||||
|
||||
await store.dispatch('reading/setStatus', { visitTaskId: this.visitTaskList[i].VisitTaskId })
|
||||
loading.close()
|
||||
}
|
||||
this.questions = this.visitTaskList[i].ReadingQuestions
|
||||
this.$nextTick(() => {
|
||||
this.$refs['ecrf'].getQuestions(this.visitTaskId)
|
||||
this.getTableQuestions()
|
||||
this.tableQuestions.forEach(item => {
|
||||
item.TableQuestions.Answers.forEach(i => {
|
||||
var refName = `${item.Id}_${i.RowIndex}`
|
||||
this.$refs[refName] && this.$refs[refName][0].initForm()
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
async resetQuestions(obj) {
|
||||
this.setQuestions(this.questions, obj)
|
||||
await store.dispatch('reading/setReadingQuestionAndAnswer', { questions: this.questions, visitTaskId: this.visitTaskId })
|
||||
|
||||
this.getTableQuestions()
|
||||
},
|
||||
setQuestions(questions, obj) {
|
||||
questions.forEach(item => {
|
||||
if (item.Type === 'table' && item.Id === obj.questionId) {
|
||||
var idx = item.TableQuestions.Answers.findIndex(i => i.RowIndex === obj.rowIndex)
|
||||
item.TableQuestions.Answers[idx].isMeasurable = obj.isMeasurable
|
||||
console.log(obj.isMeasurable)
|
||||
item.TableQuestions.Answers[idx].mean = obj.mean
|
||||
item.TableQuestions.Answers[idx].saveTypeEnum = obj.saveTypeEnum
|
||||
|
||||
for (const i in obj.anwsers) {
|
||||
if (i === 'MeasureData' && obj.anwsers[i]) {
|
||||
|
||||
} else {
|
||||
item.TableQuestions.Answers[idx][i] = String(obj.anwsers[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.Childrens.length > 0) {
|
||||
this.setQuestions(item.Childrens, obj)
|
||||
}
|
||||
})
|
||||
},
|
||||
getQuestions(questions) {
|
||||
questions.forEach(item => {
|
||||
if (item.Type === 'table' && item.TableQuestions && item.TableQuestions.Answers.length > 0) {
|
||||
item.TableQuestions.Answers.forEach(answerObj => {
|
||||
let isMeasurable = this.getQuestionAnswer(item.TableQuestions.Questions, 1105, answerObj)
|
||||
this.$set(answerObj, 'isMeasurable', isMeasurable)
|
||||
this.$set(answerObj, 'mean', this.getQuestionAnswer(item.TableQuestions.Questions, 1104, answerObj))
|
||||
if (answerObj.RowId) {
|
||||
this.$set(answerObj, 'saveTypeEnum', isNaN(parseInt(isMeasurable)) ? 1 : 2)
|
||||
} else {
|
||||
this.$set(answerObj, 'saveTypeEnum', 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (item.Childrens.length > 0) {
|
||||
this.getQuestions(item.Childrens)
|
||||
}
|
||||
})
|
||||
return questions
|
||||
},
|
||||
getTableQuestions() {
|
||||
this.tableQuestions = []
|
||||
this.questions.map(item => {
|
||||
if (item.Type === 'table') {
|
||||
this.tableQuestions.push(item)
|
||||
}
|
||||
if (item.Childrens.length > 0) {
|
||||
this.getTableQuestionsChild(item.Childrens)
|
||||
}
|
||||
})
|
||||
},
|
||||
getTableQuestionsChild(obj) {
|
||||
obj.map(item => {
|
||||
if (item.Type === 'table') {
|
||||
this.tableQuestions.push(item)
|
||||
}
|
||||
if (item.Childrens.length > 0) {
|
||||
this.getTableQuestionsChild(item.Childrens)
|
||||
}
|
||||
})
|
||||
},
|
||||
refreshReadingQuestionAndAnswer(type) {
|
||||
if (type === 0) {
|
||||
// 删除
|
||||
this.activeName = ''
|
||||
this.activeItem.activeRowIndex = null
|
||||
this.activeItem.activeCollapseId = null
|
||||
}
|
||||
|
||||
this.getReadingQuestionAndAnswer(this.visitTaskId)
|
||||
},
|
||||
getReadingQuestionAndAnswer(showLoading = true) {
|
||||
return new Promise(async resolve => {
|
||||
try {
|
||||
let loading = null
|
||||
if (showLoading) {
|
||||
loading = this.$loading({ fullscreen: true })
|
||||
}
|
||||
await store.dispatch('reading/refreshReadingQuestionAndAnswer', { trialId: this.$router.currentRoute.query.trialId, visitTaskId: this.visitTaskId }).then(() => {
|
||||
var idx = this.visitTaskList.findIndex(i => i.VisitTaskId === this.visitTaskId)
|
||||
if (idx > -1) {
|
||||
if (this.visitTaskList[idx].ReadingQuestions.length > 0) {
|
||||
this.questions = this.visitTaskList[idx].ReadingQuestions
|
||||
}
|
||||
this.readingTaskState = this.visitTaskList[idx].ReadingTaskState
|
||||
this.isBaseLineTask = this.visitTaskList[idx].IsBaseLineTask
|
||||
this.isCurrentTask = this.visitTaskList[idx].IsCurrentTask
|
||||
}
|
||||
this.getTableQuestions()
|
||||
this.$nextTick(() => {
|
||||
this.tableQuestions.forEach(item => {
|
||||
item.TableQuestions.Answers.forEach(i => {
|
||||
var refName = `${item.Id}_${i.RowIndex}`
|
||||
this.$refs[refName] && this.$refs[refName][0].initForm()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
await store.dispatch('reading/refreshMeasuredData', this.visitTaskId)
|
||||
DicomEvent.$emit('getMeasureData')
|
||||
|
||||
loading ? loading.close() : ''
|
||||
resolve()
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
loading ? loading.close() : ''
|
||||
}
|
||||
})
|
||||
},
|
||||
getQuestionAnswer(questions, questionMark, answers) {
|
||||
var idx = questions.findIndex(i => i.QuestionMark === questionMark)
|
||||
if (idx > -1) {
|
||||
var questionId = questions[idx].Id
|
||||
return answers[questionId]
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
isCanActiveTool(toolName) {
|
||||
return { isCanActiveTool: true, reason: '' }
|
||||
},
|
||||
|
||||
checkToolCanActive(toolName) {
|
||||
return { isCanActiveTool: true, reason: '' }
|
||||
},
|
||||
|
||||
getLesionName(questions, q) {
|
||||
let liverSegmentStr = ''
|
||||
if (!this.liverSegmentId) {
|
||||
let i = questions.findIndex(i=>i.QuestionMark === 1106)
|
||||
if (i === -1) return
|
||||
this.liverSegmentId = questions[i].Id
|
||||
this.liverSegmentDicCode = questions[i].DictionaryCode
|
||||
}
|
||||
if (q && q[this.liverSegmentId]) {
|
||||
liverSegmentStr = this.$fd(this.liverSegmentDicCode, parseInt(q[this.liverSegmentId]))
|
||||
}
|
||||
return liverSegmentStr
|
||||
},
|
||||
handleCollapseChange(val) {
|
||||
if (this.activeName) {
|
||||
var arr = this.activeName.split('_')
|
||||
this.activeItem.activeRowIndex = arr[1]
|
||||
this.activeItem.activeCollapseId = arr[0]
|
||||
this.$nextTick(() => {
|
||||
const refName = `${this.activeItem.activeCollapseId}_${this.activeItem.activeRowIndex}`
|
||||
if (this.$refs[refName][0].questionForm.IsDicomReading !== false) {
|
||||
var markTool = this.$refs[refName][0].currentMarkTool
|
||||
var readingTaskState = this.readingTaskState
|
||||
var isMarked = !!this.$refs[refName][0].questionForm.MeasureData
|
||||
DicomEvent.$emit('imageLocation', { questionId: this.activeItem.activeCollapseId, rowIndex: this.activeItem.activeRowIndex, visitTaskId: this.visitTaskId, lesionName: this.$refs[refName][0].lesionMark, lesionType: this.$refs[refName][0].lesionType, markTool, readingTaskState, isMarked })
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.activeItem.activeRowIndex = null
|
||||
this.activeItem.activeCollapseId = null
|
||||
}
|
||||
},
|
||||
collapseRightClick(e, obj, activeCollapseId, activeRowIndex) {
|
||||
if (obj.IsDicomReading !== false) {
|
||||
const refName = `${activeCollapseId}_${activeRowIndex}`
|
||||
DicomEvent.$emit('imageLocation', { questionId: activeCollapseId, rowIndex: activeRowIndex, visitTaskId: this.visitTaskId, lesionName: this.$refs[refName][0].lesionMark, lesionType: this.$refs[refName][0].lesionType })
|
||||
}
|
||||
e.stopImmediatePropagation()
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
},
|
||||
setCollapseActive(measureData) {
|
||||
if (measureData) {
|
||||
if (this.activeItem.activeRowIndex === measureData.RowIndex && this.activeItem.activeCollapseId === measureData.QuestionId) {
|
||||
return
|
||||
} else {
|
||||
this.activeItem.activeCollapseId = measureData.QuestionId
|
||||
this.activeItem.activeRowIndex = measureData.RowIndex
|
||||
this.activeName = `${this.activeItem.activeCollapseId}_${this.activeItem.activeRowIndex}`
|
||||
}
|
||||
}
|
||||
},
|
||||
modifyMeasuredData(measureObj) {
|
||||
if (measureObj.questionInfo) {
|
||||
this.activeItem.activeCollapseId = measureObj.questionInfo.QuestionId
|
||||
this.activeItem.activeRowIndex = String(measureObj.questionInfo.RowIndex)
|
||||
this.activeName = `${this.activeItem.activeCollapseId}_${this.activeItem.activeRowIndex}`
|
||||
const refName = `${this.activeItem.activeCollapseId}_${this.activeItem.activeRowIndex}`
|
||||
this.$refs[refName][0].setMeasureData(measureObj.measureData)
|
||||
}
|
||||
},
|
||||
// 设置测量数据
|
||||
setMeasuredData(measureData) {
|
||||
if (this.activeItem.activeCollapseId) {
|
||||
// 判断是否存在测量数据
|
||||
this.$nextTick(() => {
|
||||
const refName = `${this.activeItem.activeCollapseId}_${this.activeItem.activeRowIndex}`
|
||||
if (!this.$refs[refName][0].questionForm.MeasureData || (this.$refs[refName][0].questionForm && this.$refs[refName][0].questionForm.MeasureData && measureData.data.uuid === this.$refs[refName][0].questionForm.MeasureData.data.uuid)) {
|
||||
this.$refs[refName][0].setMeasureData(measureData)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
}
|
||||
},
|
||||
async close(questionsObj) {
|
||||
if (questionsObj) {
|
||||
this.getReadingQuestionAndAnswer(questionsObj.visitTaskId)
|
||||
}
|
||||
this.activeItem.activeRowIndex = null
|
||||
this.activeItem.activeCollapseId = null
|
||||
this.activeName = ''
|
||||
},
|
||||
getECRFQuestions(obj) {
|
||||
this.$refs['ecrf'].getQuestions(obj.visitTaskId)
|
||||
},
|
||||
async resetMeasuredData() {
|
||||
const confirm = await this.$confirm(
|
||||
this.$t('trials:dicomReading:message:confirmReset1'),
|
||||
this.$t('trials:dicomReading:message:confirmReset2'),
|
||||
{
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
}
|
||||
)
|
||||
if (confirm !== 'confirm') return
|
||||
const loading = this.$loading({ fullscreen: true })
|
||||
try {
|
||||
const res = await resetReadingTask({ visitTaskId: this.visitTaskId })
|
||||
this.loading = false
|
||||
if (res.IsSuccess) {
|
||||
// 刷新标注、表单、报告页信息
|
||||
this.activeName = ''
|
||||
this.activeItem.activeRowIndex = null
|
||||
this.activeItem.activeCollapseId = null
|
||||
await this.getReadingQuestionAndAnswer(this.visitTaskId)
|
||||
const triald = this.$router.currentRoute.query.trialId
|
||||
await store.dispatch('reading/refreshDicomReadingQuestionAnswer', { trialId: triald, visitTaskId: this.visitTaskId })
|
||||
this.$refs['ecrf'].getQuestions(this.visitTaskId, true)
|
||||
DicomEvent.$emit('getMeasureData')
|
||||
DicomEvent.$emit('getReportInfo', true)
|
||||
DicomEvent.$emit('refreshStudyListMeasureData')
|
||||
}
|
||||
loading.close()
|
||||
} catch (e) {
|
||||
loading.close()
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
getAllUnSaveLesions() {
|
||||
var arr = []
|
||||
this.tableQuestions.map(item => {
|
||||
if (item.TableQuestions && item.TableQuestions.Answers) {
|
||||
item.TableQuestions.Answers.map(t => {
|
||||
const refName = `${item.Id}_${t.RowIndex}`
|
||||
if (this.$refs[refName] && this.$refs[refName][0] && this.$refs[refName][0].questionForm.saveTypeEnum !== 2) {
|
||||
var lessionName = this.getLesionName(item.OrderMark, t.RowIndex)
|
||||
arr.push({ lessionName: lessionName, rowIndex: t.RowIndex, questionId: item.Id })
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
return arr
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.measurement-wrapper{
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
// overflow: hidden;
|
||||
|
||||
.container{
|
||||
padding: 10px;
|
||||
.basic-info{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
h3{
|
||||
color: #ddd;
|
||||
padding: 5px 0px;
|
||||
margin: 0;
|
||||
}
|
||||
i{
|
||||
color: #fff;
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
.title{
|
||||
padding: 5px;
|
||||
font-weight: bold;
|
||||
color: #ddd;
|
||||
font-size: 15px;
|
||||
|
||||
}
|
||||
.add-icon{
|
||||
padding: 5px;
|
||||
font-weight: bold;
|
||||
color: #ddd;
|
||||
font-size: 15px;
|
||||
border: 1px solid #938b8b;
|
||||
margin-bottom: 2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.add-icon:hover{
|
||||
background-color: #607d8b;
|
||||
}
|
||||
|
||||
.flex-row{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
background-color: #424242;
|
||||
|
||||
}
|
||||
.lesion_list{
|
||||
position: relative;
|
||||
}
|
||||
.el-collapse{
|
||||
border-bottom:none;
|
||||
border-top:none;
|
||||
/deep/ .el-collapse-item{
|
||||
background-color: #000!important;
|
||||
color: #ddd;
|
||||
|
||||
}
|
||||
/deep/ .el-collapse-item__header{
|
||||
background-color: #000!important;
|
||||
color: #ddd;
|
||||
border-bottom-color:#5a5a5a;
|
||||
padding-left: 5px;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
}
|
||||
/deep/ .el-collapse-item__wrap{
|
||||
background-color: #000!important;
|
||||
color: #ddd;
|
||||
}
|
||||
/deep/ .el-collapse-item__content{
|
||||
width:260px;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
// border: 1px solid #ffeb3b;
|
||||
border: 1px solid #fff;
|
||||
z-index: 1;
|
||||
color: #ddd;
|
||||
padding: 5px;
|
||||
background-color:#1e1e1e;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -373,13 +373,13 @@ export default {
|
||||
})
|
||||
},
|
||||
async beforeLeave() {
|
||||
if (this.questionFormChangeState && this.CriterionType !== 2) {
|
||||
var msg = this.$t('trials:readingReport:message:msg5')
|
||||
var isgo = await this.myConfirm(msg)
|
||||
if (!isgo) {
|
||||
return Promise.resolve(true)
|
||||
}
|
||||
}
|
||||
// if (this.questionFormChangeState && this.CriterionType !== 2) {
|
||||
// var msg = this.$t('trials:readingReport:message:msg5')
|
||||
// var isgo = await this.myConfirm(msg)
|
||||
// if (!isgo) {
|
||||
// return Promise.resolve(true)
|
||||
// }
|
||||
// }
|
||||
var list = null
|
||||
DicomEvent.$emit('getAllUnSaveLesions', val => {
|
||||
list = val
|
||||
@@ -467,7 +467,7 @@ export default {
|
||||
if ((item.LesionType === 1 || item.LesionType === 2 || item.LesionType === 6 || item.LesionType === 7 || item.LesionType === 8) && isNTFilterLength) {
|
||||
filterArr = [0, 1, 3, 4, 5, 6, 2, 8, 10, 7]
|
||||
} else {
|
||||
filterArr = [3, 4, 5, 6, 2, 8, 10, 7]
|
||||
filterArr = [3, 4, 5, 6, 2, 8, 10, 7, 1106]
|
||||
}
|
||||
if ((lesionType === 0 || lesionType === 5) && isLymphNodes === 0 && !this.isShowDetail && (this.CriterionType === 1 || this.CriterionType === 3 || this.CriterionType === 17)) {
|
||||
filterArr.push(1)
|
||||
@@ -542,6 +542,15 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.CriterionType === 21) {
|
||||
var liverSegmentIdx = item.Childrens.findIndex(i => i.QuestionMark === 1106)
|
||||
if (liverSegmentIdx > -1) {
|
||||
if (item.Childrens[liverSegmentIdx].Answer.length > 0) {
|
||||
let v = item.Childrens[liverSegmentIdx].Answer[0].Answer
|
||||
obj.QuestionName = this.$fd(item.Childrens[liverSegmentIdx].DictionaryCode, parseInt(v))
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,404 @@
|
||||
import * as cornerstoneTools from 'cornerstone-tools'
|
||||
const external = cornerstoneTools.external
|
||||
// State
|
||||
const getToolState = cornerstoneTools.getToolState
|
||||
const textStyle = cornerstoneTools.textStyle
|
||||
const toolColors = cornerstoneTools.toolColors
|
||||
const toolStyle = cornerstoneTools.toolStyle
|
||||
// Drawing
|
||||
const getNewContext = cornerstoneTools.import('drawing/getNewContext')
|
||||
const draw = cornerstoneTools.import('drawing/draw')
|
||||
const drawHandles = cornerstoneTools.import('drawing/drawHandles')
|
||||
const drawTextBox = cornerstoneTools.import('drawing/drawTextBox')
|
||||
// Utilities
|
||||
const getRGBPixels = cornerstoneTools.import('util/getRGBPixels')
|
||||
const calculateSUV = cornerstoneTools.import('util/calculateSUV')
|
||||
// import { probeCursor } from '../cursors/index.js';
|
||||
// import { getLogger } from '../../util/logger.js';
|
||||
const throttle = cornerstoneTools.import('util/throttle')
|
||||
const getModule = cornerstoneTools.getModule
|
||||
const getPixelSpacing = cornerstoneTools.import('util/getPixelSpacing')
|
||||
// import numbersWithCommas from './../../util/numbersWithCommas.js';
|
||||
const numbersWithCommas = cornerstoneTools.import('util/numbersWithCommas')
|
||||
// const logger = getLogger('tools:annotation:ProbeTool');
|
||||
import calculateEllipseStatistics from './calculateEllipseStatistics'
|
||||
import getCircleCoords from './getCircleCoords'
|
||||
/**
|
||||
* @public
|
||||
* @class ProbeTool
|
||||
* @memberof Tools.Annotation
|
||||
* @classdesc Tool which provides a probe of the image data at the
|
||||
* desired position.
|
||||
* @extends Tools.Base.BaseAnnotationTool
|
||||
*/
|
||||
export default class ProbeTool extends cornerstoneTools.ProbeTool {
|
||||
constructor(props = {}) {
|
||||
const defaultProps = {
|
||||
name: 'Probe',
|
||||
supportedInteractionTypes: ['Mouse', 'Touch'],
|
||||
// svgCursor: probeCursor,
|
||||
configuration: {
|
||||
drawHandles: true,
|
||||
renderDashed: false,
|
||||
handleRadius: 0,
|
||||
fixedRadius: 0,
|
||||
hideHandlesIfMoving: false,
|
||||
digits: 1,
|
||||
showRadius: false,
|
||||
},
|
||||
};
|
||||
|
||||
super(props, defaultProps);
|
||||
|
||||
this.throttledUpdateCachedStats = throttle(this.updateCachedStats, 110);
|
||||
}
|
||||
|
||||
createNewMeasurement(eventData) {
|
||||
const goodEventData =
|
||||
eventData && eventData.currentPoints && eventData.currentPoints.image;
|
||||
|
||||
if (!goodEventData) {
|
||||
logger.error(
|
||||
`required eventData not supplied to tool ${this.name}'s createNewMeasurement`
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
visible: true,
|
||||
active: true,
|
||||
color: undefined,
|
||||
invalidated: true,
|
||||
handles: {
|
||||
// start: {
|
||||
// x: eventData.currentPoints.image.x,
|
||||
// y: eventData.currentPoints.image.y,
|
||||
// highlight: true,
|
||||
// active: false,
|
||||
// },
|
||||
end: {
|
||||
x: eventData.currentPoints.image.x,
|
||||
y: eventData.currentPoints.image.y,
|
||||
highlight: true,
|
||||
active: true,
|
||||
radius: 0
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {*} element
|
||||
* @param {*} data
|
||||
* @param {*} coords
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
pointNearTool(element, data, coords) {
|
||||
const hasEndHandle = data && data.handles && data.handles.end;
|
||||
const validParameters = hasEndHandle;
|
||||
|
||||
if (!validParameters) {
|
||||
logger.warn(
|
||||
`invalid parameters supplied to tool ${this.name}'s pointNearTool`
|
||||
);
|
||||
}
|
||||
|
||||
if (!validParameters || data.visible === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const probeCoords = external.cornerstone.pixelToCanvas(
|
||||
element,
|
||||
data.handles.end
|
||||
);
|
||||
|
||||
return external.cornerstoneMath.point.distance(probeCoords, coords) < 5;
|
||||
}
|
||||
// pointNearTool(element, data, coords) {
|
||||
// const hasEndHandle = data && data.handles && data.handles.end;
|
||||
// const validParameters = hasEndHandle;
|
||||
|
||||
// if (!validParameters) {
|
||||
// logger.warn(
|
||||
// `invalid parameters supplied to tool ${this.name}'s pointNearTool`
|
||||
// );
|
||||
// }
|
||||
|
||||
// if (!validParameters || data.visible === false) {
|
||||
// return false;
|
||||
// }
|
||||
// // data.handles.end.x = data.handles.end.x + 10
|
||||
// let endCoords = {
|
||||
// x: data.handles.end.x + 50,
|
||||
// y: data.handles.end.y,
|
||||
// highlight: data.handles.end.highlight,
|
||||
// active: data.handles.end.active,
|
||||
// }
|
||||
// const probeCoords = external.cornerstone.pixelToCanvas(
|
||||
// element,
|
||||
// endCoords
|
||||
// );
|
||||
|
||||
// return external.cornerstoneMath.point.distance(probeCoords, coords) < 5;
|
||||
// }
|
||||
|
||||
// updateCachedStats(image, element, data) {
|
||||
// const x = Math.round(data.handles.end.x);
|
||||
// const y = Math.round(data.handles.end.y);
|
||||
|
||||
// const stats = {};
|
||||
|
||||
// if (x >= 0 && y >= 0 && x < image.columns && y < image.rows) {
|
||||
// stats.x = x;
|
||||
// stats.y = y;
|
||||
|
||||
// if (image.color) {
|
||||
// stats.storedPixels = getRGBPixels(element, x, y, 1, 1);
|
||||
// } else {
|
||||
// stats.storedPixels = external.cornerstone.getStoredPixels(
|
||||
// element,
|
||||
// x,
|
||||
// y,
|
||||
// 1,
|
||||
// 1
|
||||
// );
|
||||
// stats.sp = stats.storedPixels[0];
|
||||
// stats.mo = stats.sp * image.slope + image.intercept;
|
||||
// stats.suv = calculateSUV(image, stats.sp);
|
||||
// }
|
||||
// }
|
||||
|
||||
// data.cachedStats = stats;
|
||||
// data.invalidated = false;
|
||||
// }
|
||||
updateCachedStats(image, element, data) {
|
||||
const seriesModule =
|
||||
external.cornerstone.metaData.get('generalSeriesModule', image.imageId) ||
|
||||
{};
|
||||
const modality = seriesModule.modality;
|
||||
const pixelSpacing = getPixelSpacing(image);
|
||||
const { fixedRadius, digits } = this.configuration;
|
||||
const stats = _calculateStats(
|
||||
image,
|
||||
element,
|
||||
data.handles,
|
||||
modality,
|
||||
pixelSpacing,
|
||||
fixedRadius,
|
||||
digits
|
||||
);
|
||||
|
||||
data.cachedStats = stats;
|
||||
data.invalidated = false;
|
||||
}
|
||||
|
||||
renderToolData(evt) {
|
||||
const eventData = evt.detail;
|
||||
const { fixedRadius, renderDashed } = this.configuration;
|
||||
const toolData = getToolState(evt.currentTarget, this.name);
|
||||
|
||||
if (!toolData) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We have tool data for this element - iterate over each one and draw it
|
||||
const context = getNewContext(eventData.canvasContext.canvas);
|
||||
const { image, element } = eventData;
|
||||
const fontHeight = textStyle.getFontSize();
|
||||
const lineDash = getModule('globalConfiguration').configuration.lineDash;
|
||||
const pixelSpacing = getPixelSpacing(image);
|
||||
// Meta
|
||||
const seriesModule =
|
||||
external.cornerstone.metaData.get('generalSeriesModule', image.imageId) ||
|
||||
{};
|
||||
|
||||
// Pixel Spacing
|
||||
const modality = seriesModule.modality;
|
||||
const hasPixelSpacing = pixelSpacing && pixelSpacing.rowPixelSpacing && pixelSpacing.colPixelSpacing;
|
||||
for (let i = 0; i < toolData.data.length; i++) {
|
||||
const data = toolData.data[i];
|
||||
if (data.visible === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
draw(context, context => {
|
||||
const color = toolColors.getColorIfActive(data);
|
||||
|
||||
if (this.configuration.drawHandles) {
|
||||
// Draw the handles
|
||||
let radius = getCanvasRadius(data.handles, fixedRadius, element, pixelSpacing)
|
||||
data.handles.end.radius = radius
|
||||
const handleOptions = { handleRadius: radius, color };
|
||||
|
||||
if (renderDashed) {
|
||||
handleOptions.lineDash = lineDash;
|
||||
}
|
||||
drawHandles(context, eventData, data.handles, handleOptions);
|
||||
}
|
||||
|
||||
// Update textbox stats
|
||||
if (data.invalidated === true) {
|
||||
if (data.cachedStats) {
|
||||
this.throttledUpdateCachedStats(image, element, data);
|
||||
} else {
|
||||
this.updateCachedStats(image, element, data);
|
||||
}
|
||||
}
|
||||
|
||||
// let text, str;
|
||||
let textLines = []
|
||||
const { x, y, area, mean, radius } = data.cachedStats;
|
||||
|
||||
if (x >= 0 && y >= 0 && x < image.columns && y < image.rows) {
|
||||
// text = `${x}, ${y}`;
|
||||
if (data.remark) {
|
||||
textLines.push(`${data.remark}`)
|
||||
}
|
||||
if (!image.color) {
|
||||
// Draw text
|
||||
let unit = _getUnit(modality, this.configuration.showHounsfieldUnits);
|
||||
|
||||
// textLines.push(_formatArea(area, hasPixelSpacing));
|
||||
if (mean) {
|
||||
// str += `mean: ${parseFloat(mean.toFixed(3))}`;
|
||||
textLines.push(`Mean: ${mean} ${unit}`)
|
||||
}
|
||||
// if (radius) {
|
||||
// str += `radius: ${parseFloat(radius.toFixed(3))}`;
|
||||
// textLines.push(`radius: ${parseFloat(radius.toFixed(3))}`)
|
||||
// }
|
||||
}
|
||||
let r = getPixelRadius(fixedRadius, pixelSpacing)
|
||||
// Coords for text
|
||||
const coords = {
|
||||
// Translate the x/y away from the cursor
|
||||
x: data.handles.end.x + r,
|
||||
y: data.handles.end.y - r,
|
||||
};
|
||||
const textCoords = external.cornerstone.pixelToCanvas(
|
||||
eventData.element,
|
||||
coords
|
||||
);
|
||||
drawTextBox(
|
||||
context,
|
||||
textLines,
|
||||
textCoords.x,
|
||||
textCoords.y ,
|
||||
color
|
||||
);
|
||||
// drawTextBox(context, '', textCoords.x, textCoords.y, color);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
function _getUnit(modality, showHounsfieldUnits) {
|
||||
return modality === 'CT' && showHounsfieldUnits !== false ? 'HU' : '';
|
||||
}
|
||||
function _formatArea(area, hasPixelSpacing) {
|
||||
const suffix = hasPixelSpacing
|
||||
? ` mm${String.fromCharCode(178)}`
|
||||
: ` px${String.fromCharCode(178)}`;
|
||||
|
||||
return `Area: ${numbersWithCommas(area.toFixed(2))}${suffix}`;
|
||||
}
|
||||
function getCanvasRadius(handles, fixedRadius, element, pixelSpacing) {
|
||||
let startCoords = {
|
||||
x: handles.end.x,
|
||||
y: handles.end.y
|
||||
}
|
||||
const handleCanvasStartCoords = external.cornerstone.pixelToCanvas(
|
||||
element,
|
||||
startCoords
|
||||
);
|
||||
let r = getPixelRadius(fixedRadius, pixelSpacing)
|
||||
let endCoords = {
|
||||
x: handles.end.x + r,
|
||||
y: handles.end.y
|
||||
}
|
||||
const handleCanvasEndCoords = external.cornerstone.pixelToCanvas(
|
||||
element,
|
||||
endCoords
|
||||
);
|
||||
return Math.abs(handleCanvasEndCoords.x - handleCanvasStartCoords.x)
|
||||
}
|
||||
function getPixelRadius(r, pixelSpacing) {
|
||||
return r / ((pixelSpacing && pixelSpacing.colPixelSpacing) || 1)
|
||||
}
|
||||
function _calculateStats(image, element, handles, modality, pixelSpacing, fixedRadius, digits) {
|
||||
// Retrieve the bounds of the ellipse in image coordinates
|
||||
let startCoords = {
|
||||
x: handles.end.x,
|
||||
y: handles.end.y
|
||||
}
|
||||
let r = getPixelRadius(fixedRadius, pixelSpacing)
|
||||
let endCoords = {
|
||||
x: handles.end.x + r,
|
||||
y: handles.end.y
|
||||
}
|
||||
const circleCoordinates = getCircleCoords(startCoords, endCoords);
|
||||
|
||||
// Retrieve the array of pixels that the ellipse bounds cover
|
||||
const pixels = external.cornerstone.getPixels(
|
||||
element,
|
||||
circleCoordinates.left,
|
||||
circleCoordinates.top,
|
||||
circleCoordinates.width,
|
||||
circleCoordinates.height
|
||||
);
|
||||
|
||||
// Calculate the mean & standard deviation from the pixels and the ellipse details.
|
||||
const ellipseMeanStdDev = calculateEllipseStatistics(
|
||||
pixels,
|
||||
circleCoordinates
|
||||
);
|
||||
|
||||
let meanStdDevSUV;
|
||||
|
||||
if (modality === 'PT') {
|
||||
meanStdDevSUV = {
|
||||
mean: calculateSUV(image, ellipseMeanStdDev.mean, true) || 0,
|
||||
stdDev: calculateSUV(image, ellipseMeanStdDev.stdDev, true) || 0,
|
||||
};
|
||||
}
|
||||
|
||||
const radius =
|
||||
(circleCoordinates.width *
|
||||
((pixelSpacing && pixelSpacing.colPixelSpacing) || 1)) /
|
||||
2;
|
||||
const perimeter = 2 * Math.PI * radius;
|
||||
const area =
|
||||
Math.PI *
|
||||
((circleCoordinates.width *
|
||||
((pixelSpacing && pixelSpacing.colPixelSpacing) || 1)) /
|
||||
2) *
|
||||
((circleCoordinates.height *
|
||||
((pixelSpacing && pixelSpacing.rowPixelSpacing) || 1)) /
|
||||
2);
|
||||
const x = Math.round(handles.end.x);
|
||||
const y = Math.round(handles.end.y);
|
||||
|
||||
const stats = {};
|
||||
|
||||
if (x >= 0 && y >= 0 && x < image.columns && y < image.rows) {
|
||||
stats.x = x;
|
||||
stats.y = y;
|
||||
}
|
||||
return {
|
||||
area: area || 0,
|
||||
radius: radius || 0,
|
||||
perimeter: perimeter || 0,
|
||||
mean: ellipseMeanStdDev.mean.toFixed(digits) || 0,
|
||||
stdDev: ellipseMeanStdDev.stdDev.toFixed(digits) || 0,
|
||||
min: ellipseMeanStdDev.min.toFixed(digits) || 0,
|
||||
max: ellipseMeanStdDev.max.toFixed(digits) || 0,
|
||||
meanStdDevSUV,
|
||||
x: stats.x,
|
||||
y: stats.y
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
import pointInEllipse from './pointInEllipse.js';
|
||||
|
||||
/**
|
||||
* Calculates the statistics of an elliptical region of interest.
|
||||
*
|
||||
* @private
|
||||
* @function calculateEllipseStatistics
|
||||
*
|
||||
* @param {number[]} sp - Array of the image data's pixel values.
|
||||
* @param {Object} ellipse - { top, left, height, width } - An object describing the ellipse.
|
||||
* @returns {Object} { count, mean, variance, stdDev, min, max }
|
||||
*/
|
||||
export default function(sp, ellipse) {
|
||||
let sum = 0;
|
||||
let sumSquared = 0;
|
||||
let count = 0;
|
||||
let index = 0;
|
||||
let min = null;
|
||||
let max = null;
|
||||
|
||||
for (let y = ellipse.top; y < ellipse.top + ellipse.height; y++) {
|
||||
for (let x = ellipse.left; x < ellipse.left + ellipse.width; x++) {
|
||||
const point = {
|
||||
x,
|
||||
y,
|
||||
};
|
||||
|
||||
if (pointInEllipse(ellipse, point)) {
|
||||
if (min === null) {
|
||||
min = sp[index];
|
||||
max = sp[index];
|
||||
}
|
||||
|
||||
sum += sp[index];
|
||||
sumSquared += sp[index] * sp[index];
|
||||
min = Math.min(min, sp[index]);
|
||||
max = Math.max(max, sp[index]);
|
||||
count++;
|
||||
}
|
||||
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
if (count === 0) {
|
||||
return {
|
||||
count,
|
||||
mean: 0.0,
|
||||
variance: 0.0,
|
||||
stdDev: 0.0,
|
||||
min: 0.0,
|
||||
max: 0.0,
|
||||
};
|
||||
}
|
||||
|
||||
const mean = sum / count;
|
||||
const variance = sumSquared / count - mean * mean;
|
||||
|
||||
return {
|
||||
count,
|
||||
mean,
|
||||
variance,
|
||||
stdDev: Math.sqrt(variance),
|
||||
min,
|
||||
max,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import * as cornerstoneTools from 'cornerstone-tools'
|
||||
const external = cornerstoneTools.external
|
||||
|
||||
/**
|
||||
* Retrieve the bounds of the circle in image coordinates
|
||||
*
|
||||
* @param {*} startHandle
|
||||
* @param {*} endHandle
|
||||
* @returns {{ left: number, top: number, width: number, height: number }}
|
||||
*/
|
||||
export default function getCircleCoords(startHandle, endHandle) {
|
||||
const { distance } = external.cornerstoneMath.point
|
||||
const radius = distance(startHandle, endHandle)
|
||||
|
||||
return {
|
||||
left: Math.floor(Math.min(startHandle.x - radius, endHandle.x)),
|
||||
top: Math.floor(Math.min(startHandle.y - radius, endHandle.y)),
|
||||
width: radius * 2,
|
||||
height: radius * 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Returns true if a point is within an ellipse
|
||||
* @export @public @method
|
||||
* @name pointInEllipse
|
||||
*
|
||||
* @param {Object} ellipse Object defining the ellipse.
|
||||
* @param {Object} location The location of the point.
|
||||
* @returns {boolean} True if the point is within the ellipse.
|
||||
*/
|
||||
export default function(ellipse, location) {
|
||||
const xRadius = ellipse.width / 2;
|
||||
const yRadius = ellipse.height / 2;
|
||||
|
||||
if (xRadius <= 0.0 || yRadius <= 0.0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const center = {
|
||||
x: ellipse.left + xRadius,
|
||||
y: ellipse.top + yRadius,
|
||||
};
|
||||
|
||||
/* This is a more general form of the circle equation
|
||||
*
|
||||
* X^2/a^2 + Y^2/b^2 <= 1
|
||||
*/
|
||||
|
||||
const normalized = {
|
||||
x: location.x - center.x,
|
||||
y: location.y - center.y,
|
||||
};
|
||||
|
||||
const inEllipse =
|
||||
(normalized.x * normalized.x) / (xRadius * xRadius) +
|
||||
(normalized.y * normalized.y) / (yRadius * yRadius) <=
|
||||
1.0;
|
||||
|
||||
return inEllipse;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<box-content style="height: 100%;background: #fff;">
|
||||
<box-content style="height: 100%; background: #fff">
|
||||
<!-- 搜索框 -->
|
||||
<div class="search">
|
||||
<el-form :inline="true" class="base-search-form">
|
||||
@@ -8,7 +8,7 @@
|
||||
<el-select
|
||||
v-model="searchData.FileTypeId"
|
||||
clearable
|
||||
style="width:150px;"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item of $d.Trial_Document"
|
||||
@@ -20,14 +20,14 @@
|
||||
</el-form-item>
|
||||
<!-- 文件名称 -->
|
||||
<el-form-item :label="$t('trials:attachment:table:fileName')">
|
||||
<el-input v-model="searchData.Name" style="width:100px;" />
|
||||
<el-input v-model="searchData.Name" style="width: 100px" />
|
||||
</el-form-item>
|
||||
<!-- 培训状态 -->
|
||||
<el-form-item :label="$t('trials:attachment:table:isDeleted')">
|
||||
<el-select
|
||||
clearable
|
||||
v-model="searchData.IsDeleted"
|
||||
style="width:150px;"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item of $d.TrainingStatus"
|
||||
@@ -42,11 +42,18 @@
|
||||
<el-select
|
||||
v-model="searchData.UserTypeId"
|
||||
clearable
|
||||
style="width:100%;"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item of userTypeOptions"
|
||||
v-show="item.UserTypeEnum !== 1 && item.UserTypeEnum !== 8 && item.UserTypeEnum !== 20 && item.UserTypeEnum !== 26 && item.UserTypeEnum !== 27 && item.UserTypeEnum !== 31"
|
||||
v-show="
|
||||
item.UserTypeEnum !== 1 &&
|
||||
item.UserTypeEnum !== 8 &&
|
||||
item.UserTypeEnum !== 20 &&
|
||||
item.UserTypeEnum !== 26 &&
|
||||
item.UserTypeEnum !== 27 &&
|
||||
item.UserTypeEnum !== 31
|
||||
"
|
||||
:key="item.Id"
|
||||
:label="item.UserTypeShortName"
|
||||
:value="item.Id"
|
||||
@@ -55,20 +62,23 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</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>
|
||||
<span style="margin-left:auto;">
|
||||
<span style="margin-left: auto">
|
||||
<!-- 新增 -->
|
||||
<el-button
|
||||
v-hasPermi="['trials:trials-panel:setting:attachment:add']"
|
||||
@@ -85,7 +95,7 @@
|
||||
<el-table
|
||||
ref="attachmentList"
|
||||
v-loading="loading"
|
||||
v-adaptive="{bottomOffset:60}"
|
||||
v-adaptive="{ bottomOffset: 60 }"
|
||||
:data="list"
|
||||
stripe
|
||||
height="100"
|
||||
@@ -125,8 +135,12 @@
|
||||
min-width="100"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.IsDeleted" type="danger">{{ $fd('TrainingStatus', !scope.row.IsDeleted) }}</el-tag>
|
||||
<el-tag v-else type="primary">{{ $fd('TrainingStatus', !scope.row.IsDeleted) }}</el-tag>
|
||||
<el-tag v-if="scope.row.IsDeleted" type="danger">{{
|
||||
$fd('TrainingStatus', !scope.row.IsDeleted)
|
||||
}}</el-tag>
|
||||
<el-tag v-else type="primary">{{
|
||||
$fd('TrainingStatus', !scope.row.IsDeleted)
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 需要签署的用户类型 -->
|
||||
@@ -137,7 +151,11 @@
|
||||
min-width="100"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.NeedConfirmedUserTypes?scope.row.NeedConfirmedUserTypes.join(', '):'' }}
|
||||
{{
|
||||
scope.row.NeedConfirmedUserTypes
|
||||
? scope.row.NeedConfirmedUserTypes.join(', ')
|
||||
: ''
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 描述 -->
|
||||
@@ -148,14 +166,21 @@
|
||||
min-width="300"
|
||||
/> -->
|
||||
<!-- 更新时间 -->
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
prop="UpdateTime"
|
||||
:label="$t('trials:attachment:table:updateTime')"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
min-width="160"
|
||||
/> -->
|
||||
<!--创建时间-->
|
||||
<el-table-column
|
||||
prop="CreateTime"
|
||||
:label="$t('trials:attachment:table:CreateTime')"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
min-width="160"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
:label="$t('common:action:action')"
|
||||
min-width="140"
|
||||
@@ -192,7 +217,13 @@
|
||||
</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"
|
||||
/>
|
||||
|
||||
<!-- 新增/编辑 -->
|
||||
<el-dialog
|
||||
@@ -203,7 +234,11 @@
|
||||
width="800px"
|
||||
custom-class="base-dialog-wrapper"
|
||||
>
|
||||
<AttachmentForm :data="currentRow" @closeDialog="closeDialog" @getList="getList" />
|
||||
<AttachmentForm
|
||||
:data="currentRow"
|
||||
@closeDialog="closeDialog"
|
||||
@getList="getList"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 预览文件 -->
|
||||
@@ -215,16 +250,25 @@
|
||||
append-to-body
|
||||
custom-class="base-dialog-wrapper"
|
||||
>
|
||||
<div class="base-modal-body" style="border:2px solid #ccc;padding: 10px">
|
||||
<PreviewFile v-if="previewVisible" :file-path="currentPath" :file-type="currentType" />
|
||||
<div
|
||||
class="base-modal-body"
|
||||
style="border: 2px solid #ccc; padding: 10px"
|
||||
>
|
||||
<PreviewFile
|
||||
v-if="previewVisible"
|
||||
:file-path="currentPath"
|
||||
:file-type="currentType"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
</box-content>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import { getTrialDocumentList, userAbandonDoc, getTrialUserTypeList } from '@/api/trials'
|
||||
import {
|
||||
getTrialDocumentList,
|
||||
userAbandonDoc,
|
||||
getTrialUserTypeList,
|
||||
} from '@/api/trials'
|
||||
import BoxContent from '@/components/BoxContent'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import AttachmentForm from './components/attachmentForm'
|
||||
@@ -238,7 +282,7 @@ const searchDataDefault = () => {
|
||||
SortField: '',
|
||||
Asc: false,
|
||||
IsDeleted: null,
|
||||
UserTypeId: null
|
||||
UserTypeId: null,
|
||||
}
|
||||
}
|
||||
export default {
|
||||
@@ -258,7 +302,7 @@ export default {
|
||||
currentPath: '',
|
||||
currentType: '',
|
||||
trialId: '',
|
||||
userTypeOptions: []
|
||||
userTypeOptions: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -271,31 +315,38 @@ export default {
|
||||
getList() {
|
||||
this.loading = true
|
||||
this.searchData.TrialId = this.trialId
|
||||
getTrialDocumentList(this.searchData).then(res => {
|
||||
this.loading = false
|
||||
const { CurrentPageData, TotalCount } = res.Result
|
||||
CurrentPageData.forEach(item => {
|
||||
item.NeedConfirmedUserTypes = []
|
||||
item.NeedConfirmedUserTypeeIds = []
|
||||
item.NeedConfirmedUserTypeList.forEach((i) => {
|
||||
item.NeedConfirmedUserTypes.push(i.UserTypeShortName)
|
||||
item.NeedConfirmedUserTypeeIds.push(i.NeedConfirmUserTypeId)
|
||||
getTrialDocumentList(this.searchData)
|
||||
.then((res) => {
|
||||
this.loading = false
|
||||
const { CurrentPageData, TotalCount } = res.Result
|
||||
CurrentPageData.forEach((item) => {
|
||||
item.NeedConfirmedUserTypes = []
|
||||
item.NeedConfirmedUserTypeeIds = []
|
||||
item.NeedConfirmedUserTypeList.forEach((i) => {
|
||||
item.NeedConfirmedUserTypes.push(i.UserTypeShortName)
|
||||
item.NeedConfirmedUserTypeeIds.push(i.NeedConfirmUserTypeId)
|
||||
})
|
||||
})
|
||||
this.list = CurrentPageData
|
||||
this.total = TotalCount
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
this.list = CurrentPageData
|
||||
this.total = TotalCount
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 获取用户类型下拉数据
|
||||
getUserType() {
|
||||
getTrialUserTypeList().then(res => {
|
||||
this.userTypeOptions = res.Result
|
||||
if (this.form.Id) {
|
||||
this.form.NeedConfirmedUserTypeIdList = this.data.NeedConfirmedUserTypeeIds
|
||||
}
|
||||
}).catch(() => { this.loading = false })
|
||||
getTrialUserTypeList()
|
||||
.then((res) => {
|
||||
this.userTypeOptions = res.Result
|
||||
if (this.form.Id) {
|
||||
this.form.NeedConfirmedUserTypeIdList =
|
||||
this.data.NeedConfirmedUserTypeeIds
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 新增
|
||||
handleAdd() {
|
||||
@@ -307,7 +358,9 @@ export default {
|
||||
handlePreview(row) {
|
||||
const { Name, FullFilePath } = row
|
||||
this.currentPath = FullFilePath
|
||||
this.currentType = row.Name ? Name.substring(Name.lastIndexOf('.') + 1).toLocaleLowerCase() : ''
|
||||
this.currentType = row.Name
|
||||
? Name.substring(Name.lastIndexOf('.') + 1).toLocaleLowerCase()
|
||||
: ''
|
||||
this.previewVisible = true
|
||||
},
|
||||
// 编辑
|
||||
@@ -320,19 +373,25 @@ export default {
|
||||
handleRepeal(row) {
|
||||
this.$confirm(this.$t('trials:attachment:message:abolish'), {
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
distinguishCancelAndClose: true,
|
||||
})
|
||||
.then(() => {
|
||||
this.loading = true
|
||||
userAbandonDoc(row.Id, false)
|
||||
.then(res => {
|
||||
.then((res) => {
|
||||
this.loading = false
|
||||
if (res.IsSuccess) {
|
||||
this.getList()
|
||||
this.$message.success(this.$t('trials:trials-list:message:abolitionSuccessfully'))
|
||||
this.$message.success(
|
||||
this.$t('trials:trials-list:message:abolitionSuccessfully')
|
||||
)
|
||||
}
|
||||
}).catch(() => { this.loading = false })
|
||||
}).catch(() => {})
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
// 关闭编辑弹窗
|
||||
closeDialog() {
|
||||
@@ -361,7 +420,7 @@ export default {
|
||||
this.searchData.SortField = column.prop
|
||||
this.searchData.PageIndex = 1
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -109,15 +109,13 @@ export default {
|
||||
this.TrialSiteId = row.TrialSiteId
|
||||
this.config.title = this.$t(
|
||||
'trials:trials-panel:setting:personnel-manage:dicomAETitle'
|
||||
).replace('xxx', `${row.TrialSiteCode}、${row.TrialSiteAliasName}`)
|
||||
)
|
||||
.replace('xxx', `${row.TrialSiteCode}`)
|
||||
.replace('yyy', `${row.TrialSiteAliasName}`)
|
||||
|
||||
this.siteData = row
|
||||
this.config.visible = true
|
||||
this.getList()
|
||||
console.log(
|
||||
this.hasPermi([
|
||||
'trials:trials-panel:setting:personnel-manage:edit-site',
|
||||
])
|
||||
)
|
||||
},
|
||||
// 获取dicomAE列表
|
||||
async getList() {
|
||||
|
||||
@@ -47,26 +47,26 @@
|
||||
:disabled="loading"
|
||||
@click="config.visible = false"
|
||||
>
|
||||
{{ $t("common:button:cancel") }}
|
||||
{{ $t('common:button:cancel') }}
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" :loading="loading" @click="save">
|
||||
{{ $t("common:button:save") }}
|
||||
{{ $t('common:button:save') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</base-model>
|
||||
</template>
|
||||
<script>
|
||||
import { addOrUpdateTrialSiteDicomAE } from "@/api/trials";
|
||||
import BaseModel from "@/components/BaseModel";
|
||||
import { addOrUpdateTrialSiteDicomAE } from '@/api/trials'
|
||||
import BaseModel from '@/components/BaseModel'
|
||||
export default {
|
||||
name: "dicomForm",
|
||||
name: 'dicomForm',
|
||||
components: { BaseModel },
|
||||
data() {
|
||||
return {
|
||||
config: {
|
||||
visible: false,
|
||||
title: null,
|
||||
width: "600px",
|
||||
width: '600px',
|
||||
appendToBody: true,
|
||||
},
|
||||
form: {
|
||||
@@ -80,128 +80,127 @@ export default {
|
||||
CallingAE: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("common:ruleMessage:specify"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
pattern: /[a-zA-Z0-9]/,
|
||||
message: this.$t("common:ruleMessage:CallingAEPattern"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:CallingAEPattern'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
min: 1,
|
||||
max: 16,
|
||||
message: this.$t("common:ruleMessage:CallingAEPattern"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:CallingAEPattern'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
Ip: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("common:ruleMessage:specify"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (
|
||||
value === "" ||
|
||||
typeof value === "undefined" ||
|
||||
value === '' ||
|
||||
typeof value === 'undefined' ||
|
||||
value == null
|
||||
) {
|
||||
callback(new Error(this.$t("common:ruleMessage:ipPattern")));
|
||||
callback(new Error(this.$t('common:ruleMessage:ipPattern')))
|
||||
} else {
|
||||
const reg =
|
||||
/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
|
||||
if (!reg.test(value) && value !== "") {
|
||||
callback(new Error(this.$t("common:ruleMessage:ipPattern")));
|
||||
/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
|
||||
if (!reg.test(value) && value !== '') {
|
||||
callback(new Error(this.$t('common:ruleMessage:ipPattern')))
|
||||
} else {
|
||||
callback();
|
||||
callback()
|
||||
}
|
||||
}
|
||||
},
|
||||
message: this.$t("common:ruleMessage:ipPattern"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:ipPattern'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
Port: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("common:ruleMessage:specify"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
type: "number",
|
||||
type: 'number',
|
||||
min: 0,
|
||||
max: 65535,
|
||||
message: this.$t("common:ruleMessage:portPattern"),
|
||||
trigger: "blur",
|
||||
message: this.$t('common:ruleMessage:portPattern'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (
|
||||
value &&
|
||||
(String(value).includes(".") ||
|
||||
(String(value).includes('.') ||
|
||||
new RegExp(/\D/g).test(String(value)))
|
||||
) {
|
||||
callback(new Error(this.$t("common:ruleMessage:portPattern")));
|
||||
callback(new Error(this.$t('common:ruleMessage:portPattern')))
|
||||
} else {
|
||||
callback();
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: "blur",
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
siteData: {},
|
||||
loading: false,
|
||||
status: "add",
|
||||
};
|
||||
status: 'add',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(siteData, data = null, status = "add") {
|
||||
this.siteData = siteData;
|
||||
this.status = status;
|
||||
open(siteData, data = null, status = 'add') {
|
||||
this.siteData = siteData
|
||||
this.status = status
|
||||
Object.keys(this.form).forEach((key) => {
|
||||
this.form[key] = null;
|
||||
});
|
||||
if (data && status === "edit") {
|
||||
this.form[key] = null
|
||||
})
|
||||
if (data && status === 'edit') {
|
||||
Object.keys(this.form).forEach((key) => {
|
||||
this.form[key] = data[key];
|
||||
});
|
||||
this.form.Ip = data.IP;
|
||||
this.form[key] = data[key]
|
||||
})
|
||||
this.form.Ip = data.IP
|
||||
}
|
||||
this.config.title = this.$t(
|
||||
"trials:trials-panel:setting:personnel-manage:dicomAETitle"
|
||||
).replace(
|
||||
"xxx",
|
||||
`${siteData.TrialSiteCode}、${siteData.TrialSiteAliasName}`
|
||||
);
|
||||
this.config.visible = true;
|
||||
'trials:trials-panel:setting:personnel-manage:dicomAETitle'
|
||||
)
|
||||
.replace('xxx', `${siteData.TrialSiteCode}`)
|
||||
.replace('yyy', `${siteData.TrialSiteAliasName}`)
|
||||
this.config.visible = true
|
||||
},
|
||||
// 保存
|
||||
async save() {
|
||||
try {
|
||||
let validate = await this.$refs.dicomForm.validate();
|
||||
if (!validate) return false;
|
||||
this.loading = true;
|
||||
this.form.TrialSiteId = this.siteData.TrialSiteId;
|
||||
this.form.TrialId = this.$route.query.trialId;
|
||||
let res = await addOrUpdateTrialSiteDicomAE(this.form);
|
||||
this.loading = false;
|
||||
let validate = await this.$refs.dicomForm.validate()
|
||||
if (!validate) return false
|
||||
this.loading = true
|
||||
this.form.TrialSiteId = this.siteData.TrialSiteId
|
||||
this.form.TrialId = this.$route.query.trialId
|
||||
let res = await addOrUpdateTrialSiteDicomAE(this.form)
|
||||
this.loading = false
|
||||
if (res.IsSuccess) {
|
||||
this.status === "add"
|
||||
? this.$t("common:message:savedSuccessfully")
|
||||
: this.$t("common:message:savedFail");
|
||||
this.$emit("getList");
|
||||
this.$emit("save");
|
||||
this.config.visible = false;
|
||||
this.status === 'add'
|
||||
? this.$t('common:message:savedSuccessfully')
|
||||
: this.$t('common:message:savedFail')
|
||||
this.$emit('getList')
|
||||
this.$emit('save')
|
||||
this.config.visible = false
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
this.loading = false;
|
||||
console.log(err)
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -150,12 +150,7 @@
|
||||
min-width="100"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="scope.row.UserCount > 0"
|
||||
size="small"
|
||||
type="text"
|
||||
@click="getCrcList(scope.row)"
|
||||
>
|
||||
<el-button size="small" type="text" @click="getCrcList(scope.row)">
|
||||
{{
|
||||
scope.row.UserNameList.length > 0
|
||||
? scope.row.UserNameList.join(', ')
|
||||
@@ -412,7 +407,7 @@
|
||||
>
|
||||
<!-- 姓名 -->
|
||||
<el-table-column
|
||||
prop="UserRealName"
|
||||
prop="FullName"
|
||||
:label="$t('trials:internalStaff:table:name')"
|
||||
min-width="100"
|
||||
show-overflow-tooltip
|
||||
|
||||
@@ -16,7 +16,12 @@
|
||||
<el-select v-model="listQuery.UserTypeId" clearable class="mr">
|
||||
<el-option
|
||||
v-for="item of userTypeOptions"
|
||||
v-show="item.UserTypeEnum !== 8 && item.UserTypeEnum !== 31 && item.UserTypeEnum !== 26 && item.UserTypeEnum !== 27"
|
||||
v-show="
|
||||
item.UserTypeEnum !== 8 &&
|
||||
item.UserTypeEnum !== 31 &&
|
||||
item.UserTypeEnum !== 26 &&
|
||||
item.UserTypeEnum !== 27
|
||||
"
|
||||
:key="item.Id"
|
||||
:label="item.UserTypeShortName"
|
||||
:value="item.Id"
|
||||
@@ -32,8 +37,13 @@
|
||||
<!-- 状态 -->
|
||||
<el-form-item :label="$t('trials:staff:table:status')">
|
||||
<el-select v-model="listQuery.IsDeleted" clearable class="mr">
|
||||
<el-option v-for="item of $d.IsUserExitTrial" :label="item.label" :value="item.value" :key="item.id" />
|
||||
<!-- <el-option label="加入" :value="false" />-->
|
||||
<el-option
|
||||
v-for="item of $d.IsUserExitTrial"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.id"
|
||||
/>
|
||||
<!-- <el-option label="加入" :value="false" />-->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -42,14 +52,20 @@
|
||||
{{ $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-button
|
||||
v-hasPermi="['trials:trials-panel:setting:personnel-manage:add-internal-staff']"
|
||||
v-hasPermi="[
|
||||
'trials:trials-panel:setting:personnel-manage:add-internal-staff',
|
||||
]"
|
||||
type="primary"
|
||||
style="margin-left:10px"
|
||||
style="margin-left: 10px"
|
||||
icon="el-icon-plus"
|
||||
@click="handleAdd('Add')"
|
||||
>
|
||||
@@ -57,7 +73,9 @@
|
||||
</el-button>
|
||||
<!-- 添加外部人员 -->
|
||||
<el-button
|
||||
v-hasPermi="['trials:trials-panel:setting:personnel-manage:add-external-staff']"
|
||||
v-hasPermi="[
|
||||
'trials:trials-panel:setting:personnel-manage:add-external-staff',
|
||||
]"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="handleAdd('External')"
|
||||
@@ -88,7 +106,7 @@
|
||||
<el-table-column type="index" width="50" />
|
||||
<!-- 姓名 -->
|
||||
<el-table-column
|
||||
prop="UserRealName"
|
||||
prop="FullName"
|
||||
:label="$t('trials:staff:table:name')"
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
@@ -109,7 +127,24 @@
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
width="140"
|
||||
/>
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="
|
||||
Array.isArray(scope.row.TrialUserRoleList) &&
|
||||
scope.row.TrialUserRoleList.length > 0
|
||||
"
|
||||
type="text"
|
||||
@click.stop="openRoleList(scope.row)"
|
||||
>
|
||||
<span>{{
|
||||
scope.row.TrialUserRoleList.map(
|
||||
(item) => item.UserTypeShortName
|
||||
).join(',')
|
||||
}}</span>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 联系电话 -->
|
||||
<el-table-column
|
||||
prop="Phone"
|
||||
@@ -143,8 +178,12 @@
|
||||
min-width="40"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.IsDeleted" type="danger">{{ $fd('IsUserExitTrial', scope.row.IsDeleted) }}</el-tag>
|
||||
<el-tag v-else>{{ $fd('IsUserExitTrial', scope.row.IsDeleted) }}</el-tag>
|
||||
<el-tag v-if="scope.row.IsDeleted" type="danger">{{
|
||||
$fd('IsUserExitTrial', scope.row.IsDeleted)
|
||||
}}</el-tag>
|
||||
<el-tag v-else>{{
|
||||
$fd('IsUserExitTrial', scope.row.IsDeleted)
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 加入日期 -->
|
||||
@@ -156,7 +195,11 @@
|
||||
width="160"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.JoinTime?moment(scope.row.JoinTime).format('YYYY-MM-DD'):'' }}
|
||||
{{
|
||||
scope.row.JoinTime
|
||||
? moment(scope.row.JoinTime).format('YYYY-MM-DD')
|
||||
: ''
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 退出日期 -->
|
||||
@@ -168,25 +211,29 @@
|
||||
width="160"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.RemoveTime? moment(scope.row.RemoveTime).format('YYYY-MM-DD'):'' }}
|
||||
{{
|
||||
scope.row.RemoveTime
|
||||
? moment(scope.row.RemoveTime).format('YYYY-MM-DD')
|
||||
: ''
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 授权时间 -->
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
prop="CreateTime"
|
||||
:label="$t('trials:staff:table:authorizationTime')"
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
width="180"
|
||||
/>
|
||||
/> -->
|
||||
<!-- 禁用时间 -->
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
prop="DeletedTime"
|
||||
:label="$t('trials:staff:table:disableTime')"
|
||||
show-overflow-tooltip
|
||||
sortable
|
||||
min-width="60"
|
||||
/>
|
||||
/> -->
|
||||
|
||||
<el-table-column
|
||||
v-if="hasPermi(['trials:trials-panel:setting:personnel-manage:status'])"
|
||||
@@ -199,7 +246,9 @@
|
||||
circle
|
||||
:title="$t('trials:staff:action:status')"
|
||||
icon="el-icon-edit-outline"
|
||||
:disabled="hasPermi(['role:pm']) && scope.row.UserTypeEnum*1===1"
|
||||
:disabled="
|
||||
hasPermi(['role:pm']) && scope.row.UserTypeEnum * 1 === 1
|
||||
"
|
||||
@click="handleStatus(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
@@ -207,30 +256,60 @@
|
||||
</el-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<div class="pagination" style="text-align:right">
|
||||
<pagination :total="total" :page.sync="listQuery.PageIndex" :limit.sync="listQuery.PageSize" @pagination="getList" />
|
||||
<div class="pagination" style="text-align: right">
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="listQuery.PageIndex"
|
||||
:limit.sync="listQuery.PageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 分配参与人员模态框 -->
|
||||
<base-model v-if="staff_model.visible" :config="staff_model">
|
||||
<template slot="dialog-body">
|
||||
<StaffForm v-if="isAdd == 'Add'" @closeDialog="closeDialog" />
|
||||
<StaffExternalForm v-else @closeDialog="closeDialog" @getList="getList" />
|
||||
<StaffExternalForm
|
||||
v-else
|
||||
@closeDialog="closeDialog"
|
||||
@getList="getList"
|
||||
/>
|
||||
</template>
|
||||
</base-model>
|
||||
|
||||
<!-- 修改参与者人员状态 -->
|
||||
<base-model v-if="status_model.visible" :config="status_model">
|
||||
<template slot="dialog-body">
|
||||
<el-form ref="statusForm" :model="statusForm" label-width="110px" size="small" :rules="statusRules">
|
||||
<el-form
|
||||
ref="statusForm"
|
||||
:model="statusForm"
|
||||
label-width="110px"
|
||||
size="small"
|
||||
:rules="statusRules"
|
||||
>
|
||||
<!-- Status -->
|
||||
<el-form-item :label="$t('trials:staff:table:status')" prop="isDeleted">
|
||||
<el-radio-group v-model="statusForm.isDeleted" @change="handleIsDeletedChanged">
|
||||
<el-radio v-for="item of $d.IsUserExitTrial" :label="item.value" :key="item.id">{{ item.label }}</el-radio>
|
||||
<el-form-item
|
||||
:label="$t('trials:staff:table:status')"
|
||||
prop="isDeleted"
|
||||
>
|
||||
<el-radio-group
|
||||
v-model="statusForm.isDeleted"
|
||||
@change="handleIsDeletedChanged"
|
||||
>
|
||||
<el-radio
|
||||
v-for="item of $d.IsUserExitTrial"
|
||||
:label="item.value"
|
||||
:key="item.id"
|
||||
>{{ item.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- 退出日期 -->
|
||||
<el-form-item v-if="statusForm.isDeleted" :label="$t('trials:staff:table:exitTime')" prop="removeTime">
|
||||
<el-form-item
|
||||
v-if="statusForm.isDeleted"
|
||||
:label="$t('trials:staff:table:exitTime')"
|
||||
prop="removeTime"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="statusForm.removeTime"
|
||||
type="date"
|
||||
@@ -240,7 +319,11 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 加入日期 -->
|
||||
<el-form-item v-else :label="$t('trials:staff:table:joinTime')" prop="joinTime">
|
||||
<el-form-item
|
||||
v-else
|
||||
:label="$t('trials:staff:table:joinTime')"
|
||||
prop="joinTime"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="statusForm.joinTime"
|
||||
type="date"
|
||||
@@ -250,21 +333,114 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</template>
|
||||
<template slot="dialog-footer">
|
||||
<el-button :disabled="btnLoading" size="small" type="primary" @click="status_model.visible = false">
|
||||
<el-button
|
||||
:disabled="btnLoading"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="status_model.visible = false"
|
||||
>
|
||||
{{ $t('common:button:cancel') }}
|
||||
</el-button>
|
||||
<el-button size="small" type="primary" :loading="btnLoading" @click="saveStatus">
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
:loading="btnLoading"
|
||||
@click="saveStatus"
|
||||
>
|
||||
{{ $t('common:button:save') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</base-model>
|
||||
<!-- 修改参与者人员角色 -->
|
||||
<base-model v-if="role_model.visible" :config="role_model">
|
||||
<template slot="dialog-body">
|
||||
<el-table :data="roleList" style="width: 100%" max-height="300px">
|
||||
<el-table-column type="index" width="40" />
|
||||
<el-table-column
|
||||
prop="UserTypeShortName"
|
||||
:label="
|
||||
$t(
|
||||
'trials:trials-panel:setting:personnel-manage:table:UserTypeShortName'
|
||||
)
|
||||
"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="IsDeleted"
|
||||
:label="
|
||||
$t(
|
||||
'trials:trials-panel:setting:personnel-manage:table:IsUserRoleDisabled'
|
||||
)
|
||||
"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span> {{ $fd('IsEnable', !scope.row.IsDeleted) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="IsDeleted"
|
||||
:label="
|
||||
$t(
|
||||
'trials:trials-panel:setting:personnel-manage:table:enableTime'
|
||||
)
|
||||
"
|
||||
min-width="120px"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.IsDeleted">
|
||||
{{ scope.row.UpdateTime }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="IsDeleted"
|
||||
:label="
|
||||
$t(
|
||||
'trials:trials-panel:setting:personnel-manage:table:forbiddenTime'
|
||||
)
|
||||
"
|
||||
min-width="120px"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.IsDeleted">
|
||||
{{ scope.row.UpdateTime }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('common:action:action')" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
:disabled="scope.row.IsDeleted"
|
||||
@click.stop="changeRoleStatus(scope.row, true)"
|
||||
>
|
||||
{{ $fd('IsEnable', false) }}
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
:disabled="!scope.row.IsDeleted"
|
||||
@click.stop="changeRoleStatus(scope.row, false)"
|
||||
>
|
||||
{{ $fd('IsEnable', true) }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</base-model>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getMaintenanceList, getTrialUserTypeList, updateTrialUser, trialUserListExport } from '@/api/trials'
|
||||
import {
|
||||
getMaintenanceList,
|
||||
getTrialUserTypeList,
|
||||
updateTrialUser,
|
||||
trialUserListExport,
|
||||
updateTrialUserRole,
|
||||
} from '@/api/trials'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import StaffForm from './staffForm'
|
||||
import StaffExternalForm from './staffExternalForm'
|
||||
@@ -278,7 +454,7 @@ const getListQueryDefault = () => {
|
||||
OrganizationName: '',
|
||||
IsDeleted: null,
|
||||
PageIndex: 1,
|
||||
PageSize: 20
|
||||
PageSize: 20,
|
||||
}
|
||||
}
|
||||
export default {
|
||||
@@ -290,8 +466,16 @@ export default {
|
||||
listQuery: getListQueryDefault(),
|
||||
listLoading: false,
|
||||
total: 0,
|
||||
staff_model: { visible: false, title: this.$t('trials:staff:dialogTitle:add'), width: '1200px' },
|
||||
status_model: { visible: false, title: this.$t('trials:staff:dialogTitle:status'), width: '500px' },
|
||||
staff_model: {
|
||||
visible: false,
|
||||
title: this.$t('trials:staff:dialogTitle:add'),
|
||||
width: '1200px',
|
||||
},
|
||||
status_model: {
|
||||
visible: false,
|
||||
title: this.$t('trials:staff:dialogTitle:status'),
|
||||
width: '500px',
|
||||
},
|
||||
userTypeOptions: [],
|
||||
isAdd: 'Add',
|
||||
staffStatus: null,
|
||||
@@ -301,14 +485,33 @@ export default {
|
||||
moment,
|
||||
statusForm: { isDeleted: false, removeTime: '', joinTime: '' },
|
||||
statusRules: {
|
||||
removeTime: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur'] }],
|
||||
joinTime: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur'] }]
|
||||
removeTime: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:select'),
|
||||
trigger: ['blur'],
|
||||
},
|
||||
],
|
||||
joinTime: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:select'),
|
||||
trigger: ['blur'],
|
||||
},
|
||||
],
|
||||
},
|
||||
pickerOption: {
|
||||
disabledDate: time => {
|
||||
disabledDate: (time) => {
|
||||
return time.getTime() > Date.now()
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
roleList: [],
|
||||
role_model: {
|
||||
visible: false,
|
||||
title: this.$t('trials:staff:dialogTitle:role'),
|
||||
width: '800px',
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -317,15 +520,48 @@ export default {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
// 修改角色状态
|
||||
async changeRoleStatus(row, status) {
|
||||
try {
|
||||
let message = this.$t('trials:staff:comfirm:changeRoleStatus').replace(
|
||||
'xxx',
|
||||
this.$fd('IsEnable', !status)
|
||||
)
|
||||
let comfirm = await this.$confirm(message)
|
||||
if (!comfirm) return false
|
||||
let data = {
|
||||
IdList: [row.Id],
|
||||
IsDeleted: status,
|
||||
}
|
||||
let res = await updateTrialUserRole(data)
|
||||
if (res.IsSuccess) {
|
||||
row.IsDeleted = status
|
||||
this.$message.success(
|
||||
this.$t('trials:trials-myinfo:message:updateSuccessfully')
|
||||
)
|
||||
this.getList()
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
openRoleList(row) {
|
||||
this.roleList = row.TrialUserRoleList
|
||||
this.role_model.visible = true
|
||||
},
|
||||
// 分页获取项目参与人员列表
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
this.listQuery.TrialId = this.trialId
|
||||
getMaintenanceList(this.listQuery).then(res => {
|
||||
this.listLoading = false
|
||||
this.list = res.Result.CurrentPageData
|
||||
this.total = res.Result.TotalCount
|
||||
}).catch(() => { this.listLoading = false })
|
||||
getMaintenanceList(this.listQuery)
|
||||
.then((res) => {
|
||||
this.listLoading = false
|
||||
this.list = res.Result.CurrentPageData
|
||||
this.total = res.Result.TotalCount
|
||||
})
|
||||
.catch(() => {
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
// 新增项目参与者
|
||||
handleAdd(type) {
|
||||
@@ -347,7 +583,7 @@ export default {
|
||||
},
|
||||
// 修改参与者状态
|
||||
saveStatus() {
|
||||
this.$refs.statusForm.validate(valid => {
|
||||
this.$refs.statusForm.validate((valid) => {
|
||||
if (!valid) return
|
||||
this.btnLoading = true
|
||||
const param = {
|
||||
@@ -355,17 +591,18 @@ export default {
|
||||
trialId: this.trialId,
|
||||
isDeleted: this.statusForm.isDeleted,
|
||||
removeTime: this.statusForm.removeTime,
|
||||
joinTime: this.statusForm.joinTime
|
||||
joinTime: this.statusForm.joinTime,
|
||||
}
|
||||
updateTrialUser(param)
|
||||
.then(res => {
|
||||
.then((res) => {
|
||||
this.btnLoading = false
|
||||
if (res.IsSuccess) {
|
||||
this.status_model.visible = false
|
||||
this.getList()
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
this.btnLoading = false
|
||||
})
|
||||
})
|
||||
@@ -408,39 +645,43 @@ export default {
|
||||
handleExport() {
|
||||
this.listLoading = true
|
||||
this.listQuery.TrialId = this.trialId
|
||||
trialUserListExport({ ...this.listQuery }).then((data) => {
|
||||
this.listLoading = false
|
||||
}).catch(() => { this.listLoading = false })
|
||||
trialUserListExport({ ...this.listQuery })
|
||||
.then((data) => {
|
||||
this.listLoading = false
|
||||
})
|
||||
.catch(() => {
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
// 获取用户类型下拉数据
|
||||
getUserType() {
|
||||
getTrialUserTypeList().then(res => {
|
||||
getTrialUserTypeList().then((res) => {
|
||||
this.userTypeOptions = res.Result
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.participant-list{
|
||||
.filter-box{
|
||||
.participant-list {
|
||||
.filter-box {
|
||||
display: flex;
|
||||
padding: 5px;
|
||||
.base-search-form{
|
||||
.el-form-item{
|
||||
.base-search-form {
|
||||
.el-form-item {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
}
|
||||
.mr{
|
||||
.mr {
|
||||
margin-right: 5px;
|
||||
width: 120px;
|
||||
width: 120px;
|
||||
}
|
||||
}
|
||||
.el-dialog__header{
|
||||
padding:10px;
|
||||
.el-dialog__header {
|
||||
padding: 10px;
|
||||
}
|
||||
.el-dialog__body{
|
||||
padding:10px;
|
||||
.el-dialog__body {
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
+282
-69
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-container class="participant-container">
|
||||
<el-header style="height:50px">
|
||||
<el-header style="height: 50px">
|
||||
<div class="filter-container">
|
||||
<!-- 姓名 -->
|
||||
<span>{{ $t('trials:externalStaff:table:name') }}:</span>
|
||||
@@ -12,19 +12,54 @@
|
||||
<span>{{ $t('trials:externalStaff:table:phone') }}:</span>
|
||||
<el-input v-model="listQuery.Phone" size="mini" class="mr" clearable />
|
||||
<!-- 查询 -->
|
||||
<el-button type="primary" size="mini" icon="el-icon-search" @click="handleSearch">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
icon="el-icon-search"
|
||||
@click="handleSearch"
|
||||
>
|
||||
{{ $t('common:button:search') }}
|
||||
</el-button>
|
||||
<!-- 重置 -->
|
||||
<el-button size="mini" type="primary" icon="el-icon-refresh-left" @click="handleReset">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-refresh-left"
|
||||
@click="handleReset"
|
||||
>
|
||||
{{ $t('common:button:reset') }}
|
||||
</el-button>
|
||||
<!-- 权限配置 -->
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
style="margin-left: auto"
|
||||
:loading="assignLoadStatus"
|
||||
@click="openPermission"
|
||||
>
|
||||
{{ $t('trials:staff:button:permissionConfiguration') }}
|
||||
</el-button>
|
||||
<!-- 发送邮件 -->
|
||||
<el-button type="primary" size="mini" style="margin-left:auto" :disabled="selectArr.length === 0" :loading="assignLoadStatus" icon="el-icon-message" @click="sendEmail">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
style="margin-left: 10px"
|
||||
:disabled="selectArr.length === 0"
|
||||
:loading="assignLoadStatus"
|
||||
icon="el-icon-message"
|
||||
@click="sendEmail"
|
||||
>
|
||||
{{ $t('trials:staff:button:sendEmail') }}
|
||||
</el-button>
|
||||
<!-- 添加 -->
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" style="margin-left:10px" :loading="assignLoadStatus" @click="handleAdd">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
style="margin-left: 10px"
|
||||
:loading="assignLoadStatus"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('trials:staff:button:addExternalStaff') }}
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -53,7 +88,9 @@
|
||||
sortable="custom"
|
||||
min-width="100"
|
||||
>
|
||||
<template slot-scope="scope">{{ scope.row.LastName + ' / ' + scope.row.FirstName }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.LastName + ' / ' + scope.row.FirstName
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="UserType"
|
||||
@@ -63,7 +100,13 @@
|
||||
min-width="120"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ userTypeOptions.length > 0 ? userTypeOptions.find((v) => { return v.Id == scope.row.UserTypeId }).UserTypeShortName : '' }}
|
||||
{{
|
||||
userTypeOptions.length > 0
|
||||
? userTypeOptions.find((v) => {
|
||||
return v.Id == scope.row.UserTypeId
|
||||
}).UserTypeShortName
|
||||
: ''
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -96,9 +139,15 @@
|
||||
sortable="custom"
|
||||
min-width="120"
|
||||
>
|
||||
<template slot-scope="scope">{{ $fd('IsJoin', scope.row.IsJoin) }}</template>
|
||||
<template slot-scope="scope">{{
|
||||
$fd('IsJoin', scope.row.IsJoin)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('common:action:action')" fixed="right" min-width="150">
|
||||
<el-table-column
|
||||
:label="$t('common:action:action')"
|
||||
fixed="right"
|
||||
min-width="150"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
circle
|
||||
@@ -112,22 +161,103 @@
|
||||
</el-table>
|
||||
</div>
|
||||
</el-main>
|
||||
<StaffExternalAdd ref="StaffExternalAdd" :user-type-options="userTypeOptions" @getList="refeshList" />
|
||||
<StaffExternalAdd
|
||||
ref="StaffExternalAdd"
|
||||
:user-type-options="userTypeOptions"
|
||||
@getList="refeshList"
|
||||
/>
|
||||
<base-model v-if="model_config.visible" :config="model_config">
|
||||
<template slot="dialog-body">
|
||||
<el-form
|
||||
:model="permission"
|
||||
:rules="permissionRole"
|
||||
ref="permissionForm"
|
||||
label-width="140px"
|
||||
class="demo-ruleForm"
|
||||
>
|
||||
<el-form-item
|
||||
:label="$t('trials:externalStaff:form:IsSPMJoinReReadingApproval')"
|
||||
prop="IsSPMJoinReReadingApproval"
|
||||
>
|
||||
<el-radio-group v-model="permission.IsSPMJoinReReadingApproval">
|
||||
<el-radio
|
||||
v-for="item in $d.YesOrNo"
|
||||
:key="item.id"
|
||||
:label="item.value"
|
||||
>{{ item.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('trials:externalStaff:form:IsSPMJoinReviewerSelect')"
|
||||
prop="IsSPMJoinReviewerSelect"
|
||||
>
|
||||
<el-radio-group v-model="permission.IsSPMJoinReviewerSelect">
|
||||
<el-radio
|
||||
v-for="item in $d.YesOrNo"
|
||||
:key="item.id"
|
||||
:label="item.value"
|
||||
>{{ item.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('trials:externalStaff:form:IsSPMJoinSiteSurvey')"
|
||||
prop="IsSPMJoinSiteSurvey"
|
||||
>
|
||||
<el-radio-group v-model="permission.IsSPMJoinSiteSurvey">
|
||||
<el-radio
|
||||
v-for="item in $d.YesOrNo"
|
||||
:key="item.id"
|
||||
:label="item.value"
|
||||
>{{ item.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<template slot="dialog-footer">
|
||||
<el-button
|
||||
:disabled="assignLoadStatus"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="model_config.visible = false"
|
||||
>
|
||||
{{ $t('common:button:cancel') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
:loading="assignLoadStatus"
|
||||
@click="savePermission"
|
||||
>
|
||||
{{ $t('common:button:save') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</base-model>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
import { getTrialExternalUserList, addTrialUsers, getUserTypeList, sendExternalUserJoinEmail } from '@/api/trials'
|
||||
import {
|
||||
getTrialExternalUserList,
|
||||
addTrialUsers,
|
||||
getUserTypeList,
|
||||
sendExternalUserJoinEmail,
|
||||
getTrialConfigInfo,
|
||||
configTrialSPMInfo,
|
||||
} from '@/api/trials'
|
||||
import { deleteTrialExternalUser } from '@/api/trials/setting.js'
|
||||
import StaffExternalAdd from './staffExternalAdd'
|
||||
import BaseModel from '@/components/BaseModel'
|
||||
const getListQueryDefault = () => {
|
||||
return {
|
||||
Phone: '',
|
||||
Email: '',
|
||||
Name: ''
|
||||
Name: '',
|
||||
}
|
||||
}
|
||||
export default {
|
||||
components: { StaffExternalAdd },
|
||||
components: { StaffExternalAdd, BaseModel },
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
@@ -135,10 +265,28 @@ export default {
|
||||
listQuery: getListQueryDefault(),
|
||||
selectArr: [],
|
||||
assignLoadStatus: false,
|
||||
isAdmin: JSON.parse(zzSessionStorage.getItem('IsAdmin')),
|
||||
// isAdmin: JSON.parse(zzSessionStorage.getItem('IsAdmin')),
|
||||
userTypeOptions: [],
|
||||
stateList: ['WaitSent', 'HasSend', 'UserConfirmed', 'UserReject', 'OverTime'],
|
||||
trialId: ''
|
||||
stateList: [
|
||||
'WaitSent',
|
||||
'HasSend',
|
||||
'UserConfirmed',
|
||||
'UserReject',
|
||||
'OverTime',
|
||||
],
|
||||
trialId: '',
|
||||
model_config: {
|
||||
visible: false,
|
||||
title: this.$t('trials:staff:dialogTitle:permissionConfiguration'),
|
||||
width: '500px',
|
||||
appendToBody: true,
|
||||
},
|
||||
permission: {
|
||||
IsSPMJoinReReadingApproval: false,
|
||||
IsSPMJoinReviewerSelect: false,
|
||||
IsSPMJoinSiteSurvey: false,
|
||||
},
|
||||
permissionRole: {},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -147,6 +295,46 @@ export default {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
// 获取权限配置
|
||||
async getPermission() {
|
||||
try {
|
||||
let res = await getTrialConfigInfo(this.trialId)
|
||||
if (res.IsSuccess) {
|
||||
Object.keys(this.permission).forEach((key) => {
|
||||
this.permission[key] = res.Result[key]
|
||||
})
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
// 打开权限配置弹窗
|
||||
async openPermission() {
|
||||
try {
|
||||
await this.getPermission()
|
||||
this.model_config.visible = true
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
// 保存权限配置
|
||||
async savePermission() {
|
||||
try {
|
||||
let validate = await this.$refs.permissionForm.validate()
|
||||
if (!validate) return false
|
||||
this.assignLoadStatus = true
|
||||
let data = Object.assign({ Id: this.trialId }, this.permission)
|
||||
let res = await configTrialSPMInfo(data)
|
||||
this.assignLoadStatus = false
|
||||
if (res.IsSuccess) {
|
||||
this.model_config.visible = false
|
||||
this.$message.success(this.$t('common:message:updatedSuccessfully'))
|
||||
}
|
||||
} catch (err) {
|
||||
this.assignLoadStatus = false
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
refeshList() {
|
||||
this.getList()
|
||||
this.$emit('getList')
|
||||
@@ -156,83 +344,108 @@ export default {
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['StaffExternalAdd'].openDialog(this.$t('trials:externalStaff:dialogTitle:edit'), row)
|
||||
this.$refs['StaffExternalAdd'].openDialog(
|
||||
this.$t('trials:externalStaff:dialogTitle:edit'),
|
||||
row
|
||||
)
|
||||
})
|
||||
},
|
||||
handleAdd() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['StaffExternalAdd'].openDialog(this.$t('trials:externalStaff:dialogTitle:add'), {})
|
||||
this.$refs['StaffExternalAdd'].openDialog(
|
||||
this.$t('trials:externalStaff:dialogTitle:add'),
|
||||
{}
|
||||
)
|
||||
})
|
||||
},
|
||||
deleteTrialExternalUser(row) {
|
||||
this.$confirm(this.$t('trials:externalStaff:message:delete'), {
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
distinguishCancelAndClose: true,
|
||||
}).then(() => {
|
||||
this.loading = true
|
||||
deleteTrialExternalUser(row.Id, row.IsSystemUser, row.SystemUserId)
|
||||
.then((res) => {
|
||||
this.$message.success(this.$t('common:message:deletedSuccessfully'))
|
||||
this.getList()
|
||||
this.loading = false
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
.then(() => {
|
||||
this.loading = true
|
||||
deleteTrialExternalUser(row.Id, row.IsSystemUser, row.SystemUserId)
|
||||
.then(res => {
|
||||
this.$message.success(this.$t('common:message:deletedSuccessfully'))
|
||||
this.getList()
|
||||
this.loading = false
|
||||
}).catch(() => { this.loading = false })
|
||||
})
|
||||
},
|
||||
sendEmail() {
|
||||
const loading = this.$loading({
|
||||
target: document.querySelector('.participant-table-list'),
|
||||
fullscreen: false,
|
||||
lock: true
|
||||
lock: true,
|
||||
})
|
||||
// var BaseUrl = document.domain + `/#/login`
|
||||
var BaseUrl = `${location.protocol}//${location.host}/login`
|
||||
var joinUrl = `${location.protocol}//${location.host}/email-recompose`
|
||||
var sendEmailUserArr = this.selectArr.map((v) => { return { Id: v.Id, Email: v.Email, IsSystemUser: v.IsSystemUser, SystemUserId: v.SystemUserId } })
|
||||
var sendEmailUserArr = this.selectArr.map((v) => {
|
||||
return {
|
||||
Id: v.Id,
|
||||
Email: v.Email,
|
||||
IsSystemUser: v.IsSystemUser,
|
||||
SystemUserId: v.SystemUserId,
|
||||
UserTypeId: v.UserTypeId,
|
||||
}
|
||||
})
|
||||
sendExternalUserJoinEmail({
|
||||
TrialId: this.trialId,
|
||||
SendUsers: sendEmailUserArr,
|
||||
BaseUrl: BaseUrl,
|
||||
RouteUrl: joinUrl
|
||||
}).then(() => {
|
||||
loading.close()
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
this.getList()
|
||||
this.$emit('getList')
|
||||
}).catch(() => { loading.close() })
|
||||
RouteUrl: joinUrl,
|
||||
})
|
||||
.then(() => {
|
||||
loading.close()
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
this.getList()
|
||||
this.$emit('getList')
|
||||
})
|
||||
.catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
const loading = this.$loading({
|
||||
target: document.querySelector('.participant-table-list'),
|
||||
fullscreen: false,
|
||||
lock: true
|
||||
lock: true,
|
||||
})
|
||||
this.listQuery.TrialId = this.trialId
|
||||
getTrialExternalUserList(this.listQuery).then(res => {
|
||||
loading.close()
|
||||
this.list = res.Result
|
||||
}).catch(() => { loading.close() })
|
||||
getTrialExternalUserList(this.listQuery)
|
||||
.then((res) => {
|
||||
loading.close()
|
||||
this.list = res.Result
|
||||
})
|
||||
.catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
handleAssign() {
|
||||
this.$confirm(this.$t('trials:externalStaff:message:add'), {
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
distinguishCancelAndClose: true,
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
target: document.querySelector('.participant-table-list'),
|
||||
fullscreen: false,
|
||||
lock: true
|
||||
lock: true,
|
||||
})
|
||||
this.assignLoadStatus = true
|
||||
addTrialUsers(this.selectArr)
|
||||
.then(res => {
|
||||
.then((res) => {
|
||||
this.assignLoadStatus = false
|
||||
loading.close()
|
||||
if (res.IsSuccess) {
|
||||
this.$emit('closeDialog')
|
||||
this.$message.success(this.$t('common:message:savedSuccessfully'))
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
loading.close()
|
||||
this.assignLoadStatus = false
|
||||
})
|
||||
@@ -267,35 +480,35 @@ export default {
|
||||
}
|
||||
},
|
||||
getUserType() {
|
||||
getUserTypeList(1).then(res => {
|
||||
getUserTypeList(1).then((res) => {
|
||||
this.userTypeOptions = res.Result
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.participant-container{
|
||||
height: 100%;
|
||||
.el-header{
|
||||
.filter-container{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
span{
|
||||
font-size:13px;
|
||||
margin-right:5px;
|
||||
}
|
||||
.mr{
|
||||
margin-right: 5px;
|
||||
width: 120px;
|
||||
}
|
||||
.participant-container {
|
||||
height: 100%;
|
||||
.el-header {
|
||||
.filter-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
span {
|
||||
font-size: 13px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.mr {
|
||||
margin-right: 5px;
|
||||
width: 120px;
|
||||
}
|
||||
}
|
||||
.el-main{
|
||||
padding: 0px;
|
||||
}
|
||||
.el-footer{
|
||||
padding: 0 20px;
|
||||
}
|
||||
}
|
||||
.el-main {
|
||||
padding: 0px;
|
||||
}
|
||||
.el-footer {
|
||||
padding: 0 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,19 +1,39 @@
|
||||
<template>
|
||||
<el-container class="participant-container">
|
||||
<el-header style="height:50px">
|
||||
<el-header style="height: 50px">
|
||||
<div class="filter-container">
|
||||
<!-- 姓名 -->
|
||||
<span>{{ $t('trials:staff:table:name') }}:</span>
|
||||
<el-input v-model="listQuery.UserRealName" size="mini" class="mr" clearable />
|
||||
<el-input
|
||||
v-model="listQuery.UserRealName"
|
||||
size="mini"
|
||||
class="mr"
|
||||
clearable
|
||||
/>
|
||||
<!-- 用户名 -->
|
||||
<span>{{ $t('trials:staff:table:uid') }}:</span>
|
||||
<el-input v-model="listQuery.UserName" size="mini" class="mr" clearable />
|
||||
<el-input
|
||||
v-model="listQuery.UserName"
|
||||
size="mini"
|
||||
class="mr"
|
||||
clearable
|
||||
/>
|
||||
<!-- 单位 -->
|
||||
<span>{{ $t('trials:staff:table:organization') }}:</span>
|
||||
<el-input v-model="listQuery.OrganizationName" size="mini" class="mr" clearable />
|
||||
<el-input
|
||||
v-model="listQuery.OrganizationName"
|
||||
size="mini"
|
||||
class="mr"
|
||||
clearable
|
||||
/>
|
||||
<!-- 用户类型 -->
|
||||
<span>{{ $t('trials:staff:table:userType') }}:</span>
|
||||
<el-select v-model="listQuery.UserTypeEnum" size="mini" clearable class="mr">
|
||||
<el-select
|
||||
v-model="listQuery.UserTypeEnum"
|
||||
size="mini"
|
||||
clearable
|
||||
class="mr"
|
||||
>
|
||||
<el-option
|
||||
v-for="item of userTypeOptions"
|
||||
:key="item.Id"
|
||||
@@ -24,15 +44,33 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!-- 查询 -->
|
||||
<el-button type="primary" size="mini" icon="el-icon-search" @click="handleSearch">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
icon="el-icon-search"
|
||||
@click="handleSearch"
|
||||
>
|
||||
{{ $t('common:button:search') }}
|
||||
</el-button>
|
||||
<!-- 重置 -->
|
||||
<el-button size="mini" type="primary" icon="el-icon-refresh-left" @click="handleReset">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-refresh-left"
|
||||
@click="handleReset"
|
||||
>
|
||||
{{ $t('common:button:reset') }}
|
||||
</el-button>
|
||||
|
||||
<el-button type="primary" size="mini" style="margin-left:auto" :disabled="selectArr.length === 0" :loading="assignLoadStatus" icon="el-icon-plus" @click="handleAssign">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
style="margin-left: auto"
|
||||
:disabled="selectArr.length === 0"
|
||||
:loading="assignLoadStatus"
|
||||
icon="el-icon-plus"
|
||||
@click="handleAssign"
|
||||
>
|
||||
{{ $t('common:button:add') }}
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -55,7 +93,7 @@
|
||||
<el-table-column type="index" width="50" />
|
||||
<!-- 姓名 -->
|
||||
<el-table-column
|
||||
prop="UserRealName"
|
||||
prop="FullName"
|
||||
:label="$t('trials:staff:table:name')"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
@@ -95,23 +133,31 @@
|
||||
/>
|
||||
<!-- 用户类型 -->
|
||||
<el-table-column
|
||||
prop="UserType"
|
||||
prop="UserTypeShortName"
|
||||
:label="$t('trials:staff:table:userType')"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
min-width="100"
|
||||
/>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
</el-main>
|
||||
<div class="pagination" style="text-align: right;margin-top:5px;">
|
||||
<pagination :total="total" :page.sync="listQuery.PageIndex" :limit.sync="listQuery.PageSize" @pagination="getList" />
|
||||
<div class="pagination" style="text-align: right; margin-top: 5px">
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="listQuery.PageIndex"
|
||||
:limit.sync="listQuery.PageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
import { getTrialUserScreeningList, addTrialUsers, getUserTypeList } from '@/api/trials'
|
||||
import {
|
||||
getTrialUserScreeningList,
|
||||
addTrialUsers,
|
||||
getUserTypeList,
|
||||
} from '@/api/trials'
|
||||
import Pagination from '@/components/Pagination'
|
||||
const getListQueryDefault = () => {
|
||||
return {
|
||||
@@ -120,7 +166,7 @@ const getListQueryDefault = () => {
|
||||
OrganizationName: '',
|
||||
UserTypeEnum: '',
|
||||
PageIndex: 1,
|
||||
PageSize: 20
|
||||
PageSize: 20,
|
||||
}
|
||||
}
|
||||
export default {
|
||||
@@ -132,9 +178,9 @@ export default {
|
||||
listQuery: getListQueryDefault(),
|
||||
selectArr: [],
|
||||
assignLoadStatus: false,
|
||||
isAdmin: JSON.parse(zzSessionStorage.getItem('IsAdmin')),
|
||||
// isAdmin: JSON.parse(zzSessionStorage.getItem('IsAdmin')),
|
||||
userTypeOptions: [],
|
||||
trialId: ''
|
||||
trialId: '',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -147,40 +193,44 @@ export default {
|
||||
const loading = this.$loading({
|
||||
target: document.querySelector('.participant-table-list'),
|
||||
fullscreen: false,
|
||||
lock: true
|
||||
lock: true,
|
||||
})
|
||||
this.listQuery.TrialId = this.trialId
|
||||
getTrialUserScreeningList(this.listQuery).then(res => {
|
||||
loading.close()
|
||||
this.list = res.Result.CurrentPageData
|
||||
this.total = res.Result.TotalCount
|
||||
}).catch(() => { loading.close() })
|
||||
getTrialUserScreeningList(this.listQuery)
|
||||
.then((res) => {
|
||||
loading.close()
|
||||
this.list = res.Result.CurrentPageData
|
||||
this.total = res.Result.TotalCount
|
||||
})
|
||||
.catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
handleAssign() {
|
||||
this.$confirm(this.$t('trials:staff:message:addStaff'), {
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true
|
||||
})
|
||||
.then(() => {
|
||||
const loading = this.$loading({
|
||||
target: document.querySelector('.participant-table-list'),
|
||||
fullscreen: false,
|
||||
lock: true
|
||||
})
|
||||
this.assignLoadStatus = true
|
||||
addTrialUsers(this.selectArr)
|
||||
.then(res => {
|
||||
this.assignLoadStatus = false
|
||||
loading.close()
|
||||
if (res.IsSuccess) {
|
||||
this.$emit('closeDialog')
|
||||
this.$message.success(this.$t('common:message:addedSuccessfully'))
|
||||
}
|
||||
}).catch(() => {
|
||||
loading.close()
|
||||
this.assignLoadStatus = false
|
||||
})
|
||||
distinguishCancelAndClose: true,
|
||||
}).then(() => {
|
||||
const loading = this.$loading({
|
||||
target: document.querySelector('.participant-table-list'),
|
||||
fullscreen: false,
|
||||
lock: true,
|
||||
})
|
||||
this.assignLoadStatus = true
|
||||
addTrialUsers(this.selectArr)
|
||||
.then((res) => {
|
||||
this.assignLoadStatus = false
|
||||
loading.close()
|
||||
if (res.IsSuccess) {
|
||||
this.$emit('closeDialog')
|
||||
this.$message.success(this.$t('common:message:addedSuccessfully'))
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
loading.close()
|
||||
this.assignLoadStatus = false
|
||||
})
|
||||
})
|
||||
},
|
||||
handleSearch() {
|
||||
this.listQuery.PageIndex = 1
|
||||
@@ -211,34 +261,34 @@ export default {
|
||||
}
|
||||
},
|
||||
getUserType() {
|
||||
getUserTypeList(2).then(res => {
|
||||
getUserTypeList(2).then((res) => {
|
||||
this.userTypeOptions = res.Result
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.participant-container{
|
||||
.participant-container {
|
||||
height: 100%;
|
||||
.el-header{
|
||||
.filter-container{
|
||||
.el-header {
|
||||
.filter-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
span{
|
||||
font-size:13px;
|
||||
margin-right:5px;
|
||||
span {
|
||||
font-size: 13px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.mr{
|
||||
.mr {
|
||||
margin-right: 5px;
|
||||
width: 120px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.el-main{
|
||||
.el-main {
|
||||
padding: 0px;
|
||||
}
|
||||
.el-footer{
|
||||
.el-footer {
|
||||
padding: 0 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -632,10 +632,10 @@
|
||||
:close-on-click-modal="false"
|
||||
:title="$t('trials:logincCfg:form:modality')"
|
||||
custom-class="base-dialog-wrapper"
|
||||
width="900px"
|
||||
width="400px"
|
||||
>
|
||||
<div class="base-dialog-body" style="height: 400px; text-align: center">
|
||||
<el-transfer
|
||||
<div class="base-dialog-body">
|
||||
<!-- <el-transfer
|
||||
filterable
|
||||
:filter-method="filterMethod"
|
||||
filter-placeholder=""
|
||||
@@ -651,8 +651,8 @@
|
||||
}"
|
||||
:render-content="renderFunc"
|
||||
>
|
||||
</el-transfer>
|
||||
<!-- <el-table
|
||||
</el-transfer> -->
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="$d.Modality"
|
||||
stripe
|
||||
@@ -671,7 +671,7 @@
|
||||
prop="value"
|
||||
:label="$t('trials:logincCfg:form:modality')"
|
||||
/>
|
||||
</el-table> -->
|
||||
</el-table>
|
||||
</div>
|
||||
<div
|
||||
class="base-dialog-footer"
|
||||
@@ -959,7 +959,8 @@ export default {
|
||||
handleConfirmModality() {
|
||||
this.form.ModalityList = Object.assign(
|
||||
[],
|
||||
this.selectedList.map((v) => v)
|
||||
// this.selectedList.map((v) => v)
|
||||
this.selectedList.map((v) => v.value)
|
||||
)
|
||||
let Modalitys = this.form.ModalityList.map((item) => {
|
||||
return this.$fd('Modality', item.trim())
|
||||
@@ -984,12 +985,20 @@ export default {
|
||||
},
|
||||
handleSetModality() {
|
||||
this.modalityListVisible = true
|
||||
var a = this.$d.Modality.filter((v) => {
|
||||
return !!this.form.ModalityList.find((v1) => {
|
||||
return v1 === v.value
|
||||
this.$nextTick(() => {
|
||||
var a = this.$d.Modality.filter((v) => {
|
||||
return !!this.form.ModalityList.find((v1) => {
|
||||
return v1 === v.value
|
||||
})
|
||||
})
|
||||
this.toggleSelection(a)
|
||||
})
|
||||
this.selectedList = a.map((item) => item.value)
|
||||
// var a = this.$d.Modality.filter((v) => {
|
||||
// return !!this.form.ModalityList.find((v1) => {
|
||||
// return v1 === v.value
|
||||
// })
|
||||
// })
|
||||
// this.selectedList = a.map((item) => item.value)
|
||||
},
|
||||
handleBodyPartSelectionChange(val) {
|
||||
this.selectedBodyParts = val
|
||||
|
||||
@@ -121,6 +121,24 @@
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- 采集影像 -->
|
||||
<el-form-item
|
||||
:label="$t('trials:processCfg:form:CollectImagesEnum')"
|
||||
prop="CollectImagesEnum"
|
||||
>
|
||||
<el-radio-group
|
||||
v-model="form.CollectImagesEnum"
|
||||
:disabled="form.IsTrialProcessConfirmed && !isEdit"
|
||||
>
|
||||
<el-radio
|
||||
v-for="item of $d.CollectImagesType"
|
||||
:key="item.id"
|
||||
:label="item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- 修约小数位数 -->
|
||||
<!-- <el-form-item
|
||||
:label="$t('trials:processCfg:form:digitPlaces')"
|
||||
@@ -1157,6 +1175,7 @@ export default {
|
||||
ClinicalDataTrialSetIds: [],
|
||||
ClinicalDataSetNamesStr: '',
|
||||
QCProcessEnum: null,
|
||||
CollectImagesEnum: null,
|
||||
IsImageConsistencyVerification: null,
|
||||
ReadingMode: null,
|
||||
// ImagePlatform: null,
|
||||
@@ -1189,6 +1208,13 @@ export default {
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
CollectImagesEnum: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:select'),
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
QCProcessEnum: [
|
||||
{
|
||||
required: true,
|
||||
@@ -1455,6 +1481,14 @@ export default {
|
||||
this.initialForm.IsImageConsistencyVerification
|
||||
),
|
||||
},
|
||||
{
|
||||
Name: this.$t('trials:processCfg:form:CollectImagesEnum'), // 采集影像
|
||||
NewVal: this.$fd('CollectImagesType', this.form.CollectImagesEnum),
|
||||
OldVal: this.$fd(
|
||||
'CollectImagesType',
|
||||
this.initialForm.CollectImagesEnum
|
||||
),
|
||||
},
|
||||
// {
|
||||
// Name: this.$t('trials:processCfg:form:criterion'), // 阅片标准
|
||||
// NewVal: criterions.length > 0 ? criterions.join(', ') : '',
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
</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
|
||||
@@ -94,7 +94,7 @@
|
||||
icon="el-icon-refresh-left"
|
||||
@click="handleReset"
|
||||
>
|
||||
{{ $t("common:button:reset") }}
|
||||
{{ $t('common:button:reset') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -118,7 +118,7 @@
|
||||
sortable="custom"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ $fd("UserOptType", scope.row.OptType) }}
|
||||
{{ $fd('UserOptType', scope.row.OptType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -145,12 +145,12 @@
|
||||
/>
|
||||
<el-table-column
|
||||
:label="$t('trials:loginLog:table:userName')"
|
||||
prop="LoginUserName"
|
||||
prop="ActionUserName"
|
||||
min-width="90"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
/>
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
:label="$t('trials:loginLog:table:userType')"
|
||||
prop="LoginUserTypeEnum"
|
||||
min-width="90"
|
||||
@@ -158,18 +158,18 @@
|
||||
sortable="custom"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ $fd("UserType", scope.row.LoginUserTypeEnum) }}
|
||||
{{ $fd('UserType', scope.row.LoginUserTypeEnum) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
v-if="!isMine"
|
||||
:label="$t('trials:loginLog:table:optUserName')"
|
||||
prop="OptUserName"
|
||||
min-width="160"
|
||||
prop="TargetIdentityUserName"
|
||||
min-width="120"
|
||||
show-overflow-tooltip
|
||||
sortable="custom"
|
||||
/>
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
v-if="!isMine"
|
||||
:label="$t('trials:loginLog:table:optUserType')"
|
||||
prop="OptUserTypeEnum"
|
||||
@@ -178,7 +178,22 @@
|
||||
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: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
|
||||
@@ -198,32 +213,34 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
</template>
|
||||
<detail :config="config" :JsonObj="JsonObj" />
|
||||
</BaseContainer>
|
||||
</template>
|
||||
<script>
|
||||
import { getUserLogList, getTrialUserList } from "@/api/user";
|
||||
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: "",
|
||||
LoginUserName: "",
|
||||
Ip: '',
|
||||
LoginFaildName: '',
|
||||
LoginUserName: '',
|
||||
LoginUserTypeEnum: null,
|
||||
BeginDate: "",
|
||||
EndDate: "",
|
||||
BeginDate: '',
|
||||
EndDate: '',
|
||||
Asc: false,
|
||||
SortField: "CreateTime",
|
||||
SortField: 'CreateTime',
|
||||
PageIndex: 1,
|
||||
PageSize: 20,
|
||||
UserId: "",
|
||||
};
|
||||
};
|
||||
UserId: '',
|
||||
}
|
||||
}
|
||||
export default {
|
||||
components: { BaseContainer, Pagination },
|
||||
components: { BaseContainer, Pagination, detail },
|
||||
props: {
|
||||
isMine: {
|
||||
type: Boolean,
|
||||
@@ -231,7 +248,7 @@ export default {
|
||||
},
|
||||
id: {
|
||||
type: String,
|
||||
default: "",
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
@@ -243,75 +260,92 @@ export default {
|
||||
loading: false,
|
||||
datetimerange: [],
|
||||
trialUserList: [],
|
||||
};
|
||||
config: {
|
||||
visible: false,
|
||||
title: this.$t('trials:loginLog:dialog:title'),
|
||||
width: '500px',
|
||||
top: '10vh',
|
||||
},
|
||||
JsonObj: null,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.isMine) {
|
||||
this.getTrialUserList();
|
||||
this.getTrialUserList()
|
||||
}
|
||||
this.getList();
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
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,
|
||||
};
|
||||
let res = await getTrialUserList(params);
|
||||
}
|
||||
let res = await getTrialUserList(params)
|
||||
if (res.IsSuccess) {
|
||||
this.trialUserList = res.Result;
|
||||
this.trialUserList = res.Result
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(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.UserId = 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.datetimerange = null;
|
||||
this.searchData = searchDataDefault();
|
||||
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>
|
||||
|
||||
@@ -169,6 +169,7 @@
|
||||
<el-tab-pane
|
||||
:label="$t('trials:uploadedDicoms:tab:uploadDicoms')"
|
||||
name="dicom"
|
||||
v-if="[0, 1].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
<upload-dicom-files
|
||||
v-if="uploadVisible"
|
||||
@@ -183,6 +184,7 @@
|
||||
<el-tab-pane
|
||||
:label="$t('trials:uploadNonDicoms:tab:uploadNonDicoms')"
|
||||
name="non-dicom"
|
||||
v-if="[0, 2].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
<upload-non-dicom-files
|
||||
v-if="activeName === 'non-dicom'"
|
||||
@@ -473,6 +475,13 @@ export default {
|
||||
this.uploadBtnLoading = false
|
||||
if (res.IsSuccess) {
|
||||
dicomStore.studyList = []
|
||||
if (
|
||||
[0, 1].includes(this.$store.state.trials.config.CollectImagesEnum)
|
||||
) {
|
||||
this.activeName = 'dicom'
|
||||
} else {
|
||||
this.activeName = 'non-dicom'
|
||||
}
|
||||
this.uploadVisible = true
|
||||
}
|
||||
})
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
<el-tab-pane
|
||||
:label="$t('trials:uploadedDicoms:tab:uploadDicoms')"
|
||||
name="dicom"
|
||||
v-if="[0, 1].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
<upload-dicom-files :data="data" :subject-id="data.SubjectId" :subject-visit-id="data.Id" @close="closeUpload" @getList="reFreshList" />
|
||||
</el-tab-pane>
|
||||
@@ -125,6 +126,7 @@
|
||||
<el-tab-pane
|
||||
:label="$t('trials:uploadNonDicoms:tab:uploadNonDicoms')"
|
||||
name="non-dicom"
|
||||
v-if="[0, 2].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
<upload-non-dicom-files v-if="activeName==='non-dicom'" :data="data" :allow-add-or-edit="true" :body-parts="bodyParts" :modalities="modalities" :subject-visit-id="data.Id" @getList="reFreshList" />
|
||||
</el-tab-pane>
|
||||
@@ -347,6 +349,11 @@ export default {
|
||||
this.uploadBtnLoading = false;
|
||||
if (res.IsSuccess) {
|
||||
dicomStore.studyList = [];
|
||||
if ([0, 1].includes(this.$store.state.trials.config.CollectImagesEnum)) {
|
||||
this.activeName = 'dicom'
|
||||
} else {
|
||||
this.activeName = 'non-dicom'
|
||||
}
|
||||
this.uploadVisible = true;
|
||||
}
|
||||
})
|
||||
|
||||
@@ -742,7 +742,10 @@
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="tip">
|
||||
<div
|
||||
class="tip"
|
||||
v-if="[0].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
<i class="el-icon-warning-outline"></i>
|
||||
<div v-html="$t('trials:uploadedDicoms:tip:message')"></div>
|
||||
</div>
|
||||
@@ -751,6 +754,7 @@
|
||||
<el-tab-pane
|
||||
:label="$t('trials:uploadedDicoms:tab:uploadDicoms')"
|
||||
name="dicom"
|
||||
v-if="[0, 1].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
<upload-dicom-files2
|
||||
:data="rowData"
|
||||
@@ -766,6 +770,7 @@
|
||||
<el-tab-pane
|
||||
:label="$t('trials:uploadNonDicoms:tab:uploadNonDicoms')"
|
||||
name="non-dicom"
|
||||
v-if="[0, 2].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
<upload-non-dicom-files
|
||||
v-if="activeName === 'non-dicom'"
|
||||
@@ -890,8 +895,16 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- DICOM影像 -->
|
||||
<h4 class="box-title">{{ $t('trials:crcUpload:label:dicom') }}</h4>
|
||||
<el-card class="box-card">
|
||||
<h4
|
||||
class="box-title"
|
||||
v-if="[0, 1].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
{{ $t('trials:crcUpload:label:dicom') }}
|
||||
</h4>
|
||||
<el-card
|
||||
class="box-card"
|
||||
v-if="[0, 1].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
<StudyInfo
|
||||
v-if="rowData.Id"
|
||||
:data="rowData"
|
||||
@@ -900,10 +913,17 @@
|
||||
/>
|
||||
</el-card>
|
||||
<!-- 非DICOM影像 -->
|
||||
<h4 class="box-title" style="margin-top: 10px">
|
||||
<h4
|
||||
class="box-title"
|
||||
style="margin-top: 10px"
|
||||
v-if="[0, 2].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
{{ $t('trials:crcUpload:label:noneDicom') }}
|
||||
</h4>
|
||||
<el-card class="box-card">
|
||||
<el-card
|
||||
class="box-card"
|
||||
v-if="[0, 2].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
<UploadNonDicomFiles
|
||||
v-if="rowData.Id"
|
||||
:data="rowData"
|
||||
@@ -1737,12 +1757,10 @@ export default {
|
||||
this.selected.TrialId = this.subjectRowData.TrialId
|
||||
this.selected.SubjectId = this.subjectRowData.SubjectId
|
||||
this.isShow = true
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
},
|
||||
handleView2(row) {
|
||||
console.log(row)
|
||||
this.rowData = { ...row }
|
||||
this.openType = 'look'
|
||||
this.preview.visible = true
|
||||
@@ -1897,7 +1915,6 @@ export default {
|
||||
this.list = res.Result.CurrentPageData
|
||||
this.total = res.Result.TotalCount
|
||||
this.otherInfo = res.OtherInfo
|
||||
console.log(this.otherInfo)
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false
|
||||
@@ -1929,7 +1946,12 @@ export default {
|
||||
},
|
||||
CRChandleUpload2(row) {
|
||||
dicomStore.studyList = []
|
||||
this.activeName = 'dicom'
|
||||
if ([0, 1].includes(this.$store.state.trials.config.CollectImagesEnum)) {
|
||||
this.activeName = 'dicom'
|
||||
} else {
|
||||
this.activeName = 'non-dicom'
|
||||
}
|
||||
|
||||
this.rowData = { ...row }
|
||||
this.$store.state.trials.checkTaskId = row.Id
|
||||
this.uploadVisible = true
|
||||
@@ -2031,9 +2053,16 @@ export default {
|
||||
this.otherInfo.ClinicalInformationTransmissionEnum > 0 &&
|
||||
this.rowData.IsBaseLine
|
||||
) {
|
||||
const { ClinicalDataConfirmation } = const_.processSignature
|
||||
this.signCode = ClinicalDataConfirmation
|
||||
this.signVisible = true
|
||||
getVisitClinicalDataName({ id: this.rowData.Id })
|
||||
.then((res) => {
|
||||
this.signReplaceText = res.Result.ClinicalDataName
|
||||
const { ClinicalDataConfirmation } = const_.processSignature
|
||||
this.signCode = ClinicalDataConfirmation
|
||||
this.signVisible = true
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
} else {
|
||||
this.submit()
|
||||
}
|
||||
|
||||
@@ -860,18 +860,33 @@
|
||||
</el-form>
|
||||
<div>
|
||||
<!-- DICOM影像 -->
|
||||
<h4 class="box-title">{{ $t('trials:audit:tab:dicoms') }}</h4>
|
||||
<el-card class="box-card">
|
||||
<h4
|
||||
class="box-title"
|
||||
v-if="[0, 1].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
{{ $t('trials:audit:tab:dicoms') }}
|
||||
</h4>
|
||||
<el-card
|
||||
class="box-card"
|
||||
v-if="[0, 1].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
<DicomFiles v-if="rowData.Id" :data="rowData" />
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<!-- 非DICOM影像 -->
|
||||
<h4 class="box-title" style="margin-top: 10px">
|
||||
<h4
|
||||
class="box-title"
|
||||
style="margin-top: 10px"
|
||||
v-if="[0, 2].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
{{ $t('trials:audit:tab:nonDicoms') }}
|
||||
</h4>
|
||||
<el-card class="box-card">
|
||||
<el-card
|
||||
class="box-card"
|
||||
v-if="[0, 2].includes($store.state.trials.config.CollectImagesEnum)"
|
||||
>
|
||||
<UploadNonDicomFiles
|
||||
v-if="rowData.Id"
|
||||
:body-parts="OtherInfo.BodyPartTypes"
|
||||
|
||||
@@ -471,7 +471,6 @@ export default {
|
||||
...mapState('user', ['isTestUser'])
|
||||
},
|
||||
mounted() {
|
||||
console.log('isTestUser: ',this.isTestUser)
|
||||
this.getUserTobeDoneRecord()
|
||||
this.getNeedSignTrialDocTrialIdList()
|
||||
this.getUserInfo()
|
||||
@@ -488,10 +487,13 @@ export default {
|
||||
hoursTip=this.$t('common:date:good evening')
|
||||
}
|
||||
this.hoursTip = hoursTip
|
||||
this.$EventBus.$on("reload", (data) => {
|
||||
window.location.reload()
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getUserInfo() {
|
||||
getUser(this.userId).then(async res => {
|
||||
getUser().then(async res => {
|
||||
this.user = res.Result
|
||||
}).catch(() => { loading.close() })
|
||||
},
|
||||
@@ -507,7 +509,6 @@ export default {
|
||||
},
|
||||
getNeedSignTrialDocTrialIdList() {
|
||||
getNeedSignTrialDocTrialIdList().then(res => {
|
||||
console.log(res)
|
||||
this.trialIdList = res.Result
|
||||
this.$nextTick(() => {
|
||||
var list = document.querySelectorAll('div[tab-data]')
|
||||
|
||||
+385
-113
@@ -17,36 +17,78 @@
|
||||
<!-- 用户基本信息 -->
|
||||
{{ $t('trials:trials-myinfo:title:basicInfo') }}
|
||||
</div>
|
||||
<el-form ref="userForm" label-position="right" :model="user" :rules="userFormRules" label-width="120px">
|
||||
<el-form
|
||||
ref="userForm"
|
||||
label-position="right"
|
||||
:model="user"
|
||||
:rules="userFormRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form-item v-if="user.Code" label="ID: " prop="Code">
|
||||
<el-input v-model="user.Code" disabled />
|
||||
</el-form-item>
|
||||
<!-- 姓 -->
|
||||
<el-form-item :disabled="user.UserTypeEnum === 8" :label="$t('trials:trials-myinfo:form:surname')" prop="LastName">
|
||||
<el-input v-model="user.LastName" :placeholder="$t('trials:trials-myinfo:form:surname')"/>
|
||||
<el-form-item
|
||||
:disabled="user.UserTypeEnum === 8"
|
||||
:label="$t('trials:trials-myinfo:form:surname')"
|
||||
prop="LastName"
|
||||
>
|
||||
<el-input
|
||||
v-model="user.LastName"
|
||||
:placeholder="$t('trials:trials-myinfo:form:surname')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 名 -->
|
||||
<el-form-item :disabled="user.UserTypeEnum === 8" :label="$t('trials:trials-myinfo:form:givenname')" prop="FirstName">
|
||||
<el-input v-model="user.FirstName" :placeholder="$t('trials:trials-myinfo:form:givenname')"/>
|
||||
<el-form-item
|
||||
:disabled="user.UserTypeEnum === 8"
|
||||
:label="$t('trials:trials-myinfo:form:givenname')"
|
||||
prop="FirstName"
|
||||
>
|
||||
<el-input
|
||||
v-model="user.FirstName"
|
||||
:placeholder="$t('trials:trials-myinfo:form:givenname')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 性别 -->
|
||||
<el-form-item :label="$t('trials:trials-myinfo:form:gender')" prop="Sex" style="margin-right:40px;">
|
||||
<el-form-item
|
||||
:label="$t('trials:trials-myinfo:form:gender')"
|
||||
prop="Sex"
|
||||
style="margin-right: 40px"
|
||||
>
|
||||
<el-radio-group v-model="user.Sex">
|
||||
<el-radio :label="1">Male</el-radio>
|
||||
<el-radio :label="0">Female</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- 单位 -->
|
||||
<el-form-item :label="$t('trials:trials-myinfo:form:organization')" prop="OrganizationName">
|
||||
<el-input v-model="user.OrganizationName" :placeholder="$t('trials:trials-myinfo:form:organization')"/>
|
||||
<el-form-item
|
||||
:label="$t('trials:trials-myinfo:form:organization')"
|
||||
prop="OrganizationName"
|
||||
>
|
||||
<el-input
|
||||
v-model="user.OrganizationName"
|
||||
:placeholder="$t('trials:trials-myinfo:form:organization')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 部门 -->
|
||||
<el-form-item :label="$t('trials:trials-myinfo:form:department')" prop="DepartmentName">
|
||||
<el-input v-model="user.DepartmentName" :placeholder="$t('trials:trials-myinfo:form:organization')"/>
|
||||
<el-form-item
|
||||
:label="$t('trials:trials-myinfo:form:department')"
|
||||
prop="DepartmentName"
|
||||
>
|
||||
<el-input
|
||||
v-model="user.DepartmentName"
|
||||
:placeholder="$t('trials:trials-myinfo:form:organization')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 职位 -->
|
||||
<el-form-item :label="$t('trials:trials-myinfo:form:position')" prop="PositionName">
|
||||
<el-input v-model="user.PositionName" :placeholder="$t('trials:trials-myinfo:form:position')"/>
|
||||
<el-form-item
|
||||
:label="$t('trials:trials-myinfo:form:position')"
|
||||
prop="PositionName"
|
||||
>
|
||||
<el-input
|
||||
v-model="user.PositionName"
|
||||
:placeholder="$t('trials:trials-myinfo:form:position')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 保存 -->
|
||||
@@ -68,39 +110,97 @@
|
||||
</div>
|
||||
<el-form label-position="right" label-width="180px">
|
||||
<!-- 用户名 -->
|
||||
<el-form-item :label="$t('trials:trials-myinfo:form:userName')" style="margin-bottom: 5px;" prop="UserName">
|
||||
<el-form-item
|
||||
:label="$t('trials:trials-myinfo:form:userName')"
|
||||
style="margin-bottom: 5px"
|
||||
prop="UserName"
|
||||
>
|
||||
<span>{{ user.UserName }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="" style="position: relative" prop="UserName">
|
||||
<el-input v-model="userForm.UserName" :placeholder="$t('trials:trials-myinfo:form:userName')"/>
|
||||
<el-input
|
||||
v-model="userForm.UserName"
|
||||
:placeholder="$t('trials:trials-myinfo:form:userName')"
|
||||
/>
|
||||
<!-- 修改 -->
|
||||
<el-button :disabled="!userForm.UserName" class="saveBtn" type="primary" size="small" @click="setNewUserName">
|
||||
<el-button
|
||||
:disabled="!userForm.UserName"
|
||||
class="saveBtn"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="setNewUserName"
|
||||
>
|
||||
{{ $t('trials:trials-myinfo:button:update') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<!-- 电话 -->
|
||||
<el-form-item :label="$t('trials:trials-myinfo:form:phone')" style="margin-bottom: 5px;" prop="UserName">
|
||||
<el-form-item
|
||||
:label="$t('trials:trials-myinfo:form:phone')"
|
||||
style="margin-bottom: 5px"
|
||||
prop="UserName"
|
||||
>
|
||||
<span>{{ user.Phone }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="" style="position: relative" prop="UserName">
|
||||
<el-input v-model="userForm.Phone" :placeholder="$t('trials:trials-myinfo:form:phone')"/>
|
||||
<el-input
|
||||
v-model="userForm.Phone"
|
||||
:placeholder="$t('trials:trials-myinfo:form:phone')"
|
||||
/>
|
||||
<!-- 修改 -->
|
||||
<el-button :disabled="!userForm.Phone" class="saveBtn" type="primary" size="small" @click="setNewPhone">
|
||||
<el-button
|
||||
:disabled="!userForm.Phone"
|
||||
class="saveBtn"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="setNewPhone"
|
||||
>
|
||||
{{ $t('trials:trials-myinfo:button:update') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<!-- 邮箱 -->
|
||||
<el-form-item :label="$t('trials:trials-myinfo:form:email')" style="margin-bottom: 5px;" prop="UserName">
|
||||
<el-form-item
|
||||
:label="$t('trials:trials-myinfo:form:email')"
|
||||
style="margin-bottom: 5px"
|
||||
prop="UserName"
|
||||
>
|
||||
<span>{{ user.EMail }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="" style="margin-bottom: 10px;position: relative" prop="EMail">
|
||||
<el-input v-model="userForm.EMail" @input="handleEmailChange" :placeholder="$t('trials:trials-myinfo:form:email')"/>
|
||||
<el-button class="sendCode" :disabled="sendDisabled" type="primary" size="mini" @click="sendVerificationCode">{{ sendTitle }}</el-button>
|
||||
<el-form-item
|
||||
label=""
|
||||
style="margin-bottom: 10px; position: relative"
|
||||
prop="EMail"
|
||||
>
|
||||
<el-input
|
||||
v-model="userForm.EMail"
|
||||
@input="handleEmailChange"
|
||||
:placeholder="$t('trials:trials-myinfo:form:email')"
|
||||
/>
|
||||
<el-button
|
||||
class="sendCode"
|
||||
:disabled="sendDisabled"
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="sendVerificationCode"
|
||||
>{{ sendTitle }}</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item label="" style="position: relative" prop="VerificationCode">
|
||||
<el-input v-model="userForm.VerificationCode" :placeholder="$t('trials:researchForm:form:verifyCode')"/>
|
||||
<el-form-item
|
||||
label=""
|
||||
style="position: relative"
|
||||
prop="VerificationCode"
|
||||
>
|
||||
<el-input
|
||||
v-model="userForm.VerificationCode"
|
||||
:placeholder="$t('trials:researchForm:form:verifyCode')"
|
||||
/>
|
||||
<!-- 修改 -->
|
||||
<el-button :disabled="!userForm.EMail || !userForm.VerificationCode" class="saveBtn" type="primary" size="small" @click="setNewEmail">
|
||||
<el-button
|
||||
:disabled="!userForm.EMail || !userForm.VerificationCode"
|
||||
class="saveBtn"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="setNewEmail"
|
||||
>
|
||||
{{ $t('trials:trials-myinfo:button:update') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
@@ -111,18 +211,52 @@
|
||||
<!-- 修改密码 -->
|
||||
{{ $t('trials:trials-myinfo:title:updatePaasord') }}
|
||||
</div>
|
||||
<el-form ref="passwordForm" label-position="right" :model="password" :rules="passwordFormRules" label-width="180px">
|
||||
<el-form
|
||||
ref="passwordForm"
|
||||
label-position="right"
|
||||
:model="password"
|
||||
:rules="passwordFormRules"
|
||||
label-width="180px"
|
||||
>
|
||||
<!-- 旧密码 -->
|
||||
<el-form-item :label="$t('recompose:form:oldPassword')" prop="OldPassWord">
|
||||
<el-input v-model="password.OldPassWord" type="password" show-password auto-complete="new-password" :placeholder="$t('recompose:form:oldPassword')"/>
|
||||
<el-form-item
|
||||
:label="$t('recompose:form:oldPassword')"
|
||||
prop="OldPassWord"
|
||||
>
|
||||
<el-input
|
||||
v-model="password.OldPassWord"
|
||||
type="password"
|
||||
show-password
|
||||
auto-complete="new-password"
|
||||
:placeholder="$t('recompose:form:oldPassword')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 新密码 -->
|
||||
<el-form-item class="my_new_pwd" :label="$t('recompose:form:newPassword')" prop="NewPassWord">
|
||||
<el-input v-model="password.NewPassWord" type="password" show-password auto-complete="new-password" :placeholder="$t('recompose:form:newPassword')"/>
|
||||
<el-form-item
|
||||
class="my_new_pwd"
|
||||
:label="$t('recompose:form:newPassword')"
|
||||
prop="NewPassWord"
|
||||
>
|
||||
<el-input
|
||||
v-model="password.NewPassWord"
|
||||
type="password"
|
||||
show-password
|
||||
auto-complete="new-password"
|
||||
:placeholder="$t('recompose:form:newPassword')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 确认密码 -->
|
||||
<el-form-item :label="$t('recompose:form:confirmPassword')" prop="ConfirmPassWord">
|
||||
<el-input v-model="password.ConfirmPassWord" type="password" show-password auto-complete="new-password" :placeholder="$t('recompose:form:confirmPassword')"/>
|
||||
<el-form-item
|
||||
:label="$t('recompose:form:confirmPassword')"
|
||||
prop="ConfirmPassWord"
|
||||
>
|
||||
<el-input
|
||||
v-model="password.ConfirmPassWord"
|
||||
type="password"
|
||||
show-password
|
||||
auto-complete="new-password"
|
||||
:placeholder="$t('recompose:form:confirmPassword')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button
|
||||
@@ -139,13 +273,23 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserTypeList, getUser, updateUser, modifyPassword } from '@/api/admin.js'
|
||||
import { sendVerificationCode, setNewEmail, setNewPhone, setNewUserName } from '@/api/system/user.js'
|
||||
import {
|
||||
getUserTypeList,
|
||||
getUser,
|
||||
updateUser,
|
||||
modifyPassword,
|
||||
} from '@/api/admin.js'
|
||||
import {
|
||||
sendVerificationCode,
|
||||
setNewEmail,
|
||||
setNewPhone,
|
||||
setNewUserName,
|
||||
} from '@/api/system/user.js'
|
||||
import md5 from 'js-md5'
|
||||
var timer = ''
|
||||
var countdown = 60
|
||||
import store from '@/store'
|
||||
import {mapGetters, mapMutations} from 'vuex'
|
||||
import { mapGetters, mapMutations } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'TrialsMyinfo',
|
||||
@@ -158,38 +302,102 @@ export default {
|
||||
sendDisabled: true,
|
||||
sendTitle: this.$t('trials:trials-myinfo:button:getVCode'),
|
||||
userFormRules: {
|
||||
UserName: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }],
|
||||
UserTypeId: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }],
|
||||
IsZhiZhun: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }],
|
||||
OrganizationName: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }],
|
||||
LastName: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }, { max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50` }],
|
||||
FirstName: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }, { max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50` }],
|
||||
Sex: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }],
|
||||
Status: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }]
|
||||
UserName: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
UserTypeId: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:select'),
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
IsZhiZhun: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:select'),
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
OrganizationName: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
LastName: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{ max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50` },
|
||||
],
|
||||
FirstName: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{ max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50` },
|
||||
],
|
||||
Sex: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
Status: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
passwordFormRules: {
|
||||
OldPassWord: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }],
|
||||
OldPassWord: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
NewPassWord: [
|
||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' },
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
trigger: 'blur',
|
||||
validator: this.$validatePassword
|
||||
validator: this.$validatePassword,
|
||||
},
|
||||
],
|
||||
ConfirmPassWord: [
|
||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' },
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('common:ruleMessage:specify'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
trigger: 'blur',
|
||||
validator: this.$validatePassword
|
||||
validator: this.$validatePassword,
|
||||
},
|
||||
]
|
||||
}
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userId', 'name'])
|
||||
...mapGetters(['userId', 'name']),
|
||||
},
|
||||
mounted() {
|
||||
this.getUserInfo()
|
||||
@@ -198,7 +406,7 @@ export default {
|
||||
methods: {
|
||||
...mapMutations({ setLanguage: 'lang/setLanguage' }),
|
||||
handleSave() {
|
||||
this.$refs.userForm.validate(valid => {
|
||||
this.$refs.userForm.validate((valid) => {
|
||||
console.log(valid)
|
||||
if (valid) {
|
||||
this.isDisabled = true
|
||||
@@ -212,17 +420,24 @@ export default {
|
||||
// this.user.OrganizationName = 'ZhiZhun'
|
||||
// }
|
||||
if (this.user.Id) {
|
||||
updateUser(this.user).then(res => {
|
||||
this.isDisabled = false
|
||||
this.$message.success(this.$t('trials:trials-myinfo:message:updateSuccessfully'))
|
||||
this.getUserInfo()
|
||||
}).catch(() => { this.isDisabled = false })
|
||||
updateUser(this.user)
|
||||
.then((res) => {
|
||||
this.isDisabled = false
|
||||
this.$message.success(
|
||||
this.$t('trials:trials-myinfo:message:updateSuccessfully')
|
||||
)
|
||||
this.getUserInfo()
|
||||
})
|
||||
.catch(() => {
|
||||
this.isDisabled = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleEmailChange() {
|
||||
var reg = /^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/
|
||||
var reg =
|
||||
/^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/
|
||||
if (this.userForm.EMail && reg.test(this.userForm.EMail)) {
|
||||
this.sendDisabled = false
|
||||
} else {
|
||||
@@ -233,11 +448,13 @@ export default {
|
||||
sendVerificationCode(this.userForm.EMail).then(() => {
|
||||
this.settime(this)
|
||||
// 发送成功
|
||||
this.$message.success(this.$t('trials:trials-myinfo:message:sendSuccessfully'))
|
||||
this.$message.success(
|
||||
this.$t('trials:trials-myinfo:message:sendSuccessfully')
|
||||
)
|
||||
})
|
||||
},
|
||||
save() {
|
||||
this.$refs.passwordForm.validate(valid => {
|
||||
this.$refs.passwordForm.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.password.NewPassWord !== this.password.ConfirmPassWord) {
|
||||
this.$alert(this.$t('passwordReset:formRule:passwordsDiffer'))
|
||||
@@ -246,12 +463,14 @@ export default {
|
||||
const param = {
|
||||
UserId: this.userId,
|
||||
NewPassWord: md5(this.password.NewPassWord),
|
||||
OldPassWord: md5(this.password.OldPassWord)
|
||||
OldPassWord: md5(this.password.OldPassWord),
|
||||
}
|
||||
modifyPassword(param).then(res => {
|
||||
modifyPassword(param).then((res) => {
|
||||
if (res.IsSuccess) {
|
||||
// 修改成功,请重新登录账号
|
||||
this.$message.success(this.$t('trials:trials-myinfo:message:modifyPWSuccessfully'))
|
||||
this.$message.success(
|
||||
this.$t('trials:trials-myinfo:message:modifyPWSuccessfully')
|
||||
)
|
||||
setTimeout(() => {
|
||||
this.logout()
|
||||
}, 1000)
|
||||
@@ -261,26 +480,36 @@ export default {
|
||||
})
|
||||
},
|
||||
setNewEmail() {
|
||||
setNewEmail(this.userForm.EMail, this.userForm.VerificationCode).then(() => {
|
||||
this.userForm.EMail = ''
|
||||
this.userForm.VerificationCode = ''
|
||||
this.$message.success(this.$t('trials:trials-myinfo:message:updateSuccessfully'))
|
||||
this.getUserInfo()
|
||||
})
|
||||
setNewEmail(this.userForm.EMail, this.userForm.VerificationCode).then(
|
||||
() => {
|
||||
this.userForm.EMail = ''
|
||||
this.userForm.VerificationCode = ''
|
||||
this.$message.success(
|
||||
this.$t('trials:trials-myinfo:message:updateSuccessfully')
|
||||
)
|
||||
this.getUserInfo()
|
||||
}
|
||||
)
|
||||
},
|
||||
setNewUserName() {
|
||||
setNewUserName(this.userForm.UserName).then(() => {
|
||||
this.$store.dispatch('user/changeUserName', this.userForm.UserName).then((res) => {
|
||||
this.userForm.UserName = ''
|
||||
this.$message.success(this.$t('trials:trials-myinfo:message:updateSuccessfully'))
|
||||
this.getUserInfo()
|
||||
})
|
||||
this.$store
|
||||
.dispatch('user/changeUserName', this.userForm.UserName)
|
||||
.then((res) => {
|
||||
this.userForm.UserName = ''
|
||||
this.$message.success(
|
||||
this.$t('trials:trials-myinfo:message:updateSuccessfully')
|
||||
)
|
||||
this.getUserInfo()
|
||||
})
|
||||
})
|
||||
},
|
||||
setNewPhone() {
|
||||
setNewPhone(this.userForm.Phone).then(() => {
|
||||
this.userForm.Phone = ''
|
||||
this.$message.success(this.$t('trials:trials-myinfo:message:updateSuccessfully'))
|
||||
this.$message.success(
|
||||
this.$t('trials:trials-myinfo:message:updateSuccessfully')
|
||||
)
|
||||
this.getUserInfo()
|
||||
})
|
||||
},
|
||||
@@ -290,36 +519,42 @@ export default {
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.07)'
|
||||
background: 'rgba(0, 0, 0, 0.07)',
|
||||
})
|
||||
getUser(this.userId).then(async res => {
|
||||
this.user = res.Result
|
||||
/* eslint-disable */
|
||||
zzSessionStorage.setItem('realName', this.user.RealName)
|
||||
await store.dispatch('user/updateInfo')
|
||||
loading.close()
|
||||
}).catch(() => { loading.close() })
|
||||
getUser()
|
||||
.then(async (res) => {
|
||||
this.user = res.Result
|
||||
/* eslint-disable */
|
||||
zzSessionStorage.setItem('Name', this.user.FullName)
|
||||
await store.dispatch('user/updateInfo')
|
||||
loading.close()
|
||||
})
|
||||
.catch(() => {
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
settime(obj) {
|
||||
if (countdown === 0) {
|
||||
obj.sendDisabled = false
|
||||
obj.sendTitle = this.$t('trials:trials-myinfo:button:getVCode')// '获取验证码'
|
||||
obj.sendTitle = this.$t('trials:trials-myinfo:button:getVCode') // '获取验证码'
|
||||
countdown = 60
|
||||
clearTimeout(timer)
|
||||
return
|
||||
} else {
|
||||
obj.sendDisabled = true
|
||||
obj.sendTitle = `${this.$t('trials:trials-myinfo:button:wait')}(${countdown}s)`
|
||||
obj.sendTitle = `${this.$t(
|
||||
'trials:trials-myinfo:button:wait'
|
||||
)}(${countdown}s)`
|
||||
countdown--
|
||||
// eslint-disable-next-line no-self-assign
|
||||
countdown = countdown
|
||||
timer = setTimeout(function() {
|
||||
timer = setTimeout(function () {
|
||||
obj.settime(obj)
|
||||
}, 1000)
|
||||
}
|
||||
},
|
||||
getUserTypeList() {
|
||||
getUserTypeList().then(res => {
|
||||
getUserTypeList().then((res) => {
|
||||
if (res.IsSuccess) {
|
||||
this.userTypeOptions = res.Result
|
||||
}
|
||||
@@ -337,56 +572,93 @@ export default {
|
||||
this.$i18n.locale = 'zh'
|
||||
this.setLanguage('zh')
|
||||
this.$updateDictionary()
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.trial-myinfo{
|
||||
.trial-myinfo {
|
||||
background: #f3f3f3;
|
||||
flex: 1;overflow: auto;display: flex;flex-direction: row;justify-content: space-around;
|
||||
.trial-myinfo-head{
|
||||
position: absolute;top: 40px;left: -10%;font-size: 14px;
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-around;
|
||||
.trial-myinfo-head {
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
left: -10%;
|
||||
font-size: 14px;
|
||||
}
|
||||
.trial-myinfo-left{
|
||||
.trial-myinfo-left {
|
||||
overflow: auto;
|
||||
background: #fff;width: calc(50% - 9px);margin: 6px 0;
|
||||
background: #fff;
|
||||
width: calc(50% - 9px);
|
||||
margin: 6px 0;
|
||||
padding-bottom: 50px;
|
||||
.trial-myinfo-left-top{
|
||||
width: 70%;padding-top: 100px;position: relative;margin: 0 auto;margin-bottom: 10px;
|
||||
.trial-myinfo-body{
|
||||
width:160px;height:160px;border-radius: 50%;background: #428bca;display: flex;justify-content: center;align-items: center;
|
||||
div{
|
||||
color:#fff;font-size: 30px;
|
||||
.trial-myinfo-left-top {
|
||||
width: 70%;
|
||||
padding-top: 100px;
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 10px;
|
||||
.trial-myinfo-body {
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
border-radius: 50%;
|
||||
background: #428bca;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
div {
|
||||
color: #fff;
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.saveBtn{
|
||||
position: absolute;right: -10px;top:2px;transform: translateX(100%)
|
||||
.saveBtn {
|
||||
position: absolute;
|
||||
right: -10px;
|
||||
top: 2px;
|
||||
transform: translateX(100%);
|
||||
}
|
||||
.trial-info-btn{
|
||||
position: absolute;bottom: -60px;left: calc(100% + 10px);min-width: 97px;
|
||||
.trial-info-btn {
|
||||
position: absolute;
|
||||
bottom: -60px;
|
||||
left: calc(100% + 10px);
|
||||
min-width: 97px;
|
||||
}
|
||||
.trial-myinfo-left-bottom{
|
||||
width: 70%;padding-top: 100px;position: relative;margin: 0 auto;
|
||||
.trial-myinfo-left-bottom {
|
||||
width: 70%;
|
||||
padding-top: 100px;
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.trial-myinfo-right{
|
||||
.trial-myinfo-right {
|
||||
overflow: auto;
|
||||
background: #fff;width: calc(50% - 9px);margin: 6px 0;
|
||||
background: #fff;
|
||||
width: calc(50% - 9px);
|
||||
margin: 6px 0;
|
||||
padding-bottom: 50px;
|
||||
.sendCode {
|
||||
position: absolute;right: -10px;top: 50%;transform: translate(100%, -50%);
|
||||
position: absolute;
|
||||
right: -10px;
|
||||
top: 50%;
|
||||
transform: translate(100%, -50%);
|
||||
}
|
||||
.trial-myinfo-right-box{
|
||||
width: 70%;padding-top: 100px;position: relative;margin: 0 auto;
|
||||
.trial-myinfo-right-box {
|
||||
width: 70%;
|
||||
padding-top: 100px;
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
/deep/ .is-error.my_new_pwd{
|
||||
::v-deep .is-error.my_new_pwd {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user