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