Administrator
2021-08-06 f8159c1dbb2ffbc0de9d4d13e9b0e0dcc8a95d31
src/views/desk/notice.vue
@@ -1,5 +1,5 @@
<template>
  <basic-container class="desk">
  <basic-container class="desk1">
    <avue-crud
      :option="option"
      :table-loading="loading"
@@ -27,7 +27,6 @@
          size="small"
          icon="el-icon-delete"
          plain
          v-if="deptCategory"
          @click="handleDelete"
          >删 除
        </el-button>
@@ -38,19 +37,18 @@
      </template>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          v-if="deptCategory"
          :size="size"
          :type="type"
          @click="handleUploadPage(row)"
          >附件上传
        </el-button>
        <el-button
        <!-- <el-button
          v-if="!deptCategory"
          :size="size"
          :type="type"
          @click="handleUploadPage(row)"
          >附件查看
        </el-button>
        </el-button> -->
      </template>
    </avue-crud>
  </basic-container>
@@ -125,6 +123,7 @@
            defaultValue: "1",
            prop: "category",
            search: true,
            searchSpan:5,
            rules: [
              {
                required: true,
@@ -210,10 +209,10 @@
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permissionAdd, false),
        viewBtn: this.vaildData(this.permissionView, false),
        delBtn: this.vaildData(this.permissionDelete, false),
        editBtn: this.vaildData(this.permissionEdit, false),
        addBtn: this.vaildData(this.permissionAdd, true),
        viewBtn: this.vaildData(this.permissionView, true),
        delBtn: this.vaildData(this.permissionDelete, true),
        editBtn: this.vaildData(this.permissionEdit, true),
      };
    },
    ids() {
@@ -235,12 +234,12 @@
          ? (that.deptCategory = true)
          : (that.deptCategory = false);
        if (that.deptCategory) {
        // if (that.deptCategory) {
          that.permissionAdd = this.permission.notice_add;
          that.permissionView = this.permission.notice_view;
          that.permissionDelete = this.permission.notice_delete;
          that.permissionEdit = this.permission.notice_edit;
        }
        // }
      });
    },
    //跳转到附近列表页面
@@ -374,18 +373,18 @@
          ? (that.deptCategory = true)
          : (that.deptCategory = false);
        if (that.deptCategory) {
        // if (that.deptCategory) {
          that.permissionAdd = this.permission.notice_add;
          that.permissionView = this.permission.notice_view;
          that.permissionDelete = this.permission.notice_delete;
          that.permissionEdit = this.permission.notice_edit;
        }
        // }
        const { releaseTimeRange } = this.query;
        if (that.deptCategory) {
        // if (that.deptCategory) {
          params["deptId"] = this.deptId;
          params["jurisdiction"] = this.jurisdiction;
        }
        // }
        let values = {
          ...params,
        };
@@ -403,18 +402,18 @@
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.data.forEach((item) => {
            if (item.category == 2) {
              that.option.addBtn = false;
              that.option.editBtn = false;
              that.option.delBtn = false;
            }
            if (item.category == 1) {
              that.option.addBtn = true;
              that.option.editBtn = true;
              that.option.delBtn = true;
            }
          });
          // this.data.forEach((item) => {
          //   if (item.category == 2) {
          //     that.option.addBtn = false;
          //     that.option.editBtn = false;
          //     that.option.delBtn = false;
          //   }
          //   if (item.category == 1) {
          //     that.option.addBtn = true;
          //     that.option.editBtn = true;
          //     that.option.delBtn = true;
          //   }
          // });
          this.loading = false;
          this.selectionClear();
        });