@kayak-sj/design 1.0.50 → 1.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{components-crJ55-Y9.css → componentRegistry-phw1HTVy.css} +1 -1
- package/dist/assets/index-Biv6Btn_.css +1 -0
- package/dist/chunks/{Complex-3sfdJKzA.js → Complex-CyaAEB_v.js} +1 -1
- package/dist/chunks/componentRegistry-6at2AsFD.js +2390 -0
- package/dist/components/k-editor/utils/editorValue.d.ts +50 -10
- package/dist/components/k-form/composables/useFormSchema.d.ts +16 -0
- package/dist/components/k-form/composables/useKFormFields.d.ts +7 -2
- package/dist/components/k-form/composables/useKFormModel.d.ts +20 -3
- package/dist/components/k-form/composables/useKFormTemplateRef.d.ts +4 -0
- package/dist/components/k-form/formComponent/componentRegistry.d.ts +10 -3
- package/dist/components/k-form/utils/fieldValue.d.ts +51 -4
- package/dist/components/k-form/utils/formRules.d.ts +6 -0
- package/dist/components/k-form/utils/resolveFormFieldComponent.d.ts +15 -2
- package/dist/components/k-handle-page/useHandlePageInit.d.ts +13 -1
- package/dist/components/k-icon/resolveLucideIcon.d.ts +23 -4
- package/dist/components/k-table/composables/useColumnDisplay.d.ts +4 -0
- package/dist/components/k-table/composables/useKTable.d.ts +27 -2
- package/dist/components/k-table/composables/useKTableCrossPageSelection.d.ts +26 -0
- package/dist/components/k-table/composables/useKTableTemplateRef.d.ts +10 -0
- package/dist/components/k-table/composables/useTableColumns.d.ts +14 -2
- package/dist/components/k-table/composables/useTableData.d.ts +28 -5
- package/dist/components/k-table/composables/useTablePagination.d.ts +3 -0
- package/dist/components/k-table/composables/useTableRadio.d.ts +9 -0
- package/dist/components/k-table/composables/useTableRowSort.d.ts +9 -0
- package/dist/components/k-table/composables/useTableTreeLoad.d.ts +12 -0
- package/dist/components/k-table/dictOptions.d.ts +6 -1
- package/dist/components/k-table/report/exportKTableReport.d.ts +30 -5
- package/dist/components/k-table/types.d.ts +4 -0
- package/dist/components/k-upload/utils/uploadFileValue.d.ts +40 -12
- package/dist/config/uploadConfig.d.ts +11 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +2641 -50
- package/dist/theme/index.d.ts +7 -3
- package/dist/utils/createStubComponent.d.ts +12 -1
- package/dist/utils/validators.d.ts +38 -6
- package/package.json +4 -9
- package/src/styles/components/_k-handle-page.scss +7 -4
- package/dist/chunks/components-CbP6XLFC.js +0 -4976
- package/dist/components/index.js +0 -3
|
@@ -1,4976 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
2
|
-
import { a as t, d as n, i as r, l as i, n as a, r as o, u as s } from "./editorValue-DSKvW8ty.js";
|
|
3
|
-
import { Fragment as c, Transition as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createSlots as h, createTextVNode as g, createVNode as _, defineAsyncComponent as v, defineComponent as y, guardReactiveProps as b, h as x, inject as S, isRef as ee, mergeDefaults as C, mergeModels as w, mergeProps as T, nextTick as E, normalizeClass as D, normalizeProps as te, normalizeStyle as O, onBeforeUnmount as k, onMounted as ne, openBlock as A, provide as j, reactive as re, ref as M, renderList as N, renderSlot as P, resolveComponent as ie, resolveDirective as ae, resolveDynamicComponent as oe, shallowRef as se, toDisplayString as F, toRef as I, toValue as L, unref as R, useAttrs as ce, useModel as le, useSlots as z, useTemplateRef as B, vShow as ue, watch as V, withCtx as H, withDirectives as de, withModifiers as fe } from "vue";
|
|
4
|
-
import { ElButton as pe, ElCard as me, ElCascader as he, ElCheckbox as U, ElCheckboxGroup as ge, ElCollapse as _e, ElCollapseItem as ve, ElDatePicker as ye, ElDialog as be, ElDivider as xe, ElForm as W, ElFormItem as Se, ElIcon as Ce, ElImageViewer as we, ElInput as Te, ElInputNumber as Ee, ElMessage as De, ElOption as Oe, ElPagination as ke, ElPopover as Ae, ElProgress as je, ElRadio as Me, ElRadioButton as Ne, ElRadioGroup as Pe, ElSelect as Fe, ElTable as Ie, ElTableColumn as G, ElTag as Le, ElTimePicker as Re, ElTooltip as ze, ElTreeSelect as Be, ElUpload as Ve } from "element-plus";
|
|
5
|
-
import K from "dayjs";
|
|
6
|
-
import { cloneDeep as q } from "lodash-es";
|
|
7
|
-
import { useDebounceFn as He, useEventListener as Ue, useLocalStorage as We } from "@vueuse/core";
|
|
8
|
-
import { Delete as Ge, Download as Ke, Loading as qe, Plus as Je, VideoPlay as Ye, ZoomIn as Xe } from "@element-plus/icons-vue";
|
|
9
|
-
import * as Ze from "lucide-vue-next";
|
|
10
|
-
import Qe from "sortablejs";
|
|
11
|
-
import '../assets/components-crJ55-Y9.css';//#region \0rolldown/runtime.js
|
|
12
|
-
var $e = Object.defineProperty, et = (e, t) => {
|
|
13
|
-
let n = {};
|
|
14
|
-
for (var r in e) $e(n, r, {
|
|
15
|
-
get: e[r],
|
|
16
|
-
enumerable: !0
|
|
17
|
-
});
|
|
18
|
-
return t || $e(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
19
|
-
};
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/utils/createStubComponent.ts
|
|
22
|
-
function tt(e) {
|
|
23
|
-
return y({
|
|
24
|
-
name: e,
|
|
25
|
-
inheritAttrs: !0,
|
|
26
|
-
setup(t, { attrs: n, slots: r }) {
|
|
27
|
-
return () => x("div", {
|
|
28
|
-
class: "k-design-stub",
|
|
29
|
-
"data-component": e,
|
|
30
|
-
...n
|
|
31
|
-
}, r.default?.() ?? `[${e}] 待迁移`);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function nt(e) {
|
|
36
|
-
return y({
|
|
37
|
-
name: `LucideStub_${e}`,
|
|
38
|
-
inheritAttrs: !0,
|
|
39
|
-
setup(t, { attrs: n }) {
|
|
40
|
-
return () => x("span", {
|
|
41
|
-
class: "k-icon k-icon--stub",
|
|
42
|
-
style: {
|
|
43
|
-
display: "inline-flex",
|
|
44
|
-
alignItems: "center",
|
|
45
|
-
justifyContent: "center",
|
|
46
|
-
width: `${n.size ?? 18}px`,
|
|
47
|
-
height: `${n.size ?? 18}px`,
|
|
48
|
-
fontSize: "10px",
|
|
49
|
-
color: "var(--el-text-color-placeholder, #a8abb2)",
|
|
50
|
-
border: "1px dashed currentColor",
|
|
51
|
-
borderRadius: "2px",
|
|
52
|
-
verticalAlign: "middle",
|
|
53
|
-
flexShrink: "0"
|
|
54
|
-
},
|
|
55
|
-
title: e,
|
|
56
|
-
"data-icon": e
|
|
57
|
-
}, e?.charAt(0).toUpperCase());
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/components/k-button/KButton.vue
|
|
63
|
-
var J = /* @__PURE__ */ y({
|
|
64
|
-
name: "KButton",
|
|
65
|
-
__name: "KButton",
|
|
66
|
-
setup(e) {
|
|
67
|
-
return (e, t) => (A(), d(R(pe), te(b(e.$attrs)), {
|
|
68
|
-
default: H(() => [P(e.$slots, "default")]),
|
|
69
|
-
_: 3
|
|
70
|
-
}, 16));
|
|
71
|
-
}
|
|
72
|
-
}), rt = { class: "k-dialog-header" }, it = {
|
|
73
|
-
key: 0,
|
|
74
|
-
class: "k-dialog-header__badge",
|
|
75
|
-
"aria-hidden": "true"
|
|
76
|
-
}, at = { class: "k-dialog-header__text" }, ot = {
|
|
77
|
-
key: 0,
|
|
78
|
-
class: "k-dialog-header__title"
|
|
79
|
-
}, st = {
|
|
80
|
-
key: 1,
|
|
81
|
-
class: "k-dialog-header__desc"
|
|
82
|
-
}, ct = {
|
|
83
|
-
key: 1,
|
|
84
|
-
class: "k-dialog-header__extra"
|
|
85
|
-
}, lt = /* @__PURE__ */ y({
|
|
86
|
-
name: "KDialogHeader",
|
|
87
|
-
__name: "KDialogHeader",
|
|
88
|
-
props: {
|
|
89
|
-
title: { default: "" },
|
|
90
|
-
description: { default: "" },
|
|
91
|
-
icon: {},
|
|
92
|
-
iconSize: { default: 22 }
|
|
93
|
-
},
|
|
94
|
-
setup(e) {
|
|
95
|
-
return (t, n) => (A(), p("div", rt, [
|
|
96
|
-
e.icon || t.$slots.icon ? (A(), p("div", it, [P(t.$slots, "icon", {}, () => [(A(), d(oe(e.icon), {
|
|
97
|
-
class: "k-dialog-header__icon",
|
|
98
|
-
size: e.iconSize,
|
|
99
|
-
"stroke-width": 2.2
|
|
100
|
-
}, null, 8, ["size"]))])])) : f("", !0),
|
|
101
|
-
m("div", at, [
|
|
102
|
-
e.title || t.$slots.title ? (A(), p("p", ot, [P(t.$slots, "title", {}, () => [g(F(e.title), 1)])])) : f("", !0),
|
|
103
|
-
e.description || t.$slots.description ? (A(), p("p", st, [P(t.$slots, "description", {}, () => [g(F(e.description), 1)])])) : f("", !0),
|
|
104
|
-
P(t.$slots, "default")
|
|
105
|
-
]),
|
|
106
|
-
t.$slots.extra ? (A(), p("div", ct, [P(t.$slots, "extra")])) : f("", !0)
|
|
107
|
-
]));
|
|
108
|
-
}
|
|
109
|
-
}), ut = { class: "k-dialog__body" }, dt = /* @__PURE__ */ y({
|
|
110
|
-
name: "KDialog",
|
|
111
|
-
inheritAttrs: !1,
|
|
112
|
-
__name: "KDialog",
|
|
113
|
-
props: /*@__PURE__*/ w({
|
|
114
|
-
title: { default: "" },
|
|
115
|
-
description: { default: "" },
|
|
116
|
-
icon: { default: void 0 },
|
|
117
|
-
variant: { default: "default" },
|
|
118
|
-
showConfirm: {
|
|
119
|
-
type: [Boolean, String],
|
|
120
|
-
default: !0
|
|
121
|
-
},
|
|
122
|
-
showCancel: {
|
|
123
|
-
type: [Boolean, String],
|
|
124
|
-
default: !0
|
|
125
|
-
},
|
|
126
|
-
confirmLoading: {
|
|
127
|
-
type: Boolean,
|
|
128
|
-
default: !1
|
|
129
|
-
},
|
|
130
|
-
appendToBody: {
|
|
131
|
-
type: Boolean,
|
|
132
|
-
default: !0
|
|
133
|
-
},
|
|
134
|
-
showClose: {
|
|
135
|
-
type: Boolean,
|
|
136
|
-
default: !0
|
|
137
|
-
},
|
|
138
|
-
destroyOnClose: {
|
|
139
|
-
type: Boolean,
|
|
140
|
-
default: !0
|
|
141
|
-
}
|
|
142
|
-
}, {
|
|
143
|
-
visible: {
|
|
144
|
-
type: Boolean,
|
|
145
|
-
default: !1
|
|
146
|
-
},
|
|
147
|
-
visibleModifiers: {}
|
|
148
|
-
}),
|
|
149
|
-
emits: /*@__PURE__*/ w([
|
|
150
|
-
"confirm",
|
|
151
|
-
"cancel",
|
|
152
|
-
"closed"
|
|
153
|
-
], ["update:visible"]),
|
|
154
|
-
setup(e, { emit: t }) {
|
|
155
|
-
let n = le(e, "visible"), r = e, i = t, a = ce(), o = z(), s = u(() => r.variant === "hero"), c = u(() => s.value ? void 0 : r.title), l = u(() => [
|
|
156
|
-
"k-dialog",
|
|
157
|
-
s.value ? "k-dialog--hero" : void 0,
|
|
158
|
-
a.class
|
|
159
|
-
]), p = u(() => {
|
|
160
|
-
let { class: e, ...t } = a;
|
|
161
|
-
return {
|
|
162
|
-
closeOnClickModal: !1,
|
|
163
|
-
appendToBody: r.appendToBody,
|
|
164
|
-
showClose: r.showClose,
|
|
165
|
-
destroyOnClose: r.destroyOnClose,
|
|
166
|
-
...t
|
|
167
|
-
};
|
|
168
|
-
}), v = u(() => r.showConfirm === !0 ? "确定" : String(r.showConfirm)), y = u(() => r.showCancel === !0 ? "取消" : String(r.showCancel)), b = u(() => s.value && (!!o.header || !!r.title || !!r.description || !!r.icon || !!o.icon));
|
|
169
|
-
function x() {
|
|
170
|
-
n.value = !1;
|
|
171
|
-
}
|
|
172
|
-
function S() {
|
|
173
|
-
x(), i("cancel");
|
|
174
|
-
}
|
|
175
|
-
function ee() {
|
|
176
|
-
i("confirm");
|
|
177
|
-
}
|
|
178
|
-
return (t, r) => (A(), d(R(be), T({
|
|
179
|
-
modelValue: n.value,
|
|
180
|
-
"onUpdate:modelValue": r[0] ||= (e) => n.value = e,
|
|
181
|
-
class: l.value,
|
|
182
|
-
title: c.value
|
|
183
|
-
}, p.value, { onClosed: r[1] ||= (e) => i("closed") }), h({
|
|
184
|
-
default: H(() => [m("div", ut, [P(t.$slots, "default")])]),
|
|
185
|
-
_: 2
|
|
186
|
-
}, [b.value ? {
|
|
187
|
-
name: "header",
|
|
188
|
-
fn: H(() => [P(t.$slots, "header", {}, () => [_(lt, {
|
|
189
|
-
title: e.title,
|
|
190
|
-
description: e.description,
|
|
191
|
-
icon: e.icon
|
|
192
|
-
}, h({ _: 2 }, [R(o).icon ? {
|
|
193
|
-
name: "icon",
|
|
194
|
-
fn: H(() => [P(t.$slots, "icon")]),
|
|
195
|
-
key: "0"
|
|
196
|
-
} : void 0]), 1032, [
|
|
197
|
-
"title",
|
|
198
|
-
"description",
|
|
199
|
-
"icon"
|
|
200
|
-
])])]),
|
|
201
|
-
key: "0"
|
|
202
|
-
} : void 0, R(o).footer ? {
|
|
203
|
-
name: "footer",
|
|
204
|
-
fn: H(() => [P(t.$slots, "footer")]),
|
|
205
|
-
key: "1"
|
|
206
|
-
} : !R(o).footer && (e.showConfirm !== !1 || e.showCancel !== !1) ? {
|
|
207
|
-
name: "footer",
|
|
208
|
-
fn: H(() => [e.showCancel === !1 ? f("", !0) : (A(), d(J, {
|
|
209
|
-
key: 0,
|
|
210
|
-
onClick: S
|
|
211
|
-
}, {
|
|
212
|
-
default: H(() => [g(F(y.value), 1)]),
|
|
213
|
-
_: 1
|
|
214
|
-
})), e.showConfirm === !1 ? f("", !0) : (A(), d(J, {
|
|
215
|
-
key: 1,
|
|
216
|
-
type: "primary",
|
|
217
|
-
loading: e.confirmLoading,
|
|
218
|
-
onClick: ee
|
|
219
|
-
}, {
|
|
220
|
-
default: H(() => [g(F(v.value), 1)]),
|
|
221
|
-
_: 1
|
|
222
|
-
}, 8, ["loading"]))]),
|
|
223
|
-
key: "2"
|
|
224
|
-
} : void 0]), 1040, [
|
|
225
|
-
"modelValue",
|
|
226
|
-
"class",
|
|
227
|
-
"title"
|
|
228
|
-
]));
|
|
229
|
-
}
|
|
230
|
-
}), ft = Symbol("kayak-dict"), pt = {
|
|
231
|
-
list: "rows",
|
|
232
|
-
page: "page_no",
|
|
233
|
-
limit: "page_size",
|
|
234
|
-
total: "total"
|
|
235
|
-
}, mt = {
|
|
236
|
-
total: 0,
|
|
237
|
-
currentPage: 1,
|
|
238
|
-
pageSize: 10,
|
|
239
|
-
pageSizes: [
|
|
240
|
-
10,
|
|
241
|
-
20,
|
|
242
|
-
30,
|
|
243
|
-
100
|
|
244
|
-
],
|
|
245
|
-
layout: "total, sizes, prev, pager, next, jumper"
|
|
246
|
-
}, ht = {
|
|
247
|
-
number: /^\d+$/,
|
|
248
|
-
phone: /^1\d{10}$/,
|
|
249
|
-
money: /^(0|[1-9]\d*)(\.\d{1,2})?$/,
|
|
250
|
-
percentage: /^(?!0(?:\.00?)?$)(?:100(?:\.00?)?|\d{0,2}(?:\.\d{1,2})?)$/
|
|
251
|
-
};
|
|
252
|
-
function gt(e, t) {
|
|
253
|
-
return {
|
|
254
|
-
validator: (n, r, i) => {
|
|
255
|
-
if (r === "" || r == null) {
|
|
256
|
-
i();
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
i(e.test(String(r)) ? void 0 : Error(t));
|
|
260
|
-
},
|
|
261
|
-
trigger: "blur"
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
function _t(e) {
|
|
265
|
-
return {
|
|
266
|
-
validator: (t, n, r) => {
|
|
267
|
-
let i = Array.isArray(n) ? n : [], a = String(i[0] ?? "").trim(), o = String(i[1] ?? "").trim();
|
|
268
|
-
if (!a || !o) {
|
|
269
|
-
r(Error(e));
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
r();
|
|
273
|
-
},
|
|
274
|
-
trigger: ["change", "blur"]
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
function vt(e) {
|
|
278
|
-
let t = [...e.rules ?? []];
|
|
279
|
-
if (typeof e.component != "string") return t;
|
|
280
|
-
let n = e.componentProps?.type;
|
|
281
|
-
if (e.component === "Input" && n === "number" && t.push(gt(ht.number, "请输入合法的正整数")), e.component === "Input" && n === "phone" && t.push(gt(ht.phone, "请输入正常的手机号")), e.component === "Input" && n === "money" && t.push(gt(ht.money, "请输入正确金额数值")), e.component === "Input" && n === "percentage" && t.push(gt(ht.percentage, "请输入正确的数据范围:0.01 ~ 100")), e.component === "InputMixInput") {
|
|
282
|
-
let e = t.find((e) => e.required);
|
|
283
|
-
e && t.push(_t(String(e.message || "请完整填写")));
|
|
284
|
-
}
|
|
285
|
-
return t;
|
|
286
|
-
}
|
|
287
|
-
//#endregion
|
|
288
|
-
//#region src/components/k-form/composables/useKFormFields.ts
|
|
289
|
-
function yt(e) {
|
|
290
|
-
let t = S(ft, null), n = u(() => e.formConfigs.value.filter((e) => e.display === void 0 || e.display)), r = u(() => e.layout.value.hideLabel ? n.value.map((e) => {
|
|
291
|
-
let t = q(e);
|
|
292
|
-
return t.componentProps ||= {}, typeof t.component == "string" && [
|
|
293
|
-
"Input",
|
|
294
|
-
"Select",
|
|
295
|
-
"TreeSelect",
|
|
296
|
-
"Cascader"
|
|
297
|
-
].includes(t.component) ? (t.componentProps.placeholder = t.componentProps.placeholder || t.label, t.label = "") : t.component === "DatePicker" && (t.label = ""), t;
|
|
298
|
-
}) : n.value);
|
|
299
|
-
function i(e) {
|
|
300
|
-
let { dict: n, componentProps: r = {} } = e, i = r.options ?? [];
|
|
301
|
-
return n && t?.getGroupOptions ? t.getGroupOptions(n) : i.map((e) => ({
|
|
302
|
-
label: String(e.label ?? ""),
|
|
303
|
-
value: e.value,
|
|
304
|
-
disabled: !!e.disabled
|
|
305
|
-
}));
|
|
306
|
-
}
|
|
307
|
-
function a(t) {
|
|
308
|
-
return t.display === !1 || t.readonly === !0 || e.formReadonly?.value ? [] : vt(t);
|
|
309
|
-
}
|
|
310
|
-
function o(e) {
|
|
311
|
-
return e.componentProps?.style;
|
|
312
|
-
}
|
|
313
|
-
function s(e) {
|
|
314
|
-
if (e.display === !1) return "none";
|
|
315
|
-
}
|
|
316
|
-
function c(t) {
|
|
317
|
-
return t.readonly === !0 || e.formReadonly?.value ? !0 : (t.componentProps ?? {}).readonly === !0;
|
|
318
|
-
}
|
|
319
|
-
function l(e) {
|
|
320
|
-
return e.disabled === !0 || (e.componentProps ?? {}).disabled === !0;
|
|
321
|
-
}
|
|
322
|
-
return {
|
|
323
|
-
normalizedConfigs: r,
|
|
324
|
-
getFieldOptions: i,
|
|
325
|
-
resolveItemRules: a,
|
|
326
|
-
itemStyle: o,
|
|
327
|
-
itemDisplay: s,
|
|
328
|
-
isItemReadonly: c,
|
|
329
|
-
isItemDisabled: l
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
//#endregion
|
|
333
|
-
//#region src/components/k-form/composables/useKFormModel.ts
|
|
334
|
-
function bt(e) {
|
|
335
|
-
let { componentProps: t = {}, component: n } = e, r = t.value, i = t.type ?? "";
|
|
336
|
-
if (r !== void 0) return q(r);
|
|
337
|
-
if (t.multiple === !0 || n === "Checkbox" || n === "SelectMultiple" || n === "InputMixInput") return [];
|
|
338
|
-
if (n === "InputMixSelect") return {};
|
|
339
|
-
if (n === "DatePicker" && [
|
|
340
|
-
"datetimerange",
|
|
341
|
-
"daterange",
|
|
342
|
-
"monthrange"
|
|
343
|
-
].includes(i)) return [];
|
|
344
|
-
if (n !== "DatePicker") return n === "Upload" || n === "TimePicker" && i === "timerange" ? [] : "";
|
|
345
|
-
}
|
|
346
|
-
function xt(e, t, n) {
|
|
347
|
-
return Y(t);
|
|
348
|
-
}
|
|
349
|
-
function St(e) {
|
|
350
|
-
return e.controlled?.value === !0;
|
|
351
|
-
}
|
|
352
|
-
function Y(e) {
|
|
353
|
-
if (typeof e != "object" || !e) return e;
|
|
354
|
-
if (e instanceof Date) return new Date(e.getTime());
|
|
355
|
-
if (Array.isArray(e)) return e.map(Y);
|
|
356
|
-
let t = e, n = {};
|
|
357
|
-
for (let e of Object.keys(t)) n[e] = Y(t[e]);
|
|
358
|
-
return n;
|
|
359
|
-
}
|
|
360
|
-
function Ct(e) {
|
|
361
|
-
let t = {};
|
|
362
|
-
return Object.keys(e).forEach((n) => {
|
|
363
|
-
t[n] = Y(e[n]);
|
|
364
|
-
}), t;
|
|
365
|
-
}
|
|
366
|
-
function wt(e, t) {
|
|
367
|
-
let n = t[e.id];
|
|
368
|
-
return n == null ? bt(e) : xt(e, n, t);
|
|
369
|
-
}
|
|
370
|
-
function Tt(e) {
|
|
371
|
-
let t = re({}), n = {}, r = null, i = u(() => {
|
|
372
|
-
let t = /* @__PURE__ */ new Map();
|
|
373
|
-
return e.formConfigs.value.forEach((e) => t.set(e.id, e)), t;
|
|
374
|
-
});
|
|
375
|
-
function a(e) {
|
|
376
|
-
return i.value.get(e) ?? {
|
|
377
|
-
id: e,
|
|
378
|
-
component: "Input"
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
let o = u(() => {
|
|
382
|
-
let t = "", n = "";
|
|
383
|
-
return e.formConfigs.value.forEach((e) => {
|
|
384
|
-
t += `${e.id}\0`, n += `${e.id}:${e.display === !1 ? 0 : 1}\0`;
|
|
385
|
-
}), {
|
|
386
|
-
fieldSignature: t,
|
|
387
|
-
displaySignature: n
|
|
388
|
-
};
|
|
389
|
-
});
|
|
390
|
-
function s() {
|
|
391
|
-
return e.modelValue?.value ?? e.data?.value ?? {};
|
|
392
|
-
}
|
|
393
|
-
function c() {
|
|
394
|
-
return {
|
|
395
|
-
...s(),
|
|
396
|
-
...Ct(t)
|
|
397
|
-
};
|
|
398
|
-
}
|
|
399
|
-
function l() {
|
|
400
|
-
let n = St(e) ? c() : Ct(t);
|
|
401
|
-
return r = n, e.onChange?.(n), n;
|
|
402
|
-
}
|
|
403
|
-
function d(r) {
|
|
404
|
-
let i = s(), a = St(e), o = {};
|
|
405
|
-
r.forEach((e) => {
|
|
406
|
-
if (e.display !== !1) {
|
|
407
|
-
o[e.id] = wt(e, i);
|
|
408
|
-
return;
|
|
409
|
-
}
|
|
410
|
-
if (a) {
|
|
411
|
-
let t = i[e.id];
|
|
412
|
-
t != null && (o[e.id] = Y(t));
|
|
413
|
-
}
|
|
414
|
-
}), Object.keys(t).forEach((e) => {
|
|
415
|
-
e in o || delete t[e];
|
|
416
|
-
}), Object.assign(t, o), n = q(t);
|
|
417
|
-
}
|
|
418
|
-
function f(e, n) {
|
|
419
|
-
let r = n?.preserveFieldIds, o = r?.length ? new Set(r) : null;
|
|
420
|
-
i.value.forEach((n, r) => {
|
|
421
|
-
if (o?.has(r) || !(r in e)) return;
|
|
422
|
-
let i = e[r];
|
|
423
|
-
if (i == null) {
|
|
424
|
-
t[r] = bt(a(r));
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
427
|
-
t[r] = xt(n, i, e);
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
function p(n) {
|
|
431
|
-
let i = s(), a = [];
|
|
432
|
-
if (n.forEach((e) => {
|
|
433
|
-
e.display !== !1 && t[e.id] === void 0 && (t[e.id] = wt(e, i), a.push(e.id));
|
|
434
|
-
}), a.length) {
|
|
435
|
-
if (St(e)) {
|
|
436
|
-
let n = {};
|
|
437
|
-
if (a.forEach((e) => {
|
|
438
|
-
e in i || (n[e] = Y(t[e]));
|
|
439
|
-
}), Object.keys(n).length) {
|
|
440
|
-
let t = {
|
|
441
|
-
...i,
|
|
442
|
-
...n
|
|
443
|
-
};
|
|
444
|
-
r = t, e.onChange?.(t);
|
|
445
|
-
}
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
l();
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
function m(e) {
|
|
452
|
-
let n = {}, r = s();
|
|
453
|
-
Object.keys(e).forEach((t) => {
|
|
454
|
-
if (!i.value.has(t)) return;
|
|
455
|
-
let o = a(t), s = e[t];
|
|
456
|
-
if (s == null) {
|
|
457
|
-
n[t] = bt(o);
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
|
-
n[t] = xt(o, s, {
|
|
461
|
-
...r,
|
|
462
|
-
...e
|
|
463
|
-
});
|
|
464
|
-
}), Object.assign(t, n), l();
|
|
465
|
-
}
|
|
466
|
-
function h(n, r) {
|
|
467
|
-
if (Object.is(t[n.id], r)) return;
|
|
468
|
-
t[n.id] = r;
|
|
469
|
-
let i = l();
|
|
470
|
-
(n.onChange ?? n.componentProps?.onChange)?.(r, n), St(e) && f({
|
|
471
|
-
...i,
|
|
472
|
-
[n.id]: t[n.id]
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
function g(e) {
|
|
476
|
-
return (e?.length ? e : Object.keys(t)).reduce((e, n) => (n in t && (e[n] = Y(t[n])), e), {});
|
|
477
|
-
}
|
|
478
|
-
function _() {
|
|
479
|
-
let n = {};
|
|
480
|
-
return e.formConfigs.value.forEach((e) => {
|
|
481
|
-
e.display !== !1 && t[e.id] !== void 0 && (n[e.id] = Y(t[e.id]));
|
|
482
|
-
}), n;
|
|
483
|
-
}
|
|
484
|
-
function v() {
|
|
485
|
-
Object.keys(t).forEach((e) => {
|
|
486
|
-
e in n || delete t[e];
|
|
487
|
-
}), Object.assign(t, q(n)), l();
|
|
488
|
-
}
|
|
489
|
-
function y() {
|
|
490
|
-
n = q(t);
|
|
491
|
-
}
|
|
492
|
-
function b(r) {
|
|
493
|
-
r.forEach((r) => {
|
|
494
|
-
let i = St(e) ? bt(a(r)) : n[r] ?? "";
|
|
495
|
-
t[r] = Y(i);
|
|
496
|
-
}), l();
|
|
497
|
-
}
|
|
498
|
-
return V(o, (t, n) => {
|
|
499
|
-
if (!n || t.fieldSignature !== n.fieldSignature) {
|
|
500
|
-
d(e.formConfigs.value);
|
|
501
|
-
return;
|
|
502
|
-
}
|
|
503
|
-
t.displaySignature !== n.displaySignature && p(e.formConfigs.value);
|
|
504
|
-
}, { immediate: !0 }), V(() => e.data?.value, (t) => {
|
|
505
|
-
St(e) || t && Object.keys(t).length && m(t);
|
|
506
|
-
}, { deep: !0 }), V(() => e.modelValue?.value, (t) => {
|
|
507
|
-
!St(e) || !t || t !== r && f(t);
|
|
508
|
-
}, {
|
|
509
|
-
deep: !0,
|
|
510
|
-
immediate: !0
|
|
511
|
-
}), {
|
|
512
|
-
formModel: t,
|
|
513
|
-
initFormModel: d,
|
|
514
|
-
setFieldsValue: m,
|
|
515
|
-
updateFieldValue: h,
|
|
516
|
-
getFieldsValue: g,
|
|
517
|
-
getVisibleFieldsValue: _,
|
|
518
|
-
resetFormModel: v,
|
|
519
|
-
resetFieldsValue: b,
|
|
520
|
-
rebuildFirsthandModel: y
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
//#endregion
|
|
524
|
-
//#region src/components/k-form/constants.ts
|
|
525
|
-
var Et = Symbol("k-form-date-picker-values"), Dt = [
|
|
526
|
-
"year",
|
|
527
|
-
"month",
|
|
528
|
-
"date",
|
|
529
|
-
"dates",
|
|
530
|
-
"datetime",
|
|
531
|
-
"week",
|
|
532
|
-
"datetimerange",
|
|
533
|
-
"daterange",
|
|
534
|
-
"monthrange",
|
|
535
|
-
"yearrange"
|
|
536
|
-
];
|
|
537
|
-
function Ot(e) {
|
|
538
|
-
return typeof e == "string" || typeof e == "number" ? e : String(e);
|
|
539
|
-
}
|
|
540
|
-
function X(e) {
|
|
541
|
-
if (e != null) return typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? e : String(e);
|
|
542
|
-
}
|
|
543
|
-
function kt(e) {
|
|
544
|
-
return e == null ? "" : String(e);
|
|
545
|
-
}
|
|
546
|
-
function At(e) {
|
|
547
|
-
return Array.isArray(e) ? e.filter((e) => typeof e == "string" || typeof e == "number") : [];
|
|
548
|
-
}
|
|
549
|
-
function jt(e) {
|
|
550
|
-
if (typeof e == "number" && !Number.isNaN(e)) return e;
|
|
551
|
-
if (e == null || e === "") return;
|
|
552
|
-
let t = Number(e);
|
|
553
|
-
return Number.isNaN(t) ? void 0 : t;
|
|
554
|
-
}
|
|
555
|
-
function Mt(e) {
|
|
556
|
-
if (e != null) return e instanceof Date || typeof e == "string" || Array.isArray(e) && e.length === 2 && (e.every((e) => e instanceof Date) || e.every((e) => typeof e == "string")) ? e : String(e);
|
|
557
|
-
}
|
|
558
|
-
function Nt(e) {
|
|
559
|
-
return e && Dt.includes(e) ? e : "date";
|
|
560
|
-
}
|
|
561
|
-
function Pt(e) {
|
|
562
|
-
if (e != null && e !== "") return e instanceof Date || typeof e == "string" || Array.isArray(e) && e.length === 2 && (e.every((e) => e instanceof Date) || e.every((e) => typeof e == "string")) ? e : String(e);
|
|
563
|
-
}
|
|
564
|
-
function Ft(e) {
|
|
565
|
-
return e === "timerange" ? "timerange" : "time";
|
|
566
|
-
}
|
|
567
|
-
function It(e) {
|
|
568
|
-
return e == null || typeof e == "string" || typeof e == "number" ? e : Array.isArray(e) ? e.filter((e) => typeof e == "string" || typeof e == "number") : typeof e == "object" ? e : String(e);
|
|
569
|
-
}
|
|
570
|
-
function Lt(e) {
|
|
571
|
-
return Array.isArray(e) ? e : [];
|
|
572
|
-
}
|
|
573
|
-
function Rt(e, t) {
|
|
574
|
-
let n = X(t);
|
|
575
|
-
if (n !== void 0) for (let t of e) {
|
|
576
|
-
let e = t.value ?? t.id;
|
|
577
|
-
if (e != null && String(e) === String(n)) {
|
|
578
|
-
let e = t.label;
|
|
579
|
-
return e == null ? void 0 : String(e);
|
|
580
|
-
}
|
|
581
|
-
let r = t.children;
|
|
582
|
-
if (Array.isArray(r)) {
|
|
583
|
-
let e = Rt(r, n);
|
|
584
|
-
if (e) return e;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
function zt(e, t, n, r = " / ") {
|
|
589
|
-
let i = It(t);
|
|
590
|
-
if (i == null || i === "") return Z(t);
|
|
591
|
-
let a = n?.value ?? "value", o = n?.label ?? "label", s = n?.children ?? "children", c = Array.isArray(i) ? i : [i], l = [], u = Array.isArray(e) ? e : [];
|
|
592
|
-
for (let e of c) {
|
|
593
|
-
let t = u.find((t) => t != null && String(t[a]) === String(e));
|
|
594
|
-
if (!t) return l.length ? [...l, ...c.slice(l.length).map(String)].join(r) : Z(Array.isArray(i) ? c.join(r) : i);
|
|
595
|
-
let n = t[o];
|
|
596
|
-
l.push(String(n != null && n !== "" ? n : e));
|
|
597
|
-
let d = t[s];
|
|
598
|
-
u = Array.isArray(d) ? d : [];
|
|
599
|
-
}
|
|
600
|
-
return l.length ? l.join(r) : Z(t);
|
|
601
|
-
}
|
|
602
|
-
function Z(e, t = "--") {
|
|
603
|
-
return e == null || e === "" ? t : String(e);
|
|
604
|
-
}
|
|
605
|
-
//#endregion
|
|
606
|
-
//#region src/components/k-form/formComponent/Cascader.vue?vue&type=script&setup=true&lang.ts
|
|
607
|
-
var Bt = {
|
|
608
|
-
key: 0,
|
|
609
|
-
class: "k-form-cascader__readonly"
|
|
610
|
-
}, Vt = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
611
|
-
name: "KFormCascader",
|
|
612
|
-
__name: "Cascader",
|
|
613
|
-
props: {
|
|
614
|
-
modelValue: {},
|
|
615
|
-
options: {},
|
|
616
|
-
readonly: { type: Boolean },
|
|
617
|
-
disabled: { type: Boolean },
|
|
618
|
-
props: {},
|
|
619
|
-
cascaderProps: {},
|
|
620
|
-
placeholder: {},
|
|
621
|
-
clearable: { type: Boolean },
|
|
622
|
-
separator: {}
|
|
623
|
-
},
|
|
624
|
-
emits: ["update:modelValue"],
|
|
625
|
-
setup(e, { emit: t }) {
|
|
626
|
-
let n = e, r = t, i = u(() => It(n.modelValue)), a = u(() => n.cascaderProps ?? n.props), o = u(() => zt(n.options, n.modelValue, a.value, n.separator ?? " / "));
|
|
627
|
-
return (t, n) => e.readonly ? (A(), p("span", Bt, F(o.value), 1)) : (A(), d(R(he), {
|
|
628
|
-
key: 1,
|
|
629
|
-
"model-value": i.value,
|
|
630
|
-
options: e.options ?? [],
|
|
631
|
-
props: a.value,
|
|
632
|
-
placeholder: e.placeholder,
|
|
633
|
-
clearable: e.clearable ?? !0,
|
|
634
|
-
disabled: e.disabled,
|
|
635
|
-
"onUpdate:modelValue": n[0] ||= (e) => r("update:modelValue", e)
|
|
636
|
-
}, null, 8, [
|
|
637
|
-
"model-value",
|
|
638
|
-
"options",
|
|
639
|
-
"props",
|
|
640
|
-
"placeholder",
|
|
641
|
-
"clearable",
|
|
642
|
-
"disabled"
|
|
643
|
-
]));
|
|
644
|
-
}
|
|
645
|
-
}), [["__scopeId", "data-v-ed0da536"]]), Ht = { class: "k-form-checkbox" }, Ut = {
|
|
646
|
-
key: 0,
|
|
647
|
-
class: "k-form-checkbox__readonly"
|
|
648
|
-
}, Wt = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
649
|
-
name: "KFormCheckbox",
|
|
650
|
-
__name: "CheckBox",
|
|
651
|
-
props: {
|
|
652
|
-
modelValue: {},
|
|
653
|
-
options: {},
|
|
654
|
-
readonly: { type: Boolean },
|
|
655
|
-
disabled: { type: Boolean },
|
|
656
|
-
showSelectAll: {
|
|
657
|
-
type: Boolean,
|
|
658
|
-
default: !1
|
|
659
|
-
}
|
|
660
|
-
},
|
|
661
|
-
emits: ["update:modelValue"],
|
|
662
|
-
setup(e, { emit: t }) {
|
|
663
|
-
function n(e) {
|
|
664
|
-
return e.tooltip ?? "";
|
|
665
|
-
}
|
|
666
|
-
function r(e) {
|
|
667
|
-
return n(e) === "";
|
|
668
|
-
}
|
|
669
|
-
let i = e, a = t, o = M([]), s = M(!1), l = M(!1), m = u(() => (i.options ?? []).map((e) => e.value)), h = u(() => {
|
|
670
|
-
let e = (i.options ?? []).filter((e) => o.value.includes(e.value)).map((e) => e.label);
|
|
671
|
-
return e.length ? e.join(", ") : "--";
|
|
672
|
-
});
|
|
673
|
-
V(() => i.modelValue, (e) => {
|
|
674
|
-
o.value = At(e), v(o.value);
|
|
675
|
-
}, { immediate: !0 });
|
|
676
|
-
function v(e) {
|
|
677
|
-
let t = m.value.length, n = e.length;
|
|
678
|
-
s.value = t > 0 && n === t, l.value = n > 0 && n < t;
|
|
679
|
-
}
|
|
680
|
-
function y(e) {
|
|
681
|
-
let t = e === !0 ? [...m.value] : [];
|
|
682
|
-
o.value = t, l.value = !1, a("update:modelValue", t);
|
|
683
|
-
}
|
|
684
|
-
function b(e) {
|
|
685
|
-
o.value = e, v(e), a("update:modelValue", e);
|
|
686
|
-
}
|
|
687
|
-
return (t, i) => (A(), p("div", Ht, [e.readonly ? (A(), p("span", Ut, F(h.value), 1)) : (A(), p(c, { key: 1 }, [e.showSelectAll ? (A(), d(R(U), {
|
|
688
|
-
key: 0,
|
|
689
|
-
modelValue: s.value,
|
|
690
|
-
"onUpdate:modelValue": i[0] ||= (e) => s.value = e,
|
|
691
|
-
indeterminate: l.value,
|
|
692
|
-
disabled: e.disabled,
|
|
693
|
-
onChange: y
|
|
694
|
-
}, {
|
|
695
|
-
default: H(() => [...i[1] ||= [g(" 全选 ", -1)]]),
|
|
696
|
-
_: 1
|
|
697
|
-
}, 8, [
|
|
698
|
-
"modelValue",
|
|
699
|
-
"indeterminate",
|
|
700
|
-
"disabled"
|
|
701
|
-
])) : f("", !0), _(R(ge), {
|
|
702
|
-
"model-value": o.value,
|
|
703
|
-
disabled: e.disabled,
|
|
704
|
-
"onUpdate:modelValue": b
|
|
705
|
-
}, {
|
|
706
|
-
default: H(() => [(A(!0), p(c, null, N(e.options, (e) => (A(), d(R(ze), {
|
|
707
|
-
key: String(e.value),
|
|
708
|
-
content: n(e),
|
|
709
|
-
disabled: r(e),
|
|
710
|
-
placement: "top-start"
|
|
711
|
-
}, {
|
|
712
|
-
default: H(() => [_(R(U), {
|
|
713
|
-
value: R(X)(e.value),
|
|
714
|
-
disabled: e.disabled
|
|
715
|
-
}, {
|
|
716
|
-
default: H(() => [g(F(e.label), 1)]),
|
|
717
|
-
_: 2
|
|
718
|
-
}, 1032, ["value", "disabled"])]),
|
|
719
|
-
_: 2
|
|
720
|
-
}, 1032, ["content", "disabled"]))), 128))]),
|
|
721
|
-
_: 1
|
|
722
|
-
}, 8, ["model-value", "disabled"])], 64))]));
|
|
723
|
-
}
|
|
724
|
-
}), [["__scopeId", "data-v-fca64c11"]]), Gt = ["innerHTML"], Kt = {
|
|
725
|
-
key: 2,
|
|
726
|
-
class: "k-form-date-picker__readonly"
|
|
727
|
-
}, qt = ["innerHTML"], Jt = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
728
|
-
name: "KFormDatePicker",
|
|
729
|
-
inheritAttrs: !1,
|
|
730
|
-
__name: "DatePicker",
|
|
731
|
-
props: {
|
|
732
|
-
modelValue: {},
|
|
733
|
-
options: {},
|
|
734
|
-
readonly: { type: Boolean },
|
|
735
|
-
disabled: { type: Boolean },
|
|
736
|
-
type: { default: "date" },
|
|
737
|
-
prepend: { default: "" },
|
|
738
|
-
append: { default: "" },
|
|
739
|
-
limitTime: {
|
|
740
|
-
type: Boolean,
|
|
741
|
-
default: !1
|
|
742
|
-
},
|
|
743
|
-
datePickerValues: { default: void 0 },
|
|
744
|
-
dateDisabled: {
|
|
745
|
-
type: [Array, Function],
|
|
746
|
-
default: void 0
|
|
747
|
-
},
|
|
748
|
-
minDate: {
|
|
749
|
-
type: [
|
|
750
|
-
String,
|
|
751
|
-
Date,
|
|
752
|
-
Function
|
|
753
|
-
],
|
|
754
|
-
default: void 0
|
|
755
|
-
},
|
|
756
|
-
maxDate: {
|
|
757
|
-
type: [
|
|
758
|
-
String,
|
|
759
|
-
Date,
|
|
760
|
-
Function
|
|
761
|
-
],
|
|
762
|
-
default: void 0
|
|
763
|
-
},
|
|
764
|
-
placeholder: { default: void 0 },
|
|
765
|
-
startPlaceholder: { default: void 0 },
|
|
766
|
-
endPlaceholder: { default: void 0 },
|
|
767
|
-
valueFormat: { default: void 0 },
|
|
768
|
-
defaultTime: { default: void 0 }
|
|
769
|
-
},
|
|
770
|
-
emits: ["update:modelValue"],
|
|
771
|
-
setup(e, { emit: t }) {
|
|
772
|
-
let n = e, r = t, i = S(Et, null), a = u(() => n.datePickerValues ?? i?.value ?? {}), o = u(() => Mt(n.modelValue)), s = u(() => Nt(n.type)), c = u(() => s.value === "datetimerange" ? "k-form-date-picker--datetimerange" : ""), l = (e, t) => K(e instanceof Date ? e : String(e)).format(t), m = u(() => {
|
|
773
|
-
if (!n.modelValue) return Z(n.modelValue);
|
|
774
|
-
let e = s.value.includes("datetime") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
775
|
-
if (Array.isArray(n.modelValue)) return n.modelValue.map((t) => l(t, e)).join(" - ");
|
|
776
|
-
let t = K(n.modelValue instanceof Date ? n.modelValue : String(n.modelValue));
|
|
777
|
-
return t.isValid() ? t.format(e) : Z(n.modelValue);
|
|
778
|
-
}), h = u(() => {
|
|
779
|
-
if (!n.limitTime) return;
|
|
780
|
-
let e = K().hour();
|
|
781
|
-
return () => Array.from({ length: 24 }, (e, t) => t).filter((t) => t < e);
|
|
782
|
-
});
|
|
783
|
-
function g(e) {
|
|
784
|
-
let t = new Date(e.getTime());
|
|
785
|
-
return t.setHours(0, 0, 0, 0), t;
|
|
786
|
-
}
|
|
787
|
-
function _(e) {
|
|
788
|
-
if (e == null) return null;
|
|
789
|
-
if (e === "today") return g(/* @__PURE__ */ new Date());
|
|
790
|
-
if (typeof e == "function") {
|
|
791
|
-
let t = e();
|
|
792
|
-
return t instanceof Date && !Number.isNaN(t.getTime()) ? g(t) : null;
|
|
793
|
-
}
|
|
794
|
-
return e instanceof Date && !Number.isNaN(e.getTime()) ? g(e) : null;
|
|
795
|
-
}
|
|
796
|
-
function v(e) {
|
|
797
|
-
if (e.date !== void 0) return _(e.date);
|
|
798
|
-
if (e.id) {
|
|
799
|
-
let t = a.value[`kitDate-${e.id}`];
|
|
800
|
-
if (!t) return null;
|
|
801
|
-
if (t instanceof Date) return g(t);
|
|
802
|
-
let n = K(t);
|
|
803
|
-
return n.isValid() ? g(n.toDate()) : null;
|
|
804
|
-
}
|
|
805
|
-
return null;
|
|
806
|
-
}
|
|
807
|
-
function y(e, t, n) {
|
|
808
|
-
return n === ">=" ? e >= t : n === ">" ? e > t : n === "<=" ? e <= t : n === "<" ? e < t : n === "==" && e === t;
|
|
809
|
-
}
|
|
810
|
-
function b(e) {
|
|
811
|
-
let t = g(e).getTime(), r = _(n.minDate);
|
|
812
|
-
if (r && t < r.getTime()) return !0;
|
|
813
|
-
let i = _(n.maxDate);
|
|
814
|
-
if (i && t > i.getTime()) return !0;
|
|
815
|
-
let a = n.dateDisabled;
|
|
816
|
-
return !a || (typeof a == "function" && (a = a()), !a.length) ? !1 : a.some((e) => {
|
|
817
|
-
let n = v(e);
|
|
818
|
-
return n ? y(t, n.getTime(), e.condition) : !1;
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
function x(e) {
|
|
822
|
-
r("update:modelValue", e);
|
|
823
|
-
}
|
|
824
|
-
return (t, n) => (A(), p("div", { class: D(["k-form-date-picker", c.value]) }, [
|
|
825
|
-
e.prepend ? (A(), p("span", {
|
|
826
|
-
key: 0,
|
|
827
|
-
class: "k-form-date-picker__text",
|
|
828
|
-
innerHTML: e.prepend
|
|
829
|
-
}, null, 8, Gt)) : f("", !0),
|
|
830
|
-
e.readonly ? (A(), p("span", Kt, F(m.value), 1)) : (A(), d(R(ye), {
|
|
831
|
-
key: 1,
|
|
832
|
-
"model-value": o.value,
|
|
833
|
-
type: s.value,
|
|
834
|
-
"unlink-panels": "",
|
|
835
|
-
placeholder: e.placeholder,
|
|
836
|
-
"start-placeholder": e.startPlaceholder,
|
|
837
|
-
"end-placeholder": e.endPlaceholder,
|
|
838
|
-
"value-format": e.valueFormat,
|
|
839
|
-
disabled: e.disabled,
|
|
840
|
-
"disabled-date": b,
|
|
841
|
-
"disabled-hours": h.value,
|
|
842
|
-
"default-time": e.defaultTime,
|
|
843
|
-
"onUpdate:modelValue": x
|
|
844
|
-
}, null, 8, [
|
|
845
|
-
"model-value",
|
|
846
|
-
"type",
|
|
847
|
-
"placeholder",
|
|
848
|
-
"start-placeholder",
|
|
849
|
-
"end-placeholder",
|
|
850
|
-
"value-format",
|
|
851
|
-
"disabled",
|
|
852
|
-
"disabled-hours",
|
|
853
|
-
"default-time"
|
|
854
|
-
])),
|
|
855
|
-
e.append ? (A(), p("span", {
|
|
856
|
-
key: 3,
|
|
857
|
-
class: "k-form-date-picker__text",
|
|
858
|
-
innerHTML: e.append
|
|
859
|
-
}, null, 8, qt)) : f("", !0)
|
|
860
|
-
], 2));
|
|
861
|
-
}
|
|
862
|
-
}), [["__scopeId", "data-v-4885818d"]]), Yt = /* @__PURE__ */ y({
|
|
863
|
-
name: "KFormFallback",
|
|
864
|
-
__name: "Fallback",
|
|
865
|
-
props: {
|
|
866
|
-
modelValue: {},
|
|
867
|
-
componentType: {}
|
|
868
|
-
},
|
|
869
|
-
setup(e) {
|
|
870
|
-
let t = e, n = u(() => `[${t.componentType ?? "Unknown"}] 待迁移`), r = u(() => kt(t.modelValue));
|
|
871
|
-
return (e, t) => (A(), d(R(Te), {
|
|
872
|
-
"model-value": r.value,
|
|
873
|
-
disabled: "",
|
|
874
|
-
placeholder: n.value
|
|
875
|
-
}, null, 8, ["model-value", "placeholder"]));
|
|
876
|
-
}
|
|
877
|
-
}), Xt = ["type"], Zt = {
|
|
878
|
-
key: 1,
|
|
879
|
-
class: "k-form-input__readonly"
|
|
880
|
-
}, Q = /* @__PURE__ */ y({
|
|
881
|
-
name: "KFormInput",
|
|
882
|
-
inheritAttrs: !1,
|
|
883
|
-
__name: "Input",
|
|
884
|
-
props: {
|
|
885
|
-
modelValue: {},
|
|
886
|
-
options: {},
|
|
887
|
-
readonly: { type: Boolean },
|
|
888
|
-
disabled: { type: Boolean },
|
|
889
|
-
placeholder: { default: "请输入" },
|
|
890
|
-
maxlength: { default: void 0 },
|
|
891
|
-
maxLength: { default: void 0 },
|
|
892
|
-
type: { default: "text" },
|
|
893
|
-
leftText: { default: "" },
|
|
894
|
-
rightText: { default: "" },
|
|
895
|
-
prepend: { default: "" },
|
|
896
|
-
append: { default: "" },
|
|
897
|
-
leftClass: { default: "" },
|
|
898
|
-
rightClass: { default: "" },
|
|
899
|
-
leftClick: {
|
|
900
|
-
type: Function,
|
|
901
|
-
default: () => void 0
|
|
902
|
-
},
|
|
903
|
-
rightClick: {
|
|
904
|
-
type: Function,
|
|
905
|
-
default: () => void 0
|
|
906
|
-
},
|
|
907
|
-
componentType: { default: void 0 },
|
|
908
|
-
clearable: {
|
|
909
|
-
type: Boolean,
|
|
910
|
-
default: !0
|
|
911
|
-
}
|
|
912
|
-
},
|
|
913
|
-
emits: ["update:modelValue"],
|
|
914
|
-
setup(e, { emit: t }) {
|
|
915
|
-
let n = e, r = t, i = u(() => kt(n.modelValue)), a = u(() => n.maxlength ?? n.maxLength), o = u(() => n.type === "textarea"), s = u(() => n.clearable && !o.value), c = u(() => {
|
|
916
|
-
let e = Z(i.value);
|
|
917
|
-
return e === "--" ? e : `${n.prepend || ""}${e}${n.append || ""}`;
|
|
918
|
-
});
|
|
919
|
-
function l(e) {
|
|
920
|
-
r("update:modelValue", e);
|
|
921
|
-
}
|
|
922
|
-
return (t, n) => (A(), p("div", {
|
|
923
|
-
class: "k-form-input",
|
|
924
|
-
type: o.value ? "textarea" : void 0
|
|
925
|
-
}, [
|
|
926
|
-
e.leftText ? (A(), p("div", {
|
|
927
|
-
key: 0,
|
|
928
|
-
class: D(["k-form-input__side k-form-input__side--left", e.leftClass]),
|
|
929
|
-
onClick: n[0] ||= (...t) => e.leftClick && e.leftClick(...t)
|
|
930
|
-
}, F(e.leftText), 3)) : f("", !0),
|
|
931
|
-
e.readonly ? (A(), p("div", Zt, F(c.value), 1)) : (A(), d(R(Te), T({ key: 2 }, t.$attrs, {
|
|
932
|
-
"model-value": i.value,
|
|
933
|
-
autocomplete: "off",
|
|
934
|
-
clearable: s.value,
|
|
935
|
-
disabled: e.disabled,
|
|
936
|
-
placeholder: e.placeholder,
|
|
937
|
-
maxlength: a.value,
|
|
938
|
-
type: e.type,
|
|
939
|
-
"onUpdate:modelValue": l
|
|
940
|
-
}), h({ _: 2 }, [e.prepend ? {
|
|
941
|
-
name: "prepend",
|
|
942
|
-
fn: H(() => [g(F(e.prepend), 1)]),
|
|
943
|
-
key: "0"
|
|
944
|
-
} : void 0, e.append ? {
|
|
945
|
-
name: "append",
|
|
946
|
-
fn: H(() => [g(F(e.append), 1)]),
|
|
947
|
-
key: "1"
|
|
948
|
-
} : void 0]), 1040, [
|
|
949
|
-
"model-value",
|
|
950
|
-
"clearable",
|
|
951
|
-
"disabled",
|
|
952
|
-
"placeholder",
|
|
953
|
-
"maxlength",
|
|
954
|
-
"type"
|
|
955
|
-
])),
|
|
956
|
-
e.rightText ? (A(), p("div", {
|
|
957
|
-
key: 3,
|
|
958
|
-
class: D(["k-form-input__side k-form-input__side--right", e.rightClass]),
|
|
959
|
-
onClick: n[1] ||= (...t) => e.rightClick && e.rightClick(...t)
|
|
960
|
-
}, F(e.rightText), 3)) : f("", !0)
|
|
961
|
-
], 8, Xt));
|
|
962
|
-
}
|
|
963
|
-
}), Qt = ["innerHTML"], $t = ["innerHTML"], en = ["innerHTML"], tn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
964
|
-
name: "KFormInputMixInput",
|
|
965
|
-
__name: "InputMixInput",
|
|
966
|
-
props: {
|
|
967
|
-
modelValue: {},
|
|
968
|
-
options: {},
|
|
969
|
-
readonly: { type: Boolean },
|
|
970
|
-
disabled: { type: Boolean },
|
|
971
|
-
leftText: { default: "" },
|
|
972
|
-
rightText: { default: "" },
|
|
973
|
-
centerText: { default: "" },
|
|
974
|
-
leftPlaceholder: { default: "" },
|
|
975
|
-
rightPlaceholder: { default: "" },
|
|
976
|
-
leftProps: { default: () => ({}) },
|
|
977
|
-
rightProps: { default: () => ({}) },
|
|
978
|
-
inputWidth: { default: 120 },
|
|
979
|
-
leftWidth: { default: void 0 },
|
|
980
|
-
rightWidth: { default: void 0 },
|
|
981
|
-
clearable: {
|
|
982
|
-
type: Boolean,
|
|
983
|
-
default: !0
|
|
984
|
-
}
|
|
985
|
-
},
|
|
986
|
-
emits: ["update:modelValue"],
|
|
987
|
-
setup(e, { emit: t }) {
|
|
988
|
-
let n = e, r = t, i = M(["", ""]);
|
|
989
|
-
function a(e, t) {
|
|
990
|
-
let n = e ?? t;
|
|
991
|
-
return typeof n == "number" ? `${n}px` : n;
|
|
992
|
-
}
|
|
993
|
-
function o(e) {
|
|
994
|
-
return !!(e?.prepend || e?.append);
|
|
995
|
-
}
|
|
996
|
-
function s(e, t) {
|
|
997
|
-
let r = a(e, n.inputWidth);
|
|
998
|
-
return o(t) ? {
|
|
999
|
-
"--k-mix-input-field-width": r,
|
|
1000
|
-
flex: "0 0 auto"
|
|
1001
|
-
} : {
|
|
1002
|
-
width: r,
|
|
1003
|
-
maxWidth: r,
|
|
1004
|
-
minWidth: r,
|
|
1005
|
-
flex: "0 0 auto"
|
|
1006
|
-
};
|
|
1007
|
-
}
|
|
1008
|
-
let c = u(() => o(n.leftProps)), l = u(() => o(n.rightProps)), d = u(() => s(n.leftWidth, n.leftProps)), h = u(() => s(n.rightWidth, n.rightProps));
|
|
1009
|
-
V(() => n.modelValue, (e) => {
|
|
1010
|
-
Array.isArray(e) && (i.value = [String(e[0] ?? ""), String(e[1] ?? "")]);
|
|
1011
|
-
}, { immediate: !0 });
|
|
1012
|
-
function g(e, t) {
|
|
1013
|
-
i.value[e] = t, r("update:modelValue", [...i.value]);
|
|
1014
|
-
}
|
|
1015
|
-
return (t, n) => (A(), p("div", { class: D(["k-form-input-mix-input", { "k-form-input-mix-input--readonly": e.readonly }]) }, [
|
|
1016
|
-
e.leftText ? (A(), p("div", {
|
|
1017
|
-
key: 0,
|
|
1018
|
-
class: "k-form-input-mix-input__text",
|
|
1019
|
-
innerHTML: e.leftText
|
|
1020
|
-
}, null, 8, Qt)) : f("", !0),
|
|
1021
|
-
m("div", {
|
|
1022
|
-
class: D(["k-form-input-mix-input__control", { "k-form-input-mix-input__control--affix": c.value }]),
|
|
1023
|
-
style: O(e.readonly ? void 0 : d.value)
|
|
1024
|
-
}, [_(Q, T({
|
|
1025
|
-
clearable: e.clearable,
|
|
1026
|
-
"model-value": i.value[0],
|
|
1027
|
-
readonly: e.readonly,
|
|
1028
|
-
disabled: e.disabled,
|
|
1029
|
-
placeholder: e.leftPlaceholder
|
|
1030
|
-
}, e.leftProps, { "onUpdate:modelValue": n[0] ||= (e) => g(0, e) }), null, 16, [
|
|
1031
|
-
"clearable",
|
|
1032
|
-
"model-value",
|
|
1033
|
-
"readonly",
|
|
1034
|
-
"disabled",
|
|
1035
|
-
"placeholder"
|
|
1036
|
-
])], 6),
|
|
1037
|
-
e.centerText ? (A(), p("div", {
|
|
1038
|
-
key: 1,
|
|
1039
|
-
class: "k-form-input-mix-input__text",
|
|
1040
|
-
innerHTML: e.centerText
|
|
1041
|
-
}, null, 8, $t)) : f("", !0),
|
|
1042
|
-
m("div", {
|
|
1043
|
-
class: D(["k-form-input-mix-input__control", { "k-form-input-mix-input__control--affix": l.value }]),
|
|
1044
|
-
style: O(e.readonly ? void 0 : h.value)
|
|
1045
|
-
}, [_(Q, T({
|
|
1046
|
-
"model-value": i.value[1],
|
|
1047
|
-
clearable: e.clearable,
|
|
1048
|
-
readonly: e.readonly,
|
|
1049
|
-
disabled: e.disabled,
|
|
1050
|
-
placeholder: e.rightPlaceholder
|
|
1051
|
-
}, e.rightProps, { "onUpdate:modelValue": n[1] ||= (e) => g(1, e) }), null, 16, [
|
|
1052
|
-
"model-value",
|
|
1053
|
-
"clearable",
|
|
1054
|
-
"readonly",
|
|
1055
|
-
"disabled",
|
|
1056
|
-
"placeholder"
|
|
1057
|
-
])], 6),
|
|
1058
|
-
e.rightText ? (A(), p("div", {
|
|
1059
|
-
key: 2,
|
|
1060
|
-
class: "k-form-input-mix-input__text",
|
|
1061
|
-
innerHTML: e.rightText
|
|
1062
|
-
}, null, 8, en)) : f("", !0)
|
|
1063
|
-
], 2));
|
|
1064
|
-
}
|
|
1065
|
-
}), [["__scopeId", "data-v-6fdf6265"]]), nn = {
|
|
1066
|
-
key: 0,
|
|
1067
|
-
class: "k-form-select__readonly"
|
|
1068
|
-
}, rn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1069
|
-
name: "KFormSelect",
|
|
1070
|
-
inheritAttrs: !1,
|
|
1071
|
-
__name: "Select",
|
|
1072
|
-
props: {
|
|
1073
|
-
modelValue: {},
|
|
1074
|
-
options: {},
|
|
1075
|
-
readonly: { type: Boolean },
|
|
1076
|
-
disabled: { type: Boolean },
|
|
1077
|
-
placeholder: { default: "请选择" },
|
|
1078
|
-
multiple: {
|
|
1079
|
-
type: Boolean,
|
|
1080
|
-
default: !1
|
|
1081
|
-
},
|
|
1082
|
-
filterable: {
|
|
1083
|
-
type: Boolean,
|
|
1084
|
-
default: !0
|
|
1085
|
-
},
|
|
1086
|
-
clearable: {
|
|
1087
|
-
type: Boolean,
|
|
1088
|
-
default: !0
|
|
1089
|
-
}
|
|
1090
|
-
},
|
|
1091
|
-
emits: ["update:modelValue"],
|
|
1092
|
-
setup(e, { emit: t }) {
|
|
1093
|
-
let n = e, r = t, i = u(() => X(n.modelValue)), a = u(() => At(n.modelValue)), o = u(() => (n.options ?? []).map((e) => ({
|
|
1094
|
-
label: e.label,
|
|
1095
|
-
value: Ot(e.value),
|
|
1096
|
-
disabled: e.disabled,
|
|
1097
|
-
key: String(e.value)
|
|
1098
|
-
}))), s = u(() => {
|
|
1099
|
-
let e = o.value;
|
|
1100
|
-
if (n.multiple) {
|
|
1101
|
-
let t = a.value, n = e.filter((e) => t.includes(e.value)).map((e) => e.label);
|
|
1102
|
-
return n.length ? n.join(",") : "--";
|
|
1103
|
-
}
|
|
1104
|
-
return e.find((e) => e.value === i.value)?.label ?? Z(i.value);
|
|
1105
|
-
});
|
|
1106
|
-
function l(e) {
|
|
1107
|
-
r("update:modelValue", e);
|
|
1108
|
-
}
|
|
1109
|
-
return (t, n) => (A(), p("div", T({ class: ["k-form-select", { "k-form-select--readonly": e.readonly }] }, t.$attrs), [e.readonly ? (A(), p("span", nn, F(s.value), 1)) : (A(), d(R(Fe), {
|
|
1110
|
-
key: 1,
|
|
1111
|
-
"model-value": e.multiple ? a.value : i.value,
|
|
1112
|
-
placeholder: e.placeholder,
|
|
1113
|
-
multiple: e.multiple,
|
|
1114
|
-
filterable: e.filterable,
|
|
1115
|
-
clearable: e.clearable,
|
|
1116
|
-
disabled: e.disabled,
|
|
1117
|
-
"onUpdate:modelValue": l
|
|
1118
|
-
}, {
|
|
1119
|
-
default: H(() => [(A(!0), p(c, null, N(o.value, (e) => (A(), d(R(Oe), {
|
|
1120
|
-
key: e.key,
|
|
1121
|
-
label: e.label,
|
|
1122
|
-
value: e.value,
|
|
1123
|
-
disabled: e.disabled
|
|
1124
|
-
}, null, 8, [
|
|
1125
|
-
"label",
|
|
1126
|
-
"value",
|
|
1127
|
-
"disabled"
|
|
1128
|
-
]))), 128))]),
|
|
1129
|
-
_: 1
|
|
1130
|
-
}, 8, [
|
|
1131
|
-
"model-value",
|
|
1132
|
-
"placeholder",
|
|
1133
|
-
"multiple",
|
|
1134
|
-
"filterable",
|
|
1135
|
-
"clearable",
|
|
1136
|
-
"disabled"
|
|
1137
|
-
]))], 16));
|
|
1138
|
-
}
|
|
1139
|
-
}), [["__scopeId", "data-v-20fc23b7"]]), an = {
|
|
1140
|
-
key: 0,
|
|
1141
|
-
class: "k-form-input-mix-select__text"
|
|
1142
|
-
}, on = {
|
|
1143
|
-
key: 1,
|
|
1144
|
-
class: "k-form-input-mix-select__text"
|
|
1145
|
-
}, sn = {
|
|
1146
|
-
key: 0,
|
|
1147
|
-
class: "k-form-input-mix-select__text"
|
|
1148
|
-
}, cn = {
|
|
1149
|
-
key: 3,
|
|
1150
|
-
class: "k-form-input-mix-select__text"
|
|
1151
|
-
}, ln = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1152
|
-
name: "KFormInputMixSelect",
|
|
1153
|
-
__name: "InputMixSelect",
|
|
1154
|
-
props: {
|
|
1155
|
-
modelValue: {},
|
|
1156
|
-
options: {},
|
|
1157
|
-
readonly: { type: Boolean },
|
|
1158
|
-
disabled: {
|
|
1159
|
-
type: Boolean,
|
|
1160
|
-
default: void 0
|
|
1161
|
-
},
|
|
1162
|
-
inputBefore: {
|
|
1163
|
-
type: Boolean,
|
|
1164
|
-
default: !0
|
|
1165
|
-
},
|
|
1166
|
-
leftText: { default: "" },
|
|
1167
|
-
rightText: { default: "" },
|
|
1168
|
-
centerText: { default: "" },
|
|
1169
|
-
selectWidth: { default: 150 },
|
|
1170
|
-
inputWidth: { default: 140 },
|
|
1171
|
-
itemGap: { default: 8 },
|
|
1172
|
-
inputProps: { default: () => ({}) },
|
|
1173
|
-
selectProps: { default: () => ({}) },
|
|
1174
|
-
inputPlaceholder: { default: "" },
|
|
1175
|
-
selectPlaceholder: { default: "请选择" },
|
|
1176
|
-
inputHide: {
|
|
1177
|
-
type: Boolean,
|
|
1178
|
-
default: !1
|
|
1179
|
-
},
|
|
1180
|
-
integrityCheck: {
|
|
1181
|
-
type: Boolean,
|
|
1182
|
-
default: !1
|
|
1183
|
-
}
|
|
1184
|
-
},
|
|
1185
|
-
emits: ["update:modelValue"],
|
|
1186
|
-
setup(e, { emit: t }) {
|
|
1187
|
-
let n = S(ft, null), r = e, i = t, a = M({}), o = M(""), s = M(""), l = u(() => r.inputProps.id ?? "input"), d = u(() => r.selectProps.id ?? "select"), h = u(() => {
|
|
1188
|
-
let e = q(r.inputProps);
|
|
1189
|
-
return delete e.id, e;
|
|
1190
|
-
}), g = u(() => {
|
|
1191
|
-
let e = q(r.selectProps);
|
|
1192
|
-
return delete e.id, e;
|
|
1193
|
-
});
|
|
1194
|
-
function v(e, t) {
|
|
1195
|
-
return e == null || e === "" ? t : typeof e == "number" ? `${e}px` : e;
|
|
1196
|
-
}
|
|
1197
|
-
function y(e) {
|
|
1198
|
-
return !!(e?.prepend || e?.append);
|
|
1199
|
-
}
|
|
1200
|
-
let b = u(() => ({ gap: v(r.itemGap, "8px") }));
|
|
1201
|
-
function x(e, t, n) {
|
|
1202
|
-
if (r.readonly) return;
|
|
1203
|
-
let i = v(e, t);
|
|
1204
|
-
return y(n) ? {
|
|
1205
|
-
"--k-mix-select-field-width": i,
|
|
1206
|
-
flex: "0 0 auto"
|
|
1207
|
-
} : {
|
|
1208
|
-
width: i,
|
|
1209
|
-
maxWidth: i,
|
|
1210
|
-
minWidth: i,
|
|
1211
|
-
flex: "0 0 auto"
|
|
1212
|
-
};
|
|
1213
|
-
}
|
|
1214
|
-
let ee = u(() => y(r.inputProps)), C = u(() => y(r.selectProps)), w = u(() => x(r.selectWidth, "150px", r.selectProps)), E = u(() => x(r.inputWidth, "140px", r.inputProps));
|
|
1215
|
-
function te(e) {
|
|
1216
|
-
let { dict: t, options: r = [] } = e;
|
|
1217
|
-
return t && n?.getGroupOptions ? n.getGroupOptions(t) : r.map((e) => ({
|
|
1218
|
-
label: String(e.label ?? ""),
|
|
1219
|
-
value: e.value,
|
|
1220
|
-
disabled: e.disabled
|
|
1221
|
-
}));
|
|
1222
|
-
}
|
|
1223
|
-
let k = u(() => te(r.selectProps));
|
|
1224
|
-
function ne() {
|
|
1225
|
-
let e = a.value[l.value], t = a.value[d.value];
|
|
1226
|
-
if (r.integrityCheck) {
|
|
1227
|
-
e && t || r.inputHide ? i("update:modelValue", { ...a.value }) : i("update:modelValue", "");
|
|
1228
|
-
return;
|
|
1229
|
-
}
|
|
1230
|
-
i("update:modelValue", { ...a.value });
|
|
1231
|
-
}
|
|
1232
|
-
function j(e, t) {
|
|
1233
|
-
a.value[t] = e, o.value = String(a.value[l.value] ?? ""), s.value = a.value[d.value], ne();
|
|
1234
|
-
}
|
|
1235
|
-
return V(() => r.modelValue, (e) => {
|
|
1236
|
-
e && typeof e == "object" && !Array.isArray(e) && (a.value = q(e), o.value = String(a.value[l.value] ?? ""), s.value = a.value[d.value]);
|
|
1237
|
-
}, {
|
|
1238
|
-
immediate: !0,
|
|
1239
|
-
deep: !0
|
|
1240
|
-
}), (t, n) => (A(), p("div", { class: D(["k-form-input-mix-select", { "k-form-input-mix-select--readonly": e.readonly }]) }, [m("div", {
|
|
1241
|
-
class: "k-form-input-mix-select__row",
|
|
1242
|
-
style: O(b.value)
|
|
1243
|
-
}, [
|
|
1244
|
-
e.leftText ? (A(), p("div", an, F(e.leftText), 1)) : f("", !0),
|
|
1245
|
-
e.inputBefore ? (A(), p(c, { key: 1 }, [
|
|
1246
|
-
e.inputHide ? f("", !0) : (A(), p("div", {
|
|
1247
|
-
key: 0,
|
|
1248
|
-
class: D(["k-form-input-mix-select__control", { "k-form-input-mix-select__control--affix": ee.value }]),
|
|
1249
|
-
style: O(E.value)
|
|
1250
|
-
}, [_(Q, T({
|
|
1251
|
-
"model-value": o.value,
|
|
1252
|
-
readonly: e.readonly,
|
|
1253
|
-
disabled: e.disabled,
|
|
1254
|
-
placeholder: e.inputPlaceholder
|
|
1255
|
-
}, h.value, { "onUpdate:modelValue": n[0] ||= (e) => j(e, l.value) }), null, 16, [
|
|
1256
|
-
"model-value",
|
|
1257
|
-
"readonly",
|
|
1258
|
-
"disabled",
|
|
1259
|
-
"placeholder"
|
|
1260
|
-
])], 6)),
|
|
1261
|
-
e.centerText ? (A(), p("div", on, F(e.centerText), 1)) : f("", !0),
|
|
1262
|
-
m("div", {
|
|
1263
|
-
class: D(["k-form-input-mix-select__control", { "k-form-input-mix-select__control--affix": C.value }]),
|
|
1264
|
-
style: O(w.value)
|
|
1265
|
-
}, [_(rn, T({
|
|
1266
|
-
"model-value": s.value,
|
|
1267
|
-
readonly: e.readonly,
|
|
1268
|
-
disabled: e.disabled,
|
|
1269
|
-
options: k.value,
|
|
1270
|
-
placeholder: e.selectPlaceholder
|
|
1271
|
-
}, g.value, { "onUpdate:modelValue": n[1] ||= (e) => j(e, d.value) }), null, 16, [
|
|
1272
|
-
"model-value",
|
|
1273
|
-
"readonly",
|
|
1274
|
-
"disabled",
|
|
1275
|
-
"options",
|
|
1276
|
-
"placeholder"
|
|
1277
|
-
])], 6)
|
|
1278
|
-
], 64)) : (A(), p(c, { key: 2 }, [
|
|
1279
|
-
m("div", {
|
|
1280
|
-
class: D(["k-form-input-mix-select__control", { "k-form-input-mix-select__control--affix": C.value }]),
|
|
1281
|
-
style: O(w.value)
|
|
1282
|
-
}, [_(rn, T({
|
|
1283
|
-
"model-value": s.value,
|
|
1284
|
-
readonly: e.readonly,
|
|
1285
|
-
disabled: e.disabled,
|
|
1286
|
-
options: k.value,
|
|
1287
|
-
placeholder: e.selectPlaceholder
|
|
1288
|
-
}, g.value, { "onUpdate:modelValue": n[2] ||= (e) => j(e, d.value) }), null, 16, [
|
|
1289
|
-
"model-value",
|
|
1290
|
-
"readonly",
|
|
1291
|
-
"disabled",
|
|
1292
|
-
"options",
|
|
1293
|
-
"placeholder"
|
|
1294
|
-
])], 6),
|
|
1295
|
-
e.centerText ? (A(), p("div", sn, F(e.centerText), 1)) : f("", !0),
|
|
1296
|
-
e.inputHide ? f("", !0) : (A(), p("div", {
|
|
1297
|
-
key: 1,
|
|
1298
|
-
class: D(["k-form-input-mix-select__control", { "k-form-input-mix-select__control--affix": ee.value }]),
|
|
1299
|
-
style: O(E.value)
|
|
1300
|
-
}, [_(Q, T({
|
|
1301
|
-
"model-value": o.value,
|
|
1302
|
-
readonly: e.readonly,
|
|
1303
|
-
disabled: e.disabled,
|
|
1304
|
-
placeholder: e.inputPlaceholder
|
|
1305
|
-
}, h.value, { "onUpdate:modelValue": n[3] ||= (e) => j(e, l.value) }), null, 16, [
|
|
1306
|
-
"model-value",
|
|
1307
|
-
"readonly",
|
|
1308
|
-
"disabled",
|
|
1309
|
-
"placeholder"
|
|
1310
|
-
])], 6))
|
|
1311
|
-
], 64)),
|
|
1312
|
-
e.rightText && !e.inputHide ? (A(), p("div", cn, F(e.rightText), 1)) : f("", !0)
|
|
1313
|
-
], 4)], 2));
|
|
1314
|
-
}
|
|
1315
|
-
}), [["__scopeId", "data-v-1f46ef39"]]), un = { class: "k-form-input-number" }, dn = {
|
|
1316
|
-
key: 0,
|
|
1317
|
-
class: "k-form-input-number__side k-form-input-number__side--left"
|
|
1318
|
-
}, fn = {
|
|
1319
|
-
key: 1,
|
|
1320
|
-
class: "k-form-input-number__readonly"
|
|
1321
|
-
}, pn = {
|
|
1322
|
-
key: 3,
|
|
1323
|
-
class: "k-form-input-number__side k-form-input-number__side--right"
|
|
1324
|
-
}, mn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1325
|
-
name: "KFormInputNumber",
|
|
1326
|
-
__name: "InputNumber",
|
|
1327
|
-
props: {
|
|
1328
|
-
modelValue: {},
|
|
1329
|
-
options: {},
|
|
1330
|
-
readonly: { type: Boolean },
|
|
1331
|
-
disabled: { type: Boolean },
|
|
1332
|
-
leftText: { default: "" },
|
|
1333
|
-
rightText: { default: "" },
|
|
1334
|
-
min: { default: void 0 },
|
|
1335
|
-
max: { default: void 0 },
|
|
1336
|
-
maxlength: { default: 1e3 }
|
|
1337
|
-
},
|
|
1338
|
-
emits: ["update:modelValue"],
|
|
1339
|
-
setup(e, { emit: t }) {
|
|
1340
|
-
let n = e, r = t, i = u(() => jt(n.modelValue));
|
|
1341
|
-
function a(e) {
|
|
1342
|
-
if (e === void 0) {
|
|
1343
|
-
r("update:modelValue", n.min ?? 0);
|
|
1344
|
-
return;
|
|
1345
|
-
}
|
|
1346
|
-
let t = String(e);
|
|
1347
|
-
if (t.length > n.maxlength) {
|
|
1348
|
-
r("update:modelValue", Number(t.slice(0, n.maxlength)));
|
|
1349
|
-
return;
|
|
1350
|
-
}
|
|
1351
|
-
r("update:modelValue", e);
|
|
1352
|
-
}
|
|
1353
|
-
return (t, n) => (A(), p("div", un, [
|
|
1354
|
-
e.leftText ? (A(), p("div", dn, F(e.leftText), 1)) : f("", !0),
|
|
1355
|
-
e.readonly ? (A(), p("span", fn, F(R(Z)(i.value)), 1)) : (A(), d(R(Ee), {
|
|
1356
|
-
key: 2,
|
|
1357
|
-
"model-value": i.value,
|
|
1358
|
-
min: e.min,
|
|
1359
|
-
max: e.max,
|
|
1360
|
-
disabled: e.disabled,
|
|
1361
|
-
"onUpdate:modelValue": a
|
|
1362
|
-
}, null, 8, [
|
|
1363
|
-
"model-value",
|
|
1364
|
-
"min",
|
|
1365
|
-
"max",
|
|
1366
|
-
"disabled"
|
|
1367
|
-
])),
|
|
1368
|
-
e.rightText ? (A(), p("div", pn, F(e.rightText), 1)) : f("", !0)
|
|
1369
|
-
]));
|
|
1370
|
-
}
|
|
1371
|
-
}), [["__scopeId", "data-v-acdc4199"]]), hn = { class: "k-form-radio" }, gn = {
|
|
1372
|
-
key: 0,
|
|
1373
|
-
class: "k-form-radio__readonly"
|
|
1374
|
-
}, _n = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1375
|
-
name: "KFormRadio",
|
|
1376
|
-
__name: "Radio",
|
|
1377
|
-
props: {
|
|
1378
|
-
modelValue: {},
|
|
1379
|
-
options: {},
|
|
1380
|
-
readonly: { type: Boolean },
|
|
1381
|
-
disabled: { type: Boolean },
|
|
1382
|
-
type: { default: "default" }
|
|
1383
|
-
},
|
|
1384
|
-
emits: ["update:modelValue"],
|
|
1385
|
-
setup(e, { emit: t }) {
|
|
1386
|
-
let n = e, r = t, i = u(() => X(n.modelValue)), a = u(() => (n.options ?? []).find((e) => e.value === i.value)?.label ?? Z(i.value));
|
|
1387
|
-
function o(e) {
|
|
1388
|
-
r("update:modelValue", e);
|
|
1389
|
-
}
|
|
1390
|
-
return (t, n) => (A(), p("div", hn, [e.readonly ? (A(), p("span", gn, F(a.value), 1)) : (A(), d(R(Pe), {
|
|
1391
|
-
key: 1,
|
|
1392
|
-
"model-value": i.value,
|
|
1393
|
-
disabled: e.disabled,
|
|
1394
|
-
"onUpdate:modelValue": o
|
|
1395
|
-
}, {
|
|
1396
|
-
default: H(() => [(A(!0), p(c, null, N(e.options, (t) => (A(), p(c, { key: String(t.value) }, [e.type === "button" ? (A(), d(R(Ne), {
|
|
1397
|
-
key: 0,
|
|
1398
|
-
value: R(X)(t.value),
|
|
1399
|
-
disabled: t.disabled
|
|
1400
|
-
}, {
|
|
1401
|
-
default: H(() => [g(F(t.label), 1)]),
|
|
1402
|
-
_: 2
|
|
1403
|
-
}, 1032, ["value", "disabled"])) : (A(), d(R(Me), {
|
|
1404
|
-
key: 1,
|
|
1405
|
-
value: R(X)(t.value),
|
|
1406
|
-
disabled: t.disabled
|
|
1407
|
-
}, {
|
|
1408
|
-
default: H(() => [g(F(t.label), 1)]),
|
|
1409
|
-
_: 2
|
|
1410
|
-
}, 1032, ["value", "disabled"]))], 64))), 128))]),
|
|
1411
|
-
_: 1
|
|
1412
|
-
}, 8, ["model-value", "disabled"]))]));
|
|
1413
|
-
}
|
|
1414
|
-
}), [["__scopeId", "data-v-e0ff32b0"]]), vn = {
|
|
1415
|
-
key: 0,
|
|
1416
|
-
class: "k-form-radio-input__label"
|
|
1417
|
-
}, yn = {
|
|
1418
|
-
key: 3,
|
|
1419
|
-
class: "k-form-radio-input__label"
|
|
1420
|
-
}, bn = {
|
|
1421
|
-
key: 1,
|
|
1422
|
-
class: "k-form-radio-input__readonly"
|
|
1423
|
-
}, xn = { key: 0 }, Sn = { key: 1 }, Cn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1424
|
-
name: "KFormRadioInput",
|
|
1425
|
-
__name: "RadioInput",
|
|
1426
|
-
props: {
|
|
1427
|
-
modelValue: {},
|
|
1428
|
-
options: {},
|
|
1429
|
-
readonly: { type: Boolean },
|
|
1430
|
-
disabled: { type: Boolean },
|
|
1431
|
-
showInput: { default: "1" },
|
|
1432
|
-
type: { default: "" },
|
|
1433
|
-
inputPlaceholder: { default: "" },
|
|
1434
|
-
leftText: { default: "" },
|
|
1435
|
-
rightText: { default: "" },
|
|
1436
|
-
inputProps: { default: () => ({}) }
|
|
1437
|
-
},
|
|
1438
|
-
emits: ["update:modelValue"],
|
|
1439
|
-
setup(e, { emit: t }) {
|
|
1440
|
-
let n = e, r = t, i = M(n.options?.[0]?.value ?? ""), a = M(""), o = u(() => i.value === n.showInput);
|
|
1441
|
-
function s() {
|
|
1442
|
-
let e = Number(n.inputProps?.min ?? 1);
|
|
1443
|
-
return Number.isFinite(e) ? e : 1;
|
|
1444
|
-
}
|
|
1445
|
-
function l(e) {
|
|
1446
|
-
return e === "" || e == null;
|
|
1447
|
-
}
|
|
1448
|
-
function m(e) {
|
|
1449
|
-
if (n.type !== "inputNumber" || l(e)) return e;
|
|
1450
|
-
if (typeof e == "number") return Number.isFinite(e) ? e : "";
|
|
1451
|
-
let t = Number(e);
|
|
1452
|
-
return Number.isFinite(t) ? t : e;
|
|
1453
|
-
}
|
|
1454
|
-
let h = u(() => {
|
|
1455
|
-
if (l(a.value)) return null;
|
|
1456
|
-
let e = Number(a.value);
|
|
1457
|
-
return Number.isFinite(e) ? e : null;
|
|
1458
|
-
});
|
|
1459
|
-
V(() => n.modelValue, (e) => {
|
|
1460
|
-
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
1461
|
-
let t = e;
|
|
1462
|
-
t.radio !== void 0 && (i.value = t.radio), t.input !== void 0 && (a.value = m(t.input));
|
|
1463
|
-
}
|
|
1464
|
-
}, {
|
|
1465
|
-
immediate: !0,
|
|
1466
|
-
deep: !0
|
|
1467
|
-
});
|
|
1468
|
-
function v() {
|
|
1469
|
-
if (i.value === n.showInput) {
|
|
1470
|
-
if (n.type === "inputNumber" && l(a.value)) {
|
|
1471
|
-
a.value = s();
|
|
1472
|
-
return;
|
|
1473
|
-
}
|
|
1474
|
-
r("update:modelValue", {
|
|
1475
|
-
radio: i.value,
|
|
1476
|
-
input: a.value
|
|
1477
|
-
});
|
|
1478
|
-
return;
|
|
1479
|
-
}
|
|
1480
|
-
if (i.value !== "" && i.value != null) {
|
|
1481
|
-
r("update:modelValue", { radio: i.value });
|
|
1482
|
-
return;
|
|
1483
|
-
}
|
|
1484
|
-
r("update:modelValue", {});
|
|
1485
|
-
}
|
|
1486
|
-
V([i, a], v, { immediate: !0 });
|
|
1487
|
-
function y(e) {
|
|
1488
|
-
e === n.showInput && n.type === "inputNumber" && l(a.value) && (a.value = s()), i.value = e;
|
|
1489
|
-
}
|
|
1490
|
-
return (t, n) => (A(), p("div", { class: D(["k-form-radio-input", { "k-form-radio-input--readonly": e.readonly }]) }, [
|
|
1491
|
-
_(_n, {
|
|
1492
|
-
"model-value": i.value,
|
|
1493
|
-
options: e.options,
|
|
1494
|
-
readonly: e.readonly,
|
|
1495
|
-
disabled: e.disabled,
|
|
1496
|
-
class: "k-form-radio-input__radio",
|
|
1497
|
-
"onUpdate:modelValue": y
|
|
1498
|
-
}, null, 8, [
|
|
1499
|
-
"model-value",
|
|
1500
|
-
"options",
|
|
1501
|
-
"readonly",
|
|
1502
|
-
"disabled"
|
|
1503
|
-
]),
|
|
1504
|
-
!e.readonly && o.value ? (A(), p(c, { key: 0 }, [
|
|
1505
|
-
e.leftText ? (A(), p("label", vn, F(e.leftText), 1)) : f("", !0),
|
|
1506
|
-
e.type === "inputNumber" ? (A(), d(R(Ee), T({
|
|
1507
|
-
key: 1,
|
|
1508
|
-
"model-value": h.value,
|
|
1509
|
-
class: "k-form-radio-input__input",
|
|
1510
|
-
placeholder: e.inputPlaceholder,
|
|
1511
|
-
disabled: e.disabled
|
|
1512
|
-
}, e.inputProps, { "onUpdate:modelValue": n[0] ||= (e) => a.value = e ?? "" }), null, 16, [
|
|
1513
|
-
"model-value",
|
|
1514
|
-
"placeholder",
|
|
1515
|
-
"disabled"
|
|
1516
|
-
])) : (A(), d(R(Te), T({
|
|
1517
|
-
key: 2,
|
|
1518
|
-
modelValue: a.value,
|
|
1519
|
-
"onUpdate:modelValue": n[1] ||= (e) => a.value = e,
|
|
1520
|
-
class: "k-form-radio-input__input",
|
|
1521
|
-
placeholder: e.inputPlaceholder,
|
|
1522
|
-
disabled: e.disabled
|
|
1523
|
-
}, e.inputProps), null, 16, [
|
|
1524
|
-
"modelValue",
|
|
1525
|
-
"placeholder",
|
|
1526
|
-
"disabled"
|
|
1527
|
-
])),
|
|
1528
|
-
e.rightText ? (A(), p("label", yn, F(e.rightText), 1)) : f("", !0)
|
|
1529
|
-
], 64)) : f("", !0),
|
|
1530
|
-
e.readonly && o.value ? (A(), p("div", bn, [
|
|
1531
|
-
e.leftText ? (A(), p("label", xn, F(e.leftText), 1)) : f("", !0),
|
|
1532
|
-
g(" " + F(a.value) + " ", 1),
|
|
1533
|
-
e.rightText ? (A(), p("label", Sn, F(e.rightText), 1)) : f("", !0)
|
|
1534
|
-
])) : f("", !0)
|
|
1535
|
-
], 2));
|
|
1536
|
-
}
|
|
1537
|
-
}), [["__scopeId", "data-v-1543c319"]]), wn = {
|
|
1538
|
-
key: 0,
|
|
1539
|
-
class: "k-form-scroll-select__readonly"
|
|
1540
|
-
}, Tn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1541
|
-
name: "KFormScrollSelect",
|
|
1542
|
-
__name: "ScrollSelect",
|
|
1543
|
-
props: {
|
|
1544
|
-
modelValue: {},
|
|
1545
|
-
options: {},
|
|
1546
|
-
readonly: { type: Boolean },
|
|
1547
|
-
disabled: { type: Boolean },
|
|
1548
|
-
multiple: {
|
|
1549
|
-
type: Boolean,
|
|
1550
|
-
default: !1
|
|
1551
|
-
},
|
|
1552
|
-
clearable: {
|
|
1553
|
-
type: Boolean,
|
|
1554
|
-
default: !1
|
|
1555
|
-
},
|
|
1556
|
-
defaultSelectedStr: { default: () => [] },
|
|
1557
|
-
searchKey: { default: "searchKey" },
|
|
1558
|
-
getListMethods: {
|
|
1559
|
-
type: Function,
|
|
1560
|
-
default: void 0
|
|
1561
|
-
},
|
|
1562
|
-
getListParams: { default: () => ({}) },
|
|
1563
|
-
getListFormat: {
|
|
1564
|
-
type: Function,
|
|
1565
|
-
default: (e) => Array.isArray(e) ? e : []
|
|
1566
|
-
},
|
|
1567
|
-
pageSize: { default: 10 }
|
|
1568
|
-
},
|
|
1569
|
-
emits: ["update:modelValue"],
|
|
1570
|
-
setup(e, { emit: t }) {
|
|
1571
|
-
let n = e, r = t, i = M([]), a = M(!1), o = M(!1), s = M(1), l = M(""), f = M(null), m = M(n.multiple ? [] : "");
|
|
1572
|
-
V(() => n.modelValue, (e) => {
|
|
1573
|
-
m.value = n.multiple ? At(e) : X(e);
|
|
1574
|
-
}, { immediate: !0 }), V(() => n.defaultSelectedStr, (e) => {
|
|
1575
|
-
e?.length && (i.value = [...i.value, ...e]);
|
|
1576
|
-
}, {
|
|
1577
|
-
immediate: !0,
|
|
1578
|
-
deep: !0
|
|
1579
|
-
}), V(() => n.getListParams, () => {
|
|
1580
|
-
m.value = n.multiple ? [] : "", i.value = [], s.value = 1, o.value = !1, h();
|
|
1581
|
-
}, { deep: !0 });
|
|
1582
|
-
async function h() {
|
|
1583
|
-
if (!(!n.getListMethods || o.value || a.value)) {
|
|
1584
|
-
a.value = !0;
|
|
1585
|
-
try {
|
|
1586
|
-
let e = {
|
|
1587
|
-
...n.getListParams,
|
|
1588
|
-
[n.searchKey]: l.value,
|
|
1589
|
-
page_no: s.value,
|
|
1590
|
-
page_size: n.pageSize
|
|
1591
|
-
}, t = await n.getListMethods(e), r = n.getListFormat(t, s.value);
|
|
1592
|
-
r.length < n.pageSize && (o.value = !0), i.value = i.value.concat(r);
|
|
1593
|
-
} finally {
|
|
1594
|
-
a.value = !1;
|
|
1595
|
-
}
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1598
|
-
let g = He((e) => {
|
|
1599
|
-
i.value = [], s.value = 1, o.value = !1, l.value = e, h();
|
|
1600
|
-
}, 500), _ = He(() => {
|
|
1601
|
-
s.value += 1, h();
|
|
1602
|
-
}, 300);
|
|
1603
|
-
function v(e) {
|
|
1604
|
-
e !== l.value && g(e);
|
|
1605
|
-
}
|
|
1606
|
-
function y() {
|
|
1607
|
-
if (!f.value || o.value) return;
|
|
1608
|
-
let { scrollHeight: e, scrollTop: t, clientHeight: n } = f.value;
|
|
1609
|
-
e - t > n + 2 || _();
|
|
1610
|
-
}
|
|
1611
|
-
Ue(f, "scroll", y);
|
|
1612
|
-
function b(e) {
|
|
1613
|
-
if (!e) {
|
|
1614
|
-
f.value = null;
|
|
1615
|
-
return;
|
|
1616
|
-
}
|
|
1617
|
-
E(() => {
|
|
1618
|
-
f.value = document.querySelector(".k-form-scroll-select__dropdown .el-select-dropdown__wrap");
|
|
1619
|
-
});
|
|
1620
|
-
}
|
|
1621
|
-
function x(e) {
|
|
1622
|
-
m.value = e, r("update:modelValue", e);
|
|
1623
|
-
}
|
|
1624
|
-
let S = u(() => {
|
|
1625
|
-
if (n.multiple) {
|
|
1626
|
-
let e = At(m.value), t = i.value.filter((t) => e.includes(t.value)).map((e) => String(e.label ?? e.name ?? e.value));
|
|
1627
|
-
return t.length ? t.join(", ") : Z(e);
|
|
1628
|
-
}
|
|
1629
|
-
let e = X(m.value), t = i.value.find((t) => t.value === e);
|
|
1630
|
-
return t ? String(t.label ?? t.name ?? t.value) : Z(e);
|
|
1631
|
-
});
|
|
1632
|
-
return h(), (t, n) => e.readonly ? (A(), p("span", wn, F(S.value), 1)) : (A(), d(R(Fe), {
|
|
1633
|
-
key: 1,
|
|
1634
|
-
"model-value": m.value,
|
|
1635
|
-
remote: "",
|
|
1636
|
-
filterable: "",
|
|
1637
|
-
"remote-method": v,
|
|
1638
|
-
multiple: e.multiple,
|
|
1639
|
-
clearable: e.clearable,
|
|
1640
|
-
disabled: e.disabled,
|
|
1641
|
-
loading: a.value,
|
|
1642
|
-
"popper-class": "k-form-scroll-select__dropdown",
|
|
1643
|
-
class: "k-form-scroll-select",
|
|
1644
|
-
onVisibleChange: b,
|
|
1645
|
-
"onUpdate:modelValue": x
|
|
1646
|
-
}, {
|
|
1647
|
-
default: H(() => [(A(!0), p(c, null, N(i.value, (e, t) => de((A(), d(R(Oe), {
|
|
1648
|
-
key: `${e.value}-${t}`,
|
|
1649
|
-
label: String(e.label ?? ""),
|
|
1650
|
-
value: e.value
|
|
1651
|
-
}, null, 8, ["label", "value"])), [[ue, e.isShow !== !1]])), 128))]),
|
|
1652
|
-
_: 1
|
|
1653
|
-
}, 8, [
|
|
1654
|
-
"model-value",
|
|
1655
|
-
"multiple",
|
|
1656
|
-
"clearable",
|
|
1657
|
-
"disabled",
|
|
1658
|
-
"loading"
|
|
1659
|
-
]));
|
|
1660
|
-
}
|
|
1661
|
-
}), [["__scopeId", "data-v-dc0bba37"]]), En = {
|
|
1662
|
-
key: 0,
|
|
1663
|
-
class: "k-form-select-multiple__readonly"
|
|
1664
|
-
}, Dn = "all", On = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1665
|
-
name: "KFormSelectMultiple",
|
|
1666
|
-
__name: "SelectMultiple",
|
|
1667
|
-
props: {
|
|
1668
|
-
modelValue: {},
|
|
1669
|
-
options: {},
|
|
1670
|
-
readonly: { type: Boolean },
|
|
1671
|
-
disabled: { type: Boolean },
|
|
1672
|
-
placeholder: { default: "请选择" },
|
|
1673
|
-
showAllItem: {
|
|
1674
|
-
type: Boolean,
|
|
1675
|
-
default: !1
|
|
1676
|
-
}
|
|
1677
|
-
},
|
|
1678
|
-
emits: ["update:modelValue"],
|
|
1679
|
-
setup(e, { emit: t }) {
|
|
1680
|
-
let n = e, r = t, i = M([]), a = u(() => {
|
|
1681
|
-
let e = n.options ?? [];
|
|
1682
|
-
return !n.showAllItem || e.some((e) => e.value === Dn) ? e : [{
|
|
1683
|
-
label: "全选",
|
|
1684
|
-
value: Dn
|
|
1685
|
-
}, ...e];
|
|
1686
|
-
}), o = u(() => a.value.map((e) => ({
|
|
1687
|
-
label: e.label,
|
|
1688
|
-
value: Ot(e.value),
|
|
1689
|
-
disabled: e.disabled,
|
|
1690
|
-
key: String(e.value)
|
|
1691
|
-
}))), s = u(() => o.value.map((e) => e.value)), l = u(() => {
|
|
1692
|
-
let e = o.value.filter((e) => i.value.includes(e.value)).map((e) => e.label);
|
|
1693
|
-
return e.length ? e.join(", ") : Z(i.value);
|
|
1694
|
-
});
|
|
1695
|
-
V(() => n.modelValue, (e) => {
|
|
1696
|
-
i.value = At(e);
|
|
1697
|
-
}, { immediate: !0 });
|
|
1698
|
-
function f(e, t) {
|
|
1699
|
-
if (!n.showAllItem) {
|
|
1700
|
-
r("update:modelValue", e);
|
|
1701
|
-
return;
|
|
1702
|
-
}
|
|
1703
|
-
let a = e.includes(Dn), o = t.includes(Dn);
|
|
1704
|
-
a && e.length > t.length ? i.value = [...s.value] : !a && o && e.length !== s.value.length ? i.value = [] : a && e.length !== s.value.length ? i.value = e.filter((e) => e !== Dn) : !a && e.length >= s.value.length - 1 ? i.value = [Dn, ...e] : i.value = e, r("update:modelValue", i.value);
|
|
1705
|
-
}
|
|
1706
|
-
let m = [];
|
|
1707
|
-
function h(e) {
|
|
1708
|
-
f(e, m), m = [...i.value];
|
|
1709
|
-
}
|
|
1710
|
-
return (t, n) => e.readonly ? (A(), p("span", En, F(l.value), 1)) : (A(), d(R(Fe), {
|
|
1711
|
-
key: 1,
|
|
1712
|
-
"model-value": i.value,
|
|
1713
|
-
multiple: "",
|
|
1714
|
-
"collapse-tags": "",
|
|
1715
|
-
"collapse-tags-tooltip": "",
|
|
1716
|
-
placeholder: e.placeholder,
|
|
1717
|
-
disabled: e.disabled,
|
|
1718
|
-
class: "k-form-select-multiple",
|
|
1719
|
-
"onUpdate:modelValue": h
|
|
1720
|
-
}, {
|
|
1721
|
-
default: H(() => [(A(!0), p(c, null, N(o.value, (e) => (A(), d(R(Oe), {
|
|
1722
|
-
key: e.key,
|
|
1723
|
-
label: e.label,
|
|
1724
|
-
value: e.value,
|
|
1725
|
-
disabled: e.disabled
|
|
1726
|
-
}, null, 8, [
|
|
1727
|
-
"label",
|
|
1728
|
-
"value",
|
|
1729
|
-
"disabled"
|
|
1730
|
-
]))), 128))]),
|
|
1731
|
-
_: 1
|
|
1732
|
-
}, 8, [
|
|
1733
|
-
"model-value",
|
|
1734
|
-
"placeholder",
|
|
1735
|
-
"disabled"
|
|
1736
|
-
]));
|
|
1737
|
-
}
|
|
1738
|
-
}), [["__scopeId", "data-v-e6ca06e1"]]), kn = { class: "k-form-tag" }, An = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1739
|
-
name: "KFormTag",
|
|
1740
|
-
inheritAttrs: !1,
|
|
1741
|
-
__name: "Tag",
|
|
1742
|
-
props: {
|
|
1743
|
-
modelValue: {},
|
|
1744
|
-
options: {},
|
|
1745
|
-
readonly: { type: Boolean },
|
|
1746
|
-
disabled: {
|
|
1747
|
-
type: Boolean,
|
|
1748
|
-
default: !1
|
|
1749
|
-
},
|
|
1750
|
-
hasDefaultOption: {
|
|
1751
|
-
type: Boolean,
|
|
1752
|
-
default: !1
|
|
1753
|
-
},
|
|
1754
|
-
hasAllTag: {
|
|
1755
|
-
type: Boolean,
|
|
1756
|
-
default: !1
|
|
1757
|
-
},
|
|
1758
|
-
canUnSelect: {
|
|
1759
|
-
type: Boolean,
|
|
1760
|
-
default: !0
|
|
1761
|
-
},
|
|
1762
|
-
multiple: {
|
|
1763
|
-
type: Boolean,
|
|
1764
|
-
default: !1
|
|
1765
|
-
}
|
|
1766
|
-
},
|
|
1767
|
-
emits: ["update:modelValue"],
|
|
1768
|
-
setup(e, { emit: t }) {
|
|
1769
|
-
let n = e, r = t, i = M([]), a = u(() => n.hasDefaultOption || n.hasAllTag), o = u(() => {
|
|
1770
|
-
let e = (n.options ?? []).map((e) => ({
|
|
1771
|
-
label: e.label,
|
|
1772
|
-
value: String(e.value)
|
|
1773
|
-
}));
|
|
1774
|
-
return a.value ? [{
|
|
1775
|
-
label: "全部",
|
|
1776
|
-
value: ""
|
|
1777
|
-
}, ...e] : e;
|
|
1778
|
-
});
|
|
1779
|
-
function s() {
|
|
1780
|
-
let e = n.modelValue;
|
|
1781
|
-
if (Array.isArray(e)) {
|
|
1782
|
-
i.value = e.map(String);
|
|
1783
|
-
return;
|
|
1784
|
-
}
|
|
1785
|
-
let t = X(e);
|
|
1786
|
-
i.value = t ? [String(t)] : [];
|
|
1787
|
-
}
|
|
1788
|
-
V(() => n.modelValue, s, { immediate: !0 });
|
|
1789
|
-
function l() {
|
|
1790
|
-
if (n.multiple) {
|
|
1791
|
-
r("update:modelValue", [...i.value]);
|
|
1792
|
-
return;
|
|
1793
|
-
}
|
|
1794
|
-
r("update:modelValue", i.value[0] ?? "");
|
|
1795
|
-
}
|
|
1796
|
-
function f(e) {
|
|
1797
|
-
if (n.readonly || n.disabled) return;
|
|
1798
|
-
let t = i.value.includes(e);
|
|
1799
|
-
t && n.canUnSelect ? i.value = i.value.filter((t) => t !== e) : n.multiple ? t || i.value.push(e) : i.value = [e], l();
|
|
1800
|
-
}
|
|
1801
|
-
function m(e) {
|
|
1802
|
-
let t = ["k-form-tag__item"];
|
|
1803
|
-
return n.disabled && t.push("is-disabled"), n.readonly && t.push("is-readonly"), i.value.includes(e) && t.push("is-active"), t.join(" ");
|
|
1804
|
-
}
|
|
1805
|
-
return (e, t) => (A(), p("div", kn, [(A(!0), p(c, null, N(o.value, (e) => (A(), d(R(Le), {
|
|
1806
|
-
key: e.value || "__all__",
|
|
1807
|
-
class: D(["k-form-tag__item", m(e.value)]),
|
|
1808
|
-
type: "info",
|
|
1809
|
-
effect: "plain",
|
|
1810
|
-
"disable-transitions": !0,
|
|
1811
|
-
onClick: (t) => f(e.value)
|
|
1812
|
-
}, {
|
|
1813
|
-
default: H(() => [g(F(e.label), 1)]),
|
|
1814
|
-
_: 2
|
|
1815
|
-
}, 1032, ["class", "onClick"]))), 128))]));
|
|
1816
|
-
}
|
|
1817
|
-
}), [["__scopeId", "data-v-9961a98a"]]), jn = { class: "k-form-text" }, Mn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1818
|
-
name: "KFormText",
|
|
1819
|
-
__name: "Text",
|
|
1820
|
-
props: {
|
|
1821
|
-
modelValue: {},
|
|
1822
|
-
options: {},
|
|
1823
|
-
readonly: { type: Boolean },
|
|
1824
|
-
disabled: { type: Boolean }
|
|
1825
|
-
},
|
|
1826
|
-
setup(e) {
|
|
1827
|
-
let t = e, n = u(() => kt(t.modelValue));
|
|
1828
|
-
return (e, t) => (A(), p("div", jn, [m("p", null, F(n.value), 1)]));
|
|
1829
|
-
}
|
|
1830
|
-
}), [["__scopeId", "data-v-9dc35114"]]), Nn = { class: "k-form-time-picker" }, Pn = ["innerHTML"], Fn = {
|
|
1831
|
-
key: 1,
|
|
1832
|
-
class: "k-form-time-picker__side k-form-time-picker__side--left"
|
|
1833
|
-
}, In = {
|
|
1834
|
-
key: 2,
|
|
1835
|
-
class: "k-form-time-picker__readonly"
|
|
1836
|
-
}, Ln = {
|
|
1837
|
-
key: 4,
|
|
1838
|
-
class: "k-form-time-picker__side k-form-time-picker__side--right"
|
|
1839
|
-
}, Rn = ["innerHTML"], zn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1840
|
-
name: "KFormTimePicker",
|
|
1841
|
-
inheritAttrs: !1,
|
|
1842
|
-
__name: "TimePicker",
|
|
1843
|
-
props: {
|
|
1844
|
-
modelValue: {},
|
|
1845
|
-
options: {},
|
|
1846
|
-
readonly: { type: Boolean },
|
|
1847
|
-
disabled: { type: Boolean },
|
|
1848
|
-
type: { default: "time" },
|
|
1849
|
-
prepend: { default: "" },
|
|
1850
|
-
append: { default: "" },
|
|
1851
|
-
leftText: { default: "" },
|
|
1852
|
-
rightText: { default: "" },
|
|
1853
|
-
limitTime: {
|
|
1854
|
-
type: Boolean,
|
|
1855
|
-
default: !1
|
|
1856
|
-
},
|
|
1857
|
-
placeholder: { default: "请选择时间" },
|
|
1858
|
-
startPlaceholder: { default: void 0 },
|
|
1859
|
-
endPlaceholder: { default: void 0 },
|
|
1860
|
-
valueFormat: { default: "HH:mm:ss" },
|
|
1861
|
-
format: { default: void 0 },
|
|
1862
|
-
clearable: {
|
|
1863
|
-
type: Boolean,
|
|
1864
|
-
default: !0
|
|
1865
|
-
}
|
|
1866
|
-
},
|
|
1867
|
-
emits: ["update:modelValue"],
|
|
1868
|
-
setup(e, { emit: t }) {
|
|
1869
|
-
let n = e, r = t, i = u(() => Pt(n.modelValue)), a = u(() => Ft(n.type)), o = u(() => a.value === "timerange"), s = (e, t) => {
|
|
1870
|
-
let n = K(e instanceof Date ? e : String(e));
|
|
1871
|
-
return n.isValid() ? n.format(t) : Z(e);
|
|
1872
|
-
}, c = u(() => {
|
|
1873
|
-
if (!n.modelValue) return Z(n.modelValue);
|
|
1874
|
-
let e = n.valueFormat || "HH:mm:ss";
|
|
1875
|
-
return Array.isArray(n.modelValue) ? n.modelValue.map((t) => s(t, e)).join(" - ") : s(n.modelValue, e);
|
|
1876
|
-
}), l = u(() => {
|
|
1877
|
-
if (!n.limitTime) return;
|
|
1878
|
-
let e = K().hour();
|
|
1879
|
-
return () => Array.from({ length: 24 }, (e, t) => t).filter((t) => t < e);
|
|
1880
|
-
}), m = u(() => {
|
|
1881
|
-
if (n.limitTime) return (e) => {
|
|
1882
|
-
let t = K();
|
|
1883
|
-
return e > t.hour() ? [] : e < t.hour() ? Array.from({ length: 60 }, (e, t) => t) : Array.from({ length: 60 }, (e, t) => t).filter((e) => e < t.minute());
|
|
1884
|
-
};
|
|
1885
|
-
}), h = u(() => {
|
|
1886
|
-
if (n.limitTime) return (e, t) => {
|
|
1887
|
-
let n = K();
|
|
1888
|
-
return e > n.hour() || e === n.hour() && t > n.minute() ? [] : e < n.hour() || e === n.hour() && t < n.minute() ? Array.from({ length: 60 }, (e, t) => t) : Array.from({ length: 60 }, (e, t) => t).filter((e) => e < n.second());
|
|
1889
|
-
};
|
|
1890
|
-
});
|
|
1891
|
-
function g(e) {
|
|
1892
|
-
r("update:modelValue", e);
|
|
1893
|
-
}
|
|
1894
|
-
return (t, n) => (A(), p("div", Nn, [
|
|
1895
|
-
e.prepend ? (A(), p("span", {
|
|
1896
|
-
key: 0,
|
|
1897
|
-
class: "k-form-time-picker__text",
|
|
1898
|
-
innerHTML: e.prepend
|
|
1899
|
-
}, null, 8, Pn)) : f("", !0),
|
|
1900
|
-
e.leftText ? (A(), p("span", Fn, F(e.leftText), 1)) : f("", !0),
|
|
1901
|
-
e.readonly ? (A(), p("span", In, F(c.value), 1)) : (A(), d(R(Re), {
|
|
1902
|
-
key: 3,
|
|
1903
|
-
"model-value": i.value,
|
|
1904
|
-
"is-range": o.value,
|
|
1905
|
-
placeholder: e.placeholder,
|
|
1906
|
-
"start-placeholder": e.startPlaceholder,
|
|
1907
|
-
"end-placeholder": e.endPlaceholder,
|
|
1908
|
-
"value-format": e.valueFormat,
|
|
1909
|
-
format: e.format,
|
|
1910
|
-
disabled: e.disabled,
|
|
1911
|
-
clearable: e.clearable,
|
|
1912
|
-
"disabled-hours": l.value,
|
|
1913
|
-
"disabled-minutes": m.value,
|
|
1914
|
-
"disabled-seconds": h.value,
|
|
1915
|
-
"onUpdate:modelValue": g
|
|
1916
|
-
}, null, 8, [
|
|
1917
|
-
"model-value",
|
|
1918
|
-
"is-range",
|
|
1919
|
-
"placeholder",
|
|
1920
|
-
"start-placeholder",
|
|
1921
|
-
"end-placeholder",
|
|
1922
|
-
"value-format",
|
|
1923
|
-
"format",
|
|
1924
|
-
"disabled",
|
|
1925
|
-
"clearable",
|
|
1926
|
-
"disabled-hours",
|
|
1927
|
-
"disabled-minutes",
|
|
1928
|
-
"disabled-seconds"
|
|
1929
|
-
])),
|
|
1930
|
-
e.rightText ? (A(), p("span", Ln, F(e.rightText), 1)) : f("", !0),
|
|
1931
|
-
e.append ? (A(), p("span", {
|
|
1932
|
-
key: 5,
|
|
1933
|
-
class: "k-form-time-picker__text",
|
|
1934
|
-
innerHTML: e.append
|
|
1935
|
-
}, null, 8, Rn)) : f("", !0)
|
|
1936
|
-
]));
|
|
1937
|
-
}
|
|
1938
|
-
}), [["__scopeId", "data-v-8680ec2d"]]), Bn = { class: "k-form-tree-select" }, Vn = {
|
|
1939
|
-
key: 0,
|
|
1940
|
-
class: "k-form-input__readonly"
|
|
1941
|
-
}, Hn = /* @__PURE__ */ y({
|
|
1942
|
-
name: "KFormTreeSelect",
|
|
1943
|
-
__name: "TreeSelect",
|
|
1944
|
-
props: {
|
|
1945
|
-
modelValue: {},
|
|
1946
|
-
options: {},
|
|
1947
|
-
readonly: { type: Boolean },
|
|
1948
|
-
disabled: { type: Boolean },
|
|
1949
|
-
data: { default: () => [] },
|
|
1950
|
-
placeholder: { default: void 0 },
|
|
1951
|
-
clearable: {
|
|
1952
|
-
type: Boolean,
|
|
1953
|
-
default: !0
|
|
1954
|
-
},
|
|
1955
|
-
filterable: {
|
|
1956
|
-
type: Boolean,
|
|
1957
|
-
default: !0
|
|
1958
|
-
},
|
|
1959
|
-
checkStrictly: {
|
|
1960
|
-
type: Boolean,
|
|
1961
|
-
default: !0
|
|
1962
|
-
}
|
|
1963
|
-
},
|
|
1964
|
-
emits: ["update:modelValue"],
|
|
1965
|
-
setup(e, { emit: t }) {
|
|
1966
|
-
let n = e, r = t, i = u(() => X(n.modelValue)), a = u(() => Lt(n.data)), o = u(() => Rt(a.value, i.value) ?? Z(i.value));
|
|
1967
|
-
return (t, n) => (A(), p("div", Bn, [e.readonly ? (A(), p("div", Vn, F(o.value), 1)) : (A(), d(R(Be), {
|
|
1968
|
-
key: 1,
|
|
1969
|
-
"model-value": i.value,
|
|
1970
|
-
data: a.value,
|
|
1971
|
-
placeholder: e.placeholder,
|
|
1972
|
-
clearable: e.clearable,
|
|
1973
|
-
filterable: e.filterable,
|
|
1974
|
-
"check-strictly": e.checkStrictly,
|
|
1975
|
-
disabled: e.disabled,
|
|
1976
|
-
"render-after-expand": !1,
|
|
1977
|
-
"onUpdate:modelValue": n[0] ||= (e) => r("update:modelValue", e)
|
|
1978
|
-
}, null, 8, [
|
|
1979
|
-
"model-value",
|
|
1980
|
-
"data",
|
|
1981
|
-
"placeholder",
|
|
1982
|
-
"clearable",
|
|
1983
|
-
"filterable",
|
|
1984
|
-
"check-strictly",
|
|
1985
|
-
"disabled"
|
|
1986
|
-
]))]));
|
|
1987
|
-
}
|
|
1988
|
-
}), Un = { class: "k-upload__file-item" }, Wn = ["src"], Gn = { class: "el-upload-list__item-actions" }, Kn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
1989
|
-
name: "KUploadFileItem",
|
|
1990
|
-
__name: "UploadFileItem",
|
|
1991
|
-
props: {
|
|
1992
|
-
file: {},
|
|
1993
|
-
listType: {},
|
|
1994
|
-
disabled: { type: Boolean }
|
|
1995
|
-
},
|
|
1996
|
-
emits: [
|
|
1997
|
-
"zoom",
|
|
1998
|
-
"download",
|
|
1999
|
-
"remove",
|
|
2000
|
-
"play"
|
|
2001
|
-
],
|
|
2002
|
-
setup(e, { emit: t }) {
|
|
2003
|
-
let n = e, r = t, i = u(() => n.listType === "video" || n.listType === "audio"), a = u(() => n.file.status === "uploading"), o = u(() => Math.round(Number(n.file.percentage ?? 0)));
|
|
2004
|
-
return (t, n) => (A(), p("div", Un, [i.value ? (A(), p("button", {
|
|
2005
|
-
key: 0,
|
|
2006
|
-
type: "button",
|
|
2007
|
-
class: "k-upload__media-play",
|
|
2008
|
-
onClick: n[0] ||= (t) => r("play", e.file)
|
|
2009
|
-
}, [_(R(Ce), null, {
|
|
2010
|
-
default: H(() => [_(R(Ye))]),
|
|
2011
|
-
_: 1
|
|
2012
|
-
})])) : (A(), p(c, { key: 1 }, [P(t.$slots, "preview", { file: e.file }, () => [m("img", {
|
|
2013
|
-
class: "el-upload-list__item-thumbnail",
|
|
2014
|
-
src: e.file.url,
|
|
2015
|
-
alt: ""
|
|
2016
|
-
}, null, 8, Wn)], !0), m("span", Gn, [
|
|
2017
|
-
m("span", {
|
|
2018
|
-
class: "el-upload-list__item-preview",
|
|
2019
|
-
onClick: n[1] ||= (t) => r("zoom", e.file)
|
|
2020
|
-
}, [_(R(Ce), null, {
|
|
2021
|
-
default: H(() => [_(R(Xe))]),
|
|
2022
|
-
_: 1
|
|
2023
|
-
})]),
|
|
2024
|
-
e.disabled ? f("", !0) : (A(), p("span", {
|
|
2025
|
-
key: 0,
|
|
2026
|
-
class: "el-upload-list__item-download",
|
|
2027
|
-
onClick: n[2] ||= (t) => r("download", e.file)
|
|
2028
|
-
}, [_(R(Ce), null, {
|
|
2029
|
-
default: H(() => [_(R(Ke))]),
|
|
2030
|
-
_: 1
|
|
2031
|
-
})])),
|
|
2032
|
-
e.disabled ? f("", !0) : (A(), p("span", {
|
|
2033
|
-
key: 1,
|
|
2034
|
-
class: "el-upload-list__item-delete",
|
|
2035
|
-
onClick: n[3] ||= (t) => r("remove", e.file)
|
|
2036
|
-
}, [_(R(Ce), null, {
|
|
2037
|
-
default: H(() => [_(R(Ge))]),
|
|
2038
|
-
_: 1
|
|
2039
|
-
})]))
|
|
2040
|
-
])], 64)), a.value ? (A(), d(R(je), {
|
|
2041
|
-
key: 2,
|
|
2042
|
-
class: "k-upload__file-progress",
|
|
2043
|
-
type: e.listType === "picture-card" || e.listType === "lottie" ? "circle" : "line",
|
|
2044
|
-
width: e.listType === "picture-card" || e.listType === "lottie" ? 80 : void 0,
|
|
2045
|
-
"stroke-width": 6,
|
|
2046
|
-
percentage: o.value,
|
|
2047
|
-
"show-text": !1
|
|
2048
|
-
}, null, 8, [
|
|
2049
|
-
"type",
|
|
2050
|
-
"width",
|
|
2051
|
-
"percentage"
|
|
2052
|
-
])) : f("", !0)]));
|
|
2053
|
-
}
|
|
2054
|
-
}), [["__scopeId", "data-v-01959ada"]]), qn = { class: "k-upload__inline-actions" }, Jn = ["innerHTML"], Yn = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
2055
|
-
name: "KUploadInlineActions",
|
|
2056
|
-
__name: "UploadInlineActions",
|
|
2057
|
-
props: {
|
|
2058
|
-
templateCode: { default: "" },
|
|
2059
|
-
templateBtnText: { default: "模版下载" },
|
|
2060
|
-
tipType: { default: "text" },
|
|
2061
|
-
tipText: { default: "" }
|
|
2062
|
-
},
|
|
2063
|
-
emits: ["downloadTemplate"],
|
|
2064
|
-
setup(e, { emit: t }) {
|
|
2065
|
-
let n = t;
|
|
2066
|
-
return (t, r) => (A(), p("div", qn, [
|
|
2067
|
-
e.templateCode ? (A(), p("button", {
|
|
2068
|
-
key: 0,
|
|
2069
|
-
type: "button",
|
|
2070
|
-
class: "k-upload__download",
|
|
2071
|
-
onClick: r[0] ||= fe((e) => n("downloadTemplate"), ["stop"])
|
|
2072
|
-
}, [_(R(Ce), { class: "k-upload__download-icon" }, {
|
|
2073
|
-
default: H(() => [_(R(Ke))]),
|
|
2074
|
-
_: 1
|
|
2075
|
-
}), m("span", null, F(e.templateBtnText), 1)])) : f("", !0),
|
|
2076
|
-
e.tipType === "text" && e.tipText ? (A(), p("span", {
|
|
2077
|
-
key: 1,
|
|
2078
|
-
class: "k-upload__inline-tip",
|
|
2079
|
-
innerHTML: e.tipText
|
|
2080
|
-
}, null, 8, Jn)) : f("", !0),
|
|
2081
|
-
e.tipType === "tooltip" && e.tipText ? (A(), d(R(ze), {
|
|
2082
|
-
key: 2,
|
|
2083
|
-
placement: "top",
|
|
2084
|
-
content: e.tipText
|
|
2085
|
-
}, {
|
|
2086
|
-
default: H(() => [...r[1] ||= [m("i", {
|
|
2087
|
-
class: "k-upload__tip-icon",
|
|
2088
|
-
"aria-label": "上传说明"
|
|
2089
|
-
}, "?", -1)]]),
|
|
2090
|
-
_: 1
|
|
2091
|
-
}, 8, ["content"])) : f("", !0)
|
|
2092
|
-
]));
|
|
2093
|
-
}
|
|
2094
|
-
}), [["__scopeId", "data-v-aee31b8d"]]), Xn = { class: "k-upload__media-wrap" }, Zn = ["src"], Qn = ["src"], $n = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
2095
|
-
name: "KUploadMediaDialog",
|
|
2096
|
-
__name: "UploadMediaDialog",
|
|
2097
|
-
props: /*@__PURE__*/ w({
|
|
2098
|
-
url: {},
|
|
2099
|
-
type: {}
|
|
2100
|
-
}, {
|
|
2101
|
-
visible: {
|
|
2102
|
-
type: Boolean,
|
|
2103
|
-
default: !1
|
|
2104
|
-
},
|
|
2105
|
-
visibleModifiers: {}
|
|
2106
|
-
}),
|
|
2107
|
-
emits: ["update:visible"],
|
|
2108
|
-
setup(e) {
|
|
2109
|
-
let t = le(e, "visible");
|
|
2110
|
-
return (n, r) => (A(), d(dt, {
|
|
2111
|
-
visible: t.value,
|
|
2112
|
-
"onUpdate:visible": r[0] ||= (e) => t.value = e,
|
|
2113
|
-
"show-confirm": !1,
|
|
2114
|
-
"show-cancel": !1,
|
|
2115
|
-
width: "640px",
|
|
2116
|
-
title: "预览"
|
|
2117
|
-
}, {
|
|
2118
|
-
default: H(() => [m("div", Xn, [e.type === "video" ? (A(), p("video", {
|
|
2119
|
-
key: 0,
|
|
2120
|
-
src: e.url,
|
|
2121
|
-
controls: "",
|
|
2122
|
-
class: "k-upload__media"
|
|
2123
|
-
}, "您的浏览器不支持视频播放", 8, Zn)) : (A(), p("audio", {
|
|
2124
|
-
key: 1,
|
|
2125
|
-
src: e.url,
|
|
2126
|
-
controls: "",
|
|
2127
|
-
class: "k-upload__media"
|
|
2128
|
-
}, "您的浏览器不支持音频播放", 8, Qn))])]),
|
|
2129
|
-
_: 1
|
|
2130
|
-
}, 8, ["visible"]));
|
|
2131
|
-
}
|
|
2132
|
-
}), [["__scopeId", "data-v-b9720661"]]), er = { class: "k-upload__tip-area" }, tr = ["innerHTML"], nr = /* @__PURE__ */ y({
|
|
2133
|
-
name: "KUploadTipArea",
|
|
2134
|
-
__name: "UploadTipArea",
|
|
2135
|
-
props: {
|
|
2136
|
-
tipType: { default: "text" },
|
|
2137
|
-
tipText: { default: "" }
|
|
2138
|
-
},
|
|
2139
|
-
setup(e) {
|
|
2140
|
-
return (t, n) => (A(), p("div", er, [e.tipType === "text" && e.tipText ? (A(), p("div", {
|
|
2141
|
-
key: 0,
|
|
2142
|
-
class: "el-upload__tip",
|
|
2143
|
-
innerHTML: e.tipText
|
|
2144
|
-
}, null, 8, tr)) : f("", !0)]));
|
|
2145
|
-
}
|
|
2146
|
-
});
|
|
2147
|
-
//#endregion
|
|
2148
|
-
//#region src/components/k-upload/composables/useImagePreview.ts
|
|
2149
|
-
function rr() {
|
|
2150
|
-
let e = M(!1), t = M([]), n = M(0);
|
|
2151
|
-
function r(r, i) {
|
|
2152
|
-
let a = i.map((e) => e.url).filter((e) => !!e), o = r.url;
|
|
2153
|
-
if (o && !a.includes(o) && a.unshift(o), !a.length) return !1;
|
|
2154
|
-
let s = o ? a.indexOf(o) : 0;
|
|
2155
|
-
return t.value = a, n.value = s < 0 ? 0 : s, e.value = !0, !0;
|
|
2156
|
-
}
|
|
2157
|
-
function i() {
|
|
2158
|
-
e.value = !1;
|
|
2159
|
-
}
|
|
2160
|
-
return {
|
|
2161
|
-
visible: e,
|
|
2162
|
-
urlList: t,
|
|
2163
|
-
initialIndex: n,
|
|
2164
|
-
open: r,
|
|
2165
|
-
close: i
|
|
2166
|
-
};
|
|
2167
|
-
}
|
|
2168
|
-
//#endregion
|
|
2169
|
-
//#region src/components/k-upload/composables/useMediaPreview.ts
|
|
2170
|
-
function ir() {
|
|
2171
|
-
let e = M(!1), t = M(""), n = M("video");
|
|
2172
|
-
function r(r, i) {
|
|
2173
|
-
r.url && (t.value = r.url, n.value = i, e.value = !0);
|
|
2174
|
-
}
|
|
2175
|
-
function i() {
|
|
2176
|
-
e.value = !1, t.value = "";
|
|
2177
|
-
}
|
|
2178
|
-
return {
|
|
2179
|
-
visible: e,
|
|
2180
|
-
url: t,
|
|
2181
|
-
type: n,
|
|
2182
|
-
open: r,
|
|
2183
|
-
close: i
|
|
2184
|
-
};
|
|
2185
|
-
}
|
|
2186
|
-
//#endregion
|
|
2187
|
-
//#region src/components/k-upload/composables/useUploadFileList.ts
|
|
2188
|
-
function ar(e, t) {
|
|
2189
|
-
return String(e) === String(t);
|
|
2190
|
-
}
|
|
2191
|
-
function or(e) {
|
|
2192
|
-
let t = M([]);
|
|
2193
|
-
V(() => e.getModelValue(), (e) => {
|
|
2194
|
-
t.value = Array.isArray(e) ? e.map((e) => ({ ...e })) : [];
|
|
2195
|
-
}, {
|
|
2196
|
-
immediate: !0,
|
|
2197
|
-
deep: !0
|
|
2198
|
-
});
|
|
2199
|
-
let n = u(() => t.value.map((e) => ({
|
|
2200
|
-
name: e.name,
|
|
2201
|
-
url: e.url,
|
|
2202
|
-
uid: e.uid,
|
|
2203
|
-
status: e.status ?? "success"
|
|
2204
|
-
})));
|
|
2205
|
-
function r(n) {
|
|
2206
|
-
t.value = n, e.onUpdate(n.map((e) => ({ ...e })));
|
|
2207
|
-
}
|
|
2208
|
-
function i(e) {
|
|
2209
|
-
r(t.value.filter((t) => !ar(t.uid, e)));
|
|
2210
|
-
}
|
|
2211
|
-
function a(n) {
|
|
2212
|
-
if (e.getLimit() === 1) {
|
|
2213
|
-
r([n]);
|
|
2214
|
-
return;
|
|
2215
|
-
}
|
|
2216
|
-
r([...t.value.filter((e) => !ar(e.uid, n.uid)), n]);
|
|
2217
|
-
}
|
|
2218
|
-
function o(e) {
|
|
2219
|
-
return t.value.find((t) => ar(t.uid, e));
|
|
2220
|
-
}
|
|
2221
|
-
return {
|
|
2222
|
-
fileList: t,
|
|
2223
|
-
elFileList: n,
|
|
2224
|
-
publish: r,
|
|
2225
|
-
removeByUid: i,
|
|
2226
|
-
upsert: a,
|
|
2227
|
-
findByUid: o
|
|
2228
|
-
};
|
|
2229
|
-
}
|
|
2230
|
-
//#endregion
|
|
2231
|
-
//#region src/components/k-upload/composables/useUploadRequest.ts
|
|
2232
|
-
function sr() {
|
|
2233
|
-
let e = s();
|
|
2234
|
-
if (!e.uploadRequest) throw Error("[KUpload] uploadRequest 未配置,请在 setupCmsBase 中初始化上传能力");
|
|
2235
|
-
return e;
|
|
2236
|
-
}
|
|
2237
|
-
function cr(e, t) {
|
|
2238
|
-
if (String(e[t.responseCode] ?? "") !== t.responseSuccessCode) {
|
|
2239
|
-
let n = String(e[t.responseMsg] ?? "");
|
|
2240
|
-
throw Error(n || "文件上传失败");
|
|
2241
|
-
}
|
|
2242
|
-
}
|
|
2243
|
-
function lr(e) {
|
|
2244
|
-
function t(t) {
|
|
2245
|
-
let n = { ...t }, r = e.getTemplateCode();
|
|
2246
|
-
return r && (n.type_code = r), n;
|
|
2247
|
-
}
|
|
2248
|
-
return {
|
|
2249
|
-
httpRequest: async (e) => {
|
|
2250
|
-
let n = sr(), r = await n.uploadRequest({
|
|
2251
|
-
file: e.file,
|
|
2252
|
-
action: e.action,
|
|
2253
|
-
data: t(e.data),
|
|
2254
|
-
onProgress: (t) => {
|
|
2255
|
-
e.onProgress?.({ percent: t });
|
|
2256
|
-
}
|
|
2257
|
-
});
|
|
2258
|
-
return cr(r, n), r;
|
|
2259
|
-
},
|
|
2260
|
-
uploadFile: async (e, n, r) => {
|
|
2261
|
-
let i = sr(), a = await i.uploadRequest({
|
|
2262
|
-
file: e,
|
|
2263
|
-
action: n,
|
|
2264
|
-
data: t(r),
|
|
2265
|
-
onProgress: () => {}
|
|
2266
|
-
});
|
|
2267
|
-
return cr(a, i), a;
|
|
2268
|
-
}
|
|
2269
|
-
};
|
|
2270
|
-
}
|
|
2271
|
-
//#endregion
|
|
2272
|
-
//#region src/components/k-upload/composables/useUploadValidation.ts
|
|
2273
|
-
function ur(e) {
|
|
2274
|
-
let t = /* @__PURE__ */ new Set();
|
|
2275
|
-
function n(t) {
|
|
2276
|
-
let n = e.getAccept(), i = n.split(",").map((e) => e.trim()).filter(Boolean), a = t.name.slice(t.name.lastIndexOf(".")).toLowerCase();
|
|
2277
|
-
return i.length && !i.includes(a) ? (De.warning(`只能上传后缀是${n}的文件`), r(t), !1) : t.size / 1024 / 1024 > e.getMaxSize() ? (De.warning(`文件大小不得超过${e.getMaxSize()}M`), r(t), !1) : !0;
|
|
2278
|
-
}
|
|
2279
|
-
function r(e) {
|
|
2280
|
-
let n = e.uid;
|
|
2281
|
-
typeof n == "number" && t.add(n);
|
|
2282
|
-
}
|
|
2283
|
-
function i(e) {
|
|
2284
|
-
return t.has(e) ? (t.delete(e), !0) : !1;
|
|
2285
|
-
}
|
|
2286
|
-
return {
|
|
2287
|
-
validate: n,
|
|
2288
|
-
consumeRejected: i
|
|
2289
|
-
};
|
|
2290
|
-
}
|
|
2291
|
-
//#endregion
|
|
2292
|
-
//#region src/components/k-upload/resolveUploadAction.ts
|
|
2293
|
-
function dr(e, t) {
|
|
2294
|
-
if (t) return t;
|
|
2295
|
-
let { urls: n } = s();
|
|
2296
|
-
return e === "text" ? n.UPLOAD_EXCEL_URL : e === "picture" || e === "picture-card" || e === "picture2" ? n.UPLOAD_IMG_URL : n.UPLOAD_FILE_URL;
|
|
2297
|
-
}
|
|
2298
|
-
function fr(e) {
|
|
2299
|
-
let { urls: t } = s();
|
|
2300
|
-
return e === "picture" || e === "picture-card" || e === "picture2" ? t.SHOW_IMG_URL : t.DOWNLOAD_FILE_URL;
|
|
2301
|
-
}
|
|
2302
|
-
//#endregion
|
|
2303
|
-
//#region src/components/k-upload/KUpload.vue?vue&type=script&setup=true&lang.ts
|
|
2304
|
-
var pr = {
|
|
2305
|
-
key: 0,
|
|
2306
|
-
class: "k-upload__trigger-row"
|
|
2307
|
-
}, mr = { class: "picture-card-context" }, hr = ["innerHTML"], gr = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
2308
|
-
name: "KUpload",
|
|
2309
|
-
inheritAttrs: !1,
|
|
2310
|
-
__name: "KUpload",
|
|
2311
|
-
props: {
|
|
2312
|
-
modelValue: { default: () => [] },
|
|
2313
|
-
listType: { default: "picture" },
|
|
2314
|
-
action: { default: "" },
|
|
2315
|
-
accept: { default: "" },
|
|
2316
|
-
limit: { default: void 0 },
|
|
2317
|
-
maxSize: { default: 2 },
|
|
2318
|
-
disabled: {
|
|
2319
|
-
type: Boolean,
|
|
2320
|
-
default: !1
|
|
2321
|
-
},
|
|
2322
|
-
btnText: { default: "点击上传" },
|
|
2323
|
-
templateCode: { default: "" },
|
|
2324
|
-
templateDomain: { default: "app" },
|
|
2325
|
-
templateDownloadUrl: { default: "" },
|
|
2326
|
-
templateBtnText: { default: "模版下载" },
|
|
2327
|
-
tipType: { default: "text" },
|
|
2328
|
-
fileTips: { default: "" },
|
|
2329
|
-
showSuccMessage: {
|
|
2330
|
-
type: Boolean,
|
|
2331
|
-
default: !0
|
|
2332
|
-
},
|
|
2333
|
-
autoUpload: {
|
|
2334
|
-
type: Boolean,
|
|
2335
|
-
default: !0
|
|
2336
|
-
},
|
|
2337
|
-
openCutter: {
|
|
2338
|
-
type: Boolean,
|
|
2339
|
-
default: !1
|
|
2340
|
-
},
|
|
2341
|
-
cutterOption: { default: () => ({}) }
|
|
2342
|
-
},
|
|
2343
|
-
emits: [
|
|
2344
|
-
"update:modelValue",
|
|
2345
|
-
"success",
|
|
2346
|
-
"error",
|
|
2347
|
-
"remove",
|
|
2348
|
-
"preview",
|
|
2349
|
-
"change",
|
|
2350
|
-
"exceed"
|
|
2351
|
-
],
|
|
2352
|
-
setup(e, { expose: t, emit: n }) {
|
|
2353
|
-
let r = v(() => import("./ImageCutter-B4uKMA_8.js")), i = {
|
|
2354
|
-
picture: ".bmp,.gif,.png,.jpg,.jpeg",
|
|
2355
|
-
"picture-card": ".bmp,.gif,.png,.jpg,.jpeg",
|
|
2356
|
-
text: ".doc,.docx,.xlsx,.xls",
|
|
2357
|
-
video: ".mp4",
|
|
2358
|
-
audio: ".m4a",
|
|
2359
|
-
lottie: ".json"
|
|
2360
|
-
};
|
|
2361
|
-
function a(e, t) {
|
|
2362
|
-
let n = e instanceof Error ? e.message : String(e ?? "");
|
|
2363
|
-
return /timeout/i.test(n) || /ECONNABORTED/i.test(n) ? "请求超时,请稍后重试" : n || t;
|
|
2364
|
-
}
|
|
2365
|
-
let o = e, c = n, l = M(), y = B("cutterRef"), x = M(null);
|
|
2366
|
-
V(y, (e) => {
|
|
2367
|
-
if (!e || !x.value) return;
|
|
2368
|
-
let t = x.value;
|
|
2369
|
-
x.value = null, e.openImgCutter({
|
|
2370
|
-
name: t.name,
|
|
2371
|
-
raw: t.raw
|
|
2372
|
-
});
|
|
2373
|
-
});
|
|
2374
|
-
function S(e) {
|
|
2375
|
-
if (y.value) {
|
|
2376
|
-
y.value.openImgCutter({
|
|
2377
|
-
name: e.name,
|
|
2378
|
-
raw: e.raw
|
|
2379
|
-
});
|
|
2380
|
-
return;
|
|
2381
|
-
}
|
|
2382
|
-
x.value = e;
|
|
2383
|
-
}
|
|
2384
|
-
function C(e) {
|
|
2385
|
-
return e === "picture2" ? "picture" : e;
|
|
2386
|
-
}
|
|
2387
|
-
let w = u(() => C(o.listType)), O = u(() => o.accept ? o.accept.toLowerCase() : i[w.value] ?? ""), { fileList: k, elFileList: ne, removeByUid: j, upsert: re, findByUid: N } = or({
|
|
2388
|
-
getModelValue: () => o.modelValue,
|
|
2389
|
-
onUpdate: (e) => c("update:modelValue", e),
|
|
2390
|
-
getLimit: () => o.limit
|
|
2391
|
-
}), ie = ur({
|
|
2392
|
-
getAccept: () => O.value,
|
|
2393
|
-
getMaxSize: () => o.maxSize
|
|
2394
|
-
}), ae = lr({ getTemplateCode: () => o.templateCode }), { visible: oe, urlList: se, initialIndex: I, open: L, close: ce } = rr(), { visible: le, url: z, type: ue, open: de } = ir(), fe = u(() => dr(w.value, o.action)), pe = u(() => {
|
|
2395
|
-
switch (w.value) {
|
|
2396
|
-
case "picture": return "picture";
|
|
2397
|
-
case "picture-card":
|
|
2398
|
-
case "lottie": return "picture-card";
|
|
2399
|
-
default: return "text";
|
|
2400
|
-
}
|
|
2401
|
-
}), me = u(() => [
|
|
2402
|
-
"picture",
|
|
2403
|
-
"picture-card",
|
|
2404
|
-
"lottie"
|
|
2405
|
-
].includes(w.value)), he = u(() => [
|
|
2406
|
-
"picture-card",
|
|
2407
|
-
"lottie",
|
|
2408
|
-
"video",
|
|
2409
|
-
"audio"
|
|
2410
|
-
].includes(w.value)), U = u(() => w.value === "picture-card" || w.value === "lottie"), ge = u(() => !U.value), _e = u(() => !o.openCutter && o.autoUpload), ve = u(() => o.limit === 1 ? void 0 : o.limit), ye = u(() => !!(o.limit && o.limit !== 1 && k.value.length >= o.limit)), be = u(() => !o.disabled), xe = u(() => !(U.value || o.disabled || w.value === "picture" && o.tipType === "text")), W = u(() => o.disabled ? "" : o.fileTips || (O.value ? `支持上传 ${O.value} 后缀文件,且不超过${o.maxSize}M` : "")), Se = u(() => W.value && (o.tipType === "tooltip" || o.tipType === "text" && w.value === "picture") ? W.value : ""), Te = u(() => {
|
|
2411
|
-
let e = ["k-upload", `k-upload--${w.value}`];
|
|
2412
|
-
return o.disabled && e.push("k-upload_detail"), ye.value && e.push("k-upload--limit"), e.join(" ");
|
|
2413
|
-
});
|
|
2414
|
-
function Ee(e, t, n) {
|
|
2415
|
-
let r = e ?? {}, i = String(r.resource_id ?? ""), a = String(r.file_name ?? n), o = fr(w.value);
|
|
2416
|
-
return {
|
|
2417
|
-
...r,
|
|
2418
|
-
uid: t,
|
|
2419
|
-
name: a,
|
|
2420
|
-
resource_id: i,
|
|
2421
|
-
file_name: a,
|
|
2422
|
-
imp_id: r.imp_id,
|
|
2423
|
-
url: i ? `${o}${i}` : void 0,
|
|
2424
|
-
status: "success"
|
|
2425
|
-
};
|
|
2426
|
-
}
|
|
2427
|
-
function Oe(e, t, n) {
|
|
2428
|
-
let r = Ee(e, t, n);
|
|
2429
|
-
re(r), o.showSuccMessage && De.success("文件上传成功!"), c("success", e, r);
|
|
2430
|
-
}
|
|
2431
|
-
let ke = (e) => ie.validate(e), Ae = (e, t) => {
|
|
2432
|
-
Oe(e ?? {}, t.uid, t.name);
|
|
2433
|
-
}, je = (e, t) => {
|
|
2434
|
-
De.error(a(e, "文件上传失败!")), j(t.uid), c("error", e, t);
|
|
2435
|
-
}, Me = (e) => {
|
|
2436
|
-
if (typeof e.uid == "number" && ie.consumeRejected(e.uid)) return;
|
|
2437
|
-
let t = N(e.uid);
|
|
2438
|
-
j(e.uid), t && c("remove", t);
|
|
2439
|
-
}, Ne = (e) => {
|
|
2440
|
-
let t = N(e.uid);
|
|
2441
|
-
t && (c("preview", t), !(me.value && L(t, k.value)) && K(t));
|
|
2442
|
-
}, Pe = (e) => {
|
|
2443
|
-
if (c("change", e), !(!o.openCutter || e.status !== "ready" || !e.raw)) {
|
|
2444
|
-
if (ie.validate(e.raw) === !1) {
|
|
2445
|
-
j(e.uid);
|
|
2446
|
-
return;
|
|
2447
|
-
}
|
|
2448
|
-
j(e.uid), E(() => {
|
|
2449
|
-
l.value?.handleRemove(e), S({
|
|
2450
|
-
name: e.name,
|
|
2451
|
-
raw: e.raw
|
|
2452
|
-
});
|
|
2453
|
-
});
|
|
2454
|
-
}
|
|
2455
|
-
}, Fe = (e, t) => {
|
|
2456
|
-
c("exceed", e, t);
|
|
2457
|
-
};
|
|
2458
|
-
function Ie(e) {
|
|
2459
|
-
let t = N(e.uid);
|
|
2460
|
-
t && L(t, k.value);
|
|
2461
|
-
}
|
|
2462
|
-
function G(e) {
|
|
2463
|
-
let t = N(e.uid);
|
|
2464
|
-
t && K(t);
|
|
2465
|
-
}
|
|
2466
|
-
function Le(e) {
|
|
2467
|
-
let t = N(e.uid);
|
|
2468
|
-
j(e.uid), t && c("remove", t);
|
|
2469
|
-
}
|
|
2470
|
-
function Re(e) {
|
|
2471
|
-
let t = N(e.uid);
|
|
2472
|
-
t && de(t, w.value === "audio" ? "audio" : "video");
|
|
2473
|
-
}
|
|
2474
|
-
async function ze(e) {
|
|
2475
|
-
try {
|
|
2476
|
-
let t = dr("picture", o.action);
|
|
2477
|
-
Oe(await ae.uploadFile(e, t), -Date.now(), e.name);
|
|
2478
|
-
} catch (e) {
|
|
2479
|
-
De.error(a(e, "图片上传失败!"));
|
|
2480
|
-
}
|
|
2481
|
-
}
|
|
2482
|
-
function Be(e, t) {
|
|
2483
|
-
let n = document.createElement("a");
|
|
2484
|
-
n.href = e, n.download = t, n.click();
|
|
2485
|
-
}
|
|
2486
|
-
function K(e) {
|
|
2487
|
-
e.resource_id && Be(`${fr(w.value)}${e.resource_id}`, e.name || String(e.resource_id));
|
|
2488
|
-
}
|
|
2489
|
-
function q() {
|
|
2490
|
-
let e = s(), t = e.templateCodeRelation[o.templateCode];
|
|
2491
|
-
if (!t) {
|
|
2492
|
-
De.warning("模板未配置");
|
|
2493
|
-
return;
|
|
2494
|
-
}
|
|
2495
|
-
Be(`${o.templateDownloadUrl || (o.templateDomain === "base" ? e.baseTemplateDownloadBaseUrl : e.templateDownloadBaseUrl) || e.urls.BASE_URL}${t}`, t);
|
|
2496
|
-
}
|
|
2497
|
-
return t({
|
|
2498
|
-
submit: () => l.value?.submit(),
|
|
2499
|
-
clearFiles: () => l.value?.clearFiles(),
|
|
2500
|
-
uploadRef: l
|
|
2501
|
-
}), (t, n) => (A(), p("div", { class: D(["k-upload-wrap", Te.value]) }, [
|
|
2502
|
-
_(R(Ve), T({
|
|
2503
|
-
ref_key: "uploadRef",
|
|
2504
|
-
ref: l
|
|
2505
|
-
}, t.$attrs, {
|
|
2506
|
-
class: "k-upload__inner",
|
|
2507
|
-
"file-list": R(ne),
|
|
2508
|
-
action: fe.value,
|
|
2509
|
-
"list-type": pe.value,
|
|
2510
|
-
accept: O.value,
|
|
2511
|
-
limit: ve.value,
|
|
2512
|
-
disabled: e.disabled,
|
|
2513
|
-
"auto-upload": _e.value,
|
|
2514
|
-
"http-request": R(ae).httpRequest,
|
|
2515
|
-
"before-upload": ke,
|
|
2516
|
-
"on-success": Ae,
|
|
2517
|
-
"on-error": je,
|
|
2518
|
-
"on-remove": Me,
|
|
2519
|
-
"on-preview": Ne,
|
|
2520
|
-
"on-change": Pe,
|
|
2521
|
-
"on-exceed": Fe
|
|
2522
|
-
}), h({
|
|
2523
|
-
tip: H(() => [P(t.$slots, "tip", {}, () => [U.value && (e.templateCode || e.tipType === "tooltip" && W.value) ? (A(), d(Yn, {
|
|
2524
|
-
key: 0,
|
|
2525
|
-
"template-code": e.templateCode,
|
|
2526
|
-
"template-btn-text": e.templateBtnText,
|
|
2527
|
-
"tip-type": e.tipType,
|
|
2528
|
-
"tip-text": W.value,
|
|
2529
|
-
onDownloadTemplate: q
|
|
2530
|
-
}, null, 8, [
|
|
2531
|
-
"template-code",
|
|
2532
|
-
"template-btn-text",
|
|
2533
|
-
"tip-type",
|
|
2534
|
-
"tip-text"
|
|
2535
|
-
])) : f("", !0), xe.value ? (A(), d(nr, {
|
|
2536
|
-
key: 1,
|
|
2537
|
-
"tip-type": e.tipType,
|
|
2538
|
-
"tip-text": W.value
|
|
2539
|
-
}, null, 8, ["tip-type", "tip-text"])) : f("", !0)], !0)]),
|
|
2540
|
-
_: 2
|
|
2541
|
-
}, [be.value ? {
|
|
2542
|
-
name: "default",
|
|
2543
|
-
fn: H(() => [ge.value ? (A(), p("div", pr, [
|
|
2544
|
-
P(t.$slots, "buttonBefore", {}, void 0, !0),
|
|
2545
|
-
P(t.$slots, "content", {}, () => [_(J, {
|
|
2546
|
-
type: "primary",
|
|
2547
|
-
disabled: ye.value
|
|
2548
|
-
}, {
|
|
2549
|
-
default: H(() => [g(F(e.btnText), 1)]),
|
|
2550
|
-
_: 1
|
|
2551
|
-
}, 8, ["disabled"])], !0),
|
|
2552
|
-
_(Yn, {
|
|
2553
|
-
"template-code": e.templateCode,
|
|
2554
|
-
"template-btn-text": e.templateBtnText,
|
|
2555
|
-
"tip-type": e.tipType,
|
|
2556
|
-
"tip-text": Se.value,
|
|
2557
|
-
onDownloadTemplate: q
|
|
2558
|
-
}, null, 8, [
|
|
2559
|
-
"template-code",
|
|
2560
|
-
"template-btn-text",
|
|
2561
|
-
"tip-type",
|
|
2562
|
-
"tip-text"
|
|
2563
|
-
]),
|
|
2564
|
-
P(t.$slots, "buttonAfter", {}, void 0, !0)
|
|
2565
|
-
])) : P(t.$slots, "content", {}, () => [m("div", mr, [_(R(Ce), { class: "k-upload__plus" }, {
|
|
2566
|
-
default: H(() => [_(R(Je))]),
|
|
2567
|
-
_: 1
|
|
2568
|
-
}), e.tipType === "text" && W.value ? (A(), p("span", {
|
|
2569
|
-
key: 0,
|
|
2570
|
-
class: "picture-card-tips",
|
|
2571
|
-
innerHTML: W.value
|
|
2572
|
-
}, null, 8, hr)) : f("", !0)])], !0, 1)]),
|
|
2573
|
-
key: "0"
|
|
2574
|
-
} : void 0, he.value ? {
|
|
2575
|
-
name: "file",
|
|
2576
|
-
fn: H(({ file: n }) => [P(t.$slots, "file", { file: n }, () => [_(Kn, {
|
|
2577
|
-
file: n,
|
|
2578
|
-
"list-type": w.value,
|
|
2579
|
-
disabled: e.disabled,
|
|
2580
|
-
onZoom: Ie,
|
|
2581
|
-
onDownload: G,
|
|
2582
|
-
onRemove: Le,
|
|
2583
|
-
onPlay: Re
|
|
2584
|
-
}, h({ _: 2 }, [t.$slots.preview ? {
|
|
2585
|
-
name: "preview",
|
|
2586
|
-
fn: H((e) => [P(t.$slots, "preview", te(b(e)), void 0, !0)]),
|
|
2587
|
-
key: "0"
|
|
2588
|
-
} : void 0]), 1032, [
|
|
2589
|
-
"file",
|
|
2590
|
-
"list-type",
|
|
2591
|
-
"disabled"
|
|
2592
|
-
])], !0)]),
|
|
2593
|
-
key: "1"
|
|
2594
|
-
} : void 0]), 1040, [
|
|
2595
|
-
"file-list",
|
|
2596
|
-
"action",
|
|
2597
|
-
"list-type",
|
|
2598
|
-
"accept",
|
|
2599
|
-
"limit",
|
|
2600
|
-
"disabled",
|
|
2601
|
-
"auto-upload",
|
|
2602
|
-
"http-request"
|
|
2603
|
-
]),
|
|
2604
|
-
e.openCutter ? (A(), d(R(r), {
|
|
2605
|
-
key: 0,
|
|
2606
|
-
ref_key: "cutterRef",
|
|
2607
|
-
ref: y,
|
|
2608
|
-
option: e.cutterOption,
|
|
2609
|
-
onCut: ze
|
|
2610
|
-
}, null, 8, ["option"])) : f("", !0),
|
|
2611
|
-
R(oe) ? (A(), d(R(we), {
|
|
2612
|
-
key: 1,
|
|
2613
|
-
"url-list": R(se),
|
|
2614
|
-
"initial-index": R(I),
|
|
2615
|
-
onClose: R(ce)
|
|
2616
|
-
}, null, 8, [
|
|
2617
|
-
"url-list",
|
|
2618
|
-
"initial-index",
|
|
2619
|
-
"onClose"
|
|
2620
|
-
])) : f("", !0),
|
|
2621
|
-
_($n, {
|
|
2622
|
-
visible: R(le),
|
|
2623
|
-
"onUpdate:visible": n[0] ||= (e) => ee(le) ? le.value = e : null,
|
|
2624
|
-
url: R(z),
|
|
2625
|
-
type: R(ue)
|
|
2626
|
-
}, null, 8, [
|
|
2627
|
-
"visible",
|
|
2628
|
-
"url",
|
|
2629
|
-
"type"
|
|
2630
|
-
])
|
|
2631
|
-
], 2));
|
|
2632
|
-
}
|
|
2633
|
-
}), [["__scopeId", "data-v-b075bf5b"]]), _r = /* @__PURE__ */ y({
|
|
2634
|
-
name: "KFormUpload",
|
|
2635
|
-
inheritAttrs: !1,
|
|
2636
|
-
__name: "Upload",
|
|
2637
|
-
props: {
|
|
2638
|
-
modelValue: {},
|
|
2639
|
-
options: {},
|
|
2640
|
-
readonly: { type: Boolean },
|
|
2641
|
-
disabled: { type: Boolean },
|
|
2642
|
-
listType: { default: "text" },
|
|
2643
|
-
action: { default: "" },
|
|
2644
|
-
limit: { default: 1 },
|
|
2645
|
-
maxSize: { default: 10 },
|
|
2646
|
-
btnText: { default: "点击上传" },
|
|
2647
|
-
templateCode: { default: "" },
|
|
2648
|
-
templateDownloadUrl: { default: "" },
|
|
2649
|
-
templateBtnText: { default: "模版下载" },
|
|
2650
|
-
fileTips: { default: "" },
|
|
2651
|
-
showSuccMessage: {
|
|
2652
|
-
type: Boolean,
|
|
2653
|
-
default: !0
|
|
2654
|
-
}
|
|
2655
|
-
},
|
|
2656
|
-
emits: ["update:modelValue"],
|
|
2657
|
-
setup(e, { emit: t }) {
|
|
2658
|
-
let n = e, r = t, i = u(() => Array.isArray(n.modelValue) ? n.modelValue : []);
|
|
2659
|
-
function a(e) {
|
|
2660
|
-
r("update:modelValue", e);
|
|
2661
|
-
}
|
|
2662
|
-
return (e, t) => (A(), d(gr, T(e.$attrs, {
|
|
2663
|
-
"model-value": i.value,
|
|
2664
|
-
"list-type": n.listType,
|
|
2665
|
-
action: n.action,
|
|
2666
|
-
limit: n.limit,
|
|
2667
|
-
"max-size": n.maxSize,
|
|
2668
|
-
disabled: n.disabled === !0 || n.readonly === !0,
|
|
2669
|
-
"btn-text": n.btnText,
|
|
2670
|
-
"template-code": n.templateCode,
|
|
2671
|
-
"template-download-url": n.templateDownloadUrl,
|
|
2672
|
-
"template-btn-text": n.templateBtnText,
|
|
2673
|
-
"file-tips": n.fileTips,
|
|
2674
|
-
"show-succ-message": n.showSuccMessage,
|
|
2675
|
-
"onUpdate:modelValue": a
|
|
2676
|
-
}), null, 16, [
|
|
2677
|
-
"model-value",
|
|
2678
|
-
"list-type",
|
|
2679
|
-
"action",
|
|
2680
|
-
"limit",
|
|
2681
|
-
"max-size",
|
|
2682
|
-
"disabled",
|
|
2683
|
-
"btn-text",
|
|
2684
|
-
"template-code",
|
|
2685
|
-
"template-download-url",
|
|
2686
|
-
"template-btn-text",
|
|
2687
|
-
"file-tips",
|
|
2688
|
-
"show-succ-message"
|
|
2689
|
-
]));
|
|
2690
|
-
}
|
|
2691
|
-
}), vr = v(() => import("./Editor-CNxCYFmc.js")), yr = {
|
|
2692
|
-
Input: Q,
|
|
2693
|
-
Text: Mn,
|
|
2694
|
-
Select: rn,
|
|
2695
|
-
SelectMultiple: On,
|
|
2696
|
-
DatePicker: Jt,
|
|
2697
|
-
Radio: _n,
|
|
2698
|
-
Checkbox: Wt,
|
|
2699
|
-
InputNumber: mn,
|
|
2700
|
-
KInputNumber: mn,
|
|
2701
|
-
Cascader: Vt,
|
|
2702
|
-
TreeSelect: Hn,
|
|
2703
|
-
InputMixInput: tn,
|
|
2704
|
-
InputMixSelect: ln,
|
|
2705
|
-
RadioInput: Cn,
|
|
2706
|
-
Complex: v(() => import("./Complex-3sfdJKzA.js")),
|
|
2707
|
-
ScrollSelect: Tn,
|
|
2708
|
-
Upload: _r,
|
|
2709
|
-
Tag: An,
|
|
2710
|
-
TimePicker: zn,
|
|
2711
|
-
Editor: vr
|
|
2712
|
-
};
|
|
2713
|
-
function br(e) {
|
|
2714
|
-
return yr[e] ?? Yt;
|
|
2715
|
-
}
|
|
2716
|
-
function xr(e) {
|
|
2717
|
-
Object.assign(yr, e);
|
|
2718
|
-
}
|
|
2719
|
-
//#endregion
|
|
2720
|
-
//#region src/components/k-form/utils/resolveFormFieldComponent.ts
|
|
2721
|
-
function Sr(e) {
|
|
2722
|
-
return typeof e == "string";
|
|
2723
|
-
}
|
|
2724
|
-
function Cr(e) {
|
|
2725
|
-
return typeof e == "object" || typeof e == "function";
|
|
2726
|
-
}
|
|
2727
|
-
function wr(e) {
|
|
2728
|
-
return Cr(e) ? e : br(e);
|
|
2729
|
-
}
|
|
2730
|
-
//#endregion
|
|
2731
|
-
//#region src/components/k-form/KFormField.vue
|
|
2732
|
-
var Tr = /* @__PURE__ */ y({
|
|
2733
|
-
name: "KFormField",
|
|
2734
|
-
__name: "KFormField",
|
|
2735
|
-
props: {
|
|
2736
|
-
item: {},
|
|
2737
|
-
modelValue: {},
|
|
2738
|
-
options: {},
|
|
2739
|
-
readonly: { type: Boolean },
|
|
2740
|
-
disabled: { type: Boolean }
|
|
2741
|
-
},
|
|
2742
|
-
emits: ["update:modelValue"],
|
|
2743
|
-
setup(e, { emit: t }) {
|
|
2744
|
-
let n = e, r = t, i = u(() => wr(n.item.component)), a = u(() => Sr(n.item.component) ? n.item.component : ""), o = u(() => {
|
|
2745
|
-
let e = { ...n.item.componentProps ?? {} };
|
|
2746
|
-
return delete e.value, delete e.onChange, delete e.style, delete e.readonly, delete e.disabled, [
|
|
2747
|
-
"Complex",
|
|
2748
|
-
"ScrollSelect",
|
|
2749
|
-
"Cascader"
|
|
2750
|
-
].includes(a.value) || delete e.options, {
|
|
2751
|
-
...e,
|
|
2752
|
-
componentType: a.value
|
|
2753
|
-
};
|
|
2754
|
-
}), s = u(() => {
|
|
2755
|
-
if (![
|
|
2756
|
-
"Complex",
|
|
2757
|
-
"ScrollSelect",
|
|
2758
|
-
"Cascader"
|
|
2759
|
-
].includes(a.value)) return n.options;
|
|
2760
|
-
});
|
|
2761
|
-
function c(e) {
|
|
2762
|
-
r("update:modelValue", e);
|
|
2763
|
-
}
|
|
2764
|
-
return (t, n) => (A(), d(oe(i.value), T({
|
|
2765
|
-
"model-value": e.modelValue,
|
|
2766
|
-
options: s.value,
|
|
2767
|
-
readonly: e.readonly,
|
|
2768
|
-
disabled: e.disabled
|
|
2769
|
-
}, o.value, { "onUpdate:modelValue": c }), null, 16, [
|
|
2770
|
-
"model-value",
|
|
2771
|
-
"options",
|
|
2772
|
-
"readonly",
|
|
2773
|
-
"disabled"
|
|
2774
|
-
]));
|
|
2775
|
-
}
|
|
2776
|
-
}), Er = ["innerHTML"], Dr = /* @__PURE__ */ y({
|
|
2777
|
-
name: "KForm",
|
|
2778
|
-
inheritAttrs: !1,
|
|
2779
|
-
__name: "KForm",
|
|
2780
|
-
props: {
|
|
2781
|
-
formConfigs: {},
|
|
2782
|
-
colLength: { default: 2 },
|
|
2783
|
-
inline: {
|
|
2784
|
-
type: Boolean,
|
|
2785
|
-
default: !1
|
|
2786
|
-
},
|
|
2787
|
-
labelWidth: { default: void 0 },
|
|
2788
|
-
autoLayout: {
|
|
2789
|
-
type: Boolean,
|
|
2790
|
-
default: !1
|
|
2791
|
-
},
|
|
2792
|
-
hideLabel: {
|
|
2793
|
-
type: Boolean,
|
|
2794
|
-
default: !1
|
|
2795
|
-
},
|
|
2796
|
-
labelPosition: { default: "right" },
|
|
2797
|
-
modelValue: { default: void 0 },
|
|
2798
|
-
data: { default: () => ({}) },
|
|
2799
|
-
ignoreValidate: {
|
|
2800
|
-
type: Boolean,
|
|
2801
|
-
default: !1
|
|
2802
|
-
},
|
|
2803
|
-
readonly: {
|
|
2804
|
-
type: Boolean,
|
|
2805
|
-
default: !1
|
|
2806
|
-
}
|
|
2807
|
-
},
|
|
2808
|
-
emits: ["update:modelValue", "change"],
|
|
2809
|
-
setup(e, { expose: t, emit: n }) {
|
|
2810
|
-
let r = z(), i = e, a = n, o = ce(), s = M(), l = M({});
|
|
2811
|
-
j(Et, l);
|
|
2812
|
-
function f(e) {
|
|
2813
|
-
if (e == null || e === "") return;
|
|
2814
|
-
if (e instanceof Date) return Number.isNaN(e.getTime()) ? void 0 : e;
|
|
2815
|
-
if (Array.isArray(e)) {
|
|
2816
|
-
let t = e[0];
|
|
2817
|
-
return t ? f(t) : void 0;
|
|
2818
|
-
}
|
|
2819
|
-
let t = K(e);
|
|
2820
|
-
return t.isValid() ? t.toDate() : void 0;
|
|
2821
|
-
}
|
|
2822
|
-
function v(e, t) {
|
|
2823
|
-
l.value = {
|
|
2824
|
-
...l.value,
|
|
2825
|
-
[`kitDate-${e}`]: f(t)
|
|
2826
|
-
};
|
|
2827
|
-
}
|
|
2828
|
-
function y(e) {
|
|
2829
|
-
return Sr(e.component) && e.component === "DatePicker";
|
|
2830
|
-
}
|
|
2831
|
-
let b = u(() => ({
|
|
2832
|
-
colLength: i.colLength,
|
|
2833
|
-
inline: i.inline,
|
|
2834
|
-
labelWidth: x.value,
|
|
2835
|
-
labelPosition: i.labelPosition,
|
|
2836
|
-
autoLayout: i.autoLayout,
|
|
2837
|
-
hideLabel: i.hideLabel
|
|
2838
|
-
})), x = u(() => i.labelWidth ? i.labelWidth : i.autoLayout ? "120px" : "110px"), S = u(() => ({
|
|
2839
|
-
"k-form--inline-layout": i.inline,
|
|
2840
|
-
"k-form--query-layout": i.autoLayout,
|
|
2841
|
-
"k-form--grid-layout": !i.autoLayout && !i.inline
|
|
2842
|
-
})), ee = u(() => ({ "--k-form-cols": String(i.colLength) })), C = u(() => i.modelValue !== void 0), w = Tt({
|
|
2843
|
-
formConfigs: I(i, "formConfigs"),
|
|
2844
|
-
data: I(i, "data"),
|
|
2845
|
-
modelValue: I(i, "modelValue"),
|
|
2846
|
-
controlled: C,
|
|
2847
|
-
onChange: (e) => {
|
|
2848
|
-
a("change", e), C.value && a("update:modelValue", e);
|
|
2849
|
-
}
|
|
2850
|
-
});
|
|
2851
|
-
function te() {
|
|
2852
|
-
let e = {};
|
|
2853
|
-
i.formConfigs.forEach((t) => {
|
|
2854
|
-
y(t) && (e[`kitDate-${t.id}`] = f(w.formModel[t.id]));
|
|
2855
|
-
}), l.value = e;
|
|
2856
|
-
}
|
|
2857
|
-
let { normalizedConfigs: k, getFieldOptions: ne, resolveItemRules: re, itemStyle: ie, itemDisplay: ae, isItemReadonly: oe, isItemDisabled: se } = yt({
|
|
2858
|
-
formConfigs: I(i, "formConfigs"),
|
|
2859
|
-
layout: b,
|
|
2860
|
-
formReadonly: I(i, "readonly")
|
|
2861
|
-
});
|
|
2862
|
-
V(() => i.formConfigs, () => te(), {
|
|
2863
|
-
immediate: !0,
|
|
2864
|
-
deep: !0
|
|
2865
|
-
}), V(() => w.formModel, () => te(), { deep: !0 });
|
|
2866
|
-
function L(e) {
|
|
2867
|
-
let t = ae(e);
|
|
2868
|
-
return {
|
|
2869
|
-
...ie(e),
|
|
2870
|
-
...t ? { display: t } : {}
|
|
2871
|
-
};
|
|
2872
|
-
}
|
|
2873
|
-
let le = u(() => {
|
|
2874
|
-
let e = { ...o };
|
|
2875
|
-
return delete e.readonly, {
|
|
2876
|
-
inline: i.inline && !i.autoLayout,
|
|
2877
|
-
labelWidth: x.value,
|
|
2878
|
-
labelPosition: i.labelPosition ?? "right",
|
|
2879
|
-
...e
|
|
2880
|
-
};
|
|
2881
|
-
});
|
|
2882
|
-
function B(e, t) {
|
|
2883
|
-
w.updateFieldValue(e, t), y(e) && v(e.id, t), ue(e);
|
|
2884
|
-
}
|
|
2885
|
-
function ue(e) {
|
|
2886
|
-
if (!s.value) return;
|
|
2887
|
-
let t = e.validatePeers ?? [], n = re(e).length > 0;
|
|
2888
|
-
!n && !t.length || E(() => {
|
|
2889
|
-
n && s.value?.validateField(e.id).catch(() => {});
|
|
2890
|
-
for (let e of t) s.value?.validateField(e).catch(() => {});
|
|
2891
|
-
});
|
|
2892
|
-
}
|
|
2893
|
-
async function de() {
|
|
2894
|
-
let e = w.getVisibleFieldsValue();
|
|
2895
|
-
if (!s.value) return e;
|
|
2896
|
-
try {
|
|
2897
|
-
return await s.value.validate() === !1 ? i.ignoreValidate ? (s.value.clearValidate(), e) : (pe(), null) : e;
|
|
2898
|
-
} catch {
|
|
2899
|
-
return i.ignoreValidate ? (s.value.clearValidate(), e) : (pe(), null);
|
|
2900
|
-
}
|
|
2901
|
-
}
|
|
2902
|
-
function pe() {
|
|
2903
|
-
((s.value?.$el)?.querySelector(".el-form-item.is-error") ?? document.querySelector(".k-form .el-form-item.is-error"))?.scrollIntoView({
|
|
2904
|
-
block: "center",
|
|
2905
|
-
behavior: "smooth"
|
|
2906
|
-
});
|
|
2907
|
-
}
|
|
2908
|
-
function me(e) {
|
|
2909
|
-
return w.getFieldsValue(e);
|
|
2910
|
-
}
|
|
2911
|
-
function he() {
|
|
2912
|
-
return w.getVisibleFieldsValue();
|
|
2913
|
-
}
|
|
2914
|
-
function U(e) {
|
|
2915
|
-
w.setFieldsValue(e);
|
|
2916
|
-
}
|
|
2917
|
-
function ge() {
|
|
2918
|
-
s.value?.resetFields(), w.resetFormModel();
|
|
2919
|
-
}
|
|
2920
|
-
function _e(e) {
|
|
2921
|
-
w.resetFieldsValue(e), e.forEach((e) => s.value?.clearValidate(e));
|
|
2922
|
-
}
|
|
2923
|
-
function ve() {
|
|
2924
|
-
s.value?.clearValidate();
|
|
2925
|
-
}
|
|
2926
|
-
function ye() {
|
|
2927
|
-
return s.value;
|
|
2928
|
-
}
|
|
2929
|
-
return t({
|
|
2930
|
-
validateFields: de,
|
|
2931
|
-
getFieldsValue: me,
|
|
2932
|
-
getParams: he,
|
|
2933
|
-
setFieldsValue: U,
|
|
2934
|
-
resetForm: ge,
|
|
2935
|
-
resetFieldsValue: _e,
|
|
2936
|
-
getFormRef: ye,
|
|
2937
|
-
clearValidate: ve
|
|
2938
|
-
}), (e, t) => (A(), d(R(W), T({
|
|
2939
|
-
ref_key: "formRef",
|
|
2940
|
-
ref: s,
|
|
2941
|
-
class: ["k-form", S.value],
|
|
2942
|
-
style: ee.value,
|
|
2943
|
-
model: R(w).formModel
|
|
2944
|
-
}, le.value, { onSubmit: t[0] ||= fe(() => {}, ["prevent"]) }), {
|
|
2945
|
-
default: H(() => [(A(!0), p(c, null, N(R(k), (n) => (A(), d(R(Se), {
|
|
2946
|
-
key: n.id,
|
|
2947
|
-
"data-label": n.label || "",
|
|
2948
|
-
"data-field-id": n.id,
|
|
2949
|
-
label: n.label ? `${n.label}:` : void 0,
|
|
2950
|
-
prop: n.id,
|
|
2951
|
-
rules: R(re)(n),
|
|
2952
|
-
class: D(["k-form__item", [n.class, {
|
|
2953
|
-
"k-form__item--readonly": R(oe)(n),
|
|
2954
|
-
"k-form__item--disabled": R(se)(n),
|
|
2955
|
-
"k-form__item--full-row": n.newLineStart,
|
|
2956
|
-
"k-form__item--choice": R(Sr)(n.component) && (n.component === "Radio" || n.component === "Checkbox" || n.component === "Tag")
|
|
2957
|
-
}]]),
|
|
2958
|
-
style: O(L(n))
|
|
2959
|
-
}, h({
|
|
2960
|
-
default: H(() => [!n.slot || !R(r)[n.id] ? (A(), d(Tr, {
|
|
2961
|
-
key: 0,
|
|
2962
|
-
item: n,
|
|
2963
|
-
"model-value": R(w).formModel[n.id],
|
|
2964
|
-
options: R(ne)(n),
|
|
2965
|
-
readonly: R(oe)(n),
|
|
2966
|
-
disabled: R(se)(n),
|
|
2967
|
-
"onUpdate:modelValue": (e) => B(n, e)
|
|
2968
|
-
}, null, 8, [
|
|
2969
|
-
"item",
|
|
2970
|
-
"model-value",
|
|
2971
|
-
"options",
|
|
2972
|
-
"readonly",
|
|
2973
|
-
"disabled",
|
|
2974
|
-
"onUpdate:modelValue"
|
|
2975
|
-
])) : P(e.$slots, n.id, {
|
|
2976
|
-
item: n,
|
|
2977
|
-
value: R(w).formModel[n.id],
|
|
2978
|
-
updateValue: (e) => B(n, e)
|
|
2979
|
-
}, void 0, void 0, 1)]),
|
|
2980
|
-
_: 2
|
|
2981
|
-
}, [n.toolTip ? {
|
|
2982
|
-
name: "label",
|
|
2983
|
-
fn: H(() => [_(R(ze), {
|
|
2984
|
-
effect: "dark",
|
|
2985
|
-
placement: "bottom",
|
|
2986
|
-
"popper-class": "k-form__tooltip"
|
|
2987
|
-
}, {
|
|
2988
|
-
content: H(() => [m("span", { innerHTML: n.toolTip }, null, 8, Er)]),
|
|
2989
|
-
default: H(() => [t[1] ||= m("span", {
|
|
2990
|
-
class: "k-form__tip-icon",
|
|
2991
|
-
"aria-hidden": "true"
|
|
2992
|
-
}, "i", -1)]),
|
|
2993
|
-
_: 2
|
|
2994
|
-
}, 1024), g(" " + F(n.label ? `${n.label}:` : ""), 1)]),
|
|
2995
|
-
key: "0"
|
|
2996
|
-
} : void 0]), 1032, [
|
|
2997
|
-
"data-label",
|
|
2998
|
-
"data-field-id",
|
|
2999
|
-
"label",
|
|
3000
|
-
"prop",
|
|
3001
|
-
"rules",
|
|
3002
|
-
"class",
|
|
3003
|
-
"style"
|
|
3004
|
-
]))), 128)), P(e.$slots, "default")]),
|
|
3005
|
-
_: 3
|
|
3006
|
-
}, 16, [
|
|
3007
|
-
"class",
|
|
3008
|
-
"style",
|
|
3009
|
-
"model"
|
|
3010
|
-
]));
|
|
3011
|
-
}
|
|
3012
|
-
});
|
|
3013
|
-
//#endregion
|
|
3014
|
-
//#region src/components/k-form/composables/useKFormTemplateRef.ts
|
|
3015
|
-
function Or(e) {
|
|
3016
|
-
return B(e);
|
|
3017
|
-
}
|
|
3018
|
-
//#endregion
|
|
3019
|
-
//#region src/components/k-handle-page/KHandlePage.vue?vue&type=script&setup=true&lang.ts
|
|
3020
|
-
var kr = { class: "k-handle-page" }, Ar = {
|
|
3021
|
-
key: 0,
|
|
3022
|
-
class: "k-handle-page__header"
|
|
3023
|
-
}, jr = { class: "k-handle-page__body" }, Mr = {
|
|
3024
|
-
key: 0,
|
|
3025
|
-
class: "k-handle-page__loading",
|
|
3026
|
-
role: "status",
|
|
3027
|
-
"aria-live": "polite",
|
|
3028
|
-
"aria-busy": "true",
|
|
3029
|
-
"aria-label": "加载中"
|
|
3030
|
-
}, Nr = { class: "k-handle-page__loading-inner" }, Pr = {
|
|
3031
|
-
key: 1,
|
|
3032
|
-
class: "k-handle-page__footer"
|
|
3033
|
-
}, Fr = /* @__PURE__ */ y({
|
|
3034
|
-
name: "KHandlePage",
|
|
3035
|
-
inheritAttrs: !1,
|
|
3036
|
-
__name: "KHandlePage",
|
|
3037
|
-
props: {
|
|
3038
|
-
showFooter: {
|
|
3039
|
-
type: Boolean,
|
|
3040
|
-
default: !0
|
|
3041
|
-
},
|
|
3042
|
-
showSubmit: {
|
|
3043
|
-
type: Boolean,
|
|
3044
|
-
default: !0
|
|
3045
|
-
},
|
|
3046
|
-
cancelText: {
|
|
3047
|
-
type: [String, Boolean],
|
|
3048
|
-
default: "取消"
|
|
3049
|
-
},
|
|
3050
|
-
submitText: {
|
|
3051
|
-
type: [String, Boolean],
|
|
3052
|
-
default: "确定"
|
|
3053
|
-
},
|
|
3054
|
-
submitLoading: {
|
|
3055
|
-
type: Boolean,
|
|
3056
|
-
default: !1
|
|
3057
|
-
},
|
|
3058
|
-
loading: {
|
|
3059
|
-
type: Boolean,
|
|
3060
|
-
default: !1
|
|
3061
|
-
},
|
|
3062
|
-
onSubmit: {
|
|
3063
|
-
type: Function,
|
|
3064
|
-
default: void 0
|
|
3065
|
-
},
|
|
3066
|
-
gap: { default: 16 }
|
|
3067
|
-
},
|
|
3068
|
-
emits: ["cancel", "submit"],
|
|
3069
|
-
setup(e, { emit: t }) {
|
|
3070
|
-
let n = e, r = t, i = z(), a = M(!1), o = u(() => ({ gap: typeof n.gap == "number" ? `${n.gap}px` : n.gap })), s = u(() => n.cancelText === !1 ? "" : n.cancelText || "取消"), c = u(() => n.submitText === !1 ? "" : n.submitText || "确定"), h = u(() => n.cancelText !== !1), v = u(() => n.showSubmit && n.submitText !== !1), y = u(() => n.submitLoading || n.loading || a.value), b = u(() => !!i.header);
|
|
3071
|
-
async function x() {
|
|
3072
|
-
if (!y.value) {
|
|
3073
|
-
if (n.onSubmit) {
|
|
3074
|
-
a.value = !0;
|
|
3075
|
-
try {
|
|
3076
|
-
await n.onSubmit();
|
|
3077
|
-
} catch {} finally {
|
|
3078
|
-
a.value = !1;
|
|
3079
|
-
}
|
|
3080
|
-
return;
|
|
3081
|
-
}
|
|
3082
|
-
r("submit");
|
|
3083
|
-
}
|
|
3084
|
-
}
|
|
3085
|
-
return (t, n) => (A(), p("div", kr, [
|
|
3086
|
-
b.value ? (A(), p("header", Ar, [P(t.$slots, "header")])) : f("", !0),
|
|
3087
|
-
m("div", jr, [_(l, { name: "k-handle-page-loading" }, {
|
|
3088
|
-
default: H(() => [e.loading ? (A(), p("div", Mr, [m("div", Nr, [_(R(Ce), {
|
|
3089
|
-
class: "k-handle-page__loading-icon is-loading",
|
|
3090
|
-
size: 32
|
|
3091
|
-
}, {
|
|
3092
|
-
default: H(() => [_(R(qe))]),
|
|
3093
|
-
_: 1
|
|
3094
|
-
}), n[1] ||= m("span", { class: "k-handle-page__loading-text" }, "加载中...", -1)])])) : f("", !0)]),
|
|
3095
|
-
_: 1
|
|
3096
|
-
}), m("div", {
|
|
3097
|
-
class: D(["k-handle-page__content", { "k-handle-page__content--loading": e.loading }]),
|
|
3098
|
-
style: O(o.value)
|
|
3099
|
-
}, [P(t.$slots, "default")], 6)]),
|
|
3100
|
-
e.showFooter ? (A(), p("footer", Pr, [P(t.$slots, "footer", {}, () => [h.value ? (A(), d(J, {
|
|
3101
|
-
key: 0,
|
|
3102
|
-
onClick: n[0] ||= (e) => r("cancel")
|
|
3103
|
-
}, {
|
|
3104
|
-
default: H(() => [g(F(s.value), 1)]),
|
|
3105
|
-
_: 1
|
|
3106
|
-
})) : f("", !0), v.value ? (A(), d(J, {
|
|
3107
|
-
key: 1,
|
|
3108
|
-
type: "primary",
|
|
3109
|
-
loading: y.value,
|
|
3110
|
-
onClick: x
|
|
3111
|
-
}, {
|
|
3112
|
-
default: H(() => [g(F(c.value), 1)]),
|
|
3113
|
-
_: 1
|
|
3114
|
-
}, 8, ["loading"])) : f("", !0)])])) : f("", !0)
|
|
3115
|
-
]));
|
|
3116
|
-
}
|
|
3117
|
-
});
|
|
3118
|
-
//#endregion
|
|
3119
|
-
//#region src/components/k-handle-page/useHandlePageInit.ts
|
|
3120
|
-
function Ir(e, t) {
|
|
3121
|
-
let n = M(!1);
|
|
3122
|
-
async function r() {
|
|
3123
|
-
(L(t?.skipLoading) ?? !1) || (n.value = !0);
|
|
3124
|
-
try {
|
|
3125
|
-
await e();
|
|
3126
|
-
} finally {
|
|
3127
|
-
n.value = !1;
|
|
3128
|
-
}
|
|
3129
|
-
}
|
|
3130
|
-
return t?.immediate !== !1 && ne(() => {
|
|
3131
|
-
r();
|
|
3132
|
-
}), {
|
|
3133
|
-
pageLoading: n,
|
|
3134
|
-
runInit: r
|
|
3135
|
-
};
|
|
3136
|
-
}
|
|
3137
|
-
//#endregion
|
|
3138
|
-
//#region src/components/k-icon/resolveLucideIcon.ts
|
|
3139
|
-
var Lr = /* @__PURE__ */ new Map();
|
|
3140
|
-
function Rr(e) {
|
|
3141
|
-
return e.split("-").filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
|
|
3142
|
-
}
|
|
3143
|
-
function zr(e) {
|
|
3144
|
-
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").toLowerCase();
|
|
3145
|
-
}
|
|
3146
|
-
function Br(e) {
|
|
3147
|
-
if (!e || e === "#") return nt(e);
|
|
3148
|
-
let t = e.trim();
|
|
3149
|
-
if (Lr.has(t)) return Lr.get(t) ?? nt(e);
|
|
3150
|
-
let n = Ze[Rr(t)], r = typeof n == "function" ? n : null;
|
|
3151
|
-
return Lr.set(t, r), r ?? nt(e);
|
|
3152
|
-
}
|
|
3153
|
-
var Vr = /* @__PURE__ */ new Set(["createLucideIcon"]), Hr = null;
|
|
3154
|
-
function Ur() {
|
|
3155
|
-
if (Hr) return Hr;
|
|
3156
|
-
let e = /* @__PURE__ */ new Set(), t = [];
|
|
3157
|
-
for (let [n, r] of Object.entries(Ze)) Vr.has(n) || n.endsWith("Icon") || typeof r == "function" && (e.has(r) || (e.add(r), t.push(zr(n))));
|
|
3158
|
-
return Hr = t.sort((e, t) => e.localeCompare(t)), Hr;
|
|
3159
|
-
}
|
|
3160
|
-
//#endregion
|
|
3161
|
-
//#region src/components/k-icon/KIcon.vue
|
|
3162
|
-
var Wr = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
3163
|
-
name: "KIcon",
|
|
3164
|
-
__name: "KIcon",
|
|
3165
|
-
props: {
|
|
3166
|
-
name: { default: "" },
|
|
3167
|
-
size: { default: 18 },
|
|
3168
|
-
strokeWidth: { default: 2 }
|
|
3169
|
-
},
|
|
3170
|
-
setup(e) {
|
|
3171
|
-
let t = e, n = u(() => Br(t.name));
|
|
3172
|
-
return (t, r) => n.value ? (A(), d(oe(n.value), {
|
|
3173
|
-
key: 0,
|
|
3174
|
-
class: "k-icon",
|
|
3175
|
-
size: e.size,
|
|
3176
|
-
"stroke-width": e.strokeWidth
|
|
3177
|
-
}, null, 8, ["size", "stroke-width"])) : f("", !0);
|
|
3178
|
-
}
|
|
3179
|
-
}), [["__scopeId", "data-v-6fd081ab"]]), Gr = { class: "k-link-button__item" }, Kr = {
|
|
3180
|
-
key: 0,
|
|
3181
|
-
class: "k-link-button__divider"
|
|
3182
|
-
}, qr = ["onClick"], Jr = /* @__PURE__ */ y({
|
|
3183
|
-
name: "KLinkButton",
|
|
3184
|
-
__name: "KLinkButton",
|
|
3185
|
-
props: {
|
|
3186
|
-
data: { default: () => [] },
|
|
3187
|
-
disabled: {
|
|
3188
|
-
type: Boolean,
|
|
3189
|
-
default: !1
|
|
3190
|
-
},
|
|
3191
|
-
align: { default: "center" },
|
|
3192
|
-
tableMode: {
|
|
3193
|
-
type: Boolean,
|
|
3194
|
-
default: !1
|
|
3195
|
-
}
|
|
3196
|
-
},
|
|
3197
|
-
emits: ["click"],
|
|
3198
|
-
setup(e, { emit: t }) {
|
|
3199
|
-
let n = e, r = t, i = u(() => n.data.filter((e) => e.isDisplay !== !1));
|
|
3200
|
-
function a(e) {
|
|
3201
|
-
return n.disabled && e.label !== "查看";
|
|
3202
|
-
}
|
|
3203
|
-
function o(e) {
|
|
3204
|
-
return e.style ? `k-link-button__btn--${e.style}` : "";
|
|
3205
|
-
}
|
|
3206
|
-
function s(e, t) {
|
|
3207
|
-
a(e) || (r("click", e, t), !n.tableMode && e.onClick && e.onClick({}, t));
|
|
3208
|
-
}
|
|
3209
|
-
function l(e) {
|
|
3210
|
-
return !!e.slot;
|
|
3211
|
-
}
|
|
3212
|
-
function h(e) {
|
|
3213
|
-
return typeof e.slot == "string" ? e.slot : "default";
|
|
3214
|
-
}
|
|
3215
|
-
return (t, n) => (A(), p("div", {
|
|
3216
|
-
class: "k-link-button",
|
|
3217
|
-
style: O({ justifyContent: e.align })
|
|
3218
|
-
}, [(A(!0), p(c, null, N(i.value, (e, n) => (A(), d(R(ze), {
|
|
3219
|
-
key: `${e.label}-${n}`,
|
|
3220
|
-
content: e.tooltip,
|
|
3221
|
-
placement: "top",
|
|
3222
|
-
disabled: !e.tooltip
|
|
3223
|
-
}, {
|
|
3224
|
-
default: H(() => [m("div", Gr, [n > 0 ? (A(), p("span", Kr)) : f("", !0), m("a", {
|
|
3225
|
-
class: D(["k-link-button__btn", [o(e), { "k-link-button__btn--readonly": a(e) }]]),
|
|
3226
|
-
onClick: fe((t) => s(e, n), ["prevent"])
|
|
3227
|
-
}, [l(e) ? P(t.$slots, h(e), { item: e }, () => [g(F(e.label), 1)], void 0, 0) : (A(), p(c, { key: 1 }, [g(F(e.label), 1)], 64))], 10, qr)])]),
|
|
3228
|
-
_: 2
|
|
3229
|
-
}, 1032, ["content", "disabled"]))), 128))], 4));
|
|
3230
|
-
}
|
|
3231
|
-
}), Yr = /* @__PURE__ */ y({
|
|
3232
|
-
name: "KPagination",
|
|
3233
|
-
__name: "KPagination",
|
|
3234
|
-
props: {
|
|
3235
|
-
layout: { default: "total, sizes, prev, pager, next, jumper" },
|
|
3236
|
-
pageSize: { default: 10 },
|
|
3237
|
-
pageSizes: { default: () => [
|
|
3238
|
-
10,
|
|
3239
|
-
20,
|
|
3240
|
-
30,
|
|
3241
|
-
40,
|
|
3242
|
-
50,
|
|
3243
|
-
60,
|
|
3244
|
-
70,
|
|
3245
|
-
80,
|
|
3246
|
-
90,
|
|
3247
|
-
100
|
|
3248
|
-
] }
|
|
3249
|
-
},
|
|
3250
|
-
setup(e) {
|
|
3251
|
-
return (t, n) => (A(), d(R(ke), T(t.$attrs, {
|
|
3252
|
-
layout: e.layout,
|
|
3253
|
-
"page-size": e.pageSize,
|
|
3254
|
-
"page-sizes": e.pageSizes
|
|
3255
|
-
}), null, 16, [
|
|
3256
|
-
"layout",
|
|
3257
|
-
"page-size",
|
|
3258
|
-
"page-sizes"
|
|
3259
|
-
]));
|
|
3260
|
-
}
|
|
3261
|
-
}), Xr = ["id"], Zr = { class: "k-long-page-panel__title" }, Qr = { class: "k-long-page-panel__content" }, $r = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
3262
|
-
name: "KLongPagePanel",
|
|
3263
|
-
__name: "KLongPagePanel",
|
|
3264
|
-
props: {
|
|
3265
|
-
panelId: { default: "" },
|
|
3266
|
-
title: { default: "" }
|
|
3267
|
-
},
|
|
3268
|
-
setup(e) {
|
|
3269
|
-
return (t, n) => (A(), p("div", {
|
|
3270
|
-
id: e.panelId || void 0,
|
|
3271
|
-
class: "k-long-page-panel"
|
|
3272
|
-
}, [m("div", Zr, F(e.title), 1), m("div", Qr, [P(t.$slots, "default", {}, void 0, !0)])], 8, Xr));
|
|
3273
|
-
}
|
|
3274
|
-
}), [["__scopeId", "data-v-9d6e7832"]]), ei = 4;
|
|
3275
|
-
function ti(e) {
|
|
3276
|
-
let t = 0, n = 0, r = !1, i = !1, a = null;
|
|
3277
|
-
function o(o) {
|
|
3278
|
-
if (!r || !e.value || o.pointerId !== a) return;
|
|
3279
|
-
let s = o.clientY - t;
|
|
3280
|
-
if (!i && Math.abs(s) < ei) return;
|
|
3281
|
-
i = !0, o.preventDefault();
|
|
3282
|
-
let c = Math.min(Math.max(n + s, 0), window.innerHeight - e.value.offsetHeight);
|
|
3283
|
-
e.value.style.top = `${c}px`;
|
|
3284
|
-
}
|
|
3285
|
-
function s() {
|
|
3286
|
-
r = !1, a = null, window.removeEventListener("pointermove", o), window.removeEventListener("pointerup", c), window.removeEventListener("pointercancel", c);
|
|
3287
|
-
}
|
|
3288
|
-
function c() {
|
|
3289
|
-
s();
|
|
3290
|
-
}
|
|
3291
|
-
function l(s) {
|
|
3292
|
-
!e.value || s.button !== 0 || (r = !0, i = !1, a = s.pointerId, t = s.clientY, n = e.value.getBoundingClientRect().top, window.addEventListener("pointermove", o), window.addEventListener("pointerup", c), window.addEventListener("pointercancel", c));
|
|
3293
|
-
}
|
|
3294
|
-
function u() {
|
|
3295
|
-
return i ? (i = !1, !0) : !1;
|
|
3296
|
-
}
|
|
3297
|
-
return k(s), {
|
|
3298
|
-
onPointerDown: l,
|
|
3299
|
-
consumeClickIfDragged: u
|
|
3300
|
-
};
|
|
3301
|
-
}
|
|
3302
|
-
//#endregion
|
|
3303
|
-
//#region src/components/k-long-page/icons/icon-base.png?no-inline
|
|
3304
|
-
var ni = "" + new URL("../assets/icon-base-pYrXWQZO.png", import.meta.url).href, ri = "" + new URL("../assets/icon-base-2-CcPa4bmO.png", import.meta.url).href, ii = "" + new URL("../assets/icon-notice-DNvEYor3.png", import.meta.url).href, ai = "" + new URL("../assets/icon-notice-2-JVyxpYo9.png", import.meta.url).href, oi = "" + new URL("../assets/icon-price-4iIa0b5D.png", import.meta.url).href, si = "" + new URL("../assets/icon-price-2-DMmEoFbh.png", import.meta.url).href, ci = "" + new URL("../assets/icon-restrict-BWJ7LA9s.png", import.meta.url).href, li = "" + new URL("../assets/icon-restrict-2-BjWtoOXX.png", import.meta.url).href, ui = "" + new URL("../assets/icon-setup-DXpIP63L.png", import.meta.url).href, di = "" + new URL("../assets/icon-setup-2-BO6uKRX4.png", import.meta.url).href, fi = {
|
|
3305
|
-
base: [ni, ri],
|
|
3306
|
-
price: [oi, si],
|
|
3307
|
-
notice: [ii, ai],
|
|
3308
|
-
setup: [ui, di],
|
|
3309
|
-
restrict: [ci, li]
|
|
3310
|
-
};
|
|
3311
|
-
function pi(e) {
|
|
3312
|
-
return fi[e] ?? fi.base;
|
|
3313
|
-
}
|
|
3314
|
-
//#endregion
|
|
3315
|
-
//#region src/components/k-long-page/KLongPage.vue?vue&type=script&setup=true&lang.ts
|
|
3316
|
-
var mi = ["onClick"], hi = ["src", "alt"], gi = ["src", "alt"], _i = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
3317
|
-
name: "KLongPage",
|
|
3318
|
-
__name: "KLongPage",
|
|
3319
|
-
props: { panels: { default: () => [{
|
|
3320
|
-
name: "1",
|
|
3321
|
-
label: "面板一"
|
|
3322
|
-
}] } },
|
|
3323
|
-
setup(e) {
|
|
3324
|
-
let t = B("rootRef"), n = B("navRef"), { onPointerDown: r, consumeClickIfDragged: i } = ti(n);
|
|
3325
|
-
function a(e) {
|
|
3326
|
-
return pi(e);
|
|
3327
|
-
}
|
|
3328
|
-
async function o(e) {
|
|
3329
|
-
if (i()) return;
|
|
3330
|
-
await E();
|
|
3331
|
-
let n = t.value?.querySelector(`#${CSS.escape(e)}`);
|
|
3332
|
-
(n?.querySelector(".k-long-page-panel__title") ?? n)?.scrollIntoView({
|
|
3333
|
-
block: "start",
|
|
3334
|
-
behavior: "smooth"
|
|
3335
|
-
});
|
|
3336
|
-
}
|
|
3337
|
-
return (i, s) => (A(), p("div", {
|
|
3338
|
-
ref_key: "rootRef",
|
|
3339
|
-
ref: t,
|
|
3340
|
-
class: "k-long-page"
|
|
3341
|
-
}, [(A(!0), p(c, null, N(e.panels, (e) => (A(), d($r, {
|
|
3342
|
-
key: e.name,
|
|
3343
|
-
class: "k-long-page__panel",
|
|
3344
|
-
"panel-id": e.name,
|
|
3345
|
-
title: e.label
|
|
3346
|
-
}, {
|
|
3347
|
-
default: H(() => [P(i.$slots, e.name, {}, void 0, !0)]),
|
|
3348
|
-
_: 2
|
|
3349
|
-
}, 1032, ["panel-id", "title"]))), 128)), m("div", {
|
|
3350
|
-
ref_key: "navRef",
|
|
3351
|
-
ref: n,
|
|
3352
|
-
class: "k-long-page__nav",
|
|
3353
|
-
onPointerdown: s[0] ||= (...e) => R(r) && R(r)(...e)
|
|
3354
|
-
}, [(A(!0), p(c, null, N(e.panels, (e) => (A(), p("div", {
|
|
3355
|
-
key: e.name,
|
|
3356
|
-
class: "k-long-page__nav-item",
|
|
3357
|
-
role: "button",
|
|
3358
|
-
tabindex: "0",
|
|
3359
|
-
onClick: (t) => o(e.name)
|
|
3360
|
-
}, [
|
|
3361
|
-
m("img", {
|
|
3362
|
-
class: "k-long-page__nav-item-icon k-long-page__nav-item-icon--default",
|
|
3363
|
-
src: a(e.name)[0],
|
|
3364
|
-
alt: e.label,
|
|
3365
|
-
width: "28",
|
|
3366
|
-
height: "28",
|
|
3367
|
-
draggable: "false"
|
|
3368
|
-
}, null, 8, hi),
|
|
3369
|
-
m("img", {
|
|
3370
|
-
class: "k-long-page__nav-item-icon k-long-page__nav-item-icon--active",
|
|
3371
|
-
src: a(e.name)[1],
|
|
3372
|
-
alt: e.label,
|
|
3373
|
-
width: "28",
|
|
3374
|
-
height: "28",
|
|
3375
|
-
draggable: "false"
|
|
3376
|
-
}, null, 8, gi),
|
|
3377
|
-
m("span", null, F(e.label), 1)
|
|
3378
|
-
], 8, mi))), 128))], 544)], 512));
|
|
3379
|
-
}
|
|
3380
|
-
}), [["__scopeId", "data-v-ac934c5d"]]), vi = /* @__PURE__ */ y({
|
|
3381
|
-
name: "KCard",
|
|
3382
|
-
__name: "KCard",
|
|
3383
|
-
setup(e) {
|
|
3384
|
-
return (e, t) => (A(), d(R(me), te(b(e.$attrs)), h({
|
|
3385
|
-
default: H(() => [P(e.$slots, "default")]),
|
|
3386
|
-
_: 2
|
|
3387
|
-
}, [e.$slots.header ? {
|
|
3388
|
-
name: "header",
|
|
3389
|
-
fn: H(() => [P(e.$slots, "header")]),
|
|
3390
|
-
key: "0"
|
|
3391
|
-
} : void 0, e.$slots.footer ? {
|
|
3392
|
-
name: "footer",
|
|
3393
|
-
fn: H(() => [P(e.$slots, "footer")]),
|
|
3394
|
-
key: "1"
|
|
3395
|
-
} : void 0]), 1040));
|
|
3396
|
-
}
|
|
3397
|
-
}), yi = {
|
|
3398
|
-
key: 0,
|
|
3399
|
-
class: "panel-head"
|
|
3400
|
-
}, bi = { class: "panel-head_left" }, xi = { class: "panel-content" }, Si = /* @__PURE__ */ y({
|
|
3401
|
-
name: "KPanel",
|
|
3402
|
-
__name: "KPanel",
|
|
3403
|
-
props: {
|
|
3404
|
-
title: {},
|
|
3405
|
-
isFold: {
|
|
3406
|
-
type: Boolean,
|
|
3407
|
-
default: !1
|
|
3408
|
-
},
|
|
3409
|
-
unfold: {
|
|
3410
|
-
type: Boolean,
|
|
3411
|
-
default: !0
|
|
3412
|
-
},
|
|
3413
|
-
hover: {
|
|
3414
|
-
type: Boolean,
|
|
3415
|
-
default: !0
|
|
3416
|
-
}
|
|
3417
|
-
},
|
|
3418
|
-
setup(e) {
|
|
3419
|
-
let t = e, n = M(t.unfold ? ["content"] : []), r = u(() => ({
|
|
3420
|
-
panel: !0,
|
|
3421
|
-
"panel-hover": t.hover
|
|
3422
|
-
}));
|
|
3423
|
-
return (t, i) => (A(), p("div", { class: D(r.value) }, [e.isFold ? (A(), d(R(_e), {
|
|
3424
|
-
key: 0,
|
|
3425
|
-
modelValue: n.value,
|
|
3426
|
-
"onUpdate:modelValue": i[0] ||= (e) => n.value = e
|
|
3427
|
-
}, {
|
|
3428
|
-
default: H(() => [_(R(ve), {
|
|
3429
|
-
name: "content",
|
|
3430
|
-
title: e.title
|
|
3431
|
-
}, {
|
|
3432
|
-
default: H(() => [P(t.$slots, "default")]),
|
|
3433
|
-
_: 3
|
|
3434
|
-
}, 8, ["title"])]),
|
|
3435
|
-
_: 3
|
|
3436
|
-
}, 8, ["modelValue"])) : (A(), p(c, { key: 1 }, [e.title || t.$slots.title ? (A(), p("div", yi, [m("div", bi, [P(t.$slots, "title", {}, () => [g(F(e.title), 1)])])])) : f("", !0), m("div", xi, [P(t.$slots, "default")])], 64))], 2));
|
|
3437
|
-
}
|
|
3438
|
-
}), Ci = {
|
|
3439
|
-
key: 0,
|
|
3440
|
-
class: "k-panel-query__footer"
|
|
3441
|
-
}, wi = /* @__PURE__ */ y({
|
|
3442
|
-
name: "KPanelQueryActions",
|
|
3443
|
-
__name: "KPanelQueryActions",
|
|
3444
|
-
props: { footer: {
|
|
3445
|
-
type: Boolean,
|
|
3446
|
-
default: !1
|
|
3447
|
-
} },
|
|
3448
|
-
emits: ["query", "reset"],
|
|
3449
|
-
setup(e, { emit: t }) {
|
|
3450
|
-
let n = t;
|
|
3451
|
-
return (t, r) => e.footer ? (A(), p("div", Ci, [_(J, {
|
|
3452
|
-
type: "primary",
|
|
3453
|
-
onClick: r[0] ||= (e) => n("query")
|
|
3454
|
-
}, {
|
|
3455
|
-
default: H(() => [...r[4] ||= [g("查询", -1)]]),
|
|
3456
|
-
_: 1
|
|
3457
|
-
}), _(J, {
|
|
3458
|
-
class: "k-panel-query__btn-reset",
|
|
3459
|
-
onClick: r[1] ||= (e) => n("reset")
|
|
3460
|
-
}, {
|
|
3461
|
-
default: H(() => [...r[5] ||= [g("重置", -1)]]),
|
|
3462
|
-
_: 1
|
|
3463
|
-
})])) : (A(), p(c, { key: 1 }, [_(J, {
|
|
3464
|
-
type: "primary",
|
|
3465
|
-
onClick: r[2] ||= (e) => n("query")
|
|
3466
|
-
}, {
|
|
3467
|
-
default: H(() => [...r[6] ||= [g("查询", -1)]]),
|
|
3468
|
-
_: 1
|
|
3469
|
-
}), _(J, {
|
|
3470
|
-
class: "k-panel-query__btn-reset",
|
|
3471
|
-
onClick: r[3] ||= (e) => n("reset")
|
|
3472
|
-
}, {
|
|
3473
|
-
default: H(() => [...r[7] ||= [g("重置", -1)]]),
|
|
3474
|
-
_: 1
|
|
3475
|
-
})], 64));
|
|
3476
|
-
}
|
|
3477
|
-
}), Ti = /* @__PURE__ */ y({
|
|
3478
|
-
name: "KPanelQueryForm",
|
|
3479
|
-
__name: "KPanelQueryForm",
|
|
3480
|
-
props: {
|
|
3481
|
-
formConfigs: {},
|
|
3482
|
-
colLength: { default: 3 },
|
|
3483
|
-
inline: {
|
|
3484
|
-
type: Boolean,
|
|
3485
|
-
default: !0
|
|
3486
|
-
},
|
|
3487
|
-
labelWidth: { default: "120px" },
|
|
3488
|
-
labelPosition: { default: "right" },
|
|
3489
|
-
autoLayout: {
|
|
3490
|
-
type: Boolean,
|
|
3491
|
-
default: !0
|
|
3492
|
-
},
|
|
3493
|
-
hideLabel: {
|
|
3494
|
-
type: Boolean,
|
|
3495
|
-
default: !1
|
|
3496
|
-
}
|
|
3497
|
-
},
|
|
3498
|
-
setup(e, { expose: t }) {
|
|
3499
|
-
let n = M();
|
|
3500
|
-
return t({
|
|
3501
|
-
validateFields: () => n.value?.validateFields(),
|
|
3502
|
-
getParams: () => n.value?.getParams() ?? {},
|
|
3503
|
-
resetForm: () => n.value?.resetForm(),
|
|
3504
|
-
getFormRef: () => n.value?.getFormRef()
|
|
3505
|
-
}), (t, r) => (A(), d(R(Dr), {
|
|
3506
|
-
ref_key: "formRef",
|
|
3507
|
-
ref: n,
|
|
3508
|
-
class: "k-panel-query-form",
|
|
3509
|
-
"form-configs": e.formConfigs,
|
|
3510
|
-
"col-length": e.colLength,
|
|
3511
|
-
inline: e.inline,
|
|
3512
|
-
"label-width": e.labelWidth,
|
|
3513
|
-
"label-position": e.labelPosition,
|
|
3514
|
-
"auto-layout": e.autoLayout,
|
|
3515
|
-
"hide-label": e.hideLabel
|
|
3516
|
-
}, null, 8, [
|
|
3517
|
-
"form-configs",
|
|
3518
|
-
"col-length",
|
|
3519
|
-
"inline",
|
|
3520
|
-
"label-width",
|
|
3521
|
-
"label-position",
|
|
3522
|
-
"auto-layout",
|
|
3523
|
-
"hide-label"
|
|
3524
|
-
]));
|
|
3525
|
-
}
|
|
3526
|
-
}), Ei = { class: "k-items k-form" }, Di = { class: "k-items_ul" }, Oi = {
|
|
3527
|
-
key: 0,
|
|
3528
|
-
class: "k-item_label"
|
|
3529
|
-
}, ki = { class: "k-item_input" }, Ai = {
|
|
3530
|
-
key: 0,
|
|
3531
|
-
class: "k-item k-panel-query__item-actions"
|
|
3532
|
-
}, ji = /* @__PURE__ */ y({
|
|
3533
|
-
name: "KPanelQueryItem",
|
|
3534
|
-
__name: "KPanelQueryItem",
|
|
3535
|
-
props: { formConfigs: {} },
|
|
3536
|
-
setup(e, { expose: t }) {
|
|
3537
|
-
let n = e, r = z(), i = u(() => ({
|
|
3538
|
-
colLength: 1,
|
|
3539
|
-
inline: !0,
|
|
3540
|
-
autoLayout: !1,
|
|
3541
|
-
hideLabel: !1
|
|
3542
|
-
})), a = Tt({
|
|
3543
|
-
formConfigs: I(n, "formConfigs"),
|
|
3544
|
-
controlled: u(() => !1)
|
|
3545
|
-
}), { normalizedConfigs: o, getFieldOptions: s } = yt({
|
|
3546
|
-
formConfigs: I(n, "formConfigs"),
|
|
3547
|
-
layout: i
|
|
3548
|
-
});
|
|
3549
|
-
function l(e, t) {
|
|
3550
|
-
a.updateFieldValue(e, t);
|
|
3551
|
-
}
|
|
3552
|
-
async function d() {
|
|
3553
|
-
return a.getVisibleFieldsValue();
|
|
3554
|
-
}
|
|
3555
|
-
function h() {
|
|
3556
|
-
return a.getVisibleFieldsValue();
|
|
3557
|
-
}
|
|
3558
|
-
function g() {
|
|
3559
|
-
a.resetFormModel();
|
|
3560
|
-
}
|
|
3561
|
-
return t({
|
|
3562
|
-
validateFields: d,
|
|
3563
|
-
getParams: h,
|
|
3564
|
-
resetForm: g,
|
|
3565
|
-
getFormRef: () => void 0
|
|
3566
|
-
}), (e, t) => (A(), p("div", Ei, [m("ul", Di, [(A(!0), p(c, null, N(R(o), (e) => (A(), p("li", {
|
|
3567
|
-
key: e.id,
|
|
3568
|
-
class: D(["k-item", { "k-item_flex": !!e.label }])
|
|
3569
|
-
}, [e.label ? (A(), p("label", Oi, F(e.label), 1)) : f("", !0), m("div", ki, [_(Tr, {
|
|
3570
|
-
item: e,
|
|
3571
|
-
"model-value": R(a).formModel[e.id],
|
|
3572
|
-
options: R(s)(e),
|
|
3573
|
-
"onUpdate:modelValue": (t) => l(e, t)
|
|
3574
|
-
}, null, 8, [
|
|
3575
|
-
"item",
|
|
3576
|
-
"model-value",
|
|
3577
|
-
"options",
|
|
3578
|
-
"onUpdate:modelValue"
|
|
3579
|
-
])])], 2))), 128)), R(r).button ? (A(), p("li", Ai, [P(e.$slots, "button")])) : f("", !0)])]));
|
|
3580
|
-
}
|
|
3581
|
-
}), Mi = /* @__PURE__ */ y({
|
|
3582
|
-
name: "KPanelQuery",
|
|
3583
|
-
__name: "KPanelQuery",
|
|
3584
|
-
props: {
|
|
3585
|
-
title: { default: "快速查询" },
|
|
3586
|
-
showPanel: {
|
|
3587
|
-
type: Boolean,
|
|
3588
|
-
default: !0
|
|
3589
|
-
},
|
|
3590
|
-
model: { default: "form" },
|
|
3591
|
-
isFold: {
|
|
3592
|
-
type: Boolean,
|
|
3593
|
-
default: !0
|
|
3594
|
-
},
|
|
3595
|
-
unfold: {
|
|
3596
|
-
type: Boolean,
|
|
3597
|
-
default: !0
|
|
3598
|
-
},
|
|
3599
|
-
hover: {
|
|
3600
|
-
type: Boolean,
|
|
3601
|
-
default: !0
|
|
3602
|
-
},
|
|
3603
|
-
hideButton: {
|
|
3604
|
-
type: Boolean,
|
|
3605
|
-
default: !1
|
|
3606
|
-
},
|
|
3607
|
-
hideLabel: {
|
|
3608
|
-
type: Boolean,
|
|
3609
|
-
default: !1
|
|
3610
|
-
},
|
|
3611
|
-
form: {}
|
|
3612
|
-
},
|
|
3613
|
-
emits: ["query", "reset"],
|
|
3614
|
-
setup(e, { expose: t, emit: n }) {
|
|
3615
|
-
let r = e, i = n, a = M(), o = /* @__PURE__ */ new Set([
|
|
3616
|
-
"Input",
|
|
3617
|
-
"Select",
|
|
3618
|
-
"TreeSelect",
|
|
3619
|
-
"Cascader"
|
|
3620
|
-
]);
|
|
3621
|
-
function s(e) {
|
|
3622
|
-
return r.hideLabel ? e.map((e) => {
|
|
3623
|
-
let t = String(e.component ?? ""), n = { ...e.componentProps ?? {} };
|
|
3624
|
-
return o.has(t) ? (n.placeholder = n.placeholder || e.label, {
|
|
3625
|
-
...e,
|
|
3626
|
-
label: "",
|
|
3627
|
-
componentProps: n
|
|
3628
|
-
}) : t === "DatePicker" ? {
|
|
3629
|
-
...e,
|
|
3630
|
-
label: "",
|
|
3631
|
-
componentProps: n
|
|
3632
|
-
} : e;
|
|
3633
|
-
}) : e;
|
|
3634
|
-
}
|
|
3635
|
-
let l = u(() => {
|
|
3636
|
-
let e = r.form;
|
|
3637
|
-
if (!e) return;
|
|
3638
|
-
let t = e.formConfigs.length, n = e.colLength ?? (t > 0 ? Math.min(t, 3) : 3);
|
|
3639
|
-
return {
|
|
3640
|
-
...e,
|
|
3641
|
-
colLength: n,
|
|
3642
|
-
autoLayout: e.autoLayout ?? !0,
|
|
3643
|
-
formConfigs: s(e.formConfigs)
|
|
3644
|
-
};
|
|
3645
|
-
}), m = u(() => r.model === "item");
|
|
3646
|
-
async function g() {
|
|
3647
|
-
let e = await a.value?.validateFields();
|
|
3648
|
-
e && i("query", e);
|
|
3649
|
-
}
|
|
3650
|
-
async function v() {
|
|
3651
|
-
a.value?.resetForm(), i("reset"), await E();
|
|
3652
|
-
let e = await a.value?.validateFields();
|
|
3653
|
-
e && i("query", e);
|
|
3654
|
-
}
|
|
3655
|
-
function y() {
|
|
3656
|
-
return a.value?.getParams() ?? {};
|
|
3657
|
-
}
|
|
3658
|
-
function b() {
|
|
3659
|
-
a.value?.resetForm();
|
|
3660
|
-
}
|
|
3661
|
-
return t({
|
|
3662
|
-
getParams: y,
|
|
3663
|
-
resetForm: b,
|
|
3664
|
-
getFormRef: () => a.value?.getFormRef(),
|
|
3665
|
-
submit: g
|
|
3666
|
-
}), (t, n) => (A(), p("div", { class: D(["k-panel-query", {
|
|
3667
|
-
"k-panel-query__form": e.model === "form" && !e.showPanel,
|
|
3668
|
-
"k-panel-query__item": m.value
|
|
3669
|
-
}]) }, [e.showPanel ? (A(), d(R(Si), {
|
|
3670
|
-
key: 1,
|
|
3671
|
-
title: e.title,
|
|
3672
|
-
"is-fold": e.isFold,
|
|
3673
|
-
unfold: e.unfold,
|
|
3674
|
-
hover: e.hover
|
|
3675
|
-
}, {
|
|
3676
|
-
default: H(() => [l.value ? (A(), p(c, { key: 0 }, [m.value ? (A(), d(ji, T({
|
|
3677
|
-
key: 0,
|
|
3678
|
-
ref_key: "formRef",
|
|
3679
|
-
ref: a
|
|
3680
|
-
}, l.value), h({ _: 2 }, [e.hideButton ? void 0 : {
|
|
3681
|
-
name: "button",
|
|
3682
|
-
fn: H(() => [_(wi, {
|
|
3683
|
-
onQuery: g,
|
|
3684
|
-
onReset: v
|
|
3685
|
-
})]),
|
|
3686
|
-
key: "0"
|
|
3687
|
-
}]), 1040)) : (A(), p(c, { key: 1 }, [_(Ti, T({
|
|
3688
|
-
ref_key: "formRef",
|
|
3689
|
-
ref: a
|
|
3690
|
-
}, l.value, { "hide-label": e.hideLabel }), null, 16, ["hide-label"]), e.hideButton ? f("", !0) : (A(), d(wi, {
|
|
3691
|
-
key: 0,
|
|
3692
|
-
footer: "",
|
|
3693
|
-
onQuery: g,
|
|
3694
|
-
onReset: v
|
|
3695
|
-
}))], 64))], 64)) : f("", !0)]),
|
|
3696
|
-
_: 1
|
|
3697
|
-
}, 8, [
|
|
3698
|
-
"title",
|
|
3699
|
-
"is-fold",
|
|
3700
|
-
"unfold",
|
|
3701
|
-
"hover"
|
|
3702
|
-
])) : (A(), p(c, { key: 0 }, [l.value ? (A(), p(c, { key: 0 }, [m.value ? (A(), d(ji, T({
|
|
3703
|
-
key: 0,
|
|
3704
|
-
ref_key: "formRef",
|
|
3705
|
-
ref: a
|
|
3706
|
-
}, l.value), h({ _: 2 }, [e.hideButton ? void 0 : {
|
|
3707
|
-
name: "button",
|
|
3708
|
-
fn: H(() => [_(wi, {
|
|
3709
|
-
onQuery: g,
|
|
3710
|
-
onReset: v
|
|
3711
|
-
})]),
|
|
3712
|
-
key: "0"
|
|
3713
|
-
}]), 1040)) : (A(), p(c, { key: 1 }, [_(Ti, T({
|
|
3714
|
-
ref_key: "formRef",
|
|
3715
|
-
ref: a
|
|
3716
|
-
}, l.value, { "hide-label": e.hideLabel }), null, 16, ["hide-label"]), e.hideButton ? f("", !0) : (A(), d(wi, {
|
|
3717
|
-
key: 0,
|
|
3718
|
-
footer: "",
|
|
3719
|
-
onQuery: g,
|
|
3720
|
-
onReset: v
|
|
3721
|
-
}))], 64))], 64)) : f("", !0)], 64))], 2));
|
|
3722
|
-
}
|
|
3723
|
-
});
|
|
3724
|
-
//#endregion
|
|
3725
|
-
//#region src/components/k-table/utils/rowKey.ts
|
|
3726
|
-
function Ni(e, t) {
|
|
3727
|
-
return e[t];
|
|
3728
|
-
}
|
|
3729
|
-
function Pi(e, t) {
|
|
3730
|
-
let n = Ni(e, t);
|
|
3731
|
-
return typeof n == "string" || typeof n == "number" || typeof n == "boolean" ? n : n == null ? "" : String(n);
|
|
3732
|
-
}
|
|
3733
|
-
//#endregion
|
|
3734
|
-
//#region src/components/k-table/utils/formatCellValue.ts
|
|
3735
|
-
function Fi(e) {
|
|
3736
|
-
return e === "" || e == null;
|
|
3737
|
-
}
|
|
3738
|
-
function Ii(e) {
|
|
3739
|
-
let t = Number(e);
|
|
3740
|
-
return Number.isNaN(t) ? String(e ?? "") : t.toLocaleString("en-US");
|
|
3741
|
-
}
|
|
3742
|
-
function Li(e) {
|
|
3743
|
-
return e.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
|
|
3744
|
-
}
|
|
3745
|
-
function Ri(e, t) {
|
|
3746
|
-
if (Fi(t)) return "";
|
|
3747
|
-
let n = String(t);
|
|
3748
|
-
switch (e) {
|
|
3749
|
-
case "date": return K(n).format("YYYY-MM-DD");
|
|
3750
|
-
case "datetime": return K(n).format("YYYY-MM-DD HH:mm:ss");
|
|
3751
|
-
case "amount": return Ii(t);
|
|
3752
|
-
case "phone": return Li(n);
|
|
3753
|
-
default: return n;
|
|
3754
|
-
}
|
|
3755
|
-
}
|
|
3756
|
-
function zi(e, t, n, r, i) {
|
|
3757
|
-
let a = e.prop ? Ni(t, e.prop) : void 0;
|
|
3758
|
-
return e.formatter ? e.formatter(t, e, a, n) : e.dict && i !== void 0 ? i : Fi(a) ? r : e.showType ? Ri(e.showType, a) : String(a);
|
|
3759
|
-
}
|
|
3760
|
-
//#endregion
|
|
3761
|
-
//#region src/components/k-table/composables/useTableColumns.ts
|
|
3762
|
-
var Bi = [
|
|
3763
|
-
"prop",
|
|
3764
|
-
"label",
|
|
3765
|
-
"width",
|
|
3766
|
-
"minWidth",
|
|
3767
|
-
"align",
|
|
3768
|
-
"headerAlign",
|
|
3769
|
-
"fixed",
|
|
3770
|
-
"sortable",
|
|
3771
|
-
"sortMethod",
|
|
3772
|
-
"sortBy",
|
|
3773
|
-
"sortOrders",
|
|
3774
|
-
"resizable",
|
|
3775
|
-
"formatter",
|
|
3776
|
-
"showOverflowTooltip",
|
|
3777
|
-
"className",
|
|
3778
|
-
"labelClassName",
|
|
3779
|
-
"selectable",
|
|
3780
|
-
"reserveSelection",
|
|
3781
|
-
"filters",
|
|
3782
|
-
"filterMethod",
|
|
3783
|
-
"filteredValue"
|
|
3784
|
-
];
|
|
3785
|
-
function Vi(e, t = !1) {
|
|
3786
|
-
let n = e.some((e) => e.type === "selection"), r = e;
|
|
3787
|
-
return t && !n && (r = [{
|
|
3788
|
-
type: "selection",
|
|
3789
|
-
width: 50,
|
|
3790
|
-
align: "center"
|
|
3791
|
-
}, ...r]), r.map((e) => e.prop === "operates" && !e.type ? {
|
|
3792
|
-
...e,
|
|
3793
|
-
type: "operates"
|
|
3794
|
-
} : e);
|
|
3795
|
-
}
|
|
3796
|
-
function Hi(e) {
|
|
3797
|
-
let t = {
|
|
3798
|
-
minWidth: e.minWidth ?? "110",
|
|
3799
|
-
align: e.align ?? "center",
|
|
3800
|
-
headerAlign: e.headerAlign ?? "center"
|
|
3801
|
-
};
|
|
3802
|
-
for (let n of Bi) e[n] !== void 0 && (t[n] = e[n]);
|
|
3803
|
-
return e.type === "index" && !t.label && (t.label = "序号"), e.type === "expand" && (t.width = e.width ?? 50, delete t.minWidth), e.type !== "selection" && e.type !== "index" && e.type !== "operates" && e.type !== "radio" && e.type !== "expand" && (t.showOverflowTooltip = e.showOverflowTooltip ?? !0), t;
|
|
3804
|
-
}
|
|
3805
|
-
function Ui(e = "--") {
|
|
3806
|
-
let t = S(ft, null);
|
|
3807
|
-
function n(n, r, i) {
|
|
3808
|
-
let a = n.prop ? Ni(r, n.prop) : void 0;
|
|
3809
|
-
return zi(n, r, i, e, n.dict && t && !Wi(a) ? t.getLabel(n.dict, a) : void 0);
|
|
3810
|
-
}
|
|
3811
|
-
return { getCellDisplayValue: n };
|
|
3812
|
-
}
|
|
3813
|
-
function Wi(e) {
|
|
3814
|
-
return e === "" || e == null;
|
|
3815
|
-
}
|
|
3816
|
-
//#endregion
|
|
3817
|
-
//#region src/components/k-table/utils/columnIdentity.ts
|
|
3818
|
-
function $(e, t = 0) {
|
|
3819
|
-
return e.prop ? `prop:${e.prop}` : e.type ? `type:${e.type}:${t}` : e.label ? `label:${e.label}:${t}` : `index:${t}`;
|
|
3820
|
-
}
|
|
3821
|
-
//#endregion
|
|
3822
|
-
//#region src/components/k-table/KTableColumn.vue
|
|
3823
|
-
var Gi = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
3824
|
-
name: "KTableColumn",
|
|
3825
|
-
__name: "KTableColumn",
|
|
3826
|
-
props: {
|
|
3827
|
-
column: {},
|
|
3828
|
-
columnIndex: { default: 0 },
|
|
3829
|
-
indexOffset: { default: 0 },
|
|
3830
|
-
nullValueFormat: { default: "--" },
|
|
3831
|
-
disabled: {
|
|
3832
|
-
type: Boolean,
|
|
3833
|
-
default: !1
|
|
3834
|
-
},
|
|
3835
|
-
rowKey: { default: "id" },
|
|
3836
|
-
radioSelected: {
|
|
3837
|
-
type: [
|
|
3838
|
-
String,
|
|
3839
|
-
Number,
|
|
3840
|
-
Boolean
|
|
3841
|
-
],
|
|
3842
|
-
default: ""
|
|
3843
|
-
}
|
|
3844
|
-
},
|
|
3845
|
-
emits: ["operate-click", "radio-select"],
|
|
3846
|
-
setup(e, { emit: t }) {
|
|
3847
|
-
let n = e, r = t, i = z(), { getCellDisplayValue: a } = Ui(n.nullValueFormat);
|
|
3848
|
-
function o(e) {
|
|
3849
|
-
return e ?? "";
|
|
3850
|
-
}
|
|
3851
|
-
let s = u(() => Hi(n.column)), l = (e) => n.indexOffset + e + 1, f = u(() => {
|
|
3852
|
-
let e = n.column.prop;
|
|
3853
|
-
return !!(e && i[o(e)]);
|
|
3854
|
-
}), v = u(() => n.column.type === "operates" ? i.operates ? !0 : !!(n.column.prop && i[o(n.column.prop)]) : !1);
|
|
3855
|
-
function y(e, t, n) {
|
|
3856
|
-
r("operate-click", e, n, t), e.onClick?.(n, t);
|
|
3857
|
-
}
|
|
3858
|
-
function b(e) {
|
|
3859
|
-
return typeof e.slot == "string" ? e.slot : "default";
|
|
3860
|
-
}
|
|
3861
|
-
function x(e) {
|
|
3862
|
-
return Pi(e, n.rowKey);
|
|
3863
|
-
}
|
|
3864
|
-
return (t, n) => {
|
|
3865
|
-
let u = ie("KTableColumn", !0);
|
|
3866
|
-
return e.column.type === "selection" ? (A(), d(R(G), T({
|
|
3867
|
-
key: `${R($)(e.column, e.columnIndex)}:selection`,
|
|
3868
|
-
type: "selection"
|
|
3869
|
-
}, s.value), null, 16)) : e.column.type === "index" ? (A(), d(R(G), T({ key: `${R($)(e.column, e.columnIndex)}:index` }, s.value), {
|
|
3870
|
-
default: H(({ $index: e }) => [P(t.$slots, "index", {
|
|
3871
|
-
index: e,
|
|
3872
|
-
displayIndex: l(e)
|
|
3873
|
-
}, () => [g(F(l(e)), 1)], !0)]),
|
|
3874
|
-
_: 3
|
|
3875
|
-
}, 16)) : e.column.type === "radio" ? (A(), d(R(G), T({ key: `${R($)(e.column, e.columnIndex)}:radio` }, s.value), {
|
|
3876
|
-
default: H(({ row: t }) => [_(R(Me), {
|
|
3877
|
-
class: "k-table-column__radio",
|
|
3878
|
-
"model-value": e.radioSelected,
|
|
3879
|
-
label: x(t),
|
|
3880
|
-
"onUpdate:modelValue": (e) => r("radio-select", t)
|
|
3881
|
-
}, null, 8, [
|
|
3882
|
-
"model-value",
|
|
3883
|
-
"label",
|
|
3884
|
-
"onUpdate:modelValue"
|
|
3885
|
-
])]),
|
|
3886
|
-
_: 1
|
|
3887
|
-
}, 16)) : e.column.type === "operates" ? (A(), d(R(G), T({ key: `${R($)(e.column, e.columnIndex)}:operates` }, s.value), {
|
|
3888
|
-
default: H(({ row: n, column: r, $index: a }) => [v.value ? P(t.$slots, R(i).operates ? "operates" : o(e.column.prop), {
|
|
3889
|
-
row: n,
|
|
3890
|
-
column: r,
|
|
3891
|
-
index: a
|
|
3892
|
-
}, void 0, !0, 0) : (A(), d(R(Jr), {
|
|
3893
|
-
key: 1,
|
|
3894
|
-
data: e.column.operates ?? [],
|
|
3895
|
-
disabled: e.disabled,
|
|
3896
|
-
"table-mode": "",
|
|
3897
|
-
onClick: (e, t) => y(e, t, n)
|
|
3898
|
-
}, h({ _: 2 }, [N(e.column.operates ?? [], (e) => ({
|
|
3899
|
-
name: b(e),
|
|
3900
|
-
fn: H(({ item: i }) => [P(t.$slots, b(e), {
|
|
3901
|
-
row: n,
|
|
3902
|
-
column: r,
|
|
3903
|
-
index: a,
|
|
3904
|
-
item: i
|
|
3905
|
-
}, () => [g(F(i.label), 1)], !0)])
|
|
3906
|
-
}))]), 1032, [
|
|
3907
|
-
"data",
|
|
3908
|
-
"disabled",
|
|
3909
|
-
"onClick"
|
|
3910
|
-
]))]),
|
|
3911
|
-
_: 3
|
|
3912
|
-
}, 16)) : e.column.type === "expand" ? (A(), d(R(G), T({
|
|
3913
|
-
key: `${R($)(e.column, e.columnIndex)}:expand`,
|
|
3914
|
-
type: "expand"
|
|
3915
|
-
}, s.value), {
|
|
3916
|
-
default: H(({ row: e, column: n, $index: r }) => [P(t.$slots, "expand", {
|
|
3917
|
-
row: e,
|
|
3918
|
-
column: n,
|
|
3919
|
-
index: r
|
|
3920
|
-
}, void 0, !0)]),
|
|
3921
|
-
_: 3
|
|
3922
|
-
}, 16)) : e.column.children?.length ? (A(), d(R(G), T({ key: `${R($)(e.column, e.columnIndex)}:group` }, s.value), {
|
|
3923
|
-
default: H(() => [(A(!0), p(c, null, N(e.column.children, (i, a) => (A(), d(u, {
|
|
3924
|
-
key: R($)(i, a),
|
|
3925
|
-
column: i,
|
|
3926
|
-
"column-index": a,
|
|
3927
|
-
"index-offset": e.indexOffset,
|
|
3928
|
-
"null-value-format": e.nullValueFormat,
|
|
3929
|
-
disabled: e.disabled,
|
|
3930
|
-
"row-key": e.rowKey,
|
|
3931
|
-
"radio-selected": e.radioSelected,
|
|
3932
|
-
onOperateClick: n[0] ||= (e, t, n) => r("operate-click", e, t, n),
|
|
3933
|
-
onRadioSelect: n[1] ||= (e) => r("radio-select", e)
|
|
3934
|
-
}, h({ _: 2 }, [N(t.$slots, (e, n) => ({
|
|
3935
|
-
name: n,
|
|
3936
|
-
fn: H((e) => [P(t.$slots, n, T({ ref_for: !0 }, e ?? {}), void 0, !0)])
|
|
3937
|
-
}))]), 1032, [
|
|
3938
|
-
"column",
|
|
3939
|
-
"column-index",
|
|
3940
|
-
"index-offset",
|
|
3941
|
-
"null-value-format",
|
|
3942
|
-
"disabled",
|
|
3943
|
-
"row-key",
|
|
3944
|
-
"radio-selected"
|
|
3945
|
-
]))), 128))]),
|
|
3946
|
-
_: 3
|
|
3947
|
-
}, 16)) : (A(), d(R(G), T({ key: `${R($)(e.column, e.columnIndex)}:default` }, s.value), h({
|
|
3948
|
-
default: H(({ row: n, column: r, $index: i }) => [f.value ? P(t.$slots, o(e.column.prop), {
|
|
3949
|
-
row: n,
|
|
3950
|
-
column: r,
|
|
3951
|
-
index: i
|
|
3952
|
-
}, void 0, !0, 0) : (A(), p(c, { key: 1 }, [g(F(R(a)(e.column, n, i)), 1)], 64))]),
|
|
3953
|
-
_: 2
|
|
3954
|
-
}, [e.column.toolTip ? {
|
|
3955
|
-
name: "header",
|
|
3956
|
-
fn: H(() => [m("span", null, F(e.column.label), 1), _(R(ze), {
|
|
3957
|
-
content: e.column.toolTip,
|
|
3958
|
-
placement: "top"
|
|
3959
|
-
}, {
|
|
3960
|
-
default: H(() => [...n[2] ||= [m("span", { class: "k-table-column__tip" }, "i", -1)]]),
|
|
3961
|
-
_: 1
|
|
3962
|
-
}, 8, ["content"])]),
|
|
3963
|
-
key: "0"
|
|
3964
|
-
} : void 0]), 1040));
|
|
3965
|
-
};
|
|
3966
|
-
}
|
|
3967
|
-
}), [["__scopeId", "data-v-578909bc"]]), Ki = { class: "k-table-column-selector" }, qi = { class: "k-table-column-selector__header" }, Ji = { class: "k-table-column-selector__content" }, Yi = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
3968
|
-
name: "KTableColumnSelector",
|
|
3969
|
-
__name: "KTableColumnSelector",
|
|
3970
|
-
props: { items: {} },
|
|
3971
|
-
emits: ["change", "reset"],
|
|
3972
|
-
setup(e, { emit: t }) {
|
|
3973
|
-
let n = t, r = M(!1);
|
|
3974
|
-
function i(e, t) {
|
|
3975
|
-
n("change", e, t);
|
|
3976
|
-
}
|
|
3977
|
-
function a() {
|
|
3978
|
-
n("reset");
|
|
3979
|
-
}
|
|
3980
|
-
return (t, n) => (A(), d(R(Ae), {
|
|
3981
|
-
visible: r.value,
|
|
3982
|
-
"onUpdate:visible": n[0] ||= (e) => r.value = e,
|
|
3983
|
-
placement: "bottom-end",
|
|
3984
|
-
width: 300,
|
|
3985
|
-
trigger: "click",
|
|
3986
|
-
"popper-class": "k-table-column-selector__popover"
|
|
3987
|
-
}, {
|
|
3988
|
-
reference: H(() => [...n[1] ||= [m("button", {
|
|
3989
|
-
type: "button",
|
|
3990
|
-
class: "k-table-column-selector__trigger",
|
|
3991
|
-
"aria-label": "列展示设置"
|
|
3992
|
-
}, [m("span", { class: "k-table-column-selector__icon" })], -1)]]),
|
|
3993
|
-
default: H(() => [m("div", Ki, [
|
|
3994
|
-
m("div", qi, [n[3] ||= m("span", null, "列展示", -1), _(R(pe), {
|
|
3995
|
-
type: "primary",
|
|
3996
|
-
link: "",
|
|
3997
|
-
onClick: a
|
|
3998
|
-
}, {
|
|
3999
|
-
default: H(() => [...n[2] ||= [g("恢复默认", -1)]]),
|
|
4000
|
-
_: 1
|
|
4001
|
-
})]),
|
|
4002
|
-
_(R(xe), { class: "k-table-column-selector__divider" }),
|
|
4003
|
-
m("div", Ji, [(A(!0), p(c, null, N(e.items, (e) => (A(), d(R(U), {
|
|
4004
|
-
key: e.key,
|
|
4005
|
-
"model-value": e.checked,
|
|
4006
|
-
disabled: e.disabled,
|
|
4007
|
-
onChange: (t) => i(e.key, !!t)
|
|
4008
|
-
}, {
|
|
4009
|
-
default: H(() => [g(F(e.label), 1)]),
|
|
4010
|
-
_: 2
|
|
4011
|
-
}, 1032, [
|
|
4012
|
-
"model-value",
|
|
4013
|
-
"disabled",
|
|
4014
|
-
"onChange"
|
|
4015
|
-
]))), 128))])
|
|
4016
|
-
])]),
|
|
4017
|
-
_: 1
|
|
4018
|
-
}, 8, ["visible"]));
|
|
4019
|
-
}
|
|
4020
|
-
}), [["__scopeId", "data-v-e0b3cf31"]]), Xi = {
|
|
4021
|
-
key: 0,
|
|
4022
|
-
class: "k-table-toolbar k-table-header"
|
|
4023
|
-
}, Zi = {
|
|
4024
|
-
key: 0,
|
|
4025
|
-
class: "k-table-toolbar__main"
|
|
4026
|
-
}, Qi = {
|
|
4027
|
-
key: 1,
|
|
4028
|
-
class: "k-table-toolbar__header"
|
|
4029
|
-
}, $i = {
|
|
4030
|
-
key: 2,
|
|
4031
|
-
class: "k-table-toolbar__extra"
|
|
4032
|
-
}, ea = {
|
|
4033
|
-
key: 1,
|
|
4034
|
-
class: "k-table-toolbar__divider"
|
|
4035
|
-
}, ta = {
|
|
4036
|
-
key: 2,
|
|
4037
|
-
class: "k-table-toolbar__selection"
|
|
4038
|
-
}, na = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
4039
|
-
name: "KTableToolbar",
|
|
4040
|
-
__name: "KTableToolbar",
|
|
4041
|
-
props: {
|
|
4042
|
-
addButton: {
|
|
4043
|
-
type: [Boolean, String],
|
|
4044
|
-
default: !1
|
|
4045
|
-
},
|
|
4046
|
-
selectionShow: {
|
|
4047
|
-
type: Boolean,
|
|
4048
|
-
default: !1
|
|
4049
|
-
},
|
|
4050
|
-
selectedCount: { default: 0 }
|
|
4051
|
-
},
|
|
4052
|
-
emits: ["add"],
|
|
4053
|
-
setup(e, { emit: t }) {
|
|
4054
|
-
let n = e, r = t, i = z(), a = u(() => !!(n.addButton || i.header || i.extra)), o = u(() => !!(n.addButton && n.selectionShow));
|
|
4055
|
-
return (t, n) => a.value || e.selectionShow ? (A(), p("div", Xi, [
|
|
4056
|
-
a.value ? (A(), p("div", Zi, [
|
|
4057
|
-
e.addButton ? (A(), d(J, {
|
|
4058
|
-
key: 0,
|
|
4059
|
-
type: "primary",
|
|
4060
|
-
icon: R(Je),
|
|
4061
|
-
onClick: n[0] ||= (e) => r("add")
|
|
4062
|
-
}, {
|
|
4063
|
-
default: H(() => [g(F(e.addButton === !0 ? "新建" : e.addButton), 1)]),
|
|
4064
|
-
_: 1
|
|
4065
|
-
}, 8, ["icon"])) : f("", !0),
|
|
4066
|
-
R(i).header ? (A(), p("div", Qi, [P(t.$slots, "header", {}, void 0, !0)])) : f("", !0),
|
|
4067
|
-
R(i).extra ? (A(), p("div", $i, [P(t.$slots, "extra", {}, void 0, !0)])) : f("", !0)
|
|
4068
|
-
])) : f("", !0),
|
|
4069
|
-
o.value ? (A(), p("div", ea)) : f("", !0),
|
|
4070
|
-
e.selectionShow ? (A(), p("div", ta, "已选择" + F(e.selectedCount) + "条数据", 1)) : f("", !0)
|
|
4071
|
-
])) : f("", !0);
|
|
4072
|
-
}
|
|
4073
|
-
}), [["__scopeId", "data-v-bff19ed1"]]), ra = "kayak_table_column_display";
|
|
4074
|
-
function ia(e) {
|
|
4075
|
-
return e.type === "selection" || e.type === "index" || e.type === "radio" || e.type === "expand" || e.required === !0;
|
|
4076
|
-
}
|
|
4077
|
-
function aa(e) {
|
|
4078
|
-
return !(e.type === "radio" || e.type === "expand" || e.children?.length);
|
|
4079
|
-
}
|
|
4080
|
-
function oa(e) {
|
|
4081
|
-
let t = M({}), n = M(""), r = We(ra, {}), i = u(() => !!L(e.enableColumnCache)), a = u(() => L(e.columns).filter((e) => aa(e)));
|
|
4082
|
-
function o() {
|
|
4083
|
-
return L(e.tableKey) || n.value;
|
|
4084
|
-
}
|
|
4085
|
-
function s() {
|
|
4086
|
-
let t = {};
|
|
4087
|
-
return L(e.columns).forEach((e, n) => {
|
|
4088
|
-
aa(e) && (t[$(e, n)] = !0);
|
|
4089
|
-
}), t;
|
|
4090
|
-
}
|
|
4091
|
-
function c() {
|
|
4092
|
-
if (!i.value) return null;
|
|
4093
|
-
let e = o();
|
|
4094
|
-
return e ? r.value[e] ?? null : null;
|
|
4095
|
-
}
|
|
4096
|
-
function l() {
|
|
4097
|
-
if (!i.value) return;
|
|
4098
|
-
let e = o();
|
|
4099
|
-
e && (r.value = {
|
|
4100
|
-
...r.value,
|
|
4101
|
-
[e]: t.value
|
|
4102
|
-
});
|
|
4103
|
-
}
|
|
4104
|
-
function d() {
|
|
4105
|
-
if (!i.value) return;
|
|
4106
|
-
let e = o();
|
|
4107
|
-
if (!e) return;
|
|
4108
|
-
let t = { ...r.value };
|
|
4109
|
-
delete t[e], r.value = t;
|
|
4110
|
-
}
|
|
4111
|
-
function f(t, n) {
|
|
4112
|
-
let r = L(e.columns), i = r.findIndex((e) => e === t || e.prop && e.prop === t.prop && e.type === t.type);
|
|
4113
|
-
return i >= 0 ? $(r[i], i) : $(t, n);
|
|
4114
|
-
}
|
|
4115
|
-
function p() {
|
|
4116
|
-
n.value = L(e.tableKey) || `table_${Math.random().toString(36).slice(2, 11)}`;
|
|
4117
|
-
let r = c();
|
|
4118
|
-
t.value = r ? q(r) : s();
|
|
4119
|
-
}
|
|
4120
|
-
function m() {
|
|
4121
|
-
E(() => e.onLayout?.());
|
|
4122
|
-
}
|
|
4123
|
-
function h(n, r) {
|
|
4124
|
-
t.value = {
|
|
4125
|
-
...t.value,
|
|
4126
|
-
[n]: r
|
|
4127
|
-
}, l(), e.onDisplayChange?.(t.value), m();
|
|
4128
|
-
}
|
|
4129
|
-
function g(e, t, n) {
|
|
4130
|
-
h(f(e, t), n);
|
|
4131
|
-
}
|
|
4132
|
-
function _() {
|
|
4133
|
-
d(), t.value = s(), e.onDisplayChange?.(t.value), m();
|
|
4134
|
-
}
|
|
4135
|
-
let v = u(() => {
|
|
4136
|
-
let n = L(e.renderColumns);
|
|
4137
|
-
return i.value ? n.filter((e, n) => {
|
|
4138
|
-
if (ia(e)) return !0;
|
|
4139
|
-
let r = f(e, n);
|
|
4140
|
-
return t.value[r] !== !1;
|
|
4141
|
-
}) : n;
|
|
4142
|
-
}), y = u(() => a.value.map((e, n) => {
|
|
4143
|
-
let r = $(e, n);
|
|
4144
|
-
return {
|
|
4145
|
-
column: e,
|
|
4146
|
-
key: r,
|
|
4147
|
-
label: e.label || "未命名列",
|
|
4148
|
-
checked: t.value[r] !== !1,
|
|
4149
|
-
disabled: ia(e)
|
|
4150
|
-
};
|
|
4151
|
-
}));
|
|
4152
|
-
return V(() => L(e.columns), () => {
|
|
4153
|
-
let e = s();
|
|
4154
|
-
Object.keys(e).forEach((e) => {
|
|
4155
|
-
t.value[e] === void 0 && (t.value[e] = !0);
|
|
4156
|
-
});
|
|
4157
|
-
}, { deep: !0 }), ne(() => {
|
|
4158
|
-
p();
|
|
4159
|
-
}), {
|
|
4160
|
-
columnDisplay: t,
|
|
4161
|
-
displayableColumns: a,
|
|
4162
|
-
visibleColumns: v,
|
|
4163
|
-
selectorItems: y,
|
|
4164
|
-
setColumnVisible: g,
|
|
4165
|
-
setColumnVisibleByKey: h,
|
|
4166
|
-
resetColumnDisplay: _
|
|
4167
|
-
};
|
|
4168
|
-
}
|
|
4169
|
-
//#endregion
|
|
4170
|
-
//#region src/components/k-table/composables/useTableData.ts
|
|
4171
|
-
function sa(e) {
|
|
4172
|
-
let t = M([]), n = M(e.initialLoading ?? !1), r = M(!1), i = M(!1);
|
|
4173
|
-
function a() {
|
|
4174
|
-
return {
|
|
4175
|
-
...pt,
|
|
4176
|
-
...L(e.responseConfig)
|
|
4177
|
-
};
|
|
4178
|
-
}
|
|
4179
|
-
function o() {
|
|
4180
|
-
let t = a(), { currentPage: n, pageSize: r } = e.pagination.state.value;
|
|
4181
|
-
return {
|
|
4182
|
-
...L(e.params) ?? {},
|
|
4183
|
-
...L(e.queryParams) ?? {},
|
|
4184
|
-
[t.page]: String(n),
|
|
4185
|
-
[t.limit]: String(r)
|
|
4186
|
-
};
|
|
4187
|
-
}
|
|
4188
|
-
function s(n) {
|
|
4189
|
-
let r = n ?? {}, i = a(), o = r[i.list] ?? [], s = Number(r[i.total] ?? r.total ?? 0);
|
|
4190
|
-
t.value = o, e.pagination.setTotal(s), e.onDataLoaded?.(o, s), o.length === 0 && e.pagination.state.value.currentPage > 1 && (e.pagination.setCurrentPage(e.pagination.state.value.currentPage - 1), c());
|
|
4191
|
-
}
|
|
4192
|
-
async function c() {
|
|
4193
|
-
if (!(!e.action || i.value)) {
|
|
4194
|
-
i.value = !0, n.value = !0;
|
|
4195
|
-
try {
|
|
4196
|
-
s(await e.action(o()));
|
|
4197
|
-
} finally {
|
|
4198
|
-
n.value = !1, r.value = !0, i.value = !1;
|
|
4199
|
-
}
|
|
4200
|
-
}
|
|
4201
|
-
}
|
|
4202
|
-
async function l(t = !1) {
|
|
4203
|
-
t && e.pagination.resetPage(), await c();
|
|
4204
|
-
}
|
|
4205
|
-
return {
|
|
4206
|
-
tableData: t,
|
|
4207
|
-
loading: n,
|
|
4208
|
-
loaded: r,
|
|
4209
|
-
fetchData: c,
|
|
4210
|
-
refresh: l
|
|
4211
|
-
};
|
|
4212
|
-
}
|
|
4213
|
-
//#endregion
|
|
4214
|
-
//#region src/components/k-table/composables/useTablePagination.ts
|
|
4215
|
-
function ca(e) {
|
|
4216
|
-
let t = L(e.pagination), n = M({
|
|
4217
|
-
total: t?.total ?? mt.total,
|
|
4218
|
-
currentPage: t?.currentPage ?? mt.currentPage,
|
|
4219
|
-
pageSize: t?.pageSize ?? mt.pageSize,
|
|
4220
|
-
pageSizes: t?.pageSizes ?? [...mt.pageSizes],
|
|
4221
|
-
layout: t?.layout ?? mt.layout
|
|
4222
|
-
}), r = u(() => ({
|
|
4223
|
-
total: n.value.total,
|
|
4224
|
-
currentPage: n.value.currentPage,
|
|
4225
|
-
pageSize: n.value.pageSize,
|
|
4226
|
-
pageSizes: n.value.pageSizes,
|
|
4227
|
-
layout: n.value.layout
|
|
4228
|
-
})), i = u(() => (n.value.currentPage - 1) * n.value.pageSize);
|
|
4229
|
-
V(() => {
|
|
4230
|
-
let t = L(e.pagination);
|
|
4231
|
-
return [
|
|
4232
|
-
t?.total,
|
|
4233
|
-
t?.currentPage,
|
|
4234
|
-
t?.pageSize,
|
|
4235
|
-
e.hasAction.value
|
|
4236
|
-
];
|
|
4237
|
-
}, ([e, t, r, i]) => {
|
|
4238
|
-
t !== void 0 && (n.value.currentPage = t), r !== void 0 && (n.value.pageSize = r), !i && e !== void 0 && (n.value.total = e);
|
|
4239
|
-
});
|
|
4240
|
-
function a(e) {
|
|
4241
|
-
n.value.total = e;
|
|
4242
|
-
}
|
|
4243
|
-
function o(e) {
|
|
4244
|
-
n.value.currentPage = e;
|
|
4245
|
-
}
|
|
4246
|
-
function s(e) {
|
|
4247
|
-
n.value.pageSize = e;
|
|
4248
|
-
}
|
|
4249
|
-
function c() {
|
|
4250
|
-
n.value.currentPage = 1;
|
|
4251
|
-
}
|
|
4252
|
-
return {
|
|
4253
|
-
state: n,
|
|
4254
|
-
bindProps: r,
|
|
4255
|
-
indexOffset: i,
|
|
4256
|
-
setTotal: a,
|
|
4257
|
-
setCurrentPage: o,
|
|
4258
|
-
setPageSize: s,
|
|
4259
|
-
resetPage: c
|
|
4260
|
-
};
|
|
4261
|
-
}
|
|
4262
|
-
//#endregion
|
|
4263
|
-
//#region src/components/k-table/composables/useTableRadio.ts
|
|
4264
|
-
function la(e) {
|
|
4265
|
-
let t = M(""), n = u(() => L(e.columns).some((e) => e.type === "radio"));
|
|
4266
|
-
function r(n) {
|
|
4267
|
-
return t.value = n ? Pi(n, L(e.rowKey)) : "", n;
|
|
4268
|
-
}
|
|
4269
|
-
function i() {
|
|
4270
|
-
t.value = "";
|
|
4271
|
-
}
|
|
4272
|
-
function a(n) {
|
|
4273
|
-
t.value = Pi(n, L(e.rowKey));
|
|
4274
|
-
}
|
|
4275
|
-
function o() {
|
|
4276
|
-
return t.value;
|
|
4277
|
-
}
|
|
4278
|
-
return {
|
|
4279
|
-
radioSelected: t,
|
|
4280
|
-
hasRadioColumn: n,
|
|
4281
|
-
selectRow: r,
|
|
4282
|
-
clearRadioSelection: i,
|
|
4283
|
-
setRadioSelection: a,
|
|
4284
|
-
getRadioSelection: o
|
|
4285
|
-
};
|
|
4286
|
-
}
|
|
4287
|
-
//#endregion
|
|
4288
|
-
//#region src/components/k-table/composables/useTableRowSort.ts
|
|
4289
|
-
function ua(e) {
|
|
4290
|
-
let t = null;
|
|
4291
|
-
function n() {
|
|
4292
|
-
t?.destroy(), t = null;
|
|
4293
|
-
}
|
|
4294
|
-
function r() {
|
|
4295
|
-
if (n(), !L(e.enabled)) return;
|
|
4296
|
-
let r = e.tableRef.value?.$el?.querySelector(".el-table__body-wrapper tbody");
|
|
4297
|
-
r && (t = Qe.create(r, {
|
|
4298
|
-
disabled: L(e.disabled),
|
|
4299
|
-
animation: 300,
|
|
4300
|
-
handle: ".sort-handle",
|
|
4301
|
-
filter: ".ignore-elements",
|
|
4302
|
-
preventOnFilter: !0,
|
|
4303
|
-
onEnd: (t) => e.onSortEnd(t)
|
|
4304
|
-
}));
|
|
4305
|
-
}
|
|
4306
|
-
return V(() => [
|
|
4307
|
-
L(e.enabled),
|
|
4308
|
-
L(e.rebindKey),
|
|
4309
|
-
e.tableRef.value
|
|
4310
|
-
], () => {
|
|
4311
|
-
E(r);
|
|
4312
|
-
}, { flush: "post" }), V(() => L(e.disabled), (e) => {
|
|
4313
|
-
t && t.option("disabled", e);
|
|
4314
|
-
}), k(n), {
|
|
4315
|
-
initSortable: () => E(r),
|
|
4316
|
-
destroySortable: n
|
|
4317
|
-
};
|
|
4318
|
-
}
|
|
4319
|
-
//#endregion
|
|
4320
|
-
//#region src/components/k-table/composables/useTableTreeLoad.ts
|
|
4321
|
-
function da(e) {
|
|
4322
|
-
let t = /* @__PURE__ */ new Map();
|
|
4323
|
-
function n(n) {
|
|
4324
|
-
return (r, i, a) => {
|
|
4325
|
-
let o = Pi(r, L(e.rowKey));
|
|
4326
|
-
o != null && t.set(o, {
|
|
4327
|
-
row: r,
|
|
4328
|
-
treeNode: i,
|
|
4329
|
-
resolve: a
|
|
4330
|
-
}), n(r, i, a);
|
|
4331
|
-
};
|
|
4332
|
-
}
|
|
4333
|
-
function r(n) {
|
|
4334
|
-
let r = L(e.load), i = t.get(n);
|
|
4335
|
-
if (!i || !r) return;
|
|
4336
|
-
let a = e.tableRef.value?.store?.states?.lazyTreeNodeMap;
|
|
4337
|
-
a && n != null && (a[String(n)] = []), r(i.row, i.treeNode, i.resolve);
|
|
4338
|
-
}
|
|
4339
|
-
function i() {
|
|
4340
|
-
t.clear();
|
|
4341
|
-
}
|
|
4342
|
-
return {
|
|
4343
|
-
wrapLoad: n,
|
|
4344
|
-
refreshTree: r,
|
|
4345
|
-
clearTreeCache: i
|
|
4346
|
-
};
|
|
4347
|
-
}
|
|
4348
|
-
//#endregion
|
|
4349
|
-
//#region src/components/k-table/composables/useKTable.ts
|
|
4350
|
-
function fa(e) {
|
|
4351
|
-
let { props: t, emit: n, attrs: r, slots: i, tableRef: a, queryRef: o } = e, s = M({}), c = M(0), l = u(() => !!t.action), d = u(() => !!t.query?.form?.formConfigs?.length), f = u(() => !!i.header);
|
|
4352
|
-
function p(e) {
|
|
4353
|
-
let n = { ...e };
|
|
4354
|
-
s.value = t.convertParams ? t.convertParams(n) : n;
|
|
4355
|
-
}
|
|
4356
|
-
let m = u(() => {
|
|
4357
|
-
let e = Vi(t.columns, t.selectionShow);
|
|
4358
|
-
return t.disabled && (e = e.filter((e) => e.type !== "operates" && e.prop !== "operates")), e;
|
|
4359
|
-
}), h = oa({
|
|
4360
|
-
columns: () => t.columns,
|
|
4361
|
-
renderColumns: m,
|
|
4362
|
-
enableColumnCache: () => t.enableColumnCache,
|
|
4363
|
-
tableKey: () => t.tableKey,
|
|
4364
|
-
onDisplayChange: (e) => n("column-display-change", e),
|
|
4365
|
-
onLayout: () => a.value?.doLayout()
|
|
4366
|
-
}), g = la({
|
|
4367
|
-
columns: () => t.columns,
|
|
4368
|
-
rowKey: () => t.rowKey
|
|
4369
|
-
}), _ = da({
|
|
4370
|
-
tableRef: a,
|
|
4371
|
-
rowKey: () => t.rowKey,
|
|
4372
|
-
load: () => t.load
|
|
4373
|
-
}), v = ca({
|
|
4374
|
-
pagination: () => t.pagination,
|
|
4375
|
-
hasAction: l
|
|
4376
|
-
}), y = sa({
|
|
4377
|
-
action: t.action,
|
|
4378
|
-
params: () => t.params,
|
|
4379
|
-
queryParams: s,
|
|
4380
|
-
responseConfig: () => t.responseConfig,
|
|
4381
|
-
pagination: v,
|
|
4382
|
-
initialLoading: !!(t.action && t.initTable),
|
|
4383
|
-
onDataLoaded: (e, t) => n("data-loaded", e, t)
|
|
4384
|
-
}), b = u(() => t.enableColumnCache ? h.visibleColumns.value : m.value), x = u(() => b.value.map((e, t) => $(e, t)).join("|")), S = u(() => !!(t.addButton || t.selectionShow || f.value || t.enableColumnCache)), ee = u(() => l.value ? y.tableData.value : t.data), C = u(() => t.loading === void 0 ? l.value ? y.loading.value : !1 : t.loading), w = u(() => C.value || !!(l.value && t.initTable && !y.loaded.value)), T = u(() => {
|
|
4385
|
-
let e = { ...r };
|
|
4386
|
-
l.value && "data" in e && delete e.data, t.load && delete e.load;
|
|
4387
|
-
let n = {
|
|
4388
|
-
data: ee.value,
|
|
4389
|
-
rowKey: t.rowKey,
|
|
4390
|
-
border: !0,
|
|
4391
|
-
stripe: !0,
|
|
4392
|
-
maxHeight: t.maxHeight,
|
|
4393
|
-
...e
|
|
4394
|
-
};
|
|
4395
|
-
return t.load && (n.load = _.wrapLoad(t.load)), g.hasRadioColumn.value && n.highlightCurrentRow === void 0 && (n.highlightCurrentRow = r["highlight-current-row"] !== !1), typeof document < "u" && document.documentElement.classList.contains("kayak-micro-embed") && (n.tooltipOptions = {
|
|
4396
|
-
...n.tooltipOptions ?? n["tooltip-options"] ?? {},
|
|
4397
|
-
strategy: "absolute"
|
|
4398
|
-
}), n;
|
|
4399
|
-
});
|
|
4400
|
-
ua({
|
|
4401
|
-
enabled: () => t.sort,
|
|
4402
|
-
disabled: () => t.disabled,
|
|
4403
|
-
tableRef: a,
|
|
4404
|
-
rebindKey: () => x.value,
|
|
4405
|
-
onSortEnd: (e) => {
|
|
4406
|
-
let t = [...ee.value];
|
|
4407
|
-
if (e.oldIndex == null || e.newIndex == null) return;
|
|
4408
|
-
let [r] = t.splice(e.oldIndex, 1);
|
|
4409
|
-
t.splice(e.newIndex, 0, r), n("sort-end", e, t);
|
|
4410
|
-
}
|
|
4411
|
-
});
|
|
4412
|
-
function E() {
|
|
4413
|
-
l.value && y.fetchData();
|
|
4414
|
-
}
|
|
4415
|
-
ne(() => {
|
|
4416
|
-
!t.initTable || !t.action || (d.value && p(o.value?.getParams() ?? {}), y.fetchData());
|
|
4417
|
-
});
|
|
4418
|
-
function D(e) {
|
|
4419
|
-
c.value = e.length, n("selection-change", e);
|
|
4420
|
-
}
|
|
4421
|
-
function te(e) {
|
|
4422
|
-
n("sort-change", e);
|
|
4423
|
-
}
|
|
4424
|
-
function O() {
|
|
4425
|
-
a.value?.setCurrentRow();
|
|
4426
|
-
}
|
|
4427
|
-
function k(e) {
|
|
4428
|
-
p(e), v.resetPage(), t.clearCurrentRowOnQuery && O(), n("query", s.value), E();
|
|
4429
|
-
}
|
|
4430
|
-
function A() {
|
|
4431
|
-
n("reset"), t.selectionShow && L(), t.clearCurrentRowOnReset && O();
|
|
4432
|
-
}
|
|
4433
|
-
function j(e) {
|
|
4434
|
-
v.setCurrentPage(e), n("page-change", e), E();
|
|
4435
|
-
}
|
|
4436
|
-
function re(e) {
|
|
4437
|
-
v.setPageSize(e), n("size-change", e), E();
|
|
4438
|
-
}
|
|
4439
|
-
function N() {
|
|
4440
|
-
n("add");
|
|
4441
|
-
}
|
|
4442
|
-
function P(e, t, r) {
|
|
4443
|
-
n("operate-click", e, t, r);
|
|
4444
|
-
}
|
|
4445
|
-
function ie(e) {
|
|
4446
|
-
if (!g.hasRadioColumn.value) return;
|
|
4447
|
-
let t = g.selectRow(e);
|
|
4448
|
-
t && n("radio-change", t, g.radioSelected.value);
|
|
4449
|
-
}
|
|
4450
|
-
function ae(e) {
|
|
4451
|
-
ie(e);
|
|
4452
|
-
}
|
|
4453
|
-
function oe(e, t) {
|
|
4454
|
-
h.setColumnVisibleByKey(e, t);
|
|
4455
|
-
}
|
|
4456
|
-
function se() {
|
|
4457
|
-
return a.value;
|
|
4458
|
-
}
|
|
4459
|
-
function F() {
|
|
4460
|
-
return o.value;
|
|
4461
|
-
}
|
|
4462
|
-
function I() {
|
|
4463
|
-
return a.value?.getSelectionRows() ?? [];
|
|
4464
|
-
}
|
|
4465
|
-
function L() {
|
|
4466
|
-
a.value?.clearSelection(), c.value = 0;
|
|
4467
|
-
}
|
|
4468
|
-
function R(e, t) {
|
|
4469
|
-
a.value?.toggleRowSelection(e, t);
|
|
4470
|
-
}
|
|
4471
|
-
async function ce(e = !1) {
|
|
4472
|
-
l.value && await y.refresh(e);
|
|
4473
|
-
}
|
|
4474
|
-
function le() {
|
|
4475
|
-
g.clearRadioSelection(), a.value?.setCurrentRow();
|
|
4476
|
-
}
|
|
4477
|
-
function z(e) {
|
|
4478
|
-
g.setRadioSelection(e);
|
|
4479
|
-
}
|
|
4480
|
-
function B() {
|
|
4481
|
-
return g.getRadioSelection();
|
|
4482
|
-
}
|
|
4483
|
-
function ue(e) {
|
|
4484
|
-
_.refreshTree(e);
|
|
4485
|
-
}
|
|
4486
|
-
return {
|
|
4487
|
-
showQuery: d,
|
|
4488
|
-
showToolbar: S,
|
|
4489
|
-
hasHeaderSlot: f,
|
|
4490
|
-
renderColumns: b,
|
|
4491
|
-
tableProps: T,
|
|
4492
|
-
tableLoading: C,
|
|
4493
|
-
showLoadingEmpty: w,
|
|
4494
|
-
columnSelectorItems: h.selectorItems,
|
|
4495
|
-
paginationBind: v.bindProps,
|
|
4496
|
-
indexOffset: v.indexOffset,
|
|
4497
|
-
selectedCount: c,
|
|
4498
|
-
radioSelected: g.radioSelected,
|
|
4499
|
-
getColumnIdentity: $,
|
|
4500
|
-
handleSelectionChange: D,
|
|
4501
|
-
handleSortChange: te,
|
|
4502
|
-
handleQuery: k,
|
|
4503
|
-
handleQueryReset: A,
|
|
4504
|
-
handlePageChange: j,
|
|
4505
|
-
handleSizeChange: re,
|
|
4506
|
-
handleAdd: N,
|
|
4507
|
-
handleOperateClick: P,
|
|
4508
|
-
handleRowClick: ae,
|
|
4509
|
-
handleRadioChange: ie,
|
|
4510
|
-
handleColumnVisibleChange: oe,
|
|
4511
|
-
resetColumnDisplay: h.resetColumnDisplay,
|
|
4512
|
-
getTableRef: se,
|
|
4513
|
-
getQueryRef: F,
|
|
4514
|
-
getSelection: I,
|
|
4515
|
-
clearSelection: L,
|
|
4516
|
-
toggleRowSelection: R,
|
|
4517
|
-
refresh: ce,
|
|
4518
|
-
clearRadioSelection: le,
|
|
4519
|
-
setRadioSelection: z,
|
|
4520
|
-
getRadioSelection: B,
|
|
4521
|
-
refreshTree: ue
|
|
4522
|
-
};
|
|
4523
|
-
}
|
|
4524
|
-
var pa = {
|
|
4525
|
-
hidePagination: !1,
|
|
4526
|
-
initTable: !0,
|
|
4527
|
-
nullValueFormat: "--",
|
|
4528
|
-
selectionShow: !1,
|
|
4529
|
-
rowKey: "id",
|
|
4530
|
-
maxHeight: 560,
|
|
4531
|
-
addButton: !1,
|
|
4532
|
-
disabled: !1,
|
|
4533
|
-
enableColumnCache: !0,
|
|
4534
|
-
tableKey: "",
|
|
4535
|
-
sort: !1,
|
|
4536
|
-
data: () => [],
|
|
4537
|
-
sortFilter: () => []
|
|
4538
|
-
}, ma = { class: "k-table__box" }, ha = { class: "k-table" }, ga = {
|
|
4539
|
-
key: 0,
|
|
4540
|
-
class: "k-table__loading-empty"
|
|
4541
|
-
}, _a = { class: "k-table-footer" }, va = /*@__PURE__*/ y({
|
|
4542
|
-
name: "KTable",
|
|
4543
|
-
inheritAttrs: !0,
|
|
4544
|
-
__name: "KTable",
|
|
4545
|
-
props: /*@__PURE__*/ C({
|
|
4546
|
-
columns: {},
|
|
4547
|
-
data: {},
|
|
4548
|
-
action: { type: Function },
|
|
4549
|
-
params: {},
|
|
4550
|
-
responseConfig: {},
|
|
4551
|
-
pagination: {},
|
|
4552
|
-
hidePagination: { type: Boolean },
|
|
4553
|
-
initTable: { type: Boolean },
|
|
4554
|
-
loading: { type: Boolean },
|
|
4555
|
-
nullValueFormat: {},
|
|
4556
|
-
selectionShow: { type: Boolean },
|
|
4557
|
-
rowKey: {},
|
|
4558
|
-
maxHeight: {},
|
|
4559
|
-
query: {},
|
|
4560
|
-
convertParams: { type: Function },
|
|
4561
|
-
addButton: { type: [Boolean, String] },
|
|
4562
|
-
disabled: { type: Boolean },
|
|
4563
|
-
clearCurrentRowOnQuery: { type: Boolean },
|
|
4564
|
-
clearCurrentRowOnReset: { type: Boolean },
|
|
4565
|
-
enableColumnCache: { type: Boolean },
|
|
4566
|
-
tableKey: {},
|
|
4567
|
-
sort: { type: Boolean },
|
|
4568
|
-
sortFilter: {},
|
|
4569
|
-
load: { type: Function }
|
|
4570
|
-
}, {
|
|
4571
|
-
...pa,
|
|
4572
|
-
data: () => []
|
|
4573
|
-
}),
|
|
4574
|
-
emits: [
|
|
4575
|
-
"selection-change",
|
|
4576
|
-
"page-change",
|
|
4577
|
-
"size-change",
|
|
4578
|
-
"data-loaded",
|
|
4579
|
-
"query",
|
|
4580
|
-
"reset",
|
|
4581
|
-
"add",
|
|
4582
|
-
"operate-click",
|
|
4583
|
-
"column-display-change",
|
|
4584
|
-
"radio-change",
|
|
4585
|
-
"sort-end",
|
|
4586
|
-
"sort-change"
|
|
4587
|
-
],
|
|
4588
|
-
setup(e, { expose: t, emit: n }) {
|
|
4589
|
-
let r = e, i = n, a = z(), o = M(), s = M(), l = re(fa({
|
|
4590
|
-
props: r,
|
|
4591
|
-
emit: i,
|
|
4592
|
-
attrs: ce(),
|
|
4593
|
-
slots: a,
|
|
4594
|
-
tableRef: o,
|
|
4595
|
-
queryRef: s
|
|
4596
|
-
})), v = u(() => {
|
|
4597
|
-
let e = /* @__PURE__ */ new Set();
|
|
4598
|
-
a.operates && e.add("operates"), a.index && e.add("index"), a.expand && e.add("expand");
|
|
4599
|
-
for (let t of l.renderColumns) {
|
|
4600
|
-
t.type === "expand" && e.add("expand"), t.prop && a[t.prop] && e.add(t.prop);
|
|
4601
|
-
for (let n of t.operates ?? []) typeof n.slot == "string" && a[n.slot] && e.add(n.slot);
|
|
4602
|
-
}
|
|
4603
|
-
return [...e];
|
|
4604
|
-
});
|
|
4605
|
-
return t({
|
|
4606
|
-
getTableRef: l.getTableRef,
|
|
4607
|
-
getQueryRef: l.getQueryRef,
|
|
4608
|
-
getSelection: l.getSelection,
|
|
4609
|
-
clearSelection: l.clearSelection,
|
|
4610
|
-
toggleRowSelection: l.toggleRowSelection,
|
|
4611
|
-
refresh: l.refresh,
|
|
4612
|
-
clearRadioSelection: l.clearRadioSelection,
|
|
4613
|
-
setRadioSelection: l.setRadioSelection,
|
|
4614
|
-
getRadioSelection: l.getRadioSelection,
|
|
4615
|
-
refreshTree: l.refreshTree
|
|
4616
|
-
}), (t, n) => {
|
|
4617
|
-
let r = ae("loading");
|
|
4618
|
-
return A(), p("div", ma, [l.showQuery ? (A(), d(R(Mi), T({
|
|
4619
|
-
key: 0,
|
|
4620
|
-
ref_key: "queryRef",
|
|
4621
|
-
ref: s,
|
|
4622
|
-
class: "k-table-query"
|
|
4623
|
-
}, e.query, {
|
|
4624
|
-
onQuery: l.handleQuery,
|
|
4625
|
-
onReset: l.handleQueryReset
|
|
4626
|
-
}), null, 16, ["onQuery", "onReset"])) : f("", !0), m("div", ha, [
|
|
4627
|
-
l.showToolbar ? (A(), d(na, {
|
|
4628
|
-
key: 0,
|
|
4629
|
-
"add-button": e.addButton,
|
|
4630
|
-
"selection-show": e.selectionShow,
|
|
4631
|
-
"selected-count": l.selectedCount,
|
|
4632
|
-
onAdd: l.handleAdd
|
|
4633
|
-
}, h({ _: 2 }, [l.hasHeaderSlot ? {
|
|
4634
|
-
name: "header",
|
|
4635
|
-
fn: H(() => [P(t.$slots, "header", {}, void 0, !0)]),
|
|
4636
|
-
key: "0"
|
|
4637
|
-
} : void 0, e.enableColumnCache ? {
|
|
4638
|
-
name: "extra",
|
|
4639
|
-
fn: H(() => [_(Yi, {
|
|
4640
|
-
items: l.columnSelectorItems,
|
|
4641
|
-
onChange: l.handleColumnVisibleChange,
|
|
4642
|
-
onReset: l.resetColumnDisplay
|
|
4643
|
-
}, null, 8, [
|
|
4644
|
-
"items",
|
|
4645
|
-
"onChange",
|
|
4646
|
-
"onReset"
|
|
4647
|
-
])]),
|
|
4648
|
-
key: "1"
|
|
4649
|
-
} : void 0]), 1032, [
|
|
4650
|
-
"add-button",
|
|
4651
|
-
"selection-show",
|
|
4652
|
-
"selected-count",
|
|
4653
|
-
"onAdd"
|
|
4654
|
-
])) : f("", !0),
|
|
4655
|
-
de((A(), d(R(Ie), T({
|
|
4656
|
-
ref_key: "tableRef",
|
|
4657
|
-
ref: o,
|
|
4658
|
-
class: "k-table__main"
|
|
4659
|
-
}, l.tableProps, {
|
|
4660
|
-
onSelectionChange: l.handleSelectionChange,
|
|
4661
|
-
onSortChange: l.handleSortChange,
|
|
4662
|
-
onRowClick: l.handleRowClick
|
|
4663
|
-
}), {
|
|
4664
|
-
empty: H(() => [l.showLoadingEmpty ? de((A(), p("span", ga, null, 512)), [[r, l.showLoadingEmpty]]) : P(t.$slots, "empty", {}, () => [g(F(t.$attrs.emptyText ?? t.$attrs["empty-text"] ?? "暂无数据"), 1)], !0, 1)]),
|
|
4665
|
-
default: H(() => [e.sort ? (A(), d(R(G), {
|
|
4666
|
-
key: 0,
|
|
4667
|
-
label: "拖拽排序",
|
|
4668
|
-
align: "center",
|
|
4669
|
-
width: "100"
|
|
4670
|
-
}, {
|
|
4671
|
-
default: H(({ row: n, column: r, $index: i }) => [P(t.$slots, "sort", {
|
|
4672
|
-
row: n,
|
|
4673
|
-
column: r,
|
|
4674
|
-
index: i
|
|
4675
|
-
}, () => [m("span", {
|
|
4676
|
-
class: D(e.sortFilter.includes(i) ? "ignore-elements" : "sort-handle k-table__sort-handle"),
|
|
4677
|
-
"aria-hidden": "true"
|
|
4678
|
-
}, "⋮⋮", 2)], !0)]),
|
|
4679
|
-
_: 3
|
|
4680
|
-
})) : f("", !0), (A(!0), p(c, null, N(l.renderColumns, (n, r) => (A(), d(Gi, {
|
|
4681
|
-
key: l.getColumnIdentity(n, r),
|
|
4682
|
-
column: n,
|
|
4683
|
-
"column-index": r,
|
|
4684
|
-
"index-offset": l.indexOffset,
|
|
4685
|
-
"null-value-format": e.nullValueFormat,
|
|
4686
|
-
disabled: e.disabled,
|
|
4687
|
-
"row-key": e.rowKey,
|
|
4688
|
-
"radio-selected": l.radioSelected,
|
|
4689
|
-
onOperateClick: l.handleOperateClick,
|
|
4690
|
-
onRadioSelect: l.handleRadioChange
|
|
4691
|
-
}, h({ _: 2 }, [N(v.value, (e) => ({
|
|
4692
|
-
name: e,
|
|
4693
|
-
fn: H((n) => [P(t.$slots, e, T({ ref_for: !0 }, n ?? {}), void 0, !0)])
|
|
4694
|
-
}))]), 1032, [
|
|
4695
|
-
"column",
|
|
4696
|
-
"column-index",
|
|
4697
|
-
"index-offset",
|
|
4698
|
-
"null-value-format",
|
|
4699
|
-
"disabled",
|
|
4700
|
-
"row-key",
|
|
4701
|
-
"radio-selected",
|
|
4702
|
-
"onOperateClick",
|
|
4703
|
-
"onRadioSelect"
|
|
4704
|
-
]))), 128))]),
|
|
4705
|
-
_: 3
|
|
4706
|
-
}, 16, [
|
|
4707
|
-
"onSelectionChange",
|
|
4708
|
-
"onSortChange",
|
|
4709
|
-
"onRowClick"
|
|
4710
|
-
])), [[r, l.tableLoading]]),
|
|
4711
|
-
m("div", _a, [e.hidePagination ? f("", !0) : (A(), d(R(Yr), T({
|
|
4712
|
-
key: 0,
|
|
4713
|
-
class: "pagination"
|
|
4714
|
-
}, l.paginationBind, {
|
|
4715
|
-
onCurrentChange: l.handlePageChange,
|
|
4716
|
-
onSizeChange: l.handleSizeChange
|
|
4717
|
-
}), null, 16, ["onCurrentChange", "onSizeChange"])), P(t.$slots, "footer", {}, void 0, !0)])
|
|
4718
|
-
])]);
|
|
4719
|
-
};
|
|
4720
|
-
}
|
|
4721
|
-
}), ya = /*#__PURE__*/ e(va, [["__scopeId", "data-v-ccb6f7c6"]]);
|
|
4722
|
-
//#endregion
|
|
4723
|
-
//#region src/components/k-table/dictOptions.ts
|
|
4724
|
-
function ba(e) {
|
|
4725
|
-
return e.map((e) => ({
|
|
4726
|
-
value: String(e.item_key ?? ""),
|
|
4727
|
-
label: String(e.item_value ?? e.item_key ?? "")
|
|
4728
|
-
}));
|
|
4729
|
-
}
|
|
4730
|
-
//#endregion
|
|
4731
|
-
//#region src/components/k-table/utils/mergeQueryConfig.ts
|
|
4732
|
-
function xa(e, t) {
|
|
4733
|
-
return e.map((e) => {
|
|
4734
|
-
let n = t[e.id];
|
|
4735
|
-
return n ? {
|
|
4736
|
-
...e,
|
|
4737
|
-
componentProps: {
|
|
4738
|
-
...e.componentProps,
|
|
4739
|
-
...n
|
|
4740
|
-
}
|
|
4741
|
-
} : e;
|
|
4742
|
-
});
|
|
4743
|
-
}
|
|
4744
|
-
function Sa(e, t) {
|
|
4745
|
-
let n = e.form;
|
|
4746
|
-
return n ? {
|
|
4747
|
-
...e,
|
|
4748
|
-
form: {
|
|
4749
|
-
...n,
|
|
4750
|
-
formConfigs: xa(n.formConfigs ?? [], t)
|
|
4751
|
-
}
|
|
4752
|
-
} : e;
|
|
4753
|
-
}
|
|
4754
|
-
function Ca(e, t) {
|
|
4755
|
-
return e.query ? {
|
|
4756
|
-
...e,
|
|
4757
|
-
query: Sa(e.query, t)
|
|
4758
|
-
} : e;
|
|
4759
|
-
}
|
|
4760
|
-
//#endregion
|
|
4761
|
-
//#region src/components/k-table/composables/useKTableTemplateRef.ts
|
|
4762
|
-
function wa(e) {
|
|
4763
|
-
return B(e);
|
|
4764
|
-
}
|
|
4765
|
-
//#endregion
|
|
4766
|
-
//#region src/components/k-table/composables/useKTableCrossPageSelection.ts
|
|
4767
|
-
function Ta(e) {
|
|
4768
|
-
let t = se([]), n = se([]), r = se(!1), i = wa(e.tableRefKey ?? "tableRef");
|
|
4769
|
-
function a() {
|
|
4770
|
-
return e.tableRef == null ? i.value : L(e.tableRef);
|
|
4771
|
-
}
|
|
4772
|
-
function o(t) {
|
|
4773
|
-
return String(Pi(t, L(e.rowKey)));
|
|
4774
|
-
}
|
|
4775
|
-
function s(e) {
|
|
4776
|
-
t.value = [...e];
|
|
4777
|
-
}
|
|
4778
|
-
function c() {
|
|
4779
|
-
t.value = [];
|
|
4780
|
-
}
|
|
4781
|
-
function l() {
|
|
4782
|
-
n.value = [];
|
|
4783
|
-
}
|
|
4784
|
-
function u(i) {
|
|
4785
|
-
n.value = i;
|
|
4786
|
-
let s = new Set(t.value.map(o));
|
|
4787
|
-
if (L(e.mode) === "single") {
|
|
4788
|
-
let e = i.find((e) => s.has(o(e)));
|
|
4789
|
-
e && a()?.setRadioSelection(e);
|
|
4790
|
-
return;
|
|
4791
|
-
}
|
|
4792
|
-
r.value = !0, E(async () => {
|
|
4793
|
-
let e = a();
|
|
4794
|
-
i.forEach((t) => {
|
|
4795
|
-
s.has(o(t)) && e?.toggleRowSelection(t, !0);
|
|
4796
|
-
}), await E(), r.value = !1;
|
|
4797
|
-
});
|
|
4798
|
-
}
|
|
4799
|
-
function d(e) {
|
|
4800
|
-
if (r.value) return;
|
|
4801
|
-
let i = new Set(n.value.map(o));
|
|
4802
|
-
t.value = [...t.value.filter((e) => !i.has(o(e))), ...e];
|
|
4803
|
-
}
|
|
4804
|
-
function f(e) {
|
|
4805
|
-
t.value = [e];
|
|
4806
|
-
}
|
|
4807
|
-
return {
|
|
4808
|
-
selection: t,
|
|
4809
|
-
pageRows: n,
|
|
4810
|
-
tableRef: i,
|
|
4811
|
-
setSelection: s,
|
|
4812
|
-
clearSelection: c,
|
|
4813
|
-
resetPageRows: l,
|
|
4814
|
-
onDataLoaded: u,
|
|
4815
|
-
onSelectionChange: d,
|
|
4816
|
-
onRadioChange: f
|
|
4817
|
-
};
|
|
4818
|
-
}
|
|
4819
|
-
//#endregion
|
|
4820
|
-
//#region src/components/k-table/report/convertDownloadCol.ts
|
|
4821
|
-
function Ea(e) {
|
|
4822
|
-
return e.filter((e) => e.type !== "expand").map((e) => ({
|
|
4823
|
-
sTitle: e.label ?? "",
|
|
4824
|
-
mDataProp: e.prop ?? "",
|
|
4825
|
-
dict: e.dict ?? "",
|
|
4826
|
-
show: ""
|
|
4827
|
-
}));
|
|
4828
|
-
}
|
|
4829
|
-
//#endregion
|
|
4830
|
-
//#region src/components/k-table/report/pickExportColumns.ts
|
|
4831
|
-
function Da(e, t) {
|
|
4832
|
-
let n = e;
|
|
4833
|
-
return t?.excludeLast && (n = n.slice(0, -1)), t?.excludeOperates && (n = n.filter((e) => e.type !== "operates" && e.prop !== "operates")), n.filter((e) => e.type !== "expand" && e.type !== "index" && e.type !== "selection" && e.type !== "radio");
|
|
4834
|
-
}
|
|
4835
|
-
//#endregion
|
|
4836
|
-
//#region src/components/k-table/report/exportKTableReport.ts
|
|
4837
|
-
function Oa(e) {
|
|
4838
|
-
let t = e.tableRef.value?.getQueryRef()?.getParams() ?? {}, n = e.convertParams ? e.convertParams(t) : t, r = Da(e.columns, e);
|
|
4839
|
-
return e.exportApi({
|
|
4840
|
-
globColumnlist: Ea(r),
|
|
4841
|
-
jsondata: n
|
|
4842
|
-
});
|
|
4843
|
-
}
|
|
4844
|
-
function ka(e) {
|
|
4845
|
-
let t = Da(e.columns, e);
|
|
4846
|
-
return e.exportApi({
|
|
4847
|
-
globColumnlist: Ea(t),
|
|
4848
|
-
jsondata: e.jsondata
|
|
4849
|
-
});
|
|
4850
|
-
}
|
|
4851
|
-
//#endregion
|
|
4852
|
-
//#region src/components/k-table/report/useExportKTableReport.ts
|
|
4853
|
-
function Aa(e) {
|
|
4854
|
-
let t = M(!1);
|
|
4855
|
-
async function n() {
|
|
4856
|
-
if (!t.value) {
|
|
4857
|
-
t.value = !0;
|
|
4858
|
-
try {
|
|
4859
|
-
await Oa({
|
|
4860
|
-
tableRef: e.tableRef,
|
|
4861
|
-
columns: L(e.columns),
|
|
4862
|
-
exportApi: e.exportApi,
|
|
4863
|
-
convertParams: e.convertParams,
|
|
4864
|
-
excludeOperates: L(e.excludeOperates),
|
|
4865
|
-
excludeLast: L(e.excludeLast)
|
|
4866
|
-
});
|
|
4867
|
-
} catch {
|
|
4868
|
-
De.error("导出失败");
|
|
4869
|
-
} finally {
|
|
4870
|
-
t.value = !1;
|
|
4871
|
-
}
|
|
4872
|
-
}
|
|
4873
|
-
}
|
|
4874
|
-
return {
|
|
4875
|
-
exportTable: n,
|
|
4876
|
-
exportLoading: t
|
|
4877
|
-
};
|
|
4878
|
-
}
|
|
4879
|
-
//#endregion
|
|
4880
|
-
//#region src/components/k-upload/utils/uploadFileValue.ts
|
|
4881
|
-
function ja(e, t, n = {}) {
|
|
4882
|
-
let r = `${fr(n.listType ?? "text")}${e}`;
|
|
4883
|
-
return [{
|
|
4884
|
-
uid: e,
|
|
4885
|
-
name: t,
|
|
4886
|
-
resource_id: e,
|
|
4887
|
-
file_name: t,
|
|
4888
|
-
imp_id: n.impId,
|
|
4889
|
-
url: r
|
|
4890
|
-
}];
|
|
4891
|
-
}
|
|
4892
|
-
function Ma(e, t = {}) {
|
|
4893
|
-
return Array.isArray(e) ? e : typeof e != "string" || !e ? [] : ja(e, t.fileName ?? e, { listType: t.listType });
|
|
4894
|
-
}
|
|
4895
|
-
function Na(e, t = {}) {
|
|
4896
|
-
if (typeof e == "string") return e ? {
|
|
4897
|
-
resource_id: e,
|
|
4898
|
-
file_name: t.fileName
|
|
4899
|
-
} : null;
|
|
4900
|
-
if (!Array.isArray(e) || !e.length) return null;
|
|
4901
|
-
let n = e[0];
|
|
4902
|
-
return !n?.resource_id && !n?.imp_id ? null : {
|
|
4903
|
-
resource_id: n.resource_id,
|
|
4904
|
-
file_name: n.file_name ?? n.name,
|
|
4905
|
-
imp_id: n.imp_id,
|
|
4906
|
-
imp_count: n.imp_count
|
|
4907
|
-
};
|
|
4908
|
-
}
|
|
4909
|
-
function Pa(e, t = {}) {
|
|
4910
|
-
let n = Na(e, t);
|
|
4911
|
-
return {
|
|
4912
|
-
resource_id: n?.resource_id ?? "",
|
|
4913
|
-
file_name: n?.file_name ?? t.fileName ?? "",
|
|
4914
|
-
imp_id: n?.imp_id ?? "",
|
|
4915
|
-
imp_count: n?.imp_count
|
|
4916
|
-
};
|
|
4917
|
-
}
|
|
4918
|
-
function Fa(e) {
|
|
4919
|
-
return !!(e.resource_id || e.imp_id);
|
|
4920
|
-
}
|
|
4921
|
-
//#endregion
|
|
4922
|
-
//#region src/components/index.ts
|
|
4923
|
-
var Ia = /* @__PURE__ */ et({
|
|
4924
|
-
DICT_KEY: () => ft,
|
|
4925
|
-
KAffix: () => La,
|
|
4926
|
-
KBreadcrumb: () => Ra,
|
|
4927
|
-
KButton: () => J,
|
|
4928
|
-
KCard: () => vi,
|
|
4929
|
-
KCascader: () => za,
|
|
4930
|
-
KCheckbox: () => Wt,
|
|
4931
|
-
KColorPicker: () => Ba,
|
|
4932
|
-
KDatePicker: () => Jt,
|
|
4933
|
-
KDialog: () => dt,
|
|
4934
|
-
KDialogHeader: () => lt,
|
|
4935
|
-
KForm: () => Dr,
|
|
4936
|
-
KHandlePage: () => Fr,
|
|
4937
|
-
KIcon: () => Wr,
|
|
4938
|
-
KInput: () => Q,
|
|
4939
|
-
KLinkButton: () => Jr,
|
|
4940
|
-
KLongPage: () => _i,
|
|
4941
|
-
KPagination: () => Yr,
|
|
4942
|
-
KPanel: () => Si,
|
|
4943
|
-
KPanelQuery: () => Mi,
|
|
4944
|
-
KRadio: () => _n,
|
|
4945
|
-
KSelect: () => rn,
|
|
4946
|
-
KTable: () => ya,
|
|
4947
|
-
KTimePicker: () => zn,
|
|
4948
|
-
KUpload: () => gr,
|
|
4949
|
-
countEditorHtmlWords: () => a,
|
|
4950
|
-
countEditorWords: () => o,
|
|
4951
|
-
createUploadFileItem: () => ja,
|
|
4952
|
-
exportKTableReport: () => Oa,
|
|
4953
|
-
exportKTableReportData: () => ka,
|
|
4954
|
-
getAllLucideKebabNames: () => Ur,
|
|
4955
|
-
getEditorHtml: () => r,
|
|
4956
|
-
getEditorWordCount: () => t,
|
|
4957
|
-
getUploadConfig: () => s,
|
|
4958
|
-
hasUploadSubmitFields: () => Fa,
|
|
4959
|
-
mapGroupDictToOptions: () => ba,
|
|
4960
|
-
pascalToKebab: () => zr,
|
|
4961
|
-
registerFormComponents: () => xr,
|
|
4962
|
-
resolveLucideIcon: () => Br,
|
|
4963
|
-
toKEditorValue: () => i,
|
|
4964
|
-
toLucidePascalName: () => Rr,
|
|
4965
|
-
toUploadFiles: () => Ma,
|
|
4966
|
-
toUploadSubmitFields: () => Pa,
|
|
4967
|
-
updateUploadConfig: () => n,
|
|
4968
|
-
useExportKTableReport: () => Aa,
|
|
4969
|
-
useHandlePageInit: () => Ir,
|
|
4970
|
-
useKFormTemplateRef: () => Or,
|
|
4971
|
-
useKTableCrossPageSelection: () => Ta,
|
|
4972
|
-
useKTableTemplateRef: () => wa,
|
|
4973
|
-
withQueryFieldOptions: () => Ca
|
|
4974
|
-
}), La = tt("KAffix"), Ra = tt("KBreadcrumb"), za = tt("KCascader"), Ba = tt("KColorPicker");
|
|
4975
|
-
//#endregion
|
|
4976
|
-
export { Fr as A, Jt as B, Jr as C, Br as D, zr as E, gr as F, J as G, ft as H, zn as I, _n as L, Dr as M, xr as N, Rr as O, br as P, rn as R, Yr as S, Ur as T, dt as U, Wt as V, lt as W, ya as _, Ia as a, vi as b, Ma as c, Oa as d, ka as f, ba as g, Ca as h, Ba as i, Or as j, Ir as k, Pa as l, wa as m, Ra as n, ja as o, Ta as p, za as r, Fa as s, La as t, Aa as u, Mi as v, Wr as w, _i as x, Si as y, Q as z };
|