Browse Source

some bugs

master
maochaoying 2 years ago
parent
commit
243d1431f7
  1. 25
      src/components/Debug.vue
  2. 10
      src/components/Excel.vue
  3. 7
      src/components/Image.vue
  4. 5
      src/components/Task.vue
  5. 6
      src/pages/index.vue

25
src/components/Debug.vue

@ -80,6 +80,7 @@
class="demo-select-base" class="demo-select-base"
clearable clearable
filterable filterable
@change="handleSelectChange"
placeholder="请选择堆芯" placeholder="请选择堆芯"
> >
<t-option <t-option
@ -143,7 +144,7 @@ import {
} from '@/command' } from '@/command'
import { coreListApi } from '@/api/info' import { coreListApi } from '@/api/info'
import { MessagePlugin } from 'tdesign-vue-next' import { MessagePlugin } from 'tdesign-vue-next'
import { addCameraConfig } from '@/api/camera'
import { addCameraConfig, getCameraConfig } from '@/api/camera'
const photoUrl = ref('') const photoUrl = ref('')
const recognitionResult = ref('') const recognitionResult = ref('')
@ -151,6 +152,28 @@ const station_core_id = ref('')
const coreList = ref([]) const coreList = ref([])
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)
}
}
}
onMounted(async () => { onMounted(async () => {
const res = await coreListApi() const res = await coreListApi()
if (res?.code == 200) { if (res?.code == 200) {

10
src/components/Excel.vue

@ -32,14 +32,8 @@ const showCoreDetail = index => {
} }
// //
if (arr?.length > 0) { if (arr?.length > 0) {
if ([1, 2].includes(item.result)) {
// itemstore
imageStore.updateShowImage(true)
imageStore.updateCoreInfo(item)
} else {
imageStore.updateCoreInfo({})
imageStore.updateShowImage(false)
}
imageStore.updateShowImage(true)
imageStore.updateCoreInfo(item)
} }
} }

7
src/components/Image.vue

@ -4,7 +4,10 @@
v-if="cameraStore?.cameraState || imageStore.showImage" v-if="cameraStore?.cameraState || imageStore.showImage"
> >
<img <img
v-if="cameraStore?.cameraState && !imageStore.showImage"
v-if="
(cameraStore?.cameraState && !imageStore.showImage) ||
!imageStore?.coreInfo?.resultImg
"
:src="photoUrl" :src="photoUrl"
alt="图像" alt="图像"
class="img" class="img"
@ -28,7 +31,7 @@
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
fill="none" fill="none"
v-if="imageStore?.coreInfo?.result == 2"
v-if="imageStore?.coreInfo?.result != 1"
version="1.1" version="1.1"
width="30" width="30"
height="29.999998092651367" height="29.999998092651367"

5
src/components/Task.vue

@ -547,25 +547,24 @@ export default {
if (flag == 1 && canUpload) { if (flag == 1 && canUpload) {
return return
} }
this.startCaptureFunc()
// id // id
const res = await getCameraConfig(row.nuclearCoreId) const res = await getCameraConfig(row.nuclearCoreId)
console.log(res) console.log(res)
if (res?.code == 200) { if (res?.code == 200) {
if (res?.data?.exposure) { if (res?.data?.exposure) {
// exposure // exposure
this.startCaptureFunc()
this.handleExposureTime() this.handleExposureTime()
} }
if (res?.data?.simulation_brightness) { if (res?.data?.simulation_brightness) {
// simulation_brightness // simulation_brightness
this.startCaptureFunc()
this.handleSimulationBrightness() this.handleSimulationBrightness()
} }
} }
this.startCaptureFunc()
taskStore.updateTaskStatus(row.status) taskStore.updateTaskStatus(row.status)
taskStore.updateCurrentCoord(row.currentCoord) taskStore.updateCurrentCoord(row.currentCoord)
imageStore.updateNuclearCoreName(coreName) imageStore.updateNuclearCoreName(coreName)
Cookie.setCookie('core_name', coreName)
imageStore.updateOperatorName(row.operatorName) imageStore.updateOperatorName(row.operatorName)
imageStore.updateNuclearStationName(row.nuclearCoreName) imageStore.updateNuclearStationName(row.nuclearCoreName)
imageStore.updateShowImage(false) imageStore.updateShowImage(false)

6
src/pages/index.vue

@ -485,6 +485,7 @@ const continueWork = () => {
// //
taskStore.updateType(0) taskStore.updateType(0)
getInitData() getInitData()
imageStore.updateNuclearCoreName(Cookie.getCookie('core_name'))
} }
const getInitData = async () => { const getInitData = async () => {
@ -500,7 +501,7 @@ const getInitData = async () => {
taskStore.updateCheckStatus(false) taskStore.updateCheckStatus(false)
} }
taskStore.updateCurrentCoord(data.currentCoord) taskStore.updateCurrentCoord(data.currentCoord)
imageStore.updateNuclearCoreName(data.nuclearCoreName)
// imageStore.updateNuclearCoreName(data.nuclearCoreName)
imageStore.updateShowImage(false) imageStore.updateShowImage(false)
taskStore.getExcelList(data.id) taskStore.getExcelList(data.id)
taskStore.updateCurrentTaskId(data.id) taskStore.updateCurrentTaskId(data.id)
@ -722,12 +723,13 @@ const websocketonmessage = async e => {
} }
} else { } else {
loading.value = false loading.value = false
MessagePlugin('error', { content: 'ws发送指令执行错误' })
// MessagePlugin('error', { content: 'ws' })
} }
} }
const websocketonopen = () => { const websocketonopen = () => {
console.log('客户端链接成功!!!') console.log('客户端链接成功!!!')
startCaptureFunc()
} }
const websocketonerror = () => { const websocketonerror = () => {

Loading…
Cancel
Save