From 1f644c69e6c5df3683e8b4698b3073d487cf6d80 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期二, 02 七月 2024 11:27:31 +0800
Subject: [PATCH] 测试完成

---
 src/views/knowledge/questionbank/index.vue |  120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 109 insertions(+), 11 deletions(-)

diff --git a/src/views/knowledge/questionbank/index.vue b/src/views/knowledge/questionbank/index.vue
index 437e672..bcfe201 100644
--- a/src/views/knowledge/questionbank/index.vue
+++ b/src/views/knowledge/questionbank/index.vue
@@ -29,7 +29,7 @@
         >
           <span class="custom-tree-node" slot-scope="{ node, data }">
             <span>{{ node.label }}</span>
-            <span>
+            <span v-if="data.id > 0">
               <el-button
                 type="text"
                 icon="el-icon-delete"
@@ -37,6 +37,17 @@
                 size="mini"
                 @click="() => remove(node, data)"
               >
+              </el-button>
+            </span>
+            <span v-if="data.id > 0">
+              <el-button
+                type="text"
+                circle
+                size="mini"
+                @click="() => altertag(node, data)"
+                ><span class="button-textxg"
+                  ><i class="el-icon-edit-outline"></i
+                ></span>
               </el-button>
             </span>
           </span>
@@ -162,8 +173,8 @@
                 label="搴忓彿"
                 fixed
                 align="center"
-                key="topicid"
-                prop="topicid"
+                key="id"
+                prop="id"
               />
               <el-table-column
                 label="棰樼洰鏍囬"
@@ -177,8 +188,8 @@
               <el-table-column
                 label="棰樼洰鍐呭"
                 align="center"
-                key="topicContent"
-                prop="topicContent"
+                key="script"
+                prop="script"
                 width="200"
                 :show-overflow-tooltip="true"
               />
@@ -279,7 +290,7 @@
                   <el-button
                     size="medium"
                     type="text"
-                    @click="handleDelete(scope.row)"
+                    @click="topicpreview(scope.row)"
                     v-hasPermi="['system:user:remove']"
                     ><span class="button-text"
                       ><i class="el-icon-view"></i>棰勮</span
@@ -326,7 +337,7 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button @click="dialogFormVisible = false">鍙� 娑�</el-button>
+        <el-button @click="getDeptTree()">鍙� 娑�</el-button>
         <el-button type="primary" @click="submitsidecolumn">纭� 瀹�</el-button>
       </div>
     </el-dialog>
@@ -378,6 +389,32 @@
         <el-button type="primary" @click="confirmillness">纭� 瀹�</el-button>
       </span>
     </el-dialog>
+    <el-dialog title="棰樼洰棰勮" :visible.sync="topicVisible" width="50%">
+      <div class="preview-left">
+        <div class="dev-text">
+          <span>{{ topicform.scriptContent }}</span>
+        </div>
+
+        <div class="dev-xx" v-if="topicform.valueType == 1">
+          <el-radio-group v-model="topicform.asrtext">
+            <el-radio
+              v-for="(topicforms, index) in topicform.svyLibScriptOptions"
+              :key="topicforms.optioncontent"
+              :label="topicforms.optioncontent"
+              >{{ topicforms.optioncontent }}</el-radio
+            >
+          </el-radio-group>
+        </div>
+        <div v-else>
+          <el-input
+            type="textarea"
+            placeholder="璇疯緭鍏ュ唴瀹�"
+            v-model.sync="topicform.asrtext"
+            :rows="2"
+          />
+        </div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -387,6 +424,7 @@
   getissueclassify,
   delissueclassify,
   addissueclassify,
+  editissueclassify,
   getissuelist,
   issueinfo,
   compileissue,
@@ -422,9 +460,13 @@
       namequestionnaire: "",
       haoquestionnaire: "",
       idds: "",
+      topicform: {
+        questionText: "",
+      },
       amendtag: false, //鏄惁淇敼绫诲埆
       dialogFormVisible: false, //淇敼娣诲姞绫诲埆寮规
       deleteVisible: false, //鍒嗙被鍒犻櫎寮规
+      topicVisible: false, //棰勮寮规
       deletefenl: "楂樿鍘�", //鍒犻櫎椤�
       classifyform: {
         categoryname: "",
@@ -501,7 +543,7 @@
     compileUpdate(row) {
       this.$router.push({
         path: "/knowledge/questionbank/particulars/",
-        query: { id: row.topicid },
+        query: { id: row.id },
       });
     },
     // 鐤剧梾-----------------------
@@ -588,12 +630,21 @@
     getDeptTree() {
       getissueclassify({}).then((res) => {
         this.deptOptions = res.rows;
-        console.log(res);
+        this.dialogFormVisible = false;
       });
     },
 
     // 娣诲姞绫诲埆鏍�
     submitsidecolumn() {
+      if (this.classifyform.id) {
+        editissueclassify(this.classifyform).then((res) => {
+          this.getDeptTree();
+          this.$modal.msgSuccess("淇敼鎴愬姛");
+          this.classifyform = {};
+          this.dialogFormVisible = false;
+        });
+        return;
+      }
       let calssvalue = {};
       if (
         this.classifyform.pid &&
@@ -645,6 +696,16 @@
           .catch(() => {});
       }
     },
+    altertag(a, b) {
+      this.dialogFormVisible = true;
+      if (!b.pid) {
+        this.radio = "涓诲垎绫�";
+      } else {
+        this.radio = "瀛愬垎绫�";
+      }
+      this.classifyform = b;
+      this.dialogFormVisible = true;
+    },
 
     // 绛涢�夎妭鐐�
     filterNode(value, data) {
@@ -652,7 +713,7 @@
       return data.name.indexOf(value) !== -1;
     },
     handleNodeClick(data) {
-      this.queryParams.assortid = data.id;
+      this.queryParams.categoryid = data.id;
       this.getList();
     },
 
@@ -721,6 +782,10 @@
         })
         .catch(() => {});
     },
+    topicpreview(row) {
+      this.topicform = row;
+      this.topicVisible = true;
+    },
   },
 };
 </script>
@@ -737,7 +802,7 @@
   margin-top: 20px;
   margin: 20px;
   padding: 30px;
-  background: #edf1f7;
+  background: #fff;
   border: 1px solid #dcdfe6;
   -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
     0 0 6px 0 rgba(0, 0, 0, 0.04);
@@ -856,6 +921,21 @@
     vertical-align: bottom;
   }
 }
+.preview-left {
+  margin: 20px;
+  //   margin: 20px;
+  padding: 30px;
+  // background: #ffff;
+  border: 1px solid #dcdfe6;
+  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
+    0 0 6px 0 rgba(0, 0, 0, 0.04);
+
+  .dev-text {
+    margin-bottom: 10px;
+    text-align: left;
+    font-size: 22px;
+  }
+}
 
 ::v-deep .el-tree-node__content {
   display: -webkit-box;
@@ -868,6 +948,24 @@
   font-size: 20px;
   cursor: pointer;
 }
+::v-deep .el-tree {
+  position: relative;
+  cursor: default;
+  border-radius: 5px;
+  background: #eff8fe;
+  color: #606266;
+  border: 1px solid #bbe1fa;
+  // border: 1px solid #dcdfe6;
+  -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
+    0 0 6px 0 rgba(0, 0, 0, 0.04);
+}
+::v-deep
+  .el-tree--highlight-current
+  .el-tree-node.is-current
+  > .el-tree-node__content {
+  background-color: #7799fb;
+  color: #fff;
+}
 ::v-deep .el-button--mini.is-circle {
   padding: 7px;
   margin: 0;

--
Gitblit v1.9.3