@king-one/antdv 2.3.3 → 2.3.5
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/CHANGELOG.md +12 -0
- package/dist/es/components/dept-selector/src/dept.mjs +34 -33
- package/dist/es/components/index.mjs +45 -42
- package/dist/es/components/pro-form-render/src/index.vue2.mjs +20 -20
- package/dist/es/components/pro-form-render/src/module/AioArrayInput.vue.mjs +42 -41
- package/dist/es/components/pro-form-render/src/module/AioDatePicker.vue.mjs +1 -1
- package/dist/es/components/pro-form-render/src/module/AioInput.vue.mjs +1 -1
- package/dist/es/components/pro-form-render/src/module/AioInputNumber.vue.mjs +1 -1
- package/dist/es/components/pro-form-render/src/module/AioSelect.vue.mjs +1 -1
- package/dist/es/components/pro-form-render/src/module/AioSubForm.vue.mjs +7 -7
- package/dist/es/components/pro-form-render/src/module/AioTextarea.vue.mjs +1 -1
- package/dist/es/components/pro-form-render/src/module/AioTimePicker.vue.mjs +1 -1
- package/dist/es/components/pro-picker/apis/pro-picker.api.mjs +6 -6
- package/dist/es/components/pro-picker/src/ProPicker.vue2.mjs +28 -28
- package/dist/es/components/pro-picker/src/types.mjs +4 -0
- package/dist/es/components/pro-selector/index.mjs +13 -10
- package/dist/es/components/pro-selector/src/components/org-tree.mjs +47 -47
- package/dist/es/components/pro-selector/src/components/user.mjs +22 -12
- package/dist/es/components/pro-selector/src/pro-user.mjs +22 -22
- package/dist/es/components/pro-selector-group/index.mjs +11 -0
- package/dist/es/components/pro-selector-group/src/compoents/dept-tree.vue.mjs +4 -0
- package/dist/es/components/pro-selector-group/src/compoents/dept-tree.vue2.mjs +124 -0
- package/dist/es/components/pro-selector-group/src/compoents/dept.vue.mjs +47 -0
- package/dist/es/components/pro-selector-group/src/compoents/dept.vue2.mjs +4 -0
- package/dist/es/components/pro-selector-group/src/compoents/index.mjs +3 -0
- package/dist/es/components/pro-selector-group/src/compoents/role.vue.mjs +129 -0
- package/dist/es/components/pro-selector-group/src/compoents/role.vue2.mjs +4 -0
- package/dist/es/components/pro-selector-group/src/compoents/select-box.vue.mjs +4 -0
- package/dist/es/components/pro-selector-group/src/compoents/select-box.vue2.mjs +95 -0
- package/dist/es/components/pro-selector-group/src/compoents/user.vue.mjs +148 -0
- package/dist/es/components/pro-selector-group/src/compoents/user.vue2.mjs +4 -0
- package/dist/es/components/pro-selector-group/src/hooks/useApi.mjs +60 -0
- package/dist/es/components/pro-selector-group/src/index.vue.mjs +4 -0
- package/dist/es/components/pro-selector-group/src/index.vue2.mjs +186 -0
- package/dist/es/components/pro-selector-group/src/style/index.mjs +2 -0
- package/dist/es/components/pro-selector-group/src/types.mjs +4 -0
- package/dist/es/components/pro-sign/src/components/add-signature.vue2.mjs +57 -49
- package/dist/es/components/pro-sign/src/components/batch.vue2.mjs +133 -125
- package/dist/es/components/pro-sign/src/components/date.vue.mjs +23 -23
- package/dist/es/components/pro-sign/src/components/loader.vue2.mjs +48 -48
- package/dist/es/components/pro-sign/src/components/middle.vue.mjs +151 -147
- package/dist/es/components/pro-sign/src/components/signature.vue.mjs +39 -39
- package/dist/es/components/pro-sign/src/components/verify.vue2.mjs +50 -42
- package/dist/es/components/pro-table/src/field/field.vue2.mjs +60 -60
- package/dist/es/components/pro-table/src/form-render.vue2.mjs +51 -45
- package/dist/es/components/pro-table/src/pro-table.vue2.mjs +96 -89
- package/dist/es/components/pro-user-avatar/src/index.vue2.mjs +52 -52
- package/dist/es/components/role-selector/src/role.mjs +23 -20
- package/dist/es/components/scale-virtual-list/component/scale-virtual-list.vue2.mjs +19 -19
- package/dist/es/index.mjs +93 -86
- package/dist/lib/components/dept-selector/src/dept.js +1 -1
- package/dist/lib/components/index.js +1 -1
- package/dist/lib/components/pro-form-render/src/index.vue2.js +1 -1
- package/dist/lib/components/pro-form-render/src/module/AioArrayInput.vue.js +1 -1
- package/dist/lib/components/pro-form-render/src/module/AioDatePicker.vue.js +1 -1
- package/dist/lib/components/pro-form-render/src/module/AioInput.vue.js +1 -1
- package/dist/lib/components/pro-form-render/src/module/AioInputNumber.vue.js +1 -1
- package/dist/lib/components/pro-form-render/src/module/AioSelect.vue.js +1 -1
- package/dist/lib/components/pro-form-render/src/module/AioSubForm.vue.js +1 -1
- package/dist/lib/components/pro-form-render/src/module/AioTextarea.vue.js +1 -1
- package/dist/lib/components/pro-form-render/src/module/AioTimePicker.vue.js +1 -1
- package/dist/lib/components/pro-picker/apis/pro-picker.api.js +1 -1
- package/dist/lib/components/pro-picker/src/ProPicker.vue2.js +1 -1
- package/dist/lib/components/pro-picker/src/types.js +1 -1
- package/dist/lib/components/pro-selector/index.js +1 -1
- package/dist/lib/components/pro-selector/src/components/user.js +1 -1
- package/dist/lib/components/pro-selector-group/index.js +1 -0
- package/dist/lib/components/pro-selector-group/src/compoents/dept-tree.vue.js +1 -0
- package/dist/lib/components/pro-selector-group/src/compoents/dept-tree.vue2.js +1 -0
- package/dist/lib/components/pro-selector-group/src/compoents/dept.vue.js +1 -0
- package/dist/lib/components/pro-selector-group/src/compoents/dept.vue2.js +1 -0
- package/dist/lib/components/pro-selector-group/src/compoents/index.js +1 -0
- package/dist/lib/components/pro-selector-group/src/compoents/role.vue.js +1 -0
- package/dist/lib/components/pro-selector-group/src/compoents/role.vue2.js +1 -0
- package/dist/lib/components/pro-selector-group/src/compoents/select-box.vue.js +1 -0
- package/dist/lib/components/pro-selector-group/src/compoents/select-box.vue2.js +1 -0
- package/dist/lib/components/pro-selector-group/src/compoents/user.vue.js +1 -0
- package/dist/lib/components/pro-selector-group/src/compoents/user.vue2.js +1 -0
- package/dist/lib/components/pro-selector-group/src/hooks/useApi.js +1 -0
- package/dist/lib/components/pro-selector-group/src/index.vue.js +1 -0
- package/dist/lib/components/pro-selector-group/src/index.vue2.js +1 -0
- package/dist/lib/components/pro-selector-group/src/style/index.js +1 -0
- package/dist/lib/components/pro-selector-group/src/types.js +1 -0
- package/dist/lib/components/pro-sign/src/components/add-signature.vue2.js +1 -1
- package/dist/lib/components/pro-sign/src/components/batch.vue2.js +1 -1
- package/dist/lib/components/pro-sign/src/components/date.vue.js +1 -1
- package/dist/lib/components/pro-sign/src/components/loader.vue2.js +2 -2
- package/dist/lib/components/pro-sign/src/components/middle.vue.js +1 -1
- package/dist/lib/components/pro-sign/src/components/signature.vue.js +1 -1
- package/dist/lib/components/pro-sign/src/components/verify.vue2.js +1 -1
- package/dist/lib/components/pro-table/src/field/field.vue2.js +1 -1
- package/dist/lib/components/pro-table/src/form-render.vue2.js +1 -1
- package/dist/lib/components/pro-table/src/pro-table.vue2.js +1 -1
- package/dist/lib/components/pro-user-avatar/src/index.vue2.js +1 -1
- package/dist/lib/components/scale-virtual-list/component/scale-virtual-list.vue2.js +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/pro-selector-group.css +1 -0
- package/dist/types/components/collapse-transtion/index.d.ts +5 -10
- package/dist/types/components/collapse-transtion/src/collapse-transtion.vue.d.ts +4 -4
- package/dist/types/components/cover-scroll-bar/hooks/use-has-scroll.d.ts +2 -2
- package/dist/types/components/cover-scroll-bar/index.d.ts +9 -9
- package/dist/types/components/cover-scroll-bar/src/cover-scroll-bar.d.ts +9 -9
- package/dist/types/components/dept-selector/index.d.ts +7 -7
- package/dist/types/components/dept-selector/src/dept.d.ts +7 -7
- package/dist/types/components/form/component/form-item.vue.d.ts +4 -4
- package/dist/types/components/form/component/form.vue.d.ts +2 -2
- package/dist/types/components/form/index.d.ts +8 -14
- package/dist/types/components/icon/index.d.ts +5 -5
- package/dist/types/components/icon/src/icon.vue.d.ts +5 -5
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/plus-upload/index.d.ts +12 -46
- package/dist/types/components/plus-upload/src/plus-upload.vue.d.ts +6 -6
- package/dist/types/components/pro-area/hooks/use-pro-area.d.ts +1 -1
- package/dist/types/components/pro-area/index.d.ts +8 -8
- package/dist/types/components/pro-area/src/ProArea.vue.d.ts +8 -8
- package/dist/types/components/pro-cell/index.d.ts +7 -254
- package/dist/types/components/pro-cell/src/index.vue.d.ts +3 -42
- package/dist/types/components/pro-cell-group/index.d.ts +5 -164
- package/dist/types/components/pro-cell-group/src/index.vue.d.ts +2 -11
- package/dist/types/components/pro-contract-view/hooks/use-contract-view.d.ts +20 -0
- package/dist/types/components/pro-contract-view/index.d.ts +76 -5
- package/dist/types/components/pro-contract-view/src/pro-contract-view.vue.d.ts +76 -5
- package/dist/types/components/pro-form-render/index.d.ts +651 -8
- package/dist/types/components/pro-form-render/src/index.vue.d.ts +651 -8
- package/dist/types/components/pro-form-render/src/module/AioArrayInput.vue.d.ts +7 -7
- package/dist/types/components/pro-form-render/src/module/AioDatePicker.vue.d.ts +7 -7
- package/dist/types/components/pro-form-render/src/module/AioInput.vue.d.ts +7 -7
- package/dist/types/components/pro-form-render/src/module/AioInputNumber.vue.d.ts +7 -7
- package/dist/types/components/pro-form-render/src/module/AioSelect.vue.d.ts +7 -7
- package/dist/types/components/pro-form-render/src/module/AioSubForm.vue.d.ts +687 -9
- package/dist/types/components/pro-form-render/src/module/AioSwitch.vue.d.ts +7 -7
- package/dist/types/components/pro-form-render/src/module/AioTextarea.vue.d.ts +7 -7
- package/dist/types/components/pro-form-render/src/module/AioTimePicker.vue.d.ts +7 -7
- package/dist/types/components/pro-modal/hooks/useProModal.d.ts +1 -1
- package/dist/types/components/pro-modal/index.d.ts +12 -28
- package/dist/types/components/pro-modal/src/Modal.d.ts +5 -5
- package/dist/types/components/pro-modal/src/ProModal.vue.d.ts +7 -5
- package/dist/types/components/pro-overlay/index.d.ts +4 -4
- package/dist/types/components/pro-overlay/src/pro-overlay.vue.d.ts +2 -2
- package/dist/types/components/pro-picker/apis/pro-picker.api.d.ts +4 -4
- package/dist/types/components/pro-picker/index.d.ts +18 -8
- package/dist/types/components/pro-picker/src/ProPicker.vue.d.ts +18 -8
- package/dist/types/components/pro-picker/src/types.d.ts +4 -0
- package/dist/types/components/pro-selector/index.d.ts +48 -9
- package/dist/types/components/pro-selector/src/components/org-tree.d.ts +6 -6
- package/dist/types/components/pro-selector/src/components/user.d.ts +8 -8
- package/dist/types/components/pro-selector/src/pro-user.d.ts +13 -12
- package/dist/types/components/pro-selector-group/index.d.ts +25 -0
- package/dist/types/components/pro-selector-group/src/compoents/dept-tree.vue.d.ts +13 -0
- package/dist/types/components/pro-selector-group/src/compoents/dept.vue.d.ts +10 -0
- package/dist/types/components/pro-selector-group/src/compoents/index.d.ts +3 -0
- package/dist/types/components/pro-selector-group/src/compoents/role.vue.d.ts +10 -0
- package/dist/types/components/pro-selector-group/src/compoents/select-box.vue.d.ts +16 -0
- package/dist/types/components/pro-selector-group/src/compoents/user.vue.d.ts +10 -0
- package/dist/types/components/pro-selector-group/src/hooks/useApi.d.ts +102 -0
- package/dist/types/components/pro-selector-group/src/index.vue.d.ts +22 -0
- package/dist/types/components/pro-selector-group/src/types.d.ts +30 -0
- package/dist/types/components/pro-selector-group/src/utils/index.d.ts +2 -0
- package/dist/types/components/pro-sign/index.d.ts +4 -4
- package/dist/types/components/pro-sign/src/components/add-signature.vue.d.ts +121 -11
- package/dist/types/components/pro-sign/src/components/batch.vue.d.ts +6 -6
- package/dist/types/components/pro-sign/src/components/date.vue.d.ts +2 -2
- package/dist/types/components/pro-sign/src/components/files.vue.d.ts +2 -2
- package/dist/types/components/pro-sign/src/components/info.vue.d.ts +2 -2
- package/dist/types/components/pro-sign/src/components/loader.vue.d.ts +93 -62
- package/dist/types/components/pro-sign/src/components/middle.vue.d.ts +137 -2
- package/dist/types/components/pro-sign/src/components/pro-sign.vue.d.ts +4 -4
- package/dist/types/components/pro-sign/src/components/seals.vue.d.ts +2 -2
- package/dist/types/components/pro-sign/src/components/signature.vue.d.ts +2 -2
- package/dist/types/components/pro-sign/src/components/verify.vue.d.ts +6 -6
- package/dist/types/components/pro-sign/src/hook/useScrollDetection.d.ts +2 -2
- package/dist/types/components/pro-sign/src/hook/useSms.d.ts +2 -2
- package/dist/types/components/pro-signature/index.d.ts +9 -7
- package/dist/types/components/pro-signature/src/ProSignature.vue.d.ts +9 -7
- package/dist/types/components/pro-table/hooks/use-pro-table.d.ts +1 -1
- package/dist/types/components/pro-table/src/field/field-date-range/field-date-range.vue.d.ts +5 -14
- package/dist/types/components/pro-table/src/field/field-input/field-input.vue.d.ts +5 -14
- package/dist/types/components/pro-table/src/field/field-radio/field-radio.vue.d.ts +5 -14
- package/dist/types/components/pro-table/src/field/field-select/field-select.vue.d.ts +5 -14
- package/dist/types/components/pro-table/src/field/field.vue.d.ts +2 -11
- package/dist/types/components/pro-table/src/form-render.vue.d.ts +646 -3
- package/dist/types/components/pro-table/src/hooks/use-form.d.ts +1 -1
- package/dist/types/components/pro-table/src/pro-table.vue.d.ts +49 -3
- package/dist/types/components/pro-tag/index.d.ts +6 -6
- package/dist/types/components/pro-tag/src/ProTag.vue.d.ts +6 -6
- package/dist/types/components/pro-tag-group/index.d.ts +9 -7
- package/dist/types/components/pro-tag-group/src/ProTagGroup.vue.d.ts +9 -7
- package/dist/types/components/pro-title/index.d.ts +7 -24
- package/dist/types/components/pro-title/src/ProTitle.vue.d.ts +5 -5
- package/dist/types/components/pro-upload/index.d.ts +35 -107
- package/dist/types/components/pro-upload/src/file-list.d.ts +6 -6
- package/dist/types/components/pro-upload/src/gd-upload.d.ts +35 -107
- package/dist/types/components/pro-user-avatar/index.d.ts +18 -106
- package/dist/types/components/pro-user-avatar/src/index.vue.d.ts +9 -34
- package/dist/types/components/role-selector/index.d.ts +13 -13
- package/dist/types/components/role-selector/src/role.d.ts +7 -7
- package/dist/types/components/scale-virtual-list/component/scale-virtual-list.vue.d.ts +10 -29
- package/dist/types/components/scale-virtual-list/index.d.ts +21 -73
- package/dist/types/components/scroll-bar/index.d.ts +12 -12
- package/dist/types/components/scroll-bar/src/scroll-bar.d.ts +12 -12
- package/dist/types/hooks/useModelValue.d.ts +1 -1
- package/dist/types/hooks/useProForm.d.ts +2 -2
- package/global.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { defineComponent as w, inject as B, useModel as L, ref as r, watch as U, onMounted as b, createElementBlock as c, openBlock as u, createVNode as y, createBlock as O, unref as o, withCtx as q, createElementVNode as h, createTextVNode as N, toDisplayString as p, mergeModels as A } from "vue";
|
|
2
|
+
import "../../../index.mjs";
|
|
3
|
+
import { InputSearch as j, Tree as z, Empty as E } from "ant-design-vue";
|
|
4
|
+
import { useApi as G } from "../hooks/useApi.mjs";
|
|
5
|
+
import { selectContextKey as R } from "../types.mjs";
|
|
6
|
+
import { KIcon as F } from "../../../icon/index.mjs";
|
|
7
|
+
const H = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "selector-tree"
|
|
10
|
+
}, J = { class: "tree-title" }, Q = { class: "tree-title_name" }, W = { key: 0 }, X = { style: { color: "#f50" } }, Y = { key: 1 }, ae = /* @__PURE__ */ w({
|
|
11
|
+
__name: "dept-tree",
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: { required: !0, default: () => [] },
|
|
14
|
+
modelModifiers: {}
|
|
15
|
+
},
|
|
16
|
+
emits: /* @__PURE__ */ A(["select"], ["update:modelValue"]),
|
|
17
|
+
setup(K, { emit: S }) {
|
|
18
|
+
const V = S, x = B(R), { getDeptTree: I, getUserListByDeptId: M, deptTree: i } = G(x.http, x.urlPrefix), _ = L(K, "modelValue"), l = r(""), m = r([]), d = r([]), f = r(!0), g = r([]);
|
|
19
|
+
function k(t) {
|
|
20
|
+
const n = [];
|
|
21
|
+
for (let e = 0; e < t.length; e++) {
|
|
22
|
+
const a = t[e], s = a.id;
|
|
23
|
+
n.push({ key: s, title: a.deptName }), a.children && n.push(...k(a.children));
|
|
24
|
+
}
|
|
25
|
+
return n;
|
|
26
|
+
}
|
|
27
|
+
function v(t, n) {
|
|
28
|
+
let e;
|
|
29
|
+
for (let a = 0; a < n.length; a++) {
|
|
30
|
+
const s = n[a];
|
|
31
|
+
s.children && (s.children.some((P) => P.id === t) ? e = s.id : v(t, s.children) && (e = v(t, s.children)));
|
|
32
|
+
}
|
|
33
|
+
return e;
|
|
34
|
+
}
|
|
35
|
+
U(l, (t) => {
|
|
36
|
+
const n = g.value.map((e) => e.title.includes(t) ? v(e.key, i.value) : null).filter((e, a, s) => e && s.indexOf(e) === a);
|
|
37
|
+
d.value = n, f.value = !!t;
|
|
38
|
+
}), b(async () => {
|
|
39
|
+
if (await I(), i.value.length > 0) {
|
|
40
|
+
g.value = k(i.value);
|
|
41
|
+
const t = i.value[0];
|
|
42
|
+
d.value = [t.id], m.value = [t.id], _.value = t.id, await M(t.id);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
function T(t) {
|
|
46
|
+
l.value = t;
|
|
47
|
+
}
|
|
48
|
+
function C(t) {
|
|
49
|
+
d.value = t.map((n) => String(n)), f.value = !1;
|
|
50
|
+
}
|
|
51
|
+
function D(t, { node: n }) {
|
|
52
|
+
_.value = n.id, V("select", n);
|
|
53
|
+
}
|
|
54
|
+
return (t, n) => (u(), c("div", null, [
|
|
55
|
+
y(o(j), {
|
|
56
|
+
value: l.value,
|
|
57
|
+
"onUpdate:value": n[0] || (n[0] = (e) => l.value = e),
|
|
58
|
+
placeholder: "请输入部门名称",
|
|
59
|
+
onSearch: T
|
|
60
|
+
}, null, 8, ["value"]),
|
|
61
|
+
o(i).length > 0 ? (u(), c("div", H, [
|
|
62
|
+
y(o(z), {
|
|
63
|
+
"selected-keys": m.value,
|
|
64
|
+
"onUpdate:selectedKeys": n[1] || (n[1] = (e) => m.value = e),
|
|
65
|
+
"expanded-keys": d.value,
|
|
66
|
+
"onUpdate:expandedKeys": n[2] || (n[2] = (e) => d.value = e),
|
|
67
|
+
"tree-data": o(i),
|
|
68
|
+
"auto-expand-parent": f.value,
|
|
69
|
+
"field-names": {
|
|
70
|
+
key: "id",
|
|
71
|
+
title: "deptName"
|
|
72
|
+
},
|
|
73
|
+
virtual: !1,
|
|
74
|
+
onSelect: D,
|
|
75
|
+
onExpand: C
|
|
76
|
+
}, {
|
|
77
|
+
title: q(({ data: e }) => [
|
|
78
|
+
h("div", J, [
|
|
79
|
+
y(o(F), {
|
|
80
|
+
name: e.parentId === "root" ? "qiye" : "bumen",
|
|
81
|
+
size: 16
|
|
82
|
+
}, null, 8, ["name"]),
|
|
83
|
+
h("span", Q, [
|
|
84
|
+
l.value && e.deptName.includes(l.value) ? (u(), c("span", W, [
|
|
85
|
+
N(
|
|
86
|
+
p(e.deptName.substring(0, e.deptName.indexOf(l.value))) + " ",
|
|
87
|
+
1
|
|
88
|
+
/* TEXT */
|
|
89
|
+
),
|
|
90
|
+
h(
|
|
91
|
+
"span",
|
|
92
|
+
X,
|
|
93
|
+
p(l.value),
|
|
94
|
+
1
|
|
95
|
+
/* TEXT */
|
|
96
|
+
),
|
|
97
|
+
N(
|
|
98
|
+
" " + p(e.deptName.substring(e.deptName.indexOf(l.value) + l.value.length)),
|
|
99
|
+
1
|
|
100
|
+
/* TEXT */
|
|
101
|
+
)
|
|
102
|
+
])) : (u(), c(
|
|
103
|
+
"span",
|
|
104
|
+
Y,
|
|
105
|
+
p(e.deptName),
|
|
106
|
+
1
|
|
107
|
+
/* TEXT */
|
|
108
|
+
))
|
|
109
|
+
])
|
|
110
|
+
])
|
|
111
|
+
]),
|
|
112
|
+
_: 1
|
|
113
|
+
/* STABLE */
|
|
114
|
+
}, 8, ["selected-keys", "expanded-keys", "tree-data", "auto-expand-parent"])
|
|
115
|
+
])) : (u(), O(o(E), {
|
|
116
|
+
key: 1,
|
|
117
|
+
image: o(E).PRESENTED_IMAGE_SIMPLE
|
|
118
|
+
}, null, 8, ["image"]))
|
|
119
|
+
]));
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
export {
|
|
123
|
+
ae as default
|
|
124
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineComponent as m, inject as f, ref as a, watch as v, createElementBlock as _, openBlock as x, createVNode as h } from "vue";
|
|
2
|
+
import { selectContextKey as D } from "../types.mjs";
|
|
3
|
+
import "./dept-tree.vue.mjs";
|
|
4
|
+
import y from "./dept-tree.vue2.mjs";
|
|
5
|
+
const V = { class: "type-selector-box dept-selector" }, B = /* @__PURE__ */ m({
|
|
6
|
+
__name: "dept",
|
|
7
|
+
setup(C, { expose: s }) {
|
|
8
|
+
const c = f(D), n = a(""), t = a([]);
|
|
9
|
+
v(() => t.value, (e) => {
|
|
10
|
+
c.changeSelectData(e);
|
|
11
|
+
}, { deep: !0 });
|
|
12
|
+
function u(e) {
|
|
13
|
+
t.value.some((o) => o.value === e.id) || t.value.push({
|
|
14
|
+
value: e.id,
|
|
15
|
+
label: e.deptName || "",
|
|
16
|
+
type: "dept"
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function p(e) {
|
|
20
|
+
t.value = t.value.filter((l) => l.value !== e);
|
|
21
|
+
}
|
|
22
|
+
function r(e) {
|
|
23
|
+
p(e);
|
|
24
|
+
}
|
|
25
|
+
function i(e) {
|
|
26
|
+
t.value = [];
|
|
27
|
+
}
|
|
28
|
+
function d() {
|
|
29
|
+
t.value = [];
|
|
30
|
+
}
|
|
31
|
+
return s({
|
|
32
|
+
delFn: r,
|
|
33
|
+
reset: d,
|
|
34
|
+
deleteAll: i
|
|
35
|
+
}), (e, l) => (x(), _("div", V, [
|
|
36
|
+
h(y, {
|
|
37
|
+
modelValue: n.value,
|
|
38
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => n.value = o),
|
|
39
|
+
style: { width: "400px !important" },
|
|
40
|
+
onSelect: u
|
|
41
|
+
}, null, 8, ["modelValue"])
|
|
42
|
+
]));
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export {
|
|
46
|
+
B as default
|
|
47
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { defineComponent as N, inject as I, ref as b, computed as E, reactive as S, watch as p, onMounted as F, createElementBlock as h, openBlock as f, createElementVNode as s, createVNode as r, unref as d, withCtx as k, createTextVNode as m, Fragment as U, renderList as B, toDisplayString as D } from "vue";
|
|
2
|
+
import { InputSearch as R, Checkbox as v, CheckboxGroup as j } from "ant-design-vue";
|
|
3
|
+
import { useApi as G } from "../hooks/useApi.mjs";
|
|
4
|
+
import { selectContextKey as K } from "../types.mjs";
|
|
5
|
+
const M = { class: "type-selector-box role-selector" }, O = { style: { width: "400px" } }, P = { style: { "margin-top": "12px" } }, T = { style: { "margin-top": "12px" } }, W = /* @__PURE__ */ N({
|
|
6
|
+
__name: "role",
|
|
7
|
+
setup(q, { expose: g }) {
|
|
8
|
+
const a = I(K), { getRole: L, roleList: u } = G(a.http, a.urlPrefix), i = b(""), c = E(() => i.value ? u.value.filter(
|
|
9
|
+
(l) => l.roleName && l.roleName.includes(i.value)
|
|
10
|
+
) : u.value), e = S({
|
|
11
|
+
indeterminate: !1,
|
|
12
|
+
checkAll: !1,
|
|
13
|
+
checkedList: []
|
|
14
|
+
});
|
|
15
|
+
p(() => e.checkedList, (l) => {
|
|
16
|
+
if (l) {
|
|
17
|
+
e.checkAll = l.length === c.value.length && l.length > 0 && c.value.length > 0, e.indeterminate = l.length > 0 && l.length < c.value.length;
|
|
18
|
+
const t = [];
|
|
19
|
+
u.value.forEach((n) => {
|
|
20
|
+
e.checkedList.forEach((o) => {
|
|
21
|
+
n.id === o && t.push({ label: n.roleName, value: o, type: "role" });
|
|
22
|
+
});
|
|
23
|
+
}), console.log("list =>", t), a.changeSelectData(t);
|
|
24
|
+
}
|
|
25
|
+
}, { deep: !0 }), p(() => i.value, () => {
|
|
26
|
+
const l = e.checkedList.filter(
|
|
27
|
+
(t) => c.value.some((n) => n.id === t)
|
|
28
|
+
);
|
|
29
|
+
e.checkAll = l.length === c.value.length && c.value.length > 0, e.indeterminate = l.length > 0 && l.length < c.value.length;
|
|
30
|
+
});
|
|
31
|
+
function x(l) {
|
|
32
|
+
if (l.target.checked) {
|
|
33
|
+
e.checkAll = !0, e.indeterminate = !1;
|
|
34
|
+
const t = c.value.map((o) => o.id), n = e.checkedList.filter((o) => !t.includes(o));
|
|
35
|
+
e.checkedList = [...n, ...t];
|
|
36
|
+
} else {
|
|
37
|
+
e.checkAll = !1, e.indeterminate = !1;
|
|
38
|
+
const t = c.value.map((n) => n.id);
|
|
39
|
+
e.checkedList = e.checkedList.filter((n) => !t.includes(n));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function A(l) {
|
|
43
|
+
i.value = l;
|
|
44
|
+
}
|
|
45
|
+
function _(l) {
|
|
46
|
+
e.checkedList = e.checkedList.filter((t) => t !== l);
|
|
47
|
+
}
|
|
48
|
+
function y(l) {
|
|
49
|
+
e.checkedList = e.checkedList.filter((t) => !l.includes(t));
|
|
50
|
+
}
|
|
51
|
+
function C() {
|
|
52
|
+
e.checkAll = !1, e.indeterminate = !1, e.checkedList = [];
|
|
53
|
+
}
|
|
54
|
+
return F(() => {
|
|
55
|
+
L();
|
|
56
|
+
}), g({
|
|
57
|
+
delFn: _,
|
|
58
|
+
deleteAll: y,
|
|
59
|
+
reset: C
|
|
60
|
+
}), (l, t) => (f(), h("div", M, [
|
|
61
|
+
s("div", O, [
|
|
62
|
+
r(d(R), {
|
|
63
|
+
value: i.value,
|
|
64
|
+
"onUpdate:value": t[0] || (t[0] = (n) => i.value = n),
|
|
65
|
+
placeholder: "请输入角色名称",
|
|
66
|
+
onOnSearch: A
|
|
67
|
+
}, null, 8, ["value"]),
|
|
68
|
+
s("div", P, [
|
|
69
|
+
r(d(v), {
|
|
70
|
+
checked: e.checkAll,
|
|
71
|
+
"onUpdate:checked": t[1] || (t[1] = (n) => e.checkAll = n),
|
|
72
|
+
indeterminate: e.indeterminate,
|
|
73
|
+
onChange: x
|
|
74
|
+
}, {
|
|
75
|
+
default: k(() => [...t[3] || (t[3] = [
|
|
76
|
+
m(
|
|
77
|
+
" 全选 ",
|
|
78
|
+
-1
|
|
79
|
+
/* CACHED */
|
|
80
|
+
)
|
|
81
|
+
])]),
|
|
82
|
+
_: 1
|
|
83
|
+
/* STABLE */
|
|
84
|
+
}, 8, ["checked", "indeterminate"]),
|
|
85
|
+
s("div", T, [
|
|
86
|
+
r(d(j), {
|
|
87
|
+
value: e.checkedList,
|
|
88
|
+
"onUpdate:value": t[2] || (t[2] = (n) => e.checkedList = n)
|
|
89
|
+
}, {
|
|
90
|
+
default: k(() => [
|
|
91
|
+
s("div", null, [
|
|
92
|
+
(f(!0), h(
|
|
93
|
+
U,
|
|
94
|
+
null,
|
|
95
|
+
B(c.value, (n) => (f(), h("div", {
|
|
96
|
+
key: n.id,
|
|
97
|
+
style: { "margin-top": "4px" }
|
|
98
|
+
}, [
|
|
99
|
+
r(d(v), {
|
|
100
|
+
value: n.id
|
|
101
|
+
}, {
|
|
102
|
+
default: k(() => [
|
|
103
|
+
m(
|
|
104
|
+
D(n.roleName),
|
|
105
|
+
1
|
|
106
|
+
/* TEXT */
|
|
107
|
+
)
|
|
108
|
+
]),
|
|
109
|
+
_: 2
|
|
110
|
+
/* DYNAMIC */
|
|
111
|
+
}, 1032, ["value"])
|
|
112
|
+
]))),
|
|
113
|
+
128
|
|
114
|
+
/* KEYED_FRAGMENT */
|
|
115
|
+
))
|
|
116
|
+
])
|
|
117
|
+
]),
|
|
118
|
+
_: 1
|
|
119
|
+
/* STABLE */
|
|
120
|
+
}, 8, ["value"])
|
|
121
|
+
])
|
|
122
|
+
])
|
|
123
|
+
])
|
|
124
|
+
]));
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
export {
|
|
128
|
+
W as default
|
|
129
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { defineComponent as x, inject as g, useModel as f, computed as y, createElementBlock as o, openBlock as e, createElementVNode as t, toDisplayString as d, createBlock as b, createCommentVNode as C, unref as i, withCtx as E, createTextVNode as V, Fragment as M, renderList as N, normalizeStyle as S, createVNode as r, mergeModels as w } from "vue";
|
|
2
|
+
import { Button as B, Empty as m } from "ant-design-vue";
|
|
3
|
+
import "../../../index.mjs";
|
|
4
|
+
import { selectContextKey as z } from "../types.mjs";
|
|
5
|
+
import { KIcon as A } from "../../../icon/index.mjs";
|
|
6
|
+
const D = { class: "king-select-box" }, I = { class: "king-select-box_title" }, K = { class: "king-select-box_title_count" }, T = { style: { width: "40px" } }, j = { class: "king-select-box_content" }, L = { key: 0 }, P = { class: "king-select-box_content-item_close" }, R = {
|
|
7
|
+
key: 1,
|
|
8
|
+
style: { display: "flex", "justify-content": "center", "align-items": "center", width: "100%", height: "100%" }
|
|
9
|
+
}, O = /* @__PURE__ */ x({
|
|
10
|
+
__name: "select-box",
|
|
11
|
+
props: {
|
|
12
|
+
modelValue: { required: !0, default: () => [] },
|
|
13
|
+
modelModifiers: {}
|
|
14
|
+
},
|
|
15
|
+
emits: /* @__PURE__ */ w(["delete", "deleteAll"], ["update:modelValue"]),
|
|
16
|
+
setup(u, { emit: _ }) {
|
|
17
|
+
const c = _, p = g(z), l = f(u, "modelValue"), v = y(() => ({
|
|
18
|
+
width: p.currentTabKey.value === "user" ? "220px" : "350px"
|
|
19
|
+
}));
|
|
20
|
+
function k(n) {
|
|
21
|
+
c("delete", n);
|
|
22
|
+
}
|
|
23
|
+
function h() {
|
|
24
|
+
c("deleteAll", l.value.map((n) => n.value));
|
|
25
|
+
}
|
|
26
|
+
return (n, a) => (e(), o("div", D, [
|
|
27
|
+
t("div", I, [
|
|
28
|
+
t(
|
|
29
|
+
"div",
|
|
30
|
+
K,
|
|
31
|
+
" 已选: " + d(l.value.length) + "个 ",
|
|
32
|
+
1
|
|
33
|
+
/* TEXT */
|
|
34
|
+
),
|
|
35
|
+
t("div", T, [
|
|
36
|
+
l.value.length > 0 ? (e(), b(i(B), {
|
|
37
|
+
key: 0,
|
|
38
|
+
type: "link",
|
|
39
|
+
size: "small",
|
|
40
|
+
onClick: h
|
|
41
|
+
}, {
|
|
42
|
+
default: E(() => [...a[0] || (a[0] = [
|
|
43
|
+
V(
|
|
44
|
+
" 清空 ",
|
|
45
|
+
-1
|
|
46
|
+
/* CACHED */
|
|
47
|
+
)
|
|
48
|
+
])]),
|
|
49
|
+
_: 1
|
|
50
|
+
/* STABLE */
|
|
51
|
+
})) : C("v-if", !0)
|
|
52
|
+
])
|
|
53
|
+
]),
|
|
54
|
+
t("div", j, [
|
|
55
|
+
l.value.length > 0 ? (e(), o("div", L, [
|
|
56
|
+
(e(!0), o(
|
|
57
|
+
M,
|
|
58
|
+
null,
|
|
59
|
+
N(l.value, (s) => (e(), o("div", {
|
|
60
|
+
key: s.value,
|
|
61
|
+
class: "king-select-box_content-item"
|
|
62
|
+
}, [
|
|
63
|
+
t(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
class: "king-select-box_content-item_name",
|
|
67
|
+
style: S(v.value)
|
|
68
|
+
},
|
|
69
|
+
d(s.label),
|
|
70
|
+
5
|
|
71
|
+
/* TEXT, STYLE */
|
|
72
|
+
),
|
|
73
|
+
t("div", P, [
|
|
74
|
+
r(i(A), {
|
|
75
|
+
name: "close-circle-o",
|
|
76
|
+
size: 16,
|
|
77
|
+
onClick: (q) => k(s.value)
|
|
78
|
+
}, null, 8, ["onClick"])
|
|
79
|
+
])
|
|
80
|
+
]))),
|
|
81
|
+
128
|
|
82
|
+
/* KEYED_FRAGMENT */
|
|
83
|
+
))
|
|
84
|
+
])) : (e(), o("div", R, [
|
|
85
|
+
r(i(m), {
|
|
86
|
+
image: i(m).PRESENTED_IMAGE_SIMPLE
|
|
87
|
+
}, null, 8, ["image"])
|
|
88
|
+
]))
|
|
89
|
+
])
|
|
90
|
+
]));
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
export {
|
|
94
|
+
O as default
|
|
95
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { defineComponent as F, inject as K, computed as y, reactive as M, ref as x, watch as E, createElementBlock as p, openBlock as v, createVNode as g, createElementVNode as C, unref as o, withCtx as _, createBlock as A, createCommentVNode as T, createTextVNode as j, Fragment as G, renderList as O } from "vue";
|
|
2
|
+
import { Spin as R, InputSearch as $, Checkbox as q, Empty as S } from "ant-design-vue";
|
|
3
|
+
import { KUserSelectorCheckbox as z } from "../../../pro-selector/index.mjs";
|
|
4
|
+
import { useApi as H } from "../hooks/useApi.mjs";
|
|
5
|
+
import { selectContextKey as J } from "../types.mjs";
|
|
6
|
+
import "./dept-tree.vue.mjs";
|
|
7
|
+
import Q from "./dept-tree.vue2.mjs";
|
|
8
|
+
const W = { class: "type-selector-box user-selector" }, X = { style: { width: "280px" } }, Y = { style: { "margin-top": "12px" } }, Z = { key: 0 }, re = /* @__PURE__ */ F({
|
|
9
|
+
__name: "user",
|
|
10
|
+
setup(ee, { expose: L }) {
|
|
11
|
+
const k = K(J), { getUserListByDeptId: N, userList: i, userLoading: U } = H(k.http, k.urlPrefix), f = y(() => r[u.value] || {
|
|
12
|
+
indeterminate: !1,
|
|
13
|
+
checkAll: !1
|
|
14
|
+
}), r = M({}), u = x(""), d = x(""), a = x([]), n = y(() => d.value ? i.value.filter(
|
|
15
|
+
(e) => e.realName && e.realName.includes(d.value)
|
|
16
|
+
) : i.value);
|
|
17
|
+
E(() => u.value, async (e) => {
|
|
18
|
+
e && (await N(e), r[e] = h());
|
|
19
|
+
}, { immediate: !0 }), E(() => a.value, (e) => {
|
|
20
|
+
console.log("newVal =>", e), k.changeSelectData(e);
|
|
21
|
+
}, { deep: !0 }), E(() => d.value, () => {
|
|
22
|
+
u.value && (r[u.value] = h());
|
|
23
|
+
});
|
|
24
|
+
function h() {
|
|
25
|
+
a.value.forEach((t) => {
|
|
26
|
+
i.value.forEach((l) => {
|
|
27
|
+
t.value === l.id && (l.checked = !0);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const e = n.value.filter((t) => t.checked);
|
|
31
|
+
return {
|
|
32
|
+
indeterminate: e.length > 0 && e.length < n.value.length,
|
|
33
|
+
checkAll: e.length === n.value.length && n.value.length > 0
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function m(e, t) {
|
|
37
|
+
return e.some((l) => l.value === t);
|
|
38
|
+
}
|
|
39
|
+
function I(e) {
|
|
40
|
+
const t = r[u.value];
|
|
41
|
+
t.checkAll = e.target.checked, t.indeterminate = !1, n.value.forEach((l) => {
|
|
42
|
+
const c = i.value.find((s) => s.id === l.id);
|
|
43
|
+
c && (c.checked = e.target.checked);
|
|
44
|
+
}), e.target.checked ? n.value.forEach((l) => {
|
|
45
|
+
m(a.value, l.id) || a.value.push({
|
|
46
|
+
value: l.id,
|
|
47
|
+
label: l.realName || "",
|
|
48
|
+
type: "user"
|
|
49
|
+
});
|
|
50
|
+
}) : n.value.forEach((l) => {
|
|
51
|
+
m(a.value, l.id) && (a.value = a.value.filter((s) => s.value !== l.id));
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function V(e, t) {
|
|
55
|
+
const l = r[u.value], c = n.value.filter((s) => s.checked);
|
|
56
|
+
l.checkAll = c.length === n.value.length && n.value.length > 0, l.indeterminate = c.length > 0 && c.length < n.value.length, e ? m(a.value, t.id) || a.value.push({
|
|
57
|
+
value: t.id,
|
|
58
|
+
label: t.realName || "",
|
|
59
|
+
type: "user"
|
|
60
|
+
}) : m(a.value, t.id) && (a.value = a.value.filter((P) => P.value !== t.id));
|
|
61
|
+
}
|
|
62
|
+
function b(e) {
|
|
63
|
+
d.value = e;
|
|
64
|
+
}
|
|
65
|
+
function B(e) {
|
|
66
|
+
console.log("value =>", e, i.value), a.value = a.value.filter((t) => t.value !== e), i.value.forEach((t) => {
|
|
67
|
+
t.id === e && (t.checked = !1);
|
|
68
|
+
}), u.value && (r[u.value] = h());
|
|
69
|
+
}
|
|
70
|
+
function D(e) {
|
|
71
|
+
a.value = a.value.filter((t) => !e.includes(t.value)), i.value.forEach((t) => {
|
|
72
|
+
e.includes(t.id) && (t.checked = !1);
|
|
73
|
+
}), u.value && (r[u.value] = h());
|
|
74
|
+
}
|
|
75
|
+
function w() {
|
|
76
|
+
f.value.checkAll = !1, f.value.indeterminate = !1, a.value = [], i.value.forEach((e) => {
|
|
77
|
+
e.checked = !1;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return L({
|
|
81
|
+
delFn: B,
|
|
82
|
+
reset: w,
|
|
83
|
+
deleteAll: D
|
|
84
|
+
}), (e, t) => (v(), p("div", W, [
|
|
85
|
+
g(Q, {
|
|
86
|
+
modelValue: u.value,
|
|
87
|
+
"onUpdate:modelValue": t[0] || (t[0] = (l) => u.value = l),
|
|
88
|
+
style: { width: "280px" }
|
|
89
|
+
}, null, 8, ["modelValue"]),
|
|
90
|
+
C("div", X, [
|
|
91
|
+
g(o(R), { spinning: o(U) }, {
|
|
92
|
+
default: _(() => [
|
|
93
|
+
g(o($), {
|
|
94
|
+
value: d.value,
|
|
95
|
+
"onUpdate:value": t[1] || (t[1] = (l) => d.value = l),
|
|
96
|
+
placeholder: "请输入用户名称",
|
|
97
|
+
onSearch: b
|
|
98
|
+
}, null, 8, ["value"]),
|
|
99
|
+
n.value.length > 0 ? (v(), A(o(q), {
|
|
100
|
+
key: 0,
|
|
101
|
+
checked: f.value.checkAll,
|
|
102
|
+
"onUpdate:checked": t[2] || (t[2] = (l) => f.value.checkAll = l),
|
|
103
|
+
style: { "margin-top": "12px", "margin-left": "6px" },
|
|
104
|
+
indeterminate: f.value.indeterminate,
|
|
105
|
+
onChange: I
|
|
106
|
+
}, {
|
|
107
|
+
default: _(() => [...t[3] || (t[3] = [
|
|
108
|
+
j(
|
|
109
|
+
" 全选 ",
|
|
110
|
+
-1
|
|
111
|
+
/* CACHED */
|
|
112
|
+
)
|
|
113
|
+
])]),
|
|
114
|
+
_: 1
|
|
115
|
+
/* STABLE */
|
|
116
|
+
}, 8, ["checked", "indeterminate"])) : T("v-if", !0),
|
|
117
|
+
C("div", Y, [
|
|
118
|
+
n.value.length > 0 ? (v(), p("div", Z, [
|
|
119
|
+
(v(!0), p(
|
|
120
|
+
G,
|
|
121
|
+
null,
|
|
122
|
+
O(n.value, (l) => (v(), p("div", {
|
|
123
|
+
key: l.id
|
|
124
|
+
}, [
|
|
125
|
+
g(o(z), {
|
|
126
|
+
"user-info": l,
|
|
127
|
+
onChangeChecked: V
|
|
128
|
+
}, null, 8, ["user-info"])
|
|
129
|
+
]))),
|
|
130
|
+
128
|
|
131
|
+
/* KEYED_FRAGMENT */
|
|
132
|
+
))
|
|
133
|
+
])) : (v(), A(o(S), {
|
|
134
|
+
key: 1,
|
|
135
|
+
image: o(S).PRESENTED_IMAGE_SIMPLE
|
|
136
|
+
}, null, 8, ["image"]))
|
|
137
|
+
])
|
|
138
|
+
]),
|
|
139
|
+
_: 1
|
|
140
|
+
/* STABLE */
|
|
141
|
+
}, 8, ["spinning"])
|
|
142
|
+
])
|
|
143
|
+
]));
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
export {
|
|
147
|
+
re as default
|
|
148
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ref as u } from "vue";
|
|
2
|
+
function E(t, a = "") {
|
|
3
|
+
if (!t)
|
|
4
|
+
throw new Error("http is required");
|
|
5
|
+
const n = u([]), c = u([]), o = u(!1), d = u([]);
|
|
6
|
+
return {
|
|
7
|
+
getDeptTree: async () => {
|
|
8
|
+
try {
|
|
9
|
+
const e = await t.get(`${a}/security/dept/company/tree`);
|
|
10
|
+
return e.status === 0 ? (n.value = e.data, e.data) : [];
|
|
11
|
+
} catch (e) {
|
|
12
|
+
return console.error(e), [];
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
getUserListByDeptId: async (e) => {
|
|
16
|
+
try {
|
|
17
|
+
o.value = !0;
|
|
18
|
+
const s = await t.get(`${a}/security/dept/user/page?deptId=${e}&pageSIze=1000&pageNum=1`);
|
|
19
|
+
return s.status === 0 ? (c.value = s.data.list.map((r) => {
|
|
20
|
+
var p, g;
|
|
21
|
+
return {
|
|
22
|
+
...r,
|
|
23
|
+
id: r.userId,
|
|
24
|
+
userId: r.userId,
|
|
25
|
+
deptId: r.deptId,
|
|
26
|
+
realName: ((p = r.userInfo) == null ? void 0 : p.realName) || "",
|
|
27
|
+
phone: ((g = r.userInfo) == null ? void 0 : g.phone) || ""
|
|
28
|
+
};
|
|
29
|
+
}), s.data) : [];
|
|
30
|
+
} catch (s) {
|
|
31
|
+
return console.error(s), [];
|
|
32
|
+
} finally {
|
|
33
|
+
o.value = !1;
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
getUser: async () => {
|
|
37
|
+
try {
|
|
38
|
+
const e = await t.get(`${a}/security/dept/user/tree`);
|
|
39
|
+
return e.status === 0 ? e.data : [];
|
|
40
|
+
} catch (e) {
|
|
41
|
+
return console.error(e), [];
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
getRole: async () => {
|
|
45
|
+
try {
|
|
46
|
+
const e = await t.get(`${a}/security/company/role/page?pageNum=1&pageSize=1000`);
|
|
47
|
+
return e.status === 0 ? (d.value = e.data.list || [], e.data) : [];
|
|
48
|
+
} catch (e) {
|
|
49
|
+
return console.error(e), [];
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
deptTree: n,
|
|
53
|
+
userList: c,
|
|
54
|
+
roleList: d,
|
|
55
|
+
userLoading: o
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
E as useApi
|
|
60
|
+
};
|