From 399367ef477d4a719366af2fccdcd07ce5bff62a Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期日, 07 四月 2024 10:18:21 +0800
Subject: [PATCH] 测试完成

---
 src/views/repositoryai/templateku/configurat/measurement.vue |   28 ++++-
 src/components/Regular/index.vue                             |    4 
 src/views/repositoryai/general/particulars/index.vue         |  202 +++++++++++++++++++++++++++++++++++++++-
 src/store/modules/regular.js                                 |   54 ++++------
 4 files changed, 243 insertions(+), 45 deletions(-)

diff --git a/src/components/Regular/index.vue b/src/components/Regular/index.vue
index 5f23dca..1789177 100644
--- a/src/components/Regular/index.vue
+++ b/src/components/Regular/index.vue
@@ -253,8 +253,8 @@
       regexno = regexno.slice(0, -1);
       hostregex = "(?=.*(?:" + `${regex}` + ")).*$";
       hostregexno = "^(?!.(?:" + `${regexno}` + ")).*$";
-      this.TargetoptionList[index].hostregex = hostregex;
-      this.TargetoptionList[index].hostregex2 = hostregexno;
+      this.TargetoptionList[index].targetregex = hostregex;
+      this.TargetoptionList[index].targetregex2 = hostregexno;
       console.log(hostregex, "纭畾瀛楀尮閰�");
       console.log(hostregexno, "鍚﹀畾瀛楀尮閰�");
       this.handleSelectionChange();
diff --git a/src/store/modules/regular.js b/src/store/modules/regular.js
index f14ddac..9eec9eb 100644
--- a/src/store/modules/regular.js
+++ b/src/store/modules/regular.js
@@ -1,36 +1,30 @@
 const user = {
   state: {
     regular: [
-      { value: "1", label: "浼�" },
-      { value: "2", label: "缇�" },
-      { value: "3", label: "鍠�" },
-      { value: "4", label: "缇庡ソ" },
-      { value: "5", label: "骞哥" },
-      { value: "6", label: "鐢滅編" },
-      { value: "7", label: "鍙埍" },
-      { value: "8", label: "缇庢弧" },
-      { value: "9", label: "缇庝附" },
-      { value: "10", label: "蹇箰" },
-      { value: "11", label: "骞哥缇庢弧" },
-      { value: "12", label: "缇庡ソ骞哥" },
-      { value: "13", label: "缇庢弧骞哥" },
-      { value: "14", label: "缇庝附骞哥" },
-      { value: "15", label: "缇庡ソ蹇箰" },
-      { value: "16", label: "骞哥蹇箰" },
-      { value: "17", label: "缇庢弧蹇箰" },
-      { value: "18", label: "缇庝附蹇箰" },
-      { value: "19", label: "缇庡ソ鐢滅編" },
-      { value: "20", label: "骞哥鐢滅編" },
-      { value: "21", label: "缇庢弧鐢滅編" },
-      { value: "22", label: "缇庝附鐢滅編" },
-      { value: "23", label: "鍠勮壇缇庡ソ" },
-      { value: "24", label: "浼樼編骞哥" },
-      { value: "25", label: "鍠勮壇骞哥" },
-      { value: "26", label: "浼樼編蹇箰" },
-      { value: "27", label: "鍠勮壇蹇箰" },
-      { value: "28", label: "浼樼編鐢滅編" },
-      { value: "29", label: "鍠勮壇鐢滅編" },
-      { value: "30", label: "缇庡ソ鍙埍" },
+      { value: "1", label: "鏄�" },
+      { value: "2", label: "瀵�" },
+      { value: "3", label: "濂�" },
+      { value: "4", label: "纭�" },
+      { value: "5", label: "鐨勭‘" },
+      { value: "6", label: "纭畾" },
+      { value: "7", label: "纭" },
+      { value: "8", label: "濡�" },
+      { value: "9", label: "娌¢棶棰�" },
+      { value: "10", label: "鏄殑" },
+      { value: "11", label: "纭俊" },
+      { value: "19", label: "纭嚳鏃犵枒" },
+      { value: "20", label: "纭畾涓嶇Щ" },
+      { value: "22", label: "纭疄濡傛" },
+      { value: "23", label: "纭疄鏃犺" },
+      { value: "24", label: "纭疄鏃犵枒" },
+      { value: "25", label: "纭疄姣嬪焊缃枒" },
+      { value: "26", label: "纭疄濡傚疄" },
+      { value: "27", label: "纭疄濡傛槸" },
+      { value: "28", label: "纭疄姝g‘" },
+      { value: "29", label: "纭疄姝g‘鏃犺" },
+      { value: "30", label: "纭疄姝g‘鏃犵枒" },
+      { value: "31", label: "纭疄姝g‘姣嬪焊缃枒" },
+    
     ],
     noregular: [
       { value: "1", label: "鍚�" },
diff --git a/src/views/repositoryai/general/particulars/index.vue b/src/views/repositoryai/general/particulars/index.vue
index 63f1374..8a161a6 100644
--- a/src/views/repositoryai/general/particulars/index.vue
+++ b/src/views/repositoryai/general/particulars/index.vue
@@ -172,12 +172,89 @@
               <!-- <el-input v-model="indexform.userName" maxlength="30" /> -->
             </el-form-item>
 
-            <el-form-item label="鍖归厤鏂囨湰" prop="desc">
-              <el-input
-                type="textarea"
-                placeholder="璇疯緭鍏ュ尮閰嶆鍒�"
-                v-model="ruleForm.selfRegex"
-              ></el-input>
+            <el-form-item label="鍏抽敭瀛�(鍚�)" prop="desc">
+              <div class="xinz-inf">
+                <el-tag
+                  :key="crux"
+                  type="success"
+                  v-for="crux in ruleForm.dynamiccruxs"
+                  closable
+                  effect="dark"
+                  :disable-transitions="false"
+                  @close="handleClosecrux(crux, ruleForm, 1)"
+                >
+                  {{ crux }}
+                </el-tag>
+                <el-select
+                  v-model="inputValue"
+                  v-if="inputVisible"
+                  @change="handleInputConfirm(ruleForm)"
+                  filterable
+                  remote
+                  allow-create
+                  reserve-keyword
+                  default-first-option
+                  :loading="loading"
+                  placeholder="璇烽�夋嫨"
+                >
+                  <el-option
+                    v-for="ruleForms in regular"
+                    :key="ruleForms.label"
+                    :label="ruleForms.label"
+                    :value="ruleForms.label"
+                  >
+                  </el-option>
+                </el-select>
+                <el-button
+                  v-else
+                  class="button-new-tag"
+                  size="small"
+                  @click="showInput(ruleForm)"
+                  >+ 鏂板</el-button
+                >
+              </div>
+            </el-form-item>
+            <el-form-item label="鍏抽敭瀛�(闈�)" prop="desc">
+              <div class="xinz-inf">
+                <el-tag
+                  :key="crux"
+                  type="warning"
+                  v-for="crux in ruleForm.nodynamiccruxs"
+                  closable
+                  effect="dark"
+                  :disable-transitions="false"
+                  @close="handleClosecrux(crux, ruleForm, 2)"
+                >
+                  {{ crux }}
+                </el-tag>
+                <el-select
+                  v-model="inputValue"
+                  v-if="noinputVisible"
+                  @change="handleInputConfirm(ruleForm)"
+                  filterable
+                  remote
+                  allow-create
+                  reserve-keyword
+                  default-first-option
+                  :loading="loading"
+                  placeholder="璇烽�夋嫨"
+                >
+                  <el-option
+                    v-for="ruleForms in noregular"
+                    :key="ruleForms.value"
+                    :label="ruleForms.label"
+                    :value="ruleForms.label"
+                  >
+                  </el-option>
+                </el-select>
+                <el-button
+                  v-else
+                  class="button-new-tag"
+                  size="small"
+                  @click="showInputno(ruleForm)"
+                  >+ 鏂板</el-button
+                >
+              </div>
             </el-form-item>
             <el-form-item>
               <el-button type="primary" @click="submitForm('ruleForm')"
@@ -247,12 +324,24 @@
           label: "缁撴潫璇�",
         },
       ],
-      ruleForm: {},
+      ruleForm: {
+        dynamiccruxs: [],
+        nodynamiccruxs: [],
+      },
       baseForm: {
         extName: "",
       },
       rules: {},
       bases: {},
+      whether: 1, //1涓哄叧閿瘝锛�2涓哄惁瀹氬叧閿瘝
+      inputValue: "",
+      inputVisible: false,
+      noinputVisible: false,
+      loading: false,
+      regular: [],
+      noregular: [],
+      nodynamiccruxs: ["鍒�", "涓�"],
+      dynamiccruxs: ["濂�"],
     };
   },
 
@@ -262,6 +351,8 @@
     this.usable = store.getters.usablesz;
     this.languagelist = store.getters.languagelist;
     this.mode = store.getters.mode;
+    this.regular = store.getters.regular;
+    this.noregular = store.getters.noregular;
   },
 
   methods: {
@@ -388,6 +479,81 @@
       }
       return "";
     },
+    // 姝e垯-----------------
+    // 鐢熸垚姝e垯
+    generateRegex(row) {
+      let regex = "";
+      let regexno = "";
+      let hostregex = "";
+      let hostregexno = "";
+
+      for (let i = 0; i < this.ruleForm.dynamiccruxs.length; i++) {
+        regex += `${this.ruleForm.dynamiccruxs[i]}|`;
+      }
+      for (let i = 0; i < this.ruleForm.nodynamiccruxs.length; i++) {
+        regexno += `${this.ruleForm.nodynamiccruxs[i]}|`;
+      }
+      regex = regex.slice(0, -1);
+      regexno = regexno.slice(0, -1);
+      hostregex = "(?=.*(?:" + `${regex}` + ")).*$";
+      hostregexno = "^(?!.(?:" + `${regexno}` + ")).*$";
+      this.ruleForm.selfRegex = hostregex;
+      this.ruleForm.selfRegex2 = hostregexno;
+      console.log(hostregex, "纭畾瀛楀尮閰�");
+      console.log(hostregexno, "鍚﹀畾瀛楀尮閰�");
+    },
+    handleClosecrux(crux, item, whether) {
+      if (whether == 1) {
+        item.dynamiccruxs.splice(item.dynamiccruxs.indexOf(crux), 1);
+        console.log(1);
+        console.log(item.dynamiccruxs);
+        console.log(item.nodynamiccruxs);
+      } else {
+        console.log(2);
+        item.nodynamiccruxs.splice(item.nodynamiccruxs.indexOf(crux), 1);
+      }
+      this.generateRegex(item);
+    },
+    handleInputConfirm(row) {
+      // let index = this.TargetoptionList.indexOf(row);
+      console.log(this.ruleForm.dynamiccruxs);
+      console.log(this.ruleForm.nodynamiccruxs);
+      if (this.whether == 1 && this.inputValue) {
+        console.log(1);
+        if (this.ruleForm.dynamiccruxs.indexOf(this.inputValue) == -1) {
+          this.ruleForm.dynamiccruxs.push(this.inputValue);
+          console.log(2);
+        } else {
+          this.$message.error("鍏抽敭瀛楀凡瀛樺湪");
+        }
+        // this.inputVisible = false;
+        this.inputVisible = false;
+      } else if (this.whether == 2 && this.inputValue) {
+        console.log(this.ruleForm.nodynamiccruxs.indexOf(this.inputValue));
+        if (this.ruleForm.nodynamiccruxs.indexOf(this.inputValue) == -1) {
+          this.ruleForm.nodynamiccruxs.push(this.inputValue);
+        } else {
+          this.$message.error("鍏抽敭瀛楀凡瀛樺湪");
+        }
+        // this.noinputVisible = false;
+        this.noinputVisible = false;
+      }
+      this.generateRegex(row);
+
+      this.inputValue = "";
+    },
+    showInput(row) {
+      // let index = this.TargetoptionList.indexOf(row);
+      this.inputVisible = true;
+      // this.$set(this.ruleForm, "inputVisible", true);
+      this.whether = 1;
+    },
+    showInputno(row) {
+      // let index = this.TargetoptionList.indexOf(row);
+      this.noinputVisible = true;
+      // this.$set(this.ruleForm, "noinputVisible", true);
+      this.whether = 2;
+    },
   },
 };
 </script>
@@ -408,6 +574,28 @@
 .button-textsc {
   color: rgb(235, 23, 23);
 }
+.topicxq {
+  background-color: #e2f5fc;
+  border-radius: 4px;
+  margin-top: 10px;
+  padding: 10px;
+}
+
+.el-tag + .el-tag {
+  margin-left: 10px;
+}
+.button-new-tag {
+  margin-left: 10px;
+  height: 32px;
+  line-height: 30px;
+  padding-top: 0;
+  padding-bottom: 0;
+}
+.input-new-tag {
+  width: 90px;
+  margin-left: 10px;
+  vertical-align: bottom;
+}
 ::v-deep.el-table .warning-row {
   background: rgb(193, 208, 250);
 }
diff --git a/src/views/repositoryai/templateku/configurat/measurement.vue b/src/views/repositoryai/templateku/configurat/measurement.vue
index 491059f..7aa74d3 100644
--- a/src/views/repositoryai/templateku/configurat/measurement.vue
+++ b/src/views/repositoryai/templateku/configurat/measurement.vue
@@ -129,7 +129,7 @@
       };
       // 鍙戣捣ws璇锋眰
       sendWebsocket(
-        "ws://localhost:8089/chat?userId=1",
+        "ws://192.168.2.8:8089/chat?userId=1",
         obj,
         this.wsMessage,
         this.wsError
@@ -141,16 +141,32 @@
       dataJson = JSON.parse(dataJson);
       dataJson = JSON.parse(dataJson);
       console.log(dataJson, "鏁版嵁");
+      // 棣栨鎺ユ敹鏁版嵁
       if (!this.Answerline[0]) {
         this.Answerline.push({
           value: dataJson.kcb,
           isEat: 1,
         });
       }
-      this.Answerline.push({
-        value: dataJson.nowQuestion.questionText,
-        isEat: 1,
-      });
+      // 浼樺厛鍔犲叆閫氱敤搴撳尮閰嶆枃鏈�
+      if (dataJson.nowQuestion.submoduleText) {
+        this.Answerline.push({
+          value: dataJson.nowQuestion.submoduleText,
+          isEat: 1,
+        });
+      }
+      // 鏄惁缁撴潫
+      if (!dataJson.jsy) {
+        this.Answerline.push({
+          value: dataJson.nowQuestion.questionText,
+          isEat: 1,
+        });
+      } else {
+        this.Answerline.push({
+          value: dataJson.jsy,
+          isEat: 1,
+        });
+      }
       this.questionList = dataJson.questionList;
       this.questionList = this.questionList.map((item) => {
         item.ivrLibaScriptTargetoptionList.forEach((row) => {
@@ -179,7 +195,7 @@
       console.log(obj, "鍏ュ弬");
       // 鍙戣捣ws璇锋眰
       sendWebsocket(
-        "ws://localhost:8089/chat?userId=1",
+        "ws://192.168.2.8:8089/chat?userId=1",
         obj,
         this.wsMessage,
         this.wsError

--
Gitblit v1.9.3