This commit is contained in:
WangXiaoDong
2023-08-23 17:50:09 +08:00
parent d41b331e38
commit 2fda4a8c36
20 changed files with 2587 additions and 332 deletions

View File

@@ -11,7 +11,7 @@
<div class="my_material_header_right">
<div class="content_search_block">
<input class="search_input" placeholder="Please input" v-model="searchPictureName" @keydown.enter="getLibraryList()">
<div class="search_icon_block" @click="getLibraryList()"><span class="icon iconfont icon-sousuo"></span></div>
<div class="search_icon_block" @click.stop="getLibraryList()"><span class="icon iconfont icon-sousuo"></span></div>
</div>
</div>
</div>
@@ -44,10 +44,58 @@
</div>
</div> -->
<div class="material_content_body scroll_style">
<div class="content_img_item" v-for="(img) in imgList" :key="img.id" @click="selectImgItem(img)">
<div class="content_img_item_block" :class="{active:img?.checked}">
<img :class="[selectCode == 'Moodboard' || selectCode == 'Printboard' ? 'print_content_img' : 'content_img']" v-lazy="img.url" :key="img.url" :alt="img.name"/>
<div class="content_img_item" v-for="(file) in imgList" :key="file.id" :class="{active:type_.type2 !== 'Moodboard'}">
<div class="content_img_item_block" :class="{active:file?.checked}">
<img :class="[selectCode == 'Moodboard' || selectCode == 'Printboard' ? 'print_content_img' : 'content_img']" v-lazy="file.url" :key="file.url" :alt="file.name" @click.stop="selectImgItem(file)"/>
<div class="operate_file_block" v-if="type_.type2 == 'Sketchboard'">
<div class="select_img_type">
<div
class="select_category"
@click.stop="showFileCategory(file)"
>
{{ getSketchLabel(file.category) }}
<div
:class="[
'icon',
'iconfont',
'icon-xiala',
file.categoryShow
? 'icon_rotate'
: '',
]"
></div>
</div>
<div
class="category_list"
v-show="file.categoryShow"
>
<div
:class="[
'category_item',
file.category == cate.value
? 'select_category_item'
: '',
]"
v-for="(
cate, index
) in disignTypeList"
:key="index"
@click.stop="
selectFileCategory(
file,
cate
)
"
>
{{ cate.label }}
</div>
</div>
</div>
</div>
</div>
<div class="pin_block">
<a-checkbox v-model:checked="file.pin">PIN</a-checkbox>
</div>
<!-- <div class="content_img_name">{{img.name}}</div> -->
</div>
@@ -134,6 +182,21 @@ export default defineComponent({
}
}
},
computed: {
getSketchLabel(value:any) {
return (value: any) => {
let lable = "";
for (let item of this.disignTypeList) {
if (item.value === value) {
lable = item.label;
break;
}
}
return lable;
};
},
},
methods:{
init(code:any){
@@ -187,6 +250,10 @@ export default defineComponent({
let aa:any = []
this.imgList = rv.content
rv.content.forEach((item:any) => {
if(this.type_.type2 == 'Sketchboard'){
item.category = "Outwear";
item.categoryShow = false;
}
if(!item.id_){
item.id_ = GO.id++
aa.push(item)
@@ -212,7 +279,23 @@ export default defineComponent({
this.currentPage = 1
this.pageSize = 10
this.total = 0
}
},
showFileCategory(file: any) {
file.categoryShow = true;
document.addEventListener("click", this.hiddenFileCategory);
},
selectFileCategory(file: any, cate: any) {
file.category = cate.value;
for (let item of (this.imgList as any)) {
item.categoryShow = false;
}
},
hiddenFileCategory() {
for (let item of (this.imgList as any)) {
item.categoryShow = false;
}
document.removeEventListener("click", this.hiddenFileCategory);
},
}
})
</script>
@@ -383,6 +466,16 @@ export default defineComponent({
// margin-bottom: 2.8rem;
margin: 0 2rem 2rem 0;
padding: 0;
&.active{
height: 10rem;
margin: 0 2rem 4rem 0;
.pin_block{
display: block;
}
}
.pin_block{
display: none;
}
.content_img_item_block{
// border: 0.1rem solid transparent;
width: 10rem;