|
@@ -102,8 +102,19 @@ const subtitle = ref("");
|
|
|
const handleClickTable = async ({ row, column, rowIndex }: any) => {
|
|
|
const $table = LjTableRef.value.element;
|
|
|
if ($table) {
|
|
|
- selectList.value = [row];
|
|
|
- $table.setRadioRow(row);
|
|
|
+ if (props.multipleLimit == 1) {
|
|
|
+ selectList.value = [row];
|
|
|
+ $table.setRadioRow(row);
|
|
|
+ } else {
|
|
|
+ let ifHas = selectList.value.find((item: any) => item[TABLE_KEY] == row[TABLE_KEY]);
|
|
|
+ if (ifHas) {
|
|
|
+ selectList.value = selectList.value.filter((item: any) => item[TABLE_KEY] != row[TABLE_KEY]);
|
|
|
+ $table.setCheckboxRow(row, false);
|
|
|
+ } else {
|
|
|
+ selectList.value.push(row);
|
|
|
+ $table.setCheckboxRow(row, true);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -113,10 +124,12 @@ const handleClickTable = async ({ row, column, rowIndex }: any) => {
|
|
|
const handleDBlClickTable = async ({ row, column, rowIndex }: any) => {
|
|
|
const $table = LjTableRef.value.element;
|
|
|
if ($table) {
|
|
|
- selectList.value = [row];
|
|
|
- $table.setRadioRow(row);
|
|
|
+ if (props.multipleLimit == 1) {
|
|
|
+ selectList.value = [row];
|
|
|
+ $table.setRadioRow(row);
|
|
|
|
|
|
- LjSelectorRef.value.funcSubmit();
|
|
|
+ LjSelectorRef.value.funcSubmit();
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|