@yqg/permission 1.3.5 → 1.3.7-bate.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-DFVMxU4P.js → apply-modal-CTYgpCDi.js} +2805 -2797
- package/dist/{category-selector-D_8E2kwg.js → category-selector-DyIpOw0V.js} +23 -23
- package/dist/{index-C55cbXDC.js → index-BSXxLRqm.js} +3 -3
- package/dist/{index-CJqbH2iQ.js → index-B_8TwHV1.js} +3 -3
- package/dist/index.js +2 -2
- package/dist/{permission-item-D5l8rvrV.js → permission-item-EPKvQkXL.js} +4 -4
- package/dist/{yqg-permission-CVFg15cm.js → yqg-permission-EZ-WtiwC.js} +2 -2
- package/dist/yqg-permission.umd.js +35 -35
- package/package.json +1 -1
- package/src/components/apply-modal.vue +43 -14
package/package.json
CHANGED
|
@@ -21,19 +21,22 @@
|
|
|
21
21
|
<span v-if="!permissionList.length">
|
|
22
22
|
{{ t('noPermissionTips') }}
|
|
23
23
|
</span>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
:
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
<div v-else :class="{ 'yqg-permission-tree-list-wraper': showScrollBar }">
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
<Tree checkable :default-expand-all="true" :tree-data="permissionList" :height="200"
|
|
28
|
+
:expandedKeys="expandedKeys"
|
|
29
|
+
:checkedKeys="formState.features" @check="onCheck" @expand="expandedKeys = $event">
|
|
30
|
+
<template #title="item: PermissionType">
|
|
31
|
+
<div v-if="item.children && item.children.length">
|
|
32
|
+
{{ item.shortName }}
|
|
33
|
+
</div>
|
|
34
|
+
<PermissionItem v-else :checkedKeys="formState.features" :item="item"
|
|
35
|
+
@onChangeTime="onChangeTime" @updateTime="setDefaultTime"
|
|
36
|
+
:validTimeOptions="validTimeOptions" />
|
|
37
|
+
</template>
|
|
38
|
+
</Tree>
|
|
39
|
+
</div>
|
|
37
40
|
<CategorySelector v-if="categoryList.length" :categoryList="categoryList" ref="categoryRef" />
|
|
38
41
|
</Spin>
|
|
39
42
|
</FormItem>
|
|
@@ -70,7 +73,8 @@ import {
|
|
|
70
73
|
ref,
|
|
71
74
|
watch,
|
|
72
75
|
PropType,
|
|
73
|
-
computed
|
|
76
|
+
computed,
|
|
77
|
+
nextTick
|
|
74
78
|
} from 'vue';
|
|
75
79
|
import Http from '../axios/index';
|
|
76
80
|
import {
|
|
@@ -144,6 +148,7 @@ const successModal = ref<InstanceType<typeof SuccessModal>>();
|
|
|
144
148
|
const formRef = ref();
|
|
145
149
|
const categoryRef = ref();
|
|
146
150
|
let stepNodes = ref([]);
|
|
151
|
+
const showScrollBar = ref(false);
|
|
147
152
|
const categoryList = ref<CategoryType[]>([]);
|
|
148
153
|
const validTimeOptions = ref([]);
|
|
149
154
|
const expandedKeys = ref<any[]>([]);
|
|
@@ -288,6 +293,18 @@ const onCheck = (checkedIds: any, info: any) => {
|
|
|
288
293
|
// 预览审批流程
|
|
289
294
|
}
|
|
290
295
|
|
|
296
|
+
const initScrollBar = () => {
|
|
297
|
+
const treeHeight = document.querySelector('.yqg-permission-tree-list-holder')?.children?.[0]?.clientHeight || 0;
|
|
298
|
+
if (treeHeight > 200) {
|
|
299
|
+
// 设置树的高度
|
|
300
|
+
showScrollBar.value = true;
|
|
301
|
+
} else {
|
|
302
|
+
showScrollBar.value = false;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
291
308
|
watch(() => props.permissionList, (cur) => {
|
|
292
309
|
expandedKeys.value = [];
|
|
293
310
|
deepTree(cur, (item: any) => {
|
|
@@ -295,6 +312,10 @@ watch(() => props.permissionList, (cur) => {
|
|
|
295
312
|
expandedKeys.value.push(item.feature);
|
|
296
313
|
}
|
|
297
314
|
})
|
|
315
|
+
|
|
316
|
+
nextTick(() => {
|
|
317
|
+
initScrollBar();
|
|
318
|
+
})
|
|
298
319
|
})
|
|
299
320
|
|
|
300
321
|
watch(() => props.defaultCheckedIds, (cur) => {
|
|
@@ -355,4 +376,12 @@ const getPopupContainer = ():HTMLElement => {
|
|
|
355
376
|
:deep(.yqg-permission-tree-title) {
|
|
356
377
|
width: 100% !important;
|
|
357
378
|
}
|
|
379
|
+
|
|
380
|
+
.yqg-permission-tree-list-wraper :deep(.yqg-permission-tree-list-scrollbar) {
|
|
381
|
+
display: block !important;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
358
387
|
</style>
|