parent
b6240cd008
commit
73dda8df56
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "es6",
|
||||
"target": "es2017",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@JS/*": ["./resources/js/*"],
|
||||
"@Global/*": ["./resources/js/Global/*"],
|
||||
"@Home/*": ["./resources/js/Home/*"],
|
||||
"@CRM/*": ["./modules/wm-crm/resources/js/*"],
|
||||
"@Common/*": ["./modules/wm-common/resources/js/*"],
|
||||
"@Core/*": ["./modules/wm-core/resources/js/*"],
|
||||
"@User/*": ["./modules/wm-core/resources/js/Modules/User/*"],
|
||||
"@Auth/*": ["./modules/wm-core/resources/js/Modules/Authentication/*"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=979ca3cbe3ae6f2f6648",
|
||||
"/js/vue/Home/app.js": "/js/vue/Home/app.js?id=952eba47f3c87b27c8e4",
|
||||
"/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=2438d0b19611c164de10",
|
||||
"/js/vue/User/app.js": "/js/vue/User/app.js?id=90b3808d13f34c14baac"
|
||||
"/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=b727d2fdd4ae9b2599ca",
|
||||
"/js/vue/Home/app.js": "/js/vue/Home/app.js?id=73deaff9655f8ee55fcb",
|
||||
"/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=d94428e8a2e4f40c46c8",
|
||||
"/js/vue/User/app.js": "/js/vue/User/app.js?id=2b834de4476db0e81b1b"
|
||||
}
|
||||
|
@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<div>
|
||||
<vue-dropzone ref="myVueDropzone" id="dropzone" @vdropzone-removed-file="removeFile" :options="dropzoneOptions" @vdropzone-success="responseSuccess"></vue-dropzone>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Permissions from "@Global/utils/Permissions/list";
|
||||
import vue2Dropzone from 'vue2-dropzone'
|
||||
import 'vue2-dropzone/dist/vue2Dropzone.min.css'
|
||||
export default {
|
||||
props: {
|
||||
api: { default: null },
|
||||
defaultMessage: { default: "<i class='fa fa-cloud-upload'></i>آپلود فایل" },
|
||||
value: { default:() => ([]) },
|
||||
id: { default: null },
|
||||
loadeFiles: {default:() => ([])},
|
||||
},
|
||||
components: {
|
||||
vueDropzone: vue2Dropzone
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dropzoneOptions: {
|
||||
url: this.api ? this.api : "https://httpbin.org/post",
|
||||
thumbnailWidth: 200,
|
||||
addRemoveLinks: true,
|
||||
dictDefaultMessage: this.defaultMessage
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
responseSuccess(file, response) {
|
||||
// this.value.push(response.data);
|
||||
// this.$emit('input', this.value);
|
||||
},
|
||||
removeFile(file, error, xhr) {
|
||||
// let index = this.value.findIndex(x => x == xhr.data);
|
||||
// this.value.splice(index, 1);
|
||||
// this.$emit('input', this.value);
|
||||
},
|
||||
manuallyLoadFiles(files) { //file =[ {size: 123, name: "Icon", type: "image/png", url: "https://myvizo.com/img/logo_sm.png"}]
|
||||
for (const file of files) {
|
||||
this.$refs.myVueDropzone.manuallyAddFile(file, file.url);
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
loadFiles(files) {
|
||||
this.manuallyLoadFiles(files);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
Loading…
Reference in new issue