detail页面sketch支持镜像、detail图片合成由前端来做,但是新增sketch还是要过接口,sketch调整细节位置变更
This commit is contained in:
@@ -61,6 +61,7 @@ import SelectImages from '@/component/common/SelectImages.vue'
|
||||
|
||||
import upload from './upload.vue'
|
||||
import pallet from './pallet.vue'
|
||||
import { select } from 'three/tsl';
|
||||
export default defineComponent({
|
||||
components:{
|
||||
upload,pallet,SelectImages
|
||||
@@ -99,13 +100,18 @@ export default defineComponent({
|
||||
tcxToColor:'',
|
||||
})
|
||||
watch(()=>colorData.selectColor,async (newVal,oldVal)=>{
|
||||
console.log(newVal)
|
||||
if(newVal.rgba && newVal.rgba?.r){
|
||||
let data:any = await getColorName(newVal.rgba)
|
||||
newVal.name = data.name
|
||||
newVal.tcx = data.tcx
|
||||
colorData.colorList.list[colorData.selectDetail.id][colorData.colorList.index] = newVal
|
||||
data.rgba = newVal.rgba
|
||||
if(newVal.gradient){
|
||||
data.gradient = newVal.gradient
|
||||
}
|
||||
let value = {
|
||||
data:newVal,
|
||||
data:data,
|
||||
str:'color'
|
||||
}
|
||||
store.commit('DesignDetail/setNewDetail',value)
|
||||
@@ -141,7 +147,6 @@ export default defineComponent({
|
||||
JSON.stringify(colorData.selectDetail.color.gradient) == JSON.stringify(color?.gradient)
|
||||
&& colorData.selectDetail.color.rgba?.r
|
||||
){
|
||||
console.log('---',index)
|
||||
isNoSelect = true
|
||||
colorData.selectColor = item
|
||||
colorData.colorList.index = index
|
||||
@@ -190,52 +195,11 @@ export default defineComponent({
|
||||
colorData.colorList.index = num
|
||||
colorData.colorList.list[newVal][num] = item
|
||||
}
|
||||
|
||||
// for (let index = 0; index < 9; index++) {
|
||||
// colorData.allBoardData.colorBoards
|
||||
// let item:any = {}
|
||||
// item = colorData.allBoardData.colorBoards[index]
|
||||
// if(
|
||||
// colorData.allBoardData.colorBoards?.[index] &&
|
||||
// colorData.selectDetail.color.rgba?.r == colorData.allBoardData.colorBoards?.[index]?.rgba?.r &&
|
||||
// colorData.selectDetail.color.rgba?.g == colorData.allBoardData.colorBoards?.[index]?.rgba?.g &&
|
||||
// colorData.selectDetail.color.rgba?.b == colorData.allBoardData.colorBoards?.[index]?.rgba?.b &&
|
||||
// JSON.stringify(colorData.selectDetail.color.gradient) == JSON.stringify(colorData.allBoardData.colorBoards?.[index]?.gradient)
|
||||
// && colorData.selectDetail.color.rgba?.r
|
||||
// ){
|
||||
// console.log(13212)
|
||||
// if(!isOneChecked){
|
||||
// isOneChecked = true
|
||||
// if(colorData.allBoardData.colorBoards?.[index].gradient){
|
||||
// item.gradient = colorData.allBoardData.colorBoards?.[index].gradient
|
||||
// }
|
||||
// colorData.selectColor = item
|
||||
// colorData.colorList.index = index
|
||||
// }
|
||||
// }else if(colorData.selectDetail.color.rgba?.r){
|
||||
// if(!isNoSelect){
|
||||
// item = {
|
||||
// hex:rgbaToHex([colorData.selectDetail.color.rgba.r,colorData.selectDetail.color.rgba.g,colorData.selectDetail.color.rgba.b]),
|
||||
// id:colorData.selectDetail.color.id,
|
||||
// rgba:{
|
||||
// r:colorData.selectDetail.color.rgba.r,
|
||||
// g:colorData.selectDetail.color.rgba.g,
|
||||
// b:colorData.selectDetail.color.rgba.b,
|
||||
// },
|
||||
// tcx:colorData.selectDetail.color.tcx,
|
||||
// name:colorData.selectDetail.color.name,
|
||||
// }
|
||||
// if(colorData.selectDetail.color.gradient){
|
||||
// item.gradient = colorData.selectDetail.color.gradient
|
||||
// }
|
||||
// colorData.colorList.index = index
|
||||
// colorData.selectColor = item
|
||||
// isNoSelect = true
|
||||
// }else{
|
||||
// item = {}
|
||||
// }
|
||||
// }
|
||||
// colorData.colorList.list[newVal].push(item)
|
||||
// let newData = colorData.selectDetail?.newDetail?.color
|
||||
// console.log(newData,colorData.selectColor)
|
||||
// if(newData){
|
||||
// newData.hex = rgbaToHex([newData.rgba.r,newData.rgba.g,newData.rgba.b])
|
||||
// colorData.selectColor = newData
|
||||
// }
|
||||
},{immediate: true})
|
||||
const selectImgItem = ()=>{
|
||||
@@ -281,7 +245,6 @@ export default defineComponent({
|
||||
})
|
||||
}
|
||||
const handleShowListChange=(val:boolean)=>{
|
||||
console.log('val',val)
|
||||
showLibrary.value = !val
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="detailLeft">
|
||||
<sketch v-show="currentDetailType == 'sketch'" ref="sketch" @addDetail="addDetail"></sketch>
|
||||
<print v-show="currentDetailType == 'print'"></print>
|
||||
<color v-if="currentDetailType == 'color'"></color>
|
||||
<color v-if="currentDetailType == 'color'" :key="detailLeftColorKey"></color>
|
||||
<element v-show="currentDetailType == 'element'"></element>
|
||||
<accessory v-show="currentDetailType == 'accessory'"></accessory>
|
||||
<models v-show="currentDetailType == 'models'"></models>
|
||||
@@ -26,6 +26,12 @@ export default defineComponent({
|
||||
components:{
|
||||
sketch,print,color,element,models,accessory
|
||||
},
|
||||
props:{
|
||||
detailLeftColorKey:{
|
||||
type:Number,
|
||||
default:0,
|
||||
},
|
||||
},
|
||||
emit:['addDetail'],
|
||||
setup(props,{emit}) {
|
||||
const store = useStore();
|
||||
|
||||
@@ -69,7 +69,6 @@ export default defineComponent({
|
||||
file.designType = file?.resData?.designType
|
||||
}
|
||||
}
|
||||
// store.commit('DesignDetail/setNewDetail',file.resData)
|
||||
emit('selectImgItem',file)
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,6 @@ export default defineComponent({
|
||||
})
|
||||
const selectImgItem = (file:any)=>{
|
||||
// let data = JSON.parse(JSON.stringify(file))
|
||||
// store.commit('DesignDetail/setNewDetail',file)
|
||||
emit('selectImgItem',file)
|
||||
}
|
||||
const upFileUploadChange = (data:any)=>{
|
||||
|
||||
@@ -88,7 +88,6 @@ export default defineComponent({
|
||||
})
|
||||
const selectImgItem = (file:any)=>{
|
||||
// let data = JSON.parse(JSON.stringify(file))
|
||||
// store.commit('DesignDetail/setNewDetail',file)
|
||||
emit('selectImgItem',file)
|
||||
}
|
||||
const setUploadImgList = (list:any)=>{
|
||||
|
||||
Reference in New Issue
Block a user