@yqg/permission 1.1.1-beta.0 → 1.1.3-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-CXHxB881.js → apply-modal-C5gl_EGn.js} +3 -3
- package/dist/{checkbox-item-B19NWjP3.js → checkbox-item-CbU84h2h.js} +3 -3
- package/dist/{index-CtHcMKbX.js → index-CwpGTkMT.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/index.umd.cjs +9 -9
- package/dist/{yqg-permission-B-6y_a6O.js → yqg-permission-5wZs7Zr5.js} +13 -16
- package/package.json +1 -1
- package/src/components/yqg-permission.vue +19 -24
|
@@ -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 lt, 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 lt, 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-CwpGTkMT.js";
|
|
2
2
|
function Mn(e) {
|
|
3
3
|
"@babel/helpers - typeof";
|
|
4
4
|
return Mn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
@@ -16582,15 +16582,12 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16582
16582
|
},
|
|
16583
16583
|
emits: ["onSuccess"],
|
|
16584
16584
|
setup(e, { emit: t }) {
|
|
16585
|
-
|
|
16585
|
+
it.config({ prefixCls: "yqg-permission-message" });
|
|
16586
|
+
const n = vg(() => import("./apply-modal-C5gl_EGn.js").then((C) => C.a)), o = {
|
|
16586
16587
|
DEFAULT: "DEFAULT",
|
|
16587
16588
|
PENDING: "PENDING",
|
|
16588
16589
|
NO: "NO"
|
|
16589
|
-
};
|
|
16590
|
-
it.config({ prefixCls: "yqg-permission-message" });
|
|
16591
|
-
const o = vg(
|
|
16592
|
-
() => import("./apply-modal-CXHxB881.js").then((C) => C.a)
|
|
16593
|
-
), r = e, A = G(!1), i = G();
|
|
16590
|
+
}, r = e, A = G(!1), i = G();
|
|
16594
16591
|
let a = G([]), s = G({
|
|
16595
16592
|
imageUrl: bo,
|
|
16596
16593
|
status: ""
|
|
@@ -16611,19 +16608,19 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16611
16608
|
imageUrl: bo,
|
|
16612
16609
|
status: ""
|
|
16613
16610
|
};
|
|
16614
|
-
const h = C.find((y) => y.businessApplyType ===
|
|
16611
|
+
const h = C.find((y) => y.businessApplyType === o.PENDING), m = C.every((y) => y.businessApplyType === o.NO);
|
|
16615
16612
|
return h ? (i.value = h, {
|
|
16616
16613
|
imageUrl: dQ,
|
|
16617
|
-
status:
|
|
16614
|
+
status: o.PENDING,
|
|
16618
16615
|
tips: ke("status.PENDING"),
|
|
16619
16616
|
url: h.oaFlowUrl
|
|
16620
16617
|
}) : m ? {
|
|
16621
16618
|
imageUrl: bo,
|
|
16622
|
-
status:
|
|
16619
|
+
status: o.NO,
|
|
16623
16620
|
tips: (Q = (I = C[0].admin) == null ? void 0 : I.map((y) => `${y.name}(${y.departmentName})`)) == null ? void 0 : Q.join("、")
|
|
16624
16621
|
} : {
|
|
16625
16622
|
imageUrl: bo,
|
|
16626
|
-
status:
|
|
16623
|
+
status: o.DEFAULT
|
|
16627
16624
|
};
|
|
16628
16625
|
}, g = () => {
|
|
16629
16626
|
var C;
|
|
@@ -16667,7 +16664,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16667
16664
|
}, [
|
|
16668
16665
|
Eg(C.$slots, "custom", {}, void 0, !0)
|
|
16669
16666
|
])) : (Bt(), vn(Qe, { key: 2 }, [
|
|
16670
|
-
K(s).status ===
|
|
16667
|
+
K(s).status === o.DEFAULT ? (Bt(), vn(Qe, { key: 0 }, [
|
|
16671
16668
|
He("img", {
|
|
16672
16669
|
src: K(s).imageUrl,
|
|
16673
16670
|
height: "200",
|
|
@@ -16687,7 +16684,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16687
16684
|
})
|
|
16688
16685
|
])
|
|
16689
16686
|
], 64)) : co("", !0),
|
|
16690
|
-
K(s).status ===
|
|
16687
|
+
K(s).status === o.PENDING ? (Bt(), vn(Qe, { key: 1 }, [
|
|
16691
16688
|
He("img", {
|
|
16692
16689
|
src: K(s).imageUrl,
|
|
16693
16690
|
height: "200",
|
|
@@ -16723,7 +16720,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16723
16720
|
})
|
|
16724
16721
|
])
|
|
16725
16722
|
], 64)) : co("", !0),
|
|
16726
|
-
K(s).status ===
|
|
16723
|
+
K(s).status === o.NO ? (Bt(), vn("div", tw, [
|
|
16727
16724
|
He("img", {
|
|
16728
16725
|
src: K(s).imageUrl,
|
|
16729
16726
|
height: "200",
|
|
@@ -16745,7 +16742,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16745
16742
|
])) : co("", !0)
|
|
16746
16743
|
], 64))
|
|
16747
16744
|
]),
|
|
16748
|
-
v(K(
|
|
16745
|
+
v(K(n), {
|
|
16749
16746
|
modelValue: A.value,
|
|
16750
16747
|
"onUpdate:modelValue": h[0] || (h[0] = (m) => A.value = m),
|
|
16751
16748
|
permissionList: K(a),
|
|
@@ -16762,7 +16759,7 @@ const Wr = "/admin/crane", Gy = {
|
|
|
16762
16759
|
for (const [o, r] of t)
|
|
16763
16760
|
n[o] = r;
|
|
16764
16761
|
return n;
|
|
16765
|
-
}, sw = /* @__PURE__ */ aw(iw, [["__scopeId", "data-v-
|
|
16762
|
+
}, sw = /* @__PURE__ */ aw(iw, [["__scopeId", "data-v-f798ad8b"]]), xw = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
16766
16763
|
__proto__: null,
|
|
16767
16764
|
default: sw
|
|
16768
16765
|
}, Symbol.toStringTag, { value: "Module" }));
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ConfigProvider
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
v-if="allPermissions.length"
|
|
4
|
+
prefixCls="yqg-permission"
|
|
5
|
+
:theme="{
|
|
6
6
|
token: {
|
|
7
7
|
colorPrimary: props.color,
|
|
8
|
-
}}"
|
|
9
|
-
>
|
|
8
|
+
}}">
|
|
10
9
|
<div class="crane-wraper">
|
|
11
10
|
<template v-if="type==='text'">
|
|
12
11
|
<TypographyLink @click="showModal">{{t('permissionApply')}}</TypographyLink>
|
|
@@ -19,7 +18,7 @@
|
|
|
19
18
|
<template v-else>
|
|
20
19
|
|
|
21
20
|
<!-- 可申请 -->
|
|
22
|
-
<template v-if="curStatus.status ===
|
|
21
|
+
<template v-if="curStatus.status === statusMap.DEFAULT">
|
|
23
22
|
<img
|
|
24
23
|
:src="curStatus.imageUrl"
|
|
25
24
|
height="200"
|
|
@@ -33,7 +32,7 @@
|
|
|
33
32
|
</div>
|
|
34
33
|
</template>
|
|
35
34
|
<!-- 审批中 -->
|
|
36
|
-
<template v-if="curStatus.status ===
|
|
35
|
+
<template v-if="curStatus.status === statusMap.PENDING">
|
|
37
36
|
<img
|
|
38
37
|
:src="curStatus.imageUrl"
|
|
39
38
|
height="200"
|
|
@@ -53,7 +52,7 @@
|
|
|
53
52
|
</div>
|
|
54
53
|
</template>
|
|
55
54
|
<!-- 不可申请 -->
|
|
56
|
-
<div v-if="curStatus.status ===
|
|
55
|
+
<div v-if="curStatus.status === statusMap.NO" class="crane-wraper">
|
|
57
56
|
<img
|
|
58
57
|
:src="curStatus.imageUrl"
|
|
59
58
|
height="200"
|
|
@@ -83,25 +82,21 @@
|
|
|
83
82
|
</ConfigProvider>
|
|
84
83
|
</template>
|
|
85
84
|
<script lang="ts" setup>
|
|
86
|
-
import { ref, defineAsyncComponent, computed, watchEffect, watch
|
|
87
|
-
import {Button, ConfigProvider, TypographyLink, Popover, message
|
|
85
|
+
import { ref, defineAsyncComponent, computed, watchEffect, watch} from 'vue';
|
|
86
|
+
import { Button, ConfigProvider, TypographyLink, Popover , message} from 'ant-design-vue';
|
|
88
87
|
import applyUrl from '@/assets/applying.png';
|
|
89
88
|
import noauthority from '@/assets/noauthority.png';
|
|
90
89
|
import Http from '../axios/index';
|
|
91
90
|
import t from '../utils';
|
|
92
91
|
|
|
93
|
-
|
|
92
|
+
// 重置 message 类名,避免被全局样式覆盖
|
|
93
|
+
message.config({prefixCls: 'yqg-permission-message'});
|
|
94
|
+
const ApplyModal = defineAsyncComponent(() =>import('./apply-modal.vue'));
|
|
95
|
+
const statusMap = {
|
|
94
96
|
DEFAULT: 'DEFAULT',
|
|
95
97
|
PENDING: 'PENDING',
|
|
96
98
|
NO: 'NO',
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// 重置 message 类名,避免被全局样式覆盖
|
|
100
|
-
message.config({prefixCls: 'yqg-permission-message'});
|
|
101
|
-
|
|
102
|
-
const ApplyModal = defineAsyncComponent(() =>
|
|
103
|
-
import('./apply-modal.vue')
|
|
104
|
-
);
|
|
99
|
+
}
|
|
105
100
|
|
|
106
101
|
const props = defineProps({
|
|
107
102
|
workNumber: {
|
|
@@ -175,13 +170,13 @@
|
|
|
175
170
|
status: '',
|
|
176
171
|
};
|
|
177
172
|
}
|
|
178
|
-
const current = data.find((per) => per.businessApplyType ===
|
|
179
|
-
const cannotApply = data.every((per) => per.businessApplyType ===
|
|
173
|
+
const current = data.find((per) => per.businessApplyType === statusMap.PENDING);
|
|
174
|
+
const cannotApply = data.every((per) => per.businessApplyType === statusMap.NO);
|
|
180
175
|
if (current) {
|
|
181
176
|
curApproving.value = current;
|
|
182
177
|
return {
|
|
183
178
|
imageUrl: applyUrl,
|
|
184
|
-
status:
|
|
179
|
+
status: statusMap.PENDING,
|
|
185
180
|
tips: t('status.PENDING'),
|
|
186
181
|
url: current.oaFlowUrl,
|
|
187
182
|
};
|
|
@@ -190,13 +185,13 @@
|
|
|
190
185
|
if (cannotApply) {
|
|
191
186
|
return {
|
|
192
187
|
imageUrl: noauthority,
|
|
193
|
-
status:
|
|
188
|
+
status: statusMap.NO,
|
|
194
189
|
tips: data[0].admin?.map((item) => `${item.name}(${item.departmentName})`)?.join('、'),
|
|
195
190
|
};
|
|
196
191
|
};
|
|
197
192
|
return {
|
|
198
193
|
imageUrl: noauthority,
|
|
199
|
-
status:
|
|
194
|
+
status: statusMap.DEFAULT,
|
|
200
195
|
}
|
|
201
196
|
};
|
|
202
197
|
|