@yqg/permission 1.0.8-beta.0 → 1.0.8
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-DEXDzX6B.js → apply-modal-AV3_k_ue.js} +496 -494
- package/dist/{checkbox-item-D5r_FlIc.js → checkbox-item-Bsy25r5N.js} +425 -425
- package/dist/{index-DsIoPFuc.js → index-CUxQJBEu.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/index.umd.cjs +49 -49
- package/dist/{yqg-permission-Cx73HCrN.js → yqg-permission-CijpI0ru.js} +16 -10
- package/package.json +4 -6
- package/src/App.vue +9 -4
- package/src/axios/index.ts +1 -1
- package/src/components/apply-modal.vue +9 -2
- package/src/components/checkbox-item.vue +3 -2
- package/src/components/success-modal.vue +6 -6
- package/src/components/yqg-permission.vue +1 -0
- package/src/i18n/en-US.ts +8 -3
- package/src/i18n/zh-CH.ts +3 -2
- package/src/typings/index.d.ts +3 -0
- package/src/vite-env.d.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as Qe, i as Kn, C as ug, T as Gs, d as k, r as Xe, o as Pe, a as Vn, b as MA, w as V, g as st, p as fe, c as D, e as pe, f as G, u as K, s as Y, h as Se, j as Ge, t as gg, k as I, l as qt, m as Ws, n as fg, q as qn, v as Ks, x as Zt, y as Fe, z as dg, A as pg, B as Pi, D as Cg, E as Vs, G as RA, H as qs, I as Bg, J as hg, K as Bt, L as Si, M as co, N as ht, O as He, P as En, Q as nt, R as vn, S as Eg, U as vg } from "./index-
|
|
1
|
+
import { F as Qe, i as Kn, C as ug, T as Gs, d as k, r as Xe, o as Pe, a as Vn, b as MA, w as V, g as st, p as fe, c as D, e as pe, f as G, u as K, s as Y, h as Se, j as Ge, t as gg, k as I, l as qt, m as Ws, n as fg, q as qn, v as Ks, x as Zt, y as Fe, z as dg, A as pg, B as Pi, D as Cg, E as Vs, G as RA, H as qs, I as Bg, J as hg, K as Bt, L as Si, M as co, N as ht, O as He, P as En, Q as nt, R as vn, S as Eg, U as vg } from "./index-CUxQJBEu.js";
|
|
2
2
|
function Mn(e) {
|
|
3
3
|
"@babel/helpers - typeof";
|
|
4
4
|
return Mn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
@@ -16416,7 +16416,7 @@ ne.interceptors.response.use(
|
|
|
16416
16416
|
return pt.error(t), Promise.reject(e);
|
|
16417
16417
|
}
|
|
16418
16418
|
);
|
|
16419
|
-
const Wr = "/
|
|
16419
|
+
const Wr = "/crane", Gy = {
|
|
16420
16420
|
getPermissions: (e) => ne.get(`${Wr}/permission/apply`, { params: e }),
|
|
16421
16421
|
getFlowPreview: (e) => ne.post(`${Wr}/permission/apply/oa/flow/submit/preview`, e),
|
|
16422
16422
|
submitApply: (e) => ne.post(`${Wr}/permission/apply/oa/flow/submit`, e)
|
|
@@ -16426,7 +16426,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16426
16426
|
applyReason: "申请理由",
|
|
16427
16427
|
approvalProcess: "审批流程",
|
|
16428
16428
|
applyReason1: "新入职员工申请",
|
|
16429
|
-
applyReason2: "
|
|
16429
|
+
applyReason2: "项目需要",
|
|
16430
16430
|
applyReason3: "数据查询与分析",
|
|
16431
16431
|
applyReasonPlaceholder: "请尽可能详细描述申请理由",
|
|
16432
16432
|
cancel: "取消",
|
|
@@ -16442,7 +16442,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16442
16442
|
adaptDepartment: "适用部门",
|
|
16443
16443
|
noApprovalProcess: "无审批流程",
|
|
16444
16444
|
excessTips: "一次最多可申请{number}个权限",
|
|
16445
|
-
unavailableTips: "
|
|
16445
|
+
unavailableTips: "您暂无权限查看/操作该页面,请点击下方按钮进行申请",
|
|
16446
16446
|
appliedTips: "权限已申请,正在{status}...",
|
|
16447
16447
|
unapplyTips: "您暂无权限查看/操作该页面,且该页面中没有您可以申请的权限,",
|
|
16448
16448
|
callManager: "如有需要请联系系统管理员",
|
|
@@ -16450,6 +16450,10 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16450
16450
|
availableTime: "有效期",
|
|
16451
16451
|
selectPlaceholder: "请选择权限点",
|
|
16452
16452
|
reasonPlaceholder: "请输入申请理由",
|
|
16453
|
+
maxCountTips: "一次最多只可申请{count}个权限",
|
|
16454
|
+
maxLengthTips: "最多{length}个字符",
|
|
16455
|
+
lastDays: "{count}天后到期",
|
|
16456
|
+
taday: "今天到期",
|
|
16453
16457
|
availiables: {
|
|
16454
16458
|
SEVEN_DAYS: "7天",
|
|
16455
16459
|
THIRTY_DAYS: "30天",
|
|
@@ -16465,7 +16469,8 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16465
16469
|
status: {
|
|
16466
16470
|
PENDING: "审批中",
|
|
16467
16471
|
NO: "不可申请",
|
|
16468
|
-
OWNER: "
|
|
16472
|
+
OWNER: "永久拥有",
|
|
16473
|
+
TEMP_OWNER: "临时拥有"
|
|
16469
16474
|
},
|
|
16470
16475
|
operationType: {
|
|
16471
16476
|
QUERY: "查询",
|
|
@@ -16477,7 +16482,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16477
16482
|
applyReason: "申请理由",
|
|
16478
16483
|
approvalProcess: "审批流程",
|
|
16479
16484
|
applyReason1: "新入职员工申请",
|
|
16480
|
-
applyReason2: "
|
|
16485
|
+
applyReason2: "项目需要",
|
|
16481
16486
|
applyReason3: "数据查询与分析",
|
|
16482
16487
|
applyReasonPlaceholder: "请尽可能详细描述申请理由",
|
|
16483
16488
|
cancel: "取消",
|
|
@@ -16493,7 +16498,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16493
16498
|
adaptDepartment: "适用部门",
|
|
16494
16499
|
noApprovalProcess: "无审批流程",
|
|
16495
16500
|
excessTips: "一次最多可申请{number}个权限",
|
|
16496
|
-
unavailableTips: "
|
|
16501
|
+
unavailableTips: "您暂无权限查看/操作该页面,请点击下方按钮进行申请",
|
|
16497
16502
|
appliedTips: "权限已申请,正在{status}...",
|
|
16498
16503
|
unapplyTips: "您暂无权限查看/操作该页面,且该页面中没有您可以申请的权限,",
|
|
16499
16504
|
callManager: "如有需要请联系系统管理员",
|
|
@@ -16504,6 +16509,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16504
16509
|
maxCountTips: "一次最多只可申请{count}个权限",
|
|
16505
16510
|
maxLengthTips: "最多{length}个字符",
|
|
16506
16511
|
lastDays: "{count}天后到期",
|
|
16512
|
+
taday: "今天到期",
|
|
16507
16513
|
availiables: {
|
|
16508
16514
|
SEVEN_DAYS: "7天",
|
|
16509
16515
|
THIRTY_DAYS: "30天",
|
|
@@ -16584,7 +16590,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16584
16590
|
emits: ["onSuccess"],
|
|
16585
16591
|
setup(e, { emit: t }) {
|
|
16586
16592
|
const n = vg(
|
|
16587
|
-
() => import("./apply-modal-
|
|
16593
|
+
() => import("./apply-modal-AV3_k_ue.js").then((h) => h.a)
|
|
16588
16594
|
), o = {
|
|
16589
16595
|
DEFAULT: "DEFAULT",
|
|
16590
16596
|
PENDING: "PENDING",
|
|
@@ -16637,7 +16643,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16637
16643
|
let v = await Gy.getPermissions(h);
|
|
16638
16644
|
s.value = u(v.body || []), l.value = g(s.value);
|
|
16639
16645
|
}, C = () => {
|
|
16640
|
-
i.value = !i.value;
|
|
16646
|
+
p(), i.value = !i.value;
|
|
16641
16647
|
};
|
|
16642
16648
|
return Se(p), V(() => r.locale, (h, v) => {
|
|
16643
16649
|
h !== v && localStorage.setItem("permission_locale", r.locale);
|
|
@@ -16762,7 +16768,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16762
16768
|
for (const [o, r] of t)
|
|
16763
16769
|
n[o] = r;
|
|
16764
16770
|
return n;
|
|
16765
|
-
}, sw = /* @__PURE__ */ aw(iw, [["__scopeId", "data-v-
|
|
16771
|
+
}, sw = /* @__PURE__ */ aw(iw, [["__scopeId", "data-v-debef759"]]), xw = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
16766
16772
|
__proto__: null,
|
|
16767
16773
|
default: sw
|
|
16768
16774
|
}, Symbol.toStringTag, { value: "Module" }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yqg/permission",
|
|
3
|
-
"version": "1.0.8
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -13,16 +13,14 @@
|
|
|
13
13
|
"dev": "vite",
|
|
14
14
|
"preview": "vite preview"
|
|
15
15
|
},
|
|
16
|
-
"
|
|
17
|
-
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@ant-design/icons-vue": "^7.0.1",
|
|
18
18
|
"@commitlint/cli": "^19.5.0",
|
|
19
19
|
"@commitlint/config-conventional": "^19.5.0",
|
|
20
20
|
"ant-design-vue": "4.x",
|
|
21
21
|
"axios": "^1.7.7",
|
|
22
22
|
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
23
|
-
"vue": "^3.5.12"
|
|
24
|
-
},
|
|
25
|
-
"devDependencies": {
|
|
23
|
+
"vue": "^3.5.12",
|
|
26
24
|
"@typescript-eslint/parser": "^8.13.0",
|
|
27
25
|
"@vitejs/plugin-vue": "^5.1.4",
|
|
28
26
|
"eslint": "^9.14.0",
|
package/src/App.vue
CHANGED
|
@@ -8,9 +8,14 @@ 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([
|
|
12
|
-
'CRANE.
|
|
13
|
-
|
|
11
|
+
const permissions = reactive(['CRANE.ROLE.QUERY',
|
|
12
|
+
'CRANE.ROLE.CREATE',
|
|
13
|
+
'CRANE.ROLE.UPDATE',
|
|
14
|
+
'CRANE.ROLE.DELETE',
|
|
15
|
+
'CRANE.ROLE.PERMISSION_ASSIGN',
|
|
16
|
+
'CRANE.ROLE.EMPLOYEE_ASSIGN',
|
|
17
|
+
'CRANE.ROLE.DETAIL_QUERY',
|
|
18
|
+
'CRANE.ROLE.EXPORT']);
|
|
14
19
|
// const permissions = reactive(['CRANE.BUSINESS.QUERY', 'RANE.BUSINESS.CREATE', 'CRANE.BUSINESS.UPDATE', 'CRANE.BUSINESS.DELETE']);
|
|
15
20
|
const changeColor = () => {
|
|
16
21
|
color.value = color.value === '#f00' ? '#1677ff' : '#f00';
|
|
@@ -33,7 +38,7 @@ const changeLocale = () => {
|
|
|
33
38
|
<!-- 05184 -->
|
|
34
39
|
<yqg-permission
|
|
35
40
|
:permissions="permissions"
|
|
36
|
-
workNumber="
|
|
41
|
+
workNumber="EX03385"
|
|
37
42
|
businessCode="CRANE"
|
|
38
43
|
:color="color"
|
|
39
44
|
:locale="locale"
|
package/src/axios/index.ts
CHANGED
|
@@ -173,8 +173,7 @@
|
|
|
173
173
|
|
|
174
174
|
const onChangeHandler = throttle(async () => {
|
|
175
175
|
if (formState.roleIds.length > 5) {
|
|
176
|
-
|
|
177
|
-
return message.warning(t('maxCountTips', {count: 5}));
|
|
176
|
+
return;
|
|
178
177
|
}
|
|
179
178
|
|
|
180
179
|
if (!formState.roleIds.length) {
|
|
@@ -187,6 +186,14 @@
|
|
|
187
186
|
stepNodes.value = res?.body?.nodes || [];
|
|
188
187
|
}, 0)
|
|
189
188
|
|
|
189
|
+
watch(() => formState.roleIds, (val) => {
|
|
190
|
+
// 写到watch里避免闪烁
|
|
191
|
+
if (val.length > 5) {
|
|
192
|
+
formState.roleIds.pop();
|
|
193
|
+
message.warning(t('maxCountTips', {count: 5}));
|
|
194
|
+
}
|
|
195
|
+
})
|
|
196
|
+
|
|
190
197
|
watch(() => open.value, (cur) => {
|
|
191
198
|
if (cur) {
|
|
192
199
|
formRef.value?.resetFields();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="crane-checkbox-line">
|
|
3
3
|
<Checkbox
|
|
4
|
-
:value="item.roleId"
|
|
4
|
+
:value="item.roleId"
|
|
5
5
|
:disabled="['OWNER', 'PENDING', 'NO'].includes(props.item.businessApplyType)"
|
|
6
6
|
@change="onCheck">
|
|
7
7
|
<div class="crane-flex-center crane-checkbox-label">
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
</Tag>
|
|
31
31
|
<Popover>
|
|
32
32
|
<template #content>
|
|
33
|
-
{{t('lastDays', {count: item?.ownStatusVO?.dayDiff})}}
|
|
33
|
+
<span v-if="item?.ownStatusVO?.dayDiff>0">{{t('lastDays', {count: item?.ownStatusVO?.dayDiff})}}</span>
|
|
34
|
+
<span v-else>{{ t('taday') }}</span>
|
|
34
35
|
</template>
|
|
35
36
|
<Tag
|
|
36
37
|
v-if="item.businessApplyType === 'TEMP_OWNER'"
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
onOk: () => {
|
|
22
22
|
window.open(url);
|
|
23
23
|
modal1.destroy();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
callback && callback();
|
|
25
|
+
window.YQG_PERMISSION_CALLBACK && window.YQG_PERMISSION_CALLBACK();
|
|
26
|
+
if (!window.YQG_PERMISSION_CALLBACK && !callback) {
|
|
27
27
|
location.reload();
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
onCancel: () => {
|
|
31
31
|
modal1.destroy();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
callback && callback();
|
|
33
|
+
window.YQG_PERMISSION_CALLBACK && window.YQG_PERMISSION_CALLBACK();
|
|
34
|
+
if (!window.YQG_PERMISSION_CALLBACK && !callback) {
|
|
35
35
|
location.reload();
|
|
36
36
|
}
|
|
37
37
|
},
|
package/src/i18n/en-US.ts
CHANGED
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
applyReason: '申请理由',
|
|
5
5
|
approvalProcess: '审批流程',
|
|
6
6
|
applyReason1: '新入职员工申请',
|
|
7
|
-
applyReason2: '
|
|
7
|
+
applyReason2: '项目需要',
|
|
8
8
|
applyReason3: '数据查询与分析',
|
|
9
9
|
applyReasonPlaceholder: '请尽可能详细描述申请理由',
|
|
10
10
|
cancel: '取消',
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
adaptDepartment: '适用部门',
|
|
21
21
|
noApprovalProcess: '无审批流程',
|
|
22
22
|
excessTips: '一次最多可申请{number}个权限',
|
|
23
|
-
unavailableTips: '
|
|
23
|
+
unavailableTips: '您暂无权限查看/操作该页面,请点击下方按钮进行申请',
|
|
24
24
|
appliedTips: '权限已申请,正在{status}...',
|
|
25
25
|
unapplyTips: '您暂无权限查看/操作该页面,且该页面中没有您可以申请的权限,',
|
|
26
26
|
callManager: '如有需要请联系系统管理员',
|
|
@@ -28,6 +28,10 @@ export default {
|
|
|
28
28
|
availableTime: '有效期',
|
|
29
29
|
selectPlaceholder: '请选择权限点',
|
|
30
30
|
reasonPlaceholder: '请输入申请理由',
|
|
31
|
+
maxCountTips: '一次最多只可申请{count}个权限',
|
|
32
|
+
maxLengthTips: '最多{length}个字符',
|
|
33
|
+
lastDays: '{count}天后到期',
|
|
34
|
+
taday: '今天到期',
|
|
31
35
|
availiables: {
|
|
32
36
|
SEVEN_DAYS: '7天',
|
|
33
37
|
THIRTY_DAYS: '30天',
|
|
@@ -43,7 +47,8 @@ export default {
|
|
|
43
47
|
status: {
|
|
44
48
|
PENDING: '审批中',
|
|
45
49
|
NO: '不可申请',
|
|
46
|
-
OWNER: '
|
|
50
|
+
OWNER: '永久拥有',
|
|
51
|
+
TEMP_OWNER: '临时拥有',
|
|
47
52
|
},
|
|
48
53
|
operationType: {
|
|
49
54
|
QUERY: '查询',
|
package/src/i18n/zh-CH.ts
CHANGED
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
applyReason: '申请理由',
|
|
5
5
|
approvalProcess: '审批流程',
|
|
6
6
|
applyReason1: '新入职员工申请',
|
|
7
|
-
applyReason2: '
|
|
7
|
+
applyReason2: '项目需要',
|
|
8
8
|
applyReason3: '数据查询与分析',
|
|
9
9
|
applyReasonPlaceholder: '请尽可能详细描述申请理由',
|
|
10
10
|
cancel: '取消',
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
adaptDepartment: '适用部门',
|
|
21
21
|
noApprovalProcess: '无审批流程',
|
|
22
22
|
excessTips: '一次最多可申请{number}个权限',
|
|
23
|
-
unavailableTips: '
|
|
23
|
+
unavailableTips: '您暂无权限查看/操作该页面,请点击下方按钮进行申请',
|
|
24
24
|
appliedTips: '权限已申请,正在{status}...',
|
|
25
25
|
unapplyTips: '您暂无权限查看/操作该页面,且该页面中没有您可以申请的权限,',
|
|
26
26
|
callManager: '如有需要请联系系统管理员',
|
|
@@ -31,6 +31,7 @@ export default {
|
|
|
31
31
|
maxCountTips: '一次最多只可申请{count}个权限',
|
|
32
32
|
maxLengthTips: '最多{length}个字符',
|
|
33
33
|
lastDays: '{count}天后到期',
|
|
34
|
+
taday: '今天到期',
|
|
34
35
|
availiables: {
|
|
35
36
|
SEVEN_DAYS: '7天',
|
|
36
37
|
THIRTY_DAYS: '30天',
|
package/src/typings/index.d.ts
CHANGED
package/src/vite-env.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
1
|
+
/// <reference types="vite/client" />
|