yxuse 3.0.39 → 3.0.40
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/api.cjs.js +1 -1
- package/lib/api.es.js +9 -9
- package/lib/components.cjs.js +1 -1
- package/lib/components.es.js +11 -11
- package/lib/directives.cjs.js +1 -1
- package/lib/directives.es.js +2 -2
- package/lib/hooks.cjs.js +1 -1
- package/lib/hooks.es.js +2 -2
- package/lib/index.cjs.js +1 -1
- package/lib/index.cjs10.js +1 -1
- package/lib/index.cjs11.js +1 -3
- package/lib/index.cjs11.js.gz +0 -0
- package/lib/index.cjs12.js +1 -1
- package/lib/index.cjs13.js +1 -1
- package/lib/index.cjs2.js +1 -1
- package/lib/index.cjs3.js +1 -1
- package/lib/index.cjs4.js +1 -1
- package/lib/index.cjs5.js +8 -28
- package/lib/index.cjs5.js.gz +0 -0
- package/lib/index.cjs6.js +1 -1
- package/lib/index.cjs6.js.gz +0 -0
- package/lib/index.cjs7.js +1 -1
- package/lib/index.cjs9.js +1 -1
- package/lib/index.es.js +43 -39
- package/lib/index.es10.js +245 -241
- package/lib/index.es10.js.gz +0 -0
- package/lib/index.es11.js +1854 -1146
- package/lib/index.es11.js.gz +0 -0
- package/lib/index.es12.js +181 -103
- package/lib/index.es13.js +15 -12
- package/lib/index.es2.js +13 -13
- package/lib/index.es3.js +58 -40
- package/lib/index.es4.js +47 -37
- package/lib/index.es5.js +9697 -5929
- package/lib/index.es5.js.gz +0 -0
- package/lib/index.es6.js +821 -615
- package/lib/index.es6.js.gz +0 -0
- package/lib/index.es7.js +21 -17
- package/lib/index.es8.js +4 -4
- package/lib/index.es9.js +9 -7
- package/lib/theme.cjs.js +1 -1
- package/lib/theme.es.js +11 -11
- package/lib/translate.cjs.js +1 -1
- package/lib/translate.es.js +6 -6
- package/lib/utils.cjs.js +1 -1
- package/lib/utils.es.js +11 -11
- package/lib/yxIcon.cjs.js +1 -1
- package/lib/yxIcon.es.js +2 -2
- package/package.json +2 -1
package/lib/index.es6.js
CHANGED
|
@@ -1,105 +1,146 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (n != null && G)
|
|
17
|
-
for (var s of G(n))
|
|
18
|
-
o.indexOf(s) < 0 && le.call(n, s) && (t[s] = n[s]);
|
|
19
|
-
return t;
|
|
20
|
-
};
|
|
21
|
-
var J = (n, o, t) => new Promise((s, l) => {
|
|
22
|
-
var d = (b) => {
|
|
23
|
-
try {
|
|
24
|
-
h(t.next(b));
|
|
25
|
-
} catch (p) {
|
|
26
|
-
l(p);
|
|
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]);
|
|
27
16
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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];
|
|
33
29
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
+
import { defineComponent, reactive, resolveComponent, openBlock, createBlock, createSlots, withCtx, renderSlot, createElementVNode, createVNode, createTextVNode, watch, resolveDynamicComponent, mergeProps, createElementBlock, Fragment, renderList, createCommentVNode, useSlots, useAttrs, ref, onMounted, nextTick, isVNode, withModifiers, computed, unref, normalizeStyle, toDisplayString, withKeys, toHandlers, pushScopeId, popScopeId } from "vue";
|
|
53
|
+
import { S as Sortable, _ as _export_sfc, T as Toolbar } from "./index.es5.js";
|
|
39
54
|
import "./index.es11.js";
|
|
40
55
|
import "element-plus";
|
|
41
|
-
import { u as
|
|
42
|
-
const
|
|
56
|
+
import { u as uploadResourceApi } from "./index.es13.js";
|
|
57
|
+
const _hoisted_1$3 = { class: "dialog-footer flex justify-end" };
|
|
58
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
43
59
|
__name: "index",
|
|
44
|
-
setup(
|
|
45
|
-
const
|
|
60
|
+
setup(__props, { expose: __expose }) {
|
|
61
|
+
const dialogOptions = reactive({
|
|
46
62
|
width: "40%",
|
|
47
|
-
show:
|
|
63
|
+
show: false,
|
|
48
64
|
title: "",
|
|
49
|
-
loading:
|
|
50
|
-
showFooter:
|
|
51
|
-
autoClose:
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
loading: false,
|
|
66
|
+
showFooter: true,
|
|
67
|
+
autoClose: true
|
|
68
|
+
});
|
|
69
|
+
const close = () => {
|
|
70
|
+
dialogOptions.show = false;
|
|
71
|
+
};
|
|
72
|
+
const dialogMap = {};
|
|
73
|
+
const submit = () => __async(this, null, function* () {
|
|
74
|
+
if (dialogMap["beforeSubmit"] && !(yield dialogMap["beforeSubmit"]()))
|
|
75
|
+
return;
|
|
76
|
+
dialogOptions.loading = true;
|
|
77
|
+
try {
|
|
78
|
+
dialogMap["submit"] && (yield dialogMap["submit"]());
|
|
79
|
+
dialogOptions.loading = false;
|
|
80
|
+
if (dialogOptions.autoClose)
|
|
81
|
+
close();
|
|
82
|
+
} catch (err) {
|
|
83
|
+
dialogOptions.loading = false;
|
|
62
84
|
}
|
|
63
85
|
});
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
86
|
+
const show = ({ width, title, submit: submit2, cancel, showFooter, autoClose, beforeOpen, beforeSubmit }) => {
|
|
87
|
+
if (width)
|
|
88
|
+
dialogOptions.width = width;
|
|
89
|
+
if (title)
|
|
90
|
+
dialogOptions.title = title;
|
|
91
|
+
if (showFooter !== void 0)
|
|
92
|
+
dialogOptions.showFooter = showFooter;
|
|
93
|
+
if (autoClose !== void 0)
|
|
94
|
+
dialogOptions.autoClose = autoClose;
|
|
95
|
+
if (submit2)
|
|
96
|
+
dialogMap["submit"] = submit2;
|
|
97
|
+
if (cancel)
|
|
98
|
+
dialogMap["cancel"] = cancel;
|
|
99
|
+
if (beforeSubmit)
|
|
100
|
+
dialogMap["beforeSubmit"] = beforeSubmit;
|
|
101
|
+
if (beforeOpen)
|
|
102
|
+
beforeOpen();
|
|
103
|
+
dialogOptions.show = true;
|
|
104
|
+
};
|
|
105
|
+
__expose({
|
|
106
|
+
show,
|
|
107
|
+
close
|
|
108
|
+
});
|
|
109
|
+
return (_ctx, _cache) => {
|
|
110
|
+
const _component_el_button = resolveComponent("el-button");
|
|
111
|
+
const _component_el_dialog = resolveComponent("el-dialog");
|
|
112
|
+
return openBlock(), createBlock(_component_el_dialog, {
|
|
113
|
+
"close-on-click-modal": false,
|
|
73
114
|
attrs: "",
|
|
74
|
-
width:
|
|
75
|
-
modelValue:
|
|
76
|
-
"onUpdate:modelValue":
|
|
77
|
-
title:
|
|
78
|
-
},
|
|
79
|
-
default:
|
|
80
|
-
|
|
115
|
+
width: dialogOptions.width,
|
|
116
|
+
modelValue: dialogOptions.show,
|
|
117
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dialogOptions.show = $event),
|
|
118
|
+
title: dialogOptions.title
|
|
119
|
+
}, createSlots({
|
|
120
|
+
default: withCtx(() => [
|
|
121
|
+
renderSlot(_ctx.$slots, "default")
|
|
81
122
|
]),
|
|
82
123
|
_: 2
|
|
83
124
|
}, [
|
|
84
|
-
|
|
125
|
+
dialogOptions.showFooter ? {
|
|
85
126
|
name: "footer",
|
|
86
|
-
fn:
|
|
87
|
-
|
|
88
|
-
|
|
127
|
+
fn: withCtx(() => [
|
|
128
|
+
createElementVNode("span", _hoisted_1$3, [
|
|
129
|
+
createVNode(_component_el_button, {
|
|
89
130
|
plain: "",
|
|
90
|
-
onClick:
|
|
131
|
+
onClick: close
|
|
91
132
|
}, {
|
|
92
|
-
default:
|
|
93
|
-
|
|
133
|
+
default: withCtx(() => [
|
|
134
|
+
createTextVNode("取消")
|
|
94
135
|
]),
|
|
95
136
|
_: 1
|
|
96
137
|
}),
|
|
97
|
-
|
|
98
|
-
loading:
|
|
99
|
-
onClick:
|
|
138
|
+
createVNode(_component_el_button, {
|
|
139
|
+
loading: dialogOptions.loading,
|
|
140
|
+
onClick: submit
|
|
100
141
|
}, {
|
|
101
|
-
default:
|
|
102
|
-
|
|
142
|
+
default: withCtx(() => [
|
|
143
|
+
createTextVNode("确认")
|
|
103
144
|
]),
|
|
104
145
|
_: 1
|
|
105
146
|
}, 8, ["loading"])
|
|
@@ -110,40 +151,45 @@ const Ne = { class: "dialog-footer flex justify-end" }, Fe = /* @__PURE__ */ P({
|
|
|
110
151
|
]), 1032, ["width", "modelValue", "title"]);
|
|
111
152
|
};
|
|
112
153
|
}
|
|
113
|
-
})
|
|
154
|
+
});
|
|
155
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
114
156
|
__name: "index",
|
|
115
157
|
props: {
|
|
116
158
|
conf: {},
|
|
117
159
|
model: {}
|
|
118
160
|
},
|
|
119
161
|
emits: ["change"],
|
|
120
|
-
setup(
|
|
121
|
-
const
|
|
122
|
-
|
|
162
|
+
setup(__props, { emit: __emit }) {
|
|
163
|
+
const props = __props;
|
|
164
|
+
const emit = __emit;
|
|
165
|
+
watch(
|
|
123
166
|
() => {
|
|
124
|
-
var
|
|
125
|
-
return
|
|
167
|
+
var _a;
|
|
168
|
+
return props.model[(_a = props.conf) == null ? void 0 : _a.prop];
|
|
126
169
|
},
|
|
127
170
|
() => {
|
|
128
|
-
|
|
171
|
+
emit("change", props.model);
|
|
129
172
|
}
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
173
|
+
);
|
|
174
|
+
return (_ctx, _cache) => {
|
|
175
|
+
var _a, _b, _c;
|
|
176
|
+
return openBlock(), createBlock(resolveDynamicComponent(`el-${(_a = _ctx.conf) == null ? void 0 : _a.renderType}`), mergeProps({
|
|
177
|
+
modelValue: _ctx.model[(_b = _ctx.conf) == null ? void 0 : _b.prop],
|
|
178
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => {
|
|
179
|
+
var _a2;
|
|
180
|
+
return _ctx.model[(_a2 = _ctx.conf) == null ? void 0 : _a2.prop] = $event;
|
|
137
181
|
})
|
|
138
|
-
}, (
|
|
139
|
-
default:
|
|
140
|
-
var
|
|
182
|
+
}, (_c = _ctx.conf) == null ? void 0 : _c.config), {
|
|
183
|
+
default: withCtx(() => {
|
|
184
|
+
var _a2, _b2, _c2;
|
|
141
185
|
return [
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
186
|
+
_ctx.conf.renderType === "select" ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList((_c2 = (_b2 = (_a2 = _ctx.conf) == null ? void 0 : _a2.config) == null ? void 0 : _b2.options) != null ? _c2 : [], (op) => {
|
|
187
|
+
return openBlock(), createBlock(resolveDynamicComponent(`el-option`), {
|
|
188
|
+
key: op.value,
|
|
189
|
+
label: op.label,
|
|
190
|
+
value: op.value
|
|
191
|
+
}, null, 8, ["label", "value"]);
|
|
192
|
+
}), 128)) : createCommentVNode("", true)
|
|
147
193
|
];
|
|
148
194
|
}),
|
|
149
195
|
_: 1
|
|
@@ -151,11 +197,12 @@ const Ne = { class: "dialog-footer flex justify-end" }, Fe = /* @__PURE__ */ P({
|
|
|
151
197
|
};
|
|
152
198
|
}
|
|
153
199
|
});
|
|
154
|
-
function
|
|
155
|
-
return typeof
|
|
200
|
+
function _isSlot$1(s) {
|
|
201
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
156
202
|
}
|
|
157
|
-
const
|
|
158
|
-
name: "YxTable"
|
|
203
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
204
|
+
name: "YxTable"
|
|
205
|
+
}), {
|
|
159
206
|
__name: "index",
|
|
160
207
|
props: {
|
|
161
208
|
tableData: {},
|
|
@@ -171,127 +218,152 @@ const Te = /* @__PURE__ */ P({
|
|
|
171
218
|
}
|
|
172
219
|
},
|
|
173
220
|
emits: ["operate-handle", "sort-end", "update-page", "size-change"],
|
|
174
|
-
setup(
|
|
175
|
-
expose:
|
|
176
|
-
emit:
|
|
221
|
+
setup(__props, {
|
|
222
|
+
expose: __expose,
|
|
223
|
+
emit: __emit
|
|
177
224
|
}) {
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
225
|
+
const props = __props;
|
|
226
|
+
const slots = useSlots();
|
|
227
|
+
const attrs = useAttrs();
|
|
228
|
+
const tableRef = ref();
|
|
229
|
+
const emit = __emit;
|
|
230
|
+
onMounted(() => {
|
|
231
|
+
nextTick(() => {
|
|
232
|
+
startSort();
|
|
182
233
|
});
|
|
183
234
|
});
|
|
184
|
-
const
|
|
185
|
-
if (!
|
|
235
|
+
const startSort = () => {
|
|
236
|
+
if (!props.sort)
|
|
186
237
|
return;
|
|
187
|
-
const
|
|
188
|
-
|
|
238
|
+
const sortDom = document.querySelector(".el-table__body tbody");
|
|
239
|
+
Sortable.create(sortDom, {
|
|
189
240
|
animation: 200,
|
|
190
241
|
// group: "el-table__row table-row",
|
|
191
|
-
sort:
|
|
192
|
-
handle:
|
|
242
|
+
sort: true,
|
|
243
|
+
handle: props.sortHandle ? `.${props.sortHandle}` : null,
|
|
193
244
|
onEnd: ({
|
|
194
|
-
oldIndex
|
|
195
|
-
newIndex
|
|
245
|
+
oldIndex,
|
|
246
|
+
newIndex
|
|
196
247
|
}) => {
|
|
197
|
-
|
|
248
|
+
emit("sort-end", oldIndex, newIndex);
|
|
198
249
|
}
|
|
199
250
|
});
|
|
200
|
-
}
|
|
201
|
-
|
|
251
|
+
};
|
|
252
|
+
const render2 = (props2) => {
|
|
253
|
+
let _slot;
|
|
202
254
|
const {
|
|
203
|
-
columns
|
|
204
|
-
rowKey
|
|
205
|
-
tableData
|
|
206
|
-
pageInfo
|
|
207
|
-
} =
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
255
|
+
columns,
|
|
256
|
+
rowKey,
|
|
257
|
+
tableData,
|
|
258
|
+
pageInfo
|
|
259
|
+
} = props2;
|
|
260
|
+
const columnSlots = (cell, scope) => {
|
|
261
|
+
var _a;
|
|
262
|
+
return cell.slotName && ((_a = slots[cell.slotName]) == null ? void 0 : _a.call(slots, scope));
|
|
263
|
+
};
|
|
264
|
+
const renderColumn = (columns2) => {
|
|
265
|
+
return columns2.filter((cell) => !cell.show || cell.show(cell)).map((cell) => {
|
|
266
|
+
const _a = cell, {
|
|
267
|
+
children
|
|
268
|
+
} = _a, cellConf = __objRest(_a, [
|
|
269
|
+
"children"
|
|
270
|
+
]);
|
|
271
|
+
return createVNode(resolveComponent("el-table-column"), cellConf, {
|
|
272
|
+
default: (scope) => {
|
|
273
|
+
if ((cell == null ? void 0 : cell.renderType) === "operate")
|
|
274
|
+
return renderOperate(cell, scope);
|
|
275
|
+
if ((cell == null ? void 0 : cell.renderType) && (cell == null ? void 0 : cell.renderType) !== "operate") {
|
|
276
|
+
const conf = {
|
|
277
|
+
renderType: cell.renderType,
|
|
278
|
+
prop: cell.prop,
|
|
279
|
+
config: cell.config
|
|
280
|
+
};
|
|
281
|
+
return createVNode(_sfc_main$7, {
|
|
282
|
+
"conf": conf,
|
|
283
|
+
"model": scope.row,
|
|
284
|
+
"onChange": cell == null ? void 0 : cell.change
|
|
285
|
+
}, null);
|
|
286
|
+
}
|
|
287
|
+
if (cell == null ? void 0 : cell.render)
|
|
288
|
+
return cell == null ? void 0 : cell.render(scope.row);
|
|
289
|
+
if (children && (children == null ? void 0 : children.length) > 0)
|
|
290
|
+
return renderColumn(children);
|
|
291
|
+
return (cell == null ? void 0 : cell.slotName) && columnSlots(cell, scope);
|
|
231
292
|
}
|
|
232
|
-
|
|
233
|
-
}
|
|
293
|
+
});
|
|
234
294
|
});
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
295
|
+
};
|
|
296
|
+
const renderOperate = (cell, scope) => {
|
|
297
|
+
var _a;
|
|
298
|
+
return createVNode("div", {
|
|
299
|
+
"class": "flex justify-center items-center cursor-pointer"
|
|
300
|
+
}, [(_a = cell.operate) == null ? void 0 : _a.filter((op) => !op.show || op.show(scope.row)).map((op) => {
|
|
301
|
+
if (op == null ? void 0 : op.render)
|
|
302
|
+
return op.render(scope.row);
|
|
303
|
+
return createVNode("span", {
|
|
304
|
+
"onClick": withModifiers(() => {
|
|
305
|
+
(op == null ? void 0 : op.onClick) && (op == null ? void 0 : op.onClick(scope.row));
|
|
306
|
+
emit("operate-handle", op.key, scope.row);
|
|
307
|
+
}, ["stop"]),
|
|
308
|
+
"class": "table-handle whitespace-nowrap"
|
|
309
|
+
}, [createTextVNode(" "), op.label, createTextVNode(" ")]);
|
|
310
|
+
})]);
|
|
311
|
+
};
|
|
312
|
+
const pagination = () => {
|
|
313
|
+
if (!pageInfo)
|
|
247
314
|
return null;
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
|
|
315
|
+
const handleSizeChange = (e) => {
|
|
316
|
+
emit("update-page", "pageSize", e);
|
|
317
|
+
};
|
|
318
|
+
const handleCurrentChange = (e) => {
|
|
319
|
+
emit("update-page", "pageIndex", e);
|
|
252
320
|
};
|
|
253
|
-
return
|
|
254
|
-
class: "pagination-wrap"
|
|
255
|
-
}, [
|
|
256
|
-
currentPage:
|
|
257
|
-
"onUpdate:currentPage": (
|
|
258
|
-
pageSize:
|
|
259
|
-
"onUpdate:pageSize": (
|
|
260
|
-
small:
|
|
261
|
-
disabled:
|
|
321
|
+
return createVNode("div", {
|
|
322
|
+
"class": "pagination-wrap"
|
|
323
|
+
}, [createVNode(resolveComponent("el-pagination"), {
|
|
324
|
+
"currentPage": pageInfo.pageIndex,
|
|
325
|
+
"onUpdate:currentPage": ($event) => pageInfo.pageIndex = $event,
|
|
326
|
+
"pageSize": pageInfo.pageSize,
|
|
327
|
+
"onUpdate:pageSize": ($event) => pageInfo.pageSize = $event,
|
|
328
|
+
"small": false,
|
|
329
|
+
"disabled": false,
|
|
262
330
|
"page-sizes": [10, 20, 50, 100],
|
|
263
|
-
layout: "total,sizes,prev, pager, next",
|
|
264
|
-
background:
|
|
265
|
-
total:
|
|
266
|
-
onSizeChange:
|
|
267
|
-
onCurrentChange:
|
|
331
|
+
"layout": "total,sizes,prev, pager, next",
|
|
332
|
+
"background": false,
|
|
333
|
+
"total": pageInfo.total,
|
|
334
|
+
"onSizeChange": handleSizeChange,
|
|
335
|
+
"onCurrentChange": handleCurrentChange
|
|
268
336
|
}, null)]);
|
|
269
337
|
};
|
|
270
|
-
return
|
|
271
|
-
ref:
|
|
272
|
-
},
|
|
273
|
-
"row-key":
|
|
274
|
-
data:
|
|
275
|
-
}),
|
|
276
|
-
default: () => [
|
|
277
|
-
}),
|
|
338
|
+
return createVNode(Fragment, null, [createVNode(resolveComponent("el-table"), mergeProps({
|
|
339
|
+
"ref": tableRef
|
|
340
|
+
}, attrs, {
|
|
341
|
+
"row-key": rowKey,
|
|
342
|
+
"data": tableData
|
|
343
|
+
}), _isSlot$1(_slot = renderColumn(columns)) ? _slot : {
|
|
344
|
+
default: () => [_slot]
|
|
345
|
+
}), pagination()]);
|
|
346
|
+
};
|
|
347
|
+
__expose({
|
|
348
|
+
tableRef
|
|
349
|
+
});
|
|
350
|
+
return (_ctx, _cache) => {
|
|
351
|
+
return openBlock(), createBlock(resolveDynamicComponent(render2(props)));
|
|
278
352
|
};
|
|
279
|
-
return o({
|
|
280
|
-
tableRef: S
|
|
281
|
-
}), (w, v) => (_(), F(j(p(s))));
|
|
282
353
|
}
|
|
283
|
-
})
|
|
354
|
+
}));
|
|
355
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
284
356
|
__name: "index",
|
|
285
357
|
props: {
|
|
286
358
|
searchColumns: {},
|
|
287
359
|
searchParams: {},
|
|
288
360
|
showSearchBtn: {
|
|
289
361
|
type: Boolean,
|
|
290
|
-
default:
|
|
362
|
+
default: true
|
|
291
363
|
},
|
|
292
364
|
showAddBtn: {
|
|
293
365
|
type: Boolean,
|
|
294
|
-
default:
|
|
366
|
+
default: true
|
|
295
367
|
},
|
|
296
368
|
style: {},
|
|
297
369
|
labelStyle: {},
|
|
@@ -299,317 +371,382 @@ const Te = /* @__PURE__ */ P({
|
|
|
299
371
|
classLabelName: {}
|
|
300
372
|
},
|
|
301
373
|
emits: ["search", "add"],
|
|
302
|
-
setup(
|
|
303
|
-
emit:
|
|
374
|
+
setup(__props, {
|
|
375
|
+
emit: __emit
|
|
304
376
|
}) {
|
|
305
|
-
const
|
|
377
|
+
const slots = useSlots();
|
|
378
|
+
const props = __props;
|
|
379
|
+
const emit = __emit;
|
|
380
|
+
const render2 = (props2) => {
|
|
306
381
|
const {
|
|
307
|
-
searchColumns
|
|
308
|
-
searchParams
|
|
309
|
-
showSearchBtn
|
|
310
|
-
showAddBtn
|
|
311
|
-
style
|
|
312
|
-
labelStyle
|
|
313
|
-
className
|
|
314
|
-
classLabelName
|
|
315
|
-
} =
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
class: "search-
|
|
382
|
+
searchColumns,
|
|
383
|
+
searchParams,
|
|
384
|
+
showSearchBtn,
|
|
385
|
+
showAddBtn,
|
|
386
|
+
style,
|
|
387
|
+
labelStyle,
|
|
388
|
+
className,
|
|
389
|
+
classLabelName
|
|
390
|
+
} = props2;
|
|
391
|
+
const renderColumn = (searchColumns2) => {
|
|
392
|
+
return searchColumns2.filter((cell) => !cell.show || cell.show()).map((cell) => {
|
|
393
|
+
var _a, _b;
|
|
394
|
+
const conf = {
|
|
395
|
+
renderType: cell.renderType,
|
|
396
|
+
prop: cell.key,
|
|
397
|
+
config: cell.config
|
|
398
|
+
};
|
|
399
|
+
return createVNode("div", {
|
|
400
|
+
"class": `flex items-center search-item ${className != null ? className : ""} ${(_a = cell.className) != null ? _a : ""}`,
|
|
401
|
+
"style": __spreadValues(__spreadValues({}, style), cell.style)
|
|
402
|
+
}, [createVNode("span", {
|
|
403
|
+
"class": `whitespace-nowrap label ${classLabelName != null ? classLabelName : ""} ${(_b = cell.classLabelName) != null ? _b : ""}`,
|
|
404
|
+
"style": __spreadValues(__spreadValues({}, labelStyle), cell.labelStyle)
|
|
405
|
+
}, [createTextVNode(" "), cell.label, createTextVNode(" ")]), createVNode(_sfc_main$7, {
|
|
406
|
+
"class": cell.componentClassName,
|
|
407
|
+
"style": cell.componentStyle,
|
|
408
|
+
"conf": conf,
|
|
409
|
+
"model": searchParams,
|
|
410
|
+
"onChange": cell == null ? void 0 : cell.change
|
|
411
|
+
}, null)]);
|
|
412
|
+
});
|
|
413
|
+
};
|
|
414
|
+
return createVNode(Fragment, null, [createVNode("div", {
|
|
415
|
+
"class": "table-search flex gap-10"
|
|
416
|
+
}, [renderColumn(searchColumns), showSearchBtn && createVNode(resolveComponent("el-button"), {
|
|
417
|
+
"onClick": () => emit("search"),
|
|
418
|
+
"class": "search-item"
|
|
341
419
|
}, {
|
|
342
|
-
default: () => [
|
|
343
|
-
}),
|
|
344
|
-
class: "search-item",
|
|
345
|
-
onClick: () =>
|
|
420
|
+
default: () => [createTextVNode("搜索"), " "]
|
|
421
|
+
}), showAddBtn && createVNode(resolveComponent("el-button"), {
|
|
422
|
+
"class": "search-item",
|
|
423
|
+
"onClick": () => emit("add")
|
|
346
424
|
}, {
|
|
347
|
-
default: () => [
|
|
348
|
-
}),
|
|
425
|
+
default: () => [createTextVNode("添加")]
|
|
426
|
+
}), slots.default && slots.default()])]);
|
|
427
|
+
};
|
|
428
|
+
return (_ctx, _cache) => {
|
|
429
|
+
return openBlock(), createBlock(resolveDynamicComponent(render2(props)));
|
|
349
430
|
};
|
|
350
|
-
return (S, h) => (_(), F(j(d(s))));
|
|
351
431
|
}
|
|
352
|
-
})
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
432
|
+
});
|
|
433
|
+
const index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-c70da20e"]]);
|
|
434
|
+
const ruleMap = {
|
|
435
|
+
required: rule_required,
|
|
436
|
+
isNumber: rule_isNumber,
|
|
437
|
+
isInt: rule_isInt,
|
|
438
|
+
maxNumber: rule_maxNumber,
|
|
439
|
+
minNumber: rule_minNumber,
|
|
440
|
+
reg: rule_reg
|
|
359
441
|
};
|
|
360
|
-
function
|
|
361
|
-
return
|
|
442
|
+
function formatRule(label, ruleName, value) {
|
|
443
|
+
return ruleMap[ruleName](label, value);
|
|
362
444
|
}
|
|
363
|
-
function
|
|
364
|
-
return { required:
|
|
445
|
+
function rule_required(label) {
|
|
446
|
+
return { required: true, message: `请输入${label}`, trigger: ["blur", "change"] };
|
|
365
447
|
}
|
|
366
|
-
function
|
|
448
|
+
function rule_isNumber(label) {
|
|
367
449
|
return {
|
|
368
|
-
validator: (
|
|
369
|
-
if (Number.isNaN(+
|
|
370
|
-
|
|
450
|
+
validator: (rule, value, callback) => {
|
|
451
|
+
if (Number.isNaN(+value)) {
|
|
452
|
+
callback(new Error(`${label}必须是数字类型`));
|
|
371
453
|
return;
|
|
372
454
|
}
|
|
373
|
-
|
|
455
|
+
callback();
|
|
374
456
|
},
|
|
375
457
|
trigger: "blur"
|
|
376
458
|
};
|
|
377
459
|
}
|
|
378
|
-
function
|
|
460
|
+
function rule_isInt(label) {
|
|
379
461
|
return {
|
|
380
|
-
validator: (
|
|
381
|
-
if (
|
|
382
|
-
|
|
462
|
+
validator: (rule, value, callback) => {
|
|
463
|
+
if (value % 1 !== 0) {
|
|
464
|
+
callback(new Error(`${label}必须是整数类型`));
|
|
383
465
|
return;
|
|
384
466
|
}
|
|
385
|
-
|
|
467
|
+
callback();
|
|
386
468
|
},
|
|
387
469
|
trigger: "blur"
|
|
388
470
|
};
|
|
389
471
|
}
|
|
390
|
-
function
|
|
472
|
+
function rule_maxNumber(label, maxNumber) {
|
|
391
473
|
return {
|
|
392
|
-
validator: (
|
|
393
|
-
if (+
|
|
394
|
-
|
|
474
|
+
validator: (rule, value, callback) => {
|
|
475
|
+
if (+value > +maxNumber) {
|
|
476
|
+
callback(new Error(`${label}的值必须小于${maxNumber}`));
|
|
395
477
|
return;
|
|
396
478
|
}
|
|
397
|
-
|
|
479
|
+
callback();
|
|
398
480
|
},
|
|
399
481
|
trigger: "blur"
|
|
400
482
|
};
|
|
401
483
|
}
|
|
402
|
-
function
|
|
484
|
+
function rule_minNumber(label, minNumber) {
|
|
403
485
|
return {
|
|
404
|
-
validator: (
|
|
405
|
-
if (+
|
|
406
|
-
|
|
486
|
+
validator: (rule, value, callback) => {
|
|
487
|
+
if (+value < +minNumber) {
|
|
488
|
+
callback(new Error(`${label}的值必须大于${minNumber}`));
|
|
407
489
|
return;
|
|
408
490
|
}
|
|
409
|
-
|
|
491
|
+
callback();
|
|
410
492
|
},
|
|
411
493
|
trigger: "blur"
|
|
412
494
|
};
|
|
413
495
|
}
|
|
414
|
-
function
|
|
496
|
+
function rule_reg(label, reg) {
|
|
415
497
|
return {
|
|
416
|
-
validator: (
|
|
417
|
-
if (!
|
|
418
|
-
|
|
498
|
+
validator: (rule, value, callback) => {
|
|
499
|
+
if (!reg.test(value)) {
|
|
500
|
+
callback(new Error(`校验不通过`));
|
|
419
501
|
return;
|
|
420
502
|
}
|
|
421
|
-
|
|
503
|
+
callback();
|
|
422
504
|
},
|
|
423
505
|
trigger: "blur"
|
|
424
506
|
};
|
|
425
507
|
}
|
|
426
|
-
const
|
|
508
|
+
const _hoisted_1$2 = {
|
|
427
509
|
xmlns: "http://www.w3.org/2000/svg",
|
|
428
510
|
width: "16",
|
|
429
511
|
height: "16",
|
|
430
512
|
class: "icon",
|
|
431
513
|
viewBox: "0 0 1024 1024"
|
|
432
|
-
}
|
|
514
|
+
};
|
|
515
|
+
const _hoisted_2$2 = /* @__PURE__ */ createElementVNode("path", {
|
|
433
516
|
fill: "#707070",
|
|
434
517
|
d: "M511.666 64.673c-246.535 0-446.39 199.856-446.39 446.39 0 246.536 199.855 446.393 446.39 446.393s446.392-199.857 446.392-446.392S758.203 64.673 511.666 64.673m0 836.878c-215.66 0-390.487-174.827-390.487-390.488 0-215.66 174.827-390.487 390.487-390.487s390.488 174.827 390.488 390.487c0 215.661-174.828 390.488-390.488 390.488m-86.894-485.188s14.002-86.168 100.17-76.474c86.168 9.694 66.78 74.32 58.163 87.245-8.616 21.542-88.323 73.243-101.247 104.479-12.925 31.236-11.848 89.4-11.848 89.4h77.551s-4.308-61.395 38.776-87.246c43.084-25.85 116.326-101.247 84.014-173.413-51.701-82.937-102.324-91.554-168.028-89.4-65.703 2.155-134.638 34.468-157.257 134.639 53.855 7.538 79.706 10.77 79.706 10.77m44.16 233.73h80.783v88.311h-80.782v-88.31z"
|
|
435
|
-
}, null, -1)
|
|
436
|
-
|
|
518
|
+
}, null, -1);
|
|
519
|
+
const _hoisted_3$1 = [
|
|
520
|
+
_hoisted_2$2
|
|
437
521
|
];
|
|
438
|
-
function
|
|
439
|
-
return
|
|
522
|
+
function render(_ctx, _cache) {
|
|
523
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$2, _hoisted_3$1);
|
|
440
524
|
}
|
|
441
|
-
const
|
|
525
|
+
const HelpIcon = { render };
|
|
526
|
+
const _hoisted_1$1 = {
|
|
442
527
|
key: 0,
|
|
443
528
|
style: { "margin-left": "4px" }
|
|
444
|
-
}
|
|
529
|
+
};
|
|
530
|
+
const _hoisted_2$1 = ["slot"];
|
|
531
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
445
532
|
__name: "form",
|
|
446
533
|
props: {
|
|
447
534
|
formConfig: {},
|
|
448
535
|
status: {},
|
|
449
536
|
formData: {}
|
|
450
537
|
},
|
|
451
|
-
setup(
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
538
|
+
setup(__props, { expose: __expose }) {
|
|
539
|
+
const hasNoComp = ["date-picker"];
|
|
540
|
+
const props = __props;
|
|
541
|
+
const formRef = ref();
|
|
542
|
+
const form2 = ref(getForm());
|
|
543
|
+
const rules = getRules();
|
|
544
|
+
const formValue = computed(() => {
|
|
545
|
+
const compList = props.formConfig.compList;
|
|
546
|
+
const showFormValue = {};
|
|
547
|
+
compList.forEach((item) => {
|
|
548
|
+
if (typeof item.hidden === "function" ? !item.hidden(form2.value, props.status) : !item.hidden) {
|
|
549
|
+
item.name && (showFormValue[item.name] = form2.value[item.name]);
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
return showFormValue;
|
|
457
553
|
});
|
|
458
|
-
function
|
|
459
|
-
return
|
|
554
|
+
function getForm() {
|
|
555
|
+
return props.status === "ADD" ? initForm() : props.formData;
|
|
460
556
|
}
|
|
461
|
-
function
|
|
462
|
-
return
|
|
557
|
+
function getRules() {
|
|
558
|
+
return initRules();
|
|
463
559
|
}
|
|
464
|
-
function
|
|
465
|
-
|
|
560
|
+
function resetForm() {
|
|
561
|
+
form2.value = initForm();
|
|
466
562
|
}
|
|
467
|
-
function
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
563
|
+
function initForm() {
|
|
564
|
+
const list = props.formConfig.compList;
|
|
565
|
+
const form22 = {};
|
|
566
|
+
list.forEach((item) => {
|
|
567
|
+
item.name && (form22[item.name] = item.defaultValue);
|
|
568
|
+
});
|
|
569
|
+
return form22;
|
|
472
570
|
}
|
|
473
|
-
function
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
571
|
+
function initRules() {
|
|
572
|
+
const list = props.formConfig.compList;
|
|
573
|
+
const rules2 = {};
|
|
574
|
+
list.forEach((item) => {
|
|
575
|
+
var _a, _b, _c;
|
|
576
|
+
const hasRules = ((_a = item.rule) == null ? void 0 : _a.constructor) === Object && Object.keys(item.rule).length > 0;
|
|
577
|
+
const hasCustomRules = Array.isArray(item.customRules) && item.customRules.length > 0;
|
|
578
|
+
if (hasRules || hasCustomRules) {
|
|
579
|
+
!rules2[item.name] && (rules2[item.name] = []);
|
|
580
|
+
}
|
|
581
|
+
if (hasRules) {
|
|
582
|
+
for (const ruleName in item.rule) {
|
|
583
|
+
if (item.rule[ruleName] === false)
|
|
481
584
|
break;
|
|
482
|
-
const
|
|
483
|
-
(
|
|
585
|
+
const label = typeof item.label === "function" ? handleFn(item.label) : item.label;
|
|
586
|
+
(_b = rules2[item.name]) == null ? void 0 : _b.push(formatRule(label, ruleName, item.rule[ruleName]));
|
|
484
587
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
(
|
|
488
|
-
|
|
489
|
-
|
|
588
|
+
}
|
|
589
|
+
if (hasCustomRules) {
|
|
590
|
+
(_c = item.customRules) == null ? void 0 : _c.forEach((cRule) => {
|
|
591
|
+
var _a2;
|
|
592
|
+
(_a2 = rules2[item.name]) == null ? void 0 : _a2.push(cRule);
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
return rules2;
|
|
490
597
|
}
|
|
491
|
-
function
|
|
492
|
-
return new Promise((
|
|
493
|
-
|
|
494
|
-
|
|
598
|
+
function validateForm() {
|
|
599
|
+
return new Promise((resolve, reject) => {
|
|
600
|
+
formRef.value.validate((valid) => {
|
|
601
|
+
valid ? resolve("") : reject();
|
|
495
602
|
});
|
|
496
603
|
});
|
|
497
604
|
}
|
|
498
|
-
function
|
|
499
|
-
return
|
|
605
|
+
function formShow(compList) {
|
|
606
|
+
return compList.filter((i) => !handleFn(i.hidden));
|
|
500
607
|
}
|
|
501
|
-
function
|
|
502
|
-
return typeof
|
|
608
|
+
function handleFn(fields) {
|
|
609
|
+
return typeof fields === "function" ? fields(form2.value, props.status) : fields;
|
|
503
610
|
}
|
|
504
|
-
|
|
505
|
-
() =>
|
|
611
|
+
watch(
|
|
612
|
+
() => form2,
|
|
506
613
|
() => {
|
|
507
|
-
|
|
614
|
+
initForm();
|
|
508
615
|
},
|
|
509
616
|
{
|
|
510
|
-
deep:
|
|
617
|
+
deep: true
|
|
511
618
|
}
|
|
512
|
-
)
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
619
|
+
);
|
|
620
|
+
__expose({
|
|
621
|
+
form: form2,
|
|
622
|
+
formValue,
|
|
623
|
+
resetForm,
|
|
624
|
+
validateForm
|
|
625
|
+
});
|
|
626
|
+
return (_ctx, _cache) => {
|
|
627
|
+
const _component_el_popover = resolveComponent("el-popover");
|
|
628
|
+
const _component_el_form_item = resolveComponent("el-form-item");
|
|
629
|
+
const _component_el_form = resolveComponent("el-form");
|
|
630
|
+
return openBlock(), createBlock(_component_el_form, mergeProps({
|
|
520
631
|
ref_key: "formRef",
|
|
521
|
-
ref:
|
|
522
|
-
model:
|
|
523
|
-
},
|
|
524
|
-
default:
|
|
525
|
-
|
|
632
|
+
ref: formRef,
|
|
633
|
+
model: form2.value
|
|
634
|
+
}, _ctx.formConfig.formProps, { rules: unref(rules) }), {
|
|
635
|
+
default: withCtx(() => [
|
|
636
|
+
createElementVNode("div", {
|
|
526
637
|
class: "form-wrap",
|
|
527
|
-
style:
|
|
638
|
+
style: normalizeStyle(_ctx.formConfig.wrapStyle)
|
|
528
639
|
}, [
|
|
529
|
-
(
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
key:
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
640
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(formShow(_ctx.formConfig.compList), (item) => {
|
|
641
|
+
return openBlock(), createElementBlock("div", {
|
|
642
|
+
class: "form-item",
|
|
643
|
+
key: item.name,
|
|
644
|
+
style: normalizeStyle(__spreadValues(__spreadValues({}, _ctx.formConfig.itemStyle), item.style))
|
|
645
|
+
}, [
|
|
646
|
+
createVNode(_component_el_form_item, mergeProps(__spreadValues(__spreadValues({}, _ctx.formConfig.formItemProps), item.formItemProps), {
|
|
647
|
+
prop: item.name,
|
|
648
|
+
style: _ctx.formConfig.formItemStyle,
|
|
649
|
+
class: _ctx.formConfig.layout
|
|
650
|
+
}), {
|
|
651
|
+
label: withCtx(() => [
|
|
652
|
+
createElementVNode("span", {
|
|
653
|
+
style: normalizeStyle(item.labelStyle)
|
|
654
|
+
}, toDisplayString(handleFn(item.label)), 5),
|
|
655
|
+
item.hint ? (openBlock(), createBlock(_component_el_popover, {
|
|
656
|
+
key: 0,
|
|
657
|
+
placement: "top-start",
|
|
658
|
+
trigger: "hover",
|
|
659
|
+
content: item.hint
|
|
660
|
+
}, {
|
|
661
|
+
reference: withCtx(() => [
|
|
662
|
+
item.hint ? (openBlock(), createElementBlock("span", _hoisted_1$1, [
|
|
663
|
+
createVNode(unref(HelpIcon), { color: "#ccc" })
|
|
664
|
+
])) : createCommentVNode("", true)
|
|
665
|
+
]),
|
|
666
|
+
_: 2
|
|
667
|
+
}, 1032, ["content"])) : createCommentVNode("", true)
|
|
668
|
+
]),
|
|
669
|
+
default: withCtx(() => [
|
|
670
|
+
item.slotName ? renderSlot(_ctx.$slots, item.slotName, {
|
|
671
|
+
key: 0,
|
|
672
|
+
form: form2.value
|
|
673
|
+
}, void 0, true) : hasNoComp.includes(item.ctype || "") ? (openBlock(), createBlock(resolveDynamicComponent(`el-${item.ctype}`), mergeProps({ key: 1 }, item.config, {
|
|
674
|
+
modelValue: form2.value[item.name],
|
|
675
|
+
"onUpdate:modelValue": ($event) => form2.value[item.name] = $event
|
|
676
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue"])) : (openBlock(), createBlock(resolveDynamicComponent(`el-${item.ctype}`), mergeProps({ key: 2 }, item.config, {
|
|
677
|
+
disabled: handleFn(item.disabled),
|
|
678
|
+
modelValue: form2.value[item.name],
|
|
679
|
+
"onUpdate:modelValue": ($event) => form2.value[item.name] = $event,
|
|
680
|
+
onKeyup: withKeys(($event) => handleFn(item == null ? void 0 : item.enter), ["enter"])
|
|
681
|
+
}, toHandlers(item.event)), {
|
|
682
|
+
default: withCtx(() => [
|
|
683
|
+
item.ctype === "select" ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(item.selectOptions, (option) => {
|
|
684
|
+
return openBlock(), createBlock(resolveDynamicComponent("el-option"), {
|
|
685
|
+
key: option.value,
|
|
686
|
+
label: option.label,
|
|
687
|
+
value: option.value
|
|
688
|
+
}, null, 8, ["label", "value"]);
|
|
689
|
+
}), 128)) : createCommentVNode("", true),
|
|
690
|
+
item.ctype === "radio-group" ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(item.radioList, (radio) => {
|
|
691
|
+
return openBlock(), createBlock(resolveDynamicComponent("el-radio"), {
|
|
692
|
+
key: radio.value,
|
|
693
|
+
label: radio.value
|
|
694
|
+
}, {
|
|
695
|
+
default: withCtx(() => [
|
|
696
|
+
createTextVNode(toDisplayString(radio.label), 1)
|
|
697
|
+
]),
|
|
698
|
+
_: 2
|
|
699
|
+
}, 1032, ["label"]);
|
|
700
|
+
}), 128)) : createCommentVNode("", true),
|
|
701
|
+
item.ctype === "checkbox-group" ? (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(item.checkboxList, (box) => {
|
|
702
|
+
return openBlock(), createBlock(resolveDynamicComponent("el-checkbox"), {
|
|
703
|
+
key: box,
|
|
704
|
+
label: box
|
|
705
|
+
}, null, 8, ["label"]);
|
|
706
|
+
}), 128)) : createCommentVNode("", true),
|
|
707
|
+
item.ctype === "input" ? (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList((item.slots || []).filter((i) => i.type === "text"), (st) => {
|
|
708
|
+
return openBlock(), createElementBlock("div", {
|
|
709
|
+
slot: st.name,
|
|
710
|
+
key: st.name
|
|
711
|
+
}, toDisplayString(st.inner), 9, _hoisted_2$1);
|
|
712
|
+
}), 128)) : createCommentVNode("", true)
|
|
713
|
+
]),
|
|
714
|
+
_: 2
|
|
715
|
+
}, 1040, ["disabled", "modelValue", "onUpdate:modelValue", "onKeyup"]))
|
|
716
|
+
]),
|
|
717
|
+
_: 2
|
|
718
|
+
}, 1040, ["prop", "style", "class"])
|
|
719
|
+
], 4);
|
|
720
|
+
}), 128))
|
|
600
721
|
], 4)
|
|
601
722
|
]),
|
|
602
723
|
_: 3
|
|
603
724
|
}, 16, ["model", "rules"]);
|
|
604
725
|
};
|
|
605
726
|
}
|
|
606
|
-
})
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
}
|
|
727
|
+
});
|
|
728
|
+
const form = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-a47302d3"]]);
|
|
729
|
+
let versionKey, curVersion, updateApp;
|
|
730
|
+
const updateSysVersion = () => {
|
|
731
|
+
localStorage.setItem(versionKey, curVersion);
|
|
732
|
+
window.location.reload(true);
|
|
733
|
+
};
|
|
734
|
+
const delayUpdateSysVersion = () => {
|
|
735
|
+
updateApp.unmount();
|
|
736
|
+
document.body.removeChild(document.querySelector("#update"));
|
|
737
|
+
localStorage.setItem(versionKey, curVersion);
|
|
738
|
+
};
|
|
739
|
+
const _withScopeId = (n) => (pushScopeId("data-v-ebf4f18f"), n = n(), popScopeId(), n);
|
|
740
|
+
const _hoisted_1 = { class: "update-wrap flex items-center justify-center" };
|
|
741
|
+
const _hoisted_2 = { class: "relative update-content" };
|
|
742
|
+
const _hoisted_3 = { class: "flex items-center justify-center" };
|
|
743
|
+
const _hoisted_4 = { class: "flex flex-col gap-5 mt-10" };
|
|
744
|
+
const _hoisted_5 = { class: "update-title" };
|
|
745
|
+
const _hoisted_6 = { class: "update-item px-20" };
|
|
746
|
+
const _hoisted_7 = { class: "text-end" };
|
|
747
|
+
const _hoisted_8 = { class: "flex justify-end items-center mt-10" };
|
|
748
|
+
const _hoisted_9 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "tips mt-10" }, "提示: 选择立即更新后,会立即刷新页面更新系统,当前页面缓存数据会消失选择暂不更新后,请稍后自行刷新页面更新系统。", -1));
|
|
749
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
613
750
|
__name: "index",
|
|
614
751
|
props: {
|
|
615
752
|
title: {},
|
|
@@ -617,45 +754,50 @@ const Xe = () => {
|
|
|
617
754
|
content: {},
|
|
618
755
|
time: {}
|
|
619
756
|
},
|
|
620
|
-
setup(
|
|
621
|
-
const
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
(
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
757
|
+
setup(__props) {
|
|
758
|
+
const props = __props;
|
|
759
|
+
console.log(props);
|
|
760
|
+
return (_ctx, _cache) => {
|
|
761
|
+
const _component_el_button = resolveComponent("el-button");
|
|
762
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
763
|
+
createElementVNode("div", _hoisted_2, [
|
|
764
|
+
createElementVNode("div", _hoisted_3, toDisplayString(props == null ? void 0 : props.title), 1),
|
|
765
|
+
createElementVNode("div", _hoisted_4, [
|
|
766
|
+
createElementVNode("div", _hoisted_5, toDisplayString(props == null ? void 0 : props.description), 1),
|
|
767
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(props == null ? void 0 : props.content, (item, key) => {
|
|
768
|
+
return openBlock(), createElementBlock("div", _hoisted_6, [
|
|
769
|
+
createElementVNode("span", null, toDisplayString(key) + ":", 1),
|
|
770
|
+
createTextVNode(),
|
|
771
|
+
createElementVNode("span", null, toDisplayString(item), 1)
|
|
772
|
+
]);
|
|
773
|
+
}), 256)),
|
|
774
|
+
createElementVNode("div", _hoisted_7, toDisplayString(props.time) + " 软件专业部", 1),
|
|
775
|
+
createElementVNode("div", _hoisted_8, [
|
|
776
|
+
createVNode(_component_el_button, {
|
|
637
777
|
plain: "",
|
|
638
|
-
onClick:
|
|
778
|
+
onClick: unref(delayUpdateSysVersion)
|
|
639
779
|
}, {
|
|
640
|
-
default:
|
|
641
|
-
|
|
780
|
+
default: withCtx(() => [
|
|
781
|
+
createTextVNode("暂不更新")
|
|
642
782
|
]),
|
|
643
783
|
_: 1
|
|
644
784
|
}, 8, ["onClick"]),
|
|
645
|
-
|
|
646
|
-
default:
|
|
647
|
-
|
|
785
|
+
createVNode(_component_el_button, { onClick: unref(updateSysVersion) }, {
|
|
786
|
+
default: withCtx(() => [
|
|
787
|
+
createTextVNode("立即更新")
|
|
648
788
|
]),
|
|
649
789
|
_: 1
|
|
650
790
|
}, 8, ["onClick"])
|
|
651
791
|
]),
|
|
652
|
-
|
|
792
|
+
_hoisted_9
|
|
653
793
|
])
|
|
654
794
|
])
|
|
655
795
|
]);
|
|
656
796
|
};
|
|
657
797
|
}
|
|
658
|
-
})
|
|
798
|
+
});
|
|
799
|
+
const Update = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-ebf4f18f"]]);
|
|
800
|
+
const _sfc_main$2 = {
|
|
659
801
|
props: {
|
|
660
802
|
color: {
|
|
661
803
|
type: String,
|
|
@@ -667,15 +809,16 @@ const Xe = () => {
|
|
|
667
809
|
}
|
|
668
810
|
}
|
|
669
811
|
};
|
|
670
|
-
function
|
|
671
|
-
return
|
|
812
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
813
|
+
return openBlock(), createElementBlock("i", {
|
|
672
814
|
class: "yx-icon",
|
|
673
|
-
style:
|
|
815
|
+
style: normalizeStyle([{ "--color": $props.color, "font-size": $props.size + "px" }])
|
|
674
816
|
}, [
|
|
675
|
-
|
|
817
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
676
818
|
], 4);
|
|
677
819
|
}
|
|
678
|
-
const
|
|
820
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render], ["__scopeId", "data-v-75aef834"]]);
|
|
821
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
679
822
|
__name: "index",
|
|
680
823
|
props: {
|
|
681
824
|
uploadTips: {},
|
|
@@ -684,38 +827,54 @@ const mt = /* @__PURE__ */ Z(pt, [["render", ft], ["__scopeId", "data-v-75aef834
|
|
|
684
827
|
}
|
|
685
828
|
},
|
|
686
829
|
emits: ["update:fileObsUrl"],
|
|
687
|
-
setup(
|
|
688
|
-
emit:
|
|
830
|
+
setup(__props, {
|
|
831
|
+
emit: __emit
|
|
689
832
|
}) {
|
|
690
|
-
const
|
|
691
|
-
|
|
833
|
+
const attrs = useAttrs();
|
|
834
|
+
const fileList = ref([]);
|
|
835
|
+
const props = __props;
|
|
836
|
+
const fileObsUrl = ref("");
|
|
837
|
+
const emit = __emit;
|
|
838
|
+
const uploadFile = (_0) => __async(this, [_0], function* ({
|
|
839
|
+
file
|
|
692
840
|
}) {
|
|
693
|
-
const
|
|
694
|
-
|
|
841
|
+
const fromData = new FormData();
|
|
842
|
+
fromData.append("file", file);
|
|
695
843
|
const {
|
|
696
|
-
data
|
|
697
|
-
} = yield
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
class: "w-full h-full",
|
|
701
|
-
"http-request": h,
|
|
702
|
-
"file-list": s.value
|
|
703
|
-
}, t), {
|
|
704
|
-
trigger: () => p == null ? void 0 : p.render(d.value),
|
|
705
|
-
tip: () => f("div", {
|
|
706
|
-
class: "el-upload__tip"
|
|
707
|
-
}, [p == null ? void 0 : p.uploadTips])
|
|
844
|
+
data
|
|
845
|
+
} = yield uploadResourceApi(fromData);
|
|
846
|
+
fileObsUrl.value = data.fileUrl;
|
|
847
|
+
emit("update:fileObsUrl", fileObsUrl.value);
|
|
708
848
|
});
|
|
709
|
-
|
|
710
|
-
"
|
|
711
|
-
|
|
849
|
+
const render2 = (props2) => {
|
|
850
|
+
return createVNode(resolveComponent("el-upload"), mergeProps({
|
|
851
|
+
"class": "w-full h-full",
|
|
852
|
+
"http-request": uploadFile,
|
|
853
|
+
"file-list": fileList.value
|
|
854
|
+
}, attrs), {
|
|
855
|
+
trigger: () => {
|
|
856
|
+
return props2 == null ? void 0 : props2.render(fileObsUrl.value);
|
|
857
|
+
},
|
|
858
|
+
tip: () => {
|
|
859
|
+
return createVNode("div", {
|
|
860
|
+
"class": "el-upload__tip"
|
|
861
|
+
}, [props2 == null ? void 0 : props2.uploadTips]);
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
};
|
|
865
|
+
return (_ctx, _cache) => {
|
|
866
|
+
return openBlock(), createBlock(resolveDynamicComponent(render2(props)), {
|
|
867
|
+
"model-value": fileObsUrl.value
|
|
868
|
+
}, null, 8, ["model-value"]);
|
|
869
|
+
};
|
|
712
870
|
}
|
|
713
871
|
});
|
|
714
|
-
function
|
|
715
|
-
return typeof
|
|
872
|
+
function _isSlot(s) {
|
|
873
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
716
874
|
}
|
|
717
|
-
const
|
|
718
|
-
name: "YxForm"
|
|
875
|
+
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
876
|
+
name: "YxForm"
|
|
877
|
+
}), {
|
|
719
878
|
__name: "index",
|
|
720
879
|
props: {
|
|
721
880
|
formParams: {},
|
|
@@ -733,175 +892,222 @@ const gt = /* @__PURE__ */ P({
|
|
|
733
892
|
},
|
|
734
893
|
rules: {}
|
|
735
894
|
},
|
|
736
|
-
setup(
|
|
737
|
-
expose:
|
|
895
|
+
setup(__props, {
|
|
896
|
+
expose: __expose
|
|
738
897
|
}) {
|
|
739
|
-
let
|
|
740
|
-
const
|
|
898
|
+
let formData = ref({});
|
|
899
|
+
const formRules = ref({});
|
|
900
|
+
const initForm = () => {
|
|
741
901
|
const {
|
|
742
|
-
formList
|
|
743
|
-
formParams
|
|
744
|
-
} =
|
|
745
|
-
!
|
|
746
|
-
|
|
747
|
-
|
|
902
|
+
formList,
|
|
903
|
+
formParams
|
|
904
|
+
} = props;
|
|
905
|
+
if (!formParams || Object.keys(formParams).length === 0) {
|
|
906
|
+
formList.forEach((item) => formData.value[item.prop] = "");
|
|
907
|
+
} else {
|
|
908
|
+
formData.value = formParams;
|
|
909
|
+
}
|
|
910
|
+
console.log("initForm", formData);
|
|
911
|
+
};
|
|
912
|
+
const slots = useSlots();
|
|
913
|
+
const attrs = useAttrs();
|
|
914
|
+
const props = __props;
|
|
915
|
+
const getRules = () => {
|
|
916
|
+
let rules = {};
|
|
748
917
|
const {
|
|
749
|
-
formList
|
|
750
|
-
} =
|
|
751
|
-
|
|
752
|
-
if (
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
918
|
+
formList
|
|
919
|
+
} = props;
|
|
920
|
+
formList.forEach((form2) => {
|
|
921
|
+
if (form2.children && form2.children.length > 0) {
|
|
922
|
+
form2.children.forEach((item) => {
|
|
923
|
+
if (item.required) {
|
|
924
|
+
const defaultRule = {
|
|
925
|
+
required: true,
|
|
926
|
+
message: `${item.label}不能为空`,
|
|
927
|
+
trigger: "blur"
|
|
928
|
+
};
|
|
929
|
+
rules[item.prop] = [defaultRule];
|
|
930
|
+
if (item.rules) {
|
|
931
|
+
rules[item.prop] = [...rules[item.prop], ...item.rules];
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
}
|
|
936
|
+
if (form2.required) {
|
|
937
|
+
const defaultRule = {
|
|
938
|
+
required: true,
|
|
939
|
+
message: `${form2.label}不能为空`,
|
|
765
940
|
trigger: "blur"
|
|
766
941
|
};
|
|
767
|
-
|
|
942
|
+
rules[form2.prop] = [defaultRule];
|
|
943
|
+
if (form2.rules) {
|
|
944
|
+
rules[form2.prop] = [...rules[form2.prop], ...form2.rules];
|
|
945
|
+
}
|
|
768
946
|
}
|
|
769
|
-
})
|
|
770
|
-
|
|
947
|
+
});
|
|
948
|
+
formRules.value = rules;
|
|
949
|
+
};
|
|
950
|
+
const formRef = ref();
|
|
951
|
+
const getFormStyle = () => {
|
|
771
952
|
const {
|
|
772
|
-
formStyle
|
|
773
|
-
} =
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
953
|
+
formStyle
|
|
954
|
+
} = props;
|
|
955
|
+
const _a = formStyle, {
|
|
956
|
+
row,
|
|
957
|
+
gap
|
|
958
|
+
} = _a, style = __objRest(_a, [
|
|
777
959
|
"row",
|
|
778
960
|
"gap"
|
|
779
961
|
]);
|
|
780
|
-
return
|
|
781
|
-
"grid-template-columns": `repeat(${
|
|
782
|
-
"grid-gap":
|
|
783
|
-
},
|
|
784
|
-
}
|
|
785
|
-
|
|
962
|
+
return __spreadValues({
|
|
963
|
+
"grid-template-columns": `repeat(${row}, 1fr)`,
|
|
964
|
+
"grid-gap": gap
|
|
965
|
+
}, style);
|
|
966
|
+
};
|
|
967
|
+
const getGroupStyle = (groupStyle) => {
|
|
968
|
+
if (!groupStyle)
|
|
786
969
|
return {};
|
|
787
|
-
const
|
|
788
|
-
row
|
|
789
|
-
gap
|
|
790
|
-
} =
|
|
970
|
+
const _a = groupStyle, {
|
|
971
|
+
row,
|
|
972
|
+
gap
|
|
973
|
+
} = _a, style = __objRest(_a, [
|
|
791
974
|
"row",
|
|
792
975
|
"gap"
|
|
793
976
|
]);
|
|
794
|
-
return
|
|
795
|
-
"grid-template-columns": `repeat(${
|
|
796
|
-
"grid-gap":
|
|
797
|
-
},
|
|
977
|
+
return __spreadValues({
|
|
978
|
+
"grid-template-columns": `repeat(${row}, 1fr)`,
|
|
979
|
+
"grid-gap": gap
|
|
980
|
+
}, style);
|
|
798
981
|
};
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
982
|
+
initForm();
|
|
983
|
+
getRules();
|
|
984
|
+
const render2 = (props2) => {
|
|
985
|
+
let _slot;
|
|
802
986
|
const {
|
|
803
|
-
formList
|
|
804
|
-
formStyle
|
|
805
|
-
formLayout
|
|
806
|
-
} =
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
987
|
+
formList,
|
|
988
|
+
formStyle,
|
|
989
|
+
formLayout
|
|
990
|
+
} = props2;
|
|
991
|
+
const dynamicComponent = ({
|
|
992
|
+
renderType,
|
|
993
|
+
event,
|
|
994
|
+
prop,
|
|
995
|
+
label,
|
|
996
|
+
config
|
|
812
997
|
}) => {
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
998
|
+
const Component = resolveComponent("el-" + renderType);
|
|
999
|
+
const renderChildComponent = () => {
|
|
1000
|
+
if (renderType === "select")
|
|
1001
|
+
return config.options.map((item) => createVNode(resolveComponent("el-option"), {
|
|
1002
|
+
"label": item.label,
|
|
1003
|
+
"value": item.value
|
|
818
1004
|
}, null));
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
|
|
1005
|
+
};
|
|
1006
|
+
const _a = config || {}, {
|
|
1007
|
+
options
|
|
1008
|
+
} = _a, conf = __objRest(_a, [
|
|
822
1009
|
"options"
|
|
823
1010
|
]);
|
|
824
|
-
return
|
|
825
|
-
modelValue:
|
|
826
|
-
"onUpdate:modelValue": (
|
|
827
|
-
placeholder: `请输入${
|
|
828
|
-
}),
|
|
829
|
-
default: () => [
|
|
1011
|
+
return createVNode(Component, mergeProps(event, conf, {
|
|
1012
|
+
"modelValue": formData.value[prop],
|
|
1013
|
+
"onUpdate:modelValue": ($event) => formData.value[prop] = $event,
|
|
1014
|
+
"placeholder": `请输入${label}`
|
|
1015
|
+
}), _isSlot(renderChildComponent) ? renderChildComponent : {
|
|
1016
|
+
default: () => [renderChildComponent]
|
|
830
1017
|
});
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
1018
|
+
};
|
|
1019
|
+
const formItemSlots = (form2, scope) => {
|
|
1020
|
+
var _a;
|
|
1021
|
+
return form2.slotName && ((_a = slots[form2.slotName]) == null ? void 0 : _a.call(slots, scope));
|
|
1022
|
+
};
|
|
1023
|
+
const renderFormItem = (formList2) => {
|
|
1024
|
+
const renderForm = (form2) => {
|
|
1025
|
+
var _b;
|
|
1026
|
+
const _a = form2, {
|
|
1027
|
+
render: render3,
|
|
1028
|
+
config,
|
|
1029
|
+
renderType
|
|
1030
|
+
} = _a, formProps = __objRest(_a, [
|
|
842
1031
|
"render",
|
|
843
1032
|
"config",
|
|
844
1033
|
"renderType"
|
|
845
1034
|
]);
|
|
846
|
-
return
|
|
847
|
-
class: `${
|
|
848
|
-
},
|
|
849
|
-
prop:
|
|
850
|
-
labelWidth:
|
|
1035
|
+
return createVNode(resolveComponent("el-form-item"), mergeProps({
|
|
1036
|
+
"class": `${formLayout === "vertical" ? "flex flex-col " : ""} ${(_b = form2.className) != null ? _b : ""}`
|
|
1037
|
+
}, formProps, {
|
|
1038
|
+
"prop": form2.prop,
|
|
1039
|
+
"labelWidth": formStyle.labelWidth
|
|
851
1040
|
}), {
|
|
852
|
-
default: (
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
1041
|
+
default: (scope) => {
|
|
1042
|
+
if (form2 == null ? void 0 : form2.render)
|
|
1043
|
+
return form2 == null ? void 0 : form2.render(formData.value);
|
|
1044
|
+
if (form2.renderType)
|
|
1045
|
+
return dynamicComponent(form2);
|
|
1046
|
+
return (form2 == null ? void 0 : form2.slotName) && formItemSlots(form2, scope);
|
|
1047
|
+
},
|
|
1048
|
+
label: () => createVNode("span", {
|
|
1049
|
+
"class": form2.className,
|
|
1050
|
+
"style": __spreadValues({}, form2.style)
|
|
1051
|
+
}, [form2.label])
|
|
857
1052
|
});
|
|
858
1053
|
};
|
|
859
|
-
return
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
1054
|
+
return formList2.filter((form2) => !form2.show || form2.show(formData.value)).map((form2) => {
|
|
1055
|
+
if (form2.children && form2.children.length > 0) {
|
|
1056
|
+
return createVNode("div", {
|
|
1057
|
+
"class": "flex flex-col"
|
|
1058
|
+
}, [createVNode("span", null, [form2.groupName]), createVNode("div", {
|
|
1059
|
+
"class": "grid",
|
|
1060
|
+
"style": __spreadValues({}, getGroupStyle(form2 == null ? void 0 : form2.groupStyle))
|
|
1061
|
+
}, [form2.children.filter((form3) => !form3.show || form3.show(formData.value)).map((form3) => renderForm(form3))])]);
|
|
1062
|
+
} else {
|
|
1063
|
+
return renderForm(form2);
|
|
1064
|
+
}
|
|
1065
|
+
});
|
|
865
1066
|
};
|
|
866
|
-
return
|
|
867
|
-
"scroll-to-error":
|
|
868
|
-
model:
|
|
869
|
-
rules:
|
|
870
|
-
class: "grid",
|
|
871
|
-
ref:
|
|
872
|
-
},
|
|
873
|
-
style:
|
|
874
|
-
}),
|
|
875
|
-
default: () => [
|
|
1067
|
+
return createVNode(Fragment, null, [createVNode(resolveComponent("el-form"), mergeProps({
|
|
1068
|
+
"scroll-to-error": true,
|
|
1069
|
+
"model": formData.value,
|
|
1070
|
+
"rules": formRules.value,
|
|
1071
|
+
"class": "grid",
|
|
1072
|
+
"ref": formRef
|
|
1073
|
+
}, attrs, {
|
|
1074
|
+
"style": __spreadValues({}, getFormStyle())
|
|
1075
|
+
}), _isSlot(_slot = renderFormItem(formList)) ? _slot : {
|
|
1076
|
+
default: () => [_slot]
|
|
876
1077
|
})]);
|
|
877
1078
|
};
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
1079
|
+
const formValidate = () => __async(this, null, function* () {
|
|
1080
|
+
return yield formRef.value.validate((valid) => valid ? true : false);
|
|
1081
|
+
});
|
|
1082
|
+
__expose({
|
|
1083
|
+
formData,
|
|
1084
|
+
formValidate
|
|
1085
|
+
});
|
|
1086
|
+
return (_ctx, _cache) => {
|
|
1087
|
+
return openBlock(), createBlock(resolveDynamicComponent(render2(props)));
|
|
1088
|
+
};
|
|
884
1089
|
}
|
|
885
|
-
})
|
|
1090
|
+
}));
|
|
1091
|
+
const components2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
886
1092
|
__proto__: null,
|
|
887
|
-
Toolbar
|
|
888
|
-
Update
|
|
889
|
-
YxDialog:
|
|
890
|
-
YxForm:
|
|
891
|
-
YxFormV2:
|
|
892
|
-
YxIcon:
|
|
893
|
-
YxSearchForm:
|
|
894
|
-
YxTable:
|
|
895
|
-
YxUpload:
|
|
1093
|
+
Toolbar,
|
|
1094
|
+
Update,
|
|
1095
|
+
YxDialog: _sfc_main$8,
|
|
1096
|
+
YxForm: form,
|
|
1097
|
+
YxFormV2: _sfc_main,
|
|
1098
|
+
YxIcon: index,
|
|
1099
|
+
YxSearchForm: index$1,
|
|
1100
|
+
YxTable: _sfc_main$6,
|
|
1101
|
+
YxUpload: _sfc_main$1
|
|
896
1102
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
897
1103
|
export {
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
1104
|
+
Update as U,
|
|
1105
|
+
_sfc_main$8 as _,
|
|
1106
|
+
_sfc_main$6 as a,
|
|
1107
|
+
index as b,
|
|
1108
|
+
components2 as c,
|
|
1109
|
+
_sfc_main$1 as d,
|
|
1110
|
+
_sfc_main as e,
|
|
1111
|
+
form as f,
|
|
1112
|
+
index$1 as i
|
|
907
1113
|
};
|