From 7175760f28beb6d1027ad1f0d3104515d00b5929 Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Fri, 28 Jul 2023 14:35:58 +0800 Subject: [PATCH] debug save --- .env | 10 +++++----- src/api/camera.js | 9 +++++++++ src/components/Debug.vue | 25 +++++++++++++++++++++++-- 3 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 src/api/camera.js diff --git a/.env b/.env index 8264477..ab77a95 100644 --- a/.env +++ b/.env @@ -1,8 +1,8 @@ # 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_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 @@ -13,6 +13,6 @@ VITE_HOST_URL=http://192.168.1.194:8081/ VITE_BASE_URL=http://192.168.1.111:8899 VITE_WEBSOCKET_JAVA_URL=ws://192.168.1.111:8899/websocket/nuclear -# VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear -# VITE_WEBSOCKET_CAMERA_URL=ws://192.168.1.111:8081/ws/cmd -# VITE_HOST_URL=http://192.168.1.111:8081/ \ No newline at end of file +VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear +VITE_WEBSOCKET_CAMERA_URL=ws://192.168.1.111:8081/ws/cmd +VITE_HOST_URL=http://192.168.1.111:8081/ \ No newline at end of file diff --git a/src/api/camera.js b/src/api/camera.js new file mode 100644 index 0000000..e1fc74b --- /dev/null +++ b/src/api/camera.js @@ -0,0 +1,9 @@ +import request from '@/service' + +export const addCameraConfig = data => { + return request({ + url: `/camera/add`, + method: 'POST', + data, + }) +} diff --git a/src/components/Debug.vue b/src/components/Debug.vue index 5aef983..79efc24 100644 --- a/src/components/Debug.vue +++ b/src/components/Debug.vue @@ -48,7 +48,6 @@ v-model="simulation_brightness" :min="0" :max="65535" - :disabled="!isCameraOpen" @change="handleSimulationBrightness" />

{{ simulation_brightness }}

@@ -57,7 +56,6 @@

曝光时间

+ 保存 @@ -144,6 +143,7 @@ import { } from '@/command' import { coreListApi } from '@/api/info' import { MessagePlugin } from 'tdesign-vue-next' +import { addCameraConfig } from '@/api/camera' const photoUrl = ref('') const recognitionResult = ref('') @@ -158,6 +158,24 @@ onMounted(async () => { } }) +const onSubmit = async () => { + if (!station_core_id.value) { + MessagePlugin('error', { content: '请选择堆芯' }) + return + } + // 保存当前相机参数到相应的堆芯 + const data = { + station_core_id: station_core_id.value, + simulation_brightness: simulation_brightness.value, + exposure: exposure.value, + } + const res = await addCameraConfig(data) + console.log(res) + if (res?.code == 200) { + MessagePlugin('success', { content: '保存成功' }) + } +} + setInterval( () => { photoUrl.value = `${ @@ -490,6 +508,9 @@ onUnmounted(() => { } .save_form { flex: 1; + .save_btn { + margin-top: 14px; + } } } }