|
|
@@ -13,7 +13,7 @@
|
|
|
</el-form-item>
|
|
|
<template v-if="!path">
|
|
|
<el-form-item label="上传文件">
|
|
|
- <div class="upload" @click="openDialog" id='upload'>
|
|
|
+ <div class="upload" @click="openDialog" id='upload-area'>
|
|
|
<i class="el-icon-upload"></i>
|
|
|
<div class="title">
|
|
|
将
|
|
|
@@ -38,7 +38,7 @@
|
|
|
<template v-else>
|
|
|
<el-form-item label="上传文件">
|
|
|
<div>
|
|
|
- <el-button type="primary" plain @click="openDialog">重新选择文件夹</el-button>
|
|
|
+ <el-button type="primary" plain @click="openDialog" id='upload-area'>重新选择文件夹</el-button>
|
|
|
<div class="tip" style="margin:6px 0 14px;">选择文件夹后,若对其中文件进行了增删操作,请重新选择一次,系统会自动覆盖之前文件夹</div>
|
|
|
<order-show ref='orderShow' :clientOrder='clientOrder' @openFileHandler='openFileHandler(filesInfo.localPath)' @changeList='changeList'></order-show>
|
|
|
|
|
|
@@ -111,7 +111,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState(['userInfo']),
|
|
|
+ ...mapState(['userInfo', 'dragFile']),
|
|
|
storeInfo() {
|
|
|
return this.goodsInfo.storeInfo || {}
|
|
|
},
|
|
|
@@ -168,6 +168,12 @@ export default {
|
|
|
return num;
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ dragFile() {
|
|
|
+ console.log(this.dragFile)
|
|
|
+ this.getPath(this.dragFile)
|
|
|
+ },
|
|
|
+ },
|
|
|
mounted() {
|
|
|
// this.$router.replace({
|
|
|
// name: 'orderBookingStep3',
|
|
|
@@ -194,9 +200,6 @@ export default {
|
|
|
// },1000)
|
|
|
},
|
|
|
methods: {
|
|
|
- dragstartEvent() {
|
|
|
-
|
|
|
- },
|
|
|
changeList(list) {
|
|
|
this.clientOrder.userOrderList = list
|
|
|
var num = 0;
|
|
|
@@ -211,7 +214,7 @@ export default {
|
|
|
let files = [];
|
|
|
var hasDirectory = false;
|
|
|
fs.readdirSync(dir).forEach(child => {
|
|
|
- if(child.substr(0, 1) =='.'){
|
|
|
+ if (child.substr(0, 1) == '.') {
|
|
|
return
|
|
|
}
|
|
|
let info = fs.statSync(path.resolve(dir, child))
|
|
|
@@ -262,29 +265,33 @@ export default {
|
|
|
|
|
|
},
|
|
|
openDialog() {
|
|
|
- this.oneOrder = false
|
|
|
let paths = this.$electron.remote.dialog.showOpenDialog({ properties: ['openDirectory'] })
|
|
|
if (paths && paths.length) {
|
|
|
- this.path = paths[0]
|
|
|
- this.filesInfo = {
|
|
|
- name: this.getPathName(this.path),
|
|
|
- typeFlag: 1,
|
|
|
- localPath: this.path,
|
|
|
- fullname: this.getPathName(this.path),
|
|
|
- children: this.readDir(paths[0], true)
|
|
|
- }
|
|
|
- this.clientOrder = {
|
|
|
- userId: this.userInfo.id,
|
|
|
- storeId: this.storeInfo.id,
|
|
|
- productId: this.goodsInfo.id,
|
|
|
- orderName: this.getPathName(this.path),
|
|
|
- quantity: this.getPhotoNum(this.filesInfo),
|
|
|
- userOrderList: this.getOrderLiet(this.filesInfo),
|
|
|
- albumQuantity: 0
|
|
|
- }
|
|
|
+ var path = paths[0]
|
|
|
+ this.getPath(path)
|
|
|
|
|
|
}
|
|
|
},
|
|
|
+ getPath(path) {
|
|
|
+ this.oneOrder = false
|
|
|
+ this.path = path
|
|
|
+ this.filesInfo = {
|
|
|
+ name: this.getPathName(this.path),
|
|
|
+ typeFlag: 1,
|
|
|
+ localPath: this.path,
|
|
|
+ fullname: this.getPathName(this.path),
|
|
|
+ children: this.readDir(path, true)
|
|
|
+ }
|
|
|
+ this.clientOrder = {
|
|
|
+ userId: this.userInfo.id,
|
|
|
+ storeId: this.storeInfo.id,
|
|
|
+ productId: this.goodsInfo.id,
|
|
|
+ orderName: this.getPathName(this.path),
|
|
|
+ quantity: this.getPhotoNum(this.filesInfo),
|
|
|
+ userOrderList: this.getOrderLiet(this.filesInfo),
|
|
|
+ albumQuantity: 0
|
|
|
+ }
|
|
|
+ },
|
|
|
getOrderLiet(fileInfo) {
|
|
|
var list = []
|
|
|
if (this.oneOrder) {
|