@94ai/nf-search-form 3.2.26 → 3.2.32

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
@@ -86,7 +86,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
86
86
  };
87
87
  columns: {
88
88
  type: import("vue-demi").PropType<number>;
89
- default: number;
89
+ default: undefined;
90
90
  };
91
91
  showBtn: {
92
92
  type: import("vue-demi").PropType<boolean>;
@@ -167,7 +167,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
167
167
  default: number;
168
168
  };
169
169
  formOptions: {
170
- type: import("vue-demi").PropType<import("./types").NfSearchFormItemOption[]>;
170
+ type: import("vue-demi").PropType<any>;
171
171
  default: () => never[];
172
172
  };
173
173
  closable: {
@@ -487,7 +487,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
487
487
  };
488
488
  columns: {
489
489
  type: import("vue-demi").PropType<number>;
490
- default: number;
490
+ default: undefined;
491
491
  };
492
492
  showBtn: {
493
493
  type: import("vue-demi").PropType<boolean>;
@@ -568,7 +568,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
568
568
  default: number;
569
569
  };
570
570
  formOptions: {
571
- type: import("vue-demi").PropType<import("./types").NfSearchFormItemOption[]>;
571
+ type: import("vue-demi").PropType<any>;
572
572
  default: () => never[];
573
573
  };
574
574
  closable: {
@@ -850,7 +850,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
850
850
  btnBoxLabel: string;
851
851
  btnModel: "inline" | "block";
852
852
  labelWidth: number;
853
- formOptions: import("./types").NfSearchFormItemOption[];
853
+ formOptions: any;
854
854
  closable: boolean;
855
855
  columnEdit: boolean;
856
856
  showItems: string[];
@@ -991,7 +991,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
991
991
  };
992
992
  columns: {
993
993
  type: import("vue-demi").PropType<number>;
994
- default: number;
994
+ default: undefined;
995
995
  };
996
996
  showBtn: {
997
997
  type: import("vue-demi").PropType<boolean>;
@@ -1072,7 +1072,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1072
1072
  default: number;
1073
1073
  };
1074
1074
  formOptions: {
1075
- type: import("vue-demi").PropType<import("./types").NfSearchFormItemOption[]>;
1075
+ type: import("vue-demi").PropType<any>;
1076
1076
  default: () => never[];
1077
1077
  };
1078
1078
  closable: {
@@ -1317,6 +1317,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1317
1317
  _index?: number | undefined;
1318
1318
  __index?: number | undefined;
1319
1319
  initHidden?: boolean | undefined;
1320
+ destory?: boolean | undefined;
1320
1321
  label?: string | undefined;
1321
1322
  addLabel?: string | undefined;
1322
1323
  prop?: string | undefined;
@@ -1371,6 +1372,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1371
1372
  columnCheckDrawer: import("vue-demi").Ref<any>;
1372
1373
  configNfSearchItemVisibleDialog: import("vue-demi").Ref<boolean>;
1373
1374
  syncCookiesToSearchFormItemOptions: (readCached?: boolean) => void;
1375
+ onResize: () => void;
1376
+ visibleChange: () => void;
1374
1377
  }> & import("vue/types/v3-component-options").ExtractComputedReturns<{}> & import("vue-demi").ComponentCustomProperties & Readonly<import("vue-demi").ExtractPropTypes<{
1375
1378
  storageKey: {
1376
1379
  type: import("vue-demi").PropType<string>;
@@ -1458,7 +1461,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1458
1461
  };
1459
1462
  columns: {
1460
1463
  type: import("vue-demi").PropType<number>;
1461
- default: number;
1464
+ default: undefined;
1462
1465
  };
1463
1466
  showBtn: {
1464
1467
  type: import("vue-demi").PropType<boolean>;
@@ -1539,7 +1542,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1539
1542
  default: number;
1540
1543
  };
1541
1544
  formOptions: {
1542
- type: import("vue-demi").PropType<import("./types").NfSearchFormItemOption[]>;
1545
+ type: import("vue-demi").PropType<any>;
1543
1546
  default: () => never[];
1544
1547
  };
1545
1548
  closable: {
@@ -1859,7 +1862,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1859
1862
  };
1860
1863
  columns: {
1861
1864
  type: import("vue-demi").PropType<number>;
1862
- default: number;
1865
+ default: undefined;
1863
1866
  };
1864
1867
  showBtn: {
1865
1868
  type: import("vue-demi").PropType<boolean>;
@@ -1940,7 +1943,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1940
1943
  default: number;
1941
1944
  };
1942
1945
  formOptions: {
1943
- type: import("vue-demi").PropType<import("./types").NfSearchFormItemOption[]>;
1946
+ type: import("vue-demi").PropType<any>;
1944
1947
  default: () => never[];
1945
1948
  };
1946
1949
  closable: {
@@ -2185,6 +2188,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
2185
2188
  _index?: number | undefined;
2186
2189
  __index?: number | undefined;
2187
2190
  initHidden?: boolean | undefined;
2191
+ destory?: boolean | undefined;
2188
2192
  label?: string | undefined;
2189
2193
  addLabel?: string | undefined;
2190
2194
  prop?: string | undefined;
@@ -2239,6 +2243,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
2239
2243
  columnCheckDrawer: import("vue-demi").Ref<any>;
2240
2244
  configNfSearchItemVisibleDialog: import("vue-demi").Ref<boolean>;
2241
2245
  syncCookiesToSearchFormItemOptions: (readCached?: boolean) => void;
2246
+ onResize: () => void;
2247
+ visibleChange: () => void;
2242
2248
  }, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
2243
2249
  onChange: (event: Record<string, any>) => void;
2244
2250
  itemsChange: (event: string[]) => void;
@@ -2288,7 +2294,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
2288
2294
  btnBoxLabel: string;
2289
2295
  btnModel: "inline" | "block";
2290
2296
  labelWidth: number;
2291
- formOptions: import("./types").NfSearchFormItemOption[];
2297
+ formOptions: any;
2292
2298
  closable: boolean;
2293
2299
  columnEdit: boolean;
2294
2300
  showItems: string[];
@@ -2430,7 +2436,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
2430
2436
  };
2431
2437
  columns: {
2432
2438
  type: import("vue-demi").PropType<number>;
2433
- default: number;
2439
+ default: undefined;
2434
2440
  };
2435
2441
  showBtn: {
2436
2442
  type: import("vue-demi").PropType<boolean>;
@@ -2511,7 +2517,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
2511
2517
  default: number;
2512
2518
  };
2513
2519
  formOptions: {
2514
- type: import("vue-demi").PropType<import("./types").NfSearchFormItemOption[]>;
2520
+ type: import("vue-demi").PropType<any>;
2515
2521
  default: () => never[];
2516
2522
  };
2517
2523
  closable: {
@@ -6063,17 +6063,18 @@ __sfc_main$1.setup = (__props, __ctx) => {
6063
6063
  const fixedColumn = vueDemi.ref([]);
6064
6064
  const unFixedColumn = vueDemi.ref([]);
6065
6065
  vueDemi.onBeforeMount(() => {
6066
- currentTable.value = deepClone(props.tableColumns).sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
6066
+ 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);
6067
6067
  currentTable.value.map((i) => {
6068
6068
  if (!i.attr) {
6069
6069
  i.attr = {};
6070
6070
  }
6071
6071
  });
6072
- setFields(props.tableColumns);
6072
+ const list = props.tableColumns.filter((item) => !item.destory);
6073
+ setFields(list);
6073
6074
  updateColumn();
6074
6075
  if (currentTable.value.every((i) => !i.initHidden)) {
6075
6076
  showColumn.value = currentTable.value.map((i) => i.prop);
6076
- checkedCount.value = currentTable.value.length;
6077
+ checkedCount.value = list.length;
6077
6078
  checkAll.value = true;
6078
6079
  isIndeterminate.value = false;
6079
6080
  }
@@ -6441,7 +6442,7 @@ __sfc_main.props = {
6441
6442
  key: "columns",
6442
6443
  required: false,
6443
6444
  type: Number,
6444
- default: 3
6445
+ default: void 0
6445
6446
  },
6446
6447
  showBtn: {
6447
6448
  key: "showBtn",
@@ -6459,7 +6460,7 @@ __sfc_main.props = {
6459
6460
  key: "expandBtnType",
6460
6461
  required: false,
6461
6462
  type: String,
6462
- default: "default"
6463
+ default: ""
6463
6464
  },
6464
6465
  expandBtnIcon: {
6465
6466
  key: "expandBtnIcon",
@@ -6470,7 +6471,7 @@ __sfc_main.props = {
6470
6471
  key: "expandBtnPlain",
6471
6472
  required: false,
6472
6473
  type: Boolean,
6473
- default: false
6474
+ default: true
6474
6475
  },
6475
6476
  expandBtnSize: {
6476
6477
  key: "expandBtnSize",
@@ -6588,7 +6589,7 @@ __sfc_main.props = {
6588
6589
  formOptions: {
6589
6590
  key: "formOptions",
6590
6591
  required: false,
6591
- type: Array,
6592
+ type: [Array, null],
6592
6593
  default: () => []
6593
6594
  },
6594
6595
  closable: {
@@ -7042,13 +7043,15 @@ __sfc_main.setup = (__props, __ctx) => {
7042
7043
  const columnCheckDialog = vueDemi.ref();
7043
7044
  const nfSearchFormModel = vueDemi.ref({});
7044
7045
  const initLocalShow = () => {
7046
+ props.formOptions._skip = true;
7045
7047
  const result = props.formOptions.filter((item) => {
7046
7048
  var _a2;
7047
7049
  if ((_a2 = props.showItems) == null ? void 0 : _a2.includes(item.prop)) {
7048
- item.initHidden = true;
7050
+ item.initHidden = false;
7049
7051
  }
7050
- return item.initHidden;
7052
+ return !item.initHidden;
7051
7053
  }).map((item) => item.prop);
7054
+ props.formOptions._skip = false;
7052
7055
  if (result.length) {
7053
7056
  return result;
7054
7057
  }
@@ -7098,6 +7101,7 @@ __sfc_main.setup = (__props, __ctx) => {
7098
7101
  }
7099
7102
  };
7100
7103
  const syncShowItemToInitHidden = () => {
7104
+ props.formOptions._skip = true;
7101
7105
  props.formOptions.forEach((item) => {
7102
7106
  var _a2;
7103
7107
  if ((_a2 = localShowItems.value) == null ? void 0 : _a2.includes(item.prop)) {
@@ -7106,6 +7110,7 @@ __sfc_main.setup = (__props, __ctx) => {
7106
7110
  item.initHidden = true;
7107
7111
  }
7108
7112
  });
7113
+ props.formOptions._skip = false;
7109
7114
  };
7110
7115
  if (props.columnEdit) {
7111
7116
  const cached = (_b = instance == null ? void 0 : instance.$cookies) == null ? void 0 : _b.get(props.storageKey);
@@ -7124,6 +7129,7 @@ __sfc_main.setup = (__props, __ctx) => {
7124
7129
  const renderSearchFormItemOptions = vueDemi.ref([]);
7125
7130
  const syncCookiesToSearchFormItemOptions = (readCached = true) => {
7126
7131
  var _a2;
7132
+ props.formOptions._skip = true;
7127
7133
  const columns = props.formOptions.map((item, index2) => {
7128
7134
  item.key = item.key || createUniqueString();
7129
7135
  item._index = index2;
@@ -7150,14 +7156,15 @@ __sfc_main.setup = (__props, __ctx) => {
7150
7156
  }
7151
7157
  }
7152
7158
  renderSearchFormItemOptions.value = columns.sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
7159
+ props.formOptions._skip = false;
7153
7160
  };
7154
7161
  syncCookiesToSearchFormItemOptions();
7155
7162
  const itemIsShow = (item) => {
7156
7163
  var _a2;
7157
7164
  if (!((_a2 = localShowItems.value) == null ? void 0 : _a2.length)) {
7158
- return true;
7165
+ return !item.initHidden && !item.destory;
7159
7166
  }
7160
- return localShowItems.value.includes(item.prop) && !item.initHidden;
7167
+ return localShowItems.value.includes(item.prop) && !item.initHidden && !item.destory;
7161
7168
  };
7162
7169
  vueDemi.watch(() => nfSearchFormModel.value, () => {
7163
7170
  emit("onChange", nfSearchFormModel.value);
@@ -7176,7 +7183,10 @@ __sfc_main.setup = (__props, __ctx) => {
7176
7183
  vueDemi.watch(() => {
7177
7184
  return props.formOptions;
7178
7185
  }, () => {
7179
- syncCookiesToSearchFormItemOptions();
7186
+ if (props.formOptions._skip) {
7187
+ return;
7188
+ }
7189
+ syncCookiesToSearchFormItemOptions(false);
7180
7190
  }, {
7181
7191
  deep: true
7182
7192
  });
@@ -7210,6 +7220,10 @@ __sfc_main.setup = (__props, __ctx) => {
7210
7220
  }
7211
7221
  };
7212
7222
  const calcColumns = () => {
7223
+ if (props.columns) {
7224
+ newColumns.value = props.columns;
7225
+ return;
7226
+ }
7213
7227
  if (!nfSearchFormRef.value)
7214
7228
  return;
7215
7229
  let count = 0;
@@ -7408,7 +7422,9 @@ __sfc_main.setup = (__props, __ctx) => {
7408
7422
  /**
7409
7423
  * 列编辑同步cookies到组件渲染数据
7410
7424
  */
7411
- syncCookiesToSearchFormItemOptions
7425
+ syncCookiesToSearchFormItemOptions,
7426
+ onResize,
7427
+ visibleChange: onResize
7412
7428
  });
7413
7429
  };
7414
7430
  __sfc_main.components = Object.assign({
@@ -6061,17 +6061,18 @@ __sfc_main$1.setup = (__props, __ctx) => {
6061
6061
  const fixedColumn = ref([]);
6062
6062
  const unFixedColumn = ref([]);
6063
6063
  onBeforeMount(() => {
6064
- currentTable.value = deepClone(props.tableColumns).sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
6064
+ 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);
6065
6065
  currentTable.value.map((i) => {
6066
6066
  if (!i.attr) {
6067
6067
  i.attr = {};
6068
6068
  }
6069
6069
  });
6070
- setFields(props.tableColumns);
6070
+ const list = props.tableColumns.filter((item) => !item.destory);
6071
+ setFields(list);
6071
6072
  updateColumn();
6072
6073
  if (currentTable.value.every((i) => !i.initHidden)) {
6073
6074
  showColumn.value = currentTable.value.map((i) => i.prop);
6074
- checkedCount.value = currentTable.value.length;
6075
+ checkedCount.value = list.length;
6075
6076
  checkAll.value = true;
6076
6077
  isIndeterminate.value = false;
6077
6078
  }
@@ -6439,7 +6440,7 @@ __sfc_main.props = {
6439
6440
  key: "columns",
6440
6441
  required: false,
6441
6442
  type: Number,
6442
- default: 3
6443
+ default: void 0
6443
6444
  },
6444
6445
  showBtn: {
6445
6446
  key: "showBtn",
@@ -6457,7 +6458,7 @@ __sfc_main.props = {
6457
6458
  key: "expandBtnType",
6458
6459
  required: false,
6459
6460
  type: String,
6460
- default: "default"
6461
+ default: ""
6461
6462
  },
6462
6463
  expandBtnIcon: {
6463
6464
  key: "expandBtnIcon",
@@ -6468,7 +6469,7 @@ __sfc_main.props = {
6468
6469
  key: "expandBtnPlain",
6469
6470
  required: false,
6470
6471
  type: Boolean,
6471
- default: false
6472
+ default: true
6472
6473
  },
6473
6474
  expandBtnSize: {
6474
6475
  key: "expandBtnSize",
@@ -6586,7 +6587,7 @@ __sfc_main.props = {
6586
6587
  formOptions: {
6587
6588
  key: "formOptions",
6588
6589
  required: false,
6589
- type: Array,
6590
+ type: [Array, null],
6590
6591
  default: () => []
6591
6592
  },
6592
6593
  closable: {
@@ -7040,13 +7041,15 @@ __sfc_main.setup = (__props, __ctx) => {
7040
7041
  const columnCheckDialog = ref();
7041
7042
  const nfSearchFormModel = ref({});
7042
7043
  const initLocalShow = () => {
7044
+ props.formOptions._skip = true;
7043
7045
  const result = props.formOptions.filter((item) => {
7044
7046
  var _a2;
7045
7047
  if ((_a2 = props.showItems) == null ? void 0 : _a2.includes(item.prop)) {
7046
- item.initHidden = true;
7048
+ item.initHidden = false;
7047
7049
  }
7048
- return item.initHidden;
7050
+ return !item.initHidden;
7049
7051
  }).map((item) => item.prop);
7052
+ props.formOptions._skip = false;
7050
7053
  if (result.length) {
7051
7054
  return result;
7052
7055
  }
@@ -7096,6 +7099,7 @@ __sfc_main.setup = (__props, __ctx) => {
7096
7099
  }
7097
7100
  };
7098
7101
  const syncShowItemToInitHidden = () => {
7102
+ props.formOptions._skip = true;
7099
7103
  props.formOptions.forEach((item) => {
7100
7104
  var _a2;
7101
7105
  if ((_a2 = localShowItems.value) == null ? void 0 : _a2.includes(item.prop)) {
@@ -7104,6 +7108,7 @@ __sfc_main.setup = (__props, __ctx) => {
7104
7108
  item.initHidden = true;
7105
7109
  }
7106
7110
  });
7111
+ props.formOptions._skip = false;
7107
7112
  };
7108
7113
  if (props.columnEdit) {
7109
7114
  const cached = (_b = instance == null ? void 0 : instance.$cookies) == null ? void 0 : _b.get(props.storageKey);
@@ -7122,6 +7127,7 @@ __sfc_main.setup = (__props, __ctx) => {
7122
7127
  const renderSearchFormItemOptions = ref([]);
7123
7128
  const syncCookiesToSearchFormItemOptions = (readCached = true) => {
7124
7129
  var _a2;
7130
+ props.formOptions._skip = true;
7125
7131
  const columns = props.formOptions.map((item, index2) => {
7126
7132
  item.key = item.key || createUniqueString();
7127
7133
  item._index = index2;
@@ -7148,14 +7154,15 @@ __sfc_main.setup = (__props, __ctx) => {
7148
7154
  }
7149
7155
  }
7150
7156
  renderSearchFormItemOptions.value = columns.sort((a, b) => a._index - b._index < 0 ? -1 : a._index - b._index > 0 ? 1 : 0);
7157
+ props.formOptions._skip = false;
7151
7158
  };
7152
7159
  syncCookiesToSearchFormItemOptions();
7153
7160
  const itemIsShow = (item) => {
7154
7161
  var _a2;
7155
7162
  if (!((_a2 = localShowItems.value) == null ? void 0 : _a2.length)) {
7156
- return true;
7163
+ return !item.initHidden && !item.destory;
7157
7164
  }
7158
- return localShowItems.value.includes(item.prop) && !item.initHidden;
7165
+ return localShowItems.value.includes(item.prop) && !item.initHidden && !item.destory;
7159
7166
  };
7160
7167
  watch(() => nfSearchFormModel.value, () => {
7161
7168
  emit("onChange", nfSearchFormModel.value);
@@ -7174,7 +7181,10 @@ __sfc_main.setup = (__props, __ctx) => {
7174
7181
  watch(() => {
7175
7182
  return props.formOptions;
7176
7183
  }, () => {
7177
- syncCookiesToSearchFormItemOptions();
7184
+ if (props.formOptions._skip) {
7185
+ return;
7186
+ }
7187
+ syncCookiesToSearchFormItemOptions(false);
7178
7188
  }, {
7179
7189
  deep: true
7180
7190
  });
@@ -7208,6 +7218,10 @@ __sfc_main.setup = (__props, __ctx) => {
7208
7218
  }
7209
7219
  };
7210
7220
  const calcColumns = () => {
7221
+ if (props.columns) {
7222
+ newColumns.value = props.columns;
7223
+ return;
7224
+ }
7211
7225
  if (!nfSearchFormRef.value)
7212
7226
  return;
7213
7227
  let count = 0;
@@ -7406,7 +7420,9 @@ __sfc_main.setup = (__props, __ctx) => {
7406
7420
  /**
7407
7421
  * 列编辑同步cookies到组件渲染数据
7408
7422
  */
7409
- syncCookiesToSearchFormItemOptions
7423
+ syncCookiesToSearchFormItemOptions,
7424
+ onResize,
7425
+ visibleChange: onResize
7410
7426
  });
7411
7427
  };
7412
7428
  __sfc_main.components = Object.assign({
@@ -87,7 +87,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
87
87
  };
88
88
  columns: {
89
89
  type: import("vue-demi").PropType<number>;
90
- default: number;
90
+ default: undefined;
91
91
  };
92
92
  showBtn: {
93
93
  type: import("vue-demi").PropType<boolean>;
@@ -168,7 +168,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
168
168
  default: number;
169
169
  };
170
170
  formOptions: {
171
- type: import("vue-demi").PropType<NfSearchFormItemOption[]>;
171
+ type: import("vue-demi").PropType<any>;
172
172
  default: () => never[];
173
173
  };
174
174
  closable: {
@@ -413,6 +413,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
413
413
  _index?: number | undefined;
414
414
  __index?: number | undefined;
415
415
  initHidden?: boolean | undefined;
416
+ destory?: boolean | undefined;
416
417
  label?: string | undefined;
417
418
  addLabel?: string | undefined;
418
419
  prop?: string | undefined;
@@ -467,6 +468,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
467
468
  columnCheckDrawer: import("vue-demi").Ref<any>;
468
469
  configNfSearchItemVisibleDialog: import("vue-demi").Ref<boolean>;
469
470
  syncCookiesToSearchFormItemOptions: (readCached?: boolean) => void;
471
+ onResize: () => void;
472
+ visibleChange: () => void;
470
473
  }, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
471
474
  onChange: (event: Record<string, any>) => void;
472
475
  itemsChange: (event: string[]) => void;
@@ -562,7 +565,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
562
565
  };
563
566
  columns: {
564
567
  type: import("vue-demi").PropType<number>;
565
- default: number;
568
+ default: undefined;
566
569
  };
567
570
  showBtn: {
568
571
  type: import("vue-demi").PropType<boolean>;
@@ -643,7 +646,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
643
646
  default: number;
644
647
  };
645
648
  formOptions: {
646
- type: import("vue-demi").PropType<NfSearchFormItemOption[]>;
649
+ type: import("vue-demi").PropType<any>;
647
650
  default: () => never[];
648
651
  };
649
652
  closable: {
@@ -917,7 +920,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
917
920
  btnBoxLabel: string;
918
921
  btnModel: 'inline' | 'block';
919
922
  labelWidth: number;
920
- formOptions: NfSearchFormItemOption[];
923
+ formOptions: NfSearchFormItemOption[] | any;
921
924
  closable: boolean;
922
925
  columnEdit: boolean;
923
926
  showItems: string[];
package/lib/types.d.ts CHANGED
@@ -3,6 +3,7 @@ export type NfSearchFormItemOption = {
3
3
  _index?: number;
4
4
  __index?: number;
5
5
  initHidden?: boolean;
6
+ destory?: boolean;
6
7
  label?: string;
7
8
  addLabel?: string;
8
9
  prop?: string;
@@ -182,21 +182,21 @@ const unFixedColumn = ref<Record<string, any>[]>([])
182
182
 
183
183
 
184
184
  onBeforeMount(() => {
185
- 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>[]
185
+ 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>[]
186
186
  // 兼容处理
187
187
  currentTable.value.map(i => {
188
188
  if (!i.attr) {
189
189
  i.attr = {}
190
190
  }
191
191
  })
192
-
192
+ const list = props.tableColumns.filter(item => !item.destory)
193
193
  // 可选列表 → 字段区分
194
- setFields(props.tableColumns)
194
+ setFields(list)
195
195
  // 已选列表
196
196
  updateColumn()
197
197
  if (currentTable.value.every(i => !i.initHidden)) {
198
198
  showColumn.value = currentTable.value.map(i => i.prop)
199
- checkedCount.value = currentTable.value.length
199
+ checkedCount.value = list.length
200
200
  checkAll.value = true
201
201
  isIndeterminate.value = false
202
202
  }
@@ -338,7 +338,7 @@ const props = withDefaults(defineProps<{
338
338
  /**
339
339
  * 所有的表单项
340
340
  */
341
- formOptions?: NfSearchFormItemOption[],
341
+ formOptions?: NfSearchFormItemOption[] | any,
342
342
  /**
343
343
  * 列编辑,是否显示关闭选项功能
344
344
  */
@@ -456,13 +456,13 @@ const props = withDefaults(defineProps<{
456
456
  downIcon: 'icon-xiangxia2',
457
457
  showBtn: true,
458
458
  isCollapse: false,
459
- expandBtnType: 'default',
460
- expandBtnPlain: false,
459
+ expandBtnType: '',
460
+ expandBtnPlain: true,
461
461
  expandBtnRound: false,
462
462
  expandBtnCircle: false,
463
463
  expandBtnLoading: false,
464
464
  expandBtnDisabled: false,
465
- columns: 3,
465
+ columns: undefined,
466
466
  labelPosition: 'top',
467
467
  inline: true,
468
468
  rules: undefined,
@@ -602,12 +602,14 @@ const nfSearchFormModel = ref<Record<string, any>>({})
602
602
  * 同步用户参数
603
603
  */
604
604
  const initLocalShow = () => {
605
+ props.formOptions._skip = true
605
606
  const result = props.formOptions.filter(item => {
606
607
  if (props.showItems?.includes(item.prop!)) {
607
- item.initHidden = true
608
+ item.initHidden = false
608
609
  }
609
- return item.initHidden
610
+ return !item.initHidden
610
611
  }).map(item => item.prop!)
612
+ props.formOptions._skip = false
611
613
  if (result.length) {
612
614
  return result
613
615
  }
@@ -657,6 +659,7 @@ const syncCookiesToLocalShowColumn = () => {
657
659
  }
658
660
 
659
661
  const syncShowItemToInitHidden = () => {
662
+ props.formOptions._skip = true
660
663
  props.formOptions.forEach(item => {
661
664
  if (localShowItems.value?.includes(item.prop!)) {
662
665
  item.initHidden = false
@@ -664,12 +667,12 @@ const syncShowItemToInitHidden = () => {
664
667
  item.initHidden = true
665
668
  }
666
669
  })
670
+ props.formOptions._skip = false
667
671
  }
668
672
  if (props.columnEdit) {
669
673
  // 同步缓存参数
670
674
  const cached = instance?.$cookies?.get(props.storageKey)
671
675
  const cachedPriority = props.priority === 'cached'
672
-
673
676
  if (cachedPriority ? cached : localShowItems.value?.length) {
674
677
  cachedPriority ? syncCookiesToLocalShowColumn() : syncLocalShowColumnToCookies()
675
678
  } else if (cachedPriority ? localShowItems.value?.length : cached) {
@@ -698,6 +701,7 @@ const isShowBtnBoxSlot = computed(() => {
698
701
  */
699
702
  const renderSearchFormItemOptions = ref<NfSearchFormItemOption[]>([])
700
703
  const syncCookiesToSearchFormItemOptions = (readCached = true) => {
704
+ props.formOptions._skip = true
701
705
  const columns = props.formOptions!.map((item, index) => {
702
706
  item.key = item.key || createUniqueString()
703
707
  item._index = index
@@ -725,6 +729,7 @@ const syncCookiesToSearchFormItemOptions = (readCached = true) => {
725
729
  }
726
730
  }
727
731
  renderSearchFormItemOptions.value = columns.sort((a, b) => a._index! - b._index! < 0 ? -1 : a._index! - b._index! > 0 ? 1 : 0)
732
+ props.formOptions._skip = false
728
733
  }
729
734
  syncCookiesToSearchFormItemOptions()
730
735
 
@@ -734,9 +739,9 @@ syncCookiesToSearchFormItemOptions()
734
739
  */
735
740
  const itemIsShow = (item: NfSearchFormItemOption) => {
736
741
  if (!localShowItems.value?.length) {
737
- return true
742
+ return !item.initHidden && !item.destory
738
743
  }
739
- return localShowItems.value.includes(item.prop!) && !item.initHidden
744
+ return localShowItems.value.includes(item.prop!) && !item.initHidden && !item.destory
740
745
  }
741
746
 
742
747
 
@@ -777,7 +782,10 @@ onBeforeMount(() => {
777
782
  watch(() => {
778
783
  return props.formOptions
779
784
  }, () => {
780
- syncCookiesToSearchFormItemOptions()
785
+ if (props.formOptions._skip) {
786
+ return
787
+ }
788
+ syncCookiesToSearchFormItemOptions(false)
781
789
  }, {
782
790
  deep: true
783
791
  })
@@ -815,6 +823,10 @@ const onResize = () => {
815
823
  }
816
824
 
817
825
  const calcColumns = () => {
826
+ if (props.columns) {
827
+ newColumns.value = props.columns
828
+ return
829
+ }
818
830
  if (!nfSearchFormRef.value) return
819
831
  let count = 0
820
832
  const formWidth = nfSearchFormRef.value.$el.offsetWidth
@@ -1026,7 +1038,9 @@ defineExpose({
1026
1038
  /**
1027
1039
  * 列编辑同步cookies到组件渲染数据
1028
1040
  */
1029
- syncCookiesToSearchFormItemOptions
1041
+ syncCookiesToSearchFormItemOptions,
1042
+ onResize,
1043
+ visibleChange: onResize
1030
1044
  })
1031
1045
 
1032
1046
  </script>
package/package/types.ts CHANGED
@@ -3,6 +3,7 @@ export type NfSearchFormItemOption = {
3
3
  _index?: number
4
4
  __index?: number
5
5
  initHidden?: boolean
6
+ destory?: boolean
6
7
  /**
7
8
  * nf-form-item配置
8
9
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-search-form",
3
- "version": "3.2.26",
3
+ "version": "3.2.32",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "zoujiahe <zoujiahe@94ai.com>",
@@ -14,20 +14,20 @@
14
14
  "url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/nf-action": "^3.2.26",
18
- "@94ai/nf-double-half-year": "^3.2.26",
19
- "@94ai/nf-double-quarter": "^3.2.26",
20
- "@94ai/nf-double-week": "^3.2.26",
21
- "@94ai/nf-double-year": "^3.2.26",
22
- "@94ai/nf-drawer": "^3.2.26",
23
- "@94ai/nf-form": "^3.2.26",
24
- "@94ai/nf-form-item": "^3.2.26",
25
- "@94ai/nf-half-year-picker": "^3.2.26",
26
- "@94ai/nf-message": "^3.2.26",
27
- "@94ai/nf-quarter-picker": "^3.2.26",
28
- "@94ai/nf-select-transfer": "^3.2.26",
29
- "@94ai/nf-theme-chalk": "^3.2.26",
30
- "@94ai/nf-virtual-select": "^3.2.26",
17
+ "@94ai/nf-action": "^3.2.32",
18
+ "@94ai/nf-double-half-year": "^3.2.32",
19
+ "@94ai/nf-double-quarter": "^3.2.32",
20
+ "@94ai/nf-double-week": "^3.2.32",
21
+ "@94ai/nf-double-year": "^3.2.32",
22
+ "@94ai/nf-drawer": "^3.2.32",
23
+ "@94ai/nf-form": "^3.2.32",
24
+ "@94ai/nf-form-item": "^3.2.32",
25
+ "@94ai/nf-half-year-picker": "^3.2.32",
26
+ "@94ai/nf-message": "^3.2.32",
27
+ "@94ai/nf-quarter-picker": "^3.2.32",
28
+ "@94ai/nf-select-transfer": "^3.2.32",
29
+ "@94ai/nf-theme-chalk": "^3.2.32",
30
+ "@94ai/nf-virtual-select": "^3.2.32",
31
31
  "vue-cookies": "^1.8.3",
32
32
  "vue-demi": "^0.14.5",
33
33
  "vuedraggable": "^2.24.3"
@@ -45,5 +45,5 @@
45
45
  "types": "lib/index.d.ts",
46
46
  "main": "lib/nf-search-form.cjs.js",
47
47
  "module": "lib/nf-search-form.esm-bundler.js",
48
- "gitHead": "3fc82ba76ea5963f800c942e7dddf4ec58d851c4"
48
+ "gitHead": "10cdc1cc67171a0545ae2b2afd2794caff180e53"
49
49
  }