|
@@ -3,6 +3,7 @@ import RoleEdit from '@/components/RoleEdit.vue';
|
|
|
import { statusOptions } from '@/model/options';
|
|
import { statusOptions } from '@/model/options';
|
|
|
|
|
|
|
|
import type { RoleModel, RoleQuery } from '@/model/system.model';
|
|
import type { RoleModel, RoleQuery } from '@/model/system.model';
|
|
|
|
|
+import { usePermission } from '@/core/usePermission';
|
|
|
|
|
|
|
|
import { deleteRoleMethod, rolesMethod, updateRoleStatusMethod } from '@/request/api/system.api';
|
|
import { deleteRoleMethod, rolesMethod, updateRoleStatusMethod } from '@/request/api/system.api';
|
|
|
import { usePagination } from 'alova/client';
|
|
import { usePagination } from 'alova/client';
|
|
@@ -85,6 +86,7 @@ const gridOptions = reactive<VxeGridProps<RoleModel>>({
|
|
|
props: {
|
|
props: {
|
|
|
openLabel: '启用', openValue: '0',
|
|
openLabel: '启用', openValue: '0',
|
|
|
closeLabel: '停用', closeValue: '1',
|
|
closeLabel: '停用', closeValue: '1',
|
|
|
|
|
+ disabled: !usePermission('system:role:edit').value
|
|
|
},
|
|
},
|
|
|
events: {
|
|
events: {
|
|
|
change({ row, rowIndex }, { value }) {
|
|
change({ row, rowIndex }, { value }) {
|
|
@@ -105,8 +107,8 @@ const gridOptions = reactive<VxeGridProps<RoleModel>>({
|
|
|
mode: 'text',
|
|
mode: 'text',
|
|
|
},
|
|
},
|
|
|
options: [
|
|
options: [
|
|
|
- { content: '修改', status: 'warning', name: 'editRole' },
|
|
|
|
|
- { content: '删除', status: 'error', name: 'deleteRole' },
|
|
|
|
|
|
|
+ { content: '修改', status: 'warning', name: 'editRole', permissionCode: 'system:role:edit' },
|
|
|
|
|
+ { content: '删除', status: 'error', name: 'deleteRole', permissionCode: 'system:role:remove' },
|
|
|
],
|
|
],
|
|
|
events: {
|
|
events: {
|
|
|
click({ row, rowIndex }, { name }) {
|
|
click({ row, rowIndex }, { name }) {
|
|
@@ -211,7 +213,7 @@ function editRole(model?: RoleModel, index?: number) {
|
|
|
<main class="flex-auto overflow-hidden">
|
|
<main class="flex-auto overflow-hidden">
|
|
|
<vxe-grid ref="gridRef" v-bind="gridOptions" v-on="gridEvents" :loading="loading">
|
|
<vxe-grid ref="gridRef" v-bind="gridOptions" v-on="gridEvents" :loading="loading">
|
|
|
<template #handle>
|
|
<template #handle>
|
|
|
- <vxe-button status="primary" @click="editRole()">新增</vxe-button>
|
|
|
|
|
|
|
+ <vxe-button status="primary" permission-code="system:role:add" @click="editRole()">新增</vxe-button>
|
|
|
</template>
|
|
</template>
|
|
|
<template #toolbar-extra>
|
|
<template #toolbar-extra>
|
|
|
<vxe-button style="margin-right: 12px;" icon="vxe-icon-repeat" circle @click="refresh(page)"></vxe-button>
|
|
<vxe-button style="margin-right: 12px;" icon="vxe-icon-repeat" circle @click="refresh(page)"></vxe-button>
|