2023-10-20

This commit is contained in:
2023-10-20 17:21:45 +08:00
parent 12ef707f64
commit bd9dabd21d
29 changed files with 1401 additions and 385 deletions

View File

@@ -34,7 +34,7 @@
>
<div
class="upload_file_item_content"
v-show="file?.status === 'uploading'"
v-show="file?.status === 'uploading'"
>
<a-spin
:indicator="indicator"
@@ -58,6 +58,7 @@
class="upload_file_item upload_component"
v-show="moodboarList.length < 8"
>
<a-upload
:action="uploadUrl + '/api/element/upload'"
list-type="picture-card"
@@ -65,8 +66,8 @@
...upload,
}"
:headers="{ Authorization: token }"
v-model:file-list="fileList"
:before-upload="beforeUpload"
v-model:file-list="fileList"
multiple
:maxCount="8 - moodboarList.length+fileList.length"
accept=".jpg,.png,.jpeg,.bmp"
@@ -160,6 +161,7 @@ export default defineComponent({
const store = useStore()
let lessenList: any = ref([]);
let fileList: any = ref([]);
let showFileList: any = ref([]);
let templateModal: any = ref(false);
let templateFileList: any = ref([]);
let openClick: any = ref(1);
@@ -171,8 +173,10 @@ export default defineComponent({
let modalImg:any= computed(()=>{
return store.state.UploadFilesModule.disposeMoodboard
})
let uploading:any = ref([])
return {
fileList,
showFileList,
lessenList,
templateModal,
templateFileList,
@@ -182,7 +186,8 @@ export default defineComponent({
layoutList,
layoutOpen,
loadingShow,
modalImg
modalImg,
uploading
};
},
data() {
@@ -223,8 +228,16 @@ export default defineComponent({
watch:{
fileList:{
handler(newVal:any,oldVal:any){
console.log(newVal,oldVal);
// console.log(111);
// if(this.uploading.length<newVal.length){
// for (let index = 1; this.uploading.length < newVal.length; index++) {
// this.uploading.push(false)
// }
// }else{
// if(newVal[newVal.length-1].status == 'dome')
// this.uploading[this.uploading-1] = true
// }
}
}
},
@@ -283,6 +296,7 @@ export default defineComponent({
}else{
this.store.commit("setMoodboardFile", fileList);
}
// this.showFileList = this.fileList
} else if (file.status === "error") {
let index = -1;
this.fileList.forEach((ele: any, index1: any) => {
@@ -295,6 +309,7 @@ export default defineComponent({
}
message.error(file.name + "upload failed");
}
},
beforeUpload(file: any) {
const isJpgOrPng =
@@ -351,6 +366,8 @@ export default defineComponent({
material:[] as any,
moodboard:[] as any,
}
console.log(disposeMoodboard);
arr.forEach((v:any)=>{
if(v.type_.type1 == 'generate'){
setboard.generate.push(v)
@@ -360,7 +377,6 @@ export default defineComponent({
setboard.moodboard.push(v)
}
})
this.store.commit("setMoodboardGenerateFiles", setboard.generate);
this.store.commit("setMoodboardMaterialFiles", setboard.material);
this.store.commit("setMoodboardFile", setboard.moodboard);
@@ -547,12 +563,15 @@ export default defineComponent({
.modal_img_item{
width: 4rem;
height: 4rem;
text-align: center;
margin: 0 1rem 1rem 0;
position: relative;
cursor: pointer;
img{
width: 100%;
width: auto;
height: 100%;
max-width: 100%;
object-fit: cover;
}
.checked{
position: absolute;