From 6f35ca70caf02e1c2b7dbab32794c1cc1f5dbf60 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期四, 24 十月 2024 11:15:47 +0800
Subject: [PATCH] 测试完成

---
 src/views/repositoryai/verbaltrick/particulars/index.vue |  339 ++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 243 insertions(+), 96 deletions(-)

diff --git a/src/views/repositoryai/verbaltrick/particulars/index.vue b/src/views/repositoryai/verbaltrick/particulars/index.vue
index 07ed606..abac453 100644
--- a/src/views/repositoryai/verbaltrick/particulars/index.vue
+++ b/src/views/repositoryai/verbaltrick/particulars/index.vue
@@ -7,14 +7,14 @@
           <el-step>
             <template slot="title">
               <span style="cursor: pointer" @click="Editprogress = 1"
-                >闂搴撶紪杈�</span
+                >璇濇湳鍩虹淇℃伅缂栬緫</span
               >
             </template>
           </el-step>
           <el-step>
             <template slot="title">
               <span style="cursor: pointer" @click="nextstep"
-                >闂鎸囨爣缂栬緫</span
+                >璇濇湳鎸囨爣缂栬緫</span
               >
             </template>
           </el-step>
@@ -40,6 +40,28 @@
           :rules="rules"
           label-width="100px"
         >
+        <el-row :gutter="20">
+            <el-col :span="12">
+              <el-form-item label="闂涓绘棬" prop="scriptTopic">
+                <el-input
+                  v-model="indexform.scriptTopic"
+                  placeholder="璇疯緭鍏ラ棶棰樹富鏃�"
+                  maxlength="80"
+                />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-form-item label="闂鏂囨湰" prop="scriptContent">
+                <el-input
+                  :rows="2"
+                  type="textarea"
+                  id="scriptContent"
+                  show-word-limit
+                  placeholder="璇疯緭鍏ュ唴瀹�"
+                  v-model.sync="indexform.scriptContent"
+                  @focus="handleInput('scriptContent')"
+                />
+              </el-form-item>
           <el-row>
             <el-col :span="12">
               <el-form-item label="璇█" prop="deptId">
@@ -109,17 +131,7 @@
               </el-form-item>
             </el-col>
           </el-row>
-          <el-row :gutter="20">
-            <el-col :span="20">
-              <el-form-item label="闂涓绘棬" prop="scriptTopic">
-                <el-input
-                  v-model="indexform.scriptTopic"
-                  placeholder="璇疯緭鍏ラ棶棰樹富鏃�"
-                  maxlength="80"
-                />
-              </el-form-item>
-            </el-col>
-          </el-row>
+
           <el-form-item label="鏍囩" prop="desc">
             <div class="xinz-inf">
               <el-tag
@@ -202,7 +214,7 @@
               </div>
             </el-form-item>
           </el-drawer>
-          <el-row>
+          <!-- <el-row>
             <el-col :span="6">
               <el-form-item label="浠呴檺闄㈠尯" prop="region">
                 <el-select
@@ -239,14 +251,14 @@
                 </el-select>
               </el-form-item>
             </el-col>
-          </el-row>
+          </el-row> -->
           <el-row>
             <el-col :span="24">
               <el-form-item label="闂鍙橀噺" prop="scriptContent">
                 <div style="display: flex; margin-bottom: 10px">
                   <div
                     v-for="item in variablelist"
-                    class="tsgname"
+                    :class="item.default ? 'tsgname' : 'tsgnames'"
                     @click="tsgnameto(item)"
                   >
                     {{ item.variatename }}
@@ -260,36 +272,54 @@
           >
           <el-row>
             <el-col :span="24">
-              <el-form-item label="闂鏂囨湰" prop="scriptContent">
+              <el-form-item label="璇煶鏂囨湰" prop="scriptContent">
                 <el-input
                   :rows="2"
                   type="textarea"
                   id="scriptContent"
                   show-word-limit
                   placeholder="璇疯緭鍏ュ唴瀹�"
-                  v-model.sync="indexform.scriptContent"
+                  v-model.sync="indexform.ivrtext"
                   @focus="handleInput('scriptContent')"
                 />
               </el-form-item> </el-col
           ></el-row>
           <el-row>
             <el-col :span="6">
-              <el-form-item label="闂璇煶" prop="verbaltrickyy">
+              <el-form-item label="璇煶鏂囦欢" prop="verbaltrickyy">
                 <el-upload
                   class="upload-demo"
-                  action="https://jsonplaceholder.typicode.com/posts/"
-                  :on-change="handleChange"
-                  :file-list="fileList"
+                  :action="uploadImgUrl"
+                  :headers="headers"
+                  :show-file-list="false"
+                  :on-success="
+                    (response, file) => handleChange(response, file, 1)
+                  "
+                  accept=".wav,.mp3"
                   :limit="1"
-                  :on-exceed="handleExceed"
                 >
                   <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
                 </el-upload>
-                <!-- <el-input v-model="indexform.userName" maxlength="66"
-                  show-word-limit /> -->
               </el-form-item>
-            </el-col></el-row
-          >
+            </el-col>
+            <el-col :span="6">
+              <span style="font-size: 12px" v-if="indexform.ivrVoice">{{
+                indexform.ivrVoice.substring(
+                  indexform.ivrVoice.lastIndexOf("/") + 1
+                )
+              }}</span>
+            </el-col>
+            <el-col :span="6">
+              <mini-audio
+                :audio-source="
+                  indexform.ivrVoice
+                    ? indexform.ivrVoice
+                    : 'https://example.com/example.mp3'
+                "
+              ></mini-audio>
+            </el-col>
+          </el-row>
+
           <el-row>
             <el-col :span="24">
               <el-form-item label="鏃犲尮閰嶆枃鏈�" prop="noMatchText">
@@ -306,23 +336,42 @@
           ></el-row>
           <el-row>
             <el-col :span="6">
-              <el-form-item label="鏃犲尮閰嶈闊�" prop="matchyy">
+              <el-form-item label="鏃犲尮閰嶈闊�" prop="verbaltrickyy">
                 <el-upload
                   class="upload-demo"
-                  action="https://jsonplaceholder.typicode.com/posts/"
-                  :on-change="handleChange"
-                  :file-list="fileList"
+                  :action="uploadImgUrl"
+                  :show-file-list="false"
+                  :headers="headers"
+                  :on-success="
+                    (response, file) => handleChange(response, file, 2)
+                  "
+                  accept=".wav,.mp3"
                   :limit="1"
-                  :on-exceed="handleExceed"
                 >
                   <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
                 </el-upload>
               </el-form-item>
-            </el-col></el-row
-          >
+            </el-col>
+            <el-col :span="6">
+              <span style="font-size: 12px" v-if="indexform.nomatchvoice">{{
+                indexform.nomatchvoice.substring(
+                  indexform.nomatchvoice.lastIndexOf("/") + 1
+                )
+              }}</span>
+            </el-col>
+            <el-col :span="6">
+              <mini-audio
+                :audio-source="
+                  indexform.nomatchvoice
+                    ? indexform.nomatchvoice
+                    : 'https://example.com/example.mp3'
+                "
+              ></mini-audio>
+            </el-col>
+          </el-row>
           <el-row>
             <el-col :span="24">
-              <el-form-item label="鏃犲0鏂囨湰" prop="slienceText">
+              <el-form-item label="闈欓粯鏂囨湰" prop="slienceText">
                 <el-input
                   type="textarea"
                   :rows="2"
@@ -336,20 +385,39 @@
           ></el-row>
           <el-row>
             <el-col :span="6">
-              <el-form-item label="鏃犲0璇煶" prop="silentyy">
+              <el-form-item label="闈欓粯璇煶" prop="verbaltrickyy">
                 <el-upload
                   class="upload-demo"
-                  action="https://jsonplaceholder.typicode.com/posts/"
-                  :on-change="handleChange"
-                  :file-list="fileList"
+                  :action="uploadImgUrl"
+                  :show-file-list="false"
+                  :headers="headers"
+                  :on-success="
+                    (response, file) => handleChange(response, file, 3)
+                  "
+                  accept=".wav,.mp3"
                   :limit="1"
-                  :on-exceed="handleExceed"
                 >
                   <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
                 </el-upload>
               </el-form-item>
-            </el-col></el-row
-          >
+            </el-col>
+            <el-col :span="6">
+              <span style="font-size: 12px" v-if="indexform.sliencevoice">{{
+                indexform.sliencevoice.substring(
+                  indexform.sliencevoice.lastIndexOf("/") + 1
+                )
+              }}</span>
+            </el-col>
+            <el-col :span="6">
+              <mini-audio
+                :audio-source="
+                  indexform.sliencevoice
+                    ? indexform.sliencevoice
+                    : 'https://example.com/example.mp3'
+                "
+              ></mini-audio>
+            </el-col>
+          </el-row>
 
           <el-row>
             <el-col :span="24">
@@ -367,20 +435,39 @@
           ></el-row>
           <el-row>
             <el-col :span="6">
-              <el-form-item label="鍚笉娓呰闊�" prop="vagueyy">
+              <el-form-item label="鍚笉娓呰闊�" prop="verbaltrickyy">
                 <el-upload
                   class="upload-demo"
-                  action="https://jsonplaceholder.typicode.com/posts/"
-                  :on-change="handleChange"
-                  :file-list="fileList"
+                  :action="uploadImgUrl"
+                  :show-file-list="false"
+                  :headers="headers"
+                  :on-success="
+                    (response, file) => handleChange(response, file, 4)
+                  "
+                  accept=".wav,.mp3"
                   :limit="1"
-                  :on-exceed="handleExceed"
                 >
                   <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
                 </el-upload>
               </el-form-item>
-            </el-col></el-row
-          >
+            </el-col>
+            <el-col :span="6">
+              <span style="font-size: 12px" v-if="indexform.noclearlyvoice">{{
+                indexform.noclearlyvoice.substring(
+                  indexform.noclearlyvoice.lastIndexOf("/") + 1
+                )
+              }}</span>
+            </el-col>
+            <el-col :span="6">
+              <mini-audio
+                :audio-source="
+                  indexform.noclearlyvoice
+                    ? indexform.noclearlyvoice
+                    : 'https://example.com/example.mp3'
+                "
+              ></mini-audio>
+            </el-col>
+          </el-row>
         </el-form>
         <div slot="footer" class="dialog-footer">
           <el-button type="primary" @click="nextstep">涓嬩竴姝�</el-button>
@@ -429,7 +516,10 @@
           <el-row>
             <el-col :span="24">
               <el-form-item label="鍊肩被鍨�">
-                <el-radio-group disabled v-model="indexform.valueType">
+                <el-radio-group
+                  :disabled="indexform.targetid"
+                  v-model="indexform.valueType"
+                >
                   <el-radio :label="1">閫夐」</el-radio>
                   <el-radio :label="2">鏂囨湰</el-radio>
                   <el-radio :label="3">鏁板��</el-radio>
@@ -437,16 +527,19 @@
               </el-form-item>
 
               <el-form-item label="棰樼洰绫诲瀷">
-                <el-radio-group disabled v-model="indexform.scriptType">
+                <el-radio-group
+                  @input="typeselection"
+                  :disabled="indexform.targetid"
+                  v-model="indexform.scriptType"
+                >
                   <el-radio :label="1">鍗曢��</el-radio>
-                  <el-radio :label="2">澶氶��</el-radio>
-                  <el-radio :label="3">濉┖</el-radio>
+                  <!-- <el-radio :label="2">澶氶��</el-radio> -->
                   <el-radio :label="4">闂瓟</el-radio>
                 </el-radio-group>
               </el-form-item>
             </el-col></el-row
           >
-          <div v-if="indexform.valueType == 1">
+          <div v-if="indexform.scriptType == 1 || indexform.scriptType == 2">
             <el-card class="box-card" style="margin-bottom: 20px">
               <Regular
                 :TargetoptionList="indexform.ivrLibaScriptTargetoptionList"
@@ -455,20 +548,23 @@
                 @syioption="syioption"
                 @xiayioption="xiayioption"
                 :intent="false"
+                :Verbalproblem="false"
               />
             </el-card>
             <el-row :gutter="20">
               <el-col :span="12">
                 <el-form-item label="娴嬭瘯杈撳叆" prop="targetvalue">
                   <el-input
-                    v-model="testvalue"
+                    v-model="indexform.content"
                     placeholder="璇疯緭鍏ユ祴璇曞唴瀹�"
                     maxlength="40"
                   />
                 </el-form-item>
               </el-col>
               <el-col :span="4">
-                <el-button type="success">寮�濮嬫祴璇�</el-button>
+                <el-button type="success" @click="testtagerlist"
+                  >寮�濮嬫祴璇�</el-button
+                >
               </el-col>
             </el-row>
             <div style="margin-bottom: 20px">
@@ -519,6 +615,17 @@
               style="width: 200px"
               @keyup.enter.native="gettargetInfo"
             />
+          </el-form-item>
+          <el-form-item label="鎸囨爣绫诲瀷" prop="scriptType">
+            <el-select v-model="queryParams.scriptType" placeholder="璇烽�夋嫨">
+              <el-option
+                v-for="(item, index) in qyoptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
           </el-form-item>
 
           <el-form-item>
@@ -594,12 +701,17 @@
 } from "@/api/AiCentre/index";
 import Regular from "@/components/Regular"; //姝e垯缁勪欢
 import store from "@/store";
+import { getToken } from "@/utils/auth";
 
 export default {
   name: "Verbalproblem",
   components: { Regular },
   data() {
     return {
+      headers: {
+        Authorization: "Bearer " + getToken(),
+      },
+      uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/uploadSort",
       Editprogress: 1, //缂栬緫杩涘害
       loading: false, // 閬僵灞�
       radio: "false", //鍗曢�夐閫変腑
@@ -618,6 +730,9 @@
         ivrLibaScriptTargetoptionList: [],
         ivrLibaScriptTagList: [],
         suitway: "2",
+        noMatchText:'鎶辨瓑锛屾垜娌℃湁鍚噦锛屾偍鑳藉啀璇翠竴閬嶅悧?',
+        noClearlyText:'鎶辨瓑锛屾垜娌℃湁鍚竻鎮ㄨ鐨勮瘽锛屾偍鍙互鍐嶈涓�娆″悧?',
+        slienceText:'鎶辨瓑锛屾垜娌℃湁鍚埌鎮ㄨ鐨勮瘽锛屾偍鍙互鍐嶈涓�娆″悧?',
       },
       mode: [],
       questionclass: [],
@@ -645,6 +760,7 @@
 
       addvalue: "娣诲姞棰樼洰",
       languagelist: [], //璇█鍒楄〃
+      qyoptions: [],
       // 鏌ヨ鍙傛暟
       queryParams: {
         pageNum: 1,
@@ -662,12 +778,16 @@
     this.languagelist = store.getters.languagelist;
     this.usable = store.getters.usable;
     this.courtyardlist = store.getters.courtyardlist;
+    this.qyoptions = store.getters.askvaluetype;
   },
 
   methods: {
     // 鑾峰彇璇︽儏鏁版嵁
     getverbaltrick() {
       let id = this.$route.query.id;
+      this.indexform.language = "鏅�氳瘽";
+      this.indexform.isAvailable = "1";
+
       if (id) {
         getverbaltrick({ id: id }).then((res) => {
           this.indexform = res.data;
@@ -738,33 +858,21 @@
       }
     },
 
-    // targetchange(res) {
-    //   console.log(res);
-    //   gettargetInfo({ id: res }).then((res) => {
-    //     console.log(res.rows[0]);
-    //     this.$modal
-    //       .confirm('鏄惁娣诲姞"' + res.rows[0].targetname + '"鎸囨爣鐨勯�夐」锛�')
-    //       .then(() => {
-    //         this.indexform.valueType = res.rows[0].valueType;
-    //         this.indexform.scriptType = res.rows[0].scriptType;
-    //         this.indexform.scriptTopic = res.rows[0].targetname;
-    //         this.indexform.targetname = res.rows[0].targetname;
-    //         this.indexform.targetid = res.rows[0].id;
-    //         this.indexform.targetdesc = res.rows[0].targetdesc;
-    //         this.indexform.isAvailable = "0";
-    //         this.indexform.language = "鏅�氳瘽";
-    //         this.indexform.isenable = res.rows[0].isenable;
-    //         this.$forceUpdate();
-    //         res.rows[0].targetoptionList.forEach((item) => {
-    //           item.isoperation = 1;
-    //           this.indexform.ivrLibaScriptTargetoptionList.push(item);
-    //         });
-    //       })
-    //       .catch(() => {
-    //         this.$modal.msgSuccess("宸插彇娑�");
-    //       });
-    //   });
-    // },
+    testtagerlist() {
+      if (this.indexform.content) {
+        let data = this.indexform;
+        data.targetoptionList =
+          this.indexform.ivrLibaScriptTargetoptionList.concat(this.dellist);
+        testtagerlist(data).then((res) => {
+          this.$modal.msgSuccess("娴嬭瘯鎴愬姛");
+          this.testgovalue = res.msg;
+          this.getList();
+        });
+      } else {
+        this.$modal.msgError("璇峰~鍐欐祴璇曞唴瀹�");
+        return;
+      }
+    },
     // 閫夋嫨鎸囨爣
     selectlabel(row) {
       this.$modal
@@ -792,6 +900,7 @@
         .catch(() => {});
     },
     gettargetInfo() {
+      this.queryParams.suitWay = 2;
       gettargetInfo(this.queryParams).then((res) => {
         console.log(res);
         this.targetList = res.rows;
@@ -807,6 +916,25 @@
       this.gettargetInfo();
     },
 
+    // 棰樼洰绫诲瀷鏇存崲
+    typeselection(row) {
+      if (
+        (row == 1 || row == 2) &&
+        !this.indexform.ivrLibaScriptTargetoptionList.length
+      ) {
+        this.indexform.ivrLibaScriptTargetoptionList.push({
+          guid: 1,
+          isoperation: 1,
+          targetvalue: "",
+          targetregex: "",
+          targetregex2: "",
+          dynamiccruxs: [],
+          nodynamiccruxs: [],
+          dynamiccruxsJson: "",
+          nodynamiccruxsJson: "",
+        });
+      }
+    },
     // 涓嬩竴姝�
     nextstep() {
       if (this.Editprogress <= 1) {
@@ -841,17 +969,20 @@
     },
     // 鏂囦欢----------------------
     // 鎺у埗鏂囦欢
-    handleChange(file, fileList) {
-      this.fileList = fileList.slice(-3);
+    handleChange(response, file, additionalParam) {
+      console.log(response);
+      if (additionalParam == 1) {
+        this.indexform.ivrVoice = response.url;
+      } else if (additionalParam == 2) {
+        this.indexform.nomatchvoice = response.url;
+        console.log(this.indexform.nomatchvoice);
+      } else if (additionalParam == 3) {
+        this.indexform.sliencevoice = response.url;
+      } else if (additionalParam == 4) {
+        this.indexform.noclearlyvoice = response.url;
+      }
     },
-    // 鏂囦欢瓒呭嚭涓暟闄愬埗鏃剁殑閽╁瓙
-    handleExceed(files, fileList) {
-      this.$message.warning(
-        `褰撳墠闄愬埗閫夋嫨 1 涓枃浠讹紝鏈閫夋嫨浜� ${files.length} 涓枃浠讹紝鍏遍�夋嫨浜� ${
-          files.length + fileList.length
-        } 涓枃浠禶
-      );
-    },
+
     // 鏍囩-----------------
     gettabList() {
       const tagqueryParams = {
@@ -1076,7 +1207,7 @@
 .sidecolumn {
   margin: 20px;
   margin-bottom: 0;
-  padding: 20px;
+  padding: 15px;
   background: #edf1f7;
   border: 1px solid #dcdfe6;
   -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
@@ -1084,6 +1215,7 @@
 }
 .leftvlue {
   margin: 20px;
+  margin-top: 10px;
   padding: 30px;
   background: #ffff;
   border: 1px solid #dcdfe6;
@@ -1128,7 +1260,7 @@
   padding-top: 0;
   padding-bottom: 0;
 }
-.tsgname {
+.tsgnames {
   width: 90px;
   margin-right: 10px;
   text-align: center;
@@ -1140,9 +1272,24 @@
   font-size: 18px;
   border-radius: 5px;
 }
-.tsgname:hover {
+.tsgnames:hover {
   background: #3366f5;
 }
+.tsgname {
+  width: 90px;
+  margin-right: 10px;
+  text-align: center;
+  cursor: pointer;
+  height: 40px;
+  line-height: 40px;
+  background: #66c18c;
+  color: #ffff;
+  font-size: 18px;
+  border-radius: 5px;
+}
+.tsgname:hover {
+  background: #20894d;
+}
 .tsgnamebj {
   width: 90px;
   margin-left: 15px;

--
Gitblit v1.9.3