@skyfox2000/webui 1.0.9 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyfox2000/webui",
3
- "version": "1.0.9",
3
+ "version": "1.0.12",
4
4
  "description": "后台前端通用组件定义",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -34,7 +34,7 @@
34
34
  "peerDependencies": {
35
35
  "@skyfox2000/fapi": "^1.1.19",
36
36
  "@skyfox2000/microbase": "^1.0.15",
37
- "@skyfox2000/webbase": "^1.1.15",
37
+ "@skyfox2000/webbase": "^1.1.17",
38
38
  "ant-design-vue": "^4.2.6",
39
39
  "dayjs": "^1.11.13",
40
40
  "pinia": "^2.3.0",
@@ -9,6 +9,7 @@ import {
9
9
  gridQueryList,
10
10
  GridControl,
11
11
  filterColumns,
12
+ AppRouter,
12
13
  } from '@skyfox2000/webbase';
13
14
  import TableOperate from './tableOperate.vue';
14
15
  import Toolbar from '../toolbar/index.vue';
@@ -198,8 +199,7 @@ onMounted(async () => {
198
199
  <template v-if="gridCtrl && bodyCell?.column?.dataIndex === 'enabled'">
199
200
  <Switch
200
201
  v-model:checked="bodyCell.record.Enabled"
201
- v-role="['Super', 'Admin']"
202
- v-permit:disable="':enabled'"
202
+ v-auth:disable="{ url: AppRouter.currentRoute.value.path, role: ['Super', 'Admin'], permit: ':enabled' }"
203
203
  :disabled="statusDisabled ? statusDisabled(bodyCell.record) : false"
204
204
  :data="OPTIONS.EnableDisable"
205
205
  @click="gridStatusUpdate(gridCtrl, bodyCell.record)"
@@ -8,6 +8,7 @@ import {
8
8
  onGridRowEdit,
9
9
  onGridRowDelete,
10
10
  GridControl,
11
+ AppRouter,
11
12
  } from '@skyfox2000/webbase';
12
13
  import { ConfigProvider, Button, Space, DropdownButton, Menu, MenuItem, Popconfirm } from 'ant-design-vue';
13
14
 
@@ -31,6 +32,7 @@ const defaultOperates: ButtonTool[] = [
31
32
  label: '编辑',
32
33
  type: 'primary',
33
34
  visible: true,
35
+ role: ['Super', 'Admin'],
34
36
  permit: ':edit',
35
37
  click: () => onGridRowEdit<T>(gridCtrl, props.record as T),
36
38
  },
@@ -40,6 +42,7 @@ const defaultOperates: ButtonTool[] = [
40
42
  type: 'primary',
41
43
  visible: true,
42
44
  danger: true,
45
+ role: ['Super', 'Admin'],
43
46
  permit: ':delete',
44
47
  confirm: true,
45
48
  confirmText: '是否删除此记录?',
@@ -93,8 +96,7 @@ const disabled = (item: ButtonTool): boolean => {
93
96
  :danger="item.danger"
94
97
  v-if="getToolVisible(item, props.record)"
95
98
  :disabled="disabled(item)"
96
- v-role="item.role"
97
- v-permit="item.permit"
99
+ v-auth="{ url: AppRouter.currentRoute.value.path, role: item.role, permit: item.permit }"
98
100
  @click="onToolClicked(item, gridCtrl.page, gridCtrl, props.record)"
99
101
  size="small"
100
102
  :style="{
@@ -115,8 +117,7 @@ const disabled = (item: ButtonTool): boolean => {
115
117
  <MenuItem
116
118
  v-if="getToolVisible(item, props.record)"
117
119
  :disabled="disabled(item)"
118
- v-role="item.role"
119
- v-permit="item.permit"
120
+ v-auth="{ url: AppRouter.currentRoute.value.path, role: item.role, permit: item.permit }"
120
121
  @click="onToolClicked(item, gridCtrl.page, gridCtrl, props.record)"
121
122
  >
122
123
  {{ item.label }}
@@ -7,6 +7,7 @@ import {
7
7
  getToolStatus,
8
8
  onToolClicked,
9
9
  openNewForm,
10
+ AppRouter,
10
11
  } from '@skyfox2000/webbase';
11
12
  import { Dropdown, Menu, MenuItem, Space } from 'ant-design-vue';
12
13
  import { Button } from '../../common';
@@ -35,6 +36,7 @@ const defaultButtons: ButtonTool[] = [
35
36
  type: 'primary',
36
37
  icon: 'icon-new',
37
38
  danger: true,
39
+ role: ['Super', 'Admin'],
38
40
  permit: ':new', // 默认仅受权限码控制
39
41
  click: () => {
40
42
  return openNewForm(editorCtrl);
@@ -74,8 +76,7 @@ watch(
74
76
  :danger="item.danger"
75
77
  :disabled="getToolStatus(item)"
76
78
  :icon="item.icon"
77
- v-role="item.role"
78
- v-permit="item.permit"
79
+ v-auth="{ url: AppRouter.currentRoute.value.path, role: item.role, permit: item.permit }"
79
80
  @click="onToolClicked(item, pageCtrl, gridCtrl)"
80
81
  >
81
82
  {{ item.label }}
@@ -87,8 +88,7 @@ watch(
87
88
  v-for="item in ToolbarMenus"
88
89
  :key="item.key"
89
90
  :disabled="getToolStatus(item)"
90
- v-role="item.role"
91
- v-permit="item.permit"
91
+ v-auth="{ url: AppRouter.currentRoute.value.path, role: item.role, permit: item.permit }"
92
92
  @click="onToolClicked(item, pageCtrl, gridCtrl)"
93
93
  >
94
94
  {{ item.label }}