WXL
2024-08-27 b50917f4bdf0b05c028d76d8cdbde44a85ec8b91
src/views/repositoryai/templateku/configurat/index.vue
@@ -348,9 +348,16 @@
            @click="getaddtopiclist"
            >添加题目</el-button
          >
          <el-button
            type="success"
            icon="el-icon-edit-outline"
            round
            @click="Operateit = !Operateit"
            >{{ !Operateit ? "编辑题目" : "完整信息展示" }}</el-button
          >
        </div>
        <div class="presentation">
          <div class="presentation-left">
          <div :class="Operateit ? 'presentation-left' : 'spresentation-left'">
            <el-card class="box-card" style="min-height: 688px">
              <el-table
                v-loading="loading"
@@ -370,15 +377,40 @@
                  :show-overflow-tooltip="true"
                />
                <el-table-column
                  v-if="!Operateit"
                  label="问题话术"
                  align="center"
                  key="scriptContent"
                  prop="scriptContent"
                  :show-overflow-tooltip="true"
                />
                <el-table-column
                  v-if="!Operateit"
                  label="问题话术"
                  align="center"
                  key="scriptContent"
                  prop="scriptContent"
                  :show-overflow-tooltip="true"
                />
                <el-table-column
                  label="下题跳转"
                  align="center"
                  key="nextScriptno"
                  prop="nextScriptno"
                  :show-overflow-tooltip="true"
                >
                  <template slot-scope="scope">
                    <span>{{
                      scope.row.nextScriptno == 0
                        ? "已是最后一题"
                        : scope.row.nextScriptno
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  label="操作"
                  v-if="Operateit"
                  align="center"
                  width="250"
                  class-name="small-padding fixed-width"
@@ -413,7 +445,7 @@
              </el-table>
            </el-card>
          </div>
          <div class="presentation-right">
          <div class="presentation-right" v-if="Operateit">
            <el-card class="box-card">
              <el-form
                :model="topicobj"
@@ -422,13 +454,21 @@
              >
                <div class="headline">题目设置详情</div>
                <el-row>
                  <el-col :span="20"
                  <el-col :span="12"
                    ><el-form-item label="题目标题">
                      <el-input
                        v-model="topicobj.scriptTopic"
                        placeholder="请从左侧列表选择"
                      ></el-input> </el-form-item
                  ></el-col>
                  <el-col :span="12">
                    <el-form-item label="下题跳转">
                      <el-input
                        v-model="topicobj.nextScriptno"
                        placeholder="请输入题号"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="20"
@@ -469,14 +509,14 @@
                      </el-select> </el-form-item
                  ></el-col>
                  <el-col :span="12"
                    ><el-form-item label="取值类型">
                    ><el-form-item label="题目类型">
                      <el-select
                        v-model="topicobj.valueType"
                        v-model="topicobj.scriptType"
                        placeholder="请选择"
                        :disabled="true"
                      >
                        <el-option
                          v-for="item in valuetype"
                          v-for="item in askvaluetype"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
@@ -485,6 +525,15 @@
                      </el-select> </el-form-item
                  ></el-col>
                </el-row>
                <el-form-item
                  label="是否由选项配置跳转"
                  v-if="topicobj.scriptType == 1"
                >
                  <el-radio-group v-model="topicobj.branchFlag">
                    <el-radio :label="1">是</el-radio>
                    <el-radio :label="0">否</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-row>
                  <el-col :span="6">
                    <el-form-item label="问题语音" prop="verbaltrickyy">
@@ -556,6 +605,8 @@
                  <Regular
                    :TargetoptionList="topicobj.ivrLibaScriptTargetoptionList"
                    @deloption="deloption"
                    @branchFlagfn="branchFlagfn"
                    :branchFlag="topicobj.branchFlag ? true : false"
                    :controlsc="false"
                  />
                  <!-- 无匹配类型 -->
@@ -753,62 +804,64 @@
        <el-divider></el-divider>
        <div class="preview-left">
          <!-- 单选 -->
          <div
            class="scriptTopic-dev"
            v-for="item in valssu"
            :key="item.sort"
            v-if="item.valueType == 1"
          >
            <div class="dev-text">
              {{ item.sort }}、[单选]<span>{{ item.scriptContent }}</span>
          <div v-for="item in valssu">
            <!-- 单选 -->
            <div
              class="scriptTopic-dev"
              :key="item.sort"
              v-if="item.valueType == 1"
            >
              <div class="dev-text">
                {{ item.sort }}、[单选]<span>{{ item.scriptContent }}</span>
              </div>
              <div class="dev-xx">
                <el-radio-group v-model="item.remark">
                  <el-radio
                    v-for="(items, index) in item.ivrLibaScriptTargetoptionList"
                    :key="index"
                    :label="index"
                    >{{ items.targetvalue }}</el-radio
                  >
                </el-radio-group>
              </div>
            </div>
            <div class="dev-xx">
              <el-radio-group v-model="item.remark">
                <el-radio
                  v-for="(items, index) in item.ivrLibaScriptTargetoptionList"
                  :key="index"
                  :label="index"
                  >{{ items.targetvalue }}</el-radio
                >
              </el-radio-group>
            <!-- 多选 -->
            <div
              class="scriptTopic-dev"
              :key="item.sort"
              v-if="item.valueType == 2"
            >
              <div class="dev-text">
                {{ item.sort }}、[多选]<span>{{ item.scriptContent }}</span>
              </div>
              <div class="dev-xx">
                <el-checkbox-group v-model="item.remark">
                  <el-checkbox
                    v-for="(items, index) in item.ivrLibaScriptTargetoptionList"
                    :key="index"
                    :label="index"
                  >
                    {{ items.targetvalue }}
                  </el-checkbox>
                </el-checkbox-group>
              </div>
            </div>
          </div>
          <!-- 多选 -->
          <div
            class="scriptTopic-dev"
            v-for="item in valssu"
            :key="item.sort"
            v-if="item.valueType == 2"
          >
            <div class="dev-text">
              {{ item.sort }}、[多选]<span>{{ item.scriptContent }}</span>
            </div>
            <div class="dev-xx">
              <el-checkbox-group v-model="item.remark">
                <el-checkbox
                  v-for="(items, index) in item.ivrLibaScriptTargetoptionList"
                  :key="index"
                  :label="index"
                >
                  {{ items.targetvalue }}
                </el-checkbox>
              </el-checkbox-group>
            </div>
          </div>
          <!-- 填空 -->
          <div
            class="scriptTopic-dev"
            v-for="item in valssu"
            :key="item.sort"
            v-if="item.valueType == 3"
          >
            <div class="dev-text">
              {{ item.sort }}、[填空]<span>{{ item.scriptContent }}</span>
            </div>
            <div class="dev-xx">
              <el-input placeholder="请输入答案" v-model="radioas" clearable>
              </el-input>
            <!-- 填空 -->
            <div
              class="scriptTopic-dev"
              :key="item.sort"
              v-if="item.valueType == 3"
            >
              <div class="dev-text">
                {{ item.sort }}、[填空]<span>{{ item.scriptContent }}</span>
              </div>
              <div class="dev-xx">
                <el-input placeholder="请输入答案" v-model="radioas" clearable>
                </el-input>
              </div>
            </div>
          </div>
        </div>
@@ -1335,6 +1388,7 @@
      radioas: "", //填空题答案
      task: null, //是否来自任务
      taskform: null, //任务信息
      Operateit: true,
      indexform: {
        ivrLibaScriptTargetoptionList: [],
      },
@@ -1385,6 +1439,7 @@
      usable: [],
      required: [],
      valuetype: [],
      askvaluetype: [],
      mode: [],
      inputVisible: false,
      inputVisibleillness: false,
@@ -1451,6 +1506,7 @@
    this.usable = store.getters.usable;
    this.required = store.getters.required;
    this.valuetype = store.getters.valuetype;
    this.askvaluetype = store.getters.askvaluetype;
    this.languagelist = store.getters.languagelist;
    this.courtyardlist = store.getters.courtyardlist;
    this.precedencetype = store.getters.precedencetype;
@@ -1555,7 +1611,14 @@
      });
      // 疾病列
    },
    //
    // 选项配置跳转触发
    branchFlagfn(row) {
      if (this.topicobj.branchFlag == 1 && this.topicobj.nextScriptno != 0) {
        this.topicobj.nextScriptno =
          this.topicobj.ivrLibaScriptTargetoptionList[0].nextQuestion;
      }
    },
    //保存
    submitForm(formName) {
      if (this.ruleForm.id) {
        this.ruleForm.isoperation = 2;
@@ -1874,16 +1937,20 @@
    },
    // 问题排序
    sortFn() {
      this.ruleForm.ivrLibaTemplateScriptVOList =
        this.ruleForm.ivrLibaTemplateScriptVOList.map((item, index) => {
          return Object.assign({}, item, { sort: (index + 1).toString() });
        });
      this.ruleForm.ivrLibaTemplateScriptVOList.forEach((question, index) => {
        question.ivrLibaScriptTargetoptionList =
          question.ivrLibaScriptTargetoptionList.map((option) => {
            option.nextQuestion = Number(question.sort) + 1;
            return option;
      this.ruleForm.ivrLibaTemplateScriptVOList.forEach((item, index) => {
        item.sort = Number(index) + 1;
        console.log(1);
        if (item.sort == this.ruleForm.ivrLibaTemplateScriptVOList.length) {
          item.nextScriptno = 0;
        } else {
          item.nextScriptno = item.sort + 1;
        }
        if (item.ivrLibaScriptTargetoptionList) {
          item.ivrLibaScriptTargetoptionList.forEach((items) => {
            items.nextQuestion = Number(item.sort) + 1;
          });
        }
      });
      console.log(this.ruleForm.ivrLibaTemplateScriptVOList);
    },
@@ -2092,6 +2159,16 @@
      color: #f52727;
    }
  }
  .spresentation-left {
    width: 100%;
    // height: 500px;
    .button-textxg {
      color: #024df0;
    }
    .button-textsc {
      color: #f52727;
    }
  }
  .presentation-right {
    width: 55%;
    max-height: 688px;