自定义表格问题预览
continuous-integration/drone/push Build is passing Details

uat_us
熊飞 2024-01-22 16:37:50 +08:00
parent 1d42e5eab5
commit 7692037b67
3 changed files with 95 additions and 47 deletions

View File

@ -2,7 +2,7 @@
ENV = 'production' ENV = 'production'
NODE_ENV = 'production' NODE_ENV = 'production'
# base public path # base public path
VUE_APP_BASE_PATH = 'https://ei-code-prod.s3.amazonaws.com/2024-01-19/' VUE_APP_BASE_PATH = 'https://ei-code-prod.s3.amazonaws.com/2024-01-22/'
# 是否开启登陆限制 true:是 false:否 # 是否开启登陆限制 true:是 false:否
VUE_APP_LOGIN_FOR_PERMISSION = false VUE_APP_LOGIN_FOR_PERMISSION = false

View File

@ -239,7 +239,6 @@
</el-dialog> </el-dialog>
</el-form-item> </el-form-item>
</template> </template>
<template v-if="question.Childrens && question.Childrens.length>0 && question.Type !== 'table'"> <template v-if="question.Childrens && question.Childrens.length>0 && question.Type !== 'table'">
<QuestionFormItem <QuestionFormItem
v-for="(item) in question.Childrens" v-for="(item) in question.Childrens"

View File

@ -75,7 +75,8 @@
/> />
</el-form-item> </el-form-item>
<!-- 文件类型 --> <!-- 文件类型 -->
<el-form-item v-if="form.Type === 'upload'" :label="$t('trials:readingUnit:qsList:title:FileType')" prop="DataSource"> <el-form-item v-if="form.Type === 'upload'" :label="$t('trials:readingUnit:qsList:title:FileType')"
prop="DataSource">
<el-checkbox-group <el-checkbox-group
v-model="form.FileType" v-model="form.FileType"
@change="(v) => { @change="(v) => {
@ -97,12 +98,13 @@
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<!-- 最大字符数 --> <!-- 最大字符数 -->
<el-form-item v-if="form.Type === 'input' || form.Type === 'textarea'" :label="$t('trials:readingUnit:qsList:title:MaxAnswerLength')"> <el-form-item v-if="form.Type === 'input' || form.Type === 'textarea'"
<el-input v-model="form.MaxAnswerLength" /> :label="$t('trials:readingUnit:qsList:title:MaxAnswerLength')">
<el-input v-model="form.MaxAnswerLength"/>
</el-form-item> </el-form-item>
<!-- 自增序号前缀 --> <!-- 自增序号前缀 -->
<el-form-item v-if="form.Type === 'table'" :label="$t('trials:readingUnit:qsList:title:orderMark')"> <el-form-item v-if="form.Type === 'table'" :label="$t('trials:readingUnit:qsList:title:orderMark')">
<el-input v-model="form.OrderMark" /> <el-input v-model="form.OrderMark"/>
</el-form-item> </el-form-item>
<!-- 最大行数 --> <!-- 最大行数 -->
<el-form-item v-if="form.Type === 'table'" :label="$t('trials:readingUnit:qsList:title:maxQuestionCount')"> <el-form-item v-if="form.Type === 'table'" :label="$t('trials:readingUnit:qsList:title:maxQuestionCount')">
@ -120,7 +122,8 @@
/> />
</el-form-item> </el-form-item>
<!-- 问题数据来源 --> <!-- 问题数据来源 -->
<el-form-item v-if="form.Type === 'number'" :label="$t('trials:readingUnit:qsList:title:dataSource')" prop="DataSource"> <el-form-item v-if="form.Type === 'number'" :label="$t('trials:readingUnit:qsList:title:dataSource')"
prop="DataSource">
<el-radio-group <el-radio-group
v-model="form.DataSource" v-model="form.DataSource"
> >
@ -164,7 +167,7 @@
{ required: true, message: this.$t('common:ruleMessage:select')} { required: true, message: this.$t('common:ruleMessage:select')}
]" ]"
> >
<el-input :value="$fd('DigitPlaces', ValueType).toString()" :disabled="true" /> <el-input :value="$fd('DigitPlaces', ValueType).toString()" :disabled="true"/>
</el-form-item> </el-form-item>
<!-- 单位 --> <!-- 单位 -->
<el-form-item <el-form-item
@ -190,9 +193,10 @@
{ required: true, message: this.$t('common:ruleMessage:select')} { required: true, message: this.$t('common:ruleMessage:select')}
]" ]"
> >
<el-input v-model="form.CustomUnit" /> <el-input v-model="form.CustomUnit"/>
</el-form-item> </el-form-item>
<div v-if="form.Type === 'number' && form.DataSource === 1" style="background: #f8f8f8;padding: 10px 0px;border-radius: 10px;position: relative;margin-bottom: 10px;"> <div v-if="form.Type === 'number' && form.DataSource === 1"
style="background: #f8f8f8;padding: 10px 0px;border-radius: 10px;position: relative;margin-bottom: 10px;">
<!-- 运算类型 --> <!-- 运算类型 -->
<el-form-item <el-form-item
:label="$t('trials:readingUnit:qsList:title:customCalculateMark')" :label="$t('trials:readingUnit:qsList:title:customCalculateMark')"
@ -248,7 +252,9 @@
min-width="70" min-width="70"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index === 0 && [1, 2, 3, 4].includes(form.CustomCalculateMark) ? null : $fd('CustomCalculateMark', form.CustomCalculateMark) }} {{
scope.$index === 0 && [1, 2, 3, 4].includes(form.CustomCalculateMark) ? null : $fd('CustomCalculateMark', form.CustomCalculateMark)
}}
</template> </template>
</el-table-column> </el-table-column>
<!-- 表格名称 --> <!-- 表格名称 -->
@ -261,7 +267,8 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.QuestionId" clearable :disabled="!scope.row.IsTable"> <el-select v-model="scope.row.QuestionId" clearable :disabled="!scope.row.IsTable">
<el-option v-for="item of tableQuestions" :key="item.QuestionId" :label="item.QuestionName" :value="item.QuestionId" /> <el-option v-for="item of tableQuestions" :key="item.QuestionId" :label="item.QuestionName"
:value="item.QuestionId"/>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
@ -274,10 +281,13 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-if="!scope.row.IsTable" v-model="scope.row.TableQuestionId" clearable> <el-select v-if="!scope.row.IsTable" v-model="scope.row.TableQuestionId" clearable>
<el-option v-for="item of Questions" :key="item.QuestionId" :label="item.QuestionName" :value="item.QuestionId" /> <el-option v-for="item of Questions" :key="item.QuestionId" :label="item.QuestionName"
:value="item.QuestionId"/>
</el-select> </el-select>
<el-select v-if="scope.row.IsTable" v-model="scope.row.TableQuestionId" clearable> <el-select v-if="scope.row.IsTable" v-model="scope.row.TableQuestionId" clearable>
<el-option v-for="item of !scope.row.QuestionId ? [] : tableQuestions.find(v => v.QuestionId === scope.row.QuestionId).TableQuestions" :key="item.QuestionId" :label="item.QuestionName" :value="item.QuestionId" /> <el-option
v-for="item of !scope.row.QuestionId ? [] : tableQuestions.find(v => v.QuestionId === scope.row.QuestionId).TableQuestions"
:key="item.QuestionId" :label="item.QuestionName" :value="item.QuestionId"/>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
@ -310,7 +320,9 @@
</el-table> </el-table>
<div style="font-size: 12px;color:#666;padding: 0 15px 0;text-align: right"> <div style="font-size: 12px;color:#666;padding: 0 15px 0;text-align: right">
<!-- '请选择同级问题!': '请选择表格问题下的子问题!' --> <!-- '请选择同级问题!': '请选择表格问题下的子问题!' -->
<i class="el-icon-info" />{{ [1, 2, 3, 4].includes(form.CustomCalculateMark) ? $t('trials:readingUnit:qsList:message:msg1') : $t('trials:readingUnit:qsList:message:msg2') }} <i class="el-icon-info"/>{{
[1, 2, 3, 4].includes(form.CustomCalculateMark) ? $t('trials:readingUnit:qsList:message:msg1') : $t('trials:readingUnit:qsList:message:msg2')
}}
</div> </div>
</div> </div>
<!-- 选项类型 --> <!-- 选项类型 -->
@ -358,7 +370,8 @@
prop="ClassifyQuestionId" prop="ClassifyQuestionId"
> >
<el-select v-model="form.ClassifyQuestionId" clearable> <el-select v-model="form.ClassifyQuestionId" clearable>
<el-option v-for="item of Questions" :key="item.QuestionId" :label="item.QuestionName" :value="item.QuestionId" /> <el-option v-for="item of Questions" :key="item.QuestionId" :label="item.QuestionName"
:value="item.QuestionId"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
@ -380,7 +393,7 @@
min-width="70" min-width="70"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.label}} {{ scope.row.label }}
</template> </template>
</el-table-column> </el-table-column>
<!-- 运算类型 --> <!-- 运算类型 -->
@ -480,7 +493,9 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- 是否必填 --> <!-- 是否必填 -->
<el-form-item v-if="form.Type !== 'group' && form.Type !== 'table' && form.Type !== 'summary' || form.Type === 'class'" :label="$t('trials:readingUnit:qsList:title:isRequired')" prop="IsRequired"> <el-form-item
v-if="form.Type !== 'group' && form.Type !== 'table' && form.Type !== 'summary' || form.Type === 'class'"
:label="$t('trials:readingUnit:qsList:title:isRequired')" prop="IsRequired">
<el-radio-group <el-radio-group
v-model="form.IsRequired" v-model="form.IsRequired"
:disabled="form.IsJudgeQuestion===true || form.ShowQuestion===2" :disabled="form.IsJudgeQuestion===true || form.ShowQuestion===2"
@ -515,7 +530,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 显示时依赖父问题触发值 --> <!-- 显示时依赖父问题触发值 -->
<el-form-item v-if="form.ParentId && form.ShowQuestion===1" :label="$t('trials:readingUnit:qsList:title:parentTriggerValueList')" prop="ParentTriggerValueList"> <el-form-item v-if="form.ParentId && form.ShowQuestion===1"
:label="$t('trials:readingUnit:qsList:title:parentTriggerValueList')" prop="ParentTriggerValueList">
<el-select v-model="form.ParentTriggerValueList" clearable multiple> <el-select v-model="form.ParentTriggerValueList" clearable multiple>
<el-option <el-option
v-for="item of parentTriggerValOptions" v-for="item of parentTriggerValOptions"
@ -581,7 +597,8 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- 是否裁判问题 --> <!-- 是否裁判问题 -->
<el-form-item v-if="form.Type === 'select' || form.Type === 'radio' || form.Type === 'number'" :label="$t('trials:readingUnit:qsList:title:isJudgeQuestion')"> <el-form-item v-if="form.Type === 'select' || form.Type === 'radio' || form.Type === 'number'"
:label="$t('trials:readingUnit:qsList:title:isJudgeQuestion')">
<el-radio-group <el-radio-group
v-model="form.IsJudgeQuestion" v-model="form.IsJudgeQuestion"
@change="((val)=>{isJudgeQuestionChange(val, form)})" @change="((val)=>{isJudgeQuestionChange(val, form)})"
@ -595,16 +612,29 @@
</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:LimitShow')">
<el-radio-group v-model="form.LimitShow" @change="(v) => {
if (v !== 0) {
form.LimitEdit = v
}
}">
<el-radio v-for="item of $d.LimitShow" :key="item.id" :label="item.value">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
<!-- 限制编辑 --> <!-- 限制编辑 -->
<el-form-item :label="$t('trials:readingUnit:qsList:title:limitEdit')"> <el-form-item :label="$t('trials:readingUnit:qsList:title:limitEdit')">
<el-radio-group v-model="form.LimitEdit"> <el-radio-group v-model="form.LimitEdit" :disabled="form.LimitShow !== 0">
<el-radio v-for="item of $d.LimitEdit" :key="item.id" :label="item.value">{{ item.label }}</el-radio> <el-radio v-for="item of $d.LimitEdit" :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('trials:readingUnit:qsList:title:globalReadingShowType')"> <el-form-item :label="$t('trials:readingUnit:qsList:title:globalReadingShowType')">
<el-radio-group v-model="form.GlobalReadingShowType"> <el-radio-group v-model="form.GlobalReadingShowType">
<el-radio v-for="item of $d.GlobalReadingShowType" :key="item.id" :label="item.value">{{ item.label }}</el-radio> <el-radio v-for="item of $d.GlobalReadingShowType" :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 <el-form-item
@ -636,27 +666,41 @@
</el-form> </el-form>
</template> </template>
<script> <script>
import { getCalculateQuestions, addOrUpdateReadingQuestionTrial, getTrialCriterionOtherQuestion, getTrialGroupNameList, getCriterionLesionType } from '@/api/trials' import {
import { getBasicConfigSelect, getCriterionDictionaryList } from '@/api/dictionary' getCalculateQuestions,
addOrUpdateReadingQuestionTrial,
getTrialCriterionOtherQuestion,
getTrialGroupNameList,
getCriterionLesionType
} from '@/api/trials'
import {getBasicConfigSelect, getCriterionDictionaryList} from '@/api/dictionary'
export default { export default {
name: 'AddOrUpdateClinicalData', name: 'AddOrUpdateClinicalData',
props: { props: {
digitPlaces: { digitPlaces: {
type: Number, type: Number,
default() { return 0 } default() {
return 0
}
}, },
list: { list: {
type: Array, type: Array,
default() { return [] } default() {
return []
}
}, },
trialCriterionId: { trialCriterionId: {
type: String, type: String,
default() { return '' } default() {
return ''
}
}, },
data: { data: {
type: Object, type: Object,
default() { return {} } default() {
return {}
}
}, },
isFromSystem: { isFromSystem: {
type: Boolean, type: Boolean,
@ -724,28 +768,33 @@ export default {
DictionaryCode: null, DictionaryCode: null,
GroupId: null, GroupId: null,
ClassifyQuestionId: null, ClassifyQuestionId: null,
ClassifyAlgorithms: null ClassifyAlgorithms: null,
LimitShow: null
// IsEnable: true // IsEnable: true
}, },
rules: { rules: {
Type: [ Type: [
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] } {required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change']}
], ],
QuestionName: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['blur', 'change'] }, QuestionName: [{required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['blur', 'change']},
{ max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50` }], {max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50`}],
TypeValue: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['blur', 'change'] }, TypeValue: [{required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['blur', 'change']},
{ validator: validateTypeVal, trigger: ['blur', 'change'] }, {validator: validateTypeVal, trigger: ['blur', 'change']},
{ max: 200, message: `${this.$t('common:ruleMessage:maxLength')} 200` }], {max: 200, message: `${this.$t('common:ruleMessage:maxLength')} 200`}],
ShowQuestion: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }], ShowQuestion: [{required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change']}],
IsRequired: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }], IsRequired: [{required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change']}],
ParentId: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }], ParentId: [{required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change']}],
ParentTriggerValueList: [ ParentTriggerValueList: [
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] } {required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change']}
], ],
RelevanceId: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }], RelevanceId: [{required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change']}],
RelevanceValueList: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }], RelevanceValueList: [{
GroupName: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['blur', 'change'] }, required: true,
{ max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50` }] message: this.$t('common:ruleMessage:select'),
trigger: ['blur', 'change']
}],
GroupName: [{required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['blur', 'change']},
{max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50`}]
}, },
loading: false, loading: false,
dicList: [], dicList: [],
@ -882,7 +931,7 @@ export default {
} else { } else {
const options = [] const options = []
this.parentOptions[index].TypeValue.split('|').forEach((item, index) => { this.parentOptions[index].TypeValue.split('|').forEach((item, index) => {
options.push({ id: index, label: item, value: item }) options.push({id: index, label: item, value: item})
}) })
this.parentTriggerValOptions = options this.parentTriggerValOptions = options
} }
@ -898,7 +947,7 @@ export default {
} else { } else {
const options = [] const options = []
this.parentOptions[i].TypeValue.split('|').forEach((item, index) => { this.parentOptions[i].TypeValue.split('|').forEach((item, index) => {
options.push({ id: i, label: item, value: item }) options.push({id: i, label: item, value: item})
}) })
this.reParentTriggerValOptions = options this.reParentTriggerValOptions = options
} }
@ -1013,7 +1062,7 @@ export default {
// this.parentTriggerValOptions = this.parentOptions[index].TypeValue.split('|') // this.parentTriggerValOptions = this.parentOptions[index].TypeValue.split('|')
const options = [] const options = []
this.parentOptions[index].TypeValue.split('|').forEach((item, index) => { this.parentOptions[index].TypeValue.split('|').forEach((item, index) => {
options.push({ id: index, label: item, value: item }) options.push({id: index, label: item, value: item})
}) })
this.parentTriggerValOptions = options this.parentTriggerValOptions = options
if (this.parentOptions[index].GroupName) { if (this.parentOptions[index].GroupName) {
@ -1038,7 +1087,7 @@ export default {
// this.reParentTriggerValOptions = this.parentOptions[index].TypeValue.split('|') // this.reParentTriggerValOptions = this.parentOptions[index].TypeValue.split('|')
const options = [] const options = []
this.parentOptions[index].TypeValue.split('|').forEach((item, index) => { this.parentOptions[index].TypeValue.split('|').forEach((item, index) => {
options.push({ id: index, label: item, value: item }) options.push({id: index, label: item, value: item})
}) })
this.reParentTriggerValOptions = options this.reParentTriggerValOptions = options
} }