This commit is contained in:
X1627315083
2024-06-20 10:36:45 +08:00
parent 814dd1205c
commit dc93403506
28 changed files with 1506 additions and 394 deletions

View File

@@ -97,7 +97,7 @@
<div class="centent_div centent_print" v-if="exhibitionList.print && exhibitionList.print.length > 1" @click="openCurrent(2)">
<img v-for="item in exhibitionList.print" :key="item.id" :src="item.path" alt="">
</div>
<div v-else-if="exhibitionList.print && exhibitionList.print.length == 1" class="centent_div">
<div v-else-if="exhibitionList.print && exhibitionList.print.length == 1" class="centent_div" @click="openCurrent(2)">
<img :src="exhibitionList.print[0]?.path" alt="">
</div>
<i v-else class="fi fi-rr-picture centent" @click="openCurrent(2)"></i>
@@ -133,7 +133,7 @@
<div class="centent_div centent_print" v-if="exhibitionList.elements && exhibitionList.elements.length > 1" @click="openCurrent(4)">
<img v-for="item in exhibitionList.elements" :key="item.id" :src="item.path" alt="">
</div>
<div v-else-if="exhibitionList.elements && exhibitionList.elements.length == 1" class="centent_div">
<div v-else-if="exhibitionList.elements && exhibitionList.elements.length == 1" class="centent_div" @click="openCurrent(4)">
<img :src="exhibitionList.elements[0]?.path" alt="">
</div>
<i v-else class="fi fi-rr-picture centent" @click="openCurrent(4)"></i>
@@ -359,6 +359,8 @@ export default defineComponent({
handler(newVal,oldVal){
if(newVal && newVal.length > 0){
this.exhibitionList.print = this.setExhibitionList(newVal)
}else{
this.exhibitionList.print = []
}
}
},
@@ -366,6 +368,8 @@ export default defineComponent({
handler(newVal,oldVal){
if(newVal && newVal.length > 0){
this.exhibitionList.elements = this.setExhibitionList(newVal)
}else{
this.exhibitionList.print = []
}
}
},

View File

@@ -24,9 +24,9 @@
<!-- <div class="modal_img_item" v-for="item,index in current.printObject.prints" :key="item" > -->
<img v-lazy="item.path" alt="">
<sketchCategory :disignTypeList="designTypeList" :generateList="exhibitionList.print" :item="item" :isSpread="true" :isSetSketchCategory="true"></sketchCategory>
<div
class="delete_file_block"
v-if="current.printObject.ifSingle"
@click="deleteSelectptints(item,index)"
>
<span class="icon iconfont icon-shanchu"></span>
@@ -92,10 +92,9 @@
</div>
</div>
<div v-show="type_ == 1 || type_ == 3" @click.stop="setPreview" class="subitOkPreviewBtn" :class="[ !sketchImg?.id?!current?.id?'active':'':'' ]">{{ $t('DesignDetailEnd.preview') }}</div>
<div v-if="type_ == 2 && (current?.printObject?.prints?.length != 0 || printsList.length != 0)" @click.stop="setPrint" class="subitOkPreviewBtn Guide_1_23">{{ $t('DesignDetailEnd.Layout') }}</div>
<div v-if="type_ == 2 && (current?.printObject?.prints?.length != 0 || printsList.length != 0 || exhibitionList.print.length != 0)" @click.stop="setPrint" class="subitOkPreviewBtn Guide_1_23">{{ $t('DesignDetailEnd.Layout') }}</div>
<!-- <div v-else-if="type_ == 2 && designItemDetail?.clothes?.[currentIndex]?.printObject?.prints?.[0]?.path != null && current?.printObject?.prints?.[0]?.path == null" @click.stop="setPreview" class="subitOkPreviewBtn">{{ $t('DesignDetailEnd.preview') }}</div> -->
<div v-if="type_ == 4" @click.stop="setElemets" class="subitOkPreviewBtn">{{ $t('DesignDetailEnd.Layout') }}</div>
<div v-if="type_ == 4 && (elementsList.length != 0 || exhibitionList.elements.length != 0)" @click.stop="setElemets" class="subitOkPreviewBtn">{{ $t('DesignDetailEnd.Layout') }}</div>
<DesignPrintOperation v-if="!moible" ref="DesignPrintOperation"></DesignPrintOperation>
<DesignPrintOperationMobile v-else ref="DesignPrintOperationMobile"></DesignPrintOperationMobile>
<DesignElementsOperation v-if="!moible" ref="DesignElementsOperation"></DesignElementsOperation>

View File

@@ -40,10 +40,10 @@
<div class="print_right show_print_right Guide_1_25" :class="[driver__.driver?'showEvents':'']">
<div class="designOpenrtion_nav">
<div class="designOpenrtion_single" v-for="item,index in designOpenrtionList" :key="item" v-show="(stateOverallSingle == 'overall' && item.level2Type == 'Pattern') || stateOverallSingle == 'single'">
<img :src="item.path" @click="setpitch(item,index)">
<img :class="[(item.checked == true && overallSingle == false)?'active':'']" :src="item.path" @click="setpitch(item,index)">
</div>
<div class="designOpenrtion_single" v-for="item,index in designList" :key="item" v-show="(stateOverallSingle == 'overall' && item.level2Type == 'Pattern') || stateOverallSingle == 'single'">
<img :src="item.path" @click="setpitch(item,index)">
<img :class="[(item.checked == true && overallSingle == false)?'active':'']" :src="item.path" @click="setpitch(item,index)">
</div>
<!-- <div class="designOpenrtion_overall" v-show="!overallSingle">
<img :src="designOpenrtionList[0].path">
@@ -87,6 +87,7 @@
</div>
</div>
<!-- <img v-if="overallSingle" :src="current?.layersObject?.[1]?.maskUrl" alt="" class="designOpenrtion_sketch"> -->
<!-- {{printStyleList[stateOverallSingle][0]}} -->
<img :src="current?.path" alt="" class="designOpenrtion_sketch">
<img v-show="overallSingle" :src="current?.layersObject?.[1]?.maskUrl" alt="" class="designOpenrtion_sketch_mask">
<div class="designOpenrtion_btn">
@@ -104,9 +105,9 @@
<ul v-if="!overallSingle && printStyleList[stateOverallSingle][0]" :class="{active:printStyleList[stateOverallSingle][0]?.designOpenrtionBtn}" class="designOpenrtion_Mouoverall" :style="'left:'+printStyleList[stateOverallSingle][0]?.style?.left+';top:'+printStyleList[stateOverallSingle][0]?.style?.top+';'" @mousedown.stop="itemMoveMousedown(0,$event)">
<i class="fi fi-rr-arrows animtion1"></i>
<i class="fi fi-rr-arrows animtion2"></i>
<li class="designOpenrtion_delete" @click="deletePrint">
<!-- <li class="designOpenrtion_delete" @click="deletePrint">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAACxAAAAsQHGLUmNAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAdBJREFUSImt1r1uU0EQBeDPFh1pgBQEEwFVAg9BROhCAh1FAg1gkMA8DA0oKOEB3IEIRQgF4SEQBIUC6ENSGgPFXaPx+udeSxxppPXOzJnZ8e7MrRmPWdzANZxPv+EbvmILL/G9hGcADayjgz8l0kUb56qSX8dhBeJcDrFSRv44ZRQdt3EPczieZB5NvB1ymta4zCP5J1yucOIFfM6CDJykob8s73GiAnkPJ7Eb/H9iJhpsZJlPQh6D7AWe9Z5iFr+CIpalhjWspnXZ/pXA01FURkv/HxpxK+g2UE+yGfZXM5+doHt4DEtB2R5dAXdD9nfG2LVxNa2XKGreiziXGefZ5rKZbCLmg/4jHIWNqSEZ1fC0IrnE0bM5qqdFGWoV92RBf/P/S3RRVqI3YaOZGd8eQpgHXMt8HgTd67qi5fZwMzOO5XuREmim9ShEji04q78tLwSDSR/aYuD599DgeVDsY3pMhqOQt4pnUXlGf7PbTQ5VcQofgv8BTudGK/rb9Z6it5RhEV+CX1cxYoeiZXDg7OC+4vpNJbmkuC3vMtsuHpVltKzo55OOzINxmeeYxhPVhn5H0ftnhhGNeu49NBSjdBkX9H+27Cvu+Sv8GEXwF9+O3b1zwZqdAAAAAElFTkSuQmCC" alt="">
</li>
</li> -->
</ul>
</div>
</div>
@@ -287,6 +288,9 @@ export default defineComponent({
this.ifListOver()
if(this.current.printObject.prints)this.exhibitionOpenrtionList[this.stateOverallSingle] = JSON.parse(JSON.stringify(this.current.printObject.prints))
if(this.$parent.exhibitionList.print)this.designOpenrtionList = JSON.parse(JSON.stringify(this.$parent.exhibitionList.print))
if(this.overallSingle == false && this.designOpenrtionList.length > 0){
this.designOpenrtionList[0].checked = true
}
if(this.$parent.elementsList)this.designList = JSON.parse(JSON.stringify(this.$parent.printsList))
// this.overallSingle = this.current.ifSingle?false:this.current.ifSingle
let skecth = new Image
@@ -341,14 +345,27 @@ export default defineComponent({
}
// this.random()
},
async setpitch(item,index){
async setpitch(item,index,str){
await this.setPrintWH(item.path)
this.printStyleList[this.stateOverallSingle].forEach((v)=>{
v.designOpenrtionBtn = false
})
if(!this.overallSingle){
if(item.checked){
this.deletePrint()
item.checked = false
return
}else{
this.designOpenrtionList.forEach((itemElem)=>{
itemElem.checked = false
})
this.designList.forEach((itemElem)=>{
itemElem.checked = false
})
item.checked = true
}
this.printStyleList[this.stateOverallSingle][0] = JSON.parse(JSON.stringify(this.currentPrintStyleList))
this.refetchTemplate(0)
this.refetchTemplate(0,true)
this.exhibitionOpenrtionList[this.stateOverallSingle][0] = {
angle:0,
designType:item.designType,
@@ -359,7 +376,7 @@ export default defineComponent({
scale:.3,
location:[0,0]
}
this.systemDesignerPercentage = 30
this.systemDesignerPercentage = item.scale?item.scale*100:30
}else{
this.printStyleList[this.stateOverallSingle].push(JSON.parse(JSON.stringify(this.currentPrintStyleList)))
let currentIndex = this.printStyleList[this.stateOverallSingle].length-1
@@ -373,7 +390,7 @@ export default defineComponent({
scale:1,
location:[0,0]
})
this.refetchTemplate(currentIndex)
this.refetchTemplate(currentIndex,false)
}
},
//设置移动
@@ -518,11 +535,11 @@ export default defineComponent({
},
random(){
this.exhibitionOpenrtionList[this.stateOverallSingle].forEach((v,index)=>{
this.refetchTemplate(index)
this.refetchTemplate(index,false)
})
},
//随机重置图片顺序
refetchTemplate(index) {
refetchTemplate(index,boor) {
// let scale = (Math.trunc(Math.random()*15)+1)*.1
let rotateZ1 = Math.trunc(Math.random()*360)+1
let rotateZ2 = Math.trunc(Math.random()*360)+1
@@ -549,8 +566,8 @@ export default defineComponent({
top:0,
},
style:{
left:Math.trunc(Math.random()*x)+1+"px",
top:Math.trunc(Math.random()*y)+1+"px",
left:(boor?sketch.offsetWidth/2:Math.trunc(Math.random()*x)+1)+"px",
top:(boor?sketch.offsetHeight/2:Math.trunc(Math.random()*y)+1)+"px",
right:"auto",
bottom:"auto",
width:this.print.width.replace(/px/g,'')*scale+'px',
@@ -915,6 +932,10 @@ export default defineComponent({
img{
width: 100%;
cursor: pointer;
&.active{
opacity: .5;
transform: scale(.8);
}
}
.designOpenrtion_overall{
width: 80%;

View File

@@ -38,6 +38,20 @@
</div>
</div>
<div class="print_right show_print_right Guide_1_25" :class="[driver__?.driver?'showEvents':'']">
<div class="designOpenrtionMobile_nav">
<!-- <div class="designOpenrtionMobile_single" v-show="overallSingle" v-for="item,index in designOpenrtionList" :key="item" :class="{active:printStyleList[index]?.designOpenrtionBtn?printStyleList[index]?.designOpenrtionBtn:false}">
<img :src="item.path" @click="setpitch(item,index)">
</div> -->
<div class="designOpenrtionMobile_single" v-for="item,index in designOpenrtionList" :key="item" v-show="(stateOverallSingle == 'overall' && item.level2Type == 'Pattern') || stateOverallSingle == 'single'">
<img :class="[(item.checked == true && overallSingle == false)?'active':'']" :src="item.path" @click="setpitch(item,index)">
</div>
<div class="designOpenrtionMobile_single" v-for="item,index in designList" :key="item" v-show="(stateOverallSingle == 'overall' && item.level2Type == 'Pattern') || stateOverallSingle == 'single'">
<img :class="[(item.checked == true && overallSingle == false)?'active':'']" :src="item.path" @click="setpitch(item,index)">
</div>
<!-- <div class="designOpenrtionMobile_overall" v-show="!overallSingle">
<img :src="designOpenrtionList[0].path">
</div> -->
</div>
<div v-show="!overallSingle" class="habit_System_Designer">
<div class="habit_System_Designer_text">Scale</div>
<a-slider id="system_silder"
@@ -53,20 +67,7 @@
<input class="search_input" :placeholder="$t('DesignPrintOperation.inputContent')" type="Number" v-model="printAmount" @input="setprintAmount">
<i class="fi fi-rr-trash" @click="deletePrint"></i>
</div> -->
<div class="designOpenrtionMobile_nav">
<!-- <div class="designOpenrtionMobile_single" v-show="overallSingle" v-for="item,index in designOpenrtionList" :key="item" :class="{active:printStyleList[index]?.designOpenrtionBtn?printStyleList[index]?.designOpenrtionBtn:false}">
<img :src="item.path" @click="setpitch(item,index)">
</div> -->
<div class="designOpenrtionMobile_single" v-for="item,index in designOpenrtionList" :key="item" v-show="(stateOverallSingle == 'overall' && item.level2Type == 'Pattern') || stateOverallSingle == 'single'">
<img :src="item.path" @click="setpitch(item,index)">
</div>
<div class="designOpenrtionMobile_single" v-for="item,index in designList" :key="item" v-show="(stateOverallSingle == 'overall' && item.level2Type == 'Pattern') || stateOverallSingle == 'single'">
<img :src="item.path" @click="setpitch(item,index)">
</div>
<!-- <div class="designOpenrtionMobile_overall" v-show="!overallSingle">
<img :src="designOpenrtionList[0].path">
</div> -->
</div>
<div class="subitOkPreviewBtn" @click.stop="setPreview">{{ $t('DesignPrintOperation.preview') }}</div>
<div class="subitOkPreviewBtn Guide_1_25_1" :class="[driver__.driver?'hideEvents':'']" @click.stop="setOK">OK</div>
</div>
@@ -105,9 +106,9 @@
<ul v-if="!overallSingle && printStyleList[stateOverallSingle][0]" :class="{active:printStyleList[stateOverallSingle][0]?.designOpenrtionBtn}" class="designOpenrtionMobile_Mouoverall" :style="'left:'+printStyleList[stateOverallSingle][0]?.style?.left+';top:'+printStyleList[stateOverallSingle][0]?.style?.top+';'" @touchstart.stop="itemMoveMousedown(0,$event)">
<i class="fi fi-rr-arrows animtion1"></i>
<i class="fi fi-rr-arrows animtion2"></i>
<li class="designOpenrtionMobile__delete" @click="deletePrint">
<!-- <li class="designOpenrtionMobile__delete" @click="deletePrint">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAACxAAAAsQHGLUmNAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAdBJREFUSImt1r1uU0EQBeDPFh1pgBQEEwFVAg9BROhCAh1FAg1gkMA8DA0oKOEB3IEIRQgF4SEQBIUC6ENSGgPFXaPx+udeSxxppPXOzJnZ8e7MrRmPWdzANZxPv+EbvmILL/G9hGcADayjgz8l0kUb56qSX8dhBeJcDrFSRv44ZRQdt3EPczieZB5NvB1ymta4zCP5J1yucOIFfM6CDJykob8s73GiAnkPJ7Eb/H9iJhpsZJlPQh6D7AWe9Z5iFr+CIpalhjWspnXZ/pXA01FURkv/HxpxK+g2UE+yGfZXM5+doHt4DEtB2R5dAXdD9nfG2LVxNa2XKGreiziXGefZ5rKZbCLmg/4jHIWNqSEZ1fC0IrnE0bM5qqdFGWoV92RBf/P/S3RRVqI3YaOZGd8eQpgHXMt8HgTd67qi5fZwMzOO5XuREmim9ShEji04q78tLwSDSR/aYuD599DgeVDsY3pMhqOQt4pnUXlGf7PbTQ5VcQofgv8BTudGK/rb9Z6it5RhEV+CX1cxYoeiZXDg7OC+4vpNJbmkuC3vMtsuHpVltKzo55OOzINxmeeYxhPVhn5H0ftnhhGNeu49NBSjdBkX9H+27Cvu+Sv8GEXwF9+O3b1zwZqdAAAAAElFTkSuQmCC" alt="">
</li>
</li> -->
</ul>
</div>
</div>
@@ -288,7 +289,9 @@ export default defineComponent({
if(this.current.printObject.prints)this.exhibitionOpenrtionList[this.stateOverallSingle] = JSON.parse(JSON.stringify(this.current.printObject.prints))
if(this.$parent.exhibitionList.print)this.designOpenrtionList = JSON.parse(JSON.stringify(this.$parent.exhibitionList.print))
if(this.$parent.elementsList)this.designList = JSON.parse(JSON.stringify(this.$parent.printsList))
// this.overallSingle = this.current.ifSingle?false:this.current.ifSingle
if(this.overallSingle == false && this.designOpenrtionList.length > 0){
this.designOpenrtionList[0].checked = true
}
let skecth = new Image
skecth.src = this.current.path
skecth.onload=()=>{
@@ -347,7 +350,21 @@ export default defineComponent({
v.designOpenrtionBtn = false
})
if(!this.overallSingle){
if(item.checked){
this.deletePrint()
item.checked = false
return
}else{
this.designOpenrtionList.forEach((itemElem)=>{
itemElem.checked = false
})
this.designList.forEach((itemElem)=>{
itemElem.checked = false
})
item.checked = true
}
this.printStyleList[this.stateOverallSingle][0] = JSON.parse(JSON.stringify(this.currentPrintStyleList))
this.refetchTemplate(0,true)
this.exhibitionOpenrtionList[this.stateOverallSingle][0] = {
angle:0,
designType:item.designType,
@@ -358,8 +375,7 @@ export default defineComponent({
scale:.3,
location:[0,0]
}
this.refetchTemplate(0)
this.systemDesignerPercentage = 30
this.systemDesignerPercentage = item.scale?item.scale*100:30
}else{
this.printStyleList[this.stateOverallSingle].push(JSON.parse(JSON.stringify(this.currentPrintStyleList)))
let currentIndex = this.printStyleList[this.stateOverallSingle].length-1
@@ -373,7 +389,7 @@ export default defineComponent({
scale:1,
location:[0,0]
})
this.refetchTemplate(currentIndex)
this.refetchTemplate(currentIndex,false)
}
},
//设置移动
@@ -519,11 +535,11 @@ export default defineComponent({
},
random(){
this.exhibitionOpenrtionList[this.stateOverallSingle].forEach((v,index)=>{
this.refetchTemplate(index)
this.refetchTemplate(index,false)
})
},
//随机重置图片顺序
refetchTemplate(index) {
refetchTemplate(index,boor) {
// let scale = (Math.trunc(Math.random()*15)+1)*.1
let rotateZ1 = Math.trunc(Math.random()*360)+1
let rotateZ2 = Math.trunc(Math.random()*360)+1
@@ -550,8 +566,8 @@ export default defineComponent({
top:0,
},
style:{
left:Math.trunc(Math.random()*x)+1+"px",
top:Math.trunc(Math.random()*y)+1+"px",
left:(boor?sketch.offsetWidth/2:Math.trunc(Math.random()*x)+1)+"px",
top:(boor?sketch.offsetHeight/2:Math.trunc(Math.random()*y)+1)+"px",
right:"auto",
bottom:"auto",
width:this.print.width.replace(/px/g,'')*scale+'px',
@@ -567,7 +583,8 @@ export default defineComponent({
}
},
//设置图片
setTemplate(item,index) {
async setTemplate(item,index) {
await this.setPrintWH(item.path)
this.designOpenrtionList
let sketch = document.getElementsByClassName("designOpenrtionMobile_modal")[0]?.getElementsByClassName('designOpenrtionMobile_sketch')[0]
let sketchNum = this.sketch.width.replace(/rem/g,'')*10/sketch.offsetWidth
@@ -952,6 +969,10 @@ export default defineComponent({
img{
width: 100%;
cursor: pointer;
&.active{
opacity: .5;
transform: scale(.8);
}
}
.designOpenrtionMobile_overall{
width: 80%;

View File

@@ -31,7 +31,7 @@
<i class="icon iconfont icon-move" @click="setOperation('move')" :class="{active:canvasState == 'move'}"></i>
<i class="icon iconfont icon-bianji" @click="setOperation('pencil')" :class="{active:canvasState == 'pencil'}"></i>
<i class="icon iconfont icon-xiangpi_huaban1" @click="setOperation('eraser')" :class="{active:canvasState == 'eraser'}"></i>
<input type="range" v-show="canvasState != 'move'" @input="setPencilWidth" min="1" max="50" v-model="canvasPencilWidth">
<input type="range" v-show="canvasState != 'move'" @input="setPencilWidth" min="1" max="50" v-model="canvasPencilWidth[canvasState]">
<div class="icon iconfont icon-xiala" :class="{btnRotate:spreadState}" @click="()=>spreadState = !spreadState"></div>
</div>
</div>
@@ -76,7 +76,10 @@ export default defineComponent({
let exportWH = 512
let canvasBtn = reactive({
canvasState:'move',
canvasPencilWidth:4,
canvasPencilWidth:{
pencil:4,
eraser:4,
},
spreadState:false,
})
let canvasWH = ref(0);
@@ -166,7 +169,7 @@ export default defineComponent({
}
let rgba = 'rgba(0, 0, 0, 1)'
let brushIndicator = new fabric.Circle({
radius:(canvasBtn.canvasPencilWidth/2),
radius:(canvasBtn.canvasPencilWidth[canvasBtn.canvasState]/2),
fill: '#fff',
stroke: '#000',
strokeWidth: 1,
@@ -198,7 +201,7 @@ export default defineComponent({
let setPencil = ()=>{
canvas.isDrawingMode = true//开启绘画模式
canvas.freeDrawingBrush = new fabric.PencilBrush(canvas,{});
canvas.freeDrawingBrush.width = Number(canvasBtn.canvasPencilWidth);
canvas.freeDrawingBrush.width = Number(canvasBtn.canvasPencilWidth[canvasBtn.canvasState]);
canvas.freeDrawingBrush.color = rgba
brushIndicator.set('fill',rgba)
canvas.freeDrawingBrush.isEraser = false
@@ -210,7 +213,7 @@ export default defineComponent({
brushIndicator.set({fill: '#fff'});
canvas.requestRenderAll();
canvas.freeDrawingBrush.isEraser = true
canvas.freeDrawingBrush.width = Number(canvasBtn.canvasPencilWidth);
canvas.freeDrawingBrush.width = Number(canvasBtn.canvasPencilWidth[canvasBtn.canvasState]);
}
let deleteObj = ()=> {
// if(!canvas.getActiveObjects()){
@@ -231,7 +234,7 @@ export default defineComponent({
let setPencilWidth = ()=>{//切换颜色给铅笔设置颜色
clearTimeout(setTimeOutWidth)
setTimeOutWidth = setTimeout(()=>{
canvas.freeDrawingBrush.width = Number(canvasBtn.canvasPencilWidth)
canvas.freeDrawingBrush.width = Number(canvasBtn.canvasPencilWidth[canvasBtn.canvasState])
},300)
}
let updateCanvasState = () =>{

View File

@@ -169,6 +169,9 @@
<habitSetStyle ref="habitSetStyle" @setParentData=setParentData @setWorkspaceStyle=setWorkspaceStyle></habitSetStyle>
</div>
</div>
<div class="mark_loading" v-show="isShowMark">
<a-spin size="large" />
</div>
</template>
<script lang="ts">
import { useStore } from "vuex";
@@ -242,6 +245,7 @@ export default defineComponent({
])
const {t} = useI18n()
let styleList = ref([])
let isShowMark = ref(true)
return{
systemSeleves,
mannequins,
@@ -256,7 +260,8 @@ export default defineComponent({
sex,
position,
t,
styleList
styleList,
isShowMark
}
},
watch:{
@@ -493,43 +498,44 @@ export default defineComponent({
getDetail(id:any){//
Https.axiosGet(Https.httpUrls.workspaceDetail,{params:{id:id}}).then((rv: any) => {
if (rv) {
this.isShowMark = false
if(rv.position == "Overall"){
rv.overallSingle = false
}else{
rv.overallSingle = true
}
rv.keyWord = {
Moodboard:[{
name:'Moodboard',
id:1,
},{
name:'Moodboard',
id:2,
},{
name:'Moodboard',
id:3,
}],
Printboard:[{
name:'Printboard',
id:1,
},{
name:'Printboard',
id:2,
},{
name:'Printboard',
id:3,
}],
Sketchboard:[{
name:'Sketchboard',
id:1,
},{
name:'Sketchboard',
id:2,
},{
name:'Sketchboard',
id:3,
}],
}
// rv.allKeywordsByStyle = {
// Moodboard:[{
// name:'Moodboard',
// id:1,
// },{
// name:'Moodboard',
// id:2,
// },{
// name:'Moodboard',
// id:3,
// }],
// Printboard:[{
// name:'Printboard',
// id:1,
// },{
// name:'Printboard',
// id:2,
// },{
// name:'Printboard',
// id:3,
// }],
// Sketchboard:[{
// name:'Sketchboard',
// id:1,
// },{
// name:'Sketchboard',
// id:2,
// },{
// name:'Sketchboard',
// id:3,
// }],
// }
rv.putName = false
this.workspaceItem = rv
this.setMannequinsSex()
@@ -810,7 +816,8 @@ export default defineComponent({
// this.store.commit("setTemplateData", event);
// },
setWorkspaceStyle(data: any){
this.workspaceItem.styleId = data
this.workspaceItem.styleId = data.id
this.workspaceItem.styleName = data.name
this.putWorkspace(this.workspaceItem,this.workspaceItem.id)
},
setStyle(){

View File

@@ -29,9 +29,15 @@
</div>
</div>
</div>
<div class="habitSetStyle_ok started_btn" @click="setOk">
OK
<div class="habitSetStyle_ok">
<div class="started_btn" @click="setOk()">
OK
</div>
<div class="started_btn" @click="setClear()">
Clear
</div>
</div>
</div>
<div class="mark_loading" v-show="isShowMark">
<a-spin size="large" />
@@ -42,11 +48,12 @@
<script lang="ts">
import { defineComponent,watch,createVNode, h, ref ,toRefs,computed,reactive,triggerRef, nextTick} from "vue";
// import { getCookie } from "@/tool/cookie";
import { message,Modal } from "ant-design-vue";
import { LoadingOutlined ,ExclamationCircleOutlined} from "@ant-design/icons-vue";
import { Https } from "@/tool/https";
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";
export default defineComponent({
@@ -55,6 +62,7 @@ emits:['setParentData','setWorkspaceStyle'],
setup(props,{emit}) {
let habitSetStyle: any = ref(false);//弹窗
let habitSetStyleMask:any = ref(false)//弹窗遮罩
let oldDataId = ''
let habitSetStyleData:any = reactive({
styleList:[],
selectStyle:{
@@ -85,6 +93,7 @@ setup(props,{emit}) {
if(habitSetStyleData.styleList.length == 0){
getStyleList()
}
oldDataId = data.styleId
habitSetStyleData.selectStyle.id = data.styleId
habitSetStyleData.selectStyle.name = data.styleName
// habitSetStyleData.selectStyleId = 'feng2'
@@ -108,8 +117,38 @@ setup(props,{emit}) {
cleardata()
}
let setOk= ()=>{
emit('setWorkspaceStyle',habitSetStyleData.selectStyle.id)
cleardata()
let data = {
id:habitSetStyleData.selectStyle.id,
name:habitSetStyleData.selectStyle.name,
isRevampModel:false,
}
if(oldDataId == data.id){
cleardata()
}else{
let _this = this
Modal.confirm({
title: 'It is detected that you have modified the style, may I ask whether the model is changed to the model corresponding to the style',
icon: createVNode(ExclamationCircleOutlined),
okText: 'Yes',
cancelText: 'No',
mask:false,
centered:true,
zIndex:1050,
onOk() {
data.isRevampModel = true
emit('setWorkspaceStyle',data)
cleardata()
},
onCancel() {
emit('setWorkspaceStyle',data)
cleardata()
},
});
}
}
let setClear = ()=>{
habitSetStyleData.selectStyle.id = ''
habitSetStyleData.selectStyle.name = ''
}
let setItemSelect = (item:any)=>{
habitSetStyleData.selectStyle = item
@@ -123,6 +162,7 @@ setup(props,{emit}) {
cancelDsign,
setItemSelect,
setOk,
setClear,
};
},
data() {
@@ -231,6 +271,11 @@ methods: {
width: 60%;
text-align: center;
margin: 0 auto;
display: flex;
justify-content: space-around;
>div{
width: 40%;
}
}
}

View File

@@ -51,7 +51,7 @@
</div> -->
<div class="color_setting_operateSingle">
<div class="started_btn" @click="setOperate">
{{ colorList[selectIndex]?.gradient?.gradientShow? 'Gradual Change':'Single'}}
{{ colorList[selectIndex]?.gradient?.gradientShow? 'Gradual':'Single'}}
</div>
</div>
<div class="color_setting_operate" v-if="colorList[selectIndex]?.gradient?.gradientShow">

View File

@@ -101,7 +101,34 @@
<i class="icon iconfont icon-move" @click="setOperation('move')" :class="{active:operation == 'move'}"></i>
<i class="icon iconfont icon-xiangpi_huaban1" @click="setOperation('eraser')" :class="{active:operation == 'eraser'}"></i>
</div>
<div class="exportCanvasBox_left_tool_item">
<i class="icon iconfont icon-xian" @click="setOperation('fold')" :class="{active:operation == 'fold'}"></i>
<i class="icon iconfont icon-checkbox-full" @click="setOperation('rect')" :class="{active:operation == 'rect'}"></i>
<!-- <i class="icon iconfont icon-zhixian" @click="setOperation('line')" :class="{active:operation == 'line'}"></i> -->
<!-- <i class="icon iconfont icon-circle" @click="setOperation('circle')" :class="{active:operation == 'circle'}"></i> -->
<i class="icon iconfont icon-sanjiaoxing" @click="setOperation('triangle')" :class="{active:operation == 'triangle'}"></i>
<i class="icon iconfont icon-tx-fill-tuoyuanxing" @click="setOperation('ellipse')" :class="{active:operation == 'ellipse'}"></i>
<label class="uploadImage">
<i class="icon iconfont icon-shangchuantupian" ></i>
<input type="file" @change="uploadImage">
</label>
<i class="icon iconfont" @click="setOperation('text')" :class="{active:operation == 'text'}">T</i>
</div>
</div>
<div class="exportCanvasBox_title" @click.stop="setCloseNav('move')">
{{ $t('exportModel.More') }}
<!-- <div
:class="[
'icon',
'iconfont',
'icon-xiala',
closeNav.move?'icon-rotate':''
]"
>
</div> -->
</div>
<div class="exportCanvasBox_left_tool exportCanvasBox_left_item" :class="{'closeNav' :closeNav.tool}">
<div class="exportCanvasBox_left_tool_item">
<label v-show="operation != 'move' && operation != 'eraser' && operation != 'texture'">
<div >{{ $t('exportModel.Color') }}</div>
@@ -109,7 +136,7 @@
</label>
<label v-show="operation != 'move'">
<div >{{ $t('exportModel.Size') }}:</div>
<input type="range" @input="setPencilWidth" min="1" max="50" v-model="canvasPencilWidth[operation]">
<input @change="setFontFamily" type="range" @input="setPencilWidth" min="3" max="50" v-model="canvasPencilWidth[operation]">
</label>
<label v-show="operation == 'pencil'">
<div >{{ $t('exportModel.Brushwork') }}:</div>
@@ -135,7 +162,7 @@
</a-select-option>
</a-select>
</label>
<label v-show="operation != 'pencil' && operation != 'eraser'&&operation != 'move'&&operation != 'text'&&operation != 'texture'">
<label v-show="operation != 'pencil' && operation != 'eraser'&&operation != 'move'&&operation != 'text'&&operation != 'texture'&&operation != ''">
<div >{{ $t('exportModel.FillBack') }}:</div>
<div class="exportCanvasBox_left_tool_item leftAlign">
<i class="icon iconfont icon-tuceng1" @click="setOperationMode('fill')" :class="{active:operationMode == 'fill'}"></i>
@@ -155,40 +182,24 @@
<div >{{ $t('exportModel.Width') }}</div>
<input type="number" @input="setAllSelectWidth" v-model="allSelectWidth">
</label>
<label v-show="operation == '' || operation == 'text' || textDataShow">
<div>Font Family</div>
<a-select ref="select" class="label_select" size="small" v-model:value="fontFamily"
style="flex: 1"
@change="setFontFamily"
>
<!-- v-model:value="brushwork" -->
<a-select-option class="label_select_item" v-for="item in textFontFamilyList" :style="{'font-family':item.value}" :value="item.value">
{{item.name}}
</a-select-option>
</a-select>
</label>
<!-- <label v-show="operation != 'move' && operation != 'eraser' && operation != 'texture'">
<div >{{ $t('exportModel.Height') }}</div>
<input type="number" @input="setPencilColor" v-model="canvasPencilColor">
</label> -->
</div>
</div>
<div class="exportCanvasBox_title" @click.stop="setCloseNav('move')">
{{ $t('exportModel.More') }}
<div
:class="[
'icon',
'iconfont',
'icon-xiala',
closeNav.move?'icon-rotate':''
]"
>
</div>
</div>
<div class="exportCanvasBox_left_tool exportCanvasBox_left_item" :class="{'closeNav' :closeNav.move}">
<div class="exportCanvasBox_left_tool_item">
<i class="icon iconfont icon-xian" @click="setOperation('fold')" :class="{active:operation == 'fold'}"></i>
<i class="icon iconfont icon-checkbox-full" @click="setOperation('rect')" :class="{active:operation == 'rect'}"></i>
<!-- <i class="icon iconfont icon-zhixian" @click="setOperation('line')" :class="{active:operation == 'line'}"></i> -->
<!-- <i class="icon iconfont icon-circle" @click="setOperation('circle')" :class="{active:operation == 'circle'}"></i> -->
<i class="icon iconfont icon-sanjiaoxing" @click="setOperation('triangle')" :class="{active:operation == 'triangle'}"></i>
<i class="icon iconfont icon-tx-fill-tuoyuanxing" @click="setOperation('ellipse')" :class="{active:operation == 'ellipse'}"></i>
<label class="uploadImage">
<i class="icon iconfont icon-shangchuantupian" ></i>
<input type="file" @change="uploadImage">
</label>
<i class="icon iconfont" @click="setOperation('text')" :class="{active:operation == 'text'}">T</i>
</div>
</div>
<div class="exportCanvasBox_left_bottom">
<div class="exportCanvasBox_left_credits" v-show="credits<1">
<div><span class="icon iconfont icon-zhuyi"></span>{{ $t('exportModel.insufficient') }}</div>
@@ -443,11 +454,9 @@ export default defineComponent({
Https.axiosPost(Https.httpUrls.exportSearch, data)
.then((rv) => {
resolve(rv)
isShowMark.value = false
})
.catch((rv) => {
resolve(null)
isShowMark.value = false
});
})
@@ -456,6 +465,7 @@ export default defineComponent({
canvasWH.value.height = oldExportCanvas.canvasHeight
canvas.setHeight(canvasWH.value.height);
canvas.loadFromJSON(oldExportCanvas, () => {});
isShowMark.value = false
}else{
for (const item of arr) {
for (const key in allBoardData.value) {
@@ -560,6 +570,7 @@ export default defineComponent({
canvas.setHeight(canvasWH.value.height);
}
}
isShowMark.value = false
}
updateCanvasState('')//加载完成后记录一下
if(driver__.value.driver){
@@ -638,6 +649,9 @@ export default defineComponent({
minioUrl = data.url
}else if(key == 'likePorductImg'){
imgId = data.id
let url = data.imgUrl.split('?')[0]
var match = url.match(/:(\d+)\/(.*)/);
minioUrl = match[2]
}else if(key == 'disposeMoodboard'){
let url = data.imgUrl.split('?')[0]
var match = url.match(/:(\d+)\/(.*)/);
@@ -665,14 +679,33 @@ export default defineComponent({
lockRotation: true,
});
}
//设置导出
let setExport = async () => {
initAligningGuidelines(canvas,false)
var imageDataURL = canvas.toDataURL({
let setExportCanvas = ()=>{
var objects = canvas.getObjects();
var maxHeight = 0;
// 计算所有对象的最大高度
objects.forEach(function(obj) {
var objBottom = obj.top + obj.height*obj.scaleY;
if (objBottom > maxHeight) {
console.log(obj);
maxHeight = objBottom;
}
});
canvasWH.height = maxHeight+30
// 调整 Canvas 的高度
canvas.setDimensions({ height: canvasWH.height });
// 重新渲染 Canvas
canvas.renderAll();
return canvas.toDataURL({
format: "png", // 导出格式为 PNG
quality: 1, // 图片质量为 1最高质量
});
}
//设置导出
let setExport = async () => {
initAligningGuidelines(canvas,false)
var imageDataURL = setExportCanvas()
let a = document.createElement("a");
let img = [];
let index = 0;
@@ -1107,6 +1140,8 @@ export default defineComponent({
let canvasPencilWidth = ref({
})
let fontFamily = ref({})
let textFontFamilyList = ref([])
let allSelectWidth = ref(-1)//多选或单选的宽度
let allSelect = ref([])//多选或单选的宽度
let setOperation = (str)=>{
@@ -1122,10 +1157,9 @@ export default defineComponent({
if(str == 'pencil'){
setPencil()
}else if(str == 'move'){
setMove()
JSchangeType(canvas,'init')
initAligningGuidelines(canvas,true)
setMove()
}else if(str == 'texture'){
setTexture()
}else if(str == 'eraser'){
@@ -1134,8 +1168,8 @@ export default defineComponent({
setMove()
setText()
JSchangeType(canvas,'init')
}else{
canvas.forEachObject((obj) =>obj.selectable = false);
}else if(str){
// canvas.forEachObject((obj) =>obj.selectable = false);
canvas.isDrawingMode = false
}
}
@@ -1356,43 +1390,50 @@ export default defineComponent({
canvas.freeDrawingBrush.isEraser = true
canvas.freeDrawingBrush.width = canvasPencilWidth.value[operation.value]?canvasPencilWidth.value[operation.value]:20;
}
let createText = {}
let setTextFun = (e)=>{
if(operation.value != 'text'){
return
}
var clickedObject = e.target;
if (clickedObject instanceof fabric.Textbox) {
createText = clickedObject
}else{
var pointer = canvas.getPointer(e.pointer);
var x = pointer.x;
var y = pointer.y;
let textbox = new fabric.Textbox('', {
createText = new fabric.Textbox('', {
left: x,
top: y,
width: 150,
fontSize: canvasPencilWidth.value[operation.value]?canvasPencilWidth.value[operation.value]:20,
fontFamily:fontFamily.value,
fill:canvasPencilColor.value,
})
canvas.add(textbox)
textbox.enterEditing();
canvas.setActiveObject(textbox).renderAll();
canvas.add(createText)
createText.enterEditing();
canvas.setActiveObject(createText).renderAll();
operation.value = ''
removeSetText()
}
}
let setText = ()=>{
if(isMoible()){
canvas.on('mouse:down',setTextFun)
}else{
canvas.on('mouse:dblclick',setTextFun)
}
// if(isMoible()){
// canvas.on('mouse:down',setTextFun)
// }else{
// canvas.on('mouse:dblclick',setTextFun)
// }
}
let removeSetText = ()=>{
if(isMoible()){
canvas.off('mouse:down',setTextFun)
}else{
canvas.off('mouse:dblclick',setTextFun)
}
// if(isMoible()){
// canvas.off('mouse:down',setTextFun)
// }else{
// canvas.off('mouse:dblclick',setTextFun)
// }
}
// let setTextStyle = (x,y)=>{
// var group = new fabric.Group([rect.color, rect.text, rect.text1],{
@@ -1414,6 +1455,10 @@ export default defineComponent({
let setPencilColor = ()=>{//切换颜色给铅笔设置颜色
clearTimeout(setTimeOut.color)
setTimeOut.color = setTimeout(()=>{
if(createText){
setFontFamily()
return
}
// brushIndicator.fill = canvasPencilColor.value;
if(canvas.freeDrawingBrush.isEraser){
@@ -1484,6 +1529,7 @@ export default defineComponent({
let setCanvasDown = (event)=>{
// brushIndicator.set({fill: '#FFF',strokeWidth:0});
//设置移动端按下添加元素
if(isMoible && present.upScaleChecked){
present.upScaleChecked = false
present = {}
@@ -1527,6 +1573,15 @@ export default defineComponent({
}
}
}else{
var clickedObject = event.target;
if (clickedObject instanceof fabric.Textbox && operation.value != 'text') {
textDataShow.value = true
createText = clickedObject
setTextData(clickedObject)
}else{
textDataShow.value = false
createText = {}
}
createPatterningIs = false
}
}
@@ -1549,6 +1604,7 @@ export default defineComponent({
// currentPatterning.set({stroke: canvasPencilColor.value})
createPatterningIs = false
clearPatterning()//临时图形置为空并且添加撤回对象里面
setOperation('move')
}
//设置再画布上抬起
let setCanvasUp = (event)=>{
@@ -1592,9 +1648,10 @@ export default defineComponent({
if(operation.value == 'fold'){
canvas.forEachObject((obj) =>obj.selectable = false);
canvas.bringToFront(polyLineBtn);//设置优先级最高
}else{
}else if(operation.value){
createPatterningIs = false
clearPatterning()//临时图形置为空并且添加撤回对象里面
setOperation('move')
}
}
}
@@ -1768,10 +1825,7 @@ export default defineComponent({
initAligningGuidelines(canvas,false)
let publishModal = publish.value
publishModal.publishMask = true
var imageDataURL = canvas.toDataURL({
format: "jpeg", // 导出格式为 PNG
quality: 1, // 图片质量为 1最高质量
});
var imageDataURL = setExportCanvas()
let data = {
"imgUrl":imageDataURL,
userlikeGroupId:userlikeGroupId,
@@ -1801,7 +1855,43 @@ export default defineComponent({
})
return json
}
onMounted(() => {});
let textDataShow = ref(false)
let setTextData = (obj)=>{
fontFamily.value = obj.fontFamily
canvasPencilWidth.value['text'] = obj.fontSize
canvasPencilColor.value = obj.fill
}
let setFontFamily = ()=>{
if(createText){
createText.set({
fontFamily:fontFamily.value,
fontSize:canvasPencilWidth.value[operation.value]?canvasPencilWidth.value[operation.value]:20,
fill:canvasPencilColor.value,
})
canvas.renderAll();
}
}
onMounted(() => {
let arr = [
{ value: 'Arial', name: 'select font' },
{ value: 'EN_slogan_art1', name: 'select font' },
{ value: 'EN_slogan_art2', name: 'select font' },
{ value: 'EN_slogan_art3', name: 'select font' },
{ value: 'EN_slogan_art4', name: 'select font' },
{ value: 'EN_slogan_art5', name: 'select font' },
{ value: 'EN_slogan_art6', name: 'select font' },
{ value: 'EN_slogan_art7', name: 'select font' },
{ value: '微软雅黑', name: '请选择字体' },
{ value: 'CN_slogan_art1', name: '请选择字体' },
{ value: 'CN_slogan_art2', name: '请选择字体' },
{ value: 'CN_slogan_art3', name: '请选择字体' },
{ value: 'CN_slogan_art4', name: '请选择字体' },
{ value: '华文行楷', name: '请选择字体' },
{ value: '隶书', name: '请选择字体' },
]
textFontFamilyList.value = arr
fontFamily.value = arr[0].value
});
return {
toSvg,
t,
@@ -1853,6 +1943,10 @@ export default defineComponent({
setExportSR,//设置SR导出
setShare,
setSubmit,
textFontFamilyList,
fontFamily,
textDataShow,
setFontFamily,
};
},
data(prop) {
@@ -1989,11 +2083,13 @@ export default defineComponent({
div {
width: 8rem;
}
input {
input,select {
// width: 10em;
flex: 1;
overflow: hidden;
height: 4.5rem;
}
.label_select{
img{
width: 100%;

View File

@@ -43,7 +43,7 @@
<template #content>
<p>Seed</p>
</template>
<input class="search_seed" v-show="scene?.value == 'Logo'" @input="ifSeedValue" v-model="searchPictureSeed" type="Number" placeholder='Seed' min="0">
<input class="search_seed" max="9999" v-show="scene?.value == 'Logo'" @input="ifSeedValue" v-model="searchPictureSeed" type="Number" placeholder='Seed' min="0">
</a-popover>
<input
@@ -99,10 +99,11 @@
</div>
<span class="inputShowText" ref="inputShowText"></span>
</div>
<div class="search_keyword" v-show="isInputFocus" @click.stop="">
<div class="search_keyword" v-if="workspace?.allKeywordsByStyle" v-show="isInputFocus" @click.stop="">
<div class="search_keyword_center">
<div class="search_keyword_center_left">
<div v-for="item in workspace?.keyWord?.[type_.type2]" @click.stop="cliSetKeyword(item.name)" class="search_keyword_center_item"> {{item.name}} </div>
<div v-if="type_.type2 == 'Printboard'" v-for="item in styleRecommend" @click.stop="cliSetKeyword(item)" class="search_keyword_center_item"> {{item}} </div>
<div v-for="item in workspace?.allKeywordsByStyle?.[type_.type2]" @click.stop="cliSetKeyword(item)" class="search_keyword_center_item"> {{item}} </div>
</div>
</div>
</div>
@@ -242,6 +243,7 @@ export default defineComponent({
let generateProceedList = ref([])
let remGenerate:any = ref(false)
let remGenerateTime:any = ref()
let styleRecommend:any = inject('styleRecommend')
return {
searchPictureName,
searchPictureSeed,
@@ -267,6 +269,7 @@ export default defineComponent({
generateProceedList,
remGenerate,
remGenerateTime,
styleRecommend,
};
},
data(prop) {
@@ -392,6 +395,7 @@ export default defineComponent({
},
getgenerate(){
this.isTextarea = false
this.isInputFocus = false
if(this.isGenerate)return
clearInterval(this.remGenerateTime)
if(this.searchPictureName){
@@ -417,16 +421,28 @@ export default defineComponent({
let collectionElementId = ''
let base64 = ''
if(this.sketchboardList?.[0]){
level2Type = this.sketchboardList[0].categoryValue?this.sketchboardList[0].categoryValue:''
collectionElementId = this.sketchboardList[0].id
if(this.sketchboardList[0].base64){
base64 = this.sketchboardList[0].imgUrl
}
}
let sloganType = ['Blue and Yellow Starry Night','Green Cthulhu','Red and yellow fire style','Cyberpunk style','City skyline buildings','Red maple leaves','Golden Sunflower','Emerald Jungle Canopy','Pink Sakura Blossom']
let sloganText = ''
sloganText = this.searchPictureName
if(this.upload.level1Type == "Sketchboard"){
level2Type = this.sketchboardList?.[0]?.categoryValue?this.sketchboardList[0].categoryValue:''
}else if(this.upload.level1Type == "Printboard"){
level2Type = this.scene?.value
if(level2Type == 'Slogan' && this.searchPictureName == ''){
var randomNumber = Math.floor(Math.random() * sloganType.length);
sloganText = sloganType[randomNumber]
}else if(level2Type == 'Pattern'){
sloganText = `${this.printModel.value},${sloganText}`
}
if(!base64 && level2Type == 'Slogan'){
message.info('请绘制Slogan');
return
}
}
let data = {
generateType:'text',
@@ -434,7 +450,7 @@ export default defineComponent({
collectionElementId:collectionElementId,
level1Type:this.upload.level1Type,
level2Type:level2Type,
text:this.searchPictureName,
text:sloganText,
seed:this.searchPictureSeed,
userId:this?.userInfo?.userId,
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
@@ -559,6 +575,9 @@ export default defineComponent({
if(this.searchPictureName[this.searchPictureName.length-1] != ',' && this.searchPictureName.length != 0){
str = ','
}
if(this.upload.level1Type == "Moodboard"){
this.styleRecommend.push(value)
}
this.searchPictureName += str + value
},
ifSeedValue(e:any){

View File

@@ -154,7 +154,7 @@
<span class="icon iconfont icon-shanchu operate_icon"></span>
</div>
<div class="pin_block">
<a-checkbox v-model="item.pin">{{ $t('PrintboardUpload.PIN') }}</a-checkbox>
<a-checkbox v-model:checked="item.pin">{{ $t('PrintboardUpload.PIN') }}</a-checkbox>
</div>
</div>
</div>

View File

@@ -1,5 +1,4 @@
<template>
<keep-alive>
<div v-if="showCollectionModal">
<a-modal class="modal_component collection_modal Guide_1_2"
v-model:visible="showCollectionModal"
@@ -56,7 +55,6 @@
</div>
</a-modal>
</div>
</keep-alive>
</template>
<script lang="ts">
import { defineComponent ,createVNode, ref,onUnmounted , computed,provide } from 'vue'
@@ -101,6 +99,8 @@ export default defineComponent({
let collectionStep=ref(1)
provide('driver__',driver__)
let isShowMark = ref(false)
let styleRecommend = ref([])
provide('styleRecommend',styleRecommend)
onUnmounted(()=>{
let data = {
showCollectionModal:showCollectionModal.value,
@@ -116,6 +116,7 @@ export default defineComponent({
position,
showCollectionModal,
collectionStep,
styleRecommend,
}
},
@@ -203,6 +204,7 @@ export default defineComponent({
_this.showCollectionModal = false
_this.store.commit('clearAllData')
_this.collectionStep = 1
_this.styleRecommend = []
}
});
},
@@ -285,9 +287,12 @@ export default defineComponent({
},
//完成
async finishCollection(){
console.log(123123);
this.isShowMark = true
let sketchList = this.store.state.UploadFilesModule.sketchboard
let arr:any = []
console.log(sketchList);
sketchList.forEach((item:any) => {
let obj = {
designType:item.resData.designType,
@@ -302,6 +307,7 @@ export default defineComponent({
this.isShowMark = false
return
}
let elList = document.querySelectorAll('.img_block_item_sketch img')
Https.axiosPost(Https.httpUrls.sketchBoardsBoundingBox, data)
.then((rv: any) => {

View File

@@ -107,7 +107,7 @@ export default defineComponent({
let canvasWH = ref(0);
let textData = reactive({
fill:'#000000',
fontSize:'35',
fontSize:'51',
fontFamily:'Arial',
textAlign:'left',
overline: false,
@@ -144,21 +144,26 @@ export default defineComponent({
nextTick(()=>{
let canvasBox = document.querySelector(".clearSlogan_modal .exportCanvasBox_center");
let height = canvasBox.offsetHeight;
textData.fontSize = (height/10*1.9).toFixed(0)
canvasBox.style.width = height+'px'
canvasWH.value = height
scale = exportWH/canvasWH.value
var canvasDom = document.createElement("canvas");
let oldCanvasDom = canvasBox.querySelector('.canvas-container')
if(oldCanvasDom)oldCanvasDom.remove()
canvasBox.appendChild(canvasDom);
canvas = new fabric.Canvas(canvasDom, {
backgroundColor: "#e6e6e6",
width: canvasWH.value,
height: canvasWH.value,
isDrawingMode: false, // 开启绘图模式
});
canvas.on('object:moving',canvasMoving)
setTextFun('请输入一段话吧~')
// if(oldCanvasDom)oldCanvasDom.remove()
if(!oldCanvasDom){
var canvasDom = document.createElement("canvas");
canvasBox.appendChild(canvasDom);
canvas = new fabric.Canvas(canvasDom, {
backgroundColor: "#e6e6e6",
width: canvasWH.value,
height: canvasWH.value,
isDrawingMode: false, // 开启绘图模式
});
canvas.on('object:moving',canvasMoving)
setTextFun('请输入\n一段话吧~')
}
if(!fabric.Object.prototype.controls.deleteControl){
JSSetRemoveImage(deleteObj)
}else{
@@ -171,6 +176,14 @@ export default defineComponent({
})
}
let selectTextbox = ref(null)
let oldClickedObject = null
let clickObjChanged = (options)=>{
console.log(options);
console.log(oldClickedObject);
// var changedObject = options.target;
setBtnPosition(oldClickedObject)
}
let setTextBtn = (e) =>{//点击判断是否点击到文字
var clickedObject = e.target;
if (clickedObject instanceof fabric.IText){
@@ -183,6 +196,9 @@ export default defineComponent({
textData.linethrough = clickedObject.linethrough
textData.underline = clickedObject.underline
setBtnPosition(clickedObject)
clickedObject.on('changed',clickObjChanged);
if(oldClickedObject)oldClickedObject.off('changed',clickObjChanged);
oldClickedObject = clickedObject
}else{
selectTextbox.value = null
textBtnShow.value = false
@@ -206,6 +222,23 @@ export default defineComponent({
let messageShow = false
let canvasMoving = (options)=>{
let obj = options.target
let left,top
let canvasWidth = canvas.getWidth()
let canvasHeight = canvas.getHeight()
if(obj.left < 0){
left = obj.left<0?0:obj.left
}else{
left = obj.left + obj.width*obj.scaleX>canvasWidth?canvasWidth - obj.width*obj.scaleX:obj.left
}
if(obj.top < 0){
top = obj.top<0?0:obj.top
}else{
top = obj.top + obj.height*obj.scaleY>canvasHeight?canvasHeight - obj.height*obj.scaleY:obj.top
}
obj.set({
left,
top
})
isCanvasMoving(obj)
}
let isCanvasMoving = (obj)=>{
@@ -240,7 +273,6 @@ export default defineComponent({
textbox = new fabric.IText(str, {
fontSize: 20,
textAlign:'center'
// fill:canvasPencilColor.value,
})
textbox.set(textData)
@@ -364,6 +396,12 @@ export default defineComponent({
flex-direction: column;
// height: calc(512px / 2);
margin: 0 auto;
.modal_title_text{
padding-bottom: calc(2rem* 1.2);
background: #fff;
z-index: 4;
margin-bottom: 0;
}
.clearSlogan_center_item{
// position: relative;
background: #fff;
@@ -391,14 +429,6 @@ export default defineComponent({
-webkit-appearance: none;
margin: 0;
}
>select{
height: 2.5rem;
border: 0.2rem solid #c4c4c4 !important;
border-radius: 4px; /* 设置圆角半径 */
}
>select:focus-visible{
border: 0.2rem solid #c4c4c4;
}
div{
padding: 0 1rem;
font-weight: 600;
@@ -442,7 +472,7 @@ export default defineComponent({
flex: 1;
position: relative;
margin: 0 auto;
overflow: hidden;
// overflow: hidden;
// overflow: scroll;
.canvas-container{
margin: 0 auto;

View File

@@ -233,6 +233,7 @@ export default defineComponent({
let cleardata = ()=>{
productImg.value = false
productImgData.isShowMark = false
productImgData.likeList = []
}
let fileUploadChange = (data: any)=> {

View File

@@ -35,13 +35,14 @@
</div>
</template>
</el-cascader>
<div v-show="selectCode == 'Sketchboard'" class="collection_rename_title">{{$t('LibraryPage.Category')}}</div>
<!-- <div v-show="selectCode == 'Sketchboard'" class="collection_rename_title">{{$t('LibraryPage.Category')}}</div> -->
<div v-show="selectCode == 'Sketchboard'" class="rename_form_content">
<div v-show="selectCode == 'Sketchboard' || selectCode == 'Printboard'" class="collection_rename_title">{{$t('LibraryPage.Category')}}</div>
<!-- <div v-show="selectCode == 'Sketchboard' || selectCode == 'Printboard'" class="collection_rename_title">{{$t('LibraryPage.Category')}}</div> -->
<div v-show="selectCode == 'Sketchboard' || selectCode == 'Printboard'" class="rename_form_content">
<div class="select_block">
<a-select
v-if="selectCode == 'Sketchboard'"
ref="select"
v-model:value="editSex.value"
v-model:value="sex"
:options="sexList"
@change="getPosition"
>
@@ -55,7 +56,7 @@
</a-select>
<a-select
ref="select"
v-model:value="editDesignType.value"
v-model:value="editDesignType"
:options="disignTypeList"
>
<template #suffixIcon>
@@ -164,7 +165,7 @@ export default defineComponent({
let parent:any = this.$parent
this.selectCode = parent.selectCode || ''
this.value = parent.value || ''
this.disignTypeList = parent.disignTypeList || []
this.disignTypeList = parent.designTypeList[this.selectCode] || []
this.sexList = parent.sexList || []
this.sex = parent.sex || ''
this.designType = parent.designType || ''
@@ -224,7 +225,7 @@ export default defineComponent({
},
async getPosition(){
let params
if(this.sex.value == 'Female'){
if(this.sex == 'Female'){
params = 'FemalePosition'
}else{
params = 'MalePosition'
@@ -259,7 +260,7 @@ export default defineComponent({
userGroupId :this.selectSingleImg.id,//history id
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
}
let designType = this.selectCode == 'Sketchboard' || this.selectCode == 'MarketingSketch' ? this.designType.value : ''
let designType = this.selectCode == 'Sketchboard' || this.selectCode == 'Printboard' || this.selectCode == 'MarketingSketch' ? this.designType : ''
let labelArr:any = []
this.value.editLabelValue.forEach((item:any)=>{
labelArr.push(item[item.length-1]?item[item.length-1]:item)
@@ -311,7 +312,7 @@ export default defineComponent({
libraryId:this.renameType === 'batch' ? this.selectImgList : [this.selectSingleImg.id],
level2Type:this.editDesignType.value,
}
if(this.selectCode == 'Sketchboard'){
if(this.selectCode == 'Sketchboard' || this.selectCode == 'Printboard'){
await Https.axiosPost(Https.httpUrls.setSketchLibrary,data3).then(
(rv) => {
}

View File

@@ -37,7 +37,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="2.5rem" height="2.5rem" viewBox="0 0 16 16" fill="none" role="img" :style="{color:'#9e9ea7',fill: 'currentColor'}">
<path d="M10.7408 2C13.0889 2 14.6667 4.235 14.6667 6.32C14.6667 10.5425 8.11856 14 8.00004 14C7.88152 14 1.33337 10.5425 1.33337 6.32C1.33337 4.235 2.91115 2 5.2593 2C6.60745 2 7.48893 2.6825 8.00004 3.2825C8.51115 2.6825 9.39263 2 10.7408 2Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
<span>321</span>
<span>{{item.viewNums}}</span>
</div> -->
<label @click="portfolioLike(item)">
<i v-if="true" class="fi fi-sr-thumbs-up" style="color:rgba(158, 158, 167);"></i>
@@ -50,7 +50,7 @@
<path d="M8 10C9.10457 10 10 9.10457 10 8C10 6.89543 9.10457 6 8 6C6.89543 6 6 6.89543 6 8C6 9.10457 6.89543 10 8 10Z" fill="white"></path>
</svg> -->
<i class="fi fi-sr-eye"></i>
<span>{{item.likeNum}}</span>
<span>{{item.viewNums}}</span>
</div>
</div>
</div>
@@ -337,6 +337,8 @@ export default defineComponent({
display: flex;
width: 40%;
width: 20%;
// width: 7rem;
width: 60px;
justify-content: space-between;
>label{
// cursor: pointer;
@@ -345,14 +347,15 @@ export default defineComponent({
display: flex;
align-items: center;
i{
font-size: 2rem;
// font-size: 1.8rem;
font-size: 12px;
}
svg,i{
color: #9e9ea7;
display: flex;
// width: 10px;
// height: 10px;
margin-right: .5rem;
margin-right: 5px;
}
span{
margin-left: 3px;

View File

@@ -82,7 +82,7 @@
<img v-lazy="scaleImageData?.imgUrl">
</div> -->
<div class="detail_right_user_content">
<div class="scaleImage_chunk_title">名字</div>
<div class="scaleImage_chunk_title">{{scaleImageData.userName}}</div>
<!-- <div class="scaleImage_chunk_title_intro">个性签名</div>
<div class="scaleImage_chunk_btn">关注</div> -->
</div>
@@ -113,10 +113,10 @@
<i v-else class="fi fi-rr-social-network"></i>
<span>{{scaleImageData.likeNum}}</span>
</div>
<!-- <div>
<div>
<i class="fi fi-sr-eye"></i>
<span>{{scaleImageData.likeNum}}</span>
</div> -->
<span>{{scaleImageData.viewNums}}</span>
</div>
<div>
<i class="fi fi-rr-comment-alt-dots"></i>
<span>{{commentList.length}}</span>
@@ -169,7 +169,8 @@
<i class="fi fi-sr-thumbs-up" :adminSix="!!true" style="color: rgb(158, 158, 167);"></i>
<span>123</span>
</div> -->
<div v-show="true" class="left_content_item_unfold" @click="()=>item.unfold = !item.unfold">展开</div>
<!-- <div v-show="true" class="left_content_item_unfold" @click="()=>item.unfold = !item.unfold">展开</div> -->
</div>
<div class="detail_left_content_item_replyContent" v-for="children in item.childCommentVOList" :key="children.id">
<div class="detail_left_content_item_img">
@@ -269,6 +270,7 @@ export default defineComponent({
imgData.scaleImageIndex = 0
imgData.scaleImageData = {}
imgData.commentText = ''
imgData.scaleImageList = []
document.removeEventListener('click',removeCommentReply)
}
let download = ()=>{
@@ -302,8 +304,6 @@ export default defineComponent({
findUrl = rv.designPythonOutfitList.map((obj:any) => obj.designUrl);
}
imgData.scaleImageList = canvasUrl.concat(findUrl);
console.log(imgData.scaleImageList);
imgData.scaleImageIndex = 0
imgData.getCommentData.portfolioId = rv.id
if(str == 'zan'){
@@ -924,6 +924,7 @@ export default defineComponent({
i{
display: flex;
font-size: 2rem;
color: #9e9ea7;
}
span{
margin-left: calc(var(--padding) / 2);