增加流程图 小手功能 增加重置功能 移动流程位置后恢复原位置

This commit is contained in:
Lemon 2025-02-18 11:55:46 +08:00
parent 0212ef4851
commit f9c7446186

View File

@ -1,6 +1,6 @@
<template>
<div class="simple-process-model-container position-relative">
<div class="position-absolute top-0px right-0px bg-#fff">
<div class="position-absolute top-0px right-0px bg-#fff z-index-button-group">
<el-row type="flex" justify="end">
<el-button-group key="scale-control" size="default">
<el-button v-if="!readonly" size="default" @click="exportJson">
@ -23,6 +23,7 @@
<el-button size="default" :plain="true" :icon="ZoomOut" @click="zoomOut()" />
<el-button size="default" class="w-80px"> {{ scaleValue }}% </el-button>
<el-button size="default" :plain="true" :icon="ZoomIn" @click="zoomIn()" />
<el-button size="default" @click="resetPosition">重置</el-button>
</el-button-group>
</el-row>
</div>
@ -93,6 +94,8 @@ const startX = ref(0)
const startY = ref(0)
const currentX = ref(0)
const currentY = ref(0)
const initialX = ref(0)
const initialY = ref(0)
const setGrabCursor = () => {
document.body.style.cursor = 'grab';
@ -238,6 +241,18 @@ const zoomOut = () => {
const processReZoom = () => {
scaleValue.value = 100
}
//
onMounted(() => {
initialX.value = currentX.value
initialY.value = currentY.value
})
//
const resetPosition = () => {
currentX.value = initialX.value
currentY.value = initialY.value
}
</script>
<style lang="scss" scoped>
@ -253,4 +268,8 @@ const processReZoom = () => {
min-width: 100%; // 100%
min-height: 100%; // 100%
}
.z-index-button-group {
z-index: 10;
}
</style>