|
@@ -54,12 +54,8 @@
|
|
|
<!-- 标线 -->
|
|
|
<EditorLine/>
|
|
|
<!-- 上下边距线 -->
|
|
|
- <div
|
|
|
- :style="`top: ${pageConfig?.pageMarginTop * realScale}px`"
|
|
|
- class="yvan-print-margin-top-line"/>
|
|
|
- <div
|
|
|
- :style="`bottom: ${pageConfig?.pageMarginBottom * realScale}px`"
|
|
|
- class="yvan-print-margin-bottom-line"/>
|
|
|
+ <div :style="`top: ${pageConfig?.pageMarginTop * realScale}px`" class="yvan-print-margin-top-line"/>
|
|
|
+ <div :style="`bottom: ${pageConfig?.pageMarginBottom * realScale}px`" class="yvan-print-margin-bottom-line"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -88,10 +84,10 @@ import {Context, ContextItem, directive} from '@/components/yvan-context'
|
|
|
import ComponentAdjuster from '@/components/yvan-editor/ComponentAdjuster.vue'
|
|
|
import {getComponentRotatedStyle, getShapeStyle} from '@/utils/style-util.js'
|
|
|
import Big from 'big.js'
|
|
|
-import RoyText from '@/components/PageComponents/RoyText.vue'
|
|
|
-import RoySimpleText from '@/components/PageComponents/RoySimpleText.vue'
|
|
|
+// import RoyText from '@/components/PageComponents/YvanRichText.vue'
|
|
|
+// import YvanSimpleText from '@/components/PageComponents/YvanSimpleText.vue'
|
|
|
// import RoyRect from '@/components/PageComponents/RoyRect'
|
|
|
-import RoyLine from '@/components/PageComponents/RoyLine.vue'
|
|
|
+// import RoyLine from '@/components/PageComponents/YvanLine.vue'
|
|
|
// import RoyImage from '@/components/PageComponents/RoyImage'
|
|
|
// import RoyStar from '@/components/PageComponents/RoyStar'
|
|
|
// import RoyCircle from '@/components/PageComponents/RoyCircle'
|
|
@@ -103,6 +99,7 @@ import commonMixin from '@/mixin/commonMixin'
|
|
|
import {$, isPreventDrop} from '@/utils/html-util.js'
|
|
|
import EditorLine from '@/components/yvan-editor/EditorLine.vue'
|
|
|
import EditorCoordinate from '@/components/yvan-editor/EditorCoordinate.vue'
|
|
|
+import eventBus from "@/utils/eventBus.js";
|
|
|
|
|
|
const {MIN_SCALE, MAX_SCALE} = CONSTANT
|
|
|
|
|
@@ -119,11 +116,11 @@ export default {
|
|
|
Context,
|
|
|
ContextItem,
|
|
|
ComponentAdjuster,
|
|
|
- RoyText,
|
|
|
- RoySimpleText,
|
|
|
+ // RoyText,
|
|
|
+ // YvanSimpleText,
|
|
|
// RoyGroup,
|
|
|
// RoyRect,
|
|
|
- RoyLine,
|
|
|
+ // RoyLine,
|
|
|
// RoyCircle,
|
|
|
// RoyStar,
|
|
|
// RoyImage,
|
|
@@ -195,89 +192,73 @@ export default {
|
|
|
if (!this.curComponent) {
|
|
|
return [
|
|
|
{
|
|
|
- code: 'setting',
|
|
|
- icon: 'ri-list-settings-line',
|
|
|
- label: '属性',
|
|
|
- status: 'default',
|
|
|
- event: () => {
|
|
|
- // this.$store.commit('printTemplateModule/setGlobalCount')
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
code: 'paste',
|
|
|
- icon: 'ri-clipboard-line',
|
|
|
+ icon: 'fa fa-paste',
|
|
|
label: '粘贴',
|
|
|
status: 'default',
|
|
|
event: () => {
|
|
|
- // this.$store.commit('printTemplateModule/paste', true)
|
|
|
- // this.$store.commit('printTemplateModule/recordSnapshot')
|
|
|
+ globalStore().paste(true)
|
|
|
+ globalStore().recordSnapshot()
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
if (this.curComponent.isLock) {
|
|
|
+ const curComponent = this.curComponent
|
|
|
return [
|
|
|
{
|
|
|
code: 'unlock',
|
|
|
- icon: 'ri-lock-unlock-line',
|
|
|
+ icon: 'fa fa-unlock',
|
|
|
label: '解锁',
|
|
|
status: 'default',
|
|
|
event: () => {
|
|
|
- // this.$store.commit('printTemplateModule/unlock')
|
|
|
+ globalStore().unlock({curComponent})
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
+ const curComponent = this.curComponent
|
|
|
return [
|
|
|
{
|
|
|
- code: 'setting',
|
|
|
- icon: 'ri-list-settings-line',
|
|
|
- label: '属性',
|
|
|
- status: 'default',
|
|
|
- event: () => {
|
|
|
- // this.$store.commit('printTemplateModule/setPaletteCount')
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
code: 'copy',
|
|
|
- icon: 'ri-file-copy-line',
|
|
|
+ icon: 'fa fa-copy',
|
|
|
label: '复制',
|
|
|
status: 'default',
|
|
|
event: () => {
|
|
|
- // this.$store.commit('printTemplateModule/copy')
|
|
|
+ globalStore().copy()
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
code: 'cut',
|
|
|
- icon: 'ri-scissors-cut-line',
|
|
|
+ icon: 'fa fa-cut',
|
|
|
label: '剪切',
|
|
|
status: 'default',
|
|
|
event: () => {
|
|
|
- // this.$store.commit('printTemplateModule/cut')
|
|
|
+ globalStore().cut()
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
code: 'del',
|
|
|
- icon: 'ri-delete-bin-line',
|
|
|
+ icon: 'fa fa-trash',
|
|
|
label: '删除',
|
|
|
status: 'danger',
|
|
|
event: () => {
|
|
|
- // this.$store.commit('printTemplateModule/deleteComponent')
|
|
|
- // this.$store.commit('printTemplateModule/recordSnapshot')
|
|
|
+ globalStore().deleteComponent(globalStore().curComponentIndex)
|
|
|
+ globalStore().recordSnapshot()
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
code: 'lock',
|
|
|
- icon: 'ri-lock-line',
|
|
|
+ icon: 'fa fa-lock',
|
|
|
label: '锁定',
|
|
|
status: 'default',
|
|
|
event: () => {
|
|
|
- // this.$store.commit('printTemplateModule/lock')
|
|
|
+ globalStore().lock({curComponent})
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
code: 'top',
|
|
|
- icon: 'ri-align-top',
|
|
|
+ icon: 'fa fa-angle-double-up',
|
|
|
label: '置顶',
|
|
|
status: 'default',
|
|
|
event: () => {
|
|
@@ -287,7 +268,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
code: 'bottom',
|
|
|
- icon: 'ri-align-bottom',
|
|
|
+ icon: 'fa fa-angle-double-down',
|
|
|
label: '置底',
|
|
|
status: 'default',
|
|
|
event: () => {
|
|
@@ -297,7 +278,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
code: 'up',
|
|
|
- icon: 'ri-arrow-up-line',
|
|
|
+ icon: 'fa fa-arrow-circle-up',
|
|
|
label: '上移',
|
|
|
status: 'default',
|
|
|
event: () => {
|
|
@@ -307,7 +288,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
code: 'down',
|
|
|
- icon: 'ri-arrow-down-line',
|
|
|
+ icon: 'fa fa-arrow-circle-down',
|
|
|
label: '下移',
|
|
|
status: 'default',
|
|
|
event: () => {
|
|
@@ -351,6 +332,7 @@ export default {
|
|
|
...mapActions(ruleStore, ['setReDrawRuler', 'setScale']),
|
|
|
getShapeStyle,
|
|
|
handleMouseDown(e) {
|
|
|
+ console.log("editor >> handleMouseDown >>> ", e)
|
|
|
// 如果没有选中组件 在画布上点击时需要调用 e.preventDefault() 防止触发 drop 事件
|
|
|
if (!this.curComponent || isPreventDrop(this.curComponent.component)) {
|
|
|
e.preventDefault()
|
|
@@ -400,9 +382,11 @@ export default {
|
|
|
handleContextMenu(e) {
|
|
|
e.stopPropagation()
|
|
|
e.preventDefault()
|
|
|
- let top = e.offsetY
|
|
|
- let left = e.offsetX
|
|
|
- globalStore().showContextMenu(globalStore, {top, left})
|
|
|
+ let top = e.clientY
|
|
|
+ let left = e.clientX
|
|
|
+ console.log("handleContextMenu >>> ", top, left, e)
|
|
|
+ // globalStore().showContextMenu( {top, left})
|
|
|
+ eventBus.emit("showContextMenu", {top, left})
|
|
|
},
|
|
|
hideArea() {
|
|
|
this.isShowArea = 0
|
|
@@ -544,7 +528,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- console.log("mounted >>> editor")
|
|
|
this.rulerWidth = this.$el.offsetWidth
|
|
|
this.rulerHeight = this.$el.offsetHeight
|
|
|
this.$refs.screensRef.scrollLeft = this.$refs.containerRef.getBoundingClientRect().width / 2 - this.rectWidth
|