@yqg/permission 1.3.2 → 1.3.4
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-bqIJ2QXS.js → apply-modal-BsokPhqu.js} +1484 -1465
- package/dist/{category-selector-B8MH3Q3G.js → category-selector-Bo1Upd0w.js} +68 -69
- package/dist/{index-u37w35am.js → index-CTndgjy2.js} +1 -1
- package/dist/{index-CzfXAbzR.js → index-Dl_VZBVk.js} +3 -3
- package/dist/index.js +2 -2
- package/dist/{permission-item-BlYq3oFU.js → permission-item-Cc_fF08Z.js} +4 -4
- package/dist/{yqg-permission-owkq3rvu.js → yqg-permission-ItXNxp6g.js} +6 -5
- package/dist/yqg-permission.umd.js +28 -28
- package/package.json +1 -1
- package/src/components/apply-modal.vue +60 -42
- package/src/components/category-selector.vue +1 -1
- package/src/components/yqg-permission.vue +7 -5
- package/src/style/reset.css +3 -0
package/package.json
CHANGED
|
@@ -9,48 +9,56 @@
|
|
|
9
9
|
<span v-show="isAllChecked && permissionList.length" class="crane-permission-title-tips">{{
|
|
10
10
|
t('isAllOwnTips') }}</span>
|
|
11
11
|
</template>
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
<ConfigProvider :getPopupContainer="getPopupContainer" prefixCls="yqg-permission" :theme="{
|
|
13
|
+
token: {
|
|
14
|
+
colorPrimary: color,
|
|
15
|
+
}
|
|
16
|
+
}">
|
|
17
|
+
<Form ref="formRef" :model="formState" :labelCol="{ span: 4 }" :wrapperCol="{ span: 19 }">
|
|
18
|
+
<FormItem :label="t('applyPermission')" name="features"
|
|
19
|
+
:rules="[{ required: true, message: t('selectPlaceholder') }]">
|
|
20
|
+
<Spin :spinning="spining">
|
|
21
|
+
<span v-if="!permissionList.length">
|
|
22
|
+
{{ t('noPermissionTips') }}
|
|
23
|
+
</span>
|
|
24
|
+
|
|
25
|
+
<Tree checkable :default-expand-all="true" :tree-data="permissionList" :height="200"
|
|
26
|
+
:expandedKeys="expandedKeys" :checkedKeys="formState.features" class="crane-permission-tree"
|
|
27
|
+
@check="onCheck" @expand="expandedKeys = $event">
|
|
28
|
+
<template #title="item: PermissionType">
|
|
29
|
+
<div v-if="item.children && item.children.length">
|
|
30
|
+
{{ item.shortName }}
|
|
31
|
+
</div>
|
|
32
|
+
<PermissionItem v-else :checkedKeys="formState.features" :item="item"
|
|
33
|
+
@onChangeTime="onChangeTime" @updateTime="setDefaultTime"
|
|
34
|
+
:validTimeOptions="validTimeOptions" />
|
|
35
|
+
</template>
|
|
36
|
+
</Tree>
|
|
37
|
+
<CategorySelector v-if="categoryList.length" :categoryList="categoryList" ref="categoryRef" />
|
|
38
|
+
</Spin>
|
|
39
|
+
</FormItem>
|
|
40
|
+
<FormItem name="applyReason" :label="t('applyReason')" :rules="[{
|
|
41
|
+
required: true, message: t('reasonPlaceholder'), trigger: ['change']
|
|
42
|
+
}, {
|
|
43
|
+
max: 300, message: t('maxLengthTips', { length: 300 }), trigger: ['change', 'blur']
|
|
44
|
+
}]">
|
|
45
|
+
<Textarea v-model:value.trim="formState.applyReason" :placeholder="t('applyReasonPlaceholder')"
|
|
46
|
+
:auto-size="{ minRows: 4, maxRows: 4 }" :disabled="isAllChecked || !permissionList.length">
|
|
47
|
+
</Textarea>
|
|
48
|
+
<span class="reason-tips" style="font-size: 12px">
|
|
49
|
+
{{ t('applyReasonTips') }}
|
|
18
50
|
</span>
|
|
51
|
+
</FormItem>
|
|
52
|
+
|
|
53
|
+
<FormItem :label="t('approvalProcess')">
|
|
54
|
+
<ApprovalSteps :stepNodes="stepNodes" />
|
|
55
|
+
</FormItem>
|
|
56
|
+
|
|
57
|
+
</Form>
|
|
19
58
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<template #title="item: PermissionType">
|
|
24
|
-
<div v-if="item.children && item.children.length">
|
|
25
|
-
{{ item.shortName }}
|
|
26
|
-
</div>
|
|
27
|
-
<PermissionItem v-else :checkedKeys="formState.features" :item="item"
|
|
28
|
-
@onChangeTime="onChangeTime" @updateTime="setDefaultTime"
|
|
29
|
-
:validTimeOptions="validTimeOptions" />
|
|
30
|
-
</template>
|
|
31
|
-
</Tree>
|
|
32
|
-
<CategorySelector v-if="categoryList.length" :categoryList="categoryList" ref="categoryRef" />
|
|
33
|
-
</Spin>
|
|
34
|
-
</FormItem>
|
|
35
|
-
<FormItem name="applyReason" :label="t('applyReason')" :rules="[{
|
|
36
|
-
required: true, message: t('reasonPlaceholder'), trigger: ['change']
|
|
37
|
-
}, {
|
|
38
|
-
max: 300, message: t('maxLengthTips', { length: 300 }), trigger: ['change', 'blur']
|
|
39
|
-
}]">
|
|
40
|
-
<Textarea v-model:value.trim="formState.applyReason" :placeholder="t('applyReasonPlaceholder')"
|
|
41
|
-
:auto-size="{ minRows: 4, maxRows: 4 }" :disabled="isAllChecked || !permissionList.length">
|
|
42
|
-
</Textarea>
|
|
43
|
-
<span class="reason-tips" style="font-size: 12px">
|
|
44
|
-
{{ t('applyReasonTips') }}
|
|
45
|
-
</span>
|
|
46
|
-
</FormItem>
|
|
47
|
-
|
|
48
|
-
<FormItem :label="t('approvalProcess')">
|
|
49
|
-
<ApprovalSteps :stepNodes="stepNodes" />
|
|
50
|
-
</FormItem>
|
|
51
|
-
</Form>
|
|
52
|
-
|
|
53
|
-
<SuccessModal ref="successModal" />
|
|
59
|
+
<SuccessModal ref="successModal" />
|
|
60
|
+
|
|
61
|
+
</ConfigProvider>
|
|
54
62
|
|
|
55
63
|
</Modal>
|
|
56
64
|
</template>
|
|
@@ -73,7 +81,8 @@ import {
|
|
|
73
81
|
message,
|
|
74
82
|
Tree,
|
|
75
83
|
Spin,
|
|
76
|
-
Button
|
|
84
|
+
Button,
|
|
85
|
+
ConfigProvider,
|
|
77
86
|
} from 'ant-design-vue';
|
|
78
87
|
import SuccessModal from './success-modal.vue';
|
|
79
88
|
import ApprovalSteps from './approval-steps.vue';
|
|
@@ -116,6 +125,10 @@ const props = defineProps({
|
|
|
116
125
|
type: Number,
|
|
117
126
|
default: 1000
|
|
118
127
|
},
|
|
128
|
+
color: {
|
|
129
|
+
type: String,
|
|
130
|
+
default: '#1677ff'
|
|
131
|
+
}
|
|
119
132
|
|
|
120
133
|
});
|
|
121
134
|
const emit = defineEmits(['onSubmit', 'onSuccess']);
|
|
@@ -143,7 +156,6 @@ const formState = reactive<formStateType>({
|
|
|
143
156
|
},
|
|
144
157
|
submitWorkNumber: submitWorkNumber.value,
|
|
145
158
|
});
|
|
146
|
-
|
|
147
159
|
const getValidTimeOptions = async () => {
|
|
148
160
|
let res = await Http.getValidTimeOptions();
|
|
149
161
|
validTimeOptions.value = res.body;
|
|
@@ -295,6 +307,12 @@ watch(() => open.value, (cur) => {
|
|
|
295
307
|
stepNodes.value = [];
|
|
296
308
|
}
|
|
297
309
|
})
|
|
310
|
+
|
|
311
|
+
const getPopupContainer = ():HTMLElement => {
|
|
312
|
+
const modalRoot = document.querySelector('.yqg-permission-modal-content');
|
|
313
|
+
|
|
314
|
+
return (modalRoot || document.body) as HTMLElement;
|
|
315
|
+
}
|
|
298
316
|
</script>
|
|
299
317
|
|
|
300
318
|
<style scoped>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
v-show="categoryValuesMap[item.id]?.length"
|
|
9
9
|
:rules="[{ required: true, message: t('pleaseChoose'), trigger: ['change', 'blur'] }]">
|
|
10
10
|
<TreeSelect treeCheckable treeDefaultExpandAll :tree-data="categoryValuesMap[item.id]" showSearch
|
|
11
|
-
|
|
11
|
+
allowClear v-model:value="item.attributeValueIds_view"
|
|
12
12
|
treeNodeFilterProp="attributeName" v-model:searchValue="searchValue"
|
|
13
13
|
:fieldNames="{ label: 'attributeName', value: 'id' }" treeNodeLabelProp="attributeName"
|
|
14
14
|
:show-checked-strategy="SHOW_PARENT">
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
64
|
|
|
65
|
-
<ApplyModal v-model="open" :permissionList="permissionList" :spining="loading" :workNumber="workNumber"
|
|
66
|
-
:defaultCheckedIds="defaultCheckedIds" :isAllChecked="isAllChecked"
|
|
67
|
-
@onSubmit="getPermissions">
|
|
65
|
+
<ApplyModal v-model="open" :permissionList="permissionList" :spining="loading" :workNumber="workNumber"
|
|
66
|
+
:zIndex="zIndex" :defaultCheckedIds="defaultCheckedIds" :isAllChecked="isAllChecked"
|
|
67
|
+
@onSuccess="() => emit('onSuccess')" @onSubmit="getPermissions" :color="color">
|
|
68
68
|
</ApplyModal>
|
|
69
|
-
|
|
70
69
|
</ConfigProvider>
|
|
70
|
+
|
|
71
71
|
</template>
|
|
72
72
|
<script lang="ts" setup>
|
|
73
73
|
import { ref, defineAsyncComponent, computed, watchEffect, watch } from 'vue';
|
|
@@ -79,6 +79,7 @@ import t from '../utils';
|
|
|
79
79
|
import useDraggable from '../hooks/useDragable';
|
|
80
80
|
import useStatus from '../hooks/useStatus';
|
|
81
81
|
import useFormat from '../hooks/useFormat';
|
|
82
|
+
import '../style/reset.css';
|
|
82
83
|
|
|
83
84
|
const STATUS_MAP = {
|
|
84
85
|
DEFAULT: 'DEFAULT',
|
|
@@ -95,7 +96,7 @@ const COM_TYPE = {
|
|
|
95
96
|
const RIGHT_DEFAULT = '10px';
|
|
96
97
|
|
|
97
98
|
// 重置 message 类名,避免被全局样式覆盖
|
|
98
|
-
message.config({ prefixCls: 'yqg-permission-message'
|
|
99
|
+
message.config({ prefixCls : 'yqg-permission-message'});
|
|
99
100
|
|
|
100
101
|
const ApplyModal = defineAsyncComponent(() => import('./apply-modal.vue'));
|
|
101
102
|
|
|
@@ -212,4 +213,5 @@ watch(() => props.locale, (cur, pre) => {
|
|
|
212
213
|
.crane-margin-right10 {
|
|
213
214
|
margin-right: 10px;
|
|
214
215
|
}
|
|
216
|
+
|
|
215
217
|
</style>
|