mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-06 03:58:04 +08:00
fix: 抽离水印的组件
This commit is contained in:
parent
383b7c3cd5
commit
295115b6be
@ -4,25 +4,15 @@
|
|||||||
:style="rangeStyle"
|
:style="rangeStyle"
|
||||||
@mousedown="mousedownHandleUnStop($event, undefined)"
|
@mousedown="mousedownHandleUnStop($event, undefined)"
|
||||||
>
|
>
|
||||||
<n-watermark
|
|
||||||
id="go-edit-watermark"
|
|
||||||
:content="watermarkText"
|
|
||||||
cross
|
|
||||||
selectable
|
|
||||||
:font-size="16"
|
|
||||||
:line-height="16"
|
|
||||||
:width="500"
|
|
||||||
:height="150"
|
|
||||||
:x-offset="12"
|
|
||||||
:y-offset="80"
|
|
||||||
:rotate="-15"
|
|
||||||
style="display: none; width: 100%; height: 100%;"
|
|
||||||
></n-watermark>
|
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
<!-- 水印 -->
|
||||||
|
<edit-watermark></edit-watermark>
|
||||||
<!-- 标尺 -->
|
<!-- 标尺 -->
|
||||||
<edit-rule></edit-rule>
|
<edit-rule></edit-rule>
|
||||||
<!-- 拖拽时的辅助线 -->
|
<!-- 拖拽时的辅助线 -->
|
||||||
<edit-align-line></edit-align-line>
|
<edit-align-line></edit-align-line>
|
||||||
|
<!-- 拖拽时的遮罩 -->
|
||||||
|
<div class="go-edit-range-model" :style="rangeModelStyle"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -32,8 +22,8 @@ import { useSizeStyle } from '../../hooks/useStyle.hook'
|
|||||||
import { mousedownHandleUnStop } from '../../hooks/useDrag.hook'
|
import { mousedownHandleUnStop } from '../../hooks/useDrag.hook'
|
||||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||||
import { EditAlignLine } from '../EditAlignLine'
|
import { EditAlignLine } from '../EditAlignLine'
|
||||||
|
import { EditWatermark } from '../EditWatermark'
|
||||||
import { EditRule } from '../EditRule'
|
import { EditRule } from '../EditRule'
|
||||||
import { watermarkText } from '@/settings/designSetting'
|
|
||||||
|
|
||||||
const chartEditStore = useChartEditStore()
|
const chartEditStore = useChartEditStore()
|
||||||
|
|
||||||
@ -65,13 +55,30 @@ const rangeStyle = computed(() => {
|
|||||||
return { ...useSizeStyle(size.value), ...computedBackground, ...scale }
|
return { ...useSizeStyle(size.value), ...computedBackground, ...scale }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 模态层
|
||||||
|
const rangeModelStyle = computed(() => {
|
||||||
|
const dragStyle = getEditCanvas.value.isCreate && { 'z-index': 99999 }
|
||||||
|
// @ts-ignore
|
||||||
|
return { ...useSizeStyle(size.value), ...dragStyle }
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@include go(edit-range) {
|
@include go(edit-range) {
|
||||||
position: relative;
|
position: relative;
|
||||||
transform-origin: left top;
|
transform-origin: left top;
|
||||||
@include filter-border-color("hover-border-color");
|
@include filter-border-color('hover-border-color');
|
||||||
@include filter-bg-color("background-color2");
|
@include filter-bg-color('background-color2');
|
||||||
|
|
||||||
|
@include go(edit-range-model) {
|
||||||
|
z-index: -1;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
border-radius: 15px;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0);
|
||||||
|
background-color: greenyellow;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
import EditWatermark from './index.vue'
|
||||||
|
|
||||||
|
export { EditWatermark }
|
@ -0,0 +1,27 @@
|
|||||||
|
<template>
|
||||||
|
<n-watermark
|
||||||
|
id="go-edit-watermark"
|
||||||
|
:content="watermarkText"
|
||||||
|
cross
|
||||||
|
selectable
|
||||||
|
:font-size="16"
|
||||||
|
:line-height="16"
|
||||||
|
:width="500"
|
||||||
|
:height="150"
|
||||||
|
:x-offset="12"
|
||||||
|
:y-offset="80"
|
||||||
|
:rotate="-15"
|
||||||
|
></n-watermark>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { watermarkText } from '@/settings/designSetting'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
#go-edit-watermark {
|
||||||
|
display: none;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
x
Reference in New Issue
Block a user