@yqg/permission 1.0.5-beta.0 → 1.0.7-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-CufqYkyN.js} +11 -7
- package/dist/{checkbox-item-zQ0rw1If.js → checkbox-item-DyelhIIV.js} +1008 -986
- package/dist/{index-DA6ClyIX.js → index-BbZYqbTL.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/index.umd.cjs +49 -49
- package/dist/{yqg-permission-BrJJoGxC.js → yqg-permission-CIMrprWp.js} +6 -5
- package/package.json +1 -1
- package/src/App.vue +5 -3
- package/src/components/apply-modal.vue +7 -4
- package/src/components/checkbox-item.vue +20 -6
- package/src/components/yqg-permission.vue +2 -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-BbZYqbTL.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-CufqYkyN.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;
|
|
@@ -16625,7 +16626,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16625
16626
|
};
|
|
16626
16627
|
}, g = () => {
|
|
16627
16628
|
var C;
|
|
16628
|
-
(C = i.value) != null && C.oaFlowUrl && window.open(i.value.oaFlowUrl);
|
|
16629
|
+
console.log(i.value), (C = i.value) != null && C.oaFlowUrl && window.open(i.value.oaFlowUrl);
|
|
16629
16630
|
}, d = async () => {
|
|
16630
16631
|
if (!l.value.length || !r.businessCode || !r.workNumber) return;
|
|
16631
16632
|
const C = {
|
|
@@ -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-a4765cce"]]), 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,9 @@ 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.EMPLOYEE.QUERY', 'CRANE.EMPLOYEE.DETAIL_QUERY', 'CRANE.EMPLOYEE.ATTRIBUTE_CREATE', 'CRANE.EMPLOYEE.ROLE_ASSIGN'
|
|
13
|
+
]);
|
|
12
14
|
// const permissions = reactive(['CRANE.BUSINESS.QUERY', 'RANE.BUSINESS.CREATE', 'CRANE.BUSINESS.UPDATE', 'CRANE.BUSINESS.DELETE']);
|
|
13
15
|
const changeColor = () => {
|
|
14
16
|
color.value = color.value === '#f00' ? '#1677ff' : '#f00';
|
|
@@ -31,8 +33,8 @@ const changeLocale = () => {
|
|
|
31
33
|
<!-- 05184 -->
|
|
32
34
|
<yqg-permission
|
|
33
35
|
:permissions="permissions"
|
|
34
|
-
workNumber="
|
|
35
|
-
businessCode="
|
|
36
|
+
workNumber="05181"
|
|
37
|
+
businessCode="CRANE"
|
|
36
38
|
:color="color"
|
|
37
39
|
:locale="locale"
|
|
38
40
|
@success="() => {console.log('成功')}"
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
width="800px"
|
|
6
6
|
@ok="handleOk"
|
|
7
7
|
:okText="t('submit')"
|
|
8
|
+
:maskClosable="false"
|
|
8
9
|
:ok-button-props="{ loading: loading }"
|
|
9
10
|
:cancelText="t('cancel')">
|
|
10
11
|
<Form
|
|
@@ -34,14 +35,14 @@
|
|
|
34
35
|
|
|
35
36
|
<FormItem
|
|
36
37
|
name="applyReason"
|
|
37
|
-
:label="t('applyReason')"
|
|
38
|
+
:label="t('applyReason')"
|
|
38
39
|
:rules="[{
|
|
39
|
-
required: true, message: t('reasonPlaceholder')
|
|
40
|
+
required: true, message: t('reasonPlaceholder'), trigger: ['change', 'blur']
|
|
40
41
|
}, {
|
|
41
|
-
max: 300, message: t('maxLengthTips', {length: 300})
|
|
42
|
+
max: 300, message: t('maxLengthTips', {length: 300}), trigger: ['change', 'blur']
|
|
42
43
|
}]">
|
|
43
44
|
<Textarea
|
|
44
|
-
v-model:value="formState.applyReason"
|
|
45
|
+
v-model:value.trim="formState.applyReason"
|
|
45
46
|
show-count
|
|
46
47
|
:maxlength="300"
|
|
47
48
|
:placeholder="t('applyReasonPlaceholder')"
|
|
@@ -141,6 +142,7 @@
|
|
|
141
142
|
} else {
|
|
142
143
|
formState.applyReason += `、${item}`;
|
|
143
144
|
}
|
|
145
|
+
formRef.value.validateFields(['applyReason']);
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
const handleOk = async() => {
|
|
@@ -171,6 +173,7 @@
|
|
|
171
173
|
|
|
172
174
|
const onChangeHandler = throttle(async () => {
|
|
173
175
|
if (formState.roleIds.length > 5) {
|
|
176
|
+
formState.roleIds.pop();
|
|
174
177
|
return message.warning(t('maxCountTips', {count: 5}));
|
|
175
178
|
}
|
|
176
179
|
|
|
@@ -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);
|
|
@@ -195,6 +195,7 @@
|
|
|
195
195
|
};
|
|
196
196
|
|
|
197
197
|
const goViewApproval = () => {
|
|
198
|
+
console.log(curApproving.value)
|
|
198
199
|
if (curApproving.value?.oaFlowUrl) {
|
|
199
200
|
window.open(curApproving.value.oaFlowUrl);
|
|
200
201
|
}
|
package/src/i18n/zh-CH.ts
CHANGED