src/views/desk/policyRelease.vue
@@ -2,10 +2,12 @@
  <basic-container
    :class="[
      'desk1',
      $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
      $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
      $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : ''
    ]"
  >
    <avue-crud
      class="tablesss"
      :option="option"
      :table-loading="loading"
      :data="data"
@@ -83,7 +85,7 @@
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize,
        ...this.$store.state.control.changePageSize
      },
      selectionList: [],
      option: {
@@ -118,9 +120,9 @@
              {
                required: true,
                message: "请输入通知标题",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
            label: "封面",
@@ -132,10 +134,10 @@
            action: "/api/blade-resource/oss/endpoint/put-file",
            propsHttp: {
              res: "data",
              url: "link",
              url: "link"
            },
            // hide: true,
            span: 24,
            span: 24
          },
          // {
          //   label: "类型",
@@ -168,7 +170,7 @@
            dicUrl: "/api/blade-system/dept/lazy-tree",
            props: {
              label: "title",
              value: "id",
              value: "id"
            },
            addDisplay: false,
            editDisplay: false,
@@ -176,9 +178,9 @@
              {
                required: true,
                message: "所属组织机构",
                trigger: "click",
              },
            ],
                trigger: "click"
              }
            ]
          },
          {
            label: "发布时间",
@@ -196,9 +198,9 @@
              {
                required: true,
                message: "请输入发布时间",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
            label: "发布时间",
@@ -210,9 +212,9 @@
              {
                required: true,
                message: "请输入发布时间",
                trigger: "click",
              },
            ],
                trigger: "click"
              }
            ]
          },
          {
            label: "发布内容",
@@ -222,16 +224,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: {
@@ -241,28 +243,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)
@@ -275,8 +278,8 @@
        path: `/resource/uploadPolicyRelease`,
        query: {
          deptId: row.deptId,
          noticeId: row.id,
        },
          noticeId: row.id
        }
      });
    },
    rowSave(row, done, loading) {
@@ -287,11 +290,11 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -304,11 +307,11 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -318,7 +321,7 @@
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
@@ -327,7 +330,7 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
        });
    },
@@ -356,7 +359,7 @@
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
@@ -365,14 +368,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;
        });
      }
@@ -394,7 +397,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)
@@ -406,36 +409,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"] = 2;
        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>