Browse Source

修改bug

master
maochaoying 2 years ago
parent
commit
f95bf90ca9
  1. 20
      .env
  2. BIN
      dist.zip
  3. 55
      src/components/Debug.vue
  4. 6
      src/components/Task.vue
  5. 6
      src/pages/index.vue
  6. 2
      src/service/request.js

20
.env

@ -1,15 +1,15 @@
# VITE_BASE_URL=http://192.168.1.194:8899
# VITE_WEBSOCKET_JAVA_URL=ws://192.168.1.194:8899/websocket/nuclear
# VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear
# VITE_WEBSOCKET_CAMERA_URL=ws://192.168.1.194:8081/ws/cmd
# VITE_HOST_URL=http://192.168.1.194:8081/
VITE_BASE_URL=http://192.168.1.194:8899
VITE_WEBSOCKET_JAVA_URL=ws://192.168.1.194:8899/websocket/nuclear
VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear
VITE_WEBSOCKET_CAMERA_URL=ws://192.168.1.194:8081/ws/cmd
VITE_HOST_URL=http://192.168.1.194:8081/
VITE_BASE_URL=http://127.0.0.1:8899
VITE_WEBSOCKET_JAVA_URL=ws://127.0.0.1:8899/websocket/nuclear
# VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear
VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8081/ws/cmd
VITE_HOST_URL=http://127.0.0.1:8081/
# VITE_BASE_URL=http://127.0.0.1:8899
# VITE_WEBSOCKET_JAVA_URL=ws://127.0.0.1:8899/websocket/nuclear
# # VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear
# VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8081/ws/cmd
# VITE_HOST_URL=http://127.0.0.1:8081/
# VITE_BASE_URL=http://192.168.1.111:8899
# VITE_WEBSOCKET_JAVA_URL=ws://192.168.1.111:8899/websocket/nuclear

BIN
dist.zip

55
src/components/Debug.vue

@ -125,6 +125,12 @@
</div>
<img :src="photoUrl" class="photo" v-else />
</div>
<t-loading
:loading="loadingVisible"
text="识别中..."
fullscreen
size="large"
/>
</div>
</template>
@ -156,25 +162,27 @@ const station_core_id = ref('')
const coreList = ref([])
const loadingVisible = ref(false)
const handleSelectChange = async val => {
const res = await getCameraConfig(val)
if (res?.code == 200) {
if (res?.data?.exposure) {
exposure.value = res?.data?.exposure
// exposure
handleExposureTime(res?.data?.exposure)
} else {
exposure.value = 0
handleExposureTime(0)
}
if (res?.data?.brightness) {
simulation_brightness.value = res?.data?.brightness
// simulation_brightness
handleSimulationBrightness(res?.data?.brightness)
} else {
simulation_brightness.value = 0
handleSimulationBrightness(0)
}
// if (res?.data?.exposure) {
// exposure.value = res?.data?.exposure
// // exposure
// handleExposureTime(res?.data?.exposure)
// } else {
// exposure.value = 0
// handleExposureTime(0)
// }
// if (res?.data?.brightness) {
// simulation_brightness.value = res?.data?.brightness
// // simulation_brightness
// handleSimulationBrightness(res?.data?.brightness)
// } else {
// simulation_brightness.value = 0
// handleSimulationBrightness(0)
// }
}
}
@ -183,6 +191,9 @@ onMounted(async () => {
if (res?.code == 200) {
coreList.value = res?.data?.list
}
setTimeout(() => {
websocketsend(openFlashLight)
}, 2000)
})
const onSubmit = async () => {
@ -251,6 +262,7 @@ const handleStopCharacterRecognition = () => {
const handleGetCharacterRecognitionResult = () => {
if (isCameraOpen.value) {
//
loadingVisible.value = true
websocketsend(getCharacterRecognitionResult)
} else {
MessagePlugin('error', { content: '请先开启相机' })
@ -348,15 +360,22 @@ const websocketonmessage = e => {
case 'getCharacterRecognitionResult':
const { result } = data
const { result: str, srcImagePath } = result || {}
loadingVisible.value = false
recognitionResult.value = `识别结果为${
str ? str : '空结果'
}, 图片保存路径为${srcImagePath}`
if (str) {
MessagePlugin.success('识别结果为' + str)
} else {
MessagePlugin.error('识别失败,结果为空')
}
break
default:
break
}
} else {
// MessagePlugin('error', { content: 'ws' })
loadingVisible.value = false
}
}
@ -572,9 +591,9 @@ onUnmounted(() => {
background: #ebebeb;
}
.photo {
flex: 1;
width: 100%;
width: 835px;
border-radius: 6px;
object-fit: cover;
}
}
}

6
src/components/Task.vue

@ -449,6 +449,7 @@ export default {
'startCaptureFunc',
'handleSimulationBrightness',
'handleExposureTime',
'startFlashLight',
],
components: {
PathPlan,
@ -583,6 +584,11 @@ export default {
return
}
this.startCaptureFunc()
this.startFlashLight()
setTimeout(() => {
this.startFlashLight()
}, 1000)
// websocketsend(openFlashLight)
// id
const res = await getCameraConfig(row.nuclearCoreId)
if (res?.code == 200) {

6
src/pages/index.vue

@ -314,6 +314,7 @@
</div>
<div class="task_container" v-if="accountStore.activePage == 1">
<Task
:startFlashLight="startFlashLight"
:startCaptureFunc="startCaptureFunc"
:handleSimulationBrightness="handleSimulationBrightness"
:handleExposureTime="handleExposureTime"
@ -375,6 +376,7 @@ import {
startCapture,
setFlashBrightnessAnalog,
setExposureTimeRaw,
openFlashLight,
} from '@/command'
const accountStore = useAccountStore()
const taskStore = useTaskStore()
@ -389,6 +391,10 @@ const testArrLength = ref(121)
// websocket
const websocket = ref(null)
const startFlashLight = () => {
websocketsend(openFlashLight)
}
const handleExposureTime = value => {
websocketsend(setExposureTimeRaw(value))
}

2
src/service/request.js

@ -55,7 +55,7 @@ class Request {
return res.data
},
err => {
if (err.response.status == 403) {
if (err.response?.status == 403) {
// token超时
Cookie.clearAllCookie()
window.location.href = '/'

Loading…
Cancel
Save