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