yxuse 3.0.59 → 3.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs12.js +1 -1
- package/lib/index.cjs12.js.gz +0 -0
- package/lib/index.cjs12.js.map +1 -1
- package/lib/index.cjs2.js +1 -1
- package/lib/index.cjs2.js.map +1 -1
- package/lib/index.cjs3.js +1 -1
- package/lib/index.cjs3.js.map +1 -1
- package/lib/index.cjs5.js +2 -2
- package/lib/index.cjs5.js.gz +0 -0
- package/lib/index.cjs5.js.map +1 -1
- package/lib/index.cjs6.js +3 -3
- package/lib/index.cjs6.js.gz +0 -0
- package/lib/index.cjs6.js.map +1 -1
- package/lib/index.cjs7.js +1 -16
- package/lib/index.cjs7.js.map +1 -1
- package/lib/index.es12.js +6 -0
- package/lib/index.es12.js.gz +0 -0
- package/lib/index.es12.js.map +1 -1
- package/lib/index.es2.js +1 -0
- package/lib/index.es2.js.map +1 -1
- package/lib/index.es3.js +1 -0
- package/lib/index.es3.js.map +1 -1
- package/lib/index.es5.js +9 -4
- package/lib/index.es5.js.gz +0 -0
- package/lib/index.es5.js.map +1 -1
- package/lib/index.es6.js +142 -76
- package/lib/index.es6.js.gz +0 -0
- package/lib/index.es6.js.map +1 -1
- package/lib/index.es7.js +1 -5361
- package/lib/index.es7.js.map +1 -1
- package/lib/mqtt.min.cjs.js +1 -1
- package/lib/mqtt.min.cjs.js.gz +0 -0
- package/lib/mqtt.min.cjs.js.map +1 -1
- package/lib/mqtt.min.es.js +2 -1
- package/lib/mqtt.min.es.js.gz +0 -0
- package/lib/mqtt.min.es.js.map +1 -1
- package/lib/style.css +1 -1
- package/lib/theme.cjs.js +1 -1
- package/lib/theme.es.js +4 -0
- package/lib/theme.es.js.map +1 -1
- package/lib/translate.cjs.js +1 -1
- package/lib/translate.es.js +6 -1
- package/lib/translate.es.js.map +1 -1
- package/lib/yxIcon.cjs.js +1 -1
- package/lib/yxIcon.es.js +1 -0
- package/lib/yxIcon.es.js.map +1 -1
- package/lib/yxi18n.cjs.js +1 -1
- package/lib/yxi18n.es.js +2 -1
- package/lib/yxi18n.es.js.map +1 -1
- package/package.json +4 -4
- package/types/components/YxTable/index.vue.d.ts +1 -0
- package/types/components/YxTable/type.d.ts +7 -1
- package/lib/index.cjs7.js.gz +0 -0
- package/lib/index.es7.js.gz +0 -0
- package/lib/style.css.gz +0 -0
package/lib/index.es6.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent, reactive, resolveComponent, createBlock, openBlock, createSlots, withCtx, renderSlot, createElementVNode, createVNode, createTextVNode,
|
|
1
|
+
import { defineComponent, reactive, resolveComponent, createBlock, openBlock, createSlots, withCtx, renderSlot, createElementVNode, createVNode, createTextVNode, useSlots, useAttrs, ref, onMounted, nextTick, watch, onBeforeMount, resolveDynamicComponent, Fragment, mergeProps, withModifiers, isVNode, createElementBlock, onUnmounted, toDisplayString, renderList, unref, normalizeStyle, normalizeClass, createCommentVNode, version, createApp } from "vue";
|
|
2
2
|
import { S as Sortable, _ as _export_sfc, T as Toolbar } from "./index.es5.js";
|
|
3
3
|
import { genFileId } from "element-plus";
|
|
4
4
|
import { j as jumpToHome, b as getUserConfig } from "./index.es12.js";
|
|
5
|
+
import "element-plus/es/components/message/style/index";
|
|
5
6
|
import { u as uploadResourceApi } from "./index.es13.js";
|
|
6
7
|
const _hoisted_1$4 = { class: "dialog-footer flex justify-end" };
|
|
7
|
-
const _sfc_main$
|
|
8
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
8
9
|
__name: "index",
|
|
9
10
|
setup(__props, { expose: __expose }) {
|
|
10
11
|
const dialogOptions = reactive({
|
|
@@ -97,7 +98,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
97
98
|
}
|
|
98
99
|
});
|
|
99
100
|
const _hoisted_1$3 = { class: "dialog-footer flex justify-end" };
|
|
100
|
-
const _sfc_main$
|
|
101
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
101
102
|
__name: "index",
|
|
102
103
|
setup(__props, { expose: __expose }) {
|
|
103
104
|
const drawerOptions = reactive({
|
|
@@ -189,51 +190,6 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
189
190
|
};
|
|
190
191
|
}
|
|
191
192
|
});
|
|
192
|
-
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
193
|
-
__name: "index",
|
|
194
|
-
props: {
|
|
195
|
-
conf: {},
|
|
196
|
-
model: {}
|
|
197
|
-
},
|
|
198
|
-
emits: ["change"],
|
|
199
|
-
setup(__props, { emit: __emit }) {
|
|
200
|
-
const props = __props;
|
|
201
|
-
const emit = __emit;
|
|
202
|
-
watch(
|
|
203
|
-
() => {
|
|
204
|
-
var _a;
|
|
205
|
-
return props.model[(_a = props.conf) == null ? void 0 : _a.prop];
|
|
206
|
-
},
|
|
207
|
-
() => {
|
|
208
|
-
emit("change", props.model);
|
|
209
|
-
}
|
|
210
|
-
);
|
|
211
|
-
return (_ctx, _cache) => {
|
|
212
|
-
var _a, _b, _c;
|
|
213
|
-
return openBlock(), createBlock(resolveDynamicComponent(`el-${(_a = _ctx.conf) == null ? void 0 : _a.renderType}`), mergeProps({
|
|
214
|
-
modelValue: _ctx.model[(_b = _ctx.conf) == null ? void 0 : _b.prop],
|
|
215
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => {
|
|
216
|
-
var _a2;
|
|
217
|
-
return _ctx.model[(_a2 = _ctx.conf) == null ? void 0 : _a2.prop] = $event;
|
|
218
|
-
})
|
|
219
|
-
}, (_c = _ctx.conf) == null ? void 0 : _c.config), {
|
|
220
|
-
default: withCtx(() => {
|
|
221
|
-
var _a2, _b2;
|
|
222
|
-
return [
|
|
223
|
-
_ctx.conf.renderType === "select" ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(((_b2 = (_a2 = _ctx.conf) == null ? void 0 : _a2.config) == null ? void 0 : _b2.options) ?? [], (op) => {
|
|
224
|
-
return openBlock(), createBlock(resolveDynamicComponent(`el-option`), {
|
|
225
|
-
key: op.value,
|
|
226
|
-
label: op.label,
|
|
227
|
-
value: op.value
|
|
228
|
-
}, null, 8, ["label", "value"]);
|
|
229
|
-
}), 128)) : createCommentVNode("", true)
|
|
230
|
-
];
|
|
231
|
-
}),
|
|
232
|
-
_: 1
|
|
233
|
-
}, 16, ["modelValue"]);
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
193
|
/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
|
238
194
|
var XLSX = {};
|
|
239
195
|
XLSX.version = "0.18.5";
|
|
@@ -20410,7 +20366,8 @@ function _isSlot$1(s) {
|
|
|
20410
20366
|
}
|
|
20411
20367
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
20412
20368
|
...{
|
|
20413
|
-
name: "YxTable"
|
|
20369
|
+
name: "YxTable",
|
|
20370
|
+
inheritAttrs: false
|
|
20414
20371
|
},
|
|
20415
20372
|
__name: "index",
|
|
20416
20373
|
props: {
|
|
@@ -20434,7 +20391,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20434
20391
|
const slots = useSlots();
|
|
20435
20392
|
const attrs = useAttrs();
|
|
20436
20393
|
const tableRef = ref();
|
|
20394
|
+
const tableFormRef = ref();
|
|
20437
20395
|
const columns = ref([]);
|
|
20396
|
+
const isFormTable = ref(false);
|
|
20397
|
+
const formTableRules = ref({});
|
|
20438
20398
|
const emit = __emit;
|
|
20439
20399
|
onMounted(() => {
|
|
20440
20400
|
nextTick(() => {
|
|
@@ -20450,12 +20410,18 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20450
20410
|
const initTable = async () => {
|
|
20451
20411
|
columns.value = typeof props.columns === "function" ? await props.columns() : props.columns;
|
|
20452
20412
|
columns.value.forEach((col) => {
|
|
20453
|
-
var _a;
|
|
20413
|
+
var _a, _b;
|
|
20454
20414
|
if (!col.renderType) return;
|
|
20455
20415
|
if (["select", "cascader"].includes(col.renderType) && ((_a = col == null ? void 0 : col.config) == null ? void 0 : _a.loadOptions)) {
|
|
20456
20416
|
loadOptions(col.config);
|
|
20457
20417
|
}
|
|
20418
|
+
if (col.required || ((_b = col.rules) == null ? void 0 : _b.length)) {
|
|
20419
|
+
isFormTable.value = true;
|
|
20420
|
+
}
|
|
20458
20421
|
});
|
|
20422
|
+
if (isFormTable.value) {
|
|
20423
|
+
getRules();
|
|
20424
|
+
}
|
|
20459
20425
|
};
|
|
20460
20426
|
const loadOptions = async (config) => {
|
|
20461
20427
|
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") {
|
|
@@ -20479,8 +20445,107 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20479
20445
|
}
|
|
20480
20446
|
});
|
|
20481
20447
|
};
|
|
20482
|
-
const
|
|
20448
|
+
const dynamicComponent = (column, {
|
|
20449
|
+
$index,
|
|
20450
|
+
row
|
|
20451
|
+
}) => {
|
|
20483
20452
|
let _slot;
|
|
20453
|
+
const {
|
|
20454
|
+
renderType,
|
|
20455
|
+
event = {},
|
|
20456
|
+
prop,
|
|
20457
|
+
label,
|
|
20458
|
+
config = {},
|
|
20459
|
+
required,
|
|
20460
|
+
rules
|
|
20461
|
+
} = column;
|
|
20462
|
+
if (!prop || !renderType) return null;
|
|
20463
|
+
const Component = resolveComponent("el-" + renderType);
|
|
20464
|
+
const {
|
|
20465
|
+
options = [],
|
|
20466
|
+
...restConfig
|
|
20467
|
+
} = config;
|
|
20468
|
+
const renderChildComponent = () => {
|
|
20469
|
+
if (!options || options.length === 0) return null;
|
|
20470
|
+
if (renderType === "select") {
|
|
20471
|
+
return options.map((item) => createVNode(resolveComponent("el-option"), {
|
|
20472
|
+
"label": item.label,
|
|
20473
|
+
"value": item.value,
|
|
20474
|
+
"key": item.value
|
|
20475
|
+
}, null));
|
|
20476
|
+
}
|
|
20477
|
+
if (renderType === "radio-group") {
|
|
20478
|
+
return options.map((item) => createVNode(resolveComponent("el-radio"), {
|
|
20479
|
+
"label": item.value,
|
|
20480
|
+
"key": item.value
|
|
20481
|
+
}, {
|
|
20482
|
+
default: () => [item.label]
|
|
20483
|
+
}));
|
|
20484
|
+
}
|
|
20485
|
+
return null;
|
|
20486
|
+
};
|
|
20487
|
+
if (renderType === "cascader") {
|
|
20488
|
+
return createVNode(resolveComponent("el-cascader"), mergeProps({
|
|
20489
|
+
"modelValue": row[prop],
|
|
20490
|
+
"onUpdate:modelValue": ($event) => row[prop] = $event,
|
|
20491
|
+
"placeholder": `请选择${label}`,
|
|
20492
|
+
"options": options
|
|
20493
|
+
}, event, restConfig), null);
|
|
20494
|
+
}
|
|
20495
|
+
const isSelect = ["select", "cascader"].includes(renderType);
|
|
20496
|
+
const isFormCell = required || (rules == null ? void 0 : rules.length);
|
|
20497
|
+
const modelValue = row[prop];
|
|
20498
|
+
const updateModelValue = (val) => {
|
|
20499
|
+
row[prop] = (config == null ? void 0 : config.type) === "number" ? Number(val) : val;
|
|
20500
|
+
};
|
|
20501
|
+
const component = createVNode(Component, mergeProps({
|
|
20502
|
+
"modelValue": modelValue,
|
|
20503
|
+
"onUpdate:modelValue": updateModelValue,
|
|
20504
|
+
"placeholder": `请${isSelect ? "选择" : "输入"}${label}`
|
|
20505
|
+
}, event, restConfig), _isSlot$1(_slot = renderChildComponent()) ? _slot : {
|
|
20506
|
+
default: () => [_slot]
|
|
20507
|
+
});
|
|
20508
|
+
if (!isFormCell) return component;
|
|
20509
|
+
return createVNode(resolveComponent("el-form-item"), {
|
|
20510
|
+
"prop": "tableData." + $index + "." + prop,
|
|
20511
|
+
"label": " ",
|
|
20512
|
+
"rules": formTableRules.value[prop]
|
|
20513
|
+
}, _isSlot$1(component) ? component : {
|
|
20514
|
+
default: () => [component]
|
|
20515
|
+
});
|
|
20516
|
+
};
|
|
20517
|
+
const getRules = () => {
|
|
20518
|
+
const rules = {};
|
|
20519
|
+
if (!isFormTable.value) return;
|
|
20520
|
+
const handleRule = (item) => {
|
|
20521
|
+
if (!item.prop) return;
|
|
20522
|
+
const isSelect = (item == null ? void 0 : item.renderType) && ["select", "cascader"].includes(item == null ? void 0 : item.renderType);
|
|
20523
|
+
const defaultRule = {
|
|
20524
|
+
required: true,
|
|
20525
|
+
message: `${item.label ?? "该字段"}不能为空`,
|
|
20526
|
+
trigger: isSelect ? "change" : "blur"
|
|
20527
|
+
};
|
|
20528
|
+
if (item.required) {
|
|
20529
|
+
rules[item.prop] = [defaultRule];
|
|
20530
|
+
}
|
|
20531
|
+
if (item.rules && item.rules.length > 0) {
|
|
20532
|
+
rules[item.prop] = [...rules[item == null ? void 0 : item.prop] || [], ...item.rules];
|
|
20533
|
+
}
|
|
20534
|
+
};
|
|
20535
|
+
columns.value.filter((cell) => (cell == null ? void 0 : cell.renderType) && ((cell == null ? void 0 : cell.required) || (cell == null ? void 0 : cell.rules))).forEach((form) => {
|
|
20536
|
+
var _a;
|
|
20537
|
+
(_a = form.children) == null ? void 0 : _a.forEach(handleRule);
|
|
20538
|
+
handleRule(form);
|
|
20539
|
+
});
|
|
20540
|
+
formTableRules.value = rules;
|
|
20541
|
+
};
|
|
20542
|
+
const tableFormValidate = async () => {
|
|
20543
|
+
if (!isFormTable.value) return Promise.resolve(true);
|
|
20544
|
+
if (!tableFormRef.value) return Promise.resolve(false);
|
|
20545
|
+
return await tableFormRef.value.validate(() => Promise.resolve());
|
|
20546
|
+
};
|
|
20547
|
+
const render2 = (props2) => {
|
|
20548
|
+
let _slot2;
|
|
20484
20549
|
const {
|
|
20485
20550
|
rowKey,
|
|
20486
20551
|
tableData,
|
|
@@ -20500,16 +20565,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20500
20565
|
default: (scope) => {
|
|
20501
20566
|
if ((cell == null ? void 0 : cell.renderType) === "operate") return renderOperate(cell, scope);
|
|
20502
20567
|
if ((cell == null ? void 0 : cell.renderType) && (cell == null ? void 0 : cell.renderType) !== "operate") {
|
|
20503
|
-
|
|
20504
|
-
renderType: cell.renderType,
|
|
20505
|
-
prop: cell.prop,
|
|
20506
|
-
config: cell.config
|
|
20507
|
-
};
|
|
20508
|
-
return createVNode(_sfc_main$6, {
|
|
20509
|
-
"conf": conf,
|
|
20510
|
-
"model": scope.row,
|
|
20511
|
-
"onChange": cell == null ? void 0 : cell.change
|
|
20512
|
-
}, null);
|
|
20568
|
+
return dynamicComponent(cell, scope);
|
|
20513
20569
|
}
|
|
20514
20570
|
if (cell == null ? void 0 : cell.render) return cell == null ? void 0 : cell.render(scope.row);
|
|
20515
20571
|
if (children && (children == null ? void 0 : children.length) > 0) return renderColumn(children);
|
|
@@ -20564,14 +20620,23 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20564
20620
|
}, null)]);
|
|
20565
20621
|
};
|
|
20566
20622
|
if (!columns.value) return;
|
|
20567
|
-
return createVNode(Fragment, null, [createVNode(resolveComponent("el-
|
|
20568
|
-
"
|
|
20569
|
-
|
|
20570
|
-
|
|
20571
|
-
|
|
20572
|
-
})
|
|
20573
|
-
|
|
20574
|
-
|
|
20623
|
+
return createVNode(Fragment, null, [isFormTable.value ? createVNode(resolveComponent("el-form"), {
|
|
20624
|
+
"model": props2,
|
|
20625
|
+
"ref": tableFormRef
|
|
20626
|
+
}, _isSlot$1(_slot2 = renderTable()) ? _slot2 : {
|
|
20627
|
+
default: () => [_slot2]
|
|
20628
|
+
}) : renderTable(), pagination()]);
|
|
20629
|
+
function renderTable() {
|
|
20630
|
+
let _slot3;
|
|
20631
|
+
return createVNode(resolveComponent("el-table"), mergeProps({
|
|
20632
|
+
"ref": tableRef
|
|
20633
|
+
}, attrs, {
|
|
20634
|
+
"row-key": rowKey,
|
|
20635
|
+
"data": tableData
|
|
20636
|
+
}), _isSlot$1(_slot3 = renderColumn(columns.value)) ? _slot3 : {
|
|
20637
|
+
default: () => [_slot3]
|
|
20638
|
+
});
|
|
20639
|
+
}
|
|
20575
20640
|
};
|
|
20576
20641
|
const exportDataToExcel = (fileName) => {
|
|
20577
20642
|
const header = columns.value.filter((cell) => cell.prop);
|
|
@@ -20589,7 +20654,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
20589
20654
|
__expose({
|
|
20590
20655
|
tableRef,
|
|
20591
20656
|
exportDataToExcel,
|
|
20592
|
-
updateColumns
|
|
20657
|
+
updateColumns,
|
|
20658
|
+
tableFormValidate
|
|
20593
20659
|
});
|
|
20594
20660
|
return (_ctx, _cache) => {
|
|
20595
20661
|
return openBlock(), createBlock(resolveDynamicComponent(render2(props)));
|
|
@@ -20951,7 +21017,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
20951
21017
|
};
|
|
20952
21018
|
}
|
|
20953
21019
|
});
|
|
20954
|
-
const index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
21020
|
+
const index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-8f175b2c"]]);
|
|
20955
21021
|
let versionKey, curVersion, updateApp;
|
|
20956
21022
|
const updateSysVersion = () => {
|
|
20957
21023
|
localStorage.setItem(versionKey, curVersion);
|
|
@@ -21040,7 +21106,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
21040
21106
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
21041
21107
|
], 4);
|
|
21042
21108
|
}
|
|
21043
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-
|
|
21109
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-a90cbe2e"]]);
|
|
21044
21110
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
21045
21111
|
__name: "index",
|
|
21046
21112
|
props: {
|
|
@@ -21221,8 +21287,8 @@ const components2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
21221
21287
|
LogoTitleRender,
|
|
21222
21288
|
Toolbar,
|
|
21223
21289
|
Update,
|
|
21224
|
-
YxDialog: _sfc_main$
|
|
21225
|
-
YxDrawer: _sfc_main$
|
|
21290
|
+
YxDialog: _sfc_main$7,
|
|
21291
|
+
YxDrawer: _sfc_main$6,
|
|
21226
21292
|
YxForm: index$1,
|
|
21227
21293
|
YxIcon: index,
|
|
21228
21294
|
YxTable: _sfc_main$5,
|
|
@@ -21231,8 +21297,8 @@ const components2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
21231
21297
|
export {
|
|
21232
21298
|
LogoTitleRender as L,
|
|
21233
21299
|
Update as U,
|
|
21234
|
-
_sfc_main$
|
|
21235
|
-
_sfc_main$
|
|
21300
|
+
_sfc_main$7 as _,
|
|
21301
|
+
_sfc_main$6 as a,
|
|
21236
21302
|
_sfc_main$5 as b,
|
|
21237
21303
|
components2 as c,
|
|
21238
21304
|
index as d,
|
package/lib/index.es6.js.gz
CHANGED
|
Binary file
|