yxuse 3.0.56 → 3.0.57
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/lib/index.cjs12.js +1 -1
- package/lib/index.cjs12.js.gz +0 -0
- package/lib/index.cjs12.js.map +1 -1
- package/lib/index.cjs2.js +1 -1
- package/lib/index.cjs2.js.map +1 -1
- package/lib/index.cjs3.js +1 -1
- package/lib/index.cjs3.js.map +1 -1
- package/lib/index.cjs4.js +1 -1
- package/lib/index.cjs4.js.map +1 -1
- package/lib/index.cjs5.js +5 -5
- package/lib/index.cjs5.js.gz +0 -0
- package/lib/index.cjs5.js.map +1 -1
- package/lib/index.cjs6.js +3 -3
- package/lib/index.cjs6.js.gz +0 -0
- package/lib/index.cjs6.js.map +1 -1
- package/lib/index.cjs7.js +4 -4
- package/lib/index.cjs7.js.gz +0 -0
- package/lib/index.cjs7.js.map +1 -1
- package/lib/index.es12.js +99 -209
- package/lib/index.es12.js.gz +0 -0
- package/lib/index.es12.js.map +1 -1
- package/lib/index.es2.js +54 -90
- package/lib/index.es2.js.map +1 -1
- package/lib/index.es3.js +6 -26
- package/lib/index.es3.js.map +1 -1
- package/lib/index.es4.js +12 -32
- package/lib/index.es4.js.map +1 -1
- package/lib/index.es5.js +125 -169
- package/lib/index.es5.js.gz +0 -0
- package/lib/index.es5.js.map +1 -1
- package/lib/index.es6.js +162 -184
- package/lib/index.es6.js.gz +0 -0
- package/lib/index.es6.js.map +1 -1
- package/lib/index.es7.js +118 -162
- package/lib/index.es7.js.gz +0 -0
- package/lib/index.es7.js.map +1 -1
- package/lib/mqtt.min.cjs.js +1 -1
- package/lib/mqtt.min.cjs.js.gz +0 -0
- package/lib/mqtt.min.cjs.js.map +1 -1
- package/lib/mqtt.min.es.js +21 -37
- package/lib/mqtt.min.es.js.gz +0 -0
- package/lib/mqtt.min.es.js.map +1 -1
- package/lib/style.css +1 -1
- package/lib/style.css.gz +0 -0
- package/package.json +1 -1
- package/types/components/YxForm/type.d.ts +11 -1
- package/types/components/YxUpload/index.vue.d.ts +2 -1
package/lib/index.es6.js
CHANGED
|
@@ -1,54 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
var __async = (__this, __arguments, generator) => {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
var fulfilled = (value) => {
|
|
35
|
-
try {
|
|
36
|
-
step(generator.next(value));
|
|
37
|
-
} catch (e) {
|
|
38
|
-
reject(e);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var rejected = (value) => {
|
|
42
|
-
try {
|
|
43
|
-
step(generator.throw(value));
|
|
44
|
-
} catch (e) {
|
|
45
|
-
reject(e);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
1
|
import { defineComponent, reactive, resolveComponent, createBlock, openBlock, createSlots, withCtx, renderSlot, createElementVNode, createVNode, createTextVNode, watch, resolveDynamicComponent, mergeProps, createElementBlock, createCommentVNode, Fragment, renderList, useSlots, useAttrs, ref, onMounted, nextTick, onBeforeMount, withModifiers, isVNode, toDisplayString, unref, normalizeStyle, normalizeClass, version, createApp } from "vue";
|
|
53
2
|
import { S as Sortable, _ as _export_sfc, T as Toolbar } from "./index.es5.js";
|
|
54
3
|
import { genFileId } from "element-plus";
|
|
@@ -71,18 +20,18 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
71
20
|
dialogOptions.show = false;
|
|
72
21
|
};
|
|
73
22
|
const dialogMap = {};
|
|
74
|
-
const submit = () =>
|
|
75
|
-
if (dialogMap["beforeSubmit"] && !
|
|
23
|
+
const submit = async () => {
|
|
24
|
+
if (dialogMap["beforeSubmit"] && !await dialogMap["beforeSubmit"]()) return;
|
|
76
25
|
dialogOptions.loading = true;
|
|
77
26
|
try {
|
|
78
|
-
dialogMap["submit"] &&
|
|
27
|
+
dialogMap["submit"] && await dialogMap["submit"]();
|
|
79
28
|
dialogOptions.loading = false;
|
|
80
29
|
if (dialogOptions.autoClose) close();
|
|
81
30
|
} catch (err) {
|
|
82
31
|
dialogOptions.loading = false;
|
|
83
32
|
}
|
|
84
|
-
}
|
|
85
|
-
const show =
|
|
33
|
+
};
|
|
34
|
+
const show = async ({ width, title, submit: submit2, cancel, showFooter, autoClose, beforeOpen, beforeSubmit }) => {
|
|
86
35
|
if (width) dialogOptions.width = width;
|
|
87
36
|
if (title) dialogOptions.title = title;
|
|
88
37
|
if (showFooter !== void 0) dialogOptions.showFooter = showFooter;
|
|
@@ -91,10 +40,10 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
91
40
|
if (cancel) dialogMap["cancel"] = cancel;
|
|
92
41
|
if (beforeSubmit) dialogMap["beforeSubmit"] = beforeSubmit;
|
|
93
42
|
if (beforeOpen) {
|
|
94
|
-
|
|
43
|
+
await beforeOpen();
|
|
95
44
|
}
|
|
96
45
|
dialogOptions.show = true;
|
|
97
|
-
}
|
|
46
|
+
};
|
|
98
47
|
__expose({
|
|
99
48
|
show,
|
|
100
49
|
close
|
|
@@ -164,18 +113,18 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
164
113
|
drawerOptions.show = false;
|
|
165
114
|
};
|
|
166
115
|
const drawerMap = {};
|
|
167
|
-
const submit = () =>
|
|
168
|
-
if (drawerMap["beforeSubmit"] && !
|
|
116
|
+
const submit = async () => {
|
|
117
|
+
if (drawerMap["beforeSubmit"] && !await drawerMap["beforeSubmit"]()) return;
|
|
169
118
|
drawerOptions.loading = true;
|
|
170
119
|
try {
|
|
171
|
-
drawerMap["submit"] &&
|
|
120
|
+
drawerMap["submit"] && await drawerMap["submit"]();
|
|
172
121
|
drawerOptions.loading = false;
|
|
173
122
|
if (drawerOptions.autoClose) close();
|
|
174
123
|
} catch (err) {
|
|
175
124
|
drawerOptions.loading = false;
|
|
176
125
|
}
|
|
177
|
-
}
|
|
178
|
-
const show =
|
|
126
|
+
};
|
|
127
|
+
const show = async ({ width, title, submit: submit2, cancel, showFooter, autoClose, beforeOpen, beforeSubmit }) => {
|
|
179
128
|
if (width) drawerOptions.width = width;
|
|
180
129
|
if (title) drawerOptions.title = title;
|
|
181
130
|
if (showFooter !== void 0) drawerOptions.showFooter = showFooter;
|
|
@@ -184,10 +133,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
184
133
|
if (cancel) drawerMap["cancel"] = cancel;
|
|
185
134
|
if (beforeSubmit) drawerMap["beforeSubmit"] = beforeSubmit;
|
|
186
135
|
if (beforeOpen) {
|
|
187
|
-
|
|
136
|
+
await beforeOpen();
|
|
188
137
|
}
|
|
189
138
|
drawerOptions.show = true;
|
|
190
|
-
}
|
|
139
|
+
};
|
|
191
140
|
__expose({
|
|
192
141
|
show,
|
|
193
142
|
close
|
|
@@ -269,9 +218,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
269
218
|
})
|
|
270
219
|
}, (_c = _ctx.conf) == null ? void 0 : _c.config), {
|
|
271
220
|
default: withCtx(() => {
|
|
272
|
-
var _a2, _b2
|
|
221
|
+
var _a2, _b2;
|
|
273
222
|
return [
|
|
274
|
-
_ctx.conf.renderType === "select" ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList((
|
|
223
|
+
_ctx.conf.renderType === "select" ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(((_b2 = (_a2 = _ctx.conf) == null ? void 0 : _a2.config) == null ? void 0 : _b2.options) ?? [], (op) => {
|
|
275
224
|
return openBlock(), createBlock(resolveDynamicComponent(`el-option`), {
|
|
276
225
|
key: op.value,
|
|
277
226
|
label: op.label,
|
|
@@ -20459,9 +20408,10 @@ const exportToExcel = ({ header, tableData, fileName }) => {
|
|
|
20459
20408
|
function _isSlot$1(s) {
|
|
20460
20409
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
20461
20410
|
}
|
|
20462
|
-
const _sfc_main$5 = /* @__PURE__ */ defineComponent(
|
|
20463
|
-
|
|
20464
|
-
|
|
20411
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
20412
|
+
...{
|
|
20413
|
+
name: "YxTable"
|
|
20414
|
+
},
|
|
20465
20415
|
__name: "index",
|
|
20466
20416
|
props: {
|
|
20467
20417
|
tableData: {},
|
|
@@ -20494,11 +20444,11 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20494
20444
|
watch(() => props.columns, () => {
|
|
20495
20445
|
initTable();
|
|
20496
20446
|
});
|
|
20497
|
-
onBeforeMount(() =>
|
|
20498
|
-
|
|
20499
|
-
})
|
|
20500
|
-
const initTable = () =>
|
|
20501
|
-
columns.value = typeof props.columns === "function" ?
|
|
20447
|
+
onBeforeMount(async () => {
|
|
20448
|
+
await initTable();
|
|
20449
|
+
});
|
|
20450
|
+
const initTable = async () => {
|
|
20451
|
+
columns.value = typeof props.columns === "function" ? await props.columns() : props.columns;
|
|
20502
20452
|
columns.value.forEach((col) => {
|
|
20503
20453
|
var _a;
|
|
20504
20454
|
if (!col.renderType) return;
|
|
@@ -20506,12 +20456,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20506
20456
|
loadOptions(col.config);
|
|
20507
20457
|
}
|
|
20508
20458
|
});
|
|
20509
|
-
}
|
|
20510
|
-
const loadOptions = (config) =>
|
|
20459
|
+
};
|
|
20460
|
+
const loadOptions = async (config) => {
|
|
20511
20461
|
if ((config == null ? void 0 : config.options) && (config == null ? void 0 : config.options.length) === 0 && (config == null ? void 0 : config.loadOptions) && typeof (config == null ? void 0 : config.loadOptions) === "function") {
|
|
20512
|
-
config.options =
|
|
20462
|
+
config.options = await (config == null ? void 0 : config.loadOptions());
|
|
20513
20463
|
}
|
|
20514
|
-
}
|
|
20464
|
+
};
|
|
20515
20465
|
const startSort = () => {
|
|
20516
20466
|
var _a, _b;
|
|
20517
20467
|
if (!props.sort) return;
|
|
@@ -20542,11 +20492,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20542
20492
|
};
|
|
20543
20493
|
const renderColumn = (columns2) => {
|
|
20544
20494
|
return columns2.filter((cell) => !cell.show || cell.show(cell)).map((cell) => {
|
|
20545
|
-
const
|
|
20546
|
-
children
|
|
20547
|
-
|
|
20548
|
-
|
|
20549
|
-
]);
|
|
20495
|
+
const {
|
|
20496
|
+
children,
|
|
20497
|
+
...cellConf
|
|
20498
|
+
} = cell;
|
|
20550
20499
|
return createVNode(resolveComponent("el-table-column"), cellConf, {
|
|
20551
20500
|
default: (scope) => {
|
|
20552
20501
|
if ((cell == null ? void 0 : cell.renderType) === "operate") return renderOperate(cell, scope);
|
|
@@ -20567,26 +20516,25 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20567
20516
|
return (cell == null ? void 0 : cell.slotName) && columnSlots(cell, scope);
|
|
20568
20517
|
},
|
|
20569
20518
|
header: (scope) => {
|
|
20570
|
-
var
|
|
20519
|
+
var _a;
|
|
20571
20520
|
if (cell == null ? void 0 : cell.headerRender) return cell == null ? void 0 : cell.headerRender(scope.row);
|
|
20572
|
-
if (cell == null ? void 0 : cell.headerSlotName) return (
|
|
20521
|
+
if (cell == null ? void 0 : cell.headerSlotName) return (_a = slots[cell == null ? void 0 : cell.headerSlotName]) == null ? void 0 : _a.call(slots, scope);
|
|
20573
20522
|
}
|
|
20574
20523
|
});
|
|
20575
20524
|
});
|
|
20576
20525
|
};
|
|
20577
20526
|
const renderOperate = (cell, scope) => {
|
|
20578
|
-
var _a, _b
|
|
20527
|
+
var _a, _b;
|
|
20579
20528
|
return createVNode("div", {
|
|
20580
|
-
"class": `flex justify-center items-center cursor-pointer gap-10 ${(
|
|
20581
|
-
}, [(
|
|
20582
|
-
var _a2;
|
|
20529
|
+
"class": `flex justify-center items-center cursor-pointer gap-10 ${((_a = cell.config) == null ? void 0 : _a.className) ?? ""}`
|
|
20530
|
+
}, [(_b = cell.operate) == null ? void 0 : _b.filter((op) => !op.show || op.show(scope.row)).map((op) => {
|
|
20583
20531
|
if (op == null ? void 0 : op.render) return op.render(scope.row, scope.$index);
|
|
20584
20532
|
return createVNode("span", {
|
|
20585
20533
|
"onClick": withModifiers(() => {
|
|
20586
20534
|
(op == null ? void 0 : op.onClick) && (op == null ? void 0 : op.onClick(scope.row));
|
|
20587
20535
|
emit("operate-handle", op.key, scope.row, scope.$index);
|
|
20588
20536
|
}, ["stop"]),
|
|
20589
|
-
"class": `table-handle whitespace-nowrap ${(
|
|
20537
|
+
"class": `table-handle whitespace-nowrap ${(op == null ? void 0 : op.className) ?? ""}`
|
|
20590
20538
|
}, [op.label]);
|
|
20591
20539
|
})]);
|
|
20592
20540
|
};
|
|
@@ -20634,10 +20582,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20634
20582
|
fileName: fileName || Date.now()
|
|
20635
20583
|
});
|
|
20636
20584
|
};
|
|
20637
|
-
const updateColumns = (newColumns) =>
|
|
20585
|
+
const updateColumns = async (newColumns) => {
|
|
20638
20586
|
if (!columns.value) return;
|
|
20639
|
-
columns.value = typeof newColumns === "function" ?
|
|
20640
|
-
}
|
|
20587
|
+
columns.value = typeof newColumns === "function" ? await newColumns() : newColumns;
|
|
20588
|
+
};
|
|
20641
20589
|
__expose({
|
|
20642
20590
|
tableRef,
|
|
20643
20591
|
exportDataToExcel,
|
|
@@ -20647,7 +20595,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20647
20595
|
return openBlock(), createBlock(resolveDynamicComponent(render2(props)));
|
|
20648
20596
|
};
|
|
20649
20597
|
}
|
|
20650
|
-
})
|
|
20598
|
+
});
|
|
20651
20599
|
const _hoisted_1$2 = {
|
|
20652
20600
|
xmlns: "http://www.w3.org/2000/svg",
|
|
20653
20601
|
viewBox: "0 0 1024 1024"
|
|
@@ -20664,9 +20612,10 @@ const Question = { render };
|
|
|
20664
20612
|
function _isSlot(s) {
|
|
20665
20613
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
20666
20614
|
}
|
|
20667
|
-
const _sfc_main$4 = /* @__PURE__ */ defineComponent(
|
|
20668
|
-
|
|
20669
|
-
|
|
20615
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
20616
|
+
...{
|
|
20617
|
+
name: "YxForm"
|
|
20618
|
+
},
|
|
20670
20619
|
__name: "index",
|
|
20671
20620
|
props: {
|
|
20672
20621
|
formParams: {},
|
|
@@ -20691,13 +20640,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20691
20640
|
const formRules = ref({});
|
|
20692
20641
|
const formColumn = ref([]);
|
|
20693
20642
|
const isOptionsComponent = (type) => type && ["select", "cascader"].includes(type);
|
|
20694
|
-
const initForm = () =>
|
|
20643
|
+
const initForm = async () => {
|
|
20695
20644
|
var _a;
|
|
20696
20645
|
const {
|
|
20697
20646
|
formList,
|
|
20698
20647
|
formParams
|
|
20699
20648
|
} = props;
|
|
20700
|
-
formColumn.value = typeof formList === "function" ?
|
|
20649
|
+
formColumn.value = typeof formList === "function" ? await formList() : formList;
|
|
20701
20650
|
if (!Array.isArray(formColumn.value) || formColumn.value.length === 0) {
|
|
20702
20651
|
return;
|
|
20703
20652
|
}
|
|
@@ -20712,6 +20661,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20712
20661
|
if (Array.isArray(item.children)) {
|
|
20713
20662
|
item.children.forEach(fillFormData);
|
|
20714
20663
|
}
|
|
20664
|
+
handleLinkOptions(item);
|
|
20715
20665
|
};
|
|
20716
20666
|
formColumn.value.forEach((item) => fillFormData(item));
|
|
20717
20667
|
if (formParams && Object.keys(formParams).length > 0) {
|
|
@@ -20729,25 +20679,46 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20729
20679
|
} else {
|
|
20730
20680
|
formData.value = initialData;
|
|
20731
20681
|
}
|
|
20732
|
-
}
|
|
20682
|
+
};
|
|
20683
|
+
const handleLinkOptions = (item) => {
|
|
20684
|
+
var _a, _b;
|
|
20685
|
+
if (!((_a = item.config) == null ? void 0 : _a.linkOptions)) return;
|
|
20686
|
+
const linkOptions = item.config.linkOptions;
|
|
20687
|
+
const originOnChange = (_b = item.event) == null ? void 0 : _b.onChange;
|
|
20688
|
+
const newOnChange = async (e) => {
|
|
20689
|
+
var _a2;
|
|
20690
|
+
const updateForm = formColumn.value.find((form) => (form == null ? void 0 : form.prop) === linkOptions);
|
|
20691
|
+
if (!updateForm || !((_a2 = updateForm == null ? void 0 : updateForm.config) == null ? void 0 : _a2.loadOptions)) return;
|
|
20692
|
+
const options = await updateForm.config.loadOptions(e);
|
|
20693
|
+
updateForm.config.options = options;
|
|
20694
|
+
if (typeof originOnChange === "function") {
|
|
20695
|
+
originOnChange(e);
|
|
20696
|
+
}
|
|
20697
|
+
};
|
|
20698
|
+
item.event = {
|
|
20699
|
+
...item.event,
|
|
20700
|
+
onChange: newOnChange
|
|
20701
|
+
};
|
|
20702
|
+
};
|
|
20733
20703
|
const hasLoadOptions = () => {
|
|
20734
20704
|
return formColumn.value.some((item) => {
|
|
20735
20705
|
var _a;
|
|
20736
20706
|
return ((_a = item.config) == null ? void 0 : _a.loadOptions) && typeof item.config.loadOptions === "function";
|
|
20737
20707
|
});
|
|
20738
20708
|
};
|
|
20739
|
-
const loadOptions =
|
|
20709
|
+
const loadOptions = async ({
|
|
20740
20710
|
config,
|
|
20741
20711
|
prop
|
|
20742
|
-
}) {
|
|
20712
|
+
}) => {
|
|
20743
20713
|
var _a;
|
|
20744
|
-
if (
|
|
20745
|
-
|
|
20714
|
+
if (config == null ? void 0 : config.notAutoLoadOptions) return;
|
|
20715
|
+
if ((config == null ? void 0 : config.options) && (config == null ? void 0 : config.loadOptions) && typeof (config == null ? void 0 : config.loadOptions) === "function") {
|
|
20716
|
+
config.options = await (config == null ? void 0 : config.loadOptions());
|
|
20746
20717
|
if (prop && ((_a = props == null ? void 0 : props.formParams) == null ? void 0 : _a[prop])) {
|
|
20747
20718
|
formData.value[prop] = props == null ? void 0 : props.formParams[prop];
|
|
20748
20719
|
}
|
|
20749
20720
|
}
|
|
20750
|
-
}
|
|
20721
|
+
};
|
|
20751
20722
|
const slots = useSlots();
|
|
20752
20723
|
const attrs = useAttrs();
|
|
20753
20724
|
const props = __props;
|
|
@@ -20767,12 +20738,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20767
20738
|
const rules = {};
|
|
20768
20739
|
if (!((_a = formColumn.value) == null ? void 0 : _a.length)) return;
|
|
20769
20740
|
const handleRule = (item) => {
|
|
20770
|
-
var _a2;
|
|
20771
20741
|
if (!item.prop) return;
|
|
20772
20742
|
const isSelect = (item == null ? void 0 : item.renderType) && ["select", "cascader"].includes(item == null ? void 0 : item.renderType);
|
|
20773
20743
|
const defaultRule = {
|
|
20774
20744
|
required: true,
|
|
20775
|
-
message: `${
|
|
20745
|
+
message: `${item.label ?? "该字段"}不能为空`,
|
|
20776
20746
|
trigger: isSelect ? "change" : "blur"
|
|
20777
20747
|
};
|
|
20778
20748
|
if (item.required) {
|
|
@@ -20789,42 +20759,40 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20789
20759
|
});
|
|
20790
20760
|
formRules.value = rules;
|
|
20791
20761
|
};
|
|
20792
|
-
onBeforeMount(() =>
|
|
20762
|
+
onBeforeMount(async () => {
|
|
20793
20763
|
if (props.formList) {
|
|
20794
|
-
|
|
20764
|
+
await initForm();
|
|
20795
20765
|
getRules();
|
|
20796
20766
|
}
|
|
20797
|
-
})
|
|
20767
|
+
});
|
|
20798
20768
|
const formRef = ref();
|
|
20799
20769
|
const getFormStyle = () => {
|
|
20800
20770
|
const {
|
|
20801
20771
|
formStyle
|
|
20802
20772
|
} = props;
|
|
20803
|
-
const
|
|
20773
|
+
const {
|
|
20804
20774
|
row,
|
|
20805
|
-
gap
|
|
20806
|
-
|
|
20807
|
-
|
|
20808
|
-
|
|
20809
|
-
]);
|
|
20810
|
-
return __spreadValues({
|
|
20775
|
+
gap,
|
|
20776
|
+
...style
|
|
20777
|
+
} = formStyle;
|
|
20778
|
+
return {
|
|
20811
20779
|
"grid-template-columns": `repeat(${row}, 1fr)`,
|
|
20812
|
-
"grid-gap": gap
|
|
20813
|
-
|
|
20780
|
+
"grid-gap": gap,
|
|
20781
|
+
...style
|
|
20782
|
+
};
|
|
20814
20783
|
};
|
|
20815
20784
|
const getGroupStyle = (groupStyle) => {
|
|
20816
20785
|
if (!groupStyle) return {};
|
|
20817
|
-
const
|
|
20786
|
+
const {
|
|
20818
20787
|
row,
|
|
20819
|
-
gap
|
|
20820
|
-
|
|
20821
|
-
|
|
20822
|
-
|
|
20823
|
-
]);
|
|
20824
|
-
return __spreadValues({
|
|
20788
|
+
gap,
|
|
20789
|
+
...style
|
|
20790
|
+
} = groupStyle;
|
|
20791
|
+
return {
|
|
20825
20792
|
"grid-template-columns": `repeat(${row}, 1fr)`,
|
|
20826
|
-
"grid-gap": gap
|
|
20827
|
-
|
|
20793
|
+
"grid-gap": gap,
|
|
20794
|
+
...style
|
|
20795
|
+
};
|
|
20828
20796
|
};
|
|
20829
20797
|
const render2 = (props2) => {
|
|
20830
20798
|
var _a;
|
|
@@ -20854,11 +20822,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20854
20822
|
}, null));
|
|
20855
20823
|
return null;
|
|
20856
20824
|
};
|
|
20857
|
-
const
|
|
20858
|
-
options
|
|
20859
|
-
|
|
20860
|
-
|
|
20861
|
-
]);
|
|
20825
|
+
const {
|
|
20826
|
+
options,
|
|
20827
|
+
...conf
|
|
20828
|
+
} = config || {};
|
|
20862
20829
|
if (renderType === "cascader") return createVNode(resolveComponent("el-cascader"), mergeProps(event, conf, {
|
|
20863
20830
|
"options": options,
|
|
20864
20831
|
"modelValue": formData.value[prop],
|
|
@@ -20881,14 +20848,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20881
20848
|
};
|
|
20882
20849
|
const renderFormItem = (formList) => {
|
|
20883
20850
|
const renderForm = (form) => {
|
|
20884
|
-
|
|
20885
|
-
|
|
20886
|
-
|
|
20887
|
-
} =
|
|
20888
|
-
"className"
|
|
20889
|
-
]);
|
|
20851
|
+
const {
|
|
20852
|
+
className,
|
|
20853
|
+
...formProps
|
|
20854
|
+
} = form;
|
|
20890
20855
|
return createVNode(resolveComponent("el-form-item"), mergeProps({
|
|
20891
|
-
"class": `${formLayout === "vertical" ? "flex flex-col " : ""} ${(
|
|
20856
|
+
"class": `${formLayout === "vertical" ? "flex flex-col " : ""} ${(formStyle == null ? void 0 : formStyle.formItemClassName) ?? ""} ${className ?? ""} ${!form.label ? "no-label-item" : ""}`
|
|
20892
20857
|
}, formProps, {
|
|
20893
20858
|
"prop": form.prop,
|
|
20894
20859
|
"labelWidth": formStyle == null ? void 0 : formStyle.labelWidth,
|
|
@@ -20900,15 +20865,15 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20900
20865
|
return (form == null ? void 0 : form.slotName) && formItemSlots(form);
|
|
20901
20866
|
},
|
|
20902
20867
|
label: () => {
|
|
20903
|
-
var
|
|
20868
|
+
var _a2;
|
|
20904
20869
|
return form.label ? createVNode("div", {
|
|
20905
|
-
"class": `flex items-center gap-5 ${
|
|
20906
|
-
}, [form.label, form.promptConf ? createVNode(resolveComponent("el-tooltip"), (
|
|
20870
|
+
"class": `flex items-center gap-5 ${form.labelClassName ?? ""}`
|
|
20871
|
+
}, [form.label, form.promptConf ? createVNode(resolveComponent("el-tooltip"), (_a2 = form.promptConf) == null ? void 0 : _a2.tooltipConf, {
|
|
20907
20872
|
default: () => {
|
|
20908
|
-
var
|
|
20873
|
+
var _a3, _b;
|
|
20909
20874
|
return [createVNode(resolveComponent("el-icon"), {
|
|
20910
|
-
"size": (
|
|
20911
|
-
"color": (
|
|
20875
|
+
"size": ((_a3 = form.promptConf) == null ? void 0 : _a3.size) ?? 15,
|
|
20876
|
+
"color": (_b = form.promptConf) == null ? void 0 : _b.color
|
|
20912
20877
|
}, {
|
|
20913
20878
|
default: () => [createVNode(Question, null, null)]
|
|
20914
20879
|
})];
|
|
@@ -20918,17 +20883,22 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20918
20883
|
});
|
|
20919
20884
|
};
|
|
20920
20885
|
return formList.filter((form) => !form.show || form.show(formData.value)).map((form) => {
|
|
20921
|
-
var _a2, _b, _c, _d;
|
|
20922
20886
|
if (form.children && form.children.length > 0) {
|
|
20923
20887
|
return createVNode("div", {
|
|
20924
|
-
"class": `flex flex-col ${
|
|
20925
|
-
"style":
|
|
20888
|
+
"class": `flex flex-col ${form.groupWrapClassName ?? ""}`,
|
|
20889
|
+
"style": {
|
|
20890
|
+
...form == null ? void 0 : form.groupWrapStyle
|
|
20891
|
+
}
|
|
20926
20892
|
}, [createVNode("div", {
|
|
20927
|
-
"class":
|
|
20928
|
-
"style":
|
|
20893
|
+
"class": form.groupTitleClassName ?? "",
|
|
20894
|
+
"style": {
|
|
20895
|
+
...form == null ? void 0 : form.groupTitleStyle
|
|
20896
|
+
}
|
|
20929
20897
|
}, [form.groupName]), createVNode("div", {
|
|
20930
|
-
"class": `grid ${
|
|
20931
|
-
"style":
|
|
20898
|
+
"class": `grid ${form.groupClassName ?? ""}`,
|
|
20899
|
+
"style": {
|
|
20900
|
+
...getGroupStyle((form == null ? void 0 : form.groupStyle) ?? {})
|
|
20901
|
+
}
|
|
20932
20902
|
}, [form.children.filter((form2) => !form2.show || form2.show(formData.value)).map((form2) => renderForm(form2))])]);
|
|
20933
20903
|
} else {
|
|
20934
20904
|
return renderForm(form);
|
|
@@ -20943,15 +20913,17 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20943
20913
|
"ref": formRef,
|
|
20944
20914
|
"validate-on-rule-change": false
|
|
20945
20915
|
}, attrs, {
|
|
20946
|
-
"style":
|
|
20916
|
+
"style": {
|
|
20917
|
+
...getFormStyle()
|
|
20918
|
+
}
|
|
20947
20919
|
}), _isSlot(_slot = renderFormItem(formColumn.value)) ? _slot : {
|
|
20948
20920
|
default: () => [_slot]
|
|
20949
20921
|
})]);
|
|
20950
20922
|
};
|
|
20951
|
-
const formValidate = () =>
|
|
20923
|
+
const formValidate = async () => {
|
|
20952
20924
|
if (!formRef.value) return Promise.resolve(false);
|
|
20953
|
-
return
|
|
20954
|
-
}
|
|
20925
|
+
return await formRef.value.validate(() => Promise.resolve());
|
|
20926
|
+
};
|
|
20955
20927
|
__expose({
|
|
20956
20928
|
formData,
|
|
20957
20929
|
formValidate,
|
|
@@ -20961,8 +20933,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
20961
20933
|
return openBlock(), createBlock(resolveDynamicComponent(render2(props)));
|
|
20962
20934
|
};
|
|
20963
20935
|
}
|
|
20964
|
-
})
|
|
20965
|
-
const index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
20936
|
+
});
|
|
20937
|
+
const index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-032287c8"]]);
|
|
20966
20938
|
let versionKey, curVersion, updateApp;
|
|
20967
20939
|
const updateSysVersion = () => {
|
|
20968
20940
|
localStorage.setItem(versionKey, curVersion);
|
|
@@ -21076,12 +21048,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
21076
21048
|
const slots = useSlots();
|
|
21077
21049
|
const fileList = ref([]);
|
|
21078
21050
|
const props = __props;
|
|
21051
|
+
let uploadFileList = [];
|
|
21079
21052
|
const fileObsUrl = ref("");
|
|
21080
21053
|
const upload = ref();
|
|
21081
21054
|
const emit = __emit;
|
|
21082
|
-
const uploadFile = (
|
|
21083
|
-
file
|
|
21084
|
-
}) {
|
|
21055
|
+
const uploadFile = async (file) => {
|
|
21085
21056
|
if (props == null ? void 0 : props.customUpload) {
|
|
21086
21057
|
return props == null ? void 0 : props.customUpload(file);
|
|
21087
21058
|
}
|
|
@@ -21089,38 +21060,44 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
21089
21060
|
fromData.append("file", file);
|
|
21090
21061
|
const {
|
|
21091
21062
|
data
|
|
21092
|
-
} =
|
|
21063
|
+
} = await ((props == null ? void 0 : props.uploadResourceApi) ? props == null ? void 0 : props.uploadResourceApi(fromData) : uploadResourceApi(fromData));
|
|
21093
21064
|
fileObsUrl.value = data.fileUrl;
|
|
21094
21065
|
emit("update:fileObsUrl", fileObsUrl.value);
|
|
21095
|
-
}
|
|
21096
|
-
const onExceed = (files) => {
|
|
21066
|
+
};
|
|
21067
|
+
const onExceed = async (files) => {
|
|
21097
21068
|
upload.value.clearFiles();
|
|
21098
21069
|
const file = files[0];
|
|
21099
21070
|
file.uid = genFileId();
|
|
21100
21071
|
upload.value.handleStart(file);
|
|
21101
|
-
uploadFile({
|
|
21102
|
-
file
|
|
21103
|
-
});
|
|
21104
21072
|
};
|
|
21073
|
+
const onChange = async (file, uploadFiles) => {
|
|
21074
|
+
uploadFileList = uploadFiles;
|
|
21075
|
+
if ((attrs == null ? void 0 : attrs.limit) && (attrs == null ? void 0 : attrs.limit) === 1) {
|
|
21076
|
+
await uploadFile(uploadFileList[0]);
|
|
21077
|
+
} else {
|
|
21078
|
+
await uploadFile(uploadFileList);
|
|
21079
|
+
}
|
|
21080
|
+
};
|
|
21081
|
+
const getFileList = () => uploadFileList;
|
|
21105
21082
|
__expose({
|
|
21106
|
-
upload
|
|
21083
|
+
upload,
|
|
21084
|
+
getFileList
|
|
21107
21085
|
});
|
|
21108
21086
|
const render2 = (props2) => {
|
|
21109
21087
|
const defaultTrigger = () => {
|
|
21110
21088
|
return createVNode(resolveComponent("el-button"), null, {
|
|
21111
|
-
default: () =>
|
|
21112
|
-
var _a;
|
|
21113
|
-
return [(_a = props2.triggerText) != null ? _a : "上传文件"];
|
|
21114
|
-
}
|
|
21089
|
+
default: () => [props2.triggerText ?? "上传文件"]
|
|
21115
21090
|
});
|
|
21116
21091
|
};
|
|
21117
21092
|
return createVNode(Fragment, null, [createVNode(resolveComponent("el-upload"), mergeProps({
|
|
21118
|
-
"ref":
|
|
21093
|
+
"ref": upload,
|
|
21119
21094
|
"class": "w-full h-full",
|
|
21120
21095
|
"http-request": uploadFile,
|
|
21121
21096
|
"file-list": fileList.value
|
|
21122
21097
|
}, attrs, {
|
|
21123
|
-
"on-exceed": onExceed
|
|
21098
|
+
"on-exceed": onExceed,
|
|
21099
|
+
"on-change": onChange,
|
|
21100
|
+
"auto-upload": false
|
|
21124
21101
|
}), {
|
|
21125
21102
|
trigger: () => {
|
|
21126
21103
|
return (props2 == null ? void 0 : props2.triggerRender) ? props2 == null ? void 0 : props2.triggerRender(fileObsUrl.value) : slots["trigger"] ? slots["trigger"]() : defaultTrigger();
|
|
@@ -21165,14 +21142,15 @@ const _sfc_main = {
|
|
|
21165
21142
|
}
|
|
21166
21143
|
};
|
|
21167
21144
|
},
|
|
21168
|
-
created() {
|
|
21169
|
-
|
|
21170
|
-
|
|
21171
|
-
|
|
21172
|
-
this.customConfig
|
|
21173
|
-
|
|
21174
|
-
}
|
|
21175
|
-
})
|
|
21145
|
+
async created() {
|
|
21146
|
+
try {
|
|
21147
|
+
const data = await getUserConfig();
|
|
21148
|
+
this.customConfig = {
|
|
21149
|
+
...this.customConfig,
|
|
21150
|
+
...data
|
|
21151
|
+
};
|
|
21152
|
+
} catch (e) {
|
|
21153
|
+
}
|
|
21176
21154
|
},
|
|
21177
21155
|
methods: {
|
|
21178
21156
|
logoJumpHandle() {
|
package/lib/index.es6.js.gz
CHANGED
|
Binary file
|