Merge remote-tracking branch 'origin/StableVersion' into develop
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
:closable="false"
|
||||
:mask="publishMask"
|
||||
:keyboard="false"
|
||||
:destroyOnClose="true"
|
||||
>
|
||||
<div class="generalModel_btn">
|
||||
<div class="generalModel_closeIcon" @click.stop="cancelDsign()">
|
||||
@@ -33,70 +32,32 @@
|
||||
<div class="publidh_right">
|
||||
<div class="publidh_right_name publidh_content_item">
|
||||
<div class="publidh_content_item_title">{{$t('Publish.CollectionTitle')}}</div>
|
||||
<input type="text" :disabled="selectTagList.length > 0" v-model="subPublishDate.portfolioName">
|
||||
<input type="text" v-model="subPublishDate.portfolioName">
|
||||
<!-- <div class="publidh_content_item_tag">
|
||||
<a-tag closable color="purple">#RCAworkshop_2024</a-tag>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="publidh_right_name publidh_content_item">
|
||||
<div class="publidh_content_item_title">{{$t('Publish.topic')}}</div>
|
||||
<div class="publidh_content_item_tag">
|
||||
<div v-for="item,index in selectTagList">
|
||||
<a-tooltip v-if="index > 4" :title="+'+'+selectTagList.length - 4">
|
||||
<a-tag closable color="purple" @close="handleClose(item,index)">
|
||||
{{ item.tag }}
|
||||
</a-tag>
|
||||
</a-tooltip>
|
||||
<a-tag v-else closable color="purple" @close="handleClose(item,index)">
|
||||
{{ item.tag }}
|
||||
</a-tag>
|
||||
</div>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="publidh_right_name publidh_content_item">
|
||||
<div class="publidh_content_item_title">{{$t('Publish.Description')}}</div>
|
||||
<!-- <textarea @input="textareaChange()" ref="textarea" v-model="subPublishDate.portfolioDes"></textarea> -->
|
||||
<textarea ref="textarea" v-model="subPublishDate.portfolioDes"></textarea>
|
||||
</div>
|
||||
<div class="publidh_content_item_tagList">
|
||||
<div v-for="item,index in tagList" @click="pushTag(item,index)">
|
||||
<a-tag color="purple" :title="item.title">{{ item.tagName }}</a-tag>
|
||||
</div>
|
||||
</div>
|
||||
<div class="publidh_right_detail publidh_content_item">
|
||||
<div class="publidh_content_item_title">{{$t('Publish.Permissions')}}</div>
|
||||
<!-- <div>
|
||||
<a-checkbox @change="setPermissions" v-model:checked="setPermissionsAll">All.</a-checkbox>
|
||||
</div> -->
|
||||
<!-- <div>
|
||||
<a-checkbox @change="setPermissionsItem()" v-model:checked="selectPermissions.isAllowLikes">Whether to allow likes.</a-checkbox>
|
||||
</div> -->
|
||||
<!-- <div>
|
||||
<a-checkbox @change="setPermissionsItem()" v-model:checked="selectPermissions.isAllowComment">Allow comments or not.</a-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<a-checkbox @change="setPermissionsItem()" v-model:checked="selectPermissions.isDisplayArea">Show locale or not.</a-checkbox>
|
||||
</div> -->
|
||||
<div>
|
||||
<a-checkbox @change="setPermissionsItem()" v-model:checked="selectPermissions.isSecondaryCreation">{{$t('Publish.PermissionsItem1')}}</a-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="publidh_right_name publidh_content_item">
|
||||
<div class="publidh_content_item_title">Thumbnail preview</div>
|
||||
<input type="text">
|
||||
</div> -->
|
||||
<div class="publidh_content_item publidh_right_zhuyi">
|
||||
<!-- <div class="publidh_content_item_intro">
|
||||
<label >
|
||||
<span class="icon iconfont icon-zhuyi"></span>
|
||||
<div>
|
||||
This will publish your work to the square for all users to see.
|
||||
</div>
|
||||
</label>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="publidh_right_btn">
|
||||
<div class="started_btn" @click="cancelDsign">{{$t('Publish.Close')}}</div>
|
||||
<div class="started_btn" @click="setPublish">{{beenPublished == 0?$t('Publish.Publish'):$t('Publish.UpdatePublish')}}</div>
|
||||
<div class="started_btn" @click="setPublish">{{!subPublishDate?.id?$t('Publish.Publish'):$t('Publish.UpdatePublish')}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -125,12 +86,10 @@ export default defineComponent({
|
||||
const store = useStore();
|
||||
let publish: any = ref(false);//弹窗
|
||||
let publishMask:any = ref(false)//弹窗遮罩
|
||||
let setBeenPublished:any = inject('setBeenPublished')
|
||||
let publishData:any = reactive({
|
||||
publishName:'',
|
||||
loadingShow:false,
|
||||
publishMarginTop:0,
|
||||
beenPublished:inject('beenPublished'),//history回来时候表示是否已经发布0为没发布
|
||||
publishList:[],
|
||||
publishIndex:0,//当前图片索引
|
||||
isShowMark:false,
|
||||
@@ -139,15 +98,18 @@ export default defineComponent({
|
||||
url:'',
|
||||
},
|
||||
subPublishDate:{
|
||||
id:'',
|
||||
portfolioDes:''
|
||||
},
|
||||
selectPermissions:{
|
||||
isAllowComment:true,
|
||||
isDisplayArea:true,
|
||||
isSecondaryCreation:true,
|
||||
}
|
||||
},
|
||||
})
|
||||
let tagList = ref([{tag:'RCAworkshop_2024'}])
|
||||
let selectTagList:any = ref([])
|
||||
let portfolio:any = inject('portfolio')
|
||||
let setPortfolio:any = inject('setPortfolio')
|
||||
let tagList = ref([{id: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()
|
||||
@@ -166,13 +128,14 @@ export default defineComponent({
|
||||
accountId : JSON.parse(userInfo).userId,
|
||||
createDate:'',
|
||||
idDeleted:'',
|
||||
id:'',
|
||||
portfolioDes:'',
|
||||
portfolioName:'',
|
||||
id:portfolio.value.id?portfolio.value.id:'',
|
||||
portfolioDes:portfolio.value.portfolioDes?portfolio.value.portfolioDes:'',
|
||||
portfolioName:portfolio.value.portfolioName?portfolio.value.portfolioName:'',
|
||||
portfolioType:'History',
|
||||
status:'',
|
||||
updateDate:'',
|
||||
collectionId:'',
|
||||
tagsDTO:portfolio.value.tagsDTO?portfolio.value.tagsDTO:[],
|
||||
// isAllowLikes:true,
|
||||
}
|
||||
}
|
||||
@@ -181,6 +144,39 @@ export default defineComponent({
|
||||
publishData.selectDate.url = item.url
|
||||
|
||||
}
|
||||
let extractHashtags = (text:any)=>{
|
||||
// const regex = /#\S+\s{2}/g;
|
||||
const regex = /#\S+\s/g;
|
||||
// 使用match方法提取匹配的字符串
|
||||
const matches = text.match(regex);
|
||||
// 处理提取结果,去掉空格并返回
|
||||
return matches ? matches.map((match:any) => match.replace(/\s+/g, '')) : []; // 去掉所有空格
|
||||
}
|
||||
let textareaChange = ()=>{
|
||||
let tagListArr = extractHashtags(publishData.subPublishDate.portfolioDes)
|
||||
let tagsDTO:any = []
|
||||
for (let i = 0; i < tagListArr.length; i++) {
|
||||
const index = tagList.value.findIndex((obj:any) => obj.tagName === tagListArr[i]);
|
||||
const tagsDTOIndex = publishData.subPublishDate.tagsDTO.findIndex((obj:any) => obj.tagName === tagListArr[i]);
|
||||
let obj
|
||||
if(tagsDTOIndex>-1){
|
||||
obj = {
|
||||
tagName:publishData.subPublishDate.tagsDTO[tagsDTOIndex].tagName,
|
||||
id:publishData.subPublishDate.tagsDTO[tagsDTOIndex].id
|
||||
}
|
||||
}else if(index > -1){
|
||||
obj = {
|
||||
tagName:tagList.value[index].tagName,
|
||||
id:tagList.value[index].id
|
||||
}
|
||||
}else {
|
||||
obj = {tagName:tagListArr[i]}
|
||||
}
|
||||
tagsDTO.push(obj)
|
||||
}
|
||||
// publishData.subPublishDate.tagsDTO = tagsDTO
|
||||
return tagsDTO
|
||||
}
|
||||
let setPermissionsItem = ()=>{
|
||||
// publishData.selectPermissions.isAllowLikes &&
|
||||
if(publishData.selectPermissions.isAllowComment && publishData.selectPermissions.isDisplayArea && publishData.selectPermissions.isSecondaryCreation){
|
||||
@@ -199,7 +195,6 @@ export default defineComponent({
|
||||
publish.value = false
|
||||
publishData.isShowMark = false
|
||||
publishData.subPublishDate = {}
|
||||
selectTagList.value = []
|
||||
}
|
||||
let cancelDsign = ()=>{
|
||||
Modal.confirm({
|
||||
@@ -242,43 +237,47 @@ export default defineComponent({
|
||||
let file = base64ToFile(publishData.selectDate.url,'collection')
|
||||
param.append('file',file)
|
||||
publishData.subPublishDate.openSource = publishData.selectPermissions.isSecondaryCreation?1:0
|
||||
let tagDTO = textareaChange()
|
||||
publishData.subPublishDate.tagsDTO = tagDTO
|
||||
param.append('data',JSON.stringify(publishData.subPublishDate))
|
||||
let config:any = {headers:{'Content-Type':'multipart/form-data','Accept':'*/*' }}
|
||||
// let data = publishData.subPublishDate
|
||||
publishData.isShowMark = true
|
||||
Https.axiosPost(Https.httpUrls.publish, param,config)
|
||||
.then((rv) => {
|
||||
cleardata()
|
||||
publishData.isShowMark = false
|
||||
emit('setPublish')
|
||||
let obj = {
|
||||
id:rv,
|
||||
portfolioName:publishData.subPublishDate.portfolioName,
|
||||
portfolioDes:publishData.subPublishDate.portfolioDes,
|
||||
tagsDTO:publishData.subPublishDate.tagsDTO,
|
||||
}
|
||||
cleardata()
|
||||
setPortfolio(obj)
|
||||
message.success(t('Publish.jsContent4'))
|
||||
setBeenPublished()
|
||||
})
|
||||
.catch((rv) => {
|
||||
publishData.isShowMark = false
|
||||
|
||||
});
|
||||
}
|
||||
let handleClose = (tag:any,index:number)=>{
|
||||
let selectTag = selectTagList.value.splice(index,1)[0]
|
||||
tagList.value.push(selectTag)
|
||||
}
|
||||
let pushTag = (tag:any,index:number)=>{
|
||||
let selectTag = tagList.value.splice(index,1)[0]
|
||||
selectTagList.value.push(selectTag)
|
||||
if(tag.tag == 'RCAworkshop_2024'){
|
||||
publishData.subPublishDate.portfolioName = 'AiDA x RCA workshop'
|
||||
}
|
||||
// let selectTag = tagList.value.splice(index,1)[0]
|
||||
// if(tag.tag == 'RCAworkshop_2024'){
|
||||
// publishData.subPublishDate.portfolioDes = '#AiDA x RCA workshop '
|
||||
// }
|
||||
if(!publishData.subPublishDate.portfolioDes) publishData.subPublishDate.portfolioDes = ''
|
||||
publishData.subPublishDate.portfolioDes = publishData.subPublishDate.portfolioDes+tag.tagName + ' '
|
||||
}
|
||||
return {
|
||||
publish,
|
||||
publishMask,
|
||||
...toRefs(publishData),
|
||||
tagList,
|
||||
// textarea,
|
||||
// setCopy,
|
||||
tagList,
|
||||
selectTagList,
|
||||
init,
|
||||
textareaChange,
|
||||
setPermissionsItem,
|
||||
setPermissions,
|
||||
// download,
|
||||
@@ -287,7 +286,6 @@ export default defineComponent({
|
||||
setCover,
|
||||
cancelDsign,
|
||||
setPublish,
|
||||
handleClose,
|
||||
pushTag,
|
||||
};
|
||||
},
|
||||
@@ -338,6 +336,20 @@ export default defineComponent({
|
||||
justify-content: space-between;
|
||||
flex: 1;
|
||||
height: calc(100% - 10rem);
|
||||
.publidh_content_item_tagList,.publidh_content_item_tag{
|
||||
// height: 4rem;
|
||||
border-radius: 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.publidh_content_item_tagList{
|
||||
margin-top: 1rem;
|
||||
.ant-tag{
|
||||
cursor: pointer;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
.publidh_left,.publidh_right{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -375,6 +387,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.publidh_content_item_intro{
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user