|
|
|
|
@ -90,7 +90,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-show="upload.id" style="width: 360px;margin-left: 20px;">
|
|
|
|
|
<el-upload :show-file-list="false" :fileSize="100"
|
|
|
|
|
<el-upload :show-file-list="false"
|
|
|
|
|
ref="upload"
|
|
|
|
|
action="#"
|
|
|
|
|
accept="image/*"
|
|
|
|
|
@ -101,7 +101,7 @@
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-upload"></i>
|
|
|
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
|
|
<div class="el-upload__tip" slot="tip">只能上传图片,且不超过100MB</div>
|
|
|
|
|
<div class="el-upload__tip" slot="tip">只能上传图片,且不超过{{ upload.fileSize }}MB</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
|
|
|
|
|
<ul class="el-upload-list el-upload-list--text" style="max-height:200px;overflow-y:scroll;padding: 15px;">
|
|
|
|
|
@ -254,6 +254,7 @@ export default {
|
|
|
|
|
muName: undefined,
|
|
|
|
|
// 用户导入参数
|
|
|
|
|
upload: {
|
|
|
|
|
fileSize: 300, //MB
|
|
|
|
|
loading: false,
|
|
|
|
|
// 是否显示弹出层(用户导入)
|
|
|
|
|
open: false,
|
|
|
|
|
@ -490,52 +491,82 @@ export default {
|
|
|
|
|
// 确认上传文件提交
|
|
|
|
|
submitFiles(type) {
|
|
|
|
|
if(type===1){
|
|
|
|
|
|
|
|
|
|
if(this.smwj.list.length>0){
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
let fileSize = 0;
|
|
|
|
|
this.smwj.list.forEach((item) => {
|
|
|
|
|
formData.append('files', this.dataURLtoFile(item.base64Str, item.fileName));
|
|
|
|
|
});
|
|
|
|
|
const DaPicturesRecard = {}
|
|
|
|
|
DaPicturesRecard.muId = this.dangAnNode.key;
|
|
|
|
|
DaPicturesRecard.muPath = this.getAllLabels(this.dangAnNode);
|
|
|
|
|
DaPicturesRecard.ywType = this.dangAnNode.data.ywType;
|
|
|
|
|
DaPicturesRecard.wlsjId = this.smwj.wlsjNode.key;
|
|
|
|
|
DaPicturesRecard.wlsjPath = this.getAllLabels(this.smwj.wlsjNode);
|
|
|
|
|
formData.append('picRecard', new Blob([JSON.stringify(DaPicturesRecard)],{ type: 'application/json', }));
|
|
|
|
|
this.smwj.loading = true;
|
|
|
|
|
collectSaves(formData).then(response => {
|
|
|
|
|
this.pictureRecard = response.data;
|
|
|
|
|
this.smwj.open = false;
|
|
|
|
|
this.smwj.loading = false;
|
|
|
|
|
}).catch(err=>{
|
|
|
|
|
this.smwj.loading = false;
|
|
|
|
|
item.file = this.dataURLtoFile(item.base64Str, item.fileName);
|
|
|
|
|
fileSize += item.file.size;
|
|
|
|
|
formData.append('files', item.file);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
console.log(22222, fileSize/1024/1024);
|
|
|
|
|
|
|
|
|
|
// 文件最大限制
|
|
|
|
|
if(fileSize/1024/1024 < this.upload.fileSize){
|
|
|
|
|
const DaPicturesRecard = {}
|
|
|
|
|
DaPicturesRecard.muId = this.dangAnNode.key;
|
|
|
|
|
DaPicturesRecard.muPath = this.getAllLabels(this.dangAnNode);
|
|
|
|
|
DaPicturesRecard.ywType = this.dangAnNode.data.ywType;
|
|
|
|
|
DaPicturesRecard.wlsjId = this.smwj.wlsjNode.key;
|
|
|
|
|
DaPicturesRecard.wlsjPath = this.getAllLabels(this.smwj.wlsjNode);
|
|
|
|
|
formData.append('picRecard', new Blob([JSON.stringify(DaPicturesRecard)], {type: 'application/json',}));
|
|
|
|
|
this.smwj.loading = true;
|
|
|
|
|
collectSaves(formData).then(response => {
|
|
|
|
|
this.pictureRecard = response.data;
|
|
|
|
|
this.smwj.open = false;
|
|
|
|
|
this.smwj.loading = false;
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
this.smwj.loading = false;
|
|
|
|
|
});
|
|
|
|
|
}else {
|
|
|
|
|
this.$alert(`上传文件大小不能超过 ${this.upload.fileSize} MB!`, `提示`, {
|
|
|
|
|
type: 'warning'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
this.$alert(`请先开始扫描!`, `提示`, {
|
|
|
|
|
type: 'warning'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
|
|
if(this.fileList.length>0){
|
|
|
|
|
const formData = new FormData();
|
|
|
|
|
let fileSize = 0;
|
|
|
|
|
this.fileList.forEach((file) => {
|
|
|
|
|
fileSize += file.size;
|
|
|
|
|
formData.append('files', file);
|
|
|
|
|
});
|
|
|
|
|
const DaPicturesRecard = {}
|
|
|
|
|
DaPicturesRecard.muId = this.dangAnNode.key;
|
|
|
|
|
DaPicturesRecard.muPath = this.getAllLabels(this.dangAnNode);
|
|
|
|
|
DaPicturesRecard.ywType = this.dangAnNode.data.ywType;
|
|
|
|
|
DaPicturesRecard.wlsjId = this.upload.wlsjNode.key;
|
|
|
|
|
DaPicturesRecard.wlsjPath = this.getAllLabels(this.upload.wlsjNode);
|
|
|
|
|
formData.append('picRecard', new Blob([JSON.stringify(DaPicturesRecard)],{ type: 'application/json', }));
|
|
|
|
|
this.upload.loading = true;
|
|
|
|
|
collectSaves(formData).then(response => {
|
|
|
|
|
this.pictureRecard = response.data;
|
|
|
|
|
this.upload.open = false;
|
|
|
|
|
this.upload.loading = false;
|
|
|
|
|
}).catch(err=>{
|
|
|
|
|
this.upload.loading = false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 文件最大限制
|
|
|
|
|
if(fileSize/1024/1024 < this.upload.fileSize){
|
|
|
|
|
|
|
|
|
|
const DaPicturesRecard = {}
|
|
|
|
|
DaPicturesRecard.muId = this.dangAnNode.key;
|
|
|
|
|
DaPicturesRecard.muPath = this.getAllLabels(this.dangAnNode);
|
|
|
|
|
DaPicturesRecard.ywType = this.dangAnNode.data.ywType;
|
|
|
|
|
DaPicturesRecard.wlsjId = this.upload.wlsjNode.key;
|
|
|
|
|
DaPicturesRecard.wlsjPath = this.getAllLabels(this.upload.wlsjNode);
|
|
|
|
|
formData.append('picRecard', new Blob([JSON.stringify(DaPicturesRecard)], {type: 'application/json',}));
|
|
|
|
|
this.upload.loading = true;
|
|
|
|
|
|
|
|
|
|
collectSaves(formData).then(response => {
|
|
|
|
|
this.pictureRecard = response.data;
|
|
|
|
|
this.upload.open = false;
|
|
|
|
|
this.upload.loading = false;
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
this.upload.loading = false;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
this.$alert(`上传文件大小不能超过 ${this.upload.fileSize} MB!`, `提示`, {
|
|
|
|
|
type: 'warning'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
this.$alert(`请先上传图片!`, `提示`, {
|
|
|
|
|
type: 'warning'
|
|
|
|
|
@ -603,11 +634,21 @@ export default {
|
|
|
|
|
this.checkLength = arr.length;
|
|
|
|
|
|
|
|
|
|
if(arr.length>0){
|
|
|
|
|
|
|
|
|
|
const loading = this.$loading({
|
|
|
|
|
lock: true,
|
|
|
|
|
text: 'Loading',
|
|
|
|
|
spinner: 'el-icon-loading',
|
|
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
collectRecongnize(arr).then(response => {
|
|
|
|
|
this.pictureRecard = [];
|
|
|
|
|
this.checkAll = false;
|
|
|
|
|
this.$modal.msgSuccess(response.msg);
|
|
|
|
|
loading.close();
|
|
|
|
|
}).catch((err)=>{
|
|
|
|
|
loading.close();
|
|
|
|
|
console.log(123,err);
|
|
|
|
|
if(err.taskId){
|
|
|
|
|
this.taskId = err.taskId;
|
|
|
|
|
@ -688,21 +729,6 @@ export default {
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
.myProgress{
|
|
|
|
|
position: fixed;
|
|
|
|
|
top:0;
|
|
|
|
|
left:0;
|
|
|
|
|
z-index: 10000;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
background: rgba(0,0,0,0.7);
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
|
|
|
|
.sm_col{
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|