Add delete model to worker dms
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
William Buezas 2024-04-10 08:27:30 -03:00
parent e88194eb88
commit 39af4278a6
2 changed files with 9 additions and 3 deletions

View File

@ -28,6 +28,10 @@ const $props = defineProps({
type: String, type: String,
default: null, default: null,
}, },
deleteModel: {
type: String,
default: null,
},
downloadModel: { downloadModel: {
type: String, type: String,
required: false, required: false,
@ -240,7 +244,7 @@ function deleteDms(dmsFk) {
}, },
}) })
.onOk(async () => { .onOk(async () => {
await axios.post(`${$props.model}/${dmsFk}/removeFile`); await axios.post($props.deleteModel ?? `${$props.model}/${dmsFk}/removeFile`);
const index = rows.value.findIndex((row) => row.id == dmsFk); const index = rows.value.findIndex((row) => row.id == dmsFk);
rows.value.splice(index, 1); rows.value.splice(index, 1);
}); });

View File

@ -1,11 +1,13 @@
<script setup> <script setup>
import VnDmsList from 'src/components/common/VnDmsList.vue'; import VnDmsList from 'src/components/common/VnDmsList.vue';
import { useRoute } from 'vue-router';
const route = useRoute();
</script> </script>
<template> <template>
<VnDmsList <VnDmsList
model="WorkerDms" :model="`WorkerDms/${route.params.id}/filter`"
update-model="Workers" update-model="Workers"
:delete-model="`WorkerDms/${route.params.id}/removeFile`"
download-model="WorkerDms" download-model="WorkerDms"
default-dms-code="hhrrData" default-dms-code="hhrrData"
filter="worker" filter="worker"