2025-04-01 15:25:15 +08:00
< template >
< div class = "canvasArgument" >
2025-04-09 14:09:19 +08:00
< div class = "label_item" >
< div > { { $t ( 'exportModel.Layer' ) } } : < / div >
< i class = "icon iconfont icon-shangyiceng" @click ="canvasGeneral.setLayerIndex('Front')" > < / i >
< i class = "icon iconfont icon-shangyiceng2" @click ="canvasGeneral.setLayerIndex('Forward')" > < / i >
< i class = "icon iconfont icon-xiayiceng" @click ="canvasGeneral.setLayerIndex('Backwards')" > < / i >
< i class = "icon iconfont icon-shangyiceng1" @click ="canvasGeneral.setLayerIndex('Back')" > < / i >
< / div >
2025-04-01 15:25:15 +08:00
< div class = "label_item" v -show = "
canvasGeneral . operation != 'movePosition' &&
canvasGeneral . operation != 'move' &&
canvasGeneral . brushwork . value != 'RibbonBrush' &&
canvasGeneral . brushwork . value != 'LongfurBrush' &&
canvasGeneral . operation != 'zoomIn' &&
canvasGeneral . operation != 'zoomOut' &&
canvasGeneral . operation != 'dashedPencil' &&
canvasGeneral . operation != 'dashed' " >
< div > { { $t ( 'exportModel.Size' ) } } : < / div >
< input @change ="canvasGeneral.setFontFamily" type = "range" @input ="canvasGeneral.setPencilWidth" min = "3" max = "50" v-model = "canvasGeneral.brushwork.width[canvasGeneral.operation]" >
< / div >
< div class = "label_item" v-show = "canvasGeneral.operation == 'pencil'" >
< div > { { $t ( 'exportModel.Brushwork' ) } } : < / div >
< a-select ref = "select" class = "label_select" size = "small" v -model :value = "canvasGeneral.brushwork.value"
style = "width: 12rem "
@ change = "canvasGeneral.brushworkChange"
>
< a-select-option class = "label_select_item" v-for = "item in canvasGeneral.pencilList.brushList" :value="item.value" >
< img style = "width: 100%;" :src = "item.url" alt = "" >
< / a-select-option >
< / a-select >
< / div >
< div class = "label_item texture" v-show = "canvasGeneral.operation == 'texture'" >
< div > { { $t ( 'exportModel.Texture' ) } } : < / div >
< a-select ref = "select" class = "label_select" size = "small" v -model :value = "canvasGeneral.texture.value"
style = "width: 12rem "
@ change = "canvasGeneral.textureValueChange"
>
< a-select-option class = "label_select_item" v-for = "item in canvasGeneral.texture.list" :value="item.value" >
< img :src = "item.url" alt = "" >
< / a-select-option >
< / a-select >
< / div >
< div class = "label_item" v -show = "
canvasGeneral . operation != 'pencil' &&
canvasGeneral . operation != 'eraser' &&
canvasGeneral . operation != 'movePosition' &&
canvasGeneral . operation != 'move' &&
canvasGeneral . operation != 'text' &&
canvasGeneral . operation != 'texture' &&
canvasGeneral . operation != '' &&
canvasGeneral . operation != 'zoomIn' &&
canvasGeneral . operation != 'zoomOut' &&
canvasGeneral . operation != 'dashedPencil' &&
canvasGeneral . operation != 'dashed' " >
< div > { { $t ( 'exportModel.FillBack' ) } } : < / div >
< div class = "leftAlign" >
< i class = "icon iconfont icon-tuceng1" @click ="canvasGeneral.setOperationMode('fill')" : class = "{active:canvasGeneral.operationMode == 'fill'}" > < / i >
< i class = "icon iconfont icon-tuceng" @click ="canvasGeneral.setOperationMode('border')" : class = "{active:canvasGeneral.operationMode == 'border'}" > < / i >
< / div >
< / div >
<!-- < div class = "label_item" v-show = "canvasGeneral.operation == 'movePosition'" >
< div > { { $t ( 'exportModel.Layer' ) } } : < / div >
< div class = "leftAlign" >
< i class = "icon iconfont icon-shangyiceng" @click ="canvasGeneral.setLayerIndex('Front')" > < / i >
< i class = "icon iconfont icon-shangyiceng2" @click ="canvasGeneral.setLayerIndex('Forward')" > < / i >
< i class = "icon iconfont icon-xiayiceng" @click ="canvasGeneral.setLayerIndex('Backwards')" > < / i >
< i class = "icon iconfont icon-shangyiceng1" @click ="canvasGeneral.setLayerIndex('Back')" > < / i >
< / div >
< / div > -- >
< div class = "label_item" v-show = "(canvasGeneral.operation == '' || canvasGeneral.operation == 'text' || canvasGeneral.createPatterning.textDataShow) && canvasGeneral.operation != 'movePosition' && canvasGeneral.operation != 'move'" >
< div > Font Family < / div >
< a-select ref = "select" class = "label_select" size = "small" v -model :value = "canvasGeneral.fontFamily"
style = "flex: 1;width: 15rem;"
@ change = "canvasGeneral.setFontFamily"
: style = "{'font-family':canvasGeneral.fontFamily}"
>
< a-select-option class = "label_select_item" v-for = "item in canvasGeneral.pencilList.textFontFamilyList" :style="{'font-family':item.value}" :value="item.value" >
{ { item . name } }
< / a-select-option >
< / a-select >
< / div >
< div class = "label_item" style = "margin-left: auto;" >
< span style = "margin-right: 2rem;" > Show Models < / span >
< a-switch v -model :checked = "isShowBg" @change ="showBg" / >
< / div >
2025-04-09 14:09:19 +08:00
2025-04-01 15:25:15 +08:00
< / div >
< / template >
< script lang = "ts" >
import { defineComponent , ref , reactive , nextTick , toRefs , inject } from 'vue'
export default defineComponent ( {
components : { } ,
setup ( ) {
let testModal = ref ( true )
let canvasGeneral : any = inject ( 'canvasObj' )
const data = reactive ( {
colorHistoryList : [ ] ,
operation : '' ,
isShowBg : true ,
} )
const setOperation = ( str : any ) => {
data . operation = str
}
const setOper = ( ) => {
setOperation ( '' )
}
document . addEventListener ( 'click' , setOper )
const closeModal = ( ) => {
document . removeEventListener ( 'click' , setOper )
}
const showBg = ( ) => {
canvasGeneral . showBg ( data . isShowBg )
}
return {
canvasGeneral ,
... toRefs ( data ) ,
testModal ,
setOperation ,
closeModal ,
showBg ,
}
}
} ) ;
< / script >
< style lang = 'less' scoped >
. canvasArgument {
display : flex ;
flex - wrap : wrap ;
height : 100 % ;
. label _item {
margin - right : 2 rem ;
position : relative ;
display : flex ;
align - items : center ;
. leftAlign {
display : flex ;
}
. labelHover _show {
position : absolute ;
width : 100 % ;
height : 10 rem ;
top : 100 % ;
z - index : 2 ;
display : block ;
border - radius : 4 px ;
border : 1 px solid ;
padding : .5 rem 1 rem ;
background : # fff ;
div {
width : 2 rem ;
height : 2 rem ;
margin - right : .5 rem ;
margin - bottom : .5 rem ;
display : inline - block ;
cursor : pointer ;
}
}
input {
height : 100 % ;
width : 12 rem ;
}
& . wH input {
width : 5 rem ;
}
. title {
margin - right : 1 rem ;
}
. icon - xiala {
cursor : pointer ;
transform : rotate ( 0 deg ) ;
height : 4 rem ;
width : 4 rem ;
transition : all .3 s ;
line - height : 4 rem ;
text - align : center ;
& . active {
transform : rotate ( 180 deg ) ;
}
}
}
. label _item : hover {
// .labelHover_show{
// display: flex;
// }
}
}
< / style >