Merge branch 'uat'
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
# Conflicts: # src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue # src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue # src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionList.vuemain
commit
f995b61c04
|
@ -237,7 +237,7 @@
|
|||
@change="(val) => { formItemNumberChange(val, question) }"
|
||||
@input="numberInput(question.Id)"
|
||||
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
|
||||
v-model="questionForm[question.Id]"
|
||||
v-model.trim="questionForm[question.Id]"
|
||||
:disabled="readingTaskState === 2"
|
||||
>
|
||||
<!-- <template slot="append">1</template> -->
|
||||
|
@ -250,7 +250,7 @@
|
|||
v-if="question.Type === 'number' && !question.TypeValue && question.DataSource === 1"
|
||||
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
|
||||
:disabled="question.DataSource === 1 || readingTaskState === 2"
|
||||
v-model="questionForm[question.Id]"
|
||||
v-model.trim="questionForm[question.Id]"
|
||||
>
|
||||
<!-- <template slot="append">2</template> -->
|
||||
<template slot="append" v-if="question.Unit !== 0">{{question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit}}</template>
|
||||
|
@ -531,8 +531,8 @@ export default {
|
|||
}
|
||||
},
|
||||
handleBlur(value, a, b) {
|
||||
let reg = new RegExp(/[a-zA-Z]/, 'ig')
|
||||
if(!reg.test(value)) {
|
||||
if (!value) return false
|
||||
if(!isNaN(parseFloat(value))) {
|
||||
this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
|
||||
}
|
||||
},
|
||||
|
@ -1109,8 +1109,6 @@ export default {
|
|||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
}
|
||||
::v-deep .el-form-item__content{
|
||||
}
|
||||
.el-input{
|
||||
width:100%;
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@
|
|||
@change="((val)=>{formItemNumberChange(val, question)})"
|
||||
@input="numberInput(question.Id)"
|
||||
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
|
||||
v-model="questionForm[question.Id]"
|
||||
v-model.trim="questionForm[question.Id]"
|
||||
>
|
||||
<template slot="append" v-if="question.Unit !== 0">{{question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit}}</template>
|
||||
</el-input>
|
||||
|
@ -164,7 +164,7 @@
|
|||
:disabled="question.DataSource === 1"
|
||||
@input="numberInput(question.Id, true )"
|
||||
@blur="handleCalculationBlur(calculationValue)"
|
||||
v-model="calculationValue"
|
||||
v-model.trim="calculationValue"
|
||||
>
|
||||
<template slot="append" v-if="question.Unit !== 0">{{question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit}}</template>
|
||||
</el-input>
|
||||
|
@ -337,7 +337,6 @@ export default {
|
|||
this.fileList.push({ name: '', url: `${url}` })
|
||||
})
|
||||
}
|
||||
console.log('11')
|
||||
}
|
||||
if (this.type === 'edit') return
|
||||
// if (this.question.Type === 'number') {
|
||||
|
@ -350,7 +349,7 @@ export default {
|
|||
methods: {
|
||||
numberInput(id,notId = false) {
|
||||
if(notId ) {
|
||||
// this.calculationValue = this.calculationValue.toUpperCase();
|
||||
this.calculationValue = this.calculationValue.toUpperCase();
|
||||
}else {
|
||||
this.questionForm[id] = this.questionForm[id].toUpperCase();
|
||||
}
|
||||
|
@ -407,14 +406,17 @@ export default {
|
|||
}
|
||||
},
|
||||
handleBlur(value, a, b) {
|
||||
let reg = new RegExp(/[a-zA-Z]/, 'ig')
|
||||
if(!reg.test(value)) {
|
||||
if (!value) return false
|
||||
if(!isNaN(parseFloat(value))) {
|
||||
this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
|
||||
}
|
||||
// this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
|
||||
},
|
||||
handleCalculationBlur(v) {
|
||||
if (!v) return false
|
||||
if(!isNaN(parseFloat(v))) {
|
||||
this.calculationValue = parseFloat(v).toFixed(this.digitPlaces)
|
||||
}
|
||||
},
|
||||
limitInput(value, q) {
|
||||
console.log(value)
|
||||
|
|
|
@ -137,7 +137,7 @@ export default {
|
|||
this.classArr.push({triggerId: v.ClassifyQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType})
|
||||
}
|
||||
if (v.Type === 'number') {
|
||||
this.$set(this.questionForm, v.Id, v.Answer === '' ? '' : parseFloat(v.Answer).toFixed(this.digitPlaces))
|
||||
this.$set(this.questionForm, v.Id, isNaN(parseFloat(v.Answer)) ? v.Answer : parseFloat(v.Answer).toFixed(this.digitPlaces))
|
||||
}
|
||||
if (v.Childrens.length > 0) {
|
||||
this.setChild(v.Childrens)
|
||||
|
@ -191,7 +191,7 @@ export default {
|
|||
this.$set(this.questionForm, v.Id, v.TableQuestions.Answers)
|
||||
}
|
||||
if (v.Type === 'number') {
|
||||
this.$set(this.questionForm, v.Id, v.Answer === '' ? '' : parseFloat(v.Answer).toFixed(this.digitPlaces))
|
||||
this.$set(this.questionForm, v.Id, isNaN(parseFloat(v.Answer)) ? v.Answer : parseFloat(v.Answer).toFixed(this.digitPlaces))
|
||||
}
|
||||
if (v.Childrens.length > 0) {
|
||||
this.setChild(v.Childrens)
|
||||
|
@ -212,7 +212,7 @@ export default {
|
|||
i.TableQuestions.Questions.forEach(o => {
|
||||
if (o.Type === 'number') {
|
||||
i.TableQuestions.Answers.forEach((ite, index) => {
|
||||
this.$set(i.TableQuestions.Answers[index], o.Id, i.TableQuestions.Answers[index][o.Id] ? parseFloat(i.TableQuestions.Answers[index][o.Id]).toFixed(this.digitPlaces) : null)
|
||||
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))
|
||||
})
|
||||
}
|
||||
})
|
||||
|
@ -222,7 +222,7 @@ export default {
|
|||
this.classArr.push({triggerId: i.ClassifyQuestionId, classId: i.Id, classifyAlgorithms: i.ClassifyAlgorithms, classifyType: i.ClassifyType})
|
||||
}
|
||||
if (i.Type === 'number') {
|
||||
this.$set(this.questionForm, i.Id, i.Answer === '' ? '' : parseFloat(i.Answer).toFixed(this.digitPlaces))
|
||||
this.$set(this.questionForm, i.Id, isNaN(parseFloat(i.Answer)) ? i.Answer : parseFloat(i.Answer).toFixed(this.digitPlaces))
|
||||
}
|
||||
if (i.Childrens && i.Childrens.length > 0) {
|
||||
this.setChild(i.Childrens)
|
||||
|
|
|
@ -1,36 +1,25 @@
|
|||
<template>
|
||||
<div class="criterion-form-item">
|
||||
<div
|
||||
v-if="!!question.GroupName && question.Type==='group'"
|
||||
style="font-weight: bold;font-size: 16px;margin: 5px 0px;color:#fff;"
|
||||
>
|
||||
<div v-if="!!question.GroupName && question.Type === 'group'"
|
||||
style="font-weight: bold;font-size: 16px;margin: 5px 0px;color:#fff;">
|
||||
{{ question.GroupName }}
|
||||
</div>
|
||||
<div
|
||||
v-if="question.Type==='table' || question.Type==='basicTable'"
|
||||
style="font-weight: bold;font-size: 14px;margin: 5px 0px;"
|
||||
>
|
||||
<div v-if="question.Type === 'table' || question.Type === 'basicTable'"
|
||||
style="font-weight: bold;font-size: 14px;margin: 5px 0px;">
|
||||
<div style="display: flex;justify-content: space-between;align-items: center;color:#fff;margin: 10px 0 5px">
|
||||
<span>{{ question.QuestionName }}</span>
|
||||
<el-button size="mini" v-if="readingTaskState < 2" @click="openAddTableCol(question)">
|
||||
{{ $t('common:button:add') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
:data="questionForm[question.Id]">
|
||||
<el-table :data="questionForm[question.Id]">
|
||||
<el-table-column :label="$t('CustomizeQuestionFormItem:label:OrderMark')" width="60px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ question.OrderMark }}{{ scope.$index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:prop="item.Id"
|
||||
:label="item.QuestionName"
|
||||
:key="item.Id"
|
||||
v-for="item of question.TableQuestions.Questions"
|
||||
show-overflow-tooltip
|
||||
:render-header="renderHeader"
|
||||
>
|
||||
<el-table-column :prop="item.Id" :label="item.QuestionName" :key="item.Id"
|
||||
v-for="item of question.TableQuestions.Questions" show-overflow-tooltip :render-header="renderHeader">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="item.Type === 'upload'">
|
||||
{{ scope.row[item.Id] === '' ? '' : scope.row[item.Id] ? scope.row[item.Id].split('|').length : '' }}
|
||||
|
@ -43,67 +32,35 @@
|
|||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('common:action:action')"
|
||||
show-overflow-tooltip
|
||||
width="100px"
|
||||
v-if="readingTaskState < 2"
|
||||
fixed="right"
|
||||
>
|
||||
<el-table-column :label="$t('common:action:action')" show-overflow-tooltip width="100px"
|
||||
v-if="readingTaskState < 2" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" @click="openAddTableCol(question, scope.$index)">
|
||||
{{ $t('common:button:edit') }}
|
||||
</el-button>
|
||||
<el-button type="text" size="mini" :disabled="addOrEdit.visible" v-if="scope.row.IsCurrentTaskAdd === 'True' || !question.IsCopyLesions || isBaseline" @click="deleteTableCol(question, scope.$index)">
|
||||
<el-button type="text" size="mini" :disabled="addOrEdit.visible"
|
||||
v-if="scope.row.IsCurrentTaskAdd === 'True' || !question.IsCopyLesions || isBaseline"
|
||||
@click="deleteTableCol(question, scope.$index)">
|
||||
{{ $t('common:button:delete') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog
|
||||
v-if="addOrEdit.visible"
|
||||
v-dialogDrag
|
||||
:title="addOrEdit.title"
|
||||
:visible.sync="addOrEdit.visible"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
width="400px"
|
||||
:modal="false"
|
||||
:before-close="beforeClose"
|
||||
>
|
||||
<el-dialog v-if="addOrEdit.visible" v-dialogDrag :title="addOrEdit.title" :visible.sync="addOrEdit.visible"
|
||||
:close-on-click-modal="false" :close-on-press-escape="false" width="400px" :modal="false"
|
||||
:before-close="beforeClose">
|
||||
<div>
|
||||
<el-form
|
||||
ref="tableQsForm"
|
||||
:model="QuestionsForm"
|
||||
v-loading="loading"
|
||||
size="small"
|
||||
>
|
||||
<QuestionTableFormItem
|
||||
v-for="(item) in QuestionsList"
|
||||
:key="item.Id"
|
||||
:question="item"
|
||||
:parentQsId="parentQsId"
|
||||
:isBaseline="isBaseline"
|
||||
:reading-task-state="readingTaskState"
|
||||
:question-form="QuestionsForm"
|
||||
:visit-task-id="visitTaskId"
|
||||
:criterion-id="criterionId"
|
||||
:type="addOrEdit.type"
|
||||
:calculationList="calculationList"
|
||||
:questionsMarkStatus="questionsMarkStatus"
|
||||
@formItemTableNumberChange="formItemTableNumberChange"
|
||||
@resetFormItemData="resetTableFormItemData"
|
||||
@setFormItemData="setFormTableItemData"
|
||||
@operateImageMarker="operateImageMarker"
|
||||
@save="save"
|
||||
/>
|
||||
<el-form ref="tableQsForm" :model="QuestionsForm" v-loading="loading" size="small">
|
||||
<QuestionTableFormItem v-for="(item) in QuestionsList" :key="item.Id" :question="item"
|
||||
:parentQsId="parentQsId" :isBaseline="isBaseline" :reading-task-state="readingTaskState"
|
||||
:question-form="QuestionsForm" :visit-task-id="visitTaskId" :criterion-id="criterionId"
|
||||
:type="addOrEdit.type" :calculationList="calculationList" :questionsMarkStatus="questionsMarkStatus"
|
||||
@formItemTableNumberChange="formItemTableNumberChange" @resetFormItemData="resetTableFormItemData"
|
||||
@setFormItemData="setFormTableItemData" @operateImageMarker="operateImageMarker" @save="save" />
|
||||
</el-form>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<el-button
|
||||
size="small"
|
||||
@click="handleCancel"
|
||||
>
|
||||
<el-button size="small" @click="handleCancel">
|
||||
{{ $t('common:button:cancel') }}
|
||||
</el-button>
|
||||
<!-- 保存 -->
|
||||
|
@ -116,183 +73,96 @@
|
|||
<template v-else>
|
||||
<el-form-item
|
||||
v-if="(question.ShowQuestion === 1 && question.ParentTriggerValueList.includes(questionForm[question.ParentId])) || question.ShowQuestion === 0"
|
||||
:label="`${question.QuestionName}`"
|
||||
:prop="question.Id"
|
||||
:rules="[
|
||||
{ required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && (question.RelevanceValueList.includes(isNaN(parseFloat(questionForm[question.RelevanceId])) ? questionForm[question.RelevanceId] : questionForm[question.RelevanceId].toString())))) && question.Type!=='group' && question.Type!=='summary',
|
||||
message: $t('common:ruleMessage:specify'), trigger: ['blur', 'change']},
|
||||
:label="`${question.QuestionName}`" :prop="question.Id" :rules="[
|
||||
{
|
||||
required: (question.IsRequired === 0 || (question.IsRequired === 1 && question.RelevanceId && (question.RelevanceValueList.includes(isNaN(parseFloat(questionForm[question.RelevanceId])) ? questionForm[question.RelevanceId] : questionForm[question.RelevanceId].toString())))) && question.Type !== 'group' && question.Type !== 'summary',
|
||||
message: $t('common:ruleMessage:specify'), trigger: ['blur', 'change']
|
||||
},
|
||||
{
|
||||
validator: question.Type === 'number' && !question.TypeValue ? validatorNumberInput : (rule, value, callback) => { callback() },
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
]"
|
||||
:class="[question.Type==='group'?'mb':question.Type==='upload'?'uploadWrapper':'']"
|
||||
>
|
||||
]" :class="[question.Type === 'group' ? 'mb' : question.Type === 'upload' ? 'uploadWrapper' : '']">
|
||||
<!-- 输入框 -->
|
||||
<el-input
|
||||
v-if="question.Type==='input'"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="question.TableQuestionType === 2 || readingTaskState === 2"
|
||||
/>
|
||||
<el-input v-if="question.Type === 'input'" v-model="questionForm[question.Id]"
|
||||
:disabled="question.TableQuestionType === 2 || readingTaskState === 2" />
|
||||
<!-- 多行文本输入框 -->
|
||||
<el-input
|
||||
v-if="question.Type==='textarea'"
|
||||
v-model="questionForm[question.Id]"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
:disabled="readingTaskState === 2"
|
||||
/>
|
||||
<el-input v-if="question.Type === 'textarea'" v-model="questionForm[question.Id]" type="textarea"
|
||||
: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
|
||||
: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">
|
||||
<el-option
|
||||
v-for="item in organList"
|
||||
:key="item.Id"
|
||||
:label="item[question.DataTableColumn]"
|
||||
:value="item[question.DataTableColumn]"
|
||||
/>
|
||||
<el-option v-for="item in organList" :key="item.Id" :label="item[question.DataTableColumn]"
|
||||
:value="item[question.DataTableColumn]" />
|
||||
</template>
|
||||
<template v-else-if="question.TableQuestionType === 3 || question.QuestionGenre === 3">
|
||||
<el-option
|
||||
v-for="item of $d[question.DictionaryCode]"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
/>
|
||||
<el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="item.value"
|
||||
:label="item.label" />
|
||||
</template>
|
||||
<template v-else-if="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && question.DictionaryCode">
|
||||
<el-option
|
||||
v-for="item of $d[question.DictionaryCode]"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
/>
|
||||
<template
|
||||
v-else-if="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && question.DictionaryCode">
|
||||
<el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="item.value"
|
||||
:label="item.label" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-option
|
||||
v-for="val in question.TypeValue.split('|')"
|
||||
:key="val.trim()"
|
||||
:label="val.trim()"
|
||||
:value="val.trim()"
|
||||
/>
|
||||
<el-option v-for="val in question.TypeValue.split('|')" :key="val.trim()" :label="val.trim()"
|
||||
:value="val.trim()" />
|
||||
</template>
|
||||
|
||||
</el-select>
|
||||
<!-- 单选 -->
|
||||
<el-radio-group
|
||||
v-if="question.Type==='radio'"
|
||||
v-model="questionForm[question.Id]"
|
||||
@change="((val)=>{formItemChange(val, question)})"
|
||||
:disabled="readingTaskState === 2"
|
||||
>
|
||||
<el-radio
|
||||
v-for="val in question.TypeValue.split('|')"
|
||||
:key="val.trim()"
|
||||
:label="val.trim()"
|
||||
>
|
||||
<el-radio-group v-if="question.Type === 'radio'" v-model="questionForm[question.Id]"
|
||||
@change="((val) => { formItemChange(val, question) })" :disabled="readingTaskState === 2">
|
||||
<el-radio v-for="val in question.TypeValue.split('|')" :key="val.trim()" :label="val.trim()">
|
||||
{{ val.trim() }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<!-- 复选框 -->
|
||||
<el-checkbox-group
|
||||
v-if="question.Type==='checkbox'"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="readingTaskState === 2"
|
||||
>
|
||||
<el-checkbox
|
||||
v-for="val in question.TypeValue.split('|')"
|
||||
:key="val"
|
||||
:label="val.trim()"
|
||||
>
|
||||
<el-checkbox-group v-if="question.Type === 'checkbox'" v-model="questionForm[question.Id]"
|
||||
:disabled="readingTaskState === 2">
|
||||
<el-checkbox v-for="val in question.TypeValue.split('|')" :key="val" :label="val.trim()">
|
||||
{{ val.trim() }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
<!-- 自动分类 -->
|
||||
<el-input
|
||||
v-if="question.Type === 'class' && question.ClassifyShowType === 1"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="!question.ClassifyEditType || readingTaskState === 2"
|
||||
/>
|
||||
<el-select
|
||||
v-if="question.Type === 'class' && question.ClassifyShowType === 2"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="!question.ClassifyEditType || readingTaskState === 2"
|
||||
@change="(val) => { formItemChange(val, question) }"
|
||||
>
|
||||
<el-option
|
||||
v-for="val in question.TypeValue.split('|')"
|
||||
:key="val"
|
||||
:label="val.trim()"
|
||||
:value="val.trim()"
|
||||
/>
|
||||
<el-input v-if="question.Type === 'class' && question.ClassifyShowType === 1"
|
||||
v-model="questionForm[question.Id]" :disabled="!question.ClassifyEditType || readingTaskState === 2" />
|
||||
<el-select v-if="question.Type === 'class' && question.ClassifyShowType === 2"
|
||||
v-model="questionForm[question.Id]" :disabled="!question.ClassifyEditType || readingTaskState === 2"
|
||||
@change="(val) => { formItemChange(val, question) }">
|
||||
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val.trim()" :value="val.trim()" />
|
||||
</el-select>
|
||||
<el-radio-group
|
||||
v-if="question.Type === 'class' && question.ClassifyShowType === 3"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="!question.ClassifyEditType || readingTaskState === 2"
|
||||
@change="(val) => { formItemChange(val, question) }"
|
||||
>
|
||||
<el-radio
|
||||
v-for="item of question.TypeValue.split('|')"
|
||||
:key="item.trim()"
|
||||
:label="item.trim()"
|
||||
>
|
||||
<el-radio-group v-if="question.Type === 'class' && question.ClassifyShowType === 3"
|
||||
v-model="questionForm[question.Id]" :disabled="!question.ClassifyEditType || readingTaskState === 2"
|
||||
@change="(val) => { formItemChange(val, question) }">
|
||||
<el-radio v-for="item of question.TypeValue.split('|')" :key="item.trim()" :label="item.trim()">
|
||||
{{ item.trim() }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<el-input
|
||||
v-if="question.Type === 'class' && question.ClassifyShowType === 4"
|
||||
type="number"
|
||||
:disabled="!question.ClassifyEditType || readingTaskState === 2"
|
||||
v-model="questionForm[question.Id]"
|
||||
@change="(val) => { formItemNumberChange(val, question) }"
|
||||
/>
|
||||
<el-input v-if="question.Type === 'class' && question.ClassifyShowType === 4" type="number"
|
||||
:disabled="!question.ClassifyEditType || readingTaskState === 2" v-model="questionForm[question.Id]"
|
||||
@change="(val) => { formItemNumberChange(val, question) }" />
|
||||
<!-- 自动计算 -->
|
||||
<!-- :precision="2" :step="0.1" :max="10" -->
|
||||
<el-input
|
||||
v-if="question.Type==='calculation'"
|
||||
v-model="questionForm[question.Id]"
|
||||
@input="value=value.replace(/^\D*(\d*(?:.\d{0,2})?).*$/g, '$1')"
|
||||
disabled
|
||||
/>
|
||||
<el-input v-if="question.Type === 'calculation'" v-model="questionForm[question.Id]"
|
||||
@input="value = value.replace(/^\D*(\d*(?:.\d{0,2})?).*$/g, '$1')" disabled />
|
||||
<!-- 自增 -->
|
||||
<el-input
|
||||
v-if="question.Type==='increment'"
|
||||
v-model="questionForm[question.Id]"
|
||||
disabled
|
||||
/>
|
||||
<el-input v-if="question.Type === 'increment'" v-model="questionForm[question.Id]" disabled />
|
||||
<!-- 数值 -->
|
||||
<!-- :precision="2" :step="0.1" :max="10" -->
|
||||
<el-select
|
||||
v-if="question.Type === 'number' && question.TypeValue"
|
||||
v-model="questionForm[question.Id]"
|
||||
clearable
|
||||
@change="(val) => { formItemNumberChange(val, question) }"
|
||||
:disabled="readingTaskState === 2"
|
||||
>
|
||||
<el-option
|
||||
v-for="val in question.TypeValue.split('|')"
|
||||
:key="val"
|
||||
:label="val.trim()"
|
||||
:value="val.trim()"
|
||||
/>
|
||||
<el-select v-if="question.Type === 'number' && question.TypeValue" v-model="questionForm[question.Id]" clearable
|
||||
@change="(val) => { formItemNumberChange(val, question) }" :disabled="readingTaskState === 2">
|
||||
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val.trim()" :value="val.trim()" />
|
||||
</el-select>
|
||||
<template v-if="question.Type === 'number' && (question.ImageMarkEnum === 1 || question.ImageMarkEnum === 2)">
|
||||
<div style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center;">
|
||||
<el-input
|
||||
type="number"
|
||||
@change="(val) => { formItemNumberChange(val, question) }"
|
||||
<el-input type="number" @change="(val) => { formItemNumberChange(val, question) }"
|
||||
@blur="questionsMarkStatus[question.Id] && questionsMarkStatus[question.Id].isMarked ? () => { } : handleMarkedQsBlur(questionForm[question.Id], questionForm, question.Id, question)"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="(questionsMarkStatus[question.Id] && questionsMarkStatus[question.Id].isMarked && question.ImageMarkEnum === 2) || question.ImageMarkEnum === 1"
|
||||
style="width: 150px;"
|
||||
>
|
||||
style="width: 150px;">
|
||||
<template v-if="question.Unit !== 0" slot="append">
|
||||
{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit }}
|
||||
</template>
|
||||
|
@ -300,56 +170,38 @@
|
|||
<!-- 测量 -->
|
||||
<el-button
|
||||
v-if="readingTaskState < 2 && (!questionsMarkStatus[question.Id] || (questionsMarkStatus[question.Id] && !questionsMarkStatus[question.Id].isMarked))"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 1, question})"
|
||||
>
|
||||
size="mini" type="text" @click="operateImageMarker({ operateStateEnum: 1, question })">
|
||||
测量
|
||||
</el-button>
|
||||
<!-- 绑定 -->
|
||||
<el-button
|
||||
v-if="readingTaskState < 2 && (!questionsMarkStatus[question.Id] || (questionsMarkStatus[question.Id] && !questionsMarkStatus[question.Id].isMarked))"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 0, question})"
|
||||
>
|
||||
size="mini" type="text" @click="operateImageMarker({ operateStateEnum: 0, question })">
|
||||
绑定
|
||||
</el-button>
|
||||
<!-- 查看 -->
|
||||
<el-button
|
||||
v-if="questionsMarkStatus[question.Id] && questionsMarkStatus[question.Id].isMarked"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 2, question})"
|
||||
>
|
||||
<el-button v-if="questionsMarkStatus[question.Id] && questionsMarkStatus[question.Id].isMarked" size="mini"
|
||||
type="text" @click="operateImageMarker({ operateStateEnum: 2, question })">
|
||||
查看
|
||||
</el-button>
|
||||
<!-- 更改 -->
|
||||
<el-button
|
||||
v-if="readingTaskState < 2 && (questionsMarkStatus[question.Id] && questionsMarkStatus[question.Id].isMarked)"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 3, question})"
|
||||
>
|
||||
size="mini" type="text" @click="operateImageMarker({ operateStateEnum: 3, question })">
|
||||
更改
|
||||
</el-button>
|
||||
<!-- 移除 -->
|
||||
<el-button
|
||||
v-if="readingTaskState < 2 && (questionsMarkStatus[question.Id] && questionsMarkStatus[question.Id].isMarked)"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 4, question})"
|
||||
>
|
||||
size="mini" type="text" @click="operateImageMarker({ operateStateEnum: 4, question })">
|
||||
移除
|
||||
</el-button>
|
||||
<!-- 保存 -->
|
||||
<el-button
|
||||
v-if="readingTaskState < 2 && (questionsMarkStatus[question.Id] && !questionsMarkStatus[question.Id].isSaved)"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 5, question})"
|
||||
>
|
||||
<el-tooltip v-if="questionsMarkStatus[question.Id] && !questionsMarkStatus[question.Id].isSaved" class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom">
|
||||
size="mini" type="text" @click="operateImageMarker({ operateStateEnum: 5, question })">
|
||||
<el-tooltip v-if="questionsMarkStatus[question.Id] && !questionsMarkStatus[question.Id].isSaved"
|
||||
class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom">
|
||||
<i class="el-icon-warning" style="color:red" />
|
||||
</el-tooltip>
|
||||
保存
|
||||
|
@ -357,87 +209,51 @@
|
|||
</div>
|
||||
</template>
|
||||
<template v-else-if="question.Type === 'number'">
|
||||
<el-input
|
||||
type="text"
|
||||
v-if="question.Type === 'number' && !question.TypeValue && question.DataSource !== 1"
|
||||
@change="(val) => { formItemNumberChange(val, question) }"
|
||||
@input="numberInput(question.Id)"
|
||||
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="readingTaskState === 2"
|
||||
>
|
||||
<el-input type="text" v-if="question.Type === 'number' && !question.TypeValue && question.DataSource !== 1"
|
||||
@change="(val) => { formItemNumberChange(val, question) }" @input="numberInput(question.Id)"
|
||||
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)" v-model="questionForm[question.Id]"
|
||||
:disabled="readingTaskState === 2">
|
||||
<!-- <template slot="append">1</template> -->
|
||||
<template slot="append" v-if="question.Unit !== 0">{{question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit}}</template>
|
||||
<template slot="append" v-if="question.Unit !== 0">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) :
|
||||
question.CustomUnit}}</template>
|
||||
<template slot="append" v-else-if="question.ValueType === 2">%</template>
|
||||
|
||||
</el-input>
|
||||
<el-input
|
||||
type="text"
|
||||
@input="numberInput(question.Id)"
|
||||
<el-input type="text" @input="numberInput(question.Id)"
|
||||
v-if="question.Type === 'number' && !question.TypeValue && question.DataSource === 1"
|
||||
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
|
||||
:disabled="question.DataSource === 1 || readingTaskState === 2"
|
||||
v-model="questionForm[question.Id]"
|
||||
>
|
||||
:disabled="question.DataSource === 1 || readingTaskState === 2" v-model="questionForm[question.Id]">
|
||||
<!-- <template slot="append">2</template> -->
|
||||
<template slot="append" v-if="question.Unit !== 0">{{question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit}}</template>
|
||||
<template slot="append" v-if="question.Unit !== 0">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) :
|
||||
question.CustomUnit}}</template>
|
||||
<template slot="append" v-else-if="question.ValueType === 2">%</template>
|
||||
</el-input>
|
||||
</template>
|
||||
<!-- 上传图像 -->
|
||||
<el-upload
|
||||
v-if="question.Type==='upload'"
|
||||
:disabled="readingTaskState === 2"
|
||||
action
|
||||
:accept="question.FileType"
|
||||
:limit="question.ImageCount === 0 ? 100 : question.ImageCount"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
<el-upload v-if="question.Type === 'upload'" :disabled="readingTaskState === 2" action :accept="question.FileType"
|
||||
:limit="question.ImageCount === 0 ? 100 : question.ImageCount" :on-preview="handlePictureCardPreview"
|
||||
:before-upload="(file) => { return handleBeforeUpload(file, question.FileType) }"
|
||||
:http-request="uploadScreenshot"
|
||||
:on-remove="handleRemove"
|
||||
:file-list="fileList"
|
||||
:class="{disabled:question.ImageCount === 0 ? false : fileList.length >= question.ImageCount}"
|
||||
>
|
||||
:http-request="uploadScreenshot" :on-remove="handleRemove" :file-list="fileList"
|
||||
:class="{ disabled: question.ImageCount === 0 ? false : fileList.length >= question.ImageCount }">
|
||||
<el-button slot="default" class="el-icon-plus" v-if="readingTaskState < 2">
|
||||
{{ this.$t('common:button:upload') }}
|
||||
</el-button>
|
||||
</el-upload>
|
||||
<viewer
|
||||
v-if="question.Type==='upload' && imgVisible"
|
||||
:ref="imageUrl"
|
||||
style="margin:0 10px;"
|
||||
:images="[imageUrl]"
|
||||
>
|
||||
<img
|
||||
v-show="false"
|
||||
crossorigin="anonymous"
|
||||
:src="imageUrl"
|
||||
alt="Image"
|
||||
>
|
||||
<viewer v-if="question.Type === 'upload' && imgVisible" :ref="imageUrl" style="margin:0 10px;"
|
||||
:images="[imageUrl]">
|
||||
<img v-show="false" crossorigin="anonymous" :src="imageUrl" alt="Image">
|
||||
</viewer>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template v-if="question.Childrens && question.Childrens.length>0 && question.Type !== 'table' && question.Type !== 'basicTable'">
|
||||
<QuestionFormItem
|
||||
v-for="(item) in question.Childrens"
|
||||
:key="item.Id"
|
||||
:question="item"
|
||||
:isBaseline="isBaseline"
|
||||
:reading-task-state="readingTaskState"
|
||||
:question-form="questionForm"
|
||||
:visit-task-id="visitTaskId"
|
||||
:criterion-id="criterionId"
|
||||
:calculationList="calculationList"
|
||||
:questionMarkInfoList="questionMarkInfoList"
|
||||
:questionsMarkStatus="questionsMarkStatus"
|
||||
@formItemNumberChange="formItemNumberChange"
|
||||
@setFormItemData="setFormItemData"
|
||||
@resetFormItemData="resetFormItemData"
|
||||
@getQuestions="getQuestions"
|
||||
@operateImageMarker="operateImageMarker"
|
||||
@unBindAnnotationToQuestion="unBindAnnotationToQuestion"
|
||||
/>
|
||||
<template
|
||||
v-if="question.Childrens && question.Childrens.length > 0 && question.Type !== 'table' && question.Type !== 'basicTable'">
|
||||
<QuestionFormItem v-for="(item) in question.Childrens" :key="item.Id" :question="item" :isBaseline="isBaseline"
|
||||
:reading-task-state="readingTaskState" :question-form="questionForm" :visit-task-id="visitTaskId"
|
||||
:criterion-id="criterionId" :calculationList="calculationList" :questionMarkInfoList="questionMarkInfoList"
|
||||
:questionsMarkStatus="questionsMarkStatus" @formItemNumberChange="formItemNumberChange"
|
||||
@setFormItemData="setFormItemData" @resetFormItemData="resetFormItemData" @getQuestions="getQuestions"
|
||||
@operateImageMarker="operateImageMarker" @unBindAnnotationToQuestion="unBindAnnotationToQuestion" />
|
||||
</template>
|
||||
|
||||
<!-- <base-model :config="addOrEdit"
|
||||
|
@ -451,23 +267,10 @@
|
|||
|
||||
</base-model> -->
|
||||
<!-- 预览文件 -->
|
||||
<el-dialog
|
||||
v-if="previewVisible"
|
||||
:visible.sync="previewVisible"
|
||||
:title="$t('common:button:preview')"
|
||||
:fullscreen="true"
|
||||
append-to-body
|
||||
custom-class="base-dialog-wrapper"
|
||||
>
|
||||
<div
|
||||
class="base-modal-body"
|
||||
style="border: 2px solid #ccc; padding: 10px"
|
||||
>
|
||||
<PreviewFile
|
||||
v-if="previewVisible"
|
||||
:file-path="currentPath"
|
||||
:file-type="currentType"
|
||||
/>
|
||||
<el-dialog v-if="previewVisible" :visible.sync="previewVisible" :title="$t('common:button:preview')"
|
||||
:fullscreen="true" append-to-body custom-class="base-dialog-wrapper">
|
||||
<div class="base-modal-body" style="border: 2px solid #ccc; padding: 10px">
|
||||
<PreviewFile v-if="previewVisible" :file-path="currentPath" :file-type="currentType" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
@ -677,11 +480,10 @@ export default {
|
|||
}
|
||||
},
|
||||
handleBlur(value, a, b) {
|
||||
let reg = new RegExp(/[a-zA-Z]/, 'ig')
|
||||
if(!reg.test(value)) {
|
||||
if (!value) return false
|
||||
if (!isNaN(parseFloat(value))) {
|
||||
this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
|
||||
}
|
||||
// this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
|
||||
},
|
||||
handleMarkedQsBlur(value, a, b, question) {
|
||||
this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
|
||||
|
@ -1382,15 +1184,18 @@ export default {
|
|||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.criterion-form-item {
|
||||
|
||||
// 弹窗层元素不可穿透点击事件(不影响弹窗层元素的点击事件)
|
||||
::v-deep .el-dialog {
|
||||
pointer-events: auto;
|
||||
margin-right: 15px !important;
|
||||
margin-top: 30vh !important;
|
||||
}
|
||||
|
||||
::v-deep .el-dialog__wrapper {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
// .custom-dialog .el-dialog__wrapper {
|
||||
// pointer-events:none;
|
||||
// }
|
||||
|
@ -1398,23 +1203,28 @@ export default {
|
|||
::v-deep .el-form-item__label {
|
||||
color: #c3c3c3;
|
||||
}
|
||||
|
||||
::v-deep .el-radio__label {
|
||||
color: #c3c3c3;
|
||||
}
|
||||
|
||||
::v-deep .el-input-group__append {
|
||||
background: #000;
|
||||
color: #ddd;
|
||||
border: 1px solid #5e5e5e;
|
||||
}
|
||||
|
||||
::v-deep .el-input .el-input__inner {
|
||||
background-color: transparent;
|
||||
color: #ddd;
|
||||
border: 1px solid #5e5e5e;
|
||||
}
|
||||
}
|
||||
|
||||
.criterion-form-item {
|
||||
::v-deep .criterion-form-item .el-form-item {
|
||||
display: block;
|
||||
|
||||
.el-form-item__label {
|
||||
display: block;
|
||||
color: #c8c8c8;
|
||||
|
@ -1422,39 +1232,47 @@ export default {
|
|||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mb {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
::v-deep .el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.uploadWrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
::v-deep .el-table__body-wrapper::-webkit-scrollbar {
|
||||
height: 10px !important;
|
||||
}
|
||||
|
||||
::v-deep .el-table__fixed-right::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
::v-deep .el-upload-list__item-name {
|
||||
color: #0a84ff;
|
||||
|
||||
.el-icon-document {
|
||||
color: #0a84ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -165,7 +165,7 @@ export default {
|
|||
this.classArr.push({ triggerId: v.ClassifyQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType })
|
||||
}
|
||||
if (v.Type === 'number') {
|
||||
this.$set(this.questionForm, v.Id, v.Answer === '' ? '' : parseFloat(v.Answer).toFixed(this.digitPlaces))
|
||||
this.$set(this.questionForm, v.Id, isNaN(parseFloat(v.Answer)) ? v.Answer : parseFloat(v.Answer).toFixed(this.digitPlaces))
|
||||
if (v.ImageToolAttribute) {
|
||||
this.$set(this.questionImageToolAttributeInfo, v.Id, v.ImageToolAttribute)
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ export default {
|
|||
i.TableQuestions.Questions.forEach(o => {
|
||||
if (o.Type === 'number') {
|
||||
i.TableQuestions.Answers.forEach((ite, index) => {
|
||||
this.$set(i.TableQuestions.Answers[index], o.Id, i.TableQuestions.Answers[index][o.Id] ? parseFloat(i.TableQuestions.Answers[index][o.Id]).toFixed(this.digitPlaces) : null)
|
||||
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))
|
||||
})
|
||||
}
|
||||
})
|
||||
|
@ -216,7 +216,7 @@ export default {
|
|||
this.classArr.push({ triggerId: i.ClassifyQuestionId, classId: i.Id, classifyAlgorithms: i.ClassifyAlgorithms, classifyType: i.ClassifyType })
|
||||
}
|
||||
if (i.Type === 'number') {
|
||||
this.$set(this.questionForm, i.Id, i.Answer === '' ? '' : parseFloat(i.Answer).toFixed(this.digitPlaces))
|
||||
this.$set(this.questionForm, i.Id, isNaN(parseFloat(i.Answer)) ? i.Answer : parseFloat(i.Answer).toFixed(this.digitPlaces))
|
||||
if (i.ImageToolAttribute) {
|
||||
this.$set(this.questionImageToolAttributeInfo, i.Id, i.ImageToolAttribute)
|
||||
}
|
||||
|
|
|
@ -2,160 +2,89 @@
|
|||
<div class="criterion-table-form-item">
|
||||
<el-form-item
|
||||
v-if="(question.ShowQuestion === 1 && !!~question.ParentTriggerValueList.indexOf(questionForm[question.ParentId])) || question.ShowQuestion === 0"
|
||||
:label="`${question.QuestionName}`"
|
||||
:prop="question.Id"
|
||||
:rules="[
|
||||
{ required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && !!~question.RelevanceValueList.indexOf(questionForm[question.RelevanceId]))) && question.Type!=='group' && question.Type!=='summary',
|
||||
message: $t('common:ruleMessage:select'), trigger: ['blur', 'change']},
|
||||
:label="`${question.QuestionName}`" :prop="question.Id" :rules="[
|
||||
{
|
||||
required: (question.IsRequired === 0 || (question.IsRequired === 1 && question.RelevanceId && !!~question.RelevanceValueList.indexOf(questionForm[question.RelevanceId]))) && question.Type !== 'group' && question.Type !== 'summary',
|
||||
message: $t('common:ruleMessage:select'), trigger: ['blur', 'change']
|
||||
},
|
||||
{
|
||||
validator: question.Type === 'number' && !question.TypeValue ? validatorNumberInput : (rule, value, callback) => { callback() },
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
]"
|
||||
:class="[question.Type==='group'?'mb':question.Type==='upload'?'uploadWrapper':'']"
|
||||
>
|
||||
]" :class="[question.Type === 'group' ? 'mb' : question.Type === 'upload' ? 'uploadWrapper' : '']">
|
||||
<!-- 输入框 -->
|
||||
<el-input
|
||||
v-if="question.Type==='input'"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !isBaseline && questionForm.IsCurrentTaskAdd === 'False')"
|
||||
/>
|
||||
<el-input v-if="question.Type === 'input'" v-model="questionForm[question.Id]"
|
||||
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !isBaseline && questionForm.IsCurrentTaskAdd === 'False')" />
|
||||
<!-- 多行文本输入框 -->
|
||||
<el-input
|
||||
v-if="question.Type==='textarea'"
|
||||
v-model="questionForm[question.Id]"
|
||||
type="textarea"
|
||||
<el-input v-if="question.Type === 'textarea'" v-model="questionForm[question.Id]" type="textarea"
|
||||
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !isBaseline && questionForm.IsCurrentTaskAdd === 'False')"
|
||||
: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
|
||||
:disabled="(question.TableQuestionType === 2 || 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">
|
||||
<el-option
|
||||
v-for="item in organList"
|
||||
:key="item.Id"
|
||||
:label="item[question.DataTableColumn]"
|
||||
:value="item[question.DataTableColumn]"
|
||||
/>
|
||||
<el-option v-for="item in organList" :key="item.Id" :label="item[question.DataTableColumn]"
|
||||
:value="item[question.DataTableColumn]" />
|
||||
</template>
|
||||
<template v-else-if="question.TableQuestionType === 3 || question.QuestionGenre === 3">
|
||||
<el-option
|
||||
v-for="item of $d[question.DictionaryCode]"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
/>
|
||||
<el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="item.value"
|
||||
:label="item.label" />
|
||||
</template>
|
||||
<template v-else-if="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && question.DictionaryCode">
|
||||
<el-option
|
||||
v-for="item of $d[question.DictionaryCode]"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
/>
|
||||
<template
|
||||
v-else-if="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && question.DictionaryCode">
|
||||
<el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="item.value"
|
||||
:label="item.label" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-option
|
||||
v-for="val in question.TypeValue.split('|')"
|
||||
:key="val"
|
||||
:label="val"
|
||||
:value="val"
|
||||
/>
|
||||
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val" :value="val" />
|
||||
</template>
|
||||
|
||||
</el-select>
|
||||
<!-- 单选 -->
|
||||
<el-radio-group
|
||||
v-if="question.Type==='radio'"
|
||||
v-model="questionForm[question.Id]"
|
||||
<el-radio-group v-if="question.Type === 'radio'" v-model="questionForm[question.Id]"
|
||||
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !isBaseline && questionForm.IsCurrentTaskAdd === 'False')"
|
||||
@change="((val)=>{formItemChange(val, question)})"
|
||||
>
|
||||
<el-radio
|
||||
v-for="val in question.TypeValue.split('|')"
|
||||
:key="val"
|
||||
:label="val"
|
||||
>
|
||||
@change="((val) => { formItemChange(val, question) })">
|
||||
<el-radio v-for="val in question.TypeValue.split('|')" :key="val" :label="val">
|
||||
{{ val }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<!-- 复选框 -->
|
||||
<el-checkbox-group
|
||||
v-if="question.Type==='checkbox'"
|
||||
<el-checkbox-group v-if="question.Type === 'checkbox'"
|
||||
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !isBaseline && questionForm.IsCurrentTaskAdd === 'False')"
|
||||
v-model="questionForm[question.Id]"
|
||||
>
|
||||
<el-checkbox
|
||||
v-for="val in question.TypeValue.split('|')"
|
||||
:key="val"
|
||||
:label="val"
|
||||
>
|
||||
v-model="questionForm[question.Id]">
|
||||
<el-checkbox v-for="val in question.TypeValue.split('|')" :key="val" :label="val">
|
||||
{{ val }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
<!-- 自动分类 -->
|
||||
<el-input
|
||||
v-if="question.Type === 'class' && question.ClassifyShowType === 1"
|
||||
v-model="questionForm[question.Id]"
|
||||
/>
|
||||
<el-select
|
||||
v-if="question.Type === 'class' && question.ClassifyShowType === 2"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="!question.ClassifyEditType"
|
||||
@change="(val) => { formItemChange(val, question) }"
|
||||
>
|
||||
<el-option
|
||||
v-for="val in question.TypeValue.split('|')"
|
||||
:key="val"
|
||||
:label="val.trim()"
|
||||
:value="val.trim()"
|
||||
/>
|
||||
<el-input v-if="question.Type === 'class' && question.ClassifyShowType === 1"
|
||||
v-model="questionForm[question.Id]" />
|
||||
<el-select v-if="question.Type === 'class' && question.ClassifyShowType === 2" v-model="questionForm[question.Id]"
|
||||
:disabled="!question.ClassifyEditType" @change="(val) => { formItemChange(val, question) }">
|
||||
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val.trim()" :value="val.trim()" />
|
||||
</el-select>
|
||||
<el-radio-group
|
||||
v-if="question.Type === 'class' && question.ClassifyShowType === 3"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="!question.ClassifyEditType"
|
||||
@change="(val) => { formItemChange(val, question) }"
|
||||
>
|
||||
<el-radio
|
||||
v-for="item of question.TypeValue.split('|')"
|
||||
:key="item.trim()"
|
||||
:label="item.trim()"
|
||||
>
|
||||
<el-radio-group v-if="question.Type === 'class' && question.ClassifyShowType === 3"
|
||||
v-model="questionForm[question.Id]" :disabled="!question.ClassifyEditType"
|
||||
@change="(val) => { formItemChange(val, question) }">
|
||||
<el-radio v-for="item of question.TypeValue.split('|')" :key="item.trim()" :label="item.trim()">
|
||||
{{ item.trim() }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<!-- 自动计算 -->
|
||||
<!-- :precision="2" :step="0.1" :max="10" -->
|
||||
<el-input
|
||||
v-if="question.Type==='calculation'"
|
||||
v-model="questionForm[question.Id]"
|
||||
oninput="value=value.replace(/^\D*(\d*(?:.\d{0,2})?).*$/g, '$1')"
|
||||
disabled
|
||||
/>
|
||||
<el-input v-if="question.Type === 'calculation'" v-model="questionForm[question.Id]"
|
||||
oninput="value=value.replace(/^\D*(\d*(?:.\d{0,2})?).*$/g, '$1')" disabled />
|
||||
<!-- 自增 -->
|
||||
<el-input
|
||||
v-if="question.Type==='increment'"
|
||||
v-model="questionForm[question.Id]"
|
||||
disabled
|
||||
/>
|
||||
<el-input v-if="question.Type === 'increment'" v-model="questionForm[question.Id]" disabled />
|
||||
<!-- 数值 -->
|
||||
<template v-if="question.Type === 'number' && (question.ImageMarkEnum === 1 || question.ImageMarkEnum === 2)">
|
||||
<div style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center;">
|
||||
<el-input
|
||||
type="number"
|
||||
@change="(val) => { formItemNumberChange(val, question) }"
|
||||
<el-input type="number" @change="(val) => { formItemNumberChange(val, question) }"
|
||||
@blur="questionsMarkStatus[question.Id] && questionsMarkStatus[question.Id].isMarked ? () => { } : handleMarkedQsBlur(questionForm[question.Id], questionForm, question.Id, question)"
|
||||
v-model="questionForm[question.Id]"
|
||||
:disabled="(questionsMarkStatus[question.Id] && questionsMarkStatus[question.Id].isMarked && question.ImageMarkEnum === 2) || question.ImageMarkEnum === 1"
|
||||
style="width: 150px;"
|
||||
>
|
||||
style="width: 150px;">
|
||||
<template v-if="question.Unit !== 0" slot="append">
|
||||
{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit }}
|
||||
</template>
|
||||
|
@ -163,56 +92,40 @@
|
|||
<!-- 测量 -->
|
||||
<el-button
|
||||
v-if="readingTaskState < 2 && (!questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id] || (questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id] && !questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id].isMarked))"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 1, question})"
|
||||
>
|
||||
size="mini" type="text" @click="operateImageMarker({ operateStateEnum: 1, question })">
|
||||
测量
|
||||
</el-button>
|
||||
<!-- 绑定 -->
|
||||
<el-button
|
||||
v-if="readingTaskState < 2 && (!questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id] || (questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id] && !questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id].isMarked))"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 0, question})"
|
||||
>
|
||||
size="mini" type="text" @click="operateImageMarker({ operateStateEnum: 0, question })">
|
||||
绑定
|
||||
</el-button>
|
||||
<!-- 查看 -->
|
||||
<el-button
|
||||
v-if="questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id] && questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id].isMarked"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 2, question})"
|
||||
>
|
||||
size="mini" type="text" @click="operateImageMarker({ operateStateEnum: 2, question })">
|
||||
查看
|
||||
</el-button>
|
||||
<!-- 更改 -->
|
||||
<el-button
|
||||
v-if="readingTaskState < 2 && (questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id] && questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id].isMarked)"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 3, question})"
|
||||
>
|
||||
size="mini" type="text" @click="operateImageMarker({ operateStateEnum: 3, question })">
|
||||
更改
|
||||
</el-button>
|
||||
<!-- 移除 -->
|
||||
<el-button
|
||||
v-if="readingTaskState < 2 && (questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id] && questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id].isMarked)"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 4, question})"
|
||||
>
|
||||
size="mini" type="text" @click="operateImageMarker({ operateStateEnum: 4, question })">
|
||||
移除
|
||||
</el-button>
|
||||
<!-- 保存 -->
|
||||
<el-button
|
||||
v-if="readingTaskState < 2 && (questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id] && !questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id].isSaved)"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="operateImageMarker({operateStateEnum: 7, question})"
|
||||
>
|
||||
<el-tooltip v-if="questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id] && !questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id].isSaved" class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom">
|
||||
size="mini" type="text" @click="operateImageMarker({ operateStateEnum: 7, question })">
|
||||
<el-tooltip
|
||||
v-if="questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id] && !questionsMarkStatus[rowId ? `${rowId}_${question.Id}` : question.Id].isSaved"
|
||||
class="item" effect="dark" :content="$t('trials:reading:button:unsaved')" placement="bottom">
|
||||
<i class="el-icon-warning" style="color:red" />
|
||||
</el-tooltip>
|
||||
保存
|
||||
|
@ -220,87 +133,50 @@
|
|||
</div>
|
||||
</template>
|
||||
<template v-else-if="question.Type === 'number'">
|
||||
<el-input
|
||||
type="text"
|
||||
v-if="question.Type === 'number' && question.DataSource !== 1"
|
||||
<el-input type="text" v-if="question.Type === 'number' && question.DataSource !== 1"
|
||||
:disabled="question.TableQuestionType === 2 || (question.IsCopy && type === 'edit' && !isBaseline && questionForm.IsCurrentTaskAdd === 'False')"
|
||||
@change="((val)=>{formItemNumberChange(val, question)})"
|
||||
@input="numberInput(question.Id)"
|
||||
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
|
||||
v-model="questionForm[question.Id]"
|
||||
>
|
||||
<template slot="append" v-if="question.Unit !== 0">{{question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit}}</template>
|
||||
@change="((val) => { formItemNumberChange(val, question) })" @input="numberInput(question.Id)"
|
||||
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)" v-model="questionForm[question.Id]">
|
||||
<template slot="append" v-if="question.Unit !== 0">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) :
|
||||
question.CustomUnit }}</template>
|
||||
</el-input>
|
||||
<el-input
|
||||
type="text"
|
||||
v-if="question.Type === 'number' && question.DataSource === 1"
|
||||
:disabled="question.DataSource === 1"
|
||||
@input="numberInput(question.Id, true )"
|
||||
@blur="handleCalculationBlur(calculationValue)"
|
||||
v-model="calculationValue"
|
||||
>
|
||||
<template slot="append" v-if="question.Unit !== 0">{{question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit}}</template>
|
||||
<el-input type="text" v-if="question.Type === 'number' && question.DataSource === 1"
|
||||
:disabled="question.DataSource === 1" @input="numberInput(question.Id, true)"
|
||||
@blur="handleCalculationBlur(calculationValue)" v-model="calculationValue">
|
||||
<template slot="append" v-if="question.Unit !== 0">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) :
|
||||
question.CustomUnit }}</template>
|
||||
</el-input>
|
||||
</template>
|
||||
<!-- 上传图像 -->
|
||||
<el-upload
|
||||
v-if="question.Type==='upload'"
|
||||
action
|
||||
:accept="question.FileType"
|
||||
:limit="question.ImageCount === 0 ? 100 : question.ImageCount"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:http-request="uploadScreenshot"
|
||||
list-type="picture-card"
|
||||
:on-remove="handleRemove"
|
||||
:file-list="fileList"
|
||||
:class="{disabled: question.ImageCount === 0 ? false : fileList.length >= question.ImageCount}"
|
||||
>
|
||||
<el-upload v-if="question.Type === 'upload'" action :accept="question.FileType"
|
||||
:limit="question.ImageCount === 0 ? 100 : question.ImageCount" :on-preview="handlePictureCardPreview"
|
||||
:before-upload="handleBeforeUpload" :http-request="uploadScreenshot" list-type="picture-card"
|
||||
:on-remove="handleRemove" :file-list="fileList"
|
||||
:class="{ disabled: question.ImageCount === 0 ? false : fileList.length >= question.ImageCount }">
|
||||
<i slot="default" class="el-icon-plus" />
|
||||
<div slot="file" slot-scope="{file}">
|
||||
<viewer
|
||||
:ref="file.url"
|
||||
:images="[imageUrl]"
|
||||
style="
|
||||
<viewer :ref="file.url" :images="[imageUrl]" style="
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
"
|
||||
>
|
||||
<img
|
||||
class="el-upload-list__item-thumbnail"
|
||||
:src="OSSclientConfig.basePath + file.url"
|
||||
crossOrigin="anonymous"
|
||||
alt=""
|
||||
style="max-width: 100%; max-height: 100%"
|
||||
/>
|
||||
">
|
||||
<img class="el-upload-list__item-thumbnail" :src="OSSclientConfig.basePath + file.url"
|
||||
crossOrigin="anonymous" alt="" style="max-width: 100%; max-height: 100%" />
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span
|
||||
class="el-upload-list__item-preview"
|
||||
@click="handlePictureCardPreview(file)"
|
||||
>
|
||||
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
|
||||
<i class="el-icon-zoom-in" />
|
||||
</span>
|
||||
|
||||
<span
|
||||
v-if="readingTaskState < 2"
|
||||
class="el-upload-list__item-delete"
|
||||
@click="handleRemove(file)"
|
||||
>
|
||||
<span v-if="readingTaskState < 2" class="el-upload-list__item-delete" @click="handleRemove(file)">
|
||||
<i class="el-icon-delete" />
|
||||
</span>
|
||||
</span>
|
||||
</viewer>
|
||||
</div>
|
||||
</el-upload>
|
||||
<el-dialog
|
||||
v-if="question.Type==='upload'"
|
||||
append-to-body
|
||||
:visible.sync="imgVisible"
|
||||
width="600px"
|
||||
>
|
||||
<el-dialog v-if="question.Type === 'upload'" append-to-body :visible.sync="imgVisible" width="600px">
|
||||
<el-image :src="imageUrl" width="100%">
|
||||
<div slot="placeholder" class="image-slot">
|
||||
{{ $t('trials:readingUnit:qsList:message:loading') }}<span class="dot">...</span>
|
||||
|
@ -428,7 +304,7 @@ export default {
|
|||
methods: {
|
||||
numberInput(id, notId = false) {
|
||||
if (notId) {
|
||||
// this.calculationValue = this.calculationValue.toUpperCase();
|
||||
this.calculationValue = this.calculationValue.toUpperCase();
|
||||
} else {
|
||||
this.questionForm[id] = this.questionForm[id].toUpperCase();
|
||||
}
|
||||
|
@ -474,11 +350,10 @@ export default {
|
|||
}
|
||||
},
|
||||
handleBlur(value, a, b) {
|
||||
let reg = new RegExp(/[a-zA-Z]/, 'ig')
|
||||
if(!reg.test(value)) {
|
||||
if (!value) return false
|
||||
if (!isNaN(parseFloat(value))) {
|
||||
this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
|
||||
}
|
||||
// this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
|
||||
},
|
||||
handleMarkedQsBlur(value, a, b, question) {
|
||||
this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
|
||||
|
@ -486,7 +361,10 @@ export default {
|
|||
// this.$emit('operateImageMarker', {operateStateEnum: 6, question})
|
||||
},
|
||||
handleCalculationBlur(v) {
|
||||
if (!v) return false
|
||||
if (!isNaN(parseFloat(v))) {
|
||||
this.calculationValue = parseFloat(v).toFixed(this.digitPlaces)
|
||||
}
|
||||
},
|
||||
limitInput(value, q) {
|
||||
if (value.indexOf('.') > -1) {
|
||||
|
@ -703,27 +581,31 @@ export default {
|
|||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.criterion-table-form-item {
|
||||
.el-form-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mb {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
::v-deep .el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.uploadWrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
|
@ -368,7 +368,7 @@ export default {
|
|||
if (v.Type === 'number') {
|
||||
let val = null
|
||||
if (v.ValueType === 0) {
|
||||
val = parseInt(v.Answers[this.visitTaskId])
|
||||
val = isNaN(parseFloat(v.Answers[this.visitTaskId])) ? v.Answers[this.visitTaskId] : parseInt(v.Answers[this.visitTaskId])
|
||||
} else if (v.ValueType === 3) {
|
||||
val = v.Answers[this.visitTaskId]
|
||||
} else {
|
||||
|
@ -394,7 +394,7 @@ export default {
|
|||
if (i.Type === 'number') {
|
||||
let val = null
|
||||
if (i.ValueType === 0) {
|
||||
val = parseInt(i.Answers[this.visitTaskId])
|
||||
val = isNaN(parseFloat(i.Answers[this.visitTaskId])) ? i.Answers[this.visitTaskId] : parseInt(i.Answers[this.visitTaskId])
|
||||
} else if (i.ValueType === 3) {
|
||||
val = i.Answers[this.visitTaskId]
|
||||
} else {
|
||||
|
@ -533,7 +533,7 @@ export default {
|
|||
if (item.Type === 'number') {
|
||||
let val = null
|
||||
if (item.ValueType === 0) {
|
||||
val = parseInt(i.Answer)
|
||||
val = isNaN(parseFloat(i.Answer)) ? i.Answer : parseInt(i.Answer)
|
||||
} else if (item.ValueType === 3) {
|
||||
val = i.Answer
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue