液化
This commit is contained in:
@@ -29,11 +29,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="layout_centent" :class="{active:flex_direction}" id="layoutCentent">
|
||||
<div v-for="item,index in layoutList" :key="item" :class="moodbClassName[index]" class="modal_imgItem" v-layout="index" @mousedown="setpitch(item,index)" @touchstart="setpitch(item,index)" ref="content" >
|
||||
<div v-for="item,index in layoutList" :key="item" :class="moodbClassName[index]" class="modal_imgItem" v-layout="item" @mousedown="setpitch(item,index)" @touchstart="setpitch(item,index)" ref="content" >
|
||||
<img crossOrigin="anonymous" :src="item.imgUrl" :style="{'transform':item.angle?`translate(-50%, -50%) scale(${item.zoom}) rotateZ(${item.angle}deg)`:`translate(-50%, -50%) scale(${item.zoom}) rotateZ(${item.angle}deg)`}" draggable="false" :class="moodbClassName[index]" v-modelImg>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
<ul v-show="item.setPitch" class="layout_btn" >
|
||||
<li class="layout_btn_top" v-compile.stop="'top'"></li>
|
||||
<li class="layout_btn_bottom" v-compile.stop="'bottom'"></li>
|
||||
@@ -704,7 +701,7 @@ export default defineComponent({
|
||||
this.layoutList = parentList
|
||||
this.moodbList = this.moodb[parentList.length-1]
|
||||
this.moodbClassName = this.styleObj?.class?this.styleObj?.class:[]
|
||||
this.moodItemScale = this.layoutList[0].zoom*100
|
||||
this.moodItemScale = (this.layoutList?.[0]?this.layoutList[0].zoom:1)*100
|
||||
|
||||
this.initDomStyle()
|
||||
|
||||
@@ -750,14 +747,21 @@ export default defineComponent({
|
||||
changeTemplateModal(){
|
||||
this.layout = !this.layout
|
||||
},
|
||||
setIndex(arr:any){
|
||||
const nums = arr.map((obj:any) => obj.num);
|
||||
const sortedNums = [...nums].sort((a, b) => a - b);
|
||||
GO.zIndex = sortedNums[sortedNums.length - 1] + 1
|
||||
const numToNewValue = new Map();
|
||||
sortedNums.forEach((num, index) => numToNewValue.set(num, index + 1));
|
||||
arr.forEach((obj:any) => {
|
||||
obj.num = numToNewValue.get(obj.num);
|
||||
setIndex(styleArr:any){
|
||||
let arr = JSON.parse(JSON.stringify(styleArr))
|
||||
const nums = arr.map((obj:any,index:any) => {
|
||||
obj.num = index
|
||||
return {
|
||||
num: obj.num,
|
||||
zIndex: obj['z-index']?obj['z-index']:1
|
||||
}
|
||||
});
|
||||
const sortedNums = nums.sort((a, b) => a.zIndex - b.zIndex);
|
||||
|
||||
GO.zIndex = sortedNums.length + 1
|
||||
// GO.zIndex = sortedNums[sortedNums.length - 1].zIndex + 1
|
||||
sortedNums.forEach((item:any,index:any) => {
|
||||
arr[item.num]['z-index'] = index + 1
|
||||
});
|
||||
return arr
|
||||
},
|
||||
@@ -788,6 +792,7 @@ export default defineComponent({
|
||||
initStyle(dom:any,style:any){
|
||||
if(!style)return
|
||||
for (const [property, value] of Object.entries(style)) {
|
||||
|
||||
dom.style.setProperty(property, value);
|
||||
}
|
||||
},
|
||||
@@ -812,21 +817,19 @@ export default defineComponent({
|
||||
//提交模板
|
||||
submitTemplate() {
|
||||
this.loadingShow = true
|
||||
this.setIndex(this.styleObj.domStyle)//index统一排序设置值
|
||||
this.styleObj.domStyle = this.setIndex(this.styleObj.domStyle)//index统一排序设置值
|
||||
this.store.commit("setDisposeMoodboardPosition", this.styleObj);
|
||||
this.layoutList.forEach((v:any)=>{
|
||||
v.setPitch = false
|
||||
})
|
||||
nextTick().then(async ()=>{
|
||||
let layoutCentent = document.getElementById('layoutCentent')
|
||||
let moodboardPosition = this.store.state.UploadFilesModule.moodboardPosition
|
||||
domTurnImg(layoutCentent).then((rv)=>{
|
||||
let file =rv
|
||||
let param = new FormData();
|
||||
param.append('inPin','0')
|
||||
param.append('gender','')
|
||||
param.append('level1Type','Moodboard')
|
||||
param.append('moodboardPosition',moodboardPosition)
|
||||
param.append('timeZone',Intl.DateTimeFormat().resolvedOptions().timeZone)
|
||||
param.append('file',file);
|
||||
let config:any = {headers:{'Content-Type':'multipart/form-data','Accept':'*/*' }}
|
||||
|
||||
Reference in New Issue
Block a user