diff --git a/src/assets/style/style.css b/src/assets/style/style.css index f78ac47f..4980fc27 100644 --- a/src/assets/style/style.css +++ b/src/assets/style/style.css @@ -658,9 +658,9 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte } .ant-select-arrow { right: 3rem; - width: 1.2rem; - height: 1.2rem; - margin-top: -0.6rem; + width: auto; + height: auto; + top: 60%; font-size: 1.2rem; } .generalModel_page { diff --git a/src/assets/style/style.less b/src/assets/style/style.less index bfee6c65..591daf20 100644 --- a/src/assets/style/style.less +++ b/src/assets/style/style.less @@ -722,10 +722,15 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte } .ant-select-arrow{ right: 3rem; - width: 1.2rem; - height: 1.2rem; - margin-top: -.6rem; + // width: 1.2rem; + // height: 1.2rem; + width: auto; + height: auto; + top: 60%; + // margin-top: -.6rem; font-size: 1.2rem; + // top: 50%; + // transform: translateY(-45%); } .generalModel_page {//常用查询列表样式 width: 100%; diff --git a/src/component/Detail/editFrontBack.vue b/src/component/Detail/editFrontBack.vue index 110310ad..02e1d15f 100644 --- a/src/component/Detail/editFrontBack.vue +++ b/src/component/Detail/editFrontBack.vue @@ -97,9 +97,10 @@ export default defineComponent({ let img = new Image(); img.onload = async function(){ loadingShow.value = true + let scale = img.width/img.height let height = canvasBox.offsetHeight; canvasWH.value = height - canvasBox.style.width = height+'px' + canvasBox.style.width = height * scale+'px' let wScale = 1 let hScale = 1 @@ -122,16 +123,18 @@ export default defineComponent({ await frontBackCanvasObj.canvasInit(canvasBox,{ width:canvasWH.value * wScale, height:canvasWH.value * hScale, - },data.undividedLayer) + },data.maskUrl,'',{}) + // undividedLayer canvas = frontBackCanvasObj.canvas frontBackCanvasObj.setOperation('pencil') pencilbtnStyle.value.background = rgba.value - console.log(frontBackCanvasObj,frontBackCanvasObj.setPencilWidth); + // console.log(frontBackCanvasObj,frontBackCanvasObj.setPencilWidth); frontBackCanvasObj.setPencilWidth() fabric.Object.prototype.cornerSize = 10 fabric.Object.prototype.transparentCorners = false - await frontBackCanvasObj.addPartImg({minioUrl:data.maskUrl},'') + // await frontBackCanvasObj.addPartImg({minioUrl:data.maskUrl},'',{opacity: 0.5}) + // await new Promise((resolve, reject) => { // fabric.Image.fromURL(data.maskUrl, function(img) { // // 设置背景图对象的宽度和高度与 canvas 相同 @@ -208,7 +211,6 @@ export default defineComponent({ } } let mouseup = (e)=>{ - console.log(down); if(down){ nextTick(()=>{ createSetTimeSubmit() @@ -233,7 +235,6 @@ export default defineComponent({ height: Math.round(exportWH * ratio[1]), } segmentImage(mark,full,size).then((rv)=>{ - // console.log(rv.targetFrontUrl,rv.targetBackUrl) props.patchData.front[props.imgDomIndex].imageUrl = rv.targetFrontUrl props.patchData.back[props.imgDomIndex].imageUrl = rv.targetBackUrl props.patchData.front[props.imgDomIndex].maskUrl = data @@ -284,7 +285,7 @@ export default defineComponent({ margin: 0 auto; .editFrontBack_center_item{ // position: relative; - background: #fff; + background: #ffffff; position: absolute; display: flex; @@ -418,6 +419,9 @@ export default defineComponent({ justify-content: center; width: 100%; height: 100%; + z-index: 2; + pointer-events:none; + opacity: .5; img{ height: 100%; width: 100%; diff --git a/src/component/DetailCopy/canvas/argument.vue b/src/component/DetailCopy/canvas/argument.vue index c02402d1..78e6ce82 100644 --- a/src/component/DetailCopy/canvas/argument.vue +++ b/src/component/DetailCopy/canvas/argument.vue @@ -10,7 +10,7 @@ -->
-
color
+
Sharding
-
+
print
- +
-
+
element
- +
- +
@@ -57,7 +64,7 @@
- +
@@ -104,6 +111,7 @@ export default defineComponent({ const detailDom = reactive({ model:null, canvasBox, + detailRight, }) const userDetail = computed(()=>{ return store.state.UserHabit.userDetail @@ -114,6 +122,8 @@ export default defineComponent({ selectDetail:computed(()=>store.state.DesignDetailCopy.selectDetail), designDetailShow:false, loadingShow:false, + oppositeRevocationShow:-1, + revocationShow:-1, isEditPattern:{ value:false, },// 是否编辑图案 @@ -121,6 +131,8 @@ export default defineComponent({ }) provide('isEditPattern',detailData.isEditPattern) const closeModal = ()=>{ + sessionStorage.removeItem('oppositeRevocation') + sessionStorage.removeItem('revocation') detailData.designDetailShow = false emit('destroy') } @@ -157,7 +169,7 @@ export default defineComponent({ store.commit('DesignDetailCopy/setDesignDetail',rv) // this.deleteShow = false - setRevocation(rv,'') + setRevocation() detailData.loadingShow = false // await this.setImgSize() } @@ -172,8 +184,49 @@ export default defineComponent({ sessionStorage.removeItem('oppositeRevocation') sessionStorage.removeItem('revocation') } - const setRevocation = (designItemDetail:any,data:any)=>{//设置撤销 + //撤回 + const setRevocation = ()=>{//设置撤销 + let itemDetail = JSON.parse(JSON.stringify(detailData.designDetail)) + let revocation:any = JSON.parse((sessionStorage.getItem("revocation") as any)) + // let oppositeRevocation = JSON.parse((sessionStorage.getItem("oppositeRevocation") as any)) + if(revocation?.[0]?.designItemId != itemDetail.designItemId || revocation?.[0]?.designItemId == undefined){ + // sessionStorage.setItem('revocation', JSON.stringify([])); + // sessionStorage.setItem('oppositeRevocation',JSON.stringify([])); + revocation = [] + } + revocation.push(itemDetail) + detailData.revocationShow = revocation?.length + detailData.oppositeRevocationShow = 0 + sessionStorage.setItem('revocation', JSON.stringify(revocation)); + sessionStorage.setItem('oppositeRevocation',JSON.stringify([])); + } + provide('setRevocation',setRevocation) + const revocation = ()=>{//撤回 + let oppositeRevocation = JSON.parse((sessionStorage.getItem("oppositeRevocation") as any)) + let revocation = JSON.parse((sessionStorage.getItem("revocation") as any)) + if(detailData.revocationShow <= 1)return + oppositeRevocation.push(revocation[revocation.length-1]) + detailData.oppositeRevocationShow = oppositeRevocation.length + revocation.splice(revocation.length-1,1) + detailData.revocationShow = revocation.length + store.commit("DesignDetailCopy/setDesignDetail", revocation[revocation.length-1]); + sessionStorage.setItem('oppositeRevocation', JSON.stringify(oppositeRevocation)); + sessionStorage.setItem('revocation', JSON.stringify(revocation)); + // clearSelect() + } + const oppositeRevocation = ()=>{//反撤回 + let oppositeRevocation = JSON.parse((sessionStorage.getItem("oppositeRevocation") as any)) + let revocation = JSON.parse((sessionStorage.getItem("revocation") as any)) + if(!oppositeRevocation[oppositeRevocation.length-1])return + store.commit("DesignDetailCopy/setDesignDetail", oppositeRevocation[oppositeRevocation.length-1]); + revocation.push(oppositeRevocation[oppositeRevocation.length-1]) + detailData.revocationShow = revocation.length + oppositeRevocation.splice(oppositeRevocation.length-1,1) + detailData.oppositeRevocationShow = oppositeRevocation.length + sessionStorage.setItem('oppositeRevocation', JSON.stringify(oppositeRevocation)); + sessionStorage.setItem('revocation', JSON.stringify(revocation)); + // this.clearSelect() } const setCurrentDetail = (str:string)=>{ store.commit('DesignDetailCopy/setCurrentDetailType',str) @@ -182,10 +235,12 @@ export default defineComponent({ let clothesList:any = [] for(let i = 0;i{ - store.commit('DesignDetailCopy/setPraeview',rv) + let value = { + currentType : JSON.parse(JSON.stringify(detailData.currentDetailType)), + rv:rv + } + store.commit('DesignDetailCopy/setPraeview',value) detailData.loadingShow = false }).catch(res=>{ detailData.loadingShow = false @@ -284,6 +343,8 @@ export default defineComponent({ detailData.childKey += 1 } onBeforeUnmount(()=>{ + sessionStorage.removeItem('oppositeRevocation') + sessionStorage.removeItem('revocation') store.commit('DesignDetailCopy/clearDesignDetail') }) return{ @@ -294,6 +355,8 @@ export default defineComponent({ setCurrentDetail, previwe, submit, + revocation, + oppositeRevocation, detailEdit, canvasReload, } @@ -402,6 +465,7 @@ export default defineComponent({ > .btn{ display: flex; justify-content: center; + margin-left: 12rem; > div{ margin-right: 2rem; } diff --git a/src/component/DetailCopy/detailLeft/colorBox/index.vue b/src/component/DetailCopy/detailLeft/colorBox/index.vue index 1f3e128b..f1b9ea6a 100644 --- a/src/component/DetailCopy/detailLeft/colorBox/index.vue +++ b/src/component/DetailCopy/detailLeft/colorBox/index.vue @@ -30,7 +30,7 @@ + \ No newline at end of file diff --git a/src/component/DetailCopy/detailLeft/index.vue b/src/component/DetailCopy/detailLeft/index.vue index 58ed68b4..cd5acd79 100644 --- a/src/component/DetailCopy/detailLeft/index.vue +++ b/src/component/DetailCopy/detailLeft/index.vue @@ -3,6 +3,7 @@ +
@@ -16,11 +17,12 @@ import { useI18n } from 'vue-i18n' import sketch from './sketch.vue' import print from './print.vue' import color from './colorBox/index.vue' +import element from './element.vue' import addDetails from '@/component/Detail/addDetails.vue' export default defineComponent({ components:{ - sketch,print,color,addDetails + sketch,print,color,addDetails,element }, setup(props,{emit}) { const store = useStore(); diff --git a/src/component/DetailCopy/detailLeft/module/libraryList.vue b/src/component/DetailCopy/detailLeft/module/libraryList.vue index 6a9e374e..20a24907 100644 --- a/src/component/DetailCopy/detailLeft/module/libraryList.vue +++ b/src/component/DetailCopy/detailLeft/module/libraryList.vue @@ -57,6 +57,11 @@ export default defineComponent({ default:'' as any, required:true }, + level1Type:{ + type:String, + default:'' as any, + required:true + }, }, emits:['selectImgItem'], setup(props,{emit}) { @@ -109,18 +114,9 @@ export default defineComponent({ detailData.isShowLoading = true let level2Type = '' let workspace = store.state.Workspace.workspace - let type = props.type // let type = store.state.DesignDetailCopy.currentDetailType - let leve1Type - if(type == 'sketch'){ - leve1Type = 'Sketchboard' - }else if(type == 'print'){ - leve1Type = 'Printboard' - }else if(type == 'element'){ - leve1Type = 'DesignElements' - } let data = { - level1Type:leve1Type, + level1Type:props.level1Type, // level2Type:'Pattern', level2Type:detailData.designType, modelSex:workspace?.sex, diff --git a/src/component/DetailCopy/detailLeft/module/selectList.vue b/src/component/DetailCopy/detailLeft/module/selectList.vue index 7d221310..2d8444c4 100644 --- a/src/component/DetailCopy/detailLeft/module/selectList.vue +++ b/src/component/DetailCopy/detailLeft/module/selectList.vue @@ -26,13 +26,13 @@
@@ -63,6 +63,11 @@ export default defineComponent({ default:'' as any, required:true }, + level1Type:{ + type:String, + default:'' as any, + required:true + }, }, emits:['selectImgItem'], setup(props,{emit}) { diff --git a/src/component/DetailCopy/detailLeft/module/uploadList.vue b/src/component/DetailCopy/detailLeft/module/uploadList.vue index cb37f877..fd7ff394 100644 --- a/src/component/DetailCopy/detailLeft/module/uploadList.vue +++ b/src/component/DetailCopy/detailLeft/module/uploadList.vue @@ -58,7 +58,12 @@ export default defineComponent({ type:Object, default:()=>[] as any, required:true - } + }, + level1Type:{ + type:String, + default:'' as any, + required:true + }, }, emits:['selectImgItem'], setup(props,{emit}) { @@ -69,12 +74,13 @@ export default defineComponent({ uploadList:[], upload:{ isPin: 0, - level1Type: 'Sketchboard', + level1Type: props.level1Type, gender:store.state.Workspace.workspace.sex, timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, }, token:getCookie("token"), uploadUrl:getUploadUrl(), + currentDetailType:computed(()=>store.state.DesignDetailCopy.currentDetailType) }) const getDetailListData = reactive({ total:0, @@ -154,18 +160,6 @@ export default defineComponent({ } return (isJpgOrPng && isLt2M) || Upload.LIST_IGNORE; } - onMounted(()=>{ - let type = store.state.DesignDetailCopy.currentDetailType - let leve1Type:any - if(type == 'sketch'){ - leve1Type = 'Sketchboard' - }else if(type == 'print'){ - leve1Type = 'Printboard' - }else if(type == 'element'){ - leve1Type = 'DesignElements' - } - detailData.upload.level1Type = leve1Type - }) return{ ...toRefs(detailData), ...toRefs(getDetailListData), diff --git a/src/component/DetailCopy/detailLeft/print.vue b/src/component/DetailCopy/detailLeft/print.vue index ef23b44e..f756b425 100644 --- a/src/component/DetailCopy/detailLeft/print.vue +++ b/src/component/DetailCopy/detailLeft/print.vue @@ -2,14 +2,14 @@
Current Print
- +
- +
@@ -40,12 +40,11 @@ export default defineComponent({ watch(()=>detailData?.selectDetail?.printObject?.prints,(newVal,oldVal)=>{ if(!newVal)return detailData.printList = newVal.reduce((acc:any, curr:any) => { - if (!acc.some((item:any) => item.id === curr.id)) { + if (!acc.some((item:any) => item.minIOPath === curr.minIOPath)) { acc.push(curr); } return acc; }, []); - },{immediate: true}) const getDetailListData = reactive({ total:0, @@ -65,8 +64,24 @@ export default defineComponent({ detailData.selectTitle = 'library' getDetailListDom.libraryList.init() } + const addElement = (data:any)=>{ + let value = { + designType:data.designType, + level2Type:data.level2Type, + minIOPath:data.minIOPath, + url:data.path, + } + store.commit('DesignDetailCopy/setCurrentPrintElement',value) + } const selectImgItem = (data:any)=>{ - store.commit('DesignDetailCopy/setNewDetail',data) + let value = { + data, + } + if(detailData.currentDetailType != 'print' && detailData.currentDetailType != 'element'){ + store.commit('DesignDetailCopy/setNewDetail',value) + }else{ + store.commit('DesignDetailCopy/setCurrentPrintElement',data) + } } return{ @@ -78,6 +93,7 @@ export default defineComponent({ openUpload, openLibrary, selectImgItem, + addElement, } }, @@ -113,16 +129,20 @@ export default defineComponent({ overflow: hidden; justify-content: space-between; overflow-y: auto; + justify-content: flex-start; > img{ object-fit: contain; height: 9rem; width: 9rem; overflow-y: auto; margin-bottom: 1rem; + margin: 1rem; + cursor: pointer; } > .active{ width: 100%; height: 100%; + margin: 0; margin-bottom: 0; } > div{ diff --git a/src/component/DetailCopy/detailLeft/sketch.vue b/src/component/DetailCopy/detailLeft/sketch.vue index 67e4f64d..f24d09c4 100644 --- a/src/component/DetailCopy/detailLeft/sketch.vue +++ b/src/component/DetailCopy/detailLeft/sketch.vue @@ -1,6 +1,6 @@