commit
This commit is contained in:
@@ -65,7 +65,9 @@
|
||||
<a-checkbox v-model:checked="item.pin">PIN</a-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-show="total > imgList.length" class="material_content_list_loding">
|
||||
<img src="@/assets/images/homePage/loading.gif" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="no_data_block loading_block" v-show="isShowLoading">
|
||||
<a-spin size="large"></a-spin>
|
||||
@@ -88,29 +90,13 @@ export default defineComponent({
|
||||
setup(prop) {
|
||||
let myMaterialModalShow = ref(false)
|
||||
let imgList = ref([
|
||||
{
|
||||
imgUrl: "https://illlustrations.co/static/32913fde3ee589609d98f16c51fcffa6/ee604/day8-printer.png",
|
||||
id_: 1,
|
||||
},
|
||||
{
|
||||
imgUrl: "https://illlustrations.co/static/3edf742257c1d1460eb2e2f998a1df96/ee604/day4-polariod.png",
|
||||
id_: 2,
|
||||
},
|
||||
{
|
||||
imgUrl: "https://illlustrations.co/static/475732e63175f7dc3bf93c84af8b3d11/ee604/day6-open-vault.png",
|
||||
id_: 3,
|
||||
},
|
||||
{
|
||||
imgUrl: "https://illlustrations.co/static/ca430674ef56f1a3a91f705670fd8512/ee604/day17-walkie-talkie.png",
|
||||
id_: 4,
|
||||
},
|
||||
])
|
||||
let store = useStore()
|
||||
let isShowLoading:any = ref(false)
|
||||
let selectCode:any = ref('')
|
||||
let currentPage:any = ref(1)
|
||||
let searchPictureName = ref('')
|
||||
let pageSize = ref(20)
|
||||
let pageSize = ref(12)
|
||||
let total = ref(0)
|
||||
let searcMaterialhName:any = ref('') //搜索名字
|
||||
let designType:any = ref(null)
|
||||
@@ -180,22 +166,28 @@ export default defineComponent({
|
||||
this.selectCode = code
|
||||
// this.myMaterialModalShow = true
|
||||
if(this.imgList.length == 0){
|
||||
this.getLibraryList()
|
||||
}
|
||||
this.getLibraryList()
|
||||
let loding = document.getElementsByClassName("material_content_list_loding")[0]
|
||||
const ob = new IntersectionObserver(callback,{
|
||||
root:null,
|
||||
threshold:.8
|
||||
})
|
||||
|
||||
let this_ = this
|
||||
function callback(entries:any, observer:any) {
|
||||
entries.forEach((entry:any) => {
|
||||
if (entry.isIntersecting) {
|
||||
this_.getLibraryList()
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
ob.observe(loding)
|
||||
},
|
||||
|
||||
selectImgItem(imgData:any){
|
||||
// this.selectImgListIds = this.selectImgList.map((v:any)=>v.id)
|
||||
// if(this.selectImgListIds.indexOf(imgData.id) === -1){
|
||||
// this.selectImgList.push(imgData)
|
||||
// this.selectImgListIds.push(imgData.id)
|
||||
// }else{
|
||||
// let index = this.selectImgListIds.indexOf(imgData.id)
|
||||
// this.selectImgList.splice(index,1)
|
||||
// this.selectImgListIds.splice(index,1)
|
||||
// }
|
||||
imgData.type_ = this.type_
|
||||
|
||||
imgData.resData = JSON.parse(JSON.stringify(imgData))
|
||||
this.store.commit("addGenerateMaterialFils", imgData);
|
||||
},
|
||||
@@ -220,24 +212,42 @@ export default defineComponent({
|
||||
// level2Type:this.designType,
|
||||
page:this.currentPage,
|
||||
pictureName:this.searchPictureName,
|
||||
size:this.pageSize,
|
||||
size:this.pageSize+this.imgList.length,
|
||||
}
|
||||
this.isShowLoading = true
|
||||
Https.axiosPost(Https.httpUrls.queryLibraryPage,data).then(
|
||||
(rv: any) => {
|
||||
let aa:any = []
|
||||
this.imgList = rv.content
|
||||
rv.content.forEach((item:any) => {
|
||||
rv.content.forEach((item:any,index:any) => {
|
||||
if(this.type_.type2 == 'Sketchboard'){
|
||||
item.category = "Outwear";
|
||||
item.categoryShow = false;
|
||||
}
|
||||
if(!item.id_){
|
||||
item.id_ = GO.id++
|
||||
aa.push(item)
|
||||
}else{
|
||||
aa.push(item)
|
||||
}
|
||||
// let arr
|
||||
// if(this.type_.type2 == 'Sketchboard'){
|
||||
// arr = this.store.state.UploadFilesModule.sketchMaterialFiles
|
||||
// item.category = "Outwear";
|
||||
// item.categoryShow = false;
|
||||
// }else if(this.type_.type2 == 'Moodboard'){
|
||||
// arr = this.store.state.UploadFilesModule.moodboardMaterialFiles
|
||||
// }else if(this.type_.type2 == 'Printboard'){
|
||||
// arr = this.store.state.UploadFilesModule.printMaterialFiles
|
||||
// }
|
||||
item.imgUrl = item.url
|
||||
aa.push(item)
|
||||
|
||||
// if(!item.id_){
|
||||
// item.id_ = GO.id++
|
||||
// aa.push(item)
|
||||
// arr.forEach((v:any)=>{
|
||||
// if(item.id == v.id){
|
||||
// v.checked = false
|
||||
// }
|
||||
// })
|
||||
// }else{
|
||||
// aa.push(item)
|
||||
// }
|
||||
|
||||
});
|
||||
this.imgList = aa
|
||||
this.total = rv.total
|
||||
@@ -247,8 +257,6 @@ export default defineComponent({
|
||||
this.isShowLoading = false
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
closeModal(){
|
||||
this.myMaterialModalShow = false
|
||||
this.searchPictureName = ''
|
||||
@@ -385,7 +393,7 @@ export default defineComponent({
|
||||
box-sizing: border-box;
|
||||
|
||||
.material_content_top_title{
|
||||
font-size: 20px;
|
||||
font-size: 2rem;
|
||||
color: #030303;
|
||||
}
|
||||
|
||||
@@ -439,7 +447,8 @@ export default defineComponent({
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
&.generate::-webkit-scrollbar{display: none;}
|
||||
height: 30rem;
|
||||
&.material_content_body::-webkit-scrollbar{display: none;}
|
||||
|
||||
.content_img_item{
|
||||
margin: 0 2rem 5rem 0;
|
||||
@@ -484,7 +493,12 @@ export default defineComponent({
|
||||
color: #030303;
|
||||
}
|
||||
}
|
||||
|
||||
.material_content_list_loding{
|
||||
text-align: center;
|
||||
img{
|
||||
height: 10rem;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user