This commit is contained in:
X1627315083
2025-03-10 16:51:12 +08:00
parent 7165e2455f
commit a83346438e
24 changed files with 7094 additions and 2157 deletions

View File

@@ -10,7 +10,8 @@
<div class="my_material_header">
<div class="my_material_header_left" v-if="selectCode != 'Moodboard'">
<div class="select_block">
<a-select
<generalMenu :dataList="disignTypeList" @setprintModel="menuChange" :item="disignType"></generalMenu>
<!-- <a-select
ref="select"
v-model:value="disignType"
:options="disignTypeList"
@@ -23,7 +24,7 @@
style="color: #343579"
></span
></template>
</a-select>
</a-select> -->
</div>
</div>
@@ -46,9 +47,15 @@
<a-checkbox v-model:collectionChecked="item.pin">{{ $t('Material.PIN') }}</a-checkbox>
</div> -->
</div>
<div v-show="total > imgList?.length && total != 0" class="material_content_list_loding" v-observe>
<img src="@/assets/images/homePage/loading.gif" alt="">
<div v-show="!load.isNoData" class="material_content_list_loding">
<span class="page_loading" v-show="!isShowLoading" v-observe></span>
<span v-show="isShowLoading">
<img src="@/assets/images/homePage/loading.gif" alt="">
</span>
</div>
<!-- <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>
<!-- <div class="no_data_block loading_block" v-show="isShowLoading">
<a-spin size="large"></a-spin>
@@ -69,9 +76,10 @@ import { useI18n } from 'vue-i18n';
import { openGuide,driverObj__ } from "@/tool/guide";
import sketchCategory from "@/component/HomePage/sketchCategory.vue";
import printCategory from "@/component/HomePage/printCategory.vue";
import generalMenu from "@/component/HomePage/generalMenu.vue";
export default defineComponent({
components: { sketchCategory,printCategory },
components: { sketchCategory,printCategory,generalMenu },
props: ["msg",'disignTypeList'],
setup(prop) {
@@ -100,6 +108,10 @@ export default defineComponent({
name:'',
value:''
})
let load = ref({
isShowMark:false,
isNoData:false,
})
return{
myMaterialModalShow,
imgList,
@@ -117,6 +129,7 @@ export default defineComponent({
driver__,
usGenerateList,
disignType,
load,
}
},
data (prop) {
@@ -132,22 +145,36 @@ export default defineComponent({
observe:{
mounted (el,binding) {
// console.log(binding.instance);
const ob = new IntersectionObserver(callback,{
root:null,
threshold:[0.1]
})
ob.observe(el)
// this.currentPage = 1
// this.pageSize = 12
let this_:any = binding.instance
function callback(entries:any, observer:any) {
entries.forEach((entry:any) => {
if (entry.isIntersecting) {
this_.getLibraryList('di')
} else {
}
});
}
this_.load.isShowMark = false
this_.load.isNoData = false
let parentDom = el.parentNode
new IntersectionObserver(
(entries, observer) => {
// 如果不是相交,则直接返回
// console.log(entries[0]);
if (!entries[0].intersectionRatio) return;
this_.currentPage += 1
this_.getLibraryList('di')
},
// { root:worksPage }
).observe(el);
// const ob = new IntersectionObserver(callback,{
// // root:null,
// // threshold:[0.1]
// })
// ob.observe(el)
// console.log(el)
// // this.currentPage = 1
// // this.pageSize = 12
// let this_:any = binding.instance
// function callback(entries:any, observer:any) {
// entries.forEach((entry:any) => {
// if (!entries[0].intersectionRatio) return;
// console.log(123);
// // this_.getLibraryList('di')
// });
// }
},
},
},
@@ -253,9 +280,13 @@ export default defineComponent({
this.pageSize = 12
this.imgList = []
if(code != 'Moodboard'){
this.disignType = this.disignTypeList[0].value
this.disignType = this.disignTypeList[0]
}
this.getLibraryList('')
this.load = {
isShowMark:false,
isNoData:false,
}
this.handleChange()
},
setUseGenerate(arr:any){
@@ -317,9 +348,17 @@ export default defineComponent({
}
},
menuChange(data:any){
this.disignType = data
this.handleChange()
},
handleChange(){
this.currentPage = 1
this.imgList = []
this.load = {
isShowMark:false,
isNoData:false,
}
this.getLibraryList('')
},
upTypeSucced(){
@@ -327,6 +366,7 @@ export default defineComponent({
},
//选择所有的图片
async getLibraryList(str:any){
if(this.load.isShowMark && !this.load.isNoData)return
let workspace = JSON.parse(JSON.stringify(this.store.state.Workspace.workspace))
if(this.searchPictureName != this.isOldSearchPictureName || this.workspace?.sexEnum?.value != workspace.sexEnum.value){
this.imgList = []
@@ -334,12 +374,12 @@ export default defineComponent({
}else{
}
if(str == 'di'){
this.currentPage = this.imgList?.[0]?.id != undefined?this.imgList?.length / this.pageSize+1:1
}
// if(str == 'di'){
// this.currentPage = this.imgList?.[0]?.id != undefined?this.imgList?.length / this.pageSize+1:1
// }
let data = {
level1Type:this.selectCode,
level2Type: this.selectCode == 'Moodboard'?'':this.disignType,
level2Type: this.selectCode == 'Moodboard'?'':this.disignType.value,
modelSex:workspace?.sexEnum.value,
page: this.currentPage,
// page:this.currentPage,
@@ -353,6 +393,7 @@ export default defineComponent({
(rv: any) => {
this.total = rv.total
let aa:any = []
if(rv.content.length == 0)this.load.isNoData = true
rv.content.forEach((item:any,index:any) => {
let arr
if(this.type_.type2 == 'Sketchboard'){
@@ -392,6 +433,7 @@ export default defineComponent({
}
).catch((res)=>{
this.isShowLoading = false
this.load.isNoData = true
});
},
}
@@ -401,9 +443,10 @@ export default defineComponent({
.my_material_modal{
height: calc(30rem*1.2);
overflow-x: hidden;
border-right: 1px solid #e5e5e5;
flex: 1;
border-radius: 0;
display: flex;
flex-direction: column;
&.my_material_modal::-webkit-scrollbar{display: none;}
.ant-modal-close{
width: calc(3.6rem*1.2);
@@ -434,7 +477,7 @@ export default defineComponent({
padding: 0;
padding-top: calc(2.5rem*1.2);
padding-bottom: calc(2rem*1.2);
background-color: #fff;
// background-color: #fff;
position: sticky;
top: 0;
z-index: 2;
@@ -507,7 +550,8 @@ export default defineComponent({
// height: calc(100% - 6.6rem*1.2));
height: auto;
position: relative;
flex: 1;
overflow: hidden;
.material_content_top{
padding: calc(1.3rem*1.2) 0 calc(2.1rem*1.2);
height: calc(7rem*1.2);
@@ -571,14 +615,17 @@ export default defineComponent({
height: 100%;
overflow-y: auto;
position: relative;
height: calc(30rem*1.2);
&.material_content_body::-webkit-scrollbar{display: none;}
.content_img_item{
margin: 0 calc(2rem*1.2) calc(2rem*1.2) 0;
margin: 1rem;
display: inline-block;
width: calc(10rem*1.2);
height: calc(10rem*1.2);
// width: calc(16.5rem);
// height: calc(16.5rem);
// width: calc(10rem);
// height: calc(10rem);
width: calc(25% - 2rem);
aspect-ratio: 1 / 1;
border: 1px solid #f5f5f5;
position: relative;
cursor: pointer;
@@ -589,7 +636,7 @@ export default defineComponent({
height: 100%;
}
&.moodb{
margin: 0 calc(2rem*1.2) calc(2rem*1.2) 0;
// margin: 0 calc(2rem*1.2) calc(2rem*1.2) 0;
}
.pin_block{
.ant-checkbox-wrapper{
@@ -639,6 +686,13 @@ export default defineComponent({
}
.material_content_list_loding{
text-align: center;
height: 50px;
.page_loading{
display: block;
width: 50px;
height: 50px;
margin: 0 auto;
}
img{
height: calc(10rem*1.2);
}