@sunny-base-web/ui 0.8.3 → 0.8.4
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/index.js +1 -1
- package/dist/index.mjs +607 -607
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCurrentInstance as gt, inject as Qe, defineComponent as U, computed as B, openBlock as I, createElementBlock as O, normalizeStyle as ce, normalizeClass as G, createElementVNode as k, useAttrs as rt, ref as Q, createBlock as $, unref as i, mergeProps as D, withModifiers as ue, withCtx as V, renderSlot as q, createTextVNode as ee, toDisplayString as L, createCommentVNode as W, createVNode as
|
|
1
|
+
import { getCurrentInstance as gt, inject as Qe, defineComponent as U, computed as B, openBlock as I, createElementBlock as O, normalizeStyle as ce, normalizeClass as G, createElementVNode as k, useAttrs as rt, ref as Q, createBlock as $, unref as i, mergeProps as D, withModifiers as ue, withCtx as V, renderSlot as q, createTextVNode as ee, toDisplayString as L, createCommentVNode as W, createVNode as E, reactive as vt, h as Ce, shallowRef as Te, onErrorCaptured as Jt, markRaw as _t, createStaticVNode as Yt, watch as ne, onUnmounted as Gt, Fragment as se, renderList as te, resolveDynamicComponent as Xe, normalizeProps as le, withDirectives as Ze, vShow as lt, resolveComponent as oe, createSlots as pe, guardReactiveProps as fe, isRef as Se, toRaw as be, provide as ze, useSlots as Be, defineAsyncComponent as Kt, nextTick as me, onMounted as Ie, onBeforeUnmount as yt, withKeys as bt, isReactive as Ht, vModelText as Xt } from "vue";
|
|
2
2
|
import { Modal as xe, Button as ie, Tooltip as At, Upload as Me, Checkbox as Le, Progress as Zt, Message as _, Select as Ae, Option as je, TimePicker as it, DatePicker as et, Switch as Oe, Radio as ct, TreeSelect as en, Cascader as tn, Slider as nn, Rate as on, RangePicker as St, RadioGroup as rn, CheckboxGroup as sn, Textarea as Ct, InputNumber as Ee, InputPassword as an, Input as De, MonthPicker as ln, Popover as cn, WeekPicker as un, YearPicker as dn, Tree as fn, Dropdown as pn, Doption as mn, Pagination as hn, Form as gn, FormItem as ut } from "@arco-design/web-vue";
|
|
3
3
|
import { useI18n as vn, $t as K } from "@sunny-base-web/locales";
|
|
4
4
|
import { cn as Pe, isString as ke, isHttpUrl as yn, isObject as re, isFunction as ae, cloneDeep as Ne, is as bn, isBoolean as Ue, get as dt, isEqual as An, set as Sn } from "@sunny-base-web/utils";
|
|
@@ -635,7 +635,7 @@ const Bo = Object.assign(He, {
|
|
|
635
635
|
}, m = async () => {
|
|
636
636
|
const g = r.onBeforeCancel;
|
|
637
637
|
typeof g == "function" && await g() === !1 || (y.value = !1, h.value = !1, s("close"));
|
|
638
|
-
},
|
|
638
|
+
}, f = m, C = async () => {
|
|
639
639
|
const g = r.onBeforeOk;
|
|
640
640
|
if (typeof g == "function")
|
|
641
641
|
try {
|
|
@@ -686,7 +686,7 @@ const Bo = Object.assign(He, {
|
|
|
686
686
|
}, {
|
|
687
687
|
default: V(() => [
|
|
688
688
|
k("div", Ro, [
|
|
689
|
-
|
|
689
|
+
E(i(Pt))
|
|
690
690
|
])
|
|
691
691
|
]),
|
|
692
692
|
_: 1
|
|
@@ -702,7 +702,7 @@ const Bo = Object.assign(He, {
|
|
|
702
702
|
class: "cursor-pointer text-[var(--color-text-2)] flex items-center justify-center transition-colors duration-200 text-base hover:text-[rgb(var(--red-6))]",
|
|
703
703
|
onClick: ue(m, ["stop"])
|
|
704
704
|
}, [
|
|
705
|
-
|
|
705
|
+
E(i(It))
|
|
706
706
|
])
|
|
707
707
|
])
|
|
708
708
|
], 32)
|
|
@@ -710,14 +710,14 @@ const Bo = Object.assign(He, {
|
|
|
710
710
|
footer: V(() => [
|
|
711
711
|
g.$slots.footer ? q(g.$slots, "footer", { key: 0 }) : (I(), O("div", No, [
|
|
712
712
|
q(g.$slots, "insertFooter"),
|
|
713
|
-
i(a).hideCancel ? W("", !0) : (I(), $(i(ie), D({ key: 0 }, i(a).cancelButtonProps, { onClick: i(
|
|
713
|
+
i(a).hideCancel ? W("", !0) : (I(), $(i(ie), D({ key: 0 }, i(a).cancelButtonProps, { onClick: i(f) }), {
|
|
714
714
|
default: V(() => [
|
|
715
715
|
ee(L(i(a).cancelText || i(o)("common.modal.cancel")), 1)
|
|
716
716
|
]),
|
|
717
717
|
_: 1
|
|
718
718
|
}, 16, ["onClick"])),
|
|
719
719
|
q(g.$slots, "centerFooter"),
|
|
720
|
-
|
|
720
|
+
E(i(ie), D({
|
|
721
721
|
type: "primary",
|
|
722
722
|
loading: l.value || i(a).okLoading || i(a).confirmLoading
|
|
723
723
|
}, i(a).okButtonProps, { onClick: C }), {
|
|
@@ -817,8 +817,8 @@ const ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
817
817
|
Jt((y, c, m) => {
|
|
818
818
|
if (r.value)
|
|
819
819
|
return !1;
|
|
820
|
-
const
|
|
821
|
-
return r.value = !0, s.value = _t(
|
|
820
|
+
const f = y instanceof Error ? y : new Error(String(y));
|
|
821
|
+
return r.value = !0, s.value = _t(f), !1;
|
|
822
822
|
});
|
|
823
823
|
function l() {
|
|
824
824
|
r.value = !1, s.value = null, o("retry");
|
|
@@ -1057,7 +1057,7 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1057
1057
|
class: i(Pe)("relative overflow-hidden", n.class)
|
|
1058
1058
|
}), {
|
|
1059
1059
|
default: V(() => [
|
|
1060
|
-
|
|
1060
|
+
E(i(xn), {
|
|
1061
1061
|
"as-child": "",
|
|
1062
1062
|
class: "h-full w-full rounded-[inherit] focus:outline-none",
|
|
1063
1063
|
onScroll: e.onScroll
|
|
@@ -1067,8 +1067,8 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1067
1067
|
]),
|
|
1068
1068
|
_: 3
|
|
1069
1069
|
}, 8, ["onScroll"]),
|
|
1070
|
-
|
|
1071
|
-
|
|
1070
|
+
E(i(Ft)),
|
|
1071
|
+
E(i(En))
|
|
1072
1072
|
]),
|
|
1073
1073
|
_: 3
|
|
1074
1074
|
}, 16, ["class"]));
|
|
@@ -1097,7 +1097,7 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1097
1097
|
)
|
|
1098
1098
|
}), {
|
|
1099
1099
|
default: V(() => [
|
|
1100
|
-
|
|
1100
|
+
E(i(In), { class: "relative flex-1 rounded-full bg-border" })
|
|
1101
1101
|
]),
|
|
1102
1102
|
_: 1
|
|
1103
1103
|
}, 16, ["class"]));
|
|
@@ -1123,9 +1123,9 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1123
1123
|
"left-shadow": !l.value && y.value,
|
|
1124
1124
|
"right-shadow": !s.value && c.value
|
|
1125
1125
|
}));
|
|
1126
|
-
function
|
|
1127
|
-
const g = C.target, S = g?.scrollTop ?? 0, P = g?.scrollLeft ?? 0,
|
|
1128
|
-
r.value = S <= 0, l.value = P <= 0, a.value = Math.abs(S) +
|
|
1126
|
+
function f(C) {
|
|
1127
|
+
const g = C.target, S = g?.scrollTop ?? 0, P = g?.scrollLeft ?? 0, x = g?.clientHeight ?? 0, b = g?.clientWidth ?? 0, T = g?.scrollHeight ?? 0, v = g?.scrollWidth ?? 0;
|
|
1128
|
+
r.value = S <= 0, l.value = P <= 0, a.value = Math.abs(S) + x >= T - pt, s.value = Math.abs(P) + b >= v - pt, o("scrollAt", {
|
|
1129
1129
|
bottom: a.value,
|
|
1130
1130
|
left: l.value,
|
|
1131
1131
|
right: s.value,
|
|
@@ -1134,7 +1134,7 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1134
1134
|
}
|
|
1135
1135
|
return (C, g) => (I(), $(i(tr), {
|
|
1136
1136
|
class: G([[i(Pe)(t.class), m.value], "sunny-scrollbar relative"]),
|
|
1137
|
-
"on-scroll":
|
|
1137
|
+
"on-scroll": f
|
|
1138
1138
|
}, {
|
|
1139
1139
|
default: V(() => [
|
|
1140
1140
|
h.value ? (I(), O("div", {
|
|
@@ -1183,16 +1183,16 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1183
1183
|
ne(() => o.modelValue, (v) => {
|
|
1184
1184
|
try {
|
|
1185
1185
|
l.value = JSON.parse(v || "[]");
|
|
1186
|
-
} catch (
|
|
1187
|
-
console.warn("Failed to parse modelValue:",
|
|
1186
|
+
} catch (p) {
|
|
1187
|
+
console.warn("Failed to parse modelValue:", p), l.value = [];
|
|
1188
1188
|
}
|
|
1189
1189
|
}, { immediate: !0, deep: !0 });
|
|
1190
1190
|
const c = (v) => v, m = (v) => {
|
|
1191
1191
|
if (v === 0) return "0 B";
|
|
1192
|
-
const
|
|
1193
|
-
return (v / Math.pow(mt,
|
|
1194
|
-
},
|
|
1195
|
-
const
|
|
1192
|
+
const p = Math.floor(Math.log(v) / Math.log(mt));
|
|
1193
|
+
return (v / Math.pow(mt, p)).toPrecision(3) + " " + t[p];
|
|
1194
|
+
}, f = (v) => {
|
|
1195
|
+
const p = v.type || "", d = (v.name || "").split(".").pop()?.toLowerCase() || "", w = {
|
|
1196
1196
|
"vscode-icons:file-type-excel": ["xls", "xlsx", "csv"],
|
|
1197
1197
|
"vscode-icons:file-type-powerpoint": ["ppt", "pptx"],
|
|
1198
1198
|
"vscode-icons:file-type-text": ["txt"],
|
|
@@ -1201,57 +1201,57 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1201
1201
|
"vscode-icons:file-type-pdf": ["pdf"]
|
|
1202
1202
|
};
|
|
1203
1203
|
for (const [R, z] of Object.entries(w))
|
|
1204
|
-
if (z.includes(d) || z.some((F) =>
|
|
1204
|
+
if (z.includes(d) || z.some((F) => p.includes(F)))
|
|
1205
1205
|
return R;
|
|
1206
|
-
return
|
|
1206
|
+
return p.includes("excel") || p.includes("spreadsheet") ? "vscode-icons:file-type-excel" : p.includes("powerpoint") || p.includes("presentation") ? "vscode-icons:file-type-powerpoint" : p.includes("text/plain") ? "vscode-icons:file-type-text" : p.includes("word") || p.includes("document") ? "vscode-icons:file-type-word" : p.includes("zip") || p.includes("compressed") ? "vscode-icons:file-type-zip" : p.includes("pdf") ? "vscode-icons:file-type-pdf" : "vscode-icons:default-file";
|
|
1207
1207
|
}, C = () => {
|
|
1208
1208
|
const v = JSON.stringify(l.value);
|
|
1209
1209
|
r("update:modelValue", v), r("change", v);
|
|
1210
|
-
}, g = (v,
|
|
1211
|
-
if (
|
|
1210
|
+
}, g = (v, p) => {
|
|
1211
|
+
if (p.status !== "init") return;
|
|
1212
1212
|
if (l.value.length >= o.limit) {
|
|
1213
1213
|
_.error(`最多上传${o.limit}个文件`);
|
|
1214
1214
|
return;
|
|
1215
1215
|
}
|
|
1216
|
-
const
|
|
1217
|
-
if (
|
|
1218
|
-
_.error(`文件最大限制${m(
|
|
1216
|
+
const u = o.maxSize * 1024 * 1024;
|
|
1217
|
+
if (p.file.size > u) {
|
|
1218
|
+
_.error(`文件最大限制${m(u)}`);
|
|
1219
1219
|
return;
|
|
1220
1220
|
}
|
|
1221
1221
|
l.value.push({
|
|
1222
|
-
uid:
|
|
1223
|
-
name:
|
|
1224
|
-
size:
|
|
1225
|
-
type:
|
|
1226
|
-
file:
|
|
1222
|
+
uid: p.uid,
|
|
1223
|
+
name: p.name,
|
|
1224
|
+
size: p.file?.size,
|
|
1225
|
+
type: p.file?.type,
|
|
1226
|
+
file: p.file,
|
|
1227
1227
|
percentage: 0,
|
|
1228
1228
|
checked: !1
|
|
1229
1229
|
});
|
|
1230
1230
|
}, S = async () => {
|
|
1231
1231
|
if (l.value.length === 0) return;
|
|
1232
|
-
const v = l.value.filter((
|
|
1233
|
-
for (const
|
|
1234
|
-
const
|
|
1235
|
-
|
|
1232
|
+
const v = l.value.filter((p) => !p.url);
|
|
1233
|
+
for (const p of v) {
|
|
1234
|
+
const u = new FormData();
|
|
1235
|
+
u.append("fileName", p.file), u.append("encryptFile", a.value ? "1" : "0"), o.storeType && u.append("storeType", o.storeType), o.s3FileDir && u.append("s3FileDir", o.s3FileDir), o.preSigned && u.append("preSigned", o.preSigned), o.preSignedExpire && u.append("preSignedExpire", o.preSignedExpire);
|
|
1236
1236
|
try {
|
|
1237
|
-
const d = await he.post(o.action,
|
|
1237
|
+
const d = await he.post(o.action, u, {
|
|
1238
1238
|
onUploadProgress: (R) => {
|
|
1239
1239
|
if (R.total) {
|
|
1240
1240
|
const z = Math.floor(R.loaded / R.total * 100);
|
|
1241
|
-
|
|
1241
|
+
p.percentage = z;
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
1244
|
}), { data: w } = d;
|
|
1245
|
-
w.code === 200 ? (Object.assign(
|
|
1245
|
+
w.code === 200 ? (Object.assign(p, w.result), _.success(w.message || "上传成功")) : (_.error(w.message || "上传失败"), P(p.uid));
|
|
1246
1246
|
} catch {
|
|
1247
|
-
_.error("上传失败"), P(
|
|
1247
|
+
_.error("上传失败"), P(p.uid);
|
|
1248
1248
|
}
|
|
1249
1249
|
}
|
|
1250
1250
|
C();
|
|
1251
1251
|
}, P = (v) => {
|
|
1252
|
-
const
|
|
1253
|
-
|
|
1254
|
-
},
|
|
1252
|
+
const p = l.value.findIndex((u) => u.uid === v);
|
|
1253
|
+
p > -1 && l.value.splice(p, 1);
|
|
1254
|
+
}, x = (v, p) => {
|
|
1255
1255
|
v.url ? xe.confirm({
|
|
1256
1256
|
title: c("提示"),
|
|
1257
1257
|
content: c("是否删除该文件?"),
|
|
@@ -1259,39 +1259,39 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1259
1259
|
he.post(o.delAction, {
|
|
1260
1260
|
filePathList: [v.url],
|
|
1261
1261
|
storeType: o.storeType
|
|
1262
|
-
}).then((
|
|
1263
|
-
const { data: d } =
|
|
1264
|
-
_[d.success ? "success" : "error"](d.message), d.code === 200 && (l.value.splice(
|
|
1262
|
+
}).then((u) => {
|
|
1263
|
+
const { data: d } = u;
|
|
1264
|
+
_[d.success ? "success" : "error"](d.message), d.code === 200 && (l.value.splice(p, 1), C());
|
|
1265
1265
|
});
|
|
1266
1266
|
}
|
|
1267
|
-
}) : (l.value.splice(
|
|
1267
|
+
}) : (l.value.splice(p, 1), C());
|
|
1268
1268
|
}, b = () => {
|
|
1269
|
-
const v = l.value.every((
|
|
1270
|
-
l.value.forEach((
|
|
1269
|
+
const v = l.value.every((p) => p.checked);
|
|
1270
|
+
l.value.forEach((p) => p.checked = !v);
|
|
1271
1271
|
}, T = () => {
|
|
1272
|
-
const v = l.value.filter((
|
|
1272
|
+
const v = l.value.filter((p) => p.checked);
|
|
1273
1273
|
v.length !== 0 && xe.confirm({
|
|
1274
1274
|
title: c("提示"),
|
|
1275
1275
|
content: c("是否删除选中的文件?"),
|
|
1276
1276
|
onOk: () => {
|
|
1277
1277
|
h.value = !0;
|
|
1278
|
-
const
|
|
1279
|
-
|
|
1280
|
-
filePathList:
|
|
1278
|
+
const p = v.map((u) => u.url).filter(Boolean);
|
|
1279
|
+
p.length > 0 ? he.post(o.delAction, {
|
|
1280
|
+
filePathList: p,
|
|
1281
1281
|
storeType: o.storeType
|
|
1282
|
-
}).then((
|
|
1283
|
-
const { data: d } =
|
|
1282
|
+
}).then((u) => {
|
|
1283
|
+
const { data: d } = u;
|
|
1284
1284
|
_[d.success ? "success" : "error"](d.message), d.code === 200 && (l.value = l.value.filter((w) => !w.checked), C());
|
|
1285
1285
|
}).finally(() => {
|
|
1286
1286
|
h.value = !1;
|
|
1287
|
-
}) : (l.value = l.value.filter((
|
|
1287
|
+
}) : (l.value = l.value.filter((u) => !u.checked), C(), h.value = !1);
|
|
1288
1288
|
}
|
|
1289
1289
|
});
|
|
1290
1290
|
};
|
|
1291
|
-
return (v,
|
|
1291
|
+
return (v, p) => (I(), O("div", or, [
|
|
1292
1292
|
k("div", rr, L(c("附件")), 1),
|
|
1293
1293
|
Ze(k("div", sr, [
|
|
1294
|
-
|
|
1294
|
+
E(i(Me), {
|
|
1295
1295
|
"show-file-list": !1,
|
|
1296
1296
|
"auto-upload": !1,
|
|
1297
1297
|
multiple: "",
|
|
@@ -1300,7 +1300,7 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1300
1300
|
}, {
|
|
1301
1301
|
"upload-button": V(() => [
|
|
1302
1302
|
k("span", ar, [
|
|
1303
|
-
|
|
1303
|
+
E(i(go), { class: "mr-1 w-4 h-4" }),
|
|
1304
1304
|
ee(" " + L(c("选择附件")), 1)
|
|
1305
1305
|
])
|
|
1306
1306
|
]),
|
|
@@ -1308,9 +1308,9 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1308
1308
|
}, 8, ["accept"]),
|
|
1309
1309
|
k("span", {
|
|
1310
1310
|
class: G(["flex items-center mr-4 transition-colors", A.value ? "text-gray-300 cursor-not-allowed" : "cursor-pointer text-gray-600 hover:text-gray-800"]),
|
|
1311
|
-
onClick:
|
|
1311
|
+
onClick: p[0] || (p[0] = (u) => !A.value && S())
|
|
1312
1312
|
}, [
|
|
1313
|
-
|
|
1313
|
+
E(i(fo), { class: "mr-1 w-4 h-4" }),
|
|
1314
1314
|
ee(" " + L(c("上传附件")), 1)
|
|
1315
1315
|
], 2),
|
|
1316
1316
|
k("span", {
|
|
@@ -1324,7 +1324,7 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1324
1324
|
e.showEncrypt ? (I(), $(i(Le), {
|
|
1325
1325
|
key: 0,
|
|
1326
1326
|
modelValue: a.value,
|
|
1327
|
-
"onUpdate:modelValue":
|
|
1327
|
+
"onUpdate:modelValue": p[1] || (p[1] = (u) => a.value = u),
|
|
1328
1328
|
class: "mr-4"
|
|
1329
1329
|
}, {
|
|
1330
1330
|
default: V(() => [
|
|
@@ -1335,48 +1335,48 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1335
1335
|
k("span", ir, " (" + L(c("单个文件最大")) + L(e.maxSize) + "MB," + L(c("最多上传")) + L(e.limit) + L(c("个")) + ") ", 1),
|
|
1336
1336
|
k("span", {
|
|
1337
1337
|
class: "ml-auto cursor-pointer text-blue-600 text-xs hover:text-blue-700 transition-colors",
|
|
1338
|
-
onClick:
|
|
1338
|
+
onClick: p[2] || (p[2] = (u) => s.value = !s.value)
|
|
1339
1339
|
}, L(s.value ? c("隐藏") : c("展开")), 1)
|
|
1340
1340
|
], 512), [
|
|
1341
1341
|
[lt, !e.readonly]
|
|
1342
1342
|
]),
|
|
1343
1343
|
Ze(k("div", cr, [
|
|
1344
1344
|
k("div", ur, [
|
|
1345
|
-
(I(!0), O(se, null, te(l.value, (
|
|
1346
|
-
key:
|
|
1345
|
+
(I(!0), O(se, null, te(l.value, (u, d) => (I(), O("div", {
|
|
1346
|
+
key: u.uid || d,
|
|
1347
1347
|
class: "bg-gray-50 hover:bg-gray-100 rounded p-3 relative flex items-center border border-transparent hover:border-gray-200 transition-colors group"
|
|
1348
1348
|
}, [
|
|
1349
|
-
|
|
1350
|
-
icon:
|
|
1349
|
+
E(i(Nt), {
|
|
1350
|
+
icon: f(u),
|
|
1351
1351
|
class: "w-10 h-10 mr-3 flex-shrink-0"
|
|
1352
1352
|
}, null, 8, ["icon"]),
|
|
1353
1353
|
k("div", dr, [
|
|
1354
1354
|
k("div", {
|
|
1355
1355
|
class: "text-sm truncate font-medium text-gray-700 mb-1",
|
|
1356
|
-
title:
|
|
1357
|
-
}, L(
|
|
1356
|
+
title: u.name
|
|
1357
|
+
}, L(u.name), 9, fr),
|
|
1358
1358
|
k("div", pr, [
|
|
1359
|
-
k("span", mr, L(m(
|
|
1360
|
-
|
|
1361
|
-
percent:
|
|
1359
|
+
k("span", mr, L(m(u.size)), 1),
|
|
1360
|
+
E(i(Zt), {
|
|
1361
|
+
percent: u.percentage / 100,
|
|
1362
1362
|
size: "small",
|
|
1363
1363
|
"show-text": !1,
|
|
1364
|
-
color:
|
|
1364
|
+
color: u.percentage === 100 ? "#00b42a" : "#165dff",
|
|
1365
1365
|
class: "flex-1"
|
|
1366
1366
|
}, null, 8, ["percent", "color"]),
|
|
1367
|
-
k("span", hr, L(
|
|
1367
|
+
k("span", hr, L(u.percentage) + "%", 1)
|
|
1368
1368
|
])
|
|
1369
1369
|
]),
|
|
1370
1370
|
e.readonly ? W("", !0) : (I(), $(i(Le), {
|
|
1371
1371
|
key: 0,
|
|
1372
|
-
modelValue:
|
|
1373
|
-
"onUpdate:modelValue": (w) =>
|
|
1372
|
+
modelValue: u.checked,
|
|
1373
|
+
"onUpdate:modelValue": (w) => u.checked = w,
|
|
1374
1374
|
class: "absolute top-3 right-3"
|
|
1375
1375
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])),
|
|
1376
1376
|
e.readonly ? W("", !0) : (I(), $(i(Vt), {
|
|
1377
1377
|
key: 1,
|
|
1378
1378
|
class: "absolute bottom-3 right-3 w-4 h-4 cursor-pointer text-gray-400 hover:text-red-500 transition-colors",
|
|
1379
|
-
onClick: (w) =>
|
|
1379
|
+
onClick: (w) => x(u, d)
|
|
1380
1380
|
}, null, 8, ["onClick"]))
|
|
1381
1381
|
]))), 128))
|
|
1382
1382
|
])
|
|
@@ -1443,10 +1443,10 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1443
1443
|
_.error(`文件大小不能超过 ${t.maxSize} MB`), A();
|
|
1444
1444
|
return;
|
|
1445
1445
|
}
|
|
1446
|
-
var
|
|
1447
|
-
|
|
1446
|
+
var f = new FormData();
|
|
1447
|
+
f.append("fileName", c.file), f.append("encryptFile", t.encryptFile === !0 ? "1" : "0"), f.append("storeType", t.storeType), t.s3FileDir && f.append("s3FileDir", t.s3FileDir), t.preSigned && f.append("preSigned", t.preSigned === !0 ? "1" : "0"), t.preSignedExpire && f.append("preSignedExpire", String(t.preSignedExpire)), he.post(
|
|
1448
1448
|
t.action,
|
|
1449
|
-
|
|
1449
|
+
f,
|
|
1450
1450
|
{
|
|
1451
1451
|
onUploadProgress: (C) => {
|
|
1452
1452
|
const g = Math.floor(C.loaded / C.total * 100);
|
|
@@ -1483,13 +1483,13 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1483
1483
|
return (l, h) => {
|
|
1484
1484
|
const A = oe("a-button"), y = oe("a-upload"), c = oe("a-tag");
|
|
1485
1485
|
return I(), O("div", gr, [
|
|
1486
|
-
|
|
1486
|
+
E(y, {
|
|
1487
1487
|
"show-file-list": !1,
|
|
1488
1488
|
action: e.action,
|
|
1489
1489
|
"custom-request": s
|
|
1490
1490
|
}, {
|
|
1491
1491
|
"upload-button": V(() => [
|
|
1492
|
-
|
|
1492
|
+
E(A, {
|
|
1493
1493
|
type: "primary",
|
|
1494
1494
|
size: "mini"
|
|
1495
1495
|
}, {
|
|
@@ -1506,7 +1506,7 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1506
1506
|
loading: !1,
|
|
1507
1507
|
color: m.status === "error" ? "red" : "green",
|
|
1508
1508
|
closable: "",
|
|
1509
|
-
onClose: (
|
|
1509
|
+
onClose: (f) => a(m)
|
|
1510
1510
|
}, {
|
|
1511
1511
|
default: V(() => [
|
|
1512
1512
|
ee(L(m.name), 1)
|
|
@@ -1563,11 +1563,11 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1563
1563
|
const a = (l) => {
|
|
1564
1564
|
n("update:modelValue", l);
|
|
1565
1565
|
};
|
|
1566
|
-
return () =>
|
|
1566
|
+
return () => E(Ae, D(o, {
|
|
1567
1567
|
modelValue: s.value,
|
|
1568
1568
|
"onUpdate:modelValue": a
|
|
1569
1569
|
}), {
|
|
1570
|
-
default: () => e.options.map((l) => r(l) ?
|
|
1570
|
+
default: () => e.options.map((l) => r(l) ? E(je, D({
|
|
1571
1571
|
key: l.value
|
|
1572
1572
|
}, l), {
|
|
1573
1573
|
default: () => t.option ? t.option({
|
|
@@ -1603,60 +1603,60 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1603
1603
|
o("update:modelValue", c), o("change", c);
|
|
1604
1604
|
}, h = (c) => {
|
|
1605
1605
|
if (c === !0) {
|
|
1606
|
-
const
|
|
1607
|
-
const P = t.options.find((
|
|
1606
|
+
const f = r.value.map((S) => S.value), C = t.modelValue.filter((S) => {
|
|
1607
|
+
const P = t.options.find((x) => x.value === S);
|
|
1608
1608
|
return P && P.disabled;
|
|
1609
|
-
}), g = Array.from(/* @__PURE__ */ new Set([...C, ...
|
|
1609
|
+
}), g = Array.from(/* @__PURE__ */ new Set([...C, ...f]));
|
|
1610
1610
|
o("update:modelValue", g), o("change", g);
|
|
1611
1611
|
} else {
|
|
1612
|
-
const
|
|
1612
|
+
const f = t.modelValue.filter((C) => {
|
|
1613
1613
|
const g = t.options.find((S) => S.value === C);
|
|
1614
1614
|
return g && g.disabled;
|
|
1615
1615
|
});
|
|
1616
|
-
o("update:modelValue",
|
|
1616
|
+
o("update:modelValue", f), o("change", f);
|
|
1617
1617
|
}
|
|
1618
1618
|
}, A = () => {
|
|
1619
1619
|
const c = t.modelValue.filter((m) => {
|
|
1620
|
-
const
|
|
1621
|
-
return
|
|
1620
|
+
const f = t.options.find((C) => C.value === m);
|
|
1621
|
+
return f && f.disabled;
|
|
1622
1622
|
});
|
|
1623
1623
|
o("update:modelValue", c), o("change", c);
|
|
1624
1624
|
}, y = (c) => {
|
|
1625
1625
|
const m = c.clipboardData || window.clipboardData;
|
|
1626
1626
|
if (!m) return;
|
|
1627
|
-
const
|
|
1628
|
-
if (!
|
|
1629
|
-
const C =
|
|
1627
|
+
const f = m.getData("text");
|
|
1628
|
+
if (!f) return;
|
|
1629
|
+
const C = f.split(/\r?\n/).map((x) => x.trim()).filter((x) => x);
|
|
1630
1630
|
if (C.length === 0) return;
|
|
1631
1631
|
const g = [];
|
|
1632
1632
|
let S = 0;
|
|
1633
|
-
const P = (
|
|
1634
|
-
const b =
|
|
1633
|
+
const P = (x) => {
|
|
1634
|
+
const b = x.cMeta;
|
|
1635
1635
|
return !b || Object.keys(b).length === 0 ? !0 : !t.filterModel || Object.keys(t.filterModel).length === 0 ? !1 : Object.entries(b).every(([T, v]) => {
|
|
1636
|
-
const
|
|
1637
|
-
return
|
|
1636
|
+
const p = t.filterModel[T];
|
|
1637
|
+
return p == null ? !1 : String(p) === String(v);
|
|
1638
1638
|
});
|
|
1639
1639
|
};
|
|
1640
|
-
if (C.forEach((
|
|
1640
|
+
if (C.forEach((x) => {
|
|
1641
1641
|
if (t.matchStrategy === "value" || t.matchStrategy === "both") {
|
|
1642
|
-
const b = t.options.find((T) => String(T.value) ===
|
|
1642
|
+
const b = t.options.find((T) => String(T.value) === x);
|
|
1643
1643
|
if (b && !b.disabled && P(b)) {
|
|
1644
1644
|
g.push(b.value), S++;
|
|
1645
1645
|
return;
|
|
1646
1646
|
}
|
|
1647
1647
|
}
|
|
1648
1648
|
if (t.matchStrategy === "label" || t.matchStrategy === "both") {
|
|
1649
|
-
const b = t.options.find((T) => T.label ===
|
|
1649
|
+
const b = t.options.find((T) => T.label === x);
|
|
1650
1650
|
b && !b.disabled && P(b) && (g.push(b.value), S++);
|
|
1651
1651
|
}
|
|
1652
1652
|
}), g.length > 0) {
|
|
1653
1653
|
c.preventDefault();
|
|
1654
|
-
const
|
|
1655
|
-
o("update:modelValue",
|
|
1654
|
+
const x = Array.from(/* @__PURE__ */ new Set([...t.modelValue, ...g]));
|
|
1655
|
+
o("update:modelValue", x), o("change", x), _.success(`成功识别并选中 ${S} 项 (Matched ${S} items)`);
|
|
1656
1656
|
}
|
|
1657
1657
|
};
|
|
1658
1658
|
return (c, m) => {
|
|
1659
|
-
const
|
|
1659
|
+
const f = oe("a-checkbox"), C = oe("a-tooltip");
|
|
1660
1660
|
return I(), $(i(br), D(c.$attrs, {
|
|
1661
1661
|
"model-value": e.modelValue,
|
|
1662
1662
|
options: e.options,
|
|
@@ -1668,7 +1668,7 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1668
1668
|
}), pe({
|
|
1669
1669
|
header: V(() => [
|
|
1670
1670
|
k("div", Ar, [
|
|
1671
|
-
|
|
1671
|
+
E(f, {
|
|
1672
1672
|
"model-value": s.value,
|
|
1673
1673
|
indeterminate: a.value,
|
|
1674
1674
|
onChange: h,
|
|
@@ -1680,25 +1680,25 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1680
1680
|
_: 1
|
|
1681
1681
|
}, 8, ["model-value", "indeterminate"]),
|
|
1682
1682
|
k("div", Sr, [
|
|
1683
|
-
|
|
1683
|
+
E(C, { content: "清除所有选中项" }, {
|
|
1684
1684
|
default: V(() => [
|
|
1685
1685
|
k("div", {
|
|
1686
1686
|
class: "w-6 h-6 flex items-center justify-center rounded cursor-pointer text-[var(--color-text-3)] hover:bg-[var(--color-fill-3)] transition-all",
|
|
1687
1687
|
onClick: A
|
|
1688
1688
|
}, [
|
|
1689
|
-
|
|
1689
|
+
E(i(Vt))
|
|
1690
1690
|
])
|
|
1691
1691
|
]),
|
|
1692
1692
|
_: 1
|
|
1693
1693
|
}),
|
|
1694
1694
|
m[1] || (m[1] = k("div", { class: "w-[1px] h-3 bg-[var(--color-neutral-3)] mx-1" }, null, -1)),
|
|
1695
|
-
|
|
1695
|
+
E(C, {
|
|
1696
1696
|
content: "支持从 Excel 或文本编辑器(↓列数据)复制多行数据,粘贴至搜索框即可自动匹配并选中。",
|
|
1697
1697
|
position: "left"
|
|
1698
1698
|
}, {
|
|
1699
1699
|
default: V(() => [
|
|
1700
1700
|
k("div", Cr, [
|
|
1701
|
-
|
|
1701
|
+
E(i(Pt))
|
|
1702
1702
|
])
|
|
1703
1703
|
]),
|
|
1704
1704
|
_: 1
|
|
@@ -1739,16 +1739,16 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1739
1739
|
}))), l = (c) => {
|
|
1740
1740
|
t.disabled || ["Backspace", "Delete", "Tab", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"].includes(c.key) || c.preventDefault();
|
|
1741
1741
|
}, h = (c, m) => {
|
|
1742
|
-
const
|
|
1743
|
-
|
|
1742
|
+
const f = [...t.modelValue];
|
|
1743
|
+
f.splice(m, 1), o("update:modelValue", f), o("change", f);
|
|
1744
1744
|
}, A = () => {
|
|
1745
1745
|
o("update:modelValue", []), o("change", []), o("clear");
|
|
1746
1746
|
}, y = () => {
|
|
1747
1747
|
t.disabled || o("search");
|
|
1748
1748
|
};
|
|
1749
1749
|
return (c, m) => {
|
|
1750
|
-
const
|
|
1751
|
-
return I(), $(
|
|
1750
|
+
const f = oe("a-input-tag");
|
|
1751
|
+
return I(), $(f, D(c.$attrs, {
|
|
1752
1752
|
"model-value": a.value,
|
|
1753
1753
|
"input-value": "",
|
|
1754
1754
|
disabled: e.disabled,
|
|
@@ -1767,7 +1767,7 @@ const _o = ["aria-live", "aria-busy"], Yo = ["aria-label"], Go = {
|
|
|
1767
1767
|
]]),
|
|
1768
1768
|
onClick: ue(y, ["stop"])
|
|
1769
1769
|
}, [
|
|
1770
|
-
|
|
1770
|
+
E(i(ot), { class: "transition-colors group-hover:text-[var(--color-primary-6)]" })
|
|
1771
1771
|
], 2)
|
|
1772
1772
|
]),
|
|
1773
1773
|
_: 2
|
|
@@ -2545,34 +2545,34 @@ function Or(e) {
|
|
|
2545
2545
|
const r = B(() => n.value), s = B(() => e()), a = B(() => {
|
|
2546
2546
|
const m = s.value;
|
|
2547
2547
|
if (!m) return !0;
|
|
2548
|
-
const { if:
|
|
2549
|
-
return ae(
|
|
2548
|
+
const { if: f } = m, C = r.value;
|
|
2549
|
+
return ae(f) ? !!f(C, o) : Ue(f) ? f : !0;
|
|
2550
2550
|
}), l = B(() => {
|
|
2551
2551
|
const m = s.value;
|
|
2552
2552
|
if (!m) return !0;
|
|
2553
|
-
const { show:
|
|
2554
|
-
return ae(
|
|
2553
|
+
const { show: f } = m, C = r.value;
|
|
2554
|
+
return ae(f) ? !!f(C, o) : Ue(f) ? f : !0;
|
|
2555
2555
|
}), h = B(() => {
|
|
2556
2556
|
const m = s.value;
|
|
2557
2557
|
if (!m) return !1;
|
|
2558
|
-
const { disabled:
|
|
2559
|
-
return ae(
|
|
2558
|
+
const { disabled: f } = m, C = r.value;
|
|
2559
|
+
return ae(f) ? !!f(C, o) : Ue(f) ? f : !1;
|
|
2560
2560
|
}), A = B(() => {
|
|
2561
2561
|
const m = s.value;
|
|
2562
2562
|
if (!m) return !1;
|
|
2563
|
-
const { required:
|
|
2564
|
-
return ae(
|
|
2563
|
+
const { required: f } = m, C = r.value;
|
|
2564
|
+
return ae(f) ? !!f(C, o) : !1;
|
|
2565
2565
|
}), y = B(() => {
|
|
2566
2566
|
const m = s.value;
|
|
2567
2567
|
if (!m) return {};
|
|
2568
|
-
const { componentProps:
|
|
2569
|
-
return ae(
|
|
2568
|
+
const { componentProps: f } = m, C = r.value;
|
|
2569
|
+
return ae(f) ? f(C, o) || {} : {};
|
|
2570
2570
|
}), c = B(() => {
|
|
2571
2571
|
const m = s.value;
|
|
2572
2572
|
if (!m) return;
|
|
2573
|
-
const { rules:
|
|
2574
|
-
if (ae(
|
|
2575
|
-
return
|
|
2573
|
+
const { rules: f } = m, C = r.value;
|
|
2574
|
+
if (ae(f))
|
|
2575
|
+
return f(C, o);
|
|
2576
2576
|
});
|
|
2577
2577
|
return {
|
|
2578
2578
|
dynamicComponentProps: y,
|
|
@@ -2600,7 +2600,7 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2600
2600
|
// 是否渲染 (v-if)
|
|
2601
2601
|
isRequired: m,
|
|
2602
2602
|
// 是否必填
|
|
2603
|
-
isShow:
|
|
2603
|
+
isShow: f
|
|
2604
2604
|
// 是否显示 (v-show)
|
|
2605
2605
|
} = Or(() => n.schema.dependencies), C = B(() => {
|
|
2606
2606
|
const { component: F } = n.schema;
|
|
@@ -2613,9 +2613,9 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2613
2613
|
const F = n.schema.fieldName;
|
|
2614
2614
|
return F ? !!l[F] : !1;
|
|
2615
2615
|
}), P = (F, N) => {
|
|
2616
|
-
const
|
|
2617
|
-
if (!
|
|
2618
|
-
const
|
|
2616
|
+
const j = n.schema.fieldName;
|
|
2617
|
+
if (!j || !l || !l[j]) return null;
|
|
2618
|
+
const M = l[j], X = (H) => {
|
|
2619
2619
|
F.onInput(H);
|
|
2620
2620
|
}, Y = {
|
|
2621
2621
|
// 整个表单的值 (支持双向绑定)
|
|
@@ -2631,10 +2631,10 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2631
2631
|
// 原始 field 对象 (包含 onInput, onChange 等)
|
|
2632
2632
|
field: F,
|
|
2633
2633
|
// 组件属性
|
|
2634
|
-
componentProps:
|
|
2634
|
+
componentProps: u.value
|
|
2635
2635
|
};
|
|
2636
|
-
return
|
|
2637
|
-
},
|
|
2636
|
+
return M(Y);
|
|
2637
|
+
}, x = U({
|
|
2638
2638
|
name: "FieldSlotRenderer",
|
|
2639
2639
|
props: {
|
|
2640
2640
|
field: { type: Object, required: !0 },
|
|
@@ -2643,7 +2643,7 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2643
2643
|
setup(F) {
|
|
2644
2644
|
return () => P(F.field, F.errorMessage);
|
|
2645
2645
|
}
|
|
2646
|
-
}), b = B(() => n.schema.hidden ? !1 : c.value &&
|
|
2646
|
+
}), b = B(() => n.schema.hidden ? !1 : c.value && f.value), T = B(() => A.value || n.schema.rules), v = B(() => {
|
|
2647
2647
|
if (!b.value)
|
|
2648
2648
|
return !1;
|
|
2649
2649
|
if (!T.value)
|
|
@@ -2655,11 +2655,11 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2655
2655
|
const F = be(T.value);
|
|
2656
2656
|
let N = F?.isOptional?.();
|
|
2657
2657
|
if (F?._def?.typeName === "ZodDefault") {
|
|
2658
|
-
const
|
|
2659
|
-
|
|
2658
|
+
const M = F?._def.innerType;
|
|
2659
|
+
M && (N = M.isOptional?.());
|
|
2660
2660
|
}
|
|
2661
2661
|
return !N;
|
|
2662
|
-
}),
|
|
2662
|
+
}), p = B(() => {
|
|
2663
2663
|
if (!b.value)
|
|
2664
2664
|
return null;
|
|
2665
2665
|
let F = be(T.value);
|
|
@@ -2668,37 +2668,37 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2668
2668
|
if (ke(F))
|
|
2669
2669
|
return F;
|
|
2670
2670
|
if (!!v.value) {
|
|
2671
|
-
const
|
|
2672
|
-
|
|
2671
|
+
const j = F?.unwrap?.();
|
|
2672
|
+
j && (F = j);
|
|
2673
2673
|
}
|
|
2674
2674
|
return zn(F);
|
|
2675
|
-
}),
|
|
2676
|
-
const { componentProps: F, commonComponentProps: N } = n.schema,
|
|
2675
|
+
}), u = B(() => {
|
|
2676
|
+
const { componentProps: F, commonComponentProps: N } = n.schema, j = ae(F) ? F(t.value, a) : F;
|
|
2677
2677
|
return {
|
|
2678
2678
|
...N,
|
|
2679
|
-
...
|
|
2679
|
+
...j,
|
|
2680
2680
|
...h.value
|
|
2681
2681
|
};
|
|
2682
2682
|
}), d = (F) => {
|
|
2683
|
-
const N =
|
|
2683
|
+
const N = u.value, j = (X, Y) => (...H) => {
|
|
2684
2684
|
ae(X) && X(...H), Y(...H);
|
|
2685
|
-
},
|
|
2685
|
+
}, M = (X) => {
|
|
2686
2686
|
ae(N?.onInput) && N.onInput(X), F.onInput(X);
|
|
2687
2687
|
};
|
|
2688
2688
|
return {
|
|
2689
2689
|
...N,
|
|
2690
2690
|
// 合并 onInput 事件
|
|
2691
|
-
onInput:
|
|
2691
|
+
onInput: j(N?.onInput, F.onInput),
|
|
2692
2692
|
// 合并 onChange 事件
|
|
2693
|
-
onChange:
|
|
2693
|
+
onChange: j(N?.onChange, F.onChange),
|
|
2694
2694
|
// model-value 绑定
|
|
2695
2695
|
modelValue: F.value,
|
|
2696
2696
|
// update:modelValue 事件
|
|
2697
|
-
"onUpdate:modelValue":
|
|
2697
|
+
"onUpdate:modelValue": M
|
|
2698
2698
|
};
|
|
2699
2699
|
};
|
|
2700
2700
|
ne(
|
|
2701
|
-
() =>
|
|
2701
|
+
() => u.value?.autofocus,
|
|
2702
2702
|
(F) => {
|
|
2703
2703
|
F === !0 && me(() => {
|
|
2704
2704
|
});
|
|
@@ -2707,7 +2707,7 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2707
2707
|
);
|
|
2708
2708
|
const w = B(() => y.value || // 1. 依赖禁用(最高优先级)
|
|
2709
2709
|
n.schema.disabled || // 2. Schema 禁用
|
|
2710
|
-
|
|
2710
|
+
u.value?.disabled || // 3. Props 禁用
|
|
2711
2711
|
n.schema.formDisabled || // 4. 表单级禁用(来自 commonConfig.disabled)
|
|
2712
2712
|
r.value), R = B(() => {
|
|
2713
2713
|
if (!(s.value || !n.schema.labelWidth))
|
|
@@ -2730,15 +2730,15 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2730
2730
|
};
|
|
2731
2731
|
});
|
|
2732
2732
|
return (F, N) => {
|
|
2733
|
-
const
|
|
2733
|
+
const j = oe("a-form-item");
|
|
2734
2734
|
return b.value && e.schema.fieldName ? (I(), $(i(On), {
|
|
2735
2735
|
key: 0,
|
|
2736
2736
|
name: e.schema.fieldName,
|
|
2737
|
-
rules:
|
|
2737
|
+
rules: p.value,
|
|
2738
2738
|
label: e.schema.label
|
|
2739
2739
|
}, {
|
|
2740
|
-
default: V(({ field:
|
|
2741
|
-
|
|
2740
|
+
default: V(({ field: M, errorMessage: X }) => [
|
|
2741
|
+
E(j, D({
|
|
2742
2742
|
label: e.schema.label,
|
|
2743
2743
|
help: X || e.schema.help,
|
|
2744
2744
|
"validate-status": X ? "error" : void 0,
|
|
@@ -2747,11 +2747,11 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2747
2747
|
"wrapper-col-props": R.value
|
|
2748
2748
|
}, e.schema.formFieldProps), {
|
|
2749
2749
|
default: V(() => [
|
|
2750
|
-
S.value ? (I(), $(Xe(i(
|
|
2750
|
+
S.value ? (I(), $(Xe(i(x)), {
|
|
2751
2751
|
key: 0,
|
|
2752
|
-
field:
|
|
2752
|
+
field: M,
|
|
2753
2753
|
"error-message": X
|
|
2754
|
-
}, null, 8, ["field", "error-message"])) : (I(), $(Xe(C.value), D({ key: 1 }, d(
|
|
2754
|
+
}, null, 8, ["field", "error-message"])) : (I(), $(Xe(C.value), D({ key: 1 }, d(M), { disabled: w.value }), null, 16, ["disabled"]))
|
|
2755
2755
|
]),
|
|
2756
2756
|
_: 2
|
|
2757
2757
|
}, 1040, ["label", "help", "validate-status", "required", "label-col-props", "wrapper-col-props"])
|
|
@@ -2771,7 +2771,7 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2771
2771
|
setup(e, { expose: n, emit: t }) {
|
|
2772
2772
|
const o = e, r = t, { props: s } = Lt(), a = Qn(), l = B({
|
|
2773
2773
|
get: () => o.modelValue ?? !1,
|
|
2774
|
-
set: (
|
|
2774
|
+
set: (f) => r("update:modelValue", f)
|
|
2775
2775
|
}), h = B(() => ({
|
|
2776
2776
|
content: "重置",
|
|
2777
2777
|
show: !0,
|
|
@@ -2785,9 +2785,9 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2785
2785
|
htmlType: o.formApi ? "button" : "submit",
|
|
2786
2786
|
...i(s).submitButtonOptions
|
|
2787
2787
|
}));
|
|
2788
|
-
async function y(
|
|
2788
|
+
async function y(f) {
|
|
2789
2789
|
if (o.formApi) {
|
|
2790
|
-
|
|
2790
|
+
f?.preventDefault(), f?.stopPropagation();
|
|
2791
2791
|
const C = i(s), { valid: g } = await o.formApi.validate();
|
|
2792
2792
|
if (!g)
|
|
2793
2793
|
return;
|
|
@@ -2795,8 +2795,8 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2795
2795
|
await C.handleSubmit?.(S);
|
|
2796
2796
|
}
|
|
2797
2797
|
}
|
|
2798
|
-
async function c(
|
|
2799
|
-
|
|
2798
|
+
async function c(f) {
|
|
2799
|
+
f?.preventDefault(), f?.stopPropagation();
|
|
2800
2800
|
const C = i(s);
|
|
2801
2801
|
if (o.formApi) {
|
|
2802
2802
|
const g = be(await o.formApi.getValues()) ?? {};
|
|
@@ -2816,16 +2816,16 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2816
2816
|
}
|
|
2817
2817
|
);
|
|
2818
2818
|
const m = B(() => {
|
|
2819
|
-
const
|
|
2819
|
+
const f = i(s), C = f.actionPosition || "right", g = [
|
|
2820
2820
|
"flex",
|
|
2821
2821
|
"items-center",
|
|
2822
2822
|
"gap-3",
|
|
2823
2823
|
// 垂直布局时靠右,水平布局时靠左 (默认)
|
|
2824
|
-
|
|
2824
|
+
f.layout === "vertical" ? "self-end" : "self-start",
|
|
2825
2825
|
// 行内布局不需要宽度,其他情况占满
|
|
2826
|
-
|
|
2826
|
+
f.layout === "inline" ? "" : "w-full",
|
|
2827
2827
|
// 用户自定义类名
|
|
2828
|
-
|
|
2828
|
+
f.actionWrapperClass
|
|
2829
2829
|
];
|
|
2830
2830
|
switch (C) {
|
|
2831
2831
|
case "center": {
|
|
@@ -2846,11 +2846,11 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2846
2846
|
return n({
|
|
2847
2847
|
handleReset: c,
|
|
2848
2848
|
handleSubmit: y
|
|
2849
|
-
}), (
|
|
2849
|
+
}), (f, C) => (I(), O("div", {
|
|
2850
2850
|
class: G(m.value)
|
|
2851
2851
|
}, [
|
|
2852
2852
|
i(i(s)).actionButtonsReverse ? W("", !0) : (I(), O(se, { key: 0 }, [
|
|
2853
|
-
q(
|
|
2853
|
+
q(f.$slots, "submit-before"),
|
|
2854
2854
|
A.value.show ? (I(), $(i(ie), D({
|
|
2855
2855
|
key: 0,
|
|
2856
2856
|
type: "primary",
|
|
@@ -2858,7 +2858,7 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2858
2858
|
onClick: y
|
|
2859
2859
|
}, A.value), {
|
|
2860
2860
|
icon: V(() => [
|
|
2861
|
-
|
|
2861
|
+
E(i(ot))
|
|
2862
2862
|
]),
|
|
2863
2863
|
default: V(() => [
|
|
2864
2864
|
ee(" " + L(A.value.content), 1)
|
|
@@ -2866,14 +2866,14 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2866
2866
|
_: 1
|
|
2867
2867
|
}, 16, ["size"])) : W("", !0)
|
|
2868
2868
|
], 64)),
|
|
2869
|
-
q(
|
|
2869
|
+
q(f.$slots, "reset-before"),
|
|
2870
2870
|
h.value.show ? (I(), $(i(ie), D({
|
|
2871
2871
|
key: 1,
|
|
2872
2872
|
size: i(i(s)).size,
|
|
2873
2873
|
onClick: c
|
|
2874
2874
|
}, h.value), {
|
|
2875
2875
|
icon: V(() => [
|
|
2876
|
-
|
|
2876
|
+
E(i(ro))
|
|
2877
2877
|
]),
|
|
2878
2878
|
default: V(() => [
|
|
2879
2879
|
ee(" " + L(h.value.content), 1)
|
|
@@ -2881,7 +2881,7 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2881
2881
|
_: 1
|
|
2882
2882
|
}, 16, ["size"])) : W("", !0),
|
|
2883
2883
|
i(i(s)).actionButtonsReverse ? (I(), O(se, { key: 2 }, [
|
|
2884
|
-
q(
|
|
2884
|
+
q(f.$slots, "submit-before"),
|
|
2885
2885
|
A.value.show ? (I(), $(i(ie), D({
|
|
2886
2886
|
key: 0,
|
|
2887
2887
|
type: "primary",
|
|
@@ -2889,7 +2889,7 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2889
2889
|
onClick: y
|
|
2890
2890
|
}, A.value), {
|
|
2891
2891
|
icon: V(() => [
|
|
2892
|
-
|
|
2892
|
+
E(i(ot))
|
|
2893
2893
|
]),
|
|
2894
2894
|
default: V(() => [
|
|
2895
2895
|
ee(" " + L(A.value.content), 1)
|
|
@@ -2897,8 +2897,8 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2897
2897
|
_: 1
|
|
2898
2898
|
}, 16, ["size"])) : W("", !0)
|
|
2899
2899
|
], 64)) : W("", !0),
|
|
2900
|
-
q(
|
|
2901
|
-
q(
|
|
2900
|
+
q(f.$slots, "expand-before"),
|
|
2901
|
+
q(f.$slots, "search-plan", {}, () => [
|
|
2902
2902
|
o.searchPlanConfig?.enable ? (I(), $(i(da), {
|
|
2903
2903
|
key: 0,
|
|
2904
2904
|
"form-config": o.searchPlanConfig.formConfig,
|
|
@@ -2919,7 +2919,7 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2919
2919
|
onClick: g,
|
|
2920
2920
|
title: "查询方案"
|
|
2921
2921
|
}, [
|
|
2922
|
-
|
|
2922
|
+
E(i(Nt), {
|
|
2923
2923
|
icon: "lucide:filter",
|
|
2924
2924
|
class: "w-4 h-4"
|
|
2925
2925
|
})
|
|
@@ -2935,7 +2935,7 @@ const Qr = /* @__PURE__ */ U({
|
|
|
2935
2935
|
}, [
|
|
2936
2936
|
k("span", null, L(l.value ? "展开" : "收起"), 1)
|
|
2937
2937
|
])) : W("", !0),
|
|
2938
|
-
q(
|
|
2938
|
+
q(f.$slots, "expand-after")
|
|
2939
2939
|
], 2));
|
|
2940
2940
|
}
|
|
2941
2941
|
});
|
|
@@ -2973,7 +2973,7 @@ function Dr(e) {
|
|
|
2973
2973
|
if (l) {
|
|
2974
2974
|
const y = ["xxl", "xl", "lg", "md", "sm", "xs"], c = y.indexOf(A);
|
|
2975
2975
|
for (let m = c; m < y.length; m++) {
|
|
2976
|
-
const
|
|
2976
|
+
const f = y[m], C = l[f];
|
|
2977
2977
|
if (C !== void 0)
|
|
2978
2978
|
return typeof C == "object" ? C.span ?? 24 : C;
|
|
2979
2979
|
}
|
|
@@ -3004,101 +3004,101 @@ const Ur = { class: "h-full flex flex-col justify-end" }, zt = /* @__PURE__ */ U
|
|
|
3004
3004
|
const { spans: h, actionSpan: A } = Dr(l), y = B(() => {
|
|
3005
3005
|
const {
|
|
3006
3006
|
commonConfig: u = {},
|
|
3007
|
-
labelWidth:
|
|
3008
|
-
schema:
|
|
3007
|
+
labelWidth: d,
|
|
3008
|
+
schema: w = []
|
|
3009
3009
|
} = l, {
|
|
3010
|
-
componentProps:
|
|
3011
|
-
formFieldProps:
|
|
3012
|
-
disabled:
|
|
3010
|
+
componentProps: R = {},
|
|
3011
|
+
formFieldProps: z = {},
|
|
3012
|
+
disabled: F,
|
|
3013
3013
|
// ✅ 新增:提取表单级 disabled
|
|
3014
|
-
...
|
|
3015
|
-
} = u,
|
|
3016
|
-
return
|
|
3014
|
+
...N
|
|
3015
|
+
} = u, j = { ...N };
|
|
3016
|
+
return d !== void 0 && Object.assign(j, { labelWidth: d }), w.map((M) => ({
|
|
3017
3017
|
// 合并策略:全局配置 (Global) < 表单项自身配置 (Item)
|
|
3018
|
-
...
|
|
3018
|
+
...j,
|
|
3019
3019
|
...M,
|
|
3020
3020
|
// ✅ 注入表单级禁用状态 (form-level disabled)
|
|
3021
|
-
formDisabled:
|
|
3021
|
+
formDisabled: F,
|
|
3022
3022
|
// 显隐逻辑:优先使用 hidden 属性,回退到 hide 属性
|
|
3023
3023
|
hidden: M.hidden ?? M.hide,
|
|
3024
3024
|
// 注入通用组件属性
|
|
3025
3025
|
// 注意:这里只是透传,最终合并逻辑在 FormField 组件内部进行
|
|
3026
|
-
commonComponentProps:
|
|
3026
|
+
commonComponentProps: R,
|
|
3027
3027
|
// 合并表单项容器属性 (Wrapper Props)
|
|
3028
3028
|
// 直接在此处合并全局配置和局部配置,减少下层组件的计算负担
|
|
3029
3029
|
formFieldProps: {
|
|
3030
|
-
...
|
|
3030
|
+
...z,
|
|
3031
3031
|
...M.formFieldProps || {}
|
|
3032
3032
|
},
|
|
3033
3033
|
// 显式保留组件原本的 props,防止在合并过程中被意外覆盖
|
|
3034
3034
|
componentProps: M.componentProps
|
|
3035
3035
|
}));
|
|
3036
|
-
}), c = B(() => l.layout === "inline"),
|
|
3036
|
+
}), c = B(() => l.layout === "inline"), m = o.form || wt({
|
|
3037
3037
|
// 提取默认值构建初始状态
|
|
3038
|
-
initialValues: y.value.reduce((u,
|
|
3039
|
-
});
|
|
3040
|
-
n({
|
|
3038
|
+
initialValues: y.value.reduce((u, d) => (d.fieldName && (u[d.fieldName] = d.defaultValue), u), {})
|
|
3039
|
+
}), { handleSubmit: f, resetForm: C, setValues: g, values: S, validate: P, errors: x, meta: b } = m;
|
|
3040
|
+
l.form = m, n({
|
|
3041
3041
|
/**
|
|
3042
3042
|
* 验证表单
|
|
3043
3043
|
* @returns Promise<{ valid: boolean; errors: Record<string, string> }>
|
|
3044
3044
|
*/
|
|
3045
3045
|
validate: async () => ({
|
|
3046
|
-
valid: (await
|
|
3047
|
-
errors:
|
|
3046
|
+
valid: (await P()).valid,
|
|
3047
|
+
errors: x.value
|
|
3048
3048
|
}),
|
|
3049
3049
|
/**
|
|
3050
3050
|
* 获取 handleSubmit 方法(用于外部触发表单提交)
|
|
3051
3051
|
*/
|
|
3052
|
-
handleSubmit:
|
|
3052
|
+
handleSubmit: f
|
|
3053
3053
|
}), Ie(() => {
|
|
3054
3054
|
o.formApi && o.formApi.mount({
|
|
3055
|
-
handleSubmit:
|
|
3056
|
-
resetForm:
|
|
3057
|
-
setValues:
|
|
3058
|
-
values:
|
|
3059
|
-
validate:
|
|
3060
|
-
errors:
|
|
3061
|
-
meta:
|
|
3055
|
+
handleSubmit: f,
|
|
3056
|
+
resetForm: C,
|
|
3057
|
+
setValues: g,
|
|
3058
|
+
values: S,
|
|
3059
|
+
validate: P,
|
|
3060
|
+
errors: x,
|
|
3061
|
+
meta: b
|
|
3062
3062
|
});
|
|
3063
3063
|
});
|
|
3064
|
-
const
|
|
3064
|
+
const T = f((u) => {
|
|
3065
3065
|
r("submit", u), l.handleSubmit && l.handleSubmit(u);
|
|
3066
|
-
}),
|
|
3066
|
+
}), v = (u) => {
|
|
3067
3067
|
l.collapsed = u, l.handleCollapsedChange?.(u), o.formApi && o.formApi.setState({ collapsed: u });
|
|
3068
|
-
},
|
|
3069
|
-
const { compact: u, gridProps:
|
|
3070
|
-
return { x:
|
|
3068
|
+
}, p = B(() => {
|
|
3069
|
+
const { compact: u, gridProps: d } = l, w = u ? 8 : 16, R = d?.xGap ?? d?.["x-gap"] ?? w, z = d?.yGap ?? d?.["y-gap"] ?? w;
|
|
3070
|
+
return { x: R, y: z };
|
|
3071
3071
|
});
|
|
3072
|
-
return (u,
|
|
3073
|
-
const
|
|
3074
|
-
return I(), $(
|
|
3072
|
+
return (u, d) => {
|
|
3073
|
+
const w = oe("a-col"), R = oe("a-row"), z = oe("a-form");
|
|
3074
|
+
return I(), $(z, {
|
|
3075
3075
|
model: {},
|
|
3076
3076
|
layout: i(a).layout || "horizontal",
|
|
3077
3077
|
size: i(a).size || "small",
|
|
3078
3078
|
class: "arco-form",
|
|
3079
|
-
onSubmit:
|
|
3079
|
+
onSubmit: d[0] || (d[0] = (F, N) => i(T)(N))
|
|
3080
3080
|
}, {
|
|
3081
3081
|
default: V(() => [
|
|
3082
|
-
|
|
3083
|
-
gutter: [
|
|
3082
|
+
E(R, {
|
|
3083
|
+
gutter: [p.value.x, p.value.y],
|
|
3084
3084
|
class: G(l.wrapperClass),
|
|
3085
3085
|
align: (l.layout || "horizontal") === "vertical" ? "stretch" : void 0
|
|
3086
3086
|
}, {
|
|
3087
3087
|
default: V(() => [
|
|
3088
|
-
(I(!0), O(se, null, te(y.value, (
|
|
3089
|
-
key:
|
|
3088
|
+
(I(!0), O(se, null, te(y.value, (F, N) => (I(), O(se, {
|
|
3089
|
+
key: F.fieldName || N
|
|
3090
3090
|
}, [
|
|
3091
|
-
|
|
3091
|
+
F.fieldName && !F.hidden && (!l.collapsed || N < 24 / (i(h)[F.fieldName] ?? 24) * (l.collapsedRows ?? 1) - 1) ? (I(), $(w, {
|
|
3092
3092
|
key: 0,
|
|
3093
|
-
span: i(h)[
|
|
3093
|
+
span: i(h)[F.fieldName] ?? (c.value ? void 0 : 24)
|
|
3094
3094
|
}, {
|
|
3095
3095
|
default: V(() => [
|
|
3096
|
-
|
|
3096
|
+
E(Qr, { schema: F }, null, 8, ["schema"])
|
|
3097
3097
|
]),
|
|
3098
3098
|
_: 2
|
|
3099
3099
|
}, 1032, ["span"])) : W("", !0)
|
|
3100
3100
|
], 64))), 128)),
|
|
3101
|
-
l.showDefaultActions || i(s).actions ? (I(), $(
|
|
3101
|
+
l.showDefaultActions || i(s).actions ? (I(), $(w, {
|
|
3102
3102
|
key: 0,
|
|
3103
3103
|
span: i(A),
|
|
3104
3104
|
style: ce(c.value ? { marginLeft: "16px" } : { flex: 1, textAlign: "right" })
|
|
@@ -3112,7 +3112,7 @@ const Ur = { class: "h-full flex flex-col justify-end" }, zt = /* @__PURE__ */ U
|
|
|
3112
3112
|
}) : (I(), $(Qt, {
|
|
3113
3113
|
key: 1,
|
|
3114
3114
|
"model-value": l.collapsed,
|
|
3115
|
-
"onUpdate:modelValue":
|
|
3115
|
+
"onUpdate:modelValue": v,
|
|
3116
3116
|
"form-api": o.formApi,
|
|
3117
3117
|
"search-plan-config": l.searchPlanConfig
|
|
3118
3118
|
}, pe({ _: 2 }, [
|
|
@@ -3197,7 +3197,7 @@ const Ur = { class: "h-full flex flex-col justify-end" }, zt = /* @__PURE__ */ U
|
|
|
3197
3197
|
},
|
|
3198
3198
|
setup(e) {
|
|
3199
3199
|
const n = e, t = n.formApi.useStore?.() || B(() => ({})), o = B(() => {
|
|
3200
|
-
const y = Object.entries(n).reduce((c, [m,
|
|
3200
|
+
const y = Object.entries(n).reduce((c, [m, f]) => (f !== void 0 && (c[m] = f), c), {});
|
|
3201
3201
|
return { ...t.value, ...y };
|
|
3202
3202
|
}), r = /* @__PURE__ */ new Map(), { delegatedSlots: s, form: a } = Mr(o);
|
|
3203
3203
|
Ot(o), Rr(r), yt(() => {
|
|
@@ -3209,17 +3209,17 @@ const Ur = { class: "h-full flex flex-col justify-end" }, zt = /* @__PURE__ */ U
|
|
|
3209
3209
|
() => a.values,
|
|
3210
3210
|
async (y) => {
|
|
3211
3211
|
if (n.formApi.setState({ values: Ne(y) }), h(), !o.value.handleValuesChange) return;
|
|
3212
|
-
const c = o.value.schema?.map((
|
|
3212
|
+
const c = o.value.schema?.map((f) => f.fieldName) || [];
|
|
3213
3213
|
if (c.length === 0) return;
|
|
3214
3214
|
const m = [];
|
|
3215
|
-
for (const
|
|
3216
|
-
const C = dt(y,
|
|
3217
|
-
An(C, g) || (m.push(
|
|
3215
|
+
for (const f of c) {
|
|
3216
|
+
const C = dt(y, f), g = dt(l, f);
|
|
3217
|
+
An(C, g) || (m.push(f), Sn(l, f, C));
|
|
3218
3218
|
}
|
|
3219
3219
|
if (m.length > 0) {
|
|
3220
|
-
const
|
|
3220
|
+
const f = await n.formApi.getValues();
|
|
3221
3221
|
o.value.handleValuesChange(
|
|
3222
|
-
Ne(
|
|
3222
|
+
Ne(f ?? {}),
|
|
3223
3223
|
m
|
|
3224
3224
|
);
|
|
3225
3225
|
}
|
|
@@ -3236,7 +3236,7 @@ const Ur = { class: "h-full flex flex-col justify-end" }, zt = /* @__PURE__ */ U
|
|
|
3236
3236
|
return (y, c) => (I(), O("div", {
|
|
3237
3237
|
class: G(o.value.wrapperClass)
|
|
3238
3238
|
}, [
|
|
3239
|
-
|
|
3239
|
+
E(zt, D(o.value, {
|
|
3240
3240
|
form: i(a),
|
|
3241
3241
|
"form-api": n.formApi,
|
|
3242
3242
|
onKeydown: bt(A, ["enter"])
|
|
@@ -3246,8 +3246,8 @@ const Ur = { class: "h-full flex flex-col justify-end" }, zt = /* @__PURE__ */ U
|
|
|
3246
3246
|
}, [
|
|
3247
3247
|
te(i(s), (m) => ({
|
|
3248
3248
|
name: m,
|
|
3249
|
-
fn: V((
|
|
3250
|
-
q(y.$slots, m, le(fe(
|
|
3249
|
+
fn: V((f) => [
|
|
3250
|
+
q(y.$slots, m, le(fe(f)))
|
|
3251
3251
|
])
|
|
3252
3252
|
}))
|
|
3253
3253
|
]), 1040, ["form", "form-api"])
|
|
@@ -3349,7 +3349,7 @@ const qr = /* @__PURE__ */ U({
|
|
|
3349
3349
|
}), (c, m) => (I(), O("div", {
|
|
3350
3350
|
class: G(o.wrapperClass)
|
|
3351
3351
|
}, [
|
|
3352
|
-
|
|
3352
|
+
E(zt, {
|
|
3353
3353
|
ref_key: "formRenderRef",
|
|
3354
3354
|
ref: a,
|
|
3355
3355
|
onSubmit: A
|
|
@@ -3379,7 +3379,7 @@ const qr = /* @__PURE__ */ U({
|
|
|
3379
3379
|
]),
|
|
3380
3380
|
_: 2
|
|
3381
3381
|
}, [
|
|
3382
|
-
te(i(s), (
|
|
3382
|
+
te(i(s), (f, C) => ({
|
|
3383
3383
|
name: C,
|
|
3384
3384
|
fn: V((g) => [
|
|
3385
3385
|
q(c.$slots, C, le(fe(g)))
|
|
@@ -3472,7 +3472,7 @@ const Jr = /* @__PURE__ */ U({
|
|
|
3472
3472
|
const s = oe("a-config-provider");
|
|
3473
3473
|
return I(), $(s, { size: "small" }, {
|
|
3474
3474
|
default: V(() => [
|
|
3475
|
-
|
|
3475
|
+
E(i(Et), D({
|
|
3476
3476
|
ref_key: "gridRef",
|
|
3477
3477
|
ref: t
|
|
3478
3478
|
}, o.$attrs), pe({ _: 2 }, [
|
|
@@ -3494,8 +3494,8 @@ function Ja(e) {
|
|
|
3494
3494
|
return [U(
|
|
3495
3495
|
(r, { attrs: s, slots: a }) => {
|
|
3496
3496
|
const { gridEvents: l, gridOptions: h } = e, A = Object.entries(l || {}).reduce((y, [c, m]) => {
|
|
3497
|
-
const
|
|
3498
|
-
return y[
|
|
3497
|
+
const f = `on${c.charAt(0).toUpperCase() + c.slice(1)}`;
|
|
3498
|
+
return y[f] = m, y;
|
|
3499
3499
|
}, {});
|
|
3500
3500
|
return () => Ce(Jr, { ref: n, ...r, ...s, ...h, ...A }, a);
|
|
3501
3501
|
}
|
|
@@ -3509,7 +3509,7 @@ const _r = {
|
|
|
3509
3509
|
column: n
|
|
3510
3510
|
}) => {
|
|
3511
3511
|
const t = e[n.field], r = n.params?.options?.find((s) => s.value === t);
|
|
3512
|
-
return [
|
|
3512
|
+
return [E("span", null, [r?.label ?? t])];
|
|
3513
3513
|
}
|
|
3514
3514
|
}
|
|
3515
3515
|
}, Yr = {
|
|
@@ -3518,7 +3518,7 @@ const _r = {
|
|
|
3518
3518
|
default: ({
|
|
3519
3519
|
row: e,
|
|
3520
3520
|
column: n
|
|
3521
|
-
}) => [
|
|
3521
|
+
}) => [E("span", null, [e[n.field]])]
|
|
3522
3522
|
}
|
|
3523
3523
|
}, Gr = {
|
|
3524
3524
|
editRender: {},
|
|
@@ -3526,11 +3526,11 @@ const _r = {
|
|
|
3526
3526
|
default: ({
|
|
3527
3527
|
row: e,
|
|
3528
3528
|
column: n
|
|
3529
|
-
}) => [
|
|
3529
|
+
}) => [E("span", null, [e[n.field]])],
|
|
3530
3530
|
edit: ({
|
|
3531
3531
|
row: e,
|
|
3532
3532
|
column: n
|
|
3533
|
-
}) => [
|
|
3533
|
+
}) => [E(De, D({
|
|
3534
3534
|
modelValue: e[n.field],
|
|
3535
3535
|
"onUpdate:modelValue": (t) => {
|
|
3536
3536
|
e[n.field] = t;
|
|
@@ -3545,12 +3545,12 @@ const _r = {
|
|
|
3545
3545
|
column: n
|
|
3546
3546
|
}) => {
|
|
3547
3547
|
const t = e[n.field], r = n.params?.options?.find((s) => s.value === t);
|
|
3548
|
-
return [
|
|
3548
|
+
return [E("span", null, [r?.label ?? t])];
|
|
3549
3549
|
},
|
|
3550
3550
|
edit: ({
|
|
3551
3551
|
row: e,
|
|
3552
3552
|
column: n
|
|
3553
|
-
}) => [
|
|
3553
|
+
}) => [E(Ae, D({
|
|
3554
3554
|
modelValue: e[n.field],
|
|
3555
3555
|
"onUpdate:modelValue": (t) => {
|
|
3556
3556
|
e[n.field] = t;
|
|
@@ -3563,11 +3563,11 @@ const _r = {
|
|
|
3563
3563
|
default: ({
|
|
3564
3564
|
row: e,
|
|
3565
3565
|
column: n
|
|
3566
|
-
}) => [
|
|
3566
|
+
}) => [E("span", null, [e[n.field]])],
|
|
3567
3567
|
edit: ({
|
|
3568
3568
|
row: e,
|
|
3569
3569
|
column: n
|
|
3570
|
-
}) => [
|
|
3570
|
+
}) => [E(et, D({
|
|
3571
3571
|
modelValue: e[n.field],
|
|
3572
3572
|
"onUpdate:modelValue": (t) => {
|
|
3573
3573
|
e[n.field] = t;
|
|
@@ -3580,11 +3580,11 @@ const _r = {
|
|
|
3580
3580
|
default: ({
|
|
3581
3581
|
row: e,
|
|
3582
3582
|
column: n
|
|
3583
|
-
}) => [
|
|
3583
|
+
}) => [E("span", null, [e[n.field]])],
|
|
3584
3584
|
edit: ({
|
|
3585
3585
|
row: e,
|
|
3586
3586
|
column: n
|
|
3587
|
-
}) => [
|
|
3587
|
+
}) => [E(ln, D({
|
|
3588
3588
|
modelValue: e[n.field],
|
|
3589
3589
|
"onUpdate:modelValue": (t) => {
|
|
3590
3590
|
e[n.field] = t;
|
|
@@ -3597,11 +3597,11 @@ const _r = {
|
|
|
3597
3597
|
default: ({
|
|
3598
3598
|
row: e,
|
|
3599
3599
|
column: n
|
|
3600
|
-
}) => [
|
|
3600
|
+
}) => [E("span", null, [e[n.field]])],
|
|
3601
3601
|
edit: ({
|
|
3602
3602
|
row: e,
|
|
3603
3603
|
column: n
|
|
3604
|
-
}) => [
|
|
3604
|
+
}) => [E(dn, D({
|
|
3605
3605
|
modelValue: e[n.field],
|
|
3606
3606
|
"onUpdate:modelValue": (t) => {
|
|
3607
3607
|
e[n.field] = t;
|
|
@@ -3614,11 +3614,11 @@ const _r = {
|
|
|
3614
3614
|
default: ({
|
|
3615
3615
|
row: e,
|
|
3616
3616
|
column: n
|
|
3617
|
-
}) => [
|
|
3617
|
+
}) => [E("span", null, [e[n.field]])],
|
|
3618
3618
|
edit: ({
|
|
3619
3619
|
row: e,
|
|
3620
3620
|
column: n
|
|
3621
|
-
}) => [
|
|
3621
|
+
}) => [E(un, D({
|
|
3622
3622
|
modelValue: e[n.field],
|
|
3623
3623
|
"onUpdate:modelValue": (t) => {
|
|
3624
3624
|
e[n.field] = t;
|
|
@@ -3639,7 +3639,7 @@ const _r = {
|
|
|
3639
3639
|
o = [r, s];
|
|
3640
3640
|
} else
|
|
3641
3641
|
o = e[n.field];
|
|
3642
|
-
return [
|
|
3642
|
+
return [E("span", null, [tt(o) ? o.join(" / ") : o])];
|
|
3643
3643
|
},
|
|
3644
3644
|
edit: ({
|
|
3645
3645
|
row: e,
|
|
@@ -3652,7 +3652,7 @@ const _r = {
|
|
|
3652
3652
|
o = [r, s];
|
|
3653
3653
|
} else
|
|
3654
3654
|
o = e[n.field];
|
|
3655
|
-
return [
|
|
3655
|
+
return [E(St, D({
|
|
3656
3656
|
modelValue: o,
|
|
3657
3657
|
"onUpdate:modelValue": (r) => {
|
|
3658
3658
|
t ? tt(r) && r.length === 2 ? (e[t.start] = r[0], e[t.end] = r[1]) : (e[t.start] = void 0, e[t.end] = void 0) : e[n.field] = r;
|
|
@@ -3673,12 +3673,12 @@ const _r = {
|
|
|
3673
3673
|
uncheckedValue: r,
|
|
3674
3674
|
uncheckedText: s
|
|
3675
3675
|
} = n.params || {}, a = e[n.field];
|
|
3676
|
-
return t !== void 0 && o !== void 0 && a === t ? [
|
|
3676
|
+
return t !== void 0 && o !== void 0 && a === t ? [E("span", null, [o])] : r !== void 0 && s !== void 0 && a === r ? [E("span", null, [s])] : [E("span", null, [a])];
|
|
3677
3677
|
},
|
|
3678
3678
|
edit: ({
|
|
3679
3679
|
row: e,
|
|
3680
3680
|
column: n
|
|
3681
|
-
}) => [
|
|
3681
|
+
}) => [E(Oe, D({
|
|
3682
3682
|
modelValue: e[n.field],
|
|
3683
3683
|
"onUpdate:modelValue": (t) => {
|
|
3684
3684
|
e[n.field] = t;
|
|
@@ -3691,13 +3691,13 @@ const _r = {
|
|
|
3691
3691
|
default: ({
|
|
3692
3692
|
row: e,
|
|
3693
3693
|
column: n
|
|
3694
|
-
}) => [
|
|
3694
|
+
}) => [E("span", null, [e[n.field]])],
|
|
3695
3695
|
edit: ({
|
|
3696
3696
|
row: e,
|
|
3697
3697
|
column: n
|
|
3698
3698
|
}) => {
|
|
3699
3699
|
const t = e[n.field], o = typeof t == "string" && t !== "" ? Number(t) : t;
|
|
3700
|
-
return [
|
|
3700
|
+
return [E(Ee, D({
|
|
3701
3701
|
modelValue: o,
|
|
3702
3702
|
"onUpdate:modelValue": (r) => {
|
|
3703
3703
|
typeof t == "string" && r !== null && r !== void 0 ? e[n.field] = String(r) : e[n.field] = r;
|
|
@@ -3719,7 +3719,7 @@ const _r = {
|
|
|
3719
3719
|
o = [r, s];
|
|
3720
3720
|
} else
|
|
3721
3721
|
o = e[n.field];
|
|
3722
|
-
return [
|
|
3722
|
+
return [E("span", null, [tt(o) ? o.join(" ~ ") : o])];
|
|
3723
3723
|
},
|
|
3724
3724
|
edit: ({
|
|
3725
3725
|
row: e,
|
|
@@ -3728,18 +3728,18 @@ const _r = {
|
|
|
3728
3728
|
const t = n.params?.fieldNames, o = n.params?.inputType || "input", r = o === "number" ? Ee : De;
|
|
3729
3729
|
if (t) {
|
|
3730
3730
|
const l = e[t.start], h = e[t.end], A = o === "number" && typeof l == "string" && l !== "" ? Number(l) : l, y = o === "number" && typeof h == "string" && h !== "" ? Number(h) : h;
|
|
3731
|
-
return [
|
|
3731
|
+
return [E("div", {
|
|
3732
3732
|
style: {
|
|
3733
3733
|
display: "flex",
|
|
3734
3734
|
alignItems: "center",
|
|
3735
3735
|
gap: "8px"
|
|
3736
3736
|
}
|
|
3737
|
-
}, [
|
|
3737
|
+
}, [E(r, D({
|
|
3738
3738
|
modelValue: A,
|
|
3739
3739
|
"onUpdate:modelValue": (c) => {
|
|
3740
3740
|
o === "number" && typeof l == "string" && c !== null && c !== void 0 ? e[t.start] = String(c) : e[t.start] = c;
|
|
3741
3741
|
}
|
|
3742
|
-
}, n.params), null),
|
|
3742
|
+
}, n.params), null), E("span", null, [ee("~")]), E(r, D({
|
|
3743
3743
|
modelValue: y,
|
|
3744
3744
|
"onUpdate:modelValue": (c) => {
|
|
3745
3745
|
o === "number" && typeof h == "string" && c !== null && c !== void 0 ? e[t.end] = String(c) : e[t.end] = c;
|
|
@@ -3747,7 +3747,7 @@ const _r = {
|
|
|
3747
3747
|
}, n.params), null)])];
|
|
3748
3748
|
}
|
|
3749
3749
|
const s = e[n.field], a = o === "number" && typeof s == "string" && s !== "" ? Number(s) : s;
|
|
3750
|
-
return [
|
|
3750
|
+
return [E(r, D({
|
|
3751
3751
|
modelValue: a,
|
|
3752
3752
|
"onUpdate:modelValue": (l) => {
|
|
3753
3753
|
o === "number" && typeof s == "string" && l !== null && l !== void 0 ? e[n.field] = String(l) : e[n.field] = l;
|
|
@@ -3761,19 +3761,19 @@ const _r = {
|
|
|
3761
3761
|
default: ({
|
|
3762
3762
|
row: e,
|
|
3763
3763
|
column: n
|
|
3764
|
-
}) => [
|
|
3764
|
+
}) => [E("span", null, [e[n.field]])],
|
|
3765
3765
|
edit: ({
|
|
3766
3766
|
row: e,
|
|
3767
3767
|
column: n
|
|
3768
3768
|
}) => {
|
|
3769
3769
|
const t = Q(!1), o = Q(e[n.field] || "");
|
|
3770
|
-
return [
|
|
3770
|
+
return [E(cn, {
|
|
3771
3771
|
popupVisible: t.value,
|
|
3772
3772
|
"onUpdate:popupVisible": (r) => t.value = r,
|
|
3773
3773
|
trigger: "click",
|
|
3774
3774
|
position: "top"
|
|
3775
3775
|
}, {
|
|
3776
|
-
default: () => [
|
|
3776
|
+
default: () => [E(De, D({
|
|
3777
3777
|
modelValue: o.value,
|
|
3778
3778
|
"onUpdate:modelValue": (r) => {
|
|
3779
3779
|
o.value = r, e[n.field] = r;
|
|
@@ -3782,7 +3782,7 @@ const _r = {
|
|
|
3782
3782
|
t.value = !0;
|
|
3783
3783
|
}
|
|
3784
3784
|
}, n.params), null)],
|
|
3785
|
-
content: () => [
|
|
3785
|
+
content: () => [E(Ct, D({
|
|
3786
3786
|
modelValue: o.value,
|
|
3787
3787
|
"onUpdate:modelValue": (r) => {
|
|
3788
3788
|
o.value = r, e[n.field] = r;
|
|
@@ -3802,11 +3802,11 @@ const _r = {
|
|
|
3802
3802
|
default: ({
|
|
3803
3803
|
row: e,
|
|
3804
3804
|
column: n
|
|
3805
|
-
}) => [
|
|
3805
|
+
}) => [E("span", null, [e[n.field] ? JSON.stringify(e[n.field]) : ""])],
|
|
3806
3806
|
edit: ({
|
|
3807
3807
|
row: e,
|
|
3808
3808
|
column: n
|
|
3809
|
-
}) => [
|
|
3809
|
+
}) => [E(Qs, D({
|
|
3810
3810
|
modelValue: e[n.field],
|
|
3811
3811
|
"onUpdate:modelValue": (t) => {
|
|
3812
3812
|
e[n.field] = t;
|
|
@@ -3819,11 +3819,11 @@ const _r = {
|
|
|
3819
3819
|
default: ({
|
|
3820
3820
|
row: e,
|
|
3821
3821
|
column: n
|
|
3822
|
-
}) => [
|
|
3822
|
+
}) => [E("span", null, [e[n.field] ? JSON.stringify(e[n.field]) : ""])],
|
|
3823
3823
|
edit: ({
|
|
3824
3824
|
row: e,
|
|
3825
3825
|
column: n
|
|
3826
|
-
}) => [
|
|
3826
|
+
}) => [E(yr, D({
|
|
3827
3827
|
modelValue: e[n.field],
|
|
3828
3828
|
"onUpdate:modelValue": (t) => {
|
|
3829
3829
|
e[n.field] = t;
|
|
@@ -3938,7 +3938,7 @@ function us(e, n) {
|
|
|
3938
3938
|
l || s && r && (h = !0, r.scrollLeft = s.scrollLeft, requestAnimationFrame(() => {
|
|
3939
3939
|
h = !1;
|
|
3940
3940
|
}));
|
|
3941
|
-
},
|
|
3941
|
+
}, f = () => {
|
|
3942
3942
|
!e.value || s || (s = document.createElement("div"), s.className = "vxe-table--sticky-scrollbar", s.style.position = "fixed", s.style.bottom = "0", s.style.overflowX = "auto", s.style.overflowY = "hidden", s.style.zIndex = "101", s.style.display = "none", a = document.createElement("div"), s.appendChild(a), s.addEventListener("scroll", m), document.body.appendChild(s), r = e.value.$el.querySelector(".vxe-table--body-wrapper"), r && r.addEventListener("scroll", c));
|
|
3943
3943
|
}, C = () => {
|
|
3944
3944
|
if (!e.value || !t) return;
|
|
@@ -3946,18 +3946,18 @@ function us(e, n) {
|
|
|
3946
3946
|
y();
|
|
3947
3947
|
return;
|
|
3948
3948
|
}
|
|
3949
|
-
const g = e.value.$el, S = g.getBoundingClientRect(), P = t.getBoundingClientRect(),
|
|
3949
|
+
const g = e.value.$el, S = g.getBoundingClientRect(), P = t.getBoundingClientRect(), x = A(g);
|
|
3950
3950
|
let b = { top: 0, bottom: window.innerHeight };
|
|
3951
|
-
if (
|
|
3951
|
+
if (x !== window && x instanceof HTMLElement && (b = x.getBoundingClientRect()), b.bottom > 0 && b.top < window.innerHeight && S.top < b.top && S.bottom > P.height) {
|
|
3952
3952
|
const v = Math.max(0, b.top);
|
|
3953
3953
|
S.bottom - P.height > v ? (!t.classList.contains("is-sticky") || t.style.top !== `${v}px` || t.style.left !== `${S.left}px`) && (t.style.position = "fixed", t.style.top = `${v}px`, t.style.left = `${S.left}px`, t.style.width = `${S.width}px`, t.style.zIndex = "100", t.classList.add("is-sticky"), o || (o = document.createElement("div"), t.parentNode?.insertBefore(o, t)), o.style.height = `${P.height}px`) : y();
|
|
3954
3954
|
} else
|
|
3955
3955
|
t.classList.contains("is-sticky") && (t.style.position = "", t.style.top = "", t.style.left = "", t.style.width = "", t.classList.remove("is-sticky"), o && o.parentNode && (o.parentNode.removeChild(o), o = null));
|
|
3956
|
-
if ((!s || !r) &&
|
|
3957
|
-
const v = r.scrollWidth,
|
|
3958
|
-
if (v >
|
|
3959
|
-
const
|
|
3960
|
-
S.bottom >
|
|
3956
|
+
if ((!s || !r) && f(), s && r && a) {
|
|
3957
|
+
const v = r.scrollWidth, p = r.clientWidth;
|
|
3958
|
+
if (v > p) {
|
|
3959
|
+
const u = window.innerHeight;
|
|
3960
|
+
S.bottom > u && S.top < u ? (s.style.display = "block", s.style.width = `${S.width}px`, s.style.left = `${S.left}px`, a.style.width = `${v}px`, Math.abs(s.scrollLeft - r.scrollLeft) > 1 && (s.scrollLeft = r.scrollLeft)) : s.style.display = "none";
|
|
3961
3961
|
} else
|
|
3962
3962
|
s.style.display = "none";
|
|
3963
3963
|
}
|
|
@@ -3966,7 +3966,7 @@ function us(e, n) {
|
|
|
3966
3966
|
C();
|
|
3967
3967
|
}), Ie(() => {
|
|
3968
3968
|
setTimeout(() => {
|
|
3969
|
-
e.value && (t = e.value.$el.querySelector(".vxe-table--header-wrapper"), t && (window.addEventListener("scroll", C, !0), window.addEventListener("resize", C)),
|
|
3969
|
+
e.value && (t = e.value.$el.querySelector(".vxe-table--header-wrapper"), t && (window.addEventListener("scroll", C, !0), window.addEventListener("resize", C)), f());
|
|
3970
3970
|
}, 100);
|
|
3971
3971
|
}), yt(() => {
|
|
3972
3972
|
window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C), o && o.parentNode && o.parentNode.removeChild(o), s && s.parentNode && s.parentNode.removeChild(s), r && r.removeEventListener("scroll", c);
|
|
@@ -3988,8 +3988,8 @@ const ds = { class: "my-filter-complex" }, fs = {
|
|
|
3988
3988
|
}), r = () => {
|
|
3989
3989
|
const { renderParams: c } = n;
|
|
3990
3990
|
if (c) {
|
|
3991
|
-
const { column: m } = c,
|
|
3992
|
-
t.value =
|
|
3991
|
+
const { column: m } = c, f = m.filters[0];
|
|
3992
|
+
t.value = f;
|
|
3993
3993
|
}
|
|
3994
3994
|
};
|
|
3995
3995
|
ne(o, () => {
|
|
@@ -4001,18 +4001,18 @@ const ds = { class: "my-filter-complex" }, fs = {
|
|
|
4001
4001
|
}), l = () => {
|
|
4002
4002
|
const { renderParams: c } = n, m = t.value;
|
|
4003
4003
|
if (c && m) {
|
|
4004
|
-
const { $table:
|
|
4005
|
-
|
|
4004
|
+
const { $table: f } = c, C = !!m.data;
|
|
4005
|
+
f.updateFilterOptionStatus(m, C);
|
|
4006
4006
|
}
|
|
4007
4007
|
}, h = () => {
|
|
4008
4008
|
const { renderParams: c } = n, m = {};
|
|
4009
4009
|
if (c) {
|
|
4010
|
-
const { $table:
|
|
4011
|
-
|
|
4010
|
+
const { $table: f } = c;
|
|
4011
|
+
f.getColumns().forEach((g) => {
|
|
4012
4012
|
const { field: S, filters: P } = g;
|
|
4013
4013
|
if (S && P && P.length) {
|
|
4014
|
-
const
|
|
4015
|
-
|
|
4014
|
+
const x = P[0];
|
|
4015
|
+
x.data && (m[S] = x.data);
|
|
4016
4016
|
}
|
|
4017
4017
|
});
|
|
4018
4018
|
}
|
|
@@ -4020,16 +4020,16 @@ const ds = { class: "my-filter-complex" }, fs = {
|
|
|
4020
4020
|
}, A = () => {
|
|
4021
4021
|
const { renderParams: c } = n;
|
|
4022
4022
|
if (c) {
|
|
4023
|
-
const { $table: m, $grid:
|
|
4023
|
+
const { $table: m, $grid: f } = c, C = t.value;
|
|
4024
4024
|
C && m.updateFilterOptionStatus(C, !!C.data);
|
|
4025
4025
|
const g = h();
|
|
4026
|
-
|
|
4026
|
+
f.commitProxy("query", g), f.closeFilter();
|
|
4027
4027
|
}
|
|
4028
4028
|
}, y = () => {
|
|
4029
4029
|
const { renderParams: c } = n, m = t.value;
|
|
4030
4030
|
if (c && m) {
|
|
4031
|
-
const { $table:
|
|
4032
|
-
m.data = "",
|
|
4031
|
+
const { $table: f, $grid: C } = c;
|
|
4032
|
+
m.data = "", f.updateFilterOptionStatus(m, !1);
|
|
4033
4033
|
const g = h();
|
|
4034
4034
|
C.commitProxy("query", g), C.closeFilter();
|
|
4035
4035
|
}
|
|
@@ -4039,27 +4039,27 @@ const ds = { class: "my-filter-complex" }, fs = {
|
|
|
4039
4039
|
a.value === "select" && s.value ? (I(), $(i(Un), {
|
|
4040
4040
|
key: 0,
|
|
4041
4041
|
modelValue: t.value.data,
|
|
4042
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
|
4042
|
+
"onUpdate:modelValue": m[0] || (m[0] = (f) => t.value.data = f),
|
|
4043
4043
|
options: s.value.params.optionlist,
|
|
4044
4044
|
clearable: "",
|
|
4045
4045
|
onChange: l
|
|
4046
4046
|
}, null, 8, ["modelValue", "options"])) : (I(), $(i($n), {
|
|
4047
4047
|
key: 1,
|
|
4048
4048
|
modelValue: t.value.data,
|
|
4049
|
-
"onUpdate:modelValue": m[1] || (m[1] = (
|
|
4049
|
+
"onUpdate:modelValue": m[1] || (m[1] = (f) => t.value.data = f),
|
|
4050
4050
|
clearable: "",
|
|
4051
4051
|
onKeyup: bt(A, ["enter"]),
|
|
4052
4052
|
onInput: l
|
|
4053
4053
|
}, null, 8, ["modelValue"]))
|
|
4054
4054
|
])) : W("", !0),
|
|
4055
4055
|
k("div", ps, [
|
|
4056
|
-
|
|
4056
|
+
E(i(nt), { onClick: y }, {
|
|
4057
4057
|
default: V(() => [...m[2] || (m[2] = [
|
|
4058
4058
|
ee("重置", -1)
|
|
4059
4059
|
])]),
|
|
4060
4060
|
_: 1
|
|
4061
4061
|
}),
|
|
4062
|
-
|
|
4062
|
+
E(i(nt), {
|
|
4063
4063
|
status: "primary",
|
|
4064
4064
|
onClick: A
|
|
4065
4065
|
}, {
|
|
@@ -4077,7 +4077,7 @@ Dn.renderer.add("MyFilterComplex", {
|
|
|
4077
4077
|
showTableFilterFooter: !1,
|
|
4078
4078
|
// 自定义筛选模板
|
|
4079
4079
|
renderTableFilter(e, n) {
|
|
4080
|
-
return
|
|
4080
|
+
return E(hs, {
|
|
4081
4081
|
renderOpts: e,
|
|
4082
4082
|
renderParams: n
|
|
4083
4083
|
}, null);
|
|
@@ -4116,8 +4116,8 @@ function Ga(e) {
|
|
|
4116
4116
|
return [U(
|
|
4117
4117
|
(r, { attrs: s, slots: a }) => {
|
|
4118
4118
|
const { gridEvents: l, gridOptions: h } = e, A = Object.entries(l || {}).reduce((y, [c, m]) => {
|
|
4119
|
-
const
|
|
4120
|
-
return y[
|
|
4119
|
+
const f = `on${c.charAt(0).toUpperCase() + c.slice(1)}`;
|
|
4120
|
+
return y[f] = m, y;
|
|
4121
4121
|
}, {});
|
|
4122
4122
|
return () => Ce(Ut, { ref: n, ...r, ...s, ...h, ...A }, a);
|
|
4123
4123
|
}
|
|
@@ -4150,7 +4150,7 @@ function gs(e) {
|
|
|
4150
4150
|
return String(g?.[S] ?? g?.title ?? P ?? "");
|
|
4151
4151
|
},
|
|
4152
4152
|
handleActionClick: async (g, S) => {
|
|
4153
|
-
const P = y(S).find((
|
|
4153
|
+
const P = y(S).find((x) => x.key === String(g));
|
|
4154
4154
|
P && (c(P, S) || (P.handler && await P.handler(S), t("action", {
|
|
4155
4155
|
key: P.key,
|
|
4156
4156
|
action: P,
|
|
@@ -4180,7 +4180,7 @@ const vs = { class: "sunny-resource-tree" }, ys = { class: "sunny-resource-tree_
|
|
|
4180
4180
|
props: o,
|
|
4181
4181
|
emit: r,
|
|
4182
4182
|
attrs: s
|
|
4183
|
-
}),
|
|
4183
|
+
}), f = (S, P) => {
|
|
4184
4184
|
m(S, P);
|
|
4185
4185
|
}, C = B(() => Object.keys(a).filter((S) => S !== "title")), g = (S, ...P) => l.value?.[S]?.(...P);
|
|
4186
4186
|
return n({
|
|
@@ -4192,28 +4192,28 @@ const vs = { class: "sunny-resource-tree" }, ys = { class: "sunny-resource-tree_
|
|
|
4192
4192
|
getHalfCheckedNodes: () => g("getHalfCheckedNodes"),
|
|
4193
4193
|
getExpandedNodes: () => g("getExpandedNodes"),
|
|
4194
4194
|
checkAll: (S) => g("checkAll", S),
|
|
4195
|
-
checkNode: (S, P,
|
|
4195
|
+
checkNode: (S, P, x) => g("checkNode", S, P, x),
|
|
4196
4196
|
selectAll: (S) => g("selectAll", S),
|
|
4197
4197
|
selectNode: (S, P) => g("selectNode", S, P),
|
|
4198
4198
|
expandAll: (S) => g("expandAll", S),
|
|
4199
4199
|
expandNode: (S, P) => g("expandNode", S, P)
|
|
4200
4200
|
}), (S, P) => (I(), O("div", vs, [
|
|
4201
|
-
|
|
4201
|
+
E(i(fn), D({
|
|
4202
4202
|
ref_key: "treeRef",
|
|
4203
4203
|
ref: l
|
|
4204
4204
|
}, S.$attrs), pe({
|
|
4205
|
-
title: V((
|
|
4206
|
-
i(h)(
|
|
4205
|
+
title: V((x) => [
|
|
4206
|
+
i(h)(x) ? (I(), $(i(pn), {
|
|
4207
4207
|
key: 0,
|
|
4208
4208
|
trigger: "contextMenu",
|
|
4209
4209
|
"popup-max-height": !1,
|
|
4210
|
-
onSelect: (b) =>
|
|
4210
|
+
onSelect: (b) => f(b, x)
|
|
4211
4211
|
}, {
|
|
4212
4212
|
content: V(() => [
|
|
4213
|
-
(I(!0), O(se, null, te(i(A)(
|
|
4214
|
-
key: `${String(
|
|
4213
|
+
(I(!0), O(se, null, te(i(A)(x), (b) => (I(), $(i(mn), {
|
|
4214
|
+
key: `${String(x?.key)}-${b.key}`,
|
|
4215
4215
|
value: b.key,
|
|
4216
|
-
disabled: i(y)(b,
|
|
4216
|
+
disabled: i(y)(b, x)
|
|
4217
4217
|
}, {
|
|
4218
4218
|
default: V(() => [
|
|
4219
4219
|
k("span", {
|
|
@@ -4225,22 +4225,22 @@ const vs = { class: "sunny-resource-tree" }, ys = { class: "sunny-resource-tree_
|
|
|
4225
4225
|
]),
|
|
4226
4226
|
default: V(() => [
|
|
4227
4227
|
k("span", ys, [
|
|
4228
|
-
q(S.$slots, "title", le(fe(
|
|
4229
|
-
ee(L(i(c)(
|
|
4228
|
+
q(S.$slots, "title", le(fe(x)), () => [
|
|
4229
|
+
ee(L(i(c)(x)), 1)
|
|
4230
4230
|
], !0)
|
|
4231
4231
|
])
|
|
4232
4232
|
]),
|
|
4233
4233
|
_: 2
|
|
4234
|
-
}, 1032, ["onSelect"])) : q(S.$slots, "title", le(D({ key: 1 },
|
|
4235
|
-
ee(L(i(c)(
|
|
4234
|
+
}, 1032, ["onSelect"])) : q(S.$slots, "title", le(D({ key: 1 }, x)), () => [
|
|
4235
|
+
ee(L(i(c)(x)), 1)
|
|
4236
4236
|
], !0)
|
|
4237
4237
|
]),
|
|
4238
4238
|
_: 2
|
|
4239
4239
|
}, [
|
|
4240
|
-
te(C.value, (
|
|
4241
|
-
name:
|
|
4240
|
+
te(C.value, (x) => ({
|
|
4241
|
+
name: x,
|
|
4242
4242
|
fn: V((b) => [
|
|
4243
|
-
q(S.$slots,
|
|
4243
|
+
q(S.$slots, x, le(fe(b || {})), void 0, !0)
|
|
4244
4244
|
])
|
|
4245
4245
|
}))
|
|
4246
4246
|
]), 1040)
|
|
@@ -4265,44 +4265,44 @@ function Ss(e, n) {
|
|
|
4265
4265
|
value: "value",
|
|
4266
4266
|
desc: "desc",
|
|
4267
4267
|
...e.fieldNames
|
|
4268
|
-
})), h = B(() => e.fieldNames?.value || "id"), A = (
|
|
4269
|
-
const
|
|
4270
|
-
o.value = { ...
|
|
4268
|
+
})), h = B(() => e.fieldNames?.value || "id"), A = (p) => Nn(p, h.value), y = () => {
|
|
4269
|
+
const p = As(e.formSchema);
|
|
4270
|
+
o.value = { ...p };
|
|
4271
4271
|
};
|
|
4272
4272
|
ne(
|
|
4273
4273
|
() => e.visible,
|
|
4274
|
-
(
|
|
4275
|
-
|
|
4274
|
+
(p) => {
|
|
4275
|
+
p && (e.modelValue && Array.isArray(e.modelValue) ? r.value = Rn(e.modelValue) : r.value = []);
|
|
4276
4276
|
},
|
|
4277
4277
|
{ immediate: !0 }
|
|
4278
4278
|
);
|
|
4279
|
-
const c = async (
|
|
4279
|
+
const c = async (p) => {
|
|
4280
4280
|
if (e.searchApi) {
|
|
4281
|
-
|
|
4281
|
+
p && (o.value = { ...p }), t.value = !0;
|
|
4282
4282
|
try {
|
|
4283
|
-
const
|
|
4283
|
+
const u = {
|
|
4284
4284
|
pageNo: s.value.current,
|
|
4285
4285
|
pageSize: s.value.pageSize,
|
|
4286
4286
|
...o.value
|
|
4287
4287
|
};
|
|
4288
4288
|
let d;
|
|
4289
|
-
if (typeof e.searchApi == "function" && (d = await e.searchApi(
|
|
4289
|
+
if (typeof e.searchApi == "function" && (d = await e.searchApi(u)), d) {
|
|
4290
4290
|
const w = d.list || d.records || [], R = d.total || d.totalCount || 0;
|
|
4291
4291
|
a.value = w, s.value.total = R;
|
|
4292
4292
|
}
|
|
4293
|
-
} catch (
|
|
4294
|
-
console.error("Search failed:",
|
|
4293
|
+
} catch (u) {
|
|
4294
|
+
console.error("Search failed:", u), _.error("查询失败");
|
|
4295
4295
|
} finally {
|
|
4296
4296
|
t.value = !1;
|
|
4297
4297
|
}
|
|
4298
4298
|
}
|
|
4299
|
-
}, m = (
|
|
4300
|
-
s.value.current =
|
|
4301
|
-
},
|
|
4302
|
-
s.value.pageSize =
|
|
4303
|
-
}, C = (
|
|
4304
|
-
const d = A(
|
|
4305
|
-
|
|
4299
|
+
}, m = (p) => {
|
|
4300
|
+
s.value.current = p, c();
|
|
4301
|
+
}, f = (p) => {
|
|
4302
|
+
s.value.pageSize = p, s.value.current = 1, c();
|
|
4303
|
+
}, C = (p, u) => {
|
|
4304
|
+
const d = A(p), w = r.value.findIndex((R) => A(R) === d);
|
|
4305
|
+
u ? w === -1 && (e.multiple ? r.value.push(p) : r.value = [p]) : w > -1 && r.value.splice(w, 1);
|
|
4306
4306
|
};
|
|
4307
4307
|
return {
|
|
4308
4308
|
loading: t,
|
|
@@ -4315,21 +4315,21 @@ function Ss(e, n) {
|
|
|
4315
4315
|
initDefaultValues: y,
|
|
4316
4316
|
handleSearch: c,
|
|
4317
4317
|
handlePageChange: m,
|
|
4318
|
-
handlePageSizeChange:
|
|
4319
|
-
handleCheckboxChange: (
|
|
4320
|
-
const { row:
|
|
4321
|
-
C(
|
|
4318
|
+
handlePageSizeChange: f,
|
|
4319
|
+
handleCheckboxChange: (p) => {
|
|
4320
|
+
const { row: u, checked: d } = p;
|
|
4321
|
+
C(u, d);
|
|
4322
4322
|
},
|
|
4323
|
-
handleCheckboxAll: (
|
|
4324
|
-
const { checked:
|
|
4325
|
-
|
|
4323
|
+
handleCheckboxAll: (p) => {
|
|
4324
|
+
const { checked: u, records: d } = p;
|
|
4325
|
+
u ? d.forEach((w) => C(w, !0)) : a.value.forEach((w) => C(w, !1));
|
|
4326
4326
|
},
|
|
4327
|
-
handleRadioChange: (
|
|
4328
|
-
const { row:
|
|
4329
|
-
r.value = [
|
|
4327
|
+
handleRadioChange: (p) => {
|
|
4328
|
+
const { row: u } = p;
|
|
4329
|
+
r.value = [u];
|
|
4330
4330
|
},
|
|
4331
|
-
removeRow: (
|
|
4332
|
-
C(
|
|
4331
|
+
removeRow: (p) => {
|
|
4332
|
+
C(p, !1);
|
|
4333
4333
|
},
|
|
4334
4334
|
handleOk: () => {
|
|
4335
4335
|
n("update:modelValue", r.value), n("confirm", r.value), n("update:visible", !1);
|
|
@@ -4379,17 +4379,17 @@ const Cs = { class: "flex flex-col h-full" }, ws = { class: "mb-4 border-b borde
|
|
|
4379
4379
|
searchParams: y,
|
|
4380
4380
|
selectedRows: c,
|
|
4381
4381
|
pagination: m,
|
|
4382
|
-
tableData:
|
|
4382
|
+
tableData: f,
|
|
4383
4383
|
actualFieldNames: C,
|
|
4384
4384
|
actualRowKey: g,
|
|
4385
4385
|
initDefaultValues: S,
|
|
4386
4386
|
handleSearch: P,
|
|
4387
|
-
handlePageChange:
|
|
4387
|
+
handlePageChange: x,
|
|
4388
4388
|
handlePageSizeChange: b,
|
|
4389
4389
|
handleCheckboxChange: T,
|
|
4390
4390
|
handleCheckboxAll: v,
|
|
4391
|
-
handleRadioChange:
|
|
4392
|
-
removeRow:
|
|
4391
|
+
handleRadioChange: p,
|
|
4392
|
+
removeRow: u,
|
|
4393
4393
|
handleOk: d,
|
|
4394
4394
|
handleCancel: w,
|
|
4395
4395
|
toggleRowSelection: R,
|
|
@@ -4409,9 +4409,9 @@ const Cs = { class: "flex flex-col h-full" }, ws = { class: "mb-4 border-b borde
|
|
|
4409
4409
|
} catch (Y) {
|
|
4410
4410
|
return console.error("Form validation failed:", Y), !1;
|
|
4411
4411
|
}
|
|
4412
|
-
},
|
|
4412
|
+
}, j = async (Y) => {
|
|
4413
4413
|
m.value.current = 1, r.clearOnSearch && (c.value = []), P(Y);
|
|
4414
|
-
},
|
|
4414
|
+
}, M = B(() => ({
|
|
4415
4415
|
border: !0,
|
|
4416
4416
|
stripe: !0,
|
|
4417
4417
|
showOverflow: !0,
|
|
@@ -4434,13 +4434,13 @@ const Cs = { class: "flex flex-col h-full" }, ws = { class: "mb-4 border-b borde
|
|
|
4434
4434
|
}
|
|
4435
4435
|
}));
|
|
4436
4436
|
ne(
|
|
4437
|
-
[() =>
|
|
4437
|
+
[() => f.value, () => c.value],
|
|
4438
4438
|
async () => {
|
|
4439
4439
|
await me();
|
|
4440
4440
|
const Y = l.value?.getGrid?.() || l.value;
|
|
4441
|
-
if (Y &&
|
|
4441
|
+
if (Y && f.value.length > 0) {
|
|
4442
4442
|
Y.clearCheckboxRow();
|
|
4443
|
-
const H =
|
|
4443
|
+
const H = f.value.filter(
|
|
4444
4444
|
(Z) => c.value.some((J) => J[g.value] === Z[g.value])
|
|
4445
4445
|
);
|
|
4446
4446
|
H.length > 0 && Y.setCheckboxRow(H, !0);
|
|
@@ -4461,7 +4461,7 @@ const Cs = { class: "flex flex-col h-full" }, ws = { class: "mb-4 border-b borde
|
|
|
4461
4461
|
return ne(
|
|
4462
4462
|
() => r.visible,
|
|
4463
4463
|
(Y) => {
|
|
4464
|
-
Y && (S(), r.resetOnOpen && (
|
|
4464
|
+
Y && (S(), r.resetOnOpen && (f.value = [], m.value.total = 0, me(() => {
|
|
4465
4465
|
N();
|
|
4466
4466
|
})));
|
|
4467
4467
|
}
|
|
@@ -4480,7 +4480,7 @@ const Cs = { class: "flex flex-col h-full" }, ws = { class: "mb-4 border-b borde
|
|
|
4480
4480
|
}, {
|
|
4481
4481
|
footer: V(() => [
|
|
4482
4482
|
k("div", Ns, [
|
|
4483
|
-
|
|
4483
|
+
E(i(hn), {
|
|
4484
4484
|
current: i(m).current,
|
|
4485
4485
|
"onUpdate:current": H[2] || (H[2] = (Z) => i(m).current = Z),
|
|
4486
4486
|
"page-size": i(m).pageSize,
|
|
@@ -4489,17 +4489,17 @@ const Cs = { class: "flex flex-col h-full" }, ws = { class: "mb-4 border-b borde
|
|
|
4489
4489
|
"show-page-size": "",
|
|
4490
4490
|
"page-size-options": [20, 50, 100, 200],
|
|
4491
4491
|
size: "small",
|
|
4492
|
-
onChange: i(
|
|
4492
|
+
onChange: i(x),
|
|
4493
4493
|
onPageSizeChange: i(b)
|
|
4494
4494
|
}, null, 8, ["current", "page-size", "total", "onChange", "onPageSizeChange"]),
|
|
4495
4495
|
k("div", Fs, [
|
|
4496
|
-
|
|
4496
|
+
E(i(ie), { onClick: i(w) }, {
|
|
4497
4497
|
default: V(() => [
|
|
4498
4498
|
ee(L(i(K)("common.cancel")), 1)
|
|
4499
4499
|
]),
|
|
4500
4500
|
_: 1
|
|
4501
4501
|
}, 8, ["onClick"]),
|
|
4502
|
-
|
|
4502
|
+
E(i(ie), {
|
|
4503
4503
|
type: "primary",
|
|
4504
4504
|
onClick: i(d)
|
|
4505
4505
|
}, {
|
|
@@ -4514,7 +4514,7 @@ const Cs = { class: "flex flex-col h-full" }, ws = { class: "mb-4 border-b borde
|
|
|
4514
4514
|
default: V(() => [
|
|
4515
4515
|
k("div", Cs, [
|
|
4516
4516
|
k("div", ws, [
|
|
4517
|
-
|
|
4517
|
+
E(qr, {
|
|
4518
4518
|
ref_key: "formRef",
|
|
4519
4519
|
ref: h,
|
|
4520
4520
|
values: i(y),
|
|
@@ -4523,7 +4523,7 @@ const Cs = { class: "flex flex-col h-full" }, ws = { class: "mb-4 border-b borde
|
|
|
4523
4523
|
"common-config": r.commonConfig,
|
|
4524
4524
|
"show-default-actions": "",
|
|
4525
4525
|
"reset-button-options": { show: !0 },
|
|
4526
|
-
onSubmit:
|
|
4526
|
+
onSubmit: j,
|
|
4527
4527
|
onReset: F,
|
|
4528
4528
|
layout: "vertical"
|
|
4529
4529
|
}, pe({ _: 2 }, [
|
|
@@ -4540,16 +4540,16 @@ const Cs = { class: "flex flex-col h-full" }, ws = { class: "mb-4 border-b borde
|
|
|
4540
4540
|
style: ce({ height: typeof r.contentHeight == "number" ? r.contentHeight + "px" : r.contentHeight })
|
|
4541
4541
|
}, [
|
|
4542
4542
|
k("div", ks, [
|
|
4543
|
-
|
|
4543
|
+
E(Ut, D({
|
|
4544
4544
|
ref_key: "gridRef",
|
|
4545
4545
|
ref: l,
|
|
4546
4546
|
columns: r.tableColumns,
|
|
4547
|
-
data: i(
|
|
4547
|
+
data: i(f),
|
|
4548
4548
|
loading: i(A)
|
|
4549
|
-
},
|
|
4549
|
+
}, M.value, {
|
|
4550
4550
|
onCheckboxChange: i(T),
|
|
4551
4551
|
onCheckboxAll: i(v),
|
|
4552
|
-
onRadioChange: i(
|
|
4552
|
+
onRadioChange: i(p),
|
|
4553
4553
|
onCellDblclick: X
|
|
4554
4554
|
}), null, 16, ["columns", "data", "loading", "onCheckboxChange", "onCheckboxAll", "onRadioChange"])
|
|
4555
4555
|
]),
|
|
@@ -4567,7 +4567,7 @@ const Cs = { class: "flex flex-col h-full" }, ws = { class: "mb-4 border-b borde
|
|
|
4567
4567
|
key: Z[i(g)],
|
|
4568
4568
|
class: "relative group px-2 py-1 mb-1 bg-white border border-gray-200 rounded hover:shadow-sm transition-all h-[42px] flex flex-col justify-center"
|
|
4569
4569
|
}, [
|
|
4570
|
-
|
|
4570
|
+
E(i(At), {
|
|
4571
4571
|
content: `${Z[i(C).desc]}`
|
|
4572
4572
|
}, {
|
|
4573
4573
|
default: V(() => [
|
|
@@ -4578,9 +4578,9 @@ const Cs = { class: "flex flex-col h-full" }, ws = { class: "mb-4 border-b borde
|
|
|
4578
4578
|
}, 1032, ["content"]),
|
|
4579
4579
|
k("div", {
|
|
4580
4580
|
class: "absolute top-0.5 right-0.5 opacity-0 group-hover:opacity-100 cursor-pointer text-gray-400 hover:text-red-500 transition-opacity p-0.5 bg-white rounded-full shadow-sm",
|
|
4581
|
-
onClick: (J) => i(
|
|
4581
|
+
onClick: (J) => i(u)(Z)
|
|
4582
4582
|
}, [
|
|
4583
|
-
|
|
4583
|
+
E(i(It), { size: 10 })
|
|
4584
4584
|
], 8, Vs)
|
|
4585
4585
|
]))), 128)) : (I(), O("div", Rs, L(i(K)("common.noData")), 1))
|
|
4586
4586
|
])
|
|
@@ -4608,12 +4608,12 @@ function js(e, n) {
|
|
|
4608
4608
|
set: (m) => {
|
|
4609
4609
|
n("update:modelValue", m), n("change", m);
|
|
4610
4610
|
}
|
|
4611
|
-
}), a = () => de.businessSearchAdapter, l = (m) => async (
|
|
4611
|
+
}), a = () => de.businessSearchAdapter, l = (m) => async (f) => {
|
|
4612
4612
|
if (!m?.search)
|
|
4613
4613
|
return console.warn("[SunnyBusinessSearch] No search adapter configured."), { records: [], total: 0 };
|
|
4614
4614
|
try {
|
|
4615
4615
|
return await m.search({
|
|
4616
|
-
...
|
|
4616
|
+
...f,
|
|
4617
4617
|
cNum: e.cNum
|
|
4618
4618
|
});
|
|
4619
4619
|
} catch (C) {
|
|
@@ -4630,10 +4630,10 @@ function js(e, n) {
|
|
|
4630
4630
|
}
|
|
4631
4631
|
o.value = !0;
|
|
4632
4632
|
try {
|
|
4633
|
-
const
|
|
4634
|
-
|
|
4635
|
-
} catch (
|
|
4636
|
-
console.error("[SunnyBusinessSearch] Failed to load dynamic config:",
|
|
4633
|
+
const f = await m.loadConfig(e.cNum);
|
|
4634
|
+
f.searchApi = l(m), r.value = f;
|
|
4635
|
+
} catch (f) {
|
|
4636
|
+
console.error("[SunnyBusinessSearch] Failed to load dynamic config:", f);
|
|
4637
4637
|
} finally {
|
|
4638
4638
|
o.value = !1;
|
|
4639
4639
|
}
|
|
@@ -4695,28 +4695,28 @@ const Os = { class: "sunny-business-search w-full" }, Qs = /* @__PURE__ */ U({
|
|
|
4695
4695
|
} = js(t, o), A = B(() => t.fieldNames || t.modalProps?.fieldNames || s.value.fieldNames || { label: "label", value: "value" }), y = B(() => {
|
|
4696
4696
|
let c = t.modalProps?.multiple;
|
|
4697
4697
|
c === void 0 && (c = t.multiple), c === void 0 && t.cSelectionMode && (c = t.cSelectionMode !== "single"), c = c ?? s.value.multiple ?? !0;
|
|
4698
|
-
let
|
|
4699
|
-
return !
|
|
4698
|
+
let f = [...t.modalProps.tableColumns || s.value.tableColumns || []];
|
|
4699
|
+
return !f.some((g) => g.type === "checkbox" || g.type === "radio") && f.length > 0 && (c ? f.unshift({ type: "checkbox", width: 50, fixed: "left", align: "center" }) : f.unshift({ type: "radio", width: 50, fixed: "left", align: "center" })), {
|
|
4700
4700
|
...s.value,
|
|
4701
4701
|
multiple: c,
|
|
4702
4702
|
fieldNames: A.value,
|
|
4703
4703
|
...t.modalProps,
|
|
4704
4704
|
// 用户传入的 modalProps 优先级最高
|
|
4705
|
-
tableColumns:
|
|
4705
|
+
tableColumns: f
|
|
4706
4706
|
// 覆盖处理后的 columns
|
|
4707
4707
|
};
|
|
4708
4708
|
});
|
|
4709
4709
|
return (c, m) => (I(), O("div", Os, [
|
|
4710
|
-
|
|
4710
|
+
E(i(wr), D(c.$attrs, {
|
|
4711
4711
|
"model-value": i(a),
|
|
4712
4712
|
placeholder: e.placeholder,
|
|
4713
4713
|
disabled: e.disabled,
|
|
4714
4714
|
"max-tag-count": e.maxTagCount,
|
|
4715
4715
|
"field-names": A.value,
|
|
4716
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
|
4716
|
+
"onUpdate:modelValue": m[0] || (m[0] = (f) => a.value = f),
|
|
4717
4717
|
onSearch: i(l)
|
|
4718
4718
|
}), pe({ _: 2 }, [
|
|
4719
|
-
te(c.$slots, (
|
|
4719
|
+
te(c.$slots, (f, C) => ({
|
|
4720
4720
|
name: C,
|
|
4721
4721
|
fn: V((g) => [
|
|
4722
4722
|
q(c.$slots, C, le(fe(g || {})))
|
|
@@ -4726,7 +4726,7 @@ const Os = { class: "sunny-business-search w-full" }, Qs = /* @__PURE__ */ U({
|
|
|
4726
4726
|
i(s).title || i(r) ? (I(), $(i(Ms), D({
|
|
4727
4727
|
key: 0,
|
|
4728
4728
|
visible: i(r),
|
|
4729
|
-
"onUpdate:visible": m[1] || (m[1] = (
|
|
4729
|
+
"onUpdate:visible": m[1] || (m[1] = (f) => Se(r) ? r.value = f : null),
|
|
4730
4730
|
"model-value": i(a)
|
|
4731
4731
|
}, y.value, { onConfirm: i(h) }), null, 16, ["visible", "model-value", "onConfirm"])) : W("", !0)
|
|
4732
4732
|
]));
|
|
@@ -4746,19 +4746,19 @@ function zs(e, n, t, o, r = qt) {
|
|
|
4746
4746
|
return;
|
|
4747
4747
|
}
|
|
4748
4748
|
l.value = !1;
|
|
4749
|
-
let
|
|
4749
|
+
let x = t?.value || e.model;
|
|
4750
4750
|
if (o)
|
|
4751
4751
|
try {
|
|
4752
4752
|
const v = await o.getValues();
|
|
4753
|
-
v && (
|
|
4753
|
+
v && (x = v);
|
|
4754
4754
|
} catch {
|
|
4755
4755
|
}
|
|
4756
|
-
const b = { ...
|
|
4756
|
+
const b = { ...x };
|
|
4757
4757
|
if (Object.keys(b).forEach((v) => {
|
|
4758
|
-
const
|
|
4759
|
-
Array.isArray(
|
|
4758
|
+
const p = b[v];
|
|
4759
|
+
Array.isArray(p) && (e.formConfig?.some(
|
|
4760
4760
|
(d) => d.fieldName === v && d.component && (d.component.name === "SunnyBusinessSearch" || d.component === "SunnyBusinessSearch")
|
|
4761
|
-
) ? b[v] = JSON.stringify(
|
|
4761
|
+
) ? b[v] = JSON.stringify(p) : b[v] = p.map((d) => {
|
|
4762
4762
|
let w = d;
|
|
4763
4763
|
return typeof d == "object" && d !== null && (w = d.value !== void 0 ? d.value : d.ID !== void 0 ? d.ID : d.id !== void 0 ? d.id : d), typeof w == "string" ? w : String(w);
|
|
4764
4764
|
}));
|
|
@@ -4769,17 +4769,17 @@ function zs(e, n, t, o, r = qt) {
|
|
|
4769
4769
|
try {
|
|
4770
4770
|
let v = a.value.trim();
|
|
4771
4771
|
e.searchPlanList.length === 0 && (v = "默认方案");
|
|
4772
|
-
const
|
|
4772
|
+
const p = await r.insert({
|
|
4773
4773
|
assSearchplan: {
|
|
4774
4774
|
cSearchplanname: v,
|
|
4775
4775
|
...e.nResourceid && { nResourceid: e.nResourceid }
|
|
4776
4776
|
},
|
|
4777
4777
|
colMap: b
|
|
4778
4778
|
});
|
|
4779
|
-
if (
|
|
4780
|
-
const
|
|
4781
|
-
n("update:searchPlanList",
|
|
4782
|
-
const d =
|
|
4779
|
+
if (p.message && _.success(p.message), e.resourceId) {
|
|
4780
|
+
const u = await m(e.resourceId);
|
|
4781
|
+
n("update:searchPlanList", u);
|
|
4782
|
+
const d = u.find((w) => w.CSEARCHPLANNAME === v);
|
|
4783
4783
|
d && await c(d);
|
|
4784
4784
|
}
|
|
4785
4785
|
n("add", v, { ...b }), a.value = "";
|
|
@@ -4792,19 +4792,19 @@ function zs(e, n, t, o, r = qt) {
|
|
|
4792
4792
|
return;
|
|
4793
4793
|
}
|
|
4794
4794
|
l.value = !1;
|
|
4795
|
-
let
|
|
4795
|
+
let x = t?.value || e.model;
|
|
4796
4796
|
if (o)
|
|
4797
4797
|
try {
|
|
4798
4798
|
const v = await o.getValues();
|
|
4799
|
-
v && (
|
|
4799
|
+
v && (x = v);
|
|
4800
4800
|
} catch {
|
|
4801
4801
|
}
|
|
4802
|
-
const b = { ...
|
|
4802
|
+
const b = { ...x };
|
|
4803
4803
|
if (Object.keys(b).forEach((v) => {
|
|
4804
|
-
const
|
|
4805
|
-
Array.isArray(
|
|
4804
|
+
const p = b[v];
|
|
4805
|
+
Array.isArray(p) && (e.formConfig?.some(
|
|
4806
4806
|
(d) => d.fieldName === v && d.component && (d.component.name === "SunnyBusinessSearch" || d.component === "SunnyBusinessSearch")
|
|
4807
|
-
) ? b[v] = JSON.stringify(
|
|
4807
|
+
) ? b[v] = JSON.stringify(p) : b[v] = p.map((d) => {
|
|
4808
4808
|
let w = d;
|
|
4809
4809
|
return typeof d == "object" && d !== null && (w = d.value !== void 0 ? d.value : d.ID !== void 0 ? d.ID : d.id !== void 0 ? d.id : d), typeof w == "string" ? w : String(w);
|
|
4810
4810
|
}));
|
|
@@ -4822,53 +4822,53 @@ function zs(e, n, t, o, r = qt) {
|
|
|
4822
4822
|
colMap: b
|
|
4823
4823
|
});
|
|
4824
4824
|
if (v.message && _.success(v.message), e.resourceId) {
|
|
4825
|
-
const
|
|
4826
|
-
n("update:searchPlanList",
|
|
4827
|
-
const
|
|
4828
|
-
|
|
4825
|
+
const p = await m(e.resourceId);
|
|
4826
|
+
n("update:searchPlanList", p);
|
|
4827
|
+
const u = p.find((d) => d.ID === e.currentSearchPlan?.ID);
|
|
4828
|
+
u && await c(u);
|
|
4829
4829
|
}
|
|
4830
4830
|
n("update", e.currentSearchPlan?.ID, a.value.trim() || e.currentSearchPlan?.CSEARCHPLANNAME, { ...b }), a.value = "";
|
|
4831
4831
|
} catch (v) {
|
|
4832
4832
|
n("error", v);
|
|
4833
4833
|
}
|
|
4834
|
-
}, y = async (
|
|
4834
|
+
}, y = async (x) => {
|
|
4835
4835
|
try {
|
|
4836
|
-
const b = await r.del({ id:
|
|
4837
|
-
if (n("delete",
|
|
4836
|
+
const b = await r.del({ id: x.ID });
|
|
4837
|
+
if (n("delete", x.ID), e.currentSearchPlan && e.currentSearchPlan.ID === x.ID && n("update:currentSearchPlan", void 0), b.message && _.success(b.message), e.resourceId) {
|
|
4838
4838
|
const T = await m(e.resourceId);
|
|
4839
4839
|
n("update:searchPlanList", T);
|
|
4840
4840
|
}
|
|
4841
4841
|
} catch (b) {
|
|
4842
4842
|
n("error", b);
|
|
4843
4843
|
}
|
|
4844
|
-
}, c = async (
|
|
4845
|
-
n("update:currentSearchPlan",
|
|
4844
|
+
}, c = async (x) => {
|
|
4845
|
+
n("update:currentSearchPlan", x);
|
|
4846
4846
|
try {
|
|
4847
4847
|
const b = {
|
|
4848
4848
|
...e.nResourceid && { nResourceid: e.nResourceid },
|
|
4849
|
-
nPlanId:
|
|
4849
|
+
nPlanId: x.ID
|
|
4850
4850
|
};
|
|
4851
4851
|
let v = (await r.findSearchPlanColsByPlanId(b)).result || {};
|
|
4852
|
-
if (Object.keys(v).forEach((
|
|
4853
|
-
let
|
|
4852
|
+
if (Object.keys(v).forEach((p) => {
|
|
4853
|
+
let u = v[p];
|
|
4854
4854
|
try {
|
|
4855
4855
|
if (e.formConfig?.some(
|
|
4856
|
-
(w) => w.fieldName ===
|
|
4856
|
+
(w) => w.fieldName === p && w.component && (w.component.name === "SunnyBusinessSearch" || w.component === "SunnyBusinessSearch")
|
|
4857
4857
|
)) {
|
|
4858
|
-
if (typeof
|
|
4858
|
+
if (typeof u == "string")
|
|
4859
4859
|
try {
|
|
4860
|
-
|
|
4860
|
+
u = JSON.parse(u);
|
|
4861
4861
|
} catch {
|
|
4862
4862
|
}
|
|
4863
|
-
if (Array.isArray(
|
|
4863
|
+
if (Array.isArray(u) && u.every((R) => typeof R == "string") && u.length > 0)
|
|
4864
4864
|
try {
|
|
4865
|
-
const R =
|
|
4865
|
+
const R = u.join(""), z = [];
|
|
4866
4866
|
let F = "", N = 0;
|
|
4867
|
-
for (let
|
|
4868
|
-
const
|
|
4869
|
-
if (F +=
|
|
4867
|
+
for (let j = 0; j < R.length; j++) {
|
|
4868
|
+
const M = R[j];
|
|
4869
|
+
if (F += M, M === "{")
|
|
4870
4870
|
N++;
|
|
4871
|
-
else if (
|
|
4871
|
+
else if (M === "}" && (N--, N === 0)) {
|
|
4872
4872
|
try {
|
|
4873
4873
|
z.push(JSON.parse(F));
|
|
4874
4874
|
} catch {
|
|
@@ -4876,42 +4876,42 @@ function zs(e, n, t, o, r = qt) {
|
|
|
4876
4876
|
F = "";
|
|
4877
4877
|
}
|
|
4878
4878
|
}
|
|
4879
|
-
z.length > 0 ?
|
|
4879
|
+
z.length > 0 ? u = z : u = JSON.parse(R);
|
|
4880
4880
|
} catch {
|
|
4881
4881
|
try {
|
|
4882
|
-
const R =
|
|
4883
|
-
R.split("}{").map((N,
|
|
4882
|
+
const R = u.join(""), z = [];
|
|
4883
|
+
R.split("}{").map((N, j) => j === 0 ? N + "}" : j === R.split("}{").length - 1 ? "{" + N : "{" + N + "}").forEach((N) => {
|
|
4884
4884
|
if (N.trim()) {
|
|
4885
|
-
const
|
|
4886
|
-
|
|
4885
|
+
const j = N.match(/"([^"]+)"\s*:\s*("[^"]*"|\d+)/g) || [], M = {};
|
|
4886
|
+
j.forEach((X) => {
|
|
4887
4887
|
const [Y, H] = X.split(/\s*:\s*/), Z = Y.replace(/"/g, "");
|
|
4888
4888
|
let J = H;
|
|
4889
|
-
J.startsWith('"') && J.endsWith('"') ? J = J.substring(1, J.length - 1) : isNaN(Number(J)) || (J = Number(J)),
|
|
4890
|
-
}), Object.keys(
|
|
4889
|
+
J.startsWith('"') && J.endsWith('"') ? J = J.substring(1, J.length - 1) : isNaN(Number(J)) || (J = Number(J)), M[Z] = J;
|
|
4890
|
+
}), Object.keys(M).length > 0 && z.push(M);
|
|
4891
4891
|
}
|
|
4892
|
-
}), z.length > 0 && (
|
|
4892
|
+
}), z.length > 0 && (u = z);
|
|
4893
4893
|
} catch {
|
|
4894
4894
|
}
|
|
4895
4895
|
}
|
|
4896
4896
|
} else {
|
|
4897
|
-
if (typeof
|
|
4897
|
+
if (typeof u == "string" && (u.startsWith("[") || u.includes(",")))
|
|
4898
4898
|
try {
|
|
4899
|
-
|
|
4899
|
+
u = JSON.parse(u);
|
|
4900
4900
|
} catch {
|
|
4901
|
-
|
|
4901
|
+
u.includes(",") && (u = u.split(",").map((w) => w.trim()));
|
|
4902
4902
|
}
|
|
4903
|
-
Array.isArray(
|
|
4903
|
+
Array.isArray(u) && (u = u.map((w) => {
|
|
4904
4904
|
const R = typeof w == "string" ? w.trim() : w;
|
|
4905
4905
|
return String(R);
|
|
4906
4906
|
}));
|
|
4907
4907
|
}
|
|
4908
|
-
v[
|
|
4908
|
+
v[p] = u;
|
|
4909
4909
|
} catch {
|
|
4910
4910
|
}
|
|
4911
|
-
}), e.formConfig?.forEach((
|
|
4912
|
-
const
|
|
4913
|
-
let d = v[
|
|
4914
|
-
if (d != null &&
|
|
4911
|
+
}), e.formConfig?.forEach((p) => {
|
|
4912
|
+
const u = p.fieldName;
|
|
4913
|
+
let d = v[u];
|
|
4914
|
+
if (d != null && p.component && (p.component.name === "SunnyBusinessSearch" || p.component === "SunnyBusinessSearch")) {
|
|
4915
4915
|
if (typeof d == "string")
|
|
4916
4916
|
try {
|
|
4917
4917
|
d = JSON.parse(d);
|
|
@@ -4924,7 +4924,7 @@ function zs(e, n, t, o, r = qt) {
|
|
|
4924
4924
|
d = JSON.parse(R);
|
|
4925
4925
|
} catch {
|
|
4926
4926
|
}
|
|
4927
|
-
Array.isArray(d) ? v[
|
|
4927
|
+
Array.isArray(d) ? v[u] = d.map((R) => typeof R == "object" && R !== null ? R : { value: R }) : typeof d == "object" && d !== null ? v[u] = [d] : v[u] = d;
|
|
4928
4928
|
}
|
|
4929
4929
|
}
|
|
4930
4930
|
}), t && (t.value = { ...v }), o)
|
|
@@ -4932,11 +4932,11 @@ function zs(e, n, t, o, r = qt) {
|
|
|
4932
4932
|
await o.setValues(v);
|
|
4933
4933
|
} catch {
|
|
4934
4934
|
}
|
|
4935
|
-
n("select",
|
|
4935
|
+
n("select", x);
|
|
4936
4936
|
} catch (b) {
|
|
4937
4937
|
n("error", b);
|
|
4938
4938
|
}
|
|
4939
|
-
}, m = async (
|
|
4939
|
+
}, m = async (x) => {
|
|
4940
4940
|
try {
|
|
4941
4941
|
const b = {
|
|
4942
4942
|
...e.nResourceid && { nResourceid: e.nResourceid }
|
|
@@ -4961,31 +4961,31 @@ function zs(e, n, t, o, r = qt) {
|
|
|
4961
4961
|
} catch {
|
|
4962
4962
|
}
|
|
4963
4963
|
if (t) {
|
|
4964
|
-
const
|
|
4965
|
-
Object.keys(
|
|
4966
|
-
|
|
4967
|
-
}), t.value =
|
|
4964
|
+
const x = { ...t.value };
|
|
4965
|
+
Object.keys(x).forEach((b) => {
|
|
4966
|
+
x[b] = "";
|
|
4967
|
+
}), t.value = x;
|
|
4968
4968
|
}
|
|
4969
4969
|
},
|
|
4970
4970
|
handleSearch: async () => {
|
|
4971
|
-
let
|
|
4971
|
+
let x = t?.value || e.model;
|
|
4972
4972
|
if (o)
|
|
4973
4973
|
try {
|
|
4974
4974
|
const b = await o.getValues();
|
|
4975
|
-
b && (
|
|
4975
|
+
b && (x = b);
|
|
4976
4976
|
} catch {
|
|
4977
4977
|
}
|
|
4978
|
-
n("search", { ...
|
|
4978
|
+
n("search", { ...x }), s.value = !1;
|
|
4979
4979
|
},
|
|
4980
4980
|
handleClose: () => {
|
|
4981
4981
|
s.value = !1, a.value = "", l.value = !1;
|
|
4982
4982
|
},
|
|
4983
4983
|
handleOpen: async () => {
|
|
4984
4984
|
if (s.value = !0, a.value = "", l.value = !1, t) {
|
|
4985
|
-
const
|
|
4986
|
-
Object.keys(
|
|
4987
|
-
|
|
4988
|
-
}), t.value =
|
|
4985
|
+
const x = { ...t.value };
|
|
4986
|
+
Object.keys(x).forEach((b) => {
|
|
4987
|
+
x[b] = "";
|
|
4988
|
+
}), t.value = x;
|
|
4989
4989
|
}
|
|
4990
4990
|
if (o)
|
|
4991
4991
|
try {
|
|
@@ -4994,50 +4994,50 @@ function zs(e, n, t, o, r = qt) {
|
|
|
4994
4994
|
}
|
|
4995
4995
|
if (e.resourceId)
|
|
4996
4996
|
try {
|
|
4997
|
-
const
|
|
4998
|
-
if (n("update:searchPlanList",
|
|
4999
|
-
n("update:currentSearchPlan",
|
|
4997
|
+
const x = await m(e.resourceId);
|
|
4998
|
+
if (n("update:searchPlanList", x), x.length > 0) {
|
|
4999
|
+
n("update:currentSearchPlan", x[0]);
|
|
5000
5000
|
const b = {
|
|
5001
5001
|
...e.nResourceid && { nResourceid: e.nResourceid },
|
|
5002
|
-
nPlanId:
|
|
5002
|
+
nPlanId: x[0].ID
|
|
5003
5003
|
};
|
|
5004
5004
|
let v = (await r.findSearchPlanColsByPlanId(b)).result || {};
|
|
5005
|
-
if (Object.keys(v).forEach((
|
|
5006
|
-
let
|
|
5005
|
+
if (Object.keys(v).forEach((p) => {
|
|
5006
|
+
let u = v[p];
|
|
5007
5007
|
try {
|
|
5008
5008
|
if (e.formConfig?.some(
|
|
5009
|
-
(w) => w.fieldName ===
|
|
5009
|
+
(w) => w.fieldName === p && w.component && (w.component.name === "SunnyBusinessSearch" || w.component === "SunnyBusinessSearch")
|
|
5010
5010
|
)) {
|
|
5011
|
-
if (typeof
|
|
5011
|
+
if (typeof u == "string")
|
|
5012
5012
|
try {
|
|
5013
|
-
|
|
5013
|
+
u = JSON.parse(u);
|
|
5014
5014
|
} catch {
|
|
5015
5015
|
}
|
|
5016
|
-
if (Array.isArray(
|
|
5016
|
+
if (Array.isArray(u) && u.every((R) => typeof R == "string") && u.length > 0)
|
|
5017
5017
|
try {
|
|
5018
|
-
const R =
|
|
5019
|
-
|
|
5018
|
+
const R = u.join("");
|
|
5019
|
+
u = JSON.parse(R);
|
|
5020
5020
|
} catch {
|
|
5021
5021
|
}
|
|
5022
5022
|
} else {
|
|
5023
|
-
if (typeof
|
|
5023
|
+
if (typeof u == "string" && (u.startsWith("[") || u.includes(",")))
|
|
5024
5024
|
try {
|
|
5025
|
-
|
|
5025
|
+
u = JSON.parse(u);
|
|
5026
5026
|
} catch {
|
|
5027
|
-
|
|
5027
|
+
u.includes(",") && (u = u.split(",").map((w) => w.trim()));
|
|
5028
5028
|
}
|
|
5029
|
-
Array.isArray(
|
|
5029
|
+
Array.isArray(u) && (u = u.map((w) => {
|
|
5030
5030
|
const R = typeof w == "string" ? w.trim() : w;
|
|
5031
5031
|
return String(R);
|
|
5032
5032
|
}));
|
|
5033
5033
|
}
|
|
5034
|
-
v[
|
|
5034
|
+
v[p] = u;
|
|
5035
5035
|
} catch {
|
|
5036
5036
|
}
|
|
5037
|
-
}), e.formConfig?.forEach((
|
|
5038
|
-
const
|
|
5039
|
-
let d = v[
|
|
5040
|
-
if (d != null &&
|
|
5037
|
+
}), e.formConfig?.forEach((p) => {
|
|
5038
|
+
const u = p.fieldName;
|
|
5039
|
+
let d = v[u];
|
|
5040
|
+
if (d != null && p.component && (p.component.name === "SunnyBusinessSearch" || p.component === "SunnyBusinessSearch")) {
|
|
5041
5041
|
if (typeof d == "string")
|
|
5042
5042
|
try {
|
|
5043
5043
|
d = JSON.parse(d);
|
|
@@ -5048,11 +5048,11 @@ function zs(e, n, t, o, r = qt) {
|
|
|
5048
5048
|
try {
|
|
5049
5049
|
const R = d.join(""), z = [];
|
|
5050
5050
|
let F = "", N = 0;
|
|
5051
|
-
for (let
|
|
5052
|
-
const
|
|
5053
|
-
if (F +=
|
|
5051
|
+
for (let j = 0; j < R.length; j++) {
|
|
5052
|
+
const M = R[j];
|
|
5053
|
+
if (F += M, M === "{")
|
|
5054
5054
|
N++;
|
|
5055
|
-
else if (
|
|
5055
|
+
else if (M === "}" && (N--, N === 0)) {
|
|
5056
5056
|
try {
|
|
5057
5057
|
z.push(JSON.parse(F));
|
|
5058
5058
|
} catch {
|
|
@@ -5064,20 +5064,20 @@ function zs(e, n, t, o, r = qt) {
|
|
|
5064
5064
|
} catch {
|
|
5065
5065
|
try {
|
|
5066
5066
|
const R = d.join(""), z = [];
|
|
5067
|
-
R.split("}{").map((N,
|
|
5067
|
+
R.split("}{").map((N, j) => j === 0 ? N + "}" : j === R.split("}{").length - 1 ? "{" + N : "{" + N + "}").forEach((N) => {
|
|
5068
5068
|
if (N.trim()) {
|
|
5069
|
-
const
|
|
5070
|
-
|
|
5069
|
+
const j = N.match(/"([^"]+)"\s*:\s*("[^"]*"|\d+)/g) || [], M = {};
|
|
5070
|
+
j.forEach((X) => {
|
|
5071
5071
|
const [Y, H] = X.split(/\s*:\s*/), Z = Y.replace(/"/g, "");
|
|
5072
5072
|
let J = H;
|
|
5073
|
-
J.startsWith('"') && J.endsWith('"') ? J = J.substring(1, J.length - 1) : isNaN(Number(J)) || (J = Number(J)),
|
|
5074
|
-
}), Object.keys(
|
|
5073
|
+
J.startsWith('"') && J.endsWith('"') ? J = J.substring(1, J.length - 1) : isNaN(Number(J)) || (J = Number(J)), M[Z] = J;
|
|
5074
|
+
}), Object.keys(M).length > 0 && z.push(M);
|
|
5075
5075
|
}
|
|
5076
5076
|
}), z.length > 0 && (d = z);
|
|
5077
5077
|
} catch {
|
|
5078
5078
|
}
|
|
5079
5079
|
}
|
|
5080
|
-
Array.isArray(d) ? v[
|
|
5080
|
+
Array.isArray(d) ? v[u] = d.map((R) => typeof R == "object" && R !== null ? R : { value: R }) : typeof d == "object" && d !== null ? v[u] = [d] : v[u] = d;
|
|
5081
5081
|
}
|
|
5082
5082
|
}
|
|
5083
5083
|
}), t && (t.value = { ...v }), o)
|
|
@@ -5085,7 +5085,7 @@ function zs(e, n, t, o, r = qt) {
|
|
|
5085
5085
|
await o.setValues(v);
|
|
5086
5086
|
} catch {
|
|
5087
5087
|
}
|
|
5088
|
-
n("select",
|
|
5088
|
+
n("select", x[0]);
|
|
5089
5089
|
}
|
|
5090
5090
|
} catch {
|
|
5091
5091
|
}
|
|
@@ -5093,49 +5093,49 @@ function zs(e, n, t, o, r = qt) {
|
|
|
5093
5093
|
loadSearchPlans: m,
|
|
5094
5094
|
loadDefaultSearchPlan: async () => {
|
|
5095
5095
|
try {
|
|
5096
|
-
const
|
|
5096
|
+
const x = {
|
|
5097
5097
|
...e.nResourceid && { nResourceid: e.nResourceid }
|
|
5098
|
-
}, T = (await r.findDefSearchPlan(
|
|
5098
|
+
}, T = (await r.findDefSearchPlan(x)).result || [];
|
|
5099
5099
|
if (T.length > 0) {
|
|
5100
5100
|
const v = {};
|
|
5101
|
-
if (T.forEach((
|
|
5102
|
-
|
|
5103
|
-
}), Object.keys(v).forEach((
|
|
5104
|
-
let
|
|
5101
|
+
if (T.forEach((p) => {
|
|
5102
|
+
p.C_COLNAME && p.C_COLVALUE !== void 0 && (v[p.C_COLNAME] = p.C_COLVALUE);
|
|
5103
|
+
}), Object.keys(v).forEach((p) => {
|
|
5104
|
+
let u = v[p];
|
|
5105
5105
|
try {
|
|
5106
5106
|
if (e.formConfig?.some(
|
|
5107
|
-
(w) => w.fieldName ===
|
|
5107
|
+
(w) => w.fieldName === p && w.component && (w.component.name === "SunnyBusinessSearch" || w.component === "SunnyBusinessSearch")
|
|
5108
5108
|
)) {
|
|
5109
|
-
if (typeof
|
|
5109
|
+
if (typeof u == "string")
|
|
5110
5110
|
try {
|
|
5111
|
-
|
|
5111
|
+
u = JSON.parse(u);
|
|
5112
5112
|
} catch {
|
|
5113
5113
|
}
|
|
5114
|
-
if (Array.isArray(
|
|
5114
|
+
if (Array.isArray(u) && u.every((R) => typeof R == "string") && u.length > 0)
|
|
5115
5115
|
try {
|
|
5116
|
-
const R =
|
|
5117
|
-
|
|
5116
|
+
const R = u.join("");
|
|
5117
|
+
u = JSON.parse(R);
|
|
5118
5118
|
} catch {
|
|
5119
5119
|
}
|
|
5120
5120
|
} else {
|
|
5121
|
-
if (typeof
|
|
5121
|
+
if (typeof u == "string" && (u.startsWith("[") || u.includes(",")))
|
|
5122
5122
|
try {
|
|
5123
|
-
|
|
5123
|
+
u = JSON.parse(u);
|
|
5124
5124
|
} catch {
|
|
5125
|
-
|
|
5125
|
+
u.includes(",") && (u = u.split(",").map((w) => w.trim()));
|
|
5126
5126
|
}
|
|
5127
|
-
Array.isArray(
|
|
5127
|
+
Array.isArray(u) && (u = u.map((w) => {
|
|
5128
5128
|
const R = typeof w == "string" ? w.trim() : w;
|
|
5129
5129
|
return String(R);
|
|
5130
5130
|
}));
|
|
5131
5131
|
}
|
|
5132
|
-
v[
|
|
5132
|
+
v[p] = u;
|
|
5133
5133
|
} catch {
|
|
5134
5134
|
}
|
|
5135
|
-
}), e.formConfig?.forEach((
|
|
5136
|
-
const
|
|
5137
|
-
let d = v[
|
|
5138
|
-
if (d != null &&
|
|
5135
|
+
}), e.formConfig?.forEach((p) => {
|
|
5136
|
+
const u = p.fieldName;
|
|
5137
|
+
let d = v[u];
|
|
5138
|
+
if (d != null && p.component && (p.component.name === "SunnyBusinessSearch" || p.component === "SunnyBusinessSearch")) {
|
|
5139
5139
|
if (typeof d == "string")
|
|
5140
5140
|
try {
|
|
5141
5141
|
d = JSON.parse(d);
|
|
@@ -5146,11 +5146,11 @@ function zs(e, n, t, o, r = qt) {
|
|
|
5146
5146
|
try {
|
|
5147
5147
|
const R = d.join(""), z = [];
|
|
5148
5148
|
let F = "", N = 0;
|
|
5149
|
-
for (let
|
|
5150
|
-
const
|
|
5151
|
-
if (F +=
|
|
5149
|
+
for (let j = 0; j < R.length; j++) {
|
|
5150
|
+
const M = R[j];
|
|
5151
|
+
if (F += M, M === "{")
|
|
5152
5152
|
N++;
|
|
5153
|
-
else if (
|
|
5153
|
+
else if (M === "}" && (N--, N === 0)) {
|
|
5154
5154
|
try {
|
|
5155
5155
|
z.push(JSON.parse(F));
|
|
5156
5156
|
} catch {
|
|
@@ -5162,20 +5162,20 @@ function zs(e, n, t, o, r = qt) {
|
|
|
5162
5162
|
} catch {
|
|
5163
5163
|
try {
|
|
5164
5164
|
const R = d.join(""), z = [];
|
|
5165
|
-
R.split("}{").map((N,
|
|
5165
|
+
R.split("}{").map((N, j) => j === 0 ? N + "}" : j === R.split("}{").length - 1 ? "{" + N : "{" + N + "}").forEach((N) => {
|
|
5166
5166
|
if (N.trim()) {
|
|
5167
|
-
const
|
|
5168
|
-
|
|
5167
|
+
const j = N.match(/"([^"]+)"\s*:\s*("[^"]*"|\d+)/g) || [], M = {};
|
|
5168
|
+
j.forEach((X) => {
|
|
5169
5169
|
const [Y, H] = X.split(/\s*:\s*/), Z = Y.replace(/"/g, "");
|
|
5170
5170
|
let J = H;
|
|
5171
|
-
J.startsWith('"') && J.endsWith('"') ? J = J.substring(1, J.length - 1) : isNaN(Number(J)) || (J = Number(J)),
|
|
5172
|
-
}), Object.keys(
|
|
5171
|
+
J.startsWith('"') && J.endsWith('"') ? J = J.substring(1, J.length - 1) : isNaN(Number(J)) || (J = Number(J)), M[Z] = J;
|
|
5172
|
+
}), Object.keys(M).length > 0 && z.push(M);
|
|
5173
5173
|
}
|
|
5174
5174
|
}), z.length > 0 && (d = z);
|
|
5175
5175
|
} catch {
|
|
5176
5176
|
}
|
|
5177
5177
|
}
|
|
5178
|
-
Array.isArray(d) ? v[
|
|
5178
|
+
Array.isArray(d) ? v[u] = d.map((R) => typeof R == "object" && R !== null ? R : { value: R }) : typeof d == "object" && d !== null ? v[u] = [d] : v[u] = d;
|
|
5179
5179
|
}
|
|
5180
5180
|
}
|
|
5181
5181
|
}), t && (t.value = { ...v }), o)
|
|
@@ -5186,8 +5186,8 @@ function zs(e, n, t, o, r = qt) {
|
|
|
5186
5186
|
return n("default-plan-loaded", v), v;
|
|
5187
5187
|
}
|
|
5188
5188
|
return n("default-plan-loaded", {}), {};
|
|
5189
|
-
} catch (
|
|
5190
|
-
return n("error",
|
|
5189
|
+
} catch (x) {
|
|
5190
|
+
return n("error", x), n("default-plan-loaded", {}), {};
|
|
5191
5191
|
}
|
|
5192
5192
|
}
|
|
5193
5193
|
};
|
|
@@ -5234,24 +5234,24 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5234
5234
|
handleUpdate: y,
|
|
5235
5235
|
handleDelete: c,
|
|
5236
5236
|
handleSelect: m,
|
|
5237
|
-
handleReset:
|
|
5237
|
+
handleReset: f,
|
|
5238
5238
|
handleSearch: C,
|
|
5239
5239
|
handleClose: g,
|
|
5240
5240
|
handleOpen: S,
|
|
5241
5241
|
loadSearchPlans: P,
|
|
5242
|
-
loadDefaultSearchPlan:
|
|
5242
|
+
loadDefaultSearchPlan: x
|
|
5243
5243
|
} = zs(t, o, s, r, t.api);
|
|
5244
5244
|
Ie(async () => {
|
|
5245
5245
|
if (t.resourceId)
|
|
5246
5246
|
try {
|
|
5247
5247
|
const N = await P(t.resourceId);
|
|
5248
|
-
o("update:searchPlanList", N), await
|
|
5248
|
+
o("update:searchPlanList", N), await x();
|
|
5249
5249
|
} catch (N) {
|
|
5250
5250
|
console.error("Failed to initialize search plan:", N);
|
|
5251
5251
|
}
|
|
5252
5252
|
else
|
|
5253
5253
|
try {
|
|
5254
|
-
await
|
|
5254
|
+
await x();
|
|
5255
5255
|
} catch (N) {
|
|
5256
5256
|
console.error("Failed to load default search plan:", N);
|
|
5257
5257
|
}
|
|
@@ -5265,9 +5265,9 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5265
5265
|
};
|
|
5266
5266
|
ne(
|
|
5267
5267
|
() => [t.model, t.modelValue],
|
|
5268
|
-
([N,
|
|
5269
|
-
const
|
|
5270
|
-
|
|
5268
|
+
([N, j]) => {
|
|
5269
|
+
const M = j || N;
|
|
5270
|
+
M && (s.value = { ...M }, r && r.setValues(M).catch((X) => {
|
|
5271
5271
|
console.error("setValues error:", X);
|
|
5272
5272
|
}));
|
|
5273
5273
|
},
|
|
@@ -5281,7 +5281,7 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5281
5281
|
);
|
|
5282
5282
|
const v = B(() => ({
|
|
5283
5283
|
...t.modalProps
|
|
5284
|
-
})),
|
|
5284
|
+
})), p = B(() => t.formConfig.map((N) => ({
|
|
5285
5285
|
...N,
|
|
5286
5286
|
labelWidth: 80,
|
|
5287
5287
|
colProps: {
|
|
@@ -5289,8 +5289,8 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5289
5289
|
span: 8
|
|
5290
5290
|
// 一行三列
|
|
5291
5291
|
}
|
|
5292
|
-
}))),
|
|
5293
|
-
return (N,
|
|
5292
|
+
}))), u = B(() => t.searchPlanList), d = B(() => t.currentSearchPlan), w = B(() => t.disabled), R = B(() => t.formProps), z = B(() => t.title), F = B(() => t.width);
|
|
5293
|
+
return (N, j) => (I(), O("div", Ds, [
|
|
5294
5294
|
q(N.$slots, "trigger", {
|
|
5295
5295
|
open: b,
|
|
5296
5296
|
disabled: w.value
|
|
@@ -5301,9 +5301,9 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5301
5301
|
onClick: b
|
|
5302
5302
|
}, L(i(K)("common.searchPlan.title")), 9, Us)
|
|
5303
5303
|
]),
|
|
5304
|
-
|
|
5304
|
+
E(i(st), D({
|
|
5305
5305
|
visible: i(a),
|
|
5306
|
-
"onUpdate:visible":
|
|
5306
|
+
"onUpdate:visible": j[5] || (j[5] = (M) => Se(a) ? a.value = M : null),
|
|
5307
5307
|
title: z.value,
|
|
5308
5308
|
width: F.value,
|
|
5309
5309
|
top: "50px",
|
|
@@ -5316,14 +5316,14 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5316
5316
|
k("div", ia, [
|
|
5317
5317
|
k("button", {
|
|
5318
5318
|
class: "px-3 py-1.5 border border-[var(--color-border-2)] rounded bg-white text-sm transition-colors hover:border-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-6))] disabled:cursor-not-allowed disabled:opacity-60",
|
|
5319
|
-
onClick:
|
|
5320
|
-
(...
|
|
5319
|
+
onClick: j[3] || (j[3] = //@ts-ignore
|
|
5320
|
+
(...M) => i(f) && i(f)(...M)),
|
|
5321
5321
|
disabled: t.loading
|
|
5322
5322
|
}, L(i(K)("common.searchPlan.reset")), 9, ca),
|
|
5323
5323
|
k("button", {
|
|
5324
5324
|
class: "px-3 py-1.5 bg-[rgb(var(--primary-6))] border border-[rgb(var(--primary-6))] text-white text-sm rounded hover:bg-[rgb(var(--primary-7))] transition-colors disabled:cursor-not-allowed disabled:opacity-60",
|
|
5325
|
-
onClick:
|
|
5326
|
-
(...
|
|
5325
|
+
onClick: j[4] || (j[4] = //@ts-ignore
|
|
5326
|
+
(...M) => i(C) && i(C)(...M)),
|
|
5327
5327
|
disabled: t.loading
|
|
5328
5328
|
}, L(i(K)("common.searchPlan.search")), 9, ua)
|
|
5329
5329
|
])
|
|
@@ -5331,16 +5331,16 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5331
5331
|
default: V(() => [
|
|
5332
5332
|
k("div", $s, [
|
|
5333
5333
|
t.loading ? (I(), O("div", qs, [
|
|
5334
|
-
|
|
5334
|
+
j[6] || (j[6] = k("div", { class: "w-7 h-7 border-3 border-[var(--color-border-2)] border-t-[rgb(var(--primary-6))] rounded-full animate-spin mb-2.5" }, null, -1)),
|
|
5335
5335
|
k("div", Ws, L(i(K)("common.searchPlan.loading")), 1)
|
|
5336
5336
|
])) : W("", !0),
|
|
5337
5337
|
k("div", {
|
|
5338
5338
|
class: G([{ "opacity-60": t.loading }, "flex gap-5"])
|
|
5339
5339
|
}, [
|
|
5340
5340
|
k("div", Js, [
|
|
5341
|
-
|
|
5341
|
+
E(i(Dt), D({
|
|
5342
5342
|
"form-api": i(r),
|
|
5343
|
-
schema:
|
|
5343
|
+
schema: p.value,
|
|
5344
5344
|
"show-default-actions": !1,
|
|
5345
5345
|
"show-message": !1,
|
|
5346
5346
|
layout: "vertical"
|
|
@@ -5352,7 +5352,7 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5352
5352
|
k("div", Ks, [
|
|
5353
5353
|
k("label", Hs, L(i(K)("common.searchPlan.planName")), 1),
|
|
5354
5354
|
Ze(k("input", {
|
|
5355
|
-
"onUpdate:modelValue":
|
|
5355
|
+
"onUpdate:modelValue": j[0] || (j[0] = (M) => Se(l) ? l.value = M : null),
|
|
5356
5356
|
type: "text",
|
|
5357
5357
|
placeholder: i(K)("common.searchPlan.planNamePlaceholder"),
|
|
5358
5358
|
class: "w-full px-2 py-1.5 border border-[var(--color-border-2)] rounded text-xs focus:outline-none focus:border-[rgb(var(--primary-6))] focus:ring-2 focus:ring-[rgb(var(--primary-1))]",
|
|
@@ -5365,40 +5365,40 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5365
5365
|
k("div", ea, [
|
|
5366
5366
|
k("button", {
|
|
5367
5367
|
class: "px-3 py-1 border border-[rgb(var(--primary-6))] text-[rgb(var(--primary-6))] text-xs rounded hover:bg-[rgb(var(--primary-6))] hover:text-white transition-colors disabled:cursor-not-allowed disabled:opacity-60",
|
|
5368
|
-
onClick:
|
|
5369
|
-
(...
|
|
5368
|
+
onClick: j[1] || (j[1] = //@ts-ignore
|
|
5369
|
+
(...M) => i(A) && i(A)(...M)),
|
|
5370
5370
|
disabled: t.loading
|
|
5371
5371
|
}, L(i(K)("common.searchPlan.add")), 9, ta),
|
|
5372
5372
|
k("button", {
|
|
5373
5373
|
class: "px-3 py-1 border border-[#ff4949] text-[#ff4949] text-xs rounded hover:bg-[#ff4949] hover:text-white transition-colors disabled:cursor-not-allowed disabled:opacity-60",
|
|
5374
5374
|
disabled: !d.value || t.loading,
|
|
5375
|
-
onClick:
|
|
5376
|
-
(...
|
|
5375
|
+
onClick: j[2] || (j[2] = //@ts-ignore
|
|
5376
|
+
(...M) => i(y) && i(y)(...M))
|
|
5377
5377
|
}, L(i(K)("common.searchPlan.update")), 9, na)
|
|
5378
5378
|
])
|
|
5379
5379
|
]),
|
|
5380
|
-
|
|
5380
|
+
j[7] || (j[7] = k("div", { class: "h-px bg-[var(--color-border-2)] my-5" }, null, -1)),
|
|
5381
5381
|
k("h3", oa, L(i(K)("common.searchPlan.savedPlans")), 1),
|
|
5382
5382
|
k("div", ra, [
|
|
5383
|
-
(I(!0), O(se, null, te(
|
|
5384
|
-
key:
|
|
5385
|
-
class: G(["flex items-center p-2 mb-1 rounded cursor-pointer transition-all hover:bg-[var(--color-fill-1)] border border-transparent", { "bg-[rgb(var(--primary-1))] border-[rgb(var(--primary-6))]": d.value && (d.value.ID ==
|
|
5386
|
-
onClick: (Y) => i(m)(
|
|
5383
|
+
(I(!0), O(se, null, te(u.value, (M, X) => (I(), O("div", {
|
|
5384
|
+
key: M.ID,
|
|
5385
|
+
class: G(["flex items-center p-2 mb-1 rounded cursor-pointer transition-all hover:bg-[var(--color-fill-1)] border border-transparent", { "bg-[rgb(var(--primary-1))] border-[rgb(var(--primary-6))]": d.value && (d.value.ID == M.ID || d.value.ID === M.ID) }]),
|
|
5386
|
+
onClick: (Y) => i(m)(M),
|
|
5387
5387
|
style: ce({ cursor: t.loading ? "not-allowed" : "pointer" })
|
|
5388
5388
|
}, [
|
|
5389
5389
|
k("div", {
|
|
5390
|
-
class: G(["w-5 h-5 flex items-center justify-center rounded text-xs mr-2 text-[var(--color-text-2)]", d.value && (d.value.ID ==
|
|
5390
|
+
class: G(["w-5 h-5 flex items-center justify-center rounded text-xs mr-2 text-[var(--color-text-2)]", d.value && (d.value.ID == M.ID || d.value.ID === M.ID) ? "bg-[rgb(var(--primary-6))] text-white" : "bg-[var(--color-fill-2)]"])
|
|
5391
5391
|
}, L(String(X + 1).padStart(2, "0")), 3),
|
|
5392
5392
|
k("div", {
|
|
5393
|
-
class: G(["flex-1 text-xs truncate", d.value && (d.value.ID ==
|
|
5394
|
-
}, L(
|
|
5393
|
+
class: G(["flex-1 text-xs truncate", d.value && (d.value.ID == M.ID || d.value.ID === M.ID) ? "text-[rgb(var(--primary-6))] font-medium" : "text-[var(--color-text-1)]"])
|
|
5394
|
+
}, L(M.CSEARCHPLANNAME), 3),
|
|
5395
5395
|
k("button", {
|
|
5396
5396
|
class: "w-4 h-4 flex items-center justify-center border-none bg-transparent cursor-pointer text-sm text-[var(--color-text-3)] transition-colors rounded hover:text-[var(--color-danger)] hover:bg-[var(--color-danger-light)]",
|
|
5397
|
-
onClick: ue((Y) => i(c)(
|
|
5397
|
+
onClick: ue((Y) => i(c)(M), ["stop"]),
|
|
5398
5398
|
disabled: t.loading
|
|
5399
5399
|
}, " × ", 8, aa)
|
|
5400
5400
|
], 14, sa))), 128)),
|
|
5401
|
-
|
|
5401
|
+
u.value.length === 0 ? (I(), O("div", la, L(i(K)("common.searchPlan.noPlans")), 1)) : W("", !0)
|
|
5402
5402
|
])
|
|
5403
5403
|
])
|
|
5404
5404
|
], 2)
|
|
@@ -5443,7 +5443,7 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5443
5443
|
set: (P) => {
|
|
5444
5444
|
s("update:modelValue", P);
|
|
5445
5445
|
}
|
|
5446
|
-
}),
|
|
5446
|
+
}), f = async () => {
|
|
5447
5447
|
if (r.cNum)
|
|
5448
5448
|
try {
|
|
5449
5449
|
const P = de.customizeSelectAdapter;
|
|
@@ -5451,14 +5451,14 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5451
5451
|
c.value = !0, _.error("CustomizeSelect adapter not configured");
|
|
5452
5452
|
return;
|
|
5453
5453
|
}
|
|
5454
|
-
const
|
|
5454
|
+
const x = {
|
|
5455
5455
|
cNum: r.cNum,
|
|
5456
5456
|
attrParam: {
|
|
5457
5457
|
...r.attrParam
|
|
5458
5458
|
}
|
|
5459
5459
|
};
|
|
5460
|
-
m.value && (
|
|
5461
|
-
const b = await P.query(
|
|
5460
|
+
m.value && (x.cVal = Tn(m.value));
|
|
5461
|
+
const b = await P.query(x);
|
|
5462
5462
|
h.value = b.options || [], A.value = b.options || [], b.config && (l.value = Object.assign({}, l.value, b.config)), c.value = !1;
|
|
5463
5463
|
} catch (P) {
|
|
5464
5464
|
c.value = !0, _.error(P?.message || "加载失败");
|
|
@@ -5468,7 +5468,7 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5468
5468
|
}, g = Fn((P) => {
|
|
5469
5469
|
if (P !== "") {
|
|
5470
5470
|
y.value = !0;
|
|
5471
|
-
const
|
|
5471
|
+
const x = de.customizeSelectAdapter, b = {
|
|
5472
5472
|
cNum: r.cNum,
|
|
5473
5473
|
attrParam: {
|
|
5474
5474
|
...r.attrParam
|
|
@@ -5476,9 +5476,9 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5476
5476
|
searchCondition: P
|
|
5477
5477
|
};
|
|
5478
5478
|
Promise.resolve().then(async () => {
|
|
5479
|
-
if (!
|
|
5479
|
+
if (!x?.query)
|
|
5480
5480
|
throw new Error("CustomizeSelect adapter not configured");
|
|
5481
|
-
return
|
|
5481
|
+
return x.query(b);
|
|
5482
5482
|
}).then((T) => {
|
|
5483
5483
|
T.config && (l.value = Object.assign({}, l.value, T.config)), h.value = T.options || [], A.value = T.options || [];
|
|
5484
5484
|
}).catch((T) => {
|
|
@@ -5494,15 +5494,15 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5494
5494
|
return ne(
|
|
5495
5495
|
() => r.attrParam,
|
|
5496
5496
|
() => {
|
|
5497
|
-
|
|
5497
|
+
f();
|
|
5498
5498
|
},
|
|
5499
5499
|
{ deep: !0 }
|
|
5500
5500
|
), Ie(() => {
|
|
5501
|
-
r.defaultQuery && r.defaultQuery === !0 ?
|
|
5502
|
-
}), (P,
|
|
5503
|
-
|
|
5501
|
+
r.defaultQuery && r.defaultQuery === !0 ? f() : r.cNum && r.defaultQuery === !1 && (l.value = Object.assign({}, l.value, r.defaultConfig));
|
|
5502
|
+
}), (P, x) => (I(), O("div", fa, [
|
|
5503
|
+
E(i(t), D({
|
|
5504
5504
|
modelValue: m.value,
|
|
5505
|
-
"onUpdate:modelValue":
|
|
5505
|
+
"onUpdate:modelValue": x[0] || (x[0] = (b) => m.value = b),
|
|
5506
5506
|
"allow-clear": "",
|
|
5507
5507
|
"allow-search": l.value.nType == 1,
|
|
5508
5508
|
loading: y.value,
|
|
@@ -5554,7 +5554,7 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5554
5554
|
{ label: "20000", value: "20000" },
|
|
5555
5555
|
{ label: "50000", value: "50000" },
|
|
5556
5556
|
{ label: "100000", value: "100000" }
|
|
5557
|
-
],
|
|
5557
|
+
], f = async () => {
|
|
5558
5558
|
A.value = !0;
|
|
5559
5559
|
try {
|
|
5560
5560
|
const b = await he.post(`${de.apiPrefix}${r.exportUrl}/export/openInit`, {
|
|
@@ -5568,7 +5568,7 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5568
5568
|
A.value = !1;
|
|
5569
5569
|
}
|
|
5570
5570
|
}, C = () => {
|
|
5571
|
-
|
|
5571
|
+
f();
|
|
5572
5572
|
}, g = () => {
|
|
5573
5573
|
a.value = !1, s("close");
|
|
5574
5574
|
};
|
|
@@ -5582,8 +5582,8 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5582
5582
|
}, P = async () => {
|
|
5583
5583
|
y.value = !0;
|
|
5584
5584
|
try {
|
|
5585
|
-
l.value.forEach((
|
|
5586
|
-
|
|
5585
|
+
l.value.forEach((p) => {
|
|
5586
|
+
p.colType === "spanselect" && isNaN(Number(p.selId));
|
|
5587
5587
|
});
|
|
5588
5588
|
const b = {
|
|
5589
5589
|
conditionMap: r.conditionMap || {},
|
|
@@ -5599,35 +5599,35 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5599
5599
|
}
|
|
5600
5600
|
), v = new FileReader();
|
|
5601
5601
|
v.onload = function() {
|
|
5602
|
-
const
|
|
5603
|
-
d.href = URL.createObjectURL(
|
|
5602
|
+
const p = T.headers["content-disposition"]?.split("attachment;filename=")[1], u = new Blob([T.data]), d = document.createElement("a");
|
|
5603
|
+
d.href = URL.createObjectURL(u), d.download = decodeURI(p || "export.xlsx"), d.click(), URL.revokeObjectURL(d.href), g(), s("export-success", T);
|
|
5604
5604
|
}, v.readAsText(T.data);
|
|
5605
5605
|
} catch (b) {
|
|
5606
5606
|
_.error(b.message), s("export-error", b);
|
|
5607
5607
|
} finally {
|
|
5608
5608
|
y.value = !1;
|
|
5609
5609
|
}
|
|
5610
|
-
},
|
|
5610
|
+
}, x = () => {
|
|
5611
5611
|
g();
|
|
5612
5612
|
};
|
|
5613
5613
|
return (b, T) => {
|
|
5614
|
-
const v = oe("vxe-checkbox"),
|
|
5614
|
+
const v = oe("vxe-checkbox"), p = oe("vxe-column"), u = oe("vxe-table");
|
|
5615
5615
|
return I(), $(i(xe), {
|
|
5616
5616
|
visible: a.value,
|
|
5617
5617
|
"onUpdate:visible": T[2] || (T[2] = (d) => a.value = d),
|
|
5618
5618
|
title: i(o)("common.exportModal.title"),
|
|
5619
5619
|
width: 700,
|
|
5620
5620
|
"mask-closable": !1,
|
|
5621
|
-
onCancel:
|
|
5621
|
+
onCancel: x
|
|
5622
5622
|
}, {
|
|
5623
5623
|
footer: V(() => [
|
|
5624
|
-
|
|
5624
|
+
E(i(ie), { onClick: x }, {
|
|
5625
5625
|
default: V(() => [
|
|
5626
5626
|
ee(L(i(o)("common.modal.cancel")), 1)
|
|
5627
5627
|
]),
|
|
5628
5628
|
_: 1
|
|
5629
5629
|
}),
|
|
5630
|
-
|
|
5630
|
+
E(i(ie), {
|
|
5631
5631
|
type: "primary",
|
|
5632
5632
|
loading: y.value,
|
|
5633
5633
|
onClick: P
|
|
@@ -5639,7 +5639,7 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5639
5639
|
}, 8, ["loading"])
|
|
5640
5640
|
]),
|
|
5641
5641
|
default: V(() => [
|
|
5642
|
-
|
|
5642
|
+
E(i(gn), {
|
|
5643
5643
|
model: h.value,
|
|
5644
5644
|
layout: "inline"
|
|
5645
5645
|
}, {
|
|
@@ -5649,14 +5649,14 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5649
5649
|
label: i(o)("common.exportModal.showSheetRowNum")
|
|
5650
5650
|
}, {
|
|
5651
5651
|
default: V(() => [
|
|
5652
|
-
|
|
5652
|
+
E(i(Ae), {
|
|
5653
5653
|
modelValue: h.value.nSheetRowNum,
|
|
5654
5654
|
"onUpdate:modelValue": T[0] || (T[0] = (d) => h.value.nSheetRowNum = d),
|
|
5655
5655
|
placeholder: h.value.hintSheetRowNum,
|
|
5656
5656
|
"allow-clear": ""
|
|
5657
5657
|
}, {
|
|
5658
5658
|
default: V(() => [
|
|
5659
|
-
(I(), O(se, null, te(m, (d) =>
|
|
5659
|
+
(I(), O(se, null, te(m, (d) => E(i(je), {
|
|
5660
5660
|
key: d.value,
|
|
5661
5661
|
label: d.label,
|
|
5662
5662
|
value: d.value
|
|
@@ -5672,7 +5672,7 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5672
5672
|
label: i(o)("common.exportModal.showMaxExportNumber")
|
|
5673
5673
|
}, {
|
|
5674
5674
|
default: V(() => [
|
|
5675
|
-
|
|
5675
|
+
E(i(Ee), {
|
|
5676
5676
|
modelValue: h.value.maxExportNumber,
|
|
5677
5677
|
"onUpdate:modelValue": T[1] || (T[1] = (d) => h.value.maxExportNumber = d),
|
|
5678
5678
|
placeholder: h.value.hintMaxExportNumber
|
|
@@ -5683,7 +5683,7 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5683
5683
|
]),
|
|
5684
5684
|
_: 1
|
|
5685
5685
|
}, 8, ["model"]),
|
|
5686
|
-
|
|
5686
|
+
E(u, {
|
|
5687
5687
|
size: "mini",
|
|
5688
5688
|
data: l.value,
|
|
5689
5689
|
border: "",
|
|
@@ -5695,13 +5695,13 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5695
5695
|
onRowDragEnd: S
|
|
5696
5696
|
}, {
|
|
5697
5697
|
default: V(() => [
|
|
5698
|
-
|
|
5698
|
+
E(p, {
|
|
5699
5699
|
title: i(o)("common.exportModal.nSfExport"),
|
|
5700
5700
|
width: "70",
|
|
5701
5701
|
align: "center"
|
|
5702
5702
|
}, {
|
|
5703
5703
|
default: V(({ row: d }) => [
|
|
5704
|
-
|
|
5704
|
+
E(v, {
|
|
5705
5705
|
modelValue: d.nSfExport,
|
|
5706
5706
|
"onUpdate:modelValue": (w) => d.nSfExport = w,
|
|
5707
5707
|
size: "small",
|
|
@@ -5711,18 +5711,18 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5711
5711
|
]),
|
|
5712
5712
|
_: 1
|
|
5713
5713
|
}, 8, ["title"]),
|
|
5714
|
-
|
|
5714
|
+
E(p, {
|
|
5715
5715
|
field: "colName",
|
|
5716
5716
|
title: i(o)("common.exportModal.colName"),
|
|
5717
5717
|
align: "center"
|
|
5718
5718
|
}, null, 8, ["title"]),
|
|
5719
|
-
|
|
5719
|
+
E(p, {
|
|
5720
5720
|
title: i(o)("common.exportModal.colWidth"),
|
|
5721
5721
|
width: "100",
|
|
5722
5722
|
align: "center"
|
|
5723
5723
|
}, {
|
|
5724
5724
|
default: V(({ row: d }) => [
|
|
5725
|
-
|
|
5725
|
+
E(i(Ee), {
|
|
5726
5726
|
modelValue: d.colWidth,
|
|
5727
5727
|
"onUpdate:modelValue": (w) => d.colWidth = w,
|
|
5728
5728
|
size: "small"
|
|
@@ -5730,19 +5730,19 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5730
5730
|
]),
|
|
5731
5731
|
_: 1
|
|
5732
5732
|
}, 8, ["title"]),
|
|
5733
|
-
|
|
5733
|
+
E(p, {
|
|
5734
5734
|
title: i(o)("common.exportModal.colDataType"),
|
|
5735
5735
|
width: "120",
|
|
5736
5736
|
align: "center"
|
|
5737
5737
|
}, {
|
|
5738
5738
|
default: V(({ row: d }) => [
|
|
5739
|
-
|
|
5739
|
+
E(i(Ae), {
|
|
5740
5740
|
modelValue: d.colDataType,
|
|
5741
5741
|
"onUpdate:modelValue": (w) => d.colDataType = w,
|
|
5742
5742
|
size: "small"
|
|
5743
5743
|
}, {
|
|
5744
5744
|
default: V(() => [
|
|
5745
|
-
(I(), O(se, null, te(c, (w) =>
|
|
5745
|
+
(I(), O(se, null, te(c, (w) => E(i(je), {
|
|
5746
5746
|
key: w.value,
|
|
5747
5747
|
label: w.label,
|
|
5748
5748
|
value: w.value
|
|
@@ -5753,7 +5753,7 @@ const Ds = { class: "inline-block" }, Us = ["disabled"], $s = { class: "p-5 rela
|
|
|
5753
5753
|
]),
|
|
5754
5754
|
_: 1
|
|
5755
5755
|
}, 8, ["title"]),
|
|
5756
|
-
|
|
5756
|
+
E(p, {
|
|
5757
5757
|
title: i(o)("common.exportModal.drag"),
|
|
5758
5758
|
width: "50",
|
|
5759
5759
|
align: "center",
|
|
@@ -5806,14 +5806,14 @@ const ga = { class: "import-modal-body" }, va = { class: "option-label" }, ya =
|
|
|
5806
5806
|
},
|
|
5807
5807
|
emits: ["upload-success", "upload-error", "download-success", "download-error", "close"],
|
|
5808
5808
|
setup(e, { expose: n, emit: t }) {
|
|
5809
|
-
const { t: o } = Bt(), r = e, s = t, a = Q(!1), l = Q([]), h = Q(!1), A = Q(!1), y = Q(), c = (b) => l.value.length >= r.limit ? (_.error(o("common.importModal.maxUploadLimit", { limit: r.limit })), !1) : r.accept.split(",").some((
|
|
5809
|
+
const { t: o } = Bt(), r = e, s = t, a = Q(!1), l = Q([]), h = Q(!1), A = Q(!1), y = Q(), c = (b) => l.value.length >= r.limit ? (_.error(o("common.importModal.maxUploadLimit", { limit: r.limit })), !1) : r.accept.split(",").some((p) => b.name.endsWith(p.replace(".", ""))) ? b.size / 1024 / 1024 < r.maxSize ? !0 : (_.error(o("common.importModal.maxSize", { maxSize: r.maxSize })), !1) : (_.error(o("common.importModal.onlySupport", { accept: r.accept })), !1), m = () => {
|
|
5810
5810
|
y.value.submit();
|
|
5811
|
-
},
|
|
5812
|
-
const { onProgress: T, onError: v, onSuccess:
|
|
5811
|
+
}, f = async (b) => {
|
|
5812
|
+
const { onProgress: T, onError: v, onSuccess: p, fileItem: u, name: d } = b;
|
|
5813
5813
|
h.value = !0;
|
|
5814
5814
|
try {
|
|
5815
5815
|
const w = new FormData();
|
|
5816
|
-
w.append("fileName",
|
|
5816
|
+
w.append("fileName", u.file), w.append("nModid", String(r.nModid)), w.append("nButtonid", String(r.nButtonid)), r.params && w.append("paramMap", JSON.stringify(r.params));
|
|
5817
5817
|
const R = A.value ? `${de.apiPrefix}${r.uploadUrl}/upload/fileUploadDecode` : `${de.apiPrefix}${r.uploadUrl}/upload/fileUpload`, z = await he.post(R, w, {
|
|
5818
5818
|
headers: {
|
|
5819
5819
|
"Content-Type": "multipart/form-data"
|
|
@@ -5822,7 +5822,7 @@ const ga = { class: "import-modal-body" }, va = { class: "option-label" }, ya =
|
|
|
5822
5822
|
z.data.code === 200 ? (_.success({
|
|
5823
5823
|
content: z.data.message || o("common.importModal.uploadSuccess"),
|
|
5824
5824
|
duration: 5e3
|
|
5825
|
-
}),
|
|
5825
|
+
}), p(z.data), s("upload-success", z.data), P()) : (_.error(z.data.message || o("common.importModal.uploadError")), v(z.data), s("upload-error", z.data));
|
|
5826
5826
|
} catch (w) {
|
|
5827
5827
|
_.error(w.message || o("common.importModal.uploadError")), v(w), s("upload-error", w);
|
|
5828
5828
|
} finally {
|
|
@@ -5836,8 +5836,8 @@ const ga = { class: "import-modal-body" }, va = { class: "option-label" }, ya =
|
|
|
5836
5836
|
responseType: "blob"
|
|
5837
5837
|
}), T = new FileReader();
|
|
5838
5838
|
T.onload = function() {
|
|
5839
|
-
const v = b.headers["content-disposition"]?.split("attachment;filename=")[1],
|
|
5840
|
-
|
|
5839
|
+
const v = b.headers["content-disposition"]?.split("attachment;filename=")[1], p = new Blob([b.data]), u = document.createElement("a");
|
|
5840
|
+
u.href = URL.createObjectURL(p), u.download = decodeURI(v || "template.xlsx"), u.click(), URL.revokeObjectURL(u.href), s("download-success");
|
|
5841
5841
|
}, T.readAsText(b.data);
|
|
5842
5842
|
} catch (b) {
|
|
5843
5843
|
_.error(b.message || "模板下载失败"), s("download-error", b);
|
|
@@ -5851,36 +5851,36 @@ const ga = { class: "import-modal-body" }, va = { class: "option-label" }, ya =
|
|
|
5851
5851
|
open: S,
|
|
5852
5852
|
close: P
|
|
5853
5853
|
});
|
|
5854
|
-
const
|
|
5854
|
+
const x = () => {
|
|
5855
5855
|
P();
|
|
5856
5856
|
};
|
|
5857
5857
|
return (b, T) => {
|
|
5858
5858
|
const v = oe("a-space");
|
|
5859
5859
|
return I(), $(i(xe), {
|
|
5860
5860
|
visible: a.value,
|
|
5861
|
-
"onUpdate:visible": T[3] || (T[3] = (
|
|
5861
|
+
"onUpdate:visible": T[3] || (T[3] = (p) => a.value = p),
|
|
5862
5862
|
title: i(o)("common.importModal.title"),
|
|
5863
5863
|
width: 550,
|
|
5864
5864
|
"mask-closable": !1,
|
|
5865
5865
|
footer: !1,
|
|
5866
|
-
onCancel:
|
|
5866
|
+
onCancel: x
|
|
5867
5867
|
}, {
|
|
5868
5868
|
default: V(() => [
|
|
5869
5869
|
k("div", ga, [
|
|
5870
|
-
|
|
5870
|
+
E(i(Me), {
|
|
5871
5871
|
action: "#",
|
|
5872
5872
|
"auto-upload": !1,
|
|
5873
5873
|
ref_key: "uploadRef",
|
|
5874
5874
|
ref: y,
|
|
5875
5875
|
multiple: "",
|
|
5876
|
-
"custom-request":
|
|
5876
|
+
"custom-request": f,
|
|
5877
5877
|
onBeforeUpload: c,
|
|
5878
5878
|
onChange: C
|
|
5879
5879
|
}, {
|
|
5880
5880
|
"upload-button": V(() => [
|
|
5881
|
-
|
|
5881
|
+
E(v, null, {
|
|
5882
5882
|
default: V(() => [
|
|
5883
|
-
|
|
5883
|
+
E(i(ie), {
|
|
5884
5884
|
type: "outline",
|
|
5885
5885
|
disabled: h.value,
|
|
5886
5886
|
onClick: ue(g, ["stop"])
|
|
@@ -5890,13 +5890,13 @@ const ga = { class: "import-modal-body" }, va = { class: "option-label" }, ya =
|
|
|
5890
5890
|
]),
|
|
5891
5891
|
_: 1
|
|
5892
5892
|
}, 8, ["disabled"]),
|
|
5893
|
-
|
|
5893
|
+
E(i(ie), null, {
|
|
5894
5894
|
default: V(() => [
|
|
5895
5895
|
ee(L(i(o)("common.importModal.selectFile")), 1)
|
|
5896
5896
|
]),
|
|
5897
5897
|
_: 1
|
|
5898
5898
|
}),
|
|
5899
|
-
|
|
5899
|
+
E(i(ie), {
|
|
5900
5900
|
type: "primary",
|
|
5901
5901
|
disabled: h.value,
|
|
5902
5902
|
onClick: ue(m, ["stop"])
|
|
@@ -5911,9 +5911,9 @@ const ga = { class: "import-modal-body" }, va = { class: "option-label" }, ya =
|
|
|
5911
5911
|
}, ["stop"]))
|
|
5912
5912
|
}, [
|
|
5913
5913
|
k("span", va, L(i(o)("common.importModal.isdecode")) + ":", 1),
|
|
5914
|
-
|
|
5914
|
+
E(i(Oe), {
|
|
5915
5915
|
modelValue: A.value,
|
|
5916
|
-
"onUpdate:modelValue": T[0] || (T[0] = (
|
|
5916
|
+
"onUpdate:modelValue": T[0] || (T[0] = (p) => A.value = p),
|
|
5917
5917
|
onClick: T[1] || (T[1] = ue(() => {
|
|
5918
5918
|
}, ["stop"]))
|
|
5919
5919
|
}, null, 8, ["modelValue"])
|