@yqg/permission 1.3.0-alpha.2 → 1.3.0-alpha.3

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": "@yqg/permission",
3
- "version": "1.3.0-alpha.2",
3
+ "version": "1.3.0-alpha.3",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "type": "module",
package/src/App.vue CHANGED
@@ -9,13 +9,7 @@ const color = ref<string>('#1677ff');
9
9
  const locale = ref<LocaleType>('zh-CN');
10
10
 
11
11
  const permissions = reactive([
12
- 'CRANE.PERMISSION.QUERY',
13
- 'CRANE.PERMISSION.CREATE',
14
- 'CRANE.PERMISSION.UPDATE',
15
- 'CRANE.PERMISSION.DELETE',
16
- 'CRANE.PERMISSION.DETAIL_QUERY',
17
- 'CRANE.PERMISSION.ROLE_ASSIGN',
18
- 'CRANE.PERMISSION.EXPORT',
12
+ 'yewei0313.REAQS22.DEPAWED_ANQ22.QUERY22',
19
13
  ]);
20
14
  // const permissions = reactive(['CRANE.BUSINESS.QUERY', 'RANE.BUSINESS.CREATE', 'CRANE.BUSINESS.UPDATE', 'CRANE.BUSINESS.DELETE']);
21
15
  const changeColor = () => {
@@ -70,8 +70,8 @@
70
70
  <span v-if="checkedKeys.includes(item.feature)" class="crane-weak-color crane-margin-left-12">
71
71
  {{ t('availableTime') }}:
72
72
  <Select v-model:value="validTime" style="width: 100px"
73
- :disabled="DISABLED_STATUS.includes(item.businessApplyType)"
74
- :options="DISABLED_STATUS.includes(item.businessApplyType) ? validTimeOptions : tempTimeOptions"
73
+ :disabled="item.businessApplyType === OWNER_STATUS"
74
+ :options="item.businessApplyType === OWNER_STATUS ? validTimeOptions : tempTimeOptions"
75
75
  @change="onChangeTimeHandler" size="small">
76
76
  </Select>
77
77
  </span>
@@ -87,8 +87,6 @@ import categoryImg from '@/assets/category.png';
87
87
  import t from '../utils';
88
88
 
89
89
  const OWNER_STATUS = 'OWNER';
90
- const PENDING_STATUS = 'PENDING';
91
- const DISABLED_STATUS = [OWNER_STATUS, PENDING_STATUS];
92
90
 
93
91
  const levelMap:LevelMapType = {
94
92
  L1: {
@@ -139,12 +137,9 @@ const tempTimeOptions = computed(() => {
139
137
  //1登录人所在部门 = 权限适用范围,都默认90天,不需要区分等级和类型,
140
138
  //2登录人所在部门 ≠ 权限适用范围,根据等级来,高(L3)默认给7天,中(L2)默认给30天,低(L1)默认给60天
141
139
  const setDefaultTime = (item: PermissionType) => {
142
- if (OWNER_STATUS.includes(item.businessApplyType)) {
140
+ if (item.businessApplyType === OWNER_STATUS) {
143
141
  return item.virtualOwnState?.timeStatus
144
142
  }
145
- if (PENDING_STATUS.includes(item.businessApplyType)) {
146
- return item.pendingValidTime
147
- }
148
143
  const validMap = {
149
144
  L1: 'SIXTY_DAYS',
150
145
  L2: 'THIRTY_DAYS',
@@ -20,11 +20,11 @@ export default function useFormat(tree: PermissionListType) {
20
20
  if (!node.children || node.children.length === 0) {
21
21
  node.categoryVOS = (node.categoryVOS || []).filter((item: any) => item.configWay !== Category.AUTO);
22
22
 
23
- if ([StatusType.NO].includes(node.businessApplyType)) {
23
+ if ([StatusType.NO, StatusType.PENDING].includes(node.businessApplyType)) {
24
24
  node.disabled = true;
25
25
  }
26
26
 
27
- if ([StatusType.OWNER, StatusType.PENDING].includes(node.businessApplyType) && !node.categoryVOS.length) {
27
+ if ([StatusType.OWNER].includes(node.businessApplyType) && !node.categoryVOS.length) {
28
28
  node.disabled = true;
29
29
  }
30
30
  } else {
package/src/main.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { createApp } from 'vue';
2
2
  import App from './App.vue';
3
3
  import './style.css';
4
- // import yqgPermission from './yqg-permission';
5
- import yqgPermission from '../dist';
4
+ import yqgPermission from './yqg-permission';
5
+ // import yqgPermission from '../dist';
6
6
  yqgPermission.init();
7
7
 
8
8
  const app = createApp(App);