diff --git a/.env b/.env index 27ea5c2..8264477 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 @@ -14,5 +14,5 @@ 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://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/components/Debug.vue b/src/components/Debug.vue index 2680f58..5aef983 100644 --- a/src/components/Debug.vue +++ b/src/components/Debug.vue @@ -72,8 +72,28 @@
-

结果

-
{{ recognitionResult }}
+
+

结果

+
{{ recognitionResult }}
+
+
+ + + {{ item.name }} + + +
@@ -122,10 +142,21 @@ import { setExposureTimeRaw, getCameraParametersInteger, } from '@/command' +import { coreListApi } from '@/api/info' import { MessagePlugin } from 'tdesign-vue-next' const photoUrl = ref('') const recognitionResult = ref('') +const station_core_id = ref('') + +const coreList = ref([]) + +onMounted(async () => { + const res = await coreListApi() + if (res?.code == 200) { + coreList.value = res?.data?.list + } +}) setInterval( () => { @@ -181,26 +212,17 @@ const handleGetCharacterRecognitionResult = () => { } } const handleGetMechanicalArmState = () => { - if (isCameraOpen.value) { - // 如果相机打开则发送拍照,如果相机关闭 则提醒用户 - websocketsend(getMechanicalArmState) - } else { - MessagePlugin('error', { content: '请先开启相机' }) - } + websocketsend(getMechanicalArmState) } const handleOpenFlashLight = () => { - if (isOpenCamera()) { - if (!flashStatus.value) { - websocketsend(openFlashLight) - } + if (!flashStatus.value) { + websocketsend(openFlashLight) } } -const handleCloseFlashLight = () => { - if (isOpenCamera()) { - if (flashStatus.value) { - websocketsend(closeFlashLight) - } +const handleCloseFlashLight = flag => { + if (flashStatus.value) { + websocketsend(closeFlashLight) } } @@ -290,7 +312,7 @@ const websocketonmessage = e => { break } } else { - MessagePlugin('error', { content: 'ws发送指令执行错误' }) + // MessagePlugin('error', { content: 'ws发送指令执行错误' }) } } @@ -300,7 +322,7 @@ const websocketonopen = () => { setTimeout(() => { websocketsend(getCameraParametersInteger) // 无法获取当前闪光灯是开是关。建议上层代码,初始化时候关闭闪光灯,然后在本地保存一个当前状态 - handleCloseFlashLight() + handleCloseFlashLight(false) websocketsend(getFlashBrightnessAnalog) }, 1000) } @@ -336,15 +358,11 @@ initWebSocket() // 业务处理 const handleExposureTime = value => { - if (isOpenCamera()) { - websocketsend(setExposureTimeRaw(value)) - } + websocketsend(setExposureTimeRaw(value)) } const handleSimulationBrightness = value => { - if (isOpenCamera()) { - websocketsend(setFlashBrightnessAnalog(value)) - } + websocketsend(setFlashBrightnessAnalog(value)) } onUnmounted(() => { @@ -457,14 +475,21 @@ onUnmounted(() => { } .identify_results { padding-top: 44px; - .title { - font-size: 20px; - font-weight: 500; - letter-spacing: 0.07em; - color: #191919; + display: flex; + .result_wrap { + flex: 1; + .title { + font-size: 20px; + font-weight: 500; + letter-spacing: 0.07em; + color: #191919; + } + .result { + padding: 10px 0; + } } - .result { - padding: 10px 0; + .save_form { + flex: 1; } } } diff --git a/src/components/User.vue b/src/components/User.vue index 4310e4a..0e36587 100644 --- a/src/components/User.vue +++ b/src/components/User.vue @@ -45,12 +45,6 @@ > - - - 管理员 @@ -88,7 +82,6 @@ const INITIAL_DATA = { username: '', role: '', password: '', - nickname: '', } export default { @@ -104,27 +97,6 @@ export default { trigger: 'blur', }, { whitespace: true, message: '用户名不能为空' }, - { - min: 8, - message: '至少需要8个字符,一个中文等于两个字符', - type: 'warning', - trigger: 'blur', - }, - ], - nickname: [ - { - required: true, - message: '昵称不能为空', - type: 'error', - trigger: 'blur', - }, - { whitespace: true, message: '昵称不能为空' }, - { - min: 2, - message: '至少需要2个字符,一个中文等于两个字符', - type: 'warning', - trigger: 'blur', - }, ], password: [ { @@ -152,11 +124,6 @@ export default { width: 120, }, { - colKey: 'nickname', - title: '昵称', - ellipsis: true, - }, - { title: '角色', colKey: 'role', cell: (h, { row }) => {