OCT系统标准修改,表单下拉框增加多选(OCT、自定义)
continuous-integration/drone/push Build encountered an error Details

uat
wangxiaoshuang 2025-12-08 15:13:35 +08:00
parent 6ee3a06eb2
commit 41eb974496
16 changed files with 861 additions and 1392 deletions

View File

@ -40,6 +40,13 @@ function getQuestions(questions) {
const criterionType = parseInt(localStorage.getItem('CriterionType')) const criterionType = parseInt(localStorage.getItem('CriterionType'))
questions.forEach(item => { questions.forEach(item => {
if ((item.Type === 'table' || item.Type === 'basicTable') && item.TableQuestions && item.TableQuestions.Answers.length > 0) { if ((item.Type === 'table' || item.Type === 'basicTable') && item.TableQuestions && item.TableQuestions.Answers.length > 0) {
item.TableQuestions.Questions.forEach(question => {
if (question.Type === 'select' && question.OptionTypeEnum === 1) {
item.TableQuestions.Answers.forEach((answer) => {
answer[question.Id] = answer[question.Id] ? JSON.parse(answer[question.Id]) : []
})
}
})
item.TableQuestions.Answers.forEach(answerObj => { item.TableQuestions.Answers.forEach(answerObj => {
answerObj.isDicomReading = answerObj.IsDicomReading === 'True' answerObj.isDicomReading = answerObj.IsDicomReading === 'True'

View File

@ -1,155 +1,86 @@
<template> <template>
<el-form <el-form ref="tableQsForm" v-loading="loading" :model="form" size="small" :disabled="type === 'look'" :rules="rules"
ref="tableQsForm" label-width="130px">
v-loading="loading"
:model="form"
size="small"
:disabled="type === 'look'"
:rules="rules"
label-width="130px"
>
<div class="base-dialog-body" style="height: 550px; display:flex;flex-direction: column;"> <div class="base-dialog-body" style="height: 550px; display:flex;flex-direction: column;">
<div style="height: 150px;"> <div style="height: 150px;">
<!-- 类型 --> <!-- 类型 -->
<el-form-item :label="$t('trials:readingUnit:qsList:title:type')" prop="Type"> <el-form-item :label="$t('trials:readingUnit:qsList:title:type')" prop="Type">
<el-select <el-select v-model="form.Type" @change="((val) => { qsTypeChange(val, form) })">
v-model="form.Type" <el-option v-for="item of $d.Criterion_Question_Type"
@change="((val)=>{qsTypeChange(val, form)})"
>
<el-option
v-for="item of $d.Criterion_Question_Type"
v-show="item.value !== 'class' && item.value !== 'group' && item.value !== 'table' && item.value !== 'basicTable'" v-show="item.value !== 'class' && item.value !== 'group' && item.value !== 'table' && item.value !== 'basicTable'"
:key="item.value" :key="item.value" :value="item.value" :label="item.label" />
:value="item.value"
:label="item.label"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 问题名称 --> <!-- 问题名称 -->
<el-form-item <el-form-item v-if="form.Type !== 'group'" :label="$t('trials:readingUnit:qsList:title:qsNameEn')"
v-if="form.Type !== 'group'" prop="QuestionName" :rules="[
:label="$t('trials:readingUnit:qsList:title:qsNameEn')"
prop="QuestionName"
:rules="[
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }, { required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' },
{ max: form.Type === 'summary' ? 300 : 100, message: `${this.$t('common:ruleMessage:maxLength')} ${form.Type === 'summary' ? 300 : 100}` } { max: form.Type === 'summary' ? 300 : 100, message: `${this.$t('common:ruleMessage:maxLength')} ${form.Type === 'summary' ? 300 : 100}` }
]" ]">
> <el-input v-model="form.QuestionName" />
<el-input
v-model="form.QuestionName"
/>
</el-form-item> </el-form-item>
<!-- 问题名称EN --> <!-- 问题名称EN -->
<el-form-item <el-form-item v-if="form.Type !== 'group'" :label="$t('trials:readingUnit:qsList:title:qsNameEn')"
v-if="form.Type !== 'group'" prop="QuestionEnName" :rules="[
:label="$t('trials:readingUnit:qsList:title:qsNameEn')"
prop="QuestionEnName"
:rules="[
{ max: form.Type === 'summary' ? 300 : 100, message: `${this.$t('common:ruleMessage:maxLength')} ${form.Type === 'summary' ? 300 : 100}` } { max: form.Type === 'summary' ? 300 : 100, message: `${this.$t('common:ruleMessage:maxLength')} ${form.Type === 'summary' ? 300 : 100}` }
]" ]">
> <el-input v-model="form.QuestionEnName" />
<el-input
v-model="form.QuestionEnName"
/>
</el-form-item> </el-form-item>
</div> </div>
<div style="flex: 1;overflow-y:auto;"> <div style="flex: 1;overflow-y:auto;">
<!-- 公有属性 --> <!-- 公有属性 -->
<el-divider content-position="left">{{$t('trials:readingUnit:title:publicProperties')}}</el-divider> <el-divider content-position="left">{{ $t('trials:readingUnit:title:publicProperties') }}</el-divider>
<!-- 是否显示 --> <!-- 是否显示 -->
<el-form-item v-if="form.Type !== 'group'" :label="$t('trials:readingUnit:qsList:title:isShow')" prop="ShowQuestion"> <el-form-item v-if="form.Type !== 'group'" :label="$t('trials:readingUnit:qsList:title:isShow')"
<el-radio-group prop="ShowQuestion">
v-model="form.ShowQuestion" <el-radio-group v-model="form.ShowQuestion" @change="((val) => { isShowQuestionChange(val, form) })">
@change="((val)=>{isShowQuestionChange(val, form)})" <el-radio v-for="item of $d.ShowQuestion" :key="`ShowQuestion${item.value}`" :label="item.value">
>
<el-radio
v-for="item of $d.ShowQuestion"
:key="`ShowQuestion${item.value}`"
:label="item.value"
>
{{ item.label }} {{ item.label }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- 显示时依赖父问题 --> <!-- 显示时依赖父问题 -->
<el-form-item <el-form-item v-if="form.Type !== 'group' && form.ShowQuestion === 1"
v-if="form.Type !== 'group' && form.ShowQuestion===1" :label="$t('trials:readingUnit:qsList:title:parentId')" prop="ParentId">
:label="$t('trials:readingUnit:qsList:title:parentId')" <el-select v-model="form.ParentId" clearable @change="((val) => { parentQuestionChange(val, form) })">
prop="ParentId" <el-option v-for="item of parentOptions" :key="`ParentId${item.QuestionId}`" :label="item.QuestionName"
> :value="item.QuestionId" />
<el-select
v-model="form.ParentId"
clearable
@change="((val)=>{parentQuestionChange(val, form)})"
>
<el-option
v-for="item of parentOptions"
:key="`ParentId${item.QuestionId}`"
:label="item.QuestionName"
:value="item.QuestionId"
/>
</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" :key="item.id" :label="item.label"
v-for="item of parentTriggerValOptions" :value="String(item.value)" />
:key="item.id"
:label="item.label"
:value="String(item.value)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 是否必填 --> <!-- 是否必填 -->
<el-form-item v-if="form.Type !== 'group' && form.Type !== 'table' && form.Type !== 'basicTable' && form.Type !== 'summary'" :label="$t('trials:readingUnit:qsList:title:isRequired')" prop="IsRequired"> <el-form-item
<el-radio-group v-if="form.Type !== 'group' && form.Type !== 'table' && form.Type !== 'basicTable' && form.Type !== 'summary'"
v-model="form.IsRequired" :label="$t('trials:readingUnit:qsList:title:isRequired')" prop="IsRequired">
:disabled="form.IsJudgeQuestion===true || form.ShowQuestion===2" <el-radio-group v-model="form.IsRequired" :disabled="form.IsJudgeQuestion === true || form.ShowQuestion === 2"
@change="((val)=>{isRequiredChange(val, form)})" @change="((val) => { isRequiredChange(val, form) })">
> <el-radio v-for="item of $d.QuestionRequired" :key="`QuestionRequired${item.value}`" :label="item.value">
<el-radio
v-for="item of $d.QuestionRequired"
:key="`QuestionRequired${item.value}`"
:label="item.value"
>
{{ item.label }} {{ item.label }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- 必填依赖父问题 --> <!-- 必填依赖父问题 -->
<el-form-item <el-form-item v-if="form.Type !== 'group' && form.IsRequired === 1"
v-if="form.Type !== 'group' && form.IsRequired === 1" :label="$t('trials:readingUnit:qsList:title:relevanceId')" prop="RelevanceId">
:label="$t('trials:readingUnit:qsList:title:relevanceId')" <el-select v-model="form.RelevanceId" clearable @change="((val) => { relevanceQuestionChange(val, form) })">
prop="RelevanceId" <el-option v-for="item of parentOptions" :key="`RelevanceId${item.QuestionId}`" :label="item.QuestionName"
> :value="item.QuestionId" />
<el-select
v-model="form.RelevanceId"
clearable
@change="((val)=>{relevanceQuestionChange(val, form)})"
>
<el-option
v-for="item of parentOptions"
:key="`RelevanceId${item.QuestionId}`"
:label="item.QuestionName"
:value="item.QuestionId"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 必填触发值 --> <!-- 必填触发值 -->
<el-form-item <el-form-item v-if="form.RelevanceId && form.IsRequired === 1"
v-if="form.RelevanceId && form.IsRequired === 1" :label="$t('trials:readingUnit:qsList:title:relevanceValueList')" prop="RelevanceValueList">
:label="$t('trials:readingUnit:qsList:title:relevanceValueList')"
prop="RelevanceValueList"
>
<el-select v-model="form.RelevanceValueList" clearable multiple> <el-select v-model="form.RelevanceValueList" clearable multiple>
<el-option <el-option v-for="item of reParentTriggerValOptions" :key="item.id" :label="item.label"
v-for="item of reParentTriggerValOptions" :value="String(item.value)" />
:key="item.id"
:label="item.label"
:value="String(item.value)"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 导出标识 --> <!-- 导出标识 -->
@ -174,175 +105,106 @@
</el-radio-group> </el-radio-group>
</el-form-item> --> </el-form-item> -->
<!-- 导出结果 --> <!-- 导出结果 -->
<el-form-item <el-form-item :label="$t('trials:readingUnit:qsList:title:ExportResult')"
: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'">
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" :key="`ExportResult${item.value}`"
v-for="item in CriterionDictionaryList.ExportResult" :value="parseInt(item.Code)" :label="$i18n.locale === 'zh' ? item.ValueCN : item.Value">
:key="`ExportResult${item.value}`"
:value="parseInt(item.Code)"
:label="$i18n.locale === 'zh' ? item.ValueCN : item.Value"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 限制编辑 --> <!-- 限制编辑 -->
<el-form-item <el-form-item :label="$t('trials:readingUnit:qsList:title:limitEdit')" v-if="form.Type !== 'summary'"
:label="$t('trials:readingUnit:qsList:title:limitEdit')" prop="LimitEdit" :rules="[
v-if="form.Type !== 'summary'"
prop="LimitEdit"
:rules="[
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' } { required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }
]" ]">
>
<el-radio-group v-model="form.LimitEdit"> <el-radio-group v-model="form.LimitEdit">
<el-radio v-for="item of $d.LimitEdit" :key="item.value" :label="item.value">{{ item.label }}</el-radio> <el-radio v-for="item of $d.LimitEdit" :key="item.value" :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 v-if="form.Type !== 'group' && form.Type !== 'summary'"
v-if="form.Type !== 'group' && form.Type !== 'summary'" :label="$t('dictionary:template:criterionConfig:table:questionMark')" prop="QuestionMark">
:label="$t('dictionary:template:criterionConfig:table:questionMark')" <el-select v-model="form.QuestionMark" clearable>
prop="QuestionMark" <el-option v-for="item of CriterionDictionaryList.QuestionMark" :key="item.Id" :value="parseInt(item.Code)"
> :label="$i18n.locale === 'zh' ? item.ValueCN : item.Value" />
<el-select
v-model="form.QuestionMark"
clearable
>
<el-option
v-for="item of CriterionDictionaryList.QuestionMark"
:key="item.Id"
:value="parseInt(item.Code)"
:label="$i18n.locale === 'zh' ? item.ValueCN : item.Value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 注释 --> <!-- 注释 -->
<el-form-item <el-form-item :label="$t('trials:readingUnit:qsList:title:Remark')" prop="Remark">
:label="$t('trials:readingUnit:qsList:title:Remark')"
prop="Remark"
>
<el-input v-model="form.Remark" /> <el-input v-model="form.Remark" />
</el-form-item> </el-form-item>
<!-- 序号 --> <!-- 序号 -->
<el-form-item <el-form-item :label="$t('trials:readingUnit:qsList:title:order')" prop="ShowOrder" :rules="[
:label="$t('trials:readingUnit:qsList:title:order')" { required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }
prop="ShowOrder" ]">
:rules="[ <el-input-number v-model="form.ShowOrder" controls-position="right" :min="0" />
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }
]"
>
<el-input-number
v-model="form.ShowOrder"
controls-position="right"
:min="0"
/>
</el-form-item> </el-form-item>
<!-- 重复出现最大次数 --> <!-- 重复出现最大次数 -->
<el-form-item :label="$t('dictionary:template:criterionConfig:table:maxRowCount')" v-if="form.Type !== 'summary' && form.Type !== 'screenshot' && form.Type !== 'upload'"> <el-form-item :label="$t('dictionary:template:criterionConfig:table:maxRowCount')"
<el-input-number v-if="form.Type !== 'summary' && form.Type !== 'screenshot' && form.Type !== 'upload'">
v-model="form.MaxRowCount" <el-input-number v-model="form.MaxRowCount" controls-position="right" :min="0" :max="10" />
controls-position="right"
:min="0"
:max="10"
/>
</el-form-item> </el-form-item>
<!-- 问题分类 --> <!-- 问题分类 -->
<el-form-item :label="$t('dictionary:template:criterionConfig:table:questionClassify')" v-if="criterionType === 2"> <el-form-item :label="$t('dictionary:template:criterionConfig:table:questionClassify')"
v-if="criterionType === 2">
<el-select v-model="form.QuestionClassify" clearable> <el-select v-model="form.QuestionClassify" clearable>
<el-option <el-option v-for="item of $d.QuestionClassify" :key="item.id" :label="item.label" :value="item.value" />
v-for="item of $d.QuestionClassify"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 私有属性 --> <!-- 私有属性 -->
<el-divider content-position="left">{{$t('trials:readingUnit:title:privateProperties')}}</el-divider> <el-divider content-position="left">{{ $t('trials:readingUnit:title:privateProperties') }}</el-divider>
<!-- 下拉框单选或多选 -->
<el-form-item v-if="form.Type === 'select'" :label="$t('trials:readingUnit:qsList:title:MultipleSelect')"
prop="OptionTypeEnum" :rules="[
{ required: true, message: this.$t('common:ruleMessage:specify') }
]">
<el-radio-group v-model="form.OptionTypeEnum">
<el-radio v-for="item of $d.OptionType" :key="item.id" :label="item.value">
{{ item.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<!-- 选项类型 --> <!-- 选项类型 -->
<el-form-item <el-form-item v-if="form.Type === 'select' || form.Type === 'radio' || form.Type === 'input'"
v-if="form.Type === 'select' || form.Type === 'radio' || form.Type === 'input'" :label="$t('trials:readingUnit:label:QuestionGenre')" prop="TableQuestionType" :rules="[
:label="$t('trials:readingUnit:label:QuestionGenre')" { required: form.Type !== 'input', message: this.$t('common:ruleMessage:select') }
prop="TableQuestionType" ]">
:rules="[ <el-radio-group v-model="form.TableQuestionType" @change="((val) => { tableQuestionTypeChange(val, form) })">
{ required: form.Type !== 'input', message: this.$t('common:ruleMessage:select')} <el-radio v-for="item of $d.TableQuestionType" :key="item.id" :label="item.value"
]" :disabled="(form.Type === 'radio' && (item.value === 1 || item.value === 2)) || (form.Type === 'input' && (item.value === 0 || item.value === 3))">
>
<el-radio-group
v-model="form.TableQuestionType"
@change="((val)=>{tableQuestionTypeChange(val, form)})"
>
<el-radio
v-for="item of $d.TableQuestionType"
:key="item.id"
:label="item.value"
:disabled="(form.Type === 'radio' && (item.value===1 || item.value===2)) || (form.Type === 'input' && (item.value===0 || item.value===3))"
>
{{ item.label }} {{ item.label }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- 选项 --> <!-- 选项 -->
<el-form-item <el-form-item v-if="form.TableQuestionType === 0 || form.Type === 'class'"
v-if="form.TableQuestionType === 0 || form.Type === 'class'" :label="$t('trials:qcCfg:table:typeValue')" prop="TypeValue">
:label="$t('trials:qcCfg:table:typeValue')" <el-input v-model="form.TypeValue" :placeholder="$t('trials:qcCfg:message:typeValue')"
prop="TypeValue" @change="typeValueChange" />
>
<el-input
v-model="form.TypeValue"
:placeholder="$t('trials:qcCfg:message:typeValue')"
@change="typeValueChange"
/>
</el-form-item> </el-form-item>
<!-- 关联问题 --> <!-- 关联问题 -->
<el-form-item <el-form-item v-if="form.TableQuestionType === 2"
v-if="form.TableQuestionType === 2" :label="$t('dictionary:template:criterionConfig:table:dependParentId')" prop="DependParentId">
:label="$t('dictionary:template:criterionConfig:table:dependParentId')" <el-select v-model="form.DependParentId">
prop="DependParentId" <el-option v-for="item of parentOptions" :key="`DependParentId${item.QuestionId}`"
> :label="item.QuestionName" :value="item.QuestionId" />
<el-select
v-model="form.DependParentId"
>
<el-option
v-for="item of parentOptions"
:key="`DependParentId${item.QuestionId}`"
:label="item.QuestionName"
:value="item.QuestionId"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 关联字段 --> <!-- 关联字段 -->
<el-form-item <el-form-item v-if="form.TableQuestionType === 1 || !!form.DependParentId"
v-if="form.TableQuestionType === 1 || !!form.DependParentId" :label="$t('dictionary:template:criterionConfig:table:dataTableColumn')" prop="DataTableColumn">
:label="$t('dictionary:template:criterionConfig:table:dataTableColumn')"
prop="DataTableColumn"
>
<el-select v-model="form.DataTableColumn"> <el-select v-model="form.DataTableColumn">
<el-option <el-option v-for="item of CriterionDictionaryList.OrganColumn" :key="item.Id"
v-for="item of CriterionDictionaryList.OrganColumn" :label="$i18n.locale === 'zh' ? item.ValueCN : item.Value" :value="item.Code" />
:key="item.Id"
:label="$i18n.locale === 'zh' ? item.ValueCN : item.Value"
:value="item.Code"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 关联字典 --> <!-- 关联字典 -->
<el-form-item <el-form-item v-if="form.TableQuestionType === 3 || form.TableQuestionType === 2"
v-if="form.TableQuestionType === 3 || form.TableQuestionType === 2" :label="$t('dictionary:template:criterionConfig:table:relatedDictionaryCode')" prop="DictionaryCode"
:label="$t('dictionary:template:criterionConfig:table:relatedDictionaryCode')" :rules="[{ required: form.TableQuestionType === 3, message: '请选择', trigger: 'blur' }]">
prop="DictionaryCode"
:rules="[{ required: form.TableQuestionType === 3, message: '请选择', trigger: 'blur' }]"
>
<el-select v-model="form.DictionaryCode"> <el-select v-model="form.DictionaryCode">
<el-option <el-option v-for="item of dicList" :key="item.Id" :label="item.Code" :value="item.Code" />
v-for="item of dicList"
:key="item.Id"
:label="item.Code"
:value="item.Code"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 默认值 --> <!-- 默认值 -->
@ -354,35 +216,23 @@
:label="item.label" :label="item.label"
:value="item.value.toString()" :value="item.value.toString()"
/> --> /> -->
<el-option <el-option v-for="item of highlightAnswers" :key="item.Id"
v-for="item of highlightAnswers" :label="$i18n.locale === 'zh' ? item.ValueCN : item.Value" :value="item.Code" />
:key="item.Id"
:label="$i18n.locale === 'zh' ? item.ValueCN : item.Value"
:value="item.Code"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 默认值 --> <!-- 默认值 -->
<el-form-item v-if="form.TableQuestionType === 0" :label="$t('trials:readingUnit:qsList:title:defaultValue')"> <el-form-item v-if="form.TableQuestionType === 0" :label="$t('trials:readingUnit:qsList:title:defaultValue')">
<el-select v-model="form.DefaultValue" clearable> <el-select v-model="form.DefaultValue" clearable>
<el-option <el-option v-for="item of form.TypeValue ? form.TypeValue.split('|') : []" :key="item" :label="item"
v-for="item of form.TypeValue ? form.TypeValue.split('|') : []" :value="item" />
:key="item"
:label="item"
:value="item"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 高亮标记值 --> <!-- 高亮标记值 -->
<el-form-item v-if="form.Type === 'select' || form.Type === 'radio'" :label="$t('trials:readingUnit:qsList:title:highlightAnswers')" prop="HighlightAnswerList"> <el-form-item v-if="form.Type === 'select' || form.Type === 'radio'"
:label="$t('trials:readingUnit:qsList:title:highlightAnswers')" 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">
<el-option <el-option v-for="item of form.TypeValue.split('|')" :key="item" :label="item" :value="item" />
v-for="item of form.TypeValue.split('|')"
:key="item"
:label="item"
:value="item"
/>
</template> </template>
<template v-else-if="form.DictionaryCode"> <template v-else-if="form.DictionaryCode">
<!-- <el-option <!-- <el-option
@ -391,24 +241,16 @@
:label="item.label" :label="item.label"
:value="item.value.toString()" :value="item.value.toString()"
/> --> /> -->
<el-option <el-option v-for="item of highlightAnswers" :key="item.Id"
v-for="item of highlightAnswers" :label="$i18n.locale === 'zh' ? item.ValueCN : item.Value" :value="item.Code" />
:key="item.Id"
:label="$i18n.locale === 'zh' ? item.ValueCN : item.Value"
:value="item.Code"
/>
</template> </template>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 最大长度 --> <!-- 最大长度 -->
<el-form-item <el-form-item v-if="form.Type === 'input' || form.Type === 'textarea'"
v-if="form.Type === 'input' || form.Type === 'textarea'" :label="$t('trials:readingUnit:qsList:title:MaxAnswerLength')" prop="MaxAnswerLength" :rules="[
:label="$t('trials:readingUnit:qsList:title:MaxAnswerLength')"
prop="MaxAnswerLength"
:rules="[
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' } { required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }
]" ]">
>
<el-input-number v-model="form.MaxAnswerLength" :min="0"></el-input-number> <el-input-number v-model="form.MaxAnswerLength" :min="0"></el-input-number>
</el-form-item> </el-form-item>
<!-- 是否复制前值 --> <!-- 是否复制前值 -->
@ -425,138 +267,75 @@
/> />
</el-form-item> --> </el-form-item> -->
<!-- 数值类型 --> <!-- 数值类型 -->
<el-form-item <el-form-item v-if="form.Type === 'number' || form.Type === 'calculation'"
v-if="form.Type === 'number' || form.Type === 'calculation'" :label="$t('trials:readingUnit:qsList:title:valueType')" prop="ValueType" :rules="[
:label="$t('trials:readingUnit:qsList:title:valueType')"
prop="ValueType"
:rules="[
{ required: true, message: this.$t('common:ruleMessage:select') } { required: true, message: this.$t('common:ruleMessage:select') }
]" ]">
> <el-radio-group v-model="form.ValueType">
<el-radio-group <el-radio v-for="item of $d.ValueType" :key="item.id" :label="item.value">
v-model="form.ValueType"
>
<el-radio
v-for="item of $d.ValueType"
:key="item.id"
:label="item.value"
>
{{ item.label }} {{ item.label }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- 单位 --> <!-- 单位 -->
<el-form-item <el-form-item v-if="form.Type === 'number' || form.Type === 'calculation'"
v-if="form.Type === 'number' || form.Type === 'calculation'" :label="$t('trials:readingUnit:qsList:title:unit')" prop="Unit" :rules="[
:label="$t('trials:readingUnit:qsList:title:unit')"
prop="Unit"
:rules="[
{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' } { required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }
]" ]">
> <el-radio-group v-model="form.Unit">
<el-radio-group <el-radio v-for="item of $d.ValueUnit" :key="item.id" :label="item.value">
v-model="form.Unit"
>
<el-radio
v-for="item of $d.ValueUnit"
:key="item.id"
:label="item.value"
>
{{ item.label }} {{ item.label }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<!-- 最大上传个数 --> <!-- 最大上传个数 -->
<el-form-item <el-form-item v-if="form.Type === 'upload'" :label="$t('trials:readingUnit:qsList:title:imageCount')"
v-if="form.Type === 'upload'" prop="ImageCount">
:label="$t('trials:readingUnit:qsList:title:imageCount')" <el-input-number v-model="form.ImageCount" controls-position="right" :min="0" :max="10" />
prop="ImageCount"
>
<el-input-number
v-model="form.ImageCount"
controls-position="right"
:min="0"
:max="10"
/>
</el-form-item> </el-form-item>
<!-- 文件类型 --> <!-- 文件类型 -->
<el-form-item <el-form-item v-if="form.Type === 'upload'" :label="$t('trials:readingUnit:qsList:title:FileType')"
v-if="form.Type === 'upload'"
:label="$t('trials:readingUnit:qsList:title:FileType')"
prop="FileType" prop="FileType"
:rules="[{ type: 'array', required: true, message: this.$t('common:ruleMessage:specify'), trigger: [ 'change'] }]" :rules="[{ type: 'array', required: true, message: this.$t('common:ruleMessage:specify'), trigger: ['change'] }]">
> <el-checkbox-group v-model="form.FileType" @change="(v) => {
<el-checkbox-group if (v && v.includes('-1')) {
v-model="form.FileType" form.FileType = ['-1']
@change="(v) => { }
if (v && v.includes('-1')) { }">
form.FileType = ['-1'] <el-checkbox v-for="item of $d.fileType" :key="`fileType${item.value}`" :value="item.value + ''"
} :label="item.value" :disabled="form.FileType && form.FileType.includes('-1') && item.value !== '-1'">
}"
>
<el-checkbox
v-for="item of $d.fileType"
:key="`fileType${item.value}`"
:value="item.value + ''"
:label="item.value"
:disabled="form.FileType && form.FileType.includes('-1') && item.value !== '-1'"
>
{{ item.label }} {{ item.label }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<!-- 分类 --> <!-- 分类 -->
<!-- 分类数据来源 --> <!-- 分类数据来源 -->
<el-form-item <el-form-item v-if="form.Type === 'class'"
v-if="form.Type === 'class'" :label="$t('dictionary:template:criterionConfig:table:classifyQuestion')" prop="ClassifyTableQuestionId">
:label="$t('dictionary:template:criterionConfig:table:classifyQuestion')"
prop="ClassifyTableQuestionId"
>
<el-select v-model="form.ClassifyTableQuestionId" clearable> <el-select v-model="form.ClassifyTableQuestionId" clearable>
<el-option v-for="item of Questions" :key="item.Id" :label="item.QuestionName" <el-option v-for="item of Questions" :key="item.Id" :label="item.QuestionName" :value="item.Id" />
:value="item.Id"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- 分类算法 --> <!-- 分类算法 -->
<el-form-item <el-form-item v-if="form.Type === 'class'"
v-if="form.Type === 'class'" :label="$t('dictionary:template:criterionConfig:table:classifyAlgorithms')" prop="ClassifyAlgorithms">
:label="$t('dictionary:template:criterionConfig:table:classifyAlgorithms')"
prop="ClassifyAlgorithms"
>
<div> <div>
<el-table <el-table ref="CalculateTable" :data="ClassifyAlgorithmsList" style="margin: 10px;width: 100%" size="small">
ref="CalculateTable"
:data="ClassifyAlgorithmsList"
style="margin: 10px;width: 100%"
size="small"
>
<!-- 运算类型 --> <!-- 运算类型 -->
<el-table-column <el-table-column :label="$t('trials:readingUnit:label:label')" show-overflow-tooltip min-width="70">
:label="$t('trials:readingUnit:label:label')"
show-overflow-tooltip
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>
<!-- 运算类型 --> <!-- 运算类型 -->
<el-table-column <el-table-column :label="$t('trials:readingUnit:label:gt')" show-overflow-tooltip min-width="128">
:label="$t('trials:readingUnit:label:gt')"
show-overflow-tooltip
min-width="128"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number v-model="scope.row.gt"></el-input-number> <el-input-number v-model="scope.row.gt"></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
<!-- 运算类型 --> <!-- 运算类型 -->
<el-table-column <el-table-column :label="$t('trials:readingUnit:label:lt')" show-overflow-tooltip min-width="128">
:label="$t('trials:readingUnit:label:lt')"
show-overflow-tooltip
min-width="128"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number v-model="scope.row.lt"></el-input-number> <el-input-number v-model="scope.row.lt"></el-input-number>
</template> </template>
@ -569,11 +348,7 @@
<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 <el-button size="small" type="primary" @click="close">
size="small"
type="primary"
@click="close"
>
{{ $t('common:button:cancel') }} {{ $t('common:button:cancel') }}
</el-button> </el-button>
<!-- 保存 --> <!-- 保存 -->
@ -666,7 +441,8 @@ export default {
ClassifyAlgorithms: null, ClassifyAlgorithms: null,
// ExportIdentification: 0, // ExportIdentification: 0,
ExportResult: [], ExportResult: [],
DefaultValue:null DefaultValue: null,
OptionTypeEnum: 0
// IsEnable: true // IsEnable: true
}, },
rules: { rules: {
@ -677,8 +453,8 @@ export default {
// { max: 300, message: ' 300' }], // { max: 300, message: ' 300' }],
TypeValue: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }, TypeValue: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' },
{ validator: validateTypeVal, trigger: 'blur' }, { validator: validateTypeVal, trigger: 'blur' },
{ 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' }], ShowQuestion: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }],
IsRequired: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }], IsRequired: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }],
ParentId: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }], ParentId: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: 'blur' }],
@ -776,7 +552,7 @@ export default {
if (this.data.hasOwnProperty(k)) { if (this.data.hasOwnProperty(k)) {
if (k === 'ClassifyAlgorithms' && this.data[k] !== undefined && this.data[k] !== '') { if (k === 'ClassifyAlgorithms' && this.data[k] !== undefined && this.data[k] !== '') {
this.ClassifyAlgorithmsList = JSON.parse(this.data[k]) this.ClassifyAlgorithmsList = JSON.parse(this.data[k])
} else if(k === 'FileType'){ } else if (k === 'FileType') {
this.form[k] = this.data[k].split(',') this.form[k] = this.data[k].split(',')
} else { } else {
this.form[k] = this.data[k] this.form[k] = this.data[k]
@ -792,10 +568,10 @@ export default {
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 dicCode = this.parentOptions[index].DictionaryCode
let res = await getCriterionDictionary({ReadingCriterionId: this.criterionId, DictionaryCode: dicCode}) let res = await getCriterionDictionary({ ReadingCriterionId: this.criterionId, DictionaryCode: dicCode })
this.parentTriggerValOptions = res.Result[dicCode].map(i=>{ this.parentTriggerValOptions = res.Result[dicCode].map(i => {
return {id: i.Id, label: this.$i18n.locale === 'zh' ? i.ValueCN : i.Value, value: i.Code} return { id: i.Id, label: this.$i18n.locale === 'zh' ? i.ValueCN : i.Value, value: i.Code }
}) })
} else { } else {
const options = [] const options = []
@ -814,9 +590,9 @@ export default {
if (this.parentOptions[i].QuestionGenre === 3) { if (this.parentOptions[i].QuestionGenre === 3) {
// this.reParentTriggerValOptions = this.$d[this.parentOptions[i].DictionaryCode] // this.reParentTriggerValOptions = this.$d[this.parentOptions[i].DictionaryCode]
let dicCode = this.parentOptions[i].DictionaryCode let dicCode = this.parentOptions[i].DictionaryCode
let res = await getCriterionDictionary({ReadingCriterionId: this.criterionId, DictionaryCode: dicCode}) let res = await getCriterionDictionary({ ReadingCriterionId: this.criterionId, DictionaryCode: dicCode })
this.reParentTriggerValOptions = res.Result[dicCode].map(i=>{ this.reParentTriggerValOptions = res.Result[dicCode].map(i => {
return {id: i.Id, label: this.$i18n.locale === 'zh' ? i.ValueCN : i.Value, value: i.Code} return { id: i.Id, label: this.$i18n.locale === 'zh' ? i.ValueCN : i.Value, value: i.Code }
}) })
} else { } else {
const options = [] const options = []
@ -903,12 +679,12 @@ 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 dicCode = this.parentOptions[index].DictionaryCode
let res = await getCriterionDictionary({ReadingCriterionId: this.criterionId, DictionaryCode: dicCode}) let res = await getCriterionDictionary({ ReadingCriterionId: this.criterionId, DictionaryCode: dicCode })
this.parentTriggerValOptions = res.Result[dicCode].map(i=>{ this.parentTriggerValOptions = res.Result[dicCode].map(i => {
return {id: i.Id, label: this.$i18n.locale === 'zh' ? i.ValueCN : i.Value, value: i.Code} 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) => {
@ -929,10 +705,10 @@ export default {
if (this.parentOptions[index].QuestionGenre === 3) { if (this.parentOptions[index].QuestionGenre === 3) {
// this.reParentTriggerValOptions = this.$d[this.parentOptions[index].DictionaryCode] // this.reParentTriggerValOptions = this.$d[this.parentOptions[index].DictionaryCode]
let dicCode = this.parentOptions[index].DictionaryCode let dicCode = this.parentOptions[index].DictionaryCode
let res = await getCriterionDictionary({ReadingCriterionId: this.criterionId, DictionaryCode: dicCode}) let res = await getCriterionDictionary({ ReadingCriterionId: this.criterionId, DictionaryCode: dicCode })
this.reParentTriggerValOptions = res.Result[dicCode].map(i=>{ this.reParentTriggerValOptions = res.Result[dicCode].map(i => {
return {id: i.Id, label: this.$i18n.locale === 'zh' ? i.ValueCN : i.Value, value: i.Code} return { id: i.Id, label: this.$i18n.locale === 'zh' ? i.ValueCN : i.Value, value: i.Code }
}) })
} else { } else {
const options = [] const options = []
@ -993,6 +769,7 @@ export default {
// form.ExportIdentification = 0 // form.ExportIdentification = 0
form.ExportResult = [] form.ExportResult = []
form.DefaultValue = null form.DefaultValue = null
form.OptionTypeEnum = 0
}, },
close() { close() {
this.$emit('close') this.$emit('close')
@ -1001,5 +778,4 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

View File

@ -37,7 +37,8 @@
<div class="add-icon" @click.prevent="downloadTpl(item.LesionType)"> <div class="add-icon" @click.prevent="downloadTpl(item.LesionType)">
<i class="el-icon-download" /> <i class="el-icon-download" />
</div> </div>
<div class="add-icon" style="margin: 0 5px;" @click.prevent="uploadTpl(item.LesionType, item.QuestionName)"> <div class="add-icon" style="margin: 0 5px;"
@click.prevent="uploadTpl(item.LesionType, item.QuestionName)">
<i class="el-icon-upload2" /> <i class="el-icon-upload2" />
</div> </div>
<div class="add-icon" @click.prevent="handleAddOrEdit('add', item)"> <div class="add-icon" @click.prevent="handleAddOrEdit('add', item)">
@ -64,7 +65,11 @@
{{ `${scope.row[q.Id]} ${$fd('ValueUnit', parseInt(q.Unit))}` }} {{ `${scope.row[q.Id]} ${$fd('ValueUnit', parseInt(q.Unit))}` }}
</span> </span>
<span v-else-if="q.DictionaryCode"> <span v-else-if="q.DictionaryCode">
{{ `${$fd(q.DictionaryCode, parseInt(scope.row[q.Id]))}` }} {{`${scope.row[q.Id] instanceof Array ? scope.row[q.Id].map(item => $fd(q.DictionaryCode,
parseInt(item))).join(',') : $fd(q.DictionaryCode, parseInt(scope.row[q.Id]))}`}}
</span>
<span v-else-if="q.OptionTypeEnum === 1">
{{ `${scope.row[q.Id] instanceof Array ? scope.row[q.Id].join(',') : scope.row[q.Id]}` }}
</span> </span>
<span v-else> <span v-else>
{{ `${scope.row[q.Id]}` }} {{ `${scope.row[q.Id]}` }}
@ -169,7 +174,8 @@
<!-- 导入 --> <!-- 导入 -->
<el-dialog v-if="upload.visible" :visible.sync="upload.visible" :close-on-click-modal="false" <el-dialog v-if="upload.visible" :visible.sync="upload.visible" :close-on-click-modal="false"
:title="upload.title" width="500px"> :title="upload.title" width="500px">
<UploadExcel :visit-task-id="visitTaskId" :lesion-type="upload.lesionType" :TableName="upload.TableName" @close="uploadDlgClose" /> <UploadExcel :visit-task-id="visitTaskId" :lesion-type="upload.lesionType" :TableName="upload.TableName"
@close="uploadDlgClose" />
</el-dialog> </el-dialog>
</div> </div>
</div> </div>
@ -319,7 +325,7 @@ export default {
const type = ['number', 'radio', 'select', 'input', 'textarea', 'calculation'] const type = ['number', 'radio', 'select', 'input', 'textarea', 'calculation']
questions.forEach(item => { questions.forEach(item => {
if (type.includes(item.Type)) { if (type.includes(item.Type)) {
const answer = item.Type === 'number' || item.Type === 'calculation' ? isNaN(parseFloat(item.Answer)) ? null : parseFloat(item.Answer) : item.Answer const answer = item.Type === 'select' && item.OptionTypeEnum === 1 && item.Answer ? JSON.parse(item.Answer) : item.Type === 'number' || item.Type === 'calculation' ? isNaN(parseFloat(item.Answer)) ? null : parseFloat(item.Answer) : item.Answer
this.$set(this.questionForm, item.Id, answer) this.$set(this.questionForm, item.Id, answer)
} }
if (item.Childrens.length > 0) { if (item.Childrens.length > 0) {
@ -604,7 +610,7 @@ export default {
for (const k in this.qsForm) { for (const k in this.qsForm) {
if (reg.test(k)) { if (reg.test(k)) {
if (answers.findIndex(i => i.tableQuestionId === k) === -1) { if (answers.findIndex(i => i.tableQuestionId === k) === -1) {
answers.push({ tableQuestionId: k, answer: this.qsForm[k] }) answers.push({ tableQuestionId: k, answer: Array.isArray(this.qsForm[k]) ? JSON.stringify(this.qsForm[k]) : this.qsForm[k] })
} }
} }
} }

View File

@ -23,11 +23,9 @@
:autosize="{ minRows: 2, maxRows: 4 }" maxlength="500" :disabled="readingTaskState >= 2" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="500" :disabled="readingTaskState >= 2"
@change="((val) => { formItemChange(val, question) })" /> @change="((val) => { formItemChange(val, question) })" />
<!-- 下拉框 --> <!-- 下拉框 -->
<el-select v-else-if="question.Type === 'select' || question.type === 'multipleSelect'" <el-select v-else-if="question.Type === 'select'" v-model="questionForm[question.Id]"
v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2 || ((question.TableQuestionType === 2 || question.QuestionGenre === 2) && !!question.DictionaryCode)" :disabled="readingTaskState >= 2 || ((question.TableQuestionType === 2 || question.QuestionGenre === 2) && !!question.DictionaryCode)"
clearable :multiple="question.type === 'multipleSelect'" clearable :multiple="question.OptionTypeEnum === 1" @change="((val) => { formItemChange(val, question) })">
@change="((val) => { formItemChange(val, question) })">
<template v-if="question.TableQuestionType === 1"> <template v-if="question.TableQuestionType === 1">
<el-option v-for="item in organList" :key="item.Id" :label="item[question.DataTableColumn]" <el-option v-for="item in organList" :key="item.Id" :label="item[question.DataTableColumn]"
:value="item[question.DataTableColumn]" /> :value="item[question.DataTableColumn]" />

View File

@ -6,47 +6,44 @@
> >
{{ question.GroupName }} {{ question.GroupName }}
</div> --> </div> -->
<div <div v-if="!!question.GroupName && question.Type === 'group'">
v-if="!!question.GroupName && question.Type==='group'"
>
<h4 style="color: #ddd;padding: 5px 0px;margin: 0;"> <h4 style="color: #ddd;padding: 5px 0px;margin: 0;">
{{ language==='en'?question.GroupEnName:question.GroupName }} {{ language === 'en' ? question.GroupEnName : question.GroupName }}
</h4> </h4>
</div> </div>
<template v-else-if="((question.QuestionType === 56 || question.QuestionType === 57) && question.IsBaseLineTask)" /> <template v-else-if="((question.QuestionType === 56 || question.QuestionType === 57) && question.IsBaseLineTask)" />
<template v-else> <template v-else>
<el-form-item <el-form-item
v-if="(question.ShowQuestion===1 && question.ParentTriggerValueList.includes(String(questionForm[question.ParentId]))) || question.ShowQuestion===0 " v-if="(question.ShowQuestion === 1 && question.ParentTriggerValueList.includes(String(questionForm[question.ParentId]))) || question.ShowQuestion === 0"
:label="`${question.QuestionName}`" :label="`${question.QuestionName}`" :prop="question.Id" :rules="[
:prop="question.Id" {
:rules="[ required: (question.IsRequired === 0 || (question.IsRequired === 1 && question.RelevanceId && (questionForm[question.RelevanceId] === question.RelevanceValue))) && question.Type !== 'group' && question.Type !== 'summary',
{ required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && (questionForm[question.RelevanceId] === question.RelevanceValue))) && question.Type!=='group' && question.Type!=='summary', message: ['radio', 'select', 'checkbox'].includes(question.Type) ? $t('common:ruleMessage:select') : $t('common:ruleMessage:specify'), trigger: ['blur', 'change']
message: ['radio', 'select', 'checkbox'].includes(question.Type) ? $t('common:ruleMessage:select') : $t('common:ruleMessage:specify'), trigger: ['blur', 'change']}, },
]" ]"
:class="[question.Type==='group' ? 'mb' : (question.Type==='upload' || question.QuestionName.length > 15) ?'uploadWrapper' : '']" :class="[question.Type === 'group' ? 'mb' : (question.Type === 'upload' || question.QuestionName.length > 15) ? 'uploadWrapper' : '']">
>
<template v-if="question.QuestionType === 60 || question.QuestionType === 61"> <template v-if="question.QuestionType === 60 || question.QuestionType === 61">
<div style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center;"> <div style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center;">
<el-input <el-input v-if="question.Type === 'calculation'" v-model="questionForm[question.Id]" disabled
v-if="question.Type==='calculation'" style="width: 130px;">
v-model="questionForm[question.Id]"
disabled
style="width: 130px;"
>
<template v-if="question.Unit" slot="append"> <template v-if="question.Unit" slot="append">
{{ $fd('ValueUnit', parseInt(question.Unit)) }} {{ $fd('ValueUnit', parseInt(question.Unit)) }}
</template> </template>
</el-input> </el-input>
<!-- 测量 --> <!-- 测量 -->
<el-button v-if="!questionForm[question.Id] && readingTaskState!== 2" size="mini" type="text" @click="addAnnotation(question)">{{ $t('trials:lugano:button:addAnnotation') }}</el-button> <el-button v-if="!questionForm[question.Id] && readingTaskState !== 2" size="mini" type="text"
@click="addAnnotation(question)">{{ $t('trials:lugano:button:addAnnotation') }}</el-button>
<!-- 清除标记 --> <!-- 清除标记 -->
<el-button v-if="questionForm[question.Id]&& readingTaskState!== 2" size="mini" type="text" @click="removeAnnotation(question)">{{ $t('trials:lugano:button:clearAnnotation') }}</el-button> <el-button v-if="questionForm[question.Id] && readingTaskState !== 2" size="mini" type="text"
@click="removeAnnotation(question)">{{ $t('trials:lugano:button:clearAnnotation') }}</el-button>
<!-- 定位 --> <!-- 定位 -->
<el-button v-if="questionForm[question.Id]" size="mini" type="text" @click="locateAnnotation(question)">{{ $t('trials:lugano:button:locateAnnotation') }}</el-button> <el-button v-if="questionForm[question.Id]" size="mini" type="text" @click="locateAnnotation(question)">{{
$t('trials:lugano:button:locateAnnotation') }}</el-button>
<!-- 保存 --> <!-- 保存 -->
<el-button v-if="readingTaskState!== 2 && question.SaveEnum === 1" size="mini" type="text" @click="saveAnnotation(question)"> <el-button v-if="readingTaskState !== 2 && question.SaveEnum === 1" size="mini" type="text"
@click="saveAnnotation(question)">
<!-- 未保存 --> <!-- 未保存 -->
<el-tooltip class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom"> <el-tooltip class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom">
<i class="el-icon-warning" style="color:red" /> <i class="el-icon-warning" style="color:red" />
@ -56,12 +53,9 @@
</div> </div>
</template> </template>
<template v-else-if="question.QuestionType === 48 || question.QuestionType === 51 || question.QuestionType === 52 || question.QuestionType === 53"> <template
<el-input v-else-if="question.QuestionType === 48 || question.QuestionType === 51 || question.QuestionType === 52 || question.QuestionType === 53">
v-if="question.Type==='calculation'" <el-input v-if="question.Type === 'calculation'" v-model="questionForm[question.Id]" disabled>
v-model="questionForm[question.Id]"
disabled
>
<template v-if="question.Unit" slot="append"> <template v-if="question.Unit" slot="append">
{{ $fd('ValueUnit', parseInt(question.Unit)) }} {{ $fd('ValueUnit', parseInt(question.Unit)) }}
</template> </template>
@ -69,144 +63,79 @@
</template> </template>
<!-- 输入框 --> <!-- 输入框 -->
<el-input <el-input v-else-if="question.Type === 'input'" v-model="questionForm[question.Id]"
v-else-if="question.Type==='input'" :disabled="readingTaskState >= 2 || isFirstChangeTask" @change="((val) => { formItemChange(val, question) })" />
v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2 || isFirstChangeTask"
@change="((val)=>{formItemChange(val, question)})"
/>
<!-- 多行文本输入框 --> <!-- 多行文本输入框 -->
<el-input <el-input v-else-if="question.Type === 'textarea'" v-model="questionForm[question.Id]" type="textarea"
v-else-if="question.Type==='textarea'" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="500" :disabled="readingTaskState >= 2 || isFirstChangeTask"
v-model="questionForm[question.Id]" @change="((val) => { formItemChange(val, question) })" />
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
maxlength="500"
:disabled="readingTaskState >= 2 || isFirstChangeTask"
@change="((val)=>{formItemChange(val, question)})"
/>
<!-- 下拉框 --> <!-- 下拉框 -->
<el-select <el-select v-else-if="question.Type === 'select'" v-model="questionForm[question.Id]"
v-else-if="question.Type==='select'"
v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2 || ((question.TableQuestionType === 2 || question.QuestionGenre === 2) && !!question.DictionaryCode) || isFirstChangeTask || question.QuestionType === 50 || question.QuestionType === 55" :disabled="readingTaskState >= 2 || ((question.TableQuestionType === 2 || question.QuestionGenre === 2) && !!question.DictionaryCode) || isFirstChangeTask || question.QuestionType === 50 || question.QuestionType === 55"
clearable clearable :multiple="question.OptionTypeEnum === 1" @change="((val) => { formItemChange(val, question) })">
@change="((val)=>{formItemChange(val, question)})"
>
<template v-if="question.TableQuestionType === 1"> <template v-if="question.TableQuestionType === 1">
<el-option <el-option v-for="item in organList" :key="item.Id" :label="item[question.DataTableColumn]"
v-for="item in organList" :value="item[question.DataTableColumn]" />
:key="item.Id"
:label="item[question.DataTableColumn]"
:value="item[question.DataTableColumn]"
/>
</template> </template>
<template v-else-if="question.QuestionGenre === 3 && question.QuestionType === 47 && question.IsBaseLineTask"> <template v-else-if="question.QuestionGenre === 3 && question.QuestionType === 47 && question.IsBaseLineTask">
<el-option <el-option v-for="item of $d[question.DictionaryCode]"
v-for="item of $d[question.DictionaryCode]" v-show="item.value === 1 || item.value === 2 || item.value === 5" :key="item.id"
v-show="item.value === 1 ||item.value === 2 || item.value === 5 " :value="String(item.value)" :label="item.label" />
:key="item.id"
:value="String(item.value)"
:label="item.label"
/>
</template> </template>
<template v-else-if="question.QuestionGenre === 3 && question.QuestionType === 47 && !question.IsBaseLineTask"> <template
v-else-if="question.QuestionGenre === 3 && question.QuestionType === 47 && !question.IsBaseLineTask">
<el-option-group <el-option-group
:label="!isNaN(parseFloat(question.LastTaskAnswer)) ? `${$t('trials:dicomReading:tip:lastVisitStatus')} ${$fd(question.DictionaryCode,parseFloat(question.LastTaskAnswer))}` : ''" :label="!isNaN(parseFloat(question.LastTaskAnswer)) ? `${$t('trials:dicomReading:tip:lastVisitStatus')} ${$fd(question.DictionaryCode, parseFloat(question.LastTaskAnswer))}` : ''">
> <el-option v-for="item of $d[question.DictionaryCode]"
<el-option v-show="item.value === 1 || item.value === 3 || item.value === 4 || item.value === 5" :key="item.id"
v-for="item of $d[question.DictionaryCode]" :value="String(item.value)" :label="item.label" />
v-show="item.value === 1 ||item.value === 3|| item.value === 4 || item.value === 5"
:key="item.id"
:value="String(item.value)"
:label="item.label"
/>
</el-option-group> </el-option-group>
</template> </template>
<template v-else-if="question.QuestionGenre === 3 && question.QuestionType === 49 && question.IsBaseLineTask"> <template v-else-if="question.QuestionGenre === 3 && question.QuestionType === 49 && question.IsBaseLineTask">
<el-option <el-option v-for="item of $d[question.DictionaryCode]"
v-for="item of $d[question.DictionaryCode]" v-show="item.value === 1 || item.value === 5 || item.value === 6" :key="item.id"
v-show="item.value === 1 ||item.value === 5 || item.value === 6 " :value="String(item.value)" :label="item.label" />
:key="item.id"
:value="String(item.value)"
:label="item.label"
/>
</template> </template>
<template v-else-if="question.QuestionGenre === 3 && question.QuestionType === 49 && !question.IsBaseLineTask"> <template
v-else-if="question.QuestionGenre === 3 && question.QuestionType === 49 && !question.IsBaseLineTask">
<el-option-group <el-option-group
:label="!isNaN(parseFloat(question.LastTaskAnswer)) ? `${$t('trials:dicomReading:tip:lastVisitStatus')} ${$fd(question.DictionaryCode,parseFloat(question.LastTaskAnswer))}` : ''" :label="!isNaN(parseFloat(question.LastTaskAnswer)) ? `${$t('trials:dicomReading:tip:lastVisitStatus')} ${$fd(question.DictionaryCode, parseFloat(question.LastTaskAnswer))}` : ''">
> <el-option v-for="item of $d[question.DictionaryCode]"
<el-option v-show="item.value === 1 || item.value === 2 || item.value === 3 || item.value === 4 || item.value === 5"
v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="String(item.value)" :label="item.label" />
v-show="item.value === 1 ||item.value === 2 || item.value === 3 || item.value === 4 || item.value === 5"
:key="item.id"
:value="String(item.value)"
:label="item.label"
/>
</el-option-group> </el-option-group>
</template> </template>
<template v-else-if="question.TableQuestionType === 3 || question.QuestionGenre === 3"> <template v-else-if="question.TableQuestionType === 3 || question.QuestionGenre === 3">
<el-option <el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="String(item.value)"
v-for="item of $d[question.DictionaryCode]" :label="item.label" />
:key="item.id"
:value="String(item.value)"
:label="item.label"
/>
</template> </template>
<template v-else-if="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && question.DictionaryCode"> <template
<el-option v-else-if="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && question.DictionaryCode">
v-for="item of $d[question.DictionaryCode]" <el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="String(item.value)"
:key="item.id" :label="item.label" />
:value="String(item.value)"
:label="item.label"
/>
</template> </template>
<template v-else> <template v-else>
<el-option <el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val" :value="val" />
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
:value="val"
/>
</template> </template>
</el-select> </el-select>
<!-- 单选 --> <!-- 单选 -->
<el-radio-group <el-radio-group v-else-if="question.Type === 'radio'" v-model="questionForm[question.Id]"
v-else-if="question.Type==='radio'" :disabled="readingTaskState >= 2 || isFirstChangeTask" @change="((val) => { formItemChange(val, question) })">
v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2 || isFirstChangeTask"
@change="((val)=>{formItemChange(val, question)})"
>
<template v-if="question.DictionaryCode"> <template v-if="question.DictionaryCode">
<el-radio <el-radio v-for="item of $d[question.DictionaryCode]" :key="item.id" :label="String(item.value)">
v-for="item of $d[question.DictionaryCode]"
:key="item.id"
:label="String(item.value)"
>
{{ item.label }} {{ item.label }}
</el-radio> </el-radio>
</template> </template>
<template v-else-if="question.TypeValue"> <template v-else-if="question.TypeValue">
<el-radio <el-radio v-for="val in question.TypeValue.split('|')" :key="val" :label="val">
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
>
{{ val }} {{ val }}
</el-radio> </el-radio>
</template> </template>
</el-radio-group> </el-radio-group>
<!-- 复选框 --> <!-- 复选框 -->
<el-checkbox-group <el-checkbox-group v-else-if="question.Type === 'checkbox'" v-model="questionForm[question.Id]"
v-else-if="question.Type==='checkbox'" :disabled="readingTaskState >= 2 || isFirstChangeTask">
v-model="questionForm[question.Id]" <el-checkbox v-for="val in question.TypeValue.split('|')" :key="val" :label="val">
:disabled="readingTaskState >= 2 || isFirstChangeTask"
>
<el-checkbox
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
>
{{ val }} {{ val }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
@ -217,80 +146,41 @@
:disabled="readingTaskState >= 2 || isFirstChangeTask" :disabled="readingTaskState >= 2 || isFirstChangeTask"
:precision="2" :precision="2"
/> --> /> -->
<template v-else-if="question.Type==='number'"> <template v-else-if="question.Type === 'number'">
<el-input-number <el-input-number v-if="question.ValueType === 0" v-model="questionForm[question.Id]" :precision="0"
v-if="question.ValueType === 0" :disabled="readingTaskState >= 2 || isFirstChangeTask" />
v-model="questionForm[question.Id]" <el-input-number v-else-if="question.ValueType === 3" v-model="questionForm[question.Id]"
:precision="0" :disabled="readingTaskState >= 2 || isFirstChangeTask" />
:disabled="readingTaskState >= 2 || isFirstChangeTask" <el-input-number v-else-if="question.ValueType === 1 || question.ValueType === 2"
/> v-model="questionForm[question.Id]" :precision="digitPlaces"
<el-input-number :disabled="readingTaskState >= 2 || isFirstChangeTask" />
v-else-if="question.ValueType === 3"
v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2 || isFirstChangeTask"
/>
<el-input-number
v-else-if="question.ValueType === 1 || question.ValueType === 2"
v-model="questionForm[question.Id]"
:precision="digitPlaces"
:disabled="readingTaskState >= 2 || isFirstChangeTask"
/>
</template> </template>
<el-input <el-input v-else-if="question.Type === 'calculation'" v-model="questionForm[question.Id]" disabled>
v-else-if="question.Type==='calculation'"
v-model="questionForm[question.Id]"
disabled
>
<template v-if="question.Unit" slot="append"> <template v-if="question.Unit" slot="append">
{{ $fd('ValueUnit', parseInt(question.Unit)) }} {{ $fd('ValueUnit', parseInt(question.Unit)) }}
</template> </template>
</el-input> </el-input>
<!-- 上传图像 --> <!-- 上传图像 -->
<el-upload <el-upload v-else-if="question.Type === 'upload'" action :accept="accept" :limit="question.ImageCount"
v-else-if="question.Type==='upload'" :on-preview="handlePictureCardPreview" :before-upload="handleBeforeUpload" :http-request="uploadScreenshot"
action list-type="picture-card" :on-remove="handleRemove" :file-list="fileList"
:accept="accept" :class="{ disabled: fileList.length >= question.ImageCount }"
:limit="question.ImageCount" :disabled="readingTaskState >= 2 || isFirstChangeTask">
:on-preview="handlePictureCardPreview"
:before-upload="handleBeforeUpload"
:http-request="uploadScreenshot"
list-type="picture-card"
:on-remove="handleRemove"
:file-list="fileList"
:class="{disabled:fileList.length >= question.ImageCount}"
:disabled="readingTaskState >= 2 || isFirstChangeTask"
>
<i slot="default" class="el-icon-plus" /> <i slot="default" class="el-icon-plus" />
<div slot="file" slot-scope="{file}"> <div slot="file" slot-scope="{file}">
<img <img class="el-upload-list__item-thumbnail" :src="OSSclientConfig.basePath + file.url" alt="">
class="el-upload-list__item-thumbnail"
:src="OSSclientConfig.basePath + file.url"
alt=""
>
<span class="el-upload-list__item-actions"> <span class="el-upload-list__item-actions">
<span <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in" /> <i class="el-icon-zoom-in" />
</span> </span>
<span <span v-if="readingTaskState < 2" class="el-upload-list__item-delete" @click="handleRemove(file)">
v-if="readingTaskState < 2"
class="el-upload-list__item-delete"
@click="handleRemove(file)"
>
<i class="el-icon-delete" /> <i class="el-icon-delete" />
</span> </span>
</span> </span>
</div> </div>
</el-upload> </el-upload>
<el-dialog <el-dialog v-if="question.Type === 'upload'" append-to-body :visible.sync="imgVisible" width="600px">
v-if="question.Type==='upload'"
append-to-body
:visible.sync="imgVisible"
width="600px"
>
<el-image :src="imageUrl" width="100%"> <el-image :src="imageUrl" width="100%">
<div slot="placeholder" class="image-slot"> <div slot="placeholder" class="image-slot">
加载中<span class="dot">...</span> 加载中<span class="dot">...</span>
@ -300,17 +190,9 @@
</el-form-item> </el-form-item>
</template> </template>
<QuestionItem <QuestionItem v-for="(item) in question.Childrens" :key="item.Id" :question="item"
v-for="(item) in question.Childrens" :reading-task-state="readingTaskState" :is-first-change-task="isFirstChangeTask" :question-form="questionForm"
:key="item.Id" :visit-task-id="visitTaskId" @setFormItemData="setFormItemData" @resetFormItemData="resetFormItemData" />
:question="item"
:reading-task-state="readingTaskState"
:is-first-change-task="isFirstChangeTask"
:question-form="questionForm"
:visit-task-id="visitTaskId"
@setFormItemData="setFormItemData"
@resetFormItemData="resetFormItemData"
/>
</div> </div>
</template> </template>
<script> <script>
@ -423,7 +305,7 @@ export default {
.then(() => { .then(() => {
DicomEvent.$emit('removeAnnotation', question) DicomEvent.$emit('removeAnnotation', question)
}) })
.catch(() => {}) .catch(() => { })
}, },
locateAnnotation(question) { locateAnnotation(question) {
DicomEvent.$emit('locateAnnotation', question) DicomEvent.$emit('locateAnnotation', question)
@ -479,29 +361,36 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mb{ .mb {
margin-bottom: 0px; margin-bottom: 0px;
} }
.disabled{
.disabled {
::v-deep .el-upload--picture-card { ::v-deep .el-upload--picture-card {
display: none; display: none;
} }
} }
.uploadWrapper{
.uploadWrapper {
display: flex; display: flex;
flex-direction: column !important; flex-direction: column !important;
align-items: flex-start; align-items: flex-start;
} }
::v-deep .el-input.is-disabled .el-input__inner{
background-color: #646464a1; ::v-deep .el-input.is-disabled .el-input__inner {
} background-color: #646464a1;
::v-deep .el-input-group__append, .el-input-group__prepend{ }
padding: 0 10px;
} ::v-deep .el-input-group__append,
::v-deep .el-form-item__content { .el-input-group__prepend {
width: 100%; padding: 0 10px;
} }
::v-deep .el-select.is-disabled .el-input__inner{
background-color: #646464a1; ::v-deep .el-form-item__content {
} width: 100%;
}
::v-deep .el-select.is-disabled .el-input__inner {
background-color: #646464a1;
}
</style> </style>

View File

@ -1,197 +1,104 @@
<template> <template>
<div> <div>
<div <div v-if="!!question.GroupName && question.Type === 'group'">
v-if="!!question.GroupName && question.Type==='group'"
>
<h4 style="color: #ddd;padding: 5px 0px;margin: 0;"> <h4 style="color: #ddd;padding: 5px 0px;margin: 0;">
{{ language==='en'?question.GroupEnName:question.GroupName }} {{ language === 'en' ? question.GroupEnName : question.GroupName }}
</h4> </h4>
</div> </div>
<template v-else> <template v-else>
<el-form-item <el-form-item
v-if="(question.ShowQuestion===1 && question.ParentTriggerValueList.includes(String(questionForm[question.ParentId]))) || question.ShowQuestion===0 " v-if="(question.ShowQuestion === 1 && question.ParentTriggerValueList.includes(String(questionForm[question.ParentId]))) || question.ShowQuestion === 0"
:label="`${question.QuestionName}`" :label="`${question.QuestionName}`" :prop="question.Id" :rules="[
:prop="question.Id" {
:rules="[ required: (question.IsRequired === 0 || (question.IsRequired === 1 && question.RelevanceId && (questionForm[question.RelevanceId] === question.RelevanceValue))) && question.Type !== 'group' && question.Type !== 'summary',
{ required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && (questionForm[question.RelevanceId] === question.RelevanceValue))) && question.Type!=='group' && question.Type!=='summary', message: ['radio', 'select', 'checkbox'].includes(question.Type) ? $t('common:ruleMessage:select') : $t('common:ruleMessage:specify'), trigger: ['blur', 'change']
message: ['radio', 'select', 'checkbox'].includes(question.Type) ? $t('common:ruleMessage:select') : $t('common:ruleMessage:specify'), trigger: ['blur', 'change']}, },
]" ]"
:class="[question.Type==='group' ? 'mb' : (question.Type==='upload' || question.QuestionName.length > 15) ?'uploadWrapper' : '']" :class="[question.Type === 'group' ? 'mb' : (question.Type === 'upload' || question.QuestionName.length > 15) ? 'uploadWrapper' : '']">
>
<!-- 输入框 --> <!-- 输入框 -->
<el-input <el-input v-if="question.Type === 'input'" v-model="questionForm[question.Id]" :disabled="readingTaskState >= 2"
v-if="question.Type==='input'" @change="((val) => { formItemChange(val, question) })" />
v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2"
@change="((val)=>{formItemChange(val, question)})"
/>
<!-- 多行文本输入框 --> <!-- 多行文本输入框 -->
<el-input <el-input v-else-if="question.Type === 'textarea'" v-model="questionForm[question.Id]" type="textarea"
v-else-if="question.Type==='textarea'" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="500" :disabled="readingTaskState >= 2"
v-model="questionForm[question.Id]" @change="((val) => { formItemChange(val, question) })" />
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
maxlength="500"
:disabled="readingTaskState >= 2"
@change="((val)=>{formItemChange(val, question)})"
/>
<!-- 下拉框 --> <!-- 下拉框 -->
<el-select <el-select v-else-if="question.Type === 'select'" v-model="questionForm[question.Id]"
v-else-if="question.Type==='select'"
v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2 || ((question.TableQuestionType === 2 || question.QuestionGenre === 2) && !!question.DictionaryCode)" :disabled="readingTaskState >= 2 || ((question.TableQuestionType === 2 || question.QuestionGenre === 2) && !!question.DictionaryCode)"
clearable clearable :multiple="question.OptionTypeEnum === 1" @change="((val) => { formItemChange(val, question) })">
@change="((val)=>{formItemChange(val, question)})"
>
<template v-if="question.TableQuestionType === 1"> <template v-if="question.TableQuestionType === 1">
<el-option <el-option v-for="item in organList" :key="item.Id" :label="item[question.DataTableColumn]"
v-for="item in organList" :value="item[question.DataTableColumn]" />
:key="item.Id"
:label="item[question.DataTableColumn]"
:value="item[question.DataTableColumn]"
/>
</template> </template>
<template v-else-if="question.TableQuestionType === 3 || question.QuestionGenre === 3"> <template v-else-if="question.TableQuestionType === 3 || question.QuestionGenre === 3">
<el-option <el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="String(item.value)"
v-for="item of $d[question.DictionaryCode]" :label="item.label" />
:key="item.id"
:value="String(item.value)"
:label="item.label"
/>
</template> </template>
<template v-else-if="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && question.DictionaryCode"> <template
<el-option v-else-if="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && question.DictionaryCode">
v-for="item of $d[question.DictionaryCode]" <el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="String(item.value)"
:key="item.id" :label="item.label" />
:value="String(item.value)"
:label="item.label"
/>
</template> </template>
<template v-else> <template v-else>
<el-option <el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val" :value="val" />
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
:value="val"
/>
</template> </template>
</el-select> </el-select>
<!-- 单选 --> <!-- 单选 -->
<el-radio-group <el-radio-group v-else-if="question.Type === 'radio'" v-model="questionForm[question.Id]"
v-else-if="question.Type==='radio'" :disabled="readingTaskState >= 2" @change="((val) => { formItemChange(val, question) })">
v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2"
@change="((val)=>{formItemChange(val, question)})"
>
<template v-if="question.DictionaryCode"> <template v-if="question.DictionaryCode">
<el-radio <el-radio v-for="item of $d[question.DictionaryCode]" :key="item.id" :label="String(item.value)">
v-for="item of $d[question.DictionaryCode]"
:key="item.id"
:label="String(item.value)"
>
{{ item.label }} {{ item.label }}
</el-radio> </el-radio>
</template> </template>
<template v-else-if="question.TypeValue"> <template v-else-if="question.TypeValue">
<el-radio <el-radio v-for="val in question.TypeValue.split('|')" :key="val" :label="val">
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
>
{{ val }} {{ val }}
</el-radio> </el-radio>
</template> </template>
</el-radio-group> </el-radio-group>
<!-- 复选框 --> <!-- 复选框 -->
<el-checkbox-group <el-checkbox-group v-else-if="question.Type === 'checkbox'" v-model="questionForm[question.Id]"
v-else-if="question.Type==='checkbox'" :disabled="readingTaskState >= 2">
v-model="questionForm[question.Id]" <el-checkbox v-for="val in question.TypeValue.split('|')" :key="val" :label="val">
:disabled="readingTaskState >= 2"
>
<el-checkbox
v-for="val in question.TypeValue.split('|')"
:key="val"
:label="val"
>
{{ val }} {{ val }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<!-- 数值 --> <!-- 数值 -->
<template v-else-if="question.Type==='number'"> <template v-else-if="question.Type === 'number'">
<el-input-number <el-input-number v-if="question.ValueType === 0" v-model="questionForm[question.Id]" :precision="0"
v-if="question.ValueType === 0" :disabled="readingTaskState >= 2" />
v-model="questionForm[question.Id]" <el-input-number v-else-if="question.ValueType === 3" v-model="questionForm[question.Id]"
:precision="0" :disabled="readingTaskState >= 2" />
:disabled="readingTaskState >= 2" <el-input-number v-else-if="question.ValueType === 1 || question.ValueType === 2"
/> v-model="questionForm[question.Id]" :precision="digitPlaces" :disabled="readingTaskState >= 2" />
<el-input-number
v-else-if="question.ValueType === 3"
v-model="questionForm[question.Id]"
:disabled="readingTaskState >= 2"
/>
<el-input-number
v-else-if="question.ValueType === 1 || question.ValueType === 2"
v-model="questionForm[question.Id]"
:precision="digitPlaces"
:disabled="readingTaskState >= 2"
/>
</template> </template>
<el-input <el-input v-else-if="question.Type === 'calculation'" v-model="questionForm[question.Id]" disabled>
v-else-if="question.Type==='calculation'"
v-model="questionForm[question.Id]"
disabled
>
<template v-if="question.Unit" slot="append"> <template v-if="question.Unit" slot="append">
{{ $fd('ValueUnit', parseInt(question.Unit)) }} {{ $fd('ValueUnit', parseInt(question.Unit)) }}
</template> </template>
</el-input> </el-input>
<!-- 上传图像 --> <!-- 上传图像 -->
<el-upload <el-upload v-else-if="question.Type === 'upload'" action :accept="accept" :limit="question.ImageCount"
v-else-if="question.Type==='upload'" :on-preview="handlePictureCardPreview" :before-upload="handleBeforeUpload" :http-request="uploadScreenshot"
action list-type="picture-card" :on-remove="handleRemove" :file-list="fileList"
:accept="accept" :class="{ disabled: fileList.length >= question.ImageCount }" :disabled="readingTaskState >= 2">
:limit="question.ImageCount"
:on-preview="handlePictureCardPreview"
:before-upload="handleBeforeUpload"
:http-request="uploadScreenshot"
list-type="picture-card"
:on-remove="handleRemove"
:file-list="fileList"
:class="{disabled:fileList.length >= question.ImageCount}"
:disabled="readingTaskState >= 2"
>
<i slot="default" class="el-icon-plus" /> <i slot="default" class="el-icon-plus" />
<div slot="file" slot-scope="{file}"> <div slot="file" slot-scope="{file}">
<img <img class="el-upload-list__item-thumbnail" :src="OSSclientConfig.basePath + file.url" alt="">
class="el-upload-list__item-thumbnail"
:src="OSSclientConfig.basePath + file.url"
alt=""
>
<span class="el-upload-list__item-actions"> <span class="el-upload-list__item-actions">
<span <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in" /> <i class="el-icon-zoom-in" />
</span> </span>
<span <span v-if="readingTaskState < 2" class="el-upload-list__item-delete" @click="handleRemove(file)">
v-if="readingTaskState < 2"
class="el-upload-list__item-delete"
@click="handleRemove(file)"
>
<i class="el-icon-delete" /> <i class="el-icon-delete" />
</span> </span>
</span> </span>
</div> </div>
</el-upload> </el-upload>
<el-dialog <el-dialog v-if="question.Type === 'upload'" append-to-body :visible.sync="imgVisible" width="600px">
v-if="question.Type==='upload'"
append-to-body
:visible.sync="imgVisible"
width="600px"
>
<el-image :src="imageUrl" width="100%"> <el-image :src="imageUrl" width="100%">
<div slot="placeholder" class="image-slot"> <div slot="placeholder" class="image-slot">
加载中<span class="dot">...</span> 加载中<span class="dot">...</span>
@ -201,16 +108,9 @@
</el-form-item> </el-form-item>
</template> </template>
<question-form-item <question-form-item v-for="(item) in question.Childrens" :key="item.Id" :question="item"
v-for="(item) in question.Childrens" :question-form="questionForm" :reading-task-state="readingTaskState" :visitTaskId="visitTaskId"
:key="item.Id" @resetFormItemData="resetFormItemData" @setFormItemData="setFormItemData" />
:question="item"
:question-form="questionForm"
:reading-task-state="readingTaskState"
:visitTaskId="visitTaskId"
@resetFormItemData="resetFormItemData"
@setFormItemData="setFormItemData"
/>
</div> </div>
</template> </template>
<script> <script>
@ -293,33 +193,40 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mb{ .mb {
margin-bottom: 0px; margin-bottom: 0px;
} }
.disabled{
.disabled {
::v-deep .el-upload--picture-card { ::v-deep .el-upload--picture-card {
display: none; display: none;
} }
} }
.uploadWrapper{
.uploadWrapper {
display: flex; display: flex;
flex-direction: column !important; flex-direction: column !important;
align-items: flex-start; align-items: flex-start;
} }
::v-deep .el-input.is-disabled .el-input__inner{
background-color: #646464a1; ::v-deep .el-input.is-disabled .el-input__inner {
} background-color: #646464a1;
::v-deep .el-input-group__append, .el-input-group__prepend{ }
::v-deep .el-input-group__append,
.el-input-group__prepend {
padding: 0 10px; padding: 0 10px;
} }
::v-deep .el-form-item__content { ::v-deep .el-form-item__content {
width: 100%; width: 100%;
} }
::v-deep .el-select.is-disabled .el-input__inner{
::v-deep .el-select.is-disabled .el-input__inner {
background-color: #646464a1; background-color: #646464a1;
} }
// ::v-deep .el-radio__input.is-disabled.is-checked .el-radio__inner { // ::v-deep .el-radio__input.is-disabled.is-checked .el-radio__inner {
// background-color: #428bca; // background-color: #428bca;
// border-color: #428bca; // border-color: #428bca;
// } // }</style>
</style>

View File

@ -283,7 +283,7 @@ export default {
getOuterFormData(childrens, formData = {}) { getOuterFormData(childrens, formData = {}) {
childrens.forEach(item => { childrens.forEach(item => {
if (item.Type !== 'group' && item.Type !== 'summary') { if (item.Type !== 'group' && item.Type !== 'summary') {
formData[item.Id] = item.Answer || '' formData[item.Id] = item.Answer ? item.OptionTypeEnum === 1 ? JSON.parse(item.Answer) : item.Answer : ''
if (item.QuestionType === 44) { if (item.QuestionType === 44) {
// //
this.imageQualityId = item.Id this.imageQualityId = item.Id

View File

@ -27,6 +27,10 @@
<span v-else-if="item.Type === 'number'"> <span v-else-if="item.Type === 'number'">
{{ scope.row[item.Id] ? parseFloat(scope.row[item.Id]).toFixed(digitPlaces) : null }} {{ scope.row[item.Id] ? parseFloat(scope.row[item.Id]).toFixed(digitPlaces) : null }}
</span> </span>
<span v-else-if="item.Type === 'select' && item.OptionTypeEnum === 1">
{{ scope.row[item.Id] && Array.isArray(scope.row[item.Id]) ?
scope.row[item.Id].join(',') : scope.row[item.Id] }}
</span>
<span v-else> <span v-else>
{{ scope.row[item.Id] }} {{ scope.row[item.Id] }}
</span> </span>
@ -92,6 +96,7 @@
:autosize="{ minRows: 2, maxRows: 4 }" :disabled="readingTaskState === 2" /> :autosize="{ minRows: 2, maxRows: 4 }" :disabled="readingTaskState === 2" />
<!-- 下拉框 --> <!-- 下拉框 -->
<el-select v-if="question.Type === 'select'" v-model="questionForm[question.Id]" clearable <el-select v-if="question.Type === 'select'" v-model="questionForm[question.Id]" clearable
:multiple="question.OptionTypeEnum === 1"
:disabled="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && !!question.DictionaryCode || readingTaskState === 2" :disabled="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && !!question.DictionaryCode || readingTaskState === 2"
@change="((val) => { formItemChange(val, question) })"> @change="((val) => { formItemChange(val, question) })">
<template v-if="question.TableQuestionType === 1"> <template v-if="question.TableQuestionType === 1">
@ -636,7 +641,7 @@ export default {
for (const k in this.QuestionsForm) { for (const k in this.QuestionsForm) {
if (reg.test(k)) { if (reg.test(k)) {
if (answers.findIndex(i => i.tableQuestionId === k) === -1) { if (answers.findIndex(i => i.tableQuestionId === k) === -1) {
answers.push({ tableQuestionId: k, answer: this.QuestionsForm[k] }) answers.push({ tableQuestionId: k, answer: Array.isArray(this.QuestionsForm[k]) ? JSON.stringify(this.QuestionsForm[k]) : this.QuestionsForm[k] })
} }
} }
} }
@ -744,7 +749,7 @@ export default {
} }
}, },
logic(rules, num = 0) { logic(rules, num = 0) {
let isNE = false let isNE = false, isNAN = false
try { try {
if (rules.CalculateQuestionList.length === 0) { if (rules.CalculateQuestionList.length === 0) {
return false return false
@ -762,6 +767,8 @@ export default {
} else { } else {
num *= parseFloat(q[o.TableQuestionId]) num *= parseFloat(q[o.TableQuestionId])
} }
} else {
isNAN = true
} }
if (q[o.TableQuestionId] === 'NE') { if (q[o.TableQuestionId] === 'NE') {
@ -777,6 +784,8 @@ export default {
} else { } else {
num += parseFloat(q[o.TableQuestionId]) num += parseFloat(q[o.TableQuestionId])
} }
} else {
isNAN = true
} }
if (q[o.TableQuestionId] === 'NE') { if (q[o.TableQuestionId] === 'NE') {
@ -792,6 +801,8 @@ export default {
} else { } else {
num += parseFloat(q[o.TableQuestionId]) num += parseFloat(q[o.TableQuestionId])
} }
} else {
isNAN = true
} }
if (q[o.TableQuestionId] === 'NE') { if (q[o.TableQuestionId] === 'NE') {
@ -805,6 +816,8 @@ export default {
this.questionForm[o.QuestionId].forEach(q => { this.questionForm[o.QuestionId].forEach(q => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
arr.push(q[o.TableQuestionId]) arr.push(q[o.TableQuestionId])
} else {
isNAN = true
} }
if (q[o.TableQuestionId] === 'NE') { if (q[o.TableQuestionId] === 'NE') {
@ -818,6 +831,8 @@ export default {
this.questionForm[o.QuestionId].forEach(q => { this.questionForm[o.QuestionId].forEach(q => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
arr.push(q[o.TableQuestionId]) arr.push(q[o.TableQuestionId])
} else {
isNAN = true
} }
if (q[o.TableQuestionId] === 'NE') { if (q[o.TableQuestionId] === 'NE') {
isNE = true isNE = true
@ -832,6 +847,8 @@ export default {
} }
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = parseFloat(this.questionForm[o.TableQuestionId]) num = parseFloat(this.questionForm[o.TableQuestionId])
} else {
isNAN = true
} }
if (!isNaN(num)) { if (!isNaN(num)) {
dataArr.push(num) dataArr.push(num)
@ -845,18 +862,24 @@ export default {
case 1: case 1:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num += parseFloat(this.questionForm[o.TableQuestionId]) num += parseFloat(this.questionForm[o.TableQuestionId])
} else {
isNAN = true
} }
break; break;
case 2: case 2:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num -= parseFloat(this.questionForm[o.TableQuestionId]) num -= parseFloat(this.questionForm[o.TableQuestionId])
} else {
isNAN = true
} }
break; break;
case 3: case 3:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num *= parseFloat(this.questionForm[o.TableQuestionId]) num *= parseFloat(this.questionForm[o.TableQuestionId])
} else {
isNAN = true
} }
break; break;
@ -867,12 +890,16 @@ export default {
} else { } else {
num /= parseFloat(this.questionForm[o.TableQuestionId]) num /= parseFloat(this.questionForm[o.TableQuestionId])
} }
} else {
isNAN = true
} }
break; break;
case 10: case 10:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
} else {
isNAN = true
} }
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => { num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => {
return acc + (typeof curr === "number" ? curr : 0); return acc + (typeof curr === "number" ? curr : 0);
@ -881,27 +908,43 @@ export default {
case 11: case 11:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
} else {
isNAN = true
} }
num = Math.max(...dataArr); num = Math.max(...dataArr);
break; break;
case 12: case 12:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
} else {
isNAN = true
} }
num = Math.min(...dataArr); num = Math.min(...dataArr);
break; break;
case 13: case 13:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
} else {
isNAN = true
} }
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr) ? 1 : 0 num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr) ? 1 : 0
break; break;
case 14: case 14:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
} else {
isNAN = true
} }
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc || curr, 0) ? 1 : 0; num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc || curr, 0) ? 1 : 0;
break; break;
case 15:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = Math.abs(num)
}
else {
isNAN = true
}
break;
} }
} }
}) })
@ -911,7 +954,7 @@ export default {
if (isNE) { if (isNE) {
return 'NE' return 'NE'
} }
if (isNaN(num)) { if (isNAN) {
return null return null
} }
if (rules.ValueType === 2) { if (rules.ValueType === 2) {
@ -964,7 +1007,7 @@ export default {
var CalculateQuestions = JSON.parse(v.CalculateQuestions); var CalculateQuestions = JSON.parse(v.CalculateQuestions);
var num, var num,
arr = []; arr = [];
let isNE = false let isNE = false, isNAN = false
CalculateQuestions.forEach((o, i) => { CalculateQuestions.forEach((o, i) => {
if (this.QuestionsForm[o.TableQuestionId] === 'NE') { if (this.QuestionsForm[o.TableQuestionId] === 'NE') {
isNE = true isNE = true
@ -973,6 +1016,8 @@ export default {
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num = parseFloat(this.QuestionsForm[o.TableQuestionId]); num = parseFloat(this.QuestionsForm[o.TableQuestionId]);
arr = [num]; arr = [num];
} else {
isNAN = true
} }
} else { } else {
@ -980,24 +1025,32 @@ export default {
case 1: case 1:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num += parseFloat(this.QuestionsForm[o.TableQuestionId]); num += parseFloat(this.QuestionsForm[o.TableQuestionId]);
} else {
isNAN = true
} }
break; break;
case 2: case 2:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num -= parseFloat(this.QuestionsForm[o.TableQuestionId]); num -= parseFloat(this.QuestionsForm[o.TableQuestionId]);
} else {
isNAN = true
} }
break; break;
case 3: case 3:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num *= parseFloat(this.QuestionsForm[o.TableQuestionId]); num *= parseFloat(this.QuestionsForm[o.TableQuestionId]);
} else {
isNAN = true
} }
break; break;
case 4: case 4:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
num /= parseFloat(this.QuestionsForm[o.TableQuestionId]); num /= parseFloat(this.QuestionsForm[o.TableQuestionId]);
} else {
isNAN = true
} }
break; break;
@ -1006,6 +1059,9 @@ export default {
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId])); arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]));
} }
else {
isNAN = true
}
num = num =
arr.length === 0 arr.length === 0
? 0 ? 0
@ -1016,6 +1072,8 @@ export default {
case 8: case 8:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId])); arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]));
} else {
isNAN = true
} }
num = arr.length === 0 ? 0 : Math.max(...arr); num = arr.length === 0 ? 0 : Math.max(...arr);
@ -1023,6 +1081,8 @@ export default {
case 9: case 9:
if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.QuestionsForm[o.TableQuestionId]))) {
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId])); arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]));
} else {
isNAN = true
} }
num = arr.length === 0 ? 0 : Math.min(...arr); num = arr.length === 0 ? 0 : Math.min(...arr);
@ -1034,6 +1094,9 @@ export default {
if (isNE) { if (isNE) {
num = 'NE' num = 'NE'
} }
if (isNAN) {
num = ''
}
this.$set(this.QuestionsForm, v.Id, num.toString()); this.$set(this.QuestionsForm, v.Id, num.toString());
} }
}); });
@ -1198,11 +1261,12 @@ export default {
const referencedImageId = annotation?.metadata?.referencedImageId const referencedImageId = annotation?.metadata?.referencedImageId
if (!referencedImageId) return null if (!referencedImageId) return null
const cacheKey = `imageId:${referencedImageId}` const cacheKey = `imageId:${referencedImageId}`
const cachedStats = annotation.data?.cachedStats?.[cacheKey] const points = ['x', 'y', 'z'];
const cachedStats = annotation.markTool === "ArrowAnnotate" ? annotation.data?.handles?.points[0] : annotation.data?.cachedStats?.[cacheKey]
const hasProp = cachedStats const hasProp = cachedStats
&& Object.prototype.hasOwnProperty.call(cachedStats, prop) && (Object.prototype.hasOwnProperty.call(cachedStats, prop) || cachedStats[points.indexOf(prop)])
if (!hasProp) return null if (!hasProp) return null
const value = cachedStats[prop] const value = annotation.markTool === "ArrowAnnotate" ? cachedStats[points.indexOf(prop)] : cachedStats[prop]
return value !== null return value !== null
? parseFloat(value).toFixed(this.digitPlaces) ? parseFloat(value).toFixed(this.digitPlaces)
: value : value

View File

@ -181,6 +181,9 @@ export default {
if (i.Type !== 'group' && i.Type !== 'summary' && i.Id && i.Type !== 'table' && i.Type !== 'basicTable') { if (i.Type !== 'group' && i.Type !== 'summary' && i.Id && i.Type !== 'table' && i.Type !== 'basicTable') {
this.$set(this.questionForm, i.Id, i.Answer) this.$set(this.questionForm, i.Id, i.Answer)
} }
if (i.Type === 'select' && i.OptionTypeEnum === 1) {
this.$set(this.questionForm, i.Id, i.Answer ? JSON.parse(i.Answer) : [])
}
if (i.Type === 'table' || i.Type === 'basicTable') { if (i.Type === 'table' || i.Type === 'basicTable') {
i.TableQuestions.Questions.forEach(o => { i.TableQuestions.Questions.forEach(o => {
if (o.Type === 'number') { if (o.Type === 'number') {
@ -188,6 +191,11 @@ export default {
this.$set(i.TableQuestions.Answers[index], o.Id, isNaN(parseFloat(i.TableQuestions.Answers[index][o.Id])) ? i.TableQuestions.Answers[index][o.Id] : parseFloat(i.TableQuestions.Answers[index][o.Id]).toFixed(this.digitPlaces)) this.$set(i.TableQuestions.Answers[index], o.Id, isNaN(parseFloat(i.TableQuestions.Answers[index][o.Id])) ? i.TableQuestions.Answers[index][o.Id] : parseFloat(i.TableQuestions.Answers[index][o.Id]).toFixed(this.digitPlaces))
}) })
} }
if (o.Type === 'select' && o.OptionTypeEnum === 1) {
i.TableQuestions.Answers.forEach((ite, index) => {
this.$set(i.TableQuestions.Answers[index], o.Id, i.TableQuestions.Answers[index][o.Id] ? JSON.parse(i.TableQuestions.Answers[index][o.Id]) : [])
})
}
}) })
this.$set(this.questionForm, i.Id, i.TableQuestions.Answers) this.$set(this.questionForm, i.Id, i.TableQuestions.Answers)
} }
@ -220,7 +228,11 @@ export default {
try { try {
var answers = [] var answers = []
for (const k in this.questionForm) { for (const k in this.questionForm) {
if (this.questionForm[k] instanceof Array) { } else { if (this.questionForm[k] instanceof Array) {
if (this.questionForm[k].length > 0 && Object.prototype.toString.call(this.questionForm[k][0]) === '[object String]') {
answers.push({ id: k, answer: JSON.stringify(this.questionForm[k]) })
}
} else {
answers.push({ id: k, answer: this.questionForm[k] }) answers.push({ id: k, answer: this.questionForm[k] })
} }
} }
@ -261,7 +273,11 @@ export default {
this.loading = true this.loading = true
var answers = [] var answers = []
for (const k in this.questionForm) { for (const k in this.questionForm) {
if (this.questionForm[k] instanceof Array) { } else { if (this.questionForm[k] instanceof Array) {
if (this.questionForm[k].length > 0 && Object.prototype.toString.call(this.questionForm[k][0]) === '[object String]') {
answers.push({ id: k, answer: JSON.stringify(this.questionForm[k]) })
}
} else {
answers.push({ readingQuestionTrialId: k, answer: this.questionForm[k] }) answers.push({ readingQuestionTrialId: k, answer: this.questionForm[k] })
} }
} }
@ -952,11 +968,12 @@ export default {
const referencedImageId = annotation?.metadata?.referencedImageId const referencedImageId = annotation?.metadata?.referencedImageId
if (!referencedImageId) return null if (!referencedImageId) return null
const cacheKey = `imageId:${referencedImageId}` const cacheKey = `imageId:${referencedImageId}`
const cachedStats = annotation.data?.cachedStats?.[cacheKey] const points = ['x', 'y', 'z']
const cachedStats = annotation.markTool === "ArrowAnnotate" ? annotation.data?.handles?.points[0] : annotation.data?.cachedStats?.[cacheKey]
const hasProp = cachedStats const hasProp = cachedStats
&& Object.prototype.hasOwnProperty.call(cachedStats, prop) && (Object.prototype.hasOwnProperty.call(cachedStats, prop) || cachedStats[points.indexOf(prop)])
if (!hasProp) return null if (!hasProp) return null
const value = cachedStats[prop] const value = annotation.markTool === "ArrowAnnotate" ? cachedStats[points.indexOf(prop)] : cachedStats[prop]
return value !== null return value !== null
? parseFloat(value).toFixed(this.digitPlaces) ? parseFloat(value).toFixed(this.digitPlaces)
: value : value

View File

@ -22,6 +22,7 @@
:autosize="{ minRows: 2, maxRows: 4 }" /> :autosize="{ minRows: 2, maxRows: 4 }" />
<!-- 下拉框 --> <!-- 下拉框 -->
<el-select v-if="question.Type === 'select'" v-model="questionForm[question.Id]" clearable <el-select v-if="question.Type === 'select'" v-model="questionForm[question.Id]" clearable
:multiple="question.OptionTypeEnum === 1"
:disabled="(question.TableQuestionType === 2 || question.IsPreinstall || question.QuestionGenre === 2) || (question.IsCopy && type === 'edit' && !IsBaseline && questionForm.IsCurrentTaskAdd === 'False')" :disabled="(question.TableQuestionType === 2 || question.IsPreinstall || question.QuestionGenre === 2) || (question.IsCopy && type === 'edit' && !IsBaseline && questionForm.IsCurrentTaskAdd === 'False')"
@change="((val) => { formItemChange(val, question) })"> @change="((val) => { formItemChange(val, question) })">
<template v-if="question.TableQuestionType === 1"> <template v-if="question.TableQuestionType === 1">
@ -62,7 +63,8 @@
<el-input v-if="question.Type === 'class' && question.ClassifyShowType === 1" <el-input v-if="question.Type === 'class' && question.ClassifyShowType === 1"
v-model="questionForm[question.Id]" /> v-model="questionForm[question.Id]" />
<el-select v-if="question.Type === 'class' && question.ClassifyShowType === 2" v-model="questionForm[question.Id]" <el-select v-if="question.Type === 'class' && question.ClassifyShowType === 2" v-model="questionForm[question.Id]"
:disabled="!question.ClassifyEditType || question.IsPreinstall" @change="(val) => { formItemChange(val, question) }"> :disabled="!question.ClassifyEditType || question.IsPreinstall"
@change="(val) => { formItemChange(val, question) }">
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val.trim()" :value="val.trim()" /> <el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val.trim()" :value="val.trim()" />
</el-select> </el-select>
<el-radio-group v-if="question.Type === 'class' && question.ClassifyShowType === 3" <el-radio-group v-if="question.Type === 'class' && question.ClassifyShowType === 3"
@ -158,9 +160,9 @@
</el-input> </el-input>
</template> </template>
<!-- 上传图像 --> <!-- 上传图像 -->
<el-upload v-if="question.Type === 'upload' || question.Type === 'screenshot'" :disabled="readingTaskState === 2 || question.IsPreinstall" <el-upload v-if="question.Type === 'upload' || question.Type === 'screenshot'"
action :accept="question.FileType" :limit="question.ImageCount === 0 ? 100 : question.ImageCount" :disabled="readingTaskState === 2 || question.IsPreinstall" action :accept="question.FileType"
:on-preview="handlePictureCardPreview" :limit="question.ImageCount === 0 ? 100 : question.ImageCount" :on-preview="handlePictureCardPreview"
:before-upload="(file) => { return handleBeforeUpload(file, question.FileType, question.Type) }" :before-upload="(file) => { return handleBeforeUpload(file, question.FileType, question.Type) }"
:http-request="uploadScreenshot" :on-remove="handleRemove" :file-list="fileList" :http-request="uploadScreenshot" :on-remove="handleRemove" :file-list="fileList"
:class="{ disabled: question.ImageCount === 0 ? false : fileList.length >= question.ImageCount }"> :class="{ disabled: question.ImageCount === 0 ? false : fileList.length >= question.ImageCount }">

View File

@ -68,24 +68,35 @@
<el-select <el-select
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type === 'select' || scope.row.Type === 'radio') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)" v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type === 'select' || scope.row.Type === 'radio') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]" v-model="questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]"
size="mini" clearable> size="mini" clearable :multiple="scope.row.OptionTypeEnum === 1">
<template> <template>
<el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val" :value="val" /> <el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val" :value="val" />
</template> </template>
</el-select> </el-select>
<span <span
v-else-if="questionForm[scope.row.QuestionId] instanceof Array && (scope.row.Type === 'select' || scope.row.Type === 'radio')"> v-else-if="questionForm[scope.row.QuestionId] instanceof Array && questionForm[scope.row.QuestionId][scope.row.xfIndex] && questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] && (scope.row.Type === 'select' || scope.row.Type === 'radio')">
{{ questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId] }} {{
Array.isArray(questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId])
?
questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId].join(',') :
questionForm[scope.row.QuestionId][scope.row.xfIndex][scope.row.TableQuestionId]
}}
</span> </span>
<el-select <el-select
v-else-if="(scope.row.Type === 'select' || scope.row.Type === 'radio') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)" v-else-if="(scope.row.Type === 'select' || scope.row.Type === 'radio') && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
v-model="questionForm[scope.row.QuestionId]" size="mini" clearable> v-model="questionForm[scope.row.QuestionId]" size="mini" clearable
:multiple="scope.row.OptionTypeEnum === 1">
<template> <template>
<el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val" :value="val" /> <el-option v-for="val in scope.row.TypeValue.split('|')" :key="val" :label="val" :value="val" />
</template> </template>
</el-select> </el-select>
<span v-else-if="scope.row.Type === 'select' || scope.row.Type === 'radio'"> <span v-else-if="scope.row.Type === 'select' || scope.row.Type === 'radio'">
{{ questionForm[scope.row.QuestionId] }} {{
questionForm[scope.row.QuestionId] && Array.isArray(questionForm[scope.row.QuestionId]) ?
questionForm[scope.row.QuestionId].join(',') :
questionForm[scope.row.QuestionId]
}}
</span> </span>
<el-input <el-input
v-else-if="scope.row.DataSource !== 1 && questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type === 'number' && (scope.row.xfIndex || scope.row.xfIndex === 0) && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)" v-else-if="scope.row.DataSource !== 1 && questionForm[scope.row.QuestionId] instanceof Array && scope.row.Type === 'number' && (scope.row.xfIndex || scope.row.xfIndex === 0) && !scope.row.IsShowInDicom && ((task.IsBaseLine && scope.row.LimitEdit === 1) || (!task.IsBaseLine && scope.row.LimitEdit === 2) || scope.row.LimitEdit === 0)"
@ -160,7 +171,10 @@
</span> </span>
</template> </template>
<template v-else-if="scope.row.DictionaryCode"> <template v-else-if="scope.row.DictionaryCode">
{{ $fd(scope.row.DictionaryCode, scope.row.Answers[task.VisitTaskId]) }} {{scope.row.Answers[task.VisitTaskId] instanceof Array
? scope.row.Answers[task.VisitTaskId].map(item => $fd(scope.row.DictionaryCode,
item)).join(",") : $fd(scope.row.DictionaryCode,
scope.row.Answers[task.VisitTaskId])}}
</template> </template>
<template v-else-if="criterionType === 10"> <template v-else-if="criterionType === 10">
{{ {{
@ -430,7 +444,7 @@ export default {
}) })
}, },
logic(rules, num = 0) { logic(rules, num = 0) {
let isNE = false let isNE = false, isNAN = false
try { try {
if (rules.CalculateQuestionList.length === 0) { if (rules.CalculateQuestionList.length === 0) {
return false return false
@ -451,6 +465,8 @@ export default {
} else { } else {
num *= parseFloat(q[o.TableQuestionId]) num *= parseFloat(q[o.TableQuestionId])
} }
} else {
isNAN = true
} }
if (q[o.TableQuestionId] === 'NE') { if (q[o.TableQuestionId] === 'NE') {
@ -466,6 +482,8 @@ export default {
} else { } else {
num += isNaN(parseFloat(q[o.TableQuestionId])) ? null : parseFloat(q[o.TableQuestionId]) num += isNaN(parseFloat(q[o.TableQuestionId])) ? null : parseFloat(q[o.TableQuestionId])
} }
} else {
isNAN = true
} }
if (q[o.TableQuestionId] === 'NE') { if (q[o.TableQuestionId] === 'NE') {
isNE = true isNE = true
@ -480,6 +498,8 @@ export default {
} else { } else {
num += parseFloat(q[o.TableQuestionId]) num += parseFloat(q[o.TableQuestionId])
} }
} else {
isNAN = true
} }
if (q[o.TableQuestionId] === 'NE') { if (q[o.TableQuestionId] === 'NE') {
isNE = true isNE = true
@ -492,6 +512,8 @@ export default {
this.questionForm[o.QuestionId].forEach(q => { this.questionForm[o.QuestionId].forEach(q => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
arr.push(q[o.TableQuestionId]) arr.push(q[o.TableQuestionId])
} else {
isNAN = true
} }
if (q[o.TableQuestionId] === 'NE') { if (q[o.TableQuestionId] === 'NE') {
@ -505,6 +527,8 @@ export default {
this.questionForm[o.QuestionId].forEach(q => { this.questionForm[o.QuestionId].forEach(q => {
if (!isNaN(parseFloat(q[o.TableQuestionId]))) { if (!isNaN(parseFloat(q[o.TableQuestionId]))) {
arr.push(q[o.TableQuestionId]) arr.push(q[o.TableQuestionId])
} else {
isNAN = true
} }
if (q[o.TableQuestionId] === 'NE') { if (q[o.TableQuestionId] === 'NE') {
isNE = true isNE = true
@ -516,6 +540,8 @@ export default {
} else { } else {
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = parseFloat(this.questionForm[o.TableQuestionId]) num = parseFloat(this.questionForm[o.TableQuestionId])
} else {
isNAN = true
} }
} }
@ -524,24 +550,32 @@ export default {
case 1: case 1:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num += parseFloat(this.questionForm[o.TableQuestionId]) num += parseFloat(this.questionForm[o.TableQuestionId])
} else {
isNAN = true
} }
break break
case 2: case 2:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num -= parseFloat(this.questionForm[o.TableQuestionId]) num -= parseFloat(this.questionForm[o.TableQuestionId])
} else {
isNAN = true
} }
break break
case 3: case 3:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num *= parseFloat(this.questionForm[o.TableQuestionId]) num *= parseFloat(this.questionForm[o.TableQuestionId])
} else {
isNAN = true
} }
break break
case 4: case 4:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num /= parseFloat(this.questionForm[o.TableQuestionId]) num /= parseFloat(this.questionForm[o.TableQuestionId])
} else {
isNAN = true
} }
// num /= parseFloat(this.questionForm[o.TableQuestionId]) // num /= parseFloat(this.questionForm[o.TableQuestionId])
@ -549,6 +583,8 @@ export default {
case 10: case 10:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
} else {
isNAN = true
} }
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => { num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => {
return acc + (typeof curr === "number" ? curr : 0); return acc + (typeof curr === "number" ? curr : 0);
@ -557,27 +593,40 @@ export default {
case 11: case 11:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
} else {
isNAN = true
} }
num = Math.max(...dataArr); num = Math.max(...dataArr);
break; break;
case 12: case 12:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
} else {
isNAN = true
} }
num = Math.min(...dataArr); num = Math.min(...dataArr);
break; break;
case 13: case 13:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
} else {
isNAN = true
} }
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr) ? 1 : 0 num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr) ? 1 : 0
break; break;
case 14: case 14:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
} else {
isNAN = true
} }
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc || curr, 0) ? 1 : 0; num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc || curr, 0) ? 1 : 0;
break; break;
case 15:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
num = Math.abs(num)
}
break;
} }
} }
}) })
@ -587,6 +636,9 @@ export default {
if (isNE) { if (isNE) {
return 'NE' return 'NE'
} }
if (isNAN) {
return null
}
if (rules.ValueType === 2) { if (rules.ValueType === 2) {
num = num * 100 num = num * 100
} }
@ -614,39 +666,54 @@ export default {
}).catch(() => { this.loading = false }) }).catch(() => { this.loading = false })
}, },
getQuestions(questions) { getQuestions(questions) {
const arr = [] try {
if (questions.length !== 0) { const arr = []
questions.forEach((item) => { if (questions.length !== 0) {
const obj = item questions.forEach((item) => {
this.$set(obj, 'Answers', {}) const obj = item
item.Answer.forEach(i => { this.$set(obj, 'Answers', {})
if (item.DictionaryCode) { item.Answer.forEach(i => {
this.$set(obj.Answers, i.VisitTaskId, i.Answer ? parseInt(i.Answer) : null) if (item.DictionaryCode) {
// obj.Answers[i.VisitTaskId] = i.Answer ? parseInt(i.Answer) : null if (item.Type === 'select' && item.OptionTypeEnum === 1) {
} else { let val = i.Answer ? JSON.parse(i.Answer) : []
if (item.Type === 'number') { this.$set(obj.Answers, i.VisitTaskId, val)
let val = null
if (item.ValueType === 0) {
val = isNaN(parseFloat(i.Answer)) ? i.Answer : parseInt(i.Answer)
} else if (item.ValueType === 3) {
val = i.Answer
} else { } else {
val = isNaN(parseFloat(i.Answer)) ? i.Answer : parseFloat(i.Answer).toFixed(this.digitPlaces) this.$set(obj.Answers, i.VisitTaskId, i.Answer ? parseInt(i.Answer) : null)
} }
this.$set(obj.Answers, i.VisitTaskId, val)
// obj.Answers[i.VisitTaskId] = i.Answer ? parseInt(i.Answer) : null
} else { } else {
this.$set(obj.Answers, i.VisitTaskId, i.Answer) if (item.Type === 'number') {
let val = null
if (item.ValueType === 0) {
val = isNaN(parseFloat(i.Answer)) ? i.Answer : parseInt(i.Answer)
} else if (item.ValueType === 3) {
val = i.Answer
} else {
val = isNaN(parseFloat(i.Answer)) ? i.Answer : parseFloat(i.Answer).toFixed(this.digitPlaces)
}
this.$set(obj.Answers, i.VisitTaskId, val)
} else if (item.Type === 'select' && item.OptionTypeEnum === 1) {
let val = i.Answer ? JSON.parse(i.Answer) : []
this.$set(obj.Answers, i.VisitTaskId, val)
} else {
this.$set(obj.Answers, i.VisitTaskId, i.Answer)
}
// obj.Answers[i.VisitTaskId] = i.Answer
} }
// obj.Answers[i.VisitTaskId] = i.Answer })
if (item.Childrens.length >= 1) {
obj.Childrens = this.getQuestions(item.Childrens)
} }
arr.push(obj)
}) })
if (item.Childrens.length >= 1) { }
obj.Childrens = this.getQuestions(item.Childrens) return arr
} } catch (err) {
arr.push(obj) console.log(err)
})
} }
return arr
}, },
handleShowDetail(val) { handleShowDetail(val) {
this.getReportInfo() this.getReportInfo()

View File

@ -261,7 +261,7 @@ const config = {
'name': '箭头工具', 'name': '箭头工具',
'icon': 'arrow', 'icon': 'arrow',
'toolName': 'ArrowAnnotate', 'toolName': 'ArrowAnnotate',
'props': [], 'props': ['x', 'y', 'z'],
'i18nKey': 'trials:reading:button:arrowAnnotate', 'i18nKey': 'trials:reading:button:arrowAnnotate',
'isDisabled': false, 'isDisabled': false,
'disabledReason': '' 'disabledReason': ''

View File

@ -225,6 +225,17 @@
</el-form-item> </el-form-item>
<!-- 私有属性 --> <!-- 私有属性 -->
<el-divider content-position="left">{{ $t('trials:readingUnit:title:privateProperties') }}</el-divider> <el-divider content-position="left">{{ $t('trials:readingUnit:title:privateProperties') }}</el-divider>
<!-- 下拉框单选或多选 -->
<el-form-item v-if="form.Type === 'select'" :label="$t('trials:readingUnit:qsList:title:MultipleSelect')"
prop="OptionTypeEnum" :rules="[
{ required: true, message: this.$t('common:ruleMessage:specify') }
]">
<el-radio-group v-model="form.OptionTypeEnum">
<el-radio v-for="item of $d.OptionType" :key="item.id" :label="item.value">
{{ item.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<!-- 数值类型 --> <!-- 数值类型 -->
<el-form-item v-if="form.Type === 'number'" :label="$t('trials:readingUnit:qsList:title:valueType')" <el-form-item v-if="form.Type === 'number'" :label="$t('trials:readingUnit:qsList:title:valueType')"
prop="ValueType" :rules="[ prop="ValueType" :rules="[
@ -737,7 +748,8 @@ export default {
ImageMarkEnum: 0, ImageMarkEnum: 0,
ImageTool: '', ImageTool: '',
ImageToolAttribute: '', ImageToolAttribute: '',
ExcludeShowVisitList: [] ExcludeShowVisitList: [],
OptionTypeEnum: 0
// IsEnable: true // IsEnable: true
}, },
@ -1246,6 +1258,7 @@ export default {
form.ImageMarkEnum = 0 form.ImageMarkEnum = 0
form.ImageTool = '' form.ImageTool = ''
form.ImageToolAttribute = '' form.ImageToolAttribute = ''
form.OptionTypeEnum = 0
this.imageToolAttributes = [] this.imageToolAttributes = []
}, },
getLesionType() { getLesionType() {

View File

@ -154,6 +154,17 @@
<!-- 私有属性 --> <!-- 私有属性 -->
<el-divider content-position="left">{{ $t('trials:readingUnit:title:privateProperties') }}</el-divider> <el-divider content-position="left">{{ $t('trials:readingUnit:title:privateProperties') }}</el-divider>
<!-- 下拉框单选或多选 -->
<el-form-item v-if="form.Type === 'select'" :label="$t('trials:readingUnit:qsList:title:MultipleSelect')"
prop="OptionTypeEnum" :rules="[
{ required: true, message: this.$t('common:ruleMessage:specify') }
]">
<el-radio-group v-model="form.OptionTypeEnum">
<el-radio v-for="item of $d.OptionType" :key="item.id" :label="item.value">
{{ item.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<!-- 问题数据来源 --> <!-- 问题数据来源 -->
<el-form-item v-if="form.Type === 'number'" :label="$t('trials:readingUnit:qsList:title:dataSource')" <el-form-item v-if="form.Type === 'number'" :label="$t('trials:readingUnit:qsList:title:dataSource')"
prop="DataSource" :rules="[ prop="DataSource" :rules="[
@ -600,6 +611,7 @@ export default {
ImageMarkEnum: 0, ImageMarkEnum: 0,
ImageTool: '', ImageTool: '',
ImageToolAttribute: '', ImageToolAttribute: '',
OptionTypeEnum: 0
// IsEnable: true // IsEnable: true
}, },
imageToolAttributes: [], imageToolAttributes: [],
@ -1110,6 +1122,7 @@ export default {
form.ImageMarkEnum = 0 form.ImageMarkEnum = 0
form.ImageTool = '' form.ImageTool = ''
form.ImageToolAttribute = '' form.ImageToolAttribute = ''
form.OptionTypeEnum = 0
this.imageToolAttributes = [] this.imageToolAttributes = []
}, },
close() { close() {

View File

@ -70,10 +70,10 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.IsHaveDicom" type="primary">{{ <el-tag v-if="scope.row.IsHaveDicom" type="primary">{{
$fd('IsDicom', true) $fd('IsDicom', true)
}}</el-tag> }}</el-tag>
<el-tag v-if="scope.row.IsHaveNoneDicom" type="primary">{{ <el-tag v-if="scope.row.IsHaveNoneDicom" type="primary">{{
$fd('IsDicom', false) $fd('IsDicom', false)
}}</el-tag> }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<!-- 影像数量 --> <!-- 影像数量 -->
@ -204,16 +204,16 @@ export default {
} }
let res = await getExportSubjectVisitImageList(data) let res = await getExportSubjectVisitImageList(data)
if (res.IsSuccess) { if (res.IsSuccess) {
this.downLoad(IsKeyImage, res.Result) this.downLoad(IsKeyImage, res.Result, IsExportReading)
} }
} catch (err) { } catch (err) {
console.log(err) console.log(err)
} }
}, },
// //
async downLoad(IsKeyImage = false, row) { async downLoad(IsKeyImage = false, row, IsExportReading = false) {
try { try {
let { files, name } = this.formatDownloadFile(IsKeyImage, row) let { files, name } = this.formatDownloadFile(IsKeyImage, row, IsExportReading)
let res = await downLoadFile(files, name, 'zip') let res = await downLoadFile(files, name, 'zip')
// } // }
} catch (err) { } catch (err) {
@ -221,24 +221,44 @@ export default {
} }
}, },
// //
formatDownloadFile(IsKeyImage = false, row) { formatDownloadFile(IsKeyImage = false, row, IsExportReading = false) {
let files = [], let files = [],
name = `${this.$route.query.researchProgramNo}_${this.$t('trials:imageSummary:downloadname:dicom')}_${Date.now()}.zip`; name = `${this.$route.query.researchProgramNo}_${this.$t('trials:imageSummary:downloadname:dicom')}_${Date.now()}.zip`;
if (IsExportReading) {
name = `${this.$route.query.researchProgramNo}_${this.$t('trials:imageSummary:downloadname:readingDicom')}_${Date.now()}.zip`;
}
if (!IsKeyImage) { if (!IsKeyImage) {
//ID/ID/访/Study ID_Study Date_Modality/ //ID/ID/访/Study ID_Study Date_Modality/
row.VisitList.forEach(visit => { row.VisitList.forEach(visit => {
if (visit.StudyList && visit.StudyList.length > 0) { if (visit.StudyList && visit.StudyList.length > 0) {
visit.StudyList.forEach(study => { visit.StudyList.forEach(study => {
let arr = []
study.SeriesList.forEach(item => {
if (!arr.includes(item.Modality)) {
arr.push(item.Modality)
}
})
let str = arr.join('_')
let time = study.StudyTime.split(' ')[0]
if (study.StudyDIRPath && !study.dirHas) {
study.dirHas = true
let obj = {
name: `${visit.TrialSiteCode}/${visit.SubjectCode}/${visit.VisitName}/${study.StudyCode}_${time}_${str}/DICOMDIR`,
url: this.OSSclientConfig.basePath + study.StudyDIRPath,
}
files.push(obj)
}
if (study.SeriesList && study.SeriesList.length > 0) { if (study.SeriesList && study.SeriesList.length > 0) {
study.SeriesList.forEach(serie => { study.SeriesList.forEach(serie => {
if (serie.InstancePathList && serie.InstancePathList.length > 0) {
serie.InstancePathList.forEach(instance => { if (serie.InstanceList && serie.InstanceList.length > 0) {
serie.InstanceList.forEach(instance => {
let instanceArr = instance.Path.split("/") let instanceArr = instance.Path.split("/")
let fileName = instanceArr[instanceArr.length - 1] let fileName = instance.FileName || instanceArr[instanceArr.length - 1]
let time = study.StudyTime.split(' ')[0]
let obj = { let obj = {
name: `${visit.TrialSiteCode}/${visit.SubjectCode}/${visit.VisitName}/${study.StudyCode}_${time}_${serie.Modality}/IMAGE/${fileName}`, name: `${visit.TrialSiteCode}/${visit.SubjectCode}/${visit.VisitName}/${study.StudyCode}_${time}_${str}/IMAGE/${fileName}`,
url: this.OSSclientConfig.basePath + instance.Path, url: this.OSSclientConfig.basePath + instance.Path,
IsEncapsulated: instance.IsEncapsulated
} }
files.push(obj) files.push(obj)
}) })