@94ai/nf-search-form 8.3.23 → 10.0.0

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.
@@ -1,9 +1,8 @@
1
1
  import { defineComponent, ref, getCurrentInstance, computed, watch, onBeforeMount, onMounted, nextTick, onBeforeUnmount } from "vue-demi";
2
2
  import { normalizeComponent } from "@94ai/vue2-runtime-helpers";
3
- import { createUniqueString, CachedManager, deepClone, validate, resolveValue, mapDispose } from "@94ai/common-utils";
3
+ import { useLocale, createUniqueString, CachedManager, deepClone, validate, resolveValue, mapDispose } from "@94ai/common-utils";
4
4
  import ResizeObserver from "resize-observer-polyfill";
5
5
  import { getCurrentInstance as getCurrentInstance$1, effectScope, shallowReactive, set } from "vue";
6
- import { throttle as throttle$1 } from "lodash-es";
7
6
  import { ELEMENT_LABEL_TYPE_DEFAULT_VALUE, EXCHANGE_KEY_TYPE } from "@94ai/common-constants";
8
7
  import NfMessage from "@94ai/nf-message";
9
8
  const __sfc_main$5 = defineComponent({
@@ -38,7 +37,7 @@ __sfc_main$5.setup = (__props, __ctx) => {
38
37
  const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
39
38
  const emit = __ctx.emit;
40
39
  const inputlistens = computed(() => {
41
- const list = Object.assign({}, (instance == null ? void 0 : instance.$listeners) || {}, {
40
+ const list = Object.assign({}, instance == null ? void 0 : instance.$listeners, {
42
41
  change: function() {
43
42
  emit("change", [minNumber.value, maxNumber.value]);
44
43
  }
@@ -210,18 +209,19 @@ __sfc_main$4.props = {
210
209
  endPlaceholder: {
211
210
  key: "endPlaceholder",
212
211
  required: false,
213
- type: String,
214
- default: "结束时间"
212
+ type: String
215
213
  },
216
214
  startPlaceholder: {
217
215
  key: "startPlaceholder",
218
216
  required: false,
219
- type: String,
220
- default: "开始时间"
217
+ type: String
221
218
  }
222
219
  };
223
220
  __sfc_main$4.setup = (__props, __ctx) => {
224
221
  var _a;
222
+ const {
223
+ t
224
+ } = useLocale();
225
225
  const props = __props;
226
226
  const emit = __ctx.emit;
227
227
  const startTime = ref();
@@ -241,7 +241,7 @@ __sfc_main$4.setup = (__props, __ctx) => {
241
241
  attrs == null ? true : delete attrs.type;
242
242
  const pickerOptions = (attrs == null ? void 0 : attrs["picker-options"]) || {};
243
243
  return {
244
- ...attrs || {},
244
+ ...attrs,
245
245
  "picker-options": {
246
246
  ...pickerOptions
247
247
  }
@@ -291,6 +291,7 @@ __sfc_main$4.setup = (__props, __ctx) => {
291
291
  emit("input", [startTime.value, endTime.value]);
292
292
  });
293
293
  return {
294
+ t,
294
295
  startTime,
295
296
  endTime,
296
297
  inputlistens,
@@ -306,7 +307,7 @@ var _sfc_render$4 = function render2() {
306
307
  }, [_c("el-time-select", _vm._g(_vm._b({
307
308
  staticClass: "nf-time-range-el-time-select",
308
309
  attrs: {
309
- "placeholder": _vm.startPlaceholder
310
+ "placeholder": _vm.startPlaceholder || _vm.t("nf.common.startTime")
310
311
  },
311
312
  model: {
312
313
  value: _vm.startTime,
@@ -320,7 +321,7 @@ var _sfc_render$4 = function render2() {
320
321
  }, [_vm._v("~")]), _c("el-time-select", _vm._g(_vm._b({
321
322
  staticClass: "nf-time-range-el-time-select",
322
323
  attrs: {
323
- "placeholder": _vm.endPlaceholder
324
+ "placeholder": _vm.endPlaceholder || _vm.t("nf.common.endTime")
324
325
  },
325
326
  model: {
326
327
  value: _vm.endTime,
@@ -370,6 +371,9 @@ __sfc_main$3.setup = (__props, __ctx) => {
370
371
  const emit = __ctx.emit;
371
372
  const props = __props;
372
373
  const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
374
+ const {
375
+ t
376
+ } = useLocale();
373
377
  const slotName = computed(() => {
374
378
  return props.itemOptions.slot || "";
375
379
  });
@@ -462,7 +466,7 @@ __sfc_main$3.setup = (__props, __ctx) => {
462
466
  if (events == null ? void 0 : events.change) {
463
467
  delete events.change;
464
468
  }
465
- return events || {};
469
+ return events;
466
470
  });
467
471
  const tooltip = computed(() => {
468
472
  return props.itemOptions.tooltip;
@@ -599,6 +603,7 @@ __sfc_main$3.setup = (__props, __ctx) => {
599
603
  }
600
604
  };
601
605
  return {
606
+ t,
602
607
  slotName,
603
608
  inputSlotPrepend,
604
609
  inputSlotAppend,
@@ -738,9 +743,9 @@ var _sfc_render$3 = function render3() {
738
743
  attrs: {
739
744
  "type": _vm.itemOptions.type || "datetimerange",
740
745
  "clearable": _vm.itemOptions.clearable || true,
741
- "start-placeholder": _vm.itemOptions.startPlaceholder || "开始日期",
746
+ "start-placeholder": _vm.itemOptions.startPlaceholder || _vm.t("nf.common.startDate"),
742
747
  "range-separator": _vm.itemOptions.rangeSeparator || "-",
743
- "end-placeholder": _vm.itemOptions.endPlaceholder || "结束日期",
748
+ "end-placeholder": _vm.itemOptions.endPlaceholder || _vm.t("nf.common.endDate"),
744
749
  "default-time": _vm.itemOptions.defaultTime || ["00:00:00", "23:59:59"],
745
750
  "value-format": _vm.itemOptions.valueFormat || "yyyy-MM-dd HH:mm:ss"
746
751
  },
@@ -764,9 +769,9 @@ var _sfc_render$3 = function render3() {
764
769
  attrs: {
765
770
  "type": _vm.itemOptions.type || "datetimerange",
766
771
  "clearable": _vm.itemOptions.clearable || true,
767
- "start-placeholder": _vm.itemOptions.startPlaceholder || "开始日期",
772
+ "start-placeholder": _vm.itemOptions.startPlaceholder || _vm.t("nf.common.startDate"),
768
773
  "range-separator": _vm.itemOptions.rangeSeparator || "-",
769
- "end-placeholder": _vm.itemOptions.endPlaceholder || "结束日期",
774
+ "end-placeholder": _vm.itemOptions.endPlaceholder || _vm.t("nf.common.endDate"),
770
775
  "default-time": _vm.itemOptions.defaultTime || ["00:00:00", "23:59:59"],
771
776
  "value-format": _vm.itemOptions.valueFormat || "yyyy-MM-dd HH:mm:ss"
772
777
  },
@@ -790,9 +795,9 @@ var _sfc_render$3 = function render3() {
790
795
  attrs: {
791
796
  "type": "monthrange",
792
797
  "clearable": _vm.itemOptions.clearable || true,
793
- "start-placeholder": _vm.itemOptions.startPlaceholder || "开始日期",
798
+ "start-placeholder": _vm.itemOptions.startPlaceholder || _vm.t("nf.common.startDate"),
794
799
  "range-separator": _vm.itemOptions.rangeSeparator || "-",
795
- "end-placeholder": _vm.itemOptions.endPlaceholder || "结束日期",
800
+ "end-placeholder": _vm.itemOptions.endPlaceholder || _vm.t("nf.common.endDate"),
796
801
  "value-format": _vm.itemOptions.valueFormat || "yyyy-MM"
797
802
  },
798
803
  on: {
@@ -815,9 +820,9 @@ var _sfc_render$3 = function render3() {
815
820
  attrs: {
816
821
  "type": "monthrange",
817
822
  "clearable": _vm.itemOptions.clearable || true,
818
- "start-placeholder": _vm.itemOptions.startPlaceholder || "开始日期",
823
+ "start-placeholder": _vm.itemOptions.startPlaceholder || _vm.t("nf.common.startDate"),
819
824
  "range-separator": _vm.itemOptions.rangeSeparator || "-",
820
- "end-placeholder": _vm.itemOptions.endPlaceholder || "结束日期",
825
+ "end-placeholder": _vm.itemOptions.endPlaceholder || _vm.t("nf.common.endDate"),
821
826
  "value-format": _vm.itemOptions.valueFormat || "yyyy-MM"
822
827
  },
823
828
  on: {
@@ -838,7 +843,7 @@ var _sfc_render$3 = function render3() {
838
843
  "slot": "range-separator"
839
844
  })], 2) : _vm._e(), _vm.isDatePickerOthers ? _c("nf-date-picker", _vm._g(_vm._b({
840
845
  attrs: {
841
- "placeholder": _vm.itemOptions.placeholder || "请选择日期",
846
+ "placeholder": _vm.itemOptions.placeholder || _vm.t("nf.common.selectDate"),
842
847
  "type": _vm.itemOptions.type
843
848
  },
844
849
  on: {
@@ -859,7 +864,7 @@ var _sfc_render$3 = function render3() {
859
864
  "slot": "range-separator"
860
865
  })], 2) : _vm._e(), _vm.isElDatePickerOthers ? _c("nf-timezone-picker", _vm._g(_vm._b({
861
866
  attrs: {
862
- "placeholder": _vm.itemOptions.placeholder || "请选择日期",
867
+ "placeholder": _vm.itemOptions.placeholder || _vm.t("nf.common.selectDate"),
863
868
  "type": _vm.itemOptions.type
864
869
  },
865
870
  on: {
@@ -880,7 +885,7 @@ var _sfc_render$3 = function render3() {
880
885
  "slot": "range-separator"
881
886
  })], 2) : _vm._e(), _vm.isDoubleWeek ? _c("nf-double-week", _vm._g(_vm._b({
882
887
  attrs: {
883
- "placeholder": _vm.itemOptions.placeholder || "请选择周"
888
+ "placeholder": _vm.itemOptions.placeholder || _vm.t("nf.common.selectWeek")
884
889
  },
885
890
  model: {
886
891
  value: _vm.currentVal,
@@ -897,7 +902,7 @@ var _sfc_render$3 = function render3() {
897
902
  "slot": "range-separator"
898
903
  })], 2) : _vm._e(), _vm.isYearPickerYearRange ? _c("nf-double-year", _vm._g(_vm._b({
899
904
  attrs: {
900
- "placeholder": _vm.itemOptions.placeholder || "请选择年"
905
+ "placeholder": _vm.itemOptions.placeholder || _vm.t("nf.common.selectYear")
901
906
  },
902
907
  model: {
903
908
  value: _vm.currentVal,
@@ -914,7 +919,7 @@ var _sfc_render$3 = function render3() {
914
919
  "slot": "range-separator"
915
920
  })], 2) : _vm._e(), _vm.isQuarterPickerQuarterRange ? _c("nf-double-quarter", _vm._g(_vm._b({
916
921
  attrs: {
917
- "placeholder": _vm.itemOptions.placeholder || "请选择季度"
922
+ "placeholder": _vm.itemOptions.placeholder || _vm.t("nf.common.selectQuarter")
918
923
  },
919
924
  model: {
920
925
  value: _vm.currentVal,
@@ -931,7 +936,7 @@ var _sfc_render$3 = function render3() {
931
936
  "slot": "range-separator"
932
937
  })], 2) : _vm._e(), _vm.isHalfYearPickerHalfYearRange ? _c("nf-double-half-year", _vm._g(_vm._b({
933
938
  attrs: {
934
- "placeholder": _vm.itemOptions.placeholder || "请选择半年"
939
+ "placeholder": _vm.itemOptions.placeholder || _vm.t("nf.common.selectHalfYear")
935
940
  },
936
941
  model: {
937
942
  value: _vm.currentVal,
@@ -948,7 +953,7 @@ var _sfc_render$3 = function render3() {
948
953
  "slot": "range-separator"
949
954
  })], 2) : _vm._e(), _vm.isHalfYearPicker ? _c("nf-half-year-picker", _vm._g(_vm._b({
950
955
  attrs: {
951
- "placeholder": _vm.itemOptions.placeholder || "请选择半年"
956
+ "placeholder": _vm.itemOptions.placeholder || _vm.t("nf.common.selectHalfYear")
952
957
  },
953
958
  model: {
954
959
  value: _vm.currentVal,
@@ -965,7 +970,7 @@ var _sfc_render$3 = function render3() {
965
970
  "slot": "range-separator"
966
971
  })], 2) : _vm._e(), _vm.isQuarterPicker ? _c("nf-quarter-picker", _vm._g(_vm._b({
967
972
  attrs: {
968
- "placeholder": _vm.itemOptions.placeholder || "请选择季度"
973
+ "placeholder": _vm.itemOptions.placeholder || _vm.t("nf.common.selectQuarter")
969
974
  },
970
975
  model: {
971
976
  value: _vm.currentVal,
@@ -996,7 +1001,7 @@ var _sfc_render$3 = function render3() {
996
1001
  }
997
1002
  }, "el-cascader", _vm.bindProps, false), _vm.bindEvents)) : _vm._e(), _vm.isTimeSelect ? _c("el-time-select", _vm._g(_vm._b({
998
1003
  attrs: {
999
- "placeholder": _vm.itemOptions.placeholder || "请选择时间"
1004
+ "placeholder": _vm.itemOptions.placeholder || _vm.t("nf.common.selectTime")
1000
1005
  },
1001
1006
  on: {
1002
1007
  "change": _vm.handleChange
@@ -1010,8 +1015,8 @@ var _sfc_render$3 = function render3() {
1010
1015
  }
1011
1016
  }, "el-time-select", _vm.bindProps, false), _vm.bindEvents)) : _vm._e(), _vm.isTimeSelectRange ? _c("time-range", _vm._g(_vm._b({
1012
1017
  attrs: {
1013
- "start-placeholder": _vm.itemOptions.startPlaceholder || "开始时间",
1014
- "end-placeholder": _vm.itemOptions.endPlaceholder || "结束时间"
1018
+ "start-placeholder": _vm.itemOptions.startPlaceholder || _vm.t("nf.common.startTime"),
1019
+ "end-placeholder": _vm.itemOptions.endPlaceholder || _vm.t("nf.common.endTime")
1015
1020
  },
1016
1021
  on: {
1017
1022
  "change": _vm.handleChange
@@ -1025,9 +1030,9 @@ var _sfc_render$3 = function render3() {
1025
1030
  }
1026
1031
  }, "time-range", _vm.bindProps, false), _vm.bindEvents)) : _vm._e(), _vm.isTimePicker ? _c("el-time-picker", _vm._g(_vm._b({
1027
1032
  attrs: {
1028
- "placeholder": _vm.itemOptions.placeholder || "请选择时间",
1029
- "start-placeholder": _vm.itemOptions.startPlaceholder || "请选择时间",
1030
- "end-placeholder": _vm.itemOptions.endPlaceholder || "请选择时间"
1033
+ "placeholder": _vm.itemOptions.placeholder || _vm.t("nf.common.selectTime"),
1034
+ "start-placeholder": _vm.itemOptions.startPlaceholder || _vm.t("nf.common.selectTime"),
1035
+ "end-placeholder": _vm.itemOptions.endPlaceholder || _vm.t("nf.common.selectTime")
1031
1036
  },
1032
1037
  on: {
1033
1038
  "change": _vm.handleChange
@@ -3465,7 +3470,7 @@ var autoScroll = throttle(function(evt, options, rootEl2, isFallback) {
3465
3470
  clearInterval(autoScrolls[layersOut].pid);
3466
3471
  if (vx != 0 || vy != 0) {
3467
3472
  scrollThisInstance = true;
3468
- autoScrolls[layersOut].pid = setInterval((function() {
3473
+ autoScrolls[layersOut].pid = setInterval(function() {
3469
3474
  if (isFallback && this.layer === 0) {
3470
3475
  Sortable.active._onTouchMove(touchEvt$1);
3471
3476
  }
@@ -3477,7 +3482,7 @@ var autoScroll = throttle(function(evt, options, rootEl2, isFallback) {
3477
3482
  }
3478
3483
  }
3479
3484
  scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
3480
- }).bind({
3485
+ }.bind({
3481
3486
  layer: layersOut
3482
3487
  }), 24);
3483
3488
  }
@@ -4182,9 +4187,9 @@ const require$$0 = /* @__PURE__ */ getAugmentedNamespace(sortable_esm);
4182
4187
  });
4183
4188
  if (mode & 2 && typeof value != "string")
4184
4189
  for (var key in value)
4185
- __webpack_require__.d(ns, key, (function(key2) {
4190
+ __webpack_require__.d(ns, key, function(key2) {
4186
4191
  return value[key2];
4187
- }).bind(null, key));
4192
+ }.bind(null, key));
4188
4193
  return ns;
4189
4194
  };
4190
4195
  __webpack_require__.n = function(module2) {
@@ -6441,15 +6446,11 @@ __sfc_main$1.setup = (__props, __ctx) => {
6441
6446
  fixedColumn.value.splice(fixedIndex, 1);
6442
6447
  }
6443
6448
  };
6444
- const insertColumn = (column, append = false) => {
6449
+ const insertColumn = (column) => {
6445
6450
  const unFixedIndex = unFixedColumn.value.findIndex((item) => item.prop === column.prop);
6446
6451
  const fixedIndex = fixedColumn.value.findIndex((item) => item.prop === column.prop);
6447
6452
  if (unFixedIndex === -1 && fixedIndex === -1) {
6448
- if (append) {
6449
- (column.attr.fixed ? fixedColumn.value : unFixedColumn.value).push(column);
6450
- } else {
6451
- (column.attr.fixed ? fixedColumn.value : unFixedColumn.value).unshift(column);
6452
- }
6453
+ (column.attr.fixed ? fixedColumn.value : unFixedColumn.value).push(column);
6453
6454
  }
6454
6455
  };
6455
6456
  const updateCheckStatus = () => {
@@ -6499,13 +6500,14 @@ __sfc_main$1.setup = (__props, __ctx) => {
6499
6500
  if (item) {
6500
6501
  item.initHidden = false;
6501
6502
  const cloneItem = deepClone(item);
6502
- if (!cloneItem.attr) {
6503
- cloneItem.attr = {};
6504
- }
6505
6503
  newColumns.push(cloneItem);
6506
6504
  }
6507
6505
  });
6508
6506
  currentTable.value = newColumns;
6507
+ if (columnName.value) {
6508
+ searchValue = currentTable.value.filter((item) => (item.addLabel || item.label).includes(columnName.value));
6509
+ setFields(searchValue);
6510
+ }
6509
6511
  currentTable.value.map((item) => {
6510
6512
  if (item.attr.fixed) {
6511
6513
  fixedColumn.value.push(item);
@@ -6522,7 +6524,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
6522
6524
  searchValue.map((item) => {
6523
6525
  if (!unChangedColumn.value.includes(item.prop)) {
6524
6526
  if (v) {
6525
- insertColumn(item, true);
6527
+ insertColumn(item);
6526
6528
  } else {
6527
6529
  pullAwayColumn(item);
6528
6530
  }
@@ -6534,7 +6536,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
6534
6536
  currentTable.value.map((item) => {
6535
6537
  if (!unChangedColumn.value.includes(item.prop)) {
6536
6538
  if (v) {
6537
- insertColumn(item, true);
6539
+ insertColumn(item);
6538
6540
  } else {
6539
6541
  pullAwayColumn(item);
6540
6542
  }
@@ -6551,7 +6553,7 @@ __sfc_main$1.setup = (__props, __ctx) => {
6551
6553
  if (item.prop === prop) {
6552
6554
  item.initHidden = !v;
6553
6555
  v ? "" : item.attr.fixed = false;
6554
- v ? insertColumn(item, true) : pullAwayColumn(item);
6556
+ v ? insertColumn(item) : pullAwayColumn(item);
6555
6557
  }
6556
6558
  });
6557
6559
  updateCheckStatus();
@@ -6949,14 +6951,12 @@ __sfc_main.props = {
6949
6951
  expandBtnTooltipDesc: {
6950
6952
  key: "expandBtnTooltipDesc",
6951
6953
  required: false,
6952
- type: String,
6953
- default: "展开"
6954
+ type: String
6954
6955
  },
6955
6956
  shrinkBtnTooltipDesc: {
6956
6957
  key: "shrinkBtnTooltipDesc",
6957
6958
  required: false,
6958
- type: String,
6959
- default: "收起"
6959
+ type: String
6960
6960
  },
6961
6961
  requiredValidate: {
6962
6962
  key: "requiredValidate",
@@ -7099,8 +7099,7 @@ __sfc_main.props = {
7099
7099
  selectEmptyWarningTips: {
7100
7100
  key: "selectEmptyWarningTips",
7101
7101
  required: false,
7102
- type: String,
7103
- default: "请选择至少一个选项"
7102
+ type: String
7104
7103
  },
7105
7104
  columnDisplayBtnText: {
7106
7105
  key: "columnDisplayBtnText",
@@ -7164,20 +7163,17 @@ __sfc_main.props = {
7164
7163
  columnCheckCancelButtonText: {
7165
7164
  key: "columnCheckCancelButtonText",
7166
7165
  required: false,
7167
- type: String,
7168
- default: "取消"
7166
+ type: String
7169
7167
  },
7170
7168
  columnCheckConfirmButtonText: {
7171
7169
  key: "columnCheckConfirmButtonText",
7172
7170
  required: false,
7173
- type: String,
7174
- default: "确定"
7171
+ type: String
7175
7172
  },
7176
7173
  moreDialogTitle: {
7177
7174
  key: "moreDialogTitle",
7178
7175
  required: false,
7179
- type: String,
7180
- default: "设置显示查询框"
7176
+ type: String
7181
7177
  },
7182
7178
  moreDialogWidth: {
7183
7179
  key: "moreDialogWidth",
@@ -7266,44 +7262,37 @@ __sfc_main.props = {
7266
7262
  columnCheckSearchPlaceholder: {
7267
7263
  key: "columnCheckSearchPlaceholder",
7268
7264
  required: false,
7269
- type: String,
7270
- default: "搜索"
7265
+ type: String
7271
7266
  },
7272
7267
  columnCheckFixedLeftDesc: {
7273
7268
  key: "columnCheckFixedLeftDesc",
7274
7269
  required: false,
7275
- type: String,
7276
- default: "固定在左侧"
7270
+ type: String
7277
7271
  },
7278
7272
  columnCheckClearDesc: {
7279
7273
  key: "columnCheckClearDesc",
7280
7274
  required: false,
7281
- type: String,
7282
- default: "清除"
7275
+ type: String
7283
7276
  },
7284
7277
  columnCheckNoFixedDesc: {
7285
7278
  key: "columnCheckNoFixedDesc",
7286
7279
  required: false,
7287
- type: String,
7288
- default: "不固定"
7280
+ type: String
7289
7281
  },
7290
7282
  columnCheckBasicFieldDesc: {
7291
7283
  key: "columnCheckBasicFieldDesc",
7292
7284
  required: false,
7293
- type: String,
7294
- default: "基础字段"
7285
+ type: String
7295
7286
  },
7296
7287
  columnCheckGetCheckedLengthDesc: {
7297
7288
  key: "columnCheckGetCheckedLengthDesc",
7298
7289
  required: false,
7299
- type: null,
7300
- default: (length) => (length2) => "已选(" + length2 + ")"
7290
+ type: null
7301
7291
  },
7302
7292
  columnCheckGetAllCheckDesc: {
7303
7293
  key: "columnCheckGetAllCheckDesc",
7304
7294
  required: false,
7305
- type: null,
7306
- default: (length) => (length2) => "全选(" + length2 + ")"
7295
+ type: null
7307
7296
  },
7308
7297
  columnCheckTabs: {
7309
7298
  key: "columnCheckTabs",
@@ -7377,8 +7366,7 @@ __sfc_main.props = {
7377
7366
  exportBtnText: {
7378
7367
  key: "exportBtnText",
7379
7368
  required: false,
7380
- type: String,
7381
- default: "导出"
7369
+ type: String
7382
7370
  },
7383
7371
  exportBtnClass: {
7384
7372
  key: "exportBtnClass",
@@ -7436,8 +7424,7 @@ __sfc_main.props = {
7436
7424
  queryBtnText: {
7437
7425
  key: "queryBtnText",
7438
7426
  required: false,
7439
- type: String,
7440
- default: "查询"
7427
+ type: String
7441
7428
  },
7442
7429
  queryBtnClass: {
7443
7430
  key: "queryBtnClass",
@@ -7495,8 +7482,7 @@ __sfc_main.props = {
7495
7482
  resetBtnText: {
7496
7483
  key: "resetBtnText",
7497
7484
  required: false,
7498
- type: String,
7499
- default: "重置"
7485
+ type: String
7500
7486
  },
7501
7487
  resetBtnClass: {
7502
7488
  key: "resetBtnClass",
@@ -7511,6 +7497,31 @@ __sfc_main.setup = (__props, __ctx) => {
7511
7497
  const emit = __ctx.emit;
7512
7498
  const routeName = computed(() => useRoute().name);
7513
7499
  const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
7500
+ const {
7501
+ t
7502
+ } = useLocale();
7503
+ const localeText = computed(() => ({
7504
+ expandBtnTooltipDesc: props.expandBtnTooltipDesc || t("nf.common.expand"),
7505
+ shrinkBtnTooltipDesc: props.shrinkBtnTooltipDesc || t("nf.common.collapse"),
7506
+ exportBtnText: props.exportBtnText || t("nf.searchForm.export"),
7507
+ resetBtnText: props.resetBtnText || t("nf.searchForm.reset"),
7508
+ queryBtnText: props.queryBtnText || t("nf.searchForm.query"),
7509
+ selectEmptyWarningTips: props.selectEmptyWarningTips || t("nf.table.selectEmptyWarning"),
7510
+ columnCheckCancelButtonText: props.columnCheckCancelButtonText || t("nf.common.cancel"),
7511
+ columnCheckConfirmButtonText: props.columnCheckConfirmButtonText || t("nf.common.confirm"),
7512
+ moreDialogTitle: props.moreDialogTitle || t("nf.searchForm.moreDialogTitle"),
7513
+ columnCheckSearchPlaceholder: props.columnCheckSearchPlaceholder || t("nf.table.searchPlaceholder"),
7514
+ columnCheckFixedLeftDesc: props.columnCheckFixedLeftDesc || t("nf.table.fixedLeft"),
7515
+ columnCheckClearDesc: props.columnCheckClearDesc || t("nf.table.clear"),
7516
+ columnCheckNoFixedDesc: props.columnCheckNoFixedDesc || t("nf.table.noFixed"),
7517
+ columnCheckBasicFieldDesc: props.columnCheckBasicFieldDesc || t("nf.table.basicField"),
7518
+ columnCheckGetCheckedLengthDesc: props.columnCheckGetCheckedLengthDesc || ((length) => t("nf.table.checkedLength", {
7519
+ length
7520
+ })),
7521
+ columnCheckGetAllCheckDesc: props.columnCheckGetAllCheckDesc || ((length) => t("nf.table.allCheck", {
7522
+ length
7523
+ }))
7524
+ }));
7514
7525
  const defaultButtonSlot = ref();
7515
7526
  const nfSearchFormRef = ref();
7516
7527
  const columnCheckNfDrawer = ref();
@@ -7529,9 +7540,6 @@ __sfc_main.setup = (__props, __ctx) => {
7529
7540
  }
7530
7541
  return key;
7531
7542
  });
7532
- const cStorageKeyViewIdentity = computed(() => {
7533
- return "nf-search-form-view-identity";
7534
- });
7535
7543
  const processedColumns = computed(() => {
7536
7544
  var _a2;
7537
7545
  const viewField = window.viewField;
@@ -7544,48 +7552,6 @@ __sfc_main.setup = (__props, __ctx) => {
7544
7552
  return props.formOptions;
7545
7553
  });
7546
7554
  const checkViewIdentityChange = async () => {
7547
- const userId = window.userId;
7548
- const viewField = window.viewField;
7549
- if (props.viewIdentity && userId && viewField) {
7550
- let viewIdentity = CachedManager.syncCachedGet(cStorageKeyViewIdentity.value);
7551
- if (!viewIdentity) {
7552
- viewIdentity = await CachedManager.asyncCachedGet(cStorageKeyViewIdentity.value);
7553
- }
7554
- if (!viewIdentity) {
7555
- await CachedManager.asyncCachedSet(cStorageKeyViewIdentity.value, viewField);
7556
- } else {
7557
- const newViewIdentity = viewField.find((item) => item.viewIdentity === props.viewIdentity);
7558
- const oldViewIdentity = viewIdentity.find((item) => item.viewIdentity === props.viewIdentity);
7559
- if (newViewIdentity && !oldViewIdentity || !newViewIdentity && oldViewIdentity) {
7560
- await clearColumnEditCached();
7561
- await clearDragCached();
7562
- } else if (newViewIdentity && oldViewIdentity) {
7563
- let change = false;
7564
- newViewIdentity.fieldList.every((item) => {
7565
- if (!oldViewIdentity.fieldList.includes(item)) {
7566
- change = true;
7567
- return;
7568
- }
7569
- return true;
7570
- });
7571
- if (!change) {
7572
- oldViewIdentity.fieldList.every((item) => {
7573
- if (!newViewIdentity.fieldList.includes(item)) {
7574
- change = true;
7575
- return;
7576
- }
7577
- return true;
7578
- });
7579
- }
7580
- if (change) {
7581
- await clearColumnEditCached();
7582
- await clearDragCached();
7583
- oldViewIdentity.fieldList = newViewIdentity.fieldList;
7584
- await CachedManager.asyncCachedSet(cStorageKeyViewIdentity.value, viewIdentity);
7585
- }
7586
- }
7587
- }
7588
- }
7589
7555
  };
7590
7556
  const nfSearchFormModel = ref(deepClone(props.defaultFormData));
7591
7557
  const setValue = (item, val) => {
@@ -7637,9 +7603,9 @@ __sfc_main.setup = (__props, __ctx) => {
7637
7603
  return;
7638
7604
  let list = deepClone(props.btnItems);
7639
7605
  if (validate.isString(props.btnItems)) {
7640
- list = [...props.btnItems ? [{
7606
+ list = [{
7641
7607
  btnType: props.btnItems
7642
- }] : []];
7608
+ }];
7643
7609
  }
7644
7610
  list = list.map((item) => {
7645
7611
  if (validate.isString(item)) {
@@ -7802,17 +7768,28 @@ __sfc_main.setup = (__props, __ctx) => {
7802
7768
  if (typeof columnState === "string") {
7803
7769
  columnState = JSON.parse(columnState);
7804
7770
  }
7771
+ let maxIndex = 0;
7805
7772
  for (const key in columnState) {
7806
7773
  const state = columnState[key];
7807
7774
  columns.every((i) => {
7808
7775
  if (i.prop === key) {
7809
7776
  i.initHidden = state.initHidden;
7810
7777
  i._index = state.index;
7778
+ if (maxIndex < state.index) {
7779
+ maxIndex = state.index;
7780
+ }
7811
7781
  return false;
7812
7782
  }
7813
7783
  return true;
7814
7784
  });
7815
7785
  }
7786
+ const columnStateKeys = Object.keys(columnState);
7787
+ columns.forEach((item) => {
7788
+ if (!columnStateKeys.includes(item.prop)) {
7789
+ maxIndex++;
7790
+ item._index = maxIndex;
7791
+ }
7792
+ });
7816
7793
  }
7817
7794
  } catch (e) {
7818
7795
  console.log(e);
@@ -7880,15 +7857,15 @@ __sfc_main.setup = (__props, __ctx) => {
7880
7857
  btnItemsInit();
7881
7858
  formsInit();
7882
7859
  });
7883
- const refreshNfSearchFormModel = () => {
7860
+ function refreshNfSearchFormModel() {
7884
7861
  processedColumns.value.filter((item) => !resolveValue(item.destory, nfSearchFormModel.value)).forEach((v) => {
7885
7862
  if (!localShowItems.value.includes(v.prop)) {
7886
- mapDispose.setValue(nfSearchFormModel.value, v.key, void 0);
7863
+ mapDispose.setValue(nfSearchFormModel.value, v.prop, void 0);
7887
7864
  } else if (nfSearchFormModel.value[v.prop] === void 0) {
7888
7865
  setDefaultVal(v);
7889
7866
  }
7890
7867
  });
7891
- };
7868
+ }
7892
7869
  const formsInit = () => {
7893
7870
  getChangePropKeys();
7894
7871
  processedColumns.value.forEach((item) => {
@@ -7903,7 +7880,6 @@ __sfc_main.setup = (__props, __ctx) => {
7903
7880
  await nextTick();
7904
7881
  refreshLabel();
7905
7882
  };
7906
- const domWidth = ref();
7907
7883
  const topDom = ref();
7908
7884
  const refreshLabel = () => {
7909
7885
  if (props.btnModel === "inline" && !props.btnBoxLabel && props.labelPosition === "top") {
@@ -7935,24 +7911,14 @@ __sfc_main.setup = (__props, __ctx) => {
7935
7911
  }, 0);
7936
7912
  newColumns.value = count;
7937
7913
  };
7938
- throttle$1(calcColumns, 100);
7939
- const onResize = async (params = {}) => {
7940
- var _a2;
7941
- const {
7942
- width
7943
- } = ((_a2 = params == null ? void 0 : params[0]) == null ? void 0 : _a2.contentRect) || {};
7944
- if (width && domWidth.value && width === domWidth.value) {
7945
- return;
7946
- }
7947
- if (domWidth.value) {
7948
- await nextTick();
7949
- domWidth.value = topDom.value.offsetWidth;
7950
- }
7914
+ const onResize = async (_params) => {
7951
7915
  refreshLabel();
7952
7916
  };
7953
7917
  const observer = ref();
7954
7918
  onMounted(async () => {
7955
7919
  await nextTick();
7920
+ if (!topDom.value)
7921
+ return;
7956
7922
  observer.value = new ResizeObserver(onResize);
7957
7923
  observer.value.observe(topDom.value, {
7958
7924
  box: "border-box"
@@ -7997,7 +7963,7 @@ __sfc_main.setup = (__props, __ctx) => {
7997
7963
  }
7998
7964
  };
7999
7965
  const hiddenNfSearchFormItemOptionField = async (prop) => {
8000
- prop.formOptions._skip = true;
7966
+ props.formOptions._skip = true;
8001
7967
  processedColumns.value.every((item) => {
8002
7968
  if (item.prop === prop) {
8003
7969
  item.initHidden = true;
@@ -8015,22 +7981,10 @@ __sfc_main.setup = (__props, __ctx) => {
8015
7981
  await nextTick();
8016
7982
  refreshLabel();
8017
7983
  };
8018
- const columnCheckConfirmFeedback = (value) => {
8019
- if (!props.columnEdit) {
8020
- const itemsList = [];
8021
- for (const key in value) {
8022
- if (value[key]) {
8023
- itemsList.push(key);
8024
- }
8025
- }
8026
- setLocalShowItems(itemsList, true);
8027
- }
8028
- };
8029
7984
  const columnCheckConfirm = async (cb, error) => {
8030
7985
  var _a2;
8031
7986
  try {
8032
- const value = columnCheckDrawer.value.syncTableColumnsToCookies();
8033
- columnCheckConfirmFeedback(value);
7987
+ columnCheckDrawer.value.syncTableColumnsToCookies();
8034
7988
  await syncCookiesToLocalShowColumn(true);
8035
7989
  await syncCookiesToSearchFormItemOptions();
8036
7990
  await nextTick();
@@ -8048,8 +8002,7 @@ __sfc_main.setup = (__props, __ctx) => {
8048
8002
  async function clearColumnEditCached() {
8049
8003
  await CachedManager.asyncCachedSet(cStorageKey.value, null);
8050
8004
  }
8051
- const nfSearchFormItemOptionFieldsSave = async (value) => {
8052
- columnCheckConfirmFeedback(value);
8005
+ const nfSearchFormItemOptionFieldsSave = async () => {
8053
8006
  await syncCookiesToLocalShowColumn(true);
8054
8007
  await syncCookiesToSearchFormItemOptions();
8055
8008
  await nextTick();
@@ -8086,6 +8039,7 @@ __sfc_main.setup = (__props, __ctx) => {
8086
8039
  };
8087
8040
  return Object.assign({
8088
8041
  resolveValue,
8042
+ localeText,
8089
8043
  defaultButtonSlot,
8090
8044
  nfSearchFormRef,
8091
8045
  columnCheckNfDrawer,
@@ -8241,8 +8195,8 @@ var _sfc_render = function render6() {
8241
8195
  "down-icon": _vm.downIcon,
8242
8196
  "show-btn": _vm.showBtn,
8243
8197
  "is-collapse": _vm.isCollapse,
8244
- "expand-btn-tooltip-desc": _vm.expandBtnTooltipDesc,
8245
- "shrink-btn-tooltip-desc": _vm.shrinkBtnTooltipDesc
8198
+ "expand-btn-tooltip-desc": _vm.localeText.expandBtnTooltipDesc,
8199
+ "shrink-btn-tooltip-desc": _vm.localeText.shrinkBtnTooltipDesc
8246
8200
  },
8247
8201
  on: {
8248
8202
  "isCollapseChange": _vm.isCollapseChange
@@ -8345,7 +8299,7 @@ var _sfc_render = function render6() {
8345
8299
  _vm.onNfSearchFormClick(item);
8346
8300
  }
8347
8301
  }
8348
- }, [_vm._v(_vm._s(_vm.resolveValue(item.name || _vm.queryBtnText, _vm.nfSearchFormModel)) + " ")]) : ((_b = item.btnType) == null ? void 0 : _b.includes("export")) ? _c("nf-button", {
8302
+ }, [_vm._v(_vm._s(_vm.resolveValue(item.name || _vm.localeText.queryBtnText, _vm.nfSearchFormModel)) + " ")]) : ((_b = item.btnType) == null ? void 0 : _b.includes("export")) ? _c("nf-button", {
8349
8303
  key: "btn-" + idx,
8350
8304
  class: (_vm.resolveValue(_vm.exportBtnClass, _vm.nfSearchFormModel) || "") + " nf-btn-export",
8351
8305
  attrs: {
@@ -8364,7 +8318,7 @@ var _sfc_render = function render6() {
8364
8318
  _vm.onNfSearchFormClick(item);
8365
8319
  }
8366
8320
  }
8367
- }, [_vm._v(_vm._s(_vm.resolveValue(item.name || _vm.exportBtnText, _vm.nfSearchFormModel)) + " ")]) : ((_c2 = item.btnType) == null ? void 0 : _c2.includes("reset")) ? _c("nf-button", {
8321
+ }, [_vm._v(_vm._s(_vm.resolveValue(item.name || _vm.localeText.exportBtnText, _vm.nfSearchFormModel)) + " ")]) : ((_c2 = item.btnType) == null ? void 0 : _c2.includes("reset")) ? _c("nf-button", {
8368
8322
  key: "btn-" + idx,
8369
8323
  class: (_vm.resolveValue(_vm.resetBtnClass, _vm.nfSearchFormModel) || "") + " nf-btn-reset",
8370
8324
  attrs: {
@@ -8380,7 +8334,7 @@ var _sfc_render = function render6() {
8380
8334
  on: {
8381
8335
  "click": _vm.resetNfSearchFormModel
8382
8336
  }
8383
- }, [_vm._v(_vm._s(_vm.resolveValue(item.name || _vm.resetBtnText, _vm.nfSearchFormModel)) + " ")]) : _vm.btnIsShow(item) ? _c("nf-button", {
8337
+ }, [_vm._v(_vm._s(_vm.resolveValue(item.name || _vm.localeText.resetBtnText, _vm.nfSearchFormModel)) + " ")]) : _vm.btnIsShow(item) ? _c("nf-button", {
8384
8338
  key: "btn-" + idx,
8385
8339
  class: _vm.resolveValue(item.class, _vm.nfSearchFormModel),
8386
8340
  attrs: {
@@ -8417,7 +8371,7 @@ var _sfc_render = function render6() {
8417
8371
  }
8418
8372
  }, [_c("el-tooltip", {
8419
8373
  attrs: {
8420
- "content": _vm.moreDialogTitle,
8374
+ "content": _vm.localeText.moreDialogTitle,
8421
8375
  "placement": "top"
8422
8376
  }
8423
8377
  }, [_c("span", {
@@ -8446,7 +8400,7 @@ var _sfc_render = function render6() {
8446
8400
  return _vm.onNfSearchFormSearch(true);
8447
8401
  }
8448
8402
  }
8449
- }, [_vm._v(_vm._s(_vm.resolveValue(_vm.queryBtnText, _vm.nfSearchFormModel)) + " ")]) : ((_b = item.btnType) == null ? void 0 : _b.includes("export")) ? _c("nf-button", {
8403
+ }, [_vm._v(_vm._s(_vm.resolveValue(_vm.localeText.queryBtnText, _vm.nfSearchFormModel)) + " ")]) : ((_b = item.btnType) == null ? void 0 : _b.includes("export")) ? _c("nf-button", {
8450
8404
  key: "btn-" + idx,
8451
8405
  class: (_vm.resolveValue(_vm.exportBtnClass, _vm.nfSearchFormModel) || "") + " nf-btn-export",
8452
8406
  attrs: {
@@ -8462,7 +8416,7 @@ var _sfc_render = function render6() {
8462
8416
  on: {
8463
8417
  "click": _vm.onNfSearchFormExport
8464
8418
  }
8465
- }, [_vm._v(_vm._s(_vm.resolveValue(_vm.exportBtnText, _vm.nfSearchFormModel)) + " ")]) : ((_c2 = item.btnType) == null ? void 0 : _c2.includes("reset")) ? _c("nf-button", {
8419
+ }, [_vm._v(_vm._s(_vm.resolveValue(_vm.localeText.exportBtnText, _vm.nfSearchFormModel)) + " ")]) : ((_c2 = item.btnType) == null ? void 0 : _c2.includes("reset")) ? _c("nf-button", {
8466
8420
  key: "btn-" + idx,
8467
8421
  class: (_vm.resolveValue(_vm.resetBtnClass, _vm.nfSearchFormModel) || "") + " nf-btn-reset",
8468
8422
  attrs: {
@@ -8478,7 +8432,7 @@ var _sfc_render = function render6() {
8478
8432
  on: {
8479
8433
  "click": _vm.resetNfSearchFormModel
8480
8434
  }
8481
- }, [_vm._v(_vm._s(_vm.resolveValue(_vm.resetBtnText, _vm.nfSearchFormModel)) + " ")]) : _vm.btnIsShow(item) ? _c("nf-button", {
8435
+ }, [_vm._v(_vm._s(_vm.resolveValue(_vm.localeText.resetBtnText, _vm.nfSearchFormModel)) + " ")]) : _vm.btnIsShow(item) ? _c("nf-button", {
8482
8436
  key: "btn-" + idx,
8483
8437
  class: _vm.resolveValue(item.class, _vm.nfSearchFormModel),
8484
8438
  attrs: {
@@ -8515,7 +8469,7 @@ var _sfc_render = function render6() {
8515
8469
  }
8516
8470
  }, [_vm.columnEdit ? _c("el-tooltip", {
8517
8471
  attrs: {
8518
- "content": _vm.moreDialogTitle,
8472
+ "content": _vm.localeText.moreDialogTitle,
8519
8473
  "placement": "top"
8520
8474
  }
8521
8475
  }, [_c("span", {
@@ -8525,10 +8479,10 @@ var _sfc_render = function render6() {
8525
8479
  })])]) : _vm._e()], 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", {
8526
8480
  ref: "columnCheckDialog",
8527
8481
  attrs: {
8528
- "title": _vm.moreDialogTitle,
8529
- "cancel-text": _vm.columnCheckCancelButtonText,
8530
- "confirm-text": _vm.columnCheckConfirmButtonText,
8531
- "basic-field-desc": _vm.columnCheckBasicFieldDesc,
8482
+ "title": _vm.localeText.moreDialogTitle,
8483
+ "cancel-text": _vm.localeText.columnCheckCancelButtonText,
8484
+ "confirm-text": _vm.localeText.columnCheckConfirmButtonText,
8485
+ "basic-field-desc": _vm.localeText.columnCheckBasicFieldDesc,
8532
8486
  "show": _vm.configNfSearchItemVisibleDialog,
8533
8487
  "modal-append-to-body": _vm.modalAppendToBody,
8534
8488
  "storage-key": _vm.cStorageKey,
@@ -8572,9 +8526,9 @@ var _sfc_render = function render6() {
8572
8526
  })], 2) : _vm._e(), _vm.columnEdit && _vm.checkMode === "drawer" ? _c("nf-drawer", {
8573
8527
  ref: "columnCheckNfDrawer",
8574
8528
  attrs: {
8575
- "title": _vm.moreDialogTitle,
8576
- "cancel-button-text": _vm.columnCheckCancelButtonText,
8577
- "confirm-button-text": _vm.columnCheckConfirmButtonText,
8529
+ "title": _vm.localeText.moreDialogTitle,
8530
+ "cancel-button-text": _vm.localeText.columnCheckCancelButtonText,
8531
+ "confirm-button-text": _vm.localeText.columnCheckConfirmButtonText,
8578
8532
  "size": "680px",
8579
8533
  "destroy-on-close": true,
8580
8534
  "visible": _vm.configNfSearchItemVisibleDialog,
@@ -8596,14 +8550,14 @@ var _sfc_render = function render6() {
8596
8550
  }), _c("column-check-drawer", {
8597
8551
  ref: "columnCheckDrawer",
8598
8552
  attrs: {
8599
- "basic-field-desc": _vm.columnCheckBasicFieldDesc,
8600
- "search-placeholder": _vm.columnCheckSearchPlaceholder,
8601
- "fixed-left-desc": _vm.columnCheckFixedLeftDesc,
8602
- "clear-desc": _vm.columnCheckClearDesc,
8603
- "no-fixed-desc": _vm.columnCheckNoFixedDesc,
8604
- "select-empty-warning-tips": _vm.selectEmptyWarningTips,
8605
- "get-checked-length-desc": _vm.columnCheckGetCheckedLengthDesc,
8606
- "get-all-check-desc": _vm.columnCheckGetAllCheckDesc,
8553
+ "basic-field-desc": _vm.localeText.columnCheckBasicFieldDesc,
8554
+ "search-placeholder": _vm.localeText.columnCheckSearchPlaceholder,
8555
+ "fixed-left-desc": _vm.localeText.columnCheckFixedLeftDesc,
8556
+ "clear-desc": _vm.localeText.columnCheckClearDesc,
8557
+ "no-fixed-desc": _vm.localeText.columnCheckNoFixedDesc,
8558
+ "select-empty-warning-tips": _vm.localeText.selectEmptyWarningTips,
8559
+ "get-checked-length-desc": _vm.localeText.columnCheckGetCheckedLengthDesc,
8560
+ "get-all-check-desc": _vm.localeText.columnCheckGetAllCheckDesc,
8607
8561
  "storage-key": _vm.cStorageKey,
8608
8562
  "table-columns": _vm.processedColumns,
8609
8563
  "column-edit": _vm.columnEdit