From 4fffa66d14a2b2943b35aca961317f3bed6649a0 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期五, 21 六月 2024 17:09:44 +0800
Subject: [PATCH] 测试完成

---
 src/views/knowledge/questionnaire/compilequer/index.vue |  176 ++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 114 insertions(+), 62 deletions(-)

diff --git a/src/views/knowledge/questionnaire/compilequer/index.vue b/src/views/knowledge/questionnaire/compilequer/index.vue
index 1ba545b..524e8af 100644
--- a/src/views/knowledge/questionnaire/compilequer/index.vue
+++ b/src/views/knowledge/questionnaire/compilequer/index.vue
@@ -39,28 +39,48 @@
           label-width="100px"
           class="demo-ruleForm"
         >
-          <el-form-item label="闂嵎鍒嗙被" prop="region">
-            <el-select
-              v-model="ruleForm.categoryid"
-              size="medium"
-              filterable
-              placeholder="璇烽�夋嫨鍒嗙被"
-            >
-              <el-option-group
-                v-for="group in optionsclass"
-                :key="group.id"
-                :label="group.name"
-              >
-                <el-option
-                  v-for="item in group.svyLibTitleCategoryList"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
+          <el-row :gutter="10">
+            <el-col :span="10">
+              <el-form-item label="闂嵎鍒嗙被" prop="region">
+                <el-select
+                  v-model="ruleForm.categoryid"
+                  size="medium"
+                  filterable
+                  placeholder="璇烽�夋嫨鍒嗙被"
                 >
-                </el-option>
-              </el-option-group>
-            </el-select>
-          </el-form-item>
+                  <el-option-group
+                    v-for="group in optionsclass"
+                    :key="group.id"
+                    :label="group.name"
+                  >
+                    <el-option
+                      v-for="item in group.svyLibTemplateCategoryList"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.id"
+                    >
+                    </el-option>
+                  </el-option-group>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="10">
+              <el-form-item label="璇勪环绫诲瀷">
+                <el-select
+                  v-model="ruleForm.scoreType"
+                  placeholder="璇烽�夋嫨鍒嗙被"
+                >
+                  <el-option
+                    v-for="group in appraiselist"
+                    :key="group.value"
+                    :label="group.label"
+                    :value="group.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
           <el-form-item label="闂嵎鏍囬" prop="name">
             <div style="width: 30%">
               <el-input v-model="ruleForm.svyname"></el-input>
@@ -267,19 +287,36 @@
       <div v-if="Editprogress == 2">
         <div class="leftvlue-jbxx">闂嵎棰樼洰璁剧疆</div>
         <el-divider></el-divider>
-        <div class="addtopic">
-          <el-button
-            type="primary"
-            icon="el-icon-plus"
-            round
-            @click="getaddtopiclist"
-            >娣诲姞棰樼洰</el-button
-          >
+        <div style="display: flex; justify-content: space-between">
+          <div>
+            <el-button
+              type="primary"
+              icon="el-icon-plus"
+              round
+              @click="getaddtopiclist"
+              >娣诲姞棰樼洰</el-button
+            >
+          </div>
+          <div style="display: flex">
+            <span
+              style="
+                width: 180px;
+                font-size: 20px;
+                font-weight: normal;
+                color: red;
+              "
+              >闂嵎鎬诲垎锛�</span
+            >
+            <el-input
+              v-model="ruleForm.scriptScore"
+              placeholder="璇疯緭鍏ュ垎鏁�"
+            ></el-input>
+          </div>
         </div>
         <div class="presentation">
           <div class="presentation-left">
             <el-card class="box-card" style="min-height: 688px">
-              <el-table v-loading="loading" :data="ruleForm.svyLibTopics">
+              <el-table v-loading="loading" :data="ruleForm.svyLibScripts">
                 <el-table-column
                   label="搴忓彿"
                   align="center"
@@ -287,17 +324,17 @@
                   prop="guid"
                 />
                 <el-table-column
-                  label="棰樼洰"
+                  label="棰樼洰鏍囬"
                   align="center"
                   key="topic"
                   prop="topic"
                   :show-overflow-tooltip="true"
                 />
                 <el-table-column
-                  label="涓昏鍐呭"
+                  label="棰樼洰鍐呭"
                   align="center"
-                  key="topicContent"
-                  prop="topicContent"
+                  key="script"
+                  prop="script"
                   :show-overflow-tooltip="true"
                 />
 
@@ -393,7 +430,7 @@
                 <div class="headline">閫夐」璁剧疆</div>
                 <div
                   class="topicxq"
-                  v-for="item in topicobj.svyLibTopicoptions"
+                  v-for="item in topicobj.svyLibTemplateTargetoptions"
                 >
                   <el-row :gutter="10">
                     <el-col :span="11"
@@ -401,7 +438,7 @@
                         <el-input
                           type="text"
                           placeholder="璇疯緭鍏�"
-                          v-model="item.topicid"
+                          v-model="item.id"
                           show-word-limit
                         >
                         </el-input> </el-form-item
@@ -533,7 +570,7 @@
       title="娣诲姞棰樼洰"
       :visible.sync="drawer"
       custom-class="demo-drawer"
-      width="50%"
+      size="50%"
     >
       <div class="preview-left">
         <el-form
@@ -577,8 +614,8 @@
           <el-table-column
             label="闂鍐呭"
             align="center"
-            key="topicContent"
-            prop="topicContent"
+            key="script"
+            prop="script"
             width="200"
             :show-overflow-tooltip="true"
           />
@@ -597,6 +634,13 @@
             </template>
           </el-table-column>
         </el-table>
+        <pagination
+          v-show="total > 0"
+          :total="total"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="getaddtopiclist"
+        />
       </div>
     </el-drawer>
   </div>
@@ -607,7 +651,7 @@
 import { listDept } from "@/api/system/dept";
 import store from "@/store";
 import {
-  getQtemplateclassify, 
+  getQtemplateclassify,
   delQtemplateclassify,
   addQtemplateclassify,
   getQtemplatelist,
@@ -649,6 +693,11 @@
       optionlist: [
         { value: "topic", table: "topic" },
         { value: "topic", table: "topic" },
+      ],
+      appraiselist: [
+        { label: "鍒嗘暟", value: "1" },
+        { label: "ABC绛夌骇", value: "2" },
+        { label: "浼樿壇绛夌骇", value: "3" },
       ],
 
       fileList: [
@@ -729,11 +778,11 @@
       let result = [];
       arr.forEach((item) => {
         result.push(item);
-        if (item.svyLibTitleCategoryList) {
+        if (item.svyLibTemplateCategoryList) {
           result = result.concat(
-            this.flattenArray(item.svyLibTitleCategoryList)
+            this.flattenArray(item.svyLibTemplateCategoryList)
           );
-          delete item.svyLibTitleCategoryList;
+          delete item.svyLibTemplateCategoryList;
         }
       });
       return result;
@@ -768,6 +817,8 @@
       });
     },
     submitForm(formName) {
+      this.$modal.loading("姝e湪涓婁紶鏁版嵁锛岃绋嶅��...");
+
       this.ruleForm.labelInfo = this.dynamicTags.join(",");
       this.ruleForm.suitway = this.ruleForm.suitway.join(",");
 
@@ -775,12 +826,16 @@
         this.ruleForm.isoperation = 2;
         compileQtemplate(this.ruleForm).then((response) => {
           this.$modal.msgSuccess("淇敼鎴愬姛");
+          this.$modal.closeLoading();
+
           this.$router.go(-1);
         });
       } else {
         this.ruleForm.isoperation = 1;
         compileQtemplate(this.ruleForm).then((response) => {
           this.$modal.msgSuccess("鏂板鎴愬姛");
+          this.$modal.closeLoading();
+
           this.$router.go(-1);
         });
       }
@@ -789,14 +844,12 @@
     Departmenttreatment() {
       this.ruleForm.deptNames = JSON.stringify(this.tempDetpRelevanceslist);
       console.log(this.tempDetpRelevanceslist);
-      this.ruleForm.svyLibTopics = this.ruleForm.svyLibTopics.concat(
+      this.ruleForm.svyLibScripts = this.ruleForm.svyLibScripts.concat(
         this.delScriptVOList
       );
-      console.log(this.ruleForm.svyLibTopics, "this.ruleForm.svyLibTopics");
       const result = this.tempDetpRelevanceslist.map(
         (subArr) => subArr[subArr.length - 1]
       );
-      console.log(result, "result");
       // id鏁扮粍鏌ユ暟缁勫璞�
       result.forEach((item) => {
         const condition = this.ruleForm.tempDetpRelevances.some(
@@ -810,7 +863,6 @@
           });
         }
       });
-      console.log(this.ruleForm.tempDetpRelevances);
       // 鏁扮粍瀵硅薄鏌d鏁扮粍
       this.ruleForm.tempDetpRelevances.forEach((item) => {
         const condition = result.some((obj) => obj === item.deptId);
@@ -820,7 +872,6 @@
           this.ruleForm.tempDetpRelevances[index].delFlag = 1;
         }
       });
-      console.log(this.ruleForm.tempDetpRelevances);
       setTimeout(() => {
         this.submitForm();
       }, 1000);
@@ -865,14 +916,15 @@
     // 鏂板棰樼洰
     addtopic(row) {
       row.isoperation = 1;
-      row.svyLibTopicoptions.forEach((item) => {
+      row.svyLibScriptOptions.forEach((item) => {
         item.isoperation = 1;
       });
-      this.ruleForm.svyLibTopics.push(row);
+      this.ruleForm.svyLibScripts.push(row);
+      this.$modal.msgSuccess("鏂板鎴愬姛");
     },
     handleDelete(row) {
-      let index = this.ruleForm.svyLibTopics.indexOf(row);
-      this.ruleForm.svyLibTopics.splice(index, 1);
+      let index = this.ruleForm.svyLibScripts.indexOf(row);
+      this.ruleForm.svyLibScripts.splice(index, 1);
       row.isoperation = 3;
       this.delScriptVOList.push(row);
       this.sortFn();
@@ -884,29 +936,29 @@
       // });
     },
     syioption(row) {
-      const index = this.getIndexInArray(this.ruleForm.svyLibTopics, row);
-      const item = this.ruleForm.svyLibTopics.splice(index, 1)[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓�
-      this.ruleForm.svyLibTopics.splice(index - 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣�
+      const index = this.getIndexInArray(this.ruleForm.svyLibScripts, row);
+      const item = this.ruleForm.svyLibScripts.splice(index, 1)[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓�
+      this.ruleForm.svyLibScripts.splice(index - 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣�
       this.sortFn();
     },
     xiayioption(row) {
-      const index = this.getIndexInArray(this.ruleForm.svyLibTopics, row);
-      const item = this.ruleForm.svyLibTopics.splice(index, 1)[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓�
-      this.ruleForm.svyLibTopics.splice(index + 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣�
+      const index = this.getIndexInArray(this.ruleForm.svyLibScripts, row);
+      const item = this.ruleForm.svyLibScripts.splice(index, 1)[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓�
+      this.ruleForm.svyLibScripts.splice(index + 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣�
       this.sortFn();
     },
     sortFn() {
-      this.ruleForm.svyLibTopics = this.ruleForm.svyLibTopics.map(
+      this.ruleForm.svyLibScripts = this.ruleForm.svyLibScripts.map(
         (item, index) => {
           return {
             guid: index + 1,
             svyid: item.svyid,
-            topic: item.topic,
-            topicContent: item.topicContent,
+            script: item.script,
+            script: item.script,
           };
         }
       );
-      console.log(this.ruleForm.svyLibTopics);
+      console.log(this.ruleForm.svyLibScripts);
     },
 
     // 淇敼棰樼洰淇℃伅

--
Gitblit v1.9.3