fix : edit pages will show images from now on

This commit is contained in:
zeinab.ashrafi
2025-04-30 11:49:09 +03:30
parent e693bf25f6
commit 35d8327a77
12 changed files with 29 additions and 42 deletions
+3 -2
View File
@@ -41,14 +41,15 @@ export default {
}), }),
mounted() { mounted() {
this.loadImages(); this.loadImages();
console.log(this.Images , 'Images ------------------')
}, },
methods: { methods: {
loadImages() { loadImages() {
let vm = this; let vm = this;
if (vm.Images != null) { if (vm.Images != null) {
vm.Images.forEach(function (image, key) { vm.Images.forEach(function (image, key) {
var file = {name: image.file_name, size: '1024', type: ' ', id: image.id}; var file = {name: image.thumbnail, size: image.size, type: image.mime_type, id: image.id};
vm.$refs.myVueDropzone.manuallyAddFile(file, '/' + image.path); vm.$refs.myVueDropzone.manuallyAddFile(file, image.thumbnail);
}); });
} }
}, },
+2 -6
View File
@@ -13,16 +13,12 @@
color="black" color="black"
:rules="[rules.required, rules.cellNumberCounter]" :rules="[rules.required, rules.cellNumberCounter]"
mask="#### ### ####" mask="#### ### ####"
></v-text-field> />
</v-flex> </v-flex>
</v-layout> </v-layout>
<v-layout row wrap class="px-3"> <v-layout row wrap class="px-3">
<v-flex xs12 md6 sm6 class="text-md-left text-sm-center text-xs-center"> <v-flex xs12 md6 sm6 class="text-md-left text-sm-center text-xs-center">
<v-btn <v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px" @click="handleSubmit">
class="WM-CyanBlueGradient-BG"
style="padding:10px 60px"
@click="handleSubmit"
>
<v-icon class="white--text mr-2 caption">fas fa-sign-in-alt</v-icon> <v-icon class="white--text mr-2 caption">fas fa-sign-in-alt</v-icon>
<span class="white--text">Send</span> <span class="white--text">Send</span>
</v-btn> </v-btn>
+3 -5
View File
@@ -3,9 +3,7 @@
<v-container grid-list-xs> <v-container grid-list-xs>
<v-layout row wrap class="justify-center"> <v-layout row wrap class="justify-center">
<v-flex xs12 md3 sm3 class="WM-WidthScreen-SM WM-WidthScreen-XS"> <v-flex xs12 md3 sm3 class="WM-WidthScreen-SM WM-WidthScreen-XS">
<material-card <material-card color="black" title="Login Page">
color="black"
title="Login Page">
<v-layout row wrap class="px-3"> <v-layout row wrap class="px-3">
<v-flex xs12 md12 sm12> <v-flex xs12 md12 sm12>
<v-text-field <v-text-field
@@ -15,7 +13,7 @@
color="black" color="black"
:rules="[rules.required, rules.cellNumberCounter]" :rules="[rules.required, rules.cellNumberCounter]"
mask="#### ### ####" mask="#### ### ####"
></v-text-field> />
</v-flex> </v-flex>
</v-layout> </v-layout>
<v-layout row wrap class="px-3"> <v-layout row wrap class="px-3">
@@ -30,7 +28,7 @@
:rules="[rules.required, rules.passCounter]" :rules="[rules.required, rules.passCounter]"
color="black" color="black"
class="pa-2" class="pa-2"
></v-text-field> />
</v-flex> </v-flex>
</v-layout> </v-layout>
<v-layout row wrap class="px-3"> <v-layout row wrap class="px-3">
+6 -12
View File
@@ -13,7 +13,7 @@
color="black" color="black"
class="pa-2" class="pa-2"
:rules="[rules.required, rules.nameCounter]" :rules="[rules.required, rules.nameCounter]"
></v-text-field> />
</v-flex> </v-flex>
<v-flex xs12 md2 sm2> <v-flex xs12 md2 sm2>
<v-select <v-select
@@ -25,7 +25,7 @@
class="pa-2" class="pa-2"
color="black" color="black"
:rules="[rules.required]" :rules="[rules.required]"
></v-select> />
</v-flex> </v-flex>
<v-flex xs2 md2 sm2> <v-flex xs2 md2 sm2>
<v-text-field <v-text-field
@@ -35,7 +35,7 @@
color="black" color="black"
:rules="[rules.required, rules.countryCode]" :rules="[rules.required, rules.countryCode]"
mask="####" mask="####"
></v-text-field> />
</v-flex> </v-flex>
<v-flex xs10 md10 sm10> <v-flex xs10 md10 sm10>
<v-text-field <v-text-field
@@ -45,7 +45,7 @@
color="black" color="black"
:rules="[rules.required, rules.cellNumberCounter]" :rules="[rules.required, rules.cellNumberCounter]"
mask="#### ### ####" mask="#### ### ####"
></v-text-field> />
</v-flex> </v-flex>
<v-flex xs12 md2 sm2> <v-flex xs12 md2 sm2>
<v-text-field <v-text-field
@@ -58,7 +58,7 @@
color="black" color="black"
class="pa-2" class="pa-2"
:rules="[rules.required, rules.passCounter]" :rules="[rules.required, rules.passCounter]"
></v-text-field> />
</v-flex> </v-flex>
</v-layout> </v-layout>
<v-layout row wrap> <v-layout row wrap>
@@ -68,13 +68,7 @@
<span class="white--text">Register</span> <span class="white--text">Register</span>
</v-btn> </v-btn>
</v-flex> </v-flex>
<v-flex <v-flex v-if="!isLogin" xs12 md6 sm6 class="text-md-right text-sm-center text-xs-center">
v-if="!isLogin"
xs12
md6
sm6
class="text-md-right text-sm-center text-xs-center"
>
<router-link to="/login"> <router-link to="/login">
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black"> <v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black">
<v-icon class="black--text mr-2 caption">fas fa-sign-in-alt</v-icon> <v-icon class="black--text mr-2 caption">fas fa-sign-in-alt</v-icon>
+1 -1
View File
@@ -35,7 +35,7 @@
</template> </template>
<template slot="items" slot-scope="{ item }"> <template slot="items" slot-scope="{ item }">
<td class="title font-weight-light WM-NoLetterSpacing">{{ item.name }}</td> <td class="title font-weight-light WM-NoLetterSpacing">{{ item.name }}</td>
<td class="title font-weight-light">{{ $d(new Date(item.created_at), 'long') }}</td> <td class="headline font-weight-light">{{ $d(new Date(item.created_at), 'long') }}</td>
<td class="title font-weight-light">{{ item.users_count }} Operator</td> <td class="title font-weight-light">{{ item.users_count }} Operator</td>
<td class="text-xs-right FlexBtn Height-MD-80 Height-SM-48 justify-self-end"> <td class="text-xs-right FlexBtn Height-MD-80 Height-SM-48 justify-self-end">
<v-tooltip bottom open-on-hover> <v-tooltip bottom open-on-hover>
+7 -9
View File
@@ -20,7 +20,7 @@
<span class="white--text">Filter</span> <span class="white--text">Filter</span>
</v-btn> </v-btn>
</v-flex> </v-flex>
<v-spacer></v-spacer> <v-spacer/>
<v-flex xs12 md2 sm2 class="text-xs-right"> <v-flex xs12 md2 sm2 class="text-xs-right">
<router-link :to="`/add-operator/${$route.params.medicalCenter}`"> <router-link :to="`/add-operator/${$route.params.medicalCenter}`">
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black"> <v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black">
@@ -34,10 +34,8 @@
<v-flex md12> <v-flex md12>
<v-data-table :headers="headers" :items="items" hide-actions> <v-data-table :headers="headers" :items="items" hide-actions>
<template slot="headerCell" slot-scope="{ header }"> <template slot="headerCell" slot-scope="{ header }">
<span <span class="subheading font-weight-light text-white text--darken-3"
class="subheading font-weight-light text-white text--darken-3" v-text="header.text"/>
v-text="header.text"
/>
</template> </template>
<template slot="items" slot-scope="{ item }"> <template slot="items" slot-scope="{ item }">
<td class="headline font-weight-light">{{ item.name }}</td> <td class="headline font-weight-light">{{ item.name }}</td>
@@ -48,8 +46,8 @@
<td class="title font-weight-light">{{ item.status }}</td> <td class="title font-weight-light">{{ item.status }}</td>
<td class="text-xs-right justify-self-end"> <td class="text-xs-right justify-self-end">
<v-btn :color="item.status == 'Active' ? 'red' : 'green'" <v-btn :color="item.status == 'Active' ? 'red' : 'green'"
@click="changeStatus(item.id)" @click="changeStatus(item.id)"
class="mr-2 WM-ActionButton"> class="mr-2 WM-ActionButton">
<template v-if="item.status == 'Active'"> <template v-if="item.status == 'Active'">
<v-icon class="white--text mr-2 caption">fas fa-user-tag</v-icon> <v-icon class="white--text mr-2 caption">fas fa-user-tag</v-icon>
<span v-if="item.status == 'Active'">Suspended</span> <span v-if="item.status == 'Active'">Suspended</span>
@@ -60,8 +58,8 @@
</template> </template>
</v-btn> </v-btn>
<v-btn color="orange darken-1" <v-btn color="orange darken-1"
@click="changeRoleModal(item)" @click="changeRoleModal(item)"
class="mr-2 WM-ActionButton"> class="mr-2 WM-ActionButton">
<v-icon class="white--text mr-2 caption">fas fa-user-tag</v-icon> <v-icon class="white--text mr-2 caption">fas fa-user-tag</v-icon>
<span>Role</span> <span>Role</span>
</v-btn> </v-btn>
+1 -1
View File
@@ -62,7 +62,7 @@
<td class="title font-weight-light">{{ item.description }}</td> <td class="title font-weight-light">{{ item.description }}</td>
<td class="title font-weight-light"> <td class="title font-weight-light">
<span v-for="(i , index) in item.items" :key="index"> <span v-for="(i , index) in item.items" :key="index">
{{ i.name }} <span v-if="index !== item.items.length-1">,</span> {{ i.id }} <span v-if="index !== item.items.length-1">,</span>
</span> </span>
</td> </td>
<td class="title font-weight-light">{{ item.status }}</td> <td class="title font-weight-light">{{ item.status }}</td>
+1 -1
View File
@@ -175,7 +175,7 @@ export default {
const result = await ApiService.get(urls.editPackage(id)); const result = await ApiService.get(urls.editPackage(id));
if (result.status == 200) { if (result.status == 200) {
this.formData = result.data.data; this.formData = result.data.data;
console.log('')
const usedItems = this.formData.items.filter(i => i.id && i.name); const usedItems = this.formData.items.filter(i => i.id && i.name);
const existingIds = this.items.map(i => i.id); const existingIds = this.items.map(i => i.id);
usedItems.forEach(ui => { usedItems.forEach(ui => {
+1 -1
View File
@@ -65,7 +65,7 @@
<td class="title font-weight-light">{{ item.description }}</td> <td class="title font-weight-light">{{ item.description }}</td>
<td class="title font-weight-light"> <td class="title font-weight-light">
<span v-for="(i , index) in item.items" :key="index"> <span v-for="(i , index) in item.items" :key="index">
{{ i.name }} <span v-if="index !== item.items.length-1">,</span> {{ i.id }} <span v-if="index !== item.items.length-1">,</span>
</span> </span>
</td> </td>
<td class="title font-weight-light">{{ item.status }}</td> <td class="title font-weight-light">{{ item.status }}</td>
+1 -1
View File
@@ -99,7 +99,7 @@
{{ item.result }} {{ item.result }}
</span> </span>
</td> </td>
<td class="title font-weight-light">{{ $d(new Date(item.created_at), 'long') }}</td> <td class="headline font-weight-light">{{ $d(new Date(item.created_at), 'long') }}</td>
<td class="title font-weight-light text-center"> <td class="title font-weight-light text-center">
<span v-if="item.verified == 'NotVerified'" class="NotVerified"> <span v-if="item.verified == 'NotVerified'" class="NotVerified">
<v-icon class="caption fa fa-times NotVerified"/> <v-icon class="caption fa fa-times NotVerified"/>
+2 -2
View File
@@ -86,10 +86,10 @@
<span class="subheading font-weight-light text-white text--darken-3" v-text="header.text"/> <span class="subheading font-weight-light text-white text--darken-3" v-text="header.text"/>
</template> </template>
<template slot="items" slot-scope="{ item }"> <template slot="items" slot-scope="{ item }">
<td class="headline font-weight-light">{{ item.name }}</td> <td class="title font-weight-light">{{ item.name }}</td>
<td class="title font-weight-light">{{ item.unique_code }}</td> <td class="title font-weight-light">{{ item.unique_code }}</td>
<td class="title font-weight-light">{{ item.user.name }}</td> <td class="title font-weight-light">{{ item.user.name }}</td>
<td class="title font-weight-light">{{ $d(new Date(item.created_at), 'long') }}</td> <td class="headline font-weight-light">{{ $d(new Date(item.created_at), 'long') }}</td>
<td class="text-xs-right FlexBtn justify-self-end"> <td class="text-xs-right FlexBtn justify-self-end">
<v-tooltip bottom open-on-hover> <v-tooltip bottom open-on-hover>
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
+1 -1
View File
@@ -67,7 +67,7 @@
<template slot="items" slot-scope="{ item }"> <template slot="items" slot-scope="{ item }">
<td class="title font-weight-light">{{ item.name }}</td> <td class="title font-weight-light">{{ item.name }}</td>
<td class="title font-weight-light">{{ item.cell_number }}</td> <td class="title font-weight-light">{{ item.cell_number }}</td>
<td class="title font-weight-light"> <td class="headline font-weight-light">
<span class="WM-Font-14">{{ $d(new Date(item.created_at), 'long') }}</span> <span class="WM-Font-14">{{ $d(new Date(item.created_at), 'long') }}</span>
</td> </td>
<td class="title font-weight-light"> <td class="title font-weight-light">