@gx-design-vue/pro-table 0.1.14 → 0.1.16
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/ProTable.d.ts +2 -12
- package/dist/hooks/useRowSelection.d.ts +1 -0
- package/dist/pro-table.es.js +16 -5
- package/dist/pro-table.umd.js +11 -11
- package/dist/types/TableTypings.d.ts +1 -0
- package/package.json +1 -1
package/dist/ProTable.d.ts
CHANGED
|
@@ -128,12 +128,7 @@ declare const GProTable: import("vue").DefineComponent<{
|
|
|
128
128
|
columnEmptyText: {
|
|
129
129
|
type: import("vue").PropType<import("./types/TableTypings").ProFieldEmptyText | undefined>;
|
|
130
130
|
default: boolean;
|
|
131
|
-
};
|
|
132
|
-
* @Author gx12358
|
|
133
|
-
* @DateTime 2022/1/21
|
|
134
|
-
* @lastTime 2022/1/21
|
|
135
|
-
* @description Tabel-datasource hooks 方法
|
|
136
|
-
*/
|
|
131
|
+
};
|
|
137
132
|
onReset: import("vue").PropType<((params?: Partial<Record<string, any>> | undefined) => any) | undefined>;
|
|
138
133
|
onReload: import("vue").PropType<((params?: Partial<Record<string, any>> | undefined) => any) | undefined>;
|
|
139
134
|
onSubmit: import("vue").PropType<((params?: Partial<Record<string, any>> | undefined) => any) | undefined>;
|
|
@@ -488,12 +483,7 @@ declare const GProTable: import("vue").DefineComponent<{
|
|
|
488
483
|
columnEmptyText: {
|
|
489
484
|
type: import("vue").PropType<import("./types/TableTypings").ProFieldEmptyText | undefined>;
|
|
490
485
|
default: boolean;
|
|
491
|
-
};
|
|
492
|
-
* @Author gx12358
|
|
493
|
-
* @DateTime 2022/1/21
|
|
494
|
-
* @lastTime 2022/1/21
|
|
495
|
-
* @description Tabel-datasource hooks 方法
|
|
496
|
-
*/
|
|
486
|
+
};
|
|
497
487
|
onReset: import("vue").PropType<((params?: Partial<Record<string, any>> | undefined) => any) | undefined>;
|
|
498
488
|
onReload: import("vue").PropType<((params?: Partial<Record<string, any>> | undefined) => any) | undefined>;
|
|
499
489
|
onSubmit: import("vue").PropType<((params?: Partial<Record<string, any>> | undefined) => any) | undefined>;
|
|
@@ -8,5 +8,6 @@ export declare function useRowSelection(rowKey: Ref<ProTableProps['rowKey']>, ro
|
|
|
8
8
|
selectAllRowKey: (selected: any[], selectedRows: any[], changeRows: any[]) => void;
|
|
9
9
|
removeRowKeys: (keyList: (string | number)[]) => void;
|
|
10
10
|
changeRowKey: () => void;
|
|
11
|
+
clearAllRowKeys: () => void;
|
|
11
12
|
syncSelectedRows: (dataList: any[]) => void;
|
|
12
13
|
};
|
package/dist/pro-table.es.js
CHANGED
|
@@ -27783,9 +27783,10 @@ function useRowSelection(rowKey, rowSelection) {
|
|
|
27783
27783
|
const selectRowKey = (record, selected) => {
|
|
27784
27784
|
if (rowKey.value) {
|
|
27785
27785
|
if (selected) {
|
|
27786
|
-
if (record == null ? void 0 : record[rowKey.value]) {
|
|
27786
|
+
if ((record == null ? void 0 : record[rowKey.value]) && !selectedKey.value.includes(record[rowKey.value])) {
|
|
27787
27787
|
selectedKey.value.push(record[rowKey.value]);
|
|
27788
|
-
selectedItem.value.
|
|
27788
|
+
if (!selectedItem.value.map((item) => item[rowKey.value]).includes(record[rowKey.value]))
|
|
27789
|
+
selectedItem.value.push(record);
|
|
27789
27790
|
}
|
|
27790
27791
|
} else {
|
|
27791
27792
|
selectedKey.value = selectedKey.value.filter((item) => item !== record[rowKey.value]);
|
|
@@ -27804,7 +27805,8 @@ function useRowSelection(rowKey, rowSelection) {
|
|
|
27804
27805
|
if (selectedKey.value.every((el) => el !== (item == null ? void 0 : item[rowKey.value]))) {
|
|
27805
27806
|
if (item == null ? void 0 : item[rowKey.value]) {
|
|
27806
27807
|
selectedKey.value.push(item[rowKey.value]);
|
|
27807
|
-
selectedItem.value.
|
|
27808
|
+
if (!selectedItem.value.map((el) => el[rowKey.value]).includes(item[rowKey.value]))
|
|
27809
|
+
selectedItem.value.push(item);
|
|
27808
27810
|
}
|
|
27809
27811
|
}
|
|
27810
27812
|
return item;
|
|
@@ -27832,12 +27834,18 @@ function useRowSelection(rowKey, rowSelection) {
|
|
|
27832
27834
|
const notIncludes = selectedKey.value.filter((item) => !itemsKeys.includes(item));
|
|
27833
27835
|
dataList.forEach((item) => {
|
|
27834
27836
|
if (notIncludes.includes(item[rowKey.value])) {
|
|
27835
|
-
selectedItem.value.
|
|
27837
|
+
if (!selectedItem.value.map((el) => el[rowKey.value]).includes(item[rowKey.value]))
|
|
27838
|
+
selectedItem.value.push(cloneDeep(item));
|
|
27836
27839
|
}
|
|
27837
27840
|
});
|
|
27838
27841
|
}
|
|
27839
27842
|
}
|
|
27840
27843
|
};
|
|
27844
|
+
const clearAllRowKeys = () => {
|
|
27845
|
+
selectedKey.value = [];
|
|
27846
|
+
selectedItem.value = [];
|
|
27847
|
+
changeRowKey();
|
|
27848
|
+
};
|
|
27841
27849
|
return {
|
|
27842
27850
|
selectedKey,
|
|
27843
27851
|
selectedItem,
|
|
@@ -27845,6 +27853,7 @@ function useRowSelection(rowKey, rowSelection) {
|
|
|
27845
27853
|
selectAllRowKey,
|
|
27846
27854
|
removeRowKeys,
|
|
27847
27855
|
changeRowKey,
|
|
27856
|
+
clearAllRowKeys,
|
|
27848
27857
|
syncSelectedRows
|
|
27849
27858
|
};
|
|
27850
27859
|
}
|
|
@@ -29749,6 +29758,7 @@ const GProTable = defineComponent({
|
|
|
29749
29758
|
selectRowKey,
|
|
29750
29759
|
selectAllRowKey,
|
|
29751
29760
|
syncSelectedRows,
|
|
29761
|
+
clearAllRowKeys,
|
|
29752
29762
|
removeRowKeys
|
|
29753
29763
|
} = useRowSelection(toRef(props2, "rowKey"), toRef(props2, "rowSelection"));
|
|
29754
29764
|
const configFetchData = useConfigFetchData(props2);
|
|
@@ -29857,7 +29867,8 @@ const GProTable = defineComponent({
|
|
|
29857
29867
|
pageParams: getPaginationInfo.value,
|
|
29858
29868
|
rowsSelection: {
|
|
29859
29869
|
keys: selectedKey.value,
|
|
29860
|
-
items: selectedItem.value
|
|
29870
|
+
items: selectedItem.value,
|
|
29871
|
+
clear: () => clearAllRowKeys()
|
|
29861
29872
|
},
|
|
29862
29873
|
getLoadingStatus: getLoading.value || false,
|
|
29863
29874
|
reload,
|