WXL
2024-04-08 412ecc2c412a03c909c0dc2ef41f08d02eb7d913
src/views/repositoryai/verbaltrick/particulars/index.vue
@@ -455,7 +455,7 @@
            </el-col></el-row
          >
          <el-card class="box-card" style="margin-bottom: 20px">
          <!-- <el-card class="box-card" style="margin-bottom: 20px">
            <el-table
              v-loading="loading"
              :data="indexform.ivrLibaScriptTargetoptionList"
@@ -531,6 +531,15 @@
                </template>
              </el-table-column>
            </el-table>
          </el-card> -->
          <el-card class="box-card" style="margin-bottom: 20px">
            <Regular
              :TargetoptionList="indexform.ivrLibaScriptTargetoptionList"
              @addoption="addoption"
              @deloption="deloption"
              @syioption="syioption"
              @xiayioption="xiayioption"
            />
          </el-card>
          <el-row :gutter="20">
            <el-col :span="12">
@@ -576,9 +585,12 @@
  gettargetInfolist,
  gettargetInfo,
} from "@/api/AiCentre/index";
import Regular from "@/components/Regular"; //正则组件
import store from "@/store";
export default {
  name: "Verbalproblem",
  components: { Regular },
  data() {
    return {
      Editprogress: 1, //编辑进度
@@ -592,7 +604,10 @@
      testvalue: "",
      testgovalue: "",
      topicobj: {},
      indexform: {},
      indexform: {
        ivrLibaScriptTargetoptionList:[],
        ivrLibaScriptTagList:[]
      },
      mode: [],
      questionclass: [],
      currentInputId: "",
@@ -653,23 +668,25 @@
    // 获取详情数据
    getverbaltrick() {
      let id = this.$route.query.id;
      getverbaltrick({ id: id }).then((res) => {
        this.indexform = res.data;
        this.indexform.suitway = this.indexform.suitway.split(",");
        this.indexform.assortid = parseInt(this.indexform.assortid);
        this.variablelist = JSON.parse(this.indexform.otherdata).length
          ? JSON.parse(this.indexform.otherdata)
          : this.variablelist;
        this.dynamicTags = this.indexform.ivrLibaScriptTagList.map(
          this.processElement
        );
        this.targetlist = [
          {
            id: this.indexform.targetid,
            targetname: this.indexform.targetname,
          },
        ];
      });
      if (id) {
        getverbaltrick({ id: id }).then((res) => {
          this.indexform = res.data;
          this.indexform.suitway = this.indexform.suitway.split(",");
          this.indexform.assortid = parseInt(this.indexform.assortid);
          this.variablelist = JSON.parse(this.indexform.otherdata).length
            ? JSON.parse(this.indexform.otherdata)
            : this.variablelist;
          this.dynamicTags = this.indexform.ivrLibaScriptTagList.map(
            this.processElement
          );
          this.targetlist = [
            {
              id: this.indexform.targetid,
              targetname: this.indexform.targetname,
            },
          ];
        });
      }
      // 树
      getbaltrickclassify({}).then((res) => {
        this.questionclass = res.rows;
@@ -682,7 +699,15 @@
      console.log(this.variablelist);
      this.indexform.otherdata = JSON.stringify(this.variablelist);
      this.indexform.suitway = this.indexform.suitway.join(",");
      if (this.indexform.id) {
        this.indexform.ivrLibaScriptTargetoptionList =
        this.indexform.ivrLibaScriptTargetoptionList.map((res) => {
          if (res.isoperation!=1) {
            res.isoperation = 2;
          }
          return res;
        });
        this.indexform.isoperation = 2;
        compileverbaltrick(this.indexform).then((res) => {
          if (res.code == 200) {
@@ -697,6 +722,7 @@
        });
      } else {
        this.indexform.isoperation = 1;
        compileverbaltrick(this.indexform).then((res) => {
          if (res.code == 200) {
            this.$modal.msgSuccess("新增成功");
@@ -731,6 +757,7 @@
          .confirm('是否添加"' + this.indexform.targetname + '"指标的选项?')
          .then(() => {
            this.indexform.isenable = res.rows[0].isenable;
            console.log(res.rows[0].targetoptionList);
            res.rows[0].targetoptionList.forEach((item) => {
              item.isoperation = 1;
              this.indexform.ivrLibaScriptTargetoptionList.push(item);