Browse Source

debug save

master
maochaoying 2 years ago
parent
commit
7175760f28
  1. 10
      .env
  2. 9
      src/api/camera.js
  3. 25
      src/components/Debug.vue

10
.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/
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/

9
src/api/camera.js

@ -0,0 +1,9 @@
import request from '@/service'
export const addCameraConfig = data => {
return request({
url: `/camera/add`,
method: 'POST',
data,
})
}

25
src/components/Debug.vue

@ -48,7 +48,6 @@
v-model="simulation_brightness"
:min="0"
:max="65535"
:disabled="!isCameraOpen"
@change="handleSimulationBrightness"
/>
<p class="number">{{ simulation_brightness }}</p>
@ -57,7 +56,6 @@
<p class="title">曝光时间</p>
<t-slider
v-model="exposure"
:disabled="!isCameraOpen"
:min="0"
:max="100000"
@change="handleExposureTime"
@ -93,6 +91,7 @@
{{ item.name }}
</t-option>
</t-select>
<t-button class="save_btn" @click="onSubmit">保存</t-button>
</div>
</div>
</div>
@ -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;
}
}
}
}

Loading…
Cancel
Save