修复bug

This commit is contained in:
X1627315083
2024-10-08 18:34:22 +08:00
parent 52b9d3ac32
commit 5799db9ef3
15 changed files with 841 additions and 14 deletions

View File

@@ -41,7 +41,7 @@
</div>
<div class="publidh_content_item_tagList">
<div v-for="item,index in tagList" @click="pushTag(item,index)">
<a-tag color="purple">{{ item.tag }}</a-tag>
<a-tag color="purple" :title="item.title">{{ item.tagName }}</a-tag>
</div>
</div>
<div class="publidh_right_detail publidh_content_item">
@@ -104,8 +104,7 @@ export default defineComponent({
isSecondaryCreation:true,
}
})
let tagList = ref([{tag:'#RCAworkshop_2024 '},{tag:'#RCAwork '},{tag:'#RCAwo '},{tag:'#RCAwork '}])
let selectTagList:any = ref([])
let tagList = ref([{tagId:1,tagName:'#RCAworkshop_2024 ',title:'The process is simple: use AiDA to post your design work on the "Gallery ", and the one with the most likes(at least 20 likes) will be invited to the AiDA Workshop offline event in Hong Kong on November 14th, to exchange ideas with the Royal College of Art (RCA), Jae Lim, co-founder of the renowned fashion brand BESFXXK, and outstanding designers! '}])
// let textarea: any = ref(null)
// let setCopy = ()=>{
// textarea.value.select()
@@ -131,6 +130,7 @@ export default defineComponent({
status:'',
updateDate:'',
collectionId:'',
tagsDTO:[],
// isAllowLikes:true,
}
}
@@ -144,14 +144,25 @@ export default defineComponent({
const regex = /#\S+\s/g;
// 使用match方法提取匹配的字符串
const matches = text.match(regex);
// 处理提取结果,去掉空格并返回
return matches ? matches.map((match:any) => match.trim()) : [];
}
let textareaChange = ()=>{
console.log(extractHashtags(publishData.subPublishDate.portfolioDes));
let tagListArr = extractHashtags(publishData.subPublishDate.portfolioDes)
let tagsDTO:any = []
tagListArr.forEach((item:any) => {
const index = tagList.value.findIndex((obj:any) => obj.tagName === item);
if(index>-1){
let obj = {
tagName:tagList.value[index],
tagId:tagList.value[index].tagId
}
tagsDTO.push(tagList.value[index])
}else{
tagsDTO.push({tagName:item})
}
});
publishData.subPublishDate.tagsDTO = tagsDTO
}
let setPermissionsItem = ()=>{
// publishData.selectPermissions.isAllowLikes &&
@@ -214,6 +225,7 @@ export default defineComponent({
param.append('file',file)
publishData.subPublishDate.openSource = publishData.selectPermissions.isSecondaryCreation?1:0
param.append('data',JSON.stringify(publishData.subPublishDate))
param.append('tagsDTO',JSON.stringify(publishData.subPublishDate.tagsDTO))
let config:any = {headers:{'Content-Type':'multipart/form-data','Accept':'*/*' }}
// let data = publishData.subPublishDate
publishData.isShowMark = true
@@ -236,7 +248,7 @@ export default defineComponent({
// if(tag.tag == 'RCAworkshop_2024'){
// publishData.subPublishDate.portfolioDes = '#AiDA x RCA workshop '
// }
publishData.subPublishDate.portfolioDes = publishData.subPublishDate.portfolioDes+tag.tag
publishData.subPublishDate.portfolioDes = publishData.subPublishDate.portfolioDes+tag.tagName
textareaChange()
}
return {
@@ -244,7 +256,6 @@ export default defineComponent({
publishMask,
...toRefs(publishData),
tagList,
selectTagList,
// textarea,
// setCopy,
init,