fix
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
v-model="searchPictureName"
|
||||
@keydown.enter="getgenerate()"
|
||||
@click="inputFocus()"
|
||||
@paste="onPaste"
|
||||
/>
|
||||
<i class="fi fi-br-upload" :class="{ Guide_1_2_6:type_.type2 == 'Printboard'}" :title="$t('Generate.uploadTitle')" v-show="!isTextarea && upload.level1Type !== 'Moodboard' && scene?.value != 'Slogan' && scene?.value != 'Logo'">
|
||||
<a-upload
|
||||
@@ -737,10 +738,10 @@ export default defineComponent({
|
||||
file.id_ = GO.id++;
|
||||
file.categoryValue = category?.value;
|
||||
file.category = category?.name;
|
||||
let fileList = this.sketchboardList.filter(
|
||||
(v: any) => v.status === "done"
|
||||
);
|
||||
this.sketchboardList = fileList
|
||||
//判断是否粘贴来的图片
|
||||
let paste = this.sketchboardList.filter((v: any) => v.id === file.id);
|
||||
if(paste.length == 0)this.sketchboardList.push(file);
|
||||
this.sketchboardList = this.sketchboardList.filter((v: any) => v.status === "done");
|
||||
nextTick().then(()=>{
|
||||
if(this.driver__.driver){
|
||||
driverObj__.moveNext()
|
||||
@@ -851,6 +852,32 @@ export default defineComponent({
|
||||
// this.myMaterialModalShow = false
|
||||
this.searchPictureName = "";
|
||||
},
|
||||
onPaste(e:any){
|
||||
if(e.clipboardData.items[0] && !this.isTextarea && this.upload.level1Type !== 'Moodboard' && this.scene?.value != 'Slogan' && this.scene?.value != 'Logo'){
|
||||
let param = new FormData();
|
||||
param.append('inPin','0')
|
||||
param.append('gender',this.upload.gender)
|
||||
param.append('level1Type',this.upload.level1Type)
|
||||
param.append('timeZone',Intl.DateTimeFormat().resolvedOptions().timeZone)
|
||||
param.append('file',e.clipboardData.files[0]);
|
||||
let config:any = {headers:{'Content-Type':'multipart/form-data','Accept':'*/*' }}
|
||||
Https.axiosPost(Https.httpUrls.elementUpload, param, config).then((v)=>{
|
||||
let value = {data:v,errCode : 0}
|
||||
v.status = 'done'
|
||||
let data = {
|
||||
file:{
|
||||
status: 'done',
|
||||
xhr:{
|
||||
response:JSON.stringify(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
this.fileUploadChange(data)
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user