From 503f156b9e66570712a53f8f3fc09abfdb1f4030 Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Sat, 13 Apr 2024 15:53:17 +0800
Subject: [PATCH] 无诈审核

---
 src/views/article/rotation.vue |  125 ++++++++++++++++++++++++++---------------
 1 files changed, 80 insertions(+), 45 deletions(-)

diff --git a/src/views/article/rotation.vue b/src/views/article/rotation.vue
index c5dff7d..2bd981a 100644
--- a/src/views/article/rotation.vue
+++ b/src/views/article/rotation.vue
@@ -1,4 +1,4 @@
-<!-- 走访日志 -->
+<!-- 轮播图 -->
 <template>
   <basic-container>
     <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
@@ -34,7 +34,7 @@
     data() {
       return {
         form: {
-          publicFlag: 1
+          publicFlag: 2
         },
         query: {},
         loading: true,
@@ -94,7 +94,12 @@
                   label: "综治",
                   value: 2
                 }
-              ]
+              ],
+              rules: [{
+                required: true,
+                message: "请选择类型",
+                trigger: "blur",
+              }, ],
             }, {
               width: 110,
               labelWidth: 100,
@@ -103,51 +108,53 @@
               span: 12,
               searchSpan: 4,
               type: "select",
-              // search: true,
-              // cascader: ["communityCode"],
               type: "select",
               dicData: [{
-                  label: "不公开",
-                  value: 1
-                },
-                {
                   label: "公开",
                   value: 2
-                }
+                }, {
+                  label: "限定公开",
+                  value: 1
+                },
+
               ]
             },
-            // {
-            //   width: 156,
-            //   labelWidth: 100,
-            //   overHidden: true,
-            //   label: "所属社区",
-            //   // parent: false,
-            //   prop: "communityCode",
-            //   multiple: true,
-            //   tags: true,
-            //   hide: true,
-            //   dateType: "string",
-            //   type: "tree",
-            //   dicUrl: "/api/blade-system/region/tree?deptNature={{type}}",
-            //   props: {
-            //     label: "name",
-            //     value: "id"
-            //   },
-            //   rules: [{
-            //     required: true,
-            //     message: "请选择所属社区",
-            //     trigger: "blur",
-            //   }, ],
-            // },
             {
-              label: "范围",
+              width: 156,
+              labelWidth: 100,
+              overHidden: true,
+              label: "所属社区",
+              // parent: false,
+              prop: "communityCode",
+              multiple: true,
+              tags: true,
+              hide: true,
+              dateType: "string",
+              addDisplay: false,
+              editDisplay: false,
+              type: "tree",
+              dicUrl: "/api/blade-system/region/tree?deptNature={{type}}",
+              props: {
+                label: "name",
+                value: "id"
+              },
+              rules: [{
+                required: true,
+                message: "请选择所属社区",
+                trigger: "blur",
+              }, ],
+            },
+            {
+              label: "公开范围",
               prop: "rotationRange",
               width: 156,
               labelWidth: 100,
               tags: true,
               type: "tree",
               multiple: true,
-              // editDisplay: false,
+              dateType: "string",
+              editDisplay: false,
+              addDisplay: false,
               cascader: ['articleId'],
               dicUrl: "/api/blade-district/district/getDistrictTree?filterFlag=1",
               rules: [{
@@ -168,7 +175,8 @@
               prop: "articleId",
               search: false,
               viewDisabled: false,
-              // editDisplay: false,
+              editDisplay: false,
+              addDisplay: false,
               type: 'select',
               dicUrl: `/api/blade-article/article/getArticleByDistrictId?type=4&eventType=1&districtId={{rotationRange}}`,
               formslot: true,
@@ -237,17 +245,32 @@
           const column = this.findObject(this.option.column, "rotationRange")
           if (newData == 1) {
             column.editDisplay = true
+            column.addDisplay = true
           } else {
             column.editDisplay = false
+            column.addDisplay = false
           }
 
           const column2 = this.findObject(this.option.column, "articleId")
           if (newData == 1) {
             column2.editDisplay = true
+            column2.addDisplay = true
           } else {
             column2.editDisplay = false
+            column2.addDisplay = false
           }
-
+        },
+      },
+      'form.type': {
+        handler(newData) {
+          const column = this.findObject(this.option.column, "communityCode")
+          if (newData != 3) {
+            column.editDisplay = true
+            column.addDisplay = true
+          } else {
+            column.editDisplay = false
+            column.addDisplay = false
+          }
         },
       },
     },
@@ -271,12 +294,15 @@
     },
     methods: {
       rowSave(row, done, loading) {
-        if (row.rotationRange) {
-          row.rotationRange = JSON.stringify(row.rotationRange)
+        // if (row.rotationRange) {
+        //   row.rotationRange = JSON.stringify(row.rotationRange)
+        // }
+        if (row.communityCode) {
+          row.communityCode = JSON.stringify(row.communityCode)
         }
         if (row.publicFlag == 2) {
-          row.rotationRange = []
-          row.rotationRange = JSON.stringify(row.rotationRange)
+          row.rotationRange = ''
+          // row.rotationRange = JSON.stringify(row.rotationRange)
         }
         if (row.url.length > 0) {
           var urls = []
@@ -303,12 +329,15 @@
         )
       },
       rowUpdate(row, index, done, loading) {
-        if (row.rotationRange) {
-          row.rotationRange = JSON.stringify(row.rotationRange)
+        // if (row.rotationRange) {
+        //   row.rotationRange = JSON.stringify(row.rotationRange)
+        // }
+        if (row.communityCode) {
+          row.communityCode = JSON.stringify(row.communityCode)
         }
         if (row.publicFlag == 2) {
-          row.rotationRange = []
-          row.rotationRange = JSON.stringify(row.rotationRange)
+          row.rotationRange = ''
+          // row.rotationRange = JSON.stringify(row.rotationRange)
         }
         if (row.url.length > 0) {
           var urls = []
@@ -397,6 +426,9 @@
             if (this.form.rotationRange) {
               this.form.rotationRange = JSON.parse(this.form.rotationRange)
             }
+            // if (this.form.communityCode) {
+            //   this.form.communityCode = JSON.parse(this.form.communityCode)
+            // }
             if (this.form.url.length > 0) {
               var urls = []
               var names = this.form.url.split(",")
@@ -453,6 +485,9 @@
             if (item.rotationRange) {
               item.rotationRange = JSON.parse(item.rotationRange)
             }
+            // if (item.communityCode) {
+            //   item.communityCode = JSON.parse(item.communityCode)
+            // }
             if (item.url.length > 0) {
               var urls = []
               var names = item.url.split(",")

--
Gitblit v1.9.3