From 6e54a6688661a05de7c418612cea8b38bbc2dee3 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期一, 14 四月 2025 11:28:26 +0800
Subject: [PATCH] 测试完成

---
 src/views/knowledge/questionbank/index.vue |  264 +++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 195 insertions(+), 69 deletions(-)

diff --git a/src/views/knowledge/questionbank/index.vue b/src/views/knowledge/questionbank/index.vue
index 437e672..7402482 100644
--- a/src/views/knowledge/questionbank/index.vue
+++ b/src/views/knowledge/questionbank/index.vue
@@ -3,8 +3,8 @@
     <!-- 宸︿晶鏍� -->
     <div class="sidecolumn">
       <div class="sidecolumn-top">
-        <div class="top-wj">闂绫诲瀷</div>
-        <div class="top-tj" @click="dialogFormVisible = true">+娣诲姞</div>
+        <div class="top-wj">闂鍒嗙被</div>
+        <div class="top-tj" @click="Newcategory">+娣诲姞</div>
       </div>
       <div class="center-ss">
         <el-input
@@ -20,6 +20,7 @@
           :data="deptOptions"
           :props="defaultProps"
           :expand-on-click-node="false"
+          :check-strictly="true"
           :filter-node-method="filterNode"
           ref="tree"
           node-key="id"
@@ -29,7 +30,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 +38,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>
@@ -57,36 +69,32 @@
               v-show="showSearch"
               label-width="98px"
             >
-              <el-form-item label="鍙敤闄㈠尯" prop="status">
-                <el-select v-model="queryParams.courtyard" placeholder="璇烽�夋嫨">
-                  <el-option
-                    v-for="item in languagelist"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </el-select>
-              </el-form-item>
               <el-form-item label="闂涓婚" prop="userName">
                 <el-input
-                  v-model="queryParams.userName"
+                  v-model="queryParams.scriptTopic"
                   placeholder="璇疯緭鍏�"
                   clearable
                   style="width: 200px"
                   @keyup.enter.native="handleQuery"
                 />
               </el-form-item>
-              <el-form-item label="鏂囧瓧" prop="status">
-                <el-select v-model="queryParams.status" placeholder="璇烽�夋嫨">
-                  <el-option
-                    v-for="item in languagelist"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  >
-                  </el-option>
-                </el-select>
+              <el-form-item label="闂鍐呭" prop="userName">
+                <el-input
+                  v-model="queryParams.scriptContent"
+                  placeholder="璇疯緭鍏�"
+                  clearable
+                  style="width: 200px"
+                  @keyup.enter.native="handleQuery"
+                />
+              </el-form-item>
+              <el-form-item label="鎸囨爣鍚嶇О" prop="targetname">
+                <el-input
+                  v-model="queryParams.targetname"
+                  placeholder="璇疯緭鍏�"
+                  clearable
+                  style="width: 200px"
+                  @keyup.enter.native="handleQuery"
+                />
               </el-form-item>
               <el-form-item label="鏄惁鍙敤" prop="isavailable">
                 <el-select
@@ -128,7 +136,6 @@
                   icon="el-icon-plus"
                   size="medium"
                   @click="compileUpdate"
-                  v-hasPermi="['system:user:add']"
                   >鏂板</el-button
                 >
               </el-col>
@@ -141,7 +148,6 @@
                   size="medium"
                   :disabled="multiple"
                   @click="handleDelete"
-                  v-hasPermi="['system:user:remove']"
                   >鍒犻櫎</el-button
                 >
               </el-col>
@@ -158,27 +164,49 @@
                 width="50"
                 align="center"
               />
-              <el-table-column
+              <!-- <el-table-column
                 label="搴忓彿"
                 fixed
                 align="center"
-                key="topicid"
-                prop="topicid"
-              />
+                key="id"
+                prop="id"
+              /> -->
               <el-table-column
-                label="棰樼洰鏍囬"
+                label="闂涓婚"
                 fixed
                 align="center"
-                key="topic"
-                prop="topic"
+                key="scriptTopic"
+                prop="scriptTopic"
                 width="200"
                 :show-overflow-tooltip="true"
               />
               <el-table-column
-                label="棰樼洰鍐呭"
+                label="闂鍐呭"
                 align="center"
-                key="topicContent"
-                prop="topicContent"
+                key="scriptContent"
+                prop="scriptContent"
+                width="200"
+                :show-overflow-tooltip="true"
+              />
+              <el-table-column
+                label="棰樺瀷"
+                align="center"
+                key="scriptType"
+                prop="scriptType"
+                width="120"
+              >
+                <template slot-scope="scope">
+                  <dict-tag
+                    :options="askvaluetype"
+                    :value="scope.row.scriptType"
+                  />
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="鎸囨爣鍚嶇О"
+                align="center"
+                key="targetname"
+                prop="targetname"
                 width="200"
                 :show-overflow-tooltip="true"
               />
@@ -206,7 +234,6 @@
                     size="medium"
                     type="text"
                     @click="illnessUpdate(scope.row)"
-                    v-hasPermi="['system:user:edit']"
                     ><span class="button-textxg"
                       ><i class="el-icon-date"></i>璇︽儏</span
                     ></el-button
@@ -222,8 +249,8 @@
                 :show-overflow-tooltip="true"
               >
                 <template slot-scope="scope">
-                  <span v-for="item in scope.row.tag.split(',')"
-                    >{{ item }}銆�
+                  <span v-for="item in scope.row.svyLibScriptTagList"
+                    >{{ item.tagname }}銆�
                   </span>
                 </template>
               </el-table-column>
@@ -262,16 +289,14 @@
                     size="medium"
                     type="text"
                     @click="compileUpdate(scope.row)"
-                    v-hasPermi="['system:user:edit']"
                     ><span class="button-bji"
-                      ><i class="el-icon-edit"></i>缂栬緫闂</span
+                      ><i class="el-icon-edit"></i>缂栬緫</span
                     ></el-button
                   >
                   <el-button
                     size="medium"
                     type="text"
                     @click="handleDelete(scope.row)"
-                    v-hasPermi="['system:user:remove']"
                     ><span class="button-textsc"
                       ><i class="el-icon-delete-solid"></i>鍒犻櫎</span
                     ></el-button
@@ -279,8 +304,7 @@
                   <el-button
                     size="medium"
                     type="text"
-                    @click="handleDelete(scope.row)"
-                    v-hasPermi="['system:user:remove']"
+                    @click="topicpreview(scope.row)"
                     ><span class="button-text"
                       ><i class="el-icon-view"></i>棰勮</span
                     ></el-button
@@ -301,7 +325,7 @@
       </div>
     </div>
     <!-- 娣诲姞绫诲埆寮规 -->
-    <el-dialog title="鏂板绫诲埆" width="30%" :visible.sync="dialogFormVisible">
+    <el-dialog title="绫诲埆缂栬緫" width="30%" :visible.sync="dialogFormVisible">
       <div style="text-align: center; margin-bottom: 20px">
         <el-radio-group v-model="radio">
           <el-radio-button label="涓诲垎绫�"></el-radio-button>
@@ -326,7 +350,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 +402,35 @@
         <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.scriptType != 3 && topicform.scriptType != 4"
+        >
+          <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 +440,7 @@
   getissueclassify,
   delissueclassify,
   addissueclassify,
+  editissueclassify,
   getissuelist,
   issueinfo,
   compileissue,
@@ -421,19 +475,24 @@
       total: 0,
       namequestionnaire: "",
       haoquestionnaire: "",
+      askvaluetype: "",
       idds: "",
+      topicform: {
+        scriptContent: "",
+      },
       amendtag: false, //鏄惁淇敼绫诲埆
       dialogFormVisible: false, //淇敼娣诲姞绫诲埆寮规
       deleteVisible: false, //鍒嗙被鍒犻櫎寮规
+      topicVisible: false, //棰勮寮规
       deletefenl: "楂樿鍘�", //鍒犻櫎椤�
       classifyform: {
-        categoryname: "",
+        name: "",
       }, //绫诲埆琛ㄥ崟
       // 琛ㄦ牸鏁版嵁
       userList: [],
       // 寮瑰嚭灞傛爣棰�
       tag: "",
-      title: "",
+      title: "绫诲埆缂栬緫",
       // 鏄惁鏄剧ず寮瑰嚭灞�
       open: false,
       // 鏃ユ湡鑼冨洿
@@ -454,6 +513,8 @@
       indexid: null,
       inputValue: "",
       radio: "涓诲垎绫�",
+      zufon: true,
+      zifon: true,
       inputVisible: false,
       illnessVisible: false, //鎸囨爣鐤剧梾寮规
       deptOptions: [],
@@ -461,7 +522,7 @@
       illnesslistapi: [],
       illnesslist: [],
       defaultProps: {
-        children: "svyLibTopicCategoryList",
+        children: "svyLibScriptCategoryList",
         label: "name",
       },
       mode: [],
@@ -484,6 +545,7 @@
     this.mode = store.getters.mode;
     this.languagelist = store.getters.languagelist;
     this.qyoptions = store.getters.usable;
+    this.askvaluetype = store.getters.askvaluetype;
   },
 
   methods: {
@@ -501,13 +563,13 @@
     compileUpdate(row) {
       this.$router.push({
         path: "/knowledge/questionbank/particulars/",
-        query: { id: row.topicid },
+        query: { id: row.id, categoryid: this.queryParams.categoryid },
       });
     },
     // 鐤剧梾-----------------------
     illnessUpdate(row) {
       this.illnessVisible = true;
-      this.indexid = row.topicid;
+      this.indexid = row.id;
       this.illnesslistapi = [];
       const illnessqueryParams = {
         pageNum: 1,
@@ -517,7 +579,7 @@
         console.log(response);
         this.optionsillness = response.rows;
       });
-      getillness({ outid: row.topicid, type: 4 }).then((res) => {
+      getillness({ outid: row.id, type: 4 }).then((res) => {
         this.illnesslist = res.rows;
         console.log(res);
       });
@@ -588,12 +650,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 &&
@@ -604,10 +675,11 @@
           (obj) => obj.id == this.classifyform.pid
         );
         calssvalue = this.deptOptions[index];
-        calssvalue.svyLibTopicCategoryList.push(this.classifyform);
+        console.log(calssvalue, "calssvalue");
+        calssvalue.svyLibScriptCategoryList.push(this.classifyform);
       } else if (this.radio == "涓诲垎绫�" && this.classifyform.name) {
         this.classifyform.pid = null;
-        this.classifyform.svyLibTopicCategoryList = [];
+        this.classifyform.svyLibScriptCategoryList = [];
       } else {
         return this.$modal.msgError("璇峰~鍐欏畬鏁翠俊鎭�");
       }
@@ -645,6 +717,27 @@
           .catch(() => {});
       }
     },
+    altertag(a, b) {
+      this.dialogFormVisible = true;
+      if (!b.pid) {
+        this.radio = "涓诲垎绫�";
+        this.title = "淇敼涓诲垎绫�";
+        this.zufon = false;
+      } else {
+        this.radio = "瀛愬垎绫�";
+        this.title = "淇敼瀛愬垎绫�";
+        this.zifon = false;
+      }
+      this.classifyform = b;
+      this.dialogFormVisible = true;
+    },
+    Newcategory() {
+      (this.classifyform = {}), //绫诲埆琛ㄥ崟
+        (this.radio = "涓诲垎绫�");
+      this.dialogFormVisible = true;
+      this.zifon = true;
+      this.zufon = true;
+    },
 
     // 绛涢�夎妭鐐�
     filterNode(value, data) {
@@ -652,14 +745,15 @@
       return data.name.indexOf(value) !== -1;
     },
     handleNodeClick(data) {
-      this.queryParams.assortid = data.id;
+      if (data.svyLibScriptCategoryList) return;
+      this.queryParams.categoryid = data.id;
       this.getList();
     },
 
     // 琛ㄥ崟閲嶇疆
     reset() {
       this.form = {
-        topicid: undefined,
+        id: undefined,
         deptId: undefined,
         userName: undefined,
         nickName: undefined,
@@ -689,17 +783,11 @@
     },
     // 澶氶�夋閫変腑鏁版嵁
     handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.topicid);
+      this.ids = selection.map((item) => item.id);
       this.single = selection.length != 1;
       this.multiple = !selection.length;
     },
-    /** 鏂板鎸夐挳鎿嶄綔 */
-    handleAdd() {
-      this.$router.push({
-        path: "/knowledge/verbaltrick/particulars/",
-        query: { id: "" },
-      });
-    },
+
     // 淇敼鍒嗙被寮规
     popoveramend(tagcategoryid) {
       this.idds = tagcategoryid;
@@ -709,7 +797,8 @@
 
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
     handleDelete(row) {
-      const topicids = row.topicid || this.ids;
+      console.log(this.ids);
+      const topicids = row.id || this.ids;
       this.$modal
         .confirm('鏄惁纭鍒犻櫎鐢ㄦ埛缂栧彿涓�"' + topicids + '"鐨勬暟鎹」锛�')
         .then(function () {
@@ -721,6 +810,10 @@
         })
         .catch(() => {});
     },
+    topicpreview(row) {
+      this.topicform = row;
+      this.topicVisible = true;
+    },
   },
 };
 </script>
@@ -730,14 +823,14 @@
   display: flex;
 }
 .sidecolumn {
-  width: 300px;
+  width: 400px;
   min-height: 100vh;
   text-align: center;
   //   display: flex;
   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 +949,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 +976,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