@ithinkdt/ui 4.0.15 → 4.0.17
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/auto-imports.js +6 -3
- package/{dist/DataTable-DXZ3G4ZO.js → esm/DataTable-BvLINmq3.js} +3 -3
- package/esm/components-DfV9ybsT.js +2167 -0
- package/esm/components.d.ts +158 -67
- package/esm/components.js +2 -1
- package/esm/composables.js +27 -1
- package/esm/design.d.ts +3 -6
- package/esm/directives.js +2 -1
- package/esm/index.js +1209 -1
- package/esm/page.d.ts +2 -1
- package/esm/page.js +661 -1
- package/esm/use-style.js +31 -1
- package/package.json +9 -10
- package/dist/assets-bJgPKDh1.js +0 -187
- package/dist/components.js +0 -1629
- package/dist/composables.js +0 -27
- package/dist/directives.js +0 -2
- package/dist/index.js +0 -1225
- package/dist/page.js +0 -652
- package/dist/use-style.js +0 -31
- /package/{dist/directives-g3YmS-dM.js → esm/directives-Chz4DK1u.js} +0 -0
- /package/{dist/use-i18n-D1TTDOML.js → esm/use-i18n-BUP_StIp.js} +0 -0
package/dist/components.js
DELETED
|
@@ -1,1629 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./use-i18n-D1TTDOML.js";
|
|
2
|
-
import t, { cB as n, cE as r, useClsPrefix as i } from "./use-style.js";
|
|
3
|
-
import { i as a } from "./directives-g3YmS-dM.js";
|
|
4
|
-
import { _ as o, a as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S, v as C } from "./assets-bJgPKDh1.js";
|
|
5
|
-
import { Fragment as w, computed as T, createTextVNode as E, createVNode as D, defineAsyncComponent as O, defineComponent as k, h as A, inject as ee, isVNode as j, markRaw as M, mergeProps as N, nextTick as te, onBeforeUnmount as ne, reactive as P, ref as F, renderSlot as I, shallowRef as L, toRaw as re, toRef as ie, toValue as R, unref as ae, watch as z, withDirectives as oe } from "vue";
|
|
6
|
-
import { until as se } from "@vueuse/core";
|
|
7
|
-
import { NAnchor as ce, NAnchorLink as le, NAvatar as B, NAvatarGroup as ue, NButton as V, NCard as de, NCheckbox as H, NCheckboxGroup as fe, NDropdown as pe, NEllipsis as me, NEmpty as he, NFlex as U, NForm as ge, NFormItem as _e, NGi as ve, NGrid as ye, NIcon as W, NInput as be, NList as xe, NListItem as Se, NPagination as Ce, NPopover as we, NRadio as Te, NRadioButton as Ee, NRadioGroup as De, NSelect as Oe, NSpin as ke, NTag as Ae, NText as je, NTooltip as Me, NTransfer as Ne, NTree as Pe, NTreeSelect as Fe, formProps as Ie, useDialog as Le } from "ithinkdt-ui";
|
|
8
|
-
import { nanoid as Re } from "nanoid";
|
|
9
|
-
import { isNullish as ze, pickProps as G } from "@ithinkdt/common/object";
|
|
10
|
-
import { VOverflow as Be, VResizeObserver as Ve } from "vueuc";
|
|
11
|
-
import { Sortable as He } from "sortablejs/modular/sortable.core.esm.js";
|
|
12
|
-
import { useFormItem as Ue } from "ithinkdt-ui/es/_mixins";
|
|
13
|
-
import { measureText as We } from "@ithinkdt/common/string";
|
|
14
|
-
import { useFormModal as Ge } from "@ithinkdt/page";
|
|
15
|
-
import Ke from "ithinkdt-ui/es/_mixins/use-locale.mjs";
|
|
16
|
-
import { flattenTree as qe, walkTree as Je } from "@ithinkdt/common";
|
|
17
|
-
//#region src/components/Checkboxes.jsx
|
|
18
|
-
var Ye = /* @__PURE__ */ k({
|
|
19
|
-
name: "Checkboxes",
|
|
20
|
-
inheritAttrs: !1,
|
|
21
|
-
props: {
|
|
22
|
-
options: {
|
|
23
|
-
type: Array,
|
|
24
|
-
default: () => []
|
|
25
|
-
},
|
|
26
|
-
vertical: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: !1
|
|
29
|
-
},
|
|
30
|
-
default: {
|
|
31
|
-
type: [
|
|
32
|
-
Boolean,
|
|
33
|
-
String,
|
|
34
|
-
Object
|
|
35
|
-
],
|
|
36
|
-
default: !1
|
|
37
|
-
},
|
|
38
|
-
gap: {
|
|
39
|
-
type: [
|
|
40
|
-
Number,
|
|
41
|
-
String,
|
|
42
|
-
Array
|
|
43
|
-
],
|
|
44
|
-
default: void 0
|
|
45
|
-
},
|
|
46
|
-
modelValue: {
|
|
47
|
-
type: Array,
|
|
48
|
-
default: void 0
|
|
49
|
-
},
|
|
50
|
-
labelPadding: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: void 0
|
|
53
|
-
},
|
|
54
|
-
labelField: {
|
|
55
|
-
type: String,
|
|
56
|
-
default: "label"
|
|
57
|
-
},
|
|
58
|
-
valueField: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: "value"
|
|
61
|
-
},
|
|
62
|
-
disabledField: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: "disabled"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
emits: {
|
|
68
|
-
"update:modelValue": () => !0,
|
|
69
|
-
updateModelValue: () => !0
|
|
70
|
-
},
|
|
71
|
-
setup(t, { emit: n, attrs: r }) {
|
|
72
|
-
let { t: i } = e(), a = T(() => t.default ? t.default === !0 ? i("common.all") : typeof t.default == "string" ? t.default : t.default?.[t.labelField] ?? i("common.all") : ""), o = F([]);
|
|
73
|
-
z(() => t.modelValue, (e) => o.value = e, { immediate: !0 });
|
|
74
|
-
let s = (e) => {
|
|
75
|
-
n("update:modelValue", e), n("updateModelValue", e);
|
|
76
|
-
}, c = () => {
|
|
77
|
-
s(o.value?.length === t.options.length ? [] : t.options.map((e) => e[t.valueField]));
|
|
78
|
-
}, l = T(() => t.options.length > o.value?.length && o.value?.length > 0), u = T(() => ({ "--n-label-padding": t.labelPadding }));
|
|
79
|
-
return () => {
|
|
80
|
-
let e = D(fe, N(r, {
|
|
81
|
-
value: o.value,
|
|
82
|
-
onUpdateValue: s
|
|
83
|
-
}), { default: () => [D(U, {
|
|
84
|
-
size: t.gap ?? (t.vertical ? void 0 : "small"),
|
|
85
|
-
vertical: t.vertical,
|
|
86
|
-
style: !t.default && t.vertical ? { padding: "6px 0 0" } : {}
|
|
87
|
-
}, { default: () => [t.options?.map((e) => D(H, {
|
|
88
|
-
value: e[t.valueField],
|
|
89
|
-
disabled: e[t.disabledField],
|
|
90
|
-
style: u.value
|
|
91
|
-
}, { default: () => [e[t.labelField]] }))] })] });
|
|
92
|
-
return t.default ? D(U, {
|
|
93
|
-
size: t.gap ?? (t.vertical ? void 0 : "small"),
|
|
94
|
-
vertical: t.vertical,
|
|
95
|
-
style: t.vertical ? { padding: "6px 0 0" } : {}
|
|
96
|
-
}, { default: () => [D("span", null, [D(H, {
|
|
97
|
-
indeterminate: l.value,
|
|
98
|
-
checked: o.value?.length > 0,
|
|
99
|
-
onUpdateChecked: c,
|
|
100
|
-
style: u.value
|
|
101
|
-
}, { default: () => [a.value] })]), e] }) : e;
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
}), Xe = /* @__PURE__ */ k({
|
|
105
|
-
name: "DataActions",
|
|
106
|
-
props: { options: {
|
|
107
|
-
type: Array,
|
|
108
|
-
default: () => []
|
|
109
|
-
} },
|
|
110
|
-
setup(e) {
|
|
111
|
-
let t = F(), n = !0, r = () => {
|
|
112
|
-
n ? n = !1 : t.value?.sync({ showAllItemsBeforeCalculate: !0 });
|
|
113
|
-
}, i = F(), a = () => i.value, o = F(-1), s = (t) => {
|
|
114
|
-
o.value = e.options.length - t;
|
|
115
|
-
}, c = (e) => {
|
|
116
|
-
e || (o.value = -1);
|
|
117
|
-
}, l = () => {}, u = T(() => o.value === -1 ? [] : e.options.slice(o.value).map((e) => ({
|
|
118
|
-
...e,
|
|
119
|
-
key: e.text
|
|
120
|
-
}))), d = (e) => D(V, {
|
|
121
|
-
type: e.color === "danger" ? "error" : [
|
|
122
|
-
"default",
|
|
123
|
-
"tertiary",
|
|
124
|
-
"primary",
|
|
125
|
-
"info",
|
|
126
|
-
"success",
|
|
127
|
-
"warning",
|
|
128
|
-
"error"
|
|
129
|
-
].includes(e.color) ? e.color : "primary",
|
|
130
|
-
text: !0
|
|
131
|
-
}, { default: () => [e.text] }), p = (e, t) => {
|
|
132
|
-
t.onClick?.();
|
|
133
|
-
};
|
|
134
|
-
return () => D(Ve, { onResize: r }, { default: () => [D(Be, {
|
|
135
|
-
ref: t,
|
|
136
|
-
getCounter: a,
|
|
137
|
-
onUpdateCount: s,
|
|
138
|
-
onUpdateOverflow: c,
|
|
139
|
-
updateCounter: l,
|
|
140
|
-
style: "margin-top: 2px"
|
|
141
|
-
}, {
|
|
142
|
-
default: () => e.options.map((e) => D(V, {
|
|
143
|
-
quaternary: !0,
|
|
144
|
-
type: e.color === "danger" ? "error" : [
|
|
145
|
-
"default",
|
|
146
|
-
"tertiary",
|
|
147
|
-
"primary",
|
|
148
|
-
"info",
|
|
149
|
-
"success",
|
|
150
|
-
"warning",
|
|
151
|
-
"error"
|
|
152
|
-
].includes(e.color) ? e.color : "primary",
|
|
153
|
-
size: "small",
|
|
154
|
-
onClick: e.onClick
|
|
155
|
-
}, { default: () => [e.text] })),
|
|
156
|
-
counter: () => D("span", {
|
|
157
|
-
ref: i,
|
|
158
|
-
style: "position: absolute"
|
|
159
|
-
}, [D(pe, {
|
|
160
|
-
options: u.value,
|
|
161
|
-
renderLabel: d,
|
|
162
|
-
onSelect: p
|
|
163
|
-
}, { default: () => [D(V, {
|
|
164
|
-
quaternary: !0,
|
|
165
|
-
size: "small"
|
|
166
|
-
}, { default: () => [D(f, { style: "font-size: 14px; color: #888" }, null)] })] })])
|
|
167
|
-
})] });
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
//#endregion
|
|
171
|
-
//#region src/components/DataCustom.jsx
|
|
172
|
-
function K(e) {
|
|
173
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !j(e);
|
|
174
|
-
}
|
|
175
|
-
var Ze = /* @__PURE__ */ k({
|
|
176
|
-
name: "DataCustomRow",
|
|
177
|
-
props: {
|
|
178
|
-
label: [String, Function],
|
|
179
|
-
disabled: Boolean,
|
|
180
|
-
hidden: Boolean,
|
|
181
|
-
showFixed: Boolean,
|
|
182
|
-
fixed: [Boolean, String]
|
|
183
|
-
},
|
|
184
|
-
emits: ["update-hidden", "update-fixed"],
|
|
185
|
-
setup(e, { emit: t }) {
|
|
186
|
-
return () => {
|
|
187
|
-
let n;
|
|
188
|
-
return D(U, {
|
|
189
|
-
align: "center",
|
|
190
|
-
wrap: !1,
|
|
191
|
-
size: "small"
|
|
192
|
-
}, { default: () => [
|
|
193
|
-
D(V, {
|
|
194
|
-
type: "primary",
|
|
195
|
-
text: !0,
|
|
196
|
-
class: "icon-drag"
|
|
197
|
-
}, { default: () => [D(W, { size: "18" }, { default: () => [D(b, null, null)] })] }),
|
|
198
|
-
D(H, {
|
|
199
|
-
checked: !e.hidden,
|
|
200
|
-
disabled: e.disabled,
|
|
201
|
-
onUpdateChecked: (e) => t("update-hidden", !e)
|
|
202
|
-
}, null),
|
|
203
|
-
D(me, { style: "flex: 1 1 auto" }, K(n = R(e.label)) ? n : { default: () => [n] }),
|
|
204
|
-
e.showFixed ? [D(V, {
|
|
205
|
-
text: !0,
|
|
206
|
-
type: e.fixed === "left" ? "primary" : void 0,
|
|
207
|
-
onClick: () => t("update-fixed", e.fixed === "left" ? !1 : "left")
|
|
208
|
-
}, { default: () => [D(W, null, { default: () => [D(h, null, null)] })] }), D(V, {
|
|
209
|
-
text: !0,
|
|
210
|
-
type: e.fixed === "right" ? "primary" : void 0,
|
|
211
|
-
onClick: () => t("update-fixed", e.fixed === "right" ? !1 : "right")
|
|
212
|
-
}, { default: () => [D(W, null, { default: () => [D(o, null, null)] })] })] : void 0
|
|
213
|
-
] });
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
}), Qe = /* @__PURE__ */ k({
|
|
217
|
-
name: "DataCustom",
|
|
218
|
-
props: {
|
|
219
|
-
data: {
|
|
220
|
-
type: Array,
|
|
221
|
-
required: !0
|
|
222
|
-
},
|
|
223
|
-
keyField: {
|
|
224
|
-
type: String,
|
|
225
|
-
default: "key"
|
|
226
|
-
},
|
|
227
|
-
labelField: {
|
|
228
|
-
type: String,
|
|
229
|
-
default: "label"
|
|
230
|
-
},
|
|
231
|
-
fixedField: {
|
|
232
|
-
type: String,
|
|
233
|
-
default: "fixed"
|
|
234
|
-
},
|
|
235
|
-
hiddenField: {
|
|
236
|
-
type: String,
|
|
237
|
-
default: "hidden"
|
|
238
|
-
},
|
|
239
|
-
showFixed: {
|
|
240
|
-
type: Boolean,
|
|
241
|
-
default: !0
|
|
242
|
-
},
|
|
243
|
-
disabledField: {
|
|
244
|
-
type: String,
|
|
245
|
-
default: "disabled"
|
|
246
|
-
},
|
|
247
|
-
visibleField: {
|
|
248
|
-
type: String,
|
|
249
|
-
default: "visible"
|
|
250
|
-
},
|
|
251
|
-
tooltip: [String, Object],
|
|
252
|
-
size: {
|
|
253
|
-
type: Number,
|
|
254
|
-
default: 20
|
|
255
|
-
},
|
|
256
|
-
type: { type: String }
|
|
257
|
-
},
|
|
258
|
-
emits: { custom: () => !0 },
|
|
259
|
-
setup(t, { emit: n }) {
|
|
260
|
-
let { t: r } = e();
|
|
261
|
-
function i(e, r, i) {
|
|
262
|
-
n("custom", {
|
|
263
|
-
key: e[t.keyField],
|
|
264
|
-
[r]: i
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
let o = F(), s;
|
|
268
|
-
return z(o, (e) => {
|
|
269
|
-
s?.destroy(), s = void 0, e.$el && (s = He.create(e.$el, {
|
|
270
|
-
animation: 150,
|
|
271
|
-
ghostClass: "ghost",
|
|
272
|
-
handle: ".icon-drag",
|
|
273
|
-
filter: ".disabled",
|
|
274
|
-
onEnd(e) {
|
|
275
|
-
let r = t.data.map((e) => e[t.keyField]), [i] = r.splice(e.oldIndex, 1);
|
|
276
|
-
r.splice(e.newIndex, 0, i), n("custom", r);
|
|
277
|
-
}
|
|
278
|
-
}));
|
|
279
|
-
}), ne(() => {
|
|
280
|
-
s?.destroy(), s = void 0;
|
|
281
|
-
}), () => D(we, {
|
|
282
|
-
trigger: "click",
|
|
283
|
-
scrollable: !0,
|
|
284
|
-
placement: "left-start",
|
|
285
|
-
displayDirective: "show",
|
|
286
|
-
style: "max-height: 400px; width: 240px"
|
|
287
|
-
}, {
|
|
288
|
-
trigger: () => oe(D(V, {
|
|
289
|
-
text: !0,
|
|
290
|
-
type: t.type
|
|
291
|
-
}, { default: () => [D(W, { size: t.size }, { default: () => [D(p, null, null)] })] }), [[a, t.tooltip ?? r("common.page.custom.tooltip")]]),
|
|
292
|
-
default: () => {
|
|
293
|
-
let e, a;
|
|
294
|
-
return D(U, { vertical: !0 }, { default: () => [D(U, { justify: "space-between" }, { default: () => [D("div", { style: "font-weight: bold" }, [t.tooltip ?? r("common.page.custom.tooltip")]), D(V, {
|
|
295
|
-
text: !0,
|
|
296
|
-
type: "primary",
|
|
297
|
-
size: "small",
|
|
298
|
-
onClick: () => n("custom", !0)
|
|
299
|
-
}, K(e = r("common.page.custom.reset")) ? e : { default: () => [e] })] }), D(U, {
|
|
300
|
-
ref: o,
|
|
301
|
-
vertical: !0
|
|
302
|
-
}, K(a = t.data.map((e) => D(Ze, {
|
|
303
|
-
key: e[t.keyField],
|
|
304
|
-
label: e[t.labelField],
|
|
305
|
-
hidden: e[t.hiddenField],
|
|
306
|
-
fixed: e[t.fixedField],
|
|
307
|
-
showFixed: t.showFixed,
|
|
308
|
-
style: e[t.visibleField] === !1 ? "display: none" : void 0,
|
|
309
|
-
onUpdateHidden: (t) => i(e, "hidden", t),
|
|
310
|
-
onUpdateFixed: (t) => i(e, "fixed", t)
|
|
311
|
-
}, null))) ? a : { default: () => [a] })] });
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
//#endregion
|
|
317
|
-
//#region src/components/DataDescriptions.jsx
|
|
318
|
-
function $e(e) {
|
|
319
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !j(e);
|
|
320
|
-
}
|
|
321
|
-
function q(e, t) {
|
|
322
|
-
return typeof e == "function" ? e(t) : e;
|
|
323
|
-
}
|
|
324
|
-
function et(e, t) {
|
|
325
|
-
let n = e.children?.filter((e) => e.isGroup);
|
|
326
|
-
return D(le, { href: `#${e.prop}` }, {
|
|
327
|
-
title: () => q(e.label, t),
|
|
328
|
-
default: n?.length ? () => n.map((e) => et(e, t)) : void 0
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
function tt(e, t, n) {
|
|
332
|
-
return typeof e == "function" ? e(t, n) : e;
|
|
333
|
-
}
|
|
334
|
-
function nt(e, t, n, r) {
|
|
335
|
-
return e.isGroup ? D("div", {
|
|
336
|
-
key: e.prop,
|
|
337
|
-
class: `${r}__group`,
|
|
338
|
-
id: e.prop
|
|
339
|
-
}, [D("div", { class: `${r}__title` }, [q(e.label, n)]), D("div", { class: `${r}__wrapper` }, [e.children?.map((e) => nt(e, t, n, r))])]) : D("div", {
|
|
340
|
-
key: e.prop,
|
|
341
|
-
class: `${r}__item`,
|
|
342
|
-
style: {
|
|
343
|
-
"--descriptions-col-span": tt(e.colSpan, t, n) ?? 1,
|
|
344
|
-
"--descriptions-row-span": tt(e.rowSpan, t, n) ?? 1
|
|
345
|
-
}
|
|
346
|
-
}, [e.label ? D("div", { class: `${r}__label` }, [q(e.label, n)]) : void 0, D("div", { class: `${r}__content` }, [(n ? e.render ? e.render(n) : n[e.prop] : void 0) ?? D("span", { class: `${r}__nothing` }, [E("--")])])]);
|
|
347
|
-
}
|
|
348
|
-
var rt = /* @__PURE__ */ k({
|
|
349
|
-
name: "DataDescriptions",
|
|
350
|
-
props: {
|
|
351
|
-
cols: {
|
|
352
|
-
type: Number,
|
|
353
|
-
default: 3
|
|
354
|
-
},
|
|
355
|
-
data: { type: Object },
|
|
356
|
-
items: {
|
|
357
|
-
type: Array,
|
|
358
|
-
default: () => []
|
|
359
|
-
},
|
|
360
|
-
title: { type: [String, Function] },
|
|
361
|
-
anchor: {
|
|
362
|
-
type: [Boolean, Object],
|
|
363
|
-
default: void 0
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
setup(e) {
|
|
367
|
-
let n = i(), r = `${n.value}-data-descriptions`;
|
|
368
|
-
t("-data-descriptions", it, n);
|
|
369
|
-
let a = F();
|
|
370
|
-
z(() => e.items, () => {
|
|
371
|
-
location.hash && se(a).toBeTruthy().then((e) => {
|
|
372
|
-
e.scrollTo(location.hash);
|
|
373
|
-
});
|
|
374
|
-
}, { immediate: !0 });
|
|
375
|
-
let o = T(() => ({ "--descriptions-cols": e.cols })), s = T(() => N({
|
|
376
|
-
ref: a,
|
|
377
|
-
class: `${r}__anchor`,
|
|
378
|
-
showBackground: !1,
|
|
379
|
-
affix: !0
|
|
380
|
-
}, e.anchor && typeof e.anchor == "object" ? e.anchor : {}));
|
|
381
|
-
return () => {
|
|
382
|
-
let { cols: t, title: n, data: i, items: a, anchor: c } = e, l = ze(n) ? void 0 : D("div", { class: `${r}__header` }, [typeof n == "string" ? D("span", null, [n]) : n(i ?? void 0)]), u = a.filter((e) => !e.hidden).map((e) => nt(e, t, i, r)), d;
|
|
383
|
-
if (c !== !1) {
|
|
384
|
-
let e;
|
|
385
|
-
d = D(ce, s.value, $e(e = a.filter((e) => e.isGroup).map((e) => A(et(e, i), { key: e.prop }))) ? e : { default: () => [e] });
|
|
386
|
-
}
|
|
387
|
-
return D("div", {
|
|
388
|
-
class: r,
|
|
389
|
-
style: o.value
|
|
390
|
-
}, [
|
|
391
|
-
l,
|
|
392
|
-
D("div", { class: `${r}__wrapper` }, [u]),
|
|
393
|
-
d
|
|
394
|
-
]);
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
}), it = /* @__PURE__ */ n("data-descriptions", [
|
|
398
|
-
r("header", {
|
|
399
|
-
fontWeight: "bold",
|
|
400
|
-
fontSize: "1.125rem",
|
|
401
|
-
marginBottom: "24px"
|
|
402
|
-
}),
|
|
403
|
-
r("wrapper", {
|
|
404
|
-
gridTemplateColumns: "repeat(var(--descriptions-cols, 3), 1fr)",
|
|
405
|
-
display: "grid",
|
|
406
|
-
gap: "20px"
|
|
407
|
-
}, []),
|
|
408
|
-
r("group", { gridColumn: "span var(--descriptions-cols, 3)" }),
|
|
409
|
-
r("item", {
|
|
410
|
-
gridColumn: "span var(--descriptions-col-span, 3)",
|
|
411
|
-
gridRow: "span var(--descriptions-row-span, 3)"
|
|
412
|
-
}),
|
|
413
|
-
r("title", {
|
|
414
|
-
fontWeight: "bold",
|
|
415
|
-
fontSize: "1.125rem",
|
|
416
|
-
marginBottom: "20px",
|
|
417
|
-
marginTop: "24px"
|
|
418
|
-
}),
|
|
419
|
-
r("label", {
|
|
420
|
-
color: "#888",
|
|
421
|
-
paddingBottom: "6px"
|
|
422
|
-
}),
|
|
423
|
-
r("content", {
|
|
424
|
-
fontSize: "15px",
|
|
425
|
-
color: "var(--color-text)"
|
|
426
|
-
}),
|
|
427
|
-
r("anchor", {
|
|
428
|
-
position: "absolute",
|
|
429
|
-
zIndex: 2,
|
|
430
|
-
top: "40px",
|
|
431
|
-
right: "40px"
|
|
432
|
-
})
|
|
433
|
-
]), J = {
|
|
434
|
-
size: {
|
|
435
|
-
type: String,
|
|
436
|
-
default: void 0
|
|
437
|
-
},
|
|
438
|
-
gap: {
|
|
439
|
-
type: Number,
|
|
440
|
-
default: void 0
|
|
441
|
-
},
|
|
442
|
-
submitText: {
|
|
443
|
-
type: [
|
|
444
|
-
String,
|
|
445
|
-
Number,
|
|
446
|
-
Object
|
|
447
|
-
],
|
|
448
|
-
default: void 0
|
|
449
|
-
},
|
|
450
|
-
resetText: {
|
|
451
|
-
type: [
|
|
452
|
-
String,
|
|
453
|
-
Number,
|
|
454
|
-
Object
|
|
455
|
-
],
|
|
456
|
-
default: void 0
|
|
457
|
-
},
|
|
458
|
-
cancelText: {
|
|
459
|
-
type: [
|
|
460
|
-
String,
|
|
461
|
-
Number,
|
|
462
|
-
Object
|
|
463
|
-
],
|
|
464
|
-
default: void 0
|
|
465
|
-
},
|
|
466
|
-
showSubmitBtn: {
|
|
467
|
-
type: Boolean,
|
|
468
|
-
required: !1,
|
|
469
|
-
default: !0
|
|
470
|
-
},
|
|
471
|
-
showResetBtn: {
|
|
472
|
-
type: Boolean,
|
|
473
|
-
required: !1,
|
|
474
|
-
default: !0
|
|
475
|
-
},
|
|
476
|
-
showCancelBtn: {
|
|
477
|
-
type: Boolean,
|
|
478
|
-
required: !1,
|
|
479
|
-
default: !1
|
|
480
|
-
},
|
|
481
|
-
submitDisabled: Boolean,
|
|
482
|
-
submitLoading: Boolean,
|
|
483
|
-
succeeded: {
|
|
484
|
-
type: Boolean,
|
|
485
|
-
default: void 0
|
|
486
|
-
},
|
|
487
|
-
successText: {
|
|
488
|
-
type: [
|
|
489
|
-
String,
|
|
490
|
-
Number,
|
|
491
|
-
Object
|
|
492
|
-
],
|
|
493
|
-
default: void 0
|
|
494
|
-
},
|
|
495
|
-
failureText: {
|
|
496
|
-
type: [
|
|
497
|
-
String,
|
|
498
|
-
Number,
|
|
499
|
-
Object
|
|
500
|
-
],
|
|
501
|
-
default: void 0
|
|
502
|
-
},
|
|
503
|
-
nativeButtonType: Boolean
|
|
504
|
-
}, at = /* @__PURE__ */ k({
|
|
505
|
-
name: "DataFormActions",
|
|
506
|
-
props: J,
|
|
507
|
-
emits: [
|
|
508
|
-
"submit",
|
|
509
|
-
"reset",
|
|
510
|
-
"cancel"
|
|
511
|
-
],
|
|
512
|
-
setup(t, { emit: n, slots: r }) {
|
|
513
|
-
let { t: i } = e(), a = () => {
|
|
514
|
-
n("submit");
|
|
515
|
-
}, o = () => {
|
|
516
|
-
n("reset");
|
|
517
|
-
}, s = () => {
|
|
518
|
-
n("cancel");
|
|
519
|
-
}, { mergedDisabledRef: c, mergedSizeRef: l } = Ue(t);
|
|
520
|
-
return () => {
|
|
521
|
-
let e = l.value, n = c.value, { gap: u = e === "small" ? 8 : e === "medium" ? 12 : 16, submitText: d, resetText: f, cancelText: p, submitDisabled: m, submitLoading: h, showSubmitBtn: _, showResetBtn: v, showCancelBtn: b, succeeded: x, successText: S = d, failureText: C = d, nativeButtonType: w } = t;
|
|
522
|
-
return D(U, { size: u === void 0 ? e : u }, { default: () => [
|
|
523
|
-
I(r, "prefix"),
|
|
524
|
-
_ === !1 ? void 0 : D(V, {
|
|
525
|
-
attrType: w ? "submit" : "button",
|
|
526
|
-
size: e,
|
|
527
|
-
type: x ? "success" : x === !1 ? "error" : "primary",
|
|
528
|
-
disabled: x !== void 0 || n || m || h,
|
|
529
|
-
loading: h,
|
|
530
|
-
onClick: w ? void 0 : a
|
|
531
|
-
}, {
|
|
532
|
-
default: () => (x ? S : x === !1 ? C : d) || i("common.page.form.submitText"),
|
|
533
|
-
icon: () => x ? D(W, null, { default: () => [D(g, null, null)] }) : x === !1 ? D(W, null, { default: () => [D(y, null, null)] }) : void 0
|
|
534
|
-
}),
|
|
535
|
-
v === !1 ? void 0 : D(V, {
|
|
536
|
-
size: l.value,
|
|
537
|
-
attrType: w ? "reset" : "button",
|
|
538
|
-
disabled: n || h || x,
|
|
539
|
-
type: b ? "primary" : "default",
|
|
540
|
-
secondary: b,
|
|
541
|
-
onClick: w ? void 0 : o
|
|
542
|
-
}, { default: () => [f || i("common.page.form.resetText")] }),
|
|
543
|
-
b === !1 || x ? void 0 : D(V, {
|
|
544
|
-
attrType: "button",
|
|
545
|
-
disabled: n || h,
|
|
546
|
-
onClick: s
|
|
547
|
-
}, { default: () => [p || i("common.page.form.cancelText")] }),
|
|
548
|
-
I(r, "suffix")
|
|
549
|
-
] });
|
|
550
|
-
};
|
|
551
|
-
}
|
|
552
|
-
});
|
|
553
|
-
//#endregion
|
|
554
|
-
//#region src/components/DataForm.jsx
|
|
555
|
-
function ot(e) {
|
|
556
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !j(e);
|
|
557
|
-
}
|
|
558
|
-
var st = /* @__PURE__ */ k({
|
|
559
|
-
name: "DataForm",
|
|
560
|
-
props: {
|
|
561
|
-
grid: {
|
|
562
|
-
type: Object,
|
|
563
|
-
default: () => ({})
|
|
564
|
-
},
|
|
565
|
-
...G(Ie, "disabled", "model", "labelWidth", "labelAlign", "showFeedback", "size"),
|
|
566
|
-
...G(J, "submitText", "resetText", "cancelText", "showSubmitBtn", "showResetBtn", "showCancelBtn", "submitDisabled", "succeeded", "successText", "failureText"),
|
|
567
|
-
readonly: {
|
|
568
|
-
type: Boolean,
|
|
569
|
-
required: !1,
|
|
570
|
-
default: void 0
|
|
571
|
-
},
|
|
572
|
-
items: {
|
|
573
|
-
type: Array,
|
|
574
|
-
required: !0
|
|
575
|
-
},
|
|
576
|
-
validation: {
|
|
577
|
-
type: Object,
|
|
578
|
-
default: () => ({})
|
|
579
|
-
},
|
|
580
|
-
loading: Boolean,
|
|
581
|
-
showColon: Boolean,
|
|
582
|
-
tooltipPlacement: {
|
|
583
|
-
type: String,
|
|
584
|
-
default: "bottom"
|
|
585
|
-
},
|
|
586
|
-
requireMarkPlacement: {
|
|
587
|
-
type: String,
|
|
588
|
-
default: "left"
|
|
589
|
-
},
|
|
590
|
-
labelPlacement: {
|
|
591
|
-
type: String,
|
|
592
|
-
default: "left"
|
|
593
|
-
},
|
|
594
|
-
showAction: {
|
|
595
|
-
type: [Boolean, Object],
|
|
596
|
-
default: void 0
|
|
597
|
-
},
|
|
598
|
-
actionAlign: {
|
|
599
|
-
type: String,
|
|
600
|
-
default: "center"
|
|
601
|
-
},
|
|
602
|
-
actionJustify: {
|
|
603
|
-
type: String,
|
|
604
|
-
default: "start"
|
|
605
|
-
},
|
|
606
|
-
actionGap: {
|
|
607
|
-
type: String,
|
|
608
|
-
default: void 0
|
|
609
|
-
}
|
|
610
|
-
},
|
|
611
|
-
emits: [
|
|
612
|
-
"submit",
|
|
613
|
-
"reset",
|
|
614
|
-
"cancel"
|
|
615
|
-
],
|
|
616
|
-
setup(e, { emit: t, slots: n }) {
|
|
617
|
-
let r = (n) => {
|
|
618
|
-
n?.preventDefault?.(), t("submit", { ...re(e.model) }, n);
|
|
619
|
-
}, i = (e) => {
|
|
620
|
-
e?.preventDefault?.(), t("reset");
|
|
621
|
-
}, a = (e) => {
|
|
622
|
-
e?.preventDefault?.(), t("cancel");
|
|
623
|
-
}, o = F(), s = ({ overflow: t }) => I(n, "action", {
|
|
624
|
-
overflow: t,
|
|
625
|
-
grid: o.value
|
|
626
|
-
}, () => {
|
|
627
|
-
let { loading: t, showSubmitBtn: r, showResetBtn: i, showCancelBtn: o, actionAlign: s, actionJustify: c, actionGap: l, submitDisabled: u, submitText: d, resetText: f, cancelText: p, succeeded: m, successText: h, failureText: g } = e;
|
|
628
|
-
return [D(_e, {
|
|
629
|
-
label: c === "start" ? " " : void 0,
|
|
630
|
-
showLabel: e.labelPlacement !== "top",
|
|
631
|
-
style: "padding-top: 16px"
|
|
632
|
-
}, { default: () => [D(at, {
|
|
633
|
-
align: s,
|
|
634
|
-
justify: c,
|
|
635
|
-
gap: l,
|
|
636
|
-
showSubmitBtn: r,
|
|
637
|
-
showResetBtn: i,
|
|
638
|
-
showCancelBtn: o,
|
|
639
|
-
submitText: d,
|
|
640
|
-
resetText: f,
|
|
641
|
-
cancelText: p,
|
|
642
|
-
submitDisabled: u,
|
|
643
|
-
submitLoading: t,
|
|
644
|
-
succeeded: m,
|
|
645
|
-
successText: h,
|
|
646
|
-
failureText: g,
|
|
647
|
-
nativeButtonType: !0,
|
|
648
|
-
onCancel: a
|
|
649
|
-
}, {
|
|
650
|
-
prefix: () => I(n, "actionPrefix"),
|
|
651
|
-
suffix: () => I(n, "actionSuffix")
|
|
652
|
-
})] })];
|
|
653
|
-
}), c = () => {
|
|
654
|
-
let { items: t, validation: r, showAction: i } = e;
|
|
655
|
-
return D(w, null, [t.map(({ hidden: t, name: n, render: i, label: a, showColon: o, span: s = 6, rowSpan: c, offset: l = 0, tooltip: u, tooltipPlacement: d = e.tooltipPlacement, validationStatus: f = r[n]?.errors?.length ? "error" : r[n]?.warnings?.length ? "warnings" : r[n] ? "success" : void 0, readonly: p = e.readonly, showRequireMark: h = !p, showTooltipWhenReadonly: g = !1, ..._ }) => {
|
|
656
|
-
if (t) return;
|
|
657
|
-
let v;
|
|
658
|
-
return v = n[0] === "$" ? i({}) : D(_e, N({
|
|
659
|
-
path: n,
|
|
660
|
-
validationStatus: f,
|
|
661
|
-
showRequireMark: _.required && h
|
|
662
|
-
}, _), {
|
|
663
|
-
label: () => D(je, {
|
|
664
|
-
depth: e.readonly ? 3 : 2,
|
|
665
|
-
style: "display: inline-flex; align-items: flex-start; gap: 1px"
|
|
666
|
-
}, { default: () => [
|
|
667
|
-
D("span", null, [R(a)]),
|
|
668
|
-
d === "icon" ? D(Me, null, {
|
|
669
|
-
default: () => R(u),
|
|
670
|
-
trigger: () => D(V, {
|
|
671
|
-
text: !0,
|
|
672
|
-
style: "font-size: 1.25em; opacity: 0.8"
|
|
673
|
-
}, { default: () => [D(W, null, { default: () => [D(m, null, null)] })] })
|
|
674
|
-
}) : void 0,
|
|
675
|
-
e.showColon && o !== !1 ? D("span", { style: "place-self: center" }, [E(":")]) : void 0
|
|
676
|
-
] }),
|
|
677
|
-
default: () => {
|
|
678
|
-
let t, n = D("div", { style: "width: 100%; font-size: calc(1rem - 2px); min-height: 32px; display: flex; align-items: center" }, [i({
|
|
679
|
-
disabled: e.disabled,
|
|
680
|
-
size: e.size,
|
|
681
|
-
readonly: e.readonly
|
|
682
|
-
})]);
|
|
683
|
-
return u && d === "bottom" && (!e.readonly || g) ? D("div", { style: "width: 100%; display: flex; flex-direction: column" }, [n, D(je, {
|
|
684
|
-
depth: 3,
|
|
685
|
-
style: "font-size: calc(1rem - 3px); margin-top: 6px"
|
|
686
|
-
}, ot(t = R(u)) ? t : { default: () => [t] })]) : n;
|
|
687
|
-
},
|
|
688
|
-
feedback: () => r[n]?.errors?.[0] ?? r[n]?.warnings?.[0]
|
|
689
|
-
}), e.grid === !1 ? v : D(ve, {
|
|
690
|
-
key: n,
|
|
691
|
-
offset: l,
|
|
692
|
-
span: s,
|
|
693
|
-
style: c ? { gridRowEnd: `span ${c}` } : void 0
|
|
694
|
-
}, ot(v) ? v : { default: () => [v] });
|
|
695
|
-
}), i === !1 || e.readonly === !0 && !n.action ? void 0 : D(ve, N({
|
|
696
|
-
key: "action",
|
|
697
|
-
span: 2 ** 53 - 1
|
|
698
|
-
}, typeof e.showAction == "object" ? e.showAction : {}), { default: s })]);
|
|
699
|
-
};
|
|
700
|
-
return () => {
|
|
701
|
-
let { items: t, loading: n, validation: a, showColon: s, tooltipPlacement: l, showFeedback: u, labelWidth: d = "7.2em", labelAlign: f = e.labelPlacement === "top" ? "left" : "right", grid: p, showAction: m, showSubmitBtn: h, showResetBtn: g, showCancelBtn: _, actionAlign: v, actionJustify: y, actionGap: b, submitDisabled: x, submitText: S, resetText: C, cancelText: w, succeeded: T, successText: E, failureText: O, ...k } = e, A = !e.readonly && u !== !1;
|
|
702
|
-
return D(ge, N({
|
|
703
|
-
labelWidth: d,
|
|
704
|
-
labelAlign: f,
|
|
705
|
-
onReset: i,
|
|
706
|
-
onSubmit: r,
|
|
707
|
-
showFeedback: A
|
|
708
|
-
}, k), { default: () => [D(ye, N({
|
|
709
|
-
ref: o,
|
|
710
|
-
itemResponsive: !0
|
|
711
|
-
}, p, { yGap: A ? 0 : p?.yGap ?? 24 }), { default: c })] });
|
|
712
|
-
};
|
|
713
|
-
}
|
|
714
|
-
}), ct = /* @__PURE__ */ k({
|
|
715
|
-
name: "DataFilter",
|
|
716
|
-
props: {
|
|
717
|
-
grid: {
|
|
718
|
-
type: Object,
|
|
719
|
-
default: () => ({})
|
|
720
|
-
},
|
|
721
|
-
...G(Ie, "disabled", "model"),
|
|
722
|
-
labelWidth: {
|
|
723
|
-
type: [String, Number],
|
|
724
|
-
default: "5em"
|
|
725
|
-
},
|
|
726
|
-
labelPlacement: {
|
|
727
|
-
type: String,
|
|
728
|
-
default: "left"
|
|
729
|
-
},
|
|
730
|
-
items: {
|
|
731
|
-
type: Array,
|
|
732
|
-
required: !0
|
|
733
|
-
},
|
|
734
|
-
loading: {
|
|
735
|
-
type: Boolean,
|
|
736
|
-
required: !1,
|
|
737
|
-
default: !1
|
|
738
|
-
},
|
|
739
|
-
filterOnReset: {
|
|
740
|
-
type: Boolean,
|
|
741
|
-
required: !1,
|
|
742
|
-
default: !0
|
|
743
|
-
},
|
|
744
|
-
filterText: {
|
|
745
|
-
type: String,
|
|
746
|
-
default: void 0
|
|
747
|
-
},
|
|
748
|
-
resetText: {
|
|
749
|
-
type: String,
|
|
750
|
-
default: void 0
|
|
751
|
-
},
|
|
752
|
-
customizable: {
|
|
753
|
-
type: Boolean,
|
|
754
|
-
required: !1,
|
|
755
|
-
default: !0
|
|
756
|
-
},
|
|
757
|
-
collapsible: {
|
|
758
|
-
type: Boolean,
|
|
759
|
-
required: !1,
|
|
760
|
-
default: !0
|
|
761
|
-
},
|
|
762
|
-
defaultCollapsed: {
|
|
763
|
-
type: Boolean,
|
|
764
|
-
required: !1,
|
|
765
|
-
default: !0
|
|
766
|
-
},
|
|
767
|
-
collapsedRows: Number
|
|
768
|
-
},
|
|
769
|
-
emits: [
|
|
770
|
-
"filter",
|
|
771
|
-
"reset",
|
|
772
|
-
"custom",
|
|
773
|
-
"collapse"
|
|
774
|
-
],
|
|
775
|
-
setup(t, { expose: n, emit: r }) {
|
|
776
|
-
let { t: i } = e(), a = (e) => {
|
|
777
|
-
r("filter", t.model, e);
|
|
778
|
-
}, o = (e) => {
|
|
779
|
-
r("reset", e), t.filterOnReset && r("filter", t.model, e);
|
|
780
|
-
}, s = F(t.defaultCollapsed), c = (e) => {
|
|
781
|
-
s.value = e;
|
|
782
|
-
};
|
|
783
|
-
n({ collapse: c });
|
|
784
|
-
let l = P({
|
|
785
|
-
span: 6,
|
|
786
|
-
suffix: !0
|
|
787
|
-
});
|
|
788
|
-
return () => {
|
|
789
|
-
let { filterOnReset: e, filterText: n, resetText: u, customizable: d, defaultCollapsed: f, collapsible: p, grid: m, collapsedRows: h, ...g } = t;
|
|
790
|
-
return D(st, N({ grid: {
|
|
791
|
-
cols: "12 768:18 1280:24 1536:30",
|
|
792
|
-
yGap: 20,
|
|
793
|
-
xGap: 8,
|
|
794
|
-
...m,
|
|
795
|
-
collapsed: s.value,
|
|
796
|
-
collapsedRows: h
|
|
797
|
-
} }, g, {
|
|
798
|
-
showFeedback: !1,
|
|
799
|
-
showAction: l,
|
|
800
|
-
onSubmit: a,
|
|
801
|
-
onReset: o,
|
|
802
|
-
style: "position: relative"
|
|
803
|
-
}), { action: ({ grid: e }) => (te(() => {
|
|
804
|
-
l.suffix = e?.collapsedOverflow || e?.contentEl.children.item(e?.contentEl.children.length - 1).offsetTop > 0;
|
|
805
|
-
}), D("div", { style: "display: flex; gap: 12px; align-items: center; justify-content: " + (l.suffix ? "flex-end" : "flex-start") }, [
|
|
806
|
-
l.suffix ? void 0 : D("span", null, [E("\xA0\xA0\xA0\xA0")]),
|
|
807
|
-
D(V, {
|
|
808
|
-
attrType: "submit",
|
|
809
|
-
type: "primary",
|
|
810
|
-
disabled: t.disabled,
|
|
811
|
-
loading: t.loading
|
|
812
|
-
}, { default: () => [n || i("common.page.filter.submitText")] }),
|
|
813
|
-
D(V, {
|
|
814
|
-
attrType: "reset",
|
|
815
|
-
disabled: t.disabled || t.loading
|
|
816
|
-
}, { default: () => [u || i("common.page.form.resetText")] }),
|
|
817
|
-
d ? D(Qe, {
|
|
818
|
-
keyField: "name",
|
|
819
|
-
showFixed: !1,
|
|
820
|
-
data: g.items,
|
|
821
|
-
size: 18,
|
|
822
|
-
type: "primary",
|
|
823
|
-
onCustom: (e) => r("custom", e)
|
|
824
|
-
}, null) : void 0,
|
|
825
|
-
p && e?.collapsedOverflow ? D(V, {
|
|
826
|
-
text: !0,
|
|
827
|
-
type: "primary",
|
|
828
|
-
iconPlacement: "right",
|
|
829
|
-
renderIcon: s.value ? _ : C,
|
|
830
|
-
onClick: () => c(!s.value)
|
|
831
|
-
}, { default: () => [s.value ? i("common.page.filter.expand") : i("common.page.filter.collapse")] }) : void 0
|
|
832
|
-
])) });
|
|
833
|
-
};
|
|
834
|
-
}
|
|
835
|
-
});
|
|
836
|
-
//#endregion
|
|
837
|
-
//#region src/components/DataLocaleInput.jsx
|
|
838
|
-
function lt(e) {
|
|
839
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !j(e);
|
|
840
|
-
}
|
|
841
|
-
function ut(t, n, r = 1) {
|
|
842
|
-
let { t: i } = e(), a = F(!1), o = [], { open: s, reinit: c } = Ge({
|
|
843
|
-
title: t,
|
|
844
|
-
showColon: !0,
|
|
845
|
-
submitText: i("common.confirm.defaultOk"),
|
|
846
|
-
items: ({ it: e }) => o.map((t) => e(t.value, t.label, "input", {
|
|
847
|
-
span: 24,
|
|
848
|
-
required: t.required,
|
|
849
|
-
inputProps: {
|
|
850
|
-
readonly: a,
|
|
851
|
-
clearable: !0,
|
|
852
|
-
type: "textarea",
|
|
853
|
-
showCount: !0,
|
|
854
|
-
autosize: {
|
|
855
|
-
minRows: ae(r),
|
|
856
|
-
maxRows: Math.max(ae(r), 5)
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
})),
|
|
860
|
-
onSubmit: n
|
|
861
|
-
});
|
|
862
|
-
return {
|
|
863
|
-
open: (e, t = !1) => (a.value = t, s(e)),
|
|
864
|
-
setSupports: (e) => {
|
|
865
|
-
o = e, c();
|
|
866
|
-
}
|
|
867
|
-
};
|
|
868
|
-
}
|
|
869
|
-
var dt = /* @__PURE__ */ k({
|
|
870
|
-
name: "DataLocaleInput",
|
|
871
|
-
props: {
|
|
872
|
-
label: { type: [
|
|
873
|
-
String,
|
|
874
|
-
Function,
|
|
875
|
-
Number,
|
|
876
|
-
Boolean,
|
|
877
|
-
Object
|
|
878
|
-
] },
|
|
879
|
-
mode: {
|
|
880
|
-
type: String,
|
|
881
|
-
default: "dialog"
|
|
882
|
-
},
|
|
883
|
-
defaultExpanded: {
|
|
884
|
-
type: Boolean,
|
|
885
|
-
default: !1
|
|
886
|
-
},
|
|
887
|
-
modelValue: Object,
|
|
888
|
-
supports: {
|
|
889
|
-
type: Array,
|
|
890
|
-
default: () => []
|
|
891
|
-
},
|
|
892
|
-
disabled: {
|
|
893
|
-
type: Boolean,
|
|
894
|
-
default: void 0
|
|
895
|
-
},
|
|
896
|
-
defaultLang: {
|
|
897
|
-
type: String,
|
|
898
|
-
default: "zh-CN"
|
|
899
|
-
},
|
|
900
|
-
showLang: {
|
|
901
|
-
type: String,
|
|
902
|
-
default: void 0
|
|
903
|
-
},
|
|
904
|
-
defaultRows: {
|
|
905
|
-
type: Number,
|
|
906
|
-
default: 1
|
|
907
|
-
}
|
|
908
|
-
},
|
|
909
|
-
emits: ["update:modelValue", "updateModelValue"],
|
|
910
|
-
setup(e, { emit: t }) {
|
|
911
|
-
let n = (n, r = e.showLang ?? e.defaultLang) => {
|
|
912
|
-
n = {
|
|
913
|
-
...e.modelValue,
|
|
914
|
-
[r]: n
|
|
915
|
-
}, t("update:modelValue", n), t("updateModelValue", n);
|
|
916
|
-
}, { open: r, setSupports: i } = ut(T(() => R(e.label)), (e) => {
|
|
917
|
-
t("update:modelValue", e), t("updateModelValue", e);
|
|
918
|
-
}, ie(e, "defaultRows")), o = F(e.defaultExpanded);
|
|
919
|
-
z(() => e.defaultExpanded, (e) => {
|
|
920
|
-
o.value = e;
|
|
921
|
-
});
|
|
922
|
-
let s = () => D(V, {
|
|
923
|
-
quaternary: !0,
|
|
924
|
-
onClick: () => {
|
|
925
|
-
o.value = !o.value;
|
|
926
|
-
},
|
|
927
|
-
style: "--n-padding: 0 8px"
|
|
928
|
-
}, { default: () => [D(W, {
|
|
929
|
-
size: "20",
|
|
930
|
-
depth: "3"
|
|
931
|
-
}, { default: () => [o.value ? D(S, null, null) : D(l, null, null)] })] }), c = (t) => {
|
|
932
|
-
let n = t.split("-")[0];
|
|
933
|
-
return e.supports.some((e) => e.value !== t && e.value.startsWith(n)) ? t : n;
|
|
934
|
-
}, d = `__slots${Re(6)}`;
|
|
935
|
-
z(() => e.supports, (e) => {
|
|
936
|
-
i(e);
|
|
937
|
-
let t = 0;
|
|
938
|
-
for (let [n, r] of e.entries()) {
|
|
939
|
-
let e = c(r.value);
|
|
940
|
-
t = Math.max(t, We(e, "monospace")), r[d] = M({
|
|
941
|
-
prefix: () => D("div", { style: {
|
|
942
|
-
width: `${t + 4}px`,
|
|
943
|
-
height: "100%",
|
|
944
|
-
opacity: .5,
|
|
945
|
-
fontSize: "12px",
|
|
946
|
-
fontFamily: "monospace",
|
|
947
|
-
color: r.required ? "var(--color-danger)" : void 0
|
|
948
|
-
} }, [e]),
|
|
949
|
-
suffix: n === 0 ? s : void 0
|
|
950
|
-
});
|
|
951
|
-
}
|
|
952
|
-
}, { immediate: !0 });
|
|
953
|
-
let f = T(() => {
|
|
954
|
-
let t = c(e.showLang ?? e.defaultLang);
|
|
955
|
-
return [t, We(t, "monospace")];
|
|
956
|
-
}), p = {
|
|
957
|
-
prefix: () => D("div", { style: {
|
|
958
|
-
width: `${f.value[1] + 4}px`,
|
|
959
|
-
height: "100%",
|
|
960
|
-
opacity: .5,
|
|
961
|
-
fontSize: "12px",
|
|
962
|
-
fontFamily: "monospace"
|
|
963
|
-
} }, [f.value[0]]),
|
|
964
|
-
suffix: () => D(V, {
|
|
965
|
-
quaternary: !0,
|
|
966
|
-
onClick: () => r(e.modelValue, e.disabled),
|
|
967
|
-
style: "--n-padding: 0 8px"
|
|
968
|
-
}, { default: () => [D(W, {
|
|
969
|
-
size: "20",
|
|
970
|
-
depth: "3"
|
|
971
|
-
}, { default: () => [D(u, null, null)] })] })
|
|
972
|
-
}, m = { "--n-padding-right": "0" };
|
|
973
|
-
return () => {
|
|
974
|
-
let t;
|
|
975
|
-
return e.mode === "dialog" ? D(be, {
|
|
976
|
-
value: e.modelValue?.[e.showLang ?? e.defaultLang] ?? e.modelValue?.[e.defaultLang],
|
|
977
|
-
onUpdateValue: n,
|
|
978
|
-
disabled: e.disabled,
|
|
979
|
-
clearable: !0,
|
|
980
|
-
style: m,
|
|
981
|
-
type: e.defaultRows > 1 ? "textarea" : "text",
|
|
982
|
-
rows: e.defaultRows
|
|
983
|
-
}, lt(p) ? p : { default: () => [p] }) : D(U, {
|
|
984
|
-
vertical: !0,
|
|
985
|
-
wrap: !1,
|
|
986
|
-
style: "width: 100%"
|
|
987
|
-
}, lt(t = e.supports.map((t, r) => {
|
|
988
|
-
if (!o.value && r !== 0) return;
|
|
989
|
-
let i = r == 0;
|
|
990
|
-
return oe(D(be, {
|
|
991
|
-
key: t.value,
|
|
992
|
-
value: e.modelValue?.[t.value],
|
|
993
|
-
onUpdateValue: (e) => n(e, t.value),
|
|
994
|
-
disabled: e.disabled,
|
|
995
|
-
clearable: !0,
|
|
996
|
-
style: i ? m : void 0,
|
|
997
|
-
type: e.defaultRows > 1 ? "textarea" : "text",
|
|
998
|
-
rows: e.defaultRows
|
|
999
|
-
}, t[d]), [[
|
|
1000
|
-
a,
|
|
1001
|
-
t.label,
|
|
1002
|
-
void 0,
|
|
1003
|
-
{ left: !0 }
|
|
1004
|
-
]]);
|
|
1005
|
-
})) ? t : { default: () => [t] });
|
|
1006
|
-
};
|
|
1007
|
-
}
|
|
1008
|
-
}), Y = /* @__PURE__ */ k({
|
|
1009
|
-
name: "DataPagination",
|
|
1010
|
-
props: {
|
|
1011
|
-
total: {
|
|
1012
|
-
type: Number,
|
|
1013
|
-
default: 0
|
|
1014
|
-
},
|
|
1015
|
-
currentPage: { type: Number },
|
|
1016
|
-
pageSize: { type: Number },
|
|
1017
|
-
page: { type: Object },
|
|
1018
|
-
resetPageOnSizeChange: {
|
|
1019
|
-
type: Boolean,
|
|
1020
|
-
default: !0
|
|
1021
|
-
},
|
|
1022
|
-
pageSizes: { type: Array },
|
|
1023
|
-
simple: Boolean
|
|
1024
|
-
},
|
|
1025
|
-
emits: { change: () => !0 },
|
|
1026
|
-
setup(t, { emit: n }) {
|
|
1027
|
-
let { t: r } = e(), i = (e) => n("change", {
|
|
1028
|
-
pageSize: t.pageSize ?? t.page?.pageSize ?? 0,
|
|
1029
|
-
currentPage: e
|
|
1030
|
-
}), a = (e) => n("change", {
|
|
1031
|
-
pageSize: e,
|
|
1032
|
-
currentPage: t.resetPageOnSizeChange ? 1 : t.currentPage ?? t.page?.currentPage ?? 1
|
|
1033
|
-
}), o = ee(Y.DEFAULT_PAGE_SIZES_INJECTION_KEY, () => [
|
|
1034
|
-
10,
|
|
1035
|
-
20,
|
|
1036
|
-
30,
|
|
1037
|
-
50
|
|
1038
|
-
], !0), s = {
|
|
1039
|
-
prefix: () => r("common.page.pagination.prefix", { total: t.total }),
|
|
1040
|
-
suffix: () => r("common.page.pagination.suffix")
|
|
1041
|
-
};
|
|
1042
|
-
return () => D(Ce, {
|
|
1043
|
-
page: t.currentPage ?? t.page?.currentPage,
|
|
1044
|
-
itemCount: t.total,
|
|
1045
|
-
pageSize: t.pageSize ?? t.page?.pageSize,
|
|
1046
|
-
onUpdatePage: i,
|
|
1047
|
-
onUpdatePageSize: a,
|
|
1048
|
-
pageSizes: t.pageSizes || o,
|
|
1049
|
-
showQuickJumper: !0,
|
|
1050
|
-
showSizePicker: !0,
|
|
1051
|
-
simple: t.simple,
|
|
1052
|
-
style: "justify-content: flex-end"
|
|
1053
|
-
}, t.simple ? void 0 : s);
|
|
1054
|
-
}
|
|
1055
|
-
});
|
|
1056
|
-
Y.DEFAULT_PAGE_SIZES_INJECTION_KEY = Symbol();
|
|
1057
|
-
//#endregion
|
|
1058
|
-
//#region src/components/DataSelection.jsx
|
|
1059
|
-
function ft(e) {
|
|
1060
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !j(e);
|
|
1061
|
-
}
|
|
1062
|
-
var pt = /* @__PURE__ */ k({
|
|
1063
|
-
name: "DataSelection",
|
|
1064
|
-
props: {
|
|
1065
|
-
modelValue: {
|
|
1066
|
-
type: String,
|
|
1067
|
-
required: !0
|
|
1068
|
-
},
|
|
1069
|
-
count: {
|
|
1070
|
-
type: Number,
|
|
1071
|
-
default: 0
|
|
1072
|
-
}
|
|
1073
|
-
},
|
|
1074
|
-
emits: {
|
|
1075
|
-
"update:modelValue": () => !0,
|
|
1076
|
-
clear: () => !0
|
|
1077
|
-
},
|
|
1078
|
-
setup(t, { emit: n }) {
|
|
1079
|
-
let { t: r } = e();
|
|
1080
|
-
return () => {
|
|
1081
|
-
let e;
|
|
1082
|
-
return t.modelValue !== "selection" && t.count === 0 ? D("div", null, null) : D("div", null, [D(U, {
|
|
1083
|
-
align: "center",
|
|
1084
|
-
"wrap-item": !1
|
|
1085
|
-
}, { default: () => [
|
|
1086
|
-
D("span", null, [r("common.page.selection.countText", { count: t.count })]),
|
|
1087
|
-
D(V, {
|
|
1088
|
-
text: !0,
|
|
1089
|
-
type: "primary",
|
|
1090
|
-
onClick: () => {
|
|
1091
|
-
n("update:modelValue", t.modelValue === "all" ? "selection" : "all");
|
|
1092
|
-
}
|
|
1093
|
-
}, { default: () => [t.modelValue === "all" ? r("common.page.selection.view") : r("common.page.selection.back")] }),
|
|
1094
|
-
D(V, {
|
|
1095
|
-
text: !0,
|
|
1096
|
-
onClick: () => {
|
|
1097
|
-
n("clear"), n("update:modelValue", "all");
|
|
1098
|
-
}
|
|
1099
|
-
}, ft(e = r("common.page.selection.clear")) ? e : { default: () => [e] })
|
|
1100
|
-
] })]);
|
|
1101
|
-
};
|
|
1102
|
-
}
|
|
1103
|
-
});
|
|
1104
|
-
//#endregion
|
|
1105
|
-
//#region src/components/Radios.jsx
|
|
1106
|
-
function mt(e) {
|
|
1107
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !j(e);
|
|
1108
|
-
}
|
|
1109
|
-
var ht = /* @__PURE__ */ k({
|
|
1110
|
-
name: "Radios",
|
|
1111
|
-
props: {
|
|
1112
|
-
options: {
|
|
1113
|
-
type: Array,
|
|
1114
|
-
default: () => []
|
|
1115
|
-
},
|
|
1116
|
-
vertical: {
|
|
1117
|
-
type: Boolean,
|
|
1118
|
-
default: !1
|
|
1119
|
-
},
|
|
1120
|
-
type: {
|
|
1121
|
-
type: String,
|
|
1122
|
-
default: "radio"
|
|
1123
|
-
},
|
|
1124
|
-
default: {
|
|
1125
|
-
type: [
|
|
1126
|
-
Boolean,
|
|
1127
|
-
String,
|
|
1128
|
-
Object
|
|
1129
|
-
],
|
|
1130
|
-
default: !1
|
|
1131
|
-
},
|
|
1132
|
-
padding: {
|
|
1133
|
-
type: String,
|
|
1134
|
-
default: void 0
|
|
1135
|
-
},
|
|
1136
|
-
labelField: {
|
|
1137
|
-
type: String,
|
|
1138
|
-
default: "label"
|
|
1139
|
-
},
|
|
1140
|
-
valueField: {
|
|
1141
|
-
type: String,
|
|
1142
|
-
default: "value"
|
|
1143
|
-
},
|
|
1144
|
-
disabledField: {
|
|
1145
|
-
type: String,
|
|
1146
|
-
default: "disabled"
|
|
1147
|
-
},
|
|
1148
|
-
modelValue: {
|
|
1149
|
-
type: [
|
|
1150
|
-
String,
|
|
1151
|
-
Number,
|
|
1152
|
-
Boolean
|
|
1153
|
-
],
|
|
1154
|
-
default: void 0
|
|
1155
|
-
}
|
|
1156
|
-
},
|
|
1157
|
-
emits: {
|
|
1158
|
-
"update:modelValue": () => !0,
|
|
1159
|
-
updateModelValue: () => !0
|
|
1160
|
-
},
|
|
1161
|
-
setup(t, { emit: n }) {
|
|
1162
|
-
let { t: r } = e(), i = T(() => t.default === !1 ? "" : t.default === !0 ? r("common.all") : typeof t.default == "string" ? t.default : t.default?.[t.labelField] ?? r("common.all")), a = T(() => t.type === "button-primary" ? {
|
|
1163
|
-
"--n-button-color-active": "var(--color-primary)",
|
|
1164
|
-
"--n-button-text-color-active": "var(--color-base)"
|
|
1165
|
-
} : {}), o = (e) => {
|
|
1166
|
-
n("update:modelValue", e), n("updateModelValue", e);
|
|
1167
|
-
};
|
|
1168
|
-
return () => {
|
|
1169
|
-
let e = t.type === "button" ? Ee : Te, n = D(w, null, [t.default ? D(e, { value: typeof t.default == "object" ? t.default?.[t.valueField] : null }, { default: () => [i.value] }) : void 0, t.options?.map((n) => {
|
|
1170
|
-
let r = typeof n[t.labelField] == "string" ? n[t.labelField] : n[t.labelField]?.();
|
|
1171
|
-
return D(e, {
|
|
1172
|
-
value: n[t.valueField],
|
|
1173
|
-
disabled: n[t.disabledField],
|
|
1174
|
-
style: t.padding ? {
|
|
1175
|
-
paddingLeft: t.padding,
|
|
1176
|
-
paddingRight: t.padding
|
|
1177
|
-
} : {}
|
|
1178
|
-
}, { default: () => [n.tip ? D(Me, null, {
|
|
1179
|
-
default: () => n.tip,
|
|
1180
|
-
trigger: () => r
|
|
1181
|
-
}) : r] });
|
|
1182
|
-
})]);
|
|
1183
|
-
return D(De, {
|
|
1184
|
-
style: t.vertical ? {
|
|
1185
|
-
...a.value,
|
|
1186
|
-
padding: "6px 0 0"
|
|
1187
|
-
} : a.value,
|
|
1188
|
-
value: t.modelValue,
|
|
1189
|
-
onUpdateValue: o
|
|
1190
|
-
}, { default: () => [t.type === "radio" ? D(U, {
|
|
1191
|
-
size: t.vertical ? void 0 : "small",
|
|
1192
|
-
vertical: t.vertical
|
|
1193
|
-
}, mt(n) ? n : { default: () => [n] }) : n] });
|
|
1194
|
-
};
|
|
1195
|
-
}
|
|
1196
|
-
});
|
|
1197
|
-
//#endregion
|
|
1198
|
-
//#region src/components/UserDept.jsx
|
|
1199
|
-
function X(e) {
|
|
1200
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !j(e);
|
|
1201
|
-
}
|
|
1202
|
-
var gt = /* @__PURE__ */ k({
|
|
1203
|
-
name: "UserDept",
|
|
1204
|
-
inheritAttrs: !1,
|
|
1205
|
-
props: {
|
|
1206
|
-
users: {
|
|
1207
|
-
type: Array,
|
|
1208
|
-
default: () => []
|
|
1209
|
-
},
|
|
1210
|
-
groups: {
|
|
1211
|
-
type: Array,
|
|
1212
|
-
default: () => []
|
|
1213
|
-
},
|
|
1214
|
-
depts: {
|
|
1215
|
-
type: Array,
|
|
1216
|
-
default: () => []
|
|
1217
|
-
},
|
|
1218
|
-
modelValue: {
|
|
1219
|
-
type: [Array, String],
|
|
1220
|
-
default: void 0
|
|
1221
|
-
},
|
|
1222
|
-
placeholder: {
|
|
1223
|
-
type: String,
|
|
1224
|
-
default: void 0
|
|
1225
|
-
},
|
|
1226
|
-
size: {
|
|
1227
|
-
type: String,
|
|
1228
|
-
default: void 0
|
|
1229
|
-
},
|
|
1230
|
-
type: {
|
|
1231
|
-
type: String,
|
|
1232
|
-
default: "user"
|
|
1233
|
-
},
|
|
1234
|
-
selectType: {
|
|
1235
|
-
type: String,
|
|
1236
|
-
default: "dropdown"
|
|
1237
|
-
},
|
|
1238
|
-
max: {
|
|
1239
|
-
type: Number,
|
|
1240
|
-
default: void 0
|
|
1241
|
-
},
|
|
1242
|
-
multiple: {
|
|
1243
|
-
type: Boolean,
|
|
1244
|
-
default: !1
|
|
1245
|
-
},
|
|
1246
|
-
defaultExpandAll: {
|
|
1247
|
-
type: Boolean,
|
|
1248
|
-
default: !1
|
|
1249
|
-
},
|
|
1250
|
-
filterable: {
|
|
1251
|
-
type: Boolean,
|
|
1252
|
-
default: !1
|
|
1253
|
-
},
|
|
1254
|
-
disabled: {
|
|
1255
|
-
type: Boolean,
|
|
1256
|
-
default: void 0
|
|
1257
|
-
},
|
|
1258
|
-
getUsersByGroup: {
|
|
1259
|
-
type: Function,
|
|
1260
|
-
default: () => []
|
|
1261
|
-
},
|
|
1262
|
-
getUsersByDept: {
|
|
1263
|
-
type: Function,
|
|
1264
|
-
default: () => []
|
|
1265
|
-
},
|
|
1266
|
-
valueField: { type: String },
|
|
1267
|
-
renderUserInfo: Function
|
|
1268
|
-
},
|
|
1269
|
-
emits: ["update:modelValue", "updateModelValue"],
|
|
1270
|
-
setup(t, { emit: n, attrs: r }) {
|
|
1271
|
-
let { t: i } = e(), { localeRef: a } = Ke("Popconfirm"), o = T(() => t.valueField || (t.type === "user" ? "username" : "code")), l = T(() => {
|
|
1272
|
-
if (t.multiple) return t.modelValue || [];
|
|
1273
|
-
let e = t.modelValue?.trim();
|
|
1274
|
-
return e ? [e] : [];
|
|
1275
|
-
}), u = /* @__PURE__ */ new Map(), f = T(() => (u.clear(), t.users.map((e) => (e = P(e), e.label = e.nickname + e.username, e.value = e[o.value], e.type = "user", u.set(e[o.value], e), e)))), p = L([]);
|
|
1276
|
-
z(() => t.depts, (e) => {
|
|
1277
|
-
Je(e, (e) => {
|
|
1278
|
-
e.label = e.name, e.value = e[o.value], e.type = "dept", e.children?.length || delete e.children;
|
|
1279
|
-
}), p.value = qe(e);
|
|
1280
|
-
}, { immediate: !0 });
|
|
1281
|
-
let m = T(() => [
|
|
1282
|
-
...t.depts,
|
|
1283
|
-
...t.groups.map((e) => ({
|
|
1284
|
-
label: e.name,
|
|
1285
|
-
value: e.code,
|
|
1286
|
-
type: "group"
|
|
1287
|
-
})),
|
|
1288
|
-
...f.value
|
|
1289
|
-
]), h = F([]), g = F(), _ = async (e) => {
|
|
1290
|
-
let n = await (e.type === "group" ? t.getUsersByGroup(e.value) : t.getUsersByDept(e.value));
|
|
1291
|
-
for (let e of f.value) e.disabled = !0;
|
|
1292
|
-
g.value = [...e.type === "dept" ? e.children ?? [] : [], ...n.map((e) => {
|
|
1293
|
-
let t = u.get(e[o.value]);
|
|
1294
|
-
return t && (t.disabled = !1), {
|
|
1295
|
-
...e,
|
|
1296
|
-
label: e.nickname + e.username,
|
|
1297
|
-
value: e[o.value],
|
|
1298
|
-
type: "user"
|
|
1299
|
-
};
|
|
1300
|
-
})];
|
|
1301
|
-
}, y = /* @__PURE__ */ new WeakMap(), b = (e, n, r) => {
|
|
1302
|
-
let a;
|
|
1303
|
-
if (t.type === "dept") return D(Pe, {
|
|
1304
|
-
data: t.depts,
|
|
1305
|
-
keyField: "value",
|
|
1306
|
-
labelField: "name",
|
|
1307
|
-
defaultExpandAll: t.defaultExpandAll,
|
|
1308
|
-
checkable: t.multiple,
|
|
1309
|
-
selectable: !t.multiple,
|
|
1310
|
-
multiple: !1,
|
|
1311
|
-
blockLine: !0,
|
|
1312
|
-
checkOnClick: !0,
|
|
1313
|
-
pattern: r,
|
|
1314
|
-
filter: (e, t) => t.label.includes(e) || t.value.includes(e),
|
|
1315
|
-
checkedKeys: t.multiple ? e : void 0,
|
|
1316
|
-
selectedKeys: t.multiple ? void 0 : e,
|
|
1317
|
-
onUpdateCheckedKeys: (e) => {
|
|
1318
|
-
t.max && e?.length > t.max || n(e);
|
|
1319
|
-
},
|
|
1320
|
-
onUpdateSelectedKeys: (e) => {
|
|
1321
|
-
n(e);
|
|
1322
|
-
}
|
|
1323
|
-
}, null);
|
|
1324
|
-
let o = e ? y.get(e) : /* @__PURE__ */ new Set();
|
|
1325
|
-
if (e && !o && (o = new Set(e), y.set(e, o)), g.value === !1) return D(ke, { show: !0 }, null);
|
|
1326
|
-
let l = g.value || m.value;
|
|
1327
|
-
r = r?.trim(), r && (l = l?.filter((e) => e.label.includes(r) || e.value.includes(r)));
|
|
1328
|
-
let u = h.value;
|
|
1329
|
-
return D(w, null, [D("div", { style: "margin: 12px 16px; display: flex; justify-content: space-between; align-items: center" }, [u.length > 0 ? D(w, null, [D("span", { style: "display: flex; align-items: center" }, [
|
|
1330
|
-
u.length >= 2 ? u.at(-2).label : i("common.all"),
|
|
1331
|
-
D("span", { style: "padding: 0 4px" }, [D(d, null, null)]),
|
|
1332
|
-
u.at(-1).label
|
|
1333
|
-
]), D(V, {
|
|
1334
|
-
text: !0,
|
|
1335
|
-
type: "warning",
|
|
1336
|
-
onClick: () => {
|
|
1337
|
-
if (u.pop(), g.value = u.length > 0 ? !1 : void 0, u.length > 0) _(u.at(-1));
|
|
1338
|
-
else for (let e of f.value) e.disabled = !1;
|
|
1339
|
-
}
|
|
1340
|
-
}, { default: () => [D(W, null, { default: () => [D(v, null, null)] }), i("common.back")] })]) : D("span", null, [i("common.all")])]), l?.length ? D(xe, {
|
|
1341
|
-
showDivider: !1,
|
|
1342
|
-
style: "padding: 0 16px"
|
|
1343
|
-
}, X(a = l.map((r) => {
|
|
1344
|
-
let i, a;
|
|
1345
|
-
return D(Se, {
|
|
1346
|
-
key: r.type + "_" + r.value,
|
|
1347
|
-
style: "padding: 6px 0"
|
|
1348
|
-
}, { default: () => [r.type === "user" ? t.multiple ? D(H, {
|
|
1349
|
-
checked: o.has(r.value) || !1,
|
|
1350
|
-
onUpdateChecked: (i) => {
|
|
1351
|
-
if (i && t.max && e.length >= t.max) return;
|
|
1352
|
-
let a = [...e || []];
|
|
1353
|
-
if (i) a.push(r.value);
|
|
1354
|
-
else {
|
|
1355
|
-
let e = a.indexOf(r.value);
|
|
1356
|
-
a.splice(e, 1);
|
|
1357
|
-
}
|
|
1358
|
-
n(a);
|
|
1359
|
-
},
|
|
1360
|
-
style: "margin-left: 3px"
|
|
1361
|
-
}, X(i = Q([r], {
|
|
1362
|
-
max: 1,
|
|
1363
|
-
size: 24,
|
|
1364
|
-
placement: "right",
|
|
1365
|
-
tooltip: !1,
|
|
1366
|
-
username: !0,
|
|
1367
|
-
renderInfo: t.renderUserInfo
|
|
1368
|
-
})) ? i : { default: () => [i] }) : D(Te, {
|
|
1369
|
-
checked: o.has(r.value) || !1,
|
|
1370
|
-
onUpdateChecked: (e) => {
|
|
1371
|
-
n(e ? [r.value] : []);
|
|
1372
|
-
},
|
|
1373
|
-
style: "margin-left: 3px;"
|
|
1374
|
-
}, X(a = Q([r], {
|
|
1375
|
-
max: 1,
|
|
1376
|
-
size: 24,
|
|
1377
|
-
placement: "right",
|
|
1378
|
-
tooltip: !1,
|
|
1379
|
-
username: !0,
|
|
1380
|
-
renderInfo: t.renderUserInfo
|
|
1381
|
-
})) ? a : { default: () => [a] }) : D("div", {
|
|
1382
|
-
onClick: () => {
|
|
1383
|
-
g.value = !1, h.value.push(r), _(r);
|
|
1384
|
-
},
|
|
1385
|
-
style: "cursor: pointer; display: flex; align-items: center; gap: 8px"
|
|
1386
|
-
}, [
|
|
1387
|
-
r.type === "dept" ? D(B, {
|
|
1388
|
-
size: 24,
|
|
1389
|
-
style: "background-color: red"
|
|
1390
|
-
}, { default: () => [D(W, null, { default: () => [D(s, null, null)] })] }) : D(B, {
|
|
1391
|
-
size: 24,
|
|
1392
|
-
style: "background-color: green"
|
|
1393
|
-
}, { default: () => [D(W, null, { default: () => [D(c, null, null)] })] }),
|
|
1394
|
-
D("span", { style: "flex: 1 1 auto" }, [r.label]),
|
|
1395
|
-
D(W, null, { default: () => [D(d, null, null)] })
|
|
1396
|
-
])] });
|
|
1397
|
-
})) ? a : { default: () => [a] }) : D(he, null, null)]);
|
|
1398
|
-
}, x = () => D(he, { description: t.placeholder }, null), S = ({ option: e }) => e.type === "user" ? D("span", null, [e.nickname, D("span", { style: {
|
|
1399
|
-
opacity: .4,
|
|
1400
|
-
marginLeft: "8px"
|
|
1401
|
-
} }, [e.username])]) : D("span", null, [e.label]), C = (e, n, r, i, a) => D(Ne, N(e, {
|
|
1402
|
-
key: t.type,
|
|
1403
|
-
options: n,
|
|
1404
|
-
renderSourceList: ({ onCheck: e, pattern: t }) => b(r, e, t),
|
|
1405
|
-
renderTargetList: t.placeholder?.trim() && !t.modelValue?.length ? x : void 0,
|
|
1406
|
-
renderTargetLabel: S,
|
|
1407
|
-
sourceFilterable: t.filterable,
|
|
1408
|
-
size: t.size,
|
|
1409
|
-
disabled: t.disabled || void 0,
|
|
1410
|
-
value: r,
|
|
1411
|
-
filter: (e, t) => t.label.includes(e) || t.value.includes(e),
|
|
1412
|
-
"onUpdate:value": (e) => {
|
|
1413
|
-
i?.(e);
|
|
1414
|
-
},
|
|
1415
|
-
onUpdateValue: (e) => {
|
|
1416
|
-
a?.(e);
|
|
1417
|
-
}
|
|
1418
|
-
}), null), E = ({ option: e, handleClose: n }) => D(Ae, {
|
|
1419
|
-
type: t.type === "user" ? "primary" : "info",
|
|
1420
|
-
closable: !0,
|
|
1421
|
-
onMousedown: (e) => e.preventDefault(),
|
|
1422
|
-
onClose: (e) => {
|
|
1423
|
-
e.stopPropagation(), n();
|
|
1424
|
-
}
|
|
1425
|
-
}, { default: () => [e.label] }), O = (e, r = "updateModelValue") => {
|
|
1426
|
-
t.multiple ? n(r, e) : n(r, e?.[0]);
|
|
1427
|
-
}, k = F(), A = !1, ee = Le(), j = () => {
|
|
1428
|
-
if (A) return;
|
|
1429
|
-
A = !0;
|
|
1430
|
-
let e = L([...l.value || []]);
|
|
1431
|
-
ee.create({
|
|
1432
|
-
showIcon: !1,
|
|
1433
|
-
title: t.placeholder,
|
|
1434
|
-
style: { width: "700px" },
|
|
1435
|
-
content: () => D("div", { style: { height: "550px" } }, [C({ style: { height: "100%" } }, t.type === "user" ? f.value : p.value, e.value, (t) => e.value = t)]),
|
|
1436
|
-
positiveText: a.value.positiveText,
|
|
1437
|
-
negativeText: a.value.negativeText,
|
|
1438
|
-
onPositiveClick() {
|
|
1439
|
-
O(e.value, "update:modelValue"), O(e.value, "updateModelValue");
|
|
1440
|
-
},
|
|
1441
|
-
onAfterLeave() {
|
|
1442
|
-
te(() => {
|
|
1443
|
-
k.value?.blur(), A = !1;
|
|
1444
|
-
});
|
|
1445
|
-
}
|
|
1446
|
-
});
|
|
1447
|
-
}, M = { arrow: () => D(W, null, { default: () => [t.type === "user" ? D(c, null, null) : D(s, null, null)] }) };
|
|
1448
|
-
return () => {
|
|
1449
|
-
let e = t.type === "user" ? f.value : p.value;
|
|
1450
|
-
if (t.selectType === "dropdown" && t.type === "dept") return D(Fe, {
|
|
1451
|
-
options: e,
|
|
1452
|
-
keyField: "value",
|
|
1453
|
-
defaultExpandAll: t.defaultExpandAll,
|
|
1454
|
-
checkable: t.multiple,
|
|
1455
|
-
multiple: t.multiple,
|
|
1456
|
-
filter: (e, t) => t.label.includes(e) || t.value.includes(e),
|
|
1457
|
-
value: t.modelValue,
|
|
1458
|
-
onUpdateValue: (e) => {
|
|
1459
|
-
t.multiple && t.max && e?.length > t.max || n("updateModelValue", e);
|
|
1460
|
-
},
|
|
1461
|
-
"onUpdate:value": (e) => {
|
|
1462
|
-
t.multiple && t.max && e?.length > t.max || n("update:modelValue", e);
|
|
1463
|
-
}
|
|
1464
|
-
}, X(M) ? M : { default: () => [M] });
|
|
1465
|
-
if (t.selectType === "transfer") return C(r, e, l.value, (e) => O(e, "update:modelValue"), (e) => O(e, "updateModelValue"));
|
|
1466
|
-
let i = t.selectType === "dropdown";
|
|
1467
|
-
return D(Oe, N(r, {
|
|
1468
|
-
key: t.type,
|
|
1469
|
-
ref: k,
|
|
1470
|
-
show: i ? void 0 : !1,
|
|
1471
|
-
filterable: i ? t.filterable : !1,
|
|
1472
|
-
options: e,
|
|
1473
|
-
multiple: t.multiple,
|
|
1474
|
-
size: t.size,
|
|
1475
|
-
placeholder: t.placeholder,
|
|
1476
|
-
disabled: t.disabled || void 0,
|
|
1477
|
-
value: t.modelValue,
|
|
1478
|
-
renderTag: t.multiple ? E : void 0,
|
|
1479
|
-
onFocus: i ? void 0 : j,
|
|
1480
|
-
onUpdateValue: (e) => {
|
|
1481
|
-
n("updateModelValue", e);
|
|
1482
|
-
},
|
|
1483
|
-
"onUpdate:value": (e) => {
|
|
1484
|
-
n("update:modelValue", e);
|
|
1485
|
-
}
|
|
1486
|
-
}), X(M) ? M : { default: () => [M] });
|
|
1487
|
-
};
|
|
1488
|
-
}
|
|
1489
|
-
});
|
|
1490
|
-
function Z(e, t, { placement: n = "left", size: r = 24, tooltip: i = !0, username: a = !1, renderInfo: o }) {
|
|
1491
|
-
let s = e.nickname.split(" ").at(-1), c = s;
|
|
1492
|
-
if (/^[\u4E00-\u9FA5]+$/.test(s)) {
|
|
1493
|
-
let e = s.length;
|
|
1494
|
-
c = e === 3 || e === 4 ? s.slice(-2) : e > 4 ? s.slice(0, 1) : s;
|
|
1495
|
-
} else s.length > 4 && (c = D(W, null, { default: () => [D(x, null, null)] }));
|
|
1496
|
-
let l = (e) => D(B, {
|
|
1497
|
-
color: "var(--color-primary)",
|
|
1498
|
-
round: !0,
|
|
1499
|
-
size: e
|
|
1500
|
-
}, X(c) ? c : { default: () => [c] });
|
|
1501
|
-
return D(we, {
|
|
1502
|
-
key: e.username,
|
|
1503
|
-
raw: !0,
|
|
1504
|
-
placement: n,
|
|
1505
|
-
disabled: i === !1
|
|
1506
|
-
}, {
|
|
1507
|
-
default: () => D(de, {
|
|
1508
|
-
style: "min-width: 200px",
|
|
1509
|
-
size: "small"
|
|
1510
|
-
}, { default: () => [D("div", { style: "display: flex; align-items: center; gap: 12px" }, [l(48), D("div", null, [D("div", { style: "font-size: 16px; font-weight: 500;" }, [e.nickname]), D("div", { style: "font-size: 14px; color: #999" }, [e.username])])]), o?.(e)] }),
|
|
1511
|
-
trigger: () => {
|
|
1512
|
-
let n = l(r);
|
|
1513
|
-
return t ? D("div", { style: "max-width: 100%; overflow: hidden; display: inline-flex; align-items: center; gap: 6px" }, [n, D("div", { style: "overflow: hidden; white-space: nowrap; text-overflow: ellipsis" }, [D("span", null, [e.nickname]), a ? D("span", { style: "margin-left: 8px; opacity: 0.4" }, [e.username]) : void 0])]) : n;
|
|
1514
|
-
}
|
|
1515
|
-
});
|
|
1516
|
-
}
|
|
1517
|
-
function Q(e, t = {}) {
|
|
1518
|
-
let { max: n = 4, size: r = 24 } = t;
|
|
1519
|
-
return e.length <= 1 ? e[0] ? Z(e[0], !0, t) : null : D("span", { style: {
|
|
1520
|
-
display: "inline-block",
|
|
1521
|
-
height: r + "px"
|
|
1522
|
-
} }, [D(ue, {
|
|
1523
|
-
options: e,
|
|
1524
|
-
size: r,
|
|
1525
|
-
max: n || 4,
|
|
1526
|
-
style: "top: -2px"
|
|
1527
|
-
}, {
|
|
1528
|
-
avatar: ({ option: e }) => Z(e, !1, t),
|
|
1529
|
-
rest: ({ options: e, rest: t }) => D(pe, {
|
|
1530
|
-
options: e,
|
|
1531
|
-
keyField: "username",
|
|
1532
|
-
labelField: "nickname",
|
|
1533
|
-
renderOption: ({ option: t }) => Z(t, !1, e)
|
|
1534
|
-
}, { default: () => [D(B, null, { default: () => [E("+"), t] })] })
|
|
1535
|
-
})]);
|
|
1536
|
-
}
|
|
1537
|
-
var _t = /* @__PURE__ */ k({
|
|
1538
|
-
name: "DeptRender",
|
|
1539
|
-
props: {
|
|
1540
|
-
value: [String, Array],
|
|
1541
|
-
multiple: Boolean,
|
|
1542
|
-
getDeptsByCode: Function
|
|
1543
|
-
},
|
|
1544
|
-
setup(e) {
|
|
1545
|
-
let t = F([]), n = {};
|
|
1546
|
-
return z([() => e.modelValue, () => e.multiple], ([r, i]) => {
|
|
1547
|
-
t.value = [];
|
|
1548
|
-
let a = r ? i ? Array.isArray(r) ? r : r.trim() ? r.trim().split(",") : [] : [r] : [], o = [];
|
|
1549
|
-
for (let [e, r] of a.entries()) n[r] || (n[r] = P({
|
|
1550
|
-
code: r,
|
|
1551
|
-
name: r
|
|
1552
|
-
}), o.push(r)), t.value[e] = n[r];
|
|
1553
|
-
o.length > 0 && e.getDeptsByCode(o).then((e) => {
|
|
1554
|
-
for (let t of e) Object.assign(n[t.code], t);
|
|
1555
|
-
});
|
|
1556
|
-
}, { immediate: !0 }), () => t.value.map((e) => D(Ae, { key: e.code }, { default: () => [e.name] }));
|
|
1557
|
-
}
|
|
1558
|
-
}), vt = /* @__PURE__ */ k({
|
|
1559
|
-
name: "UserRender",
|
|
1560
|
-
props: {
|
|
1561
|
-
value: [String, Array],
|
|
1562
|
-
multiple: Boolean,
|
|
1563
|
-
max: Number,
|
|
1564
|
-
size: Number,
|
|
1565
|
-
placement: String,
|
|
1566
|
-
getUsersByUsername: Function,
|
|
1567
|
-
renderInfo: Function
|
|
1568
|
-
},
|
|
1569
|
-
setup(e) {
|
|
1570
|
-
let t = F([]), n = {};
|
|
1571
|
-
return z([() => e.value, () => e.multiple], ([r, i]) => {
|
|
1572
|
-
t.value = [];
|
|
1573
|
-
let a = r ? i ? Array.isArray(r) ? r : r.trim() ? r.trim().split(",") : [] : [r] : [], o = [];
|
|
1574
|
-
for (let [e, r] of a.entries()) n[r] || (n[r] = P({
|
|
1575
|
-
username: r,
|
|
1576
|
-
nickname: r
|
|
1577
|
-
}), o.push(r)), t.value[e] = n[r];
|
|
1578
|
-
o.length > 0 && e.getUsersByUsername(o).then((e) => {
|
|
1579
|
-
for (let t of e) Object.assign(n[t.username], t);
|
|
1580
|
-
});
|
|
1581
|
-
}, { immediate: !0 }), () => Q(t.value, e);
|
|
1582
|
-
}
|
|
1583
|
-
}), $ = {
|
|
1584
|
-
disabled: {
|
|
1585
|
-
type: Boolean,
|
|
1586
|
-
default: void 0
|
|
1587
|
-
},
|
|
1588
|
-
type: {
|
|
1589
|
-
type: String,
|
|
1590
|
-
default: void 0
|
|
1591
|
-
},
|
|
1592
|
-
succeeded: {
|
|
1593
|
-
type: [Boolean, Object],
|
|
1594
|
-
default: void 0
|
|
1595
|
-
},
|
|
1596
|
-
successText: {
|
|
1597
|
-
type: [
|
|
1598
|
-
String,
|
|
1599
|
-
Number,
|
|
1600
|
-
Object
|
|
1601
|
-
],
|
|
1602
|
-
default: void 0
|
|
1603
|
-
},
|
|
1604
|
-
failureText: {
|
|
1605
|
-
type: [
|
|
1606
|
-
String,
|
|
1607
|
-
Number,
|
|
1608
|
-
Object
|
|
1609
|
-
],
|
|
1610
|
-
default: void 0
|
|
1611
|
-
}
|
|
1612
|
-
}, yt = /* @__PURE__ */ k({
|
|
1613
|
-
name: "StateButton",
|
|
1614
|
-
props: $,
|
|
1615
|
-
setup(e, { slots: t }) {
|
|
1616
|
-
return () => {
|
|
1617
|
-
let { type: n, disabled: r, succeeded: i, successText: a, failureText: o } = e;
|
|
1618
|
-
return D(V, {
|
|
1619
|
-
type: i ? "success" : i === !1 ? "error" : n,
|
|
1620
|
-
disabled: typeof i == "boolean" ? !0 : r
|
|
1621
|
-
}, {
|
|
1622
|
-
default: () => (i ? I(t, "success", void 0, () => [a]) : i === !1 ? I(t, "failure", void 0, () => [o]) : I(t, "default")) ?? I(t, "default"),
|
|
1623
|
-
icon: () => i ? I(t, "successIcon", void 0, () => [D(W, null, { default: () => [D(g, null, null)] })]) : i === !1 ? I(t, "failureIcon", void 0, () => [D(W, null, { default: () => [D(y, null, null)] })]) : I(t, "icon")
|
|
1624
|
-
});
|
|
1625
|
-
};
|
|
1626
|
-
}
|
|
1627
|
-
}), bt = O(() => import("./DataTable-DXZ3G4ZO.js").then((e) => e.DataTable));
|
|
1628
|
-
//#endregion
|
|
1629
|
-
export { Xe as DataActions, Qe as DataCustom, rt as DataDescriptions, ct as DataFilter, st as DataForm, at as DataFormActions, dt as DataLocaleInput, Y as DataPagination, pt as DataSelection, bt as DataTable, _t as DtDeptRender, gt as DtUserDept, vt as DtUserRender, Ye as NCheckboxes, ht as NRadios, yt as NStateButton, $ as StateButtonProps, J as dataFormActionsProps, Q as renderUsers, ut as useLocaleEdit };
|