修复librarybug

This commit is contained in:
X1627315083
2024-02-02 17:42:39 +08:00
parent 31d2e71ab7
commit eca1a39771

View File

@@ -92,7 +92,7 @@
<div :class="['header_operate_item' , 'fontSize',selectImgList.length>0?'active':'']" @click="showRenameModal(selectImgList,'batch')">{{ $t('LibraryPage.Rename') }}</div>
</div>
<div class="content_search_block">
<input class="search_input" :placeholder="$t('LibraryPage.inputContent1')" v-model="searchPictureName" @keydown.enter="getLibraryList()">
<input class="search_input" :placeholder="$t('LibraryPage.inputContent1')" v-model="searchPictureName" @keydown.enter="getLibraryList('')">
<div class="search_cascader">
<!-- <a-cascader
@click.stop="dropdownVisibleChange"
@@ -137,8 +137,8 @@
<div :title="$t('LibraryPage.unionSet')" @click="()=>intersection = 1" v-show="intersection == 0" :class="['icon', 'iconfont','icon-bingji',]"></div>
<div :title="$t('LibraryPage.intersection')" @click="()=>intersection = 0" v-show="intersection == 1" :class="['icon', 'iconfont','icon-bingji1',]"></div>
</div>
<!-- <div class="search_icon_block" @click="getLibraryList()"><span class="icon iconfont icon-sousuo"></span></div> -->
<div class="generage_btn search_icon_block" @click="getLibraryList()"><span class="icon iconfont icon-sousuo"></span></div>
<!-- <div class="search_icon_block" @click="getLibraryList('')"><span class="icon iconfont icon-sousuo"></span></div> -->
<div class="generage_btn search_icon_block" @click="getLibraryList('')"><span class="icon iconfont icon-sousuo"></span></div>
</div>
</div>
<div v-show="imgList.length" :class="['check_all_block',selectImgList.length == imgList.length ? 'check_all' : '']" @click="selectAllImg()">
@@ -464,6 +464,7 @@ export default defineComponent({
let selectImgList:any = ref([])
let selectCode:any = ref('Moodboard')
let searchPictureName = ref('')
let newSearchPictureName = ref('')
let designType:any = ref('Outwear')
let sex:any = ref('Meal')
let sexList:any = [
@@ -550,11 +551,13 @@ export default defineComponent({
let isGenerate:any = ref(false)
let remGenerate:any = ref(false)
let remGenerateTime:any = ref()
let getLibraryListInputTime:any = ref()
return {
menuList,
selectImgList,
selectCode,
searchPictureName,
newSearchPictureName,
sexList,
sex,
disignTypeList,
@@ -595,6 +598,7 @@ export default defineComponent({
isGenerate,
remGenerate,
remGenerateTime,
getLibraryListInputTime,
}
},
data(this_) {
@@ -619,6 +623,14 @@ export default defineComponent({
sex(newVal,oldVal){
this.upload.gender = newVal.value
},
searchPictureName(newVal,oldVal){
clearTimeout(this.getLibraryListInputTime)
this.getLibraryListInputTime = setTimeout(() => {
if(newVal != oldVal){
this.currentPage = 1
}
}, 500);
},
},
async mounted(){
let userInfo:any = getCookie("userInfo")
@@ -626,7 +638,7 @@ export default defineComponent({
this.isTest =JSON.parse(isTest)
this.userInfo = JSON.parse(userInfo);
this.uploadUrl = getUploadUrl()
this.getLibraryList()
this.getLibraryList('')
this.getClass()
this.getSex()
this.token = getCookie("token") || "";
@@ -718,7 +730,7 @@ export default defineComponent({
this.selectImgList = []
this.selectSingleImg = {}
this.value.labelValue = []
this.getLibraryList()
this.getLibraryList('')
this.getClass()
this.uploadGenerate = 'Upload'
this.captionGeneration = ''
@@ -747,10 +759,12 @@ export default defineComponent({
async sexChange(){
await this.getPosition()
this.getLibraryList()
this.currentPage = 1
this.getLibraryList('')
},
handleChange(){
this.getLibraryList()
this.currentPage = 1
this.getLibraryList('')
},
fileUploadChange(data:any){
@@ -787,7 +801,7 @@ export default defineComponent({
changePage(current: number, pageSize: number){
this.currentPage = current
this.pageSize = pageSize
this.getLibraryList()
this.getLibraryList('page')
},
//选择图片
@@ -884,7 +898,7 @@ export default defineComponent({
// }
this.value.labelValue = []
this.getLibraryList()
this.getLibraryList('')
this.closeRenameModal()
},
@@ -938,7 +952,7 @@ export default defineComponent({
uploadGenerateOpen(str:any){
if(this.uploadGenerate == 'Generate'){
if(str != 'Generate'){
this.getLibraryList()
this.getLibraryList('')
}
}
this.uploadGenerate = str
@@ -991,7 +1005,7 @@ export default defineComponent({
this.imgList.splice(index, 1)
}else{
this.selectImgList = []
this.getLibraryList()
this.getLibraryList('')
}
}
).catch((res)=>{
@@ -1063,14 +1077,14 @@ export default defineComponent({
}else{
this.currentUploadFileNum --
if(!this.currentUploadFileNum){
this.getLibraryList()
this.getLibraryList('')
}
}
}
).catch((res)=>{
this.currentUploadFileNum --
if(!this.currentUploadFileNum){
this.getLibraryList()
this.getLibraryList('')
}
});
},
@@ -1090,25 +1104,25 @@ export default defineComponent({
(rv: any) => {
_this.currentUploadFileNum --
if(!_this.currentUploadFileNum){
_this.getLibraryList()
_this.getLibraryList('')
}
}
).catch((res)=>{
_this.currentUploadFileNum --
if(!_this.currentUploadFileNum){
_this.getLibraryList()
_this.getLibraryList('')
}
});
},
onCancel(){
_this.currentUploadFileNum --
if(!_this.currentUploadFileNum){
_this.getLibraryList()
_this.getLibraryList('')
}
}
});
},
getLibraryList(){
getLibraryList(str:any){
let labelArr:any = []
this.value.labelValue.forEach((item:any)=>{
labelArr.push(item[item.length-1])
@@ -1118,18 +1132,27 @@ export default defineComponent({
classificationIdList:labelArr,
level1Type:this.selectCode,
level2Type:designType,
page:this.currentPage,
page:1,
modelSex:this.sex.value?this.sex.value:'',
pictureName:this.searchPictureName,
size:this.pageSize,
intersection:this.intersection,
}
if(str == 'page'){
data.page = this.currentPage
}
this.isShowMark = true
Https.axiosPost(Https.httpUrls.queryLibraryPage,data).then(
(rv: any) => {
this.imgList = rv.content
this.total = rv.total
this.isShowMark = false
if(rv.content.length == 0){
this.currentPage = 1
this.getLibraryList('')
}else{
this.imgList = rv.content
this.total = rv.total
this.newSearchPictureName = this.searchPictureName
this.isShowMark = false
}
}
).catch((res)=>{
this.isShowMark = false