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