@yqg/permission 1.0.4-beta.0 → 1.0.6-beta.0
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/.arcconfig +8 -0
- package/.husky/commit-msg +20 -0
- package/.husky/pre-commit +4 -0
- package/README.md +126 -3
- package/arcanist/.phutil_module_cache +1 -0
- package/arcanist/__phutil_library_init__.php +3 -0
- package/arcanist/__phutil_library_map__.php +18 -0
- package/arcanist/lint/engine/YqgWebDiffLintEngine.php +68 -0
- package/commitlint.config.js +32 -0
- package/dist/{apply-modal-C7hVR1xJ.js → apply-modal-B779Z1yz.js} +1234 -1216
- package/dist/card.png +0 -0
- package/dist/{checkbox-item-Bf_S20_z.js → checkbox-item-CWDiWBTe.js} +804 -795
- package/dist/dialog.png +0 -0
- package/dist/image.png +0 -0
- package/dist/{index-B0kTXjfX.js → index-C1qXS-ty.js} +2 -2
- package/dist/index.js +2 -2
- package/dist/index.umd.cjs +52 -52
- package/dist/{yqg-permission-CbkviMn9.js → yqg-permission-CrityVMS.js} +446 -428
- package/eslint.config.js +26 -0
- package/package.json +10 -4
- package/public/card.png +0 -0
- package/public/dialog.png +0 -0
- package/public/image.png +0 -0
- package/src/App.vue +12 -3
- package/src/axios/axios.ts +1 -1
- package/src/components/apply-modal.vue +21 -6
- package/src/components/approval-steps.vue +10 -8
- package/src/components/checkbox-item.vue +23 -22
- package/src/components/success-modal.vue +16 -7
- package/src/components/yqg-permission.vue +28 -16
- package/src/i18n/zh-CH.ts +5 -1
- package/src/main.ts +1 -1
- package/src/typings/index.d.ts +2 -0
- package/src/yqg-permission/index.ts +2 -2
- package/tsconfig.app.json +10 -1
- package/tsconfig.json +2 -2
- package/dist/vite.svg +0 -1
- package/public/vite.svg +0 -1
package/eslint.config.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import typescriptEslintParser from '@typescript-eslint/parser';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
parser: typescriptEslintParser,
|
|
5
|
+
parserOptions: {
|
|
6
|
+
ecmaVersion: 2020,
|
|
7
|
+
sourceType: 'module',
|
|
8
|
+
},
|
|
9
|
+
plugins: ['@typescript-eslint', 'vue'],
|
|
10
|
+
extends: [
|
|
11
|
+
'plugin:@typescript-eslint/recommended',
|
|
12
|
+
'plugin:vue/vue3-recommended',
|
|
13
|
+
],
|
|
14
|
+
rules: {
|
|
15
|
+
'vue/no-multiple-template-root': 'off',
|
|
16
|
+
},
|
|
17
|
+
env: {
|
|
18
|
+
browser: true,
|
|
19
|
+
node: true,
|
|
20
|
+
},
|
|
21
|
+
settings: {
|
|
22
|
+
'import/resolver': {
|
|
23
|
+
typescript: {},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yqg/permission",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
"version": "1.0.6-beta.0",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"module": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
7
|
-
|
|
7
|
+
"publishConfig": {
|
|
8
8
|
"access": "public",
|
|
9
9
|
"registry": "https://registry.npmjs.org/"
|
|
10
10
|
},
|
|
@@ -15,13 +15,19 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@ant-design/icons-vue": "^7.0.1",
|
|
18
|
+
"@commitlint/cli": "^19.5.0",
|
|
19
|
+
"@commitlint/config-conventional": "^19.5.0",
|
|
18
20
|
"ant-design-vue": "4.x",
|
|
19
21
|
"axios": "^1.7.7",
|
|
20
22
|
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
21
23
|
"vue": "^3.5.12"
|
|
22
24
|
},
|
|
23
25
|
"devDependencies": {
|
|
26
|
+
"@typescript-eslint/parser": "^8.13.0",
|
|
24
27
|
"@vitejs/plugin-vue": "^5.1.4",
|
|
28
|
+
"eslint": "^9.14.0",
|
|
29
|
+
"husky": "^9",
|
|
30
|
+
"lint-staged": "^13.2.0",
|
|
25
31
|
"typescript": "~5.5.4",
|
|
26
32
|
"vite": "^5.4.9",
|
|
27
33
|
"vue-tsc": "^2.1.8"
|
package/public/card.png
ADDED
|
Binary file
|
|
Binary file
|
package/public/image.png
ADDED
|
Binary file
|
package/src/App.vue
CHANGED
|
@@ -8,7 +8,16 @@ type LocaleType = 'zh-CN' | 'en-US' | 'id-ID' | 'fil-PH';
|
|
|
8
8
|
const color = ref<string>('#1677ff');
|
|
9
9
|
const locale = ref<LocaleType>('zh-CN');
|
|
10
10
|
|
|
11
|
-
const permissions = reactive([
|
|
11
|
+
const permissions = reactive([
|
|
12
|
+
'CRANE.ROLE.QUERY',
|
|
13
|
+
'CRANE.ROLE.CREATE',
|
|
14
|
+
'CRANE.ROLE.UPDATE',
|
|
15
|
+
'CRANE.ROLE.DELETE',
|
|
16
|
+
'CRANE.ROLE.PERMISSION_ASSIGN',
|
|
17
|
+
'CRANE.ROLE.EMPLOYEE_ASSIGN',
|
|
18
|
+
'CRANE.ROLE.DETAIL_QUERY',
|
|
19
|
+
'CRANE.ROLE.EXPORT',
|
|
20
|
+
]);
|
|
12
21
|
// const permissions = reactive(['CRANE.BUSINESS.QUERY', 'RANE.BUSINESS.CREATE', 'CRANE.BUSINESS.UPDATE', 'CRANE.BUSINESS.DELETE']);
|
|
13
22
|
const changeColor = () => {
|
|
14
23
|
color.value = color.value === '#f00' ? '#1677ff' : '#f00';
|
|
@@ -31,8 +40,8 @@ const changeLocale = () => {
|
|
|
31
40
|
<!-- 05184 -->
|
|
32
41
|
<yqg-permission
|
|
33
42
|
:permissions="permissions"
|
|
34
|
-
workNumber="
|
|
35
|
-
businessCode="
|
|
43
|
+
workNumber="05181"
|
|
44
|
+
businessCode="CRANE"
|
|
36
45
|
:color="color"
|
|
37
46
|
:locale="locale"
|
|
38
47
|
@success="() => {console.log('成功')}"
|
package/src/axios/axios.ts
CHANGED
|
@@ -8,7 +8,7 @@ const YQG_NOT_LOGIN = 10008;
|
|
|
8
8
|
axios.defaults.withCredentials = true;
|
|
9
9
|
// instance.defaults.paramsSerializer = (params) => qs.stringify(params, { arrayFormat: 'repeat' });
|
|
10
10
|
|
|
11
|
-
axios.defaults.headers.common['Accept-Language'] = localStorage.getItem('permission_locale')
|
|
11
|
+
axios.defaults.headers.common['Accept-Language'] = localStorage.getItem('permission_locale');
|
|
12
12
|
|
|
13
13
|
axios.interceptors.response.use(
|
|
14
14
|
(res: any) => {
|
|
@@ -34,10 +34,16 @@
|
|
|
34
34
|
|
|
35
35
|
<FormItem
|
|
36
36
|
name="applyReason"
|
|
37
|
-
:label="t('applyReason')"
|
|
38
|
-
:rules="[{
|
|
37
|
+
:label="t('applyReason')"
|
|
38
|
+
:rules="[{
|
|
39
|
+
required: true, message: t('reasonPlaceholder'), trigger: ['change', 'blur']
|
|
40
|
+
}, {
|
|
41
|
+
max: 300, message: t('maxLengthTips', {length: 300}), trigger: ['change', 'blur']
|
|
42
|
+
}]">
|
|
39
43
|
<Textarea
|
|
40
|
-
v-model:value="formState.applyReason"
|
|
44
|
+
v-model:value.trim="formState.applyReason"
|
|
45
|
+
show-count
|
|
46
|
+
:maxlength="300"
|
|
41
47
|
:placeholder="t('applyReasonPlaceholder')"
|
|
42
48
|
:auto-size="{ minRows: 2, maxRows: 5 }">
|
|
43
49
|
</Textarea>
|
|
@@ -62,7 +68,6 @@
|
|
|
62
68
|
</template>
|
|
63
69
|
<script lang="ts" setup>
|
|
64
70
|
import {
|
|
65
|
-
defineModel,
|
|
66
71
|
reactive,
|
|
67
72
|
defineAsyncComponent,
|
|
68
73
|
toRef,
|
|
@@ -77,6 +82,7 @@
|
|
|
77
82
|
CheckboxGroup,
|
|
78
83
|
Textarea,
|
|
79
84
|
Tag,
|
|
85
|
+
message
|
|
80
86
|
} from 'ant-design-vue';
|
|
81
87
|
import SuccessModal from './success-modal.vue';
|
|
82
88
|
import ApprovalSteps from './approval-steps.vue';
|
|
@@ -135,9 +141,13 @@
|
|
|
135
141
|
} else {
|
|
136
142
|
formState.applyReason += `、${item}`;
|
|
137
143
|
}
|
|
144
|
+
formRef.value.validateFields(['applyReason']);
|
|
138
145
|
}
|
|
139
146
|
|
|
140
147
|
const handleOk = async() => {
|
|
148
|
+
if (formState.roleIds.length > 5) {
|
|
149
|
+
return message.warning(t('maxCountTips', {count: 5}));
|
|
150
|
+
}
|
|
141
151
|
formRef.value.validate().then(async() => {
|
|
142
152
|
loading.value = true;
|
|
143
153
|
const params = getParams();
|
|
@@ -145,8 +155,8 @@
|
|
|
145
155
|
const url = res?.body?.oaFlowUrl;
|
|
146
156
|
open.value = false;
|
|
147
157
|
loading.value = false;
|
|
148
|
-
|
|
149
|
-
successModal.value?.countDown(url);
|
|
158
|
+
|
|
159
|
+
successModal.value?.countDown(url, () => emit('onSuccess'));
|
|
150
160
|
})
|
|
151
161
|
};
|
|
152
162
|
|
|
@@ -161,6 +171,11 @@
|
|
|
161
171
|
}
|
|
162
172
|
|
|
163
173
|
const onChangeHandler = throttle(async () => {
|
|
174
|
+
if (formState.roleIds.length > 5) {
|
|
175
|
+
formState.roleIds.pop();
|
|
176
|
+
return message.warning(t('maxCountTips', {count: 5}));
|
|
177
|
+
}
|
|
178
|
+
|
|
164
179
|
if (!formState.roleIds.length) {
|
|
165
180
|
stepNodes.value = [];
|
|
166
181
|
return;
|
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
<div v-if="stepNodes?.length > 1" class="crane-step-wraper">
|
|
3
3
|
<div v-for="(item, index) in stepNodes" :key="item.auditorName" class="crane-step-node">
|
|
4
4
|
<span style="white-space: nowrap;">
|
|
5
|
-
{{ item.auditorName }}
|
|
5
|
+
{{ item.auditorName }}
|
|
6
|
+
<Popover v-if="item.employeeNameList?.length">
|
|
7
|
+
<template #content>
|
|
8
|
+
<div style="max-width: 400px;">
|
|
9
|
+
{{ item.employeeNameList.join('、')}}
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
<ExclamationCircleOutlined style="margin: 0 2px; color: #1677ff;"/>
|
|
13
|
+
</Popover>
|
|
14
|
+
{{ getSubTip(index) }}
|
|
6
15
|
</span>
|
|
7
16
|
|
|
8
|
-
<Popover v-if="item.employeeNameList?.length">
|
|
9
|
-
<template #content>
|
|
10
|
-
{{item.auditorName}}:{{ item.employeeNameList.join(',')}}
|
|
11
|
-
</template>
|
|
12
|
-
<ExclamationCircleOutlined style="margin: 0 2px"/>
|
|
13
|
-
</Popover>
|
|
14
|
-
|
|
15
17
|
<img
|
|
16
18
|
v-if="index !== stepNodes.length - 1"
|
|
17
19
|
:src="arrowImg"
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="crane-checkbox-line">
|
|
3
|
-
<Checkbox
|
|
3
|
+
<Checkbox
|
|
4
|
+
:value="item.roleId"
|
|
5
|
+
:disabled="['OWNER', 'PENDING', 'NO'].includes(props.item.businessApplyType)"
|
|
6
|
+
@change="onCheck">
|
|
4
7
|
<div class="crane-flex-center crane-checkbox-label">
|
|
5
8
|
<Tag
|
|
6
9
|
v-if="item.securityLevel"
|
|
@@ -19,12 +22,25 @@
|
|
|
19
22
|
<span class="crane-text-overflow">{{ item.name }}</span>
|
|
20
23
|
</Popover>
|
|
21
24
|
<Tag
|
|
22
|
-
v-if="item.businessApplyType"
|
|
25
|
+
v-if="item.businessApplyType && item.businessApplyType !== 'TEMP_OWNER'"
|
|
23
26
|
:bordered="false"
|
|
24
27
|
class="crane-tag-position crane-margin-left-4 crane-margin-right-0"
|
|
25
|
-
:class="item.businessApplyType
|
|
26
|
-
{{ statusMap[item.businessApplyType]
|
|
28
|
+
:class="['PENDING', 'TEMP_OWNER'].includes(item.businessApplyType) ? '' : 'crane-disabled-color'">
|
|
29
|
+
{{ statusMap[item.businessApplyType] }}
|
|
27
30
|
</Tag>
|
|
31
|
+
<Popover>
|
|
32
|
+
<template #content>
|
|
33
|
+
{{t('lastDays', {count: item?.ownStatusVO?.dayDiff})}}
|
|
34
|
+
</template>
|
|
35
|
+
<Tag
|
|
36
|
+
v-if="item.businessApplyType === 'TEMP_OWNER'"
|
|
37
|
+
:bordered="false"
|
|
38
|
+
class="crane-tag-position crane-margin-left-4 crane-margin-right-0"
|
|
39
|
+
:class="['PENDING'].includes(item.businessApplyType) ? '' : 'crane-disabled-color'">
|
|
40
|
+
{{ statusMap[item.businessApplyType] }}
|
|
41
|
+
</Tag>
|
|
42
|
+
</Popover>
|
|
43
|
+
|
|
28
44
|
</div>
|
|
29
45
|
</Checkbox>
|
|
30
46
|
|
|
@@ -39,7 +55,7 @@
|
|
|
39
55
|
<template #content>
|
|
40
56
|
{{t('adaptDepartment')}}:{{ item.relatedDepartments.map((item: any) => {
|
|
41
57
|
return item.name;
|
|
42
|
-
}).join('
|
|
58
|
+
}).join('、') }}
|
|
43
59
|
</template>
|
|
44
60
|
<span class="crane-flex-center crane-margin-left-4">
|
|
45
61
|
<img :src="departmentImg" height="14" width="14">
|
|
@@ -47,7 +63,7 @@
|
|
|
47
63
|
</span>
|
|
48
64
|
</Popover>
|
|
49
65
|
|
|
50
|
-
<span v-
|
|
66
|
+
<span v-if="checkedIds.includes(item.roleId)" class="crane-week-color crane-margin-left-12">
|
|
51
67
|
{{t('availableTime')}}:
|
|
52
68
|
<Select
|
|
53
69
|
v-model:value="validTime"
|
|
@@ -81,21 +97,6 @@
|
|
|
81
97
|
text: t('levels.L3')
|
|
82
98
|
},
|
|
83
99
|
};
|
|
84
|
-
|
|
85
|
-
const statusMap:StatusMapType = {
|
|
86
|
-
PENDING: {
|
|
87
|
-
color: 'orange',
|
|
88
|
-
text: t('status.PENDING')
|
|
89
|
-
},
|
|
90
|
-
OWNER: {
|
|
91
|
-
color: 'green',
|
|
92
|
-
text: t('status.OWNER')
|
|
93
|
-
},
|
|
94
|
-
NO: {
|
|
95
|
-
color: 'red',
|
|
96
|
-
text: t('status.NO')
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
100
|
|
|
100
101
|
let props = defineProps({
|
|
101
102
|
item: {
|
|
@@ -112,7 +113,7 @@
|
|
|
112
113
|
}
|
|
113
114
|
});
|
|
114
115
|
const timeStatusOptions = formatOptions('availiables');
|
|
115
|
-
|
|
116
|
+
const statusMap = t('status');
|
|
116
117
|
const validTime = ref('');
|
|
117
118
|
|
|
118
119
|
//1登录人所在部门 = 权限适用范围,都默认90天,不需要区分等级和类型,
|
|
@@ -9,22 +9,31 @@
|
|
|
9
9
|
|
|
10
10
|
const [modal, contextHolder] = Modal.useModal();
|
|
11
11
|
|
|
12
|
-
const countDown = (url: string) => {
|
|
12
|
+
const countDown = (url: string, callback?: ()=>void) => {
|
|
13
13
|
let secondsToGo = 10;
|
|
14
14
|
const modal1 = modal.confirm({
|
|
15
15
|
title: t('resoultTitle'),
|
|
16
16
|
content: t('successTips'),
|
|
17
17
|
cancelText: `${t('close')}(${secondsToGo}s)`,
|
|
18
18
|
okText:`${t('viewApprovalDetail')}>>`,
|
|
19
|
-
wrapClassName: '
|
|
19
|
+
wrapClassName: 'yqg-permission-modal-wrap',
|
|
20
20
|
icon: createVNode(CheckCircleFilled, {style: 'color: #52c41a;'}),
|
|
21
21
|
onOk: () => {
|
|
22
22
|
window.open(url);
|
|
23
|
-
|
|
23
|
+
modal1.destroy();
|
|
24
|
+
if (callback) {
|
|
25
|
+
callback();
|
|
26
|
+
} else {
|
|
27
|
+
location.reload();
|
|
28
|
+
}
|
|
24
29
|
},
|
|
25
30
|
onCancel: () => {
|
|
26
31
|
modal1.destroy();
|
|
27
|
-
|
|
32
|
+
if (callback) {
|
|
33
|
+
callback();
|
|
34
|
+
} else {
|
|
35
|
+
location.reload();
|
|
36
|
+
}
|
|
28
37
|
},
|
|
29
38
|
});
|
|
30
39
|
|
|
@@ -44,8 +53,8 @@
|
|
|
44
53
|
defineExpose({countDown});
|
|
45
54
|
|
|
46
55
|
</script>
|
|
47
|
-
<style
|
|
48
|
-
|
|
49
|
-
text-align: center;
|
|
56
|
+
<style>
|
|
57
|
+
.yqg-permission-modal-wrap .yqg-permission-modal-confirm-btns {
|
|
58
|
+
text-align: center!important;
|
|
50
59
|
}
|
|
51
60
|
</style>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
<ConfigProvider
|
|
3
3
|
v-if="allPermissions.length"
|
|
4
4
|
prefixCls="yqg-permission"
|
|
5
|
-
iconPrefixCls="yqg-permission"
|
|
6
5
|
:theme="{
|
|
7
6
|
token: {
|
|
8
7
|
colorPrimary: props.color,
|
|
@@ -17,13 +16,14 @@
|
|
|
17
16
|
</div>
|
|
18
17
|
</template>
|
|
19
18
|
<template v-else>
|
|
20
|
-
|
|
21
|
-
:src="curStatus.imageUrl"
|
|
22
|
-
height="200"
|
|
23
|
-
width="200"
|
|
24
|
-
style="margin-top: calc(50vh - 273px)" />
|
|
19
|
+
|
|
25
20
|
<!-- 可申请 -->
|
|
26
21
|
<template v-if="curStatus.status === statusMap.DEFAULT">
|
|
22
|
+
<img
|
|
23
|
+
:src="curStatus.imageUrl"
|
|
24
|
+
height="200"
|
|
25
|
+
width="200"
|
|
26
|
+
style="margin-top: calc(50vh - 273px)" />
|
|
27
27
|
<div class="crane-margin10">
|
|
28
28
|
{{ t('unavailableTips') }}
|
|
29
29
|
</div>
|
|
@@ -33,6 +33,11 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
<!-- 审批中 -->
|
|
35
35
|
<template v-if="curStatus.status === statusMap.PENDING">
|
|
36
|
+
<img
|
|
37
|
+
:src="curStatus.imageUrl"
|
|
38
|
+
height="200"
|
|
39
|
+
width="200"
|
|
40
|
+
style="margin-top: calc(50vh - 273px)" />
|
|
36
41
|
<div class="crane-margin10">
|
|
37
42
|
<span
|
|
38
43
|
class="crane-unapply"
|
|
@@ -47,14 +52,21 @@
|
|
|
47
52
|
</div>
|
|
48
53
|
</template>
|
|
49
54
|
<!-- 不可申请 -->
|
|
50
|
-
<div v-if="curStatus.status === statusMap.NO" class="crane-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
<div v-if="curStatus.status === statusMap.NO" class="crane-wraper">
|
|
56
|
+
<img
|
|
57
|
+
:src="curStatus.imageUrl"
|
|
58
|
+
height="200"
|
|
59
|
+
width="200"
|
|
60
|
+
style="margin-top: calc(50vh - 273px)" />
|
|
61
|
+
<div class="crane-margin10">
|
|
62
|
+
{{ t('unapplyTips') }}
|
|
63
|
+
<Popover>
|
|
64
|
+
<template #content>
|
|
65
|
+
<div style="max-width: 400px;">{{t('manager')}}: {{ curStatus.tips }}</div>
|
|
66
|
+
</template>
|
|
67
|
+
<span style="color: #1677ff;">{{t('callManager') }}</span>
|
|
68
|
+
</Popover>
|
|
69
|
+
</div>
|
|
58
70
|
</div>
|
|
59
71
|
</template>
|
|
60
72
|
</div>
|
|
@@ -142,7 +154,7 @@
|
|
|
142
154
|
flattenData(data);
|
|
143
155
|
// 需要排序,规则:businessApplyType 为 null 在前面, PENDING. OWNER 在中间, NO 在后面
|
|
144
156
|
// 然后再根据 L1, L2, L3 排序
|
|
145
|
-
const sort = [ null, 'PENDING', 'OWNER', 'NO'];
|
|
157
|
+
const sort = [ null, 'TEMP_OWNER', 'PENDING', 'OWNER', 'NO'];
|
|
146
158
|
const levelSort = ['L1', 'L2', 'L3'];
|
|
147
159
|
arr.sort((a, b) => {
|
|
148
160
|
return sort.indexOf(a.businessApplyType) - sort.indexOf(b.businessApplyType) || levelSort.indexOf(a.securityLevel) - levelSort.indexOf(b.securityLevel);
|
|
@@ -173,7 +185,7 @@
|
|
|
173
185
|
return {
|
|
174
186
|
imageUrl: noauthority,
|
|
175
187
|
status: statusMap.NO,
|
|
176
|
-
tips: data[0].admin?.map((item) => item.name)?.join('、'),
|
|
188
|
+
tips: data[0].admin?.map((item) => `${item.name}(${item.departmentName})`)?.join('、'),
|
|
177
189
|
};
|
|
178
190
|
};
|
|
179
191
|
return {
|
package/src/i18n/zh-CH.ts
CHANGED
|
@@ -28,6 +28,9 @@ export default {
|
|
|
28
28
|
availableTime: '有效期',
|
|
29
29
|
selectPlaceholder: '请选择权限点',
|
|
30
30
|
reasonPlaceholder: '请输入申请理由',
|
|
31
|
+
maxCountTips: '一次最多只可申请{count}个权限',
|
|
32
|
+
maxLengthTips: '最多{length}个字符',
|
|
33
|
+
lastDays: '{count}天后到期',
|
|
31
34
|
availiables: {
|
|
32
35
|
SEVEN_DAYS: '7天',
|
|
33
36
|
THIRTY_DAYS: '30天',
|
|
@@ -43,7 +46,8 @@ export default {
|
|
|
43
46
|
status: {
|
|
44
47
|
PENDING: '审批中',
|
|
45
48
|
NO: '不可申请',
|
|
46
|
-
OWNER: '
|
|
49
|
+
OWNER: '永久拥有',
|
|
50
|
+
TEMP_OWNER: '临时拥有',
|
|
47
51
|
},
|
|
48
52
|
operationType: {
|
|
49
53
|
QUERY: '查询',
|
package/src/main.ts
CHANGED
package/src/typings/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ declare enum LevelType {
|
|
|
7
7
|
declare enum StatusType {
|
|
8
8
|
PENDING = 'PENDING',
|
|
9
9
|
OWNER = 'OWNER',
|
|
10
|
+
TEMP_OWNER = 'TEMP_OWNER',
|
|
10
11
|
NO = 'NO'
|
|
11
12
|
};
|
|
12
13
|
|
|
@@ -25,6 +26,7 @@ declare type PermissionType = {
|
|
|
25
26
|
businessApplyType: StatusType;
|
|
26
27
|
oaFlowUrl?: string;
|
|
27
28
|
children?: PermissionListType;
|
|
29
|
+
ownStatusVO: any;
|
|
28
30
|
admin?: any[];
|
|
29
31
|
};
|
|
30
32
|
declare type PermissionListType = PermissionType[];
|
|
@@ -18,7 +18,7 @@ interface Options {
|
|
|
18
18
|
interface YqgPermissionType {
|
|
19
19
|
tagName: string;
|
|
20
20
|
hasInit: boolean;
|
|
21
|
-
|
|
21
|
+
init: (options: Options) => void;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
class YqgPermission implements YqgPermissionType {
|
|
@@ -30,7 +30,7 @@ class YqgPermission implements YqgPermissionType {
|
|
|
30
30
|
this.hasInit = false;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
init(options?: Options): void {
|
|
34
34
|
if (!window || !window.customElements) {
|
|
35
35
|
console.error('yqg-permission is not supported in this environment');
|
|
36
36
|
return;
|
package/tsconfig.app.json
CHANGED
|
@@ -21,5 +21,14 @@
|
|
|
21
21
|
"noFallthroughCasesInSwitch": true
|
|
22
22
|
},
|
|
23
23
|
"composite": true,
|
|
24
|
-
"include": [
|
|
24
|
+
"include": [
|
|
25
|
+
"src/**/*.ts",
|
|
26
|
+
"src/**/*.d.ts",
|
|
27
|
+
"src/**/*.tsx",
|
|
28
|
+
"src/**/*.vue"
|
|
29
|
+
],
|
|
30
|
+
"exclude": [
|
|
31
|
+
"node_modules",
|
|
32
|
+
"vite.config.ts" // 如果不需要解析 vite.config.ts
|
|
33
|
+
],
|
|
25
34
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": [],
|
|
3
|
-
"references": [{ "path": "./tsconfig.app.json" }
|
|
3
|
+
"references": [{ "path": "./tsconfig.app.json" }],
|
|
4
4
|
"path": {
|
|
5
5
|
"@src": "./src"
|
|
6
6
|
},
|
|
7
7
|
"compilerOptions": {
|
|
8
8
|
"typeRoots": ["node_modules/ant-design-vue/typings", "./src/typings"]
|
|
9
|
-
}
|
|
9
|
+
},
|
|
10
10
|
}
|
package/dist/vite.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/public/vite.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|