This commit is contained in:
shokouhi
2020-07-06 12:17:47 +04:30
23 changed files with 167 additions and 116 deletions
@@ -139,8 +139,14 @@
<hr class="v-divider theme--light" />
</v-flex>
<v-layout row wrap class="ml-4">
<v-flex xs6 md2 sm2 v-for="(img, key) in data.title_image" :key="key">
<img :src="'/'+img.path" style="width: 100%" />
<v-flex xs6 md2 sm2 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>
+3 -1
View File
@@ -127,12 +127,14 @@ export default {
{
to: {name: 'AllItem'},
icon: 'far fa-clone',
text: 'Items'
text: 'Items',
role: 'Admin|Supervisor'
},
{
to: {name: 'AllPackage'},
icon: 'fas fa-archive',
text: 'Packages',
role: 'Admin|Supervisor'
},
{
to: {name: 'AllLabels'},
@@ -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);
}
},
}
@@ -148,8 +148,14 @@
</v-flex>
<v-layout row wrap class="ml-4">
<!-- <LightBox :media="data.images.map(img => ({thumb: img.path, src: img.path}))" style="width: 20%"></LightBox> -->
<v-flex xs6 md2 sm2 v-for="(img, key) in data.images" :key="key">
<img :src="'/'+img.path" style="width: 100%" />
<v-flex xs6 md2 sm2 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>
@@ -215,13 +221,10 @@ export default {
import { mapGetters, mapMutations } from "vuex";
import { ApiService } from "@/services";
import { urls } from "@/config/urls";
import LightBox from 'vue-image-lightbox';
import 'vue-image-lightbox/dist/vue-image-lightbox.min.css'
// import LightBox from 'vue-image-lightbox';
// import 'vue-image-lightbox/dist/vue-image-lightbox.min.css'
export default {
data: () => ({}),
components:{
LightBox
},
methods: {
...mapMutations("modal", ["closeModal", "setResultModal"]),
async verify(id) {
@@ -267,7 +270,6 @@ export default {
},
created() {
this.data = this.getModalProperties.result.data.data;
console.log(this.data.images.map(img => img.path));
},
computed: {
+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}`;
},
+2 -2
View File
@@ -18,8 +18,8 @@ import App from './App.vue'
import i18n from '@/i18n'
import router from '@/router'
import store from '@/store'
import VueLazyLoad from 'vue-lazyload';
Vue.use(VueLazyLoad)
// import VueLazyLoad from 'vue-lazyload';
// Vue.use(VueLazyLoad)
import { ApiService, TokenService } from '@/services'
// Sync store with router
sync(store, router)
+1
View File
@@ -3,6 +3,7 @@ import { TokenService } from '@/services'
const $hasRole = function(roles) {
if (TokenService.getToken()) {
roles = roles.split('|');
for (const role of roles) {
if(TokenService.getInfo().roles && Array.isArray(TokenService.getInfo().roles) && TokenService.getInfo().roles.includes(role)) {
return true;
@@ -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">