yxuse 3.0.90 → 3.0.92
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 +2 -2
- package/lib/components.cjs.js +1 -1
- package/lib/components.es.js +11 -9
- package/lib/hooks.cjs.js +1 -1
- package/lib/hooks.es.js +6 -6
- package/lib/index.cjs.js +1 -1
- package/lib/index.cjs11.js +1 -1
- package/lib/index.cjs12.js +1 -1
- package/lib/index.cjs13.js +1 -1
- package/lib/index.cjs14.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 +1 -1
- package/lib/index.cjs5.js.gz +0 -0
- package/lib/index.cjs6.js +1 -1
- package/lib/index.cjs7.js +1 -1
- package/lib/index.cjs8.js +1 -1
- package/lib/index.cjs9.js +1 -1
- package/lib/index.es.js +8 -9
- package/lib/index.es11.js +454 -15
- package/lib/index.es11.js.gz +0 -0
- package/lib/index.es12.js +226 -405
- package/lib/index.es13.js +29 -202
- package/lib/index.es14.js +19 -34
- package/lib/index.es2.js +4 -3
- package/lib/index.es3.js +2 -2
- package/lib/index.es4.js +3 -3
- package/lib/index.es5.js +1751 -34
- package/lib/index.es5.js.gz +0 -0
- package/lib/index.es6.js +35 -841
- package/lib/index.es6.js.gz +0 -0
- package/lib/index.es7.js +1 -1
- package/lib/index.es8.js +1 -1
- package/lib/index.es9.js +4 -125
- package/lib/theme.cjs.js +1 -1
- package/lib/theme.es.js +12 -13
- package/lib/translate.cjs.js +1 -1
- package/lib/translate.es.js +9 -10
- package/lib/utils.cjs.js +1 -1
- package/lib/utils.es.js +5 -4
- package/lib/yxIcon.cjs.js +1 -1
- package/lib/yxIcon.es.js +2 -2
- package/lib/yxi18n.cjs.js +1 -1
- package/lib/yxi18n.es.js +1 -1
- package/lib/yxuse.css +1 -1
- package/lib/yxuse.css.gz +0 -0
- package/package.json +1 -1
- package/types/components/CommonPage/index.d.ts +3 -0
- package/types/components/CommonPage/page.d.ts +64 -0
- package/types/components/CommonPage/pagination.d.ts +9 -0
- package/types/components/CommonPage/props.d.ts +36 -0
- package/types/components/CommonPage/search.d.ts +4 -0
- package/types/components/CommonPage/table.d.ts +3 -0
- package/types/components/CommonPage/type.d.ts +1 -0
- package/types/components/YxForm/index.vue.d.ts +1 -1
- package/types/components/YxForm/type.d.ts +14 -1
- package/types/components/YxNormalPage/config.d.ts +12 -0
- package/types/components/YxNormalPage/form.d.ts +7 -0
- package/types/components/YxNormalPage/index.d.ts +3 -0
- package/types/components/YxNormalPage/page.d.ts +83 -0
- package/types/components/YxNormalPage/pagination.d.ts +9 -0
- package/types/components/YxNormalPage/props.d.ts +40 -0
- package/types/components/YxNormalPage/search.d.ts +9 -0
- package/types/components/YxNormalPage/table.d.ts +5 -0
- package/types/components/YxNormalPage/type.d.ts +69 -0
- package/types/components/YxTable/index.vue.d.ts +4 -4
- package/types/components/YxTableBar/bar.d.ts +47 -0
- package/types/components/YxTableBar/config.d.ts +18 -0
- package/types/components/YxTableBar/index.d.ts +11 -0
- package/types/components/YxTableBar/props.d.ts +23 -0
- package/types/components/YxTableBar/type.d.ts +11 -0
- package/types/components/YxTablePro/index.d.ts +14 -14
- package/types/components/YxUpload/index.vue.d.ts +3 -3
- package/types/components/Yxbutton/index.vue.d.ts +6 -6
- package/types/components/index.d.ts +2 -0
- package/types/hooks/useConfirm/index.d.ts +1 -1
- package/types/hooks/useDialog/type.d.ts +1 -1
- package/types/theme/config.d.ts +1 -1
- package/types/theme/index.d.ts +1 -1
- package/types/utils/common/index.d.ts +7 -1
- package/types/utils/common/util.d.ts +1 -1
- package/types/utils/excel/index.d.ts +8 -8
- package/types/utils/http/index.d.ts +8 -0
- package/types/utils/subscribe/index.d.ts +1 -1
- package/lib/index.cjs15.js +0 -1
- package/lib/index.cjs6.js.gz +0 -0
- package/lib/index.es12.js.gz +0 -0
- package/lib/index.es15.js +0 -22
package/lib/index.es6.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent, reactive, resolveComponent, createBlock, openBlock, createSlots, withCtx, createVNode, renderSlot, createElementVNode, createTextVNode,
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent, reactive, resolveComponent, createBlock, openBlock, createSlots, withCtx, createVNode, renderSlot, createElementVNode, createTextVNode, createElementBlock, toDisplayString, Fragment, renderList, unref, normalizeStyle, useAttrs, useSlots, ref, resolveDynamicComponent, mergeProps, normalizeClass, createCommentVNode, version, createApp } from "vue";
|
|
2
|
+
import { _ as _export_sfc, T as Toolbar, f as _sfc_main$6, Y as YxForm, p as page, g as _sfc_main$7, h as YxTableBar, i as YxTablePro } from "./index.es5.js";
|
|
3
|
+
import "xlsx";
|
|
3
4
|
import "./vendor-file-saver.es.js";
|
|
4
5
|
import "xlsx-js-style";
|
|
5
|
-
import
|
|
6
|
-
import { _ as _export_sfc, T as Toolbar, Y as YxTablePro } from "./index.es5.js";
|
|
6
|
+
import "./vendor-sortablejs.es.js";
|
|
7
7
|
import { genFileId } from "element-plus";
|
|
8
|
-
import { j as jumpToHome, b as getUserConfig } from "./index.
|
|
8
|
+
import { j as jumpToHome, b as getUserConfig } from "./index.es11.js";
|
|
9
9
|
import "element-plus/es/components/message/style/index";
|
|
10
10
|
import "element-plus/es/components/message-box/style/index";
|
|
11
11
|
import "./vendor-dayjs.es.js";
|
|
@@ -13,11 +13,11 @@ import "element-plus/es/components/loading/style/index";
|
|
|
13
13
|
import "element-plus/es/components/message/style/css";
|
|
14
14
|
import "element-plus/es/components/loading/style/css";
|
|
15
15
|
import "./vendor-mqtt.es.js";
|
|
16
|
-
import { u as uploadResourceApi } from "./index.
|
|
16
|
+
import { u as uploadResourceApi } from "./index.es14.js";
|
|
17
17
|
import { s as setGlobalSystemConfig, g as getGlobalSystemConfig } from "./index.es4.js";
|
|
18
|
-
import { y as yxSubscribe } from "./index.
|
|
19
|
-
const _hoisted_1$
|
|
20
|
-
const _sfc_main$
|
|
18
|
+
import { y as yxSubscribe } from "./index.es13.js";
|
|
19
|
+
const _hoisted_1$3 = { class: "dialog-footer flex justify-end" };
|
|
20
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
21
21
|
__name: "index",
|
|
22
22
|
setup(__props, { expose: __expose }) {
|
|
23
23
|
const dialogOptions = reactive({
|
|
@@ -88,7 +88,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
88
88
|
dialogOptions.showFooter ? {
|
|
89
89
|
name: "footer",
|
|
90
90
|
fn: withCtx(() => [
|
|
91
|
-
createElementVNode("span", _hoisted_1$
|
|
91
|
+
createElementVNode("span", _hoisted_1$3, [
|
|
92
92
|
createVNode(_component_el_button, {
|
|
93
93
|
plain: "",
|
|
94
94
|
onClick: _cache[0] || (_cache[0] = ($event) => dialogOptions.show = false)
|
|
@@ -115,8 +115,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
|
-
const _hoisted_1$
|
|
119
|
-
const _sfc_main$
|
|
118
|
+
const _hoisted_1$2 = { class: "dialog-footer flex justify-end" };
|
|
119
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
120
120
|
__name: "index",
|
|
121
121
|
setup(__props, { expose: __expose }) {
|
|
122
122
|
const drawerOptions = reactive({
|
|
@@ -181,7 +181,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
181
181
|
drawerOptions.showFooter ? {
|
|
182
182
|
name: "footer",
|
|
183
183
|
fn: withCtx(() => [
|
|
184
|
-
createElementVNode("span", _hoisted_1$
|
|
184
|
+
createElementVNode("span", _hoisted_1$2, [
|
|
185
185
|
createVNode(_component_el_button, {
|
|
186
186
|
plain: "",
|
|
187
187
|
onClick: _cache[0] || (_cache[0] = ($event) => drawerOptions.show = false)
|
|
@@ -208,755 +208,6 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
210
|
});
|
|
211
|
-
const exportToExcel = ({ header, tableData, fileName }) => {
|
|
212
|
-
const tHeader = header.map((col) => col.label);
|
|
213
|
-
const data = tableData.map((row) => {
|
|
214
|
-
return header.map((col) => row[col.prop]);
|
|
215
|
-
});
|
|
216
|
-
const finalData = [tHeader, ...data];
|
|
217
|
-
const ws = XLSX.utils.aoa_to_sheet(finalData);
|
|
218
|
-
const wb = XLSX.utils.book_new();
|
|
219
|
-
XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
|
|
220
|
-
XLSX.writeFile(wb, `${fileName}.xlsx`);
|
|
221
|
-
};
|
|
222
|
-
function _isSlot$1(s) {
|
|
223
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
224
|
-
}
|
|
225
|
-
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
226
|
-
...{
|
|
227
|
-
name: "YxTable",
|
|
228
|
-
inheritAttrs: false
|
|
229
|
-
},
|
|
230
|
-
__name: "index",
|
|
231
|
-
props: {
|
|
232
|
-
tableData: {},
|
|
233
|
-
rowKey: {
|
|
234
|
-
default: "id"
|
|
235
|
-
},
|
|
236
|
-
columns: {},
|
|
237
|
-
pageInfo: {},
|
|
238
|
-
sort: {
|
|
239
|
-
type: Boolean
|
|
240
|
-
},
|
|
241
|
-
config: {
|
|
242
|
-
default: () => ({
|
|
243
|
-
headerOverflowHide: true
|
|
244
|
-
})
|
|
245
|
-
},
|
|
246
|
-
sortHandle: {}
|
|
247
|
-
},
|
|
248
|
-
emits: ["operate-handle", "sort-end", "update-page"],
|
|
249
|
-
setup(__props, {
|
|
250
|
-
expose: __expose,
|
|
251
|
-
emit: __emit
|
|
252
|
-
}) {
|
|
253
|
-
const props = __props;
|
|
254
|
-
const slots = useSlots();
|
|
255
|
-
const attrs = useAttrs();
|
|
256
|
-
const tableRef = ref();
|
|
257
|
-
const tableFormRef = ref();
|
|
258
|
-
const columns = ref([]);
|
|
259
|
-
const isFormTable = ref(false);
|
|
260
|
-
const formTableRules = ref({});
|
|
261
|
-
const emit = __emit;
|
|
262
|
-
onMounted(() => {
|
|
263
|
-
nextTick(() => {
|
|
264
|
-
startSort();
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
watch(() => props.columns, () => {
|
|
268
|
-
initTable();
|
|
269
|
-
});
|
|
270
|
-
onBeforeMount(async () => {
|
|
271
|
-
await initTable();
|
|
272
|
-
});
|
|
273
|
-
const initTable = async () => {
|
|
274
|
-
columns.value = typeof props.columns === "function" ? await props.columns() : props.columns;
|
|
275
|
-
columns.value.forEach((col) => {
|
|
276
|
-
var _a, _b;
|
|
277
|
-
if (col.required || ((_a = col.rules) == null ? void 0 : _a.length)) {
|
|
278
|
-
isFormTable.value = true;
|
|
279
|
-
}
|
|
280
|
-
if ((col == null ? void 0 : col.renderType) && ["select", "cascader"].includes(col == null ? void 0 : col.renderType) && ((_b = col == null ? void 0 : col.config) == null ? void 0 : _b.loadOptions)) {
|
|
281
|
-
loadOptions(col.config);
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
if (isFormTable.value) {
|
|
285
|
-
getRules();
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
const loadOptions = async (config) => {
|
|
289
|
-
if ((config == null ? void 0 : config.options) && (config == null ? void 0 : config.options.length) === 0 && (config == null ? void 0 : config.loadOptions) && typeof (config == null ? void 0 : config.loadOptions) === "function") {
|
|
290
|
-
config.options = await (config == null ? void 0 : config.loadOptions());
|
|
291
|
-
}
|
|
292
|
-
};
|
|
293
|
-
const startSort = () => {
|
|
294
|
-
var _a, _b;
|
|
295
|
-
if (!props.sort) return;
|
|
296
|
-
const sortDom = (_b = (_a = tableRef.value) == null ? void 0 : _a.$el) == null ? void 0 : _b.querySelector(".el-table__body tbody");
|
|
297
|
-
Sortable.create(sortDom, {
|
|
298
|
-
animation: 200,
|
|
299
|
-
// group: "el-table__row table-row",
|
|
300
|
-
sort: true,
|
|
301
|
-
handle: props.sortHandle ? `.${props.sortHandle}` : null,
|
|
302
|
-
onEnd: ({
|
|
303
|
-
oldIndex,
|
|
304
|
-
newIndex
|
|
305
|
-
}) => {
|
|
306
|
-
emit("sort-end", oldIndex, newIndex);
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
};
|
|
310
|
-
const dynamicComponent = (column, {
|
|
311
|
-
$index,
|
|
312
|
-
row
|
|
313
|
-
}) => {
|
|
314
|
-
let _slot;
|
|
315
|
-
const {
|
|
316
|
-
renderType,
|
|
317
|
-
event = {},
|
|
318
|
-
prop,
|
|
319
|
-
label,
|
|
320
|
-
config = {},
|
|
321
|
-
required,
|
|
322
|
-
rules
|
|
323
|
-
} = column;
|
|
324
|
-
if (!prop || !renderType) return null;
|
|
325
|
-
const Component = resolveComponent("el-" + renderType);
|
|
326
|
-
const {
|
|
327
|
-
options = [],
|
|
328
|
-
...restConfig
|
|
329
|
-
} = config;
|
|
330
|
-
const renderChildComponent = () => {
|
|
331
|
-
if (!options || options.length === 0) return null;
|
|
332
|
-
if (renderType === "select") {
|
|
333
|
-
return options.map((item) => createVNode(resolveComponent("el-option"), {
|
|
334
|
-
"label": item.label,
|
|
335
|
-
"value": item.value,
|
|
336
|
-
"key": item.value
|
|
337
|
-
}, null));
|
|
338
|
-
}
|
|
339
|
-
if (renderType === "radio-group") {
|
|
340
|
-
return options.map((item) => createVNode(resolveComponent("el-radio"), {
|
|
341
|
-
"label": item.value,
|
|
342
|
-
"key": item.value
|
|
343
|
-
}, {
|
|
344
|
-
default: () => [item.label]
|
|
345
|
-
}));
|
|
346
|
-
}
|
|
347
|
-
return null;
|
|
348
|
-
};
|
|
349
|
-
if (renderType === "cascader") {
|
|
350
|
-
return createVNode(resolveComponent("el-cascader"), mergeProps({
|
|
351
|
-
"modelValue": row[prop],
|
|
352
|
-
"onUpdate:modelValue": ($event) => row[prop] = $event,
|
|
353
|
-
"placeholder": `请选择${label}`,
|
|
354
|
-
"options": options
|
|
355
|
-
}, event, restConfig), null);
|
|
356
|
-
}
|
|
357
|
-
const isSelect = ["select", "cascader"].includes(renderType);
|
|
358
|
-
const isFormCell = required || (rules == null ? void 0 : rules.length);
|
|
359
|
-
const modelValue = row[prop];
|
|
360
|
-
const updateModelValue = (val) => {
|
|
361
|
-
row[prop] = (config == null ? void 0 : config.type) === "number" ? Number(val) : val;
|
|
362
|
-
};
|
|
363
|
-
const component = createVNode(Component, mergeProps({
|
|
364
|
-
"modelValue": modelValue,
|
|
365
|
-
"onUpdate:modelValue": updateModelValue,
|
|
366
|
-
"placeholder": `请${isSelect ? "选择" : "输入"}${label}`
|
|
367
|
-
}, event, restConfig), _isSlot$1(_slot = renderChildComponent()) ? _slot : {
|
|
368
|
-
default: () => [_slot]
|
|
369
|
-
});
|
|
370
|
-
if (!isFormCell) return component;
|
|
371
|
-
return renderForm(prop, $index, component);
|
|
372
|
-
};
|
|
373
|
-
const renderForm = (prop, index2, component) => {
|
|
374
|
-
return createVNode(resolveComponent("el-form-item"), {
|
|
375
|
-
"prop": "tableData." + index2 + "." + prop,
|
|
376
|
-
"rules": formTableRules.value[prop]
|
|
377
|
-
}, _isSlot$1(component) ? component : {
|
|
378
|
-
default: () => [component]
|
|
379
|
-
});
|
|
380
|
-
};
|
|
381
|
-
const getRules = () => {
|
|
382
|
-
const rules = {};
|
|
383
|
-
if (!isFormTable.value) return;
|
|
384
|
-
const handleRule = (item) => {
|
|
385
|
-
if (!item.prop) return;
|
|
386
|
-
const isSelect = (item == null ? void 0 : item.renderType) && ["select", "cascader"].includes(item == null ? void 0 : item.renderType);
|
|
387
|
-
const defaultRule = {
|
|
388
|
-
required: true,
|
|
389
|
-
message: `${item.label ?? "该字段"}不能为空`,
|
|
390
|
-
trigger: isSelect ? "change" : "blur"
|
|
391
|
-
};
|
|
392
|
-
if (item.required) {
|
|
393
|
-
rules[item.prop] = [defaultRule];
|
|
394
|
-
}
|
|
395
|
-
if (item.rules && item.rules.length > 0) {
|
|
396
|
-
rules[item.prop] = [...rules[item == null ? void 0 : item.prop] || [], ...item.rules];
|
|
397
|
-
}
|
|
398
|
-
};
|
|
399
|
-
columns.value.filter((cell) => ((cell == null ? void 0 : cell.renderType) || (cell == null ? void 0 : cell.render)) && ((cell == null ? void 0 : cell.required) || (cell == null ? void 0 : cell.rules))).forEach((form) => {
|
|
400
|
-
var _a;
|
|
401
|
-
(_a = form.children) == null ? void 0 : _a.forEach(handleRule);
|
|
402
|
-
handleRule(form);
|
|
403
|
-
});
|
|
404
|
-
formTableRules.value = rules;
|
|
405
|
-
};
|
|
406
|
-
const tableFormValidate = async () => {
|
|
407
|
-
if (!isFormTable.value) return Promise.resolve(true);
|
|
408
|
-
if (!tableFormRef.value) return Promise.resolve(false);
|
|
409
|
-
return await tableFormRef.value.validate(() => Promise.resolve());
|
|
410
|
-
};
|
|
411
|
-
const observeWeakMap = /* @__PURE__ */ new WeakMap();
|
|
412
|
-
const vAutoTooltip = {
|
|
413
|
-
mounted(el, binding) {
|
|
414
|
-
const observer = new IntersectionObserver((entries) => {
|
|
415
|
-
entries.forEach((entry) => {
|
|
416
|
-
if (entry.isIntersecting) {
|
|
417
|
-
requestAnimationFrame(() => {
|
|
418
|
-
const styles = getComputedStyle(entry.target);
|
|
419
|
-
const height = parseFloat(styles.height);
|
|
420
|
-
const lineHeight = parseFloat(styles.lineHeight);
|
|
421
|
-
const isOverflow = Number(height) > Number(lineHeight);
|
|
422
|
-
if (isOverflow) {
|
|
423
|
-
const item = columns.value.find((item2) => item2.prop === binding.value);
|
|
424
|
-
if (item) {
|
|
425
|
-
item.headerTooltip = isOverflow;
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
});
|
|
432
|
-
observer.observe(el);
|
|
433
|
-
observeWeakMap.set(el, observer);
|
|
434
|
-
},
|
|
435
|
-
unmounted(el) {
|
|
436
|
-
const observer = observeWeakMap.get(el);
|
|
437
|
-
if (observer) {
|
|
438
|
-
observer.disconnect();
|
|
439
|
-
observeWeakMap.delete(el);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
};
|
|
443
|
-
const render2 = (props2) => {
|
|
444
|
-
let _slot2;
|
|
445
|
-
const {
|
|
446
|
-
rowKey,
|
|
447
|
-
tableData,
|
|
448
|
-
pageInfo
|
|
449
|
-
} = props2;
|
|
450
|
-
const columnSlots = (cell, scope) => {
|
|
451
|
-
var _a;
|
|
452
|
-
return cell.slotName && ((_a = slots[cell.slotName]) == null ? void 0 : _a.call(slots, scope));
|
|
453
|
-
};
|
|
454
|
-
const renderColumn = (columns2) => {
|
|
455
|
-
return columns2.filter((cell) => !cell.show || cell.show(cell)).map((cell, index2) => {
|
|
456
|
-
const {
|
|
457
|
-
children,
|
|
458
|
-
...cellConf
|
|
459
|
-
} = cell;
|
|
460
|
-
return createVNode(resolveComponent("el-table-column"), cellConf, {
|
|
461
|
-
default: (scope) => {
|
|
462
|
-
if ((cell == null ? void 0 : cell.renderType) === "operate") return renderOperate(cell, scope);
|
|
463
|
-
if ((cell == null ? void 0 : cell.renderType) && (cell == null ? void 0 : cell.renderType) !== "operate") {
|
|
464
|
-
return dynamicComponent(cell, scope);
|
|
465
|
-
}
|
|
466
|
-
if (cell == null ? void 0 : cell.render) {
|
|
467
|
-
const renderResult = cell.render(scope.row, scope.$index, cell);
|
|
468
|
-
const needsValidation = cell.required || cell.rules;
|
|
469
|
-
const isFragment = ["symbol", "object"].includes(typeof (renderResult == null ? void 0 : renderResult.type));
|
|
470
|
-
if (needsValidation && isFragment) {
|
|
471
|
-
return renderForm(cell.prop, scope.$index, renderResult);
|
|
472
|
-
}
|
|
473
|
-
return renderResult;
|
|
474
|
-
}
|
|
475
|
-
if (children && (children == null ? void 0 : children.length) > 0) return renderColumn(children);
|
|
476
|
-
if (cell == null ? void 0 : cell.tooltip) {
|
|
477
|
-
return createVNode(resolveComponent("el-tooltip"), {
|
|
478
|
-
"content": scope.row[scope.column.property]
|
|
479
|
-
}, {
|
|
480
|
-
default: () => [createVNode("span", {
|
|
481
|
-
"class": "truncate"
|
|
482
|
-
}, [scope.row[scope.column.property]])]
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
return (cell == null ? void 0 : cell.slotName) && columnSlots(cell, scope);
|
|
486
|
-
},
|
|
487
|
-
header: (scope) => {
|
|
488
|
-
var _a, _b;
|
|
489
|
-
if (cell == null ? void 0 : cell.headerRender) return cell == null ? void 0 : cell.headerRender(scope.row);
|
|
490
|
-
if (cell == null ? void 0 : cell.headerSlotName) return (_a = slots[cell == null ? void 0 : cell.headerSlotName]) == null ? void 0 : _a.call(slots, scope);
|
|
491
|
-
if (attrs.border) {
|
|
492
|
-
return createVNode("span", null, [scope == null ? void 0 : scope.column.label]);
|
|
493
|
-
}
|
|
494
|
-
if (cell.headerTooltip) {
|
|
495
|
-
return createVNode(resolveComponent("el-tooltip"), {
|
|
496
|
-
"content": (_b = scope == null ? void 0 : scope.column) == null ? void 0 : _b.label,
|
|
497
|
-
"placement": "top"
|
|
498
|
-
}, {
|
|
499
|
-
default: () => {
|
|
500
|
-
var _a2;
|
|
501
|
-
return [createVNode("span", {
|
|
502
|
-
"class": `${cell.required ? "required" : ""} truncate`
|
|
503
|
-
}, [(_a2 = scope == null ? void 0 : scope.column) == null ? void 0 : _a2.label])];
|
|
504
|
-
}
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
|
-
return withDirectives(createVNode("div", {
|
|
508
|
-
"class": cell.required ? "required" : ""
|
|
509
|
-
}, [scope == null ? void 0 : scope.column.label]), [[vAutoTooltip, cell.prop]]);
|
|
510
|
-
}
|
|
511
|
-
});
|
|
512
|
-
});
|
|
513
|
-
};
|
|
514
|
-
const renderOperate = (cell, scope) => {
|
|
515
|
-
var _a, _b;
|
|
516
|
-
return createVNode("div", {
|
|
517
|
-
"class": `flex justify-center items-center cursor-pointer gap-10 ${((_a = cell.config) == null ? void 0 : _a.className) ?? ""}`
|
|
518
|
-
}, [(_b = cell.operate) == null ? void 0 : _b.filter((op) => !op.show || op.show(scope.row)).map((op) => {
|
|
519
|
-
if (op == null ? void 0 : op.render) return op.render(scope.row, scope.$index);
|
|
520
|
-
const disabled = typeof (op == null ? void 0 : op.disabled) === "function" ? op.disabled(scope.row, scope.$index) : (op == null ? void 0 : op.disabled) ?? false;
|
|
521
|
-
return createVNode("span", {
|
|
522
|
-
"onClick": withModifiers(() => {
|
|
523
|
-
if (!disabled) {
|
|
524
|
-
(op == null ? void 0 : op.onClick) && (op == null ? void 0 : op.onClick(scope.row));
|
|
525
|
-
emit("operate-handle", op.key, scope.row, scope.$index);
|
|
526
|
-
}
|
|
527
|
-
}, ["stop"]),
|
|
528
|
-
"class": `table-handle whitespace-nowrap ${(op == null ? void 0 : op.className) ?? ""} ${disabled ? "table-handle-disabled" : ""}`
|
|
529
|
-
}, [op.label]);
|
|
530
|
-
})]);
|
|
531
|
-
};
|
|
532
|
-
const pagination = () => {
|
|
533
|
-
if (!pageInfo) return null;
|
|
534
|
-
const handleSizeChange = (e) => {
|
|
535
|
-
emit("update-page", "pageSize", e);
|
|
536
|
-
};
|
|
537
|
-
const handleCurrentChange = (e) => {
|
|
538
|
-
emit("update-page", "pageIndex", e);
|
|
539
|
-
};
|
|
540
|
-
return createVNode("div", {
|
|
541
|
-
"class": "pagination-wrap"
|
|
542
|
-
}, [createVNode(resolveComponent("el-pagination"), {
|
|
543
|
-
"currentPage": pageInfo.pageIndex,
|
|
544
|
-
"onUpdate:currentPage": ($event) => pageInfo.pageIndex = $event,
|
|
545
|
-
"pageSize": pageInfo.pageSize,
|
|
546
|
-
"onUpdate:pageSize": ($event) => pageInfo.pageSize = $event,
|
|
547
|
-
"small": false,
|
|
548
|
-
"disabled": false,
|
|
549
|
-
"page-sizes": pageInfo.sizes ?? [10, 20, 50, 100],
|
|
550
|
-
"layout": (pageInfo == null ? void 0 : pageInfo.layout) ? pageInfo == null ? void 0 : pageInfo.layout : "total,sizes,prev, pager, next",
|
|
551
|
-
"background": false,
|
|
552
|
-
"total": pageInfo.total,
|
|
553
|
-
"onSizeChange": handleSizeChange,
|
|
554
|
-
"onCurrentChange": handleCurrentChange
|
|
555
|
-
}, null)]);
|
|
556
|
-
};
|
|
557
|
-
if (!columns.value) return;
|
|
558
|
-
return createVNode(Fragment, null, [isFormTable.value ? createVNode(resolveComponent("el-form"), {
|
|
559
|
-
"model": props2,
|
|
560
|
-
"ref": tableFormRef
|
|
561
|
-
}, _isSlot$1(_slot2 = renderTable()) ? _slot2 : {
|
|
562
|
-
default: () => [_slot2]
|
|
563
|
-
}) : renderTable(), pagination()]);
|
|
564
|
-
function renderTable() {
|
|
565
|
-
let _slot3;
|
|
566
|
-
return createVNode(resolveComponent("el-table"), mergeProps({
|
|
567
|
-
"ref": tableRef
|
|
568
|
-
}, attrs, {
|
|
569
|
-
"row-key": rowKey,
|
|
570
|
-
"data": tableData
|
|
571
|
-
}), _isSlot$1(_slot3 = renderColumn(columns.value)) ? _slot3 : {
|
|
572
|
-
default: () => [_slot3]
|
|
573
|
-
});
|
|
574
|
-
}
|
|
575
|
-
};
|
|
576
|
-
const exportDataToExcel = (fileName) => {
|
|
577
|
-
const header = columns.value.filter((cell) => cell.prop);
|
|
578
|
-
const tableData = props.tableData;
|
|
579
|
-
exportToExcel({
|
|
580
|
-
header,
|
|
581
|
-
tableData,
|
|
582
|
-
fileName: fileName || Date.now()
|
|
583
|
-
});
|
|
584
|
-
};
|
|
585
|
-
const updateColumns = async (newColumns) => {
|
|
586
|
-
if (!columns.value) return;
|
|
587
|
-
columns.value = typeof newColumns === "function" ? await newColumns() : newColumns;
|
|
588
|
-
};
|
|
589
|
-
__expose({
|
|
590
|
-
tableRef,
|
|
591
|
-
exportDataToExcel,
|
|
592
|
-
updateColumns,
|
|
593
|
-
tableFormValidate
|
|
594
|
-
});
|
|
595
|
-
return (_ctx, _cache) => {
|
|
596
|
-
return openBlock(), createBlock(resolveDynamicComponent(render2(props)));
|
|
597
|
-
};
|
|
598
|
-
}
|
|
599
|
-
});
|
|
600
|
-
const _hoisted_1$2 = {
|
|
601
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
602
|
-
viewBox: "0 0 1024 1024"
|
|
603
|
-
};
|
|
604
|
-
function render(_ctx, _cache) {
|
|
605
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$2, _cache[0] || (_cache[0] = [
|
|
606
|
-
createElementVNode("path", {
|
|
607
|
-
fill: "currentColor",
|
|
608
|
-
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"
|
|
609
|
-
}, null, -1)
|
|
610
|
-
]));
|
|
611
|
-
}
|
|
612
|
-
const Question = { render };
|
|
613
|
-
function _isSlot(s) {
|
|
614
|
-
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
615
|
-
}
|
|
616
|
-
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
617
|
-
...{
|
|
618
|
-
name: "YxForm"
|
|
619
|
-
},
|
|
620
|
-
__name: "index",
|
|
621
|
-
props: {
|
|
622
|
-
formParams: {},
|
|
623
|
-
formList: {},
|
|
624
|
-
formLayout: {
|
|
625
|
-
default: "horizontal"
|
|
626
|
-
},
|
|
627
|
-
formStyle: {
|
|
628
|
-
default: () => ({
|
|
629
|
-
row: 3,
|
|
630
|
-
gap: "15px",
|
|
631
|
-
labelWidth: "100px",
|
|
632
|
-
alignItems: "start"
|
|
633
|
-
})
|
|
634
|
-
},
|
|
635
|
-
rules: {}
|
|
636
|
-
},
|
|
637
|
-
setup(__props, {
|
|
638
|
-
expose: __expose
|
|
639
|
-
}) {
|
|
640
|
-
const formData = ref({});
|
|
641
|
-
const formRules = ref({});
|
|
642
|
-
const formColumn = ref([]);
|
|
643
|
-
const attrs = useAttrs();
|
|
644
|
-
const props = __props;
|
|
645
|
-
const isOptionsComponent = (type) => type && ["select", "cascader"].includes(type);
|
|
646
|
-
const initForm = async () => {
|
|
647
|
-
var _a;
|
|
648
|
-
const {
|
|
649
|
-
formList,
|
|
650
|
-
formParams
|
|
651
|
-
} = props;
|
|
652
|
-
formColumn.value = typeof formList === "function" ? await formList() : formList;
|
|
653
|
-
if (!Array.isArray(formColumn.value) || formColumn.value.length === 0) {
|
|
654
|
-
return;
|
|
655
|
-
}
|
|
656
|
-
const initialData = {};
|
|
657
|
-
const fillFormData = (item) => {
|
|
658
|
-
if (item.prop && !(item.prop in initialData)) {
|
|
659
|
-
initialData[item.prop] = void 0;
|
|
660
|
-
}
|
|
661
|
-
if (isOptionsComponent(item == null ? void 0 : item.renderType)) {
|
|
662
|
-
loadOptions(item);
|
|
663
|
-
}
|
|
664
|
-
if (Array.isArray(item.children)) {
|
|
665
|
-
item.children.forEach(fillFormData);
|
|
666
|
-
}
|
|
667
|
-
handleLinkOptions(item);
|
|
668
|
-
};
|
|
669
|
-
formColumn.value.forEach((item) => fillFormData(item));
|
|
670
|
-
if (formParams && Object.keys(formParams).length > 0) {
|
|
671
|
-
if (hasLoadOptions()) {
|
|
672
|
-
for (const item of formColumn.value) {
|
|
673
|
-
if (!item.prop) continue;
|
|
674
|
-
const isAsyncOption = ((_a = item.config) == null ? void 0 : _a.loadOptions) && typeof item.config.loadOptions === "function";
|
|
675
|
-
if (!(isAsyncOption && formParams[item.prop] !== void 0)) {
|
|
676
|
-
formData.value[item.prop] = formParams[item.prop];
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
} else {
|
|
680
|
-
formData.value = formParams;
|
|
681
|
-
}
|
|
682
|
-
} else {
|
|
683
|
-
formData.value = initialData;
|
|
684
|
-
}
|
|
685
|
-
};
|
|
686
|
-
const handleLinkOptions = (item) => {
|
|
687
|
-
var _a, _b;
|
|
688
|
-
if (!((_a = item.config) == null ? void 0 : _a.linkOptions) || (item == null ? void 0 : item._linkedHandled)) return;
|
|
689
|
-
const linkOptions = item.config.linkOptions;
|
|
690
|
-
const originOnChange = (_b = item.event) == null ? void 0 : _b.onChange;
|
|
691
|
-
const newOnChange = async (e) => {
|
|
692
|
-
var _a2;
|
|
693
|
-
const updateForm = formColumn.value.find((form) => (form == null ? void 0 : form.prop) === linkOptions);
|
|
694
|
-
if (!updateForm || !((_a2 = updateForm == null ? void 0 : updateForm.config) == null ? void 0 : _a2.loadOptions)) return;
|
|
695
|
-
const options = await updateForm.config.loadOptions(e);
|
|
696
|
-
updateForm.config.options = options;
|
|
697
|
-
if (typeof originOnChange === "function") {
|
|
698
|
-
originOnChange(e);
|
|
699
|
-
}
|
|
700
|
-
};
|
|
701
|
-
item.event = {
|
|
702
|
-
...item.event,
|
|
703
|
-
onChange: newOnChange
|
|
704
|
-
};
|
|
705
|
-
item._linkedHandled = true;
|
|
706
|
-
};
|
|
707
|
-
const hasLoadOptions = () => {
|
|
708
|
-
return formColumn.value.some((item) => {
|
|
709
|
-
var _a;
|
|
710
|
-
return ((_a = item.config) == null ? void 0 : _a.loadOptions) && typeof item.config.loadOptions === "function";
|
|
711
|
-
});
|
|
712
|
-
};
|
|
713
|
-
const loadOptions = async ({
|
|
714
|
-
config,
|
|
715
|
-
prop
|
|
716
|
-
}) => {
|
|
717
|
-
var _a;
|
|
718
|
-
if (!config || config.notAutoLoadOptions) return;
|
|
719
|
-
const {
|
|
720
|
-
loadOptions: loadOptions2,
|
|
721
|
-
options
|
|
722
|
-
} = config;
|
|
723
|
-
if (!options || typeof loadOptions2 !== "function") return;
|
|
724
|
-
const {
|
|
725
|
-
formParams
|
|
726
|
-
} = props;
|
|
727
|
-
const parentProp = (_a = formColumn.value.find((item) => {
|
|
728
|
-
var _a2;
|
|
729
|
-
return ((_a2 = item == null ? void 0 : item.config) == null ? void 0 : _a2.linkOptions) === prop;
|
|
730
|
-
})) == null ? void 0 : _a.prop;
|
|
731
|
-
const parentValue = parentProp ? formParams == null ? void 0 : formParams[parentProp] : void 0;
|
|
732
|
-
try {
|
|
733
|
-
config.options = await loadOptions2(parentValue);
|
|
734
|
-
if (prop && (formParams == null ? void 0 : formParams[prop])) {
|
|
735
|
-
formData.value[prop] = formParams[prop];
|
|
736
|
-
}
|
|
737
|
-
} catch (err) {
|
|
738
|
-
}
|
|
739
|
-
};
|
|
740
|
-
watch(() => props.formList, (formList) => {
|
|
741
|
-
if (formList.length > 0) {
|
|
742
|
-
initForm();
|
|
743
|
-
getRules();
|
|
744
|
-
}
|
|
745
|
-
});
|
|
746
|
-
watch(() => props.formParams, (formParams) => {
|
|
747
|
-
if (formParams) {
|
|
748
|
-
initForm();
|
|
749
|
-
}
|
|
750
|
-
});
|
|
751
|
-
const getRules = () => {
|
|
752
|
-
var _a;
|
|
753
|
-
const rules = {};
|
|
754
|
-
if (!((_a = formColumn.value) == null ? void 0 : _a.length)) return;
|
|
755
|
-
const handleRule = (item) => {
|
|
756
|
-
if (!item.prop) return;
|
|
757
|
-
const isSelect = (item == null ? void 0 : item.renderType) && ["select", "cascader"].includes(item == null ? void 0 : item.renderType);
|
|
758
|
-
const defaultRule = {
|
|
759
|
-
required: true,
|
|
760
|
-
message: `${item.label ?? "该字段"}不能为空`,
|
|
761
|
-
trigger: isSelect ? "change" : "blur"
|
|
762
|
-
};
|
|
763
|
-
if (item.required) {
|
|
764
|
-
rules[item.prop] = [defaultRule];
|
|
765
|
-
}
|
|
766
|
-
if (item.rules && item.rules.length > 0) {
|
|
767
|
-
rules[item.prop] = [...rules[item == null ? void 0 : item.prop] || [], ...item.rules];
|
|
768
|
-
}
|
|
769
|
-
};
|
|
770
|
-
formColumn.value.forEach((form) => {
|
|
771
|
-
var _a2;
|
|
772
|
-
(_a2 = form.children) == null ? void 0 : _a2.forEach(handleRule);
|
|
773
|
-
handleRule(form);
|
|
774
|
-
});
|
|
775
|
-
formRules.value = rules;
|
|
776
|
-
};
|
|
777
|
-
onBeforeMount(async () => {
|
|
778
|
-
if (props.formList) {
|
|
779
|
-
await initForm();
|
|
780
|
-
getRules();
|
|
781
|
-
}
|
|
782
|
-
});
|
|
783
|
-
onUnmounted(() => {
|
|
784
|
-
});
|
|
785
|
-
const formRef = ref();
|
|
786
|
-
const getFormStyle = () => {
|
|
787
|
-
const {
|
|
788
|
-
formStyle
|
|
789
|
-
} = props;
|
|
790
|
-
const {
|
|
791
|
-
row,
|
|
792
|
-
gap,
|
|
793
|
-
...style
|
|
794
|
-
} = formStyle;
|
|
795
|
-
return {
|
|
796
|
-
"grid-template-columns": `repeat(${row}, 1fr)`,
|
|
797
|
-
"grid-gap": gap,
|
|
798
|
-
...style
|
|
799
|
-
};
|
|
800
|
-
};
|
|
801
|
-
const getGroupStyle = (groupStyle) => {
|
|
802
|
-
if (!groupStyle) return {};
|
|
803
|
-
const {
|
|
804
|
-
row,
|
|
805
|
-
gap,
|
|
806
|
-
...style
|
|
807
|
-
} = groupStyle;
|
|
808
|
-
return {
|
|
809
|
-
"grid-template-columns": `repeat(${row}, 1fr)`,
|
|
810
|
-
"grid-gap": gap,
|
|
811
|
-
...style
|
|
812
|
-
};
|
|
813
|
-
};
|
|
814
|
-
const dynamicComponent = ({
|
|
815
|
-
renderType,
|
|
816
|
-
event,
|
|
817
|
-
prop,
|
|
818
|
-
label,
|
|
819
|
-
config
|
|
820
|
-
}) => {
|
|
821
|
-
let _slot;
|
|
822
|
-
if (!prop) return;
|
|
823
|
-
const {
|
|
824
|
-
options,
|
|
825
|
-
...conf
|
|
826
|
-
} = config || {};
|
|
827
|
-
if (renderType === "cascader") return createVNode(resolveComponent("el-cascader"), mergeProps(event, conf, {
|
|
828
|
-
"options": options,
|
|
829
|
-
"modelValue": formData.value[prop],
|
|
830
|
-
"onUpdate:modelValue": ($event) => formData.value[prop] = $event,
|
|
831
|
-
"placeholder": `请选择${label}`
|
|
832
|
-
}), null);
|
|
833
|
-
const Component = resolveComponent("el-" + renderType);
|
|
834
|
-
const renderChildComponent = () => {
|
|
835
|
-
if (renderType === "select" && (config == null ? void 0 : config.options)) {
|
|
836
|
-
return config == null ? void 0 : config.options.map((item) => createVNode(resolveComponent("el-option"), {
|
|
837
|
-
"label": item.label,
|
|
838
|
-
"value": item.value
|
|
839
|
-
}, null));
|
|
840
|
-
} else if (renderType === "radio-group" && (config == null ? void 0 : config.options)) {
|
|
841
|
-
return config == null ? void 0 : config.options.map((item) => createVNode(resolveComponent("el-radio"), {
|
|
842
|
-
"label": item.label,
|
|
843
|
-
"value": item.value
|
|
844
|
-
}, null));
|
|
845
|
-
} else {
|
|
846
|
-
return null;
|
|
847
|
-
}
|
|
848
|
-
};
|
|
849
|
-
const isSelect = renderType && ["select", "cascader"].includes(renderType);
|
|
850
|
-
return createVNode(Component, mergeProps(event, {
|
|
851
|
-
"placeholder": `请${isSelect ? "选择" : "输入"}${label}`
|
|
852
|
-
}, conf, {
|
|
853
|
-
"modelValue": formData.value[prop],
|
|
854
|
-
"onUpdate:modelValue": ($event) => formData.value[prop] = $event
|
|
855
|
-
}), _isSlot(_slot = renderChildComponent()) ? _slot : {
|
|
856
|
-
default: () => [_slot]
|
|
857
|
-
});
|
|
858
|
-
};
|
|
859
|
-
const render2 = (props2) => {
|
|
860
|
-
var _a;
|
|
861
|
-
let _slot2;
|
|
862
|
-
const {
|
|
863
|
-
formStyle,
|
|
864
|
-
formLayout
|
|
865
|
-
} = props2;
|
|
866
|
-
if (!((_a = formColumn.value) == null ? void 0 : _a.length)) return;
|
|
867
|
-
const slots = useSlots();
|
|
868
|
-
const formItemSlots = (form) => {
|
|
869
|
-
var _a2;
|
|
870
|
-
return form.slotName && ((_a2 = slots[form.slotName]) == null ? void 0 : _a2.call(slots, formData.value));
|
|
871
|
-
};
|
|
872
|
-
const renderFormItem = (formList) => {
|
|
873
|
-
const renderForm = (form) => {
|
|
874
|
-
const {
|
|
875
|
-
className,
|
|
876
|
-
...formProps
|
|
877
|
-
} = form;
|
|
878
|
-
return createVNode(resolveComponent("el-form-item"), mergeProps({
|
|
879
|
-
"class": `${formLayout === "vertical" ? "flex flex-col " : ""} ${(formStyle == null ? void 0 : formStyle.formItemClassName) ?? ""} ${className ?? ""} ${!form.label ? "no-label-item" : ""}`,
|
|
880
|
-
"prop": form.prop,
|
|
881
|
-
"labelWidth": formStyle == null ? void 0 : formStyle.labelWidth,
|
|
882
|
-
"key": form.prop
|
|
883
|
-
}, formProps), {
|
|
884
|
-
default: () => {
|
|
885
|
-
if (form == null ? void 0 : form.render) return form == null ? void 0 : form.render(formData.value);
|
|
886
|
-
if (form.renderType) return dynamicComponent(form);
|
|
887
|
-
return (form == null ? void 0 : form.slotName) && formItemSlots(form);
|
|
888
|
-
},
|
|
889
|
-
label: () => {
|
|
890
|
-
var _a2;
|
|
891
|
-
return form.label ? createVNode("div", {
|
|
892
|
-
"class": `flex items-center gap-5 ${form.labelClassName ?? ""}`
|
|
893
|
-
}, [form.label, form.promptConf ? createVNode(resolveComponent("el-tooltip"), (_a2 = form.promptConf) == null ? void 0 : _a2.tooltipConf, {
|
|
894
|
-
default: () => {
|
|
895
|
-
var _a3, _b;
|
|
896
|
-
return [createVNode(resolveComponent("el-icon"), {
|
|
897
|
-
"size": ((_a3 = form.promptConf) == null ? void 0 : _a3.size) ?? 15,
|
|
898
|
-
"color": (_b = form.promptConf) == null ? void 0 : _b.color
|
|
899
|
-
}, {
|
|
900
|
-
default: () => [createVNode(Question, null, null)]
|
|
901
|
-
})];
|
|
902
|
-
}
|
|
903
|
-
}) : ""]) : null;
|
|
904
|
-
}
|
|
905
|
-
});
|
|
906
|
-
};
|
|
907
|
-
return formList.filter((form) => !form.show || form.show(formData.value)).map((form) => {
|
|
908
|
-
if (form.children && form.children.length > 0) {
|
|
909
|
-
return createVNode("div", {
|
|
910
|
-
"class": `flex flex-col ${form.groupWrapClassName ?? ""}`,
|
|
911
|
-
"style": {
|
|
912
|
-
...form == null ? void 0 : form.groupWrapStyle
|
|
913
|
-
}
|
|
914
|
-
}, [createVNode("div", {
|
|
915
|
-
"class": form.groupTitleClassName ?? "",
|
|
916
|
-
"style": {
|
|
917
|
-
...form == null ? void 0 : form.groupTitleStyle
|
|
918
|
-
}
|
|
919
|
-
}, [form.groupName]), createVNode("div", {
|
|
920
|
-
"class": `grid ${form.groupClassName ?? ""}`,
|
|
921
|
-
"style": {
|
|
922
|
-
...getGroupStyle((form == null ? void 0 : form.groupStyle) ?? {})
|
|
923
|
-
}
|
|
924
|
-
}, [form.children.filter((form2) => !form2.show || form2.show(formData.value)).map((form2) => renderForm(form2))])]);
|
|
925
|
-
} else {
|
|
926
|
-
return renderForm(form);
|
|
927
|
-
}
|
|
928
|
-
});
|
|
929
|
-
};
|
|
930
|
-
return createVNode(Fragment, null, [createVNode(resolveComponent("el-form"), mergeProps({
|
|
931
|
-
"scroll-to-error": true,
|
|
932
|
-
"model": formData.value,
|
|
933
|
-
"rules": formRules.value,
|
|
934
|
-
"class": "grid",
|
|
935
|
-
"ref": formRef,
|
|
936
|
-
"validate-on-rule-change": false
|
|
937
|
-
}, attrs, {
|
|
938
|
-
"style": {
|
|
939
|
-
...getFormStyle()
|
|
940
|
-
}
|
|
941
|
-
}), _isSlot(_slot2 = renderFormItem(formColumn.value)) ? _slot2 : {
|
|
942
|
-
default: () => [_slot2]
|
|
943
|
-
})]);
|
|
944
|
-
};
|
|
945
|
-
const formValidate = async () => {
|
|
946
|
-
if (!formRef.value) return Promise.resolve(false);
|
|
947
|
-
return await formRef.value.validate(() => Promise.resolve());
|
|
948
|
-
};
|
|
949
|
-
__expose({
|
|
950
|
-
formData,
|
|
951
|
-
formValidate,
|
|
952
|
-
formRef
|
|
953
|
-
});
|
|
954
|
-
return (_ctx, _cache) => {
|
|
955
|
-
return openBlock(), createBlock(resolveDynamicComponent(render2(props)));
|
|
956
|
-
};
|
|
957
|
-
}
|
|
958
|
-
});
|
|
959
|
-
const index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-7611548b"]]);
|
|
960
211
|
let versionKey, curVersion, updateApp;
|
|
961
212
|
const updateSysVersion = () => {
|
|
962
213
|
localStorage.setItem(versionKey, curVersion);
|
|
@@ -975,7 +226,7 @@ const _hoisted_5 = { class: "update-title" };
|
|
|
975
226
|
const _hoisted_6 = { class: "update-item px-20" };
|
|
976
227
|
const _hoisted_7 = { class: "text-end" };
|
|
977
228
|
const _hoisted_8 = { class: "flex justify-end items-center mt-10" };
|
|
978
|
-
const _sfc_main$
|
|
229
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
979
230
|
__name: "index",
|
|
980
231
|
props: {
|
|
981
232
|
title: {},
|
|
@@ -1024,8 +275,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1024
275
|
};
|
|
1025
276
|
}
|
|
1026
277
|
});
|
|
1027
|
-
const Update = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1028
|
-
const _sfc_main$
|
|
278
|
+
const Update = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-ebf4f18f"]]);
|
|
279
|
+
const _sfc_main$2 = {
|
|
1029
280
|
props: {
|
|
1030
281
|
color: {
|
|
1031
282
|
type: String,
|
|
@@ -1045,8 +296,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1045
296
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1046
297
|
], 4);
|
|
1047
298
|
}
|
|
1048
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1049
|
-
const _sfc_main$
|
|
299
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-a90cbe2e"]]);
|
|
300
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1050
301
|
__name: "index",
|
|
1051
302
|
props: {
|
|
1052
303
|
uploadTips: {},
|
|
@@ -1106,7 +357,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1106
357
|
upload,
|
|
1107
358
|
getFileList
|
|
1108
359
|
});
|
|
1109
|
-
const
|
|
360
|
+
const render = (props2) => {
|
|
1110
361
|
const defaultTrigger = () => {
|
|
1111
362
|
return createVNode(resolveComponent("el-button"), null, {
|
|
1112
363
|
default: () => [props2.triggerText ?? "上传文件"]
|
|
@@ -1133,7 +384,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1133
384
|
})]);
|
|
1134
385
|
};
|
|
1135
386
|
return (_ctx, _cache) => {
|
|
1136
|
-
return openBlock(), createBlock(resolveDynamicComponent(
|
|
387
|
+
return openBlock(), createBlock(resolveDynamicComponent(render(props)), {
|
|
1137
388
|
"model-value": fileObsUrl.value
|
|
1138
389
|
}, null, 8, ["model-value"]);
|
|
1139
390
|
};
|
|
@@ -1145,7 +396,7 @@ const defaultCustomConfig = {
|
|
|
1145
396
|
height: "20px"
|
|
1146
397
|
}
|
|
1147
398
|
};
|
|
1148
|
-
const _sfc_main
|
|
399
|
+
const _sfc_main = {
|
|
1149
400
|
name: "LogoTitle",
|
|
1150
401
|
props: {
|
|
1151
402
|
showLogo: {
|
|
@@ -1212,7 +463,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1212
463
|
}, toDisplayString((_d = $data.customConfig) == null ? void 0 : _d.title), 5)) : createCommentVNode("", true)
|
|
1213
464
|
], 2);
|
|
1214
465
|
}
|
|
1215
|
-
const LogoTitle = /* @__PURE__ */ _export_sfc(_sfc_main
|
|
466
|
+
const LogoTitle = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-f9e99774"]]);
|
|
1216
467
|
class LogoTitleRender {
|
|
1217
468
|
constructor(props, domId = "system-logo-title") {
|
|
1218
469
|
this.render(props, domId);
|
|
@@ -1229,87 +480,30 @@ class LogoTitleRender {
|
|
|
1229
480
|
}
|
|
1230
481
|
}
|
|
1231
482
|
}
|
|
1232
|
-
function useEnterKey(callback) {
|
|
1233
|
-
const handleKeyUp = (event) => {
|
|
1234
|
-
if (event.key === "Enter") {
|
|
1235
|
-
callback();
|
|
1236
|
-
}
|
|
1237
|
-
};
|
|
1238
|
-
onMounted(() => {
|
|
1239
|
-
window.addEventListener("keyup", handleKeyUp);
|
|
1240
|
-
});
|
|
1241
|
-
onUnmounted(() => {
|
|
1242
|
-
window.removeEventListener("keyup", handleKeyUp);
|
|
1243
|
-
});
|
|
1244
|
-
onActivated(() => {
|
|
1245
|
-
window.addEventListener("keyup", handleKeyUp);
|
|
1246
|
-
});
|
|
1247
|
-
onDeactivated(() => {
|
|
1248
|
-
window.removeEventListener("keyup", handleKeyUp);
|
|
1249
|
-
});
|
|
1250
|
-
}
|
|
1251
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1252
|
-
__name: "index",
|
|
1253
|
-
props: {
|
|
1254
|
-
onClick: {},
|
|
1255
|
-
noLoading: { type: Boolean, default: false },
|
|
1256
|
-
enter: { type: Boolean, default: true }
|
|
1257
|
-
},
|
|
1258
|
-
setup(__props) {
|
|
1259
|
-
const props = __props;
|
|
1260
|
-
const loading = ref(false);
|
|
1261
|
-
const handleClick = async () => {
|
|
1262
|
-
if (props.onClick) {
|
|
1263
|
-
const result = props.onClick();
|
|
1264
|
-
if (result instanceof Promise && !props.noLoading) {
|
|
1265
|
-
try {
|
|
1266
|
-
loading.value = true;
|
|
1267
|
-
await result;
|
|
1268
|
-
} finally {
|
|
1269
|
-
loading.value = false;
|
|
1270
|
-
}
|
|
1271
|
-
}
|
|
1272
|
-
}
|
|
1273
|
-
};
|
|
1274
|
-
if (props.enter) {
|
|
1275
|
-
useEnterKey(handleClick);
|
|
1276
|
-
}
|
|
1277
|
-
return (_ctx, _cache) => {
|
|
1278
|
-
const _component_el_button = resolveComponent("el-button");
|
|
1279
|
-
return openBlock(), createBlock(_component_el_button, mergeProps({ loading: loading.value }, _ctx.$attrs, { onClick: handleClick }), {
|
|
1280
|
-
default: withCtx(() => [
|
|
1281
|
-
renderSlot(_ctx.$slots, "default")
|
|
1282
|
-
]),
|
|
1283
|
-
_: 3
|
|
1284
|
-
}, 16, ["loading"]);
|
|
1285
|
-
};
|
|
1286
|
-
}
|
|
1287
|
-
});
|
|
1288
483
|
const components2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1289
484
|
__proto__: null,
|
|
1290
485
|
LogoTitle,
|
|
1291
486
|
LogoTitleRender,
|
|
1292
487
|
Toolbar,
|
|
1293
488
|
Update,
|
|
1294
|
-
YxButton: _sfc_main,
|
|
1295
|
-
YxDialog: _sfc_main$
|
|
1296
|
-
YxDrawer: _sfc_main$
|
|
1297
|
-
YxForm
|
|
489
|
+
YxButton: _sfc_main$6,
|
|
490
|
+
YxDialog: _sfc_main$5,
|
|
491
|
+
YxDrawer: _sfc_main$4,
|
|
492
|
+
YxForm,
|
|
1298
493
|
YxIcon: index,
|
|
1299
|
-
|
|
494
|
+
YxNormalPage: page,
|
|
495
|
+
YxTable: _sfc_main$7,
|
|
496
|
+
YxTableBar,
|
|
1300
497
|
YxTablePro,
|
|
1301
|
-
YxUpload: _sfc_main$
|
|
498
|
+
YxUpload: _sfc_main$1
|
|
1302
499
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1303
500
|
export {
|
|
1304
501
|
LogoTitleRender as L,
|
|
1305
502
|
Update as U,
|
|
1306
|
-
_sfc_main$
|
|
1307
|
-
_sfc_main$
|
|
1308
|
-
_sfc_main$
|
|
503
|
+
_sfc_main$5 as _,
|
|
504
|
+
_sfc_main$4 as a,
|
|
505
|
+
_sfc_main$1 as b,
|
|
1309
506
|
components2 as c,
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
LogoTitle as f,
|
|
1313
|
-
_sfc_main as g,
|
|
1314
|
-
index$1 as i
|
|
507
|
+
LogoTitle as d,
|
|
508
|
+
index as i
|
|
1315
509
|
};
|