diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/config/index.ts b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/config/index.ts index a487301..617a2a6 100644 --- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/config/index.ts +++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/config/index.ts @@ -91,7 +91,7 @@ export const graphOptions = (elId:string, viewMode = false) => { }, panning: { // 画布移动 - enabled: viewMode, + enabled: false, pageVisible: false, // 是否分页 pageBreak: true, pannable: true,// 是否平移 diff --git a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue index c4ccc90..866ed47 100644 --- a/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue +++ b/hangtag-ui/hangtag-ui-admin/src/components/DraftDesign/index.vue @@ -481,21 +481,21 @@ const init = (isDesignMode: boolean, bgConfig: any, data = {}, propDataInfo = {} height: maxSize, } graph = new Graph(options) + // 画布拖动组件 + graph.use( + new Scroller({ + enabled: true, + pageVisible: true, // 是否分页 + pageBreak: false, + pannable: true,// 是否平移 + // pageWidth: that.pageConfig.editArea.width * 10, + // pageHeight: that.pageConfig.editArea.height * 10, + // modifiers: ['ctrl', 'meta'], + }), + ) if (that.editState) { - // 画布拖动组件 - graph.use( - new Scroller({ - enabled: true, - pageVisible: true, // 是否分页 - pageBreak: false, - pannable: true,// 是否平移 - // pageWidth: that.pageConfig.editArea.width * 10, - // pageHeight: that.pageConfig.editArea.height * 10, - // modifiers: ['ctrl', 'meta'], - }), - ) // 参考线 graph.use( @@ -974,9 +974,9 @@ const getDeviceDPI = () => { } let rulerContainer = document.createElement('div'); const addDrawRuler = () => { - if(!that.editState){ - return; - } + // if(!that.editState){ + // return; + // } // 计算每个像素对应的毫米数 const dpi = getDeviceDPI(); const mmPerInch = 25.4; // 1 英寸 = 25.4 毫米 @@ -1004,7 +1004,10 @@ const addDrawRuler = () => { backgroundCanvas.style.left = '0px'; // 与顶部标尺对齐 backgroundCanvas.style.zIndex = '-1'; // 置底 backgroundCanvas.style.backgroundColor = that.pageConfig.background.areaColor - backgroundCanvas.style.boxShadow = `1px 1px 2px 2px rgb(0, 255, 0)`; + if(that.editState) { + backgroundCanvas.style.boxShadow = `1px 1px 2px 2px rgb(0, 255, 0)`; + } + backgroundCanvas.style.pointerEvents = 'none'; rulerContainer.appendChild(backgroundCanvas); if (that.editState) { diff --git a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/config/index.ts b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/config/index.ts index a487301..617a2a6 100644 --- a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/config/index.ts +++ b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/config/index.ts @@ -91,7 +91,7 @@ export const graphOptions = (elId:string, viewMode = false) => { }, panning: { // 画布移动 - enabled: viewMode, + enabled: false, pageVisible: false, // 是否分页 pageBreak: true, pannable: true,// 是否平移 diff --git a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/index.vue b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/index.vue index c4ccc90..866ed47 100644 --- a/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/index.vue +++ b/hangtag-ui/hangtag-ui-front/src/components/DraftDesign/index.vue @@ -481,21 +481,21 @@ const init = (isDesignMode: boolean, bgConfig: any, data = {}, propDataInfo = {} height: maxSize, } graph = new Graph(options) + // 画布拖动组件 + graph.use( + new Scroller({ + enabled: true, + pageVisible: true, // 是否分页 + pageBreak: false, + pannable: true,// 是否平移 + // pageWidth: that.pageConfig.editArea.width * 10, + // pageHeight: that.pageConfig.editArea.height * 10, + // modifiers: ['ctrl', 'meta'], + }), + ) if (that.editState) { - // 画布拖动组件 - graph.use( - new Scroller({ - enabled: true, - pageVisible: true, // 是否分页 - pageBreak: false, - pannable: true,// 是否平移 - // pageWidth: that.pageConfig.editArea.width * 10, - // pageHeight: that.pageConfig.editArea.height * 10, - // modifiers: ['ctrl', 'meta'], - }), - ) // 参考线 graph.use( @@ -974,9 +974,9 @@ const getDeviceDPI = () => { } let rulerContainer = document.createElement('div'); const addDrawRuler = () => { - if(!that.editState){ - return; - } + // if(!that.editState){ + // return; + // } // 计算每个像素对应的毫米数 const dpi = getDeviceDPI(); const mmPerInch = 25.4; // 1 英寸 = 25.4 毫米 @@ -1004,7 +1004,10 @@ const addDrawRuler = () => { backgroundCanvas.style.left = '0px'; // 与顶部标尺对齐 backgroundCanvas.style.zIndex = '-1'; // 置底 backgroundCanvas.style.backgroundColor = that.pageConfig.background.areaColor - backgroundCanvas.style.boxShadow = `1px 1px 2px 2px rgb(0, 255, 0)`; + if(that.editState) { + backgroundCanvas.style.boxShadow = `1px 1px 2px 2px rgb(0, 255, 0)`; + } + backgroundCanvas.style.pointerEvents = 'none'; rulerContainer.appendChild(backgroundCanvas); if (that.editState) {