From 412ecc2c412a03c909c0dc2ef41f08d02eb7d913 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期一, 08 四月 2024 09:52:15 +0800
Subject: [PATCH] 测试完成

---
 src/views/repositoryai/verbaltrick/particulars/index.vue |  130 +++++++++++++++++++++++++++---------------
 1 files changed, 83 insertions(+), 47 deletions(-)

diff --git a/src/views/repositoryai/verbaltrick/particulars/index.vue b/src/views/repositoryai/verbaltrick/particulars/index.vue
index b0a4102..af6b4ff 100644
--- a/src/views/repositoryai/verbaltrick/particulars/index.vue
+++ b/src/views/repositoryai/verbaltrick/particulars/index.vue
@@ -2,10 +2,22 @@
   <div class="Questionnairemanagement">
     <!-- 宸︿晶鏍� -->
     <div class="sidecolumn">
-      <div style="height: 300px">
-        <el-steps direction="vertical" :active="Editprogress">
-          <el-step title="闂搴撶紪杈�"></el-step>
-          <el-step title="闂鎸囨爣缂栬緫"></el-step>
+      <div>
+        <el-steps finish-status="success" :active="Editprogress" simple>
+          <el-step>
+            <template slot="title">
+              <span style="cursor: pointer" @click="Editprogress = 1"
+                >闂搴撶紪杈�</span
+              >
+            </template>
+          </el-step>
+          <el-step>
+            <template slot="title">
+              <span style="cursor: pointer" @click="nextstep"
+                >闂鎸囨爣缂栬緫</span
+              >
+            </template>
+          </el-step>
         </el-steps>
       </div>
     </div>
@@ -60,15 +72,22 @@
               <el-form-item label="闂鍒嗙被" prop="status">
                 <el-select
                   v-model="indexform.assortid"
-                  placeholder="璇烽�夋嫨鐘舵��"
+                  filterable
+                  placeholder="璇烽�夋嫨鍒嗙被"
                 >
-                  <el-option
-                    v-for="item in questionclass"
-                    :key="item.id"
-                    :label="item.indexAssortName"
-                    :value="item.id"
+                  <el-option-group
+                    v-for="group in questionclass"
+                    :key="group.id"
+                    :label="group.indexAssortName"
                   >
-                  </el-option>
+                    <el-option
+                      v-for="item in group.ivrLibaScriptAssortList"
+                      :key="item.id"
+                      :label="item.indexAssortName"
+                      :value="item.id"
+                    >
+                    </el-option>
+                  </el-option-group>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -436,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"
@@ -512,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">
@@ -557,9 +585,12 @@
   gettargetInfolist,
   gettargetInfo,
 } from "@/api/AiCentre/index";
+import Regular from "@/components/Regular"; //姝e垯缁勪欢
 import store from "@/store";
 
 export default {
+  name: "Verbalproblem",
+  components: { Regular },
   data() {
     return {
       Editprogress: 1, //缂栬緫杩涘害
@@ -573,7 +604,10 @@
       testvalue: "",
       testgovalue: "",
       topicobj: {},
-      indexform: {},
+      indexform: {
+        ivrLibaScriptTargetoptionList:[],
+        ivrLibaScriptTagList:[]
+      },
       mode: [],
       questionclass: [],
       currentInputId: "",
@@ -634,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;
@@ -663,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) {
@@ -678,6 +722,7 @@
         });
       } else {
         this.indexform.isoperation = 1;
+
         compileverbaltrick(this.indexform).then((res) => {
           if (res.code == 200) {
             this.$modal.msgSuccess("鏂板鎴愬姛");
@@ -712,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);
@@ -725,14 +771,13 @@
 
     // 涓嬩竴姝�
     nextstep() {
-      if (this.Editprogress <= 1 && this.indexform.targetid) {
-        if (this.indexform.ivrLibaScriptTargetoptionList.length) {
+      if (this.Editprogress <= 1) {
+        if (this.indexform.targetid) {
           return this.Editprogress++;
+        } else {
+          this.$message.warning("璇峰厛閫夋嫨鍏宠仈鎸囨爣");
         }
-
-        return this.Editprogress++;
       } else {
-        this.$message.warning("璇峰厛閫夋嫨鍏宠仈鎸囨爣");
       }
     },
     // 涓婁竴姝�
@@ -967,28 +1012,19 @@
 
 <style lang="scss" scoped>
 .Questionnairemanagement {
-  display: flex;
+  // display: flex;
 }
 .sidecolumn {
-  width: 300px;
-  min-height: 100vh;
-  text-align: center;
-  //   display: flex;
-  //   margin-top: 20px;
   margin: 20px;
   margin-bottom: 0;
-  padding: 30px;
+  padding: 20px;
   background: #edf1f7;
   border: 1px solid #dcdfe6;
   -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
     0 0 6px 0 rgba(0, 0, 0, 0.04);
 }
 .leftvlue {
-  //   display: flex;
-  //   flex: 1;
-  width: 80%;
-  margin-top: 20px;
-  //   margin: 20px;
+  margin: 20px;
   padding: 30px;
   background: #ffff;
   border: 1px solid #dcdfe6;

--
Gitblit v1.9.3