@yqg/permission 1.3.1-alpha.0 → 1.3.1-alpha.1
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-D3Frqfx8.js → apply-modal-D6PPjuwj.js} +4 -4
- package/dist/{category-selector-BsBqfqWu.js → category-selector-CBXngn-1.js} +4 -4
- package/dist/{index-CHKs7hG7.js → index-Dg2700ps.js} +1 -1
- package/dist/{index-CvLY5Rbl.js → index-DtfXYXKF.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/{permission-item-DTdDRu0E.js → permission-item-CWqYi5qX.js} +4 -4
- package/dist/{yqg-permission-CEJEsvl5.js → yqg-permission-CU6eVyg6.js} +99 -102
- package/dist/yqg-permission.umd.js +29 -29
- package/package.json +1 -1
- package/src/App.vue +2 -7
- package/src/hooks/useFormat.ts +5 -4
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -9,12 +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.
|
|
13
|
-
'CRANE.EMPLOYEE.QUERY',
|
|
14
|
-
'CRANE.EMPLOYEE.DETAIL_QUERY',
|
|
15
|
-
'CRANE.EMPLOYEE.ATTRIBUTE_CREATE',
|
|
16
|
-
'CRANE.EMPLOYEE.ROLE_ASSIGN',
|
|
17
|
-
'CRANE.EMPLOYEE.DEPARTMENT_ROLE.ATTRIBUTE_ROLE_CREATE',
|
|
12
|
+
'CRANE.APPLY.REQUEST.PERMISSION', 'CRANE.APPLY.REQUEST.ROLE', 'CRANE_APPLY_TABLEAU',
|
|
18
13
|
]);
|
|
19
14
|
// const permissions = reactive(['CRANE.BUSINESS.QUERY', 'RANE.BUSINESS.CREATE', 'CRANE.BUSINESS.UPDATE', 'CRANE.BUSINESS.DELETE']);
|
|
20
15
|
const changeColor = () => {
|
|
@@ -36,7 +31,7 @@ const changeLocale = () => {
|
|
|
36
31
|
<!-- 03541 -->
|
|
37
32
|
<!-- 02124 -->
|
|
38
33
|
<!-- 05184 -->
|
|
39
|
-
<yqg-permission :permissions="permissions" workNumber="
|
|
34
|
+
<yqg-permission :permissions="permissions" workNumber="03817" :color="color" :locale="locale"
|
|
40
35
|
@onSuccess="() => {console.log('成功')}">
|
|
41
36
|
</yqg-permission>
|
|
42
37
|
</div>
|
package/src/hooks/useFormat.ts
CHANGED
|
@@ -31,13 +31,14 @@ export default function useFormat(tree: PermissionListType) {
|
|
|
31
31
|
ownList.push(node.feature);
|
|
32
32
|
}
|
|
33
33
|
} else {
|
|
34
|
-
// 如果当前节点的所有自节点都符合[StatusType.OWNER].includes(node.businessApplyType) && !node.categoryVOS.length;那么也把当前featrue放到ownList中
|
|
35
|
-
if (node.children.every((child) => [StatusType.OWNER].includes(child.businessApplyType) && !child?.categoryVOS?.length)) {
|
|
36
|
-
ownList.push(node.feature);
|
|
37
|
-
}
|
|
38
34
|
// 递归对子节点进行排序
|
|
39
35
|
node.children = sortTree(node.children, sortMap, levelSortMap);
|
|
40
36
|
|
|
37
|
+
// 如果所有子节点都在 ownList 中,那么当前节点也加入 ownList
|
|
38
|
+
if (node.children.every((child) => ownList.includes(child.feature))) {
|
|
39
|
+
ownList.push(node.feature);
|
|
40
|
+
}
|
|
41
|
+
|
|
41
42
|
// 检查所有子节点是否 `disabled === true`
|
|
42
43
|
if (node.children.every((child) => child.disabled)) {
|
|
43
44
|
node.disabled = true;
|