|
@ -72,9 +72,29 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="identify_results"> |
|
|
<div class="identify_results"> |
|
|
|
|
|
<div class="result_wrap"> |
|
|
<p class="title">结果</p> |
|
|
<p class="title">结果</p> |
|
|
<div class="result">{{ recognitionResult }}</div> |
|
|
<div class="result">{{ recognitionResult }}</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="save_form"> |
|
|
|
|
|
<t-select |
|
|
|
|
|
v-model="station_core_id" |
|
|
|
|
|
class="demo-select-base" |
|
|
|
|
|
clearable |
|
|
|
|
|
filterable |
|
|
|
|
|
placeholder="请选择堆芯" |
|
|
|
|
|
> |
|
|
|
|
|
<t-option |
|
|
|
|
|
v-for="item in coreList" |
|
|
|
|
|
:value="item.id" |
|
|
|
|
|
:label="item.name" |
|
|
|
|
|
:key="item.id" |
|
|
|
|
|
> |
|
|
|
|
|
{{ item.name }} |
|
|
|
|
|
</t-option> |
|
|
|
|
|
</t-select> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="right_camera_container"> |
|
|
<div class="right_camera_container"> |
|
@ -122,10 +142,21 @@ import { |
|
|
setExposureTimeRaw, |
|
|
setExposureTimeRaw, |
|
|
getCameraParametersInteger, |
|
|
getCameraParametersInteger, |
|
|
} from '@/command' |
|
|
} from '@/command' |
|
|
|
|
|
import { coreListApi } from '@/api/info' |
|
|
import { MessagePlugin } from 'tdesign-vue-next' |
|
|
import { MessagePlugin } from 'tdesign-vue-next' |
|
|
|
|
|
|
|
|
const photoUrl = ref('') |
|
|
const photoUrl = ref('') |
|
|
const recognitionResult = 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( |
|
|
setInterval( |
|
|
() => { |
|
|
() => { |
|
@ -181,28 +212,19 @@ const handleGetCharacterRecognitionResult = () => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
const handleGetMechanicalArmState = () => { |
|
|
const handleGetMechanicalArmState = () => { |
|
|
if (isCameraOpen.value) { |
|
|
|
|
|
// 如果相机打开则发送拍照,如果相机关闭 则提醒用户 |
|
|
|
|
|
websocketsend(getMechanicalArmState) |
|
|
websocketsend(getMechanicalArmState) |
|
|
} else { |
|
|
|
|
|
MessagePlugin('error', { content: '请先开启相机' }) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const handleOpenFlashLight = () => { |
|
|
const handleOpenFlashLight = () => { |
|
|
if (isOpenCamera()) { |
|
|
|
|
|
if (!flashStatus.value) { |
|
|
if (!flashStatus.value) { |
|
|
websocketsend(openFlashLight) |
|
|
websocketsend(openFlashLight) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
const handleCloseFlashLight = () => { |
|
|
|
|
|
if (isOpenCamera()) { |
|
|
|
|
|
|
|
|
const handleCloseFlashLight = flag => { |
|
|
if (flashStatus.value) { |
|
|
if (flashStatus.value) { |
|
|
websocketsend(closeFlashLight) |
|
|
websocketsend(closeFlashLight) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const isOpenCamera = () => { |
|
|
const isOpenCamera = () => { |
|
|
if (!isCameraOpen.value) { |
|
|
if (!isCameraOpen.value) { |
|
@ -290,7 +312,7 @@ const websocketonmessage = e => { |
|
|
break |
|
|
break |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
MessagePlugin('error', { content: 'ws发送指令执行错误' }) |
|
|
|
|
|
|
|
|
// MessagePlugin('error', { content: 'ws发送指令执行错误' }) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -300,7 +322,7 @@ const websocketonopen = () => { |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
websocketsend(getCameraParametersInteger) |
|
|
websocketsend(getCameraParametersInteger) |
|
|
// 无法获取当前闪光灯是开是关。建议上层代码,初始化时候关闭闪光灯,然后在本地保存一个当前状态 |
|
|
// 无法获取当前闪光灯是开是关。建议上层代码,初始化时候关闭闪光灯,然后在本地保存一个当前状态 |
|
|
handleCloseFlashLight() |
|
|
|
|
|
|
|
|
handleCloseFlashLight(false) |
|
|
websocketsend(getFlashBrightnessAnalog) |
|
|
websocketsend(getFlashBrightnessAnalog) |
|
|
}, 1000) |
|
|
}, 1000) |
|
|
} |
|
|
} |
|
@ -336,16 +358,12 @@ initWebSocket() |
|
|
|
|
|
|
|
|
// 业务处理 |
|
|
// 业务处理 |
|
|
const handleExposureTime = value => { |
|
|
const handleExposureTime = value => { |
|
|
if (isOpenCamera()) { |
|
|
|
|
|
websocketsend(setExposureTimeRaw(value)) |
|
|
websocketsend(setExposureTimeRaw(value)) |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const handleSimulationBrightness = value => { |
|
|
const handleSimulationBrightness = value => { |
|
|
if (isOpenCamera()) { |
|
|
|
|
|
websocketsend(setFlashBrightnessAnalog(value)) |
|
|
websocketsend(setFlashBrightnessAnalog(value)) |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => { |
|
|
onUnmounted(() => { |
|
|
websock.value.close() |
|
|
websock.value.close() |
|
@ -457,6 +475,9 @@ onUnmounted(() => { |
|
|
} |
|
|
} |
|
|
.identify_results { |
|
|
.identify_results { |
|
|
padding-top: 44px; |
|
|
padding-top: 44px; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
.result_wrap { |
|
|
|
|
|
flex: 1; |
|
|
.title { |
|
|
.title { |
|
|
font-size: 20px; |
|
|
font-size: 20px; |
|
|
font-weight: 500; |
|
|
font-weight: 500; |
|
@ -467,6 +488,10 @@ onUnmounted(() => { |
|
|
padding: 10px 0; |
|
|
padding: 10px 0; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
.save_form { |
|
|
|
|
|
flex: 1; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.right_camera_container { |
|
|
.right_camera_container { |
|
|