linwe
2023-12-01 74e2a0314d3edb84c0af444a53d2851c132f2b10
资讯添加范围
2 files modified
41 ■■■■■ changed files
src/api/district/index.js 9 ●●●●● patch | view | raw | blame | history
src/views/article/article.vue 32 ●●●●● patch | view | raw | blame | history
src/api/district/index.js
@@ -47,3 +47,12 @@
    }
  })
}
export const getDistrictTree = (params) => {
  return request({
    url: '/api/blade-district/district/getDistrictTree',
    method: 'get',
    params: {
      ...params
    }
  })
}
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") {