@yqg/permission 1.3.0 → 1.3.1-1.beta.0
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/dist/{apply-modal-Ct9rKeUf.js → apply-modal-B4niAWln.js} +3882 -4161
- package/dist/{category-selector-BnUMBDty.js → category-selector-CJ2VLSr7.js} +81 -81
- package/dist/{index-XvlOgi6s.js → index-CJ_Ktj6t.js} +1828 -1836
- package/dist/{index-CAVNFmBo.js → index-CZ6UV6_X.js} +4 -4
- package/dist/index.js +2 -2
- package/dist/permission-item-Bm9OiOSx.js +1252 -0
- package/dist/{yqg-permission-BrOMv4sA.js → yqg-permission-Cb-_sywm.js} +3738 -3696
- package/dist/yqg-permission.umd.js +65 -65
- package/package.json +9 -10
- package/src/App.vue +10 -13
- package/src/axios/index.ts +1 -1
- package/src/components/apply-modal.vue +162 -75
- package/src/components/approval-steps.vue +39 -40
- package/src/components/category-selector.vue +27 -12
- package/src/components/permission-item.vue +49 -37
- package/src/components/success-modal.vue +45 -45
- package/src/components/yqg-permission.vue +169 -144
- package/src/hooks/useAttributesCache.ts +23 -1
- package/src/hooks/useCategory.ts +2 -1
- package/src/hooks/useFormat.ts +20 -7
- package/src/i18n/en-US.ts +50 -50
- package/src/i18n/in-ID.ts +57 -0
- package/src/i18n/index.ts +5 -2
- package/src/i18n/zh-CH.ts +4 -10
- package/src/style/reset.css +3 -0
- package/src/typings/index.d.ts +8 -0
- package/src/utils/index.ts +16 -2
- package/src/yqg-permission/react.js +0 -0
- package/tsconfig.app.json +8 -8
- package/dist/permission-item-2JurQrn-.js +0 -1250
package/src/i18n/zh-CH.ts
CHANGED
|
@@ -3,8 +3,9 @@ export default {
|
|
|
3
3
|
applyPermission: '申请权限',
|
|
4
4
|
applyReason: '申请理由',
|
|
5
5
|
approvalProcess: '审批流程',
|
|
6
|
+
isAllOwnTips: '当前页面权限已拥有或审批中,无需申请',
|
|
6
7
|
applyReasonPlaceholder: '请尽可能详细说明申请原因和使用场景,不要只填写“工作需要”之类的理由,以免影响你获取权限的审批时间。',
|
|
7
|
-
applyReasonTips: '
|
|
8
|
+
applyReasonTips: '模版:因为【】项目/工作,需要查看【】数据,需要【】相关权限。其他需要说明的情况【】',
|
|
8
9
|
cancel: '取消',
|
|
9
10
|
submit: '确定',
|
|
10
11
|
close: '关闭',
|
|
@@ -31,21 +32,14 @@ export default {
|
|
|
31
32
|
maxLengthTips: '最多{length}个字符',
|
|
32
33
|
today: '今天到期',
|
|
33
34
|
clickToApply: '点击申请权限',
|
|
34
|
-
noPermissionTips: '
|
|
35
|
+
noPermissionTips: '该菜单下暂无权限点,无需申请',
|
|
35
36
|
lastDays: '{count}天',
|
|
36
37
|
categoryTips: '当前您所拥有的数据范围如下:',
|
|
37
38
|
empty: '空',
|
|
38
39
|
category: '数据权限',
|
|
39
40
|
categotySelectTips: '上方选中的权限包含数据权限,请根据实际工作需要申请/更改数据范围。',
|
|
40
41
|
categoryChangeTips: '提醒:您选择的数据权限范围较大!请确认实际工作场景是否需要全量「{category}」权限,并在申请理由中写明,避免审批不通过!',
|
|
41
|
-
|
|
42
|
-
SEVEN_DAYS: '7天',
|
|
43
|
-
THIRTY_DAYS: '30天',
|
|
44
|
-
SIXTY_DAYS: '60天',
|
|
45
|
-
NINETY_DAYS: '90天',
|
|
46
|
-
ONE_YEARS: '1年',
|
|
47
|
-
FOREVER: '永久有效',
|
|
48
|
-
},
|
|
42
|
+
deleteCategoryTips: '提醒:已有的数据权限「{categorys}」被删除,将失去该数据权限,请谨慎删除',
|
|
49
43
|
levels: {
|
|
50
44
|
L1: '低',
|
|
51
45
|
L2: '中',
|
package/src/typings/index.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ declare type PermissionType = {
|
|
|
39
39
|
admin?: any[];
|
|
40
40
|
checked?: boolean;
|
|
41
41
|
disabled?: boolean;
|
|
42
|
+
disableCheckbox?: boolean;
|
|
42
43
|
children?: PermissionListType;
|
|
43
44
|
};
|
|
44
45
|
declare type PermissionListType = PermissionType[];
|
|
@@ -75,6 +76,13 @@ declare type CategoryType = {
|
|
|
75
76
|
attributeValueIds?: number[],
|
|
76
77
|
configWay: Category,
|
|
77
78
|
attributeValueIds_view: number[],
|
|
79
|
+
defaultValueIds: number[],
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
declare type AttributeValueType = {
|
|
83
|
+
id: number,
|
|
84
|
+
attributeName: string,
|
|
85
|
+
children?: AttributeValueType[],
|
|
78
86
|
}
|
|
79
87
|
|
|
80
88
|
declare type OptionsType = {
|
package/src/utils/index.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import language from '../i18n';
|
|
2
2
|
|
|
3
|
+
const localkey = 'yqg_permission_sdk_locale';
|
|
4
|
+
|
|
3
5
|
type optionsType = {
|
|
4
6
|
[key: string]: any;
|
|
5
7
|
};
|
|
6
8
|
const t = (key: string, options?: optionsType) => {
|
|
7
9
|
// key的格式为:'xxx.xxx.xxx'//国际化todo
|
|
8
|
-
const en = localStorage.getItem(
|
|
10
|
+
const en = localStorage.getItem(localkey) || 'en';
|
|
9
11
|
const keys = key.split('.');
|
|
10
|
-
let result = language[en as string] || language['en
|
|
12
|
+
let result = language[en as string] || language['en'];
|
|
11
13
|
for (let i = 0; i < keys.length; i++) {
|
|
12
14
|
result = result[keys[i]];
|
|
13
15
|
}
|
|
@@ -54,3 +56,15 @@ export const deepTree = (tree: any[], fn: (item:any) => void) => {
|
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
export default t;
|
|
59
|
+
|
|
60
|
+
export const setLocale = (locale: string) => {
|
|
61
|
+
let finalLocale = '';
|
|
62
|
+
if (locale.startsWith('zh')) {
|
|
63
|
+
finalLocale = 'zh';
|
|
64
|
+
} else if (locale.startsWith('en')) {
|
|
65
|
+
finalLocale = 'en';
|
|
66
|
+
} else if (locale.startsWith('id') || locale.startsWith('in')) {
|
|
67
|
+
finalLocale = 'id';
|
|
68
|
+
}
|
|
69
|
+
localStorage.setItem(localkey, finalLocale);
|
|
70
|
+
}
|
|
File without changes
|
package/tsconfig.app.json
CHANGED
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
},
|
|
23
23
|
"composite": true,
|
|
24
24
|
"include": [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
"src/**/*.ts",
|
|
26
|
+
"src/**/*.d.ts",
|
|
27
|
+
"src/**/*.tsx",
|
|
28
|
+
"src/**/*.vue",
|
|
29
29
|
"src/i18n/zh-CH.js"
|
|
30
30
|
],
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
"exclude": [
|
|
32
|
+
"node_modules",
|
|
33
|
+
"vite.config.ts" // 如果不需要解析 vite.config.ts
|
|
34
|
+
],
|
|
35
35
|
}
|