@94ai/nf-table 3.2.69 → 3.2.71

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.d.ts CHANGED
@@ -947,6 +947,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
947
947
  syncCookiesToLocalShowColumn: () => Promise<void>;
948
948
  syncCookiesToTableColumn: (readCached?: boolean, init?: boolean) => Promise<void>;
949
949
  elTableRefKey: import("vue-demi").Ref<number>;
950
+ clearDragCached: () => Promise<void>;
951
+ clearColumnEditCached: () => Promise<void>;
950
952
  }> & import("vue/types/v3-component-options").ExtractComputedReturns<{}> & import("vue-demi").ComponentCustomProperties & Readonly<import("vue-demi").ExtractPropTypes<{
951
953
  background: {
952
954
  type: import("vue-demi").PropType<string>;
@@ -1559,6 +1561,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1559
1561
  syncCookiesToLocalShowColumn: () => Promise<void>;
1560
1562
  syncCookiesToTableColumn: (readCached?: boolean, init?: boolean) => Promise<void>;
1561
1563
  elTableRefKey: import("vue-demi").Ref<number>;
1564
+ clearDragCached: () => Promise<void>;
1565
+ clearColumnEditCached: () => Promise<void>;
1562
1566
  }, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
1563
1567
  fieldsChange: (event: string[]) => void;
1564
1568
  "update:showColumn": (event: string[] | undefined) => void;
@@ -150,14 +150,14 @@ __sfc_main$2.props = {
150
150
  };
151
151
  __sfc_main$2.setup = (__props, __ctx) => {
152
152
  var _a;
153
- const props = __props;
153
+ const props2 = __props;
154
154
  const emit = __ctx.emit;
155
155
  (_a = vueDemi.getCurrentInstance()) == null ? void 0 : _a.proxy;
156
156
  const tableData = vueDemi.ref({});
157
157
  const unChangedColumn = vueDemi.ref([]);
158
158
  const visible = vueDemi.computed({
159
159
  get() {
160
- return props.show;
160
+ return props2.show;
161
161
  },
162
162
  set(val) {
163
163
  emit("update:show", val);
@@ -165,9 +165,9 @@ __sfc_main$2.setup = (__props, __ctx) => {
165
165
  });
166
166
  const fields = vueDemi.computed(() => {
167
167
  const obj = {};
168
- props.tableColumns.filter((item) => !item.destory).map((item) => {
168
+ props2.tableColumns.filter((item) => !item.destory).map((item) => {
169
169
  if (!item.type) {
170
- const key = item.category || props.basicFieldDesc;
170
+ const key = item.category || props2.basicFieldDesc;
171
171
  if (!obj[key]) {
172
172
  obj[key] = [];
173
173
  }
@@ -186,7 +186,7 @@ __sfc_main$2.setup = (__props, __ctx) => {
186
186
  const submit = () => {
187
187
  visible.value = false;
188
188
  const columnState = {};
189
- props.tableColumns.map((i, index2) => {
189
+ props2.tableColumns.map((i, index2) => {
190
190
  var _a2;
191
191
  columnState[i.prop] = {
192
192
  initHidden: !tableData.value[i.prop] || false,
@@ -196,24 +196,24 @@ __sfc_main$2.setup = (__props, __ctx) => {
196
196
  };
197
197
  });
198
198
  emit("save", tableData.value);
199
- if (props.columnEdit) {
200
- commonUtils.CachedManager.syncCachedSet(props.storageKey, columnState);
199
+ if (props2.columnEdit) {
200
+ commonUtils.CachedManager.syncCachedSet(props2.storageKey, columnState);
201
201
  }
202
202
  };
203
203
  const addInitValue = () => {
204
204
  const obj = {};
205
- props.tableColumns.forEach((v) => {
205
+ props2.tableColumns.forEach((v) => {
206
206
  obj[v.prop] = !v.initHidden;
207
207
  });
208
208
  tableData.value = obj;
209
- if (props.tableColumns.findIndex((item) => !!item.type) > -1) {
209
+ if (props2.tableColumns.findIndex((item) => !!item.type) > -1) {
210
210
  unChangedColumn.value.push("selection");
211
211
  }
212
- if (props.tableColumns.findIndex((item) => {
212
+ if (props2.tableColumns.findIndex((item) => {
213
213
  var _a2;
214
- return (item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop)) === props.operationPropKey;
214
+ return (item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop)) === props2.operationPropKey;
215
215
  }) > -1) {
216
- unChangedColumn.value.push(props.operationPropKey);
216
+ unChangedColumn.value.push(props2.operationPropKey);
217
217
  }
218
218
  };
219
219
  vueDemi.onMounted(() => {
@@ -4863,9 +4863,9 @@ const require$$0 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
4863
4863
  if (!componentData) {
4864
4864
  return attributes;
4865
4865
  }
4866
- var on2 = componentData.on, props2 = componentData.props, componentDataAttrs = componentData.attrs;
4866
+ var on2 = componentData.on, props3 = componentData.props, componentDataAttrs = componentData.attrs;
4867
4867
  update("on", on2);
4868
- update("props", props2);
4868
+ update("props", props3);
4869
4869
  Object.assign(attributes.attrs, componentDataAttrs);
4870
4870
  return attributes;
4871
4871
  }
@@ -4875,7 +4875,7 @@ const require$$0 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
4875
4875
  return "on" + evt;
4876
4876
  });
4877
4877
  var draggingElement = null;
4878
- var props = {
4878
+ var props2 = {
4879
4879
  options: Object,
4880
4880
  list: {
4881
4881
  type: Array,
@@ -4918,7 +4918,7 @@ const require$$0 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
4918
4918
  var draggableComponent = {
4919
4919
  name: "draggable",
4920
4920
  inheritAttrs: false,
4921
- props,
4921
+ props: props2,
4922
4922
  data: function data() {
4923
4923
  return {
4924
4924
  transitionMode: false,
@@ -5332,20 +5332,20 @@ __sfc_main$1.props = {
5332
5332
  __sfc_main$1.setup = (__props, __ctx) => {
5333
5333
  var _a;
5334
5334
  const instance = (_a = vueDemi.getCurrentInstance()) == null ? void 0 : _a.proxy;
5335
- const props = __props;
5335
+ const props2 = __props;
5336
5336
  const currentTable = vueDemi.ref([]);
5337
5337
  const showColumn = vueDemi.ref([]);
5338
5338
  const unChangedColumn = vueDemi.ref([]);
5339
5339
  const fixedColumn = vueDemi.ref([]);
5340
5340
  const unFixedColumn = vueDemi.ref([]);
5341
5341
  vueDemi.onBeforeMount(() => {
5342
- currentTable.value = commonUtils.deepClone(props.tableColumns.filter((item) => !item.destory)).sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
5342
+ currentTable.value = commonUtils.deepClone(props2.tableColumns.filter((item) => !item.destory)).sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
5343
5343
  currentTable.value.map((i) => {
5344
5344
  if (!i.attr) {
5345
5345
  i.attr = {};
5346
5346
  }
5347
5347
  });
5348
- const list = props.tableColumns.filter((item) => !item.destory);
5348
+ const list = props2.tableColumns.filter((item) => !item.destory);
5349
5349
  setFields(list);
5350
5350
  updateColumn();
5351
5351
  if (currentTable.value.findIndex((item) => !!item.type) > -1) {
@@ -5353,9 +5353,9 @@ __sfc_main$1.setup = (__props, __ctx) => {
5353
5353
  }
5354
5354
  if (currentTable.value.findIndex((item) => {
5355
5355
  var _a2;
5356
- return (item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop)) === props.operationPropKey;
5356
+ return (item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop)) === props2.operationPropKey;
5357
5357
  }) > -1) {
5358
- unChangedColumn.value.push(props.operationPropKey);
5358
+ unChangedColumn.value.push(props2.operationPropKey);
5359
5359
  }
5360
5360
  if (currentTable.value.every((i) => !i.initHidden)) {
5361
5361
  showColumn.value = currentTable.value.map((i) => i.prop);
@@ -5368,7 +5368,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
5368
5368
  const setFields = (tableColumns) => {
5369
5369
  const obj = {};
5370
5370
  tableColumns.map((item) => {
5371
- const key = item.category || props.basicFieldDesc;
5371
+ const key = item.category || props2.basicFieldDesc;
5372
5372
  if (!obj[key]) {
5373
5373
  obj[key] = [];
5374
5374
  }
@@ -5458,12 +5458,12 @@ __sfc_main$1.setup = (__props, __ctx) => {
5458
5458
  const syncTableColumnsToCookies = () => {
5459
5459
  var _a2;
5460
5460
  const newTableColumns = [...fixedColumn.value, ...unFixedColumn.value];
5461
- if (newTableColumns.filter((item) => !item.type && item.prop !== props.operationPropKey && !item.initHidden).length === 0) {
5461
+ if (newTableColumns.filter((item) => !item.type && item.prop !== props2.operationPropKey && !item.initHidden).length === 0) {
5462
5462
  (_a2 = instance == null ? void 0 : instance.$openMessage) == null ? void 0 : _a2.warning({
5463
- message: props.selectEmptyWarningTips,
5463
+ message: props2.selectEmptyWarningTips,
5464
5464
  duration: 2e3
5465
5465
  });
5466
- throw new Error(props.selectEmptyWarningTips);
5466
+ throw new Error(props2.selectEmptyWarningTips);
5467
5467
  }
5468
5468
  const selectionPropItemIndex = newTableColumns.findIndex((item) => !!item.type);
5469
5469
  if (selectionPropItemIndex > -1) {
@@ -5471,7 +5471,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
5471
5471
  }
5472
5472
  const operationPropItemIndex = newTableColumns.findIndex((item) => {
5473
5473
  var _a3;
5474
- return (item.prop || ((_a3 = item.attr) == null ? void 0 : _a3.prop)) === props.operationPropKey;
5474
+ return (item.prop || ((_a3 = item.attr) == null ? void 0 : _a3.prop)) === props2.operationPropKey;
5475
5475
  });
5476
5476
  if (operationPropItemIndex > -1) {
5477
5477
  newTableColumns.push(newTableColumns.splice(operationPropItemIndex, 1)[0]);
@@ -5488,8 +5488,8 @@ __sfc_main$1.setup = (__props, __ctx) => {
5488
5488
  };
5489
5489
  obj[i.prop] = !columnState[i.prop].initHidden;
5490
5490
  });
5491
- if (props.columnEdit) {
5492
- commonUtils.CachedManager.syncCachedSet(props.storageKey, columnState);
5491
+ if (props2.columnEdit) {
5492
+ commonUtils.CachedManager.syncCachedSet(props2.storageKey, columnState);
5493
5493
  }
5494
5494
  return obj;
5495
5495
  };
@@ -5773,6 +5773,12 @@ const _sfc_render$1 = null;
5773
5773
  const _sfc_staticRenderFns$1 = null;
5774
5774
  var __component__$1 = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(_sfc_main, _sfc_render$1, _sfc_staticRenderFns$1, false, null, null, null, null);
5775
5775
  const RenderComponent = __component__$1.exports;
5776
+ async function clearDragCached() {
5777
+ await commonUtils.CachedManager.asyncCachedSet(`${props.storageKey}$drag-column-width`, null);
5778
+ }
5779
+ async function clearColumnEditCached() {
5780
+ await commonUtils.CachedManager.asyncCachedSet(props.storageKey, null);
5781
+ }
5776
5782
  const __sfc_main = vueDemi.defineComponent({
5777
5783
  name: "nf-table"
5778
5784
  });
@@ -6180,7 +6186,7 @@ __sfc_main.props = {
6180
6186
  };
6181
6187
  __sfc_main.setup = (__props, __ctx) => {
6182
6188
  var _a;
6183
- const props = __props;
6189
+ const props2 = __props;
6184
6190
  const emit = __ctx.emit;
6185
6191
  const instance = (_a = vueDemi.getCurrentInstance()) == null ? void 0 : _a.proxy;
6186
6192
  const elTableRef = vueDemi.ref();
@@ -6196,15 +6202,15 @@ __sfc_main.setup = (__props, __ctx) => {
6196
6202
  const elTableHeight = vueDemi.ref();
6197
6203
  const nfColumCheckDialogVisible = vueDemi.ref(false);
6198
6204
  const showData = vueDemi.computed(() => {
6199
- const pageSize = props.pageAttrs["page-size"];
6200
- const currentPage = props.pageAttrs["current-page"] || 1;
6201
- const noTotal = typeof props.pageAttrs.total === "undefined";
6205
+ const pageSize = props2.pageAttrs["page-size"];
6206
+ const currentPage = props2.pageAttrs["current-page"] || 1;
6207
+ const noTotal = typeof props2.pageAttrs.total === "undefined";
6202
6208
  if (!pageSize || !noTotal)
6203
- return props.data;
6204
- if (props.data.length > pageSize) {
6205
- return props.data.slice((currentPage - 1) * pageSize, currentPage * pageSize);
6209
+ return props2.data;
6210
+ if (props2.data.length > pageSize) {
6211
+ return props2.data.slice((currentPage - 1) * pageSize, currentPage * pageSize);
6206
6212
  } else {
6207
- return props.data;
6213
+ return props2.data;
6208
6214
  }
6209
6215
  });
6210
6216
  const hasOperationSlot = vueDemi.computed(() => {
@@ -6215,10 +6221,10 @@ __sfc_main.setup = (__props, __ctx) => {
6215
6221
  });
6216
6222
  const loadingInstance = vueDemi.ref();
6217
6223
  vueDemi.watch(() => {
6218
- return props.loading;
6224
+ return props2.loading;
6219
6225
  }, async () => {
6220
6226
  var _a2, _b;
6221
- if (props.loading) {
6227
+ if (props2.loading) {
6222
6228
  await vueDemi.nextTick();
6223
6229
  const {
6224
6230
  target,
@@ -6228,7 +6234,7 @@ __sfc_main.setup = (__props, __ctx) => {
6228
6234
  spinner,
6229
6235
  background,
6230
6236
  customClass
6231
- } = props;
6237
+ } = props2;
6232
6238
  loadingInstance.value = elementUi.Loading.service({
6233
6239
  target: target || ((_a2 = elTableRef.value) == null ? void 0 : _a2.$el) || document.body,
6234
6240
  lock,
@@ -6246,12 +6252,12 @@ __sfc_main.setup = (__props, __ctx) => {
6246
6252
  });
6247
6253
  const initLocalShow = (init = false) => {
6248
6254
  if (!init) {
6249
- props.columns._skip = true;
6255
+ props2.columns._skip = true;
6250
6256
  }
6251
- const result = props.columns.filter((item) => {
6257
+ const result = props2.columns.filter((item) => {
6252
6258
  var _a2, _b;
6253
6259
  const prop = item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
6254
- if ((_b = props.showColumn) == null ? void 0 : _b.includes(prop)) {
6260
+ if ((_b = props2.showColumn) == null ? void 0 : _b.includes(prop)) {
6255
6261
  item.initHidden = false;
6256
6262
  }
6257
6263
  return !item.initHidden;
@@ -6261,13 +6267,13 @@ __sfc_main.setup = (__props, __ctx) => {
6261
6267
  });
6262
6268
  if (!init) {
6263
6269
  vueDemi.nextTick(() => {
6264
- props.columns._skip = false;
6270
+ props2.columns._skip = false;
6265
6271
  });
6266
6272
  }
6267
6273
  if (result.length) {
6268
6274
  return result;
6269
6275
  }
6270
- return props.columns.map((item) => {
6276
+ return props2.columns.map((item) => {
6271
6277
  var _a2;
6272
6278
  return item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
6273
6279
  });
@@ -6282,9 +6288,9 @@ __sfc_main.setup = (__props, __ctx) => {
6282
6288
  immediate: true
6283
6289
  });
6284
6290
  const syncLocalShowColumnToCookies = () => {
6285
- if (props.columnEdit) {
6291
+ if (props2.columnEdit) {
6286
6292
  const columnState = {};
6287
- props.columns.map((i, index2) => {
6293
+ props2.columns.map((i, index2) => {
6288
6294
  var _a2, _b;
6289
6295
  const prop = i.prop || ((_a2 = i.attr) == null ? void 0 : _a2.prop);
6290
6296
  columnState[prop] = {
@@ -6294,12 +6300,12 @@ __sfc_main.setup = (__props, __ctx) => {
6294
6300
  index: index2
6295
6301
  };
6296
6302
  });
6297
- return commonUtils.CachedManager.syncCachedSet(props.storageKey, columnState);
6303
+ return commonUtils.CachedManager.syncCachedSet(props2.storageKey, columnState);
6298
6304
  }
6299
6305
  };
6300
6306
  const syncShowItemToInitHidden = () => {
6301
- props.columns._skip = true;
6302
- props.columns.forEach((item) => {
6307
+ props2.columns._skip = true;
6308
+ props2.columns.forEach((item) => {
6303
6309
  var _a2, _b;
6304
6310
  const prop = item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
6305
6311
  if ((_b = localShowColumn.value) == null ? void 0 : _b.includes(prop)) {
@@ -6309,15 +6315,15 @@ __sfc_main.setup = (__props, __ctx) => {
6309
6315
  }
6310
6316
  });
6311
6317
  vueDemi.nextTick(() => {
6312
- props.columns._skip = false;
6318
+ props2.columns._skip = false;
6313
6319
  });
6314
6320
  };
6315
6321
  const syncCookiesToLocalShowColumn = async () => {
6316
- if (props.columnEdit) {
6322
+ if (props2.columnEdit) {
6317
6323
  try {
6318
- let columnState = commonUtils.CachedManager.syncCachedGet(props.storageKey);
6324
+ let columnState = commonUtils.CachedManager.syncCachedGet(props2.storageKey);
6319
6325
  if (!columnState) {
6320
- columnState = await commonUtils.CachedManager.asyncCachedGet(props.storageKey);
6326
+ columnState = await commonUtils.CachedManager.asyncCachedGet(props2.storageKey);
6321
6327
  }
6322
6328
  if (columnState) {
6323
6329
  if (typeof columnState === "string") {
@@ -6339,13 +6345,13 @@ __sfc_main.setup = (__props, __ctx) => {
6339
6345
  };
6340
6346
  const initCachedData = async () => {
6341
6347
  var _a2, _b;
6342
- if (props.columnEdit) {
6348
+ if (props2.columnEdit) {
6343
6349
  try {
6344
- let cached = commonUtils.CachedManager.syncCachedGet(props.storageKey);
6350
+ let cached = commonUtils.CachedManager.syncCachedGet(props2.storageKey);
6345
6351
  if (!cached) {
6346
- cached = await commonUtils.CachedManager.asyncCachedGet(props.storageKey);
6352
+ cached = await commonUtils.CachedManager.asyncCachedGet(props2.storageKey);
6347
6353
  }
6348
- const cachedPriority = props.priority === "cached";
6354
+ const cachedPriority = props2.priority === "cached";
6349
6355
  if (cachedPriority ? cached : (_a2 = localShowColumn.value) == null ? void 0 : _a2.length) {
6350
6356
  cachedPriority ? await syncCookiesToLocalShowColumn() : await syncLocalShowColumnToCookies();
6351
6357
  } else if (cachedPriority ? (_b = localShowColumn.value) == null ? void 0 : _b.length : cached) {
@@ -6355,13 +6361,20 @@ __sfc_main.setup = (__props, __ctx) => {
6355
6361
  console.log(e);
6356
6362
  }
6357
6363
  }
6358
- if (props.dragCached) {
6359
- await commonUtils.CachedManager.asyncCachedGet(`${props.storageKey}$drag-column-width`);
6364
+ if (props2.dragCached) {
6365
+ await commonUtils.CachedManager.asyncCachedGet(`${props2.storageKey}$drag-column-width`);
6360
6366
  }
6361
6367
  };
6362
6368
  const getMinWidth = (column) => {
6369
+ var _a2;
6370
+ if (((_a2 = column.label) == null ? void 0 : _a2.indexOf("$$")) === 0) {
6371
+ const value = Number(column.label.replace("$$"));
6372
+ if (!Number.isNaN(value) && value) {
6373
+ return value;
6374
+ }
6375
+ }
6363
6376
  const fs = 14;
6364
- const label = column.customLabel || column.label;
6377
+ const label = column.label;
6365
6378
  const char = label.match(/[\u2E80-\u9FFF]/g);
6366
6379
  const charLen = char ? char.length : 0;
6367
6380
  const num = label.match(/\d|\./g);
@@ -6372,16 +6385,16 @@ __sfc_main.setup = (__props, __ctx) => {
6372
6385
  const tableColumns = vueDemi.ref([]);
6373
6386
  const elTableRefKey = vueDemi.ref(Date.now());
6374
6387
  const syncCookiesToTableColumn = async (readCached = true, init = false) => {
6375
- props.columns._skip = true;
6376
- const columns = props.columns.map((item, index2) => {
6388
+ props2.columns._skip = true;
6389
+ const columns = props2.columns.map((item, index2) => {
6377
6390
  var _a2;
6378
6391
  const attr = item.attr || {};
6379
6392
  if (!attr["min-width"] && item.label) {
6380
6393
  attr["min-width"] = String(getMinWidth(item)) + "px";
6381
6394
  }
6382
- if (init && props.dragCached) {
6395
+ if (init && props2.dragCached) {
6383
6396
  const prop = item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
6384
- let columnWidth = commonUtils.CachedManager.syncCachedGet(`${props.storageKey}$drag-column-width`) || {};
6397
+ let columnWidth = commonUtils.CachedManager.syncCachedGet(`${props2.storageKey}$drag-column-width`) || {};
6385
6398
  if (columnWidth[prop]) {
6386
6399
  attr.width = columnWidth[prop];
6387
6400
  }
@@ -6398,13 +6411,13 @@ __sfc_main.setup = (__props, __ctx) => {
6398
6411
  item.__index = index2;
6399
6412
  return item;
6400
6413
  });
6401
- if (readCached && props.columnEdit) {
6414
+ if (readCached && props2.columnEdit) {
6402
6415
  try {
6403
- let columnState = commonUtils.CachedManager.syncCachedGet(props.storageKey);
6416
+ let columnState = commonUtils.CachedManager.syncCachedGet(props2.storageKey);
6404
6417
  if (!columnState) {
6405
- columnState = await commonUtils.CachedManager.asyncCachedGet(props.storageKey);
6418
+ columnState = await commonUtils.CachedManager.asyncCachedGet(props2.storageKey);
6406
6419
  }
6407
- props.columns._skip = true;
6420
+ props2.columns._skip = true;
6408
6421
  if (columnState) {
6409
6422
  if (typeof columnState === "string") {
6410
6423
  columnState = JSON.parse(columnState);
@@ -6430,7 +6443,7 @@ __sfc_main.setup = (__props, __ctx) => {
6430
6443
  }
6431
6444
  tableColumns.value = columns.sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
6432
6445
  vueDemi.nextTick(() => {
6433
- props.columns._skip = false;
6446
+ props2.columns._skip = false;
6434
6447
  });
6435
6448
  elTableRefKey.value = Date.now();
6436
6449
  };
@@ -6441,9 +6454,9 @@ __sfc_main.setup = (__props, __ctx) => {
6441
6454
  initColumn();
6442
6455
  vueDemi.onBeforeMount(() => {
6443
6456
  vueDemi.watch(() => {
6444
- return props.columns;
6457
+ return props2.columns;
6445
6458
  }, async () => {
6446
- if (props.columns._skip) {
6459
+ if (props2.columns._skip) {
6447
6460
  return;
6448
6461
  }
6449
6462
  localShowColumn.value = initLocalShow();
@@ -6466,30 +6479,30 @@ __sfc_main.setup = (__props, __ctx) => {
6466
6479
  },
6467
6480
  resizable: true,
6468
6481
  border: true,
6469
- ...props.tableAttrs
6482
+ ...props2.tableAttrs
6470
6483
  };
6471
6484
  delete obj.data;
6472
6485
  return obj;
6473
6486
  });
6474
6487
  const tableEventer = vueDemi.computed(() => {
6475
6488
  const obj = {
6476
- ...props.tableEvents,
6489
+ ...props2.tableEvents,
6477
6490
  "header-dragend": headerDragend
6478
6491
  };
6479
6492
  return obj;
6480
6493
  });
6481
6494
  const pageSizes = vueDemi.ref([10, 20, 30, 40, 50, 100, 200]);
6482
6495
  const initPageSizes = () => {
6483
- const pageSizeArr = props.pageAttrs["page-sizes"];
6484
- if (props.pageAttrs["page-size"] < ((pageSizeArr == null ? void 0 : pageSizeArr.length) ? pageSizeArr[0] : 10)) {
6485
- pageSizes.value.unshift(props.pageAttrs["page-size"]);
6496
+ const pageSizeArr = props2.pageAttrs["page-sizes"];
6497
+ if (props2.pageAttrs["page-size"] < ((pageSizeArr == null ? void 0 : pageSizeArr.length) ? pageSizeArr[0] : 10)) {
6498
+ pageSizes.value.unshift(props2.pageAttrs["page-size"]);
6486
6499
  }
6487
6500
  };
6488
6501
  const showPage = vueDemi.computed(() => {
6489
- return showData.value.length > props.pageAttrs["page-size"];
6502
+ return showData.value.length > props2.pageAttrs["page-size"];
6490
6503
  });
6491
6504
  const renderPage = vueDemi.computed(() => {
6492
- return props.alwaysShowPage || showPage.value;
6505
+ return props2.alwaysShowPage || showPage.value;
6493
6506
  });
6494
6507
  initPageSizes();
6495
6508
  const pageAttrer = vueDemi.computed(() => {
@@ -6498,8 +6511,8 @@ __sfc_main.setup = (__props, __ctx) => {
6498
6511
  background: false,
6499
6512
  layout: "total, sizes, prev, pager, next, jumper",
6500
6513
  "page-sizes": pageSizes.value,
6501
- total: typeof props.pageAttrs.total === "undefined" ? (_a2 = props.data) == null ? void 0 : _a2.length : void 0,
6502
- ...props.pageAttrs
6514
+ total: typeof props2.pageAttrs.total === "undefined" ? (_a2 = props2.data) == null ? void 0 : _a2.length : void 0,
6515
+ ...props2.pageAttrs
6503
6516
  };
6504
6517
  });
6505
6518
  const isShow = (row) => {
@@ -6567,15 +6580,15 @@ __sfc_main.setup = (__props, __ctx) => {
6567
6580
  if (newWidth < minWidth) {
6568
6581
  column.width = minWidth;
6569
6582
  }
6570
- if (props.dragCached) {
6571
- const columnCachedData = await commonUtils.CachedManager.asyncCachedGet(`${props.storageKey}$drag-column-width`) || {};
6583
+ if (props2.dragCached) {
6584
+ const columnCachedData = await commonUtils.CachedManager.asyncCachedGet(`${props2.storageKey}$drag-column-width`) || {};
6572
6585
  columnCachedData[column.property] = column.width;
6573
- await commonUtils.CachedManager.asyncCachedSet(`${props.storageKey}$drag-column-width`, columnCachedData);
6586
+ await commonUtils.CachedManager.asyncCachedSet(`${props2.storageKey}$drag-column-width`, columnCachedData);
6574
6587
  }
6575
- await ((_b = (_a2 = props.tableEvents)["header-dragend"]) == null ? void 0 : _b.call(_a2, newWidth, oldWidth, column, event));
6588
+ await ((_b = (_a2 = props2.tableEvents)["header-dragend"]) == null ? void 0 : _b.call(_a2, newWidth, oldWidth, column, event));
6576
6589
  };
6577
6590
  const columnCheckConfirmFeedback = (value) => {
6578
- if (!props.columnEdit) {
6591
+ if (!props2.columnEdit) {
6579
6592
  const itemsList = [];
6580
6593
  for (const key in value) {
6581
6594
  if (value[key]) {
@@ -6607,7 +6620,7 @@ __sfc_main.setup = (__props, __ctx) => {
6607
6620
  };
6608
6621
  const calcTableHeight = () => {
6609
6622
  var _a2, _b;
6610
- if (props.calHeight && nfTableContent.value) {
6623
+ if (props2.calHeight && nfTableContent.value) {
6611
6624
  const tableContentH = (_a2 = nfTableContent.value) == null ? void 0 : _a2.offsetHeight;
6612
6625
  const actionH = nfTableActionContainerRef.value.offsetHeight;
6613
6626
  const h = tableContentH - actionH;
@@ -6615,14 +6628,14 @@ __sfc_main.setup = (__props, __ctx) => {
6615
6628
  elTableHeight.value = h;
6616
6629
  }
6617
6630
  } else {
6618
- elTableHeight.value = (_b = props.tableAttrs) == null ? void 0 : _b.height;
6631
+ elTableHeight.value = (_b = props2.tableAttrs) == null ? void 0 : _b.height;
6619
6632
  }
6620
6633
  };
6621
6634
  vueDemi.onMounted(() => {
6622
6635
  calcTableHeight();
6623
- props.columns.forEach((i) => {
6636
+ props2.columns.forEach((i) => {
6624
6637
  if (i.singleHeadMutiColSlot) {
6625
- console.log("🔅 ~ onMounted ~ props.columns:", props.columns);
6638
+ console.log("🔅 ~ onMounted ~ props.columns:", props2.columns);
6626
6639
  }
6627
6640
  });
6628
6641
  });
@@ -6780,7 +6793,9 @@ __sfc_main.setup = (__props, __ctx) => {
6780
6793
  * 列编辑同步cookies到组件渲染数据
6781
6794
  */
6782
6795
  syncCookiesToTableColumn,
6783
- elTableRefKey
6796
+ elTableRefKey,
6797
+ clearDragCached,
6798
+ clearColumnEditCached
6784
6799
  });
6785
6800
  };
6786
6801
  __sfc_main.components = Object.assign({
@@ -148,14 +148,14 @@ __sfc_main$2.props = {
148
148
  };
149
149
  __sfc_main$2.setup = (__props, __ctx) => {
150
150
  var _a;
151
- const props = __props;
151
+ const props2 = __props;
152
152
  const emit = __ctx.emit;
153
153
  (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
154
154
  const tableData = ref({});
155
155
  const unChangedColumn = ref([]);
156
156
  const visible = computed({
157
157
  get() {
158
- return props.show;
158
+ return props2.show;
159
159
  },
160
160
  set(val) {
161
161
  emit("update:show", val);
@@ -163,9 +163,9 @@ __sfc_main$2.setup = (__props, __ctx) => {
163
163
  });
164
164
  const fields = computed(() => {
165
165
  const obj = {};
166
- props.tableColumns.filter((item) => !item.destory).map((item) => {
166
+ props2.tableColumns.filter((item) => !item.destory).map((item) => {
167
167
  if (!item.type) {
168
- const key = item.category || props.basicFieldDesc;
168
+ const key = item.category || props2.basicFieldDesc;
169
169
  if (!obj[key]) {
170
170
  obj[key] = [];
171
171
  }
@@ -184,7 +184,7 @@ __sfc_main$2.setup = (__props, __ctx) => {
184
184
  const submit = () => {
185
185
  visible.value = false;
186
186
  const columnState = {};
187
- props.tableColumns.map((i, index2) => {
187
+ props2.tableColumns.map((i, index2) => {
188
188
  var _a2;
189
189
  columnState[i.prop] = {
190
190
  initHidden: !tableData.value[i.prop] || false,
@@ -194,24 +194,24 @@ __sfc_main$2.setup = (__props, __ctx) => {
194
194
  };
195
195
  });
196
196
  emit("save", tableData.value);
197
- if (props.columnEdit) {
198
- CachedManager.syncCachedSet(props.storageKey, columnState);
197
+ if (props2.columnEdit) {
198
+ CachedManager.syncCachedSet(props2.storageKey, columnState);
199
199
  }
200
200
  };
201
201
  const addInitValue = () => {
202
202
  const obj = {};
203
- props.tableColumns.forEach((v) => {
203
+ props2.tableColumns.forEach((v) => {
204
204
  obj[v.prop] = !v.initHidden;
205
205
  });
206
206
  tableData.value = obj;
207
- if (props.tableColumns.findIndex((item) => !!item.type) > -1) {
207
+ if (props2.tableColumns.findIndex((item) => !!item.type) > -1) {
208
208
  unChangedColumn.value.push("selection");
209
209
  }
210
- if (props.tableColumns.findIndex((item) => {
210
+ if (props2.tableColumns.findIndex((item) => {
211
211
  var _a2;
212
- return (item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop)) === props.operationPropKey;
212
+ return (item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop)) === props2.operationPropKey;
213
213
  }) > -1) {
214
- unChangedColumn.value.push(props.operationPropKey);
214
+ unChangedColumn.value.push(props2.operationPropKey);
215
215
  }
216
216
  };
217
217
  onMounted(() => {
@@ -4861,9 +4861,9 @@ const require$$0 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
4861
4861
  if (!componentData) {
4862
4862
  return attributes;
4863
4863
  }
4864
- var on2 = componentData.on, props2 = componentData.props, componentDataAttrs = componentData.attrs;
4864
+ var on2 = componentData.on, props3 = componentData.props, componentDataAttrs = componentData.attrs;
4865
4865
  update("on", on2);
4866
- update("props", props2);
4866
+ update("props", props3);
4867
4867
  Object.assign(attributes.attrs, componentDataAttrs);
4868
4868
  return attributes;
4869
4869
  }
@@ -4873,7 +4873,7 @@ const require$$0 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
4873
4873
  return "on" + evt;
4874
4874
  });
4875
4875
  var draggingElement = null;
4876
- var props = {
4876
+ var props2 = {
4877
4877
  options: Object,
4878
4878
  list: {
4879
4879
  type: Array,
@@ -4916,7 +4916,7 @@ const require$$0 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
4916
4916
  var draggableComponent = {
4917
4917
  name: "draggable",
4918
4918
  inheritAttrs: false,
4919
- props,
4919
+ props: props2,
4920
4920
  data: function data() {
4921
4921
  return {
4922
4922
  transitionMode: false,
@@ -5330,20 +5330,20 @@ __sfc_main$1.props = {
5330
5330
  __sfc_main$1.setup = (__props, __ctx) => {
5331
5331
  var _a;
5332
5332
  const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
5333
- const props = __props;
5333
+ const props2 = __props;
5334
5334
  const currentTable = ref([]);
5335
5335
  const showColumn = ref([]);
5336
5336
  const unChangedColumn = ref([]);
5337
5337
  const fixedColumn = ref([]);
5338
5338
  const unFixedColumn = ref([]);
5339
5339
  onBeforeMount(() => {
5340
- currentTable.value = deepClone(props.tableColumns.filter((item) => !item.destory)).sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
5340
+ currentTable.value = deepClone(props2.tableColumns.filter((item) => !item.destory)).sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
5341
5341
  currentTable.value.map((i) => {
5342
5342
  if (!i.attr) {
5343
5343
  i.attr = {};
5344
5344
  }
5345
5345
  });
5346
- const list = props.tableColumns.filter((item) => !item.destory);
5346
+ const list = props2.tableColumns.filter((item) => !item.destory);
5347
5347
  setFields(list);
5348
5348
  updateColumn();
5349
5349
  if (currentTable.value.findIndex((item) => !!item.type) > -1) {
@@ -5351,9 +5351,9 @@ __sfc_main$1.setup = (__props, __ctx) => {
5351
5351
  }
5352
5352
  if (currentTable.value.findIndex((item) => {
5353
5353
  var _a2;
5354
- return (item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop)) === props.operationPropKey;
5354
+ return (item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop)) === props2.operationPropKey;
5355
5355
  }) > -1) {
5356
- unChangedColumn.value.push(props.operationPropKey);
5356
+ unChangedColumn.value.push(props2.operationPropKey);
5357
5357
  }
5358
5358
  if (currentTable.value.every((i) => !i.initHidden)) {
5359
5359
  showColumn.value = currentTable.value.map((i) => i.prop);
@@ -5366,7 +5366,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
5366
5366
  const setFields = (tableColumns) => {
5367
5367
  const obj = {};
5368
5368
  tableColumns.map((item) => {
5369
- const key = item.category || props.basicFieldDesc;
5369
+ const key = item.category || props2.basicFieldDesc;
5370
5370
  if (!obj[key]) {
5371
5371
  obj[key] = [];
5372
5372
  }
@@ -5456,12 +5456,12 @@ __sfc_main$1.setup = (__props, __ctx) => {
5456
5456
  const syncTableColumnsToCookies = () => {
5457
5457
  var _a2;
5458
5458
  const newTableColumns = [...fixedColumn.value, ...unFixedColumn.value];
5459
- if (newTableColumns.filter((item) => !item.type && item.prop !== props.operationPropKey && !item.initHidden).length === 0) {
5459
+ if (newTableColumns.filter((item) => !item.type && item.prop !== props2.operationPropKey && !item.initHidden).length === 0) {
5460
5460
  (_a2 = instance == null ? void 0 : instance.$openMessage) == null ? void 0 : _a2.warning({
5461
- message: props.selectEmptyWarningTips,
5461
+ message: props2.selectEmptyWarningTips,
5462
5462
  duration: 2e3
5463
5463
  });
5464
- throw new Error(props.selectEmptyWarningTips);
5464
+ throw new Error(props2.selectEmptyWarningTips);
5465
5465
  }
5466
5466
  const selectionPropItemIndex = newTableColumns.findIndex((item) => !!item.type);
5467
5467
  if (selectionPropItemIndex > -1) {
@@ -5469,7 +5469,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
5469
5469
  }
5470
5470
  const operationPropItemIndex = newTableColumns.findIndex((item) => {
5471
5471
  var _a3;
5472
- return (item.prop || ((_a3 = item.attr) == null ? void 0 : _a3.prop)) === props.operationPropKey;
5472
+ return (item.prop || ((_a3 = item.attr) == null ? void 0 : _a3.prop)) === props2.operationPropKey;
5473
5473
  });
5474
5474
  if (operationPropItemIndex > -1) {
5475
5475
  newTableColumns.push(newTableColumns.splice(operationPropItemIndex, 1)[0]);
@@ -5486,8 +5486,8 @@ __sfc_main$1.setup = (__props, __ctx) => {
5486
5486
  };
5487
5487
  obj[i.prop] = !columnState[i.prop].initHidden;
5488
5488
  });
5489
- if (props.columnEdit) {
5490
- CachedManager.syncCachedSet(props.storageKey, columnState);
5489
+ if (props2.columnEdit) {
5490
+ CachedManager.syncCachedSet(props2.storageKey, columnState);
5491
5491
  }
5492
5492
  return obj;
5493
5493
  };
@@ -5771,6 +5771,12 @@ const _sfc_render$1 = null;
5771
5771
  const _sfc_staticRenderFns$1 = null;
5772
5772
  var __component__$1 = /* @__PURE__ */ normalizeComponent(_sfc_main, _sfc_render$1, _sfc_staticRenderFns$1, false, null, null, null, null);
5773
5773
  const RenderComponent = __component__$1.exports;
5774
+ async function clearDragCached() {
5775
+ await CachedManager.asyncCachedSet(`${props.storageKey}$drag-column-width`, null);
5776
+ }
5777
+ async function clearColumnEditCached() {
5778
+ await CachedManager.asyncCachedSet(props.storageKey, null);
5779
+ }
5774
5780
  const __sfc_main = defineComponent({
5775
5781
  name: "nf-table"
5776
5782
  });
@@ -6178,7 +6184,7 @@ __sfc_main.props = {
6178
6184
  };
6179
6185
  __sfc_main.setup = (__props, __ctx) => {
6180
6186
  var _a;
6181
- const props = __props;
6187
+ const props2 = __props;
6182
6188
  const emit = __ctx.emit;
6183
6189
  const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
6184
6190
  const elTableRef = ref();
@@ -6194,15 +6200,15 @@ __sfc_main.setup = (__props, __ctx) => {
6194
6200
  const elTableHeight = ref();
6195
6201
  const nfColumCheckDialogVisible = ref(false);
6196
6202
  const showData = computed(() => {
6197
- const pageSize = props.pageAttrs["page-size"];
6198
- const currentPage = props.pageAttrs["current-page"] || 1;
6199
- const noTotal = typeof props.pageAttrs.total === "undefined";
6203
+ const pageSize = props2.pageAttrs["page-size"];
6204
+ const currentPage = props2.pageAttrs["current-page"] || 1;
6205
+ const noTotal = typeof props2.pageAttrs.total === "undefined";
6200
6206
  if (!pageSize || !noTotal)
6201
- return props.data;
6202
- if (props.data.length > pageSize) {
6203
- return props.data.slice((currentPage - 1) * pageSize, currentPage * pageSize);
6207
+ return props2.data;
6208
+ if (props2.data.length > pageSize) {
6209
+ return props2.data.slice((currentPage - 1) * pageSize, currentPage * pageSize);
6204
6210
  } else {
6205
- return props.data;
6211
+ return props2.data;
6206
6212
  }
6207
6213
  });
6208
6214
  const hasOperationSlot = computed(() => {
@@ -6213,10 +6219,10 @@ __sfc_main.setup = (__props, __ctx) => {
6213
6219
  });
6214
6220
  const loadingInstance = ref();
6215
6221
  watch(() => {
6216
- return props.loading;
6222
+ return props2.loading;
6217
6223
  }, async () => {
6218
6224
  var _a2, _b;
6219
- if (props.loading) {
6225
+ if (props2.loading) {
6220
6226
  await nextTick();
6221
6227
  const {
6222
6228
  target,
@@ -6226,7 +6232,7 @@ __sfc_main.setup = (__props, __ctx) => {
6226
6232
  spinner,
6227
6233
  background,
6228
6234
  customClass
6229
- } = props;
6235
+ } = props2;
6230
6236
  loadingInstance.value = Loading.service({
6231
6237
  target: target || ((_a2 = elTableRef.value) == null ? void 0 : _a2.$el) || document.body,
6232
6238
  lock,
@@ -6244,12 +6250,12 @@ __sfc_main.setup = (__props, __ctx) => {
6244
6250
  });
6245
6251
  const initLocalShow = (init = false) => {
6246
6252
  if (!init) {
6247
- props.columns._skip = true;
6253
+ props2.columns._skip = true;
6248
6254
  }
6249
- const result = props.columns.filter((item) => {
6255
+ const result = props2.columns.filter((item) => {
6250
6256
  var _a2, _b;
6251
6257
  const prop = item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
6252
- if ((_b = props.showColumn) == null ? void 0 : _b.includes(prop)) {
6258
+ if ((_b = props2.showColumn) == null ? void 0 : _b.includes(prop)) {
6253
6259
  item.initHidden = false;
6254
6260
  }
6255
6261
  return !item.initHidden;
@@ -6259,13 +6265,13 @@ __sfc_main.setup = (__props, __ctx) => {
6259
6265
  });
6260
6266
  if (!init) {
6261
6267
  nextTick(() => {
6262
- props.columns._skip = false;
6268
+ props2.columns._skip = false;
6263
6269
  });
6264
6270
  }
6265
6271
  if (result.length) {
6266
6272
  return result;
6267
6273
  }
6268
- return props.columns.map((item) => {
6274
+ return props2.columns.map((item) => {
6269
6275
  var _a2;
6270
6276
  return item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
6271
6277
  });
@@ -6280,9 +6286,9 @@ __sfc_main.setup = (__props, __ctx) => {
6280
6286
  immediate: true
6281
6287
  });
6282
6288
  const syncLocalShowColumnToCookies = () => {
6283
- if (props.columnEdit) {
6289
+ if (props2.columnEdit) {
6284
6290
  const columnState = {};
6285
- props.columns.map((i, index2) => {
6291
+ props2.columns.map((i, index2) => {
6286
6292
  var _a2, _b;
6287
6293
  const prop = i.prop || ((_a2 = i.attr) == null ? void 0 : _a2.prop);
6288
6294
  columnState[prop] = {
@@ -6292,12 +6298,12 @@ __sfc_main.setup = (__props, __ctx) => {
6292
6298
  index: index2
6293
6299
  };
6294
6300
  });
6295
- return CachedManager.syncCachedSet(props.storageKey, columnState);
6301
+ return CachedManager.syncCachedSet(props2.storageKey, columnState);
6296
6302
  }
6297
6303
  };
6298
6304
  const syncShowItemToInitHidden = () => {
6299
- props.columns._skip = true;
6300
- props.columns.forEach((item) => {
6305
+ props2.columns._skip = true;
6306
+ props2.columns.forEach((item) => {
6301
6307
  var _a2, _b;
6302
6308
  const prop = item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
6303
6309
  if ((_b = localShowColumn.value) == null ? void 0 : _b.includes(prop)) {
@@ -6307,15 +6313,15 @@ __sfc_main.setup = (__props, __ctx) => {
6307
6313
  }
6308
6314
  });
6309
6315
  nextTick(() => {
6310
- props.columns._skip = false;
6316
+ props2.columns._skip = false;
6311
6317
  });
6312
6318
  };
6313
6319
  const syncCookiesToLocalShowColumn = async () => {
6314
- if (props.columnEdit) {
6320
+ if (props2.columnEdit) {
6315
6321
  try {
6316
- let columnState = CachedManager.syncCachedGet(props.storageKey);
6322
+ let columnState = CachedManager.syncCachedGet(props2.storageKey);
6317
6323
  if (!columnState) {
6318
- columnState = await CachedManager.asyncCachedGet(props.storageKey);
6324
+ columnState = await CachedManager.asyncCachedGet(props2.storageKey);
6319
6325
  }
6320
6326
  if (columnState) {
6321
6327
  if (typeof columnState === "string") {
@@ -6337,13 +6343,13 @@ __sfc_main.setup = (__props, __ctx) => {
6337
6343
  };
6338
6344
  const initCachedData = async () => {
6339
6345
  var _a2, _b;
6340
- if (props.columnEdit) {
6346
+ if (props2.columnEdit) {
6341
6347
  try {
6342
- let cached = CachedManager.syncCachedGet(props.storageKey);
6348
+ let cached = CachedManager.syncCachedGet(props2.storageKey);
6343
6349
  if (!cached) {
6344
- cached = await CachedManager.asyncCachedGet(props.storageKey);
6350
+ cached = await CachedManager.asyncCachedGet(props2.storageKey);
6345
6351
  }
6346
- const cachedPriority = props.priority === "cached";
6352
+ const cachedPriority = props2.priority === "cached";
6347
6353
  if (cachedPriority ? cached : (_a2 = localShowColumn.value) == null ? void 0 : _a2.length) {
6348
6354
  cachedPriority ? await syncCookiesToLocalShowColumn() : await syncLocalShowColumnToCookies();
6349
6355
  } else if (cachedPriority ? (_b = localShowColumn.value) == null ? void 0 : _b.length : cached) {
@@ -6353,13 +6359,20 @@ __sfc_main.setup = (__props, __ctx) => {
6353
6359
  console.log(e);
6354
6360
  }
6355
6361
  }
6356
- if (props.dragCached) {
6357
- await CachedManager.asyncCachedGet(`${props.storageKey}$drag-column-width`);
6362
+ if (props2.dragCached) {
6363
+ await CachedManager.asyncCachedGet(`${props2.storageKey}$drag-column-width`);
6358
6364
  }
6359
6365
  };
6360
6366
  const getMinWidth = (column) => {
6367
+ var _a2;
6368
+ if (((_a2 = column.label) == null ? void 0 : _a2.indexOf("$$")) === 0) {
6369
+ const value = Number(column.label.replace("$$"));
6370
+ if (!Number.isNaN(value) && value) {
6371
+ return value;
6372
+ }
6373
+ }
6361
6374
  const fs = 14;
6362
- const label = column.customLabel || column.label;
6375
+ const label = column.label;
6363
6376
  const char = label.match(/[\u2E80-\u9FFF]/g);
6364
6377
  const charLen = char ? char.length : 0;
6365
6378
  const num = label.match(/\d|\./g);
@@ -6370,16 +6383,16 @@ __sfc_main.setup = (__props, __ctx) => {
6370
6383
  const tableColumns = ref([]);
6371
6384
  const elTableRefKey = ref(Date.now());
6372
6385
  const syncCookiesToTableColumn = async (readCached = true, init = false) => {
6373
- props.columns._skip = true;
6374
- const columns = props.columns.map((item, index2) => {
6386
+ props2.columns._skip = true;
6387
+ const columns = props2.columns.map((item, index2) => {
6375
6388
  var _a2;
6376
6389
  const attr = item.attr || {};
6377
6390
  if (!attr["min-width"] && item.label) {
6378
6391
  attr["min-width"] = String(getMinWidth(item)) + "px";
6379
6392
  }
6380
- if (init && props.dragCached) {
6393
+ if (init && props2.dragCached) {
6381
6394
  const prop = item.prop || ((_a2 = item.attr) == null ? void 0 : _a2.prop);
6382
- let columnWidth = CachedManager.syncCachedGet(`${props.storageKey}$drag-column-width`) || {};
6395
+ let columnWidth = CachedManager.syncCachedGet(`${props2.storageKey}$drag-column-width`) || {};
6383
6396
  if (columnWidth[prop]) {
6384
6397
  attr.width = columnWidth[prop];
6385
6398
  }
@@ -6396,13 +6409,13 @@ __sfc_main.setup = (__props, __ctx) => {
6396
6409
  item.__index = index2;
6397
6410
  return item;
6398
6411
  });
6399
- if (readCached && props.columnEdit) {
6412
+ if (readCached && props2.columnEdit) {
6400
6413
  try {
6401
- let columnState = CachedManager.syncCachedGet(props.storageKey);
6414
+ let columnState = CachedManager.syncCachedGet(props2.storageKey);
6402
6415
  if (!columnState) {
6403
- columnState = await CachedManager.asyncCachedGet(props.storageKey);
6416
+ columnState = await CachedManager.asyncCachedGet(props2.storageKey);
6404
6417
  }
6405
- props.columns._skip = true;
6418
+ props2.columns._skip = true;
6406
6419
  if (columnState) {
6407
6420
  if (typeof columnState === "string") {
6408
6421
  columnState = JSON.parse(columnState);
@@ -6428,7 +6441,7 @@ __sfc_main.setup = (__props, __ctx) => {
6428
6441
  }
6429
6442
  tableColumns.value = columns.sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
6430
6443
  nextTick(() => {
6431
- props.columns._skip = false;
6444
+ props2.columns._skip = false;
6432
6445
  });
6433
6446
  elTableRefKey.value = Date.now();
6434
6447
  };
@@ -6439,9 +6452,9 @@ __sfc_main.setup = (__props, __ctx) => {
6439
6452
  initColumn();
6440
6453
  onBeforeMount(() => {
6441
6454
  watch(() => {
6442
- return props.columns;
6455
+ return props2.columns;
6443
6456
  }, async () => {
6444
- if (props.columns._skip) {
6457
+ if (props2.columns._skip) {
6445
6458
  return;
6446
6459
  }
6447
6460
  localShowColumn.value = initLocalShow();
@@ -6464,30 +6477,30 @@ __sfc_main.setup = (__props, __ctx) => {
6464
6477
  },
6465
6478
  resizable: true,
6466
6479
  border: true,
6467
- ...props.tableAttrs
6480
+ ...props2.tableAttrs
6468
6481
  };
6469
6482
  delete obj.data;
6470
6483
  return obj;
6471
6484
  });
6472
6485
  const tableEventer = computed(() => {
6473
6486
  const obj = {
6474
- ...props.tableEvents,
6487
+ ...props2.tableEvents,
6475
6488
  "header-dragend": headerDragend
6476
6489
  };
6477
6490
  return obj;
6478
6491
  });
6479
6492
  const pageSizes = ref([10, 20, 30, 40, 50, 100, 200]);
6480
6493
  const initPageSizes = () => {
6481
- const pageSizeArr = props.pageAttrs["page-sizes"];
6482
- if (props.pageAttrs["page-size"] < ((pageSizeArr == null ? void 0 : pageSizeArr.length) ? pageSizeArr[0] : 10)) {
6483
- pageSizes.value.unshift(props.pageAttrs["page-size"]);
6494
+ const pageSizeArr = props2.pageAttrs["page-sizes"];
6495
+ if (props2.pageAttrs["page-size"] < ((pageSizeArr == null ? void 0 : pageSizeArr.length) ? pageSizeArr[0] : 10)) {
6496
+ pageSizes.value.unshift(props2.pageAttrs["page-size"]);
6484
6497
  }
6485
6498
  };
6486
6499
  const showPage = computed(() => {
6487
- return showData.value.length > props.pageAttrs["page-size"];
6500
+ return showData.value.length > props2.pageAttrs["page-size"];
6488
6501
  });
6489
6502
  const renderPage = computed(() => {
6490
- return props.alwaysShowPage || showPage.value;
6503
+ return props2.alwaysShowPage || showPage.value;
6491
6504
  });
6492
6505
  initPageSizes();
6493
6506
  const pageAttrer = computed(() => {
@@ -6496,8 +6509,8 @@ __sfc_main.setup = (__props, __ctx) => {
6496
6509
  background: false,
6497
6510
  layout: "total, sizes, prev, pager, next, jumper",
6498
6511
  "page-sizes": pageSizes.value,
6499
- total: typeof props.pageAttrs.total === "undefined" ? (_a2 = props.data) == null ? void 0 : _a2.length : void 0,
6500
- ...props.pageAttrs
6512
+ total: typeof props2.pageAttrs.total === "undefined" ? (_a2 = props2.data) == null ? void 0 : _a2.length : void 0,
6513
+ ...props2.pageAttrs
6501
6514
  };
6502
6515
  });
6503
6516
  const isShow = (row) => {
@@ -6565,15 +6578,15 @@ __sfc_main.setup = (__props, __ctx) => {
6565
6578
  if (newWidth < minWidth) {
6566
6579
  column.width = minWidth;
6567
6580
  }
6568
- if (props.dragCached) {
6569
- const columnCachedData = await CachedManager.asyncCachedGet(`${props.storageKey}$drag-column-width`) || {};
6581
+ if (props2.dragCached) {
6582
+ const columnCachedData = await CachedManager.asyncCachedGet(`${props2.storageKey}$drag-column-width`) || {};
6570
6583
  columnCachedData[column.property] = column.width;
6571
- await CachedManager.asyncCachedSet(`${props.storageKey}$drag-column-width`, columnCachedData);
6584
+ await CachedManager.asyncCachedSet(`${props2.storageKey}$drag-column-width`, columnCachedData);
6572
6585
  }
6573
- await ((_b = (_a2 = props.tableEvents)["header-dragend"]) == null ? void 0 : _b.call(_a2, newWidth, oldWidth, column, event));
6586
+ await ((_b = (_a2 = props2.tableEvents)["header-dragend"]) == null ? void 0 : _b.call(_a2, newWidth, oldWidth, column, event));
6574
6587
  };
6575
6588
  const columnCheckConfirmFeedback = (value) => {
6576
- if (!props.columnEdit) {
6589
+ if (!props2.columnEdit) {
6577
6590
  const itemsList = [];
6578
6591
  for (const key in value) {
6579
6592
  if (value[key]) {
@@ -6605,7 +6618,7 @@ __sfc_main.setup = (__props, __ctx) => {
6605
6618
  };
6606
6619
  const calcTableHeight = () => {
6607
6620
  var _a2, _b;
6608
- if (props.calHeight && nfTableContent.value) {
6621
+ if (props2.calHeight && nfTableContent.value) {
6609
6622
  const tableContentH = (_a2 = nfTableContent.value) == null ? void 0 : _a2.offsetHeight;
6610
6623
  const actionH = nfTableActionContainerRef.value.offsetHeight;
6611
6624
  const h = tableContentH - actionH;
@@ -6613,14 +6626,14 @@ __sfc_main.setup = (__props, __ctx) => {
6613
6626
  elTableHeight.value = h;
6614
6627
  }
6615
6628
  } else {
6616
- elTableHeight.value = (_b = props.tableAttrs) == null ? void 0 : _b.height;
6629
+ elTableHeight.value = (_b = props2.tableAttrs) == null ? void 0 : _b.height;
6617
6630
  }
6618
6631
  };
6619
6632
  onMounted(() => {
6620
6633
  calcTableHeight();
6621
- props.columns.forEach((i) => {
6634
+ props2.columns.forEach((i) => {
6622
6635
  if (i.singleHeadMutiColSlot) {
6623
- console.log("🔅 ~ onMounted ~ props.columns:", props.columns);
6636
+ console.log("🔅 ~ onMounted ~ props.columns:", props2.columns);
6624
6637
  }
6625
6638
  });
6626
6639
  });
@@ -6778,7 +6791,9 @@ __sfc_main.setup = (__props, __ctx) => {
6778
6791
  * 列编辑同步cookies到组件渲染数据
6779
6792
  */
6780
6793
  syncCookiesToTableColumn,
6781
- elTableRefKey
6794
+ elTableRefKey,
6795
+ clearDragCached,
6796
+ clearColumnEditCached
6782
6797
  });
6783
6798
  };
6784
6799
  __sfc_main.components = Object.assign({
@@ -345,6 +345,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
345
345
  syncCookiesToLocalShowColumn: () => Promise<void>;
346
346
  syncCookiesToTableColumn: (readCached?: boolean, init?: boolean) => Promise<void>;
347
347
  elTableRefKey: import("vue-demi").Ref<number>;
348
+ clearDragCached: () => Promise<void>;
349
+ clearColumnEditCached: () => Promise<void>;
348
350
  }, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
349
351
  fieldsChange: (event: string[]) => void;
350
352
  "update:showColumn": (event: string[] | undefined) => void;
@@ -920,8 +920,14 @@ const initCachedData = async () => {
920
920
  }
921
921
 
922
922
  const getMinWidth = (column) => {
923
+ if (column.label?.indexOf('$$') === 0) {
924
+ const value = Number(column.label.replace('$$'))
925
+ if (!Number.isNaN(value) && value) {
926
+ return value
927
+ }
928
+ }
923
929
  const fs = 14
924
- const label = column.customLabel || column.label
930
+ const label = column.label
925
931
  const char = label.match(/[\u2E80-\u9FFF]/g)
926
932
  const charLen = char ? char.length : 0
927
933
  const num = label.match(/\d|\./g)
@@ -1132,6 +1138,13 @@ const headerDragend = async (newWidth, oldWidth, column, event) => {
1132
1138
  await props.tableEvents['header-dragend']?.(newWidth, oldWidth, column, event)
1133
1139
  }
1134
1140
 
1141
+ export async function clearDragCached() {
1142
+ await CachedManager.asyncCachedSet(`${props.storageKey}$drag-column-width`, null)
1143
+ }
1144
+
1145
+ export async function clearColumnEditCached() {
1146
+ await CachedManager.asyncCachedSet(props.storageKey, null)
1147
+ }
1135
1148
 
1136
1149
  const columnCheckConfirmFeedback = (value: Record<string, any>) => {
1137
1150
  if (!props.columnEdit) {
@@ -1332,7 +1345,9 @@ defineExpose({
1332
1345
  * 列编辑同步cookies到组件渲染数据
1333
1346
  */
1334
1347
  syncCookiesToTableColumn,
1335
- elTableRefKey
1348
+ elTableRefKey,
1349
+ clearDragCached,
1350
+ clearColumnEditCached
1336
1351
  })
1337
1352
 
1338
1353
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-table",
3
- "version": "3.2.69",
3
+ "version": "3.2.71",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "zoujiahe <zoujiahe@94ai.com>",
@@ -14,12 +14,12 @@
14
14
  "url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/common-utils": "^3.2.69",
18
- "@94ai/nf-button": "^3.2.69",
19
- "@94ai/nf-drawer": "^3.2.69",
20
- "@94ai/nf-message": "^3.2.69",
21
- "@94ai/nf-search-form": "^3.2.69",
22
- "@94ai/nf-theme-chalk": "^3.2.69",
17
+ "@94ai/common-utils": "^3.2.71",
18
+ "@94ai/nf-button": "^3.2.71",
19
+ "@94ai/nf-drawer": "^3.2.71",
20
+ "@94ai/nf-message": "^3.2.71",
21
+ "@94ai/nf-search-form": "^3.2.71",
22
+ "@94ai/nf-theme-chalk": "^3.2.71",
23
23
  "idb-keyval": "^6.2.1",
24
24
  "vue-demi": "^0.14.5",
25
25
  "vuedraggable": "^2.24.3"
@@ -37,5 +37,5 @@
37
37
  "types": "lib/index.d.ts",
38
38
  "main": "lib/nf-table.cjs.js",
39
39
  "module": "lib/nf-table.esm-bundler.js",
40
- "gitHead": "5a0c98a10f4bc189c07b4e947ffedb4f9aa0c568"
40
+ "gitHead": "7dd798a04d78ba60682dc8db365591e980029d37"
41
41
  }