new correction

This commit is contained in:
Fateme
2020-07-04 23:26:44 +04:30
parent a74e49af6f
commit 1f1be72d74
21 changed files with 161 additions and 107 deletions
@@ -139,8 +139,14 @@
<hr class="v-divider theme--light" />
</v-flex>
<v-layout row wrap class="ml-4">
<v-flex xs12 md6 sm6 v-for="(img, key) in data.title_image" :key="key">
<img :src="'/'+img.path" style="width: 100%" />
<v-flex xs12 md6 sm6 v-for="(file, key) in data.files" :key="key">
<template v-if="file.file_type == 'document'">
<a target="_blank" :href="'/'+file.path"><v-icon class="mr-2 caption">fas fa-check</v-icon>{{ file.file_name }}</a>
</template>
<template v-else>
<img :src="'/'+file.path" style="width: 100%" />
</template>
</v-flex>
</v-layout>
</v-layout>
@@ -10,8 +10,8 @@
@vdropzone-error = "error"
class="WM-Relative" >
<div class="dropzone-custom-content">
<!-- <h3 class="dropzone-custom-title">فایل مورد نظر خود را در این قسمت آپلود کنید</h3> -->
<div class="subtitle">Upload images here</div>
<h3 class="dropzone-custom-title">Upload your files here</h3>
<div class="subtitle">image or pdf or word</div>
</div>
</vue-dropzone>
</div>
@@ -33,7 +33,7 @@
},
data: () => ({
dropzoneOptions: {
url: '/api/UploadImage',
url: '/api/UploadFile',
thumbnailWidth: 150,
maxFilesize: 2,
headers: { "Authorization": `Bearer ${TokenService.getToken()}` },
@@ -48,7 +48,7 @@
let vm = this;
if (vm.Images != null) {
vm.Images.forEach(function(image, key){
var file = { name: image.file_name, size:'1024', type: 'jpg', id: image.id};
var file = { name: image.file_name, size:'1024', type: ' ', id: image.id};
vm.$refs.myVueDropzone.manuallyAddFile(file, '/'+image.path);
});
}
@@ -69,7 +69,7 @@
}
},
sending(file, xhr, form_data) {
form_data.append('image', file);
form_data.append('file', file);
form_data.append('model_id', this.ModelID);
form_data.append('model_type', this.ModelType);
form_data.append('batch_id', this.BatchID);
@@ -87,7 +87,7 @@
formdata.append('model_id', this.ModelID);
formdata.append('model_type', this.ModelType);
formdata.append('batch_id', this.BatchID);
let result = await ApiService.post(urls.deleteImage,formdata);
let result = await ApiService.post(urls.deleteFile,formdata);
}
},
}
@@ -139,8 +139,14 @@
<hr class="v-divider theme--light" />
</v-flex>
<v-layout row wrap class="ml-4">
<v-flex xs12 md6 sm6 v-for="(img, key) in data.images" :key="key">
<img :src="'/'+img.path" style="width: 100%" />
<v-flex xs12 md6 sm6 v-for="(file, key) in data.files" :key="key">
<template v-if="file.file_type == 'document'">
<a target="_blank" :href="'/'+file.path"><v-icon class="mr-2 caption">fas fa-check</v-icon>{{ file.file_name }}</a>
</template>
<template v-else>
<img :src="'/'+file.path" style="width: 100%" />
</template>
</v-flex>
</v-layout>
</v-layout>
+1 -1
View File
@@ -19,7 +19,7 @@ const urls = {
sendVerifyCode: `/password/verifyCode`,
changePassword: `/password/reset`,
storeMessages: `/Messages`,
deleteImage: `/DeleteImage`,
deleteFile: `/DeleteFile`,
listMessages: function(page) {
return `/Messages?page=${page}`;
},
@@ -551,7 +551,7 @@ export default {
}
}
// this.images = result.data.data.imagesPath;
this.galleries = result.data.data.imagesPath;
this.galleries = result.data.data.filesPath;
this.galleryDataLoaded = true;
}
}
@@ -22,6 +22,7 @@
label="ID Label"
color="black"
class="py-3 pr-3"
:clearable="true"
></v-autocomplete>
</v-flex>
<v-flex xs12 md3 sm3 class="WM-FlexCenter pl-3">