@94ai/nf-search-form 3.2.21 → 3.2.25

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
@@ -68,14 +68,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
68
68
  type: import("vue-demi").PropType<boolean>;
69
69
  default: boolean;
70
70
  };
71
- itemWidth: {
72
- type: import("vue-demi").PropType<number>;
73
- default: number;
74
- };
75
71
  rules: {
76
72
  type: import("vue-demi").PropType<Record<string, any>>;
77
73
  default: undefined;
78
74
  };
75
+ inline: {
76
+ type: import("vue-demi").PropType<boolean>;
77
+ default: boolean;
78
+ };
79
79
  upIcon: {
80
80
  type: import("vue-demi").PropType<string>;
81
81
  default: string;
@@ -154,16 +154,12 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
154
154
  type: import("vue-demi").PropType<"right" | "left" | "top">;
155
155
  default: string;
156
156
  };
157
- inline: {
158
- type: import("vue-demi").PropType<boolean>;
159
- default: boolean;
160
- };
161
157
  btnBoxLabel: {
162
158
  type: import("vue-demi").PropType<string>;
163
159
  default: string;
164
160
  };
165
161
  btnModel: {
166
- type: import("vue-demi").PropType<"block" | "inline">;
162
+ type: import("vue-demi").PropType<"inline" | "block">;
167
163
  default: string;
168
164
  };
169
165
  labelWidth: {
@@ -473,14 +469,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
473
469
  type: import("vue-demi").PropType<boolean>;
474
470
  default: boolean;
475
471
  };
476
- itemWidth: {
477
- type: import("vue-demi").PropType<number>;
478
- default: number;
479
- };
480
472
  rules: {
481
473
  type: import("vue-demi").PropType<Record<string, any>>;
482
474
  default: undefined;
483
475
  };
476
+ inline: {
477
+ type: import("vue-demi").PropType<boolean>;
478
+ default: boolean;
479
+ };
484
480
  upIcon: {
485
481
  type: import("vue-demi").PropType<string>;
486
482
  default: string;
@@ -559,16 +555,12 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
559
555
  type: import("vue-demi").PropType<"right" | "left" | "top">;
560
556
  default: string;
561
557
  };
562
- inline: {
563
- type: import("vue-demi").PropType<boolean>;
564
- default: boolean;
565
- };
566
558
  btnBoxLabel: {
567
559
  type: import("vue-demi").PropType<string>;
568
560
  default: string;
569
561
  };
570
562
  btnModel: {
571
- type: import("vue-demi").PropType<"block" | "inline">;
563
+ type: import("vue-demi").PropType<"inline" | "block">;
572
564
  default: string;
573
565
  };
574
566
  labelWidth: {
@@ -835,8 +827,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
835
827
  size: "medium" | "small" | "mini";
836
828
  selectEmptyWarningTips: string;
837
829
  disabled: boolean;
838
- itemWidth: number;
839
830
  rules: Record<string, any>;
831
+ inline: boolean;
840
832
  upIcon: string;
841
833
  downIcon: string;
842
834
  columns: number;
@@ -855,9 +847,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
855
847
  statusIcon: boolean;
856
848
  validateOnRuleChange: boolean;
857
849
  labelPosition: "right" | "left" | "top";
858
- inline: boolean;
859
850
  btnBoxLabel: string;
860
- btnModel: "block" | "inline";
851
+ btnModel: "inline" | "block";
861
852
  labelWidth: number;
862
853
  formOptions: import("./types").NfSearchFormItemOption[];
863
854
  closable: boolean;
@@ -982,14 +973,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
982
973
  type: import("vue-demi").PropType<boolean>;
983
974
  default: boolean;
984
975
  };
985
- itemWidth: {
986
- type: import("vue-demi").PropType<number>;
987
- default: number;
988
- };
989
976
  rules: {
990
977
  type: import("vue-demi").PropType<Record<string, any>>;
991
978
  default: undefined;
992
979
  };
980
+ inline: {
981
+ type: import("vue-demi").PropType<boolean>;
982
+ default: boolean;
983
+ };
993
984
  upIcon: {
994
985
  type: import("vue-demi").PropType<string>;
995
986
  default: string;
@@ -1068,16 +1059,12 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1068
1059
  type: import("vue-demi").PropType<"right" | "left" | "top">;
1069
1060
  default: string;
1070
1061
  };
1071
- inline: {
1072
- type: import("vue-demi").PropType<boolean>;
1073
- default: boolean;
1074
- };
1075
1062
  btnBoxLabel: {
1076
1063
  type: import("vue-demi").PropType<string>;
1077
1064
  default: string;
1078
1065
  };
1079
1066
  btnModel: {
1080
- type: import("vue-demi").PropType<"block" | "inline">;
1067
+ type: import("vue-demi").PropType<"inline" | "block">;
1081
1068
  default: string;
1082
1069
  };
1083
1070
  labelWidth: {
@@ -1453,14 +1440,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1453
1440
  type: import("vue-demi").PropType<boolean>;
1454
1441
  default: boolean;
1455
1442
  };
1456
- itemWidth: {
1457
- type: import("vue-demi").PropType<number>;
1458
- default: number;
1459
- };
1460
1443
  rules: {
1461
1444
  type: import("vue-demi").PropType<Record<string, any>>;
1462
1445
  default: undefined;
1463
1446
  };
1447
+ inline: {
1448
+ type: import("vue-demi").PropType<boolean>;
1449
+ default: boolean;
1450
+ };
1464
1451
  upIcon: {
1465
1452
  type: import("vue-demi").PropType<string>;
1466
1453
  default: string;
@@ -1539,16 +1526,12 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1539
1526
  type: import("vue-demi").PropType<"right" | "left" | "top">;
1540
1527
  default: string;
1541
1528
  };
1542
- inline: {
1543
- type: import("vue-demi").PropType<boolean>;
1544
- default: boolean;
1545
- };
1546
1529
  btnBoxLabel: {
1547
1530
  type: import("vue-demi").PropType<string>;
1548
1531
  default: string;
1549
1532
  };
1550
1533
  btnModel: {
1551
- type: import("vue-demi").PropType<"block" | "inline">;
1534
+ type: import("vue-demi").PropType<"inline" | "block">;
1552
1535
  default: string;
1553
1536
  };
1554
1537
  labelWidth: {
@@ -1858,14 +1841,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1858
1841
  type: import("vue-demi").PropType<boolean>;
1859
1842
  default: boolean;
1860
1843
  };
1861
- itemWidth: {
1862
- type: import("vue-demi").PropType<number>;
1863
- default: number;
1864
- };
1865
1844
  rules: {
1866
1845
  type: import("vue-demi").PropType<Record<string, any>>;
1867
1846
  default: undefined;
1868
1847
  };
1848
+ inline: {
1849
+ type: import("vue-demi").PropType<boolean>;
1850
+ default: boolean;
1851
+ };
1869
1852
  upIcon: {
1870
1853
  type: import("vue-demi").PropType<string>;
1871
1854
  default: string;
@@ -1944,16 +1927,12 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
1944
1927
  type: import("vue-demi").PropType<"right" | "left" | "top">;
1945
1928
  default: string;
1946
1929
  };
1947
- inline: {
1948
- type: import("vue-demi").PropType<boolean>;
1949
- default: boolean;
1950
- };
1951
1930
  btnBoxLabel: {
1952
1931
  type: import("vue-demi").PropType<string>;
1953
1932
  default: string;
1954
1933
  };
1955
1934
  btnModel: {
1956
- type: import("vue-demi").PropType<"block" | "inline">;
1935
+ type: import("vue-demi").PropType<"inline" | "block">;
1957
1936
  default: string;
1958
1937
  };
1959
1938
  labelWidth: {
@@ -2286,8 +2265,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
2286
2265
  size: "medium" | "small" | "mini";
2287
2266
  selectEmptyWarningTips: string;
2288
2267
  disabled: boolean;
2289
- itemWidth: number;
2290
2268
  rules: Record<string, any>;
2269
+ inline: boolean;
2291
2270
  upIcon: string;
2292
2271
  downIcon: string;
2293
2272
  columns: number;
@@ -2306,9 +2285,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
2306
2285
  statusIcon: boolean;
2307
2286
  validateOnRuleChange: boolean;
2308
2287
  labelPosition: "right" | "left" | "top";
2309
- inline: boolean;
2310
2288
  btnBoxLabel: string;
2311
- btnModel: "block" | "inline";
2289
+ btnModel: "inline" | "block";
2312
2290
  labelWidth: number;
2313
2291
  formOptions: import("./types").NfSearchFormItemOption[];
2314
2292
  closable: boolean;
@@ -2434,14 +2412,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
2434
2412
  type: import("vue-demi").PropType<boolean>;
2435
2413
  default: boolean;
2436
2414
  };
2437
- itemWidth: {
2438
- type: import("vue-demi").PropType<number>;
2439
- default: number;
2440
- };
2441
2415
  rules: {
2442
2416
  type: import("vue-demi").PropType<Record<string, any>>;
2443
2417
  default: undefined;
2444
2418
  };
2419
+ inline: {
2420
+ type: import("vue-demi").PropType<boolean>;
2421
+ default: boolean;
2422
+ };
2445
2423
  upIcon: {
2446
2424
  type: import("vue-demi").PropType<string>;
2447
2425
  default: string;
@@ -2520,16 +2498,12 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
2520
2498
  type: import("vue-demi").PropType<"right" | "left" | "top">;
2521
2499
  default: string;
2522
2500
  };
2523
- inline: {
2524
- type: import("vue-demi").PropType<boolean>;
2525
- default: boolean;
2526
- };
2527
2501
  btnBoxLabel: {
2528
2502
  type: import("vue-demi").PropType<string>;
2529
2503
  default: string;
2530
2504
  };
2531
2505
  btnModel: {
2532
- type: import("vue-demi").PropType<"block" | "inline">;
2506
+ type: import("vue-demi").PropType<"inline" | "block">;
2533
2507
  default: string;
2534
2508
  };
2535
2509
  labelWidth: {
@@ -2774,9 +2748,11 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
2774
2748
  } & (new () => {
2775
2749
  $slots: Partial<Record<string, (_: {
2776
2750
  slot: string;
2777
- }) => any>> & Partial<Record<string, (_: {
2778
- slot: string;
2779
2751
  }) => any>> & {
2752
+ default?(_: {
2753
+ nam: string;
2754
+ slot: string;
2755
+ }): any;
2780
2756
  btnBox?(_: {}): any;
2781
2757
  dialogTitle?(_: {
2782
2758
  slot: string;
@@ -8,10 +8,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
8
8
  type: import("vue-demi").PropType<NfSearchFormItemOption>;
9
9
  default: () => {};
10
10
  };
11
- itemWidth: {
12
- type: import("vue-demi").PropType<number>;
13
- default: number;
14
- };
15
11
  }, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
16
12
  input: (event: any) => void;
17
13
  "update:value": (event: any) => void;
@@ -24,14 +20,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
24
20
  type: import("vue-demi").PropType<NfSearchFormItemOption>;
25
21
  default: () => {};
26
22
  };
27
- itemWidth: {
28
- type: import("vue-demi").PropType<number>;
29
- default: number;
30
- };
31
23
  }>>, {
32
24
  value: any;
33
25
  itemOptions: NfSearchFormItemOption;
34
- itemWidth: number;
35
26
  }>, Partial<Record<string, (_: {}) => any>> & Partial<Record<string, (_: {}) => any>>>;
36
27
  export default _default;
37
28
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -273,6 +273,52 @@ var _sfc_render$4 = function render2() {
273
273
  var _sfc_staticRenderFns$4 = [];
274
274
  var __component__$4 = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(__sfc_main$4, _sfc_render$4, _sfc_staticRenderFns$4, false, null, null, null, null);
275
275
  const TimeRange = __component__$4.exports;
276
+ function createUniqueString(randomLength = 36) {
277
+ return Number(Math.random().toString().substr(3, randomLength) + Date.now()).toString(36);
278
+ }
279
+ function debounce(func, wait, immediate) {
280
+ let timeout, args, context, timestamp, result;
281
+ const later = function() {
282
+ const last = +/* @__PURE__ */ new Date() - timestamp;
283
+ if (last < wait && last > 0) {
284
+ timeout = setTimeout(later, wait - last);
285
+ } else {
286
+ timeout = null;
287
+ if (!immediate) {
288
+ result = func.apply(context, args);
289
+ if (!timeout)
290
+ context = args = null;
291
+ }
292
+ }
293
+ };
294
+ return function(...args2) {
295
+ context = this;
296
+ timestamp = +/* @__PURE__ */ new Date();
297
+ const callNow = immediate && !timeout;
298
+ if (!timeout)
299
+ timeout = setTimeout(later, wait);
300
+ if (callNow) {
301
+ result = func.apply(context, args2);
302
+ context = args2 = null;
303
+ }
304
+ return result;
305
+ };
306
+ }
307
+ function deepClone(source) {
308
+ if (!source && typeof source !== "object") {
309
+ throw new Error("error arguments shallowClone");
310
+ }
311
+ const targetObj = source.constructor === Array ? [] : {};
312
+ Object.keys(source).forEach((keys) => {
313
+ if (source[keys] && typeof source[keys] === "object") {
314
+ targetObj[keys] = source[keys].constructor === Array ? [] : {};
315
+ targetObj[keys] = deepClone(source[keys]);
316
+ } else {
317
+ targetObj[keys] = source[keys];
318
+ }
319
+ });
320
+ return targetObj;
321
+ }
276
322
  const __sfc_main$3 = vueDemi.defineComponent({
277
323
  name: "NfSearchFromItem"
278
324
  });
@@ -288,12 +334,6 @@ __sfc_main$3.props = {
288
334
  required: false,
289
335
  type: null,
290
336
  default: () => ({})
291
- },
292
- itemWidth: {
293
- key: "itemWidth",
294
- required: false,
295
- type: Number,
296
- default: 170
297
337
  }
298
338
  };
299
339
  __sfc_main$3.setup = (__props, __ctx) => {
@@ -302,9 +342,6 @@ __sfc_main$3.setup = (__props, __ctx) => {
302
342
  const slotName = vueDemi.computed(() => {
303
343
  return props.itemOptions.slot || "";
304
344
  });
305
- const width = vueDemi.computed(() => {
306
- return props.itemWidth + "px";
307
- });
308
345
  const currentVal = vueDemi.computed({
309
346
  get() {
310
347
  return props.value;
@@ -314,7 +351,7 @@ __sfc_main$3.setup = (__props, __ctx) => {
314
351
  emit("update:value", val);
315
352
  }
316
353
  });
317
- const bindProps = vueDemi.computed(() => {
354
+ const getProps = () => {
318
355
  let obj = {
319
356
  clearable: true,
320
357
  ...props.itemOptions
@@ -328,6 +365,7 @@ __sfc_main$3.setup = (__props, __ctx) => {
328
365
  }
329
366
  delete obj.options;
330
367
  }
368
+ obj.key = createUniqueString();
331
369
  delete obj.label;
332
370
  delete obj.prop;
333
371
  delete obj.element;
@@ -336,6 +374,16 @@ __sfc_main$3.setup = (__props, __ctx) => {
336
374
  delete obj.events;
337
375
  delete obj.tooltip;
338
376
  return obj;
377
+ };
378
+ const bindProps = vueDemi.ref(getProps());
379
+ vueDemi.onBeforeMount(() => {
380
+ vueDemi.watch(() => {
381
+ return props.itemOptions;
382
+ }, () => {
383
+ bindProps.value = getProps();
384
+ }, {
385
+ deep: true
386
+ });
339
387
  });
340
388
  const bindEvents = vueDemi.computed(() => {
341
389
  const events = {
@@ -446,7 +494,6 @@ __sfc_main$3.setup = (__props, __ctx) => {
446
494
  };
447
495
  return {
448
496
  slotName,
449
- width,
450
497
  currentVal,
451
498
  bindProps,
452
499
  bindEvents,
@@ -481,10 +528,7 @@ var _sfc_render$3 = function render3() {
481
528
  var _vm = this, _c = _vm._self._c;
482
529
  _vm._self._setupProxy;
483
530
  return _c("div", {
484
- staticClass: "nf-search-form-item",
485
- style: {
486
- width: _vm.width
487
- }
531
+ staticClass: "nf-search-form-item"
488
532
  }, [_vm.slotName ? [_vm._t(_vm.slotName)] : [_vm.isInput ? _c("el-input", _vm._g(_vm._b({
489
533
  attrs: {
490
534
  "placeholder": _vm.itemOptions.placeholder
@@ -513,7 +557,6 @@ var _sfc_render$3 = function render3() {
513
557
  }
514
558
  }, "el-input-number", _vm.bindProps, false), _vm.bindEvents)) : _vm._e(), _vm.isSelect ? _c("nf-virtual-select", _vm._g(_vm._b({
515
559
  attrs: {
516
- "width": _vm.width,
517
560
  "item-options": _vm.itemOptions,
518
561
  "placeholder": _vm.itemOptions.placeholder
519
562
  },
@@ -5949,52 +5992,6 @@ const require$$0 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
5949
5992
  })(vuedraggable_umd);
5950
5993
  var vuedraggable_umdExports = vuedraggable_umd.exports;
5951
5994
  const draggable = /* @__PURE__ */ getDefaultExportFromCjs(vuedraggable_umdExports);
5952
- function createUniqueString(randomLength = 36) {
5953
- return Number(Math.random().toString().substr(3, randomLength) + Date.now()).toString(36);
5954
- }
5955
- function debounce(func, wait, immediate) {
5956
- let timeout, args, context, timestamp, result;
5957
- const later = function() {
5958
- const last = +/* @__PURE__ */ new Date() - timestamp;
5959
- if (last < wait && last > 0) {
5960
- timeout = setTimeout(later, wait - last);
5961
- } else {
5962
- timeout = null;
5963
- if (!immediate) {
5964
- result = func.apply(context, args);
5965
- if (!timeout)
5966
- context = args = null;
5967
- }
5968
- }
5969
- };
5970
- return function(...args2) {
5971
- context = this;
5972
- timestamp = +/* @__PURE__ */ new Date();
5973
- const callNow = immediate && !timeout;
5974
- if (!timeout)
5975
- timeout = setTimeout(later, wait);
5976
- if (callNow) {
5977
- result = func.apply(context, args2);
5978
- context = args2 = null;
5979
- }
5980
- return result;
5981
- };
5982
- }
5983
- function deepClone(source) {
5984
- if (!source && typeof source !== "object") {
5985
- throw new Error("error arguments shallowClone");
5986
- }
5987
- const targetObj = source.constructor === Array ? [] : {};
5988
- Object.keys(source).forEach((keys) => {
5989
- if (source[keys] && typeof source[keys] === "object") {
5990
- targetObj[keys] = source[keys].constructor === Array ? [] : {};
5991
- targetObj[keys] = deepClone(source[keys]);
5992
- } else {
5993
- targetObj[keys] = source[keys];
5994
- }
5995
- });
5996
- return targetObj;
5997
- }
5998
5995
  const __sfc_main$1 = vueDemi.defineComponent({
5999
5996
  name: "NfColumnCheckDrawer"
6000
5997
  });
@@ -6423,7 +6420,7 @@ var _sfc_staticRenderFns$1 = [];
6423
6420
  var __component__$1 = /* @__PURE__ */ vue2RuntimeHelpers.normalizeComponent(__sfc_main$1, _sfc_render$1, _sfc_staticRenderFns$1, false, null, null, null, null);
6424
6421
  const ColumnCheckDrawer = __component__$1.exports;
6425
6422
  const __sfc_main = vueDemi.defineComponent({
6426
- name: "nf-search-from"
6423
+ name: "nf-search-form"
6427
6424
  });
6428
6425
  __sfc_main.props = {
6429
6426
  upIcon: {
@@ -6580,12 +6577,6 @@ __sfc_main.props = {
6580
6577
  type: String,
6581
6578
  default: "block"
6582
6579
  },
6583
- itemWidth: {
6584
- key: "itemWidth",
6585
- required: false,
6586
- type: Number,
6587
- default: 190
6588
- },
6589
6580
  labelWidth: {
6590
6581
  key: "labelWidth",
6591
6582
  required: false,
@@ -7132,9 +7123,9 @@ __sfc_main.setup = (__props, __ctx) => {
7132
7123
  const syncCookiesToSearchFormItemOptions = (readCached = true) => {
7133
7124
  var _a2;
7134
7125
  const columns = props.formOptions.map((item, index2) => {
7126
+ item.key = item.key || createUniqueString();
7135
7127
  item._index = index2;
7136
7128
  item.__index = index2;
7137
- item.key = item.key || createUniqueString();
7138
7129
  return item;
7139
7130
  });
7140
7131
  if (readCached && props.columnEdit) {
@@ -7180,6 +7171,13 @@ __sfc_main.setup = (__props, __ctx) => {
7180
7171
  immediate: true
7181
7172
  });
7182
7173
  vueDemi.onBeforeMount(() => {
7174
+ vueDemi.watch(() => {
7175
+ return props.formOptions;
7176
+ }, () => {
7177
+ syncCookiesToSearchFormItemOptions();
7178
+ }, {
7179
+ deep: true
7180
+ });
7183
7181
  const obj = {};
7184
7182
  props.formOptions.forEach((v) => {
7185
7183
  if (v.initValue !== void 0) {
@@ -7470,8 +7468,8 @@ var _sfc_render = function render6() {
7470
7468
  "label-width": item.labelWidth
7471
7469
  }
7472
7470
  }, [_c("search-form-item", {
7471
+ key: item.key,
7473
7472
  attrs: {
7474
- "item-width": _vm.itemWidth,
7475
7473
  "item-options": item
7476
7474
  },
7477
7475
  model: {
@@ -7481,8 +7479,9 @@ var _sfc_render = function render6() {
7481
7479
  },
7482
7480
  expression: "nfSearchFormModel[item.prop]"
7483
7481
  }
7484
- }, [item.tooltip ? _vm._t(item.tooltip.slot, null, {
7485
- "slot": item.tooltip.slot
7482
+ }, [item.tooltip ? _vm._t("default", null, {
7483
+ "slot": item.tooltip.slot,
7484
+ "nam": item.tooltip.slot
7486
7485
  }) : _vm._e(), item.slot ? _vm._t(item.slot, null, {
7487
7486
  "slot": item.slot
7488
7487
  }) : _vm._e()], 2), _vm.closable ? _c("div", {
@@ -7643,7 +7642,7 @@ var _sfc_render = function render6() {
7643
7642
  }
7644
7643
  }, [_c("i", {
7645
7644
  staticClass: "iconfont icon-shaixuan1 nf-fs12"
7646
- })])], 1) : _vm._e(), _vm.isShowBtnBoxSlot && _vm.reverseBtnSlot ? _vm._t("btnBox") : _vm._e()], 2) : _vm._e(), _vm.configNfSearchItemVisibleDialog && _vm.checkMode === "dialog" ? _c("column-check-dialog", {
7645
+ })])], 1) : _vm._e(), _vm.isShowBtnBoxSlot && _vm.reverseBtnSlot ? _vm._t("btnBox") : _vm._e()], 2) : _vm._e(), _vm.columnEdit && _vm.configNfSearchItemVisibleDialog && _vm.checkMode === "dialog" ? _c("column-check-dialog", {
7647
7646
  ref: "columnCheckDialog",
7648
7647
  attrs: {
7649
7648
  "storage-key": _vm.storageKey,
@@ -7688,7 +7687,7 @@ var _sfc_render = function render6() {
7688
7687
  "slot": "title"
7689
7688
  }), _vm._t("dialogFooter", null, {
7690
7689
  "slot": "footer"
7691
- })], 2) : _vm._e(), _vm.checkMode === "drawer" ? _c("nf-drawer", {
7690
+ })], 2) : _vm._e(), _vm.columnEdit && _vm.checkMode === "drawer" ? _c("nf-drawer", {
7692
7691
  ref: "columnCheckNfDrawer",
7693
7692
  attrs: {
7694
7693
  "size": "680px",
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, getCurrentInstance, computed, watch, onMounted, onBeforeMount, nextTick, onUnmounted } from "vue-demi";
1
+ import { defineComponent, ref, getCurrentInstance, computed, watch, onBeforeMount, onMounted, nextTick, onUnmounted } from "vue-demi";
2
2
  import { normalizeComponent } from "@94ai/vue2-runtime-helpers";
3
3
  import NfMessage from "@94ai/nf-message";
4
4
  const __sfc_main$5 = defineComponent({
@@ -271,6 +271,52 @@ var _sfc_render$4 = function render2() {
271
271
  var _sfc_staticRenderFns$4 = [];
272
272
  var __component__$4 = /* @__PURE__ */ normalizeComponent(__sfc_main$4, _sfc_render$4, _sfc_staticRenderFns$4, false, null, null, null, null);
273
273
  const TimeRange = __component__$4.exports;
274
+ function createUniqueString(randomLength = 36) {
275
+ return Number(Math.random().toString().substr(3, randomLength) + Date.now()).toString(36);
276
+ }
277
+ function debounce(func, wait, immediate) {
278
+ let timeout, args, context, timestamp, result;
279
+ const later = function() {
280
+ const last = +/* @__PURE__ */ new Date() - timestamp;
281
+ if (last < wait && last > 0) {
282
+ timeout = setTimeout(later, wait - last);
283
+ } else {
284
+ timeout = null;
285
+ if (!immediate) {
286
+ result = func.apply(context, args);
287
+ if (!timeout)
288
+ context = args = null;
289
+ }
290
+ }
291
+ };
292
+ return function(...args2) {
293
+ context = this;
294
+ timestamp = +/* @__PURE__ */ new Date();
295
+ const callNow = immediate && !timeout;
296
+ if (!timeout)
297
+ timeout = setTimeout(later, wait);
298
+ if (callNow) {
299
+ result = func.apply(context, args2);
300
+ context = args2 = null;
301
+ }
302
+ return result;
303
+ };
304
+ }
305
+ function deepClone(source) {
306
+ if (!source && typeof source !== "object") {
307
+ throw new Error("error arguments shallowClone");
308
+ }
309
+ const targetObj = source.constructor === Array ? [] : {};
310
+ Object.keys(source).forEach((keys) => {
311
+ if (source[keys] && typeof source[keys] === "object") {
312
+ targetObj[keys] = source[keys].constructor === Array ? [] : {};
313
+ targetObj[keys] = deepClone(source[keys]);
314
+ } else {
315
+ targetObj[keys] = source[keys];
316
+ }
317
+ });
318
+ return targetObj;
319
+ }
274
320
  const __sfc_main$3 = defineComponent({
275
321
  name: "NfSearchFromItem"
276
322
  });
@@ -286,12 +332,6 @@ __sfc_main$3.props = {
286
332
  required: false,
287
333
  type: null,
288
334
  default: () => ({})
289
- },
290
- itemWidth: {
291
- key: "itemWidth",
292
- required: false,
293
- type: Number,
294
- default: 170
295
335
  }
296
336
  };
297
337
  __sfc_main$3.setup = (__props, __ctx) => {
@@ -300,9 +340,6 @@ __sfc_main$3.setup = (__props, __ctx) => {
300
340
  const slotName = computed(() => {
301
341
  return props.itemOptions.slot || "";
302
342
  });
303
- const width = computed(() => {
304
- return props.itemWidth + "px";
305
- });
306
343
  const currentVal = computed({
307
344
  get() {
308
345
  return props.value;
@@ -312,7 +349,7 @@ __sfc_main$3.setup = (__props, __ctx) => {
312
349
  emit("update:value", val);
313
350
  }
314
351
  });
315
- const bindProps = computed(() => {
352
+ const getProps = () => {
316
353
  let obj = {
317
354
  clearable: true,
318
355
  ...props.itemOptions
@@ -326,6 +363,7 @@ __sfc_main$3.setup = (__props, __ctx) => {
326
363
  }
327
364
  delete obj.options;
328
365
  }
366
+ obj.key = createUniqueString();
329
367
  delete obj.label;
330
368
  delete obj.prop;
331
369
  delete obj.element;
@@ -334,6 +372,16 @@ __sfc_main$3.setup = (__props, __ctx) => {
334
372
  delete obj.events;
335
373
  delete obj.tooltip;
336
374
  return obj;
375
+ };
376
+ const bindProps = ref(getProps());
377
+ onBeforeMount(() => {
378
+ watch(() => {
379
+ return props.itemOptions;
380
+ }, () => {
381
+ bindProps.value = getProps();
382
+ }, {
383
+ deep: true
384
+ });
337
385
  });
338
386
  const bindEvents = computed(() => {
339
387
  const events = {
@@ -444,7 +492,6 @@ __sfc_main$3.setup = (__props, __ctx) => {
444
492
  };
445
493
  return {
446
494
  slotName,
447
- width,
448
495
  currentVal,
449
496
  bindProps,
450
497
  bindEvents,
@@ -479,10 +526,7 @@ var _sfc_render$3 = function render3() {
479
526
  var _vm = this, _c = _vm._self._c;
480
527
  _vm._self._setupProxy;
481
528
  return _c("div", {
482
- staticClass: "nf-search-form-item",
483
- style: {
484
- width: _vm.width
485
- }
529
+ staticClass: "nf-search-form-item"
486
530
  }, [_vm.slotName ? [_vm._t(_vm.slotName)] : [_vm.isInput ? _c("el-input", _vm._g(_vm._b({
487
531
  attrs: {
488
532
  "placeholder": _vm.itemOptions.placeholder
@@ -511,7 +555,6 @@ var _sfc_render$3 = function render3() {
511
555
  }
512
556
  }, "el-input-number", _vm.bindProps, false), _vm.bindEvents)) : _vm._e(), _vm.isSelect ? _c("nf-virtual-select", _vm._g(_vm._b({
513
557
  attrs: {
514
- "width": _vm.width,
515
558
  "item-options": _vm.itemOptions,
516
559
  "placeholder": _vm.itemOptions.placeholder
517
560
  },
@@ -5947,52 +5990,6 @@ const require$$0 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
5947
5990
  })(vuedraggable_umd);
5948
5991
  var vuedraggable_umdExports = vuedraggable_umd.exports;
5949
5992
  const draggable = /* @__PURE__ */ getDefaultExportFromCjs(vuedraggable_umdExports);
5950
- function createUniqueString(randomLength = 36) {
5951
- return Number(Math.random().toString().substr(3, randomLength) + Date.now()).toString(36);
5952
- }
5953
- function debounce(func, wait, immediate) {
5954
- let timeout, args, context, timestamp, result;
5955
- const later = function() {
5956
- const last = +/* @__PURE__ */ new Date() - timestamp;
5957
- if (last < wait && last > 0) {
5958
- timeout = setTimeout(later, wait - last);
5959
- } else {
5960
- timeout = null;
5961
- if (!immediate) {
5962
- result = func.apply(context, args);
5963
- if (!timeout)
5964
- context = args = null;
5965
- }
5966
- }
5967
- };
5968
- return function(...args2) {
5969
- context = this;
5970
- timestamp = +/* @__PURE__ */ new Date();
5971
- const callNow = immediate && !timeout;
5972
- if (!timeout)
5973
- timeout = setTimeout(later, wait);
5974
- if (callNow) {
5975
- result = func.apply(context, args2);
5976
- context = args2 = null;
5977
- }
5978
- return result;
5979
- };
5980
- }
5981
- function deepClone(source) {
5982
- if (!source && typeof source !== "object") {
5983
- throw new Error("error arguments shallowClone");
5984
- }
5985
- const targetObj = source.constructor === Array ? [] : {};
5986
- Object.keys(source).forEach((keys) => {
5987
- if (source[keys] && typeof source[keys] === "object") {
5988
- targetObj[keys] = source[keys].constructor === Array ? [] : {};
5989
- targetObj[keys] = deepClone(source[keys]);
5990
- } else {
5991
- targetObj[keys] = source[keys];
5992
- }
5993
- });
5994
- return targetObj;
5995
- }
5996
5993
  const __sfc_main$1 = defineComponent({
5997
5994
  name: "NfColumnCheckDrawer"
5998
5995
  });
@@ -6421,7 +6418,7 @@ var _sfc_staticRenderFns$1 = [];
6421
6418
  var __component__$1 = /* @__PURE__ */ normalizeComponent(__sfc_main$1, _sfc_render$1, _sfc_staticRenderFns$1, false, null, null, null, null);
6422
6419
  const ColumnCheckDrawer = __component__$1.exports;
6423
6420
  const __sfc_main = defineComponent({
6424
- name: "nf-search-from"
6421
+ name: "nf-search-form"
6425
6422
  });
6426
6423
  __sfc_main.props = {
6427
6424
  upIcon: {
@@ -6578,12 +6575,6 @@ __sfc_main.props = {
6578
6575
  type: String,
6579
6576
  default: "block"
6580
6577
  },
6581
- itemWidth: {
6582
- key: "itemWidth",
6583
- required: false,
6584
- type: Number,
6585
- default: 190
6586
- },
6587
6578
  labelWidth: {
6588
6579
  key: "labelWidth",
6589
6580
  required: false,
@@ -7130,9 +7121,9 @@ __sfc_main.setup = (__props, __ctx) => {
7130
7121
  const syncCookiesToSearchFormItemOptions = (readCached = true) => {
7131
7122
  var _a2;
7132
7123
  const columns = props.formOptions.map((item, index2) => {
7124
+ item.key = item.key || createUniqueString();
7133
7125
  item._index = index2;
7134
7126
  item.__index = index2;
7135
- item.key = item.key || createUniqueString();
7136
7127
  return item;
7137
7128
  });
7138
7129
  if (readCached && props.columnEdit) {
@@ -7178,6 +7169,13 @@ __sfc_main.setup = (__props, __ctx) => {
7178
7169
  immediate: true
7179
7170
  });
7180
7171
  onBeforeMount(() => {
7172
+ watch(() => {
7173
+ return props.formOptions;
7174
+ }, () => {
7175
+ syncCookiesToSearchFormItemOptions();
7176
+ }, {
7177
+ deep: true
7178
+ });
7181
7179
  const obj = {};
7182
7180
  props.formOptions.forEach((v) => {
7183
7181
  if (v.initValue !== void 0) {
@@ -7468,8 +7466,8 @@ var _sfc_render = function render6() {
7468
7466
  "label-width": item.labelWidth
7469
7467
  }
7470
7468
  }, [_c("search-form-item", {
7469
+ key: item.key,
7471
7470
  attrs: {
7472
- "item-width": _vm.itemWidth,
7473
7471
  "item-options": item
7474
7472
  },
7475
7473
  model: {
@@ -7479,8 +7477,9 @@ var _sfc_render = function render6() {
7479
7477
  },
7480
7478
  expression: "nfSearchFormModel[item.prop]"
7481
7479
  }
7482
- }, [item.tooltip ? _vm._t(item.tooltip.slot, null, {
7483
- "slot": item.tooltip.slot
7480
+ }, [item.tooltip ? _vm._t("default", null, {
7481
+ "slot": item.tooltip.slot,
7482
+ "nam": item.tooltip.slot
7484
7483
  }) : _vm._e(), item.slot ? _vm._t(item.slot, null, {
7485
7484
  "slot": item.slot
7486
7485
  }) : _vm._e()], 2), _vm.closable ? _c("div", {
@@ -7641,7 +7640,7 @@ var _sfc_render = function render6() {
7641
7640
  }
7642
7641
  }, [_c("i", {
7643
7642
  staticClass: "iconfont icon-shaixuan1 nf-fs12"
7644
- })])], 1) : _vm._e(), _vm.isShowBtnBoxSlot && _vm.reverseBtnSlot ? _vm._t("btnBox") : _vm._e()], 2) : _vm._e(), _vm.configNfSearchItemVisibleDialog && _vm.checkMode === "dialog" ? _c("column-check-dialog", {
7643
+ })])], 1) : _vm._e(), _vm.isShowBtnBoxSlot && _vm.reverseBtnSlot ? _vm._t("btnBox") : _vm._e()], 2) : _vm._e(), _vm.columnEdit && _vm.configNfSearchItemVisibleDialog && _vm.checkMode === "dialog" ? _c("column-check-dialog", {
7645
7644
  ref: "columnCheckDialog",
7646
7645
  attrs: {
7647
7646
  "storage-key": _vm.storageKey,
@@ -7686,7 +7685,7 @@ var _sfc_render = function render6() {
7686
7685
  "slot": "title"
7687
7686
  }), _vm._t("dialogFooter", null, {
7688
7687
  "slot": "footer"
7689
- })], 2) : _vm._e(), _vm.checkMode === "drawer" ? _c("nf-drawer", {
7688
+ })], 2) : _vm._e(), _vm.columnEdit && _vm.checkMode === "drawer" ? _c("nf-drawer", {
7690
7689
  ref: "columnCheckNfDrawer",
7691
7690
  attrs: {
7692
7691
  "size": "680px",
@@ -69,14 +69,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
69
69
  type: import("vue-demi").PropType<boolean>;
70
70
  default: boolean;
71
71
  };
72
- itemWidth: {
73
- type: import("vue-demi").PropType<number>;
74
- default: number;
75
- };
76
72
  rules: {
77
73
  type: import("vue-demi").PropType<Record<string, any>>;
78
74
  default: undefined;
79
75
  };
76
+ inline: {
77
+ type: import("vue-demi").PropType<boolean>;
78
+ default: boolean;
79
+ };
80
80
  upIcon: {
81
81
  type: import("vue-demi").PropType<string>;
82
82
  default: string;
@@ -155,16 +155,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
155
155
  type: import("vue-demi").PropType<"right" | "left" | "top">;
156
156
  default: string;
157
157
  };
158
- inline: {
159
- type: import("vue-demi").PropType<boolean>;
160
- default: boolean;
161
- };
162
158
  btnBoxLabel: {
163
159
  type: import("vue-demi").PropType<string>;
164
160
  default: string;
165
161
  };
166
162
  btnModel: {
167
- type: import("vue-demi").PropType<"block" | "inline">;
163
+ type: import("vue-demi").PropType<"inline" | "block">;
168
164
  default: string;
169
165
  };
170
166
  labelWidth: {
@@ -548,14 +544,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
548
544
  type: import("vue-demi").PropType<boolean>;
549
545
  default: boolean;
550
546
  };
551
- itemWidth: {
552
- type: import("vue-demi").PropType<number>;
553
- default: number;
554
- };
555
547
  rules: {
556
548
  type: import("vue-demi").PropType<Record<string, any>>;
557
549
  default: undefined;
558
550
  };
551
+ inline: {
552
+ type: import("vue-demi").PropType<boolean>;
553
+ default: boolean;
554
+ };
559
555
  upIcon: {
560
556
  type: import("vue-demi").PropType<string>;
561
557
  default: string;
@@ -634,16 +630,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
634
630
  type: import("vue-demi").PropType<"right" | "left" | "top">;
635
631
  default: string;
636
632
  };
637
- inline: {
638
- type: import("vue-demi").PropType<boolean>;
639
- default: boolean;
640
- };
641
633
  btnBoxLabel: {
642
634
  type: import("vue-demi").PropType<string>;
643
635
  default: string;
644
636
  };
645
637
  btnModel: {
646
- type: import("vue-demi").PropType<"block" | "inline">;
638
+ type: import("vue-demi").PropType<"inline" | "block">;
647
639
  default: string;
648
640
  };
649
641
  labelWidth: {
@@ -902,8 +894,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
902
894
  size: 'medium' | 'small' | 'mini';
903
895
  selectEmptyWarningTips: string;
904
896
  disabled: boolean;
905
- itemWidth: number;
906
897
  rules: Record<string, any>;
898
+ inline: boolean;
907
899
  upIcon: string;
908
900
  downIcon: string;
909
901
  columns: number;
@@ -922,7 +914,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
922
914
  statusIcon: boolean;
923
915
  validateOnRuleChange: boolean;
924
916
  labelPosition: 'top' | 'right' | 'left';
925
- inline: boolean;
926
917
  btnBoxLabel: string;
927
918
  btnModel: 'inline' | 'block';
928
919
  labelWidth: number;
@@ -982,9 +973,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue-demi").DefineCompone
982
973
  resetBtnClass: string;
983
974
  }>, Partial<Record<string, (_: {
984
975
  slot: string;
985
- }) => any>> & Partial<Record<string, (_: {
986
- slot: string;
987
976
  }) => any>> & {
977
+ default?(_: {
978
+ nam: string;
979
+ slot: string;
980
+ }): any;
988
981
  btnBox?(_: {}): any;
989
982
  dialogTitle?(_: {
990
983
  slot: string;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="nf-search-form-item" :style="{ width }">
2
+ <div class="nf-search-form-item">
3
3
  <template v-if="slotName">
4
4
  <slot :name="slotName" />
5
5
  </template>
@@ -22,7 +22,6 @@
22
22
  />
23
23
  <nf-virtual-select
24
24
  v-if="isSelect"
25
- :width="width"
26
25
  v-model="currentVal"
27
26
  v-bind="bindProps"
28
27
  v-on="bindEvents"
@@ -180,8 +179,14 @@ export default defineComponent({
180
179
  <script lang="ts" setup>
181
180
  import NumberRange from './nf-number-range.vue'
182
181
  import TimeRange from './nf-time-range.vue'
183
- import { computed } from 'vue-demi'
182
+ import {
183
+ computed,
184
+ ref,
185
+ watch,
186
+ onBeforeMount
187
+ } from 'vue-demi'
184
188
  import { NfSearchFormItemOption } from '@94ai/nf-search-form/lib/types'
189
+ import { createUniqueString } from './tools'
185
190
 
186
191
  const emit = defineEmits<{
187
192
  (e: 'input', event: any): void
@@ -197,24 +202,15 @@ const props = withDefaults(defineProps<{
197
202
  * 单个表单项渲染数据
198
203
  */
199
204
  itemOptions?: NfSearchFormItemOption,
200
- /**
201
- * content宽度
202
- */
203
- itemWidth?: number,
204
205
  }>(), {
205
206
  value: undefined,
206
207
  itemOptions: () => ({}),
207
- itemWidth: 170,
208
208
  })
209
209
 
210
210
  const slotName = computed(() => {
211
211
  return props.itemOptions.slot || ''
212
212
  })
213
213
 
214
- const width = computed(() => {
215
- return props.itemWidth + 'px'
216
- })
217
-
218
214
  // 双向绑定数据值
219
215
  const currentVal = computed({
220
216
  get() {
@@ -226,8 +222,7 @@ const currentVal = computed({
226
222
  }
227
223
  })
228
224
 
229
- // 绑定属性
230
- const bindProps = computed(() => {
225
+ const getProps = () => {
231
226
  let obj:Record<string, any> = {
232
227
  clearable: true,
233
228
  ...props.itemOptions
@@ -242,6 +237,7 @@ const bindProps = computed(() => {
242
237
  }
243
238
  delete obj.options
244
239
  }
240
+ obj.key = createUniqueString()
245
241
  delete obj.label
246
242
  delete obj.prop
247
243
  delete obj.element
@@ -250,6 +246,19 @@ const bindProps = computed(() => {
250
246
  delete obj.events
251
247
  delete obj.tooltip
252
248
  return obj
249
+ }
250
+
251
+ // 绑定属性
252
+ const bindProps = ref(getProps())
253
+
254
+ onBeforeMount(() => {
255
+ watch(() => {
256
+ return props.itemOptions
257
+ }, () => {
258
+ bindProps.value = getProps()
259
+ }, {
260
+ deep: true
261
+ })
253
262
  })
254
263
 
255
264
  // 绑定方法
@@ -51,11 +51,12 @@
51
51
  :required="item.required"
52
52
  :label-width="item.labelWidth"
53
53
  >
54
- <search-form-item v-model="nfSearchFormModel[item.prop]"
55
- :item-width="itemWidth"
56
- :item-options="item">
54
+ <search-form-item
55
+ :key="item.key"
56
+ v-model="nfSearchFormModel[item.prop]"
57
+ :item-options="item">
57
58
  <!-- 定制化SearchItem?提示-->
58
- <slot :name="item.tooltip.slot" v-if="item.tooltip" :slot="item.tooltip.slot" />
59
+ <slot :nam="item.tooltip.slot" v-if="item.tooltip" :slot="item.tooltip.slot" />
59
60
  <!-- 定制化SearchItem插槽-->
60
61
  <slot :name="item.slot" v-if="item.slot" :slot="item.slot" />
61
62
  </search-form-item>
@@ -197,7 +198,7 @@
197
198
  <column-check-dialog
198
199
  ref="columnCheckDialog"
199
200
  :storage-key="storageKey"
200
- v-if="configNfSearchItemVisibleDialog && checkMode === 'dialog'"
201
+ v-if="columnEdit && configNfSearchItemVisibleDialog && checkMode === 'dialog'"
201
202
  :show.sync="configNfSearchItemVisibleDialog"
202
203
  :table-columns="formOptions"
203
204
  :title="moreDialogTitle"
@@ -228,7 +229,7 @@
228
229
  <nf-drawer
229
230
  ref="columnCheckNfDrawer"
230
231
  size="680px"
231
- v-if="checkMode === 'drawer'"
232
+ v-if="columnEdit && checkMode === 'drawer'"
232
233
  :title="moreDialogTitle"
233
234
  :cancel-button-text="columnCheckCancelButtonText"
234
235
  :confirm-button-text="columnCheckConfirmButtonText"
@@ -262,7 +263,7 @@
262
263
  import { defineComponent } from 'vue-demi'
263
264
 
264
265
  export default defineComponent({
265
- name: 'nf-search-from'
266
+ name: 'nf-search-form'
266
267
  })
267
268
  </script>
268
269
 
@@ -330,10 +331,6 @@ const props = withDefaults(defineProps<{
330
331
  inline?: boolean
331
332
  btnBoxLabel?: string
332
333
  btnModel?: 'inline' | 'block'
333
- /**
334
- * 兼容ai-search-form控制item父dom宽度
335
- */
336
- itemWidth?: number,
337
334
  /**
338
335
  * label宽度
339
336
  */
@@ -481,7 +478,6 @@ const props = withDefaults(defineProps<{
481
478
  formOptions: () => [],
482
479
  showItems: () => [],
483
480
  closable: false,
484
- itemWidth: 190,
485
481
  btnItems: () => '',
486
482
  columnEdit: false,
487
483
  btnBoxLabel: '',
@@ -703,9 +699,9 @@ const isShowBtnBoxSlot = computed(() => {
703
699
  const renderSearchFormItemOptions = ref<NfSearchFormItemOption[]>([])
704
700
  const syncCookiesToSearchFormItemOptions = (readCached = true) => {
705
701
  const columns = props.formOptions!.map((item, index) => {
702
+ item.key = item.key || createUniqueString()
706
703
  item._index = index
707
704
  item.__index = index
708
- item.key = item.key || createUniqueString()
709
705
  return item
710
706
  })
711
707
  if (readCached && props.columnEdit) {
@@ -770,6 +766,21 @@ watch(() => {
770
766
  * 初始化formData表单数据
771
767
  */
772
768
  onBeforeMount(() => {
769
+ /**
770
+ * 有部分人喜欢用computed当作formOptions,
771
+ * 由于computed的数据子孙属性改变会引起整个formOptions引用的改动,而且旧对象引用的子属性并未变更
772
+ * 这里需要watch同步到renderSearchFormItemOptions(子组件借助renderSearchFormItemOptions引用watch去监听,如果是data当作formOptions可以不用这个watch)
773
+ *
774
+ * 用computed去改里面的副作用,这样会整个computed改变引起整个表单重新渲染,为此需要每个item传个key,不然就不会有局部更新的效果
775
+ * 用data就是data引用不动,局部动,就会直接局部更新了(不需要这里的watch,考虑到用户用computed写起来更简单,这里就做了兼容,算是优化)
776
+ */
777
+ watch(() => {
778
+ return props.formOptions
779
+ }, () => {
780
+ syncCookiesToSearchFormItemOptions()
781
+ }, {
782
+ deep: true
783
+ })
773
784
  const obj: Record<string, any> = {}
774
785
  props.formOptions.forEach(v => {
775
786
  if (v.initValue !== undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-search-form",
3
- "version": "3.2.21",
3
+ "version": "3.2.25",
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.21",
18
- "@94ai/nf-double-half-year": "^3.2.21",
19
- "@94ai/nf-double-quarter": "^3.2.21",
20
- "@94ai/nf-double-week": "^3.2.21",
21
- "@94ai/nf-double-year": "^3.2.21",
22
- "@94ai/nf-drawer": "^3.2.21",
23
- "@94ai/nf-form": "^3.2.21",
24
- "@94ai/nf-form-item": "^3.2.21",
25
- "@94ai/nf-half-year-picker": "^3.2.21",
26
- "@94ai/nf-message": "^3.2.21",
27
- "@94ai/nf-quarter-picker": "^3.2.21",
28
- "@94ai/nf-select-transfer": "^3.2.21",
29
- "@94ai/nf-theme-chalk": "^3.2.21",
30
- "@94ai/nf-virtual-select": "^3.2.21",
17
+ "@94ai/nf-action": "^3.2.25",
18
+ "@94ai/nf-double-half-year": "^3.2.25",
19
+ "@94ai/nf-double-quarter": "^3.2.25",
20
+ "@94ai/nf-double-week": "^3.2.25",
21
+ "@94ai/nf-double-year": "^3.2.25",
22
+ "@94ai/nf-drawer": "^3.2.25",
23
+ "@94ai/nf-form": "^3.2.25",
24
+ "@94ai/nf-form-item": "^3.2.25",
25
+ "@94ai/nf-half-year-picker": "^3.2.25",
26
+ "@94ai/nf-message": "^3.2.25",
27
+ "@94ai/nf-quarter-picker": "^3.2.25",
28
+ "@94ai/nf-select-transfer": "^3.2.25",
29
+ "@94ai/nf-theme-chalk": "^3.2.25",
30
+ "@94ai/nf-virtual-select": "^3.2.25",
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": "8da3362ffe37c1c3114c8bca6c0fe24ac21c0c78"
48
+ "gitHead": "8cef5ebb5a3f98596f2f279bcfcd337d293767d2"
49
49
  }