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,
default: null,
},
deleteModel: {
type: String,
default: null,
},
downloadModel: {
type: String,
required: false,
@ -240,7 +244,7 @@ function deleteDms(dmsFk) {
},
})
.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);
rows.value.splice(index, 1);
});

View File

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