添加管理员权限
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<div class="page_content_body">
|
||||
<div class="home_page_body">
|
||||
<div class="home_page_left" ref="hidden">
|
||||
<div class="home_page_left_content" :class="{'active':(domHidden && isHaveReviewCollection)}">
|
||||
<div class="home_page_left_content" :class="{'active':(domHidden)}">
|
||||
<!-- 空状态 start-->
|
||||
<div class="home_left_null" v-show="!isHaveReviewCollection">
|
||||
<div>
|
||||
@@ -57,7 +57,7 @@
|
||||
</div>
|
||||
<!-- 有图状态 end-->
|
||||
</div>
|
||||
<div class="home_page_left_bottom" @click="setShowHide('domHidden')" v-show="designCollectionId">
|
||||
<div class="home_page_left_bottom" @click="setShowHide('domHidden')" >
|
||||
<span class="icon iconfont icon-xiala" :class="{'active':domHidden}"></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -90,19 +90,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="right_content_block_box">
|
||||
<div class="right_content_block">
|
||||
<div class="right_content_block" @mouseenter="mouseenter($event,'like')">
|
||||
|
||||
|
||||
<div class="right_content_body">
|
||||
<div class="right_content_header">
|
||||
<div class="content_header_left">
|
||||
<i class="fi fi-rs-comments"></i><span class="content_header_des">
|
||||
{{ $t('HomeView.GeneratedDesign') }}
|
||||
{{ $t('HomeView.SelectedDesign') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right_content_img_block scroll_style Guide_1_17 active" :class="[driver__.driver?'showEvents':'']">
|
||||
<div class="right_content_img_item" ref="designImg">
|
||||
<div class="right_content_img_item" ref="designImg" designType="like" :index="0">
|
||||
|
||||
<div class="content_img_block content_img_GetWidth active" :style="collStyle" @mousedown.stop="designMousedown(getMousePosition($event,false))" @touchstart.passive="designMousedown(getMousePosition($event,true))"
|
||||
v-for="(design, index) in likeDesignCollectionList" :key="design.id"
|
||||
@@ -123,10 +123,45 @@
|
||||
)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="content_img_block" v-show="showDesignMark" :style="collStyle">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right_content_block recycleBin" @mouseenter="mouseenter($event,'recycle')" :class="{recycleBinShow:recycleDomHidden}">
|
||||
<div class="right_content_body">
|
||||
<div class="right_content_header">
|
||||
<div class="content_header_left">
|
||||
<i class="fi fi-rs-comments"></i><span class="content_header_des">
|
||||
{{ $t('HomeView.GeneratedDesign') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right_content_img_block scroll_style">
|
||||
<div class="right_content_img_item" designType="dislike" :index="0">
|
||||
<!-- <div class="content_img_block" v-for="(
|
||||
design, index
|
||||
) in deleteDesignCollectionList" :key="design?.designItemId">
|
||||
<div class="content_img_flex"
|
||||
@click="
|
||||
designDetail(
|
||||
design,
|
||||
index,
|
||||
designCollectionList,
|
||||
'dislike'
|
||||
)">
|
||||
<img class="content_img" :src="design.designOutfitUrl" />
|
||||
</div>
|
||||
<div class="Dustbin" @click.stop="
|
||||
cancelDeleteDesign(index)">
|
||||
Dustbin
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="content_img_block" v-show="showDesignMark">
|
||||
<a-spin size="large" class="content_img_flex"></a-spin>
|
||||
</div>
|
||||
<div class="content_img_block content_img_GetWidth" :style="collStyle" v-for="(
|
||||
<div class="content_img_block content_img_GetWidth" v-for="(
|
||||
design, index
|
||||
) in designCollectionList" :key="design?.designItemId" @mousedown.stop="designMousedown(getMousePosition($event,false))" @touchstart.passive="designMousedown(getMousePosition($event,true))">
|
||||
<div class="content_img_flex"
|
||||
@@ -151,41 +186,7 @@
|
||||
setDeleteDesign(index)">
|
||||
</i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right_content_block recycleBin" :class="{recycleBinShow:recycleDomHidden && designCollectionId}">
|
||||
<div class="right_content_body">
|
||||
<div class="right_content_header">
|
||||
<div class="content_header_left">
|
||||
<i class="fi fi-rs-comments"></i><span class="content_header_des">
|
||||
{{ $t('HomeView.recycleBin') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right_content_img_block scroll_style">
|
||||
<div class="right_content_img_item">
|
||||
<div class="content_img_block" v-for="(
|
||||
design, index
|
||||
) in deleteDesignCollectionList" :key="design?.designItemId">
|
||||
<div class="content_img_flex"
|
||||
@click="
|
||||
designDetail(
|
||||
design,
|
||||
index,
|
||||
designCollectionList,
|
||||
'dislike'
|
||||
)">
|
||||
<img class="content_img" :src="design.designOutfitUrl" />
|
||||
</div>
|
||||
<div class="Dustbin" @click.stop="
|
||||
cancelDeleteDesign(index)">
|
||||
Dustbin
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -256,6 +257,7 @@ import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
|
||||
import i18n from "@/lang";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { getMousePosition } from "@/tool/mdEvent";
|
||||
import { removeClass } from "element-plus/es/utils";
|
||||
const FileSaver = require("file-saver");
|
||||
|
||||
export default defineComponent({
|
||||
@@ -376,27 +378,31 @@ export default defineComponent({
|
||||
const setSystemDesigner = (time:any)=>{
|
||||
clearTimeout(collItemSize.collTime)
|
||||
collItemSize.collTime = setTimeout(()=>{
|
||||
nextTick(()=>{
|
||||
let wScale = 60,hScale = 92.5
|
||||
let num = collItemSize.collValue
|
||||
let width = wScale * ((num<20?20:num) / 100)
|
||||
let height =hScale * ((num<20?20:num) / 100)
|
||||
collItemSize.collStyle.width = width + 'rem'
|
||||
collItemSize.collStyle.height = height + 'rem'
|
||||
setDesignImgWidth()
|
||||
},time)
|
||||
}
|
||||
const setDesignImgWidth = ()=>{
|
||||
nextTick(()=>{
|
||||
let width = designImg.value.parentElement.offsetWidth
|
||||
let sonDom = designImg.value.querySelectorAll('.content_img_GetWidth')[0]
|
||||
if(Math.floor(width / (sonDom.offsetWidth+10 + 1)) > (likeDesignCollectionList.value.length + designCollectionList.value.length)){
|
||||
designImg.value.style.width = 100+'%'
|
||||
|
||||
let itemAddWidth = 0
|
||||
let itemAddHeight = 0
|
||||
let parentWidth = designImg.value.parentElement.offsetWidth
|
||||
// let sonDom = designImg.value.querySelectorAll('.content_img_GetWidth')[0]
|
||||
let htmlfontSize = Number(document.documentElement.style.fontSize.split('px')[0])
|
||||
let rowNum = Math.floor(parentWidth / (width*htmlfontSize+10))
|
||||
if(rowNum > (likeDesignCollectionList.value.length + designCollectionList.value.length)){
|
||||
}else{
|
||||
// let recycleBinW = recycleDomHidden.value?'53rem':0
|
||||
designImg.value.style.width = Math.floor(width / (sonDom.offsetWidth+10 + 1)) * (sonDom.offsetWidth + 10 + 1)+ 'px'
|
||||
// designImg.value.style.width = `calc(${Math.floor(width / (sonDom.offsetWidth+10 + 1)) * (sonDom.offsetWidth + 10 + 1)}px - ${recycleBinW})`
|
||||
let residue = parentWidth - Math.floor(parentWidth / (width*htmlfontSize+10 )) * (width*htmlfontSize + 10)
|
||||
itemAddWidth = residue / rowNum / htmlfontSize
|
||||
itemAddHeight = width / height * itemAddWidth
|
||||
}
|
||||
|
||||
|
||||
collItemSize.collStyle.width = width + itemAddWidth + 'rem'
|
||||
collItemSize.collStyle.height = height + itemAddHeight + 'rem'
|
||||
})
|
||||
|
||||
},time)
|
||||
}
|
||||
const setDeleteDesign = (index:any)=>{
|
||||
store.commit("setDeleteDesignCollectionList",index);
|
||||
@@ -404,11 +410,11 @@ export default defineComponent({
|
||||
const cancelDeleteDesign = (index:any)=>{
|
||||
store.commit("cancelDeleteDesignCollectionList",index);
|
||||
}
|
||||
setSystemDesigner(0)
|
||||
|
||||
let moveData = reactive({
|
||||
moveDataImg:'',
|
||||
moveDataImg_:'',
|
||||
downType:'',
|
||||
moveDataStyle:{
|
||||
position: 'absolute',
|
||||
top: '0',
|
||||
@@ -430,6 +436,7 @@ export default defineComponent({
|
||||
moveData.downXy.y = e.clientY
|
||||
moveData.moveDataStyle.width = e.target.offsetWidth + 'px'
|
||||
moveData.moveDataStyle.height = e.target.offsetHeight + 'px'
|
||||
moveData.downType = e.target.getAttribute('designType');
|
||||
|
||||
window.addEventListener('mousemove', mouseMove);
|
||||
window.addEventListener('touchmove', touchmove);
|
||||
@@ -445,7 +452,7 @@ export default defineComponent({
|
||||
let e = getMousePosition(event,true)
|
||||
desingMousemove(e)
|
||||
}
|
||||
const designMouseup = (e:any)=>{
|
||||
const designMouseup = async (e:any)=>{
|
||||
document.removeEventListener('mousemove',mouseMove)
|
||||
document.removeEventListener('touchmove',touchmove)
|
||||
document.removeEventListener('mouseup',designMouseup)
|
||||
@@ -456,12 +463,82 @@ export default defineComponent({
|
||||
var type = e.target.getAttribute('designType');
|
||||
var index = e.target.getAttribute('index');
|
||||
if(index){
|
||||
let arr = type == 'like'?likeDesignCollectionList.value:designCollectionList.value
|
||||
// arr[index]
|
||||
let item = arr.splice(moveData.downIndex, 1)
|
||||
arr.splice(index, 0, ...item)
|
||||
let likeList = likeDesignCollectionList.value
|
||||
let designList = designCollectionList.value
|
||||
let arr = moveData.downType == 'like' ? likeList : designList
|
||||
let arr1 = type == 'like' ? likeList : designList
|
||||
let item:any
|
||||
if(moveData.downType !== type){
|
||||
let httpsUrl = moveData.downType == 'like'?Https.httpUrls.designDislike:Https.httpUrls.designLike
|
||||
let data
|
||||
if(moveData.downType == 'like'){
|
||||
data = {
|
||||
designId: arr[moveData.downIndex].designId || designId.value,
|
||||
designPythonOutfitId:arr[moveData.downIndex].designOutfitId,
|
||||
groupDetailId: arr[moveData.downIndex].groupDetailId,
|
||||
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
}
|
||||
}else{
|
||||
data = {
|
||||
designItemId: arr[moveData.downIndex].designItemId,
|
||||
userGroupId: userGroupId.value,
|
||||
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
designPythonOutfitId: arr[moveData.downIndex].designOutfitId? arr[moveData.downIndex].designOutfitId: arr[moveData.downIndex].designPythonOutfitId
|
||||
}
|
||||
|
||||
}
|
||||
if(moveData.downType == 'like'){
|
||||
await like(data,httpsUrl)
|
||||
}else{
|
||||
item = await like(data,httpsUrl)
|
||||
}
|
||||
}
|
||||
item = item?item:arr.splice(moveData.downIndex, 1)
|
||||
arr1.splice(index, 0, ...item)
|
||||
}
|
||||
}
|
||||
const like = async (data:any,httpsUrl:string)=>{
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
// let data = {
|
||||
// designItemId: item.designItemId,
|
||||
// userGroupId: userGroupId.value,
|
||||
// timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
// designPythonOutfitId: item.designOutfitId? item.designOutfitId: item.designPythonOutfitId
|
||||
// }
|
||||
Https.axiosPost(httpsUrl, data).then((rv)=>{
|
||||
let value:any = {
|
||||
id:rv.userGroupId,
|
||||
userLikeSortId:rv.id,
|
||||
userLikeGroupId:rv.userGroupId,
|
||||
sort:rv.sort,
|
||||
}
|
||||
resolve(value)
|
||||
}).catch()
|
||||
})
|
||||
}
|
||||
//排序 从大到小
|
||||
const sortDesignCollection = ()=> {
|
||||
let arr = JSON.parse(JSON.stringify(likeDesignCollectionList.value))
|
||||
let arrData:any = []
|
||||
arr.forEach((item:any,index:number)=>{
|
||||
let obj = {
|
||||
id:item.userLikeSortId,
|
||||
"sort": arr.length - index,
|
||||
"userLikeGroupId": item.userLikeGroupId,
|
||||
"userLikeId": item.id
|
||||
}
|
||||
arrData.push(obj)
|
||||
})
|
||||
console.log(arrData);
|
||||
let data = {
|
||||
"userLikeGroupId": userGroupId.value,
|
||||
"userLikeSortList": arrData
|
||||
}
|
||||
Https.axiosPost(Https.httpUrls.designSort, data).then((rv:any)=>{
|
||||
console.log(rv);
|
||||
|
||||
})
|
||||
}
|
||||
const desingMousemove = (e:any)=>{
|
||||
if(!moveData.moveDataImg)moveData.moveDataImg = moveData.moveDataImg_
|
||||
let width = moveData.moveDataStyle.width.split('px')[0]
|
||||
@@ -469,6 +546,10 @@ export default defineComponent({
|
||||
moveData.moveDataStyle.left = e.clientX - Number(width)/2+'px'
|
||||
moveData.moveDataStyle.top = e.clientY - Number(height)/2+'px'
|
||||
}
|
||||
const mouseenter = (e:any,str:string)=>{
|
||||
console.log(23,str);
|
||||
|
||||
}
|
||||
return {
|
||||
store,
|
||||
likeDesignCollectionList,
|
||||
@@ -498,12 +579,13 @@ export default defineComponent({
|
||||
recycleDomHidden,
|
||||
getDesignTime,
|
||||
|
||||
setDesignImgWidth,
|
||||
setDeleteDesign,
|
||||
cancelDeleteDesign,
|
||||
...toRefs(moveData),
|
||||
designMousedown,
|
||||
sortDesignCollection,
|
||||
getMousePosition,
|
||||
mouseenter,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
@@ -544,6 +626,8 @@ export default defineComponent({
|
||||
|
||||
beforeUnmount(){
|
||||
clearTimeout(this.getDesignTime);
|
||||
// alert(1)
|
||||
this.sortDesignCollection()
|
||||
sessionStorage.setItem('domHidden',JSON.stringify(this.domHidden))
|
||||
sessionStorage.setItem('recycleDomHidden',JSON.stringify(this.recycleDomHidden))
|
||||
sessionStorage.setItem('collValue',JSON.stringify(this.collValue))
|
||||
@@ -826,7 +910,7 @@ export default defineComponent({
|
||||
await new Promise((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
this.designCollectionList.unshift(item)
|
||||
this.setDesignImgWidth()
|
||||
this.setSystemDesigner(0)
|
||||
resolve('')
|
||||
}, 200);
|
||||
})
|
||||
@@ -935,6 +1019,8 @@ export default defineComponent({
|
||||
processId:this.designRandom
|
||||
};
|
||||
// data.moodboardPosition = JSON.stringify(this.store.state.UploadFilesModule.moodboardPosition)
|
||||
this.setSystemDesigner(0)
|
||||
|
||||
let isLoad = false
|
||||
if(designCollectionId == -1){
|
||||
isLoad = true
|
||||
@@ -1114,6 +1200,7 @@ export default defineComponent({
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
//获取选择的组
|
||||
getHistoryChoose(userGroupId: any, type: any) {
|
||||
|
||||
@@ -1125,6 +1212,7 @@ export default defineComponent({
|
||||
this.setPortfolio(rv.portfolioDTO)
|
||||
this.store.commit("setUserGroupId", rv.userGroupId);
|
||||
this.dealHistoryChooseData(rv, type);
|
||||
this.setSystemDesigner(0)
|
||||
this.isShowMark = false;
|
||||
})
|
||||
.catch((rv) => {
|
||||
@@ -1160,8 +1248,6 @@ export default defineComponent({
|
||||
},
|
||||
//处理选择组的数据
|
||||
dealHistoryChooseData(data: any, type: any) {
|
||||
console.log(data.collection.moodboardPosition);
|
||||
|
||||
let collectionData = {
|
||||
disposeMoodboard: data.collection.moodTemplateId?[{
|
||||
id:data.collection.moodTemplateId,
|
||||
@@ -1198,7 +1284,9 @@ export default defineComponent({
|
||||
);
|
||||
this.isHaveReviewCollection = true;
|
||||
if (type === "normal") {
|
||||
let likeDesignCollectionList = data.userLikeDetails.map(
|
||||
let arr = data.userLikeDetails.sort((a:any, b:any) => b.sort - a.sort);
|
||||
|
||||
let likeDesignCollectionList = arr.map(
|
||||
(v: any) => {
|
||||
let data = {
|
||||
...v,
|
||||
@@ -1214,7 +1302,7 @@ export default defineComponent({
|
||||
likeDesignCollectionList
|
||||
);
|
||||
}
|
||||
this.setDesignImgWidth()
|
||||
this.setSystemDesigner(100)
|
||||
},
|
||||
|
||||
//统一处理选择组的渲染数据
|
||||
@@ -1335,7 +1423,7 @@ export default defineComponent({
|
||||
setShowHide(str:string){
|
||||
if(str == 'recycleDomHidden')this.recycleDomHidden = !this.recycleDomHidden
|
||||
if(str == 'domHidden')this.domHidden = !this.domHidden
|
||||
this.setDesignImgWidth()
|
||||
this.setSystemDesigner(0)
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -1435,7 +1523,7 @@ export default defineComponent({
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
background: #f7f8fa;
|
||||
background: #f6f6fa;
|
||||
border-radius: 2rem;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -1531,6 +1619,9 @@ export default defineComponent({
|
||||
// top: calc(50% - 10.4rem / 2);
|
||||
border: 2px solid;
|
||||
border-left: none;
|
||||
background: #000;
|
||||
color: #fff;
|
||||
flex-direction: column;
|
||||
&.active{
|
||||
right: 53rem;
|
||||
transform: translate(0, -50%);
|
||||
@@ -1592,6 +1683,7 @@ export default defineComponent({
|
||||
.right_content_body {
|
||||
width: 55rem;
|
||||
.right_content_img_block{
|
||||
|
||||
.content_img_block{
|
||||
width: 16rem;
|
||||
height: 23rem;
|
||||
@@ -1661,7 +1753,6 @@ export default defineComponent({
|
||||
}
|
||||
.right_content_body {
|
||||
// padding: 0 1.8rem 0 1.2rem;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
// height: calc(50% - 4.5rem);
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
@@ -1680,40 +1771,44 @@ export default defineComponent({
|
||||
// padding-bottom: 1rem;
|
||||
overflow-x: auto;
|
||||
justify-content: center;
|
||||
&.active::-webkit-scrollbar-button:single-button{
|
||||
&.active::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
&.active::-webkit-scrollbar {
|
||||
/* 竖轴的宽度 */
|
||||
width: 1rem;
|
||||
/* 横轴的高度 */
|
||||
height: 1rem;
|
||||
transition: all .3s;
|
||||
}
|
||||
/* 进度 */
|
||||
&.active::-webkit-scrollbar-thumb {
|
||||
border-radius: 1rem;
|
||||
background: rgba(238, 238, 244, 0);
|
||||
}
|
||||
/* 轨道 */
|
||||
&.active::-webkit-scrollbar-track {
|
||||
border-radius: 1rem;
|
||||
background: rgba(238, 238, 244, 0);
|
||||
}
|
||||
&.active:hover {
|
||||
// overflow-x: scroll;
|
||||
&.active::-webkit-scrollbar-thumb {
|
||||
background: #543087;
|
||||
}
|
||||
/* 轨道 */
|
||||
&.active::-webkit-scrollbar-track {
|
||||
background: rgba(84, 48, 135,.2);
|
||||
}
|
||||
}
|
||||
// &.active::-webkit-scrollbar-button:single-button{
|
||||
// display: none;
|
||||
// }
|
||||
// &.active::-webkit-scrollbar {
|
||||
// /* 竖轴的宽度 */
|
||||
// width: 1rem;
|
||||
// /* 横轴的高度 */
|
||||
// height: 1rem;
|
||||
// transition: all .3s;
|
||||
// }
|
||||
// /* 进度 */
|
||||
// &.active::-webkit-scrollbar-thumb {
|
||||
// border-radius: 1rem;
|
||||
// background: rgba(238, 238, 244, 0);
|
||||
// }
|
||||
// /* 轨道 */
|
||||
// &.active::-webkit-scrollbar-track {
|
||||
// border-radius: 1rem;
|
||||
// background: rgba(238, 238, 244, 0);
|
||||
// }
|
||||
// &.active:hover {
|
||||
// // overflow-x: scroll;
|
||||
// &.active::-webkit-scrollbar-thumb {
|
||||
// background: #543087;
|
||||
// }
|
||||
// /* 轨道 */
|
||||
// &.active::-webkit-scrollbar-track {
|
||||
// background: rgba(84, 48, 135,.2);
|
||||
// }
|
||||
// }
|
||||
>div{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
// padding: 0 2.8rem 0 0.9rem;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
align-content: flex-start;
|
||||
}
|
||||
@@ -1725,13 +1820,12 @@ export default defineComponent({
|
||||
box-sizing: border-box;
|
||||
margin: 5px;
|
||||
// min-height: 271px;
|
||||
max-height: 100%;
|
||||
max-height: 80%;
|
||||
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
vertical-align: top;
|
||||
flex-shrink: 0;
|
||||
max-height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -1751,6 +1845,7 @@ export default defineComponent({
|
||||
height: 100%;
|
||||
border-radius: 2rem;
|
||||
border: 2px solid #E0E0E0;
|
||||
background: #fff;
|
||||
}
|
||||
&.active{
|
||||
.icon_like,.icon_delete{
|
||||
|
||||
Reference in New Issue
Block a user