调整多选修改标签功能

This commit is contained in:
X1627315083
2024-01-04 14:51:57 +08:00
parent 21c5fad138
commit 6abd6816d9
10 changed files with 150 additions and 63 deletions

View File

@@ -88,7 +88,7 @@
</a-upload>
</div>
<div :class="['header_operate_item' , 'fontSize',selectImgList.length>0?'active':'']" @click="deleteBatchPic()">{{ $t('LibraryPage.Delete') }}</div>
<div :class="['header_operate_item' , 'fontSize',selectImgList.length>0?'active':'']" @click="showRenameModal('','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 class="content_search_block">
<input class="search_input" :placeholder="$t('LibraryPage.inputContent1')" v-model="searchPictureName" @keydown.enter="getLibraryList()">
@@ -187,7 +187,7 @@
<div class="content_body_header content_body_header_generate">
<div class="content_body_header_right" >
<div class="content_body_header_right" v-show="selectCode != 'Moodboard'">
<div class="checkboxItem">
<div class="checkboxItem" v-show="selectCode != 'Sketchboard'">
<label>
<input
type="checkbox"
@@ -570,7 +570,6 @@ export default defineComponent({
this.getClass()
this.getSex()
this.token = getCookie("token") || "";
},
methods:{
@@ -667,6 +666,22 @@ export default defineComponent({
}
this.upload.level1Type = menu.code
}
if(this.selectCode == 'Sketchboard'){
this.checkbox=[
{
name: "image",
type: false,
},
{
name: "text",
type: true,
},
{
name: "text-image",
type: false,
},
]
}
},
async sexChange(){
@@ -769,27 +784,35 @@ export default defineComponent({
if(this.newPicName){//多选修改名字
await Https.axiosPost(Https.httpUrls.batchUpdateLibraryName, data).then(
(rv: any) => {
if(this.renameType ==='batch'){
this.selectImgList = []
}
// if(this.renameType ==='batch'){
// this.selectImgList = []
// }
bor = true
}
).catch((res)=>{
// this.closeRenameModal()
});
}
if(labelArr.length > 0 && this.renameType == 'batch'){//多选修改标签
if(this.renameType == 'single'){//多选修改标签
await Https.axiosPost(Https.httpUrls.relationLibrary, data2).then(
(rv: any) => {
bor = true
}
).catch((res)=>{
// this.closeRenameModal()
});
}else{
await Https.axiosPost(Https.httpUrls.editRelPublicClassificationIdList, data2).then(
(rv: any) => {
bor = true
}
).catch((res)=>{
});
}
if(bor){
this.getLibraryList()
}
// if(bor){
// }
this.value.labelValue = []
this.getLibraryList()
this.closeRenameModal()
},
@@ -797,7 +820,6 @@ export default defineComponent({
showRenameModal(data:any,type:any){
this.newPicName = ''
if(type =='batch' && !this.selectImgList.length){ //批量但未选中
this.value.labelValue = []
this.newPicName = ''
return
}
@@ -815,31 +837,24 @@ export default defineComponent({
"userId": 0
}
this.value.editLabelValue = []
this.selectSingleImg = data
this.newPicName = data.name
if(type === 'single'){
this.selectSingleImg = data
this.newPicName = data.name
Https.axiosPost(Https.httpUrls.getRelClassificationIdList, classData).then(
(rv: any) => {
let arr:any = []
// this.options.forEach((item:any)=>{
// rv.forEach((rvItem:any) => {
// if(item.id == rvItem){
// arr.push(item.id)
// }else{
// item.childList.forEach((optionsItem:any) => {
// if(optionsItem.id == rvItem){
// arr.push([optionsItem.parentId,optionsItem.id])
// }
// });
// }
// });
// })
this.value.editLabelValue = rv
}
).catch((res)=>{
});
}
}else{
classData.libraryIdList = data
Https.axiosPost(Https.httpUrls.getRelPublicClassificationIdList, classData).then(
(rv: any) => {
this.value.editLabelValue = rv
}
).catch((res)=>{
});
}
this.renameType = type
this.renameVisivle = true
},