evui 3.4.73 → 3.4.75
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/dist/evui.common.js +134 -133
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +134 -133
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/treeGrid/TreeGrid.vue +6 -7
- package/src/components/treeGrid/uses.js +69 -60
package/package.json
CHANGED
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
<slot name="sortIcon" />
|
|
103
103
|
</span>
|
|
104
104
|
<span
|
|
105
|
-
v-if="
|
|
105
|
+
v-if="sortField === column.field"
|
|
106
106
|
:class="sortIconClass(column)"
|
|
107
107
|
:style="{
|
|
108
108
|
height: `${rowHeight}px`,
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
}"
|
|
124
124
|
/>
|
|
125
125
|
<grid-sort-button
|
|
126
|
-
v-if="
|
|
126
|
+
v-if="sortField === column.field"
|
|
127
127
|
:class="sortIconClass(column)"
|
|
128
128
|
:icon="sortOrder"
|
|
129
129
|
:style="{
|
|
@@ -636,6 +636,7 @@ export default {
|
|
|
636
636
|
|
|
637
637
|
const {
|
|
638
638
|
onSort,
|
|
639
|
+
setSortInfo,
|
|
639
640
|
} = sortEvent({ sortInfo, stores, updatePagingInfo, setTreeNodeStore, onResize });
|
|
640
641
|
|
|
641
642
|
const {
|
|
@@ -727,9 +728,10 @@ export default {
|
|
|
727
728
|
|
|
728
729
|
watch(
|
|
729
730
|
() => props.columns,
|
|
730
|
-
() => {
|
|
731
|
+
(newColumns) => {
|
|
731
732
|
initColumnSettingInfo();
|
|
732
|
-
|
|
733
|
+
setSortInfo(newColumns, false);
|
|
734
|
+
}, { deep: true, immediate: true },
|
|
733
735
|
);
|
|
734
736
|
watch(
|
|
735
737
|
() => props.checked,
|
|
@@ -925,8 +927,6 @@ export default {
|
|
|
925
927
|
},
|
|
926
928
|
);
|
|
927
929
|
|
|
928
|
-
const isSortedColumn = column => sortInfo.sortField === column.field;
|
|
929
|
-
|
|
930
930
|
const sortIconClass = () => ({
|
|
931
931
|
'column-sort__icon': true,
|
|
932
932
|
'column-sort__icon--asc': sortInfo.sortOrder === 'asc',
|
|
@@ -1039,7 +1039,6 @@ export default {
|
|
|
1039
1039
|
onApplyColumn,
|
|
1040
1040
|
onColumnContextMenu,
|
|
1041
1041
|
onSort,
|
|
1042
|
-
isSortedColumn,
|
|
1043
1042
|
sortIconClass,
|
|
1044
1043
|
};
|
|
1045
1044
|
},
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getCurrentInstance, nextTick } from 'vue';
|
|
2
2
|
import { numberWithComma } from '@/common/utils';
|
|
3
|
-
import { cloneDeep } from 'lodash-es';
|
|
4
3
|
|
|
5
4
|
export const commonFunctions = (params) => {
|
|
6
5
|
const { props } = getCurrentInstance();
|
|
@@ -995,7 +994,7 @@ export const pagingEvent = (params) => {
|
|
|
995
994
|
return { getPagingData, updatePagingInfo, changePage };
|
|
996
995
|
};
|
|
997
996
|
|
|
998
|
-
export const sortEvent = ({ sortInfo, stores
|
|
997
|
+
export const sortEvent = ({ sortInfo, stores }) => {
|
|
999
998
|
const { emit } = getCurrentInstance();
|
|
1000
999
|
|
|
1001
1000
|
const getDefaultSortType = (includeInit = true) => (includeInit ? ['asc', 'desc', 'init'] : ['asc', 'desc']);
|
|
@@ -1027,16 +1026,19 @@ export const sortEvent = ({ sortInfo, stores, updatePagingInfo, onResize }) => {
|
|
|
1027
1026
|
|
|
1028
1027
|
const order = new OrderQueue();
|
|
1029
1028
|
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1029
|
+
|
|
1030
|
+
const setSortInfo = (columns, emitTriggered = true) => {
|
|
1031
|
+
const sortByColumn = columns?.find(col => col?.sortOption?.sortType && col.sortOption.sortType !== 'init');
|
|
1032
|
+
const { sortType } = sortByColumn?.sortOption || {};
|
|
1033
|
+
|
|
1034
|
+
sortInfo.sortColumn = sortByColumn;
|
|
1035
|
+
sortInfo.sortField = sortByColumn?.field;
|
|
1035
1036
|
sortInfo.isSorting = !!(sortType);
|
|
1037
|
+
sortInfo.sortOrder = sortType;
|
|
1036
1038
|
|
|
1037
|
-
|
|
1038
|
-
setSortOptionToOrderedColumns(column, sortType);
|
|
1039
|
+
setSortOptionToOrderedColumns(sortByColumn, sortType);
|
|
1039
1040
|
|
|
1041
|
+
if (emitTriggered) {
|
|
1040
1042
|
emit('change-column-info', {
|
|
1041
1043
|
type: 'sort',
|
|
1042
1044
|
columns: getUpdatedColumns(stores),
|
|
@@ -1044,53 +1046,56 @@ export const sortEvent = ({ sortInfo, stores, updatePagingInfo, onResize }) => {
|
|
|
1044
1046
|
}
|
|
1045
1047
|
};
|
|
1046
1048
|
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
};
|
|
1049
|
+
/* 24.11.09 Tree Grid Sort 로직 임시 제거 */
|
|
1050
|
+
// const compareValues = (nodeA, nodeB) => {
|
|
1051
|
+
// const valueA = nodeA.data[sortInfo.sortField];
|
|
1052
|
+
// const valueB = nodeB.data[sortInfo.sortField];
|
|
1053
|
+
//
|
|
1054
|
+
// if (valueA === valueB) return 0;
|
|
1055
|
+
//
|
|
1056
|
+
// const isAscending = sortInfo.sortOrder === 'asc';
|
|
1057
|
+
//
|
|
1058
|
+
// if (isAscending) return valueA > valueB ? 1 : -1;
|
|
1059
|
+
//
|
|
1060
|
+
// return valueA < valueB ? 1 : -1;
|
|
1061
|
+
// };
|
|
1062
|
+
//
|
|
1063
|
+
// const sortTree = (nodes, depth = 0) => {
|
|
1064
|
+
// const groupedNodes = {};
|
|
1065
|
+
//
|
|
1066
|
+
// nodes.forEach((node) => {
|
|
1067
|
+
// const nodeDepth = node.level || depth;
|
|
1068
|
+
// if (!groupedNodes[nodeDepth]) {
|
|
1069
|
+
// groupedNodes[nodeDepth] = [];
|
|
1070
|
+
// }
|
|
1071
|
+
// groupedNodes[nodeDepth].push(node);
|
|
1072
|
+
// });
|
|
1073
|
+
//
|
|
1074
|
+
// Object.keys(groupedNodes).forEach((key) => {
|
|
1075
|
+
// groupedNodes[key].sort(compareValues);
|
|
1076
|
+
// });
|
|
1077
|
+
//
|
|
1078
|
+
// nodes.length = 0;
|
|
1079
|
+
// Object.values(groupedNodes).forEach((group) => {
|
|
1080
|
+
// group.forEach((node) => {
|
|
1081
|
+
// nodes.push(node);
|
|
1082
|
+
// if (node.hasChild) {
|
|
1083
|
+
// sortTree(node.children, node.level + 1);
|
|
1084
|
+
// }
|
|
1085
|
+
// });
|
|
1086
|
+
// });
|
|
1087
|
+
// };
|
|
1085
1088
|
|
|
1086
1089
|
const onSort = (column, sortOrder) => {
|
|
1087
|
-
const
|
|
1088
|
-
if (
|
|
1090
|
+
const isSortableColumn = column.sortable === undefined ? true : column.sortable;
|
|
1091
|
+
if (isSortableColumn) {
|
|
1089
1092
|
sortInfo.sortColumn = column;
|
|
1093
|
+
|
|
1090
1094
|
if (sortInfo.sortField !== column?.field) {
|
|
1091
1095
|
order.orders = getDefaultSortType();
|
|
1092
1096
|
sortInfo.sortField = column?.field;
|
|
1093
1097
|
}
|
|
1098
|
+
|
|
1094
1099
|
if (sortOrder) {
|
|
1095
1100
|
order.orders = getDefaultSortType();
|
|
1096
1101
|
if (sortOrder === 'desc') {
|
|
@@ -1098,6 +1103,7 @@ export const sortEvent = ({ sortInfo, stores, updatePagingInfo, onResize }) => {
|
|
|
1098
1103
|
order.enqueue(sortInfo.sortOrder);
|
|
1099
1104
|
}
|
|
1100
1105
|
}
|
|
1106
|
+
|
|
1101
1107
|
sortInfo.sortOrder = order.dequeue();
|
|
1102
1108
|
order.enqueue(sortInfo.sortOrder);
|
|
1103
1109
|
|
|
@@ -1105,6 +1111,7 @@ export const sortEvent = ({ sortInfo, stores, updatePagingInfo, onResize }) => {
|
|
|
1105
1111
|
setSortOptionToOrderedColumns(column, sortInfo.sortOrder);
|
|
1106
1112
|
|
|
1107
1113
|
const updatedColumInfo = getUpdatedColumns(stores);
|
|
1114
|
+
|
|
1108
1115
|
emit('sort-column', {
|
|
1109
1116
|
field: sortInfo.sortField,
|
|
1110
1117
|
order: sortInfo.sortOrder,
|
|
@@ -1117,18 +1124,20 @@ export const sortEvent = ({ sortInfo, stores, updatePagingInfo, onResize }) => {
|
|
|
1117
1124
|
columns: updatedColumInfo,
|
|
1118
1125
|
});
|
|
1119
1126
|
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1127
|
+
/* 24.11.09 Tree Grid Sort 로직 임시 제거 */
|
|
1128
|
+
// if (sortInfo.sortOrder === 'init') {
|
|
1129
|
+
// stores.treeStore = cloneDeep(stores.originStore);
|
|
1130
|
+
// stores.viewStore = stores.treeStore;
|
|
1131
|
+
// onResize();
|
|
1132
|
+
// sortInfo.isSorting = false;
|
|
1133
|
+
// } else {
|
|
1134
|
+
// sortTree(stores.treeRows);
|
|
1135
|
+
// sortInfo.isSorting = true;
|
|
1136
|
+
// }
|
|
1137
|
+
//
|
|
1138
|
+
// updatePagingInfo({ onSort: true });
|
|
1131
1139
|
}
|
|
1132
1140
|
};
|
|
1141
|
+
|
|
1133
1142
|
return { onSort, setSortInfo };
|
|
1134
1143
|
};
|