@yqg/permission 1.3.0 → 1.3.1-1.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-Ct9rKeUf.js → apply-modal-BFzYTq8s.js} +3886 -4164
- package/dist/{category-selector-BnUMBDty.js → category-selector-3bIJ-OEr.js} +153 -149
- package/dist/{index-XvlOgi6s.js → index-Cnz2SLUX.js} +1828 -1836
- package/dist/{index-CAVNFmBo.js → index-qdB6FW1K.js} +4 -4
- package/dist/index.js +2 -2
- package/dist/permission-item-C6tr81T4.js +1252 -0
- package/dist/{yqg-permission-BrOMv4sA.js → yqg-permission-BPhYJ3ps.js} +3738 -3696
- package/dist/yqg-permission.umd.js +65 -65
- package/package.json +9 -10
- package/src/App.vue +8 -12
- package/src/axios/index.ts +1 -1
- package/src/components/apply-modal.vue +160 -73
- package/src/components/approval-steps.vue +39 -40
- package/src/components/category-selector.vue +15 -8
- 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/useCategory.ts +1 -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 +2 -9
- package/src/style/reset.css +3 -0
- package/src/typings/index.d.ts +1 -0
- package/src/utils/index.ts +16 -2
- package/tsconfig.app.json +8 -8
- package/dist/permission-item-2JurQrn-.js +0 -1250
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
:class="['PENDING'].includes(item.businessApplyType) ? '' : 'crane-disabled-color'">
|
|
20
20
|
{{ statusMap[item.businessApplyType] }}
|
|
21
21
|
{{ item.businessApplyType === 'TEMP_OWNER' ? `(${(item?.ownStatusVO?.dayDiff > 0 ?
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
t('lastDays', {
|
|
23
|
+
count:
|
|
24
|
+
item?.ownStatusVO?.dayDiff
|
|
25
|
+
}) : t('today'))})` : '' }}
|
|
26
26
|
</Tag>
|
|
27
27
|
|
|
28
28
|
<Popover v-if="item.desc">
|
|
@@ -34,16 +34,17 @@
|
|
|
34
34
|
|
|
35
35
|
<Popover v-if="item.relatedCompleteNames?.length">
|
|
36
36
|
<template #content>
|
|
37
|
-
<div
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
<div class="crane-department-wraper">
|
|
38
|
+
<div>
|
|
39
|
+
{{ t('adaptDepartment') }}:
|
|
40
|
+
</div>
|
|
41
|
+
<div v-for="item in item.relatedCompleteNames">{{ item }}</div>
|
|
41
42
|
</div>
|
|
42
43
|
</template>
|
|
43
44
|
<div class="crane-flex-center crane-margin-left-4">
|
|
44
45
|
<img :src="departmentImg" height="14" width="14">
|
|
45
46
|
<span class="crane-weak-color crane-margin-left-4">{{ item.relatedCompleteNames.length
|
|
46
|
-
|
|
47
|
+
}}</span>
|
|
47
48
|
</div>
|
|
48
49
|
</Popover>
|
|
49
50
|
|
|
@@ -59,15 +60,15 @@
|
|
|
59
60
|
</template>
|
|
60
61
|
<div class="crane-weak-color crane-margin-left-4 crane-text-overflow">
|
|
61
62
|
{{item.categoryVOS?.map((item:
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
any) => {
|
|
64
|
+
return item.categoryName;
|
|
64
65
|
}).join('、')
|
|
65
66
|
}}
|
|
66
67
|
</div>
|
|
67
68
|
</Popover>
|
|
68
69
|
|
|
69
70
|
<!-- 选择框 -->
|
|
70
|
-
<span v-if="checkedKeys.includes(item.feature)" class="crane-weak-color crane-margin-left-12">
|
|
71
|
+
<span v-if="checkedKeys.includes(item.feature) && !item.disabled" class="crane-weak-color crane-margin-left-12">
|
|
71
72
|
{{ t('availableTime') }}:
|
|
72
73
|
<Select v-model:value="item.validTime" style="width: 100px"
|
|
73
74
|
:disabled="item.businessApplyType === OWNER_STATUS"
|
|
@@ -88,7 +89,7 @@ import t from '../utils';
|
|
|
88
89
|
|
|
89
90
|
const OWNER_STATUS = 'OWNER';
|
|
90
91
|
|
|
91
|
-
const levelMap:LevelMapType = {
|
|
92
|
+
const levelMap: LevelMapType = {
|
|
92
93
|
L1: {
|
|
93
94
|
color: '#1AA83B',
|
|
94
95
|
text: t('levels.L1'),
|
|
@@ -120,7 +121,7 @@ let props = defineProps({
|
|
|
120
121
|
},
|
|
121
122
|
item: {
|
|
122
123
|
type: Object as PropType<PermissionType>,
|
|
123
|
-
default: () => {}
|
|
124
|
+
default: () => { }
|
|
124
125
|
}
|
|
125
126
|
});
|
|
126
127
|
|
|
@@ -136,7 +137,7 @@ const tempTimeOptions = computed(() => {
|
|
|
136
137
|
const getCategoryValue = (category: CategoryType) => {
|
|
137
138
|
return `【${category.categoryName}】:${category.attributeValues?.map((item: any) => item.attributeName)?.join('、') || t('empty')}`;
|
|
138
139
|
};
|
|
139
|
-
|
|
140
|
+
|
|
140
141
|
const onChangeTimeHandler = () => {
|
|
141
142
|
emit('updateTime', props.item);
|
|
142
143
|
emit('onChangeTime', props.item);
|
|
@@ -145,15 +146,21 @@ const onChangeTimeHandler = () => {
|
|
|
145
146
|
|
|
146
147
|
</script>
|
|
147
148
|
<style scoped>
|
|
149
|
+
.crane-department-wraper {
|
|
150
|
+
max-width: 600px;
|
|
151
|
+
max-height: 300px;
|
|
152
|
+
overflow-y: scroll;
|
|
153
|
+
}
|
|
148
154
|
.crane-flex-center {
|
|
149
155
|
display: flex;
|
|
150
156
|
align-items: center;
|
|
151
157
|
white-space: nowrap;
|
|
152
|
-
|
|
158
|
+
}
|
|
153
159
|
|
|
154
|
-
|
|
160
|
+
.permission-item-wraper {
|
|
155
161
|
padding-right: 32px;
|
|
156
|
-
|
|
162
|
+
}
|
|
163
|
+
|
|
157
164
|
.crane-checkbox-line {
|
|
158
165
|
line-height: 28px;
|
|
159
166
|
display: flex;
|
|
@@ -166,31 +173,36 @@ const onChangeTimeHandler = () => {
|
|
|
166
173
|
padding: 2px 4px;
|
|
167
174
|
line-height: 12px;
|
|
168
175
|
font-weight: 500;
|
|
169
|
-
|
|
170
|
-
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.crane-margin-right-0 {
|
|
171
179
|
margin-right: 0;
|
|
172
|
-
|
|
173
|
-
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.crane-margin-left-4 {
|
|
174
183
|
margin-left: 4px;
|
|
175
|
-
|
|
176
|
-
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.crane-margin-right-4 {
|
|
177
187
|
margin-right: 4px;
|
|
178
|
-
|
|
179
|
-
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.crane-margin-left-12 {
|
|
180
191
|
margin-left: 12px;
|
|
181
|
-
|
|
182
|
-
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.crane-disabled-color {
|
|
183
195
|
color: #C9CDD4;
|
|
184
|
-
|
|
185
|
-
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.crane-weak-color {
|
|
186
199
|
color: #86909C;
|
|
187
|
-
|
|
188
|
-
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.crane-text-overflow {
|
|
189
203
|
max-width: 160px;
|
|
190
|
-
|
|
191
|
-
|
|
204
|
+
overflow: hidden;
|
|
205
|
+
text-overflow: ellipsis;
|
|
192
206
|
white-space: nowrap;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
207
|
+
}
|
|
196
208
|
</style>
|
|
@@ -2,59 +2,59 @@
|
|
|
2
2
|
<contextHolder></contextHolder>
|
|
3
3
|
</template>
|
|
4
4
|
<script lang="ts" setup>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import { createVNode } from 'vue';
|
|
6
|
+
import { CheckCircleFilled } from '@ant-design/icons-vue';
|
|
7
|
+
import { Modal } from 'ant-design-vue';
|
|
8
|
+
import t from '../utils';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const [modal, contextHolder] = Modal.useModal();
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
12
|
+
const countDown = (url: string, callback?: () => void) => {
|
|
13
|
+
let secondsToGo = 10;
|
|
14
|
+
const modal1 = modal.confirm({
|
|
15
|
+
title: t('resoultTitle'),
|
|
16
|
+
content: t('successTips'),
|
|
17
|
+
cancelText: `${t('close')}(${secondsToGo}s)`,
|
|
18
|
+
okText: `${t('viewApprovalDetail')}>>`,
|
|
19
|
+
wrapClassName: 'yqg-permission-modal-wrap',
|
|
20
|
+
icon: createVNode(CheckCircleFilled, { style: 'color: #52c41a;' }),
|
|
21
|
+
onOk: () => {
|
|
22
|
+
window.open(url);
|
|
23
|
+
modal1.destroy();
|
|
24
|
+
callback && callback();
|
|
25
|
+
window.YQG_PERMISSION_CALLBACK && window.YQG_PERMISSION_CALLBACK();
|
|
26
|
+
if (!window.YQG_PERMISSION_CALLBACK && !callback) {
|
|
27
|
+
location.reload();
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
onCancel: () => {
|
|
31
|
+
modal1.destroy();
|
|
32
|
+
callback && callback();
|
|
33
|
+
window.YQG_PERMISSION_CALLBACK && window.YQG_PERMISSION_CALLBACK();
|
|
34
|
+
if (!window.YQG_PERMISSION_CALLBACK && !callback) {
|
|
35
|
+
location.reload();
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
const interval = setInterval(() => {
|
|
41
|
+
secondsToGo -= 1;
|
|
42
|
+
modal1.update({
|
|
43
|
+
cancelText: `${t('close')}(${secondsToGo}s)`,
|
|
44
|
+
});
|
|
45
|
+
}, 1000);
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
clearInterval(interval);
|
|
49
|
+
modal1.destroy();
|
|
50
|
+
}, secondsToGo * 1000);
|
|
51
|
+
}
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
defineExpose({ countDown });
|
|
54
54
|
|
|
55
55
|
</script>
|
|
56
56
|
<style>
|
|
57
57
|
.yqg-permission-modal-wrap .yqg-permission-modal-confirm-btns {
|
|
58
|
-
text-align: center!important;
|
|
58
|
+
text-align: center !important;
|
|
59
59
|
}
|
|
60
60
|
</style>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<ConfigProvider prefixCls="yqg-permission" :theme="{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<div class="crane-wraper">
|
|
2
|
+
<ConfigProvider prefixCls="yqg-permission" :key="locale" :theme="{
|
|
3
|
+
token: {
|
|
4
|
+
colorPrimary: color,
|
|
5
|
+
}
|
|
6
|
+
}">
|
|
7
|
+
<div class="crane-wraper" :key="locale">
|
|
8
8
|
<template v-if="[COM_TYPE.FLOATBUTTON, COM_TYPE.TEXT].includes(type)">
|
|
9
9
|
<FloatButton ref="dragElement" type="primary" :tooltip="t('clickToApply')" :style="{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
right: RIGHT_DEFAULT,
|
|
11
|
+
top: currentTop,
|
|
12
|
+
}">
|
|
13
13
|
<template #icon>
|
|
14
14
|
<img :src="applyIconUrl" height="20" width="20" />
|
|
15
15
|
</template>
|
|
16
16
|
</FloatButton>
|
|
17
17
|
</template>
|
|
18
|
-
<template v-else-if="type===COM_TYPE.CUSTOM">
|
|
18
|
+
<template v-else-if="type === COM_TYPE.CUSTOM">
|
|
19
19
|
<div @click="showModal">
|
|
20
20
|
<slot name="custom" />
|
|
21
21
|
</div>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
{{ t('unavailableTips') }}
|
|
29
29
|
</div>
|
|
30
30
|
<div>
|
|
31
|
-
<Button type="primary" @click="showModal">+ {{t('applyPermission')}}</Button>
|
|
31
|
+
<Button type="primary" @click="showModal">+ {{ t('applyPermission') }}</Button>
|
|
32
32
|
</div>
|
|
33
33
|
</template>
|
|
34
34
|
<!-- 审批中 -->
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
<img :src="curStatus.imageUrl" height="200" width="200" style="margin-top: calc(50vh - 273px)" />
|
|
37
37
|
<div class="crane-margin10">
|
|
38
38
|
<span class="crane-unapply" v-html="t('appliedTips', {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
status: `<style>.crane-unapply span {color: orange;}</style><span>${curStatus.tips}</span>`
|
|
40
|
+
})">
|
|
41
41
|
</span>
|
|
42
42
|
</div>
|
|
43
43
|
<div>
|
|
44
|
-
<Button class="crane-margin-right10"
|
|
45
|
-
|
|
46
|
-
<Button type="primary" @click="showModal">+ {{t('applyMore')}}</Button>
|
|
44
|
+
<Button class="crane-margin-right10" @click="goViewApproval">{{ t('viewApprovalDetail')
|
|
45
|
+
}}</Button>
|
|
46
|
+
<Button type="primary" @click="showModal">+ {{ t('applyMore') }}</Button>
|
|
47
47
|
</div>
|
|
48
48
|
</template>
|
|
49
49
|
<!-- 不可申请 -->
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
{{ t('unapplyTips') }}
|
|
54
54
|
<Popover>
|
|
55
55
|
<template #content>
|
|
56
|
-
<div style="max-width: 400px;">{{t('manager')}}: {{ curStatus.tips }}</div>
|
|
56
|
+
<div style="max-width: 400px;">{{ t('manager') }}: {{ curStatus.tips }}</div>
|
|
57
57
|
</template>
|
|
58
|
-
<span style="color: #1677ff;">{{t('callManager') }}</span>
|
|
58
|
+
<span style="color: #1677ff;">{{ t('callManager') }}</span>
|
|
59
59
|
</Popover>
|
|
60
60
|
</div>
|
|
61
61
|
</div>
|
|
@@ -63,142 +63,167 @@
|
|
|
63
63
|
</div>
|
|
64
64
|
|
|
65
65
|
<ApplyModal v-model="open" :permissionList="permissionList" :spining="loading" :workNumber="workNumber"
|
|
66
|
-
|
|
66
|
+
:zIndex="zIndex" :defaultCheckedIds="defaultCheckedIds" :isAllChecked="isAllChecked"
|
|
67
|
+
@onSuccess="() => emit('onSuccess')" @onSubmit="getPermissions" :color="color">
|
|
67
68
|
</ApplyModal>
|
|
68
|
-
|
|
69
69
|
</ConfigProvider>
|
|
70
|
+
|
|
70
71
|
</template>
|
|
71
72
|
<script lang="ts" setup>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
import { ref, defineAsyncComponent, computed, watchEffect, watch } from 'vue';
|
|
74
|
+
import { Button, ConfigProvider, Popover, message, FloatButton } from 'ant-design-vue';
|
|
75
|
+
import applyIconUrl from '@/assets/applyicon.png';
|
|
76
|
+
import noauthority from '@/assets/noauthority.png';
|
|
77
|
+
import Http from '../axios/index';
|
|
78
|
+
import t, { setLocale } from '../utils';
|
|
79
|
+
import useDraggable from '../hooks/useDragable';
|
|
80
|
+
import useStatus from '../hooks/useStatus';
|
|
80
81
|
import useFormat from '../hooks/useFormat';
|
|
82
|
+
import '../style/reset.css';
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
84
|
+
const STATUS_MAP = {
|
|
85
|
+
DEFAULT: 'DEFAULT',
|
|
86
|
+
PENDING: 'PENDING',
|
|
87
|
+
NO: 'NO',
|
|
88
|
+
} as const;
|
|
89
|
+
|
|
90
|
+
const COM_TYPE = {
|
|
91
|
+
FLOATBUTTON: 'floatButton',
|
|
92
|
+
DEFAULT: 'default',
|
|
93
|
+
TEXT: 'text',
|
|
94
|
+
CUSTOM: 'custom',
|
|
95
|
+
};
|
|
96
|
+
const RIGHT_DEFAULT = '10px';
|
|
97
|
+
|
|
98
|
+
// 重置 message 类名,避免被全局样式覆盖
|
|
99
|
+
message.config({ prefixCls : 'yqg-permission-message'});
|
|
100
|
+
|
|
101
|
+
const ApplyModal = defineAsyncComponent(() => import('./apply-modal.vue'));
|
|
102
|
+
|
|
103
|
+
const emit = defineEmits(['onSuccess']);
|
|
104
|
+
|
|
105
|
+
const props = defineProps({
|
|
106
|
+
workNumber: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: ''
|
|
109
|
+
},
|
|
110
|
+
permissions: {
|
|
111
|
+
type: [String, Array<String>],
|
|
112
|
+
default: []
|
|
113
|
+
},
|
|
114
|
+
locale: {
|
|
115
|
+
type: String,
|
|
116
|
+
default: 'zh'
|
|
117
|
+
},
|
|
118
|
+
color: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: '#1677ff'
|
|
121
|
+
},
|
|
122
|
+
type: {
|
|
123
|
+
type: String,
|
|
124
|
+
default: 'default'
|
|
125
|
+
},
|
|
126
|
+
top: {
|
|
127
|
+
type: String,
|
|
128
|
+
default: '100px'
|
|
129
|
+
},
|
|
130
|
+
zIndex: {
|
|
131
|
+
type: Number,
|
|
132
|
+
default: 10000
|
|
133
|
+
},
|
|
134
|
+
// 某些业务场景需要在特定页面隐藏某些数据维度
|
|
135
|
+
omitCategoryIds: {
|
|
136
|
+
type: [String, Array<number>],
|
|
137
|
+
required: false,
|
|
138
|
+
default: () => []
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
const open = ref(false);
|
|
143
|
+
const curApproving = ref<PermissionType>();
|
|
144
|
+
const loading = ref(false);
|
|
145
|
+
const defaultCheckedIds = ref<string[]>([]);
|
|
146
|
+
const isAllChecked = ref(false);
|
|
147
|
+
let permissionList = ref<PermissionListType>([]);
|
|
148
|
+
let curStatus = ref<Record<string, any>>({
|
|
149
|
+
imageUrl: noauthority,
|
|
150
|
+
status: '',
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
const needOmitCategoryIds = computed(() => {
|
|
154
|
+
if (Array.isArray(props.omitCategoryIds)) {
|
|
155
|
+
return props.omitCategoryIds;
|
|
156
|
+
}
|
|
157
|
+
return props.omitCategoryIds?.split(',')?.map((item) => Number(item)) || [];
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
const allPermissions = computed(() => {
|
|
161
|
+
permissionList.value = [];
|
|
162
|
+
if (Array.isArray(props.permissions)) {
|
|
163
|
+
return props.permissions.filter((item) => item.trim());
|
|
164
|
+
}
|
|
165
|
+
return props.permissions?.split(',')?.filter((item) => item.trim()) || [];
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
const goViewApproval = () => {
|
|
169
|
+
const url = curApproving.value?.oaFlowUrl;
|
|
170
|
+
if (!url) return;
|
|
171
|
+
|
|
172
|
+
window.open(url, '_blank');
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
const getPermissions = async () => {
|
|
176
|
+
const { workNumber } = props;
|
|
177
|
+
const permissions = allPermissions.value;
|
|
178
|
+
if (!permissions?.length || !workNumber) return;
|
|
179
|
+
|
|
180
|
+
const params = {
|
|
181
|
+
workNumber,
|
|
182
|
+
features: permissions.toString(),
|
|
152
183
|
};
|
|
153
184
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
loading.value = true;
|
|
165
|
-
const res = await Http.getPermissions(params);
|
|
166
|
-
permissionList.value = useFormat(res.body || []);
|
|
167
|
-
curStatus.value = useStatus(permissionList.value, curApproving);
|
|
168
|
-
loading.value = false;
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
const showModal = () => {
|
|
172
|
-
open.value = !open.value;
|
|
173
|
-
getPermissions();
|
|
174
|
-
};
|
|
185
|
+
loading.value = true;
|
|
186
|
+
const res = await Http.getPermissions(params);
|
|
187
|
+
const datalist = useFormat(res.body || [], needOmitCategoryIds.value);
|
|
188
|
+
permissionList.value = datalist.data;
|
|
189
|
+
defaultCheckedIds.value = datalist.checkList;
|
|
190
|
+
isAllChecked.value = datalist.isAllChecked;
|
|
191
|
+
curStatus.value = useStatus(permissionList.value, curApproving);
|
|
192
|
+
loading.value = false;
|
|
193
|
+
};
|
|
175
194
|
|
|
176
|
-
|
|
195
|
+
const showModal = () => {
|
|
196
|
+
open.value = !open.value;
|
|
197
|
+
getPermissions();
|
|
198
|
+
};
|
|
177
199
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
200
|
+
const { currentTop, dragElement } = useDraggable(props, showModal);
|
|
201
|
+
|
|
202
|
+
watchEffect(() => {
|
|
203
|
+
if (props.type === COM_TYPE.DEFAULT) {
|
|
204
|
+
getPermissions();
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
watch(() => props.locale, (cur, pre) => {
|
|
208
|
+
if (cur === pre) return;
|
|
209
|
+
setLocale(cur);
|
|
210
|
+
}, { immediate: true });
|
|
187
211
|
</script>
|
|
188
212
|
|
|
189
213
|
<style scoped>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
214
|
+
.crane-wraper {
|
|
215
|
+
display: flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
flex-direction: column;
|
|
218
|
+
font-size: 14px;
|
|
219
|
+
white-space: nowrap;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.crane-margin10 {
|
|
223
|
+
margin: 10px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.crane-margin-right10 {
|
|
227
|
+
margin-right: 10px;
|
|
228
|
+
}
|
|
229
|
+
</style>
|
package/src/hooks/useCategory.ts
CHANGED
|
@@ -5,7 +5,7 @@ export default function useCategory(tree: PermissionType[], checkedIds: string[]
|
|
|
5
5
|
const categoryList: CategoryType[] = [];
|
|
6
6
|
deepTree(tree, (item) => {
|
|
7
7
|
if (!item.children && checkedIds.includes(item.feature)) {
|
|
8
|
-
item.categoryVOS
|
|
8
|
+
item.categoryVOS?.forEach((category: any) => {
|
|
9
9
|
category.attributeValueIds_view = category?.attributeValueIds || [];
|
|
10
10
|
categoryList.push(category);
|
|
11
11
|
});
|