From 7cd5ea98451006f9bfb3f18b3b55cd05c32bd813 Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Tue, 26 Mar 2024 11:33:45 +0800
Subject: [PATCH] 议事管理指定人员优化

---
 src/views/article/publicSignUp.vue |   68 +++++++++++++++++++++-------------
 1 files changed, 42 insertions(+), 26 deletions(-)

diff --git a/src/views/article/publicSignUp.vue b/src/views/article/publicSignUp.vue
index c79812e..30b8a48 100644
--- a/src/views/article/publicSignUp.vue
+++ b/src/views/article/publicSignUp.vue
@@ -31,8 +31,9 @@
       </template>
 
       <template slot-scope="{ row, size }" slot="iscomment">
-        <el-tag :size="size" :type="showStatus(row.iscomment, 2).type" v-text="showStatus(row.iscomment, 2).text">
-        </el-tag>
+        <el-switch @change="iscommentInput($event, row)" v-model="row.iscomment" :active-value="'1'"
+          :inactive-value="'0'" active-color="#13ce66" inactive-color="#ccc">
+        </el-switch>
       </template>
     </avue-crud>
 
@@ -123,7 +124,7 @@
           calcHeight: 54,
           dialogWidth: 950,
           tip: false,
-          border: false,
+          border: true,
           //stripe:true,
           index: true,
           viewBtn: false,
@@ -137,11 +138,32 @@
               row: true,
               searchSpan: 4,
               search: true,
+              searchLabelWidth: 76,
               rules: [{
                 required: true,
                 message: "请输入文章标题",
                 trigger: "blur",
               }, ],
+            },
+            {
+              label: "文章范围",
+              prop: "articleList",
+              span: 12,
+              minRows: 2,
+              type: "tree",
+              multiple: true,
+              tags: true,
+              dicData: [],
+              rules: [{
+                required: true,
+                message: "请选择文章范围",
+                trigger: "blur",
+              }, ],
+              props: {
+                label: "name",
+                value: 'id'
+              },
+              // hide: true,
             },
             {
               width: 110,
@@ -158,26 +180,7 @@
               // hide: true,
               span: 24,
             },
-            {
-              label: "文章范围",
-              prop: "articleList",
-              span: 12,
-              minRows: 2,
-              type: "cascader",
-              multiple: true,
-              tags: true,
-              dicData: [],
-              rules: [{
-                required: true,
-                message: "请选择文章范围",
-                trigger: "blur",
-              }, ],
-              props: {
-                label: "name",
-                value: 'id'
-              },
-              hide: true,
-            },
+
             {
               width: 110,
               label: "文章类型",
@@ -254,7 +257,10 @@
               label: "评论区",
               prop: "iscomment",
               slot: true,
-              type: "select",
+              type: "switch",
+              activeColor: "#13ce66",
+              inactiveColor: "#ccc",
+              value: '1',
               dicData: [{
                   label: "关闭",
                   value: "0",
@@ -415,7 +421,14 @@
       }
     },
     methods: {
-
+      iscommentInput(e, data) {
+        upcomment(data.id, e).then(() => {
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          })
+        })
+      },
 
       openUserPopup(row) {
         this.$refs.publicSignUpChild.openUser(row)
@@ -631,6 +644,7 @@
           this.page.total = data.total
           this.data = data.records
           this.data.forEach(item => {
+            item.articleList = JSON.parse(item.articleRange)
             if (item.url.length > 0) {
               var urls = []
               var names = item.url.split(",")
@@ -643,7 +657,9 @@
           this.loading = false
           this.selectionClear()
         })
-        getDistrictTree(params = {}).then((res) => {
+        getDistrictTree(params = {
+          filterFlag: 1
+        }).then((res) => {
           const data = res.data.data
           this.districtTree = data
           const column = this.findObject(this.option.column, "articleList")

--
Gitblit v1.9.3