Source/UBCS-WEB/src/views/authority/apiscope.vue
@@ -1,29 +1,30 @@
<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               ref="crud"
               v-model="form"
               :permission="permissionList"
               :before-open="beforeOpen"
               @row-del="rowDel"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @search-change="searchChange"
               @search-reset="searchReset"
               @row-click="clickRowChange"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad"
               @tree-load="treeLoad">
      :table-loading="loading"
      :page.sync="page"
      :data="data"
      ref="crud"
      v-model="form"
      :permission="permissionList"
      :before-open="beforeOpen"
      @row-del="rowDel"
      @row-update="rowUpdate"
      @row-save="rowSave"
      @search-change="searchChange"
      @search-reset="searchReset"
      @row-click="clickRowChange"
      @selection-change="selectionChange"
      @current-change="currentChange"
      @size-change="sizeChange"
      @refresh-change="refreshChange"
      @on-load="onLoad"
      @tree-load="treeLoad">
      <template slot-scope="{row}" slot="menu">
        <el-button type="text"
        <el-button v-if="permissionList.settingBtn"
                   type="text"
                   icon="el-icon-setting"
                   size="small"
                   v-if="permission.api_scope_setting"
                   plain
                   style="border: 0;background-color: transparent !important;"
                   @click.stop="handleDataScope(row)">权限配置
@@ -57,7 +58,8 @@
                   @size-change="sizeChangeScope"
                   @on-load="onLoadScope">
          <template slot="menuLeft">
            <el-button type="danger"
            <el-button v-if="permissionList.delBtn"
                       type="danger"
                       size="small"
                       icon="el-icon-delete"
                       plain
@@ -113,8 +115,9 @@
        menu: true,
        option: {
          lazy: true,
          columnBtn:false,
          tip: false,
          simplePage: true,
          //simplePage: true,
          searchShow: true,
          searchMenuSpan: 6,
          dialogWidth: "60%",
@@ -381,10 +384,11 @@
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.menu_add, false),
          viewBtn: this.vaildData(this.permission.menu_view, false),
          delBtn: this.vaildData(this.permission.menu_delete, false),
          editBtn: this.vaildData(this.permission.menu_edit, false)
          addBtn: this.vaildData(this.permission.api_scope.api_scope_add, false),
          viewBtn: this.vaildData(this.permission.api_scope.api_scope_view, false),
          delBtn: this.vaildData(this.permission.api_scope.api_scope_delete, false),
          editBtn: this.vaildData(this.permission.api_scope.mapi_scope_edit, false),
          settingBtn: this.vaildData(this.permission.api_scope.api_scope_setting,false),
        };
      },
      ids() {
@@ -514,8 +518,10 @@
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => {
          this.data = res.data.data;
        getLazyMenuList(this.parentId, Object.assign(params, this.query), page.currentPage, page.pageSize).then(res => {
          const data = res.data.data;
          this.data = data.records;
          this.page.total = data.total;
          this.loading = false;
          this.selectionClear();
        });
@@ -523,7 +529,7 @@
      treeLoad(tree, treeNode, resolve) {
        const parentId = tree.id;
        getLazyMenuList(parentId).then(res => {
          resolve(res.data.data);
          resolve(res.data.data.records);
        });
      },
      // 数据权限模块