沈丘营商办后台前端项目
wjt
2024-06-19 21245bd2f9775bc0149174256f58001a67fddba6
src/views/infomanger/banner/index.vue
@@ -59,7 +59,11 @@
          </el-row>
          <el-row v-if="item.questionType === 1">
            <el-col :span="24">
              <el-form-item label="选项" style="width: 100%;"  :prop="item.answerList">
              <el-form-item label="选项" style="width: 100%;"  :prop="`${index}`" :rules="[
                {
                  validator: answerListField,
                }
              ]">
                  <div
                    v-for="(ele, childIndex) in item.answerList"
                    :key="index"
@@ -156,6 +160,13 @@
    callback()
  }
}
function answerListField(rule: { field: string | number }, value: any, callback: any) {
  if(form.value.questionList[rule.field].answerList.length < 2) {
    callback(new Error('请至少添加两项'))
  } else {
    callback()
  }
}
function changeValue(event, index, childIndex) {
  // form.value.questionList[index].isScore = event.target.
  form.value.questionList[index].answerList.forEach((item: { isScore: number }) => {