@weitutech/by-components-v3 1.0.6 → 1.0.81
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/dist/by-component-v3.mjs
CHANGED
|
@@ -36589,7 +36589,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
36589
36589
|
}, 1024),
|
|
36590
36590
|
createVNode(_component_el_tooltip, {
|
|
36591
36591
|
effect: "dark",
|
|
36592
|
-
content: "
|
|
36592
|
+
content: "右固定",
|
|
36593
36593
|
placement: "top"
|
|
36594
36594
|
}, {
|
|
36595
36595
|
default: withCtx(() => [
|
|
@@ -36704,8 +36704,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
36704
36704
|
};
|
|
36705
36705
|
}
|
|
36706
36706
|
});
|
|
36707
|
-
const CustomColumn = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__scopeId", "data-v-
|
|
36708
|
-
const events = ["keydown", "current-change", "radio-change", "checkbox-change", "checkbox-all", "checkbox-range-start", "checkbox-range-change", "checkbox-range-end", "cell-dblclick", "cell-menu", "cell-mouseenter", "cell-mouseleave", "cell-delete-value", "header-cell-click", "header-cell-dblclick", "header-cell-menu", "footer-cell-click", "footer-cell-dblclick", "footer-cell-menu", "clear-merge", "sort-change", "clear-sort", "filter-visible", "filter-change", "clear-filter", "
|
|
36707
|
+
const CustomColumn = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__scopeId", "data-v-4a62d7dd"]]);
|
|
36708
|
+
const events = ["keydown", "current-change", "radio-change", "checkbox-change", "checkbox-all", "checkbox-range-start", "checkbox-range-change", "checkbox-range-end", "cell-dblclick", "cell-menu", "cell-mouseenter", "cell-mouseleave", "cell-delete-value", "header-cell-click", "header-cell-dblclick", "header-cell-menu", "footer-cell-click", "footer-cell-dblclick", "footer-cell-menu", "clear-merge", "sort-change", "clear-sort", "filter-visible", "filter-change", "clear-filter", "toggle-row-expand", "toggle-tree-expand", "menu-click", "cell-selected", "edit-closed", "edit-activated", "edit-disabled", "valid-error", "scroll", "custom", "page-change", "form-submit", "form-submit-invalid", "form-reset", "form-collapse", "proxy-query", "proxy-delete", "proxy-save", "toolbar-button-click", "toolbar-tool-click", "zoom", "cell-click"];
|
|
36709
36709
|
const capitalizeFirstLetter = (str) => {
|
|
36710
36710
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
36711
36711
|
};
|
|
@@ -36714,6 +36714,10 @@ const ByTable = /* @__PURE__ */ defineComponent({
|
|
|
36714
36714
|
gridOptions: {
|
|
36715
36715
|
type: Object,
|
|
36716
36716
|
required: true
|
|
36717
|
+
},
|
|
36718
|
+
name: {
|
|
36719
|
+
type: String,
|
|
36720
|
+
default: ""
|
|
36717
36721
|
}
|
|
36718
36722
|
},
|
|
36719
36723
|
emits: ["pageChange", "setColumns", "setGroupColumn", ...events],
|
|
@@ -36726,8 +36730,15 @@ const ByTable = /* @__PURE__ */ defineComponent({
|
|
|
36726
36730
|
const {
|
|
36727
36731
|
customColumnConfig,
|
|
36728
36732
|
pagerConfig,
|
|
36733
|
+
columns,
|
|
36729
36734
|
...others
|
|
36730
36735
|
} = props.gridOptions;
|
|
36736
|
+
const cols = JSON.parse(localStorage.getItem(props.name)) || void 0;
|
|
36737
|
+
if (cols && props.name) {
|
|
36738
|
+
columns.forEach((item) => {
|
|
36739
|
+
item.width = (cols.find((col) => col.field === item.field) || {}).width || void 0;
|
|
36740
|
+
});
|
|
36741
|
+
}
|
|
36731
36742
|
return {
|
|
36732
36743
|
border: true,
|
|
36733
36744
|
showOverflow: true,
|
|
@@ -36739,6 +36750,7 @@ const ByTable = /* @__PURE__ */ defineComponent({
|
|
|
36739
36750
|
loadingConfig: {
|
|
36740
36751
|
text: "加载中..."
|
|
36741
36752
|
},
|
|
36753
|
+
columns,
|
|
36742
36754
|
...others,
|
|
36743
36755
|
columnConfig: {
|
|
36744
36756
|
resizable: true
|
|
@@ -36789,6 +36801,17 @@ const ByTable = /* @__PURE__ */ defineComponent({
|
|
|
36789
36801
|
}
|
|
36790
36802
|
emit("cell-click", context);
|
|
36791
36803
|
};
|
|
36804
|
+
const handleResizableChange = (context) => {
|
|
36805
|
+
emit("resizable-change", context);
|
|
36806
|
+
if (!props.name) return;
|
|
36807
|
+
const collectColumn = context.$table.getTableColumn().collectColumn;
|
|
36808
|
+
console.log(collectColumn, "collectColumn");
|
|
36809
|
+
const clos = collectColumn.map((col) => ({
|
|
36810
|
+
field: col.field,
|
|
36811
|
+
width: col.renderWidth
|
|
36812
|
+
}));
|
|
36813
|
+
localStorage.setItem(props.name, JSON.stringify(clos));
|
|
36814
|
+
};
|
|
36792
36815
|
const handleOpenCustomColumn = () => {
|
|
36793
36816
|
console.log(CustomColumnRef.value.dialogVisible, "CustomColumnRef.value.dialogVisible");
|
|
36794
36817
|
CustomColumnRef.value.dialogVisible = true;
|
|
@@ -36846,6 +36869,25 @@ const ByTable = /* @__PURE__ */ defineComponent({
|
|
|
36846
36869
|
return () => {
|
|
36847
36870
|
var _a2, _b, _c, _d, _e2, _f;
|
|
36848
36871
|
const Slots = {};
|
|
36872
|
+
const insertSlotFn = (item) => {
|
|
36873
|
+
if (item.slots) {
|
|
36874
|
+
for (const key in item.slots) {
|
|
36875
|
+
const value = item.slots[key];
|
|
36876
|
+
Slots[value] = (context) => {
|
|
36877
|
+
return slots[value] ? slots[value](context) : null;
|
|
36878
|
+
};
|
|
36879
|
+
}
|
|
36880
|
+
}
|
|
36881
|
+
};
|
|
36882
|
+
const recursionFn = (arr = []) => {
|
|
36883
|
+
arr.forEach((item) => {
|
|
36884
|
+
insertSlotFn(item);
|
|
36885
|
+
if (item.children && item.children.length) {
|
|
36886
|
+
recursionFn(item.children);
|
|
36887
|
+
}
|
|
36888
|
+
});
|
|
36889
|
+
};
|
|
36890
|
+
recursionFn(props.gridOptions.columns);
|
|
36849
36891
|
props.gridOptions.columns.forEach((item) => {
|
|
36850
36892
|
for (const key in item.slots) {
|
|
36851
36893
|
const value = item.slots[key];
|
|
@@ -36863,7 +36905,8 @@ const ByTable = /* @__PURE__ */ defineComponent({
|
|
|
36863
36905
|
return createVNode("div", {
|
|
36864
36906
|
"class": "VxeGridWrap"
|
|
36865
36907
|
}, [createVNode(VxeGrid, mergeProps(defaultOptions.value, listeners.value, {
|
|
36866
|
-
"onCellClick": handleCellClick
|
|
36908
|
+
"onCellClick": handleCellClick,
|
|
36909
|
+
"onResizableChange": handleResizableChange
|
|
36867
36910
|
}), {
|
|
36868
36911
|
...Slots
|
|
36869
36912
|
}), props.gridOptions.customColumnConfig && props.gridOptions.customColumnConfig.showCustomColumn ? createVNode(CustomColumn, {
|