From ad70f145e8bea957b41043b4a1e37ce37cc5ed1e Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期二, 16 一月 2024 18:39:24 +0800
Subject: [PATCH] 指标完成

---
 src/views/repositoryai/verbaltrick/particulars/index.vue |  945 +++++++++++++++++++++++++++++++---------------------------
 1 files changed, 510 insertions(+), 435 deletions(-)

diff --git a/src/views/repositoryai/verbaltrick/particulars/index.vue b/src/views/repositoryai/verbaltrick/particulars/index.vue
index eaff738..8b3271e 100644
--- a/src/views/repositoryai/verbaltrick/particulars/index.vue
+++ b/src/views/repositoryai/verbaltrick/particulars/index.vue
@@ -39,9 +39,12 @@
             </el-col>
             <el-col :span="12">
               <el-form-item label="鍙敤鐘舵��" prop="status">
-                <el-select v-model="indexform.status" placeholder="璇烽�夋嫨鐘舵��">
+                <el-select
+                  v-model="indexform.isAvailable"
+                  placeholder="璇烽�夋嫨鐘舵��"
+                >
                   <el-option
-                    v-for="item in qyoptions"
+                    v-for="item in usable"
                     :key="item.value"
                     :label="item.label"
                     :value="item.value"
@@ -51,23 +54,185 @@
               </el-form-item>
             </el-col>
           </el-row>
+
           <el-row :gutter="20">
             <el-col :span="12">
-              <el-form-item label="闂涓绘棬" prop="nickName">
+              <el-form-item label="闂鍒嗙被" prop="status">
+                <el-select
+                  v-model="indexform.assortid"
+                  filterable
+                  placeholder="璇烽�夋嫨鍒嗙被"
+                >
+                <el-option-group
+                  v-for="group in questionclass"
+                  :key="group.id"
+                  :label="group.indexAssortName"
+                >
+                  <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>
+
+            <el-col :span="5">
+              <el-form-item label="鐗堟湰鍙�" prop="version">
                 <el-input
-                  v-model="indexform.nickName"
+                  v-model="indexform.version"
+                  placeholder="璇疯緭鍏�"
+                  maxlength="80"
+                />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="20">
+              <el-form-item label="闂涓绘棬" prop="questiontitle">
+                <el-input
+                  v-model="indexform.questiontitle"
                   placeholder="璇疯緭鍏ラ棶棰樹富鏃�"
                   maxlength="80"
                 />
               </el-form-item>
             </el-col>
-            <el-col :span="5">
-              <el-form-item label="鐗堟湰鍙�" prop="nickName">
-                <el-input
-                  v-model="indexform.nickName"
-                  placeholder="璇疯緭鍏�"
-                  maxlength="80"
-                />
+          </el-row>
+          <el-form-item label="鏍囩" prop="desc">
+            <div class="xinz-inf">
+              <el-tag
+                :key="tag.tagname"
+                type="success"
+                v-for="tag in dynamicTags"
+                closable
+                :disable-transitions="false"
+                @close="handleClosetag(tag)"
+              >
+                {{ tag.tagname }}
+              </el-tag>
+              <el-select
+                v-model="inputValue"
+                v-if="inputVisible"
+                @change="handleInputConfirm"
+                filterable
+                remote
+                reserve-keyword
+                default-first-option
+                :remote-method="remoteMethodtag"
+                :loading="loading"
+                placeholder="璇烽�夋嫨"
+              >
+                <el-option
+                  v-for="item in optionstag"
+                  :key="item.tagid"
+                  :label="item.tagname"
+                  :value="item.tagname"
+                >
+                </el-option>
+              </el-select>
+              <el-button
+                v-else
+                class="button-new-tag"
+                size="small"
+                @click="showInput"
+                >+ 鏂板鏍囩</el-button
+              >
+            </div>
+          </el-form-item>
+          <el-form-item label="閫氱煡鍙橀噺" prop="name">
+            <div style="margin-bottom: 5px" v-for="item in variablelist">
+              <el-row>
+                <el-col :span="5">
+                  <el-input
+                    v-model="item.variatename"
+                    placeholder="璇疯緭鍏ュ彉閲忓悕"
+                  ></el-input>
+                </el-col>
+                <el-col :span="8" :offset="1">
+                  <el-input
+                    v-model="item.variate"
+                    placeholder="璇疯緭鍏ュ彉閲忓唴瀹�"
+                  ></el-input>
+                </el-col>
+                <el-col :span="8" :offset="1">
+                  <el-button
+                    type="success"
+                    icon="el-icon-plus"
+                    circle
+                    @click="addvariable(item)"
+                  ></el-button>
+                  <el-button
+                    v-if="!item.default"
+                    type="danger"
+                    icon="el-icon-delete"
+                    circle
+                    @click="delvariable(item)"
+                  ></el-button>
+                </el-col>
+              </el-row>
+            </div>
+          </el-form-item>
+
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="浠呴檺闄㈠尯" prop="region">
+                <el-select
+                  v-model="indexform.campus"
+                  size="medium"
+                  filterable
+                  placeholder="璇烽�夋嫨"
+                >
+                  <el-option
+                    class="indexformaa"
+                    v-for="item in courtyardlist"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="閫傜敤鏂瑰紡" prop="status">
+                <el-select
+                  v-model="indexform.suitway"
+                  multiple
+                  placeholder="璇烽�夋嫨"
+                >
+                  <el-option
+                    v-for="item in mode"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="鍏宠仈鎸囨爣" prop="region">
+                <el-select
+                  v-model="indexform.targetid"
+                  filterable
+                  remote
+                  reserve-keyword
+                  placeholder="璇疯緭鍏ュ叧閿瘝"
+                  :remote-method="remoteMethod"
+                  @change="targetchange"
+                  :loading="loading"
+                >
+                  <el-option
+                    v-for="item in targetlist"
+                    :key="item.id"
+                    :label="item.targetname"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
               </el-form-item>
             </el-col>
           </el-row>
@@ -76,25 +241,26 @@
               <div
                 style="display: flex; margin-left: 100px; margin-bottom: 10px"
               >
-                <div class="tsgname" @click="tsgnameto()">鍖婚櫌鍚嶇О</div>
-                <div class="tsgname" @click="tsgnameto()">鍖婚櫌鐢佃瘽</div>
-                <div class="tsgname" @click="tsgnameto()">鍖婚櫌濮撳悕</div>
-                <div class="tsgname" @click="tsgnameto()">闅忚濮撳悕</div>
-                <div class="tsgname" @click="tsgnameto()">闅忚鐢佃瘽</div>
-                <div class="tsgname" @click="tsgnameto()">鎬у埆</div>
-                <div class="tsgname" @click="tsgnameto()">骞撮緞</div>
-                <div class="tsgname" @click="tsgnameto()">鍦板潃</div>
+                <div
+                  v-for="item in variablelist"
+                  class="tsgname"
+                  @click="tsgnameto(item)"
+                >
+                  {{ item.variatename }}
+                </div>
               </div>
             </el-col></el-row
           >
           <el-row>
             <el-col :span="24">
-              <el-form-item label="闂鏂囨湰" prop="verbaltricktext">
+              <el-form-item label="闂鏂囨湰" prop="questiontext">
                 <el-input
                   type="textarea"
                   :rows="2"
                   placeholder="璇疯緭鍏ュ唴瀹�"
-                  v-model="indexform.userName"
+                  id="questiontext"
+                  v-model.sync="indexform.questiontext"
+                  @focus="handleInput('questiontext')"
                   maxlength="30"
                 />
               </el-form-item> </el-col
@@ -118,12 +284,14 @@
           >
           <el-row>
             <el-col :span="24">
-              <el-form-item label="鏃犲尮閰嶆枃鏈�" prop="matchtext">
+              <el-form-item label="鏃犲尮閰嶆枃鏈�" prop="nomatchtext">
                 <el-input
                   type="textarea"
                   :rows="2"
+                  id="nomatchtext"
                   placeholder="璇疯緭鍏ュ唴瀹�"
-                  v-model="indexform.userName"
+                  v-model.sync="indexform.nomatchtext"
+                  @focus="handleInput('nomatchtext')"
                   maxlength="30"
                 />
               </el-form-item> </el-col
@@ -146,12 +314,14 @@
           >
           <el-row>
             <el-col :span="24">
-              <el-form-item label="鏃犲0鏂囨湰" prop="silenttext">
+              <el-form-item label="鏃犲0鏂囨湰" prop="sliencetext">
                 <el-input
                   type="textarea"
                   :rows="2"
+                  id="sliencetext"
                   placeholder="璇疯緭鍏ュ唴瀹�"
-                  v-model="indexform.userName"
+                  v-model.sync="indexform.sliencetext"
+                  @focus="handleInput('sliencetext')"
                   maxlength="30"
                 />
               </el-form-item> </el-col
@@ -174,12 +344,14 @@
           >
           <el-row>
             <el-col :span="24">
-              <el-form-item label="閫氱敤搴撴枃鏈�" prop="librarytext">
+              <el-form-item label="閫氱敤搴撴枃鏈�" prop="submoduletext">
                 <el-input
                   type="textarea"
                   :rows="2"
+                  id="submoduletext"
                   placeholder="璇疯緭鍏ュ唴瀹�"
-                  v-model="indexform.userName"
+                  v-model.sync="indexform.submoduletext"
+                  @focus="handleInput('submoduletext')"
                   maxlength="30"
                 />
               </el-form-item> </el-col
@@ -202,12 +374,14 @@
           >
           <el-row>
             <el-col :span="24">
-              <el-form-item label="鍚笉娓呮枃鏈�" prop="vaguetext">
+              <el-form-item label="鍚笉娓呮枃鏈�" prop="noclearlytext">
                 <el-input
                   type="textarea"
+                  id="noclearlytext"
                   :rows="2"
                   placeholder="璇疯緭鍏ュ唴瀹�"
-                  v-model="indexform.userName"
+                  @focus="handleInput('noclearlytext')"
+                  v-model.sync="indexform.noclearlytext"
                   maxlength="30"
                 />
               </el-form-item> </el-col
@@ -228,86 +402,11 @@
               </el-form-item>
             </el-col></el-row
           >
-          <el-form-item label="閫氱煡鍙橀噺" prop="name">
-            <el-row v-for="item in variablelist">
-              <el-col :span="4">
-                <el-input v-model="item.variable"></el-input>
-              </el-col>
-              <el-col :span="8" :offset="1">
-                <el-input v-model="item.value"></el-input>
-              </el-col>
-              <el-col :span="4" :offset="1">
-                <el-button
-                  type="success"
-                  icon="el-icon-plus"
-                  circle
-                  @click="addvariable(item)"
-                ></el-button>
-                <el-button
-                  type="danger"
-                  icon="el-icon-delete"
-                  circle
-                  @click="delvariable(item)"
-                ></el-button>
-              </el-col>
-            </el-row>
-          </el-form-item>
-
-          <el-row>
-            <el-col :span="24">
-              <el-form-item label="鎸囨爣璇存槑">
-                <el-input
-                  v-model="indexform.remark"
-                  type="textarea"
-                  placeholder="璇疯緭鍏ュ唴瀹�"
-                ></el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="12">
-              <el-form-item label="浠呴檺闄㈠尯" prop="region">
-                <el-select
-                  v-model="indexform.courtyard"
-                  size="medium"
-                  filterable
-                  placeholder="璇烽�夋嫨"
-                >
-                  <el-option
-                    class="indexformaa"
-                    v-for="item in options"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="鍏宠仈鎸囨爣" prop="region">
-                <el-select
-                  v-model="indexform.relevance"
-                  size="medium"
-                  filterable
-                  placeholder="璇烽�夋嫨鍒嗙被"
-                >
-                  <el-option
-                    class="indexformaa"
-                    v-for="item in options"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
         </el-form>
         <div slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="nextstep">纭� 瀹�</el-button>
+          <el-button type="primary" @click="nextstep">涓嬩竴姝�</el-button>
           <el-button @click="closeFm">鍏� 闂�</el-button>
+          <el-button @click="Saveproblem()">淇濆瓨鏁版嵁</el-button>
         </div>
       </div>
       <!-- 鎸囨爣璁剧疆 -->
@@ -324,156 +423,48 @@
             <el-col :span="12">
               <el-form-item label="鎸囨爣鍚嶇О" prop="deptId">
                 <el-input
-                  v-model="indexform.name"
-                  placeholder="璇疯緭鍏ユ寚鏍囩绫�"
-                  maxlength="40"
-                />
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="鐗堟湰鍙�" prop="deptId">
-                <el-input
-                  v-model="indexform.versions"
-                  placeholder="璇疯緭鍏ユ寚鏍囩绫�"
+                  v-model="indexform.targetname"
+                  placeholder="璇疯緭鍏ユ寚鏍囧悕绉�"
                   maxlength="40"
                 />
               </el-form-item>
             </el-col>
           </el-row>
-          <el-row>
-            <el-col :span="12">
-              <el-form-item label="璇█" prop="deptId">
-                <el-select
-                  v-model="indexform.language"
-                  placeholder="璇烽�夋嫨璇█"
-                >
-                  <el-option
-                    v-for="index in languagelist"
-                    :key="index.value"
-                    :label="index.label"
-                    :value="index.value"
-                  ></el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="鏄惁鍙敤" prop="deptId">
-                <el-select v-model="indexform.useofstate" placeholder="璇烽�夋嫨">
-                  <el-option
-                    v-for="index in qyoptions"
-                    :key="index.value"
-                    :label="index.label"
-                    :value="index.value"
-                  ></el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="24">
-              <el-form-item label="鎸囨爣鎻忚堪" prop="nickName">
-                <el-input
-                  v-model="indexform.nickName"
-                  placeholder="璇疯緭鍏ユ寚鏍囨弿杩�"
-                  maxlength="40"
-                />
-              </el-form-item> </el-col
-          ></el-row>
-          <el-form-item label="鏍囩" prop="desc">
-            <div class="xinz-inf">
-              <el-tag
-                :key="tag"
-                type="success"
-                v-for="tag in dynamicTags"
-                closable
-                :disable-transitions="false"
-                @close="handleClose(tag)"
-              >
-                {{ tag }}
-              </el-tag>
-              <el-select
-                v-model="inputValue"
-                v-if="inputVisible"
-                @change="handleInputConfirm"
-                filterable
-                allow-create
-                default-first-option
-                placeholder="璇烽�夋嫨"
-              >
-                <el-option
-                  v-for="item in optionstag"
-                  :key="item.tagname"
-                  :label="item.tagname"
-                  :value="item.tagname"
-                >
-                </el-option>
-              </el-select>
-              <el-button
-                v-else
-                class="button-new-tag"
-                size="small"
-                @click="showInput"
-                >+ 鏂板鏍囩</el-button
-              >
-            </div>
-          </el-form-item>
-          <el-row>
-            <el-col :span="24">
-              <el-form-item label="鍊肩被鍨�">
-                <el-radio-group v-model="indexform.resource">
-                  <el-radio label="閫夐」"></el-radio>
-                  <el-radio label="鏂囨湰"></el-radio>
-                  <el-radio label="鏁板��"></el-radio>
-                </el-radio-group>
-              </el-form-item> </el-col
-          ></el-row>
-          <el-row>
-            <el-col :span="24">
-              <el-form-item label="閫傜敤鐤剧梾" prop="userName">
-                <el-select v-model="indexform.useofstate" placeholder="璇烽�夋嫨">
-                  <el-option
-                    v-for="index in qyoptions"
-                    :key="index.value"
-                    :label="index.label"
-                    :value="index.value"
-                  ></el-option>
-                </el-select>
-              </el-form-item> </el-col
-          ></el-row>
 
           <el-row>
             <el-col :span="24">
-              <el-form-item label="閫傜敤鏂瑰紡" prop="email">
-                <el-select v-model="indexform.useofstate" placeholder="璇烽�夋嫨">
-                  <el-option
-                    v-for="index in qyoptions"
-                    :key="index.value"
-                    :label="index.label"
-                    :value="index.value"
-                  ></el-option>
-                </el-select>
+              <el-form-item label="鍊肩被鍨�">
+                <el-radio-group v-model="indexform.isenable">
+                  <el-radio :label="1">閫夐」</el-radio>
+                  <el-radio :label="2">鏂囨湰</el-radio>
+                  <el-radio :label="3">鏁板��</el-radio>
+                </el-radio-group>
               </el-form-item>
-            </el-col>
-          </el-row>
+            </el-col></el-row
+          >
+
           <el-card class="box-card" style="margin-bottom: 20px">
-            <el-table v-loading="loading" :data="testuserList">
+            <el-table
+              v-loading="loading"
+              :data="indexform.ivrLibaScriptTargetoptionList"
+            >
               <el-table-column
                 label="搴忓彿"
                 align="center"
-                key="userid"
-                prop="userid"
+                key="guid"
+                prop="guid"
                 width="50"
               />
               <el-table-column
                 label="鎸囨爣閫夐」"
                 align="center"
-                key="nickName"
-                prop="nickName"
+                key="targetvalue"
+                prop="targetvalue"
                 :show-overflow-tooltip="true"
               >
                 <template slot-scope="scope">
                   <el-input
-                    v-model="scope.row.nickName"
+                    v-model="scope.row.targetvalue"
                     placeholder="璇疯緭鍏ュ唴瀹�"
                   ></el-input>
                 </template>
@@ -481,14 +472,14 @@
               <el-table-column
                 label="瑙f瀽瑙勫垯"
                 align="center"
-                key="aphonenumber"
-                prop="aphonenumber"
+                key="targetregex"
+                prop="targetregex"
                 width="460"
                 :show-overflow-tooltip="true"
               >
                 <template slot-scope="scope">
                   <el-input
-                    v-model="scope.row.aphonenumber"
+                    v-model="scope.row.targetregex"
                     placeholder="璇疯緭鍏ュ唴瀹�"
                   ></el-input>
                 </template>
@@ -531,7 +522,7 @@
           </el-card>
           <el-row :gutter="20">
             <el-col :span="12">
-              <el-form-item label="娴嬭瘯杈撳叆" prop="nickName">
+              <el-form-item label="娴嬭瘯杈撳叆" prop="targetvalue">
                 <el-input
                   v-model="testvalue"
                   placeholder="璇疯緭鍏ユ祴璇曞唴瀹�"
@@ -554,8 +545,8 @@
           </el-input>
         </div>
         <el-button type="primary" @click="laststep()">涓婁竴姝�</el-button>
-        <el-button type="info" @click="closeFm('ruleForm')">鍏抽棴</el-button>
-        <el-button @click="Saveproblem('ruleForm')">淇濆瓨鎸囨爣鏁版嵁</el-button>
+        <el-button type="info" @click="closeFm()">鍏抽棴</el-button>
+        <el-button @click="Saveproblem()">淇濆瓨鏁版嵁</el-button>
       </div>
     </div>
   </div>
@@ -563,6 +554,17 @@
 
 <script>
 import { listtag } from "@/api/system/label";
+import {
+  getverbaltricklist,
+  verbaltrickinfo,
+  delverbaltrickinfo,
+  compileverbaltrick,
+  getverbaltrick,
+  getbaltrickclassify,
+  gettargetInfolist,
+  gettargetInfo,
+} from "@/api/AiCentre/index";
+import store from "@/store";
 
 export default {
   data() {
@@ -572,142 +574,46 @@
       radio: "false", //鍗曢�夐閫変腑
       radios: [], //澶氶�夐閫変腑
       radioas: "", //濉┖棰樼瓟妗�
-      dynamicTags: ["鏍囩涓�", "鏍囩浜�", "鏍囩涓�"],
+      dynamicTags: [],
       inputVisible: false,
       inputValue: "",
       testvalue: "",
       testgovalue: "",
       topicobj: {},
       indexform: {},
+      mode: [],
+      questionclass: [],
+      currentInputId: "",
+      courtyardlist: [],
       // 鎬绘潯鏁�
       total: 1,
-      ruleForm: {
-        name: "",
-        region: "",
-        date1: "",
-        date2: "",
-        delivery: false,
-        type: [],
-        resource: "",
-        desc: "",
-        templatevalue: "",
-        data2: "",
-      },
-      rules: {},
-      rulesa: {},
-      optionstag: [],
-      xjxsoptions: [
+
+      targetlist: [
         {
           value: "閫夐」1",
           label: "鍥炬枃",
         },
-        {
-          value: "閫夐」2",
-          label: "瑙嗛",
-        },
-        {
-          value: "閫夐」3",
-          label: "闊抽",
-        },
       ],
+      rules: {},
+      rulesa: {},
+      optionstag: [],
+
       fileList: [
         {
           name: "food.jpeg",
           url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
         },
       ],
-      qyoptions: [
-        {
-          value: 1,
-          label: "鍙敤",
-        },
-        {
-          value: 2,
-          label: "绂佺敤",
-        },
-      ],
-      options: [
-        {
-          value: "閫夐」1",
-          label: "鐤剧梾鎸囨爣",
-        },
-        {
-          value: "閫夐」2",
-          label: "鍏ラ櫌鎸囨爣",
-        },
-        {
-          value: "閫夐」3",
-          label: "鎵嬫湳鎸囨爣",
-        },
-        {
-          value: "閫夐」4",
-          label: "鎶ょ悊鎸囨爣",
-        },
-      ],
+      usable: [],
+      options: [],
       variablelist: [
-        {
-          variable: "paitent",
-          value: "琛ㄧず鎮h�呯殑鏍囪瘑",
-        },
-      ],
-      testuserList: [
-        {
-          userid: 1,
-          nickName: "璐",
-          aphonenumber: "(?!涓�.*|娌�.*|鏈�.*)^.*([璐钩鍑]|璐|璇勫|璇勫),10",
-        },
-        {
-          userid: 2,
-          nickName: "姝e父",
-          aphonenumber: "(?!涓�.*|娌�.*|鏈�.*)^.*([璐钩鍑]|璐|璇勫|璇勫),10",
-        },
-        {
-          userid: 55,
-          nickName: "闈炴甯�",
-          aphonenumber: "(?!涓�.*|娌�.*|鏈�.*)^.*([璐钩鍑]|璐|璇勫|璇勫),10",
-        },
-        {
-          userid: 4,
-          nickName: "a姝e父",
-          aphonenumber: "(?!涓�.*|娌�.*|鏈�.*)^.*([璐钩鍑]|璐|璇勫|璇勫),10",
-          status: "0",
-        },
+        { variatename: "濮撳悕", variate: "${name}", default: 1 },
+        { variatename: "鐢佃瘽", variate: "${phone}", default: 1 },
+        { variatename: "鐥呮儏", variate: "${illness}", default: 1 },
       ],
 
       addvalue: "娣诲姞棰樼洰",
-      // 棰樼洰琛ㄦ牸鏁版嵁
-      userList: [
-        {
-          userid: "1",
-          userName: "涓�鍙锋寚鏍�",
-        },
-        {
-          userid: "2",
-          userName: "浜屽彿鎸囨爣",
-        },
-        {
-          userid: "3",
-          userName: "涓夊彿鎸囨爣",
-        },
-        {
-          userid: "4",
-          userName: "鍥涘彿鎸囨爣",
-        },
-      ],
-      languagelist: [
-        {
-          value: 1,
-          label: "鏅�氳瘽",
-        },
-        {
-          value: 2,
-          label: "绮よ",
-        },
-        {
-          value: 3,
-          label: "鑻辫",
-        },
-      ], //璇█鍒楄〃
+      languagelist: [], //璇█鍒楄〃
       // 鏌ヨ鍙傛暟
       queryParams: {
         pageNum: 1,
@@ -723,24 +629,114 @@
 
   created() {
     this.gettabList();
+    this.getverbaltrick();
+    this.mode = store.getters.mode;
+    this.valuetype = store.getters.valuetype;
+    this.languagelist = store.getters.languagelist;
+    this.usable = store.getters.usable;
+    this.courtyardlist = store.getters.courtyardlist;
   },
 
   methods: {
-    submitForm(formName) {
-      this.rules = this.rulesa;
-      //   鎻愪氦
-      this.$refs[formName].validate((valid) => {
-        if (valid) {
-          alert("submit!");
-        } else {
-          console.log("error submit!!");
-          return false;
-        }
+    // 鑾峰彇璇︽儏鏁版嵁
+    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,
+          },
+        ];
+      });
+      // 鏍�
+      getbaltrickclassify({}).then((res) => {
+        this.questionclass = res.rows;
+        console.log(res);
       });
     },
+
+    // 淇濆瓨璇︾粏淇℃伅
+    Saveproblem() {
+      console.log(this.variablelist);
+      this.indexform.otherdata = JSON.stringify(this.variablelist);
+      this.indexform.suitway = this.indexform.suitway.join(",");
+      if (this.indexform.id) {
+        this.indexform.isoperation = 2;
+        compileverbaltrick(this.indexform).then((res) => {
+          if (res.code == 200) {
+            this.$modal.msgSuccess("淇敼鎴愬姛");
+            this.$router.go(-1);
+          } else {
+            this.$message({
+              message: "淇敼澶辫触",
+              type: "error",
+            });
+          }
+        });
+      } else {
+        this.indexform.isoperation = 1;
+        compileverbaltrick(this.indexform).then((res) => {
+          if (res.code == 200) {
+            this.$modal.msgSuccess("鏂板鎴愬姛");
+            this.$router.go(-1);
+          } else {
+            this.$message({
+              message: "鏂板澶辫触",
+              type: "error",
+            });
+          }
+        });
+      }
+    },
+    remoteMethod(query) {
+      if (query !== "") {
+        this.loading = true;
+        setTimeout(() => {
+          this.loading = false;
+          gettargetInfolist({ targetname: query }).then((res) => {
+            this.targetlist = res.rows;
+          });
+        }, 200);
+      } else {
+        this.targetlist = [];
+      }
+    },
+    targetchange(res) {
+      console.log(res);
+      gettargetInfo({ id: res }).then((res) => {
+        this.indexform.targetname = res.rows[0].targetname;
+        this.$modal
+          .confirm('鏄惁娣诲姞"' + this.indexform.targetname + '"鎸囨爣鐨勯�夐」锛�')
+          .then(() => {
+            this.indexform.isenable = res.rows[0].isenable;
+            res.rows[0].targetoptionList.forEach((item) => {
+              item.isoperation = 1;
+              this.indexform.ivrLibaScriptTargetoptionList.push(item);
+            });
+          })
+          .catch(() => {
+            this.$modal.msgSuccess("宸插彇娑�");
+          });
+      });
+    },
+
     // 涓嬩竴姝�
     nextstep() {
-      if (this.Editprogress <= 1 && this.indexform.relevance) {
+      if (this.Editprogress <= 1 && this.indexform.targetid) {
+        if (this.indexform.ivrLibaScriptTargetoptionList.length) {
+          return this.Editprogress++;
+        }
+
         return this.Editprogress++;
       } else {
         this.$message.warning("璇峰厛閫夋嫨鍏宠仈鎸囨爣");
@@ -767,40 +763,7 @@
           });
         });
     },
-    // 淇濆瓨棰樼洰淇℃伅
-    Saveproblem() {},
-    /** 鏌ヨ棰樼洰鍒楄〃 */
-    getList() {
-      //   this.loading = true;
-      listUser().then((response) => {
-        console.log(response);
-        // this.userList = response.data;
-        // this.total = response.total;
-        // this.loading = false;
-        console.log(this.userList);
-      });
-      //   const { rows } = await listUser();
-      //   console.log(rows);
-      //   this.list = rows;
-    },
-    // 淇敼棰樼洰淇℃伅
-    Submittopicobj() {},
-    // 鏂板鍙橀噺
-    addvariable() {
-      this.variablelist.push({
-        variable: "",
-        value: "",
-      });
-    },
-    // 鍒犻櫎鍙橀噺
-    delvariable(item) {
-      const index = this.variablelist.indexOf(item);
-      if (index !== -1) {
-        this.variablelist.splice(index, 1); // 浠庣储寮曚綅缃垹闄や竴涓厓绱�
-      } else {
-        console.log("鏈壘鍒拌瀵硅薄");
-      }
-    },
+    // 鏂囦欢----------------------
     // 鎺у埗鏂囦欢
     handleChange(file, fileList) {
       this.fileList = fileList.slice(-3);
@@ -825,74 +788,186 @@
         this.optionstag = response.rows;
       });
     },
-    handleClose(tag) {
+    handleClosetag(tag) {
+      console.log(tag);
+      console.log(this.dynamicTags.indexOf(tag));
+      const lindex = this.dynamicTags.indexOf(tag);
       this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
+      this.indexform.ivrLibaScriptTagList[lindex].isoperation = 3;
     },
     handleInputConfirm() {
-      let inputValue = this.inputValue;
-      if (inputValue) {
-        this.dynamicTags.push(inputValue);
+      let tagvalue = {};
+      let tagname = this.inputValue;
+      if (tagname) {
+        listtag({
+          pageNum: 1,
+          pageSize: 1000,
+          tagcategoryid: "0",
+          tagname: tagname,
+        }).then((res) => {
+          if (res.rows[0]) {
+            tagvalue = res.rows[0];
+            tagvalue.isoperation = 1;
+          } else {
+            tagvalue = {
+              tagname: tagname,
+              isoperation: 1,
+            };
+          }
+          this.indexform.ivrLibaScriptTagList.push(tagvalue);
+          this.dynamicTags.push(tagvalue);
+        });
       }
       this.inputVisible = false;
       this.inputValue = "";
     },
+    remoteMethodtag(query) {
+      if (query !== "") {
+        this.loading = true;
+        setTimeout(() => {
+          this.loading = false;
+          listtag({ tagname: query, tagcategoryid: "0" }).then((res) => {
+            this.optionstag = res.rows;
+          });
+        }, 200);
+      } else {
+        this.optionstag = [];
+      }
+    },
     showInput() {
       this.inputVisible = true;
-      // 鑷姩鑾峰彇鐒︾偣
-      // this.$nextTick((_) => {
-      //   this.$refs.saveTagInput.$refs.input.focus();
-      // });
     },
-    // --------------------------
     //娴嬭瘯琛ㄥ崟 --------------------------
+    gettagerlist() {
+      gettagerlist({ targetname: this.targetname }).then((response) => {
+        console.log(response);
+        this.optionstag = response.rows;
+      });
+    },
     addoption() {
-      this.testuserList.push({
-        userid: 1,
-        nickName: "璐",
-        aphonenumber: "(?!涓�.*|娌�.*|鏈�.*)^.*([璐钩鍑]|璐|璇勫|璇勫),10",
+      this.indexform.ivrLibaScriptTargetoptionList.push({
+        guid: 1,
+        isoperation: 1,
+        targetvalue: "",
+        targetregex: "",
       });
       this.sortFn();
     },
-    deloption() {
-      const index = this.testuserList.indexOf(item);
+    deloption(item) {
+      const index = this.indexform.ivrLibaScriptTargetoptionList.indexOf(item);
       if (index !== -1) {
-        this.testuserList.splice(index, 1); // 浠庣储寮曚綅缃垹闄や竴涓厓绱�
+        this.indexform.ivrLibaScriptTargetoptionList.splice(index, 1); // 浠庣储寮曚綅缃垹闄や竴涓厓绱�
         this.sortFn();
       } else {
         console.log("鏈壘鍒拌瀵硅薄");
       }
     },
+    getIndexInArray(arr, obj) {
+      return arr.indexOf(obj);
+    },
+    processElement(element) {
+      return { ...element, isoperation: 1 };
+    },
     syioption(row) {
-      const index = this.getIndexInArray(this.testuserList, row);
-      const item = this.testuserList.splice(index, 1)[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓�
-      this.testuserList.splice(index - 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣�
+      const index = this.getIndexInArray(
+        this.indexform.ivrLibaScriptTargetoptionList,
+        row
+      );
+      const item = this.indexform.ivrLibaScriptTargetoptionList.splice(
+        index,
+        1
+      )[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓�
+      this.indexform.ivrLibaScriptTargetoptionList.splice(index - 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣�
       this.sortFn();
     },
     xiayioption(row) {
-      const index = this.getIndexInArray(this.testuserList, row);
-      const item = this.testuserList.splice(index, 1)[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓�
-      this.testuserList.splice(index + 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣�
+      const index = this.getIndexInArray(
+        this.indexform.ivrLibaScriptTargetoptionList,
+        row
+      );
+      const item = this.indexform.ivrLibaScriptTargetoptionList.splice(
+        index,
+        1
+      )[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓�
+      this.indexform.ivrLibaScriptTargetoptionList.splice(index + 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣�
       this.sortFn();
     },
     sortFn() {
-      this.testuserList = this.testuserList.map((item, index) => {
-        return {
-          userid: index + 1,
-          nickName: item.nickName,
-          aphonenumber: item.aphonenumber,
-        };
-      });
-      console.log(this.testuserList);
+      this.indexform.ivrLibaScriptTargetoptionList =
+        this.indexform.ivrLibaScriptTargetoptionList.map((item, index) => {
+          return {
+            guid: index + 1,
+            targetvalue: item.targetvalue,
+            targetregex: item.targetregex,
+          };
+        });
+      console.log(this.indexform.ivrLibaScriptTargetoptionList);
     },
     // ---------------------
-    // 鏌ヨ棰樺簱
-    handleQuery() {},
-    resetQuery() {},
-    resetForm(formName) {
-      this.$refs[formName].resetFields();
-    },
     // 渚挎嵎鏍囩
-    tsgnameto() {},
+    tsgnameto(row) {
+      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("");
+      } else if (this.currentInputId == "submoduletext") {
+        inputValueArr = this.indexform.submoduletext.split("");
+      } else {
+        return;
+      }
+      //灏嗚緭鍏ユ鍐呭鍒囨垚鏁扮粍锛屾柟渚垮悗缁搷浣�
+      // inputValueArr = this.inputValue.split("");
+      // 鎷垮埌閫変腑鏂囧瓧鐨勯暱搴︼紙鍚庣画鍙互鐢ㄦ潵鏇挎崲閫変腑鐨勬枃瀛楋級
+      let selectLength = el.selectionEnd - el.selectionStart;
+      // 灏嗚鎻掑叆/鏇挎崲鐨勬枃瀛楁彃鍏�/鏇挎崲锛坴alue.name鏄鎻掑叆/鏇挎崲鐨勫瓧绗︿覆锛�
+      inputValueArr.splice(el.selectionStart, selectLength, `${row.variate}`);
+      // 鎶婃暟缁勯噸鏂拌浆鎹负瀛楃涓插苟璧嬪��
+      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;
+      } else if (this.currentInputId == "submoduletext") {
+        this.indexform.submoduletext = inputValueArr;
+      } else {
+        return;
+      }
+    },
+
+    // 鏂板鍙橀噺
+    addvariable() {
+      this.variablelist.push({
+        variatename: "",
+        variate: "",
+      });
+    },
+    // 鍒犻櫎鍙橀噺
+    delvariable(item) {
+      const index = this.variablelist.indexOf(item);
+      if (index !== -1) {
+        this.variablelist.splice(index, 1); // 浠庣储寮曚綅缃垹闄や竴涓厓绱�
+      } else {
+        console.log("鏈壘鍒拌瀵硅薄");
+      }
+    },
+    // 杈撳叆鑾峰彇id
+    handleInput(id) {
+      this.currentInputId = id;
+      console.log("杈撳叆妗嗙殑鍊煎凡鏇存柊:", this.currentInputId);
+      // 鍦ㄨ繖閲屾墽琛屾洿鏂版暟鎹殑閫昏緫
+    },
   },
 };
 </script>

--
Gitblit v1.9.3