Merge commit 'dba4466ac26890fcedfd8d20d8c20c9fd45e8850' into uat
continuous-integration/drone/push Build encountered an error Details

uat
wangxiaoshuang 2025-02-13 09:28:59 +08:00
commit 5dbddbea57
141 changed files with 8283 additions and 1941 deletions

View File

@ -5,3 +5,6 @@ npm install
# 启动服务 # 启动服务
npm run dev npm run dev
# v1.9.0修改
1. 角色修改全局userId实际意义修改为userRoleId用户角色id新增identityUserId新的用户id

View File

@ -30,7 +30,6 @@
</script> </script>
<% } else { %> <% } else { %>
<script> <script>
console.log(2)
window.zzSessionStorage = { window.zzSessionStorage = {
setItem: (item, value) => { setItem: (item, value) => {
return sessionStorage.setItem(item, value) return sessionStorage.setItem(item, value)

View File

@ -23,12 +23,38 @@
> >
i18n i18n
</div> </div>
<el-drawer title="国际化" :visible.sync="drawer" direction="rtl" size="80%"> <el-drawer
<div style="width: 320px"> :title="$t('il8n:title')"
<el-form label-width="100px" @submit.native.prevent size="small"> :visible.sync="drawer"
<el-form-item label="关键字"> direction="rtl"
size="80%"
>
<div style="width: 620px">
<el-form
label-width="100px"
@submit.native.prevent
size="small"
:inline="true"
class="demo-form-inline"
>
<el-form-item :label="$t('il8n:search:keyword')">
<el-input v-model="key" @input="keyChange" /> <el-input v-model="key" @input="keyChange" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('il8n:search:state')" v-if="il8nExternal">
<el-select
v-model="State"
clearable
filterable
@change="handleStateChange"
>
<el-option
v-for="item of $d.InternationalizationKeyState"
:key="'InternationalizationKeyState' + item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form> </el-form>
</div> </div>
<el-table <el-table
@ -39,7 +65,7 @@
> >
<el-table-column <el-table-column
prop="Code" prop="Code"
label="标签" :label="$t('il8n:table:label')"
width="300" width="300"
show-overflow-tooltip show-overflow-tooltip
> >
@ -53,7 +79,7 @@
<!-- {{scope.row.Description}}--> <!-- {{scope.row.Description}}-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column prop="Value" label="英文"> <el-table-column prop="Value" :label="$t('il8n:table:en')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model="scope.row.Value" v-model="scope.row.Value"
@ -66,7 +92,7 @@
></el-input> ></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="ValueCN" label="中文"> <el-table-column prop="ValueCN" :label="$t('il8n:table:cn')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
v-model="scope.row.ValueCN" v-model="scope.row.ValueCN"
@ -79,6 +105,27 @@
></el-input> ></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
prop="ValueCN"
:label="$t('il8n:table:state')"
v-if="il8nExternal"
>
<template slot-scope="scope">
<el-select
v-model="scope.row.State"
clearable
filterable
size="mini"
>
<el-option
v-for="item of $d.InternationalizationKeyState"
:key="'InternationalizationKeyState' + item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
</el-table> </el-table>
<div style="text-align: right; padding-top: 10px; padding-right: 10px"> <div style="text-align: right; padding-top: 10px; padding-right: 10px">
<el-button size="mini" @click="drawer = false">取消 </el-button> <el-button size="mini" @click="drawer = false">取消 </el-button>
@ -110,10 +157,13 @@ export default {
show: false, show: false,
key: null, key: null,
arr: [], arr: [],
il8nExternal: false,
State: null,
} }
}, },
mounted() { mounted() {
this.show = process.env.VUE_APP_OSS_PATH === '/test/dist' this.show = process.env.VUE_APP_OSS_PATH === '/test/dist'
Vue.prototype.$openI18n = this.openI18n
}, },
// watch: { // watch: {
// '$route.query': { // '$route.query': {
@ -145,6 +195,11 @@ export default {
// }, // },
// }, // },
methods: { methods: {
handleStateChange() {
this.tableData.forEach((item) => {
item.State = this.State
})
},
changeValue(target, attr, e) { changeValue(target, attr, e) {
this.$set(target, attr, e) this.$set(target, attr, e)
}, },
@ -154,9 +209,9 @@ export default {
[], [],
this.arr.filter( this.arr.filter(
(v) => (v) =>
~v.Code.indexOf(this.key) || ~v.Code.toLowerCase().indexOf(this.key.toLowerCase()) ||
~v.Value.indexOf(this.key) || ~v.Value.toLowerCase().indexOf(this.key.toLowerCase()) ||
~v.ValueCN.indexOf(this.key) ~v.ValueCN.toLowerCase().indexOf(this.key.toLowerCase())
) )
) )
} else { } else {
@ -181,22 +236,50 @@ export default {
i18n.mergeLocaleMessage('en', enMessages) i18n.mergeLocaleMessage('en', enMessages)
this.drawer = false this.drawer = false
this.$message.success('国际化修改成功') this.$message.success('国际化修改成功')
if (this.il8nExternal) {
this.$EventBus.$emit('il8nUpdate')
}
} }
) )
}) })
}, },
openI18n() { openI18n(ARRAY) {
this.tableData = [] this.tableData = []
this.il8nExternal = false
this.key = null this.key = null
this.drawer = true this.drawer = true
let arr = [] let arr = []
let tableData = this.$tl.map((v) => { let tableData = []
let a = { ...v } if (ARRAY && Array.isArray(ARRAY)) {
// if (!a.Description) { this.il8nExternal = true
// a.Description = this.$route.path let data = ARRAY.map((v) => {
// } let a = { ...v }
return a
}) return a
})
tableData = data.map((item) => {
return {
Code: item.Code,
Description: item.Description,
FrontType: item.FrontType,
Module: item.Module,
Value: item.Value,
ValueCN: item.ValueCN,
State: item.State,
}
})
this.tableData = Object.assign([], tableData)
this.arr = Object.assign([], tableData)
return false
} else {
tableData = this.$tl.map((v) => {
let a = { ...v }
// if (!a.Description) {
// a.Description = this.$route.path
// }
return a
})
}
tableData = tableData.filter((v) => { tableData = tableData.filter((v) => {
// return ~this.$path.indexOf(v.Description + '_' + v.Code) // return ~this.$path.indexOf(v.Description + '_' + v.Code)
return ~this.$path.indexOf(v.Code) return ~this.$path.indexOf(v.Code)

View File

@ -44,11 +44,19 @@ export function updateUser(param) {
data: param data: param
}) })
} }
export function updateUserBasicInfo(param) {
export function getUser(userId) {
return request({ return request({
url: `/user/getUser/${userId}`, url: `/user/updateUserBasicInfo`,
method: 'get' method: 'put',
data: param
})
}
export function getUser(params) {
return request({
url: `/user/getUser`,
method: 'get',
params
}) })
} }
@ -317,3 +325,20 @@ export function useUserIDGetDoctorID(data) {
data data
}) })
} }
// 管理端修改用户角色
export function updateUserRoleInfo(data) {
return request({
url: `/User/updateUserRoleInfo`,
method: 'put',
data
})
}
// 管理端新增用户发送邮件
export function addNewUserSendEmail(data) {
return request({
url: `/User/addNewUserSendEmail`,
method: 'post',
data
})
}

View File

@ -251,3 +251,37 @@ export function uploadOCTLipidAngleTemplate(param) {
data: param data: param
}) })
} }
export function saveTableQuestionMark(param, type) {
return request({
url: `/saveTableQuestionMark/${type}`,
method: 'post',
data: param
})
}
export function deleteTableQuestionMark(param, type) {
return request({
url: `/deleteTableQuestionMark/${type}`,
method: 'post',
data: param
})
}
export function submitTaskRowInfo(param, type) {
return request({
url: `/SubmitTaskRowInfo/${type}`,
method: 'post',
data: param
})
}
export function deleteSingleTableQuestionMark(param, type) {
return request({
url: `/DeleteSingleTableQuestionMark/${type}`,
method: 'post',
data: param
})
}

View File

@ -3914,4 +3914,48 @@ export function getVisitClinicalDataName(data) {
method: 'post', method: 'post',
data 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
})
}
// 获取报表配置
export function getTrialQuestionExportResult(data) {
return request({
url: `/ReadingQuestion/getTrialQuestionExportResult`,
method: 'post',
data
})
}
// 修改报表配置
export function setTrialQuestionExportResult(data) {
return request({
url: `/ReadingQuestion/SetTrialQuestionExportResult`,
method: 'post',
data
})
}
// 项目加入人员发送邮件
export function trialUserSendJoinEmail(data) {
return request({
url: `/TrialMaintenance/trialUserSendJoinEmail`,
method: 'post',
data
})
} }

View File

@ -179,11 +179,11 @@ export function verifyMFACode(params) {
} }
// 发送MFA邮件 // 发送MFA邮件
export function sendMFAEmail(params) { export function sendMFAEmail(data) {
return request({ return request({
url: `/User/sendMFAEmail`, url: `/User/sendMFAEmail`,
method: 'post', method: 'post',
params data
}) })
} }
// 获取公钥 // 获取公钥
@ -193,3 +193,19 @@ export function getPublicKey() {
method: 'get', 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,
})
}

View File

@ -13,6 +13,7 @@
v-model="searchData[item.prop]" v-model="searchData[item.prop]"
:placeholder="item.placeholder" :placeholder="item.placeholder"
size="mini" size="mini"
clearable
:style="{ width: item.width }" :style="{ width: item.width }"
:readonly="item.readonly" :readonly="item.readonly"
/> />
@ -22,6 +23,7 @@
v-model="searchData[item.prop]" v-model="searchData[item.prop]"
:placeholder="item.placeholder" :placeholder="item.placeholder"
size="mini" size="mini"
clearable
:style="{ width: item.width }" :style="{ width: item.width }"
@change="item.change && item.change(that, searchData[item.prop])" @change="item.change && item.change(that, searchData[item.prop])"
> >
@ -37,6 +39,7 @@
v-model="searchData[item.prop]" v-model="searchData[item.prop]"
:placeholder="item.placeholder" :placeholder="item.placeholder"
size="mini" size="mini"
clearable
:style="{ width: item.width }" :style="{ width: item.width }"
@change="item.change && item.change(that, searchData[item.prop])" @change="item.change && item.change(that, searchData[item.prop])"
> >
@ -96,6 +99,7 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
format="yyyy-MM-dd" format="yyyy-MM-dd"
:picker-options="item.pickerOption" :picker-options="item.pickerOption"
clearable
/> />
<!-- 时间 --> <!-- 时间 -->
<el-time-select <el-time-select
@ -104,6 +108,7 @@
:placeholder="item.placeholder" :placeholder="item.placeholder"
type="" type=""
:style="{ width: item.width }" :style="{ width: item.width }"
clearable
/> />
<!-- 日期时间 --> <!-- 日期时间 -->
<el-date-picker <el-date-picker
@ -114,12 +119,14 @@
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:disabled="item.disable && item.disable(searchData[item.prop])" :disabled="item.disable && item.disable(searchData[item.prop])"
:style="{ width: item.width }" :style="{ width: item.width }"
clearable
/> />
<!-- 日期时间段 --> <!-- 日期时间段 -->
<el-date-picker <el-date-picker
v-if="item.type === 'Daterange'" v-if="item.type === 'Daterange'"
v-model="searchData[item.prop]" v-model="searchData[item.prop]"
type="datetimerange" type="datetimerange"
:default-time="['00:00:00', '23:59:59']"
:range-separator="$t('baseForm:daterange:rangeSeparator')" :range-separator="$t('baseForm:daterange:rangeSeparator')"
:start-placeholder="$t('baseForm:daterange:startPlaceholder')" :start-placeholder="$t('baseForm:daterange:startPlaceholder')"
:end-placeholder="$t('baseForm:daterange:startendPlaceholder')" :end-placeholder="$t('baseForm:daterange:startendPlaceholder')"

View File

@ -48,6 +48,7 @@
:show-overflow-tooltip="column.showOverflowTooltip || false" :show-overflow-tooltip="column.showOverflowTooltip || false"
:sortable="column.sortable || false" :sortable="column.sortable || false"
:prop="column.prop" :prop="column.prop"
:fixed="column.fixed"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 仅仅显示文字 --> <!-- 仅仅显示文字 -->
@ -63,6 +64,10 @@
<el-button <el-button
:size="operate.size || 'mini'" :size="operate.size || 'mini'"
:type="operate.type || 'primary'" :type="operate.type || 'primary'"
v-if="
(operate.show && scope.row[operate.show]) ||
!operate.show
"
style="margin-right: 5px" style="margin-right: 5px"
@click="handleClick(operate, scope.row)" @click="handleClick(operate, scope.row)"
>{{ operate.name }}</el-button >{{ operate.name }}</el-button

View File

@ -21,7 +21,7 @@
label-width="100px" label-width="100px"
> >
<!-- 邮箱 --> <!-- 邮箱 -->
<p class="tip"> <p class="tip_mfa">
<i class="el-icon-warning" style="color: #409eff"></i> <i class="el-icon-warning" style="color: #409eff"></i>
<span>{{ tip }}</span> <span>{{ tip }}</span>
</p> </p>
@ -83,7 +83,7 @@ export default {
second: 60, second: 60,
form: { form: {
Code: null, Code: null,
UserId: null, IdentityUserId: null,
EMail: null, EMail: null,
username: null, username: null,
}, },
@ -115,7 +115,7 @@ export default {
methods: { methods: {
open(data) { open(data) {
let { UserId, status, username, EMail } = data; let { UserId, status, username, EMail } = data;
this.form.UserId = UserId; this.form.IdentityUserId = UserId;
this.status = status ? status : "login"; this.status = status ? status : "login";
this.form.username = username; this.form.username = username;
this.form.EMail = EMail; this.form.EMail = EMail;
@ -134,10 +134,10 @@ export default {
let res = await verifyMFACode(this.form); let res = await verifyMFACode(this.form);
this.loading = false; this.loading = false;
if (res.IsSuccess) { if (res.IsSuccess) {
if (this.status === "login") { // if (this.status === "login") {
this.$message.success(this.$t("mfa:message:verifySuccess")); // this.$message.success(this.$t("mfa:message:verifySuccess"));
} // }
this.$emit("success", this.form.UserId); this.$emit("success", this.form.IdentityUserId);
this.cancel(); this.cancel();
} }
} catch (err) { } catch (err) {
@ -154,7 +154,7 @@ export default {
this.timer = null; this.timer = null;
} }
let data = { let data = {
UserId: this.form.UserId, IdentityUserId: this.form.IdentityUserId,
}; };
if (this.status === "lock") { if (this.status === "lock") {
data.MfaType = 1; data.MfaType = 1;
@ -189,7 +189,7 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.tip { .tip_mfa {
width: 86%; width: 86%;
margin: auto; margin: auto;
margin-bottom: 20px; margin-bottom: 20px;

View File

@ -3,7 +3,7 @@
<div class="trialsTab"> <div class="trialsTab">
<el-tabs v-model="trialsTab" @tab-click="clickTab"> <el-tabs v-model="trialsTab" @tab-click="clickTab">
<el-tab-pane v-for="item of trialsRouter.children.find(v => {return v.name == 'TrialsPanel'}).children" :key="`tab${item.path}`" :disabled="TotalNeedSignTrialDocCount !== 0 && item.path !== '/trials/trials-panel/attachments'" :label="$t(item.LanguageMark)" :name="item.path"> <el-tab-pane v-for="item of trialsRouter.children.find(v => {return v.name == 'TrialsPanel'}).children" :key="`tab${item.path}`" :disabled="TotalNeedSignTrialDocCount !== 0 && item.path !== '/trials/trials-panel/attachments'" :label="$t(item.LanguageMark)" :name="item.path">
<el-tabs v-if="!item.tabHiddn" v-model="trialsTabChild" @tab-click="clickTab"> <el-tabs v-if="!item.tabHiddn" v-model="trialsTabChild" @tab-click="clickTab" style="background-color: #f5f7fa;">
<template v-for="item1 of item.children"> <template v-for="item1 of item.children">
<el-tab-pane <el-tab-pane
v-if="TrialConfig && isShow(item1.path)" v-if="TrialConfig && isShow(item1.path)"
@ -22,11 +22,14 @@
<i class="iconfont" style="font-size: 30px;color:#ccc">&#xe680;</i> <i class="iconfont" style="font-size: 30px;color:#ccc">&#xe680;</i>
</div> </div>
<!-- 返回项目列表 --> <!-- 返回项目列表 -->
<div class="my_icon_box" :title="$t('trials:trials:title:backTrialList')" @click="goBack"> <el-button type="primary" size="small" @click="goBack">
<i class="iconfont">&#xe670;</i> <i class="iconfont">&#xe670;</i>
<!-- 返回 -->
<span>{{ $t('trials:trials:title:back') }}</span> <span>{{ $t('trials:trials:title:back') }}</span>
</div> </el-button>
<!-- <div class="my_icon_box" :title="$t('trials:trials:title:backTrialList')" @click="goBack">
<i class="iconfont">&#xe670;</i>
<span>{{ $t('trials:trials:title:back') }}</span>
</div> -->
</div> </div>
</div> </div>
</template> </template>
@ -221,6 +224,9 @@ export default {
.el-tabs__header{ .el-tabs__header{
margin-bottom: 3px; margin-bottom: 3px;
} }
.el-tabs__item.is-active{
font-weight: bold;
}
position: relative; position: relative;
.el-input--medium .el-input__inner{ .el-input--medium .el-input__inner{
height: 44px;line-height: 44px;width: 280px; height: 44px;line-height: 44px;width: 280px;

View File

@ -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>

View File

@ -1,6 +1,5 @@
import { SubjectCheckConfig } from './module/Subject' import { SubjectCheckConfig } from './module/Subject'
console.log(SubjectCheckConfig.moduleType)
export const checkConfig = { export const checkConfig = {
ModuleType: { ModuleType: {
...SubjectCheckConfig.ModuleType ...SubjectCheckConfig.ModuleType

View File

@ -10,7 +10,7 @@ const dialogDrag = Vue.directive('dialogDrag', {
dragDom.style.cssText += ';top:0px;' dragDom.style.cssText += ';top:0px;'
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null); // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
const sty = (function() { const sty = (function () {
if (window.document.currentStyle) { if (window.document.currentStyle) {
return (dom, attr) => dom.currentStyle[attr] return (dom, attr) => dom.currentStyle[attr]
} else { } else {
@ -47,8 +47,10 @@ const dialogDrag = Vue.directive('dialogDrag', {
styL = +styL.replace(/\px/g, '') styL = +styL.replace(/\px/g, '')
styT = +styT.replace(/\px/g, '') styT = +styT.replace(/\px/g, '')
} }
const oldMousemove = document.onmousemove
document.onmousemove = function(e) { document.onmousemove = function (e) {
oldMousemove(e)
// 通过事件委托,计算移动的距离 // 通过事件委托,计算移动的距离
let left = e.clientX - disX let left = e.clientX - disX
const top = e.clientY - disY const top = e.clientY - disY
@ -70,8 +72,8 @@ const dialogDrag = Vue.directive('dialogDrag', {
dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;` dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
} }
document.onmouseup = function(e) { document.onmouseup = function (e) {
document.onmousemove = null document.onmousemove = oldMousemove
document.onmouseup = null document.onmouseup = null
} }
} }

View File

@ -14,13 +14,13 @@
<div class="right-menu"> <div class="right-menu">
<div class="navbar-flex-wrapper"> <div class="navbar-flex-wrapper">
<template v-if="device!=='mobile'"> <template v-if="device !== 'mobile'">
<screenfull id="screenfull" class="right-menu-item hover-effect" /> <screenfull id="screenfull" class="right-menu-item hover-effect" />
</template> </template>
<!-- <div class="avatar-container"> <!-- <div class="avatar-container">
<img src="@/assets/avatar.png" class="user-avatar"> <img src="@/assets/avatar.png" class="user-avatar">
</div> --> </div> -->
<div style="margin-left:20px;"> <div style="margin-left: 20px">
<el-dropdown class="dropdown-container" trigger="click"> <el-dropdown class="dropdown-container" trigger="click">
<span class="el-dropdown-link"> <span class="el-dropdown-link">
{{ `${name} (${userTypeShortName})` }} {{ `${name} (${userTypeShortName})` }}
@ -30,10 +30,20 @@
</span> </span>
<el-dropdown-menu slot="dropdown" class="user-dropdown"> <el-dropdown-menu slot="dropdown" class="user-dropdown">
<el-dropdown-item v-if="!isReviewer"> <el-dropdown-item v-if="!isReviewer">
<span style="display:block;" @click="editInfo">{{$t('system:navbar:button:Profile')}}</span> <span style="display: block" @click="editInfo">{{
$t('system:navbar:button:Profile')
}}</span>
</el-dropdown-item>
<!-- 切换角色 -->
<el-dropdown-item divided v-if="hasRole">
<span style="display: block" @click="openToggleRole">{{
$t('system:navbar:button:toggleRole')
}}</span>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item divided> <el-dropdown-item divided>
<span style="display:block;" @click="logout">{{$t('system:navbar:button:Log Out')}}</span> <span style="display: block" @click="logout">{{
$t('system:navbar:button:Log Out')
}}</span>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
@ -41,38 +51,119 @@
<TopLang></TopLang> <TopLang></TopLang>
</div> </div>
</div> </div>
<toggleRole
v-if="toggleRoleVisible"
:visible.sync="toggleRoleVisible"
:loading="toggleRoleLoading"
@save="loginByRole"
/>
</div> </div>
</template> </template>
<script> <script>
import {mapGetters, mapMutations} from 'vuex' import { mapGetters, mapMutations } from 'vuex'
import Breadcrumb from '@/components/Breadcrumb' import Breadcrumb from '@/components/Breadcrumb'
import Hamburger from '@/components/Hamburger' import Hamburger from '@/components/Hamburger'
import Screenfull from '@/components/Screenfull' import Screenfull from '@/components/Screenfull'
import TopLang from './topLang' import TopLang from './topLang'
import toggleRole from '@/components/toggleRole'
import { resetRouter } from '@/router'
export default { export default {
components: { components: {
Breadcrumb, Breadcrumb,
Hamburger, Hamburger,
Screenfull, Screenfull,
TopLang TopLang,
toggleRole,
}, },
data() { data() {
return { return {
isReviewer: false, isReviewer: false,
userTypeShortName: zzSessionStorage.getItem('userTypeShortName') toggleRoleVisible: false,
toggleRoleLoading: false,
} }
}, },
computed: { computed: {
...mapGetters(['sidebar', 'name', 'device']) ...mapGetters(['sidebar', 'name', 'device', 'userTypeShortName']),
roles() {
return this.$store.state.user.roles
},
hasRole() {
return this.roles && this.roles.length > 1
},
}, },
created() { created() {
this.isReviewer = JSON.parse(zzSessionStorage.getItem('IsReviewer')) // this.isReviewer = JSON.parse(zzSessionStorage.getItem('IsReviewer'))
}, },
methods: { methods: {
...mapMutations({ setLanguage: 'lang/setLanguage' }), ...mapMutations({ setLanguage: 'lang/setLanguage' }),
openToggleRole() {
this.$store.dispatch('user/getUserInfo').then((res) => {
this.toggleRoleVisible = true
})
},
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)
} else {
history.replaceState(null, null, '/trials/trials-workbench')
history.go(0)
}
this.toggleRoleVisible = false
this.toggleRoleLoading = false
this.$EventBus.$emit('reload')
} else {
//
this.toggleRoleLoading = false
this.$message.warning(this.$t('login:message:login2'))
}
})
.catch((err) => {
console.log(err)
this.toggleRoleLoading = false
})
} else {
this.toggleRoleLoading = false
}
})
.catch(() => {
this.toggleRoleLoading = false
})
},
toggleSideBar() { toggleSideBar() {
this.$store.dispatch('app/toggleSideBar') this.$store.dispatch('app/toggleSideBar')
}, },
@ -84,23 +175,23 @@ export default {
} else { } else {
this.$router.push(`/login`) this.$router.push(`/login`)
} }
this.$i18n.locale = 'zh' // //this.$i18n.locale = 'zh'
this.setLanguage('zh') // //this.setLanguage('zh')
this.$updateDictionary() this.$updateDictionary()
}, },
editInfo() { editInfo() {
this.$router.push({ name: 'BaiscInfo' }) this.$router.push({ name: 'BaiscInfo' })
}, },
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.navbar-flex-wrapper{ .navbar-flex-wrapper {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
} }
.navbar { .navbar {
height: 50px; height: 50px;
overflow: hidden; overflow: hidden;

View File

@ -293,6 +293,7 @@ async function VueInit() {
}() }()
_vm.$forceUpdate() _vm.$forceUpdate()
} }
Vue.prototype.$EventBus = new Vue()
Vue.prototype.$path = [] Vue.prototype.$path = []
var t = function (key) { var t = function (key) {
if (!~Vue.prototype.$path.indexOf(key)) { if (!~Vue.prototype.$path.indexOf(key)) {
@ -402,8 +403,12 @@ async function VueInit() {
} }
_vm.$store.dispatch('user/logout').then(res => { _vm.$store.dispatch('user/logout').then(res => {
// window.location.href = `/login` // window.location.href = `/login`
if (_vm.$msgbox) { try {
_vm.$msgbox.close(); if (_vm.$msgbox && _vm.$msgbox.close) {
_vm.$msgbox.close();
}
} catch (err) {
console.log(err)
} }
_vm.$FB.close(); _vm.$FB.close();
_vm.$FBT.close(); _vm.$FBT.close();

View File

@ -1,9 +1,10 @@
import router from './router' import router from './router'
import { resetRouter } from '@/router'
import store from './store' import store from './store'
// import { Message } from 'element-ui' // import { Message } from 'element-ui'
import NProgress from 'nprogress' import NProgress from 'nprogress'
import 'nprogress/nprogress.css' import 'nprogress/nprogress.css'
import { getToken } from '@/utils/auth' import { getToken, removeToken } from '@/utils/auth'
import Vue from 'vue' import Vue from 'vue'
import { OSSclient } from './utils/oss' import { OSSclient } from './utils/oss'
import WHITELIST from "./utils/whiteList" import WHITELIST from "./utils/whiteList"
@ -26,7 +27,6 @@ router.beforeEach(async (to, from, next) => {
to.query.trialId !== to.query.trialId !==
store.state.trials.config.trialId store.state.trials.config.trialId
) { ) {
console.log(to.query.path)
let res = await getTrialExtralConfig({ let res = await getTrialExtralConfig({
TrialId: to.query.trialId, TrialId: to.query.trialId,
}) })
@ -70,6 +70,16 @@ router.beforeEach(async (to, from, next) => {
} }
next() next()
NProgress.done() NProgress.done()
} else if (from.path === '/researchForm') {
removeToken()
let lang = to.query.lang || zzSessionStorage.getItem('lang')
next(`/researchLogin?trialId=${to.query.trialId}&lang=${lang}`)
NProgress.done()
} else if (from.path === '/researchDetail_m') {
removeToken()
let lang = to.query.lang || zzSessionStorage.getItem('lang')
next(`/researchLogin_m?trialId=${to.query.trialId}&lang=${lang}`)
NProgress.done()
} else { } else {
await OSSclient() await OSSclient()
const hasGetUserInfo = store.getters.userId const hasGetUserInfo = store.getters.userId
@ -79,10 +89,13 @@ router.beforeEach(async (to, from, next) => {
try { try {
// 获取用户信息 // 获取用户信息
await store.dispatch('user/getInfo') await store.dispatch('user/getInfo')
await store.dispatch('user/getUserInfo')
const accessRoutes = await store.dispatch('permission/generateRoutes') const accessRoutes = await store.dispatch('permission/generateRoutes')
resetRouter()
router.addRoutes(accessRoutes) router.addRoutes(accessRoutes)
next({ ...to, replace: true }) next({ ...to, replace: true })
} catch (error) { } catch (error) {
console.log(error)
// 删除token并进入登录页面以重新登录 // 删除token并进入登录页面以重新登录
await store.dispatch('user/resetToken') await store.dispatch('user/resetToken')
next(`/login?redirect=${to.path}`) next(`/login?redirect=${to.path}`)
@ -94,9 +107,10 @@ router.beforeEach(async (to, from, next) => {
/* has no token*/ /* has no token*/
if (whiteList.indexOf(to.path) !== -1) { if (whiteList.indexOf(to.path) !== -1) {
if (to.path === '/researchLogin') { if (to.path === '/researchLogin') {
let lang = to.query.lang || zzSessionStorage.getItem('lang')
const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i) const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
if (flag) { if (flag) {
next(`/researchLogin_m?trialId=${to.query.trialId}&lang=${to.query.lang}`) next(`/researchLogin_m?trialId=${to.query.trialId}&lang=${lang}`)
} else { } else {
next() next()
} }
@ -109,10 +123,12 @@ router.beforeEach(async (to, from, next) => {
} }
} else { } else {
if (to.path === '/researchForm') { if (to.path === '/researchForm') {
next(`/researchLogin?`) let lang = to.query.lang || zzSessionStorage.getItem('lang')
next(`/researchLogin?trialId=${to.query.trialId}&lang=${lang}`)
NProgress.done() NProgress.done()
} else if (to.path === '/researchDetail_m') { } else if (to.path === '/researchDetail_m') {
next(`/researchLogin_m?`) let lang = to.query.lang || zzSessionStorage.getItem('lang')
next(`/researchLogin_m?trialId=${to.query.trialId}&lang=${lang}`)
NProgress.done() NProgress.done()
} else if (to.path === '/ReviewersResearchForm') { } else if (to.path === '/ReviewersResearchForm') {
next(`/ReviewersResearch?`) next(`/ReviewersResearch?`)

View File

@ -3,10 +3,12 @@ const getters = {
device: state => state.app.device, device: state => state.app.device,
token: state => state.user.token, token: state => state.user.token,
name: state => state.user.name, name: state => state.user.name,
userTypeShortName: state => state.user.userTypeShortName,
permissions: state => state.user.permissions, permissions: state => state.user.permissions,
tree: state => state.user.tree, tree: state => state.user.tree,
userName: state => state.user.userName, userName: state => state.user.userName,
userId: state => state.user.userId, userId: state => state.user.userId,
identityUserId: state => state.user.identityUserId,
routes: state => state.permission.routes, routes: state => state.permission.routes,
asyncRoutes: state => state.permission.addRoutes, asyncRoutes: state => state.permission.addRoutes,
visitedViews: state => state.tagsView.visitedViews, visitedViews: state => state.tagsView.visitedViews,
@ -45,6 +47,7 @@ const getters = {
language: state => state.lang.language, language: state => state.lang.language,
TotalNeedSignSystemDocCount: state => state.user.TotalNeedSignSystemDocCount, TotalNeedSignSystemDocCount: state => state.user.TotalNeedSignSystemDocCount,
TotalNeedSignTrialDocCount: state => state.user.TotalNeedSignTrialDocCount, TotalNeedSignTrialDocCount: state => state.user.TotalNeedSignTrialDocCount,
IsFirstSysDocNeedSign: state => state.user.IsFirstSysDocNeedSign,
TrialStatusStr: state => state.user.TrialStatusStr TrialStatusStr: state => state.user.TrialStatusStr
} }
export default getters export default getters

View File

@ -70,6 +70,12 @@ function getQuestions(questions) {
answerObj.angle = angle answerObj.angle = angle
answerObj.saveTypeEnum = isNaN(parseFloat(angle)) ? 1 : 2 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 = parseInt(isMeasurable) === 1 && isNaN(parseFloat(answerObj.mean)) ? 1 : 2
} else { } else {
answerObj.lesionPart = getQuestionAnswer(item.TableQuestions.Questions, 8, answerObj) answerObj.lesionPart = getQuestionAnswer(item.TableQuestions.Questions, 8, answerObj)
answerObj.loctation = getQuestionAnswer(item.TableQuestions.Questions, 6, answerObj) answerObj.loctation = getQuestionAnswer(item.TableQuestions.Questions, 6, answerObj)
@ -507,6 +513,7 @@ const actions = {
}) })
}, },
getMeasuredData({ state }, visitTaskId) { getMeasuredData({ state }, visitTaskId) {
console.log('getMeasuredData')
return new Promise(resolve => { return new Promise(resolve => {
var index = state.visitTaskList.findIndex(i => i.VisitTaskId === visitTaskId) var index = state.visitTaskList.findIndex(i => i.VisitTaskId === visitTaskId)
if (state.visitTaskList[index].measureDataInit) { if (state.visitTaskList[index].measureDataInit) {
@ -523,6 +530,13 @@ const actions = {
el.OtherMeasureData = JSON.parse(el.OtherMeasureData) el.OtherMeasureData = JSON.parse(el.OtherMeasureData)
el.OtherMeasureData.data.remark = el.OrderMarkName 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) arr.push(el)
}) })
state.visitTaskList[index].MeasureData = arr state.visitTaskList[index].MeasureData = arr
@ -606,6 +620,13 @@ const actions = {
el.MeasureData = JSON.parse(el.MeasureData) el.MeasureData = JSON.parse(el.MeasureData)
el.MeasureData.data.remark = el.OrderMarkName 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) arr.push(el)
}) })
state.visitTaskList[index].MeasureData = arr state.visitTaskList[index].MeasureData = arr
@ -623,27 +644,40 @@ const actions = {
resolve(noneDicomMeasureData) resolve(noneDicomMeasureData)
}) })
}, },
addMeasuredData({ state }, obj) { addMeasuredData({ state }, obj) {
return new Promise(resolve => { return new Promise(resolve => {
const criterionType = parseInt(localStorage.getItem('CriterionType'))
var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId) var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
var measureData = state.visitTaskList[index].MeasureData 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.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) { if (criterionType === 21) {
for (const k in state.visitTaskList[index].MeasureData[idx]) { let i = measureData.findIndex(i=>i.TableQuestionId === obj.data.TableQuestionId)
if (k !== 'Id' && obj.data[k]) { if (i > -1) {
state.visitTaskList[index].MeasureData[idx][k] = obj.data[k] 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 { } else {
state.visitTaskList[index].MeasureData.push(obj.data) var idx = measureData.findIndex(item => item.QuestionId === obj.data.QuestionId && item.RowIndex === obj.data.RowIndex)
console.log('新增标记成功') 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) : '') // sessionStorage.setItem('visitTaskList', state.visitTaskList.length > 0 ? JSON.stringify(state.visitTaskList) : '')
console.log(state.visitTaskList)
resolve() resolve()
}) })
}, },
@ -738,32 +772,45 @@ const actions = {
return new Promise(resolve => { return new Promise(resolve => {
var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId) var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
var measureData = state.visitTaskList[index].MeasureData var measureData = state.visitTaskList[index].MeasureData
const criterionType = parseInt(localStorage.getItem('CriterionType'))
// var uuid = obj.measureData.data.uuid if (criterionType === 21) {
// 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 i = measureData.findIndex(item => item.QuestionId === obj.questionId && item.OrderMarkName === obj.orderMarkName) const i = measureData.findIndex(item => item.QuestionId === obj.questionId && item.OrderMarkName === obj.orderMarkName)
if (i > -1) { if (i > -1) {
if (measureData[i].FristAddTaskId) { if (measureData[i].FristAddTaskId) {
measureData[i].MeasureData = '' measureData[i].MeasureData = ''
console.log('清除标记成功', i) console.log('清除标记成功', i)
} else { } else {
measureData.splice(i, 1) measureData.splice(i, 1)
console.log('移除标记成功', i) console.log('移除标记成功', i)
}
} }
}
state.visitTaskList[index].MeasureData = measureData 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) { // if (idx > -1) {
// measureData.splice(idx, 1) // measureData.splice(idx, 1)
@ -840,6 +887,12 @@ const actions = {
const imageId = `wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?frame=${i}&instanceId=${instance.Id}&visitTaskId=${obj.visitTaskId}&idx=${studyIndex}|${seriesIndex}|${index}` const imageId = `wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?frame=${i}&instanceId=${instance.Id}&visitTaskId=${obj.visitTaskId}&idx=${studyIndex}|${seriesIndex}|${index}`
imageIds.push(imageId) imageIds.push(imageId)
}) })
} else if (study.IsCriticalSequence && instance.KeyFramesList.length === 0) {
// 兼容保存标记数据未存NumberOfFrames的情况按序列展示
for (let i = 0; i < instance.NumberOfFrames; i++) {
const imageId = `wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?frame=${i}&instanceId=${instance.Id}&visitTaskId=${obj.visitTaskId}&idx=${studyIndex}|${seriesIndex}|${index}`
imageIds.push(imageId)
}
} else { } else {
for (let i = 0; i < instance.NumberOfFrames; i++) { for (let i = 0; i < instance.NumberOfFrames; i++) {
const imageId = `wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?frame=${i}&instanceId=${instance.Id}&visitTaskId=${obj.visitTaskId}&idx=${studyIndex}|${seriesIndex}|${index}` const imageId = `wadouri:${localStorage.getItem('location') !== 'USA' ? Vue.prototype.OSSclientConfig.basePath : Vue.prototype.OSSclientConfig.basePath}${instance.Path}?frame=${i}&instanceId=${instance.Id}&visitTaskId=${obj.visitTaskId}&idx=${studyIndex}|${seriesIndex}|${index}`
@ -1034,7 +1087,7 @@ const actions = {
} }
}, },
setImageloadedInfo({ state }, obj) { setImageloadedInfo({ state }, obj) {
console.log('setImageloadedInfo', obj) // console.log('setImageloadedInfo', obj)
// if(obj.instance === '20dd8fc9-51b0-ec63-942b-cb3006c72650') // if(obj.instance === '20dd8fc9-51b0-ec63-942b-cb3006c72650')
// var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId) // var index = state.visitTaskList.findIndex(i => i.VisitTaskId === obj.visitTaskId)
// // const prefetchInstanceCount = state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].prefetchInstanceCount // // const prefetchInstanceCount = state.visitTaskList[index].StudyList[obj.studyIndex].SeriesList[obj.seriesIndex].prefetchInstanceCount

View File

@ -1,5 +1,6 @@
import { getToken, setToken, removeToken, setName, removeName } from '@/utils/auth' 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 { resetRouter } from '@/router'
import md5 from 'js-md5' import md5 from 'js-md5'
@ -7,22 +8,29 @@ const getDefaultState = () => {
return { return {
token: getToken(), token: getToken(),
name: '', name: '',
userTypeShortName: "",
userName: '', userName: '',
userId: '', userId: '',
identityUserId: '',
avatar: '', avatar: '',
permissions: [], permissions: [],
tree: [], tree: [],
/* eslint-disable */ /* eslint-disable */
TotalNeedSignSystemDocCount: eval(process.env.VUE_APP_WORD_FOR_PERMISSION) ? null : 0, TotalNeedSignSystemDocCount: eval(process.env.VUE_APP_WORD_FOR_PERMISSION) ? null : 0,
TotalNeedSignTrialDocCount: eval(process.env.VUE_APP_WORD_FOR_PERMISSION) ? null : 0, TotalNeedSignTrialDocCount: eval(process.env.VUE_APP_WORD_FOR_PERMISSION) ? null : 0,
IsFirstSysDocNeedSign: false,
TrialStatusStr: null, TrialStatusStr: null,
isTestUser: false isTestUser: false,
roles: []
} }
} }
const state = getDefaultState() const state = getDefaultState()
const mutations = { const mutations = {
SET_ROLES: (state, roles) => {
state.roles = roles
},
RESET_STATE: (state) => { RESET_STATE: (state) => {
Object.assign(state, getDefaultState()) Object.assign(state, getDefaultState())
}, },
@ -34,6 +42,9 @@ const mutations = {
SET_NAME: (state, name) => { SET_NAME: (state, name) => {
state.name = name state.name = name
}, },
SET_USERTYPESHORTNAME: (state, userTypeShortName) => {
state.userTypeShortName = userTypeShortName
},
SET_USERNAME: (state, name) => { SET_USERNAME: (state, name) => {
state.userName = name state.userName = name
}, },
@ -49,9 +60,16 @@ const mutations = {
SET_USERID: (state, id) => { SET_USERID: (state, id) => {
state.userId = id state.userId = id
}, },
SET_IDENTITYUSERID: (state, id) => {
state.identityUserId = id
},
SET_ISTESTUSER: (state, isTestUser) => { SET_ISTESTUSER: (state, isTestUser) => {
state.isTestUser = eval(isTestUser) state.isTestUser = eval(isTestUser)
}, },
SET_IS_FIRST_SYSTEM_DOC_SIGN: (state, IsFirstSysDocNeedSign) => {
zzSessionStorage.setItem('IsFirstSysDocNeedSign', IsFirstSysDocNeedSign)
state.IsFirstSysDocNeedSign = IsFirstSysDocNeedSign
},
SET_NEED_SIGN_SYSTEM_DOC_COUNT: (state, TotalNeedSignSystemDocCount) => { SET_NEED_SIGN_SYSTEM_DOC_COUNT: (state, TotalNeedSignSystemDocCount) => {
/* eslint-disable */ /* eslint-disable */
if (eval(process.env.VUE_APP_WORD_FOR_PERMISSION) && !state.isTestUser) { if (eval(process.env.VUE_APP_WORD_FOR_PERMISSION) && !state.isTestUser) {
@ -78,6 +96,9 @@ const mutations = {
} }
const actions = { const actions = {
setRoles({ commit }, roles) {
commit('SET_ROLES', roles)
},
changeUserName({ commit }, userName) { changeUserName({ commit }, userName) {
commit('SET_USERNAME', userName) commit('SET_USERNAME', userName)
}, },
@ -91,7 +112,7 @@ const actions = {
if (UserId) { if (UserId) {
data.UserId = UserId; data.UserId = UserId;
} }
login(data).then(async response => { getUserLoginRoleList(data).then(async response => {
if (response.IsSuccess) { if (response.IsSuccess) {
zzSessionStorage.removeItem('lastWorkbench') zzSessionStorage.removeItem('lastWorkbench')
zzSessionStorage.setItem('my_username', username.trim()) zzSessionStorage.setItem('my_username', username.trim())
@ -99,6 +120,7 @@ const actions = {
zzSessionStorage.setItem('my_EMail', response.Result.BasicInfo.EMail) zzSessionStorage.setItem('my_EMail', response.Result.BasicInfo.EMail)
localStorage.setItem('CompanyInfo', JSON.stringify(response.Result.CompanyInfo)) localStorage.setItem('CompanyInfo', JSON.stringify(response.Result.CompanyInfo))
const data = response.Result const data = response.Result
commit('SET_ROLES', data.BasicInfo.AccountList)
if (data.BasicInfo.IsFirstAdd || data.BasicInfo.LoginState === 1) { if (data.BasicInfo.IsFirstAdd || data.BasicInfo.LoginState === 1) {
try { try {
zzSessionStorage.setItem('userId', data.BasicInfo.Id) zzSessionStorage.setItem('userId', data.BasicInfo.Id)
@ -114,25 +136,24 @@ const actions = {
zzSessionStorage.setItem('IsReviewer', data.BasicInfo.IsReviewer) zzSessionStorage.setItem('IsReviewer', data.BasicInfo.IsReviewer)
zzSessionStorage.setItem('userName', data.BasicInfo.UserName) zzSessionStorage.setItem('userName', data.BasicInfo.UserName)
commit('SET_TOKEN', data.JWTStr) commit('SET_TOKEN', data.JWTStr)
commit('SET_NAME', data.BasicInfo.RealName) // commit('SET_NAME', data.BasicInfo.UserName)
zzSessionStorage.setItem('realName', data.BasicInfo.RealName)
zzSessionStorage.setItem('isTestUser', data.BasicInfo.IsTestUser) zzSessionStorage.setItem('isTestUser', data.BasicInfo.IsTestUser)
commit('SET_ISTESTUSER', data.BasicInfo.IsTestUser) commit('SET_ISTESTUSER', data.BasicInfo.IsTestUser)
commit('SET_USERNAME', data.BasicInfo.UserName) commit('SET_USERNAME', data.BasicInfo.UserName)
commit('SET_USERID', data.BasicInfo.Id)
setToken(data.JWTStr) 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 userString = decodeURIComponent(escape(window.atob(data.JWTStr.split('.')[1].replace(/-/g, '+').replace(/_/g, '/'))))
const user = JSON.parse(userString) // const user = JSON.parse(userString)
zzSessionStorage.setItem('userTypeShortName', user.userTypeShortName) // zzSessionStorage.setItem('userId', user.identityUserId)
zzSessionStorage.setItem('userId', user.id) // commit('SET_IDENTITYUSERID', user.identityUserId)
zzSessionStorage.setItem('userTypeEnumInt', user.userTypeEnumInt) // zzSessionStorage.setItem('identityUserId', user.identityUserId)
var permissions = await getUserPermissions() // zzSessionStorage.setItem('userTypeEnumInt', user.userTypeEnumInt)
var menuTree = await getUserMenuTree() // var permissions = await getUserPermissions()
commit('SET_TREE', menuTree.Result) // var menuTree = await getUserMenuTree()
commit('SET_PERMISSIONS', permissions.Result) // commit('SET_TREE', menuTree.Result)
zzSessionStorage.setItem('newTree', JSON.stringify(menuTree.Result)) // commit('SET_PERMISSIONS', permissions.Result)
zzSessionStorage.setItem('permissions', JSON.stringify(permissions.Result)) // zzSessionStorage.setItem('newTree', JSON.stringify(menuTree.Result))
// zzSessionStorage.setItem('permissions', JSON.stringify(permissions.Result))
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }
@ -146,6 +167,51 @@ 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)
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))
zzSessionStorage.removeItem('lastWorkbench')
} catch (e) {
console.log(e)
}
resolve(response.Result)
} else {
reject(response.ErrorMessage)
}
}).catch(() => {
reject()
})
})
},
setTree({ commit }, tree) { setTree({ commit }, tree) {
commit('SET_TREE', tree) commit('SET_TREE', tree)
}, },
@ -155,6 +221,9 @@ const actions = {
setTotalNeedSignSystemDocCount({ commit }, TotalNeedSignSystemDocCount) { setTotalNeedSignSystemDocCount({ commit }, TotalNeedSignSystemDocCount) {
commit('SET_NEED_SIGN_SYSTEM_DOC_COUNT', TotalNeedSignSystemDocCount) commit('SET_NEED_SIGN_SYSTEM_DOC_COUNT', TotalNeedSignSystemDocCount)
}, },
setIsFirstSysDocNeedSign({ commit }, IsFirstSysDocNeedSign) {
commit('SET_IS_FIRST_SYSTEM_DOC_SIGN', IsFirstSysDocNeedSign)
},
setTotalNeedSignTrialDocCount({ commit }, TotalNeedSignTrialDocCount) { setTotalNeedSignTrialDocCount({ commit }, TotalNeedSignTrialDocCount) {
commit('SET_NEED_SIGN_TRIALS_DOC_COUNT', TotalNeedSignTrialDocCount) commit('SET_NEED_SIGN_TRIALS_DOC_COUNT', TotalNeedSignTrialDocCount)
}, },
@ -170,32 +239,69 @@ const actions = {
commit('SET_PERMISSIONS', JSON.parse(zzSessionStorage.getItem('permissions'))) commit('SET_PERMISSIONS', JSON.parse(zzSessionStorage.getItem('permissions')))
commit('SET_ISTESTUSER', zzSessionStorage.getItem('isTestUser')) commit('SET_ISTESTUSER', zzSessionStorage.getItem('isTestUser'))
const user = JSON.parse(userString) const user = JSON.parse(userString)
commit('SET_NAME', zzSessionStorage.getItem('realName')) commit('SET_NAME', zzSessionStorage.getItem('Name'))
commit('SET_USERID', user.id) commit('SET_USERTYPESHORTNAME', user.userTypeShortName)
commit('SET_IDENTITYUSERID', user.identityUserId)
commit('SET_USERID', user.userRoleId)
commit('SET_USERNAME', zzSessionStorage.getItem('userName')) commit('SET_USERNAME', zzSessionStorage.getItem('userName'))
commit('SET_NEED_SIGN_SYSTEM_DOC_COUNT', parseInt(zzSessionStorage.getItem('TotalNeedSignSystemDocCount'))) commit('SET_NEED_SIGN_SYSTEM_DOC_COUNT', parseInt(zzSessionStorage.getItem('TotalNeedSignSystemDocCount')))
commit('SET_NEED_SIGN_TRIALS_DOC_COUNT', parseInt(zzSessionStorage.getItem('TotalNeedSignTrialDocCount'))) commit('SET_NEED_SIGN_TRIALS_DOC_COUNT', parseInt(zzSessionStorage.getItem('TotalNeedSignTrialDocCount')))
console.log(zzSessionStorage.getItem('TotalNeedSignSystemDocCount')) commit('SET_IS_FIRST_SYSTEM_DOC_SIGN', zzSessionStorage.getItem('IsFirstSysDocNeedSign'))
console.log(zzSessionStorage.getItem('TotalNeedSignTrialDocCount')) // console.log(zzSessionStorage.getItem('TotalNeedSignSystemDocCount'))
// console.log(zzSessionStorage.getItem('TotalNeedSignTrialDocCount'))
zzSessionStorage.setItem('userName', user.name) 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('userTypeShortName', user.userTypeShortName)
zzSessionStorage.setItem('userTypeEnumInt', user.userTypeEnumInt) zzSessionStorage.setItem('userTypeEnumInt', user.userTypeEnumInt)
return user return user
}, },
updateInfo({ commit, state }) { 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 => {
if (res.Result) {
commit('SET_ROLES', res.Result.AccountList)
}
resolve(res.Result)
}).catch(err => {
reject(err)
})
})
}, },
// user logout // user logout
async logout({ commit, state }) { async logout({ commit, state }) {
try { try {
removeToken() // must remove token first removeToken() // must remove token first
await loginOut({ await loginOut({
Userd: zzSessionStorage.getItem('userId') UserRoleId: zzSessionStorage.getItem('userId'),
IdentityUserId: zzSessionStorage.getItem('identityUserId'),
}) })
resetRouter() resetRouter()
removeName() removeName()
let lang = zzSessionStorage.getItem('lang')
zzSessionStorage.clear() zzSessionStorage.clear()
zzSessionStorage.setItem('lang', lang)
commit('RESET_STATE')
} catch (e) {
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()
let lang = zzSessionStorage.getItem('lang')
zzSessionStorage.clear()
zzSessionStorage.setItem('lang', lang)
commit('RESET_STATE') commit('RESET_STATE')
} catch (e) { } catch (e) {
console.log(e) console.log(e)

View File

@ -47,3 +47,6 @@
.el-range-separator { .el-range-separator {
box-sizing: content-box; box-sizing: content-box;
} }
.el-select-dropdown__wrap{
max-height: 350px;
}

View File

@ -40,8 +40,9 @@ Vue.directive('dialogDrag', {
styL = +styL.replace(/\px/g, '') styL = +styL.replace(/\px/g, '')
styT = +styT.replace(/\px/g, '') styT = +styT.replace(/\px/g, '')
} }
const oldMousemove = document.onmousemove
document.onmousemove = function(e) { document.onmousemove = function(e) {
oldMousemove(e)
// 通过事件委托,计算移动的距离 // 通过事件委托,计算移动的距离
let left = e.clientX - disX let left = e.clientX - disX
let top = e.clientY - disY let top = e.clientY - disY
@ -63,7 +64,7 @@ Vue.directive('dialogDrag', {
} }
document.onmouseup = function(e) { document.onmouseup = function(e) {
document.onmousemove = null document.onmousemove = oldMousemove
document.onmouseup = null document.onmouseup = null
} }
return false return false

View File

@ -89,9 +89,9 @@ service.interceptors.response.use(
}) })
store.dispatch('user/logout').then(() => { store.dispatch('user/logout').then(() => {
router.push(`/login`) router.push(`/login`)
this.$i18n.locale = 'zh' //this.$i18n.locale = 'zh'
this.setLanguage('zh') //this.setLanguage('zh')
this.$updateDictionary() // this.$updateDictionary()
}) })
} }
} else { } else {

View File

@ -1,11 +1,11 @@
import axios from 'axios' import axios from 'axios'
import _vm from '@/main'
import { Message, MessageBox, Alert } from 'element-ui' import { Message, MessageBox, Alert } from 'element-ui'
import store from '@/store' import store from '@/store'
import router from '@/router' import router from '@/router'
import WHITELIST from "./whiteList" import WHITELIST from "./whiteList"
import moment from 'moment-timezone'; import moment from 'moment-timezone';
import { encryptConfig } from "@/utils/encrypt" import { encryptConfig } from "@/utils/encrypt"
const ROUTER = require('@/router');
axios.defaults.withCredentials = false axios.defaults.withCredentials = false
const service = axios.create({ const service = axios.create({
baseURL: '/api', baseURL: '/api',
@ -91,13 +91,20 @@ service.interceptors.response.use(
const status = error.response.status const status = error.response.status
if (error.response.data && (error.response.data.Code === -1 || error.response.data.Code === -2)) { if (error.response.data && (error.response.data.Code === -1 || error.response.data.Code === -2)) {
store.dispatch('user/logout').then(() => { store.dispatch('user/logout').then(() => {
if (_vm.$msgbox) { let _vm = ROUTER.default.app
_vm.$msgbox.close(); try {
if (_vm.$msgbox && _vm.$msgbox.close) {
_vm.$msgbox.close();
}
} catch (err) {
console.log(err)
} }
router.push(`/login`) router.push(`/login`)
this.$i18n.locale = 'zh' // if (!this.$i18n.locale) {
this.setLanguage('zh') // //this.$i18n.locale = 'zh'
this.$updateDictionary() // //this.setLanguage('zh')
// }
// this.$updateDictionary()
}) })
} }
switch (status) { switch (status) {
@ -127,9 +134,9 @@ service.interceptors.response.use(
} }
store.dispatch('user/logout').then(() => { store.dispatch('user/logout').then(() => {
router.push(`/login`) router.push(`/login`)
this.$i18n.locale = 'zh' // //this.$i18n.locale = 'zh'
this.setLanguage('zh') // //this.setLanguage('zh')
this.$updateDictionary() // this.$updateDictionary()
}) })
} else { } else {
setTimer({ setTimer({
@ -143,6 +150,7 @@ service.interceptors.response.use(
setTimer([message, store.state.lang.language === 'en' ? 'Warning' : '警告', { setTimer([message, store.state.lang.language === 'en' ? 'Warning' : '警告', {
type: 'warning', type: 'warning',
showCancelButton: false, showCancelButton: false,
confirmButtonText: store.state.lang.language === 'en' ? 'ok' : "确定",
callback: action => { } callback: action => { }
}], 'confirm') }], 'confirm')
} }
@ -153,6 +161,7 @@ service.interceptors.response.use(
[store.state.lang.language === 'en' ? 'Please check your networkand try again later' : '请检查网络,稍后重试!', store.state.lang.language === 'en' ? 'Warning' : '警告', { [store.state.lang.language === 'en' ? 'Please check your networkand try again later' : '请检查网络,稍后重试!', store.state.lang.language === 'en' ? 'Warning' : '警告', {
type: 'warning', type: 'warning',
showCancelButton: false, showCancelButton: false,
confirmButtonText: store.state.lang.language === 'en' ? 'ok' : "确定",
callback: action => { } callback: action => { }
}], "confirm" }], "confirm"
) )
@ -171,6 +180,8 @@ const setTimer = (obj, type) => {
Message(obj) Message(obj)
} }
if (type === 'confirm') { if (type === 'confirm') {
obj[2].closeOnClickModal = false
obj[2].closeOnPressEscape = false
MessageBox.confirm(...obj) MessageBox.confirm(...obj)
} }
clearTimeout(timer); clearTimeout(timer);

View File

@ -5,7 +5,7 @@
:model="user" :model="user"
:rules="userFormRules" :rules="userFormRules"
label-width="150px" label-width="150px"
style="width:800px;" style="width: 800px"
> >
<el-card class="Basic" shadow="never" size="small"> <el-card class="Basic" shadow="never" size="small">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
@ -25,7 +25,7 @@
<el-form-item label="Given Name: " prop="FirstName"> <el-form-item label="Given Name: " prop="FirstName">
<el-input v-model="user.FirstName" /> <el-input v-model="user.FirstName" />
</el-form-item> </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-group v-model="user.Sex">
<el-radio :label="1">Male</el-radio> <el-radio :label="1">Male</el-radio>
<el-radio :label="0">Female</el-radio> <el-radio :label="0">Female</el-radio>
@ -37,13 +37,24 @@
<el-form-item label="Phone: " prop="Phone"> <el-form-item label="Phone: " prop="Phone">
<el-input v-model="user.Phone" /> <el-input v-model="user.Phone" />
</el-form-item> </el-form-item>
<el-form-item v-if="type==1" label="Disable:"> <el-form-item v-if="type == 1" label="Disable:">
<el-switch v-model="user.Status" :active-value="0" :inactive-value="1" /> <el-switch
v-model="user.Status"
:active-value="0"
:inactive-value="1"
/>
</el-form-item> </el-form-item>
<el-form-item label="User Type: " prop="UserTypeId"> <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 <el-option
v-for="(userType,key) of userTypeOptions" v-for="(userType, key) of userTypeOptions"
:key="key" :key="key"
:label="userType.UserType" :label="userType.UserType"
:value="userType.Id" :value="userType.Id"
@ -52,17 +63,28 @@
</el-form-item> </el-form-item>
</el-card> </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"> <div slot="header" class="clearfix">
<span>Affiliation</span> <span>Affiliation</span>
</div> </div>
<el-form-item prop="IsZhiZhun"> <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="true">Internal</el-radio>
<el-radio :label="false">External</el-radio> <el-radio :label="false">External</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </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-input v-model="user.OrganizationName" />
</el-form-item> </el-form-item>
@ -78,19 +100,24 @@
type="primary" type="primary"
size="small" size="small"
:disabled="isDisabled" :disabled="isDisabled"
style="margin:10px 15px" style="margin: 10px 15px"
@click="handleSave" @click="handleSave"
>Save</el-button> >Save</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>
<script> <script>
import { getUser, addUser, updateUser, getUserTypeListByUserType } from '@/api/admin.js' import {
getUser,
addUser,
updateUser,
getUserTypeListByUserType,
} from '@/api/admin.js'
export default { export default {
name: 'UserInfo', name: 'UserInfo',
props: { props: {
userId: { type: String, default: '' } userId: { type: String, default: '' },
}, },
data() { data() {
return { return {
@ -105,60 +132,69 @@ export default {
IsZhiZhun: '', IsZhiZhun: '',
OrganizationName: '', OrganizationName: '',
DepartmentName: '', DepartmentName: '',
PositionName: '' PositionName: '',
}, },
userFormRules: { userFormRules: {
UserName: [ UserName: [
{ required: true, message: 'Please specify', trigger: 'blur' }, { required: true, message: 'Please specify', trigger: 'blur' },
{ max: 50, message: 'The maximum length is 50' } { max: 50, message: 'The maximum length is 50' },
], ],
UserTypeId: [ UserTypeId: [
{ required: true, message: 'Please Select', trigger: ['blur', 'change'] } {
required: true,
message: 'Please Select',
trigger: ['blur', 'change'],
},
], ],
IsZhiZhun: [ IsZhiZhun: [
{ required: true, message: 'Please Select', trigger: ['blur', 'change'] } {
required: true,
message: 'Please Select',
trigger: ['blur', 'change'],
},
], ],
OrganizationName: [ OrganizationName: [
{ required: true, message: 'Please specify', trigger: 'blur' } { required: true, message: 'Please specify', trigger: 'blur' },
], ],
LastName: [ LastName: [
{ required: true, message: 'Please specify', trigger: 'blur' }, { required: true, message: 'Please specify', trigger: 'blur' },
{ max: 50, message: 'The maximum length is 50' } { max: 50, message: 'The maximum length is 50' },
], ],
FirstName: [ FirstName: [
{ required: true, message: 'Please specify', trigger: 'blur' }, { required: true, message: 'Please specify', trigger: 'blur' },
{ max: 50, message: 'The maximum length is 50' } { max: 50, message: 'The maximum length is 50' },
], ],
Phone: [ 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: [ EMail: [
{ {
required: true, required: true,
message: 'Please input the email address', message: 'Please input the email address',
trigger: 'blur' trigger: 'blur',
}, },
{ {
type: 'email', type: 'email',
message: 'Please input the correct email address', message: 'Please input the correct email address',
trigger: ['blur'] trigger: ['blur'],
}, },
{ max: 50, message: 'The maximum length is 50' } { max: 50, message: 'The maximum length is 50' },
],
Sex: [
{ required: true, message: 'Please specify', trigger: 'blur' }
], ],
Sex: [{ required: true, message: 'Please specify', trigger: 'blur' }],
Status: [ Status: [
{ required: true, message: 'Please specify', trigger: 'blur' } { required: true, message: 'Please specify', trigger: 'blur' },
], ],
DepartmentName: [ DepartmentName: [{ max: 50, message: 'The maximum length is 50' }],
{ max: 50, message: 'The maximum length is 50' }], PositionName: [{ max: 50, message: 'The maximum length is 50' }],
PositionName: [{ max: 50, message: 'The maximum length is 50' }
]
}, },
userTypeOptions: [], userTypeOptions: [],
isDisabled: false, isDisabled: false,
type: 0 // 10 type: 0, // 10
} }
}, },
created() { created() {
@ -172,46 +208,58 @@ export default {
}, },
methods: { methods: {
handleSave() { handleSave() {
this.$refs.userForm.validate(valid => { this.$refs.userForm.validate((valid) => {
if (valid) { if (valid) {
this.isDisabled = true 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) { if (selectedUserType.length > 0) {
this.user.UserTypeEnum = selectedUserType[0].UserTypeEnum this.user.UserTypeEnum = selectedUserType[0].UserTypeEnum
} }
if (this.user.Id) { if (this.user.Id) {
updateUser(this.user).then(res => { updateUser(this.user)
this.isDisabled = false .then((res) => {
this.$message.success('Updated successfully') this.isDisabled = false
}).catch(() => { this.isDisabled = false }) this.$message.success('Updated successfully')
})
.catch(() => {
this.isDisabled = false
})
} else { } else {
addUser(this.user).then(res => { addUser(this.user)
this.isDisabled = false .then((res) => {
this.user.Id = res.Result.Id this.isDisabled = false
this.user.UserCode = res.Result.UserCode this.user.Id = res.Result.Id
this.$emit('getUserId', res.Result.Id) this.user.UserCode = res.Result.UserCode
this.$message.success('Added successfully') this.$emit('getUserId', res.Result.Id)
this.$router.push({ path: '/system/user/list' }) this.$message.success('Added successfully')
}).catch(() => { this.isDisabled = false }) this.$router.push({ path: '/system/user/list' })
})
.catch(() => {
this.isDisabled = false
})
} }
} }
}) })
}, },
getUserTypeList() { getUserTypeList() {
getUserTypeListByUserType(0).then(res => { getUserTypeListByUserType(0).then((res) => {
if (res.IsSuccess) { if (res.IsSuccess) {
this.userTypeOptions = res.Result this.userTypeOptions = res.Result
} }
}) })
}, },
getUserInfo() { getUserInfo() {
getUser(this.userId).then(res => { getUser({
IdentityUserId: this.userId,
}).then((res) => {
this.user = res.Result this.user = res.Result
}) })
}, },
OrgnizationTypeChanged(val) { OrgnizationTypeChanged(val) {
this.user.OrganizationName = '' this.user.OrganizationName = ''
} },
} },
} }
</script> </script>

View File

@ -131,8 +131,8 @@ export default {
.then(() => { .then(() => {
this.$store.dispatch('user/logout').then(res => { this.$store.dispatch('user/logout').then(res => {
this.$router.push(`/login`) this.$router.push(`/login`)
this.$i18n.locale = 'zh' //this.$i18n.locale = 'zh'
this.setLanguage('zh') //this.setLanguage('zh')
this.$updateDictionary() this.$updateDictionary()
}) })
}) })

View File

@ -98,7 +98,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="UpdateTime" prop="UpdateTime"
label="更新时间" label="上传时间"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> />

View File

@ -108,7 +108,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="UpdateTime" prop="UpdateTime"
label="更新时间" label="上传时间"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> />

View File

@ -3,13 +3,16 @@
ref="sysAttachmentFrom" ref="sysAttachmentFrom"
v-loading="loading" v-loading="loading"
:model="form" :model="form"
label-width="170px" label-width="190px"
size="small" size="small"
:rules="rules" :rules="rules"
class="upload-temporary-file" class="upload-temporary-file"
> >
<div class="base-dialog-body"> <div class="base-dialog-body">
<el-form-item label="文件类型: " prop="FileTypeId"> <el-form-item
:label="$t('dictionary:signature:form:FileTypeId')"
prop="FileTypeId"
>
<el-select <el-select
v-model="form.FileTypeId" v-model="form.FileTypeId"
style="width: 100%" style="width: 100%"
@ -25,7 +28,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="文件: "> <el-form-item :label="$t('dictionary:signature:form:File')">
<div class="upload-container"> <div class="upload-container">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
@ -46,16 +49,16 @@
type="primary" type="primary"
:disabled="form.FileTypeId === ''" :disabled="form.FileTypeId === ''"
:loading="btnLoading" :loading="btnLoading"
>Select</el-button >{{ $t('common:button:check') }}</el-button
> >
<span slot="tip" style="margin-left: 10px" class="el-upload__tip"> <span slot="tip" style="margin-left: 10px" class="el-upload__tip">
(must be in pdf format) ({{ $t('trials:signature:label:mustBepdf') }})
</span> </span>
</el-upload> </el-upload>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="需要签署的用户类型: " :label="$t('dictionary:signature:form:NeedConfirmedUserTypeIdList')"
prop="NeedConfirmedUserTypeIdList" prop="NeedConfirmedUserTypeIdList"
> >
<el-select <el-select
@ -71,7 +74,10 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="是否仅内部签署: " prop="DocUserSignType"> <el-form-item
:label="$t('dictionary:signature:form:DocUserSignType')"
prop="DocUserSignType"
>
<el-switch <el-switch
v-model="form.DocUserSignType" v-model="form.DocUserSignType"
:active-value="1" :active-value="1"
@ -80,7 +86,7 @@
</el-switch> </el-switch>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="查看最短时间(分钟): " :label="$t('dictionary:signature:form:SignViewMinimumMinutes')"
prop="SignViewMinimumMinutes" prop="SignViewMinimumMinutes"
> >
<el-input-number <el-input-number
@ -105,7 +111,7 @@
:disabled="form.FileTypeId === '' || form.Name === ''" :disabled="form.FileTypeId === '' || form.Name === ''"
:loading="saveBtnLoading" :loading="saveBtnLoading"
@click="handleSave" @click="handleSave"
>Save</el-button >{{ $t('common:button:save') }}</el-button
> >
</el-form-item> </el-form-item>
</div> </div>
@ -138,13 +144,25 @@ export default {
}, },
rules: { rules: {
FileTypeId: [ FileTypeId: [
{ required: true, message: 'Please select', trigger: ['blur'] }, {
required: true,
message: this.$t('common:ruleMessage:select'),
trigger: ['blur'],
},
], ],
SignViewMinimumMinutes: [ SignViewMinimumMinutes: [
{ required: true, message: 'Please specify', trigger: ['change'] }, {
required: true,
message: this.$t('common:ruleMessage:specify'),
trigger: ['change'],
},
], ],
NeedConfirmedUserTypeIdList: [ NeedConfirmedUserTypeIdList: [
{ required: true, message: 'Please select', trigger: ['blur'] }, {
required: true,
message: this.$t('common:ruleMessage:select'),
trigger: ['blur'],
},
], ],
}, },
fileList: [], fileList: [],
@ -211,7 +229,7 @@ export default {
this.fileList = [] this.fileList = []
return true return true
} else { } else {
this.$alert('must be in pdf format') this.$alert(this.$t('trials:signature:label:mustBepdf'))
return false return false
} }
@ -236,7 +254,7 @@ export default {
this.$refs.sysAttachmentFrom.validate((valid) => { this.$refs.sysAttachmentFrom.validate((valid) => {
if (!valid) return if (!valid) return
if (!this.form.Name) { if (!this.form.Name) {
this.$alert('Please select file.') this.$alert(this.$t('trials:signature:message:selectFile'))
return return
} }
this.saveBtnLoading = true this.saveBtnLoading = true
@ -245,7 +263,7 @@ export default {
this.saveBtnLoading = false this.saveBtnLoading = false
this.$emit('closeDialog') this.$emit('closeDialog')
this.$emit('getList') this.$emit('getList')
this.$message.success('Uploaded successfully') this.$message.success(this.$t('common:message:updatedSuccessfully'))
}) })
.catch(() => { .catch(() => {
this.saveBtnLoading = false this.saveBtnLoading = false
@ -263,7 +281,7 @@ export default {
} }
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
this.$message.warning(`Upload is currently limited to 1 file`) this.$message.warning(this.$t('upload:rule:maxFile1'))
}, },
checkFileSuffix(fileName) { checkFileSuffix(fileName) {
var typeArr = ['pdf'] var typeArr = ['pdf']

View File

@ -2,7 +2,7 @@
<BaseContainer> <BaseContainer>
<template slot="search-container"> <template slot="search-container">
<el-form :inline="true" size="small"> <el-form :inline="true" size="small">
<el-form-item label="文件类型:"> <el-form-item :label="$t('dictionary:signature:search:FileTypeId')">
<el-select v-model="searchData.FileTypeId" style="width: 150px"> <el-select v-model="searchData.FileTypeId" style="width: 150px">
<el-option <el-option
v-for="item of dict.type.Sys_Document" v-for="item of dict.type.Sys_Document"
@ -12,7 +12,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="文件名称"> <el-form-item :label="$t('dictionary:signature:search:Name')">
<el-input v-model="searchData.Name" style="width: 130px" clearable /> <el-input v-model="searchData.Name" style="width: 130px" clearable />
</el-form-item> </el-form-item>
@ -34,7 +34,7 @@
<el-button <el-button
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
style="margin-left: auto" style="margin-left: auto; margin-bottom: 10px"
size="small" size="small"
@click="handleAdd" @click="handleAdd"
> >
@ -53,26 +53,27 @@
<el-table-column type="index" width="40" /> <el-table-column type="index" width="40" />
<el-table-column <el-table-column
prop="FileType" prop="FileType"
label="文件类型" :label="$t('dictionary:signature:table:FileType')"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> />
<el-table-column <el-table-column
prop="Name" prop="Name"
label="文件名称" :label="$t('dictionary:signature:table:Name')"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> />
<el-table-column <el-table-column
prop="SignViewMinimumMinutes" prop="SignViewMinimumMinutes"
label="查看最短时间(分钟)" :label="$t('dictionary:signature:table:SignViewMinimumMinutes')"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
min-width="110"
/> />
<el-table-column <el-table-column
prop="NeedConfirmedUserTypes" prop="NeedConfirmedUserTypes"
label="需要签署的用户类型" :label="$t('dictionary:signature:table:NeedConfirmedUserTypes')"
show-overflow-tooltip show-overflow-tooltip
> >
<template slot-scope="scope"> <template slot-scope="scope">
@ -85,48 +86,54 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="IsDeleted" prop="IsDeleted"
label="是否废除" :label="$t('dictionary:signature:table:IsDeleted')"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.IsDeleted ? 'Yes' : 'No' }} <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> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="DocUserSignType" prop="DocUserSignType"
label="是否仅内部签署" :label="$t('dictionary:signature:table:DocUserSignType')"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
min-width="90"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ $fd('ReadingYesOrNo', Number(scope.row.DocUserSignType)) }} {{ $fd('ReadingYesOrNo', Number(scope.row.DocUserSignType)) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="UpdateTime" prop="CreateTime"
label="更新时间" :label="$t('dictionary:signature:table:CreateTime')"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> />
<el-table-column label="Action"> <el-table-column :label="$t('common:action:action')" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="handlePreview(scope.row)"> <el-button type="text" @click="handlePreview(scope.row)">
预览 {{ $t('common:button:preview') }}
</el-button> </el-button>
<el-button type="text" @click="handleEdit(scope.row)"> <el-button type="text" @click="handleEdit(scope.row)">
编辑 {{ $t('common:button:edit') }}
</el-button> </el-button>
<el-button <el-button
:disabled="scope.row.IsDeleted" :disabled="scope.row.IsDeleted"
type="text" type="text"
@click="handleRepeal(scope.row)" @click="handleRepeal(scope.row)"
> >
废除 {{ $t('common:button:revoke') }}
</el-button> </el-button>
<el-button type="text" @click="handleDelete(scope.row)"> <el-button type="text" @click="handleDelete(scope.row)">
删除 {{ $t('common:button:delete') }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -261,7 +268,7 @@ export default {
}, },
// //
handleRepeal(row) { handleRepeal(row) {
this.$confirm('是否确认废除此文件?', { this.$confirm(this.$t('dictionary:signature:confirm:delFile'), {
type: 'warning', type: 'warning',
distinguishCancelAndClose: true, distinguishCancelAndClose: true,
}) })
@ -298,7 +305,9 @@ export default {
this.list.findIndex((item) => item.Id === row.Id), this.list.findIndex((item) => item.Id === row.Id),
1 1
) )
this.$message.success('删除成功!') this.$message.success(
this.$t('common:message:deletedSuccessfully')
)
} }
}) })
.catch(() => { .catch(() => {

View File

@ -111,7 +111,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="UpdateTime" prop="UpdateTime"
label="更新时间" label="上传时间"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> />

View File

@ -9,8 +9,19 @@
> >
<div class="base-dialog-body"> <div class="base-dialog-body">
<el-form-item label="Site: "> <el-form-item label="Site: ">
<el-select v-model="form.SiteId" style="width: 100%" clearable filterable @change="siteChange"> <el-select
<el-option v-for="item of siteList" :value="item.Id" :key="item.Id" :label="item.SiteName"> 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-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -20,10 +31,16 @@
<el-form-item label="Hospital EN: " prop="HospitalName"> <el-form-item label="Hospital EN: " prop="HospitalName">
<el-input v-model="form.HospitalName" /> <el-input v-model="form.HospitalName" />
</el-form-item> </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-input v-model="form.UniversityAffiliatedCN" />
</el-form-item> </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-input v-model="form.UniversityAffiliated" />
</el-form-item> </el-form-item>
<el-form-item label="Country CN: " prop="CountryCN"> <el-form-item label="Country CN: " prop="CountryCN">
@ -45,10 +62,22 @@
<el-input v-model="form.City" /> <el-input v-model="form.City" />
</el-form-item> </el-form-item>
</div> </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-form-item>
<el-button :disabled="btnLoading" size="small" type="primary" @click="handleCancel">Cancel</el-button> <el-button
<el-button size="small" type="primary" :loading="btnLoading" @click="handleSave">Save</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> </el-form-item>
</div> </div>
</el-form> </el-form>
@ -63,14 +92,14 @@ export default {
type: Object, type: Object,
default() { default() {
return {} return {}
} },
}, },
model: { model: {
type: Object, type: Object,
default() { default() {
return {} return {}
} },
} },
}, },
data() { data() {
return { return {
@ -87,23 +116,36 @@ export default {
Province: '', Province: '',
ProvinceCN: '', ProvinceCN: '',
City: '', City: '',
CityCN: '' CityCN: '',
}, },
siteList: [], siteList: [],
rules: { rules: {
HospitalNameCN: [{ required: true, message: 'Please specify', trigger: 'blur' }, { max: 50, message: 'The maximum length is 50' }], HospitalNameCN: [
UniversityAffiliated: [{ max: 100, message: 'The maximum length is 100' }], { required: true, message: 'Please specify', trigger: 'blur' },
UniversityAffiliatedCN: [{ max: 100, message: 'The maximum length is 100' }], { max: 50, message: 'The maximum length is 50' },
Country: [{ required: true, message: 'Please specify', trigger: 'blur' }, ],
{ max: 50, message: 'The maximum length is 50' }], UniversityAffiliated: [
CountryCN: [{ max: 50, message: 'The maximum length is 50' }], { max: 100, message: 'The maximum length is 100' },
Province: [{ required: true, message: 'Please specify', trigger: 'blur' }, ],
{ max: 50, message: 'The maximum length is 50' }], UniversityAffiliatedCN: [
ProvinceCN: [{ max: 50, message: 'The maximum length is 50' }], { max: 100, message: 'The maximum length is 100' },
City: [{ required: true, message: 'Please specify', trigger: 'blur' }, ],
{ max: 50, message: 'The maximum length is 50' }], Country: [{ max: 50, message: 'The maximum length is 50' }],
CityCN: [{ 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() { mounted() {
@ -114,7 +156,7 @@ export default {
}, },
methods: { methods: {
siteChange(v) { siteChange(v) {
this.siteList.forEach(o => { this.siteList.forEach((o) => {
if (o.Id === v) { if (o.Id === v) {
this.form.CityCN = o.City this.form.CityCN = o.City
this.form.HospitalNameCN = o.SiteNameCN this.form.HospitalNameCN = o.SiteNameCN
@ -125,34 +167,37 @@ export default {
}) })
}, },
getAllSiteList() { getAllSiteList() {
getAllSiteList().then(res => { getAllSiteList()
this.siteList = res.Result .then((res) => {
console.log(this.siteList) this.siteList = res.Result
}).catch(() => { console.log(this.siteList)
reject() })
}) .catch(() => {
reject()
})
}, },
handleSave() { handleSave() {
this.$refs.hospitalForm.validate(valid => { this.$refs.hospitalForm.validate((valid) => {
if (!valid) return if (!valid) return
this.btnLoading = true this.btnLoading = true
addOrUpdateHospital(this.form).then(res => { addOrUpdateHospital(this.form)
this.btnLoading = false .then((res) => {
if (res.IsSuccess) { this.btnLoading = false
this.$message.success('Saved successfully') if (res.IsSuccess) {
this.$refs['hospitalForm'].resetFields() this.$message.success('Saved successfully')
this.$emit('getList') this.$refs['hospitalForm'].resetFields()
this.$emit('close') this.$emit('getList')
} this.$emit('close')
}).catch(() => { }
this.btnLoading = false })
}) .catch(() => {
this.btnLoading = false
})
}) })
}, },
handleCancel() { handleCancel() {
this.$emit('close') this.$emit('close')
} },
} },
} }
</script> </script>

View File

@ -10,12 +10,16 @@
<el-input v-model="searchData.Version" style="width: 100px" /> <el-input v-model="searchData.Version" style="width: 100px" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleReset">{{ <el-button type="primary" icon="el-icon-search" @click="handleSearch">
$t("dictionary:browser:button:reset") {{ $t('common:button:search') }}
}}</el-button> </el-button>
<el-button type="primary" @click="handleSearch">{{ <el-button
$t("dictionary:browser:button:search") type="primary"
}}</el-button> icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t('common:button:reset') }}
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span style="margin-left: auto"> <span style="margin-left: auto">

View File

@ -24,6 +24,16 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="标准分组" prop="CriterionGroup">
<el-select v-model="form.CriterionGroup">
<el-option
v-for="item of $d.CriterionGroup"
:key="item.id"
:value="item.value"
:label="item.label"
/>
</el-select>
</el-form-item>
<el-form-item v-if="form.Id !== ''" label="是否配置完成"> <el-form-item v-if="form.Id !== ''" label="是否配置完成">
<el-switch v-model="form.IsCompleteConfig" /> <el-switch v-model="form.IsCompleteConfig" />
@ -40,7 +50,7 @@
<el-form-item v-if="form.Id !== ''" label="是否启用"> <el-form-item v-if="form.Id !== ''" label="是否启用">
<el-switch v-model="form.IsEnable" /> <el-switch v-model="form.IsEnable" />
</el-form-item> </el-form-item>
<el-form-item v-if="form.Id !== ''" label="eCRF是否显示在影像阅片页面"> <el-form-item v-if="form.Id !== ''" label="eICRF仅展示阅片Tab">
<el-switch v-model="form.IseCRFShowInDicomReading" /> <el-switch v-model="form.IseCRFShowInDicomReading" />
</el-form-item> </el-form-item>
</div> </div>
@ -72,6 +82,7 @@ export default {
Id: '', Id: '',
CriterionName: '', CriterionName: '',
CriterionType: null, CriterionType: null,
CriterionGroup: null,
IsEnable: true, IsEnable: true,
IsCompleteConfig: false, IsCompleteConfig: false,
ShowOrder: null, ShowOrder: null,
@ -80,7 +91,8 @@ export default {
}, },
rules: { rules: {
CriterionName: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['blur'] }], CriterionName: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['blur'] }],
CriterionType: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur'] }] CriterionType: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur'] }],
CriterionGroup: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur'] }]
}, },
loading: false, loading: false,

View File

@ -16,8 +16,16 @@
<el-input v-model="searchData.TagDescriptionCN" clearable style="width:120px;" /> <el-input v-model="searchData.TagDescriptionCN" clearable style="width:120px;" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleReset">Reset</el-button> <el-button type="primary" icon="el-icon-search" @click="handleSearch">
<el-button type="primary" @click="handleSearch">Search</el-button> {{ $t('common:button:search') }}
</el-button>
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t('common:button:reset') }}
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span style="margin-left:auto"> <span style="margin-left:auto">

View File

@ -27,8 +27,16 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleReset"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleSearch">
<el-button type="primary" @click="handleSearch"></el-button> {{ $t('common:button:search') }}
</el-button>
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t('common:button:reset') }}
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span style="margin-left:auto"> <span style="margin-left:auto">

View File

@ -243,7 +243,7 @@
> >
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="导出标识" <!-- <el-form-item label="导出标识"
prop="ExportIdentification" prop="ExportIdentification"
v-if="form.Type === 'radio' || form.Type === 'select' || form.Type === 'input' || form.Type === 'textarea' || form.Type === 'number' || form.Type === 'class' || form.Type === 'calculation'" v-if="form.Type === 'radio' || form.Type === 'select' || form.Type === 'input' || form.Type === 'textarea' || form.Type === 'number' || form.Type === 'class' || form.Type === 'calculation'"
> >
@ -262,8 +262,11 @@
>{{ item.label }} >{{ item.label }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item> -->
<el-form-item label="导出结果" v-if="form.ExportIdentification" prop="ExportResult"> <el-form-item
label="导出结果"
v-if="form.Type === 'radio' || form.Type === 'select' || form.Type === 'input' || form.Type === 'textarea' || form.Type === 'number' || form.Type === 'class' || form.Type === 'calculation'"
>
<el-select v-model="form.ExportResult" multiple> <el-select v-model="form.ExportResult" multiple>
<el-option <el-option
v-for="item in CriterionDictionaryList.ExportResult" v-for="item in CriterionDictionaryList.ExportResult"
@ -446,13 +449,14 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="form.QuestionGenre === 3" label="默认值"> <el-form-item v-if="form.QuestionGenre === 3" label="默认值">
<el-select v-model="form.DefaultValue" clearable> <el-select v-model="form.DefaultValue" clearable>
<el-option <el-option
v-for="item of form.DictionaryCode ? $d[form.DictionaryCode] : []" v-for="item of highlightAnswers"
:key="item.id" :key="item.Id"
:label="item.label" :label="$i18n.locale === 'zh' ? item.ValueCN : item.Value"
:value="item.value.toString()" :value="item.Code"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -598,6 +602,27 @@
/> />
</el-select> </el-select>
</el-form-item> </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 <el-form-item
v-if="form.Type === 'upload'" v-if="form.Type === 'upload'"
label="最大上传个数" label="最大上传个数"
@ -807,7 +832,7 @@ export default {
ConvertShowType: 0, ConvertShowType: 0,
QuestionClassify: null, QuestionClassify: null,
HighlightAnswerList: [], HighlightAnswerList: [],
ExportIdentification: 0, // ExportIdentification: 0,
ExportResult: [], ExportResult: [],
MaxAnswerLength: null, MaxAnswerLength: null,
FileType: [], FileType: [],
@ -844,17 +869,18 @@ export default {
{ required: true, message: '请注明', trigger: 'blur' }, { required: true, message: '请注明', trigger: 'blur' },
{ max: 50, message: '最大长度为 50' }, { max: 50, message: '最大长度为 50' },
], ],
ExportIdentification: [ // ExportIdentification: [
{ required: true, message: '请选择', trigger: 'blur' }, // { required: true, message: '', trigger: 'blur' },
], // ],
ExportResult: [ // ExportResult: [
{ required: true, message: '请选择', trigger: 'blur' }, // { required: true, message: '', trigger: 'blur' },
] // ]
}, },
loading: false, loading: false,
btnLoading: false, btnLoading: false,
parentOptions: [], parentOptions: [],
parentTriggerValOptions: [], parentTriggerValOptions: [],
reParentTriggerValOptions: [],
groupOptions: [], groupOptions: [],
isParentExistGroup: false, isParentExistGroup: false,
lesionTypes: [], lesionTypes: [],
@ -890,6 +916,7 @@ export default {
mounted() { mounted() {
this.initForm() this.initForm()
this.getCalculateQuestions('number') this.getCalculateQuestions('number')
}, },
methods: { methods: {
typeValueChange(v) { typeValueChange(v) {
@ -905,6 +932,14 @@ export default {
} }
}) })
}, },
getBasicConfigSelect() {
getCriterionDictionaryList({
CriterionId: this.criterionId,
SystemCriterionId: this.criterionId
}).then(res => {
this.dicList = res.Result
})
},
getCalculateQuestions(type) { getCalculateQuestions(type) {
getSystemCalculateQuestions({ getSystemCalculateQuestions({
systemCriterionId: this.criterionId, systemCriterionId: this.criterionId,
@ -944,6 +979,7 @@ export default {
await this.getParentQuestions() await this.getParentQuestions()
await this.getLesionTypeDictionary() await this.getLesionTypeDictionary()
await this.getLesionType() await this.getLesionType()
await this.getBasicConfigSelect()
if (Object.keys(this.data).length > 0) { if (Object.keys(this.data).length > 0) {
for (const k in this.form) { for (const k in this.form) {
if (this.data.hasOwnProperty(k)) { if (this.data.hasOwnProperty(k)) {
@ -969,8 +1005,15 @@ export default {
}) })
if (index !== -1) { if (index !== -1) {
if (this.parentOptions[index].QuestionGenre === 3) { if (this.parentOptions[index].QuestionGenre === 3) {
this.parentTriggerValOptions = // this.parentTriggerValOptions =
this.$d[this.parentOptions[index].DictionaryCode] // 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 { } else {
const options = [] const options = []
this.parentOptions[index].TypeValue.split('|').forEach( this.parentOptions[index].TypeValue.split('|').forEach(
@ -988,8 +1031,13 @@ export default {
}) })
if (index !== -1) { if (index !== -1) {
if (this.parentOptions[index].QuestionGenre === 3) { if (this.parentOptions[index].QuestionGenre === 3) {
this.reParentTriggerValOptions = // this.reParentTriggerValOptions =
this.$d[this.parentOptions[index].DictionaryCode] // 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 { } else {
const options = [] const options = []
this.parentOptions[index].TypeValue.split('|').forEach( this.parentOptions[index].TypeValue.split('|').forEach(
@ -1114,7 +1162,7 @@ export default {
data.ConvertShowType = 0 data.ConvertShowType = 0
data.QuestionClassify = null data.QuestionClassify = null
data.HighlightAnswerList = [] data.HighlightAnswerList = []
data.ExportIdentification = 0 // data.ExportIdentification = 0
data.ExportResult = [] data.ExportResult = []
data.FileType = [] data.FileType = []
data.ClassifyQuestionId = null data.ClassifyQuestionId = null
@ -1180,15 +1228,21 @@ export default {
} }
form.ParentTriggerValue = '' form.ParentTriggerValue = ''
}, },
relevanceQuestionChange(val, form) { async relevanceQuestionChange(val, form) {
if (val) { if (val) {
var index = this.parentOptions.findIndex((item) => { var index = this.parentOptions.findIndex((item) => {
return item.QuestionId === val return item.QuestionId === val
}) })
if (index !== -1) { if (index !== -1) {
if (this.parentOptions[index].QuestionGenre === 3) { if (this.parentOptions[index].QuestionGenre === 3) {
this.reParentTriggerValOptions = // this.reParentTriggerValOptions =
this.$d[this.parentOptions[index].DictionaryCode] // 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 { } else {
var options = [] var options = []
this.parentOptions[index].TypeValue.split('|').forEach( this.parentOptions[index].TypeValue.split('|').forEach(

View File

@ -8,9 +8,16 @@
<el-input v-model="searchData.QuestionName" clearable style="width:120px;" /> <el-input v-model="searchData.QuestionName" clearable style="width:120px;" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleReset"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleSearch">
<el-button type="primary" @click="handleSearch"></el-button> {{ $t('common:button:search') }}
</el-button>
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t('common:button:reset') }}
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div> <div>

View File

@ -8,9 +8,65 @@
> >
<el-input v-model="searchData.CriterionName" clearable style="width:120px;" /> <el-input v-model="searchData.CriterionName" clearable style="width:120px;" />
</el-form-item> </el-form-item>
<el-form-item
label="标准类型"
>
<el-select v-model="searchData.CriterionType" clearable style="width:120px;">
<el-option
v-for="item of $d.CriterionType"
:key="item.id"
:value="item.value"
:label="item.label"
/>
</el-select>
</el-form-item>
<el-form-item
label="标准分组"
>
<el-select v-model="searchData.CriterionGroup" clearable style="width:120px;">
<el-option
v-for="item of $d.CriterionGroup"
:key="item.id"
:value="item.value"
:label="item.label"
/>
</el-select>
</el-form-item>
<el-form-item
label="是否配置完成"
>
<el-select v-model="searchData.IsCompleteConfig" clearable style="width:120px;">
<el-option
v-for="item of $d.YesOrNo"
:key="item.id"
:value="item.value"
:label="item.label"
/>
</el-select>
</el-form-item>
<el-form-item
label="是否启用"
>
<el-select v-model="searchData.IsEnable" clearable style="width:120px;">
<el-option
v-for="item of $d.YesOrNo"
:key="item.id"
:value="item.value"
:label="item.label"
/>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleReset"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleSearch">
<el-button type="primary" @click="handleSearch"></el-button> {{ $t('common:button:search') }}
</el-button>
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t('common:button:reset') }}
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span style="margin-left:auto"> <span style="margin-left:auto">
@ -25,6 +81,8 @@
stripe stripe
size="small" size="small"
height="100" height="100"
@sort-change="handleSortByColumn"
ref="criterionsTbl"
> >
<el-table-column type="index" width="60" /> <el-table-column type="index" width="60" />
@ -32,20 +90,33 @@
prop="CriterionName" prop="CriterionName"
label="标准名称" label="标准名称"
show-overflow-tooltip show-overflow-tooltip
sortable="custom"
/> />
<el-table-column <el-table-column
prop="CriterionType" prop="CriterionType"
label="标准类型" label="标准类型"
show-overflow-tooltip show-overflow-tooltip
sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ $fd('CriterionType',scope.row.CriterionType) }} {{ $fd('CriterionType',scope.row.CriterionType) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
prop="CriterionGroup"
label="标准分组"
show-overflow-tooltip
sortable="custom"
>
<template slot-scope="scope">
{{ $fd('CriterionGroup',scope.row.CriterionGroup) }}
</template>
</el-table-column>
<el-table-column <el-table-column
prop="IsCompleteConfig" prop="IsCompleteConfig"
label="是否配置完成" label="是否配置完成"
sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
@ -62,22 +133,32 @@
label="描述" label="描述"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column
prop="ShowOrder"
label="显示序号"
show-overflow-tooltip
/>
<el-table-column <el-table-column
prop="IsEnable" prop="IsEnable"
label="是否启用" label="是否启用"
sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ $fd('YesOrNo', scope.row.IsEnable) }} {{ $fd('YesOrNo', scope.row.IsEnable) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
prop="ShowOrder"
label="显示序号"
show-overflow-tooltip
sortable="custom"
/>
<el-table-column
prop="IseCRFShowInDicomReading"
label="eICRF仅展示阅片Tab"
show-overflow-tooltip
sortable="custom"
width="210"
>
<template slot-scope="scope">
{{ $fd('YesOrNo', scope.row.IseCRFShowInDicomReading) }}
</template>
</el-table-column>
<el-table-column label="Action" min-width="200px"> <el-table-column label="Action" min-width="200px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -172,8 +253,14 @@ import AddCriterion from './AddCriterion'
const searchDataDefault = () => { const searchDataDefault = () => {
return { return {
CriterionName: '', CriterionName: '',
CriterionType: null,
CriterionGroup: null,
IsCompleteConfig: null,
IsEnable: null,
PageIndex: 1, PageIndex: 1,
PageSize: 20 PageSize: 20,
Asc: true,
SortField: ''
} }
} }
export default { export default {
@ -271,6 +358,18 @@ export default {
// //
handleReset() { handleReset() {
this.searchData = searchDataDefault() this.searchData = searchDataDefault()
this.$refs['criterionsTbl'].clearSort()
this.getList()
},
//
handleSortByColumn(column) {
if (column.order === 'ascending') {
this.searchData.Asc = true
} else {
this.searchData.Asc = false
}
this.searchData.SortField = column.prop
this.searchData.PageIndex = 1
this.getList() this.getList()
} }
} }

View File

@ -16,8 +16,16 @@
<el-input v-model="searchData.TagDescriptionCN" clearable style="width:120px;" /> <el-input v-model="searchData.TagDescriptionCN" clearable style="width:120px;" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleReset">Reset</el-button> <el-button type="primary" icon="el-icon-search" @click="handleSearch">
<el-button type="primary" @click="handleSearch">Search</el-button> {{ $t('common:button:search') }}
</el-button>
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t('common:button:reset') }}
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span style="margin-left:auto"> <span style="margin-left:auto">

View File

@ -38,8 +38,16 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleReset"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleSearch">
<el-button type="primary" @click="handleSearch"></el-button> {{ $t('common:button:search') }}
</el-button>
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t('common:button:reset') }}
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span style="margin-left:auto"> <span style="margin-left:auto">

View File

@ -26,8 +26,16 @@
<el-input v-model="searchData.Type" clearable style="width:120px;" /> <el-input v-model="searchData.Type" clearable style="width:120px;" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleReset">Reset</el-button> <el-button type="primary" icon="el-icon-search" @click="handleSearch">
<el-button type="primary" @click="handleSearch">Search</el-button> {{ $t('common:button:search') }}
</el-button>
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t('common:button:reset') }}
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span style="margin-left:auto"> <span style="margin-left:auto">

View File

@ -147,7 +147,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 导出标识 --> <!-- 导出标识 -->
<el-form-item <!-- <el-form-item
:label="$t('trials:readingUnit:qsList:title:ExportIdentification')" prop="ExportIdentification" :label="$t('trials:readingUnit:qsList:title:ExportIdentification')" prop="ExportIdentification"
v-if="form.Type === 'radio' || form.Type === 'select' || form.Type === 'input' || form.Type === 'textarea' || form.Type === 'number' || form.Type === 'class' || form.Type === 'calculation'" v-if="form.Type === 'radio' || form.Type === 'select' || form.Type === 'input' || form.Type === 'textarea' || form.Type === 'number' || form.Type === 'class' || form.Type === 'calculation'"
> >
@ -166,9 +166,12 @@
>{{ item.label }} >{{ item.label }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item> -->
<!-- 导出结果 --> <!-- 导出结果 -->
<el-form-item :label="$t('trials:readingUnit:qsList:title:ExportResult')" v-if="form.ExportIdentification" prop="ExportResult"> <el-form-item
:label="$t('trials:readingUnit:qsList:title:ExportResult')"
v-if="form.Type === 'radio' || form.Type === 'select' || form.Type === 'input' || form.Type === 'textarea' || form.Type === 'number' || form.Type === 'class' || form.Type === 'calculation'"
>
<el-select v-model="form.ExportResult" multiple> <el-select v-model="form.ExportResult" multiple>
<el-option <el-option
v-for="item in CriterionDictionaryList.ExportResult" v-for="item in CriterionDictionaryList.ExportResult"
@ -327,6 +330,32 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="form.TableQuestionType === 3" label="默认值">
<el-select v-model="form.DefaultValue" clearable>
<!-- <el-option
v-for="item of form.DictionaryCode ? $d[form.DictionaryCode] : []"
:key="item.id"
:label="item.label"
:value="item.value.toString()"
/> -->
<el-option
v-for="item of highlightAnswers"
:key="item.Id"
:label="$i18n.locale === 'zh' ? item.ValueCN : item.Value"
:value="item.Code"
/>
</el-select>
</el-form-item>
<el-form-item v-if="form.TableQuestionType === 0" label="默认值">
<el-select v-model="form.DefaultValue" clearable>
<el-option
v-for="item of form.TypeValue ? form.TypeValue.split('|') : []"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
<el-form-item v-if="form.Type === 'select' || form.Type === 'radio'" label="高亮标记值" prop="HighlightAnswerList"> <el-form-item v-if="form.Type === 'select' || form.Type === 'radio'" label="高亮标记值" prop="HighlightAnswerList">
<el-select v-model="form.HighlightAnswerList" clearable multiple> <el-select v-model="form.HighlightAnswerList" clearable multiple>
<template v-if="form.TypeValue"> <template v-if="form.TypeValue">
@ -338,11 +367,17 @@
/> />
</template> </template>
<template v-else-if="form.DictionaryCode"> <template v-else-if="form.DictionaryCode">
<el-option <!-- <el-option
v-for="item of $d[form.DictionaryCode]" v-for="item of $d[form.DictionaryCode]"
:key="item.id" :key="item.id"
:label="item.label" :label="item.label"
:value="item.value.toString()" :value="item.value.toString()"
/> -->
<el-option
v-for="item of highlightAnswers"
:key="item.Id"
:label="$i18n.locale === 'zh' ? item.ValueCN : item.Value"
:value="item.Code"
/> />
</template> </template>
</el-select> </el-select>
@ -607,8 +642,9 @@ export default {
ImageCount: 0, ImageCount: 0,
ClassifyTableQuestionId: null, ClassifyTableQuestionId: null,
ClassifyAlgorithms: null, ClassifyAlgorithms: null,
ExportIdentification: 0, // ExportIdentification: 0,
ExportResult: [] ExportResult: [],
DefaultValue:null
// IsEnable: true // IsEnable: true
}, },
rules: { rules: {
@ -633,12 +669,12 @@ export default {
DataTableColumn: [{ required: true, message: '请选择', trigger: 'blur' }], DataTableColumn: [{ required: true, message: '请选择', trigger: 'blur' }],
// DictionaryCode: [{ required: true, message: '', trigger: 'blur' }], // DictionaryCode: [{ required: true, message: '', trigger: 'blur' }],
DependParentId: [{ required: true, message: '请选择', trigger: 'blur' }], DependParentId: [{ required: true, message: '请选择', trigger: 'blur' }],
ExportIdentification: [ // ExportIdentification: [
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }, // { required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' },
], // ],
ExportResult: [ // ExportResult: [
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }, // { required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' },
] // ]
}, },
loading: false, loading: false,
parentOptions: [], parentOptions: [],
@ -648,9 +684,31 @@ export default {
colOptions: [], colOptions: [],
dicList: [], dicList: [],
CriterionDictionaryList: [], CriterionDictionaryList: [],
Questions: [] Questions: [],
highlightAnswers: []
} }
}, },
watch: {
'form.DictionaryCode': {
deep: true,
immediate: true,
async handler(v, oldv) {
try {
if (!v) {
this.highlightAnswers = []
return
}
let res = await getCriterionDictionary({
ReadingCriterionId: this.criterionId,
DictionaryCode: this.form.DictionaryCode,
})
this.highlightAnswers = res.Result[this.form.DictionaryCode]
} catch (e) {
console.log(e)
}
},
},
},
mounted() { mounted() {
this.initForm() this.initForm()
this.getCriterionDictionary() this.getCriterionDictionary()
@ -710,7 +768,13 @@ export default {
}) })
if (index !== -1) { if (index !== -1) {
if (this.parentOptions[index].QuestionGenre === 3) { 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 { } else {
const options = [] const options = []
this.parentOptions[index].TypeValue.split('|').forEach((item, index) => { this.parentOptions[index].TypeValue.split('|').forEach((item, index) => {
@ -726,8 +790,12 @@ export default {
}) })
if (i !== -1) { if (i !== -1) {
if (this.parentOptions[i].QuestionGenre === 3) { 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 { } else {
const options = [] const options = []
this.parentOptions[i].TypeValue.split('|').forEach((item, index) => { this.parentOptions[i].TypeValue.split('|').forEach((item, index) => {
@ -805,14 +873,20 @@ export default {
form.RelevanceValue = '' form.RelevanceValue = ''
} }
}, },
parentQuestionChange(val, form) { async parentQuestionChange(val, form) {
if (val) { if (val) {
var index = this.parentOptions.findIndex(item => { var index = this.parentOptions.findIndex(item => {
return item.QuestionId === val return item.QuestionId === val
}) })
if (index !== -1) { if (index !== -1) {
if (this.parentOptions[index].QuestionGenre === 3) { 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 { } else {
const options = [] const options = []
this.parentOptions[index].TypeValue.split('|').forEach((item, index) => { this.parentOptions[index].TypeValue.split('|').forEach((item, index) => {
@ -824,16 +898,20 @@ export default {
} }
form.ParentTriggerValue = '' form.ParentTriggerValue = ''
}, },
relevanceQuestionChange(val, form) { async relevanceQuestionChange(val, form) {
if (val) { if (val) {
var index = this.parentOptions.findIndex(item => { var index = this.parentOptions.findIndex(item => {
return item.QuestionId === val return item.QuestionId === val
}) })
console.log(this.$d[this.parentOptions[index].DictionaryCode], this.parentOptions[index].QuestionGenre)
if (index !== -1) { if (index !== -1) {
if (this.parentOptions[index].QuestionGenre === 3) { 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 { } else {
const options = [] const options = []
this.parentOptions[index].TypeValue.split('|').forEach((item, index) => { this.parentOptions[index].TypeValue.split('|').forEach((item, index) => {
@ -890,8 +968,9 @@ export default {
form.ImageCount = null form.ImageCount = null
form.ClassifyTableQuestionId = null form.ClassifyTableQuestionId = null
form.ClassifyAlgorithms = null form.ClassifyAlgorithms = null
form.ExportIdentification = 0 // form.ExportIdentification = 0
form.ExportResult = [] form.ExportResult = []
form.DefaultValue = null
}, },
close() { close() {
this.$emit('close') this.$emit('close')

View File

@ -246,9 +246,9 @@
:autosize="{ minRows: 8, maxRows: 8 }" :autosize="{ minRows: 8, maxRows: 8 }"
/> />
<el-button <el-button
:disabled="!form.EmailHtmlContentCN" :disabled="!form.EmailHtmlContentCN && form.EmailHtmlContent"
type="text" type="text"
@click="PreviewHTML(form.EmailHtmlContentCN)" @click="PreviewHTML(form.EmailHtmlContentCN, form.EmailHtmlContent)"
style="position: absolute; left: -50px; top: 30px" style="position: absolute; left: -50px; top: 30px"
> >
{{ $t('common:button:preview') }} {{ $t('common:button:preview') }}
@ -265,9 +265,9 @@
:autosize="{ minRows: 8, maxRows: 8 }" :autosize="{ minRows: 8, maxRows: 8 }"
/> />
<el-button <el-button
:disabled="!form.EmailHtmlContent" :disabled="!form.EmailHtmlContentCN && form.EmailHtmlContent"
type="text" type="text"
@click="PreviewHTML(form.EmailHtmlContent)" @click="PreviewHTML(form.EmailHtmlContentCN, form.EmailHtmlContent)"
style="position: absolute; left: -50px; top: 30px" style="position: absolute; left: -50px; top: 30px"
> >
{{ $t('common:button:preview') }} {{ $t('common:button:preview') }}
@ -519,8 +519,8 @@ export default {
}) })
}, },
// //
PreviewHTML(html) { PreviewHTML(html, htmlEn) {
this.$emit('PreviewHTML', html) this.$emit('PreviewHTML', html, htmlEn)
}, },
}, },
} }

View File

@ -123,8 +123,16 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleSearch"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleSearch">
<el-button type="primary" @click="handleReset"></el-button> {{ $t('common:button:search') }}
</el-button>
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t('common:button:reset') }}
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span style="margin-left: auto"> <span style="margin-left: auto">
@ -370,6 +378,13 @@
<el-button type="text" @click="handleDelete(scope.row)" <el-button type="text" @click="handleDelete(scope.row)"
>删除</el-button >删除</el-button
> >
<el-button
type="text"
@click="
preview(scope.row.EmailHtmlContentCN, scope.row.EmailHtmlContent)
"
>{{ $t('common:button:preview') }}</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -427,7 +442,23 @@
fullscreen fullscreen
custom-class="base-dialog-wrapper" custom-class="base-dialog-wrapper"
> >
<div v-html="previewHTML"></div> <div
style="
display: flex;
align-items: flex-start;
justify-content: space-around;
flex-wrap: wrap;
"
>
<div>
<h3>邮件内容模版CN</h3>
<div v-html="previewHTML"></div>
</div>
<div>
<h3>邮件内容模版EN</h3>
<div v-html="previewHTMLEN"></div>
</div>
</div>
</el-dialog> </el-dialog>
</box-content> </box-content>
</template> </template>
@ -487,6 +518,7 @@ export default {
attachmentVisible: false, attachmentVisible: false,
previewVisible: false, previewVisible: false,
previewHTML: null, previewHTML: null,
previewHTMLEN: null,
} }
}, },
computed: { computed: {
@ -574,8 +606,9 @@ export default {
closeDialog() { closeDialog() {
this.editVisible = false this.editVisible = false
}, },
preview(html) { preview(html, htmlEN) {
this.previewHTML = html this.previewHTML = html
this.previewHTMLEN = htmlEN
this.previewVisible = true this.previewVisible = true
}, },
// //

View File

@ -3,15 +3,23 @@
<!-- 搜索框 --> <!-- 搜索框 -->
<div class="search"> <div class="search">
<el-form :inline="true" size="mini" class="base-search-form"> <el-form :inline="true" size="mini" class="base-search-form">
<el-form-item label="编号:"> <el-form-item label="Code:">
<el-input v-model="searchData.Code" style="width:100px;" /> <el-input v-model="searchData.Code" style="width:100px;" />
</el-form-item> </el-form-item>
<el-form-item label="模板:"> <el-form-item label="模板:">
<el-input v-model="searchData.Name" style="width:100px;" /> <el-input v-model="searchData.Name" style="width:100px;" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleReset">Reset</el-button> <el-button type="primary" icon="el-icon-search" @click="handleSearch">
<el-button type="primary" @click="handleSearch">Search</el-button> {{ $t('common:button:search') }}
</el-button>
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="handleReset"
>
{{ $t('common:button:reset') }}
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span style="margin-left:auto;"> <span style="margin-left:auto;">

View File

@ -29,15 +29,16 @@
<el-input v-model="password.Email" disabled /> <el-input v-model="password.Email" disabled />
</el-form-item> </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-input v-model="password.UserType" disabled />
</el-form-item> </el-form-item> -->
<!-- 用户名 --> <!-- 用户名 -->
<el-form-item :label="$t('recompose:form:userName')" prop="NewUserName"> <el-form-item :label="$t('recompose:form:userName')" prop="NewUserName">
<el-input v-model="password.NewUserName" /> <el-input v-model="password.NewUserName" />
</el-form-item> </el-form-item>
<!-- 新密码 --> <!-- 新密码 -->
<el-form-item <el-form-item
class="my_new_pwd"
:label="$t('recompose:form:newPassword')" :label="$t('recompose:form:newPassword')"
prop="NewPassWord" prop="NewPassWord"
> >
@ -84,6 +85,11 @@ export default {
password: { password: {
NewUserName: null, NewUserName: null,
UserId: null, UserId: null,
ConfirmPassWord: null,
NewPassWord: null,
Email: null,
UserType: null,
access_token: null,
}, },
passwordFormRules: { passwordFormRules: {
NewUserName: [ NewUserName: [
@ -95,7 +101,6 @@ export default {
: 'zh' : 'zh'
/* eslint-disable */ /* eslint-disable */
var reg1 = /^[a-zA-Z0-9_]{4,16}$/ //8 var reg1 = /^[a-zA-Z0-9_]{4,16}$/ //8
console.log(!reg1.test(value))
if (!reg1.test(value)) { if (!reg1.test(value)) {
callback( callback(
lang === 'zh' lang === 'zh'
@ -176,9 +181,9 @@ export default {
this.$i18n.locale = this.$route.query.lang this.$i18n.locale = this.$route.query.lang
this.setLanguage(this.$route.query.lang) this.setLanguage(this.$route.query.lang)
this.$updateDictionary() this.$updateDictionary()
if (!this.password.NewUserName) { // if (!this.password.NewUserName) {
this.$alert(this.$t('recompose:message:warning')) // this.$alert(this.$t('recompose:message:warning'))
} // }
}, },
methods: { methods: {
...mapMutations({ setLanguage: 'lang/setLanguage' }), ...mapMutations({ setLanguage: 'lang/setLanguage' }),
@ -190,8 +195,10 @@ export default {
} else { } else {
this.$router.push(`/login`) this.$router.push(`/login`)
} }
this.$i18n.locale = 'zh' if (!this.$i18n.locale) {
this.setLanguage('zh') //this.$i18n.locale = 'zh'
//this.setLanguage('zh')
}
this.$updateDictionary() this.$updateDictionary()
}, },
save() { save() {
@ -229,7 +236,10 @@ export default {
}) })
}, },
cancel() { cancel() {
this.$refs['passwordForm'].resetFields() // this.$refs['passwordForm'].resetFields()
this.password.NewPassWord = null
this.password.NewUserName = null
this.password.ConfirmPassWord = null
}, },
}, },
} }
@ -263,7 +273,7 @@ input {
background-color: transparent; background-color: transparent;
caret-color: #fff; caret-color: #fff;
} }
.el-form-item { ::v-deep .is-error.my_new_pwd {
margin-bottom: 30px; margin-bottom: 45px;
} }
</style> </style>

View File

@ -2,7 +2,8 @@
<div class="wscn-http404-container"> <div class="wscn-http404-container">
<div class="wscn-http404" style="display: flex;align-items: center"> <div class="wscn-http404" style="display: flex;align-items: center">
<div class="pic-404"> <div class="pic-404">
<img class="pic-404__parent" src="@/assets/login-bg.png" alt="404"> <!-- <img class="pic-404__parent" src="@/assets/login-bg.png" alt="404"> -->
<svg-icon icon-class="login-bg" style="width: 100%; height: 100%" />
<img class="pic-404__child left" src="@/assets/404_images/404_cloud.png" alt="404"> <img class="pic-404__child left" src="@/assets/404_images/404_cloud.png" alt="404">
<img class="pic-404__child mid" src="@/assets/404_images/404_cloud.png" alt="404"> <img class="pic-404__child mid" src="@/assets/404_images/404_cloud.png" alt="404">
<img class="pic-404__child right" src="@/assets/404_images/404_cloud.png" alt="404"> <img class="pic-404__child right" src="@/assets/404_images/404_cloud.png" alt="404">
@ -56,8 +57,10 @@ export default {
.pic-404 { .pic-404 {
position: relative; position: relative;
float: left; float: left;
width: 400px; width: 500px;
height: 300px;
overflow: hidden; overflow: hidden;
margin-right: 10px;
&__parent { &__parent {
width: 100%; width: 100%;
} }

View File

@ -76,7 +76,8 @@
> >
<!-- 用户名 --> <!-- 用户名 -->
<el-form-item :label="$t('passwordReset:form:userName')" prop="UserId"> <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" v-model="form.UserId"
clearable clearable
filterable filterable
@ -94,15 +95,15 @@
item.UserType item.UserType
}}</span> }}</span>
</el-option> </el-option>
</el-select> </el-select> -->
</el-form-item> </el-form-item>
<!-- 用户类型 --> <!-- 用户类型 -->
<el-form-item <!-- <el-form-item
v-if="form.UserId" v-if="form.UserId"
:label="$t('passwordReset:form:userType')" :label="$t('passwordReset:form:userType')"
> >
<el-input v-model="form.UserType" disabled /> <el-input v-model="form.UserType" disabled />
</el-form-item> </el-form-item> -->
<!-- 新密码 --> <!-- 新密码 -->
<el-form-item <el-form-item
class="my_new_pwd" class="my_new_pwd"
@ -338,11 +339,13 @@ export default {
) )
.then((res) => { .then((res) => {
this.formLoading = false this.formLoading = false
this.users = res.Result this.form.UserId = res.Result.Id
if (this.users.length === 1) { this.form.UserName = res.Result.UserName
this.form.UserId = this.users[0].UserId // this.users = res.Result
this.form.UserType = this.users[0].UserType // if (this.users.length === 1) {
} // this.form.UserId = this.users[0].UserId
// this.form.UserType = this.users[0].UserType
// }
// //
this.$message.success( this.$message.success(
this.$t('passwordReset:message:verifiedSuccessfully') this.$t('passwordReset:message:verifiedSuccessfully')
@ -420,7 +423,7 @@ export default {
/* margin-bottom: 40px;*/ /* margin-bottom: 40px;*/
/*}*/ /*}*/
.is-error.my_new_pwd { .is-error.my_new_pwd {
margin-bottom: 40px; margin-bottom: 45px;
} }
.flexBox { .flexBox {
display: flex; display: flex;

View File

@ -83,7 +83,7 @@
<svg-icon icon-class="password" /> <svg-icon icon-class="password" />
</span> </span>
<!-- password --> <!-- password -->
<!-- <el-input <el-input
:key="passwordType" :key="passwordType"
ref="password" ref="password"
v-model="loginForm.password" v-model="loginForm.password"
@ -100,8 +100,8 @@
<svg-icon <svg-icon
:icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"
/> />
</span> --> </span>
<el-input <!-- <el-input
:key="passwordType" :key="passwordType"
ref="password" ref="password"
v-model="pwdCover" v-model="pwdCover"
@ -115,7 +115,7 @@
/> />
<span class="show-pwd" @click="hidePassword"> <span class="show-pwd" @click="hidePassword">
<svg-icon :icon-class="!isShowPassword ? 'eye' : 'eye-open'" /> <svg-icon :icon-class="!isShowPassword ? 'eye' : 'eye-open'" />
</span> </span> -->
</el-form-item> </el-form-item>
<!-- Login --> <!-- Login -->
<el-button <el-button
@ -205,17 +205,21 @@
" "
> >
<h1 <h1
style="text-align: center; margin-bottom: 20px" style="text-align: center; margin-bottom: 30px"
v-if="NODE_ENV === 'usa'" v-if="NODE_ENV === 'usa'"
> >
About About
</h1> </h1>
<h1 style="text-align: center; margin-bottom: 20px" v-else></h1> <h1 style="text-align: center; margin-bottom: 30px" v-else></h1>
<p style="margin-bottom: 20px" v-if="NODE_ENV === 'usa'"> <p style="margin-bottom: 0px" v-if="NODE_ENV === 'usa'">
{{ $t('login:title:system_title_about') }} <!-- {{ $t('login:title:system_title_about') }} -->
<svg-icon
icon-class="login-logo"
style="width: 250px; height: 71px"
/>
</p> </p>
<p style="margin-bottom: 20px" v-else>{{ $t('login:title:system') }}</p> <p style="margin-bottom: 0px" v-else>{{ $t('login:title:system') }}</p>
<p style="margin-bottom: 20px"> <p style="margin-bottom: 20px; margin-top: 0">
V{{ $version.IsEnv_US ? $version.Version_US : $version.Version }} V{{ $version.IsEnv_US ? $version.Version_US : $version.Version }}
</p> </p>
<p style="margin-bottom: 20px" v-if="language === 'zh'"> <p style="margin-bottom: 20px" v-if="language === 'zh'">
@ -243,6 +247,13 @@
</div> </div>
</el-dialog> </el-dialog>
<browserTip ref="browserTip" /> <browserTip ref="browserTip" />
<toggleRole
v-if="toggleRoleVisible"
:visible.sync="toggleRoleVisible"
:loading="toggleRoleLoading"
@save="loginByRole"
@cancel="cancel"
/>
</div> </div>
</template> </template>
@ -253,9 +264,10 @@ import TopLang from './topLang'
import Vcode from 'vue-puzzle-vcode' import Vcode from 'vue-puzzle-vcode'
import browserTip from '@/views/dictionary/template/browser/tip.vue' import browserTip from '@/views/dictionary/template/browser/tip.vue'
import Img1 from '@/assets/pic-2.png' import Img1 from '@/assets/pic-2.png'
import toggleRole from '@/components/toggleRole'
export default { export default {
name: 'Login', name: 'Login',
components: { TopLang, Vcode, browserTip }, components: { TopLang, Vcode, browserTip, toggleRole },
data() { data() {
return { return {
NODE_ENV: process.env.NODE_ENV, // process.env.NODE_ENV NODE_ENV: process.env.NODE_ENV, // process.env.NODE_ENV
@ -298,12 +310,15 @@ export default {
isShow: false, isShow: false,
showCode: false, showCode: false,
Img1, Img1,
toggleRoleVisible: false,
toggleRoleLoading: false,
} }
}, },
computed: { computed: {
...mapGetters(['asyncRoutes', 'routes', 'language']), ...mapGetters(['asyncRoutes', 'routes', 'language']),
host() { host() {
return window.location.host // return window.location.host
return 'elevateimaging.ai '
}, },
}, },
watch: { watch: {
@ -318,6 +333,8 @@ export default {
}, },
}, },
mounted() { mounted() {
let lang = zzSessionStorage.getItem('lang') || 'zh'
// zzSessionStorage.clear()
this.loginType = this.$route.query.loginType this.loginType = this.$route.query.loginType
this.location = this.$route.query.location this.location = this.$route.query.location
zzSessionStorage.setItem('loginType', this.loginType) zzSessionStorage.setItem('loginType', this.loginType)
@ -332,9 +349,9 @@ export default {
this.setLanguage('en') this.setLanguage('en')
this.$updateDictionary() this.$updateDictionary()
} else { } else {
// this.$i18n.locale = 'zh' this.$i18n.locale = lang
// this.setLanguage('zh') this.setLanguage(lang)
// this.$updateDictionary() this.$updateDictionary()
} }
} }
this.$refs.browserTip.open() this.$refs.browserTip.open()
@ -376,6 +393,9 @@ export default {
this.$store this.$store
.dispatch('user/login', this.loginForm) .dispatch('user/login', this.loginForm)
.then((res) => { .then((res) => {
if (res.BasicInfo.LoginState === 2) {
this.$message.warning(this.$t('login:message:login4'))
}
if (res.BasicInfo.IsFirstAdd) { if (res.BasicInfo.IsFirstAdd) {
// , // ,
this.$message.success(this.$t('login:message:login1')) this.$message.success(this.$t('login:message:login1'))
@ -385,7 +405,7 @@ export default {
}) })
}, 500) }, 500)
return return
} else if (res.BasicInfo.LoginState === 1) { } else if (res.BasicInfo.NeedChangePassWord) {
// //
this.$alert( this.$alert(
this.$t('login:message:login3'), this.$t('login:message:login3'),
@ -401,52 +421,117 @@ export default {
) )
return return
} else if (res.IsMFA) { } else if (res.IsMFA) {
zzSessionStorage.removeItem('userId')
zzSessionStorage.removeItem('identityUserId')
this.$MFA({ this.$MFA({
UserId: res.BasicInfo.Id, UserId: res.BasicInfo.IdentityUserId,
EMail: res.BasicInfo.EMail, EMail: res.BasicInfo.EMail,
username: this.loginForm.username, username: this.loginForm.username,
callBack: this.loginIn, callBack: this.changeRoleLogin,
cancelBack: () => { cancelBack: () => {
this.loading = false this.loading = false
}, },
}) })
return 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) => { // else if (res.BasicInfo.LoginState === 2) {
this.loading = false // // IP'
if (res && res.length > 0) { // // this.$alert(this.$t('login:message:login4'), this.$t('common:title:warning'))
this.$store.dispatch('global/getNoticeList') // this.$message.warning(this.$t('login:message:login4'))
this.$router.addRoutes(res) // }
if (this.loginType === 'DevOps') { zzSessionStorage.removeItem('userId')
this.$router.replace({ path: res[0].path }) zzSessionStorage.removeItem('identityUserId')
return this.changeRoleLogin()
}
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'))
}
})
}) })
.catch(() => { .catch(() => {
this.showCode = true this.showCode = true
this.loading = false 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
})
},
changeRoleLogin() {
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
}
if (
Array.isArray(this.$store.state.user.roles) &&
this.$store.state.user.roles.filter((item) => item.IsUserRoleDisabled)
.length ===
this.$store.state.user.roles.length - 1
) {
let role = this.$store.state.user.roles.find(
(item) => !item.IsUserRoleDisabled
)
this.loginByRole(role.Id)
return
}
return (this.toggleRoleVisible = true)
},
cancel() {
this.showCode = true
this.loading = false
this.toggleRoleLoading = false
// this.toggleRoleVisible = false
},
onSuccess() { onSuccess() {
this.isShow = false this.isShow = false
this.loginIn() this.loginIn()
@ -456,7 +541,6 @@ export default {
}, },
// //
setPassword(val) { setPassword(val) {
console.log(val)
if (this.isShowPassword) { if (this.isShowPassword) {
this.loginForm.password = val this.loginForm.password = val
} else { } else {

View File

@ -42,6 +42,7 @@
</el-form-item> </el-form-item>
<!-- 新密码 --> <!-- 新密码 -->
<el-form-item <el-form-item
class="my_new_pwd"
:label="$t('recompose:form:newPassword')" :label="$t('recompose:form:newPassword')"
prop="NewPassWord" prop="NewPassWord"
> >
@ -138,14 +139,16 @@ export default {
...mapMutations({ setLanguage: 'lang/setLanguage' }), ...mapMutations({ setLanguage: 'lang/setLanguage' }),
async logout() { async logout() {
var loginType = zzSessionStorage.getItem('loginType') var loginType = zzSessionStorage.getItem('loginType')
await this.$store.dispatch('user/logout') await this.$store.dispatch('user/resetData')
if (loginType) { if (loginType) {
this.$router.push(`/login?loginType=${loginType}`) this.$router.push(`/login?loginType=${loginType}`)
} else { } else {
this.$router.push(`/login`) this.$router.push(`/login`)
} }
this.$i18n.locale = 'zh' if (!this.$i18n.locale) {
this.setLanguage('zh') //this.$i18n.locale = 'zh'
//this.setLanguage('zh')
}
this.$updateDictionary() this.$updateDictionary()
}, },
save() { save() {
@ -219,4 +222,7 @@ input {
background-color: transparent; background-color: transparent;
caret-color: #fff; caret-color: #fff;
} }
::v-deep .is-error.my_new_pwd {
margin-bottom: 45px;
}
</style> </style>

View File

@ -117,7 +117,7 @@
:title="$t('trials:researchForm:dialogTitle:reject')" :title="$t('trials:researchForm:dialogTitle:reject')"
width="600px" width="600px"
custom-class="base-dialog-wrapper" custom-class="base-dialog-wrapper"
:append-to-body="userTypeEnumInt !== 0" append-to-body
> >
<el-form ref="rejectForm" :model="rejectForm" label-width="100px"> <el-form ref="rejectForm" :model="rejectForm" label-width="100px">
<div class="base-dialog-body"> <div class="base-dialog-body">

View File

@ -437,7 +437,7 @@ export default {
}, },
handlePreview3(row) { handlePreview3(row) {
return this.$preview({ return this.$preview({
path: row.FilePath, path: row.Path || row.FilePath,
type: 'pdf', type: 'pdf',
title: row.FileName, title: row.FileName,
}) })
@ -447,7 +447,7 @@ export default {
}, },
handlePreview2(row, r2) { handlePreview2(row, r2) {
return this.$preview({ return this.$preview({
path: row.fullPath, path: row.Path || row.fullPath,
type: 'pdf', type: 'pdf',
title: row.FileName, title: row.FileName,
}) })
@ -537,7 +537,7 @@ export default {
handlePreview(row) { handlePreview(row) {
console.log(row) console.log(row)
return this.$preview({ return this.$preview({
path: row.FullPath, path: row.Path || row.FullPath,
type: 'pdf', type: 'pdf',
title: row.FileName, title: row.FileName,
}) })

View File

@ -569,22 +569,30 @@
:label="$t('system:EducationTraining:table:Hospital')" :label="$t('system:EducationTraining:table:Hospital')"
prop="Hospital" prop="Hospital"
> >
<el-select <el-row type="flex" justify="space-between">
v-model="postgraduateForm.HospitalId" <el-col :span="11">
filterable <el-autocomplete
placeholder="" clearable
> class="inline-input"
<el-option style="width: 100%"
v-for="(item, index) in hospitalList" v-model="postgraduateForm.Hospital"
:key="index" :fetch-suggestions="querySearch"
:label="isEN ? item.HospitalName : item.HospitalNameCN" @select="handleSelect"
:value="item.Id" placeholder="Please specify in English"
> ></el-autocomplete>
<span> </el-col>
{{ isEN ? item.HospitalName : item.HospitalNameCN }} <el-col :span="11">
</span> <el-autocomplete
</el-option> clearable
</el-select> 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>
<el-form-item <el-form-item
:label="$t('system:EducationTraining:table:University')" :label="$t('system:EducationTraining:table:University')"
@ -1043,6 +1051,8 @@ export default {
}, },
isDisabled: false, isDisabled: false,
loading: false, loading: false,
hospitalSelectList: [],
hospitalSelectListCN: [],
} }
}, },
computed: { computed: {
@ -1051,11 +1061,71 @@ export default {
return this.$i18n.locale !== 'zh' 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() { mounted() {
this.initPage() this.initPage()
store.dispatch('global/getHospital') store.dispatch('global/getHospital')
}, },
methods: { 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() { initPage() {
const id = this.$route.query.Id || this.reviewerId const id = this.$route.query.Id || this.reviewerId
if (id) { if (id) {

View File

@ -14,27 +14,32 @@
<el-col :span="14"> <el-col :span="14">
<el-form-item <el-form-item
:label="$t('system:reviewer:label:Hospital')" :label="$t('system:reviewer:label:Hospital')"
prop="HospitalId" prop="HospitalName"
> >
<el-select <el-autocomplete
v-model="employmentForm.HospitalId" clearable
placeholder="select" class="inline-input"
:disabled="$route.query.ReviewStatus === '1'"
style="width: 100%" style="width: 100%"
size="small" v-model="employmentForm.HospitalName"
@change="handleHospitalChange" :fetch-suggestions="querySearch"
> @select="handleSelect"
<el-option placeholder="Please specify in English"
v-for="(item, index) in hospitalList" @change="handleChange"
:key="index" ></el-autocomplete>
:label="isEN ? item.HospitalName : item.HospitalNameCN" </el-form-item>
:value="item.Id" </el-col>
> <el-col :span="14">
<span> <el-form-item prop="HospitalNameCN">
{{ isEN ? item.HospitalName : item.HospitalNameCN }} <el-autocomplete
</span> clearable
</el-option> class="inline-input"
</el-select> style="width: 100%"
v-model="employmentForm.HospitalNameCN"
:fetch-suggestions="querySearchCN"
@select="handleSelect"
placeholder="请用中文注明"
@change="handleChange"
></el-autocomplete>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -43,12 +48,25 @@
<el-col :span="14"> <el-col :span="14">
<el-form-item <el-form-item
:label="$t('system:reviewer:label:AffiliatedUniversity')" :label="$t('system:reviewer:label:AffiliatedUniversity')"
prop="UniversityAffiliated"
> >
<el-input <el-input
disabled v-model="employmentForm.UniversityAffiliated"
v-model="UniversityAffiliated"
type="textarea" type="textarea"
autosize 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" size="small"
:maxlength="4000" :maxlength="4000"
/> />
@ -59,15 +77,23 @@
<el-col :span="14"> <el-col :span="14">
<el-form-item :label="$t('system:reviewer:label:City')"> <el-form-item :label="$t('system:reviewer:label:City')">
<el-input <el-input
disabled v-model="employmentForm.City"
v-model="City"
size="small" 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-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <!-- <el-row>
<el-col :span="14"> <el-col :span="14">
<el-form-item :label="$t('system:reviewer:label:State/Province')"> <el-form-item :label="$t('system:reviewer:label:State/Province')">
<el-input <el-input
@ -90,7 +116,7 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row> -->
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
@ -321,14 +347,34 @@ export default {
Physician: '', Physician: '',
PhysicianCN: '', PhysicianCN: '',
PhysicianOriginal: null, PhysicianOriginal: null,
HospitalName: '',
HospitalNameCN: '',
WorkPartTime: null, WorkPartTime: null,
WorkPartTimeEn: null, WorkPartTimeEn: null,
UniversityAffiliated: null,
UniversityAffiliatedCN: null,
City: null,
CityCN: null,
}, },
UniversityAffiliated: '', UniversityAffiliated: '',
City: '', City: '',
Province: '', Province: '',
Country: '', Country: '',
employmentRules: { 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: [ DepartmentId: [
{ {
required: true, required: true,
@ -435,6 +481,8 @@ export default {
otherId: 'ef84e9cb-f1a6-49d7-b6da-34be2c12abd5', otherId: 'ef84e9cb-f1a6-49d7-b6da-34be2c12abd5',
loading: false, loading: false,
dictionaryList: {}, dictionaryList: {},
hospitalSelectList: [],
hospitalSelectListCN: [],
} }
}, },
computed: { computed: {
@ -446,7 +494,83 @@ export default {
mounted() { mounted() {
this.initEmployment() 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: { 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) { RankChange(val) {
var o = this.$d.Rank.find((v) => { var o = this.$d.Rank.find((v) => {
return v.id === val return v.id === val
@ -515,6 +639,14 @@ export default {
: '' : ''
param.HospitalId = this.employmentForm.HospitalId 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) updateEmploymentInfo(param)
.then((res) => { .then((res) => {
this.isDisabled = false this.isDisabled = false
@ -551,9 +683,22 @@ export default {
PositionOther, PositionOther,
PositionOtherCN, PositionOtherCN,
HospitalId, HospitalId,
HospitalName,
HospitalNameCN,
WorkPartTime, WorkPartTime,
WorkPartTimeEn, WorkPartTimeEn,
UniversityAffiliated,
UniversityAffiliatedCN,
City,
CityCN,
} = res.Result } = 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.WorkPartTime = WorkPartTime
this.employmentForm.WorkPartTimeEn = WorkPartTimeEn this.employmentForm.WorkPartTimeEn = WorkPartTimeEn
this.employmentForm.Id = id this.employmentForm.Id = id

View File

@ -333,7 +333,7 @@ export default {
}, },
preview(row) { preview(row) {
this.$preview({ this.$preview({
path: row.FullPath, path: row.Path || row.FullPath,
type: 'pdf', type: 'pdf',
title: row.FileName, title: row.FileName,
}) })

View File

@ -292,7 +292,7 @@ export default {
}, },
preview(row) { preview(row) {
this.$preview({ this.$preview({
path: row.FullPath, path: row.Path || row.FullPath,
type: 'pdf', type: 'pdf',
title: row.FileName, title: row.FileName,
}) })

View File

@ -150,20 +150,31 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="$t('curriculumVitae:continuingTraining:form:hospital')" :label="$t('curriculumVitae:continuingTraining:form:hospital')"
prop="HospitalId" prop="Hospital"
v-if="isEN"
> >
<el-select v-model="form.HospitalId" filterable placeholder=""> <el-autocomplete
<el-option clearable
v-for="(item, index) in hospitalList" class="inline-input"
:key="index" style="width: 100%"
:label="isEN ? item.HospitalName : item.HospitalNameCN" v-model="form.Hospital"
:value="item.Id" :fetch-suggestions="querySearch"
> placeholder=""
<span> ></el-autocomplete>
{{ isEN ? item.HospitalName : item.HospitalNameCN }} </el-form-item>
</span> <el-form-item
</el-option> :label="$t('curriculumVitae:continuingTraining:form:hospital')"
</el-select> 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>
<el-form-item <el-form-item
:label="$t('curriculumVitae:continuingTraining:form:school')" :label="$t('curriculumVitae:continuingTraining:form:school')"
@ -283,6 +294,8 @@ const defaultForm = () => {
Major: '', Major: '',
MajorCN: '', MajorCN: '',
HospitalId: null, HospitalId: null,
HospitalCN: null,
Hospital: null,
School: '', School: '',
SchoolCN: '', SchoolCN: '',
City: '', City: '',
@ -418,6 +431,7 @@ export default {
}, },
loading: false, loading: false,
daterange: [], daterange: [],
hospitalSelectList: [],
} }
}, },
computed: { computed: {
@ -426,7 +440,55 @@ export default {
mounted() { mounted() {
store.dispatch('global/getHospital') 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: { 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) { openEdit(row) {
this.form = defaultForm() this.form = defaultForm()
this.daterange = [] this.daterange = []
@ -458,6 +520,11 @@ export default {
if (this.reviewerId) { if (this.reviewerId) {
this.form.DoctorId = 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 this.loading = true
let res = await addOrUpdatePostgraduateInfo(this.form) let res = await addOrUpdatePostgraduateInfo(this.form)
this.loading = false this.loading = false

View File

@ -6,7 +6,7 @@
<template v-if="DATA.FirstName && DATA.LastName"> <template v-if="DATA.FirstName && DATA.LastName">
<div class="userInfo"> <div class="userInfo">
<span>{{ <span>{{
isEN ? DATA.FirstName + DATA.LastName : DATA.ChineseName isEN ? DATA.LastName + ' / ' + DATA.FirstName : DATA.ChineseName
}}</span> }}</span>
<span>{{ $fd('Sex', DATA.Sex) }}</span> <span>{{ $fd('Sex', DATA.Sex) }}</span>
<span v-if="isEN"> <span v-if="isEN">
@ -209,25 +209,35 @@
</div> </div>
<el-form-item <el-form-item
:label="$t('curriculumVitae:info:form:hospital')" :label="$t('curriculumVitae:info:form:hospital')"
prop="HospitalId" prop="HospitalName"
v-if="isEN"
> >
<el-select <el-autocomplete
v-model="form.HospitalId" clearable
filterable class="inline-input"
style="width: 100%"
v-model="form.HospitalName"
:fetch-suggestions="querySearch"
@select="handleSelect"
placeholder="" placeholder=""
@change="handleHospitalChange" @change="handleChange"
> ></el-autocomplete>
<el-option </el-form-item>
v-for="(item, index) in hospitalList" <el-form-item
:key="index" :label="$t('curriculumVitae:info:form:hospital')"
:label="isEN ? item.HospitalName : item.HospitalNameCN" prop="HospitalNameCN"
:value="item.Id" v-else
> >
<span> <el-autocomplete
{{ isEN ? item.HospitalName : item.HospitalNameCN }} clearable
</span> class="inline-input"
</el-option> style="width: 100%"
</el-select> v-model="form.HospitalNameCN"
:fetch-suggestions="querySearch"
@select="handleSelect"
placeholder=""
@change="handleChange"
></el-autocomplete>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="$t('curriculumVitae:info:form:AffiliatedUniversity')" :label="$t('curriculumVitae:info:form:AffiliatedUniversity')"
@ -235,7 +245,6 @@
v-if="isEN" v-if="isEN"
> >
<el-input <el-input
disabled
v-model="form.UniversityAffiliated" v-model="form.UniversityAffiliated"
type="textarea" type="textarea"
autosize autosize
@ -249,7 +258,6 @@
v-else v-else
> >
<el-input <el-input
disabled
v-model="form.UniversityAffiliatedCN" v-model="form.UniversityAffiliatedCN"
type="textarea" type="textarea"
autosize autosize
@ -261,10 +269,10 @@
:label="$t('curriculumVitae:info:form:City')" :label="$t('curriculumVitae:info:form:City')"
v-if="isEN" 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>
<el-form-item :label="$t('curriculumVitae:info:form:City')" v-else> <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>
<el-form-item <el-form-item
:label="$t('curriculumVitae:info:form:department')" :label="$t('curriculumVitae:info:form:department')"
@ -433,6 +441,8 @@ const defaultForm = () => {
RankOther: '', RankOther: '',
RankOtherCN: '', RankOtherCN: '',
HospitalId: '', HospitalId: '',
HospitalName: null,
HospitalNameCN: null,
WorkPartTime: null, WorkPartTime: null,
WorkPartTimeEn: null, WorkPartTimeEn: null,
UniversityAffiliated: null, UniversityAffiliated: null,
@ -616,11 +626,18 @@ export default {
trigger: 'blur', trigger: 'blur',
}, },
], ],
HospitalId: [ HospitalName: [
{ {
required: true, required: true,
message: this.$t('common:ruleMessage:select'), message: this.$t('common:ruleMessage:specify'),
trigger: 'blur', trigger: ['blur', 'change'],
},
],
HospitalNameCN: [
{
required: true,
message: this.$t('common:ruleMessage:specify'),
trigger: ['blur', 'change'],
}, },
], ],
UniversityAffiliated: [ UniversityAffiliated: [
@ -648,16 +665,72 @@ export default {
loading: false, loading: false,
dictionaryList: {}, dictionaryList: {},
otherId: 'ef84e9cb-f1a6-49d7-b6da-34be2c12abd5', otherId: 'ef84e9cb-f1a6-49d7-b6da-34be2c12abd5',
hospitalSelectList: [],
} }
}, },
computed: { computed: {
...mapGetters(['hospitalList']), ...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() { mounted() {
this.getDicData() this.getDicData()
store.dispatch('global/getHospital') store.dispatch('global/getHospital')
}, },
methods: { 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() { openEdit() {
this.form = defaultForm() this.form = defaultForm()
Object.keys(this.form).forEach((key) => { Object.keys(this.form).forEach((key) => {
@ -666,8 +739,6 @@ export default {
} }
}) })
this.model_cfg.visible = true this.model_cfg.visible = true
console.log(this.form)
console.log(this.DATA)
}, },
handleCancle() { handleCancle() {
this.form = defaultForm() this.form = defaultForm()
@ -680,8 +751,14 @@ export default {
if (this.reviewerId) { if (this.reviewerId) {
this.form.Id = this.reviewerId this.form.Id = this.reviewerId
} }
// console.log(this.form)
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 this.loading = true
let res = await addOrUpdateDoctorBasicInfoAndEmployment(this.form) let res = await addOrUpdateDoctorBasicInfoAndEmployment(data)
this.loading = false this.loading = false
if (res.IsSuccess) { if (res.IsSuccess) {
this.$emit('update:reviewerId', res.Result.Id) this.$emit('update:reviewerId', res.Result.Id)
@ -701,13 +778,18 @@ export default {
}) })
.catch(() => {}) .catch(() => {})
}, },
handleHospitalChange(value) { handleSelect(value) {
const item = this.hospitalList.filter((item) => item.Id === value) const item = value
if (item.length) { if (item) {
this.form.UniversityAffiliated = item[0].UniversityAffiliated this.form.UniversityAffiliated = item.UniversityAffiliated
this.form.City = item[0].City this.form.City = item.City
this.form.UniversityAffiliatedCN = item[0].UniversityAffiliatedCN this.form.UniversityAffiliatedCN = item.UniversityAffiliatedCN
this.form.CityCN = item[0].CityCN this.form.CityCN = item.CityCN
} else {
this.form.UniversityAffiliated = null
this.form.City = null
this.form.UniversityAffiliatedCN = null
this.form.CityCN = null
} }
}, },
}, },

View File

@ -7,8 +7,9 @@
<span v-if="isAll"> <span v-if="isAll">
{{ {{
isEN isEN
? reviewerData.BasicInfoView.FirstName + ? reviewerData.BasicInfoView.LastName +
reviewerData.BasicInfoView.LastName ' / ' +
reviewerData.BasicInfoView.FirstName
: reviewerData.BasicInfoView.ChineseName : reviewerData.BasicInfoView.ChineseName
}} }}
</span> </span>
@ -1014,7 +1015,7 @@ export default {
} }
}, },
preview(row) { preview(row) {
let path = row.FullPath || row.FilePath let path = row.Path || row.FullPath || row.FilePath
this.$preview({ this.$preview({
path: path, path: path,
type: 'pdf', type: 'pdf',

View File

@ -179,6 +179,7 @@ export default {
methods: { methods: {
openDialog(title, data, options = [], status) { openDialog(title, data, options = [], status) {
this.PublishVersionList = options; this.PublishVersionList = options;
this.loading = false
this.status = status; this.status = status;
this.model_cfg.visible = true; this.model_cfg.visible = true;
this.model_cfg.title = title; this.model_cfg.title = title;

View File

@ -154,6 +154,15 @@
> >
批量更新 批量更新
</el-button> </el-button>
<el-button
type="primary"
icon="el-icon-edit-outline"
size="mini"
:disabled="selectTableList.length <= 0"
@click="handleBatchUpdateToChange"
>
批量编辑
</el-button>
<el-button <el-button
size="mini" size="mini"
type="primary" type="primary"
@ -380,6 +389,9 @@ export default {
mounted() { mounted() {
this.getList() this.getList()
this.getPublishVersionSelect() this.getPublishVersionSelect()
this.$EventBus.$on('il8nUpdate', (data) => {
this.getList()
})
}, },
methods: { methods: {
// //
@ -416,6 +428,10 @@ export default {
) )
}) })
}, },
//
handleBatchUpdateToChange() {
this.$openI18n(this.selectTableList)
},
async batch(row) { async batch(row) {
let { PublishLogId, State } = row let { PublishLogId, State } = row
let data = { let data = {

View File

@ -12,7 +12,7 @@
<el-form-item :label="$t('system:log:form:version')" prop="Version"> <el-form-item :label="$t('system:log:form:version')" prop="Version">
<el-input v-model="form.Version" /> <el-input v-model="form.Version" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('system:log:form:versionUS')" prop="Version"> <el-form-item :label="$t('system:log:form:versionUS')" prop="Version_US">
<el-input v-model="form.Version_US" /> <el-input v-model="form.Version_US" />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
@ -100,6 +100,9 @@ export default {
}, },
{ max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50` }, { max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50` },
], ],
Version_US:[
{ max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50` }
],
// PublishTime: [ // PublishTime: [
// { required: true, message: '', trigger: 'blur' } // { required: true, message: '', trigger: 'blur' }
// ], // ],

View File

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

View File

@ -50,7 +50,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label=" $t('system:loginLog:table:LoginUserType')" :label="$t('system:loginLog:table:LoginUserType')"
prop="LoginUserTypeEnum" prop="LoginUserTypeEnum"
> >
<el-select <el-select
@ -77,19 +77,15 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-search" @click="getList">
type="primary" {{ $t('common:button:search') }}
icon="el-icon-search"
@click="getList"
>
{{ $t("common:button:search") }}
</el-button> </el-button>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-refresh-left" icon="el-icon-refresh-left"
@click="handleReset" @click="handleReset"
> >
{{ $t("common:button:reset") }} {{ $t('common:button:reset') }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -101,7 +97,32 @@
class="table" class="table"
@sort-change="handleSortByColumn" @sort-change="handleSortByColumn"
> >
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50">
<template slot-scope="scope">
<span
style="
display: flex;
align-items: center;
justify-content: flex-end;
"
>
<el-tooltip
class="item"
effect="dark"
:content="$t('system:loginLog:label:IsLoginUncommonly')"
placement="top"
style="margin-right: 3px"
v-if="scope.row.IsLoginUncommonly"
>
<i
v-if="scope.row.IsLoginUncommonly"
class="el-icon-warning icon-i"
></i>
</el-tooltip>
<span>{{ scope.$index + 1 }}</span>
</span>
</template>
</el-table-column>
<el-table-column <el-table-column
:label="$t('system:loginLog:table:OptType')" :label="$t('system:loginLog:table:OptType')"
prop="OptType" prop="OptType"
@ -110,7 +131,7 @@
sortable="custom" sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ $fd("UserOptType", scope.row.OptType) }} {{ $fd('UserOptType', scope.row.OptType) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -127,21 +148,28 @@
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> />
<el-table-column <!-- <el-table-column
:label="$t('system:loginLog:table:LoginFaildName')" :label="$t('system:loginLog:table:LoginFaildName')"
prop="LoginFaildName" prop="LoginFaildName"
min-width="180" min-width="180"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> /> -->
<el-table-column <el-table-column
:label="$t('system:loginLog:table:LoginUserName')" :label="$t('system:loginLog:table:LoginUserName')"
prop="LoginUserName" prop="ActionUserName"
min-width="140" min-width="140"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
/> />
<el-table-column <el-table-column
:label="$t('system:loginLog:table:Aetionlserlype')"
prop="ActionUserType"
min-width="100"
show-overflow-tooltip
sortable="custom"
/>
<!-- <el-table-column
:label="$t('system:loginLog:table:LoginUserType')" :label="$t('system:loginLog:table:LoginUserType')"
prop="LoginUserTypeEnum" prop="LoginUserTypeEnum"
min-width="120" min-width="120"
@ -151,15 +179,15 @@
<template slot-scope="scope"> <template slot-scope="scope">
{{ $fd("UserType", scope.row.LoginUserTypeEnum) }} {{ $fd("UserType", scope.row.LoginUserTypeEnum) }}
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column <el-table-column
:label="$t('system:loginLog:table:OptUserName')" :label="$t('system:loginLog:table:OptUserName')"
prop="OptUserName" prop="TargetIdentityUserName"
min-width="200" min-width="200"
sortable="custom" sortable="custom"
show-overflow-tooltip show-overflow-tooltip
/> />
<el-table-column <!-- <el-table-column
:label="$t('system:loginLog:table:OptUserType')" :label="$t('system:loginLog:table:OptUserType')"
prop="OptUserTypeEnum" prop="OptUserTypeEnum"
min-width="200" min-width="200"
@ -169,6 +197,21 @@
<template slot-scope="scope"> <template slot-scope="scope">
{{ $fd("UserType", scope.row.OptUserTypeEnum) }} {{ $fd("UserType", scope.row.OptUserTypeEnum) }}
</template> </template>
</el-table-column> -->
<el-table-column
: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>
<el-table-column <el-table-column
:label="$t('system:loginLog:table:CreateTime')" :label="$t('system:loginLog:table:CreateTime')"
@ -187,29 +230,31 @@
/> />
</div> </div>
</div> </div>
<detail :config="config" :JsonObj="JsonObj" />
</div> </div>
</template> </template>
<script> <script>
import { getUserLogList } from "@/api/user"; import { getUserLogList } from '@/api/user'
import Pagination from "@/components/Pagination"; import Pagination from '@/components/Pagination'
import moment from "moment"; import detail from './detail.vue'
import moment from 'moment'
const searchDataDefault = () => { const searchDataDefault = () => {
return { return {
OptType: null, OptType: null,
Ip: "", Ip: '',
LoginFaildName: "", LoginFaildName: '',
LoginUserName: '', LoginUserName: '',
LoginUserTypeEnum: null, LoginUserTypeEnum: null,
BeginDate: "", BeginDate: '',
EndDate: "", EndDate: '',
Asc: false, Asc: false,
SortField: "CreateTime", SortField: 'CreateTime',
PageIndex: 1, PageIndex: 1,
PageSize: 20, PageSize: 20,
}; }
}; }
export default { export default {
components: { Pagination }, components: { Pagination, detail },
data() { data() {
return { return {
moment, moment,
@ -218,52 +263,69 @@ export default {
total: 0, total: 0,
loading: false, loading: false,
datetimerange: [], datetimerange: [],
}; config: {
visible: false,
title: this.$t('system:loginLog:dialog:title'),
width: '500px',
top: '10vh',
},
JsonObj: null,
}
}, },
mounted() { mounted() {
this.getList(); this.getList()
}, },
methods: { 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() { getList() {
this.loading = true; this.loading = true
getUserLogList(this.searchData) getUserLogList(this.searchData)
.then((res) => { .then((res) => {
this.loading = false; this.loading = false
this.list = res.Result.CurrentPageData; this.list = res.Result.CurrentPageData
this.total = res.Result.TotalCount; this.total = res.Result.TotalCount
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false
}); })
}, },
handleDatetimeChange(val) { handleDatetimeChange(val) {
if (val) { if (val) {
this.searchData.BeginDate = val[0]; this.searchData.BeginDate = val[0]
this.searchData.EndDate = val[1]; this.searchData.EndDate = val[1]
} else { } else {
this.searchData.BeginDate = ""; this.searchData.BeginDate = ''
this.searchData.EndDate = ""; this.searchData.EndDate = ''
} }
}, },
// //
handleReset() { handleReset() {
this.datetimerange = [] this.datetimerange = []
this.searchData = searchDataDefault(); this.searchData = searchDataDefault()
this.getList(); this.getList()
}, },
// //
handleSortByColumn(column) { handleSortByColumn(column) {
if (column.order === "ascending") { if (column.order === 'ascending') {
this.searchData.Asc = true; this.searchData.Asc = true
} else { } else {
this.searchData.Asc = false; this.searchData.Asc = false
} }
this.searchData.SortField = column.prop; this.searchData.SortField = column.prop
this.searchData.PageIndex = 1; this.searchData.PageIndex = 1
this.getList(); this.getList()
}, },
}, },
}; }
</script> </script>
<style lang="scss"> <style lang="scss">
.log { .log {
@ -291,5 +353,9 @@ export default {
text-align: right; text-align: right;
} }
} }
.icon-i {
color: #f56c6c;
cursor: pointer;
}
} }
</style> </style>

View File

@ -5,24 +5,38 @@
:model="user" :model="user"
:rules="userFormRules" :rules="userFormRules"
label-width="150px" label-width="150px"
style="width:800px;" style="width: 800px"
> >
<el-card class="Basic" shadow="never" size="small"> <el-card class="Basic" shadow="never" size="small">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ $t('system:userlist:title:Information') }}</span> <span>{{ $t('system:userlist:title:Information') }}</span>
</div> </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-input v-model="user.UserCode" disabled />
</el-form-item> </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-input v-model="user.UserName" />
</el-form-item> </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-input v-model="user.LastName" />
</el-form-item> </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-input v-model="user.FirstName" />
</el-form-item> </el-form-item>
<!-- <el-form-item :label="$t('system:userlist:table:Gender')" prop="Sex" style="margin-right:40px;"> <!-- <el-form-item :label="$t('system:userlist:table:Gender')" prop="Sex" style="margin-right:40px;">
@ -32,49 +46,134 @@
</el-radio-group> </el-radio-group>
</el-form-item> --> </el-form-item> -->
<el-form-item :label="$t('system:userlist:table:Email')" prop="EMail"> <el-form-item :label="$t('system:userlist:table:Email')" prop="EMail">
<el-input v-model="user.EMail" /> <el-input v-model="user.EMail" :disabled="!!user.UserCode" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('system:userlist:table:Phone')" prop="Phone"> <el-form-item :label="$t('system:userlist:table:Phone')" prop="Phone">
<el-input v-model="user.Phone" /> <el-input v-model="user.Phone" />
</el-form-item> </el-form-item>
<el-form-item v-if="type==1" :label="$t('system:userlist:table:Disable')"> <el-form-item
<el-switch v-model="user.Status" :active-value="1" :inactive-value="0" /> 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>
<el-form-item :label="$t('system:userlist:table:IsTestUser')"> <el-form-item :label="$t('system:userlist:table:IsTestUser')">
<el-radio-group v-model="user.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-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('system:userlist:table:UserType')" prop="UserTypeId"> <el-form-item
<el-select ref="userType" v-model="user.UserTypeId" size="small" placeholder="Please select" style="width:100%;" :disabled="user.CanEditUserType === false"> :label="$t('system:userlist:table:UserType')"
<el-option prop="Roles"
v-for="(userType,key) of userTypeOptions" v-if="type === 0"
v-if="userType.UserTypeEnum !== 20" >
:key="key" <div style="display: flex; align-items: center">
:label="userType.UserType" <el-select
:value="userType.Id" ref="userType"
/> v-model="user.Roles"
</el-select> size="small"
placeholder="Please select"
multiple
style="width: 100%"
:disabled="user.CanEditUserType === false || type === 1"
@change="handleChange"
>
<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>
</div>
</el-form-item>
<el-form-item
:label="$t('system:userlist:table:UserType')"
prop="userTypeId"
v-else
>
<div style="display: flex; align-items: center">
<el-select
ref="userType"
v-model="Roles"
size="small"
placeholder="Please select"
multiple
style="width: 100%"
:disabled="user.CanEditUserType === false || type === 1"
@change="handleChange"
>
<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-form-item>
</el-card> </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"> <div slot="header" class="clearfix">
<span>{{ $t('system:userlist:title:Affiliation') }}</span> <span>{{ $t('system:userlist:title:Affiliation') }}</span>
</div> </div>
<el-form-item prop="IsZhiZhun"> <el-form-item prop="IsZhiZhun">
<el-radio-group v-model="user.IsZhiZhun" @change="OrgnizationTypeChanged"> <el-radio-group
<el-radio :label="true">{{ $t('system:userlist:title:Internal') }}</el-radio> v-model="user.IsZhiZhun"
<el-radio :label="false">{{ $t('system:userlist:title:External') }}</el-radio> @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-radio-group>
</el-form-item> </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-input v-model="user.OrganizationName" />
</el-form-item> </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-input v-model="user.DepartmentName" />
</el-form-item> </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-input v-model="user.PositionName" />
</el-form-item> </el-form-item>
</el-card> </el-card>
@ -83,20 +182,35 @@
type="primary" type="primary"
size="small" size="small"
:disabled="isDisabled" :disabled="isDisabled"
style="margin:10px 15px" style="margin: 10px 15px"
@click="handleSave" @click="handleSave"
>Save</el-button> >Save</el-button
>
</el-form-item> </el-form-item>
<roleList
v-if="visible"
:visible.sync="visible"
:userId="userId"
:list="userRoleList"
:userTypeOptions="userTypeOptions"
@getRoleList="getRoleList"
/>
</el-form> </el-form>
</template> </template>
<script> <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 { export default {
name: 'UserInfo', name: 'UserInfo',
props: { props: {
userId: { type: String, default: '' } userId: { type: String, default: '' },
}, },
components: { roleList },
created() { created() {
this.getUserTypeList() this.getUserTypeList()
if (this.userId !== '') { if (this.userId !== '') {
@ -107,26 +221,46 @@ export default {
} }
}, },
methods: { 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 // URL
let url = wurl || window.location.href; let url = wurl || window.location.href
// //
let regex = new RegExp('([?&])' + param + '=.*?(&|$)'); let regex = new RegExp('([?&])' + param + '=.*?(&|$)')
let separator = url.indexOf('?') !== -1 ? '&' : '?'; let separator = url.indexOf('?') !== -1 ? '&' : '?'
// //
if (regex.test(url)) { if (regex.test(url)) {
return url.replace(regex, '$1' + param + '=' + newValue + '$2'); return url.replace(regex, '$1' + param + '=' + newValue + '$2')
} else { } else {
return url + separator + param + '=' + newValue; return url + separator + param + '=' + newValue
} }
}, },
handleSave() { handleSave() {
this.$refs.userForm.validate(valid => { this.$refs.userForm.validate((valid) => {
if (valid) { if (valid) {
this.isDisabled = true 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) let newUrl = this.updateQueryParam('userName', this.user.UserName)
newUrl = this.updateQueryParam('email', this.user.EMail, newUrl) newUrl = this.updateQueryParam('email', this.user.EMail, newUrl)
window.history.pushState({ path: newUrl }, '', newUrl) window.history.pushState({ path: newUrl }, '', newUrl)
@ -136,53 +270,117 @@ export default {
this.user.BaseUrl = `${location.protocol}//${location.host}/login` this.user.BaseUrl = `${location.protocol}//${location.host}/login`
this.user.RouteUrl = `${location.protocol}//${location.host}/email-recompose` this.user.RouteUrl = `${location.protocol}//${location.host}/email-recompose`
if (this.user.Id) { if (this.user.Id) {
updateUser(this.user).then(res => { updateUser(this.user)
this.isDisabled = false .then((res) => {
this.$message.success('Updated successfully') this.isDisabled = false
}).catch(() => { this.isDisabled = false }) this.$message.success('Updated successfully')
})
.catch(() => {
this.isDisabled = false
})
} else { } else {
addUser(this.user).then(res => { addUser(this.user)
this.isDisabled = false .then((res) => {
this.user.Id = res.Result.Id this.isDisabled = false
this.user.UserCode = res.Result.UserCode this.user.Id = res.Result.Id
this.$emit('getUserId', res.Result.Id) this.user.UserCode = res.Result.UserCode
this.$message.success('Added successfully') this.$emit('getUserId', res.Result.Id)
this.$router.push({ path: '/system/user/list' }) this.$message.success('Added successfully')
}).catch(() => { this.isDisabled = false }) this.$router.push({ path: '/system/user/list' })
})
.catch(() => {
this.isDisabled = false
})
} }
} }
}) })
}, },
getUserTypeList() { getUserTypeList() {
getUserTypeListByUserType(0).then(res => { getUserTypeListByUserType(0).then((res) => {
if (res.IsSuccess) { if (res.IsSuccess) {
this.userTypeOptions = res.Result this.userTypeOptions = []
res.Result.forEach((item) => {
if (item.UserTypeEnum !== 21) {
this.userTypeOptions.push(item)
}
})
} }
}) })
}, },
getUserInfo() { getUserInfo() {
getUser(this.userId).then(res => { getUser({
IdentityUserId: this.userId,
}).then((res) => {
this.user = res.Result 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) { OrgnizationTypeChanged(val) {
this.user.OrganizationName = '' this.user.OrganizationName = ''
} },
}, },
data() { data() {
var validatePassword = (rule, value, callback) => { 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 */ /* eslint-disable */
var reg1 = /^[a-zA-Z0-9_]{4,16}$/; //8 var reg1 = /^[a-zA-Z0-9_]{4,16}$/ //8
console.log(!reg1.test(value))
if (!reg1.test(value)) { 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 { } else {
callback(); callback()
} }
} }
return { return {
userRoleList: [],
Roles: [],
user: { user: {
Roles: [],
UserRoleList: [],
UserName: '', UserName: '',
LastName: '', LastName: '',
FirstName: '', FirstName: '',
@ -194,65 +392,75 @@ export default {
OrganizationName: '', OrganizationName: '',
DepartmentName: '', DepartmentName: '',
PositionName: '', PositionName: '',
IsTestUser: false IsTestUser: false,
}, },
visible: false,
userFormRules: { userFormRules: {
UserName: [ UserName: [
{ required: true, validator: validatePassword, trigger: 'blur' } { required: true, validator: validatePassword, trigger: 'blur' },
], ],
UserTypeId: [ Roles: [
{ required: true, message: 'Please Select', trigger: ['blur', 'change'] } {
required: true,
message: 'Please Select',
trigger: ['blur', 'change'],
},
], ],
IsZhiZhun: [ IsZhiZhun: [
{ required: true, message: 'Please Select', trigger: ['blur', 'change'] } {
required: true,
message: 'Please Select',
trigger: ['blur', 'change'],
},
], ],
OrganizationName: [ OrganizationName: [
{ required: true, message: 'Please specify', trigger: 'blur' } { required: true, message: 'Please specify', trigger: 'blur' },
], ],
LastName: [ LastName: [
{ required: true, message: 'Please specify', trigger: 'blur' }, { required: true, message: 'Please specify', trigger: 'blur' },
{ max: 50, message: 'The maximum length is 50' } { max: 50, message: 'The maximum length is 50' },
], ],
FirstName: [ FirstName: [
{ required: true, message: 'Please specify', trigger: 'blur' }, { required: true, message: 'Please specify', trigger: 'blur' },
{ max: 50, message: 'The maximum length is 50' } { max: 50, message: 'The maximum length is 50' },
], ],
Phone: [ 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: [ EMail: [
{ {
required: true, required: true,
message: 'Please input the email address', message: 'Please input the email address',
trigger: 'blur' trigger: 'blur',
}, },
{ {
type: 'email', type: 'email',
message: 'Please input the correct email address', message: 'Please input the correct email address',
trigger: ['blur'] trigger: ['blur'],
}, },
{ max: 50, message: 'The maximum length is 50' } { max: 50, message: 'The maximum length is 50' },
],
Sex: [
{ required: true, message: 'Please specify', trigger: 'blur' }
], ],
Sex: [{ required: true, message: 'Please specify', trigger: 'blur' }],
Status: [ Status: [
{ required: true, message: 'Please specify', trigger: 'blur' } { required: true, message: 'Please specify', trigger: 'blur' },
], ],
DepartmentName: [ DepartmentName: [{ max: 50, message: 'The maximum length is 50' }],
{ max: 50, message: 'The maximum length is 50' }], PositionName: [{ max: 50, message: 'The maximum length is 50' }],
PositionName: [{ max: 50, message: 'The maximum length is 50' }
]
}, },
userTypeOptions: [], userTypeOptions: [],
isDisabled: false, isDisabled: false,
type: 0 // 10 type: 0, // 10
} }
} },
} }
</script> </script>
<style scoped> <style scoped>
/deep/ .is-error.my_new_pwd{ ::v-deep .is-error.my_new_pwd {
margin-bottom: 40px; margin-bottom: 40px;
} }
</style> </style>

View File

@ -0,0 +1,212 @@
<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')" min-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(item.UserTypeEnum)
)
},
},
methods: {
cancel() {
this.$emit('update:visible', false)
},
openAdd() {
this.form.roles = []
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>

View File

@ -20,23 +20,49 @@
:total="total" :total="total"
@getList="getList" @getList="getList"
@editCb="handleEditUser" @editCb="handleEditUser"
@sendCb="addNewUserSendEmail"
@deleteCb="handleDeleteUser" @deleteCb="handleDeleteUser"
@sortByColumn="sortByColumn" @sortByColumn="sortByColumn"
> >
<!-- 选择自定义slot --> <!-- 选择自定义slot -->
<template slot="tip-slot" slot-scope="{ scope }"> <template slot="tip-slot" slot-scope="{ scope }">
<i <i
v-if="diffTime(scope.row.LastLoginTime) >= 90" v-if="
diffTime(scope.row.LastLoginTime) >= 90 &&
diffTime(scope.row.LastChangePassWordTime) >= 90
"
class="el-icon-warning"
style="color: #f56c6c"
:title="$t('system:userlist:tip:overTimeAndoverTimePassWord')"
/>
<i
v-else-if="diffTime(scope.row.LastLoginTime) >= 90"
class="el-icon-warning" class="el-icon-warning"
style="color: #f56c6c" style="color: #f56c6c"
:title="$t('system:userlist:tip:overTime')" :title="$t('system:userlist:tip:overTime')"
/> />
<i
v-else-if="diffTime(scope.row.LastChangePassWordTime) >= 90"
class="el-icon-warning"
style="color: #f56c6c"
:title="$t('system:userlist:tip:overTimePassWord')"
/>
</template> </template>
<template slot="genderSlot" slot-scope="{ scope }"> <template slot="genderSlot" slot-scope="{ scope }">
{{ scope.row.Sex ? 'Male' : 'Female' }} {{ scope.row.Sex ? 'Male' : 'Female' }}
</template> </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 }"> <template slot="roleSlot" slot-scope="{ scope }">
{{ scope.row.RoleNameList.map((role) => role.RoleName).join(',') }} {{ scope.row.RoleNameList.map((role) => role.RoleName).join(', ') }}
</template> </template>
<template slot="isZhiZhunSlot" slot-scope="{ scope }"> <template slot="isZhiZhunSlot" slot-scope="{ scope }">
{{ {{
@ -63,7 +89,12 @@
</box-content> </box-content>
</template> </template>
<script> <script>
import { getUserList, getUserTypeList, deleteSysUser } from '@/api/admin' import {
getUserList,
getUserTypeList,
deleteSysUser,
addNewUserSendEmail,
} from '@/api/admin'
// import { searchForm, searchHandle, columns } from './list' // import { searchForm, searchHandle, columns } from './list'
import BoxContent from '@/components/BoxContent' import BoxContent from '@/components/BoxContent'
import SearchForm from '@/components/BaseForm/search-form' import SearchForm from '@/components/BaseForm/search-form'
@ -85,8 +116,12 @@ const searchDataDefault = () => {
RealName: '', RealName: '',
BeginCreateTime: '', BeginCreateTime: '',
EndCreateTime: '', EndCreateTime: '',
EndLastLoginTime: null,
EndLastChangePassWordTime: null,
BeginLastChangePassWordTime: null,
CreateTimeArr: [], CreateTimeArr: [],
LastLoginTimeArr: [], LastLoginTimeArr: [],
LastChangePassWordTimeArr: [],
SortField: 'CreateTime', SortField: 'CreateTime',
} }
} }
@ -115,7 +150,7 @@ export default {
showOverflowTooltip: true, showOverflowTooltip: true,
}, },
{ {
prop: 'RealName', prop: 'FullName',
label: this.$t('system:userlist:table:RealName'), label: this.$t('system:userlist:table:RealName'),
minWidth: 120, minWidth: 120,
sortable: 'custom', sortable: 'custom',
@ -154,6 +189,7 @@ export default {
prop: 'UserType', prop: 'UserType',
label: this.$t('system:userlist:table:UserType'), label: this.$t('system:userlist:table:UserType'),
minWidth: 100, minWidth: 100,
slot: 'UserTypeSlot',
sortable: 'custom', sortable: 'custom',
showOverflowTooltip: true, showOverflowTooltip: true,
}, },
@ -191,6 +227,13 @@ export default {
sortable: 'custom', sortable: 'custom',
showOverflowTooltip: true, showOverflowTooltip: true,
}, },
{
prop: 'LastChangePassWordTime',
label: this.$t('system:userlist:table:LastChangePassWordTime'),
minWidth: 250,
sortable: 'custom',
showOverflowTooltip: true,
},
{ {
prop: 'CreateTime', prop: 'CreateTime',
label: this.$t('system:userlist:table:createTime'), label: this.$t('system:userlist:table:createTime'),
@ -202,12 +245,19 @@ export default {
type: 'operate', type: 'operate',
label: this.$t('common:action:action'), label: this.$t('common:action:action'),
minWidth: 200, minWidth: 200,
fixed: 'right',
operates: [ operates: [
{ {
name: this.$t('common:button:edit'), name: this.$t('common:button:edit'),
type: 'primary', type: 'primary',
emitKey: 'editCb', emitKey: 'editCb',
}, },
{
name: this.$t('common:button:email'),
type: 'primary',
emitKey: 'sendCb',
show: 'IsFirstAdd',
},
// { // {
// name: this.$t('common:button:delete'), // name: this.$t('common:button:delete'),
// type: 'danger', // type: 'danger',
@ -326,6 +376,13 @@ export default {
width: '400px', width: '400px',
placeholder: '', placeholder: '',
}, },
{
type: 'Daterange',
label: this.$t('system:userlist:label:LastChangePassWordTime'),
prop: 'LastChangePassWordTimeArr',
width: '400px',
placeholder: '',
},
{ {
type: 'Daterange', type: 'Daterange',
label: this.$t('system:userlist:label:CreateTime'), label: this.$t('system:userlist:label:CreateTime'),
@ -335,15 +392,17 @@ export default {
}, },
], ],
searchHandle: [ searchHandle: [
{
label: this.$t('common:button:reset'),
type: 'primary',
emitKey: 'reset',
},
{ {
label: this.$t('common:button:search'), label: this.$t('common:button:search'),
type: 'primary', type: 'primary',
emitKey: 'search', emitKey: 'search',
icon: 'el-icon-search'
},
{
label: this.$t('common:button:reset'),
type: 'primary',
emitKey: 'reset',
icon: 'el-icon-refresh-left'
}, },
{ {
label: this.$t('common:button:new'), label: this.$t('common:button:new'),
@ -365,6 +424,31 @@ export default {
diffTime(time) { diffTime(time) {
return moment(new Date()).diff(time, 'days') return moment(new Date()).diff(time, 'days')
}, },
async addNewUserSendEmail(row) {
try {
let confirm = await this.$confirm(
this.$t('system:userlist:confirm:sendEmail')
)
if (!confirm) return false
let data = {
IdentityUserId: row.Id,
BaseUrl: `${location.protocol}//${location.host}/login`,
RouteUrl: `${location.protocol}//${location.host}/email-recompose`,
}
this.loading = true
let res = await addNewUserSendEmail(data)
this.loading = false
if (res.IsSuccess) {
this.$message.success(
this.$t('system:userlist:message:sendEmailSuccess')
)
this.getList()
}
} catch (err) {
this.loading = false
console.log(err)
}
},
// //
getList() { getList() {
this.loading = true this.loading = true
@ -430,6 +514,12 @@ export default {
this.searchData.BeginLastLoginTime = this.searchData.LastLoginTimeArr[0] this.searchData.BeginLastLoginTime = this.searchData.LastLoginTimeArr[0]
this.searchData.EndLastLoginTime = this.searchData.LastLoginTimeArr[1] 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() this.getList()
}, },
}, },

View File

@ -71,6 +71,8 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.notice-marquee_wrapper{ .notice-marquee_wrapper{
width: 100%; width: 100%;
display: flex;
align-items: center;
/deep/ .el-dialog__header{ /deep/ .el-dialog__header{
padding: 10px; padding: 10px;
} }

View File

@ -44,7 +44,6 @@ export default {
this.$i18n.locale = lang this.$i18n.locale = lang
this.setLanguage(lang) this.setLanguage(lang)
this.$updateDictionary() this.$updateDictionary()
console.log(Vue)
this.$upload() this.$upload()
window.location.reload() window.location.reload()
} }

View File

@ -11,7 +11,7 @@
<img v-else src="@/assets/zzlogo4.png" alt="" /> <img v-else src="@/assets/zzlogo4.png" alt="" />
<span style="white-space: nowrap" v-if="NODE_ENV !== 'usa'"> <span style="white-space: nowrap" v-if="NODE_ENV !== 'usa'">
<!-- 中心影像系统EICS --> <!-- 中心影像系统EICS -->
{{ $t("trials:trials:title:eics") }} {{ $t('trials:trials:title:eics') }}
</span> </span>
</div> </div>
<div class="center-menu"> <div class="center-menu">
@ -39,13 +39,17 @@
> >
<i class="el-icon-odometer" /> <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>
<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" /> <i class="el-icon-box" />
<!-- 我的项目 --> <!-- 我的项目 -->
<span slot="title"> <span slot="title">
{{ $t("trials:tab:trials") }} {{ $t('trials:tab:trials') }}
</span> </span>
</el-menu-item> </el-menu-item>
<el-menu-item <el-menu-item
@ -63,7 +67,7 @@
> >
<i class="el-icon-chat-dot-square" /> <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-menu-item>
<el-submenu index="4" class="my_info"> <el-submenu index="4" class="my_info">
@ -75,128 +79,230 @@
</span> </span>
<!-- 账户信息 --> <!-- 账户信息 -->
<el-menu-item v-if="!hasPermi(['role:air'])" index="4-2">{{ <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>
<!-- 管理后台 --> <!-- 管理后台 -->
<el-menu-item <el-menu-item
v-if="hasPermi(['role:dev', 'role:oa', 'role:admin'])" v-if="hasPermi(['role:dev', 'role:oa', 'role:admin'])"
index="4-4" 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">{{ <el-menu-item index="4-3">{{
$t("trials:trials-myinfo:button:loginout") $t('trials:trials-myinfo:button:loginout')
}}</el-menu-item> }}</el-menu-item>
</el-submenu> </el-submenu>
</el-menu> </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> </div>
<toggleRole
v-if="toggleRoleVisible"
:visible.sync="toggleRoleVisible"
:loading="toggleRoleLoading"
@save="loginByRole"
/>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters, mapMutations } from "vuex"; import { mapGetters, mapMutations } from 'vuex'
import TopLang from "./topLang"; import TopLang from './topLang'
import NoticeMarquee from "./noticeMarquee"; import NoticeMarquee from './noticeMarquee'
import { resetRouter } from '@/router'
import toggleRole from '@/components/toggleRole'
export default { export default {
components: { TopLang, NoticeMarquee }, components: { TopLang, NoticeMarquee, toggleRole },
data() { data() {
return { return {
activeIndex: "2", activeIndex: '2',
isReviewer: false, isReviewer: false,
userTypeShortName: zzSessionStorage.getItem("userTypeShortName"), // userTypeShortName: zzSessionStorage.getItem('userTypeShortName'),
notice: "", notice: '',
VUE_APP_OSS_CONFIG_REGION: process.env.VUE_APP_OSS_CONFIG_REGION, VUE_APP_OSS_CONFIG_REGION: process.env.VUE_APP_OSS_CONFIG_REGION,
NODE_ENV: process.env.NODE_ENV, NODE_ENV: process.env.NODE_ENV,
}; toggleRoleVisible: false,
toggleRoleLoading: false,
}
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
"sidebar", 'sidebar',
"name", 'name',
"userName", 'userName',
"device", 'device',
"TotalNeedSignSystemDocCount", 'TotalNeedSignSystemDocCount',
"language", 'language',
'userTypeShortName',
]), ]),
roles() {
return this.$store.state.user.roles
},
hasRole() {
return (
this.roles &&
this.roles.length > 1 &&
this.roles.filter((item) => !item.IsUserRoleDisabled).length > 1
)
},
}, },
watch: { watch: {
$route(v) { $route(v) {
this.changeRoute(v); this.changeRoute(v)
}, },
}, },
created() { created() {
console.log(!this.hasPermi(["role:air"])); // this.isReviewer = JSON.parse(zzSessionStorage.getItem('IsReviewer'))
this.isReviewer = JSON.parse(zzSessionStorage.getItem("IsReviewer")); this.changeRoute(this.$route)
this.changeRoute(this.$route);
}, },
methods: { methods: {
...mapMutations({ setLanguage: "lang/setLanguage" }), ...mapMutations({ setLanguage: 'lang/setLanguage' }),
changeRoute(v) { changeRoute(v) {
if (v.path === "/trials/trials-workbench") { if (v.path === '/trials/trials-workbench') {
this.activeIndex = "1"; this.activeIndex = '1'
} }
if ( if (
v.path === "/trials/trials-list" || v.path === '/trials/trials-list' ||
~v.path.indexOf("/trials/trials-panel") ~v.path.indexOf('/trials/trials-panel')
) { ) {
this.activeIndex = "2"; this.activeIndex = '2'
} }
if (v.path === "/trials/trials-notice") { if (v.path === '/trials/trials-notice') {
this.activeIndex = "3"; this.activeIndex = '3'
} }
if (v.path === "/trials/trials-myinfo") { if (v.path === '/trials/trials-myinfo') {
this.activeIndex = "4-2"; this.activeIndex = '4-2'
} }
}, },
handleSelect(key, keyPath) { handleSelect(key, keyPath) {
switch (key) { switch (key) {
case "4-2": case '4-2':
this.go("/trials/trials-myinfo"); this.go('/trials/trials-myinfo')
break; break
case "4-3": case '4-3':
this.logout(); this.logout()
break; break
case "4-4": case '4-4':
this.go("/dashboard/list"); this.go('/dashboard/list')
break; break
case "1": case '4-5':
this.go("/trials/trials-workbench"); // this.go('/dashboard/list')
break; // console.log('')
case "2": this.$store.dispatch('user/getUserInfo').then((res) => {
if (~this.$route.path.indexOf("/trials/trials-panel")) { this.toggleRoleVisible = true
return; })
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) { if (lastWorkbench) {
this.go(lastWorkbench); this.go(lastWorkbench)
} else { } else {
this.go("/trials/trials-list"); this.go('/trials/trials-list')
} }
break; break
case "3": case '3':
this.go("/trials/trials-notice"); this.go('/trials/trials-notice')
break; break
} }
}, },
toggleSideBar() { toggleSideBar() {
this.$store.dispatch("app/toggleSideBar"); this.$store.dispatch('app/toggleSideBar')
}, },
async logout() { async logout() {
await this.$store.dispatch("user/logout"); await this.$store.dispatch('user/logout')
this.$router.push(`/login`); this.$router.push(`/login`)
this.$i18n.locale = "zh"; //this.$i18n.locale = 'zh'
this.setLanguage("zh"); //this.setLanguage('zh')
this.$updateDictionary(); this.$updateDictionary()
}, },
go(value) { go(value) {
this.$router.push({ path: value }); this.$router.push({ path: value })
}, },
account() { 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -277,6 +383,11 @@ export default {
cursor: pointer; cursor: pointer;
} }
} }
.right-menu {
.el-menu-item.is-active {
font-weight: bolder;
}
}
.center-menu { .center-menu {
width: calc(100% - 1200px); width: calc(100% - 1200px);
} }

View File

@ -788,6 +788,11 @@ export default {
created() { created() {
this.initPage() this.initPage()
}, },
mounted(){
this.$EventBus.$on("reload", (data) => {
window.location.reload()
});
},
methods: { methods: {
initPage() { initPage() {
this.getList() this.getList()

View File

@ -108,6 +108,35 @@
{{ $t('trials:trials-myinfo:button:update') }} {{ $t('trials:trials-myinfo:button:update') }}
</el-button> </el-button>
</el-form-item> </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> </el-form>
</div> </div>
<password /> <password />
@ -142,6 +171,8 @@ export default {
data() { data() {
return { return {
userForm: {}, userForm: {},
userRoleId: null,
toggleRoleLoading: false,
sendDisabled: true, sendDisabled: true,
sendTitle: this.$t('trials:trials-myinfo:button:getVCode'), sendTitle: this.$t('trials:trials-myinfo:button:getVCode'),
rule: { 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: { 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() {
setNewEmail(this.userForm.EMail, this.userForm.VerificationCode).then( setNewEmail(this.userForm.EMail, this.userForm.VerificationCode).then(
() => { () => {
@ -271,10 +333,18 @@ export default {
} else { } else {
this.$router.push(`/login`) this.$router.push(`/login`)
} }
this.$i18n.locale = 'zh' //this.$i18n.locale = 'zh'
this.setLanguage('zh') //this.setLanguage('zh')
this.$updateDictionary() this.$updateDictionary()
}, },
}, },
} }
</script> </script>
<style lang="scss" scoped>
.el-radio-group {
margin-top: 12px;
}
.el-radio {
width: 60px;
}
</style>

View File

@ -37,7 +37,7 @@
:IsCanConnectInternet="IsCanConnectInternet" :IsCanConnectInternet="IsCanConnectInternet"
v-if="activeIndex === '2'" v-if="activeIndex === '2'"
/> />
<login-log v-if="activeIndex === '3'" :id="userId" :isMine="true" /> <login-log v-if="activeIndex === '3'" :id="identityUserId" :isMine="true" />
</div> </div>
</div> </div>
</template> </template>
@ -64,7 +64,7 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters(['userId', 'userName']), ...mapGetters(['identityUserId', 'userName']),
}, },
mounted() { mounted() {
this.getUserInfo() this.getUserInfo()
@ -107,11 +107,11 @@ export default {
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.07)', background: 'rgba(0, 0, 0, 0.07)',
}) })
getUser(this.userId) getUser()
.then(async (res) => { .then(async (res) => {
this.user = res.Result this.user = res.Result
/* eslint-disable */ /* eslint-disable */
zzSessionStorage.setItem('realName', this.user.RealName) zzSessionStorage.setItem('Name', this.user.FullName)
await store.dispatch('user/updateInfo') await store.dispatch('user/updateInfo')
loading.close() loading.close()
}) })

View File

@ -82,7 +82,7 @@
</div> </div>
</template> </template>
<script> <script>
import { updateUser } from "@/api/admin.js"; import { updateUserBasicInfo } from "@/api/admin.js";
export default { export default {
name: "mine", name: "mine",
props: { props: {
@ -179,7 +179,7 @@ export default {
// this.user.OrganizationName = 'ZhiZhun' // this.user.OrganizationName = 'ZhiZhun'
// } // }
if (this.user.Id) { if (this.user.Id) {
updateUser(this.user) updateUserBasicInfo(this.user)
.then((res) => { .then((res) => {
this.isDisabled = false; this.isDisabled = false;
this.$message.success( this.$message.success(

View File

@ -27,6 +27,7 @@
<!-- 新密码 --> <!-- 新密码 -->
<el-form-item <el-form-item
:label="$t('recompose:form:newPassword')" :label="$t('recompose:form:newPassword')"
class="my_new_pwd"
prop="NewPassWord" prop="NewPassWord"
> >
<el-input <el-input
@ -151,15 +152,15 @@ export default {
} else { } else {
this.$router.push(`/login`) this.$router.push(`/login`)
} }
this.$i18n.locale = 'zh' //this.$i18n.locale = 'zh'
this.setLanguage('zh') //this.setLanguage('zh')
this.$updateDictionary() this.$updateDictionary()
}, },
}, },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-form-item { ::v-deep .is-error.my_new_pwd {
margin-bottom: 30px; margin-bottom: 45px;
} }
</style> </style>

View File

@ -17,7 +17,7 @@
<el-form-item :label="$t('trials:notice:table:notificationContent')"> <el-form-item :label="$t('trials:notice:table:notificationContent')">
<el-input <el-input
v-model="searchData.NoticeContent" v-model="searchData.NoticeContent"
style="width:100px;" style="width: 100px"
clearable clearable
/> />
</el-form-item> </el-form-item>
@ -36,7 +36,11 @@
<el-button type="primary" icon="el-icon-search" @click="handleSearch"> <el-button type="primary" icon="el-icon-search" @click="handleSearch">
{{ $t('common:button:search') }} {{ $t('common:button:search') }}
</el-button> </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') }} {{ $t('common:button:reset') }}
</el-button> </el-button>
</el-form-item> </el-form-item>
@ -44,7 +48,7 @@
</template> </template>
<template slot="main-container"> <template slot="main-container">
<el-table <el-table
v-adaptive="{bottomOffset:60}" v-adaptive="{ bottomOffset: 60 }"
v-loading="loading" v-loading="loading"
:data="list" :data="list"
stripe stripe
@ -79,7 +83,15 @@
sortable="custom" sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="scope.row.ActualNoticeStateEnum === 0 ? 'info' : scope.row.ActualNoticeStateEnum === 1 ? 'success' : 'error'"> <el-tag
:type="
scope.row.ActualNoticeStateEnum === 0
? 'info'
: scope.row.ActualNoticeStateEnum === 1
? 'success'
: 'error'
"
>
{{ $fd('NoticeState', scope.row.ActualNoticeStateEnum) }} {{ $fd('NoticeState', scope.row.ActualNoticeStateEnum) }}
</el-tag> </el-tag>
</template> </template>
@ -113,7 +125,12 @@
sortable="custom" sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<a :href="OSSclientConfig.basePath + scope.row.Path" target="_blank" style="color:#428bca">{{ scope.row.FileName }}</a> <a
:href="OSSclientConfig.basePath + scope.row.Path"
target="_blank"
style="color: #428bca"
>{{ scope.row.FileName }}</a
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -124,11 +141,19 @@
sortable="custom" sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.IsRead">{{ $fd('YesOrNo', scope.row.IsRead) }}</el-tag> <el-tag v-if="scope.row.IsRead">{{
<el-tag v-else type="danger">{{ $fd('YesOrNo', scope.row.IsRead) }}</el-tag> $fd('YesOrNo', scope.row.IsRead)
}}</el-tag>
<el-tag v-else type="danger">{{
$fd('YesOrNo', scope.row.IsRead)
}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('common:action:action')" min-width="100" fixed="right"> <el-table-column
:label="$t('common:action:action')"
min-width="100"
fixed="right"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
circle circle
@ -136,12 +161,17 @@
icon="el-icon-info" icon="el-icon-info"
@click="showDetail(scope.row)" @click="showDetail(scope.row)"
/> />
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination class="page" :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize" @pagination="getList" /> <pagination
class="page"
:total="total"
:page.sync="searchData.PageIndex"
:limit.sync="searchData.PageSize"
@pagination="getList"
/>
</template> </template>
</BaseContainer> </BaseContainer>
</template> </template>
@ -157,9 +187,10 @@ const searchDataDefault = () => {
ApplicableProjectEnum: null, ApplicableProjectEnum: null,
NoticeModeEnum: null, NoticeModeEnum: null,
NoticeStateEnum: null, NoticeStateEnum: null,
Asc: true, Asc: false,
SortField: 'PublishedTime',
PageIndex: 1, PageIndex: 1,
PageSize: 20 PageSize: 20,
} }
} }
export default { export default {
@ -171,7 +202,7 @@ export default {
searchData: searchDataDefault(), searchData: searchDataDefault(),
list: [], list: [],
total: 0, total: 0,
loading: false loading: false,
} }
}, },
mounted() { mounted() {
@ -180,17 +211,21 @@ export default {
methods: { methods: {
getList() { getList() {
this.loading = true this.loading = true
getUserSystemNoticeList(this.searchData).then(res => { getUserSystemNoticeList(this.searchData)
this.loading = false .then((res) => {
this.list = res.Result.CurrentPageData this.loading = false
this.total = res.Result.TotalCount this.list = res.Result.CurrentPageData
}).catch(() => { this.loading = false }) this.total = res.Result.TotalCount
})
.catch(() => {
this.loading = false
})
}, },
showDetail(row) { showDetail(row) {
var currentNoticeType = this.$fd('NoteType', row.NoticeTypeEnum) var currentNoticeType = this.$fd('NoteType', row.NoticeTypeEnum)
if (row.IsRead || row.ActualNoticeStateEnum !== 1) { if (row.IsRead || row.ActualNoticeStateEnum !== 1) {
this.$alert(row.NoticeContent, currentNoticeType, { this.$alert(row.NoticeContent, currentNoticeType, {
showConfirmButton: false showConfirmButton: false,
}) })
} else { } else {
const h = this.$createElement const h = this.$createElement
@ -200,18 +235,22 @@ export default {
beforeClose: (action, instance, done) => { beforeClose: (action, instance, done) => {
if (action === 'confirm') { if (action === 'confirm') {
instance.confirmButtonLoading = true instance.confirmButtonLoading = true
setSystemNoticeHaveRead(row.Id).then(async res => { setSystemNoticeHaveRead(row.Id)
if (res.IsSuccess) { .then(async (res) => {
await this.$store.dispatch('global/getNoticeList') if (res.IsSuccess) {
this.getList() await this.$store.dispatch('global/getNoticeList')
} this.getList()
instance.confirmButtonLoading = false }
done() instance.confirmButtonLoading = false
}).catch(() => { instance.confirmButtonLoading = false }) done()
})
.catch(() => {
instance.confirmButtonLoading = false
})
} else { } else {
done() done()
} }
} },
}) })
} }
}, },
@ -237,10 +276,9 @@ export default {
this.searchData.SortField = column.prop this.searchData.SortField = column.prop
this.searchData.PageIndex = 1 this.searchData.PageIndex = 1
this.getList() this.getList()
} },
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>

View File

@ -5,7 +5,11 @@
<el-form :inline="true"> <el-form :inline="true">
<!-- 文件类型 --> <!-- 文件类型 -->
<el-form-item :label="$t('trials:signRecords:table:fileType')"> <el-form-item :label="$t('trials:signRecords:table:fileType')">
<el-select v-model="searchData.FileTypeId" clearable style="width: 150px"> <el-select
v-model="searchData.FileTypeId"
clearable
style="width: 150px"
>
<el-option <el-option
v-for="item of typeOptions" v-for="item of typeOptions"
:key="item.FileTypeId" :key="item.FileTypeId"
@ -72,7 +76,7 @@
style="width: 120px" style="width: 120px"
> >
<el-option <el-option
v-for="i of $d.YesOrNo" v-for="i of $d.TrainingStatusEnum"
:key="'IsConfirmed' + i.label" :key="'IsConfirmed' + i.label"
:value="i.value" :value="i.value"
:label="i.label" :label="i.label"
@ -86,7 +90,7 @@
style="width: 120px" style="width: 120px"
> >
<el-option <el-option
v-for="i of $d.YesOrNo" v-for="i of $d.TrainingStatus"
:key="'IsDeleted' + i.label" :key="'IsDeleted' + i.label"
:value="i.value" :value="i.value"
:label="i.label" :label="i.label"
@ -96,7 +100,7 @@
<el-form-item> <el-form-item>
<!-- 查询 --> <!-- 查询 -->
<el-button icon="el-icon-search" type="primary" @click="handleSearch"> <el-button icon="el-icon-search" type="primary" @click="handleSearch">
{{ $t("common:button:search") }} {{ $t('common:button:search') }}
</el-button> </el-button>
<!-- 重置 --> <!-- 重置 -->
<el-button <el-button
@ -104,7 +108,7 @@
type="primary" type="primary"
@click="handleReset" @click="handleReset"
> >
{{ $t("common:button:reset") }} {{ $t('common:button:reset') }}
</el-button> </el-button>
<!-- 导出 --> <!-- 导出 -->
<el-button <el-button
@ -113,7 +117,7 @@
:loading="exportLoading" :loading="exportLoading"
@click="handleExport" @click="handleExport"
> >
{{ $t("common:button:export") }} {{ $t('common:button:export') }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -156,10 +160,10 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.IsSystemDoc" type="primary">{{ <el-tag v-if="scope.row.IsSystemDoc" type="primary">{{
$fd("IsSystemDoc", scope.row.IsSystemDoc) $fd('IsSystemDoc', scope.row.IsSystemDoc)
}}</el-tag> }}</el-tag>
<el-tag v-else type="warning">{{ <el-tag v-else type="warning">{{
$fd("IsSystemDoc", scope.row.IsSystemDoc) $fd('IsSystemDoc', scope.row.IsSystemDoc)
}}</el-tag> }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -172,10 +176,10 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.IsDeleted" type="danger">{{ <el-tag v-if="scope.row.IsDeleted" type="danger">{{
$fd("YesOrNo", scope.row.IsDeleted) $fd('TrainingStatus', scope.row.IsDeleted)
}}</el-tag> }}</el-tag>
<el-tag v-else type="primary">{{ <el-tag v-else type="primary">{{
$fd("YesOrNo", scope.row.IsDeleted) $fd('TrainingStatus', scope.row.IsDeleted)
}}</el-tag> }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -195,11 +199,11 @@
sortable="custom" sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="!scope.row.IsConfirmed" type="primary">{{ <el-tag v-if="scope.row.IsConfirmed" type="primary">{{
$fd("YesOrNo", scope.row.IsConfirmed) $fd('TrainingStatusEnum', scope.row.IsConfirmed)
}}</el-tag> }}</el-tag>
<el-tag v-else type="danger">{{ <el-tag v-else type="danger">{{
$fd("YesOrNo", scope.row.IsConfirmed) $fd('TrainingStatusEnum', scope.row.IsConfirmed)
}}</el-tag> }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -219,11 +223,19 @@
/> />
<!-- 用户类型 --> <!-- 用户类型 -->
<el-table-column <el-table-column
prop="UserTypeShortName" prop="UserConfirmedUserTypeList"
:label="$t('trials:signRecords:table:userType')" :label="$t('trials:signRecords:table:userType')"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" >
/> <template slot-scope="scope">
<span>{{
Array.isArray(scope.row.UserConfirmedUserTypeList) &&
scope.row.UserConfirmedUserTypeList.length > 0
? scope.row.UserConfirmedUserTypeList.join(', ')
: ''
}}</span>
</template>
</el-table-column>
<!-- 签署时间 --> <!-- 签署时间 -->
<el-table-column <el-table-column
prop="ConfirmTime" prop="ConfirmTime"
@ -283,25 +295,25 @@ import {
getTrialUserSelect, getTrialUserSelect,
getTrialUserTypeList, getTrialUserTypeList,
getTrialDocAndSystemDocType, getTrialDocAndSystemDocType,
} from "@/api/trials"; } from '@/api/trials'
import { pMTrainingRecordList_Export } from "@/api/export"; import { pMTrainingRecordList_Export } from '@/api/export'
import BaseContainer from "@/components/BaseContainer"; import BaseContainer from '@/components/BaseContainer'
import Pagination from "@/components/Pagination"; import Pagination from '@/components/Pagination'
import PreviewFile from "@/components/PreviewFile/index"; import PreviewFile from '@/components/PreviewFile/index'
const searchDataDefault = () => { const searchDataDefault = () => {
return { return {
FileTypeId: "", FileTypeId: '',
Name: "", Name: '',
UserId: "", UserId: '',
UserTypeId: "", UserTypeId: '',
PageIndex: 1, PageIndex: 1,
PageSize: 20, PageSize: 20,
IsConfirmed: null, IsConfirmed: null,
IsDeleted: null, IsDeleted: null,
}; }
}; }
export default { export default {
name: "AttachmentsManagement", name: 'AttachmentsManagement',
components: { BaseContainer, Pagination, PreviewFile }, components: { BaseContainer, Pagination, PreviewFile },
data() { data() {
return { return {
@ -310,99 +322,99 @@ export default {
list: [], list: [],
total: 0, total: 0,
currentRow: {}, currentRow: {},
currentPath: "", currentPath: '',
currentType: "", currentType: '',
previewVisible: false, previewVisible: false,
userOptions: [], userOptions: [],
userTypeOptions: [], userTypeOptions: [],
currentUser: zzSessionStorage.getItem("userName"), currentUser: zzSessionStorage.getItem('userName'),
typeOptions: [], typeOptions: [],
trialId: this.$route.query.trialId, trialId: this.$route.query.trialId,
exportLoading: false, exportLoading: false,
}; }
}, },
mounted() { mounted() {
this.getTypeOptions(); this.getTypeOptions()
this.getUserSelect(); this.getUserSelect()
this.getUserType(); this.getUserType()
this.getList(); this.getList()
}, },
methods: { methods: {
handleExport() { handleExport() {
this.exportLoading = true; this.exportLoading = true
pMTrainingRecordList_Export(this.searchData) pMTrainingRecordList_Export(this.searchData)
.then(() => { .then(() => {
this.exportLoading = false; this.exportLoading = false
}) })
.catch((err) => { .catch((err) => {
this.exportLoading = false; this.exportLoading = false
}); })
}, },
// //
getList() { getList() {
this.loading = true; this.loading = true
this.searchData.TrialId = this.trialId; this.searchData.TrialId = this.trialId
getDocumentConfirmList(this.searchData) getDocumentConfirmList(this.searchData)
.then(async (res) => { .then(async (res) => {
this.loading = false; this.loading = false
this.list = res.Result.CurrentPageData; this.list = res.Result.CurrentPageData
this.total = res.Result.TotalCount; this.total = res.Result.TotalCount
console.log(this.total); console.log(this.total)
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false
}); })
}, },
// //
getTypeOptions() { getTypeOptions() {
getTrialDocAndSystemDocType(this.trialId).then((res) => { getTrialDocAndSystemDocType(this.trialId).then((res) => {
this.typeOptions = res.Result; this.typeOptions = res.Result
}); })
}, },
// //
getUserSelect() { getUserSelect() {
getTrialUserSelect(this.trialId).then((res) => { getTrialUserSelect(this.trialId).then((res) => {
this.userOptions = res.Result; this.userOptions = res.Result
}); })
}, },
// //
getUserType() { getUserType() {
getTrialUserTypeList().then((res) => { getTrialUserTypeList().then((res) => {
this.userTypeOptions = res.Result; this.userTypeOptions = res.Result
}); })
}, },
// //
handlePreview(row) { handlePreview(row) {
this.currentRow = { ...row }; this.currentRow = { ...row }
const { Name, FullFilePath } = row; const { Name, FullFilePath } = row
this.currentPath = FullFilePath; this.currentPath = FullFilePath
this.currentType = row.Name this.currentType = row.Name
? Name.substring(Name.lastIndexOf(".") + 1).toLocaleLowerCase() ? Name.substring(Name.lastIndexOf('.') + 1).toLocaleLowerCase()
: ""; : ''
this.previewVisible = true; this.previewVisible = true
}, },
// //
handleReset() { handleReset() {
this.searchData = searchDataDefault(); this.searchData = searchDataDefault()
this.getList(); this.getList()
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.AttachmentsManagement.clearSort(); this.$refs.AttachmentsManagement.clearSort()
}); })
}, },
// //
handleSearch() { handleSearch() {
this.getList(); this.getList()
}, },
// //
handleSortByColumn(column) { handleSortByColumn(column) {
if (column.order === "ascending") { if (column.order === 'ascending') {
this.searchData.Asc = true; this.searchData.Asc = true
} else { } else {
this.searchData.Asc = false; this.searchData.Asc = false
} }
this.searchData.SortField = column.prop; this.searchData.SortField = column.prop
this.getList(); this.getList()
}, },
}, },
}; }
</script> </script>

View File

@ -1,14 +1,14 @@
<template> <template>
<BaseContainer> <BaseContainer>
<template slot="search-container"> <template slot="search-container">
<div style="margin-left:auto;"> <div style="margin-left: auto">
<!-- Approve --> <!-- Approve -->
</div> </div>
</template> </template>
<template slot="main-container"> <template slot="main-container">
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
v-adaptive="{bottomOffset:65}" v-adaptive="{ bottomOffset: 65 }"
height="100" height="100"
:data="list" :data="list"
class="table" class="table"
@ -27,17 +27,26 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button type="text" @click="go(`/trialsResume?doctorId=${scope.row.Id}&token=${token}`)">{{ scope.row.LastName }} / {{ scope.row.FirstName }}</el-button> --> <!-- <el-button type="text" @click="go(`/trialsResume?doctorId=${scope.row.Id}&token=${token}`)">{{ scope.row.LastName }} / {{ scope.row.FirstName }}</el-button> -->
<span style="color: #428bca;cursor: pointer;" @click="go(`/trialsResume?doctorId=${scope.row.Id}&trialId=${$route.query.trialId}&token=${token}`)">{{ scope.row.LastName }} / {{ scope.row.FirstName }}</span> <span
style="color: #428bca; cursor: pointer"
@click="
go(
`/trialsResume?doctorId=${scope.row.Id}&trialId=${$route.query.trialId}&token=${token}`
)
"
>{{ scope.row.LastName }} / {{ scope.row.FirstName }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<!-- Name CN --> <!-- Name CN -->
<!-- <el-table-column <el-table-column
v-if="!isEN"
prop="ChineseName" prop="ChineseName"
:label="$t('trials:seletctedReviews:table:nameCN')" :label="$t('trials:seletctedReviews:table:nameCN')"
show-overflow-tooltip show-overflow-tooltip
min-width="120" min-width="120"
sortable="custom" sortable="custom"
/> --> />
<!-- ID --> <!-- ID -->
<el-table-column <el-table-column
prop="Code" prop="Code"
@ -53,8 +62,12 @@
min-width="120" min-width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.DoctorTrialState !== 5" type="primary">{{ $fd('DoctorTrialState', scope.row.DoctorTrialState) }}</el-tag> <el-tag v-if="scope.row.DoctorTrialState !== 5" type="primary">{{
<el-tag v-else type="danger">{{ $fd('DoctorTrialState', scope.row.DoctorTrialState) }}</el-tag> $fd('DoctorTrialState', scope.row.DoctorTrialState)
}}</el-tag>
<el-tag v-else type="danger">{{
$fd('DoctorTrialState', scope.row.DoctorTrialState)
}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<!-- Approver --> <!-- Approver -->
@ -70,19 +83,34 @@
min-width="150" min-width="150"
/> />
</el-table> </el-table>
<pagination class="page" :total="total" :page.sync="listQuery.PageIndex" :limit.sync="listQuery.PageSize" @pagination="getList" /> <pagination
class="page"
:total="total"
:page.sync="listQuery.PageIndex"
:limit.sync="listQuery.PageSize"
@pagination="getList"
/>
</template> </template>
</BaseContainer> </BaseContainer>
</template> </template>
<script> <script>
import BaseContainer from '@/components/BaseContainer' import BaseContainer from '@/components/BaseContainer'
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import { getSubmissionOrApprovalReviewerList, approveReviewer } from '@/api/trials' import {
getSubmissionOrApprovalReviewerList,
approveReviewer,
} from '@/api/trials'
import store from '@/store' import store from '@/store'
const enrollState = 4 const enrollState = 4
export default { export default {
name: 'Approval', name: 'Approval',
components: { BaseContainer, Pagination }, components: { BaseContainer, Pagination },
props: {
isEN: {
type: Boolean,
default: false,
},
},
data() { data() {
return { return {
list: [], list: [],
@ -93,15 +121,17 @@ export default {
PageIndex: 1, PageIndex: 1,
PageSize: 20, PageSize: 20,
Asc: false, Asc: false,
SortField: '' SortField: '',
}, },
total: 0, total: 0,
listLoading: false, listLoading: false,
approveIdArr: [], approveIdArr: [],
token: store.getters.token token: store.getters.token,
} }
}, },
created() { this.initPage() }, created() {
this.initPage()
},
methods: { methods: {
go(path) { go(path) {
window.open(path) window.open(path)
@ -112,28 +142,36 @@ export default {
getList() { getList() {
this.listLoading = true this.listLoading = true
this.listQuery.TrialId = this.$route.query.trialId this.listQuery.TrialId = this.$route.query.trialId
getSubmissionOrApprovalReviewerList(this.listQuery).then(res => { getSubmissionOrApprovalReviewerList(this.listQuery)
this.listLoading = false .then((res) => {
this.list = res.Result.CurrentPageData this.listLoading = false
this.total = res.Result.TotalCount this.list = res.Result.CurrentPageData
// eslint-disable-next-line handle-callback-err this.total = res.Result.TotalCount
}).catch(() => { this.listLoading = false }) // eslint-disable-next-line handle-callback-err
})
.catch(() => {
this.listLoading = false
})
}, },
handleApprove() { handleApprove() {
// Confirm the approval? // Confirm the approval?
this.$confirm(this.$t('trials:seletctedReviews:message:msg2'), { this.$confirm(this.$t('trials:seletctedReviews:message:msg2'), {
type: 'warning' type: 'warning',
}).then(() => { }).then(() => {
this.loading = true this.loading = true
const trialId = this.$route.query.trialId const trialId = this.$route.query.trialId
approveReviewer(trialId, this.approveIdArr, 1).then(res => { approveReviewer(trialId, this.approveIdArr, 1)
this.loading = false .then((res) => {
if (res.IsSuccess) { this.loading = false
this.getList() if (res.IsSuccess) {
this.$message.success(this.$t('common:message:savedSuccessfully')) this.getList()
this.$emit('nextStep', 'confirmation') this.$message.success(this.$t('common:message:savedSuccessfully'))
} this.$emit('nextStep', 'confirmation')
}).catch(() => {this.loading = false}) }
})
.catch(() => {
this.loading = false
})
}) })
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
@ -158,12 +196,16 @@ export default {
return 'selected' return 'selected'
} }
}, },
handleSelectTable(row) { return row.DoctorTrialState !== 8 }, handleSelectTable(row) {
return row.DoctorTrialState !== 8
},
handleDetail(row) { handleDetail(row) {
const { href } = this.$router.resolve({ path: `/trialsResume?doctorId=${row.Id}&trialId=${this.$route.query.trialId}` }) const { href } = this.$router.resolve({
path: `/trialsResume?doctorId=${row.Id}&trialId=${this.$route.query.trialId}`,
})
window.open(href, '_blank') window.open(href, '_blank')
} },
} },
} }
</script> </script>

View File

@ -50,13 +50,14 @@
</template> </template>
</el-table-column> </el-table-column>
<!-- Name CN --> <!-- Name CN -->
<!-- <el-table-column <el-table-column
v-if="!isEN"
prop="ChineseName" prop="ChineseName"
:label="$t('trials:seletctedReviews:table:nameCN')" :label="$t('trials:seletctedReviews:table:nameCN')"
show-overflow-tooltip show-overflow-tooltip
min-width="120" min-width="120"
sortable="custom" sortable="custom"
/> --> />
<!-- ID --> <!-- ID -->
<el-table-column <el-table-column
prop="Code" prop="Code"
@ -119,6 +120,12 @@ import store from '@/store'
export default { export default {
name: 'Confirmation', name: 'Confirmation',
components: { BaseContainer, Pagination }, components: { BaseContainer, Pagination },
props: {
isEN: {
type: Boolean,
default: false,
},
},
data() { data() {
return { return {
list: [], list: [],

View File

@ -186,13 +186,14 @@
</template> </template>
</el-table-column> </el-table-column>
<!-- Name CN --> <!-- Name CN -->
<!-- <el-table-column <el-table-column
v-if="!isEN"
prop="ChineseName" prop="ChineseName"
:label="$t('trials:seletctedReviews:table:nameCN')" :label="$t('trials:seletctedReviews:table:nameCN')"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
width="120" width="120"
/> --> />
<el-table-column <el-table-column
prop="DoctorUserName" prop="DoctorUserName"
@ -483,6 +484,12 @@ export default {
curriculumVitae, curriculumVitae,
}, },
dicts: ['ReadingType', 'Subspeciality', 'Position', 'Rank'], dicts: ['ReadingType', 'Subspeciality', 'Position', 'Rank'],
props: {
isEN: {
type: Boolean,
default: false,
},
},
data() { data() {
return { return {
list: [], list: [],

View File

@ -60,13 +60,14 @@
</template> </template>
</el-table-column> </el-table-column>
<!-- Name CN --> <!-- Name CN -->
<!-- <el-table-column <el-table-column
v-if="!isEN"
prop="ChineseName" prop="ChineseName"
:label="$t('trials:seletctedReviews:table:nameCN')" :label="$t('trials:seletctedReviews:table:nameCN')"
show-overflow-tooltip show-overflow-tooltip
sortable="custom" sortable="custom"
min-width="120" min-width="120"
/> --> />
<!-- ID --> <!-- ID -->
<el-table-column <el-table-column
prop="Code" prop="Code"
@ -166,6 +167,12 @@ const enrollState = 1
export default { export default {
name: 'Submission', name: 'Submission',
components: { BaseContainer, Pagination }, components: { BaseContainer, Pagination },
props: {
isEN: {
type: Boolean,
default: false,
},
},
data() { data() {
return { return {
list: [], list: [],

View File

@ -8,50 +8,83 @@
<div v-if="trialInfo" class="trial-wrapper"> <div v-if="trialInfo" class="trial-wrapper">
<div class="div-row"> <div class="div-row">
<div class="div-col"> <div class="div-col">
<label class="el-label">{{ $t('trials:trials-list:form:indication:') }}</label> <label class="el-label">{{
<span>{{$fd('Indication', trialInfo.IndicationEnum)}}{{trialInfo.Indication ? '-' + trialInfo.Indication : '' }}</span> $t('trials:trials-list:form:indication:')
</div> }}</label>
<span
<div class="div-col"> >{{ $fd('Indication', trialInfo.IndicationEnum)
<label class="el-label">{{ $t('trials:trials-list:form:declarationType:') }}</label> }}{{
<el-tooltip trialInfo.Indication ? '-' + trialInfo.Indication : ''
class="item" }}</span
:content="trialInfo.DeclarationTypeEnumList.map(v => $fd('DeclarationType', v)).join(', ')"
placement="top"
> >
<span>{{ trialInfo.DeclarationTypeEnumList.map(v => $fd('DeclarationType', v)).join(', ') }}</span>
</el-tooltip>
</div>
<div class="div-col">
<label class="el-label">{{ $t('trials:trials-list:form:criterion:') }}</label>
<el-tooltip
class="item"
:content="(trialInfo.CriterionList && trialInfo.CriterionList.length>0)? trialInfo.CriterionList.join(', '): ''"
placement="top"
>
<span>{{ (trialInfo.CriterionList && trialInfo.CriterionList.length>0)? trialInfo.CriterionList.join(', '): '' }}</span>
</el-tooltip>
</div>
<div class="div-col">
</div> </div>
<div class="div-col">
<label class="el-label">{{
$t('trials:trials-list:form:declarationType:')
}}</label>
<el-tooltip
class="item"
:content="
trialInfo.DeclarationTypeEnumList.map((v) =>
$fd('DeclarationType', v)
).join(', ')
"
placement="top"
>
<span>{{
trialInfo.DeclarationTypeEnumList.map((v) =>
$fd('DeclarationType', v)
).join(', ')
}}</span>
</el-tooltip>
</div>
<div class="div-col">
<label class="el-label">{{
$t('trials:trials-list:form:criterion:')
}}</label>
<el-tooltip
class="item"
:content="
trialInfo.CriterionList && trialInfo.CriterionList.length > 0
? trialInfo.CriterionList.join(', ')
: ''
"
placement="top"
>
<span>{{
trialInfo.CriterionList && trialInfo.CriterionList.length > 0
? trialInfo.CriterionList.join(', ')
: ''
}}</span>
</el-tooltip>
</div>
<div class="div-col"></div>
</div> </div>
<div class="div-row"> <div class="div-row">
<div class="div-col"> <div class="div-col">
<label class="el-label">{{ $t('trials:trials-list:form:expedited:') }}</label> <label class="el-label">{{
<span>{{$fd('YesOrNoForInt', trialInfo.Expedited)}}</span> $t('trials:trials-list:form:expedited:')
}}</label>
<span>{{ $fd('YesOrNoForInt', trialInfo.Expedited) }}</span>
</div> </div>
<div class="div-col"> <div class="div-col">
<label class="el-label">{{ $t('trials:trials-list:form:totalReviewers:') }}</label> <label class="el-label">{{
$t('trials:trials-list:form:totalReviewers:')
}}</label>
<span>{{ trialInfo.TotalReviewers }}</span> <span>{{ trialInfo.TotalReviewers }}</span>
</div> </div>
<div class="div-col"> <div class="div-col">
<label class="el-label">{{ $t('trials:trials-list:form:typeofReviewers:') }}</label> <label class="el-label">{{
<span>{{ trialInfo.AttendedReviewerTypeEnumList.map(v => $fd('AttendedReviewerType', v)).join(', ') }}</span> $t('trials:trials-list:form:typeofReviewers:')
</div> }}</label>
<div class="div-col"> <span>{{
trialInfo.AttendedReviewerTypeEnumList.map((v) =>
$fd('AttendedReviewerType', v)
).join(', ')
}}</span>
</div> </div>
<div class="div-col"></div>
</div> </div>
</div> </div>
<div class="title"> <div class="title">
@ -60,7 +93,12 @@
</div> </div>
</div> </div>
<div class="step-wrapper"> <div class="step-wrapper">
<el-steps :active="activeStatus" style="margin-top: 70px" align-center :space="300"> <el-steps
:active="activeStatus"
style="margin-top: 70px"
align-center
:space="300"
>
<!-- Selection --> <!-- Selection -->
<el-step <el-step
:title="$t('trials:seletctedReviews:timeline:selection')" :title="$t('trials:seletctedReviews:timeline:selection')"
@ -92,22 +130,26 @@
</el-steps> </el-steps>
<div class="step-content"> <div class="step-content">
<Selection <Selection
v-if="activeStatus===0" v-if="activeStatus === 0"
:isEN="isEN"
@nextStep="nextStep" @nextStep="nextStep"
/> />
<Submission <Submission
v-if="activeStatus===1" v-if="activeStatus === 1"
ref="submission" ref="submission"
:isEN="isEN"
@nextStep="nextStep" @nextStep="nextStep"
/> />
<Approval <Approval
v-if="activeStatus===2" v-if="activeStatus === 2"
ref="approval" ref="approval"
:isEN="isEN"
@nextStep="nextStep" @nextStep="nextStep"
/> />
<Confirmation <Confirmation
v-if="activeStatus===3" v-if="activeStatus === 3"
ref="confirmation" ref="confirmation"
:isEN="isEN"
/> />
</div> </div>
</div> </div>
@ -127,18 +169,30 @@ export default {
trialInfo: null, trialInfo: null,
TrialId: '', TrialId: '',
activeStatus: null, activeStatus: null,
TrialMaxState: 0 TrialMaxState: 0,
} }
}, },
mounted() { mounted() {
this.TrialId = this.$route.query.trialId this.TrialId = this.$route.query.trialId
this.initPage() this.initPage()
}, },
computed: {
isEN() {
return this.$i18n.locale !== 'zh'
},
},
methods: { methods: {
initPage() { initPage() {
getTrialInfoAndMaxTrialState(this.TrialId).then(res => { getTrialInfoAndMaxTrialState(this.TrialId).then((res) => {
this.trialInfo = res.Result.TrialView this.trialInfo = res.Result.TrialView
var activeStatus = res.Result.TrialMaxState < 1 ? 0 : res.Result.TrialMaxState < 5 ? 1 : res.Result.TrialMaxState < 8 ? 2 : 3 var activeStatus =
res.Result.TrialMaxState < 1
? 0
: res.Result.TrialMaxState < 5
? 1
: res.Result.TrialMaxState < 8
? 2
: 3
this.activeStatus = activeStatus this.activeStatus = activeStatus
this.TrialMaxState = activeStatus this.TrialMaxState = activeStatus
}) })
@ -147,95 +201,93 @@ export default {
this.activeStatus = step this.activeStatus = step
}, },
nextStep(stepName) { nextStep(stepName) {
this.activeStatus = this.activeStatus === 3 ? 3 : this.activeStatus + 1; this.activeStatus = this.activeStatus === 3 ? 3 : this.activeStatus + 1
if(stepName==='confirmation'){ if (stepName === 'confirmation') {
this.activeStatus = 3; this.activeStatus = 3
} }
this.TrialMaxState = this.activeStatus this.TrialMaxState = this.activeStatus
this.$nextTick( this.$nextTick(
function() { function () {
this.$refs[stepName].getList() this.$refs[stepName].getList()
}.bind(this) }.bind(this)
) )
} },
},
}
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.enroll-container { .enroll-container {
height: 100%; height: 100%;
padding: 0; padding: 0;
margin: 0; margin: 0;
display: flex;
flex-direction: column;
background-color: #fff;
.content-wrapper {
height: 100px;
}
.step-wrapper {
flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-color: #fff; }
.content-wrapper{ .el-steps {
height: 100px; height: 80px;
}
.step-content {
flex: 1;
}
.title {
height: 40px;
line-height: 40px;
padding-left: 5px;
background: #e4ebf1;
border-left: 3px solid #0fc8e0;
font-size: 13px;
p {
padding: 0;
margin: 0;
} }
.step-wrapper{ }
flex: 1; .trial-wrapper {
height: 60px;
.div-row {
display: flex; display: flex;
flex-direction: column; justify-content: space-between;
} margin: 10px 20px !important;
.el-steps{
height: 80px;
}
.step-content{
flex: 1;
}
.title {
height: 40px;
line-height: 40px;
padding-left: 5px;
background: #e4ebf1;
border-left: 3px solid #0fc8e0;
font-size: 13px; font-size: 13px;
p{ .div-col {
padding: 0; flex: 1;
margin: 0; width: 100px;
} white-space: nowrap !important;
} text-overflow: ellipsis !important;
.trial-wrapper{ word-break: break-word !important;
height: 60px; overflow: hidden !important;
.div-row { label {
display: flex; font-weight: bold;
justify-content: space-between;
margin: 10px 20px !important;
font-size: 13px;
.div-col {
flex: 1;
width: 100px;
white-space: nowrap !important;
text-overflow: ellipsis !important;
word-break: break-word !important;
overflow: hidden !important;
label {
font-weight: bold;
}
}
.div-textarea {
display: inline-block;
} }
}
.div-textarea {
display: inline-block;
}
}
}
} .underline {
// .el-step__title {
// text-decoration: underline;
// }
.el-step__title,
.el-step__title.is-process,
.el-step__title.is-finish {
text-decoration: underline;
} }
}
.underline{ .noneUnderline {
// .el-step__title { .el-step__title {
// text-decoration: underline; text-decoration: none;
// }
.el-step__title,
.el-step__title.is-process,
.el-step__title.is-finish {
text-decoration: underline;
}
}
.noneUnderline{
.el-step__title {
text-decoration: none;
}
} }
}
.el-step__head.is-process, .el-step__head.is-process,
.el-step__title.is-process, .el-step__title.is-process,
.el-step__description.is-process { .el-step__description.is-process {
@ -261,5 +313,5 @@ export default {
.click_cursor { .click_cursor {
cursor: pointer; cursor: pointer;
} }
} }
</style> </style>

View File

@ -25,7 +25,7 @@
<!-- 是否签署 --> <!-- 是否签署 -->
<el-form-item :label="$t('trials:self-attachment:table:isSign')"> <el-form-item :label="$t('trials:self-attachment:table:isSign')">
<el-select v-model="searchData.IsSign" clearable style="width:120px;"> <el-select v-model="searchData.IsSign" clearable style="width:120px;">
<template v-for="item of $d.YesOrNo"> <template v-for="item of $d.TrainingStatusEnum">
<el-option v-if="item.raw.ValueCN !== ''" :label="item.label" :value="item.value" :key="item.id"/> <el-option v-if="item.raw.ValueCN !== ''" :label="item.label" :value="item.value" :key="item.id"/>
</template> </template>
</el-select> </el-select>
@ -77,8 +77,8 @@
sortable="custom" sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.IsDeleted" type="danger">{{ $fd('YesOrNo', 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('YesOrNo', scope.row.IsDeleted) }}</el-tag> <el-tag v-else type="primary">{{ $fd('TrainingStatus', scope.row.IsDeleted) }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<!-- 上传时间 --> <!-- 上传时间 -->
@ -96,8 +96,8 @@
sortable="custom" sortable="custom"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.IsConfirmed" type="primary">{{ $fd('YesOrNo', scope.row.IsConfirmed) }}</el-tag> <el-tag v-if="scope.row.IsConfirmed" type="primary">{{ $fd('TrainingStatusEnum', scope.row.IsConfirmed) }}</el-tag>
<el-tag v-else type="danger">{{ $fd('YesOrNo', scope.row.IsConfirmed) }}</el-tag> <el-tag v-else type="danger">{{ $fd('TrainingStatusEnum', scope.row.IsConfirmed) }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<!-- 签署时间 --> <!-- 签署时间 -->

View File

@ -270,7 +270,7 @@
v-hasPermi="[ v-hasPermi="[
'trials:trials-panel:attachments:site-research:auidt', 'trials:trials-panel:attachments:site-research:auidt',
]" ]"
:disabled="scope.row.State === 0 || scope.row.State === 3" :disabled="scope.row.State === 0 || scope.row.State === 3 || scope.row.IsDeleted"
circle circle
:title="$t('trials:researchRecord:action:view')" :title="$t('trials:researchRecord:action:view')"
icon="el-icon-s-check" icon="el-icon-s-check"
@ -332,13 +332,12 @@
<template slot="dialog-body"> <template slot="dialog-body">
<div style="width: 100%; display: flex"> <div style="width: 100%; display: flex">
<div class="shareLink"> <div class="shareLink">
<div> <!-- <div>
<i style="color: #428bca" class="el-icon-success" /> <i style="color: #428bca" class="el-icon-success" />
<!-- 成功创建调查表链接 -->
<span>{{ <span>{{
$t('trials:researchRecord:message:createLinkSuccessfully') $t('trials:researchRecord:message:createLinkSuccessfully')
}}</span> }}</span>
</div> </div> -->
<div style="margin: 10px 0"> <div style="margin: 10px 0">
<!-- 链接 --> <!-- 链接 -->
{{ $t('trials:researchRecord:label:link') }} {{ $t('trials:researchRecord:label:link') }}
@ -525,7 +524,7 @@ export default {
.getElementsByTagName('canvas') .getElementsByTagName('canvas')
let a = document.createElement('a') let a = document.createElement('a')
a.href = qrCodeCanvas[0].toDataURL('image/url') 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() a.click()
}, },
// //

View File

@ -307,23 +307,21 @@
</div> </div>
</el-upload> </el-upload>
</el-form-item> </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> </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>
<el-card <el-card

View File

@ -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 BidirectionalTool from '@/views/trials/trials-panel/reading/dicoms/tools/Bidirectional/BidirectionalTool'
import ArrowAnnotateTool from '@/views/trials/trials-panel/reading/dicoms/tools/ArrowAnnotate/ArrowAnnotateTool' 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 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 OrientationMarkersTool from '@/views/trials/trials-panel/reading/dicoms/tools/OrientationMarkers/OrientationMarkersTool'
import ScaleOverlayTool from '@/views/trials/trials-panel/reading/dicoms/tools/ScaleOverlay/ScaleOverlayTool' 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 getOrientationString from '@/views/trials/trials-panel/reading/dicoms/tools/OrientationMarkers/getOrientationString'
import invertOrientationString from '@/views/trials/trials-panel/reading/dicoms/tools/OrientationMarkers/invertOrientationString' 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 calculateLongestAndShortestDiameters from '@/views/trials/trials-panel/reading/dicoms/tools/Bidirectional/calculateLongestAndShortestDiameters'
import calculateSUV from '@/views/trials/trials-panel/reading/dicoms/tools/calculateSUV' import calculateSUV from '@/views/trials/trials-panel/reading/dicoms/tools/calculateSUV'
// import { ProbeTool } from '@cornerstonejs/tools'
cornerstoneTools.external.cornerstone = cornerstone cornerstoneTools.external.cornerstone = cornerstone
cornerstoneTools.external.Hammer = Hammer cornerstoneTools.external.Hammer = Hammer
cornerstoneTools.external.cornerstoneMath = cornerstoneMath cornerstoneTools.external.cornerstoneMath = cornerstoneMath
@ -799,8 +801,8 @@ export default {
measureData.ww = Math.round(viewport.voi.windowWidth) measureData.ww = Math.round(viewport.voi.windowWidth)
measureData.wc = Math.round(viewport.voi.windowCenter) measureData.wc = Math.round(viewport.voi.windowCenter)
var questionInfo = this.measureData[idx] var questionInfo = this.measureData[idx]
const canvas = this.canvas.querySelector('canvas') // const canvas = this.canvas.querySelector('canvas')
measureData.pictureBaseStr = canvas.toDataURL('image/png', 1) // measureData.pictureBaseStr = canvas.toDataURL('image/png', 1)
measureData.data.active = false measureData.data.active = false
this.$emit('modifyMeasureData', { measureData, questionInfo }) this.$emit('modifyMeasureData', { measureData, questionInfo })
// e.stopImmediatePropagation() // e.stopImmediatePropagation()
@ -1000,26 +1002,14 @@ export default {
if (i > -1) { if (i > -1) {
var idx = this.measureData.findIndex(item => item.MeasureData && item.MeasureData.data && item.MeasureData.data.uuid === toolState.data[i].uuid) var idx = this.measureData.findIndex(item => item.MeasureData && item.MeasureData.data && item.MeasureData.data.uuid === toolState.data[i].uuid)
if (idx > -1) { if (idx > -1) {
// console.log('mouseClick')
DicomEvent.$emit('setCollapseActive', this.measureData[idx]) DicomEvent.$emit('setCollapseActive', this.measureData[idx])
if (this.readingTaskState < 2) { if (this.readingTaskState < 2) {
const measureData = {} const measureData = {}
var markName = this.measureData[idx].OrderMarkName var markName = this.measureData[idx].OrderMarkName
if (this.disabledMarks.indexOf(markName) === -1 || !this.disabledMarks) { 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] var questionInfo = this.measureData[idx]
const canvas = this.canvas.querySelector('canvas') // const canvas = this.canvas.querySelector('canvas')
measureData.pictureBaseStr = canvas.toDataURL('image/png', 1) // measureData.pictureBaseStr = canvas.toDataURL('image/png', 1)
measureData.studyId = this.stack.studyId measureData.studyId = this.stack.studyId
measureData.seriesId = this.stack.seriesId measureData.seriesId = this.stack.seriesId
measureData.instanceId = instanceId measureData.instanceId = instanceId
@ -1031,6 +1021,10 @@ export default {
measureData.ww = Math.round(viewport.voi.windowWidth) measureData.ww = Math.round(viewport.voi.windowWidth)
measureData.wc = Math.round(viewport.voi.windowCenter) measureData.wc = Math.round(viewport.voi.windowCenter)
measureData.data.active = false measureData.data.active = false
var criterionType = parseInt(localStorage.getItem('CriterionType'))
if (criterionType === 21) {
measureData.tableQuestionId = this.measureData[idx].TableQuestionId
}
this.$emit('modifyMeasureData', { measureData, questionInfo }) this.$emit('modifyMeasureData', { measureData, questionInfo })
} }
} }
@ -1161,6 +1155,8 @@ export default {
cornerstoneTools.addToolForElement(element, ArrowAnnotateTool, { configuration: { allowEmptyLabel: true, handleRadius: false, drawHandlesOnHover: true, hideHandlesIfMoving: true }}) cornerstoneTools.addToolForElement(element, ArrowAnnotateTool, { configuration: { allowEmptyLabel: true, handleRadius: false, drawHandlesOnHover: true, hideHandlesIfMoving: true }})
} else if (toolName === 'RectangleRoi') { } else if (toolName === 'RectangleRoi') {
cornerstoneTools.addToolForElement(element, RectangleRoiTool, { configuration: { allowEmptyLabel: true, handleRadius: false, drawHandlesOnHover: true, hideHandlesIfMoving: true }}) 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 { } else {
cornerstoneTools.addToolForElement(element, apiTool) cornerstoneTools.addToolForElement(element, apiTool)
} }
@ -1351,8 +1347,8 @@ export default {
measureData.ww = Math.round(viewport.voi.windowWidth) measureData.ww = Math.round(viewport.voi.windowWidth)
measureData.wc = Math.round(viewport.voi.windowCenter) measureData.wc = Math.round(viewport.voi.windowCenter)
const canvas = this.canvas.querySelector('canvas') // const canvas = this.canvas.querySelector('canvas')
measureData.pictureBaseStr = canvas.toDataURL('image/png', 1) // measureData.pictureBaseStr = canvas.toDataURL('image/png', 1)
this.$emit('setMeasureData', measureData) this.$emit('setMeasureData', measureData)
cornerstoneTools.setToolPassiveForElement(this.canvas, e.detail.toolName) cornerstoneTools.setToolPassiveForElement(this.canvas, e.detail.toolName)
} else if (e.detail.toolName === 'Bidirectional') { } else if (e.detail.toolName === 'Bidirectional') {
@ -1367,8 +1363,22 @@ export default {
measureData.location = this.dicomInfo.location measureData.location = this.dicomInfo.location
measureData.ww = Math.round(viewport.voi.windowWidth) measureData.ww = Math.round(viewport.voi.windowWidth)
measureData.wc = Math.round(viewport.voi.windowCenter) measureData.wc = Math.round(viewport.voi.windowCenter)
const canvas = this.canvas.querySelector('canvas') // const canvas = this.canvas.querySelector('canvas')
measureData.pictureBaseStr = canvas.toDataURL('image/png', 1) // 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) this.$emit('setMeasureData', measureData)
cornerstoneTools.setToolPassiveForElement(this.canvas, e.detail.toolName) cornerstoneTools.setToolPassiveForElement(this.canvas, e.detail.toolName)
} else if (!e.detail.toolName) { } else if (!e.detail.toolName) {
@ -1448,7 +1458,7 @@ export default {
}, },
onMeasurementmodified(e) { onMeasurementmodified(e) {
// //
// console.log('modified') console.log('modified')
if (this.readingTaskState >= 2) return if (this.readingTaskState >= 2) return
const { measurementData, toolType } = e.detail const { measurementData, toolType } = e.detail
var element = cornerstone.getEnabledElement(this.canvas) var element = cornerstone.getEnabledElement(this.canvas)
@ -1466,8 +1476,8 @@ export default {
var markName = this.measureData[idx].OrderMarkName var markName = this.measureData[idx].OrderMarkName
if (this.disabledMarks.indexOf(markName) === -1 || !this.disabledMarks) { if (this.disabledMarks.indexOf(markName) === -1 || !this.disabledMarks) {
var questionInfo = this.measureData[idx] var questionInfo = this.measureData[idx]
const canvas = this.canvas.querySelector('canvas') // const canvas = this.canvas.querySelector('canvas')
measureData.pictureBaseStr = canvas.toDataURL('image/png', 1) // measureData.pictureBaseStr = canvas.toDataURL('image/png', 1)
measureData.studyId = this.stack.studyId measureData.studyId = this.stack.studyId
measureData.seriesId = this.stack.seriesId measureData.seriesId = this.stack.seriesId
measureData.instanceId = instanceId measureData.instanceId = instanceId
@ -1479,6 +1489,10 @@ export default {
measureData.ww = Math.round(viewport.voi.windowWidth) measureData.ww = Math.round(viewport.voi.windowWidth)
measureData.wc = Math.round(viewport.voi.windowCenter) measureData.wc = Math.round(viewport.voi.windowCenter)
measureData.data.active = false measureData.data.active = false
var criterionType = parseInt(localStorage.getItem('CriterionType'))
if (criterionType === 21) {
measureData.tableQuestionId = this.measureData[idx].TableQuestionId
}
this.$emit('modifyMeasureData', { measureData, questionInfo }) this.$emit('modifyMeasureData', { measureData, questionInfo })
} }
} }

View File

@ -493,6 +493,14 @@
:is-show="isShow" :is-show="isShow"
:is-reading-show-subject-info="isReadingShowSubjectInfo" :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"> <h2 v-else style="color:#ddd">
Developing... Developing...
</h2> </h2>
@ -786,6 +794,7 @@ import PCWGQuestionList from './PCWG/QuestionList'
import LuganoQuestionList from './Lugano/QuestionList' import LuganoQuestionList from './Lugano/QuestionList'
import IVUSList from './IVUS/QuestionList' import IVUSList from './IVUS/QuestionList'
import OCTList from './OCT/QuestionList' import OCTList from './OCT/QuestionList'
import MRIPDFF from './MRIPDFF/QuestionList'
import CustomWwwcForm from './CustomWwwcForm' import CustomWwwcForm from './CustomWwwcForm'
import Manuals from './Manuals' import Manuals from './Manuals'
import Hotkeys from './Hotkeys' import Hotkeys from './Hotkeys'
@ -818,6 +827,7 @@ export default {
LuganoQuestionList, LuganoQuestionList,
IVUSList, IVUSList,
OCTList, OCTList,
MRIPDFF,
'download-dicom-and-nonedicom': downloadDicomAndNonedicom, 'download-dicom-and-nonedicom': downloadDicomAndNonedicom,
'upload-dicom-and-nonedicom': uploadDicomAndNonedicom, 'upload-dicom-and-nonedicom': uploadDicomAndNonedicom,
SignForm SignForm
@ -978,7 +988,8 @@ export default {
taskId: '', taskId: '',
signVisible: false, signVisible: false,
signCode: null, signCode: null,
currentUser: zzSessionStorage.getItem('userName') currentUser: zzSessionStorage.getItem('userName'),
tmpData: null
} }
}, },
@ -1067,6 +1078,10 @@ export default {
this.measuredTools = [] this.measuredTools = []
} else if (this.CriterionType === 20) { } else if (this.CriterionType === 20) {
this.measuredTools = [] 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.rotateList[0] = '1'
this.colorList[0] = '' this.colorList[0] = ''
@ -1178,6 +1193,11 @@ export default {
this.petctWindow.close() 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', () => { window.addEventListener('beforeunload', () => {
if (this.petctWindow) { if (this.petctWindow) {
this.petctWindow.close() this.petctWindow.close()
@ -1600,7 +1620,7 @@ export default {
var activeCanvasTaskId = obj.visitTaskId var activeCanvasTaskId = obj.visitTaskId
var index = this.visitTaskList.findIndex(i => i.VisitTaskId === activeCanvasTaskId) var index = this.visitTaskList.findIndex(i => i.VisitTaskId === activeCanvasTaskId)
if (index === -1) { if (index === -1) {
resolve() resolve()
return return
} }
@ -2046,6 +2066,9 @@ export default {
}, },
// () // ()
setToolActive(toolName, isMeasuredTool, e, type) { setToolActive(toolName, isMeasuredTool, e, type) {
if (!type) {
this.tmpData = null
}
if (isMeasuredTool) { if (isMeasuredTool) {
// var i = this.measuredTools.findIndex(item => item.toolName === toolName) // var i = this.measuredTools.findIndex(item => item.toolName === toolName)
// if (i === -1 && this.measuredTools[i].isDisabled) return // if (i === -1 && this.measuredTools[i].isDisabled) return
@ -2144,13 +2167,27 @@ export default {
}, },
// //
setMeasureData(data) { 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 = '' this.activeTool = ''
}, },
// //
modifyMeasureData(data) { 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 = '' this.activeTool = ''
}, },
async saveImage() { async saveImage() {
// this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].saveImage() // this.$refs[`dicomCanvas${this.currentDicomCanvasIndex}`][0].saveImage()

View File

@ -561,10 +561,13 @@ export default {
}) })
}) })
}) })
}) })
await store.dispatch('reading/refreshMeasuredData', this.visitTaskId) await store.dispatch('reading/refreshMeasuredData', this.visitTaskId)
DicomEvent.$emit('getMeasureData') DicomEvent.$emit('getMeasureData')
this.$refs['ecrf3'].getQuestions(this.visitTaskId) await store.dispatch('reading/refreshDicomReadingQuestionAnswer', { trialId: this.$route.query.trialId, visitTaskId: this.visitTaskId })
this.$refs['ecrf'].getQuestions(this.visitTaskId, true)
this.$refs['ecrf2'].getQuestions(this.visitTaskId, true)
this.$refs['ecrf3'].getQuestions(this.visitTaskId, true)
loading.close() loading.close()
resolve() resolve()
} catch (e) { console.log(e) } } catch (e) { console.log(e) }

View File

@ -0,0 +1,880 @@
<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 || (qs.QuestionMark === 1105 && isDisabledMeasurableRadio)"
@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, submitTaskRowInfo, deleteTableQuestionMark, deleteSingleTableQuestionMark } 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,
isDisabledMeasurableRadio: false,
liverSeg: ''
}
},
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])
}
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 : '')
//
if (this.isCurrentTask && this.readingTaskState < 2) {
let arr = JSON.parse(this.answers.TableQuestionMarkList)
let isExitsMarks = arr.findIndex(i=>i.MeasureData) > -1
if (isExitsMarks && parseInt(this.questionForm[this.isMeasurableId]) === 0) {
this.$set(this.questionForm, this.isMeasurableId, 1)
}
}
// saveTypeEnum 01访/2
let isMeasurable = this.getQuestionVal(1105)
const mean = this.getQuestionVal(1104)
if (this.questionForm.saveTypeEnum !== 1 && this.isCurrentTask && this.readingTaskState < 2) {
this.$set(this.questionForm, 'saveTypeEnum', parseInt(isMeasurable) === 1 && isNaN(parseFloat(mean)) ? 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
this.isDisabledMeasurableRadio = false
let seg = this.getQuestionVal(1106)
this.liverSeg = this.$fd('LiverSegmentation', seg)
if (this.answers.TableQuestionMarkList) {
let arr = JSON.parse(this.answers.TableQuestionMarkList)
arr.map(i=>{
if (i.MeasureData) {
this.isExitsMarks = true
if (!isNaN(parseInt(isMeasurable)) && parseInt(isMeasurable) === 1 && this.isCurrentTask && this.readingTaskState < 2) {
this.isDisabledMeasurableRadio = true
}
i.MeasureData = JSON.parse(i.MeasureData)
}
this.markList.push({tableQuestionId: i.TableQuestionId, measureData: i, saveEnum: 1})
})
}
let newMean = this.getMean()
if (newMean !== mean) {
let meanId = this.getQuestionId(1104)
this.$set(this.questionForm, meanId, newMean ? newMean : '')
}
if (this.questionForm.saveTypeEnum === 1 && this.isCurrentTask && this.readingTaskState < 2) {
this.setQuestions()
}
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 ''
}
},
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 : '')
}
} else if (qs.QuestionMark === 1105) {
if (!v) {
let meanId = this.getQuestionId(1104)
this.$set(this.questionForm, meanId, 'NE')
} else {
let mean = this.getMean()
let meanId = this.getQuestionId(1104)
this.$set(this.questionForm, meanId, mean)
}
}
this.setQuestions()
},
getMean() {
let mean = null
let isMeasurable = this.getQuestionVal(1105)
isMeasurable = !isNaN(parseInt(isMeasurable)) ? parseInt(isMeasurable) : null
let l1 = this.getQuestionVal(1101)
let l2 = this.getQuestionVal(1102)
let l3 = this.getQuestionVal(1103)
if ( isMeasurable && !isNaN(parseFloat(l1)) && !isNaN(parseFloat(l2)) && !isNaN(parseFloat(l3))) {
const sum = l1 + l2 + l3
mean = sum / 3
return parseFloat(mean.toFixed(this.digitPlaces))
} else if (isMeasurable === 0) {
return 'NE'
} else {
return ''
}
},
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)
}
let val = measureData.data.cachedStats.mean / 10
this.$set(this.questionForm, measureData.tableQuestionId, val.toFixed(this.digitPlaces))
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)
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
}
if (!isNaN(parseInt(isMeasurable)) && parseInt(isMeasurable) === 1) {
this.isDisabledMeasurableRadio = true
}
this.$set(this.questionForm, 'saveTypeEnum', 1)
this.setQuestions()
resolve()
})
},
addAnnotation(qs) {
//
let i = this.markList.findIndex(i=>i.saveEnum === 0)
if (i > -1 && this.markList[i].measureData && this.markList[i].measureData.MeasureData) {
this.$alert(this.$t('trials:MRIPDFF:message:message3'))
// this.$message.warning(this.$t('trials:MRIPDFF:message:message3'))
return
}
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
}
},
getIsExitsMarks() {
const isMeasurable = this.getQuestionVal(1105)
if (!isNaN(parseInt(isMeasurable)) && parseInt(isMeasurable) === 1) {
return this.markList.findIndex(i=>i.measureData && i.measureData.MeasureData) > -1 ? true : false
} 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)
if (measureData.Id) {
await deleteSingleTableQuestionMark({Id: measureData.Id}, 11)
}
// 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, '')
this.isDisabledMeasurableRadio = this.getIsExitsMarks()
this.$set(this.questionForm, 'saveTypeEnum', 1)
this.setQuestions()
},
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 })
},
setQuestions() {
const mean = this.getQuestionVal(1104)
const isMeasurable = this.getQuestionVal(1105)
this.$emit('resetQuestions', { mean, isMeasurable, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
},
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, 11)
if (res.IsSuccess) {
//
let i = this.markList.findIndex(i=>i.tableQuestionId === qs.Id)
this.markList[i].saveEnum = 1
//
let j = this.markList.findIndex(i=>!(i.saveEnum === 1 && i.measureData && i.measureData.MeasureData))
if (j === -1) {
let answers = []
let 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] })
}
}
}
let 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 submitTaskRowInfo(params, 11)
if (res.IsSuccess) {
this.$set(this.questionForm, 'saveTypeEnum', 2)
this.originalQuestionForm = { ...this.questionForm }
this.$set(this.questionForm, 'RowId', res.Result.RowId)
this.setQuestions()
DicomEvent.$emit('getReportInfo', true)
}
}
//
this.$message.success(this.$t('common:message:savedSuccessfully'))
//
this.$emit('getReadingQuestionAndAnswer')
DicomEvent.$emit('setMeasuredToolsPassive')
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)
// base64ascii
for (var i = 0; i < bytes.length; i++) {
byteArray[i] = bytes.charCodeAt(i)
}
// Blob
return new Blob([bytesCode], { type: imgtype })
},
async handleSave() {
try {
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.$alert(this.$t('trials:MRIPDFF:message:message1'))
// 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, 'NE')
}
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}, 11)
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 submitTaskRowInfo(params, 11)
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)
this.setQuestions()
this.$emit('close')
DicomEvent.$emit('getReportInfo', true)
DicomEvent.$emit('setMeasuredToolsPassive')
// await store.dispatch('reading/refreshMeasuredData', this.visitTaskId)
// DicomEvent.$emit('getMeasureData')
this.$emit('getReadingQuestionAndAnswer')
}
loading.close()
} catch (e) {
console.log(e)
loading.close()
}
} catch (e) {
console.log(e)
}
},
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;
}
/deep/ .el-input-group__append, .el-input-group__prepend {
padding: 0 10px;
}
.el-form-item__content
.el-select{
width: 100%;
}
.input-width1{
width: calc(100% -60px)!important;
}
.input-width2{
width: 100% !important;
}
}
</style>

View File

@ -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 >
<!-- 分段 -->
<el-col :span="14">{{$t('trials:MRIPDFF:label:col1')}}</el-col>
<!-- 是否可测量 -->
<!-- <el-col :span="7">{{$t('trials:MRIPDFF:label:col2')}}</el-col> -->
<!-- 平均值 -->
<el-col :span="7">{{$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;right: 0px;top: 2px;">
<!-- white-space: nowrap;overflow: hidden;text-overflow: ellipsis; -->
<div style="font-size: 13px;width:110px;height: 30px;">
<!-- <div style="display: inline-block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width:95px">
{{ $fd('ReadingYesOrNo', parseInt(item.TableQuestions.Answers[i].isMeasurable)) }}
</div> -->
<div style="display: inline-block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width:50px">
{{ isNaN(parseFloat(item.TableQuestions.Answers[i].mean)) ? item.TableQuestions.Answers[i].mean : `${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.$refs[refName][0].liverSeg
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>

View File

@ -57,7 +57,7 @@
:data="taskQuestions" :data="taskQuestions"
row-key="Id" row-key="Id"
border border
default-expand-all :expand-row-keys="expandedRows"
:height="height" :height="height"
:tree-props="{children: 'Childrens', hasChildren: 'hasChildren'}" :tree-props="{children: 'Childrens', hasChildren: 'hasChildren'}"
size="mini" size="mini"
@ -319,7 +319,8 @@ export default {
assessmentQuestions: [], assessmentQuestions: [],
tLesionCount: null, tLesionCount: null,
ntLesionCount: null, ntLesionCount: null,
openWindow: null openWindow: null,
expandedRows: []
} }
}, },
computed: { computed: {
@ -373,13 +374,13 @@ export default {
}) })
}, },
async beforeLeave() { async beforeLeave() {
if (this.questionFormChangeState && this.CriterionType !== 2) { // if (this.questionFormChangeState && this.CriterionType !== 2) {
var msg = this.$t('trials:readingReport:message:msg5') // var msg = this.$t('trials:readingReport:message:msg5')
var isgo = await this.myConfirm(msg) // var isgo = await this.myConfirm(msg)
if (!isgo) { // if (!isgo) {
return Promise.resolve(true) // return Promise.resolve(true)
} // }
} // }
var list = null var list = null
DicomEvent.$emit('getAllUnSaveLesions', val => { DicomEvent.$emit('getAllUnSaveLesions', val => {
list = val list = val
@ -458,16 +459,32 @@ export default {
const arr = [] const arr = []
if (questions.length !== 0) { if (questions.length !== 0) {
questions.forEach((item) => { questions.forEach((item) => {
if (this.CriterionType === 21) {
if (!this.isShowDetail) {
if (!item.RowId) {
this.expandedRows.push(item.Id)
}
} else {
this.expandedRows.push(item.Id)
}
} else {
this.expandedRows.push(item.Id)
}
// //
// //
// //
lesionType = item.LesionType lesionType = item.LesionType
var filterArr = [7] var filterArr = [7]
// 0 5
// 12678irecisit
// 0123ID4567810
// 11051106
if ((item.LesionType === 1 || item.LesionType === 2 || item.LesionType === 6 || item.LesionType === 7 || item.LesionType === 8) && isNTFilterLength) { 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] filterArr = [0, 1, 3, 4, 5, 6, 2, 8, 10, 7, 1105]
} else { } else {
filterArr = [3, 4, 5, 6, 2, 8, 10, 7] filterArr = [3, 4, 5, 6, 2, 8, 10, 7, 1106, 1105]
} }
if ((lesionType === 0 || lesionType === 5) && isLymphNodes === 0 && !this.isShowDetail && (this.CriterionType === 1 || this.CriterionType === 3 || this.CriterionType === 17)) { if ((lesionType === 0 || lesionType === 5) && isLymphNodes === 0 && !this.isShowDetail && (this.CriterionType === 1 || this.CriterionType === 3 || this.CriterionType === 17)) {
filterArr.push(1) filterArr.push(1)
@ -542,6 +559,28 @@ 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))
let Answers = {}
let mean = item.Childrens.findIndex(i => i.QuestionMark === 1104)
if (mean > -1) {
this.visitTaskList.forEach(v => {
const o = item.Childrens[mean].Answer.find(v1 => {
return v1.VisitTaskId === v.VisitTaskId
})
if (o) {
Answers[o.VisitTaskId] = isNaN(parseFloat(o.Answer)) ? o.Answer : `${o.Answer}%`
}
})
}
this.$set(obj, 'Answers', Answers)
}
}
}
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }

View File

@ -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
};
}

View File

@ -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,
};
}

View File

@ -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
}
}

View File

@ -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;
}

View File

@ -11,12 +11,7 @@
<span>({{ record.CreateTime }}) </span> <span>({{ record.CreateTime }}) </span>
</p> </p>
<div class="info-content"> <div class="info-content">
<template v-if="[14, 30].includes(record.UserTypeEnumInt) && (record.MedicalDialogCloseEnum!== null || record.Content)"> <template v-if="[14, 30].includes(record.UserTypeEnumInt) && record.Questioning">
<div>{{ $t('trials:medicalFeedback:title:closeReasonEnum') }}{{ $fd('MedicalDialogCloseEnum',record.MedicalDialogCloseEnum) }}</div>
<div v-if="record.Content">{{ $t('trials:medicalFeedback:title:closereasonRemarks') }}{{ record.Content }}</div>
</template>
<template v-else-if="[14, 30].includes(record.UserTypeEnumInt) && record.Questioning">
<div> <div>
<!-- 您好根据医学审核反馈该阅片任务的评估有如下问题需要您确认或澄清 --> <!-- 您好根据医学审核反馈该阅片任务的评估有如下问题需要您确认或澄清 -->
{{ $t('trials:medicalFeedback:message:msg1') }} {{ $t('trials:medicalFeedback:message:msg1') }}
@ -35,7 +30,7 @@
style="margin:0 10px;" style="margin:0 10px;"
:images="[`${OSSclientConfig.basePath}${file.ImagePath}`]" :images="[`${OSSclientConfig.basePath}${file.ImagePath}`]"
> >
<el-button type="text" @click="previewImage(file.ImagePath)"> <el-button type="text" @click="previewImage(file.ImagePath)" style="width: 400px;white-space: normal; word-wrap: break-word;text-align: left;">
{{ file.FileName }} {{ file.FileName }}
</el-button> </el-button>
<img <img
@ -60,11 +55,14 @@
{{ $t('trials:medicalFeedback:message:msg4') }} {{ $t('trials:medicalFeedback:message:msg4') }}
</div> </div>
</template> </template>
<template v-else-if="[14, 30].includes(record.UserTypeEnumInt)"> <template v-if="[14, 30].includes(record.UserTypeEnumInt) && record.MedicalDialogCloseEnum!== null">
<div>{{ $t('trials:medicalFeedback:title:closeReasonEnum') }}{{ $fd('MedicalDialogCloseEnum',record.MedicalDialogCloseEnum) }}</div>
</template>
<template v-if="[14, 30].includes(record.UserTypeEnumInt) && record.Content ">
<div>{{ record.Content }}</div> <div>{{ record.Content }}</div>
</template> </template>
<template v-else-if="[13].includes(record.UserTypeEnumInt)"> <template v-if="[13].includes(record.UserTypeEnumInt)">
<div> <div>
{{ $t('trials:medicalFeedback:title:isEndorse') }}{{ $fd('MedicalReviewDoctorUserIdea', record.DoctorUserIdeaEnum) }} {{ $t('trials:medicalFeedback:title:isEndorse') }}{{ $fd('MedicalReviewDoctorUserIdea', record.DoctorUserIdeaEnum) }}
</div> </div>

View File

@ -11,12 +11,8 @@
<span>({{ record.CreateTime }}) </span> <span>({{ record.CreateTime }}) </span>
</p> </p>
<div class="info-content"> <div class="info-content">
<template v-if="[14, 30].includes(record.UserTypeEnumInt) && (record.MedicalDialogCloseEnum!== null || record.Content)">
<div>{{ $t('trials:medicalFeedback:title:closeReasonEnum') }}{{ $fd('MedicalDialogCloseEnum',record.MedicalDialogCloseEnum) }}</div> <template v-if="[14, 30].includes(record.UserTypeEnumInt) && record.Questioning">
<div v-if="record.Content">{{ $t('trials:medicalFeedback:title:closereasonRemarks') }}{{ record.Content }}</div>
</template>
<template v-else-if="[14, 30].includes(record.UserTypeEnumInt) && record.Questioning">
<div> <div>
<!-- 您好根据医学审核反馈该阅片任务的评估有如下问题需要您确认或澄清 --> <!-- 您好根据医学审核反馈该阅片任务的评估有如下问题需要您确认或澄清 -->
{{ $t('trials:medicalFeedback:message:msg1') }} {{ $t('trials:medicalFeedback:message:msg1') }}
@ -35,7 +31,7 @@
style="margin:0 10px;" style="margin:0 10px;"
:images="[`${OSSclientConfig.basePath}${file.ImagePath}`]" :images="[`${OSSclientConfig.basePath}${file.ImagePath}`]"
> >
<el-button type="text" @click="previewImage(file.ImagePath)"> <el-button type="text" @click="previewImage(file.ImagePath)" style="width: 400px;white-space: normal; word-wrap: break-word;text-align: left;">
{{ file.FileName }} {{ file.FileName }}
</el-button> </el-button>
<img <img
@ -60,11 +56,14 @@
{{ $t('trials:medicalFeedback:message:msg4') }} {{ $t('trials:medicalFeedback:message:msg4') }}
</div> </div>
</template> </template>
<template v-else-if="[14, 30].includes(record.UserTypeEnumInt)"> <template v-if="[14, 30].includes(record.UserTypeEnumInt) && record.MedicalDialogCloseEnum!== null">
<div>{{ $t('trials:medicalFeedback:title:closeReasonEnum') }}{{ $fd('MedicalDialogCloseEnum',record.MedicalDialogCloseEnum) }}</div>
</template>
<template v-if="[14, 30].includes(record.UserTypeEnumInt) && record.Content">
<div>{{ record.Content }}</div> <div>{{ record.Content }}</div>
</template> </template>
<template v-else-if="[13].includes(record.UserTypeEnumInt)"> <template v-if="[13].includes(record.UserTypeEnumInt)">
<div> <div>
{{ $t('trials:medicalFeedback:title:isEndorse') }}{{ $fd('MedicalReviewDoctorUserIdea', record.DoctorUserIdeaEnum) }} {{ $t('trials:medicalFeedback:title:isEndorse') }}{{ $fd('MedicalReviewDoctorUserIdea', record.DoctorUserIdeaEnum) }}
</div> </div>

View File

@ -260,7 +260,11 @@ export default {
if (Object.keys(this.medicalReviewInfo).length > 0) { if (Object.keys(this.medicalReviewInfo).length > 0) {
for (const k in this.form) { for (const k in this.form) {
if (this.medicalReviewInfo.hasOwnProperty(k)) { if (this.medicalReviewInfo.hasOwnProperty(k)) {
this.form[k] = this.medicalReviewInfo[k]; if (k === 'IsHaveQuestion' && this.medicalReviewInfo.AuditState === 0) {
this.form[k] = null
} else {
this.form[k] = this.medicalReviewInfo[k]
}
} }
} }
this.fileList = []; this.fileList = [];

View File

@ -1,6 +1,6 @@
/* eslint-disable */ /* eslint-disable */
<template> <template>
<BaseContainer> <BaseContainer class="read-task-allocation">
<el-tabs type="border-card" v-model="TrialReadingCriterionId"> <el-tabs type="border-card" v-model="TrialReadingCriterionId">
<el-tab-pane :label="i.TrialReadingCriterionName" :name="i.TrialReadingCriterionId" v-for="i of trialCriterionList" :key="i.TrialReadingCriterionId"> <el-tab-pane :label="i.TrialReadingCriterionName" :name="i.TrialReadingCriterionId" v-for="i of trialCriterionList" :key="i.TrialReadingCriterionId">
<div v-if="TrialReadingCriterionId === i.TrialReadingCriterionId"> <div v-if="TrialReadingCriterionId === i.TrialReadingCriterionId">
@ -1013,6 +1013,11 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.read-task-allocation{
/deep/.search {
padding: 0px !important;
}
}
/deep/ .hidden-row{ /deep/ .hidden-row{
display: none; display: none;
} }

Some files were not shown because too many files have changed in this diff Show More