push Develop
This commit is contained in:
@@ -29,35 +29,51 @@
|
||||
<img v-lazy="selectDate.url" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="publidh_left_thubnai publidh_content_item">
|
||||
<div class="publidh_content_item_title">Select Cover Picture</div>
|
||||
<div class="publidh_left_thubnail_list publish_content_item">
|
||||
<img v-for="item in getPublishDate.groupDetails" :class="{selectActive:item.designOutfitId === subPublishDate.coverId}" v-lazy="item.url" @click="setCover(item)" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="publidh_right">
|
||||
<div class="publidh_right_name publidh_content_item">
|
||||
<div class="publidh_content_item_title">Name</div>
|
||||
<div class="publidh_content_item_title">Collection Title</div>
|
||||
<input type="text" v-model="subPublishDate.portfolioName">
|
||||
</div>
|
||||
<div class="publidh_right_name publidh_content_item">
|
||||
<div class="publidh_content_item_title">Description</div>
|
||||
<textarea ref="textarea" v-model="subPublishDate.portfolioDes"></textarea>
|
||||
</div>
|
||||
<div class="publidh_right_detail publidh_content_item">
|
||||
<div class="publidh_content_item_title">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">Whether to allow other users to perform secondary creation.</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">
|
||||
<span class="icon iconfont icon-zhuyi"></span>This will publish your work to the square for all users to see.
|
||||
</div>
|
||||
<!-- <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="setClose">Close</div>
|
||||
<div class="started_btn">Save as draft</div>
|
||||
<div class="started_btn" @click="setPublish">Publish</div>
|
||||
<div class="started_btn" @click="cancelDsign">Close</div>
|
||||
<div class="started_btn" @click="setPublish">{{beenPublished == 0?'Publish':'Updata Publish'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -76,26 +92,31 @@ import { getCookie,setCookie } from "@/tool/cookie";
|
||||
// import domTurnImg from '@/tool/domTurnImg'
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { Modal,message } from 'ant-design-vue';
|
||||
import { downloadIamge } from "@/tool/util";
|
||||
import { downloadIamge,base64ToFile } from "@/tool/util";
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
let publish: any = ref(false);//弹窗
|
||||
let publishMask:any = ref(false)//弹窗遮罩
|
||||
let publishData:any = reactive({
|
||||
publishName:'123123',
|
||||
publishName:'',
|
||||
loadingShow:false,
|
||||
publishMarginTop:0,
|
||||
beenPublished:0,//history回来时候表示是否已经发布0为没发布
|
||||
publishList:[],
|
||||
publishIndex:0,//当前图片索引
|
||||
isShowMark:false,
|
||||
setPermissionsAll:true,
|
||||
selectDate:{
|
||||
url:'',
|
||||
},
|
||||
getPublishDate:{
|
||||
},
|
||||
subPublishDate:{
|
||||
},
|
||||
selectPermissions:{
|
||||
isAllowComment:true,
|
||||
isDisplayArea:true,
|
||||
isSecondaryCreation:true,
|
||||
}
|
||||
})
|
||||
// let textarea: any = ref(null)
|
||||
// let setCopy = ()=>{
|
||||
@@ -103,56 +124,51 @@ export default defineComponent({
|
||||
// document.execCommand("copy");
|
||||
// }
|
||||
let init = (data:any)=>{
|
||||
publishData.beenPublished = data.beenPublished
|
||||
let userInfo:any = getCookie("userInfo")
|
||||
console.log(data);
|
||||
publishData.getPublishDate = data
|
||||
// console.log(data);
|
||||
publish.value = true
|
||||
publishData.selectDate.url = data.groupDetails[0].url
|
||||
publishData.selectDate.url = data.imgUrl
|
||||
publishData.subPublishDate = {
|
||||
userLikeGroupId : data.id,
|
||||
coverId : data.groupDetails[0].designOutfitId,
|
||||
userLikeGroupId : data.userlikeGroupId,
|
||||
// userLikeGroupId : data.id,
|
||||
coverId : '',
|
||||
// coverId : data.groupDetails[0].designOutfitId,
|
||||
accountId : JSON.parse(userInfo).userId,
|
||||
createDate:'',
|
||||
idDeleted:'',
|
||||
id:'',
|
||||
portfolioDes:'',
|
||||
portfolioName:data.name,
|
||||
portfolioName:'',
|
||||
portfolioType:'History',
|
||||
status:'',
|
||||
updateDate:'',
|
||||
collectionId:'',
|
||||
// isAllowLikes:true,
|
||||
}
|
||||
// publishData.publishList = list
|
||||
// publishData.publishIndex = index
|
||||
// let publishList = this.store.state.UploadFilesModule.moodboard
|
||||
}
|
||||
// let download = ()=>{
|
||||
// downloadIamge(publishData.publishList[publishData.publishIndex].imgUrl)
|
||||
// }
|
||||
// let setScaleImageIndex = (index:any)=>{
|
||||
// publishData.publishIndex = index
|
||||
// }
|
||||
// let LikeFile = (item:any,str:string)=>{
|
||||
// const currentInstance = getCurrentInstance();
|
||||
// let parent:any = currentInstance?.parent
|
||||
// console.log(parent);
|
||||
|
||||
// parent.likeFile(item,str)
|
||||
// }
|
||||
|
||||
// LikeFile(item:any,str:string){
|
||||
// let parent:any = this.$parent
|
||||
// parent.likeFile(item,str)
|
||||
// },
|
||||
let setCover = (item:any)=>{
|
||||
publishData.subPublishDate.coverId = item.designOutfitId
|
||||
publishData.selectDate.url = item.url
|
||||
|
||||
}
|
||||
let setPermissionsItem = ()=>{
|
||||
// publishData.selectPermissions.isAllowLikes &&
|
||||
if(publishData.selectPermissions.isAllowComment && publishData.selectPermissions.isDisplayArea && publishData.selectPermissions.isSecondaryCreation){
|
||||
publishData.setPermissionsAll = true
|
||||
}else{
|
||||
publishData.setPermissionsAll = false
|
||||
}
|
||||
}
|
||||
let setPermissions = ()=>{
|
||||
// publishData.selectPermissions.isAllowLikes = publishData.setPermissionsAll;
|
||||
publishData.selectPermissions.isAllowComment = publishData.setPermissionsAll
|
||||
publishData.selectPermissions.isDisplayArea = publishData.setPermissionsAll
|
||||
publishData.selectPermissions.isSecondaryCreation = publishData.setPermissionsAll
|
||||
}
|
||||
let cleardata = ()=>{
|
||||
publish.value = false
|
||||
publishData.isShowMark = false
|
||||
publishData.getPublishDate = {}
|
||||
publishData.subPublishDate = {}
|
||||
}
|
||||
let cancelDsign = ()=>{
|
||||
@@ -169,7 +185,12 @@ export default defineComponent({
|
||||
});
|
||||
}
|
||||
let setPublish= ()=>{
|
||||
let _this = this
|
||||
if(!publishData.subPublishDate.portfolioName){
|
||||
return message.info('Please enter the name of your work')
|
||||
}
|
||||
// if(!publishData.subPublishDate.portfolioDes){
|
||||
// return message.info('Please enter a description')
|
||||
// }
|
||||
Modal.confirm({
|
||||
title: 'This will publish your work to the square for all users to see. Please confirm whether to publish?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
@@ -183,13 +204,24 @@ export default defineComponent({
|
||||
});
|
||||
}
|
||||
let subPublish = ()=>{
|
||||
let data = publishData.subPublishDate
|
||||
|
||||
let param = new FormData();
|
||||
// let fill = dataURLtoFile(publishData.selectDate.url,'collection')
|
||||
// let aa = new File([fill], 'collection' + ".jpg");
|
||||
|
||||
let file = base64ToFile(publishData.selectDate.url,'collection')
|
||||
param.append('file',file)
|
||||
publishData.subPublishDate.openSource = publishData.selectPermissions.isSecondaryCreation?1:0
|
||||
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, data)
|
||||
Https.axiosPost(Https.httpUrls.publish, param,config)
|
||||
.then((rv) => {
|
||||
console.log(rv);
|
||||
cleardata()
|
||||
publishData.isShowMark = false
|
||||
message.success('Release success! You can find it in my work')
|
||||
})
|
||||
.catch((rv) => {
|
||||
publishData.isShowMark = false
|
||||
@@ -204,6 +236,8 @@ export default defineComponent({
|
||||
// textarea,
|
||||
// setCopy,
|
||||
init,
|
||||
setPermissionsItem,
|
||||
setPermissions,
|
||||
// download,
|
||||
// setScaleImageIndex,
|
||||
// LikeFile,
|
||||
@@ -221,26 +255,6 @@ export default defineComponent({
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// init(list:any,index:any,dialogueIndex:any){
|
||||
|
||||
// },
|
||||
// cancelDsign(){
|
||||
// this.publish = false
|
||||
// // this.publishList = []
|
||||
// // this.publishIndex = 0
|
||||
// },
|
||||
// download(){
|
||||
// // downloadIamge(this.publishList[this.publishIndex].imgUrl)
|
||||
// },
|
||||
// setScaleImageIndex(index:any){
|
||||
// // this.publishIndex = index
|
||||
// // console.log(this.publishIndex);
|
||||
|
||||
// },
|
||||
// LikeFile(item:any,str:string){
|
||||
// let parent:any = this.$parent
|
||||
// parent.likeFile(item,str)
|
||||
// },
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -262,6 +276,7 @@ export default defineComponent({
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex: 1;
|
||||
height: calc(100% - 10rem);
|
||||
.publidh_left,.publidh_right{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -306,14 +321,18 @@ export default defineComponent({
|
||||
}
|
||||
.publidh_left{
|
||||
width: 45%;
|
||||
|
||||
.publidh_content_item{
|
||||
height: 100%;
|
||||
}
|
||||
.publish_content_shrink{
|
||||
width: 100%;
|
||||
height: calc(100% - 4rem);
|
||||
img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
max-height: 30rem;
|
||||
// object-fit: cover;
|
||||
// max-height: 30rem;
|
||||
max-height: 100%;
|
||||
}
|
||||
}
|
||||
.publidh_left_thubnai{
|
||||
@@ -349,6 +368,13 @@ export default defineComponent({
|
||||
margin-right: 1rem;
|
||||
}
|
||||
}
|
||||
.publidh_right_detail{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
label{
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user