cnhis-design-vue 3.1.16-beta.1 → 3.1.16-beta.12

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.
Files changed (107) hide show
  1. package/es/packages/big-table/index.d.ts +652 -430
  2. package/es/packages/big-table/src/BigTable.vue.d.ts +655 -457
  3. package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +106 -112
  4. package/es/packages/big-table/src/bigTableProps.d.ts +4 -0
  5. package/es/packages/big-table/src/bigTableProps.js +2 -1
  6. package/es/packages/big-table/src/bigTableState.d.ts +2 -0
  7. package/es/packages/big-table/src/bigTableState.js +3 -1
  8. package/es/packages/big-table/src/components/edit-form/edit-time.js +1 -1
  9. package/es/packages/big-table/src/hooks/index.d.ts +9 -0
  10. package/es/packages/big-table/src/hooks/index.js +9 -0
  11. package/es/packages/big-table/src/hooks/useAnchor.d.ts +7 -0
  12. package/es/packages/big-table/src/hooks/useAnchor.js +49 -0
  13. package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +24 -8
  14. package/es/packages/big-table/src/hooks/useEdit.js +1 -1
  15. package/es/packages/big-table/src/hooks/useEvent.d.ts +1 -1
  16. package/es/packages/big-table/src/hooks/useEvent.js +3 -2
  17. package/es/packages/big-table/style/index.css +1 -2
  18. package/es/packages/button-print/index.d.ts +7 -4
  19. package/es/packages/button-print/src/ButtonPrint.vue.d.ts +7 -4
  20. package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +5 -16
  21. package/es/packages/button-print/src/components/IdentityVerification.js +5 -7
  22. package/es/packages/button-print/src/components/IdentityVerification.vue.d.ts +6 -3
  23. package/es/packages/drag-layout/index.d.ts +2 -2
  24. package/es/packages/drag-layout/src/DragLayout.vue.d.ts +2 -2
  25. package/es/packages/fabric-chart/src/FabricChart.js +3 -2
  26. package/es/packages/fabric-chart/src/hooks/constant.js +5 -5
  27. package/es/packages/fabric-chart/src/hooks/useCenter.js +20 -23
  28. package/es/packages/fabric-chart/src/hooks/useDraw.js +11 -4
  29. package/es/packages/fabric-chart/src/hooks/useEvent.js +11 -3
  30. package/es/packages/fabric-chart/src/hooks/useLeft.js +8 -4
  31. package/es/packages/fabric-chart/src/hooks/useOther.js +63 -13
  32. package/es/packages/fabric-chart/src/hooks/useTop.js +5 -8
  33. package/es/packages/field-set/index.d.ts +1 -1
  34. package/es/packages/field-set/src/FieldSet.vue.d.ts +1 -1
  35. package/es/packages/form-config/index.d.ts +110 -3367
  36. package/es/packages/form-config/src/FormConfig.js +42 -34
  37. package/es/packages/form-config/src/FormConfig.vue.d.ts +147 -3404
  38. package/es/packages/form-config/src/components/FormConfigCreator.js +13 -11
  39. package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +23 -22
  40. package/es/packages/form-config/src/components/FormConfigEdit.js +2 -2
  41. package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +75 -49
  42. package/es/packages/form-config/src/constants/index.d.ts +58 -24
  43. package/es/packages/form-config/src/constants/index.js +52 -23
  44. package/es/packages/form-config/src/hooks/index.d.ts +1 -0
  45. package/es/packages/form-config/src/hooks/index.js +1 -0
  46. package/es/packages/form-config/src/hooks/useConfigurationField.d.ts +2 -1
  47. package/es/packages/form-config/src/hooks/useConfigurationField.js +29 -80
  48. package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +2 -3
  49. package/es/packages/form-config/src/hooks/usePresetRenderer.js +16 -19
  50. package/es/packages/form-config/src/hooks/useSortable.js +1 -1
  51. package/es/packages/form-config/src/types/index.d.ts +22 -4
  52. package/es/packages/form-config/src/utils/index.d.ts +2 -0
  53. package/es/packages/form-config/src/utils/index.js +15 -0
  54. package/es/packages/form-config/style/index.css +27 -3
  55. package/es/packages/form-render/index.d.ts +13 -15
  56. package/es/packages/form-render/src/FormRender.js +11 -8
  57. package/es/packages/form-render/src/FormRender.vue.d.ts +14 -16
  58. package/es/packages/form-render/src/components/renderer/cascader.d.ts +2 -14
  59. package/es/packages/form-render/src/components/renderer/cascader.js +3 -3
  60. package/es/packages/form-render/src/components/renderer/checkbox.js +1 -1
  61. package/es/packages/form-render/src/components/renderer/combination/index.js +2 -1
  62. package/es/packages/form-render/src/components/renderer/complex.js +1 -1
  63. package/es/packages/form-render/src/components/renderer/date.d.ts +20 -4
  64. package/es/packages/form-render/src/components/renderer/date.js +36 -20
  65. package/es/packages/form-render/src/components/renderer/input.js +2 -1
  66. package/es/packages/form-render/src/components/renderer/inputNumber.js +2 -1
  67. package/es/packages/form-render/src/components/renderer/linebar.js +1 -4
  68. package/es/packages/form-render/src/components/renderer/radio.js +1 -1
  69. package/es/packages/form-render/src/components/renderer/select.d.ts +1 -10
  70. package/es/packages/form-render/src/components/renderer/select.js +26 -17
  71. package/es/packages/form-render/src/components/renderer/slider.d.ts +8 -344
  72. package/es/packages/form-render/src/components/renderer/slider.js +24 -2
  73. package/es/packages/form-render/src/components/renderer/switch.js +1 -1
  74. package/es/packages/form-render/src/components/renderer/textarea.js +1 -1
  75. package/es/packages/form-render/src/hooks/useAnchor.js +7 -4
  76. package/es/packages/form-render/src/hooks/useBusinessBinding.d.ts +15 -9
  77. package/es/packages/form-render/src/hooks/useBusinessBinding.js +62 -58
  78. package/es/packages/form-render/src/hooks/useChangeContext.d.ts +4 -2
  79. package/es/packages/form-render/src/hooks/useChangeContext.js +4 -7
  80. package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +17 -7
  81. package/es/packages/form-render/src/hooks/useFormContext.d.ts +2 -1
  82. package/es/packages/form-render/src/hooks/useFormContext.js +2 -2
  83. package/es/packages/form-render/src/hooks/useFormValidator.js +13 -3
  84. package/es/packages/form-render/src/hooks/useInitialData.d.ts +1 -1
  85. package/es/packages/form-render/src/hooks/useInitialData.js +9 -4
  86. package/es/packages/form-render/src/hooks/useTypeNormalize.js +3 -2
  87. package/es/packages/form-render/src/types/fieldItem.d.ts +11 -12
  88. package/es/packages/form-render/src/types/index.d.ts +7 -8
  89. package/es/packages/form-render/src/utils/business.d.ts +12 -0
  90. package/es/packages/form-render/src/utils/business.js +78 -0
  91. package/es/packages/form-render/src/utils/dom.d.ts +6 -0
  92. package/es/packages/form-render/src/utils/dom.js +14 -0
  93. package/es/packages/form-render/src/utils/index.d.ts +6 -26
  94. package/es/packages/form-render/src/utils/index.js +9 -138
  95. package/es/packages/form-render/src/utils/schema.d.ts +16 -0
  96. package/es/packages/form-render/src/utils/schema.js +94 -0
  97. package/es/packages/index.css +28 -5
  98. package/es/packages/scale-view/src/hooks/use-component.d.ts +7 -7
  99. package/es/packages/select-label/index.d.ts +10 -10
  100. package/es/packages/select-label/src/LabelFormContent.vue.d.ts +3 -3
  101. package/es/packages/select-label/src/SelectLabel.vue.d.ts +7 -7
  102. package/es/packages/shortcut-setter/index.d.ts +18 -20
  103. package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +18 -20
  104. package/es/packages/time-line/index.d.ts +2 -2
  105. package/es/packages/time-line/src/TimeLine.vue.d.ts +2 -2
  106. package/global.d.ts +8 -8
  107. package/package.json +1 -1
@@ -1,21 +1,13 @@
1
- import { defineComponent, ref, reactive, useAttrs, computed, onMounted, onUnmounted, onActivated, createVNode, h, resolveComponent, Teleport, createTextVNode, nextTick, watch, openBlock, createElementBlock, Fragment, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, unref, mergeProps, withCtx, renderSlot, createBlock, toDisplayString, withDirectives, vShow, isVNode } from 'vue';
1
+ import { defineComponent, ref, reactive, useAttrs, computed, onMounted, onUnmounted, onActivated, nextTick, createVNode, h, resolveComponent, Teleport, createTextVNode, watch, openBlock, createElementBlock, Fragment, createBlock, unref, withCtx, renderList, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, mergeProps, renderSlot, toDisplayString, withDirectives, vShow, isVNode } from 'vue';
2
2
  import { isArray, isFunction } from 'lodash-es';
3
- import { useAnnotation } from '../../../packages/big-table/src/hooks/useAnnotation';
4
- import { useSeparateRow } from '../../../packages/big-table/src/hooks/useSeparateRow';
5
3
  import bigTableState from './bigTableState.js';
6
4
  import bigTableProps from './bigTableProps.js';
7
5
  import bigTableEmits from './bigTableEmits.js';
8
- import { useFormat } from './hooks/useFormat.js';
9
- import { useTableParse } from './hooks/useTableParse.js';
10
- import { useBatchEditing } from './hooks/useBatchEditing.js';
11
- import { useNestTable } from './hooks/useNestTable.js';
12
- import { useEdit, comps } from './hooks/useEdit.js';
13
- import { useEvent } from './hooks/useEvent.js';
14
6
  import { SettingsSharp, CaretDown, CaretForward, CopyOutline, SyncOutline } from '@vicons/ionicons5';
15
7
  import NoData from './components/NoData.js';
16
8
  import TextOverTooltip from '../../../src/components/TextOverTooltip';
17
9
  import SvgIcon from '../../../src/components/SvgIcon';
18
- import { useMessage, NIcon, NTooltip, NCheckbox, NCheckboxGroup, NGrid, NGi, NSpace, NButton, NPopconfirm, NProgress, NDropdown, NSwitch, NPopover } from 'naive-ui';
10
+ import { useMessage, NIcon, NTooltip, NCheckbox, NCheckboxGroup, NGrid, NGi, NSpace, NButton, NPopconfirm, NProgress, NDropdown, NSwitch, NPopover, NTabs, NTabPane } from 'naive-ui';
19
11
  import CGrid from '../../../packages/grid';
20
12
  import vexutils from '../../../src/utils/vexutils';
21
13
  import { handleTableHeight, setTableConfig, handleGroupColums, treeToList, checkMethod, setTreeGroupTitle, handleName, generateEditRender, handlerInitSearchItem, getEvaluate, getMapVal, getCandidateComponents, getageShowType, isLink, showFilter, reScrollFilterWrap, hideFilterWrap, mergeConObjFn, setDefaultFormData, handleImgArr, handleImgSrc, modalDetailImage, handleQrCodeContent, getInlineEditBtn, isCopy, setVisibleCheckAllWrap, handleTableImageSize, visibleMethod, getRowStyle, getFooterGroup, flattenRow, intersectRow, removeCheckedDisabledRows } from './utils.js';
@@ -23,18 +15,24 @@ import InputButtonScript from './components/input-button.js';
23
15
  import Separate from './components/separate.js';
24
16
  import xb_big from '../../../src/assets/img/xb_big';
25
17
  import qr from '../../../src/assets/img/qr';
18
+ import { useBatchEditing } from './hooks/useBatchEditing.js';
19
+ import { useNestTable } from './hooks/useNestTable.js';
20
+ import { useAnchor } from './hooks/useAnchor.js';
21
+ import { useEvent } from './hooks/useEvent.js';
22
+ import { useSeparateRow } from './hooks/useSeparateRow.js';
23
+ import { useFormat } from './hooks/useFormat.js';
24
+ import { useTableParse } from './hooks/useTableParse.js';
25
+ import { useEdit, comps } from './hooks/useEdit.js';
26
+ import { useAnnotation } from './hooks/useAnnotation.js';
26
27
 
27
28
  const _hoisted_1 = {
28
29
  key: 0,
29
30
  class: "check-wrap"
30
31
  };
31
32
  const _hoisted_2 = /* @__PURE__ */ createElementVNode("span", null, "\u7CFB\u7EDF\u68C0\u6D4B\u5230\u6709\u6570\u636E\u66F4\u65B0,", -1);
32
- const _hoisted_3 = /* @__PURE__ */ createElementVNode("i", {
33
- class: "disabled-checked-tips"
34
- }, null, -1);
33
+ const _hoisted_3 = ["innerHTML"];
35
34
  const _hoisted_4 = ["innerHTML"];
36
- const _hoisted_5 = ["innerHTML"];
37
- const _hoisted_6 = {
35
+ const _hoisted_5 = {
38
36
  class: "refresh-row"
39
37
  };
40
38
  function _isSlot(s) {
@@ -99,10 +97,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
99
97
  loadExpandMethod,
100
98
  nestHandleClickRow
101
99
  } = useNestTable(props, state, emit);
100
+ const {
101
+ initAnchor,
102
+ updateAnchor,
103
+ anchorEvent
104
+ } = useAnchor(props, state, emit, xGrid);
102
105
  const {
103
106
  keyDown,
104
107
  scroll
105
- } = useEvent(props, state, emit, xGrid);
108
+ } = useEvent(props, state, emit, xGrid, anchorEvent);
106
109
  const attr = useAttrs();
107
110
  const currentCheckedKeys = computed(() => {
108
111
  var _a;
@@ -123,7 +126,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
123
126
  let {
124
127
  noSetting
125
128
  } = getOtherConfigInit() || {};
126
- return noSetting || ((_a = props.showSettings) == null ? void 0 : _a.hideSettingBtn) == 1;
129
+ return noSetting || ((_a = props.showSettings) == null ? void 0 : _a.hideSettingBtn);
127
130
  });
128
131
  const isScanMultiTable = computed(() => {
129
132
  var _a;
@@ -240,6 +243,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
240
243
  let columns = formatColumns(config);
241
244
  columns = handleGroupColums(columns, props);
242
245
  xGrid.value && xGrid.value.reloadColumn(columns);
246
+ nextTick(() => {
247
+ initAnchor();
248
+ });
243
249
  setGroupTreeExpand();
244
250
  resetTableInlineEditStatus();
245
251
  };
@@ -333,7 +339,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
333
339
  state.currentPageSelectedLength = currentPageSelectedRows.length;
334
340
  };
335
341
  const formatColumns = (map) => {
336
- var _a, _b;
342
+ var _a, _b, _c;
337
343
  let {
338
344
  selectType
339
345
  } = getOtherConfigInit() || {};
@@ -414,24 +420,24 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
414
420
  visible: checkVisible,
415
421
  resizable: false,
416
422
  width: checkMinWidth,
417
- slots: selectType === "checkbox" ? checkboxSlot : null,
423
+ slots: selectType === "checkbox" && !((_b = attr.checkboxConfig) == null ? void 0 : _b.checkMethod) ? checkboxSlot : null,
418
424
  showOverflow: true
419
425
  }];
420
426
  const seqObj = columns.find((v) => v.type == "seq");
421
- if ((_b = props == null ? void 0 : props.columnConfig) == null ? void 0 : _b.seqSlotFn) {
427
+ if ((_c = props == null ? void 0 : props.columnConfig) == null ? void 0 : _c.seqSlotFn) {
422
428
  seqObj.slots.default = (params) => {
423
429
  var _a2;
424
430
  return (_a2 = props.columnConfig) == null ? void 0 : _a2.seqSlotFn(params);
425
431
  };
426
432
  }
427
433
  const currentColumns = fieldList.map((item, index) => {
428
- var _a2, _b2, _c, _d, _e, _f, _g;
434
+ var _a2, _b2, _c2, _d, _e, _f, _g;
429
435
  let filterField = false;
430
436
  let filterItems = [];
431
437
  try {
432
438
  const fieldSetting = JSON.parse(item.fieldSetting);
433
439
  filterField = ((_a2 = fieldSetting == null ? void 0 : fieldSetting.mapping) == null ? void 0 : _a2.type) === "manual" && item.isMerge != 1;
434
- filterItems = (_c = (_b2 = fieldSetting == null ? void 0 : fieldSetting.mapping) == null ? void 0 : _b2.mappingFiled) == null ? void 0 : _c.map((item2) => item2.value[0]);
440
+ filterItems = (_c2 = (_b2 = fieldSetting == null ? void 0 : fieldSetting.mapping) == null ? void 0 : _b2.mappingFiled) == null ? void 0 : _c2.map((item2) => item2.value[0]);
435
441
  } catch (e) {
436
442
  }
437
443
  let notParticipatingSort = ((_d = item == null ? void 0 : item.fieldSetting) == null ? void 0 : _d.notParticipatingSort) || "";
@@ -458,31 +464,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
458
464
  treeNode,
459
465
  type,
460
466
  slots: {
461
- edit: (params) => {
462
- if (isEdit && item.isEdit && item.columnName !== "operatorColumn") {
463
- return formatterEdit(params, item);
464
- } else {
465
- return createVNode("span", null, [params.row[item.columnName]]);
466
- }
467
- },
467
+ edit: (params) => formatterEdit(params, item),
468
468
  default: (params) => {
469
- var _a3;
470
- if (!isEdit || item.columnName === "operatorColumn" || !item.isEdit) {
471
- return formatter(params, item);
472
- } else if (item.formType === "separate") {
473
- const SeparateComponent = Separate;
474
- return createVNode(SeparateComponent, {
475
- "row": params.row,
476
- "col": item
477
- }, null);
478
- } else if (isEdit && item.isEdit && ((_a3 = item.checkEditStatus) == null ? void 0 : _a3.call(item, params))) {
479
- return formatterEdit(params, item);
480
- } else {
481
- return createVNode("span", null, [getDefaultValue(params, item)]);
482
- }
469
+ const _isEdit = isEdit && item.isEdit;
470
+ return formatter(params, item, _isEdit);
483
471
  }
484
472
  },
485
- editRender: isEdit ? {} : generateEditRender(item)
473
+ editRender: isEdit && item.isEdit ? {} : generateEditRender(item)
486
474
  });
487
475
  if (filterField && !props.isNestTable && !isScanMultiTable2) {
488
476
  state.filterFields[item.columnName] = Object.assign({}, vexutils.clone({
@@ -551,7 +539,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
551
539
  });
552
540
  }
553
541
  };
554
- if (formType === "date") {
542
+ if (formType === "date" || formType === "time") {
555
543
  propsData.formattedValue = row[col.columnName];
556
544
  } else if (formatMap) {
557
545
  propsData.value = row[formatMap.value];
@@ -587,15 +575,28 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
587
575
  }
588
576
  });
589
577
  };
590
- const formatter = (params, col) => {
591
- var _a, _b;
578
+ const formatter = (params, col, _isEdit) => {
579
+ var _a, _b, _c;
592
580
  let {
593
581
  row,
594
582
  column,
595
583
  $rowIndex
596
584
  } = params;
597
- let own = (column == null ? void 0 : column._own) || (column == null ? void 0 : column.own) || col;
598
- let attrType = (own == null ? void 0 : own.attrType) || "";
585
+ let attrType = (col == null ? void 0 : col.attrType) || "";
586
+ if (col.formType === "separate") {
587
+ const SeparateComponent = Separate;
588
+ return createVNode(SeparateComponent, {
589
+ "row": params.row,
590
+ "col": col
591
+ }, null);
592
+ }
593
+ if (_isEdit) {
594
+ if ((_a = col.checkEditStatus) == null ? void 0 : _a.call(col, params)) {
595
+ return formatterEdit(params, col);
596
+ } else {
597
+ return createVNode("span", null, [getDefaultValue(params, col)]);
598
+ }
599
+ }
599
600
  let formUnionItem = showEditForm(row, column, $rowIndex);
600
601
  if (formUnionItem) {
601
602
  let dynamicProps = initBatchDynamicProps(formUnionItem, row, column);
@@ -611,66 +612,66 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
611
612
  return row[GROUP_TITLE_KEY];
612
613
  }
613
614
  if (attrType == "PICTURE" || attrType == "HEADPORTRAIT") {
614
- return getPicture(row, own, attrType);
615
+ return getPicture(row, col, attrType);
615
616
  }
616
617
  if (attrType == "COLOR") {
617
- return getColor(row, own);
618
+ return getColor(row, col);
618
619
  }
619
620
  if (attrType == "EVALUATE") {
620
- return getEvaluate(row, own);
621
+ return getEvaluate(row, col);
621
622
  }
622
623
  if (attrType == "MAP") {
623
- return getMapVal(row, own);
624
+ return getMapVal(row, col);
624
625
  }
625
626
  if (attrType == "DATE" || attrType == "TASKDATE") {
626
- return getDate(row, own);
627
+ return getDate(row, col);
627
628
  }
628
629
  if (attrType == "PERCENTAGE") {
629
- return getPercentage(row, own);
630
+ return getPercentage(row, col);
630
631
  }
631
632
  if (attrType == "VIDEO") {
632
- return getvideoList(row, own);
633
+ return getvideoList(row, col);
633
634
  }
634
635
  if (attrType == "CANDIDATE_COMPONENTS") {
635
- return getCandidateComponents(row, own);
636
+ return getCandidateComponents(row, col);
636
637
  }
637
638
  if (attrType == "AGE") {
638
- return getageShowType(row, own);
639
+ return getageShowType(row, col);
639
640
  }
640
641
  if (attrType === "COUNTDOWN") {
641
642
  return createVNode(NTooltip, null, {
642
643
  trigger() {
643
644
  return createVNode("span", {
644
- "innerHTML": row[own.columnName + "_countdown"] || ""
645
+ "innerHTML": row[col.columnName + "_countdown"] || ""
645
646
  }, null);
646
647
  },
647
648
  default() {
648
- return row[own.columnName + "_countdownTip"];
649
+ return row[col.columnName + "_countdownTip"];
649
650
  }
650
651
  });
651
652
  }
652
653
  if (attrType === "DURATION") {
653
- const value = row[own.columnName];
654
- const duration = (_a = own == null ? void 0 : own.fieldSetting) == null ? void 0 : _a.duration;
654
+ const value = row[col.columnName];
655
+ const duration = (_b = col == null ? void 0 : col.fieldSetting) == null ? void 0 : _b.duration;
655
656
  return parseDurationValue(value, duration);
656
657
  }
657
658
  if (attrType === "COMBINATION") {
658
- const value = row[own.columnName];
659
- const params2 = own.fieldSetting || {};
659
+ const value = row[col.columnName];
660
+ const params2 = col.fieldSetting || {};
660
661
  const data = parseCombinationValue(value, params2);
661
662
  return data ? [createVNode("span", {
662
663
  "title": data
663
664
  }, [data])] : "";
664
665
  }
665
666
  if (attrType === "PASSWORD") {
666
- const value = row[own.columnName];
667
+ const value = row[col.columnName];
667
668
  return [createVNode(resolveComponent("password-com"), {
668
669
  "value": value,
669
670
  "styleSetting": props.styleSetting
670
671
  }, null)];
671
672
  }
672
673
  if (attrType === "QR_CODE") {
673
- return getOrCode(row, own);
674
+ return getOrCode(row, col);
674
675
  }
675
676
  if (column.property === "operatorColumn") {
676
677
  if ((col == null ? void 0 : col.formType) === "custom" && col.slotFn && !row.initRow) {
@@ -686,21 +687,21 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
686
687
  const foldBtnList = getFoldBtnList(row, $rowIndex);
687
688
  return [createVNode("span", null, [tileBtnList, foldBtnList, inlineBtnList])];
688
689
  }
689
- if (isLink(props, own, row) && !isScanMultiTable.value) {
690
- if (own.btnLinkSwitch) {
690
+ if (isLink(props, col, row) && !isScanMultiTable.value) {
691
+ if (col.btnLinkSwitch) {
691
692
  let disabled = false;
692
- let curBtn = (_b = row.btnList) == null ? void 0 : _b.find((v) => v.name == own.columnName);
693
+ let curBtn = (_c = row.btnList) == null ? void 0 : _c.find((v) => v.name == col.columnName);
693
694
  if (curBtn && "authorizedMark" in curBtn) {
694
695
  if (!curBtn.authorizedMark) {
695
696
  disabled = true;
696
697
  }
697
698
  }
698
- return getBtnLinkSwitch(row, own, disabled, $rowIndex);
699
+ return getBtnLinkSwitch(row, col, disabled, $rowIndex);
699
700
  } else {
700
- return getField(row, own, $rowIndex, true);
701
+ return getField(row, col, $rowIndex, true);
701
702
  }
702
703
  } else {
703
- return getField(row, own, $rowIndex, false);
704
+ return getField(row, col, $rowIndex, false);
704
705
  }
705
706
  };
706
707
  const formatterHeader = (item) => {
@@ -1149,9 +1150,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1149
1150
  var _a;
1150
1151
  const {
1151
1152
  row,
1152
- column,
1153
- _rowIndex,
1154
- _columnIndex
1153
+ column
1155
1154
  } = payload;
1156
1155
  if (isFunction(attr.spanMethod))
1157
1156
  return attr.spanMethod(payload);
@@ -1199,8 +1198,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1199
1198
  };
1200
1199
  let {
1201
1200
  $rowIndex,
1202
- _columnIndex,
1203
- column
1201
+ _columnIndex
1204
1202
  } = obj;
1205
1203
  let len = state.columnLen || 99;
1206
1204
  let {
@@ -1364,7 +1362,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1364
1362
  emit("checkboxChange", {
1365
1363
  checked: checked2,
1366
1364
  row,
1367
- index: $rowIndex
1365
+ index: $rowIndex,
1366
+ records: [row]
1368
1367
  });
1369
1368
  return;
1370
1369
  }
@@ -1437,7 +1436,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1437
1436
  emit("checkboxChange", {
1438
1437
  checked: setChecked,
1439
1438
  row,
1440
- index: $rowIndex
1439
+ index: $rowIndex,
1440
+ records: checkedRow
1441
1441
  });
1442
1442
  setChecked && emit("handlerClickRow", row, $rowIndex);
1443
1443
  return;
@@ -1454,7 +1454,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1454
1454
  emit("checkboxChange", {
1455
1455
  checked: setChecked,
1456
1456
  row,
1457
- index: $rowIndex
1457
+ index: $rowIndex,
1458
+ records: checkedRow
1458
1459
  });
1459
1460
  setChecked && emit("handlerClickRow", row, $rowIndex);
1460
1461
  };
@@ -1474,6 +1475,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1474
1475
  };
1475
1476
  const treeTableSelectionChange = (records) => {
1476
1477
  if (state.isTree == 0) {
1478
+ emit("selectionChange", records);
1477
1479
  return false;
1478
1480
  }
1479
1481
  pubCheckChange(records);
@@ -1494,7 +1496,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1494
1496
  emit("checkboxChange", {
1495
1497
  checked,
1496
1498
  row,
1497
- index: $rowIndex
1499
+ index: $rowIndex,
1500
+ records
1498
1501
  });
1499
1502
  if (treeTableSelectionChange(records))
1500
1503
  return;
@@ -1520,9 +1523,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
1520
1523
  };
1521
1524
  const radioOnChange = (rowData = {}) => {
1522
1525
  let {
1523
- data,
1524
- row,
1525
- $rowIndex
1526
+ row
1526
1527
  } = rowData;
1527
1528
  emit("selectionChange", [{
1528
1529
  ...row
@@ -2271,14 +2272,23 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
2271
2272
  loadData
2272
2273
  });
2273
2274
  return (_ctx, _cache) => {
2274
- return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(` <div
2275
- class="big-table custom-big-table"
2276
- :class="{
2277
- mt: state.visibleCheckAllWrap || state.visibleTreeCheck || state.hasRefresh,
2278
- 'expand-padding': !props.isNestTable
2279
- }"
2280
- :style="{ height: state.tableHeight }"
2281
- > `), createElementVNode("div", {
2275
+ return openBlock(), createElementBlock(Fragment, null, [state.anchorList.length ? (openBlock(), createBlock(unref(NTabs), {
2276
+ key: 0,
2277
+ type: "line",
2278
+ animated: "",
2279
+ "pane-style": "padding: 0",
2280
+ value: state.anchorValue,
2281
+ "onUpdate:value": [_cache[0] || (_cache[0] = ($event) => state.anchorValue = $event), unref(updateAnchor)]
2282
+ }, {
2283
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.anchor, (item) => {
2284
+ return openBlock(), createBlock(unref(NTabPane), {
2285
+ name: item.field,
2286
+ tab: item.title,
2287
+ key: item.field
2288
+ }, null, 8, ["name", "tab"]);
2289
+ }), 128))]),
2290
+ _: 1
2291
+ }, 8, ["value", "onUpdate:value"])) : createCommentVNode("v-if", true), createElementVNode("div", {
2282
2292
  class: normalizeClass(["big-table custom-big-table", {
2283
2293
  mt: state.hasRefresh,
2284
2294
  "expand-padding": !props.isNestTable
@@ -2291,7 +2301,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
2291
2301
  }, [_hoisted_2, createElementVNode("span", {
2292
2302
  class: "check-wrap-btn",
2293
2303
  onClick: refreshTable
2294
- }, "\u70B9\u51FB\u67E5\u770B")])])) : createCommentVNode("v-if", true), createCommentVNode(" \u5168\u9009 \u9009\u62E9\u6846 "), createCommentVNode(' <div\n v-show="state.visibleCheckAllWrap && !props.isInlineOperating && !props.isNestTable"\n class="check-wrap"\n >\n <p class="check-wrap-title">\n <span>\u5DF2\u52FE\u9009\u6570\u636E\u5171{{ allSelectedLength }}\u6761</span>\n <span v-show="state.visibleCheckAllWrapMore">\n \uFF08\u5F53\u524D\u9875{{ state.currentPageSelectedLength }}\u6761\uFF09\n </span>\n </p>\n <template v-if="state.visibleCheckAllWrapMore && !props.asyncCount">\n <p v-if="!visibleCancelCheckAllBtn" class="check-wrap-btn" @click="handleCheckAll">\n <span v-if="pageVO.total > maxCheckSize">\n {{ `\u52FE\u9009\u5168\u90E8\u9875 ${maxCheckSize}\u6761\u6570\u636E` }}\n </span>\n <span v-else>\n {{ `\u52FE\u9009\u5168\u90E8\u9875 ${pageVO.total}\u6761\u6570\u636E` }}\n </span>\n </p>\n <p v-else class="check-wrap-btn" @click="handleCancelAllCheck">\u53D6\u6D88\u5168\u90E8\u52FE\u9009</p>\n </template>\n </div> '), createCommentVNode(" \u6811\u72B6\u8868\u683C\u5DF2\u9009 "), createCommentVNode(' <div\n v-show="state.visibleTreeCheck && !props.isInlineOperating && !props.isNestTable"\n class="check-wrap"\n >\n <p class="check-wrap-title">\n <span>\u5DF2\u52FE\u9009\u6570\u636E\u5171{{ state.treeTableLength }}\u6761</span>\n </p>\n </div> '), createVNode(unref(CGrid), mergeProps({
2304
+ }, "\u70B9\u51FB\u67E5\u770B")])])) : createCommentVNode("v-if", true), createVNode(unref(CGrid), mergeProps({
2295
2305
  ref_key: "xGrid",
2296
2306
  ref: xGrid,
2297
2307
  border: "",
@@ -2373,28 +2383,12 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
2373
2383
  "no-data-tip": props.emptyItems.noDataTip,
2374
2384
  "show-img": !props.isNestTable
2375
2385
  }, null, 8, ["no-data-img", "no-data-tip", "show-img"])]) : createCommentVNode("v-if", true)]),
2376
- tooltip_checkbox: withCtx(({
2377
- row,
2378
- checked
2379
- }) => [row.forbiddenBatchSelect ? (openBlock(), createBlock(unref(NTooltip), {
2380
- key: 0,
2381
- trigger: "hover",
2382
- placement: "right"
2383
- }, {
2384
- trigger: withCtx(() => [_hoisted_3]),
2385
- default: withCtx(() => [createTextVNode(" " + toDisplayString(row.forbiddenBatchSelectReason), 1)]),
2386
- _: 2
2387
- }, 1024)) : (openBlock(), createBlock(unref(NCheckbox), {
2388
- key: 1,
2389
- class: "tooltip-checkbox-item",
2390
- checked
2391
- }, null, 8, ["checked"]))]),
2392
2386
  tooltip_footer: withCtx(({
2393
2387
  column
2394
2388
  }) => [createCommentVNode(" \u5206\u7EC4\u7EDF\u8BA1 "), _ctx.groupCountFields && _ctx.groupCountFields.length ? (openBlock(), createElementBlock("span", {
2395
2389
  key: 0,
2396
2390
  innerHTML: state.groupText
2397
- }, null, 8, _hoisted_4)) : (openBlock(), createElementBlock(Fragment, {
2391
+ }, null, 8, _hoisted_3)) : (openBlock(), createElementBlock(Fragment, {
2398
2392
  key: 1
2399
2393
  }, [createCommentVNode(" \u4E00\u822C\u7EDF\u8BA1 "), createVNode(unref(NTooltip), {
2400
2394
  trigger: "hover"
@@ -2402,7 +2396,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
2402
2396
  trigger: withCtx(() => [createTextVNode(toDisplayString(getFooterTitle(column)), 1)]),
2403
2397
  default: withCtx(() => [createElementVNode("div", {
2404
2398
  innerHTML: getFooterTooltipTitle(column)
2405
- }, null, 8, _hoisted_5)]),
2399
+ }, null, 8, _hoisted_4)]),
2406
2400
  _: 2
2407
2401
  }, 1024)], 2112))]),
2408
2402
  nest_table_content: withCtx(({
@@ -2425,7 +2419,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
2425
2419
  }, [createVNode(unref(NIcon), {
2426
2420
  size: "14",
2427
2421
  component: unref(SyncOutline)
2428
- }, null, 8, ["component"]), createElementVNode("p", _hoisted_6, toDisplayString(_ctx.refreshRow) + "\u6761\u66F4\u65B0", 1)], 512), [[vShow, props.refreshRow > 0 && !props.isNestTable]])], 6)], 2112);
2422
+ }, null, 8, ["component"]), createElementVNode("p", _hoisted_5, toDisplayString(_ctx.refreshRow) + "\u6761\u66F4\u65B0", 1)], 512), [[vShow, props.refreshRow > 0 && !props.isNestTable]])], 6)], 64);
2429
2423
  };
2430
2424
  }
2431
2425
  });
@@ -199,5 +199,9 @@ declare const bigTableProps: {
199
199
  };
200
200
  resetInlineBatchEdit: FunctionConstructor;
201
201
  resetBatchEditRowStatus: FunctionConstructor;
202
+ anchor: {
203
+ type: ArrayConstructor;
204
+ default: () => never[];
205
+ };
202
206
  };
203
207
  export default bigTableProps;
@@ -112,7 +112,8 @@ const bigTableProps = {
112
112
  batchError: Boolean,
113
113
  batchFormData: { type: Object, default: () => ({}) },
114
114
  resetInlineBatchEdit: Function,
115
- resetBatchEditRowStatus: Function
115
+ resetBatchEditRowStatus: Function,
116
+ anchor: { type: Array, default: () => [] }
116
117
  };
117
118
 
118
119
  export { bigTableProps as default };
@@ -52,5 +52,7 @@ declare const bigTableState: {
52
52
  isHover: boolean;
53
53
  isCurrent: boolean;
54
54
  };
55
+ anchorValue: string;
56
+ anchorList: never[];
55
57
  };
56
58
  export default bigTableState;
@@ -54,7 +54,9 @@ const bigTableState = {
54
54
  return !row.$__SEPARATE;
55
55
  }
56
56
  },
57
- rowConfig: { height: 32, isHover: true, isCurrent: true }
57
+ rowConfig: { height: 32, isHover: true, isCurrent: true },
58
+ anchorValue: "",
59
+ anchorList: []
58
60
  };
59
61
 
60
62
  export { bigTableState as default };
@@ -44,7 +44,7 @@ var editTime = defineComponent({
44
44
  ...props.col.componentProps || {}
45
45
  };
46
46
  return () => createVNode(NTimePicker, mergeProps(attrs, config, {
47
- "onUpdateValue": onUpdateValue
47
+ "onUpdateFormattedValue": onUpdateValue
48
48
  }), null);
49
49
  }
50
50
  });
@@ -0,0 +1,9 @@
1
+ export * from './useAnchor';
2
+ export * from './useEdit';
3
+ export * from './useFormat';
4
+ export * from './useTableParse';
5
+ export * from './useBatchEditing';
6
+ export * from './useNestTable';
7
+ export * from './useEvent';
8
+ export * from './useAnnotation';
9
+ export * from './useSeparateRow';
@@ -0,0 +1,9 @@
1
+ export { useAnchor } from './useAnchor.js';
2
+ export { comps, useEdit } from './useEdit.js';
3
+ export { useFormat } from './useFormat.js';
4
+ export { useTableParse } from './useTableParse.js';
5
+ export { useBatchEditing } from './useBatchEditing.js';
6
+ export { useNestTable } from './useNestTable.js';
7
+ export { useEvent } from './useEvent.js';
8
+ export { useAnnotation } from './useAnnotation.js';
9
+ export { SeparateHandle, useSeparateMap, useSeparateRow } from './useSeparateRow.js';
@@ -0,0 +1,7 @@
1
+ export declare const useAnchor: (props: any, state: any, emit: any, xGrid: any) => {
2
+ initAnchor: () => void;
3
+ updateAnchor: (field: string) => Promise<void>;
4
+ anchorEvent: ({ scrollLeft }: {
5
+ scrollLeft: number;
6
+ }) => void;
7
+ };
@@ -0,0 +1,49 @@
1
+ import { useThrottleFn } from '@vueuse/core';
2
+
3
+ const useAnchor = (props, state, emit, xGrid) => {
4
+ let setAnchorStatus = true;
5
+ function initAnchor() {
6
+ var _a, _b, _c;
7
+ if ((_a = props.anchor) == null ? void 0 : _a.length) {
8
+ const columns = xGrid.value.getColumns();
9
+ let left = 0;
10
+ columns.forEach((column) => {
11
+ const { field, minWidth, width, fixed } = column;
12
+ const colWidth = +(minWidth || width);
13
+ if (fixed == "left") ; else {
14
+ left += colWidth;
15
+ const anchorObj = props.anchor.find((v) => v.field === field);
16
+ anchorObj && state.anchorList.push({
17
+ ...anchorObj,
18
+ left: left - colWidth
19
+ });
20
+ }
21
+ });
22
+ state.anchorValue = ((_c = (_b = state.anchorList) == null ? void 0 : _b[0]) == null ? void 0 : _c.field) || "";
23
+ }
24
+ }
25
+ async function updateAnchor(field) {
26
+ setAnchorStatus = false;
27
+ const anchorObj = state.anchorList.find((v) => v.field === field);
28
+ await xGrid.value.scrollTo(anchorObj.left);
29
+ setTimeout(() => {
30
+ setAnchorStatus = true;
31
+ });
32
+ }
33
+ function setAnchorValue({ scrollLeft }) {
34
+ if (state.anchorList.length && setAnchorStatus) {
35
+ const anchorObj = state.anchorList.find((v) => scrollLeft < v.left);
36
+ if (anchorObj) {
37
+ state.anchorValue = anchorObj.field;
38
+ }
39
+ }
40
+ }
41
+ const anchorEvent = useThrottleFn(setAnchorValue, 800);
42
+ return {
43
+ initAnchor,
44
+ updateAnchor,
45
+ anchorEvent
46
+ };
47
+ };
48
+
49
+ export { useAnchor };