@yqg/permission 1.3.0-alpha.3 → 1.3.0-alpha.5
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-DJ-rohnO.js → apply-modal-B7qjeZSE.js} +1873 -1867
- package/dist/{category-selector-iOHRBhRt.js → category-selector-CFl6Hloy.js} +4 -4
- package/dist/{index-BNldYMQw.js → index-jGgeGy8X.js} +1 -1
- package/dist/{index-arXtw86e.js → index-rX3BorbX.js} +3 -3
- package/dist/index.js +2 -2
- package/dist/{permission-item-DQA5sauU.js → permission-item-CWYGj1L0.js} +4 -4
- package/dist/{yqg-permission-C7I2t23j.js → yqg-permission-DM6aHNXO.js} +4 -4
- package/dist/yqg-permission.umd.js +31 -31
- package/package.json +1 -1
- package/src/App.vue +6 -2
- package/src/components/apply-modal.vue +12 -3
- package/src/components/yqg-permission.vue +1 -1
- package/src/utils/index.ts +2 -2
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -9,7 +9,11 @@ const color = ref<string>('#1677ff');
|
|
|
9
9
|
const locale = ref<LocaleType>('zh-CN');
|
|
10
10
|
|
|
11
11
|
const permissions = reactive([
|
|
12
|
-
'
|
|
12
|
+
'CRANE.EMPLOYEE.QUERY',
|
|
13
|
+
'CRANE.EMPLOYEE.DETAIL_QUERY',
|
|
14
|
+
'CRANE.EMPLOYEE.ATTRIBUTE_CREATE',
|
|
15
|
+
'CRANE.EMPLOYEE.ROLE_ASSIGN',
|
|
16
|
+
'CRANE.EMPLOYEE.DEPARTMENT_ROLE.ATTRIBUTE_ROLE_CREATE',
|
|
13
17
|
]);
|
|
14
18
|
// const permissions = reactive(['CRANE.BUSINESS.QUERY', 'RANE.BUSINESS.CREATE', 'CRANE.BUSINESS.UPDATE', 'CRANE.BUSINESS.DELETE']);
|
|
15
19
|
const changeColor = () => {
|
|
@@ -33,7 +37,7 @@ const changeLocale = () => {
|
|
|
33
37
|
<!-- 05184 -->
|
|
34
38
|
<yqg-permission
|
|
35
39
|
:permissions="permissions"
|
|
36
|
-
workNumber="
|
|
40
|
+
workNumber="04701"
|
|
37
41
|
:color="color"
|
|
38
42
|
:locale="locale"
|
|
39
43
|
@onSuccess="() => {console.log('成功')}"
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
{{t('noPermissionTips')}}
|
|
10
10
|
</span>
|
|
11
11
|
|
|
12
|
-
<Tree checkable :default-expand-all="true" :tree-data="permissionList" :height="200"
|
|
13
|
-
:checkedKeys="formState.features" class="crane-permission-tree" @check="onCheck">
|
|
12
|
+
<Tree checkable :default-expand-all="true" :tree-data="permissionList" :height="200" :expandedKeys="expandedKeys"
|
|
13
|
+
:checkedKeys="formState.features" class="crane-permission-tree" @check="onCheck" @expand="expandedKeys = $event">
|
|
14
14
|
<template #title="item: PermissionType">
|
|
15
15
|
<div v-if="item.children && item.children.length">
|
|
16
16
|
{{ item.shortName }}
|
|
@@ -107,6 +107,7 @@ const categoryRef = ref();
|
|
|
107
107
|
let stepNodes = ref([]);
|
|
108
108
|
const categoryList = ref<CategoryType[]>([]);
|
|
109
109
|
const validTimeOptions = ref([]);
|
|
110
|
+
const expandedKeys = ref<any[]>([]);
|
|
110
111
|
const formState = reactive<formStateType>({
|
|
111
112
|
features: [],
|
|
112
113
|
roleVoList: [],
|
|
@@ -232,10 +233,18 @@ const onCheck = (checkedIds:any, info:any) => {
|
|
|
232
233
|
|
|
233
234
|
// 收集需要展示的数据属性
|
|
234
235
|
categoryList.value = useCategory(permissionList.value, formState.features);
|
|
235
|
-
console.log(categoryList.value, formState.features);
|
|
236
236
|
// 预览审批流程
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
+
watch(() => props.permissionList, (cur) => {
|
|
240
|
+
expandedKeys.value = [];
|
|
241
|
+
deepTree(cur, (item: any) => {
|
|
242
|
+
if (item.children && item.children.length) {
|
|
243
|
+
expandedKeys.value.push(item.feature);
|
|
244
|
+
}
|
|
245
|
+
})
|
|
246
|
+
})
|
|
247
|
+
|
|
239
248
|
watch(() => open.value, (cur) => {
|
|
240
249
|
if (cur) {
|
|
241
250
|
formRef.value?.resetFields();
|
|
@@ -187,7 +187,7 @@ import useFormat from '../hooks/useFormat';
|
|
|
187
187
|
watch(() => props.locale, (cur, pre) => {
|
|
188
188
|
if (cur === pre) return;
|
|
189
189
|
localStorage.setItem('permission_locale', props.locale);
|
|
190
|
-
}, {immediate: true})
|
|
190
|
+
}, {immediate: true});
|
|
191
191
|
</script>
|
|
192
192
|
|
|
193
193
|
<style scoped>
|
package/src/utils/index.ts
CHANGED
|
@@ -4,8 +4,8 @@ type optionsType = {
|
|
|
4
4
|
[key: string]: any;
|
|
5
5
|
};
|
|
6
6
|
const t = (key: string, options?: optionsType) => {
|
|
7
|
-
// key的格式为:'xxx.xxx.xxx'
|
|
8
|
-
|
|
7
|
+
// key的格式为:'xxx.xxx.xxx'//国际化todo
|
|
8
|
+
const en = localStorage.getItem('permission_locale') || 'zh-CN';
|
|
9
9
|
const keys = key.split('.');
|
|
10
10
|
let result = language[en as string] || language['en-US'];
|
|
11
11
|
for (let i = 0; i < keys.length; i++) {
|