【代码评审】BPM:增加流程图 小手功能

This commit is contained in:
YunaiV 2025-02-19 13:51:35 +08:00
parent 1a4c94b830
commit ab86cb1ff9

View File

@ -85,10 +85,12 @@ const emits = defineEmits<{
const processNodeTree = useWatchNode(props) const processNodeTree = useWatchNode(props)
provide('readonly', props.readonly) provide('readonly', props.readonly)
// TODO
/** 拖拽、放大缩小等操作 */
let scaleValue = ref(100) let scaleValue = ref(100)
const MAX_SCALE_VALUE = 200 const MAX_SCALE_VALUE = 200
const MIN_SCALE_VALUE = 50 const MIN_SCALE_VALUE = 50
const isDragging = ref(false) const isDragging = ref(false)
const startX = ref(0) const startX = ref(0)
const startY = ref(0) const startY = ref(0)
@ -128,10 +130,33 @@ const stopDrag = () => {
resetCursor() // resetCursor() //
} }
const zoomIn = () => {
if (scaleValue.value == MAX_SCALE_VALUE) {
return
}
scaleValue.value += 10
}
const zoomOut = () => {
if (scaleValue.value == MIN_SCALE_VALUE) {
return
}
scaleValue.value -= 10
}
const processReZoom = () => {
scaleValue.value = 100
}
const resetPosition = () => {
currentX.value = initialX.value
currentY.value = initialY.value
}
/** 校验节点设置 */
const errorDialogVisible = ref(false) const errorDialogVisible = ref(false)
let errorNodes: SimpleFlowNode[] = [] let errorNodes: SimpleFlowNode[] = []
// showText
const validateNode = (node: SimpleFlowNode | undefined, errorNodes: SimpleFlowNode[]) => { const validateNode = (node: SimpleFlowNode | undefined, errorNodes: SimpleFlowNode[]) => {
if (node) { if (node) {
const { type, showText, conditionNodes } = node const { type, showText, conditionNodes } = node
@ -212,37 +237,11 @@ const importLocalFile = () => {
} }
} }
//
const zoomIn = () => {
if (scaleValue.value == MAX_SCALE_VALUE) {
return
}
scaleValue.value += 10
}
//
const zoomOut = () => {
if (scaleValue.value == MIN_SCALE_VALUE) {
return
}
scaleValue.value -= 10
}
const processReZoom = () => {
scaleValue.value = 100
}
// //
onMounted(() => { onMounted(() => {
initialX.value = currentX.value initialX.value = currentX.value
initialY.value = currentY.value initialY.value = currentY.value
}) })
//
const resetPosition = () => {
currentX.value = initialX.value
currentY.value = initialY.value
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>