This commit is contained in:
X1627315083
2023-12-19 16:36:48 +08:00
parent c50c6e76f9
commit 904b9856fd
18 changed files with 103 additions and 40 deletions

View File

@@ -65,7 +65,7 @@
<a-checkbox v-model:checked="item.pin">{{ $t('Material.PIN') }}</a-checkbox>
</div>
</div>
<div v-show="total > imgList?.length" class="material_content_list_loding" v-observe>
<div v-show="total > imgList?.length && total != 0" class="material_content_list_loding" v-observe>
<img src="@/assets/images/homePage/loading.gif" alt="">
</div>
</div>
@@ -95,6 +95,7 @@ export default defineComponent({
let selectCode:any = ref('')
let currentPage:any = ref(1)
let searchPictureName = ref('')
let isOldSearchPictureName = ref('')
let pageSize = ref(12)
let total = ref(0)
let searcMaterialhName:any = ref('') //搜索名字
@@ -112,6 +113,7 @@ export default defineComponent({
selectCode,
currentPage,
searchPictureName,
isOldSearchPictureName,
pageSize,
total,
searcMaterialhName,
@@ -287,6 +289,7 @@ export default defineComponent({
this.isShowLoading = true
Https.axiosPost(Https.httpUrls.queryLibraryPage,data).then(
(rv: any) => {
this.total = rv.total
let aa:any = []
rv.content.forEach((item:any,index:any) => {
let arr
@@ -315,13 +318,16 @@ export default defineComponent({
}
aa.push(item)
});
if(aa[aa.length-1].id == this.imgList[this.imgList.length-1]?.id){
if(this.searchPictureName != this.isOldSearchPictureName){
this.imgList = []
}else{
}
this.isOldSearchPictureName = this.searchPictureName
if((aa[aa.length-1].id == this.imgList[this.imgList.length-1]?.id) && aa?.[aa.length-1]?.id){
}else{
this.imgList.push(...aa)
}
// this.imgList = aa
this.total = rv.total
this.isShowLoading = false
}
).catch((res)=>{

View File

@@ -97,9 +97,6 @@ export default defineComponent({
watch: {
sketchList:{
handler(newVal:any,oldVal:any){
console.log(oldVal,newVal);
console.log(this.sketchList );
// this.sketchList = []
// this.sketch = [[],[],[]]
// this.sketchList = this.allBoardData.sketchboardFiles

View File

@@ -180,7 +180,7 @@ export default defineComponent({
}
});
},
isPin(str:any){
isPin(str:any,resolve:any){
let _this = this
Modal.confirm({
title: this.t('collectionModal.jsContent5',{str:str}),
@@ -190,16 +190,17 @@ export default defineComponent({
mask:false,
centered:true,
onOk() {
return true
resolve(true)
// return true
},
onCancel(){
_this.isShowMark = false
return false
resolve(false)
}
});
// message.warning(this.t('SketchboardUpload.jsContent1',str:str));
},
isPinOpen(list:any){
async isPinOpen(list:any){
this.workspace
let numTop = 0
let numBottom = 0
@@ -232,26 +233,32 @@ export default defineComponent({
numTop++
}
});
top.forEach((positionItem:any) => {
bottom.forEach((positionItem:any) => {
if(item.category == positionItem && item.pin){
numBottom++
}
});
});
let str
if(numTop >= 8){
str = `top ${topStr.join(' and ')}`
return this.isPin(str)
}else if(numBottom >= 8){
str = `bottom ${bottomStr.join(' and ')}`
return this.isPin(str)
}else{
return true
}
let bor
await new Promise(async (resolve:any)=>{
let str
if(numTop >= 8){
str = `top ${topStr.join(' and ')}`
this.isPin(str,resolve)
return
}else if(numBottom >= 8){
str = `bottom ${bottomStr.join(' and ')}`
this.isPin(str,resolve)
}else{
resolve(true)
}
}).then((v:any)=>{
bor = v
})
return bor
},
//完成
finishCollection(){
async finishCollection(){
this.isShowMark = true
let sketchList = this.store.state.UploadFilesModule.sketchboard
let arr:any = []
@@ -265,8 +272,7 @@ export default defineComponent({
arr.push(obj)
});
let data = {sketchBoards:arr}
// console.log(this.position);
if(!this.isPinOpen(sketchList)){
if(!await this.isPinOpen(sketchList)){
this.isShowMark = false
return
}