@mythpe/quasar-ui-qui 0.1.15 → 0.1.17
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/package.json
CHANGED
|
@@ -390,9 +390,9 @@ const hasFilterDialog = computed<boolean>(() => !!slots.filter)
|
|
|
390
390
|
|
|
391
391
|
const isUpdateMode = ref<boolean>(!1)
|
|
392
392
|
const formMode = computed<'update' | 'store'>(() => isUpdateMode.value ? 'update' : 'store')
|
|
393
|
-
const isSingleSelectedItem = computed<boolean>(() =>
|
|
394
|
-
const firstSelectedItem = computed(() =>
|
|
395
|
-
const hasSelectedItem = computed<boolean>(() =>
|
|
393
|
+
const isSingleSelectedItem = computed<boolean>(() => selected.value.length === 1)
|
|
394
|
+
const firstSelectedItem = computed(() => selected.value[0] as MDtItem)
|
|
395
|
+
const hasSelectedItem = computed<boolean>(() => selected.value.length > 0)
|
|
396
396
|
|
|
397
397
|
/* Titles */
|
|
398
398
|
const getShowTitle = computed(() => {
|
|
@@ -403,8 +403,9 @@ const getShowTitle = computed(() => {
|
|
|
403
403
|
return __('show_details')
|
|
404
404
|
})
|
|
405
405
|
const getFormTitle = computed(() => {
|
|
406
|
-
const name = serviceName.value && typeof serviceName.value !== 'function' ? __(`choice.${pascalCase(pluralize(
|
|
407
|
-
|
|
406
|
+
const name = serviceName.value && typeof serviceName.value !== 'function' ? __(`choice.${pascalCase(pluralize(
|
|
407
|
+
serviceName.value.split(
|
|
408
|
+
'/').pop()))}`, 1) : ''
|
|
408
409
|
return __(`replace.${formMode.value}`, { name })
|
|
409
410
|
})
|
|
410
411
|
const isGrid = computed(() => {
|
|
@@ -426,8 +427,8 @@ const getMythApiServicesSchema = (): MDtMythApiServicesSchema => {
|
|
|
426
427
|
}
|
|
427
428
|
return c
|
|
428
429
|
}
|
|
429
|
-
const updateSelectedItems = (
|
|
430
|
-
|
|
430
|
+
const updateSelectedItems = (items: MDtItem[]) => {
|
|
431
|
+
selected.value = items as any
|
|
431
432
|
}
|
|
432
433
|
const onScroll = ({ index, to }: any) => {
|
|
433
434
|
if (index && to && index === to) {
|
|
@@ -438,10 +439,10 @@ const loadMore = () => {
|
|
|
438
439
|
nextTick(() => {
|
|
439
440
|
fetchDatatableItems({
|
|
440
441
|
pagination: {
|
|
441
|
-
...
|
|
442
|
-
page: (
|
|
442
|
+
...pagination.value,
|
|
443
|
+
page: (pagination.value.page ?? 0) + 1
|
|
443
444
|
},
|
|
444
|
-
filter:
|
|
445
|
+
filter: search.value
|
|
445
446
|
})
|
|
446
447
|
})
|
|
447
448
|
}
|
|
@@ -456,7 +457,7 @@ const refreshNoUpdate = (done?: () => void) => {
|
|
|
456
457
|
nextTick(() => {
|
|
457
458
|
fetchDatatableItems({
|
|
458
459
|
pagination: pagination.value,
|
|
459
|
-
filter:
|
|
460
|
+
filter: search.value
|
|
460
461
|
})
|
|
461
462
|
if (done) {
|
|
462
463
|
done()
|
|
@@ -505,8 +506,8 @@ const getDatatableParams = ({
|
|
|
505
506
|
if (filter) {
|
|
506
507
|
params.search = filter
|
|
507
508
|
}
|
|
508
|
-
if (Object.keys(
|
|
509
|
-
const TempFilter = { ...
|
|
509
|
+
if (Object.keys(filterForm.value).length > 0) {
|
|
510
|
+
const TempFilter = { ...filterForm.value } as any
|
|
510
511
|
for (const fKey in TempFilter) {
|
|
511
512
|
if (lodash.isArray(TempFilter[fKey])) {
|
|
512
513
|
TempFilter[fKey] = TempFilter[fKey].map((elm: any) => {
|
|
@@ -525,8 +526,8 @@ const getDatatableParams = ({
|
|
|
525
526
|
}
|
|
526
527
|
}
|
|
527
528
|
}
|
|
528
|
-
// console.log(JSON.stringify(
|
|
529
|
-
// params.filter =
|
|
529
|
+
// console.log(JSON.stringify(filterForm.value))
|
|
530
|
+
// params.filter = filterForm.value
|
|
530
531
|
// console.log(TempFilter)
|
|
531
532
|
params.filter = TempFilter
|
|
532
533
|
}
|
|
@@ -546,12 +547,12 @@ const getDatatableParams = ({
|
|
|
546
547
|
return { ...params, ...merge }
|
|
547
548
|
}
|
|
548
549
|
const fetchDatatableItems = (opts: FetchRowsArgs = {}) => {
|
|
549
|
-
if (props.endReach &&
|
|
550
|
+
if (props.endReach && meta.value.last_page && pagination.value.page >= meta.value.last_page) {
|
|
550
551
|
return
|
|
551
552
|
}
|
|
552
|
-
if (
|
|
553
|
-
|
|
554
|
-
|
|
553
|
+
if (loading.value || !serviceName.value) return
|
|
554
|
+
loading.value = !0
|
|
555
|
+
selected.value = []
|
|
555
556
|
nextTick(() => {
|
|
556
557
|
const params = getDatatableParams(opts)
|
|
557
558
|
const requestWith = getRequestWith('withIndex')
|
|
@@ -589,7 +590,7 @@ const fetchDatatableItems = (opts: FetchRowsArgs = {}) => {
|
|
|
589
590
|
}
|
|
590
591
|
})
|
|
591
592
|
.finally(() => {
|
|
592
|
-
|
|
593
|
+
loading.value = !1
|
|
593
594
|
})
|
|
594
595
|
})
|
|
595
596
|
}
|
|
@@ -602,16 +603,16 @@ const exportData = (type: MDtExportOptions) => {
|
|
|
602
603
|
const toBLob = exportToBlob.value === !0 || exportToBlob.value === type
|
|
603
604
|
const headerItems = getHeaders.value.filter(e => e?.field !== props.controlKey && visibleHeaders.value.indexOf(e.name) !== -1)
|
|
604
605
|
const data = getDatatableParams({
|
|
605
|
-
pagination:
|
|
606
|
-
filter:
|
|
606
|
+
pagination: pagination.value,
|
|
607
|
+
filter: search.value
|
|
607
608
|
}, {
|
|
608
609
|
indexType: type,
|
|
609
610
|
fdt: 'e',
|
|
610
611
|
toUrl: toBLob === !0 ? !1 : exportToBlob.value !== type,
|
|
611
612
|
headerItems
|
|
612
613
|
})
|
|
613
|
-
if (
|
|
614
|
-
data.ids =
|
|
614
|
+
if (selected.value.length > 0) {
|
|
615
|
+
data.ids = selected.value.map((e: any) => e.id)
|
|
615
616
|
}
|
|
616
617
|
// console.log(3)
|
|
617
618
|
const config: AxiosRequestConfig = {}
|
|
@@ -644,7 +645,7 @@ const exportData = (type: MDtExportOptions) => {
|
|
|
644
645
|
loading.value = !1
|
|
645
646
|
})
|
|
646
647
|
}
|
|
647
|
-
if (!
|
|
648
|
+
if (!selected.value.length) {
|
|
648
649
|
confirmMessage(__('messages.export_all')).onOk(() => ex())
|
|
649
650
|
} else {
|
|
650
651
|
ex()
|
|
@@ -659,17 +660,17 @@ const openDialogTimeout = 100
|
|
|
659
660
|
const openFilterDialog = () => {
|
|
660
661
|
resetDialogForm({ values: {}, errors: {} }, { force: !0 })
|
|
661
662
|
nextTick(() => {
|
|
662
|
-
tempFilterForm.value = { ...
|
|
663
|
+
tempFilterForm.value = { ...filterForm.value }
|
|
663
664
|
dialogs.filter = !0
|
|
664
665
|
})
|
|
665
666
|
}
|
|
666
667
|
const saveFilterDialog = () => {
|
|
667
668
|
dialogs.filter = !1
|
|
668
|
-
nextTick(() => (filterForm.value = { ...
|
|
669
|
+
nextTick(() => (filterForm.value = { ...tempFilterForm.value }))
|
|
669
670
|
}
|
|
670
671
|
const closeFilterDialog = () => {
|
|
671
672
|
dialogs.filter = !1
|
|
672
|
-
tempFilterForm.value = { ...
|
|
673
|
+
tempFilterForm.value = { ...filterForm.value }
|
|
673
674
|
}
|
|
674
675
|
const onRemoveFilter = (key: string | number) => {
|
|
675
676
|
const filter = filterForm.value
|
|
@@ -683,7 +684,7 @@ const onRemoveFilter = (key: string | number) => {
|
|
|
683
684
|
}
|
|
684
685
|
const updateFilterOptions = (data: Record<string, any>) => {
|
|
685
686
|
filterForm.value = {
|
|
686
|
-
...
|
|
687
|
+
...filterForm.value,
|
|
687
688
|
...data
|
|
688
689
|
}
|
|
689
690
|
}
|
|
@@ -844,6 +845,9 @@ const updateDatatableItem = (i: MDtItem, index?: MDtItemIndex) => {
|
|
|
844
845
|
getRows.value[findIndex] = item
|
|
845
846
|
}
|
|
846
847
|
}
|
|
848
|
+
if (selected.value.length === 1) {
|
|
849
|
+
selected.value = [item]
|
|
850
|
+
}
|
|
847
851
|
}
|
|
848
852
|
}
|
|
849
853
|
const removeDtItem = (i: MDtItem | number) => {
|
|
@@ -897,13 +901,18 @@ const onSuccess: SubmissionHandler = async (form) => {
|
|
|
897
901
|
requestWith: getRequestWith(isUpdateMode.value ? 'withUpdate' : 'withStore') || undefined
|
|
898
902
|
}
|
|
899
903
|
}
|
|
900
|
-
const method = async () => isUpdateMode.value ? await apiServices.update(dialogs.item?.id || '',
|
|
904
|
+
const method = async () => isUpdateMode.value ? await apiServices.update(dialogs.item?.id || '',
|
|
905
|
+
form,
|
|
906
|
+
_conf) : await apiServices.store(form, _conf)
|
|
901
907
|
try {
|
|
902
908
|
const { _data, _message, _success }: any = await method()
|
|
903
909
|
_message && alertSuccess(_message)
|
|
904
910
|
if (_success) {
|
|
905
911
|
if (isUpdateMode.value) {
|
|
906
|
-
|
|
912
|
+
if (_data) {
|
|
913
|
+
updateDatatableItem(_data, dialogs.index)
|
|
914
|
+
updateSelectedItems([_data])
|
|
915
|
+
}
|
|
907
916
|
} else {
|
|
908
917
|
setTimeout(() => refresh(), openDialogTimeout)
|
|
909
918
|
}
|
|
@@ -937,7 +946,7 @@ const onDeleteItem = (i: MDtItem, index: number) => {
|
|
|
937
946
|
if (loading.value || !item.value?.id) {
|
|
938
947
|
return
|
|
939
948
|
}
|
|
940
|
-
|
|
949
|
+
hasAction.value = !0
|
|
941
950
|
confirmMessage(__('messages.confirm_delete')).onOk(async () => {
|
|
942
951
|
loading.value = !0
|
|
943
952
|
try {
|
|
@@ -946,8 +955,8 @@ const onDeleteItem = (i: MDtItem, index: number) => {
|
|
|
946
955
|
_message && alertSuccess(_message)
|
|
947
956
|
}
|
|
948
957
|
if (_success) {
|
|
949
|
-
if (
|
|
950
|
-
--
|
|
958
|
+
if (pagination.value.rowsNumber !== undefined) {
|
|
959
|
+
--pagination.value.rowsNumber
|
|
951
960
|
selected.value = []
|
|
952
961
|
}
|
|
953
962
|
removeDtItem(index)
|
|
@@ -958,30 +967,30 @@ const onDeleteItem = (i: MDtItem, index: number) => {
|
|
|
958
967
|
loading.value = !1
|
|
959
968
|
}
|
|
960
969
|
}).onDismiss(() => {
|
|
961
|
-
|
|
970
|
+
hasAction.value = !1
|
|
962
971
|
})
|
|
963
972
|
}
|
|
964
973
|
const deleteSelectionItem = () => {
|
|
965
|
-
if (!
|
|
966
|
-
if (loading.value || !
|
|
974
|
+
if (!selected.value.length) return
|
|
975
|
+
if (loading.value || !selected.value.length) {
|
|
967
976
|
return
|
|
968
977
|
}
|
|
969
|
-
if (
|
|
970
|
-
const dtItem =
|
|
978
|
+
if (selected.value.length === 1) {
|
|
979
|
+
const dtItem = selected.value[0] as MDtItem
|
|
971
980
|
const index = getRows.value.findIndex((e: any) => parseInt(e.id) === parseInt(dtItem?.id?.toString() || ''))
|
|
972
981
|
return onDeleteItem(dtItem, index)
|
|
973
982
|
}
|
|
974
983
|
if (!props.multiDestroy) {
|
|
975
984
|
return
|
|
976
985
|
}
|
|
977
|
-
|
|
986
|
+
hasAction.value = !0
|
|
978
987
|
confirmMessage(__('messages.confirm_delete')).onOk(async () => {
|
|
979
988
|
loading.value = !0
|
|
980
989
|
try {
|
|
981
990
|
const {
|
|
982
991
|
_message,
|
|
983
992
|
_success
|
|
984
|
-
} = await getMythApiServicesSchema().destroyAll(
|
|
993
|
+
} = await getMythApiServicesSchema().destroyAll(selected.value.map((e: MDtItem) => e.id))
|
|
985
994
|
if (!hideAutoMessage.value && _success && _message) {
|
|
986
995
|
_message && alertSuccess(_message)
|
|
987
996
|
}
|
|
@@ -996,7 +1005,7 @@ const deleteSelectionItem = () => {
|
|
|
996
1005
|
selected.value = []
|
|
997
1006
|
}
|
|
998
1007
|
}).onDismiss(() => {
|
|
999
|
-
|
|
1008
|
+
hasAction.value = !1
|
|
1000
1009
|
})
|
|
1001
1010
|
}
|
|
1002
1011
|
const logoutDatatable = () => {
|
|
@@ -1029,7 +1038,6 @@ const onRowContextmenu = (e: MouseEvent | Event, row: MDtItem, index: number | u
|
|
|
1029
1038
|
contextmenu.value = !0
|
|
1030
1039
|
}
|
|
1031
1040
|
}
|
|
1032
|
-
const contextmenuItemsProp = computed(() => props.contextItems)
|
|
1033
1041
|
const contextmenuItems = computed<any>(() => ([
|
|
1034
1042
|
{
|
|
1035
1043
|
name: 'show',
|
|
@@ -1069,7 +1077,7 @@ const contextmenuItems = computed<any>(() => ([
|
|
|
1069
1077
|
},
|
|
1070
1078
|
order: 400
|
|
1071
1079
|
},
|
|
1072
|
-
...(
|
|
1080
|
+
...(props.contextItems || [])
|
|
1073
1081
|
].sort((a, b) => (a.order ?? 0) - (b.order ?? 0))))
|
|
1074
1082
|
const onCloneItem = (item: MDtItem) => {
|
|
1075
1083
|
item = toValue(item)
|
|
@@ -1129,7 +1137,7 @@ watch(loading, v => {
|
|
|
1129
1137
|
$q.loading.hide()
|
|
1130
1138
|
}
|
|
1131
1139
|
}
|
|
1132
|
-
|
|
1140
|
+
hasAction.value = v
|
|
1133
1141
|
})
|
|
1134
1142
|
watch([filterForm, () => $q.lang.nativeName], () => refreshNoUpdate(), { deep: !0 })
|
|
1135
1143
|
watch(formDialogModel, (v) => {
|
|
@@ -1219,6 +1227,20 @@ const getSlots = computed(() => {
|
|
|
1219
1227
|
const keys = Object.keys(componentSlots || {})
|
|
1220
1228
|
return keys.filter(e => !skipSlots.includes(e))
|
|
1221
1229
|
})
|
|
1230
|
+
// contextBtn.multiClick && selected.value.length > 1 ?
|
|
1231
|
+
// contextBtn.multiClick(selected.value) : (
|
|
1232
|
+
// contextBtn.click ? contextBtn.click(selected.value[0],0) : undefined
|
|
1233
|
+
// )
|
|
1234
|
+
const onClickTopMenu = (item: any) => {
|
|
1235
|
+
if (item.multiClick && selected.value.length > 1) {
|
|
1236
|
+
item.multiClick(selected.value)
|
|
1237
|
+
return
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
if (item.click) {
|
|
1241
|
+
item.click(selected.value[0], 0)
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1222
1244
|
defineOptions({
|
|
1223
1245
|
name: 'MDatatable',
|
|
1224
1246
|
inheritAttrs: !1
|
|
@@ -1274,15 +1296,15 @@ defineOptions({
|
|
|
1274
1296
|
>
|
|
1275
1297
|
<q-table
|
|
1276
1298
|
ref="table"
|
|
1277
|
-
v-model:fullscreen="
|
|
1299
|
+
v-model:fullscreen="fullscreen"
|
|
1278
1300
|
v-model:pagination="pagination"
|
|
1279
1301
|
v-model:selected="selected"
|
|
1280
1302
|
:class="`m--datatable ` + ($q.screen.lt.md ? 'm--datatable-grid' : '')"
|
|
1281
1303
|
:columns="getHeaders"
|
|
1282
|
-
:filter="
|
|
1304
|
+
:filter="search"
|
|
1283
1305
|
:grid="isGrid"
|
|
1284
1306
|
:hide-pagination="endReach"
|
|
1285
|
-
:loading="
|
|
1307
|
+
:loading="loading"
|
|
1286
1308
|
:rows="getRows"
|
|
1287
1309
|
:rows-per-page-options="getRowsPerPageOptions"
|
|
1288
1310
|
:selection="getShowSelection ? (multiSelection ? 'multiple' : 'single') : 'none'"
|
|
@@ -1493,7 +1515,7 @@ defineOptions({
|
|
|
1493
1515
|
/>
|
|
1494
1516
|
<MInput
|
|
1495
1517
|
v-if="!hideSearch && !dialogs.form"
|
|
1496
|
-
v-model="
|
|
1518
|
+
v-model="search"
|
|
1497
1519
|
:debounce="searchDebounce"
|
|
1498
1520
|
:dense="dense === undefined ? (pluginOptions.datatable?.dense !== undefined ? pluginOptions.datatable?.dense : !0) : dense"
|
|
1499
1521
|
:placeholder="searchPlaceholder"
|
|
@@ -1506,7 +1528,7 @@ defineOptions({
|
|
|
1506
1528
|
>
|
|
1507
1529
|
<template #prepend>
|
|
1508
1530
|
<q-icon
|
|
1509
|
-
v-if="!
|
|
1531
|
+
v-if="!search"
|
|
1510
1532
|
name="ion-ios-search"
|
|
1511
1533
|
>
|
|
1512
1534
|
<q-tooltip class="m--dt-btn-tooltip">
|
|
@@ -1517,7 +1539,7 @@ defineOptions({
|
|
|
1517
1539
|
v-else
|
|
1518
1540
|
class="cursor-pointer"
|
|
1519
1541
|
name="ion-ios-close"
|
|
1520
|
-
@click="
|
|
1542
|
+
@click="search = ''"
|
|
1521
1543
|
>
|
|
1522
1544
|
<q-tooltip class="m--dt-btn-tooltip">
|
|
1523
1545
|
{{ __('myth.datatable.searchInputClear') }}
|
|
@@ -1574,7 +1596,7 @@ defineOptions({
|
|
|
1574
1596
|
no-caps
|
|
1575
1597
|
style="min-width: 68px"
|
|
1576
1598
|
unelevated
|
|
1577
|
-
@click="
|
|
1599
|
+
@click="search ? refresh() : undefined"
|
|
1578
1600
|
/>
|
|
1579
1601
|
</MRow>
|
|
1580
1602
|
</MModalMenu>
|
|
@@ -1655,7 +1677,7 @@ defineOptions({
|
|
|
1655
1677
|
>
|
|
1656
1678
|
<slot
|
|
1657
1679
|
:dt="datatableItemsScope"
|
|
1658
|
-
:filter="
|
|
1680
|
+
:filter="tempFilterForm"
|
|
1659
1681
|
:form="useFormContext"
|
|
1660
1682
|
:index="dialogItemIndex"
|
|
1661
1683
|
:item="dialogItem"
|
|
@@ -1696,7 +1718,7 @@ defineOptions({
|
|
|
1696
1718
|
<MDtBtn
|
|
1697
1719
|
v-if="!noRefreshBtn"
|
|
1698
1720
|
key="refresh-selection-btn"
|
|
1699
|
-
:disable="
|
|
1721
|
+
:disable="loading"
|
|
1700
1722
|
icon="ion-ios-refresh"
|
|
1701
1723
|
tooltip="myth.datatable.hints.refresh"
|
|
1702
1724
|
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.refresh}"
|
|
@@ -1707,44 +1729,44 @@ defineOptions({
|
|
|
1707
1729
|
<MDtBtn
|
|
1708
1730
|
v-if="fullscreenBtn === undefined ? ( !!pluginOptions.datatable?.fullscreenBtn) : fullscreenBtn"
|
|
1709
1731
|
key="fullscreen-selection-btn"
|
|
1710
|
-
:disable="
|
|
1711
|
-
:icon="
|
|
1712
|
-
:tooltip="`myth.datatable.${
|
|
1732
|
+
:disable="loading"
|
|
1733
|
+
:icon="fullscreen ? 'ion-ios-contract' : 'ion-ios-desktop'"
|
|
1734
|
+
:tooltip="`myth.datatable.${fullscreen ? 'exitFullscreen' : 'fullscreen'}`"
|
|
1713
1735
|
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.fullscreen}"
|
|
1714
|
-
@click="
|
|
1736
|
+
@click="fullscreen = !fullscreen"
|
|
1715
1737
|
/>
|
|
1716
1738
|
<template v-if="hasSelectedItem">
|
|
1717
1739
|
<MDtBtn
|
|
1718
1740
|
v-if="hasUpdateBtn && isSingleSelectedItem"
|
|
1719
1741
|
key="update-dt-selection-btn"
|
|
1720
|
-
:disable="
|
|
1742
|
+
:disable="loading"
|
|
1721
1743
|
icon="ion-ios-create"
|
|
1722
1744
|
update
|
|
1723
1745
|
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn}"
|
|
1724
|
-
@click="openUpdateDialogNoIndex(
|
|
1746
|
+
@click="openUpdateDialogNoIndex(selected[0] as any)"
|
|
1725
1747
|
/>
|
|
1726
1748
|
<MDtBtn
|
|
1727
1749
|
v-if="hasCloneBtn && isSingleSelectedItem"
|
|
1728
1750
|
key="clone-dt-selection-btn"
|
|
1729
|
-
:disable="
|
|
1751
|
+
:disable="loading"
|
|
1730
1752
|
clone
|
|
1731
1753
|
tooltip="labels.clone"
|
|
1732
1754
|
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn}"
|
|
1733
|
-
@click="onCloneItem(
|
|
1755
|
+
@click="onCloneItem(selected[0] as any)"
|
|
1734
1756
|
/>
|
|
1735
1757
|
<MDtBtn
|
|
1736
1758
|
v-if="hasShowBtn && isSingleSelectedItem"
|
|
1737
1759
|
key="show-dt-selection-btn"
|
|
1738
|
-
:disable="
|
|
1760
|
+
:disable="loading"
|
|
1739
1761
|
icon="ion-ios-eye"
|
|
1740
1762
|
show
|
|
1741
1763
|
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn}"
|
|
1742
|
-
@click="openShowDialogNoIndex(
|
|
1764
|
+
@click="openShowDialogNoIndex(selected[0] as any)"
|
|
1743
1765
|
/>
|
|
1744
1766
|
<MDtBtn
|
|
1745
|
-
v-if="
|
|
1767
|
+
v-if="selected.length > 1 ? (hasDestroyBtn && multiDestroy) : hasDestroyBtn"
|
|
1746
1768
|
key="destroy-dt-selection-btn"
|
|
1747
|
-
:disable="!hasSelectedItem ||
|
|
1769
|
+
:disable="!hasSelectedItem || loading"
|
|
1748
1770
|
color="negative"
|
|
1749
1771
|
destroy
|
|
1750
1772
|
icon="ion-ios-trash"
|
|
@@ -1756,12 +1778,10 @@ defineOptions({
|
|
|
1756
1778
|
:key="`top-s-${i}`"
|
|
1757
1779
|
>
|
|
1758
1780
|
<MDtBtn
|
|
1759
|
-
v-if="(typeof contextBtn.showIf === 'function' ? contextBtn.showIf(
|
|
1760
|
-
:tooltip="__(contextBtn.tooltip
|
|
1781
|
+
v-if="(typeof contextBtn.showIf === 'function' ? contextBtn.showIf(selected[0],0) : contextBtn.showIf) && ( (contextBtn.click && isSingleSelectedItem) || (contextBtn.multiClick && !isSingleSelectedItem) )"
|
|
1782
|
+
:tooltip="contextBtn.tooltip?__(contextBtn.tooltip):(contextBtn.label?__(`labels.${contextBtn.label}`):undefined)"
|
|
1761
1783
|
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn,...contextBtn,...contextBtn.attr}"
|
|
1762
|
-
@click="contextBtn
|
|
1763
|
-
contextBtn.click ? contextBtn.click(tableOptions.selected[0],0) : undefined
|
|
1764
|
-
)"
|
|
1784
|
+
@click="onClickTopMenu(contextBtn)"
|
|
1765
1785
|
/>
|
|
1766
1786
|
</template>
|
|
1767
1787
|
</template>
|
|
@@ -1803,14 +1823,14 @@ defineOptions({
|
|
|
1803
1823
|
|
|
1804
1824
|
<!-- Filter Row -->
|
|
1805
1825
|
<MRow
|
|
1806
|
-
v-if="Object.values(
|
|
1826
|
+
v-if="Object.values(filterForm).filter(e => e !== undefined && e !== null).length > 0"
|
|
1807
1827
|
class="items-center"
|
|
1808
1828
|
>
|
|
1809
1829
|
<MCol col="auto">
|
|
1810
1830
|
<span class="text-subtitle1 q-mr-sm">{{ __('myth.datatable.filteredBy') }}</span>
|
|
1811
1831
|
</MCol>
|
|
1812
1832
|
<template
|
|
1813
|
-
v-for="(filterValue,filterKey) in
|
|
1833
|
+
v-for="(filterValue,filterKey) in filterForm"
|
|
1814
1834
|
:key="`filter-${filterKey}`"
|
|
1815
1835
|
>
|
|
1816
1836
|
<MCol
|
|
@@ -1829,7 +1849,9 @@ defineOptions({
|
|
|
1829
1849
|
<span>
|
|
1830
1850
|
{{ getHeaders.find(e => e.name === filterKey)?.label || __(`attributes.${filterKey}`) }}
|
|
1831
1851
|
</span>
|
|
1832
|
-
<span v-if="typeof filterValue === 'boolean'">: {{
|
|
1852
|
+
<span v-if="typeof filterValue === 'boolean'">: {{
|
|
1853
|
+
__(`labels.${filterValue ? 'yes' : 'no'}`)
|
|
1854
|
+
}}</span>
|
|
1833
1855
|
<span v-else-if="typeof filterValue === 'string'">: {{ filterValue }}</span>
|
|
1834
1856
|
<span
|
|
1835
1857
|
v-else-if="lodash.isArray(filterValue) && !quasarHelpers.object(filterValue[0])"
|
|
@@ -2050,7 +2072,7 @@ defineOptions({
|
|
|
2050
2072
|
name="form-title"
|
|
2051
2073
|
>
|
|
2052
2074
|
<q-toolbar-title>
|
|
2053
|
-
<template v-if="
|
|
2075
|
+
<template v-if="loading && !dialogs.item">
|
|
2054
2076
|
<q-skeleton width="200px" />
|
|
2055
2077
|
</template>
|
|
2056
2078
|
<template v-else>
|
|
@@ -2084,11 +2106,11 @@ defineOptions({
|
|
|
2084
2106
|
class="scroll m--datatable__dialog-form-container"
|
|
2085
2107
|
>
|
|
2086
2108
|
<MContainer
|
|
2087
|
-
v-if="
|
|
2109
|
+
v-if="loading && !dialogs.item"
|
|
2088
2110
|
:fluid="!1"
|
|
2089
2111
|
>
|
|
2090
2112
|
<MRow
|
|
2091
|
-
v-if="
|
|
2113
|
+
v-if="loading"
|
|
2092
2114
|
col
|
|
2093
2115
|
>
|
|
2094
2116
|
<template
|
|
@@ -2128,7 +2150,7 @@ defineOptions({
|
|
|
2128
2150
|
<MBtn
|
|
2129
2151
|
:class="{'full-width': $q.screen.lt.sm}"
|
|
2130
2152
|
:label="__('myth.titles.' + (isUpdateMode ? 'save' : 'store'))"
|
|
2131
|
-
:loading="
|
|
2153
|
+
:loading="loading"
|
|
2132
2154
|
color="positive"
|
|
2133
2155
|
no-caps
|
|
2134
2156
|
type="submit"
|
|
@@ -2137,7 +2159,7 @@ defineOptions({
|
|
|
2137
2159
|
</slot>
|
|
2138
2160
|
<MBtn
|
|
2139
2161
|
v-if="$q.screen.gt.sm"
|
|
2140
|
-
:disable="
|
|
2162
|
+
:disable="loading"
|
|
2141
2163
|
:label="__('myth.titles.close')"
|
|
2142
2164
|
color="negative"
|
|
2143
2165
|
no-caps
|