CRF表格-预览时没有展示单位
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
bd134ec4bd
commit
1d7b187ddc
|
@ -6,16 +6,12 @@
|
||||||
>
|
>
|
||||||
{{ question.GroupName }}
|
{{ question.GroupName }}
|
||||||
</div> -->
|
</div> -->
|
||||||
<div
|
<div v-if="!!question.GroupName && question.Type === 'group'"
|
||||||
v-if="!!question.GroupName && question.Type === 'group'"
|
style="font-weight: bold; font-size: 16px; margin: 5px 0px">
|
||||||
style="font-weight: bold; font-size: 16px; margin: 5px 0px"
|
|
||||||
>
|
|
||||||
{{ language === "en" ? question.GroupEnName : question.GroupName }}
|
{{ language === "en" ? question.GroupEnName : question.GroupName }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="question.Type === 'table' || question.Type === 'basicTable'"
|
||||||
v-if="question.Type === 'table' || question.Type === 'basicTable'"
|
style="font-weight: bold; font-size: 14px; margin: 5px 0px">
|
||||||
style="font-weight: bold; font-size: 14px; margin: 5px 0px"
|
|
||||||
>
|
|
||||||
<div style="display: flex; justify-content: space-between">
|
<div style="display: flex; justify-content: space-between">
|
||||||
<span>{{ question.QuestionName }}</span>
|
<span>{{ question.QuestionName }}</span>
|
||||||
<!-- 添加 -->
|
<!-- 添加 -->
|
||||||
|
@ -24,166 +20,103 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="question.TableQuestions.Answers">
|
<el-table :data="question.TableQuestions.Answers">
|
||||||
<el-table-column
|
<el-table-column v-for="item of question.TableQuestions.Questions" :key="item.Id" :prop="item.Id"
|
||||||
v-for="item of question.TableQuestions.Questions"
|
:label="item.QuestionName" min-width="100" show-overflow-tooltip>
|
||||||
:key="item.Id"
|
<template slot-scope="scope">
|
||||||
:prop="item.Id"
|
<span v-if="item.Unit">{{ scope.row[item.Id] }}{{ item.Unit !== 4 ? $fd('ValueUnit', item.Unit)
|
||||||
:label="item.QuestionName"
|
: item.ValueType === 2 ? '%' :
|
||||||
min-width="100"
|
item.CustomUnit }}</span>
|
||||||
show-overflow-tooltip
|
<span v-else>{{ scope.row[item.Id] }}</span>
|
||||||
/>
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-form-item
|
<el-form-item v-if="
|
||||||
v-if="
|
(question.ShowQuestion === 1 &&
|
||||||
(question.ShowQuestion === 1 &&
|
!!~question.ParentTriggerValueList.indexOf(
|
||||||
!!~question.ParentTriggerValueList.indexOf(
|
questionForm[question.ParentId]
|
||||||
questionForm[question.ParentId]
|
)) ||
|
||||||
)) ||
|
question.ShowQuestion === 0
|
||||||
question.ShowQuestion === 0
|
" :label="`${question.QuestionName}`" :prop="question.Id" :rules="[
|
||||||
"
|
{
|
||||||
:label="`${question.QuestionName}`"
|
required:
|
||||||
:prop="question.Id"
|
(question.IsRequired === 0 ||
|
||||||
:rules="[
|
(question.IsRequired === 1 &&
|
||||||
{
|
question.RelevanceId &&
|
||||||
required:
|
!!~question.RelevanceValueList.indexOf(
|
||||||
(question.IsRequired === 0 ||
|
isNaN(parseFloat(questionForm[question.RelevanceId])) ? questionForm[question.RelevanceId] :
|
||||||
(question.IsRequired === 1 &&
|
questionForm[question.RelevanceId].toString()))) &&
|
||||||
question.RelevanceId &&
|
question.Type !== 'group' &&
|
||||||
!!~question.RelevanceValueList.indexOf(
|
question.Type !== 'summary',
|
||||||
isNaN(parseFloat(questionForm[question.RelevanceId])) ? questionForm[question.RelevanceId] :
|
message: this.$t('common:ruleMessage:specify'),
|
||||||
questionForm[question.RelevanceId].toString()))) &&
|
trigger: ['blur', 'change'],
|
||||||
question.Type !== 'group' &&
|
},
|
||||||
question.Type !== 'summary',
|
]" :class="[
|
||||||
message: this.$t('common:ruleMessage:specify'),
|
question.Type === 'group'
|
||||||
trigger: ['blur', 'change'],
|
? 'mb'
|
||||||
},
|
: question.Type === 'upload'
|
||||||
]"
|
|
||||||
:class="[
|
|
||||||
question.Type === 'group'
|
|
||||||
? 'mb'
|
|
||||||
: question.Type === 'upload'
|
|
||||||
? 'uploadWrapper'
|
? 'uploadWrapper'
|
||||||
: '',
|
: '',
|
||||||
]"
|
]">
|
||||||
>
|
|
||||||
<!-- 输入框 -->
|
<!-- 输入框 -->
|
||||||
<el-input
|
<el-input v-if="question.Type === 'input'" v-model="questionForm[question.Id]"
|
||||||
v-if="question.Type === 'input'"
|
:disabled="question.TableQuestionType === 2" @change="(val) => { formItemChange(val, question) }" />
|
||||||
v-model="questionForm[question.Id]"
|
|
||||||
:disabled="question.TableQuestionType === 2"
|
|
||||||
@change="(val) => { formItemChange(val, question) }"
|
|
||||||
/>
|
|
||||||
<!-- 多行文本输入框 -->
|
<!-- 多行文本输入框 -->
|
||||||
<el-input
|
<el-input v-if="question.Type === 'textarea'" v-model="questionForm[question.Id]" type="textarea"
|
||||||
v-if="question.Type === 'textarea'"
|
:autosize="{ minRows: 2, maxRows: 4 }" @change="(val) => { formItemChange(val, question) }" />
|
||||||
v-model="questionForm[question.Id]"
|
|
||||||
type="textarea"
|
|
||||||
:autosize="{ minRows: 2, maxRows: 4 }"
|
|
||||||
@change="(val) => { formItemChange(val, question) }"
|
|
||||||
/>
|
|
||||||
<!-- 下拉框 -->
|
<!-- 下拉框 -->
|
||||||
<el-select
|
<el-select v-if="question.Type === 'select'" v-model="questionForm[question.Id]" clearable :disabled="(question.TableQuestionType === 2 ||
|
||||||
v-if="question.Type === 'select'"
|
question.QuestionGenre === 2) &&
|
||||||
v-model="questionForm[question.Id]"
|
!!question.DictionaryCode
|
||||||
clearable
|
" @change="(val) => { formItemChange(val, question) }">
|
||||||
:disabled="
|
<template v-if="question.TableQuestionType === 1">
|
||||||
|
<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" />
|
||||||
|
</template>
|
||||||
|
<template v-else-if="
|
||||||
(question.TableQuestionType === 2 ||
|
(question.TableQuestionType === 2 ||
|
||||||
question.QuestionGenre === 2) &&
|
question.QuestionGenre === 2) &&
|
||||||
!!question.DictionaryCode
|
question.DictionaryCode
|
||||||
"
|
">
|
||||||
@change="(val) => { formItemChange(val, question) }"
|
<el-option v-for="item of $d[question.DictionaryCode]" :key="item.id" :value="item.value"
|
||||||
>
|
:label="item.label" />
|
||||||
<template v-if="question.TableQuestionType === 1">
|
|
||||||
<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"
|
|
||||||
/>
|
|
||||||
</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>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-option
|
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val.trim()"
|
||||||
v-for="val in question.TypeValue.split('|')"
|
:value="val.trim()" />
|
||||||
:key="val"
|
|
||||||
:label="val.trim()"
|
|
||||||
:value="val.trim()"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</el-select>
|
</el-select>
|
||||||
<!-- 单选 -->
|
<!-- 单选 -->
|
||||||
<el-radio-group
|
<el-radio-group v-if="question.Type === 'radio'" v-model="questionForm[question.Id]"
|
||||||
v-if="question.Type === 'radio'"
|
@change="(val) => { formItemChange(val, question) }">
|
||||||
v-model="questionForm[question.Id]"
|
|
||||||
@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="item.value">
|
||||||
v-for="item of $d[question.DictionaryCode]"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.value"
|
|
||||||
>
|
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="question.TypeValue">
|
<template v-if="question.TypeValue">
|
||||||
<el-radio
|
<el-radio v-for="val in question.TypeValue.split('|')" :key="val.trim()" :label="val.trim()">
|
||||||
v-for="val in question.TypeValue.split('|')"
|
|
||||||
:key="val.trim()"
|
|
||||||
:label="val.trim()"
|
|
||||||
>
|
|
||||||
{{ val.trim() }}
|
{{ val.trim() }}
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<!-- 复选框 -->
|
<!-- 复选框 -->
|
||||||
<el-checkbox-group
|
<el-checkbox-group v-if="question.Type === 'checkbox'" v-model="questionForm[question.Id]"
|
||||||
v-if="question.Type === 'checkbox'"
|
@change="(val) => { formItemChange(val, question) }">
|
||||||
v-model="questionForm[question.Id]"
|
|
||||||
@change="(val) => { formItemChange(val, question) }"
|
|
||||||
>
|
|
||||||
<template v-if="question.DictionaryCode">
|
<template v-if="question.DictionaryCode">
|
||||||
<el-checkbox
|
<el-checkbox v-for="item of $d[question.DictionaryCode]" :key="item.id" :label="item.value">
|
||||||
v-for="item of $d[question.DictionaryCode]"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.value"
|
|
||||||
>
|
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="question.TypeValue">
|
<template v-if="question.TypeValue">
|
||||||
<el-checkbox
|
<el-checkbox v-for="val in question.TypeValue.split('|')" :key="val.trim()" :label="val.trim()">
|
||||||
v-for="val in question.TypeValue.split('|')"
|
|
||||||
:key="val.trim()"
|
|
||||||
:label="val.trim()"
|
|
||||||
>
|
|
||||||
{{ val.trim() }}
|
{{ val.trim() }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</template>
|
</template>
|
||||||
|
@ -191,129 +124,68 @@
|
||||||
|
|
||||||
<!-- 自动计算 -->
|
<!-- 自动计算 -->
|
||||||
<!-- :precision="2" :step="0.1" :max="10" -->
|
<!-- :precision="2" :step="0.1" :max="10" -->
|
||||||
<el-input
|
<el-input v-if="question.Type === 'calculation'" v-model="questionForm[question.Id]" disabled />
|
||||||
v-if="question.Type === 'calculation'"
|
|
||||||
v-model="questionForm[question.Id]"
|
|
||||||
disabled
|
|
||||||
/>
|
|
||||||
<!-- 自动分类 -->
|
<!-- 自动分类 -->
|
||||||
<el-input
|
<el-input v-if="question.Type === 'class' && question.ClassifyShowType === 1"
|
||||||
v-if="question.Type === 'class' && question.ClassifyShowType === 1"
|
v-model="questionForm[question.Id]" :disabled="!question.ClassifyEditType" />
|
||||||
v-model="questionForm[question.Id]"
|
<el-select v-if="question.Type === 'class' && question.ClassifyShowType === 2"
|
||||||
:disabled="!question.ClassifyEditType"
|
v-model="questionForm[question.Id]" :disabled="!question.ClassifyEditType"
|
||||||
/>
|
@change="(val) => { formItemChange(val, question) }">
|
||||||
<el-select
|
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val.trim()" :value="val.trim()" />
|
||||||
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-select>
|
||||||
<el-radio-group
|
<el-radio-group v-if="question.Type === 'class' && question.ClassifyShowType === 3"
|
||||||
v-if="question.Type === 'class' && question.ClassifyShowType === 3"
|
v-model="questionForm[question.Id]" :disabled="!question.ClassifyEditType"
|
||||||
v-model="questionForm[question.Id]"
|
@change="(val) => { formItemChange(val, question) }">
|
||||||
:disabled="!question.ClassifyEditType"
|
<el-radio v-for="item of question.TypeValue.split('|')" :key="item.trim()" :label="item.trim()">
|
||||||
@change="(val) => { formItemChange(val, question) }"
|
|
||||||
>
|
|
||||||
<el-radio
|
|
||||||
v-for="item of question.TypeValue.split('|')"
|
|
||||||
:key="item.trim()"
|
|
||||||
:label="item.trim()"
|
|
||||||
>
|
|
||||||
{{ item.trim() }}
|
{{ item.trim() }}
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<el-input
|
<el-input v-if="question.Type === 'class' && question.ClassifyShowType === 4" type="number"
|
||||||
v-if="question.Type === 'class' && question.ClassifyShowType === 4"
|
:disabled="!question.ClassifyEditType" v-model="questionForm[question.Id]" />
|
||||||
type="number"
|
|
||||||
:disabled="!question.ClassifyEditType"
|
|
||||||
v-model="questionForm[question.Id]"
|
|
||||||
/>
|
|
||||||
<!-- 自增 -->
|
<!-- 自增 -->
|
||||||
<el-input
|
<el-input v-if="question.Type === 'increment'" v-model="questionForm[question.Id]" disabled />
|
||||||
v-if="question.Type === 'increment'"
|
|
||||||
v-model="questionForm[question.Id]"
|
|
||||||
disabled
|
|
||||||
/>
|
|
||||||
<!-- 数值 -->
|
<!-- 数值 -->
|
||||||
<!-- :precision="2" :step="0.1" :max="10" -->
|
<!-- :precision="2" :step="0.1" :max="10" -->
|
||||||
<el-select
|
<el-select v-if="question.Type === 'number' && question.TypeValue" v-model="questionForm[question.Id]" clearable
|
||||||
v-if="question.Type === 'number' && question.TypeValue"
|
@change="(val) => { formItemNumberChange(val, question) }">
|
||||||
v-model="questionForm[question.Id]"
|
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val.trim()" :value="val.trim()" />
|
||||||
clearable
|
<template v-if="question.Unit !== 0" slot="prefix">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) :
|
||||||
@change="(val) => { formItemNumberChange(val, question) }"
|
question.CustomUnit }}</template>
|
||||||
>
|
<template v-else-if="question.ValueType === 2" slot="prefix">%</template>
|
||||||
<el-option
|
|
||||||
v-for="val in question.TypeValue.split('|')"
|
|
||||||
:key="val"
|
|
||||||
:label="val.trim()"
|
|
||||||
:value="val.trim()"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input
|
<el-input v-else-if="question.Type === 'number' && question.DataSource !== 1"
|
||||||
v-else-if="question.Type === 'number' && question.DataSource !== 1"
|
v-model="questionForm[question.Id]" type="number" @change="(val) => { formItemNumberChange(val, question) }">
|
||||||
v-model="questionForm[question.Id]"
|
<template v-if="question.Unit !== 0" slot="append">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) :
|
||||||
type="number"
|
question.CustomUnit }}</template>
|
||||||
@change="(val) => { formItemNumberChange(val, question) }"
|
<template v-else-if="question.ValueType === 2" slot="append">%</template>
|
||||||
/>
|
</el-input>
|
||||||
<el-input
|
<el-input v-else-if="question.Type === 'number' && question.DataSource === 1"
|
||||||
v-else-if="question.Type === 'number' && question.DataSource === 1"
|
v-model="questionForm[question.Id]" type="number" :disabled="question.DataSource === 1">
|
||||||
v-model="questionForm[question.Id]"
|
<template v-if="question.Unit !== 0" slot="append">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) :
|
||||||
type="number"
|
question.CustomUnit }}</template>
|
||||||
:disabled="question.DataSource === 1"
|
<template v-else-if="question.ValueType === 2" slot="append">%</template>
|
||||||
/>
|
</el-input>
|
||||||
<!-- 上传图像 -->
|
<!-- 上传图像 -->
|
||||||
<el-upload
|
<el-upload v-if="question.Type === 'upload'" action :accept="question.FileType"
|
||||||
v-if="question.Type === 'upload'"
|
:limit="question.ImageCount > 0 ? parseInt(question.ImageCount) : 100" :on-preview="handlePictureCardPreview"
|
||||||
action
|
:before-upload="handleBeforeUpload" :http-request="uploadScreenshot" list-type="picture-card"
|
||||||
:accept="question.FileType"
|
:on-remove="handleRemove" :file-list="fileList" :class="{ disabled: fileList.length >= question.ImageCount }">
|
||||||
:limit="question.ImageCount > 0 ? parseInt(question.ImageCount) : 100"
|
|
||||||
: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 }"
|
|
||||||
>
|
|
||||||
<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"
|
||||||
class="el-upload-list__item-thumbnail"
|
crossOrigin="Anonymous" alt="" />
|
||||||
:src="OSSclientConfig.basePath + file.url"
|
|
||||||
crossOrigin="Anonymous"
|
|
||||||
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" crossOrigin="Anonymous" width="100%">
|
<el-image :src="imageUrl" crossOrigin="Anonymous" width="100%">
|
||||||
<!-- 加载中 -->
|
<!-- 加载中 -->
|
||||||
<div slot="placeholder" class="image-slot">
|
<div slot="placeholder" class="image-slot">
|
||||||
|
@ -324,62 +196,28 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template
|
<template v-if="
|
||||||
v-if="
|
question.Childrens &&
|
||||||
question.Childrens &&
|
question.Childrens.length > 0 &&
|
||||||
question.Childrens.length > 0 &&
|
(question.Type !== 'table' && question.Type !== 'basicTable') && Object.keys(questionForm).length > 0
|
||||||
(question.Type !== 'table' && question.Type !== 'basicTable') && Object.keys(questionForm).length > 0
|
">
|
||||||
"
|
<QuestionFormItem v-for="item in question.Childrens" :key="item.Id" :questionForm="questionForm" :question="item"
|
||||||
>
|
:reading-task-state="readingTaskState" :is-system-criterion="isSystemCriterion" :visit-task-id="visitTaskId"
|
||||||
<QuestionFormItem
|
:criterion-id="criterionId" :calculation-list="calculationList" @formItemNumberChange="formItemNumberChange"
|
||||||
v-for="item in question.Childrens"
|
@setFormItemData="setFormItemData" @resetFormItemData="resetFormItemData" />
|
||||||
:key="item.Id"
|
|
||||||
:questionForm="questionForm"
|
|
||||||
:question="item"
|
|
||||||
:reading-task-state="readingTaskState"
|
|
||||||
:is-system-criterion="isSystemCriterion"
|
|
||||||
:visit-task-id="visitTaskId"
|
|
||||||
:criterion-id="criterionId"
|
|
||||||
:calculation-list="calculationList"
|
|
||||||
@formItemNumberChange="formItemNumberChange"
|
|
||||||
@setFormItemData="setFormItemData"
|
|
||||||
@resetFormItemData="resetFormItemData"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<el-dialog
|
<el-dialog v-if="addOrEdit.visible" class="my_dialog" :visible.sync="addOrEdit.visible"
|
||||||
v-if="addOrEdit.visible"
|
:close-on-click-modal="false" :title="addOrEdit.title" width="400px" append-to-body>
|
||||||
class="my_dialog"
|
|
||||||
:visible.sync="addOrEdit.visible"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
:title="addOrEdit.title"
|
|
||||||
width="400px"
|
|
||||||
append-to-body
|
|
||||||
>
|
|
||||||
<el-form ref="tableQsForm" v-loading="loading" size="small">
|
<el-form ref="tableQsForm" v-loading="loading" size="small">
|
||||||
<QuestionTableFormItem
|
<QuestionTableFormItem v-for="item in QuestionsList" :key="item.Id" :question="item"
|
||||||
v-for="item in QuestionsList"
|
:reading-task-state="readingTaskState" :is-system-criterion="isSystemCriterion" :question-form="QuestionsForm"
|
||||||
:key="item.Id"
|
:visit-task-id="visitTaskId" :criterion-id="criterionId"
|
||||||
:question="item"
|
@formItemTableNumberChange="formItemTableNumberChange" @setFormItemData="setTblFormItemData"
|
||||||
:reading-task-state="readingTaskState"
|
@resetFormItemData="resetTblFormItemData" />
|
||||||
:is-system-criterion="isSystemCriterion"
|
<div class="base-dialog-footer" style="text-align: right; margin-top: 10px">
|
||||||
:question-form="QuestionsForm"
|
|
||||||
:visit-task-id="visitTaskId"
|
|
||||||
:criterion-id="criterionId"
|
|
||||||
@formItemTableNumberChange="formItemTableNumberChange"
|
|
||||||
@setFormItemData="setTblFormItemData"
|
|
||||||
@resetFormItemData="resetTblFormItemData"
|
|
||||||
/>
|
|
||||||
<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="addOrEdit.visible = false">
|
||||||
size="small"
|
|
||||||
type="primary"
|
|
||||||
@click="addOrEdit.visible = false"
|
|
||||||
>
|
|
||||||
{{ $t("common:button:cancel") }}
|
{{ $t("common:button:cancel") }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- 保存 -->
|
<!-- 保存 -->
|
||||||
|
@ -470,9 +308,9 @@ export default {
|
||||||
if (this.question.Type === 'class') {
|
if (this.question.Type === 'class') {
|
||||||
this.$emit("setFormItemData", { key: this.question.Id, val: v[this.question.Id], question: v })
|
this.$emit("setFormItemData", { key: this.question.Id, val: v[this.question.Id], question: v })
|
||||||
}
|
}
|
||||||
|
|
||||||
this.formItemNumberChange(this.question.Id, false);
|
this.formItemNumberChange(this.question.Id, false);
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -623,8 +461,8 @@ export default {
|
||||||
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
|
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
|
||||||
}
|
}
|
||||||
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);
|
||||||
}, 0) / dataArr.length;
|
}, 0) / dataArr.length;
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
|
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
|
||||||
|
@ -642,7 +480,7 @@ export default {
|
||||||
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]))
|
||||||
}
|
}
|
||||||
|
|
||||||
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:
|
||||||
|
@ -680,7 +518,7 @@ export default {
|
||||||
var find = v.CalculateQuestionList.filter((o) => {
|
var find = v.CalculateQuestionList.filter((o) => {
|
||||||
return o.TableQuestionId === questionId;
|
return o.TableQuestionId === questionId;
|
||||||
});
|
});
|
||||||
|
|
||||||
// find的自动计算值number
|
// find的自动计算值number
|
||||||
if (find) {
|
if (find) {
|
||||||
var num = this.logic(v);
|
var num = this.logic(v);
|
||||||
|
@ -691,7 +529,7 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.$emit('formItemNumberChange')
|
// this.$emit('formItemNumberChange')
|
||||||
},
|
},
|
||||||
formItemTableNumberChange() {
|
formItemTableNumberChange() {
|
||||||
|
@ -724,8 +562,8 @@ export default {
|
||||||
arr.length === 0
|
arr.length === 0
|
||||||
? 0
|
? 0
|
||||||
: arr.reduce((acc, curr) => {
|
: arr.reduce((acc, curr) => {
|
||||||
return acc + (typeof curr === "number" ? curr : 0);
|
return acc + (typeof curr === "number" ? curr : 0);
|
||||||
}, 0) / arr.length;
|
}, 0) / arr.length;
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]));
|
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]));
|
||||||
|
@ -749,13 +587,13 @@ export default {
|
||||||
this.addOrEdit.title =
|
this.addOrEdit.title =
|
||||||
row.QuestionName + this.$t("trials:readingUnit:qsList:title:tableQs"); // '表格问题'
|
row.QuestionName + this.$t("trials:readingUnit:qsList:title:tableQs"); // '表格问题'
|
||||||
this.QuestionsList = row.TableQuestions.Questions;
|
this.QuestionsList = row.TableQuestions.Questions;
|
||||||
row.TableQuestions.Questions.map(v=>{
|
row.TableQuestions.Questions.map(v => {
|
||||||
if (v.Type === 'class') {
|
if (v.Type === 'class') {
|
||||||
this.classArr.push({triggerId: v.ClassifyTableQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType})
|
this.classArr.push({ triggerId: v.ClassifyTableQuestionId, classId: v.Id, classifyAlgorithms: v.ClassifyAlgorithms, classifyType: v.ClassifyType })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// this.AnswersList = row.TableQuestions.Answers;
|
// this.AnswersList = row.TableQuestions.Answers;
|
||||||
row.TableQuestions.Questions.map(i=>{
|
row.TableQuestions.Questions.map(i => {
|
||||||
this.$set(this.QuestionsForm, i.Id, null)
|
this.$set(this.QuestionsForm, i.Id, null)
|
||||||
})
|
})
|
||||||
// this.QuestionsForm = {};
|
// this.QuestionsForm = {};
|
||||||
|
@ -815,7 +653,7 @@ export default {
|
||||||
},
|
},
|
||||||
setTblFormItemData(obj) {
|
setTblFormItemData(obj) {
|
||||||
this.$set(this.QuestionsForm, obj.key, obj.val)
|
this.$set(this.QuestionsForm, obj.key, obj.val)
|
||||||
this.classArr.map(i=>{
|
this.classArr.map(i => {
|
||||||
if (i.triggerId === obj.key) {
|
if (i.triggerId === obj.key) {
|
||||||
let answer = null
|
let answer = null
|
||||||
let list = JSON.parse(i.classifyAlgorithms)
|
let list = JSON.parse(i.classifyAlgorithms)
|
||||||
|
@ -826,12 +664,12 @@ export default {
|
||||||
parseFloat(obj.val) < parseFloat(v.lt)
|
parseFloat(obj.val) < parseFloat(v.lt)
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
answer = o ? o.label : null
|
answer = o ? o.label : null
|
||||||
} else if (i.classifyType === 1) {
|
} else if (i.classifyType === 1) {
|
||||||
let o = list.find(v => {
|
let o = list.find(v => {
|
||||||
return v.val.includes(obj.val)
|
return v.val.includes(obj.val)
|
||||||
})
|
})
|
||||||
answer = o ? o.label : null
|
answer = o ? o.label : null
|
||||||
}
|
}
|
||||||
this.$set(this.QuestionsForm, i.classId, answer)
|
this.$set(this.QuestionsForm, i.classId, answer)
|
||||||
}
|
}
|
||||||
|
@ -985,26 +823,42 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::v-deep .el-select .el-input__prefix {
|
||||||
|
left: calc(100% - 50px);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-select .el-input__inner {
|
||||||
|
padding-left: 15px;
|
||||||
|
padding-right: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
.criterion-form-item {
|
.criterion-form-item {
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .el-form-item__content {
|
::v-deep .el-form-item__content {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-input {
|
.el-input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.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;
|
flex-direction: column;
|
||||||
|
|
|
@ -2,224 +2,117 @@
|
||||||
<div class="criterion-form-item">
|
<div class="criterion-form-item">
|
||||||
|
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="(question.ShowQuestion===1 && !!~question.ParentTriggerValueList.indexOf(questionForm[question.ParentId])) || question.ShowQuestion===0"
|
v-if="(question.ShowQuestion === 1 && !!~question.ParentTriggerValueList.indexOf(questionForm[question.ParentId])) || question.ShowQuestion === 0"
|
||||||
:label="`${question.QuestionName}`"
|
:label="`${question.QuestionName}`" :prop="questionForm[question.Id]" :rules="[
|
||||||
:prop="questionForm[question.Id]"
|
{
|
||||||
:rules="[
|
required: (question.IsRequired === 0 || (question.IsRequired === 1 && question.RelevanceId && !!~question.RelevanceValueList.indexOf(questionForm[question.RelevanceId]))) && question.Type !== 'group' && question.Type !== 'summary',
|
||||||
{ 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:specify'), trigger: ['blur', 'change']
|
||||||
message: $t('common:ruleMessage:specify'), trigger: ['blur', 'change']},
|
},
|
||||||
]"
|
]" :class="[question.Type === 'group' ? 'mb' : question.Type === 'upload' ? 'uploadWrapper' : '']">
|
||||||
:class="[question.Type==='group'?'mb':question.Type==='upload'?'uploadWrapper':'']"
|
|
||||||
>
|
|
||||||
<!-- 输入框 -->
|
<!-- 输入框 -->
|
||||||
<el-input
|
<el-input v-if="question.Type === 'input'" v-model="questionForm[question.Id]"
|
||||||
v-if="question.Type==='input'"
|
:disabled="question.TableQuestionType === 2" />
|
||||||
v-model="questionForm[question.Id]"
|
|
||||||
:disabled="question.TableQuestionType === 2"
|
|
||||||
/>
|
|
||||||
<!-- 多行文本输入框 -->
|
<!-- 多行文本输入框 -->
|
||||||
<el-input
|
<el-input v-if="question.Type === 'textarea'" v-model="questionForm[question.Id]" type="textarea"
|
||||||
v-if="question.Type==='textarea'"
|
:autosize="{ minRows: 2, maxRows: 4 }" />
|
||||||
v-model="questionForm[question.Id]"
|
|
||||||
type="textarea"
|
|
||||||
:autosize="{ minRows: 2, maxRows: 4}"
|
|
||||||
/>
|
|
||||||
<!-- 下拉框 -->
|
<!-- 下拉框 -->
|
||||||
<el-select
|
<el-select v-if="question.Type === 'select'" v-model="questionForm[question.Id]" clearable
|
||||||
v-if="question.Type==='select'"
|
|
||||||
v-model="questionForm[question.Id]"
|
|
||||||
clearable
|
|
||||||
:disabled="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && !!question.DictionaryCode"
|
:disabled="(question.TableQuestionType === 2 || question.QuestionGenre === 2) && !!question.DictionaryCode"
|
||||||
@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="item.value"
|
||||||
v-for="item of $d[question.DictionaryCode]"
|
:label="item.label" />
|
||||||
:key="item.id"
|
|
||||||
:value="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="item.value"
|
||||||
:key="item.id"
|
:label="item.label" />
|
||||||
:value="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-if="question.Type === 'radio'" v-model="questionForm[question.Id]"
|
||||||
v-if="question.Type==='radio'"
|
@change="((val) => { formItemChange(val, question) })">
|
||||||
v-model="questionForm[question.Id]"
|
<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 }}
|
{{ val }}
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<!-- 复选框 -->
|
<!-- 复选框 -->
|
||||||
<el-checkbox-group
|
<el-checkbox-group v-if="question.Type === 'checkbox'" v-model="questionForm[question.Id]">
|
||||||
v-if="question.Type==='checkbox'"
|
<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 }}
|
{{ val }}
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
|
|
||||||
<!-- 自动计算 -->
|
<!-- 自动计算 -->
|
||||||
<!-- :precision="2" :step="0.1" :max="10" -->
|
<!-- :precision="2" :step="0.1" :max="10" -->
|
||||||
<el-input
|
<el-input v-if="question.Type === 'calculation'" v-model="questionForm[question.Id]" disabled />
|
||||||
v-if="question.Type==='calculation'"
|
|
||||||
v-model="questionForm[question.Id]"
|
|
||||||
disabled
|
|
||||||
/>
|
|
||||||
<!-- 自动计算 -->
|
<!-- 自动计算 -->
|
||||||
<el-input
|
<el-input v-if="question.Type === 'class' && question.ClassifyShowType === 1" v-model="questionForm[question.Id]"
|
||||||
v-if="question.Type === 'class' && question.ClassifyShowType === 1"
|
:disabled="!question.ClassifyEditType" />
|
||||||
v-model="questionForm[question.Id]"
|
<el-select v-if="question.Type === 'class' && question.ClassifyShowType === 2" v-model="questionForm[question.Id]"
|
||||||
:disabled="!question.ClassifyEditType"
|
: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
|
|
||||||
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-select>
|
||||||
<el-radio-group
|
<el-radio-group v-if="question.Type === 'class' && question.ClassifyShowType === 3"
|
||||||
v-if="question.Type === 'class' && question.ClassifyShowType === 3"
|
v-model="questionForm[question.Id]" :disabled="!question.ClassifyEditType"
|
||||||
v-model="questionForm[question.Id]"
|
@change="(val) => { formItemChange(val, question) }">
|
||||||
:disabled="!question.ClassifyEditType"
|
<el-radio v-for="item of question.TypeValue.split('|')" :key="item.trim()" :label="item.trim()">
|
||||||
@change="(val) => { formItemChange(val, question) }"
|
|
||||||
>
|
|
||||||
<el-radio
|
|
||||||
v-for="item of question.TypeValue.split('|')"
|
|
||||||
:key="item.trim()"
|
|
||||||
:label="item.trim()"
|
|
||||||
>
|
|
||||||
{{ item.trim() }}
|
{{ item.trim() }}
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
|
|
||||||
<!-- 自增 -->
|
<!-- 自增 -->
|
||||||
<el-input
|
<el-input v-if="question.Type === 'increment'" v-model="questionForm[question.Id]" disabled />
|
||||||
v-if="question.Type==='increment'"
|
|
||||||
v-model="questionForm[question.Id]"
|
|
||||||
disabled
|
|
||||||
/>
|
|
||||||
<!-- 数值 -->
|
<!-- 数值 -->
|
||||||
<!-- :precision="2" :step="0.1" :max="10" -->
|
<!-- :precision="2" :step="0.1" :max="10" -->
|
||||||
<el-select
|
<el-select v-if="question.Type === 'number' && question.TypeValue" v-model="questionForm[question.Id]" clearable
|
||||||
v-if="question.Type === 'number' && question.TypeValue"
|
@change="((val) => { formItemChange(val, question) })">
|
||||||
v-model="questionForm[question.Id]"
|
<el-option v-for="val in question.TypeValue.split('|')" :key="val" :label="val" :value="val" />
|
||||||
clearable
|
<template v-if="question.Unit !== 0" slot="prefix">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) :
|
||||||
@change="((val)=>{formItemChange(val, question)})"
|
question.CustomUnit }}</template>
|
||||||
>
|
<template v-else-if="question.ValueType === 2" slot="prefix">%</template>
|
||||||
<el-option
|
|
||||||
v-for="val in question.TypeValue.split('|')"
|
|
||||||
:key="val"
|
|
||||||
:label="val"
|
|
||||||
:value="val"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input
|
<el-input v-else-if="question.Type === 'number' && question.DataSource !== 1" v-model="questionForm[question.Id]"
|
||||||
v-else-if="question.Type === 'number' && question.DataSource !== 1"
|
type="number" @change="((val) => { formItemNumberChange(val, question) })">
|
||||||
v-model="questionForm[question.Id]"
|
<template v-if="question.Unit !== 0" slot="append">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) :
|
||||||
type="number"
|
question.CustomUnit }}</template>
|
||||||
@change="((val)=>{formItemNumberChange(val, question)})"
|
|
||||||
>
|
|
||||||
<template v-if="question.Unit !== 0" slot="append">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit }}</template>
|
|
||||||
<template v-else-if="question.ValueType === 2" slot="append">%</template>
|
<template v-else-if="question.ValueType === 2" slot="append">%</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-input
|
<el-input v-else-if="question.Type === 'number' && question.DataSource === 1" v-model="questionForm[question.Id]"
|
||||||
v-else-if="question.Type === 'number' && question.DataSource === 1"
|
type="number" :disabled="question.DataSource === 1">
|
||||||
v-model="questionForm[question.Id]"
|
<template v-if="question.Unit !== 0" slot="append">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) :
|
||||||
type="number"
|
question.CustomUnit }}</template>
|
||||||
:disabled="question.DataSource === 1"
|
|
||||||
>
|
|
||||||
<template v-if="question.Unit !== 0" slot="append">{{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit }}</template>
|
|
||||||
<template v-else-if="question.ValueType === 2" slot="append">%</template>
|
<template v-else-if="question.ValueType === 2" slot="append">%</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<!-- 上传图像 -->
|
<!-- 上传图像 -->
|
||||||
<el-upload
|
<el-upload v-if="question.Type === 'upload'" action :accept="question.FileType"
|
||||||
v-if="question.Type==='upload'"
|
:limit="question.ImageCount > 0 ? parseInt(question.ImageCount) : 100" :on-preview="handlePictureCardPreview"
|
||||||
action
|
:before-upload="handleBeforeUpload" :http-request="uploadScreenshot" list-type="picture-card"
|
||||||
:accept="question.FileType"
|
:on-remove="handleRemove" :file-list="fileList" :class="{ disabled: fileList.length >= question.ImageCount }">
|
||||||
:limit="question.ImageCount > 0 ? parseInt(question.ImageCount) : 100"
|
|
||||||
: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}"
|
|
||||||
>
|
|
||||||
<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" crossorigin="anonymous" :src="OSSclientConfig.basePath + file.url"
|
||||||
class="el-upload-list__item-thumbnail"
|
alt="">
|
||||||
crossorigin="anonymous"
|
|
||||||
: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" crossorigin="anonymous" width="100%">
|
<el-image :src="imageUrl" crossorigin="anonymous" width="100%">
|
||||||
<div slot="placeholder" class="image-slot">
|
<div slot="placeholder" class="image-slot">
|
||||||
加载中<span class="dot">...</span>
|
加载中<span class="dot">...</span>
|
||||||
|
@ -297,7 +190,7 @@ export default {
|
||||||
this.question.ClassifyAlgorithms
|
this.question.ClassifyAlgorithms
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.question.Type === 'upload') {
|
if (this.question.Type === 'upload') {
|
||||||
if (this.questionForm[this.question.Id]) {
|
if (this.questionForm[this.question.Id]) {
|
||||||
this.urls = this.questionForm[this.question.Id].split('|')
|
this.urls = this.questionForm[this.question.Id].split('|')
|
||||||
|
@ -372,7 +265,7 @@ export default {
|
||||||
this.$emit('setFormItemData', obj)
|
this.$emit('setFormItemData', obj)
|
||||||
},
|
},
|
||||||
uploadScreenshot(param) {
|
uploadScreenshot(param) {
|
||||||
|
|
||||||
},
|
},
|
||||||
handleBeforeUpload(file) {
|
handleBeforeUpload(file) {
|
||||||
// 检测文件类型是否符合要求
|
// 检测文件类型是否符合要求
|
||||||
|
@ -409,34 +302,50 @@ export default {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.my_dialog{
|
.my_dialog {
|
||||||
.criterion-form-item{
|
.criterion-form-item {
|
||||||
::v-deep .el-form-item__content{
|
::v-deep .el-form-item__content {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.criterion-form-item{
|
|
||||||
.el-form-item{
|
::v-deep .el-select .el-input__prefix {
|
||||||
|
left: calc(100% - 50px);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-select .el-input__inner {
|
||||||
|
padding-left: 15px;
|
||||||
|
padding-right: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.criterion-form-item {
|
||||||
|
.el-form-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
::v-deep .el-form-item__content{
|
|
||||||
|
::v-deep .el-form-item__content {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
}
|
}
|
||||||
.el-input{
|
|
||||||
width:100%;
|
.el-input {
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.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;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|
Loading…
Reference in New Issue