From 7371051db9b19381f42165153d17758a90d68f33 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期日, 29 十月 2023 00:24:36 +0800
Subject: [PATCH] 修改主数据按钮查询权限接口,VciBaseUtil中增加校验当前用户是否为配置的超管用户方法
---
Source/UBCS-WEB/src/views/authority/apiscope.vue | 82 ++++++++++++++++++++++++++---------------
1 files changed, 52 insertions(+), 30 deletions(-)
diff --git a/Source/UBCS-WEB/src/views/authority/apiscope.vue b/Source/UBCS-WEB/src/views/authority/apiscope.vue
index 0163862..b30547a 100644
--- a/Source/UBCS-WEB/src/views/authority/apiscope.vue
+++ b/Source/UBCS-WEB/src/views/authority/apiscope.vue
@@ -1,28 +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"
- @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)">鏉冮檺閰嶇疆
@@ -50,12 +52,14 @@
:before-open="beforeOpenScope"
@search-change="searchChangeScope"
@search-reset="searchResetScope"
+ @row-click="clickRowChangeResetScope"
@selection-change="selectionChangeScope"
@current-change="currentChangeScope"
@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
@@ -111,8 +115,9 @@
menu: true,
option: {
lazy: true,
+ columnBtn:false,
tip: false,
- simplePage: true,
+ //simplePage: true,
searchShow: true,
searchMenuSpan: 6,
dialogWidth: "60%",
@@ -154,7 +159,7 @@
label: "涓婄骇鑿滃崟",
prop: "parentId",
type: "tree",
- dicUrl: "/api/blade-system/menu/tree",
+ dicUrl: "/api/ubcs-system/menu/tree",
hide: true,
props: {
label: "title"
@@ -348,7 +353,7 @@
{
label: "鎺ュ彛绫诲瀷",
type: "select",
- dicUrl: "/api/blade-system/dict/dictionary?code=api_scope_type",
+ dicUrl: "/api/ubcs-system/dict/dictionary?code=api_scope_type",
props: {
label: "dictValue",
value: "dictKey"
@@ -379,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() {
@@ -457,8 +463,15 @@
this.onLoad(this.page, params);
done();
},
+ clickRowChange(row){
+ this.$refs.crud.toggleSelection();
+ this.selectionList = row;
+ this.$refs.crud.setCurrentRow(row);
+ this.$refs.crud.toggleRowSelection(row); //閫変腑褰撳墠琛�
+ },
selectionChange(list) {
this.selectionList = list;
+ this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]);
},
selectionClear() {
this.selectionList = [];
@@ -505,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();
});
@@ -514,7 +529,7 @@
treeLoad(tree, treeNode, resolve) {
const parentId = tree.id;
getLazyMenuList(parentId).then(res => {
- resolve(res.data.data);
+ resolve(res.data.data.records);
});
},
// 鏁版嵁鏉冮檺妯″潡
@@ -615,8 +630,15 @@
this.onLoadScope(this.pageScope, params);
done();
},
+ clickRowChangeResetScope(row){
+ this.$refs.crudScope.toggleSelection();
+ this.selectionList = row;
+ this.$refs.crudScope.setCurrentRow(row);
+ this.$refs.crudScope.toggleRowSelection(row); //閫変腑褰撳墠琛�
+ },
selectionChangeScope(list) {
this.selectionListScope = list;
+ this.$refs.crudScope.setCurrentRow(this.selectionList[list.length-1]);
},
currentChangeScope(currentPage) {
this.pageScope.currentPage = currentPage;
--
Gitblit v1.9.3