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

uat_us
caiyiling 2024-11-07 15:07:14 +08:00
commit 55b39a6b29
4 changed files with 263 additions and 27 deletions

View File

@ -299,10 +299,10 @@ async function VueInit() {
Vue.prototype.$path.push(key)
}
let text = i18n.t(key)
if (store.state.trials.config.aa) {
Object.keys(store.state.trials.config.aa).forEach(key => {
let test = new RegExp(key)
text = text.replace(test, store.state.trials.config.aa[key])
if (Array.isArray(store.state.trials.config.TrialObjectNameList) && store.state.trials.config.TrialObjectNameList.length > 0) {
store.state.trials.config.TrialObjectNameList.forEach(item => {
let test = new RegExp(item.Name, 'ig')
text = text.replace(test, item.TrialName)
})
}
// return i18n.t(key)

View File

@ -18,7 +18,44 @@ router.beforeEach(async (to, from, next) => {
NProgress.start()
// 设置页面标题
// document.title = getPageTitle(to.meta.title)
if (!to.query.trialId) {
store.dispatch('trials/setConfig', {})
}
if (
to.query.trialId &&
to.query.trialId !==
store.state.trials.config.trialId &&
store.state.trials.whiteList.indexOf(to.path) === -1
) {
console.log(to.query.path)
let res = await getTrialExtralConfig({
TrialId: to.query.trialId,
})
if (res.IsSuccess) {
store.dispatch('trials/setConfig', {
trialId: to.query.trialId,
...res.Result,
})
}
} if (!to.query.trialId) {
store.dispatch('trials/setConfig', {})
}
if (
to.query.trialId &&
to.query.trialId !==
store.state.trials.config.trialId &&
store.state.trials.whiteList.indexOf(to.path) === -1
) {
let res = await getTrialExtralConfig({
TrialId: to.query.trialId,
})
if (res.IsSuccess) {
store.dispatch('trials/setConfig', {
trialId: to.query.trialId,
...res.Result,
})
}
}
// 确定用户是否已登录
const hasToken = getToken()
Vue.prototype.toPath = to.path
@ -89,27 +126,6 @@ router.beforeEach(async (to, from, next) => {
}
}
}
if (!to.query.trialId) {
store.dispatch('trials/setConfig', {})
}
if (
to.query.trialId &&
to.query.trialId !==
store.state.trials.config.trialId &&
store.state.trials.whiteList.indexOf(to.path) === -1
) {
let res = await getTrialExtralConfig({
TrialId: to.query.trialId,
})
res.Result.aa = { 阅片人: '采集人', 申办方: 'aaa' }
if (res.IsSuccess) {
store.dispatch('trials/setConfig', {
trialId: to.query.trialId,
...res.Result,
})
}
}
})
router.afterEach(() => {

View File

@ -274,6 +274,16 @@
>
{{ $t('common:button:cancel') }}
</el-button>
<el-button
@click="openTerminology"
v-if="
(form.IsTrialBasicLogicConfirmed === false ||
(form.IsTrialBasicLogicConfirmed === true && isEdit)) &&
hasPermi(['trials:trials-panel:setting:trial-config:save'])
"
>
{{ $t('common:button:terminology') }}
</el-button>
</el-form-item>
</el-form>
@ -733,6 +743,11 @@
</el-button>
</template>
</base-model>
<!---术语配置--->
<terminology
:visible.sync="terminologyVisible"
:DATA.sync="form.TrialObjectNameList"
/>
</div>
</template>
<script>
@ -749,11 +764,12 @@ import {
} from '@/api/trials/setting'
import SignForm from '@/views/trials/components/newSignForm'
import ClinicalDataForm from './clinicalDataForm'
import terminology from './terminology'
import const_ from '@/const/sign-code'
import BaseModel from '@/components/BaseModel'
export default {
name: 'LogicalConfig',
components: { SignForm, ClinicalDataForm, BaseModel },
components: { SignForm, ClinicalDataForm, BaseModel, terminology },
data() {
return {
form: {
@ -775,6 +791,8 @@ export default {
ModalityListStr: '',
ChangeDefalutDays: 5,
IsTrialBasicLogicConfirmed: false,
TrialObjectNameList: [],
TrialObjectNameConfigStr: '',
// ClinicalDataSetNames: [],
// ClinicalDataTrialSetIds: [],
// ClinicalDataSetNamesStr: ''
@ -855,6 +873,7 @@ export default {
// { required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }
// ]
},
terminologyVisible: false,
confirmVisible: false,
updateVisible: false,
signVisible: false,
@ -929,6 +948,9 @@ export default {
// this.getTrialBodyPartList();
// },
methods: {
openTerminology() {
this.terminologyVisible = true
},
//
confirmCancel() {
this.isEdit = false

View File

@ -0,0 +1,198 @@
<template>
<div v-if="visible">
<el-dialog
v-dialogDrag
:visible.sync="visible"
:close-on-click-modal="false"
:title="$t('trials:logincCfg:form:terminology')"
custom-class="base-dialog-wrapper"
:before-close="handleColse"
width="900px"
>
<div
class="btnBox"
style="width: 100%; display: flex; justify-content: flex-end"
>
<el-button type="primary" size="small" @click.stop="openEdit">
{{ $t('common:button:add') }}
</el-button>
</div>
<el-table :data="DATA" style="width: 100%">
<el-table-column type="index" width="50" />
<el-table-column
prop="Name"
:label="$t('trials:logincCfg:form:terminologyName')"
>
</el-table-column>
<el-table-column
prop="TrialName"
:label="$t('trials:logincCfg:form:terminologyTrials')"
>
</el-table-column>
<el-table-column :label="$t('common:action:action')" width="150px">
<template slot-scope="scope">
<el-button
@click.stop="openEdit(scope.row, scope.$index)"
icon="el-icon-edit-outline"
circle
:title="$t('common:button:edit')"
/>
<el-button
icon="el-icon-delete"
@click.stop="handleDelete(scope.$index)"
circle
:title="$t('common:button:delete')"
/>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleColse" size="small">
{{ $t('common:button:confirm') }}
</el-button>
</span>
</el-dialog>
<el-dialog
v-if="editVisible"
v-dialogDrag
:visible.sync="editVisible"
:close-on-click-modal="false"
title=""
custom-class="base-dialog-wrapper"
width="400px"
>
<el-form
:model="form"
:rules="rules"
ref="terminologyForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item
:label="$t('trials:logincCfg:form:terminologyName')"
prop="Name"
>
<el-select v-model="form.Name" placeholder="" style="width: 100%">
<el-option
v-for="item in $d.Terminology"
:key="item.id"
:label="item.label"
:value="item.label"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
:label="$t('trials:logincCfg:form:terminologyTrials')"
prop="TrialName"
>
<el-input v-model="form.TrialName"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="save" size="small">
{{ $t('common:button:confirm') }}
</el-button>
<el-button @click="editVisible = false" size="small">
{{ $t('common:button:cancel') }}
</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
const defaultForm = () => {
return {
Name: null,
TrialName: null,
}
}
export default {
name: 'terminology',
props: {
visible: {
type: Boolean,
default: true,
},
DATA: {
type: Array,
default: () => {
return []
},
},
},
data() {
return {
status: 'add',
editIndex: -1,
editVisible: false,
form: defaultForm(),
rules: {
Name: [
{
required: true,
message: this.$t('common:ruleMessage:specify'),
trigger: 'blur',
},
],
TrialName: [
{
required: true,
message: this.$t('common:ruleMessage:specify'),
trigger: 'blur',
},
],
},
}
},
methods: {
handleColse() {
this.$emit('update:visible', false)
},
openEdit(row, index) {
this.status = 'add'
this.form = defaultForm()
if (row) {
this.status = 'edit'
this.editIndex = index
Object.keys(this.form).forEach((key) => {
this.form[key] = row[key]
})
this.form.Id = row.Id
}
this.editVisible = true
},
async handleDelete(index) {
try {
let confirm = await this.$confirm(
this.$t('trials:staffResearch:message:confirmDel')
)
if (!confirm) return false
this.DATA.splice(index, 1)
} catch (err) {
console.log(err)
}
},
async save() {
try {
let validate = await this.$refs.terminologyForm.validate()
if (!validate) return false
if (this.status === 'edit') {
this.DATA.splice(this.editIndex, 1, this.form)
} else {
this.DATA.push(this.form)
}
this.editVisible = false
} catch (err) {
console.log(err)
}
},
},
}
</script>
<style lang="scss" scoped>
::v-deep .el-dialog__body {
padding: 30px 20px;
}
</style>