refactor: header Deleted value, index changed value
This commit is contained in:
parent
3a1c0aba63
commit
f922a3a7e5
1 changed files with 13 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ import { dialog } from 'stores/utils';
|
|||
|
||||
import { VuePDF, usePDF } from '@tato30/vue-pdf';
|
||||
|
||||
const currentFileSelected = ref<string>('citizenId');
|
||||
const currentFileSelected = ref<string>('');
|
||||
const file = defineModel<
|
||||
{
|
||||
group?: string;
|
||||
|
|
@ -269,6 +269,16 @@ const { pdf, pages } = usePDF(computed(() => currentFile.value?.url));
|
|||
type="button"
|
||||
@click="
|
||||
() => {
|
||||
const tempValue = treeFile.find(
|
||||
(v) => v.label === $t(`customer.typeFile.${currentMode}`),
|
||||
);
|
||||
|
||||
if (!tempValue) return;
|
||||
|
||||
const idx = tempValue.file?.findIndex(
|
||||
(v) => v.label === currentFileSelected,
|
||||
);
|
||||
|
||||
dialog({
|
||||
color: 'negative',
|
||||
icon: 'mdi-alert',
|
||||
|
|
@ -278,6 +288,8 @@ const { pdf, pages } = usePDF(computed(() => currentFile.value?.url));
|
|||
message: $t('dialog.message.confirmDelete'),
|
||||
action: async () => {
|
||||
$emit('deleteFile', currentFileSelected);
|
||||
|
||||
currentFileSelected = tempValue.file?.[idx - 1].label || '';
|
||||
},
|
||||
|
||||
cancel: () => {},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue