fix : delete confirm modal and style

This commit is contained in:
Ashrafi
2025-04-12 14:30:59 +03:30
parent 47d81a2aa6
commit 90b0e0dc65
25 changed files with 782 additions and 12074 deletions
+20 -14
View File
@@ -2,7 +2,7 @@
<div class>
<v-container fluid>
<material-card class color="black" title="My Items" text>
<v-layout align-center wrap class="my-3 px-5">
<v-layout align-center wrap class="my-3 px-3">
<v-flex xs12 sm4 md4 lg2 xl2 class="WM-FlexCenter">
<v-icon class="fas fa-sort-numeric-up mr-2 WM-Margin-B-8"/>
<v-text-field class="py-3 pr-3" v-model="getFilters.item_id"
@@ -47,10 +47,10 @@
</router-link>
</v-flex>
</v-layout>
<v-layout class="px-4 my-3">
<v-layout class="px-3 my-3">
<v-divider/>
</v-layout>
<v-layout align-center wrap class="my-3 px-5" v-if="getMyItems">
<v-layout align-center wrap class="my-3 px-3" v-if="getMyItems">
<v-flex md12>
<v-data-table :headers="headers" :items="getMyItems" hide-actions>
<template slot="headerCell" slot-scope="{ header }">
@@ -110,7 +110,7 @@
<v-tooltip bottom open-on-hover>
<template v-slot:activator="{ on, attrs }">
<v-btn v-bind="attrs" v-on="on" color="pink" class="WM-ActionButton mr-2"
@click="remove(item.id)"
@click="removeModal(item.id)"
v-if="$hasRole('Admin|Supervisor') ||( item.user_id == $store.state.user.id && !['approved', 'rejected'].includes(item.status))">
<v-icon class="white--text mr-2 caption">fas fa-trash</v-icon>
<span>Remove</span>
@@ -148,13 +148,14 @@
<div class="text-xs-center" v-if="lastPage > 1">
<v-pagination color="black" v-model="currentPage" :length="lastPage" :total-visible="6"/>
</div>
<v-layout row wrap align-center justify-center class="mt-3">
<v-layout row wrap align-center class="px-3 mt-3">
<router-link to="/dashboard">
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black ml-5">
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black">
<v-icon class="black--text mr-2 caption">fas fa-chevron-left</v-icon>
<span class="black--text CSSD-font">Back</span>
</v-btn>
</router-link>
<v-spacer/>
</v-layout>
</material-card>
</v-container>
@@ -244,16 +245,21 @@ export default {
});
}
},
async remove(testResultId) {
const result = await ApiService.delete(
urls.removeItem(testResultId)
);
removeModal(id) {
this.changeCurrentModal({
modal: "modal-delete-delete",
properties: {
success: () => {
this.remove(id);
},
}
});
},
async remove(id) {
const result = await ApiService.delete(urls.removeItem(id));
if (result && result.status == 200) {
for (const key in this.items) {
if (
this.items.hasOwnProperty(key) &&
this.items[key].id == testResultId
) {
if (this.items.hasOwnProperty(key) && this.items[key].id == id) {
this.items.splice(key, 1);
}
}