[update] 修改bug79983

This commit is contained in:
lideqin
2024-01-04 17:29:50 +08:00
parent 384c0d4a72
commit 3a127821d1
@@ -17,6 +17,7 @@
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('businessSupport.questionAnswer.classify')">
<a-select :placeholder="$t('pleaseSelect') + $t('businessSupport.questionAnswer.classify')"
allowClear
@change="typeChange"
v-decorator.trim="[ 'type', validatorRules.type]">
<a-select-option :value="null" :key="-1">请选择</a-select-option>
<a-select-option value="1">国内标准</a-select-option>
@@ -27,7 +28,7 @@
</a-form-item>
</a-col>
<!-- 标准编号 -->
<a-col :span="12" v-if="['1', '2', '3'].includes(form.getFieldValue('type'))">
<a-col :span="12">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardNumber')">
<standard-selection
v-decorator.trim="[ 'standardNumber', validatorRules.standardNumber]"
@@ -39,7 +40,7 @@
</a-form-item>
</a-col>
<!-- 标准名称 -->
<a-col :span="12" v-if="['1', '2', '3'].includes(form.getFieldValue('type'))">
<a-col :span="12">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardName')">
<a-input disabled :placeholder="$t('pleaseEnter') + $t('standardName')"
v-decorator.trim="[ 'standardName', validatorRules.standardName]"/>
@@ -193,7 +194,7 @@ export default {
this.visible = true
this.form.resetFields()
const param = {}
param.quizTime = new Date().getFullYear() + '-' + new Date().getMonth() + '-' + new Date().getDay() + ' ' +
param.quizTime = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDay() + ' ' +
new Date().getHours() + ':' + new Date().getMinutes() + ':' + new Date().getSeconds()
this.$nextTick(() => {
this.form.setFieldsValue(pick(param, 'quizTime'))
@@ -209,6 +210,19 @@ export default {
}
})
},
// 分类改变
typeChange (value) {
if (value) {
if (value === '4') {
// 是其他问题,标准编号和标准名称不必填
this.validatorRules.standardNumber.rules[0].required = false
this.validatorRules.standardName.rules[0].required = false
} else {
this.validatorRules.standardNumber.rules[0].required = true
this.validatorRules.standardName.rules[0].required = true
}
}
},
// 标准选择名称改变的回调
standardNameChange (value) {
const param = { standardName: value }