src/views/desk/notification.vue
@@ -2,7 +2,8 @@
  <basic-container
    :class="[
      'desk1',
      $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
      $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
      $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : ''
    ]"
  >
    <!-- 
@@ -25,6 +26,7 @@
...this.$store.state.control.changePageSize,
   -->
    <avue-crud
      class="tablesss"
      :option="option"
      :table-loading="loading"
      :data="data"
@@ -102,7 +104,7 @@
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize,
        ...this.$store.state.control.changePageSize
      },
      selectionList: [],
      option: {
@@ -137,9 +139,9 @@
              {
                required: true,
                message: "请输入通知标题",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
            label: "封面",
@@ -151,10 +153,10 @@
            action: "/api/blade-resource/oss/endpoint/put-file",
            propsHttp: {
              res: "data",
              url: "link",
              url: "link"
            },
            // hide: true,
            span: 24,
            span: 24
          },
          // {
          //   label: "类型",
@@ -187,7 +189,7 @@
            dicUrl: "/api/blade-system/dept/lazy-tree",
            props: {
              label: "title",
              value: "id",
              value: "id"
            },
            addDisplay: false,
            editDisplay: false,
@@ -195,9 +197,9 @@
              {
                required: true,
                message: "所属组织机构",
                trigger: "click",
              },
            ],
                trigger: "click"
              }
            ]
          },
          {
            label: "发布时间",
@@ -215,9 +217,9 @@
              {
                required: true,
                message: "请输入发布时间",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
            label: "发布时间",
@@ -229,9 +231,9 @@
              {
                required: true,
                message: "请输入发布时间",
                trigger: "click",
              },
            ],
                trigger: "click"
              }
            ]
          },
          {
            label: "发布内容",
@@ -241,16 +243,16 @@
              action: "/api/blade-resource/oss/endpoint/put-file",
              props: {
                res: "data",
                url: "link",
              },
                url: "link"
              }
            },
            hide: true,
            minRows: 4,
            span: 24,
          },
        ],
            span: 24
          }
        ]
      },
      data: [],
      data: []
    };
  },
  computed: {
@@ -260,28 +262,29 @@
        addBtn: this.vaildData(this.permission.notice_add, false),
        viewBtn: this.vaildData(this.permission.notice_view, false),
        delBtn: this.vaildData(this.permission.notice_delete, false),
        editBtn: this.vaildData(this.permission.notice_edit, false),
        editBtn: this.vaildData(this.permission.notice_edit, false)
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
    ...mapState({
      userInfo: (state) => state.user.userInfo,
    }),
      userInfo: state => state.user.userInfo
    })
  },
  mounted() {
    this.getDeptInfo(this.userInfo.dept_id);
    this.$store.commit("setWindowSizeHeightAdd");
  },
  methods: {
    //获取当前用户部门信息
    getDeptInfo(deptId) {
      var that = this;
      getDept(deptId).then((res) => {
      getDept(deptId).then(res => {
        var deptCategory = res.data.data.deptCategory;
        deptCategory == 1
          ? (that.deptCategory = true)
@@ -294,8 +297,8 @@
        path: `/resource/uploadNotification`,
        query: {
          deptId: row.deptId,
          noticeId: row.id,
        },
          noticeId: row.id
        }
      });
    },
    rowSave(row, done, loading) {
@@ -306,11 +309,11 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -323,11 +326,11 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -337,7 +340,7 @@
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
@@ -346,7 +349,7 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
        });
    },
@@ -375,7 +378,7 @@
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
@@ -384,14 +387,14 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          this.$refs.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getNotice(this.form.id).then((res) => {
        getNotice(this.form.id).then(res => {
          this.form = res.data.data;
        });
      }
@@ -413,7 +416,7 @@
      //获取当前用户部门信息,判断是否为公安,如果是公安,则只能查看公告信息
      var that = this;
      getDept(this.deptId).then((res) => {
      getDept(this.deptId).then(res => {
        var deptCategory = res.data.data.deptCategory;
        deptCategory == 1
          ? (that.deptCategory = true)
@@ -425,36 +428,36 @@
          this.userInfo.role_name == "保安" ||
          this.userInfo.role_name == "装备管理员"
        ) {
          params['deptId'] = this.userInfo.dept_id;
          params["deptId"] = this.userInfo.dept_id;
        }
        const { releaseTimeRange } = this.query;
        params["jurisdiction"] = this.jurisdiction;
        params["type"] = 3;
        let values = {
          ...params,
          ...params
        };
        if (releaseTimeRange) {
          values = {
            ...params,
            startTime: releaseTimeRange[0],
            endTime: releaseTimeRange[1],
            ...this.query,
            ...this.query
          };
          values.releaseTimeRange = null;
        }
        this.loading = true;
        getListPage(page.currentPage, page.pageSize, values).then((res) => {
        getListPage(page.currentPage, page.pageSize, values).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.$store.commit("setWindowSizeHeightAdd");
          this.selectionClear();
        });
      });
    },
  },
    }
  }
};
</script>
<style>
</style>
<style></style>