@yqg/permission 1.0.5-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/dist/{apply-modal-CzowWeBJ.js → apply-modal-B779Z1yz.js} +10 -7
- package/dist/{checkbox-item-zQ0rw1If.js → checkbox-item-CWDiWBTe.js} +1008 -986
- package/dist/{index-DA6ClyIX.js → index-C1qXS-ty.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/index.umd.cjs +49 -49
- package/dist/{yqg-permission-BrJJoGxC.js → yqg-permission-CrityVMS.js} +5 -4
- package/package.json +1 -1
- package/src/App.vue +12 -3
- package/src/components/apply-modal.vue +6 -4
- package/src/components/checkbox-item.vue +20 -6
- package/src/components/yqg-permission.vue +1 -1
- package/src/i18n/zh-CH.ts +1 -0
- package/src/typings/index.d.ts +1 -0
|
@@ -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 v, 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 v, 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-C1qXS-ty.js";
|
|
2
2
|
function Mn(e) {
|
|
3
3
|
"@babel/helpers - typeof";
|
|
4
4
|
return Mn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
@@ -16503,6 +16503,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16503
16503
|
reasonPlaceholder: "请输入申请理由",
|
|
16504
16504
|
maxCountTips: "一次最多只可申请{count}个权限",
|
|
16505
16505
|
maxLengthTips: "最多{length}个字符",
|
|
16506
|
+
lastDays: "{count}天后到期",
|
|
16506
16507
|
availiables: {
|
|
16507
16508
|
SEVEN_DAYS: "7天",
|
|
16508
16509
|
THIRTY_DAYS: "30天",
|
|
@@ -16583,7 +16584,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16583
16584
|
emits: ["onSuccess"],
|
|
16584
16585
|
setup(e, { emit: t }) {
|
|
16585
16586
|
const n = vg(
|
|
16586
|
-
() => import("./apply-modal-
|
|
16587
|
+
() => import("./apply-modal-B779Z1yz.js").then((C) => C.a)
|
|
16587
16588
|
), o = {
|
|
16588
16589
|
DEFAULT: "DEFAULT",
|
|
16589
16590
|
PENDING: "PENDING",
|
|
@@ -16600,7 +16601,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16600
16601
|
});
|
|
16601
16602
|
};
|
|
16602
16603
|
m(C);
|
|
16603
|
-
const I = [null, "PENDING", "OWNER", "NO"], Q = ["L1", "L2", "L3"];
|
|
16604
|
+
const I = [null, "TEMP_OWNER", "PENDING", "OWNER", "NO"], Q = ["L1", "L2", "L3"];
|
|
16604
16605
|
return h.sort((y, w) => I.indexOf(y.businessApplyType) - I.indexOf(w.businessApplyType) || Q.indexOf(y.securityLevel) - Q.indexOf(w.securityLevel)), h;
|
|
16605
16606
|
}, u = (C) => {
|
|
16606
16607
|
var I, Q;
|
|
@@ -16760,7 +16761,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16760
16761
|
for (const [o, r] of t)
|
|
16761
16762
|
n[o] = r;
|
|
16762
16763
|
return n;
|
|
16763
|
-
}, sw = /* @__PURE__ */ aw(iw, [["__scopeId", "data-v-
|
|
16764
|
+
}, sw = /* @__PURE__ */ aw(iw, [["__scopeId", "data-v-effc6ab5"]]), xw = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
16764
16765
|
__proto__: null,
|
|
16765
16766
|
default: sw
|
|
16766
16767
|
}, Symbol.toStringTag, { value: "Module" }));
|
package/package.json
CHANGED
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('成功')}"
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
|
|
35
35
|
<FormItem
|
|
36
36
|
name="applyReason"
|
|
37
|
-
:label="t('applyReason')"
|
|
37
|
+
:label="t('applyReason')"
|
|
38
38
|
:rules="[{
|
|
39
|
-
required: true, message: t('reasonPlaceholder')
|
|
39
|
+
required: true, message: t('reasonPlaceholder'), trigger: ['change', 'blur']
|
|
40
40
|
}, {
|
|
41
|
-
max: 300, message: t('maxLengthTips', {length: 300})
|
|
41
|
+
max: 300, message: t('maxLengthTips', {length: 300}), trigger: ['change', 'blur']
|
|
42
42
|
}]">
|
|
43
43
|
<Textarea
|
|
44
|
-
v-model:value="formState.applyReason"
|
|
44
|
+
v-model:value.trim="formState.applyReason"
|
|
45
45
|
show-count
|
|
46
46
|
:maxlength="300"
|
|
47
47
|
:placeholder="t('applyReasonPlaceholder')"
|
|
@@ -141,6 +141,7 @@
|
|
|
141
141
|
} else {
|
|
142
142
|
formState.applyReason += `、${item}`;
|
|
143
143
|
}
|
|
144
|
+
formRef.value.validateFields(['applyReason']);
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
const handleOk = async() => {
|
|
@@ -171,6 +172,7 @@
|
|
|
171
172
|
|
|
172
173
|
const onChangeHandler = throttle(async () => {
|
|
173
174
|
if (formState.roleIds.length > 5) {
|
|
175
|
+
formState.roleIds.pop();
|
|
174
176
|
return message.warning(t('maxCountTips', {count: 5}));
|
|
175
177
|
}
|
|
176
178
|
|
|
@@ -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
|
|
28
|
+
:class="['PENDING', 'TEMP_OWNER'].includes(item.businessApplyType) ? '' : 'crane-disabled-color'">
|
|
26
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
|
|
|
@@ -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"
|
|
@@ -98,8 +114,6 @@
|
|
|
98
114
|
});
|
|
99
115
|
const timeStatusOptions = formatOptions('availiables');
|
|
100
116
|
const statusMap = t('status');
|
|
101
|
-
const StatusTypePending = 'PENDING';
|
|
102
|
-
const disabled = ['NO', 'PENDING'].includes(props.item.businessApplyType);
|
|
103
117
|
const validTime = ref('');
|
|
104
118
|
|
|
105
119
|
//1登录人所在部门 = 权限适用范围,都默认90天,不需要区分等级和类型,
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
flattenData(data);
|
|
155
155
|
// 需要排序,规则:businessApplyType 为 null 在前面, PENDING. OWNER 在中间, NO 在后面
|
|
156
156
|
// 然后再根据 L1, L2, L3 排序
|
|
157
|
-
const sort = [ null, 'PENDING', 'OWNER', 'NO'];
|
|
157
|
+
const sort = [ null, 'TEMP_OWNER', 'PENDING', 'OWNER', 'NO'];
|
|
158
158
|
const levelSort = ['L1', 'L2', 'L3'];
|
|
159
159
|
arr.sort((a, b) => {
|
|
160
160
|
return sort.indexOf(a.businessApplyType) - sort.indexOf(b.businessApplyType) || levelSort.indexOf(a.securityLevel) - levelSort.indexOf(b.securityLevel);
|
package/src/i18n/zh-CH.ts
CHANGED