cnhis-design-vue 3.1.16-beta.0 → 3.1.16-beta.11
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/es/packages/big-table/index.d.ts +652 -430
- package/es/packages/big-table/src/BigTable.vue.d.ts +655 -457
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +106 -112
- package/es/packages/big-table/src/bigTableProps.d.ts +4 -0
- package/es/packages/big-table/src/bigTableProps.js +2 -1
- package/es/packages/big-table/src/bigTableState.d.ts +2 -0
- package/es/packages/big-table/src/bigTableState.js +3 -1
- package/es/packages/big-table/src/components/edit-form/edit-time.js +1 -1
- package/es/packages/big-table/src/hooks/index.d.ts +9 -0
- package/es/packages/big-table/src/hooks/index.js +9 -0
- package/es/packages/big-table/src/hooks/useAnchor.d.ts +7 -0
- package/es/packages/big-table/src/hooks/useAnchor.js +49 -0
- package/es/packages/big-table/src/hooks/useColumnConfigAdaptor.js +24 -8
- package/es/packages/big-table/src/hooks/useEdit.js +1 -1
- package/es/packages/big-table/src/hooks/useEvent.d.ts +1 -1
- package/es/packages/big-table/src/hooks/useEvent.js +3 -2
- package/es/packages/big-table/style/index.css +1 -2
- package/es/packages/button-print/index.d.ts +6 -3
- package/es/packages/button-print/src/ButtonPrint.vue.d.ts +6 -3
- package/es/packages/button-print/src/ButtonPrint.vue_vue_type_script_setup_true_lang.js +2 -1
- package/es/packages/button-print/src/components/IdentityVerification.js +5 -7
- package/es/packages/button-print/src/components/IdentityVerification.vue.d.ts +6 -3
- package/es/packages/drag-layout/index.d.ts +2 -2
- package/es/packages/drag-layout/src/DragLayout.vue.d.ts +2 -2
- package/es/packages/fabric-chart/src/FabricChart.js +2 -1
- package/es/packages/fabric-chart/src/hooks/constant.js +5 -5
- package/es/packages/fabric-chart/src/hooks/useCenter.js +20 -23
- package/es/packages/fabric-chart/src/hooks/useDraw.js +11 -4
- package/es/packages/fabric-chart/src/hooks/useEvent.js +11 -3
- package/es/packages/fabric-chart/src/hooks/useLeft.js +8 -4
- package/es/packages/fabric-chart/src/hooks/useOther.js +63 -13
- package/es/packages/fabric-chart/src/hooks/useTop.js +5 -8
- package/es/packages/field-set/index.d.ts +1 -1
- package/es/packages/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/packages/form-config/index.d.ts +110 -3367
- package/es/packages/form-config/src/FormConfig.js +42 -34
- package/es/packages/form-config/src/FormConfig.vue.d.ts +147 -3404
- package/es/packages/form-config/src/components/FormConfigCreator.js +13 -11
- package/es/packages/form-config/src/components/FormConfigCreator.vue.d.ts +23 -22
- package/es/packages/form-config/src/components/FormConfigEdit.js +2 -2
- package/es/packages/form-config/src/components/FormConfigEdit.vue.d.ts +75 -49
- package/es/packages/form-config/src/constants/index.d.ts +58 -24
- package/es/packages/form-config/src/constants/index.js +52 -23
- package/es/packages/form-config/src/hooks/index.d.ts +1 -0
- package/es/packages/form-config/src/hooks/index.js +1 -0
- package/es/packages/form-config/src/hooks/useConfigurationField.d.ts +2 -1
- package/es/packages/form-config/src/hooks/useConfigurationField.js +29 -80
- package/es/packages/form-config/src/hooks/usePresetRenderer.d.ts +2 -3
- package/es/packages/form-config/src/hooks/usePresetRenderer.js +16 -19
- package/es/packages/form-config/src/hooks/useSortable.js +1 -1
- package/es/packages/form-config/src/types/index.d.ts +22 -4
- package/es/packages/form-config/src/utils/index.d.ts +2 -0
- package/es/packages/form-config/src/utils/index.js +15 -0
- package/es/packages/form-config/style/index.css +27 -3
- package/es/packages/form-render/index.d.ts +13 -15
- package/es/packages/form-render/src/FormRender.js +10 -7
- package/es/packages/form-render/src/FormRender.vue.d.ts +14 -16
- package/es/packages/form-render/src/components/renderer/cascader.d.ts +2 -14
- package/es/packages/form-render/src/components/renderer/cascader.js +3 -3
- package/es/packages/form-render/src/components/renderer/checkbox.js +1 -1
- package/es/packages/form-render/src/components/renderer/combination/index.js +2 -1
- package/es/packages/form-render/src/components/renderer/complex.js +1 -1
- package/es/packages/form-render/src/components/renderer/date.d.ts +20 -4
- package/es/packages/form-render/src/components/renderer/date.js +36 -20
- package/es/packages/form-render/src/components/renderer/input.js +2 -1
- package/es/packages/form-render/src/components/renderer/inputNumber.js +2 -1
- package/es/packages/form-render/src/components/renderer/linebar.js +1 -4
- package/es/packages/form-render/src/components/renderer/radio.js +1 -1
- package/es/packages/form-render/src/components/renderer/select.d.ts +1 -10
- package/es/packages/form-render/src/components/renderer/select.js +26 -17
- package/es/packages/form-render/src/components/renderer/slider.d.ts +8 -344
- package/es/packages/form-render/src/components/renderer/slider.js +24 -2
- package/es/packages/form-render/src/components/renderer/switch.js +1 -1
- package/es/packages/form-render/src/components/renderer/textarea.js +1 -1
- package/es/packages/form-render/src/hooks/useAnchor.js +7 -4
- package/es/packages/form-render/src/hooks/useBusinessBinding.d.ts +15 -9
- package/es/packages/form-render/src/hooks/useBusinessBinding.js +62 -58
- package/es/packages/form-render/src/hooks/useChangeContext.d.ts +4 -2
- package/es/packages/form-render/src/hooks/useChangeContext.js +4 -7
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +17 -7
- package/es/packages/form-render/src/hooks/useFormContext.d.ts +2 -1
- package/es/packages/form-render/src/hooks/useFormContext.js +2 -2
- package/es/packages/form-render/src/hooks/useFormValidator.js +13 -3
- package/es/packages/form-render/src/hooks/useInitialData.d.ts +1 -1
- package/es/packages/form-render/src/hooks/useInitialData.js +9 -4
- package/es/packages/form-render/src/hooks/useTypeNormalize.js +1 -1
- package/es/packages/form-render/src/types/fieldItem.d.ts +11 -12
- package/es/packages/form-render/src/types/index.d.ts +7 -8
- package/es/packages/form-render/src/utils/business.d.ts +12 -0
- package/es/packages/form-render/src/utils/business.js +78 -0
- package/es/packages/form-render/src/utils/dom.d.ts +6 -0
- package/es/packages/form-render/src/utils/dom.js +14 -0
- package/es/packages/form-render/src/utils/index.d.ts +6 -26
- package/es/packages/form-render/src/utils/index.js +9 -138
- package/es/packages/form-render/src/utils/schema.d.ts +16 -0
- package/es/packages/form-render/src/utils/schema.js +94 -0
- package/es/packages/index.css +28 -5
- package/es/packages/scale-view/src/hooks/scaleview-init.js +35 -35
- package/es/packages/scale-view/src/hooks/use-component.d.ts +7 -7
- package/es/packages/select-label/index.d.ts +10 -10
- package/es/packages/select-label/src/LabelFormContent.vue.d.ts +3 -3
- package/es/packages/select-label/src/SelectLabel.vue.d.ts +7 -7
- package/es/packages/shortcut-setter/index.d.ts +3452 -1
- package/es/packages/shortcut-setter/src/ShortcutSetter.js +5 -2
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +3456 -1
- package/es/packages/time-line/index.d.ts +2 -2
- package/es/packages/time-line/src/TimeLine.vue.d.ts +2 -2
- package/global.d.ts +8 -8
- package/package.json +1 -1
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import { defineComponent, ref, reactive, useAttrs, computed, onMounted, onUnmounted, onActivated, createVNode, h, resolveComponent, Teleport, createTextVNode,
|
|
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 =
|
|
33
|
-
class: "disabled-checked-tips"
|
|
34
|
-
}, null, -1);
|
|
33
|
+
const _hoisted_3 = ["innerHTML"];
|
|
35
34
|
const _hoisted_4 = ["innerHTML"];
|
|
36
|
-
const _hoisted_5 =
|
|
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)
|
|
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 ((
|
|
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,
|
|
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 = (
|
|
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
|
-
|
|
470
|
-
|
|
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
|
|
598
|
-
|
|
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,
|
|
615
|
+
return getPicture(row, col, attrType);
|
|
615
616
|
}
|
|
616
617
|
if (attrType == "COLOR") {
|
|
617
|
-
return getColor(row,
|
|
618
|
+
return getColor(row, col);
|
|
618
619
|
}
|
|
619
620
|
if (attrType == "EVALUATE") {
|
|
620
|
-
return getEvaluate(row,
|
|
621
|
+
return getEvaluate(row, col);
|
|
621
622
|
}
|
|
622
623
|
if (attrType == "MAP") {
|
|
623
|
-
return getMapVal(row,
|
|
624
|
+
return getMapVal(row, col);
|
|
624
625
|
}
|
|
625
626
|
if (attrType == "DATE" || attrType == "TASKDATE") {
|
|
626
|
-
return getDate(row,
|
|
627
|
+
return getDate(row, col);
|
|
627
628
|
}
|
|
628
629
|
if (attrType == "PERCENTAGE") {
|
|
629
|
-
return getPercentage(row,
|
|
630
|
+
return getPercentage(row, col);
|
|
630
631
|
}
|
|
631
632
|
if (attrType == "VIDEO") {
|
|
632
|
-
return getvideoList(row,
|
|
633
|
+
return getvideoList(row, col);
|
|
633
634
|
}
|
|
634
635
|
if (attrType == "CANDIDATE_COMPONENTS") {
|
|
635
|
-
return getCandidateComponents(row,
|
|
636
|
+
return getCandidateComponents(row, col);
|
|
636
637
|
}
|
|
637
638
|
if (attrType == "AGE") {
|
|
638
|
-
return getageShowType(row,
|
|
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[
|
|
645
|
+
"innerHTML": row[col.columnName + "_countdown"] || ""
|
|
645
646
|
}, null);
|
|
646
647
|
},
|
|
647
648
|
default() {
|
|
648
|
-
return row[
|
|
649
|
+
return row[col.columnName + "_countdownTip"];
|
|
649
650
|
}
|
|
650
651
|
});
|
|
651
652
|
}
|
|
652
653
|
if (attrType === "DURATION") {
|
|
653
|
-
const value = row[
|
|
654
|
-
const 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[
|
|
659
|
-
const params2 =
|
|
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[
|
|
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,
|
|
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,
|
|
690
|
-
if (
|
|
690
|
+
if (isLink(props, col, row) && !isScanMultiTable.value) {
|
|
691
|
+
if (col.btnLinkSwitch) {
|
|
691
692
|
let disabled = false;
|
|
692
|
-
let curBtn = (
|
|
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,
|
|
699
|
+
return getBtnLinkSwitch(row, col, disabled, $rowIndex);
|
|
699
700
|
} else {
|
|
700
|
-
return getField(row,
|
|
701
|
+
return getField(row, col, $rowIndex, true);
|
|
701
702
|
}
|
|
702
703
|
} else {
|
|
703
|
-
return getField(row,
|
|
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
|
-
|
|
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, [
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
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),
|
|
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,
|
|
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,
|
|
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",
|
|
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 };
|
|
@@ -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 };
|
|
@@ -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,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 };
|