@94ai/nf-table 3.2.29 → 3.2.34

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
@@ -888,6 +888,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
888
888
  _index?: number | undefined;
889
889
  __index?: number | undefined;
890
890
  initHidden?: boolean | undefined;
891
+ destory?: boolean | undefined;
891
892
  type?: "index" | "selection" | "expand" | undefined;
892
893
  label?: string | undefined;
893
894
  prop?: string | undefined;
@@ -1488,6 +1489,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1488
1489
  _index?: number | undefined;
1489
1490
  __index?: number | undefined;
1490
1491
  initHidden?: boolean | undefined;
1492
+ destory?: boolean | undefined;
1491
1493
  type?: "index" | "selection" | "expand" | undefined;
1492
1494
  label?: string | undefined;
1493
1495
  prop?: string | undefined;
@@ -1915,6 +1917,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1915
1917
  _index?: number | undefined;
1916
1918
  __index?: number | undefined;
1917
1919
  initHidden?: boolean | undefined;
1920
+ destory?: boolean | undefined;
1918
1921
  type?: "index" | "selection" | "expand" | undefined;
1919
1922
  label?: string | undefined;
1920
1923
  prop?: string | undefined;
@@ -5317,13 +5317,14 @@ __sfc_main$1.setup = (__props, __ctx) => {
5317
5317
  const fixedColumn = vueDemi.ref([]);
5318
5318
  const unFixedColumn = vueDemi.ref([]);
5319
5319
  vueDemi.onBeforeMount(() => {
5320
- currentTable.value = deepClone(props.tableColumns).sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
5320
+ 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);
5321
5321
  currentTable.value.map((i) => {
5322
5322
  if (!i.attr) {
5323
5323
  i.attr = {};
5324
5324
  }
5325
5325
  });
5326
- setFields(props.tableColumns);
5326
+ const list = props.tableColumns.filter((item) => !item.destory);
5327
+ setFields(list);
5327
5328
  updateColumn();
5328
5329
  if (currentTable.value.findIndex((item) => !!item.type) > -1) {
5329
5330
  unChangedColumn.value.push("selection");
@@ -5336,7 +5337,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
5336
5337
  }
5337
5338
  if (currentTable.value.every((i) => !i.initHidden)) {
5338
5339
  showColumn.value = currentTable.value.map((i) => i.prop);
5339
- checkedCount.value = props.tableColumns.length;
5340
+ checkedCount.value = list.length;
5340
5341
  checkAll.value = true;
5341
5342
  isIndeterminate.value = false;
5342
5343
  }
@@ -6365,7 +6366,7 @@ __sfc_main.setup = (__props, __ctx) => {
6365
6366
  if (props.columns._skip) {
6366
6367
  return;
6367
6368
  }
6368
- syncCookiesToTableColumn();
6369
+ syncCookiesToTableColumn(false);
6369
6370
  }, {
6370
6371
  deep: true
6371
6372
  });
@@ -6373,14 +6374,14 @@ __sfc_main.setup = (__props, __ctx) => {
6373
6374
  const tableAttrer = vueDemi.computed(() => {
6374
6375
  const obj = {
6375
6376
  "header-cell-style": {
6376
- "text-align": "center",
6377
+ "text-align": "left",
6377
6378
  "background": "#F5F7FA",
6378
6379
  "height": "48px",
6379
6380
  "color": "#303133",
6380
6381
  "font-size": "14px"
6381
6382
  },
6382
6383
  "cell-style": {
6383
- "text-align": "center"
6384
+ "text-align": "left"
6384
6385
  },
6385
6386
  resizable: true,
6386
6387
  border: true,
@@ -6422,10 +6423,13 @@ __sfc_main.setup = (__props, __ctx) => {
6422
6423
  });
6423
6424
  const isShow = (row) => {
6424
6425
  var _a2;
6425
- if (!((_a2 = localShowColumn.value) == null ? void 0 : _a2.length) || row.type) {
6426
+ if (row.type) {
6426
6427
  return true;
6427
6428
  }
6428
- return localShowColumn.value.includes(row.prop) && !row.initHidden;
6429
+ if (!((_a2 = localShowColumn.value) == null ? void 0 : _a2.length)) {
6430
+ return !row.initHidden && !row.destory;
6431
+ }
6432
+ return localShowColumn.value.includes(row.prop) && !row.initHidden && !row.destory;
6429
6433
  };
6430
6434
  const resetNfSearchFormModel = () => {
6431
6435
  var _a2;
@@ -5315,13 +5315,14 @@ __sfc_main$1.setup = (__props, __ctx) => {
5315
5315
  const fixedColumn = ref([]);
5316
5316
  const unFixedColumn = ref([]);
5317
5317
  onBeforeMount(() => {
5318
- currentTable.value = deepClone(props.tableColumns).sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
5318
+ 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);
5319
5319
  currentTable.value.map((i) => {
5320
5320
  if (!i.attr) {
5321
5321
  i.attr = {};
5322
5322
  }
5323
5323
  });
5324
- setFields(props.tableColumns);
5324
+ const list = props.tableColumns.filter((item) => !item.destory);
5325
+ setFields(list);
5325
5326
  updateColumn();
5326
5327
  if (currentTable.value.findIndex((item) => !!item.type) > -1) {
5327
5328
  unChangedColumn.value.push("selection");
@@ -5334,7 +5335,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
5334
5335
  }
5335
5336
  if (currentTable.value.every((i) => !i.initHidden)) {
5336
5337
  showColumn.value = currentTable.value.map((i) => i.prop);
5337
- checkedCount.value = props.tableColumns.length;
5338
+ checkedCount.value = list.length;
5338
5339
  checkAll.value = true;
5339
5340
  isIndeterminate.value = false;
5340
5341
  }
@@ -6363,7 +6364,7 @@ __sfc_main.setup = (__props, __ctx) => {
6363
6364
  if (props.columns._skip) {
6364
6365
  return;
6365
6366
  }
6366
- syncCookiesToTableColumn();
6367
+ syncCookiesToTableColumn(false);
6367
6368
  }, {
6368
6369
  deep: true
6369
6370
  });
@@ -6371,14 +6372,14 @@ __sfc_main.setup = (__props, __ctx) => {
6371
6372
  const tableAttrer = computed(() => {
6372
6373
  const obj = {
6373
6374
  "header-cell-style": {
6374
- "text-align": "center",
6375
+ "text-align": "left",
6375
6376
  "background": "#F5F7FA",
6376
6377
  "height": "48px",
6377
6378
  "color": "#303133",
6378
6379
  "font-size": "14px"
6379
6380
  },
6380
6381
  "cell-style": {
6381
- "text-align": "center"
6382
+ "text-align": "left"
6382
6383
  },
6383
6384
  resizable: true,
6384
6385
  border: true,
@@ -6420,10 +6421,13 @@ __sfc_main.setup = (__props, __ctx) => {
6420
6421
  });
6421
6422
  const isShow = (row) => {
6422
6423
  var _a2;
6423
- if (!((_a2 = localShowColumn.value) == null ? void 0 : _a2.length) || row.type) {
6424
+ if (row.type) {
6424
6425
  return true;
6425
6426
  }
6426
- return localShowColumn.value.includes(row.prop) && !row.initHidden;
6427
+ if (!((_a2 = localShowColumn.value) == null ? void 0 : _a2.length)) {
6428
+ return !row.initHidden && !row.destory;
6429
+ }
6430
+ return localShowColumn.value.includes(row.prop) && !row.initHidden && !row.destory;
6427
6431
  };
6428
6432
  const resetNfSearchFormModel = () => {
6429
6433
  var _a2;
@@ -295,6 +295,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
295
295
  _index?: number | undefined;
296
296
  __index?: number | undefined;
297
297
  initHidden?: boolean | undefined;
298
+ destory?: boolean | undefined;
298
299
  type?: "index" | "selection" | "expand" | undefined;
299
300
  label?: string | undefined;
300
301
  prop?: string | undefined;
@@ -719,6 +720,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
719
720
  _index?: number | undefined;
720
721
  __index?: number | undefined;
721
722
  initHidden?: boolean | undefined;
723
+ destory?: boolean | undefined;
722
724
  type?: "index" | "selection" | "expand" | undefined;
723
725
  label?: string | undefined;
724
726
  prop?: string | undefined;
package/lib/types.d.ts CHANGED
@@ -178,6 +178,7 @@ export interface NfTableColumnAttributes {
178
178
  _index?: number;
179
179
  __index?: number;
180
180
  initHidden?: boolean;
181
+ destory?: boolean;
181
182
  type?: 'selection' | 'index' | 'expand';
182
183
  label?: string;
183
184
  prop?: string;
@@ -183,7 +183,7 @@ const unFixedColumn = ref<Record<string, any>[]>([])
183
183
 
184
184
 
185
185
  onBeforeMount(() => {
186
- currentTable.value = deepClone(props.tableColumns).sort((a,b) => a._index! - b._index! < 0 ? -1 : a._index! - b._index! > 0 ? 1 : 0) as Record<string, any>[]
186
+ 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) as Record<string, any>[]
187
187
  // 兼容处理
188
188
  currentTable.value.map(i => {
189
189
  if (!i.attr) {
@@ -191,8 +191,10 @@ onBeforeMount(() => {
191
191
  }
192
192
  })
193
193
 
194
+ const list = props.tableColumns.filter(item => !item.destory)
195
+
194
196
  // 可选列表 → 字段区分
195
- setFields(props.tableColumns)
197
+ setFields(list)
196
198
  // 已选列表
197
199
  updateColumn()
198
200
  if (currentTable.value.findIndex((item) => !!item.type) > -1) {
@@ -203,7 +205,7 @@ onBeforeMount(() => {
203
205
  }
204
206
  if (currentTable.value.every(i => !i.initHidden)) {
205
207
  showColumn.value = currentTable.value.map(i => i.prop)
206
- checkedCount.value = props.tableColumns.length
208
+ checkedCount.value = list.length
207
209
  checkAll.value = true
208
210
  isIndeterminate.value = false
209
211
  }
@@ -951,7 +951,7 @@ onBeforeMount(() => {
951
951
  if (props.columns._skip) {
952
952
  return
953
953
  }
954
- syncCookiesToTableColumn()
954
+ syncCookiesToTableColumn(false)
955
955
  }, {
956
956
  deep: true
957
957
  })
@@ -960,13 +960,13 @@ onBeforeMount(() => {
960
960
  const tableAttrer = computed(() => {
961
961
  const obj: Record<string, any> = {
962
962
  'header-cell-style': {
963
- 'text-align': 'center',
963
+ 'text-align': 'left',
964
964
  'background': '#F5F7FA',
965
965
  'height': '48px',
966
966
  'color': '#303133',
967
967
  'font-size': '14px'
968
968
  },
969
- 'cell-style': { 'text-align': 'center' },
969
+ 'cell-style': { 'text-align': 'left' },
970
970
  resizable: true,
971
971
  border: true,
972
972
  ...props.tableAttrs
@@ -1012,10 +1012,13 @@ const pageAttrer = computed(() => {
1012
1012
  })
1013
1013
 
1014
1014
  const isShow = (row: Record<string, any>) => {
1015
- if (!localShowColumn.value?.length || row.type) {
1015
+ if (row.type) {
1016
1016
  return true
1017
1017
  }
1018
- return localShowColumn.value.includes(row.prop) && !row.initHidden
1018
+ if (!localShowColumn.value?.length) {
1019
+ return !row.initHidden && !row.destory
1020
+ }
1021
+ return localShowColumn.value.includes(row.prop) && !row.initHidden && !row.destory
1019
1022
  }
1020
1023
 
1021
1024
  const resetNfSearchFormModel = () => {
package/package/types.ts CHANGED
@@ -244,6 +244,7 @@ export interface NfTableColumnAttributes {
244
244
  _index?: number
245
245
  __index?: number
246
246
  initHidden?: boolean
247
+ destory?: boolean
247
248
  type?: 'selection' | 'index' | 'expand'
248
249
  label?: string
249
250
  prop?: string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-table",
3
- "version": "3.2.29",
3
+ "version": "3.2.34",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "zoujiahe <zoujiahe@94ai.com>",
@@ -14,10 +14,10 @@
14
14
  "url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/nf-drawer": "^3.2.29",
18
- "@94ai/nf-message": "^3.2.29",
19
- "@94ai/nf-search-form": "^3.2.29",
20
- "@94ai/nf-theme-chalk": "^3.2.29",
17
+ "@94ai/nf-drawer": "^3.2.34",
18
+ "@94ai/nf-message": "^3.2.34",
19
+ "@94ai/nf-search-form": "^3.2.34",
20
+ "@94ai/nf-theme-chalk": "^3.2.34",
21
21
  "vue-cookies": "^1.8.3",
22
22
  "vue-demi": "^0.14.5",
23
23
  "vuedraggable": "^2.24.3"
@@ -35,5 +35,5 @@
35
35
  "types": "lib/index.d.ts",
36
36
  "main": "lib/nf-table.cjs.js",
37
37
  "module": "lib/nf-table.esm-bundler.js",
38
- "gitHead": "d50a6e5d90176f48f79efc659a7f66bbc31721e2"
38
+ "gitHead": "2a9a3d44e82ed662247df158ae032472ed9f51f3"
39
39
  }