adminforth 2.1.0-next.19 → 2.1.0-next.20
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.
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
</td>
|
|
85
85
|
</tr>
|
|
86
86
|
|
|
87
|
-
<tr @
|
|
87
|
+
<tr @mousedown="onClick($event,row)"
|
|
88
88
|
v-else v-for="(row, rowI) in rows" :key="`row_${row._primaryKeyValue}`"
|
|
89
89
|
ref="rowRefs"
|
|
90
90
|
class="bg-lightListTable dark:bg-darkListTable border-lightListBorder dark:border-gray-700 hover:bg-lightListTableRowHover dark:hover:bg-darkListTableRowHover"
|
|
@@ -457,48 +457,50 @@ function onSortButtonClick(event, field) {
|
|
|
457
457
|
|
|
458
458
|
const clickTarget = ref(null);
|
|
459
459
|
|
|
460
|
-
async function onClick(e,row) {
|
|
461
|
-
if(clickTarget.value === e.target) return;
|
|
460
|
+
async function onClick(e, row) {
|
|
461
|
+
if (clickTarget.value === e.target) return;
|
|
462
462
|
clickTarget.value = e.target;
|
|
463
463
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
464
464
|
if (window.getSelection().toString()) return;
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
name: 'resource-show',
|
|
478
|
-
params: {
|
|
479
|
-
resourceId: props.resource.resourceId,
|
|
480
|
-
primaryKey: row._primaryKeyValue,
|
|
481
|
-
},
|
|
482
|
-
}).href,
|
|
483
|
-
'_blank'
|
|
484
|
-
);
|
|
485
|
-
}
|
|
465
|
+
if (e.button === 2) {
|
|
466
|
+
return; // right click, do nothing
|
|
467
|
+
}
|
|
468
|
+
const openInNewTab =
|
|
469
|
+
e.ctrlKey ||
|
|
470
|
+
e.metaKey ||
|
|
471
|
+
e.button === 1 ||
|
|
472
|
+
(row._clickUrl?.includes('target=_blank'));
|
|
473
|
+
|
|
474
|
+
if (openInNewTab) {
|
|
475
|
+
if (row._clickUrl) {
|
|
476
|
+
window.open(row._clickUrl, '_blank');
|
|
486
477
|
} else {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
document.location.href = row._clickUrl;
|
|
490
|
-
} else {
|
|
491
|
-
router.push(row._clickUrl);
|
|
492
|
-
}
|
|
493
|
-
} else {
|
|
494
|
-
router.push({
|
|
478
|
+
window.open(
|
|
479
|
+
router.resolve({
|
|
495
480
|
name: 'resource-show',
|
|
496
481
|
params: {
|
|
497
482
|
resourceId: props.resource.resourceId,
|
|
498
483
|
primaryKey: row._primaryKeyValue,
|
|
499
484
|
},
|
|
500
|
-
})
|
|
485
|
+
}).href,
|
|
486
|
+
'_blank'
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
} else {
|
|
490
|
+
if (row._clickUrl) {
|
|
491
|
+
if (row._clickUrl.startsWith('http')) {
|
|
492
|
+
document.location.href = row._clickUrl;
|
|
493
|
+
} else {
|
|
494
|
+
router.push(row._clickUrl);
|
|
501
495
|
}
|
|
496
|
+
} else {
|
|
497
|
+
router.push({
|
|
498
|
+
name: 'resource-show',
|
|
499
|
+
params: {
|
|
500
|
+
resourceId: props.resource.resourceId,
|
|
501
|
+
primaryKey: row._primaryKeyValue,
|
|
502
|
+
},
|
|
503
|
+
});
|
|
502
504
|
}
|
|
503
505
|
}
|
|
504
506
|
}
|