feat(device): update list
This commit is contained in:
@@ -8,7 +8,7 @@ import AppToolsEntryForm from '~/components/app/tools/entry-form.vue'
|
||||
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
||||
|
||||
// helpers
|
||||
import { toast } from "~/components/pub/ui/toast"
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
|
||||
// Types
|
||||
import type { Uom } from '~/models/uom'
|
||||
@@ -40,7 +40,6 @@ const getToolsDetail = async (id: number | string) => {
|
||||
if (result.success) {
|
||||
const currentDevice = result.body?.data || {}
|
||||
recItem.value = currentDevice
|
||||
isFormEntryDialogOpen.value = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,17 +103,19 @@ provide('rec_item', recItem)
|
||||
provide('table_data_loader', isLoading)
|
||||
|
||||
// Watch for row actions
|
||||
watch(recId, () => {
|
||||
watch([recId, recAction], () => {
|
||||
switch (recAction.value) {
|
||||
case ActionEvents.showDetail:
|
||||
getToolsDetail(recId.value)
|
||||
title.value = 'Detail Peralatan'
|
||||
isReadonly.value = true
|
||||
isFormEntryDialogOpen.value = true
|
||||
break
|
||||
case ActionEvents.showEdit:
|
||||
getToolsDetail(recId.value)
|
||||
title.value = 'Edit Peralatan'
|
||||
isReadonly.value = false
|
||||
isFormEntryDialogOpen.value = true
|
||||
break
|
||||
case ActionEvents.showConfirmDelete:
|
||||
isRecordConfirmationOpen.value = true
|
||||
@@ -177,4 +178,4 @@ onMounted(async () => {
|
||||
</template>
|
||||
</RecordConfirmation>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user