research_ui/components/research/components/FormForDelete.vue
2025-02-04 16:10:58 +03:30

95 lines
2.1 KiB
Vue

<template>
<form
class="create-form container"
role="create"
style="height: 100%; display: flex; flex-direction: column"
>
<div class="form-row">
<div class="form-group">
<input
class="form-check-input"
type="radio"
value="delete_all"
v-model="selectedOption"
/>
<label for="title" class="me-5">حذف کل شاخه:</label>
</div>
</div>
<div class="form-row">
<div class="form-group">
<input
class="form-check-input"
type="radio"
value="delete_one"
v-model="selectedOption"
/>
<label for="title" class="me-5">حذف گره اصلی:</label>
</div>
</div>
<div class="d-flex justify-content-center">
<div v-if="selectedOption == 'delete_all'">
<p>مراقب باشد کل داده شما پاک میشود</p>
</div>
<div v-else-if="selectedOption == 'delete_one'">
<p>فقط مقدار اول پاک می شود و داده های آن به شاخه اصلی منتقل می شود</p>
</div>
<div v-else>
<p>یکی از موارد را انتخاب کنید</p>
</div>
</div>
<div class="d-flex justify-content-end align-items-end mt-auto">
<button
@click.prevent="close()"
type="button"
class="btn btn-secondary"
data-dismiss="modal"
>
بستن
</button>
<button
@click.prevent="save()"
type="button"
class="btn btn-primary me-2"
>
حذف
</button>
</div>
</form>
</template>
<script>
import apis from "~/apis/borhanApi.js";
export default {
props: {
value: {
default: "",
},
},
mounted() {
this.httpService = new HttpService(import.meta.env.VITE_BASE_URL);
},
data() {
return {
selectedOption: null,
};
},
methods: {
close() {
this.$emit("close");
},
save() {
this.$emit("removItem", this.selectedOption);
this.$emit("close");
this.selectedOption = ""
},
},
};
</script>