Browse Source

fix: 区域判断取整

master
guoapeng 2 weeks ago
parent
commit
5997fe86dc
  1. 7
      src/components/spray/trayGraph/index.vue
  2. 6
      src/views/main/index.vue

7
src/components/spray/trayGraph/index.vue

@ -99,6 +99,7 @@ const addSelect = () => {
const height = newHeight
const stageWidth = stage.value.width()
const stageHeight = stage.value.height()
console.log(width, height, stageWidth, stageHeight)
//
// 1. /
@ -121,6 +122,8 @@ const addSelect = () => {
boundBoxFunc(oldBoundBox, newBoundBox) {
const stageWidth = stage.value.width()
const stageHeight = stage.value.height()
console.log('oldBoundBox', oldBoundBox)
console.log('newBoundBox', newBoundBox)
//
// 1. /
@ -129,8 +132,8 @@ const addSelect = () => {
if (
newBoundBox.x < 0
|| newBoundBox.y < 0
|| newBoundBox.x + newBoundBox.width > stageWidth
|| newBoundBox.y + newBoundBox.height > stageHeight
|| newBoundBox.x + Math.floor(newBoundBox.width) > stageWidth
|| newBoundBox.y + Math.floor(newBoundBox.height) > stageHeight
|| oldBoundBox.width - (newBoundBox.x - oldBoundBox.x) < 25
|| newBoundBox.width < 25
|| oldBoundBox.height - (newBoundBox.y - oldBoundBox.y) < 25

6
src/views/main/index.vue

@ -56,12 +56,12 @@ const ok = () => {
}
const statusMessage = (data: any) => {
// systemStore systemStatus
console.log(data)
const stopPressed = systemStore.systemStatus.stopPressed
if (stopPressed !== data.stopPressed && data.stopPressed === false) {
getStatus()
}
console.log(data)
systemStore.updateSystemStatus(data)
}
@ -93,13 +93,11 @@ const status = computed(() => {
return !['suspendable', 'selfTestCompleted', 'deviceHumidity', 'nozzleTemperature', 'slideTemperature'].includes(key)
})
let str = ''
console.log(keys)
keys.forEach((key) => {
if (systemStore.systemStatus[key as keyof typeof systemStore.systemStatus]) {
str += `${ingObj[key as keyof typeof ingObj]} | `
}
})
console.log(str)
if (str === '') {
return '空闲'
}

Loading…
Cancel
Save