@weitutech/by-components-v3 1.1.3 → 1.1.4
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
|
@@ -36830,7 +36830,7 @@ const saveCachedColumns = (name, context) => {
|
|
|
36830
36830
|
children: updatedChildren
|
|
36831
36831
|
});
|
|
36832
36832
|
}
|
|
36833
|
-
} else if (col.field === targetField) {
|
|
36833
|
+
} else if (targetField && targetField !== "" && col.field === targetField) {
|
|
36834
36834
|
result.push({
|
|
36835
36835
|
field: col.field,
|
|
36836
36836
|
width: newWidth
|
|
@@ -36881,7 +36881,7 @@ const replaceColumnWidthToColumns = (name, columns) => {
|
|
|
36881
36881
|
children: processColumnWidth(column.children, (cacheColumn2 == null ? void 0 : cacheColumn2.children) || [])
|
|
36882
36882
|
};
|
|
36883
36883
|
}
|
|
36884
|
-
const cacheColumn = cacheColumns2.find((col) => col.field === column.field);
|
|
36884
|
+
const cacheColumn = cacheColumns2.filter((col) => col.field && col.field !== "").find((col) => col.field === column.field);
|
|
36885
36885
|
return {
|
|
36886
36886
|
...column,
|
|
36887
36887
|
...(cacheColumn == null ? void 0 : cacheColumn.width) && { width: cacheColumn.width }
|
|
@@ -36961,9 +36961,11 @@ const ByTable = /* @__PURE__ */ defineComponent({
|
|
|
36961
36961
|
const listeners = ref({});
|
|
36962
36962
|
const CustomColumnRef = ref();
|
|
36963
36963
|
const vxeGridRef = ref();
|
|
36964
|
+
const showResetCache = ref(false);
|
|
36964
36965
|
const hasCache = ref(false);
|
|
36965
36966
|
const originColumns = ref([]);
|
|
36966
36967
|
onMounted(() => {
|
|
36968
|
+
showResetCache.value = !!props.name;
|
|
36967
36969
|
originColumns.value = deepClone(props.gridOptions.columns);
|
|
36968
36970
|
events.forEach((eventName) => {
|
|
36969
36971
|
listeners.value["on" + eventName.split("-").map((item) => capitalizeFirstLetter(item)).join("")] = (event) => emit(eventName, event);
|
|
@@ -37012,6 +37014,7 @@ const ByTable = /* @__PURE__ */ defineComponent({
|
|
|
37012
37014
|
CustomColumnRef.value.dialogVisible = true;
|
|
37013
37015
|
};
|
|
37014
37016
|
const changeTableFields = (cols) => {
|
|
37017
|
+
originColumns.value = deepClone(cols);
|
|
37015
37018
|
const noFixedCol = cols.filter((col) => !col.field);
|
|
37016
37019
|
const result = JSON.parse(JSON.stringify([...cols.filter((col) => col.field === "left")[0].children.map((child) => ({
|
|
37017
37020
|
...child,
|
|
@@ -37118,7 +37121,7 @@ const ByTable = /* @__PURE__ */ defineComponent({
|
|
|
37118
37121
|
"onChangeTable": changeTableFields
|
|
37119
37122
|
}, null) : null, props.gridOptions.pagerConfig ? createVNode("div", {
|
|
37120
37123
|
"class": "pager-container"
|
|
37121
|
-
}, [createVNode(resolveComponent("el-button"), {
|
|
37124
|
+
}, [showResetCache.value && createVNode(resolveComponent("el-button"), {
|
|
37122
37125
|
"disabled": !hasCache.value,
|
|
37123
37126
|
"size": "mini",
|
|
37124
37127
|
"onClick": resetCachedTableColumns
|
|
@@ -37128,7 +37131,7 @@ const ByTable = /* @__PURE__ */ defineComponent({
|
|
|
37128
37131
|
"onChange": handlePagerChange
|
|
37129
37132
|
}), null)]) : createVNode("div", {
|
|
37130
37133
|
"class": "reset-button"
|
|
37131
|
-
}, [createVNode(resolveComponent("el-button"), {
|
|
37134
|
+
}, [showResetCache.value && createVNode(resolveComponent("el-button"), {
|
|
37132
37135
|
"disabled": !hasCache.value,
|
|
37133
37136
|
"size": "mini",
|
|
37134
37137
|
"onClick": resetCachedTableColumns
|