田源
2024-12-16 dc861690e468ed4c7123673dca6415581ce2cbb0
日志管理模块页面按钮权限
已修改2个文件
56 ■■■■ 文件已修改
Source/plt-web/plt-web-ui/src/views/system/log/basicConf.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/log/index.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/log/basicConf.vue
@@ -4,8 +4,12 @@
    <el-main>
      <basic-container>
        <div style="margin: 0 0 10px 20px">
          <el-button v-if="form.delType==0" icon="el-icon-check" size="small" type="primary" @click="saveHandler">保存</el-button>
          <el-button v-else icon="el-icon-delete" size="small" type="danger" @click="delHandler">删除</el-button>
          <el-button v-if="form.delType == 0 && permissionList.saveBtn" icon="el-icon-check" size="small" type="primary"
                     @click="saveHandler">保存
          </el-button>
          <el-button v-if="form.delType != 0 && permissionList.delBtn" icon="el-icon-delete" size="small" type="danger"
                     @click="delHandler">删除
          </el-button>
        </div>
        <avue-form ref="form" v-model="form" :option="formOption"></avue-form>
        <div class="tip">
@@ -22,6 +26,8 @@
<script>
import {getPeroid,savePeriod,deleteLog} from "@/api/system/log/logBasic";
import {mapGetters} from "vuex";
export default {
  name: "basicConf",
  data: function () {
@@ -74,6 +80,15 @@
        }]
      },
    }
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        saveBtn: this.vaildData(this.permission[this.$route.query.id].save, false),
        delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
      };
    },
  },
  created() {
    this.getPeroid();
@@ -132,6 +147,7 @@
  color: #909399;
  margin: 0 0 10px 20px;
}
.tip div{
  margin-left: 30px;
}
Source/plt-web/plt-web-ui/src/views/system/log/index.vue
@@ -15,7 +15,9 @@
      @current-change="currentChange"
    >
      <template slot="menuLeft" slot-scope="scope">
        <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出</el-button>
        <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary"
                   @click="exportClickHandler">导出
        </el-button>
      </template>
    </avue-crud>
  </basic-container>
@@ -25,6 +27,7 @@
import basicOption from "@/util/basic-option";
import {getLogListByContion,getOperatingUsers,exportLog} from "@/api/system/log/logBasic";
import func from "@/util/func";
import {mapGetters} from "vuex";
export default {
  name: "index",
@@ -111,11 +114,25 @@
      this.getTableList();
    }
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false),
      };
    },
  },
  created() {
    console.log(this.$route.query.id)
  },
  methods: {
    // 表格请求
    getTableList() {
      this.tableLoading = true;
      getLogListByContion(this.page.currentPage, this.page.pageSize, {'logType': this.$route.query.logType,'roleType':this.$route.query.roleType, ...this.searchParams}).then(res => {
      getLogListByContion(this.page.currentPage, this.page.pageSize, {
        'logType': this.$route.query.logType,
        'roleType': this.$route.query.roleType, ...this.searchParams
      }).then(res => {
        this.tableData = res.data.data;
        this.page.total = res.data.total;
        this.tableLoading = false;
@@ -157,7 +174,12 @@
    // 导出
    exportClickHandler() {
      const loading = this.$loading({});
      exportLog({'pageNo':1,'pageSize':-1,'logType': this.$route.query.logType,'roleType':this.$route.query.roleType, ...this.searchParams}).then(res => {
      exportLog({
        'pageNo': 1,
        'pageSize': -1,
        'logType': this.$route.query.logType,
        'roleType': this.$route.query.roleType, ...this.searchParams
      }).then(res => {
        func.downloadFileByBlobHandler(res);
        this.createdLoading = false
        this.$message.success('导出成功');
@@ -170,8 +192,12 @@
        row,
        this.$refs.logCrud,
        this.lastIndex,
        (newIndex) => { this.lastIndex = newIndex; },
        () => { this.selectList = []; }
        (newIndex) => {
          this.lastIndex = newIndex;
        },
        () => {
          this.selectList = [];
        }
      );
    },
  }