From 4dc66a6c347a4483e72892ed4195e597b9d43f8f Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期一, 29 四月 2024 15:02:28 +0800
Subject: [PATCH] 测试完成

---
 src/views/repositoryai/verbaltrick/particulars/index.vue |  348 ++++++++++++++++++++++++---------------------------------
 1 files changed, 146 insertions(+), 202 deletions(-)

diff --git a/src/views/repositoryai/verbaltrick/particulars/index.vue b/src/views/repositoryai/verbaltrick/particulars/index.vue
index af6b4ff..8e0978c 100644
--- a/src/views/repositoryai/verbaltrick/particulars/index.vue
+++ b/src/views/repositoryai/verbaltrick/particulars/index.vue
@@ -265,15 +265,15 @@
           >
           <el-row>
             <el-col :span="24">
-              <el-form-item label="闂鏂囨湰" prop="questiontext">
+              <el-form-item label="闂鏂囨湰" prop="questionText">
                 <el-input
+                :rows="2"
                   type="textarea"
-                  :rows="2"
+                  id="questionText"
+                  show-word-limit
                   placeholder="璇疯緭鍏ュ唴瀹�"
-                  id="questiontext"
-                  v-model.sync="indexform.questiontext"
-                  @focus="handleInput('questiontext')"
-                  maxlength="30"
+                  v-model.sync="indexform.questionText"
+                  @focus="handleInput('questionText')"
                 />
               </el-form-item> </el-col
           ></el-row>
@@ -290,21 +290,22 @@
                 >
                   <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
                 </el-upload>
-                <!-- <el-input v-model="indexform.userName" maxlength="30" /> -->
+                <!-- <el-input v-model="indexform.userName" maxlength="66"
+                  show-word-limit /> -->
               </el-form-item>
             </el-col></el-row
           >
           <el-row>
             <el-col :span="24">
-              <el-form-item label="鏃犲尮閰嶆枃鏈�" prop="nomatchtext">
+              <el-form-item label="鏃犲尮閰嶆枃鏈�" prop="noMatchText">
                 <el-input
                   type="textarea"
                   :rows="2"
-                  id="nomatchtext"
+                  id="noMatchText"
                   placeholder="璇疯緭鍏ュ唴瀹�"
-                  v-model.sync="indexform.nomatchtext"
-                  @focus="handleInput('nomatchtext')"
-                  maxlength="30"
+                  v-model.sync="indexform.noMatchText"
+                  @focus="handleInput('noMatchText')"
+                  show-word-limit
                 />
               </el-form-item> </el-col
           ></el-row>
@@ -326,15 +327,15 @@
           >
           <el-row>
             <el-col :span="24">
-              <el-form-item label="鏃犲0鏂囨湰" prop="sliencetext">
+              <el-form-item label="鏃犲0鏂囨湰" prop="slienceText">
                 <el-input
                   type="textarea"
                   :rows="2"
-                  id="sliencetext"
+                  id="slienceText"
                   placeholder="璇疯緭鍏ュ唴瀹�"
-                  v-model.sync="indexform.sliencetext"
-                  @focus="handleInput('sliencetext')"
-                  maxlength="30"
+                  v-model.sync="indexform.slienceText"
+                  @focus="handleInput('slienceText')"
+                  show-word-limit
                 />
               </el-form-item> </el-col
           ></el-row>
@@ -354,47 +355,18 @@
               </el-form-item>
             </el-col></el-row
           >
+
           <el-row>
             <el-col :span="24">
-              <el-form-item label="閫氱敤搴撴枃鏈�" prop="submoduletext">
+              <el-form-item label="鍚笉娓呮枃鏈�" prop="noClearlyText">
                 <el-input
                   type="textarea"
-                  :rows="2"
-                  id="submoduletext"
-                  placeholder="璇疯緭鍏ュ唴瀹�"
-                  v-model.sync="indexform.submoduletext"
-                  @focus="handleInput('submoduletext')"
-                  maxlength="30"
-                />
-              </el-form-item> </el-col
-          ></el-row>
-          <el-row>
-            <el-col :span="6">
-              <el-form-item label="閫氱敤搴撹闊�" prop="libraryy">
-                <el-upload
-                  class="upload-demo"
-                  action="https://jsonplaceholder.typicode.com/posts/"
-                  :on-change="handleChange"
-                  :file-list="fileList"
-                  :limit="1"
-                  :on-exceed="handleExceed"
-                >
-                  <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
-                </el-upload>
-              </el-form-item>
-            </el-col></el-row
-          >
-          <el-row>
-            <el-col :span="24">
-              <el-form-item label="鍚笉娓呮枃鏈�" prop="noclearlytext">
-                <el-input
-                  type="textarea"
-                  id="noclearlytext"
+                  id="noClearlyText"
                   :rows="2"
                   placeholder="璇疯緭鍏ュ唴瀹�"
-                  @focus="handleInput('noclearlytext')"
-                  v-model.sync="indexform.noclearlytext"
-                  maxlength="30"
+                  @focus="handleInput('noClearlyText')" 
+                  v-model.sync="indexform.noClearlyText"
+                  show-word-limit
                 />
               </el-form-item> </el-col
           ></el-row>
@@ -446,7 +418,7 @@
           <el-row>
             <el-col :span="24">
               <el-form-item label="鍊肩被鍨�">
-                <el-radio-group v-model="indexform.isenable">
+                <el-radio-group v-model="indexform.valueType">
                   <el-radio :label="1">閫夐」</el-radio>
                   <el-radio :label="2">鏂囨湰</el-radio>
                   <el-radio :label="3">鏁板��</el-radio>
@@ -454,117 +426,51 @@
               </el-form-item>
             </el-col></el-row
           >
-
-          <!-- <el-card class="box-card" style="margin-bottom: 20px">
-            <el-table
-              v-loading="loading"
-              :data="indexform.ivrLibaScriptTargetoptionList"
-            >
-              <el-table-column
-                label="搴忓彿"
-                align="center"
-                key="guid"
-                prop="guid"
-                width="50"
+          <div v-if="indexform.valueType == 1">
+            <el-card class="box-card" style="margin-bottom: 20px">
+              <Regular
+                :TargetoptionList="indexform.ivrLibaScriptTargetoptionList"
+                @addoption="addoption"
+                @deloption="deloption"
+                @syioption="syioption"
+                @xiayioption="xiayioption"
               />
-              <el-table-column
-                label="鎸囨爣閫夐」"
-                align="center"
-                key="targetvalue"
-                prop="targetvalue"
-                :show-overflow-tooltip="true"
-              >
-                <template slot-scope="scope">
+            </el-card>
+            <el-row :gutter="20">
+              <el-col :span="12">
+                <el-form-item label="娴嬭瘯杈撳叆" prop="targetvalue">
                   <el-input
-                    v-model="scope.row.targetvalue"
-                    placeholder="璇疯緭鍏ュ唴瀹�"
-                  ></el-input>
-                </template>
-              </el-table-column>
-              <el-table-column
-                label="瑙f瀽瑙勫垯"
-                align="center"
-                key="targetregex"
-                prop="targetregex"
-                width="460"
-                :show-overflow-tooltip="true"
+                    v-model="testvalue"
+                    placeholder="璇疯緭鍏ユ祴璇曞唴瀹�"
+                    maxlength="40"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="4">
+                <el-button type="success">寮�濮嬫祴璇�</el-button>
+              </el-col>
+            </el-row>
+            <div style="margin-bottom: 20px">
+              <el-input
+                type="textarea"
+                :rows="4"
+                placeholder="姝ゅ灞曠ず璇嗗埆缁撴灉"
+                v-model="testgovalue"
               >
-                <template slot-scope="scope">
-                  <el-input
-                    v-model="scope.row.targetregex"
-                    placeholder="璇疯緭鍏ュ唴瀹�"
-                  ></el-input>
-                </template>
-              </el-table-column>
-
-              <el-table-column
-                label="鎿嶄綔"
-                align="center"
-                width="200"
-                class-name="small-padding fixed-width"
-              >
-                <template slot-scope="scope">
-                  <el-button
-                    @click="addoption(scope.row)"
-                    type="success"
-                    icon="el-icon-circle-plus-outline"
-                    circle
-                  ></el-button>
-                  <el-button
-                    type="danger"
-                    icon="el-icon-delete"
-                    circle
-                    @click="deloption(scope.row)"
-                  ></el-button>
-                  <el-button
-                    @click="syioption(scope.row)"
-                    type="primary"
-                    icon="el-icon-top"
-                    circle
-                  ></el-button>
-                  <el-button
-                    @click="xiayioption(scope.row)"
-                    type="primary"
-                    icon="el-icon-bottom"
-                    circle
-                  ></el-button>
-                </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">
-              <el-form-item label="娴嬭瘯杈撳叆" prop="targetvalue">
-                <el-input
-                  v-model="testvalue"
-                  placeholder="璇疯緭鍏ユ祴璇曞唴瀹�"
-                  maxlength="40"
-                />
-              </el-form-item>
-            </el-col>
-            <el-col :span="4">
-              <el-button type="success">寮�濮嬫祴璇�</el-button>
-            </el-col>
-          </el-row>
+              </el-input>
+            </div>
+          </div>
+          <div style="margin-bottom: 20px" v-else>
+            <el-input
+              type="textarea"
+              :rows="4"
+              placeholder="姝ゅ灞曠ず鏀堕泦淇℃伅"
+              v-model="testgovalue"
+            >
+            </el-input>
+          </div>
         </el-form>
-        <div style="margin-bottom: 10px">
-          <el-input
-            type="textarea"
-            :rows="4"
-            placeholder="姝ゅ灞曠ず璇嗗埆缁撴灉"
-            v-model="testgovalue"
-          >
-          </el-input>
-        </div>
+
         <el-button type="primary" @click="laststep()">涓婁竴姝�</el-button>
         <el-button type="info" @click="closeFm()">鍏抽棴</el-button>
         <el-button @click="Saveproblem()">淇濆瓨鏁版嵁</el-button>
@@ -599,14 +505,15 @@
       radios: [], //澶氶�夐閫変腑
       radioas: "", //濉┖棰樼瓟妗�
       dynamicTags: [],
+      dellist: [],
       inputVisible: false,
       inputValue: "",
       testvalue: "",
       testgovalue: "",
       topicobj: {},
       indexform: {
-        ivrLibaScriptTargetoptionList:[],
-        ivrLibaScriptTagList:[]
+        ivrLibaScriptTargetoptionList: [],
+        ivrLibaScriptTagList: [],
       },
       mode: [],
       questionclass: [],
@@ -671,7 +578,8 @@
       if (id) {
         getverbaltrick({ id: id }).then((res) => {
           this.indexform = res.data;
-          this.indexform.suitway = this.indexform.suitway.split(",");
+          if (this.indexform.suitway)
+            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)
@@ -679,14 +587,18 @@
           this.dynamicTags = this.indexform.ivrLibaScriptTagList.map(
             this.processElement
           );
-          this.targetlist = [
-            {
-              id: this.indexform.targetid,
-              targetname: this.indexform.targetname,
-            },
-          ];
+
+          // this.targetlist = [
+          //   {
+          //     id: this.indexform.targetid,
+          //     targetname: this.indexform.targetname,
+          //   },
+          // ];
         });
       }
+      gettargetInfolist({ pageSize: 100, pageNum: 1 }).then((res) => {
+        this.targetlist = res.rows;
+      });
       // 鏍�
       getbaltrickclassify({}).then((res) => {
         this.questionclass = res.rows;
@@ -696,19 +608,24 @@
 
     // 淇濆瓨璇︾粏淇℃伅
     Saveproblem() {
-      console.log(this.variablelist);
       this.indexform.otherdata = JSON.stringify(this.variablelist);
-      this.indexform.suitway = this.indexform.suitway.join(",");
-      
+      if (this.indexform.suitway) {
+        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.ivrLibaScriptTargetoptionList.map((res) => {
+            if (res.isoperation != 1) {
+              res.isoperation = 2;
+            }
+            return res;
+          });
+
         this.indexform.isoperation = 2;
+        console.log(this.dellist);
+        this.indexform.ivrLibaScriptTargetoptionList =
+          this.indexform.ivrLibaScriptTargetoptionList.concat(this.dellist);
         compileverbaltrick(this.indexform).then((res) => {
           if (res.code == 200) {
             this.$modal.msgSuccess("淇敼鎴愬姛");
@@ -752,12 +669,18 @@
     targetchange(res) {
       console.log(res);
       gettargetInfo({ id: res }).then((res) => {
-        this.indexform.targetname = res.rows[0].targetname;
+        console.log(res.rows[0]);
         this.$modal
-          .confirm('鏄惁娣诲姞"' + this.indexform.targetname + '"鎸囨爣鐨勯�夐」锛�')
+          .confirm('鏄惁娣诲姞"' + res.rows[0].targetname + '"鎸囨爣鐨勯�夐」锛�')
           .then(() => {
+            this.indexform.valueType = res.rows[0].valueType;
+            this.indexform.questiontitle = res.rows[0].targetname;
+            this.indexform.targetname = res.rows[0].targetname;
+            this.indexform.questionText = res.rows[0].targetdesc;
+            this.indexform.isAvailable = "0";
+            this.indexform.language = "鏅�氳瘽";
             this.indexform.isenable = res.rows[0].isenable;
-            console.log(res.rows[0].targetoptionList);
+            this.$forceUpdate()
             res.rows[0].targetoptionList.forEach((item) => {
               item.isoperation = 1;
               this.indexform.ivrLibaScriptTargetoptionList.push(item);
@@ -772,11 +695,11 @@
     // 涓嬩竴姝�
     nextstep() {
       if (this.Editprogress <= 1) {
-        if (this.indexform.targetid) {
-          return this.Editprogress++;
-        } else {
-          this.$message.warning("璇峰厛閫夋嫨鍏宠仈鎸囨爣");
-        }
+        // if (this.indexform.targetid) {
+        return this.Editprogress++;
+        // } else {
+        //   this.$message.warning("璇峰厛閫夋嫨鍏宠仈鎸囨爣");
+        // }
       } else {
       }
     },
@@ -888,12 +811,23 @@
         isoperation: 1,
         targetvalue: "",
         targetregex: "",
+        targetregex2: "",
+        dynamiccruxs: [],
+        nodynamiccruxs: [],
+        dynamiccruxsJson: "",
+        nodynamiccruxsJson: "",
       });
       this.sortFn();
     },
     deloption(item) {
       const index = this.indexform.ivrLibaScriptTargetoptionList.indexOf(item);
       if (index !== -1) {
+        if (item.id) {
+          console.log(item, "chunz");
+          item.isoperation = 3;
+          this.dellist.push(item);
+        }
+        console.log(this.dellist, "dellist");
         this.indexform.ivrLibaScriptTargetoptionList.splice(index, 1); // 浠庣储寮曚綅缃垹闄や竴涓厓绱�
         this.sortFn();
       } else {
@@ -936,7 +870,17 @@
           return {
             guid: index + 1,
             targetvalue: item.targetvalue,
+            targetregex2: item.targetregex2,
             targetregex: item.targetregex,
+            id: item.id,
+            targettype: this.indexform.targettype,
+            isoperation: item.id ? 2 : 1,
+            categoryName: item.categoryName,
+            language: item.language,
+            dynamiccruxs: item.dynamiccruxs,
+            nodynamiccruxs: item.nodynamiccruxs,
+            dynamiccruxsJson: item.dynamiccruxsJson,
+            nodynamiccruxsJson: item.nodynamiccruxsJson,
           };
         });
       console.log(this.indexform.ivrLibaScriptTargetoptionList);
@@ -947,14 +891,14 @@
       let inputValueArr = "";
       let el = document.querySelector("#" + this.currentInputId);
       //el.selectionStart; 杩欏氨鏄綋鍓嶅厜鏍囨墍鍦ㄧ殑浣嶇疆锛堝瓧绗︿覆涓瓧绗︾殑index锛�
-      if (this.currentInputId == "questiontext") {
-        inputValueArr = this.indexform.questiontext.split("");
-      } else if (this.currentInputId == "nomatchtext") {
-        inputValueArr = this.indexform.nomatchtext.split("");
-      } else if (this.currentInputId == "sliencetext") {
-        inputValueArr = this.indexform.sliencetext.split("");
-      } else if (this.currentInputId == "noclearlytext") {
-        inputValueArr = this.indexform.noclearlytext.split("");
+      if (this.currentInputId == "questionText") {
+        inputValueArr = this.indexform.questionText.split("");
+      } else if (this.currentInputId == "noMatchText") {
+        inputValueArr = this.indexform.noMatchText.split("");
+      } else if (this.currentInputId == "slienceText") {
+        inputValueArr = this.indexform.slienceText.split("");
+      } else if (this.currentInputId == "noClearlyText") {
+        inputValueArr = this.indexform.noClearlyText.split("");
       } else if (this.currentInputId == "submoduletext") {
         inputValueArr = this.indexform.submoduletext.split("");
       } else {
@@ -969,14 +913,14 @@
       // 鎶婃暟缁勯噸鏂拌浆鎹负瀛楃涓插苟璧嬪��
       inputValueArr = inputValueArr.join("");
       console.log(inputValueArr);
-      if (this.currentInputId == "questiontext") {
-        this.indexform.questiontext = inputValueArr;
-      } else if (this.currentInputId == "nomatchtext") {
-        this.indexform.nomatchtext = inputValueArr;
-      } else if (this.currentInputId == "sliencetext") {
-        this.indexform.sliencetext = inputValueArr;
-      } else if (this.currentInputId == "noclearlytext") {
-        this.indexform.noclearlytext = inputValueArr;
+      if (this.currentInputId == "questionText") {
+        this.indexform.questionText = inputValueArr;
+      } else if (this.currentInputId == "noMatchText") {
+        this.indexform.noMatchText = inputValueArr;
+      } else if (this.currentInputId == "slienceText") {
+        this.indexform.slienceText = inputValueArr;
+      } else if (this.currentInputId == "noClearlyText") {
+        this.indexform.noClearlyText = inputValueArr;
       } else if (this.currentInputId == "submoduletext") {
         this.indexform.submoduletext = inputValueArr;
       } else {

--
Gitblit v1.9.3