From 74e2a0314d3edb84c0af444a53d2851c132f2b10 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Fri, 01 Dec 2023 13:14:52 +0800
Subject: [PATCH] 资讯添加范围

---
 src/views/article/article.vue |   32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/src/views/article/article.vue b/src/views/article/article.vue
index adbc046..f3324f7 100644
--- a/src/views/article/article.vue
+++ b/src/views/article/article.vue
@@ -92,6 +92,11 @@
     getNoticePd,
     upcommentPd
   } from "@/api/discuss/publicDiscuss";
+
+  import {
+    getDistrictTree
+  } from "@/api/district/index";
+
   import {
     mapGetters
   } from "vuex";
@@ -182,6 +187,20 @@
                 message: "请输入资讯类型",
                 trigger: "blur",
               }, ],
+            }, {
+              label: "资讯范围",
+              prop: "articleList",
+              span: 12,
+              minRows: 2,
+              type: "cascader",
+              multiple: true,
+              tags: true,
+              dicData: [],
+              props: {
+                label: "name",
+                value: 'id'
+              },
+              hide: true,
             },
             {
               label: "资讯类型",
@@ -527,6 +546,7 @@
             // },
           ]
         },
+        districtTree: [],
       };
     },
     watch: {
@@ -616,6 +636,7 @@
           row.videoUrl = "";
         }
         row.userid = this.userInfo.user_id;
+        row.articleRange = JSON.stringify(row.articleList)
         add(row).then(
           () => {
             this.onLoad(this.page);
@@ -632,6 +653,7 @@
         );
       },
       rowUpdate(row, index, done, loading) {
+        row.articleRange = JSON.stringify(row.articleList)
         update(row).then(
           () => {
             this.onLoad(this.page);
@@ -706,7 +728,8 @@
       beforeOpen(done, type) {
         if (["edit", "view"].includes(type)) {
           getNotice(this.form.id).then((res) => {
-            this.form = res.data.data;
+            let data = res.data.data
+            this.form = data;
           });
         }
         // con
@@ -745,6 +768,13 @@
           this.loading = false;
           this.selectionClear();
         });
+        getDistrictTree(params = {}).then((res) => {
+          const data = res.data.data;
+          this.districtTree = data;
+          const column = this.findObject(this.option.column, "articleList");
+          column.dicData = res.data.data;
+          this.loading = false;
+        });
       },
       updateFb(row) {
         if (row.publish == "0") {

--
Gitblit v1.9.3