cnhis-design-vue 3.1.34 → 3.1.35-beta.10
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/components/big-table/index.d.ts +14 -0
- package/es/components/big-table/src/BigTable.vue.d.ts +17 -9
- package/es/components/big-table/src/BigTable.vue2.js +602 -15
- package/es/components/big-table/src/components/edit-form/edit-separate.vue.d.ts +4 -0
- package/es/components/big-table/src/components/separate.vue.d.ts +1 -0
- package/es/components/big-table/src/hooks/useEdit.d.ts +4 -0
- package/es/components/big-table/src/hooks/useSeparateRow.d.ts +11 -1
- package/es/components/big-table/src/hooks/useSeparateRow.js +56 -12
- package/es/components/big-table/style/index.css +1 -1
- package/es/components/fabric-chart/src/hooks/useCenter.js +3 -3
- package/es/components/fabric-chart/src/hooks/useLeft.js +3 -3
- package/es/components/fabric-chart/src/hooks/useTemperatureChart.js +2 -1
- package/es/components/fabric-chart/src/utils/utils.d.ts +2 -0
- package/es/components/fabric-chart/src/utils/utils.js +7 -1
- package/es/components/form-config/src/components/FormConfigCreator.vue.js +1 -0
- package/es/components/form-config/src/hooks/useConfigurationField.js +7 -1
- package/es/components/form-render/src/components/renderer/combination.js +11 -3
- package/es/components/form-render/src/components/renderer/formItem.d.ts +2 -0
- package/es/components/form-render/src/components/renderer/formItem.js +20 -4
- package/es/components/form-render/src/components/renderer/jsonCombination/index.js +7 -3
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.d.ts +12 -2
- package/es/components/form-render/src/components/renderer/lineBar/FormCollapse.vue.js +7 -14
- package/es/components/form-render/src/components/renderer/lineBar/index.d.ts +12 -2
- package/es/components/form-render/src/components/tooltipMessage.vue.d.ts +13 -0
- package/es/components/form-render/src/components/tooltipMessage.vue.js +37 -0
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -0
- package/es/components/form-render/style/index.css +1 -1
- package/es/components/iho-table/src/IhoTable.vue.js +3 -3
- package/es/components/index.css +1 -1
- package/es/components/info-header/index.d.ts +45 -0
- package/es/components/info-header/src/InfoHeader.vue.d.ts +39 -6
- package/es/components/info-header/src/InfoHeader.vue.js +40 -29
- package/es/components/info-header/style/index.css +1 -1
- package/es/components/keyboard/index.d.ts +34 -6
- package/es/components/keyboard/src/Keyboard.vue.d.ts +34 -6
- package/es/components/keyboard/src/Keyboard.vue.js +16 -12
- package/es/components/keyboard/src/components/InputNumber.vue.js +1 -1
- package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +14 -4
- package/es/components/keyboard/src/components/NumberPanel.vue.js +88 -30
- package/es/components/keyboard/style/index.css +1 -1
- package/package.json +2 -2
|
@@ -12,14 +12,14 @@ import { useNestTable } from './hooks/useNestTable.js';
|
|
|
12
12
|
import { useEvent } from './hooks/useEvent.js';
|
|
13
13
|
import { useAnnotation } from './hooks/useAnnotation.js';
|
|
14
14
|
import { useSeparateRow, useSeparateMap } from './hooks/useSeparateRow.js';
|
|
15
|
-
import { SettingsSharp, CaretDown, CaretForward, CopyOutline, SyncOutline } from '@vicons/ionicons5';
|
|
15
|
+
import { SettingsSharp, CreateOutline, CaretDown, CaretForward, CopyOutline, SyncOutline } from '@vicons/ionicons5';
|
|
16
16
|
import NoData from './components/NoData.vue.js';
|
|
17
17
|
import script from '../../../shared/components/SvgIcon/SvgIcon.vue.js';
|
|
18
18
|
import { useMessage, NIcon, NTooltip, NCheckbox, NCheckboxGroup, NGrid, NGi, NButton, NPopconfirm, NProgress, NDropdown, NSwitch, NPopover, NTabs, NTabPane } from 'naive-ui';
|
|
19
19
|
import Grid from '../../grid/index.js';
|
|
20
20
|
import XEUtils from 'xe-utils';
|
|
21
21
|
import 'moment';
|
|
22
|
-
import { handleTableHeight, setTableConfig, handleGroupColums, treeToList, checkMethod, setTreeGroupTitle, isFilterItem, handleName, generateEditRender, handlerInitSearchItem, getEvaluate, getMapVal, getCandidateComponents, getageShowType, isLink, showFilter, reScrollFilterWrap, hideFilterWrap, mergeConObjFn, setDefaultFormData, handleImgArr, handleImgSrc, modalDetailImage, handleQrCodeContent, getInlineEditBtn, isCopy, setVisibleCheckAllWrap, handleTableImageSize } from './utils.js';
|
|
22
|
+
import { handleTableHeight, setTableConfig, handleGroupColums, treeToList, checkMethod, setTreeGroupTitle, isFilterItem, 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
23
|
import InputButtonScript from './components/input-button.vue.js';
|
|
24
24
|
import Separate from './components/separate.vue.js';
|
|
25
25
|
import xb_big from '../../../shared/assets/img/xb_big.png.js';
|
|
@@ -101,7 +101,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
101
101
|
updateAnchor,
|
|
102
102
|
anchorEvent
|
|
103
103
|
} = useAnchor(props, state, emit, xGrid);
|
|
104
|
-
|
|
104
|
+
const {
|
|
105
|
+
keyDown,
|
|
106
|
+
scroll
|
|
107
|
+
} = useEvent(props, state, emit, xGrid, anchorEvent);
|
|
105
108
|
const currentCheckedKeys = computed(() => {
|
|
106
109
|
var _a;
|
|
107
110
|
return ((_a = state.checkedRows) == null ? void 0 : _a.map((row) => row[props.primaryKey])) || [];
|
|
@@ -112,7 +115,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
112
115
|
let isCheckedTotal = currentCheckedKeys.value.length === props.pageVO.total;
|
|
113
116
|
return isMaxChecked || !isCurrentPageAllCheck || isCheckedTotal;
|
|
114
117
|
});
|
|
115
|
-
computed(() => {
|
|
118
|
+
const singleCheckedKey = computed(() => {
|
|
116
119
|
const checkedKeys = currentCheckedKeys.value || [];
|
|
117
120
|
return checkedKeys.length == 1 ? checkedKeys[0] : "";
|
|
118
121
|
});
|
|
@@ -133,7 +136,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
133
136
|
sysImageSize: props.sysImageSize || {}
|
|
134
137
|
};
|
|
135
138
|
});
|
|
136
|
-
computed(() => {
|
|
139
|
+
const treeConfig = computed(() => {
|
|
137
140
|
let result = getAttr("tree-config");
|
|
138
141
|
let {
|
|
139
142
|
isTransform
|
|
@@ -165,7 +168,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
165
168
|
}
|
|
166
169
|
return result;
|
|
167
170
|
});
|
|
168
|
-
computed(() => {
|
|
171
|
+
const keyboardConfig = computed(() => {
|
|
169
172
|
return {
|
|
170
173
|
editMethod({
|
|
171
174
|
row,
|
|
@@ -243,14 +246,19 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
243
246
|
const {
|
|
244
247
|
separate,
|
|
245
248
|
onColumnResize,
|
|
246
|
-
separateHandle
|
|
249
|
+
separateHandle,
|
|
250
|
+
separateDataMap
|
|
247
251
|
} = useSeparateRow(() => {
|
|
248
252
|
var _a, _b;
|
|
249
253
|
return (_b = (_a = props.columnConfig) == null ? void 0 : _a.fieldList) != null ? _b : [];
|
|
250
|
-
}, (columnName) => {
|
|
254
|
+
}, colspanMethod, (columnName) => {
|
|
251
255
|
var _a, _b;
|
|
252
256
|
return (_b = (_a = props.columnConfig) == null ? void 0 : _a.fieldList) == null ? void 0 : _b.find((field) => field.columnName === columnName);
|
|
253
257
|
}, xGrid);
|
|
258
|
+
const onResizableChange = (payload) => {
|
|
259
|
+
onColumnResize(payload);
|
|
260
|
+
emit("resizableChange", payload);
|
|
261
|
+
};
|
|
254
262
|
async function loadData(data) {
|
|
255
263
|
state.isShowEmpty = !(data == null ? void 0 : data.length);
|
|
256
264
|
let formatList = data;
|
|
@@ -844,7 +852,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
844
852
|
field.filterSort = sort;
|
|
845
853
|
emit("sortChange", {
|
|
846
854
|
prop: field.columnName,
|
|
847
|
-
order: sort
|
|
855
|
+
order: sort,
|
|
856
|
+
column: field
|
|
848
857
|
});
|
|
849
858
|
};
|
|
850
859
|
const handleFilterSeach = (val, field) => {
|
|
@@ -964,14 +973,20 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
964
973
|
if (isFunction(item.headerSlotFn))
|
|
965
974
|
return () => item.headerSlotFn(item);
|
|
966
975
|
if (type === "format")
|
|
967
|
-
return [createVNode(
|
|
976
|
+
return [item.isEdit && !props.columnConfig.noEditIcon ? createVNode(NIcon, {
|
|
977
|
+
"component": CreateOutline,
|
|
978
|
+
"class": "is-edit"
|
|
979
|
+
}, null) : null, createVNode("span", {
|
|
968
980
|
"class": "header-title-span"
|
|
969
981
|
}, [name]), renderAnnotation(item)];
|
|
970
982
|
return () => {
|
|
971
|
-
return [item.treeNode && state.isTree == 1 ? createVNode(NIcon, {
|
|
983
|
+
return [item.treeNode && state.isTree == 1 && !props.columnConfig.noExpandIcon ? createVNode(NIcon, {
|
|
972
984
|
"component": state.isExpand && state.total < 1001 ? CaretDown : CaretForward,
|
|
973
985
|
"onClick": (e) => triggerExpand(e, state.isExpand)
|
|
974
|
-
}, null) :
|
|
986
|
+
}, null) : null, item.isEdit && !props.columnConfig.noEditIcon ? createVNode(NIcon, {
|
|
987
|
+
"component": CreateOutline,
|
|
988
|
+
"class": "is-edit"
|
|
989
|
+
}, null) : null, createVNode("span", {
|
|
975
990
|
"class": "header-title-span"
|
|
976
991
|
}, [name]), renderAnnotation(item)];
|
|
977
992
|
};
|
|
@@ -1004,6 +1019,54 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1004
1019
|
state.hasRefresh = false;
|
|
1005
1020
|
emit("refreshTable");
|
|
1006
1021
|
};
|
|
1022
|
+
const getRowClassName = (params) => {
|
|
1023
|
+
const {
|
|
1024
|
+
rowClassName = null
|
|
1025
|
+
} = props.columnConfig;
|
|
1026
|
+
if (rowClassName) {
|
|
1027
|
+
return XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName;
|
|
1028
|
+
}
|
|
1029
|
+
const selectStyle = () => {
|
|
1030
|
+
const {
|
|
1031
|
+
row,
|
|
1032
|
+
$rowIndex,
|
|
1033
|
+
rowIndex
|
|
1034
|
+
} = params;
|
|
1035
|
+
const k = singleCheckedKey.value;
|
|
1036
|
+
return k && k === row[props.primaryKey] ? "single--checked" : "";
|
|
1037
|
+
};
|
|
1038
|
+
return state.selectType === "checkbox" ? selectStyle() : null;
|
|
1039
|
+
};
|
|
1040
|
+
const footerMethod = (payload) => {
|
|
1041
|
+
const {
|
|
1042
|
+
columns,
|
|
1043
|
+
data
|
|
1044
|
+
} = payload;
|
|
1045
|
+
if (isFunction(attr.footerMethod))
|
|
1046
|
+
return attr.spanMethod(footerMethod);
|
|
1047
|
+
if (isFunction(attr["footer-method"]))
|
|
1048
|
+
return attr["footer-method"](payload);
|
|
1049
|
+
if (!props.groupCountFields || !props.groupCountFields.length) {
|
|
1050
|
+
return [columns.map((column, index) => {
|
|
1051
|
+
if (index === 0) {
|
|
1052
|
+
return null;
|
|
1053
|
+
}
|
|
1054
|
+
return null;
|
|
1055
|
+
})];
|
|
1056
|
+
}
|
|
1057
|
+
let groupText = getFooterGroup(columns, data, props);
|
|
1058
|
+
let groupColumns = columns.map((column, index) => {
|
|
1059
|
+
if (index === 0) {
|
|
1060
|
+
return null;
|
|
1061
|
+
} else if (index === 1) {
|
|
1062
|
+
return groupText;
|
|
1063
|
+
}
|
|
1064
|
+
return null;
|
|
1065
|
+
});
|
|
1066
|
+
emit("setGroupText", groupText);
|
|
1067
|
+
state.groupText = groupText;
|
|
1068
|
+
return [groupColumns];
|
|
1069
|
+
};
|
|
1007
1070
|
const loadChildrenMethod = ({
|
|
1008
1071
|
row
|
|
1009
1072
|
}) => {
|
|
@@ -1092,11 +1155,465 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1092
1155
|
};
|
|
1093
1156
|
});
|
|
1094
1157
|
};
|
|
1158
|
+
function spanMethod(payload) {
|
|
1159
|
+
const {
|
|
1160
|
+
row,
|
|
1161
|
+
column,
|
|
1162
|
+
rowIndex
|
|
1163
|
+
} = payload;
|
|
1164
|
+
if (row.$__SEPARATE && separateDataMap.value.has(row)) {
|
|
1165
|
+
const {
|
|
1166
|
+
rawRow
|
|
1167
|
+
} = separateDataMap.value.get(row);
|
|
1168
|
+
const {
|
|
1169
|
+
colspans
|
|
1170
|
+
} = separateDataMap.value.get(rawRow) || {};
|
|
1171
|
+
if (colspans) {
|
|
1172
|
+
const colspan = colspans[column.field];
|
|
1173
|
+
if (colspan === 0)
|
|
1174
|
+
return {
|
|
1175
|
+
colspan: 0,
|
|
1176
|
+
rowspan: 0
|
|
1177
|
+
};
|
|
1178
|
+
if (colspan > 1)
|
|
1179
|
+
return {
|
|
1180
|
+
rowspan: 1,
|
|
1181
|
+
colspan
|
|
1182
|
+
};
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
return colspanMethod(payload);
|
|
1186
|
+
}
|
|
1187
|
+
function colspanMethod(payload) {
|
|
1188
|
+
var _a;
|
|
1189
|
+
const defaultSpan = {
|
|
1190
|
+
rowspan: 1,
|
|
1191
|
+
colspan: 1
|
|
1192
|
+
};
|
|
1193
|
+
const {
|
|
1194
|
+
row,
|
|
1195
|
+
column
|
|
1196
|
+
} = payload;
|
|
1197
|
+
if (isFunction(attr.spanMethod))
|
|
1198
|
+
return attr.spanMethod(payload);
|
|
1199
|
+
if (isFunction(attr["span-method"]))
|
|
1200
|
+
return attr["span-method"](payload);
|
|
1201
|
+
if (state.isTree != 3) {
|
|
1202
|
+
return defaultSpan;
|
|
1203
|
+
}
|
|
1204
|
+
const xTree = xGrid.value;
|
|
1205
|
+
if (!xTree)
|
|
1206
|
+
return defaultSpan;
|
|
1207
|
+
const {
|
|
1208
|
+
tableColumn = []
|
|
1209
|
+
} = (xTree == null ? void 0 : xTree.getTableColumn()) || {};
|
|
1210
|
+
const fristKeyIndex = tableColumn.findIndex((column2) => !!column2.property);
|
|
1211
|
+
const fixedRightColsSpan = tableColumn.filter((column2) => column2.fixed === "right").length;
|
|
1212
|
+
const colspan = tableColumn.length - fristKeyIndex - fixedRightColsSpan;
|
|
1213
|
+
const isOldVxeTree = row.childrenList && row.childrenList.length;
|
|
1214
|
+
const isTransformVxeTree = ((_a = props.tableParams) == null ? void 0 : _a.isTransform) && !row.qianduan_parent_id;
|
|
1215
|
+
if (isOldVxeTree || isTransformVxeTree) {
|
|
1216
|
+
if (column.treeNode) {
|
|
1217
|
+
return {
|
|
1218
|
+
rowspan: 1,
|
|
1219
|
+
colspan
|
|
1220
|
+
};
|
|
1221
|
+
} else if (!column.property || column.fixed === "right") {
|
|
1222
|
+
return defaultSpan;
|
|
1223
|
+
} else {
|
|
1224
|
+
return {
|
|
1225
|
+
rowspan: 0,
|
|
1226
|
+
colspan: 0
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
const footerRowspanMethod = (obj) => {
|
|
1232
|
+
if (!props.groupCountFields || !props.groupCountFields.length)
|
|
1233
|
+
return {
|
|
1234
|
+
rowspan: 1,
|
|
1235
|
+
colspan: 1
|
|
1236
|
+
};
|
|
1237
|
+
let {
|
|
1238
|
+
$rowIndex,
|
|
1239
|
+
_columnIndex
|
|
1240
|
+
} = obj;
|
|
1241
|
+
let len = state.columnLen || 99;
|
|
1242
|
+
let {
|
|
1243
|
+
isBatchSelect
|
|
1244
|
+
} = props.columnConfig;
|
|
1245
|
+
if ($rowIndex === 0) {
|
|
1246
|
+
if (isBatchSelect == 1) {
|
|
1247
|
+
if (_columnIndex === 0) {
|
|
1248
|
+
return {
|
|
1249
|
+
rowspan: 1,
|
|
1250
|
+
colspan: 2
|
|
1251
|
+
};
|
|
1252
|
+
} else if (_columnIndex === 1) {
|
|
1253
|
+
return {
|
|
1254
|
+
rowspan: 1,
|
|
1255
|
+
colspan: 0
|
|
1256
|
+
};
|
|
1257
|
+
} else if (_columnIndex === 2) {
|
|
1258
|
+
return {
|
|
1259
|
+
rowspan: 1,
|
|
1260
|
+
colspan: len
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
1263
|
+
return {
|
|
1264
|
+
rowspan: 1,
|
|
1265
|
+
colspan: 0
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
if (_columnIndex === 0) {
|
|
1269
|
+
return {
|
|
1270
|
+
rowspan: 1,
|
|
1271
|
+
colspan: 1
|
|
1272
|
+
};
|
|
1273
|
+
} else if (_columnIndex === 1) {
|
|
1274
|
+
return {
|
|
1275
|
+
rowspan: 1,
|
|
1276
|
+
colspan: len
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
return {
|
|
1280
|
+
rowspan: 1,
|
|
1281
|
+
colspan: 0
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
};
|
|
1285
|
+
const rowdblclick = ({
|
|
1286
|
+
row,
|
|
1287
|
+
column
|
|
1288
|
+
}) => {
|
|
1289
|
+
if (isScanMultiTable.value || !!props.isInlineOperating)
|
|
1290
|
+
return false;
|
|
1291
|
+
if (XEUtils.has(row, GROUP_TITLE_KEY))
|
|
1292
|
+
return false;
|
|
1293
|
+
emit("setNestTableClick", props.isNestTable);
|
|
1294
|
+
emit("rowdblclick", row, column, true, true);
|
|
1295
|
+
};
|
|
1296
|
+
const pubCheckChange = (rows = []) => {
|
|
1297
|
+
state.treeTableLength = rows.filter((item) => {
|
|
1298
|
+
let isGroupRow = XEUtils.has(item, GROUP_TITLE_KEY);
|
|
1299
|
+
return !isGroupRow;
|
|
1300
|
+
}).length;
|
|
1301
|
+
state.visibleTreeCheck = rows.length > 1;
|
|
1302
|
+
emit("selectionChange", rows);
|
|
1303
|
+
};
|
|
1304
|
+
const updateAddCheckedRows = (rows, isTree = false) => {
|
|
1305
|
+
let obj = {
|
|
1306
|
+
isUpdate: true,
|
|
1307
|
+
updateRows: rows,
|
|
1308
|
+
isTree
|
|
1309
|
+
};
|
|
1310
|
+
if (isTree) {
|
|
1311
|
+
Object.assign(obj, {
|
|
1312
|
+
isTree,
|
|
1313
|
+
isCheckedChange: true,
|
|
1314
|
+
checkedRows: state.checkedRows
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
emit("selectionChangeLocal", obj);
|
|
1318
|
+
};
|
|
1319
|
+
const removeCheckedRows = (rows, isCheckedChange) => {
|
|
1320
|
+
removeCheckedDisabledRows(state);
|
|
1321
|
+
let checkedRows = state.checkedRows;
|
|
1322
|
+
let needRemoveIndexs = [];
|
|
1323
|
+
for (let i = 0; i < rows.length; i++) {
|
|
1324
|
+
let row = rows[i];
|
|
1325
|
+
let removeIndex = currentCheckedKeys.value.findIndex((item) => {
|
|
1326
|
+
return item === row[props.primaryKey];
|
|
1327
|
+
});
|
|
1328
|
+
removeIndex >= 0 && needRemoveIndexs.push(removeIndex);
|
|
1329
|
+
}
|
|
1330
|
+
needRemoveIndexs.sort((a, b) => b - a);
|
|
1331
|
+
emit("selectionChangeLocal", {
|
|
1332
|
+
isAdd: false,
|
|
1333
|
+
isCheckedChange,
|
|
1334
|
+
needRemoveIndexs,
|
|
1335
|
+
newCheckedRows: [],
|
|
1336
|
+
checkedRows
|
|
1337
|
+
});
|
|
1338
|
+
};
|
|
1339
|
+
const setCheckedMehod = (setChecked, row) => {
|
|
1340
|
+
if (setChecked) {
|
|
1341
|
+
updateAddCheckedRows(row);
|
|
1342
|
+
return;
|
|
1343
|
+
}
|
|
1344
|
+
if (props.pageVO.pageIndex != state.lastPageIndex) {
|
|
1345
|
+
updateAddCheckedRows(row);
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
if (currentCheckedKeys.value.includes(row[props.primaryKey])) {
|
|
1349
|
+
removeCheckedRows([row]);
|
|
1350
|
+
return;
|
|
1351
|
+
}
|
|
1352
|
+
updateAddCheckedRows(row);
|
|
1353
|
+
};
|
|
1354
|
+
const handlerClickRow = (data) => {
|
|
1355
|
+
var _a, _b, _c;
|
|
1356
|
+
let {
|
|
1357
|
+
row,
|
|
1358
|
+
$event = {},
|
|
1359
|
+
$rowIndex,
|
|
1360
|
+
triggerCheckbox
|
|
1361
|
+
} = data;
|
|
1362
|
+
if (((_a = getAttr("checkbox-config")) == null ? void 0 : _a.noTriggerCellClick) && triggerCheckbox) {
|
|
1363
|
+
return false;
|
|
1364
|
+
}
|
|
1365
|
+
if (((_b = getAttr("checkbox-config")) == null ? void 0 : _b.trigger) === "default") {
|
|
1366
|
+
emit("handlerClickRow", row, $rowIndex);
|
|
1367
|
+
return false;
|
|
1368
|
+
}
|
|
1369
|
+
if (isScanMultiTable.value || props.isInlineOperating)
|
|
1370
|
+
return false;
|
|
1371
|
+
if (XEUtils.has(data == null ? void 0 : data.row, GROUP_TITLE_KEY))
|
|
1372
|
+
return false;
|
|
1373
|
+
if (state.isTriggerSelectionChange && state.isTree == 0)
|
|
1374
|
+
return false;
|
|
1375
|
+
let table = xGrid.value;
|
|
1376
|
+
isAboutNestTable.value && emit("resetNestLastClickTable", table);
|
|
1377
|
+
let {
|
|
1378
|
+
className,
|
|
1379
|
+
tagName
|
|
1380
|
+
} = $event.target || {};
|
|
1381
|
+
if (tagName == "INPUT" || tagName == "svg" || tagName == "path")
|
|
1382
|
+
return;
|
|
1383
|
+
if (className && XEUtils.isString(className)) {
|
|
1384
|
+
if (className.includes("n-input") || className.includes("n-base-selection-label"))
|
|
1385
|
+
return;
|
|
1386
|
+
if (className.includes("vxe-table--expand-btn"))
|
|
1387
|
+
return;
|
|
1388
|
+
}
|
|
1389
|
+
isAboutNestTable.value && emit("setNestLastClickTable", table, props.isNestTable, row[handleRowId.value], row);
|
|
1390
|
+
emit("setNestTableClick", false);
|
|
1391
|
+
if (props.isNestTable) {
|
|
1392
|
+
table == null ? void 0 : table.setAllCheckboxRow(false);
|
|
1393
|
+
nestHandleClickRow(table, data);
|
|
1394
|
+
return;
|
|
1395
|
+
}
|
|
1396
|
+
const batchSelect = (_c = getAttr("checkbox-config")) == null ? void 0 : _c.batchSelect;
|
|
1397
|
+
let forbiddenBatchSelect = !checkMethod(data);
|
|
1398
|
+
if (state.selectType == "checkbox" && !batchSelect && (forbiddenBatchSelect || data.row.$__SEPARATE)) {
|
|
1399
|
+
table == null ? void 0 : table.setAllCheckboxRow(false);
|
|
1400
|
+
const checked2 = getRowClassName({
|
|
1401
|
+
row
|
|
1402
|
+
}) == "single--checked";
|
|
1403
|
+
const value = !checked2 ? [] : [row];
|
|
1404
|
+
state.checkedRows = value;
|
|
1405
|
+
pubCheckChange(value);
|
|
1406
|
+
emit("handlerClickRow", row, $rowIndex);
|
|
1407
|
+
emit("checkboxChange", {
|
|
1408
|
+
checked: checked2,
|
|
1409
|
+
row,
|
|
1410
|
+
index: $rowIndex,
|
|
1411
|
+
records: [row]
|
|
1412
|
+
});
|
|
1413
|
+
return;
|
|
1414
|
+
}
|
|
1415
|
+
state.visibleCheckAllWrap = false;
|
|
1416
|
+
state.visibleCheckAllWrapMore = false;
|
|
1417
|
+
let checked = false;
|
|
1418
|
+
if (state.selectType == "radio") {
|
|
1419
|
+
checked = table.isCheckedByRadioRow(row);
|
|
1420
|
+
} else {
|
|
1421
|
+
checked = table.isCheckedByCheckboxRow(row);
|
|
1422
|
+
}
|
|
1423
|
+
if (state.isradioChange) {
|
|
1424
|
+
checked = false;
|
|
1425
|
+
state.isradioChange = false;
|
|
1426
|
+
}
|
|
1427
|
+
let checkedRow = table.getCheckboxRecords();
|
|
1428
|
+
let rowLen = state.checkedRows.filter((item) => !XEUtils.has(item, GROUP_TITLE_KEY)).length;
|
|
1429
|
+
let newRow = [];
|
|
1430
|
+
if (state.isTree != 0) {
|
|
1431
|
+
let {
|
|
1432
|
+
className: className2
|
|
1433
|
+
} = $event.target || {};
|
|
1434
|
+
if (className2 && className2.includes("vxe-tree--node-btn"))
|
|
1435
|
+
return;
|
|
1436
|
+
if (state.selectType === "checkbox") {
|
|
1437
|
+
let rowVal = {};
|
|
1438
|
+
if (!state.isTriggerSelectionChange) {
|
|
1439
|
+
table.setAllCheckboxRow(false);
|
|
1440
|
+
state.checkedRows = [row];
|
|
1441
|
+
pubCheckChange([row]);
|
|
1442
|
+
rowVal = row;
|
|
1443
|
+
} else {
|
|
1444
|
+
if (checkedRow.length > 1)
|
|
1445
|
+
return false;
|
|
1446
|
+
rowVal = checked || checkedRow.length === 1 && !checked ? checkedRow[0] : {};
|
|
1447
|
+
state.checkedRows = [rowVal];
|
|
1448
|
+
}
|
|
1449
|
+
updateAddCheckedRows(rowVal, true);
|
|
1450
|
+
emit("handlerClickRow", rowVal);
|
|
1451
|
+
return;
|
|
1452
|
+
}
|
|
1453
|
+
let newTheUniqueKeyArr = [];
|
|
1454
|
+
flattenRow(row, newRow, newTheUniqueKeyArr, handleRowId.value);
|
|
1455
|
+
let res = intersectRow(checkedRow, newTheUniqueKeyArr, handleRowId.value);
|
|
1456
|
+
if (!res) {
|
|
1457
|
+
rowLen = 1;
|
|
1458
|
+
} else {
|
|
1459
|
+
rowLen = checkedRow.filter((item) => !XEUtils.has(item, GROUP_TITLE_KEY)).length;
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
!batchSelect && table.setAllCheckboxRow(false);
|
|
1463
|
+
let setChecked = checked;
|
|
1464
|
+
if (rowLen > 1) {
|
|
1465
|
+
state.selectType != "radio" && table.setCheckboxRow([row], true);
|
|
1466
|
+
state.isTree != 0 && state.selectType != "radio" && pubCheckChange(newRow);
|
|
1467
|
+
state.selectType != "radio" && emit("handlerClickRow", row, $rowIndex);
|
|
1468
|
+
} else {
|
|
1469
|
+
setChecked = !setChecked;
|
|
1470
|
+
if (!setChecked) {
|
|
1471
|
+
state.selectType == "radio" && table.clearRadioRow();
|
|
1472
|
+
state.isTree != 0 && state.selectType != "radio" && pubCheckChange([]);
|
|
1473
|
+
} else {
|
|
1474
|
+
state.selectType == "radio" && table.setRadioRow(row);
|
|
1475
|
+
state.isTree != 0 && state.selectType != "radio" && pubCheckChange(newRow);
|
|
1476
|
+
}
|
|
1477
|
+
state.selectType != "radio" && table.setCheckboxRow([row], setChecked);
|
|
1478
|
+
}
|
|
1479
|
+
if (state.isTree != 0) {
|
|
1480
|
+
emit("checkboxChange", {
|
|
1481
|
+
checked: setChecked,
|
|
1482
|
+
row,
|
|
1483
|
+
index: $rowIndex,
|
|
1484
|
+
records: checkedRow
|
|
1485
|
+
});
|
|
1486
|
+
setChecked && emit("handlerClickRow", row, $rowIndex);
|
|
1487
|
+
return;
|
|
1488
|
+
}
|
|
1489
|
+
setCheckedMehod(setChecked, row);
|
|
1490
|
+
if (setChecked || rowLen > 1 || !rowLen) {
|
|
1491
|
+
state.checkedRows = [row];
|
|
1492
|
+
}
|
|
1493
|
+
if (!setChecked && rowLen === 1) {
|
|
1494
|
+
state.checkedRows = [];
|
|
1495
|
+
}
|
|
1496
|
+
setCurrentCheckedLength();
|
|
1497
|
+
state.lastPageIndex = props.pageVO.pageIndex;
|
|
1498
|
+
emit("checkboxChange", {
|
|
1499
|
+
checked: setChecked,
|
|
1500
|
+
row,
|
|
1501
|
+
index: $rowIndex,
|
|
1502
|
+
records: table.getCheckboxRecords()
|
|
1503
|
+
});
|
|
1504
|
+
setChecked && emit("handlerClickRow", row, $rowIndex);
|
|
1505
|
+
};
|
|
1506
|
+
const addCheckedRows = (rows) => {
|
|
1507
|
+
removeCheckedDisabledRows(state);
|
|
1508
|
+
let checkedRows = state.checkedRows;
|
|
1509
|
+
let newCheckedRows = rows.filter((row) => {
|
|
1510
|
+
return !currentCheckedKeys.value.includes(row[props.primaryKey]);
|
|
1511
|
+
});
|
|
1512
|
+
checkedRows.push(...newCheckedRows);
|
|
1513
|
+
emit("selectionChangeLocal", {
|
|
1514
|
+
isAdd: true,
|
|
1515
|
+
isCheckedChange: true,
|
|
1516
|
+
newCheckedRows,
|
|
1517
|
+
checkedRows
|
|
1518
|
+
});
|
|
1519
|
+
};
|
|
1520
|
+
const treeTableSelectionChange = (records) => {
|
|
1521
|
+
if (state.isTree == 0) {
|
|
1522
|
+
emit("selectionChange", records);
|
|
1523
|
+
return false;
|
|
1524
|
+
}
|
|
1525
|
+
pubCheckChange(records);
|
|
1526
|
+
return true;
|
|
1527
|
+
};
|
|
1528
|
+
const selectionChange = ({
|
|
1529
|
+
checked,
|
|
1530
|
+
row,
|
|
1531
|
+
records,
|
|
1532
|
+
$rowIndex
|
|
1533
|
+
}) => {
|
|
1534
|
+
let table = xGrid.value;
|
|
1535
|
+
table.clearCurrentRow();
|
|
1536
|
+
state.isTriggerSelectionChange = true;
|
|
1537
|
+
setTimeout(() => {
|
|
1538
|
+
state.isTriggerSelectionChange = false;
|
|
1539
|
+
}, 0);
|
|
1540
|
+
emit("checkboxChange", {
|
|
1541
|
+
checked,
|
|
1542
|
+
row,
|
|
1543
|
+
index: $rowIndex,
|
|
1544
|
+
records
|
|
1545
|
+
});
|
|
1546
|
+
if (treeTableSelectionChange(records))
|
|
1547
|
+
return;
|
|
1548
|
+
if (checked) {
|
|
1549
|
+
addCheckedRows([row]);
|
|
1550
|
+
} else {
|
|
1551
|
+
removeCheckedRows([row], true);
|
|
1552
|
+
}
|
|
1553
|
+
setCurrentCheckedLength();
|
|
1554
|
+
};
|
|
1555
|
+
const selectionChangeAll = ({
|
|
1556
|
+
checked,
|
|
1557
|
+
records
|
|
1558
|
+
}) => {
|
|
1559
|
+
if (treeTableSelectionChange(records))
|
|
1560
|
+
return;
|
|
1561
|
+
if (checked) {
|
|
1562
|
+
addCheckedRows(records);
|
|
1563
|
+
} else {
|
|
1564
|
+
removeCheckedRows(props.data);
|
|
1565
|
+
}
|
|
1566
|
+
setCurrentCheckedLength();
|
|
1567
|
+
};
|
|
1568
|
+
const radioOnChange = (rowData = {}) => {
|
|
1569
|
+
let {
|
|
1570
|
+
row
|
|
1571
|
+
} = rowData;
|
|
1572
|
+
emit("selectionChange", [{
|
|
1573
|
+
...row
|
|
1574
|
+
}]);
|
|
1575
|
+
};
|
|
1576
|
+
const sortChange = ({
|
|
1577
|
+
property,
|
|
1578
|
+
order
|
|
1579
|
+
}) => {
|
|
1580
|
+
var _a;
|
|
1581
|
+
if (props.isInlineOperating)
|
|
1582
|
+
return false;
|
|
1583
|
+
Object.values(state.filterFields).forEach((item) => item.filterSort = null);
|
|
1584
|
+
const column = (_a = props.columnConfig.fieldList) == null ? void 0 : _a.find((item) => item.columnName === property);
|
|
1585
|
+
emit("sortChange", {
|
|
1586
|
+
prop: property,
|
|
1587
|
+
order,
|
|
1588
|
+
column
|
|
1589
|
+
});
|
|
1590
|
+
};
|
|
1095
1591
|
const showDrawer = () => {
|
|
1096
1592
|
const theads = xGrid.value.$el.childNodes[0].childNodes[1].childNodes[0].getElementsByClassName("mycolumn");
|
|
1097
1593
|
emit("setNestTableClickSetting", props.isNestTable);
|
|
1098
1594
|
emit("showDrawer", theads);
|
|
1099
1595
|
};
|
|
1596
|
+
const handleCellMouseenter = ({
|
|
1597
|
+
column,
|
|
1598
|
+
$event
|
|
1599
|
+
}) => {
|
|
1600
|
+
if (column.showOverflow === "title") {
|
|
1601
|
+
const target = $event == null ? void 0 : $event.currentTarget;
|
|
1602
|
+
const cls = target == null ? void 0 : target.className;
|
|
1603
|
+
const bodyCls = " vxe-body--column ";
|
|
1604
|
+
if (cls && ` ${cls} `.includes(bodyCls) && target && target.hasAttribute("title")) {
|
|
1605
|
+
const cellElem = target.querySelector(".vxe-cell");
|
|
1606
|
+
if (cellElem && cellElem.hasAttribute("title")) {
|
|
1607
|
+
cellElem.removeAttribute("title");
|
|
1608
|
+
}
|
|
1609
|
+
if (props.isInlineOperating) {
|
|
1610
|
+
if (target && target.hasAttribute("title")) {
|
|
1611
|
+
target.removeAttribute("title");
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
};
|
|
1100
1617
|
const getFooterTooltipTitle = (column) => {
|
|
1101
1618
|
let t = "";
|
|
1102
1619
|
if (XEUtils.has(props.sumData, column.property)) {
|
|
@@ -1793,6 +2310,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1793
2310
|
}
|
|
1794
2311
|
});
|
|
1795
2312
|
});
|
|
2313
|
+
const handleMenuClickEvent = (payload) => emit("menuClick", payload);
|
|
1796
2314
|
expose({
|
|
1797
2315
|
formatData,
|
|
1798
2316
|
xGrid,
|
|
@@ -1801,6 +2319,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1801
2319
|
handleFilterClearAll
|
|
1802
2320
|
});
|
|
1803
2321
|
return (_ctx, _cache) => {
|
|
2322
|
+
var _a;
|
|
1804
2323
|
return openBlock(), createElementBlock(Fragment, null, [state.anchorList.length ? (openBlock(), createBlock(unref(NTabs), {
|
|
1805
2324
|
key: 0,
|
|
1806
2325
|
type: "line",
|
|
@@ -1839,9 +2358,77 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1839
2358
|
"show-footer-overflow": "title",
|
|
1840
2359
|
"keep-source": "",
|
|
1841
2360
|
"auto-resize": "",
|
|
1842
|
-
height: props.height ? "auto" : void 0
|
|
2361
|
+
height: props.height ? "auto" : void 0,
|
|
2362
|
+
"cell-style": state.cellStyle
|
|
1843
2363
|
}, _ctx.$attrs, {
|
|
1844
|
-
"
|
|
2364
|
+
"mouse-config": {
|
|
2365
|
+
selected: ((_a = _ctx.columnConfig.keyboardConfig) == null ? void 0 : _a.isEdit) ? true : false
|
|
2366
|
+
},
|
|
2367
|
+
"tree-config": unref(treeConfig),
|
|
2368
|
+
"row-class-name": getRowClassName,
|
|
2369
|
+
"row-config": {
|
|
2370
|
+
...state.rowConfig,
|
|
2371
|
+
...unref(getAttr)("row-config")
|
|
2372
|
+
},
|
|
2373
|
+
"show-footer": _ctx.showFooter && !props.isInlineOperating,
|
|
2374
|
+
"footer-method": footerMethod,
|
|
2375
|
+
"sort-config": {
|
|
2376
|
+
trigger: "cell",
|
|
2377
|
+
remote: true,
|
|
2378
|
+
...unref(getAttr)("sort-config")
|
|
2379
|
+
},
|
|
2380
|
+
"span-method": spanMethod,
|
|
2381
|
+
"footer-span-method": footerRowspanMethod,
|
|
2382
|
+
"tooltip-config": {
|
|
2383
|
+
enterable: false,
|
|
2384
|
+
...unref(getAttr)("tooltip-config")
|
|
2385
|
+
},
|
|
2386
|
+
"checkbox-config": {
|
|
2387
|
+
checkField: "checked",
|
|
2388
|
+
labelField: "checked",
|
|
2389
|
+
checkMethod: unref(checkMethod),
|
|
2390
|
+
visibleMethod: unref(visibleMethod),
|
|
2391
|
+
trigger: "cell",
|
|
2392
|
+
reserve: true,
|
|
2393
|
+
highlight: true,
|
|
2394
|
+
...unref(getAttr)("checkbox-config")
|
|
2395
|
+
},
|
|
2396
|
+
"radio-config": {
|
|
2397
|
+
checkField: "checked",
|
|
2398
|
+
trigger: "cell",
|
|
2399
|
+
reserve: true,
|
|
2400
|
+
highlight: true,
|
|
2401
|
+
...unref(getAttr)("radio-config")
|
|
2402
|
+
},
|
|
2403
|
+
"scroll-y": {
|
|
2404
|
+
gt: 50,
|
|
2405
|
+
...unref(getAttr)("scroll-y")
|
|
2406
|
+
},
|
|
2407
|
+
"row-style": unref(getRowStyle),
|
|
2408
|
+
"edit-config": state.editConfig,
|
|
2409
|
+
"expand-config": {
|
|
2410
|
+
lazy: true,
|
|
2411
|
+
accordion: _ctx.columnConfig && _ctx.columnConfig.accordion,
|
|
2412
|
+
loadMethod: unref(loadExpandMethod),
|
|
2413
|
+
toggleMethod: unref(toggleExpandMethod),
|
|
2414
|
+
iconOpen: "iconfont icon-a-xitongtubiaozhediejian",
|
|
2415
|
+
iconClose: "iconfont icon-a-xitongtubiaotianjia",
|
|
2416
|
+
...unref(getAttr)("expand-config")
|
|
2417
|
+
},
|
|
2418
|
+
"keyboard-config": unref(keyboardConfig),
|
|
2419
|
+
"edit-rules": _ctx.columnConfig.editRules || {},
|
|
2420
|
+
"menu-config": _ctx.menuConfig,
|
|
2421
|
+
onCellDblclick: rowdblclick,
|
|
2422
|
+
onCellClick: handlerClickRow,
|
|
2423
|
+
onCheckboxChange: selectionChange,
|
|
2424
|
+
onCheckboxAll: selectionChangeAll,
|
|
2425
|
+
onRadioChange: radioOnChange,
|
|
2426
|
+
onSortChange: sortChange,
|
|
2427
|
+
onScroll: unref(scroll),
|
|
2428
|
+
onCellMouseenter: handleCellMouseenter,
|
|
2429
|
+
onKeydown: unref(keyDown),
|
|
2430
|
+
onMenuClick: handleMenuClickEvent,
|
|
2431
|
+
onResizableChange
|
|
1845
2432
|
}), {
|
|
1846
2433
|
empty: withCtx(() => [state.isShowEmpty ? renderSlot(_ctx.$slots, "empty", {
|
|
1847
2434
|
key: 0
|
|
@@ -1880,7 +2467,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1880
2467
|
}
|
|
1881
2468
|
})]),
|
|
1882
2469
|
_: 3
|
|
1883
|
-
}, 16, ["height", "edit-config"]), createCommentVNode(" `${refreshRow}\u6761\u66F4\u65B0` "), withDirectives(createElementVNode("div", {
|
|
2470
|
+
}, 16, ["height", "cell-style", "mouse-config", "tree-config", "row-config", "show-footer", "sort-config", "tooltip-config", "checkbox-config", "radio-config", "scroll-y", "row-style", "edit-config", "expand-config", "keyboard-config", "edit-rules", "menu-config", "onScroll", "onKeydown"]), createCommentVNode(" `${refreshRow}\u6761\u66F4\u65B0` "), withDirectives(createElementVNode("div", {
|
|
1884
2471
|
class: "refresh",
|
|
1885
2472
|
onClick: hanldeClickRefresh
|
|
1886
2473
|
}, [createVNode(unref(NIcon), {
|