|
|
@@ -25,7 +25,7 @@
|
|
|
<img v-if="previewKey" class="camera-img" :src="preview+'?key='+previewKey" />
|
|
|
</template>
|
|
|
<template v-if="step === 2" >
|
|
|
- <img class="camera-img" :src="imageUrl+'?key='+imageUrlkey" />
|
|
|
+ <img class="camera-img" :src="getFilePath(imageTplPath)" />
|
|
|
<span class="camera-description">这是一张用于检查镜头是否合适的测试图</span>
|
|
|
</template>
|
|
|
|
|
|
@@ -59,29 +59,39 @@
|
|
|
</div>
|
|
|
|
|
|
<editRow
|
|
|
+ v-if="showrEditRow || isSetting"
|
|
|
:id="id"
|
|
|
- @confirm="emit('confirm')"
|
|
|
- @onClose="emit('onClose')"
|
|
|
+ @confirm="confirm"
|
|
|
+ ref="editData"
|
|
|
+ @onClose="onClose"
|
|
|
:addRowData="addRowData"
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
- <hardware-check
|
|
|
- v-if="!isSetting"
|
|
|
+ <hardware-check v-if="!isSetting"
|
|
|
isInitCheck
|
|
|
@confirm="checkConfirm(true)"
|
|
|
/>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
-import {watchEffect, ref, reactive, defineEmits, defineProps, computed, onBeforeUnmount} from 'vue'
|
|
|
+import {watchEffect, ref, reactive, defineEmits, defineProps, computed, onBeforeUnmount, onMounted} from 'vue'
|
|
|
import client from "@/stores/modules/client";
|
|
|
+import socket from "@/stores/modules/socket";
|
|
|
import icpList from '@/utils/ipc'
|
|
|
import useUserInfo from "@/stores/modules/user";
|
|
|
import headerBar from '@/components/header-bar/index.vue'
|
|
|
import editRow from './components/editRow'
|
|
|
const clientStore = client();
|
|
|
+const socketStore = socket(); // WebSocket状态管理实例
|
|
|
|
|
|
const emit = defineEmits([ 'confirm','onClose']);
|
|
|
+
|
|
|
+const confirm = ()=>{
|
|
|
+ emit('confirm')
|
|
|
+}
|
|
|
+const onClose = ()=>{
|
|
|
+ emit('onClose')
|
|
|
+}
|
|
|
// 定义 props
|
|
|
const props = defineProps({
|
|
|
id:{
|
|
|
@@ -99,19 +109,14 @@ const menu = reactive([])
|
|
|
const show = ref(true)
|
|
|
|
|
|
const isSetting = computed(()=>{
|
|
|
- return props.id
|
|
|
+ return props.id || props.addRowData.mode_type
|
|
|
})
|
|
|
|
|
|
const useUserInfoStore = useUserInfo()
|
|
|
import HardwareCheck from '@/components/check/index.vue'
|
|
|
-function confirm(){
|
|
|
- emit('confirm')
|
|
|
-}
|
|
|
-
|
|
|
-import socket from "../../stores/modules/socket";
|
|
|
import { digiCamControlWEB } from '@/utils/appconfig'
|
|
|
-const imageUrl = ref(digiCamControlWEB+'preview.jpg')
|
|
|
-const imageUrlkey = ref(0)
|
|
|
+import { getFilePath } from '@/utils/appfun'
|
|
|
+import {ElMessage} from "element-plus";
|
|
|
const previewKey = ref(0)
|
|
|
const preview = ref(digiCamControlWEB+'liveview.jpg')
|
|
|
|
|
|
@@ -119,9 +124,6 @@ const step = ref(1)
|
|
|
function checkConfirm(init){
|
|
|
step.value =1
|
|
|
if(menu.length === 0){
|
|
|
- menu.push({
|
|
|
- type:'setting'
|
|
|
- })
|
|
|
if(useUserInfoStore.userInfo.brand_company_code === '1300'){
|
|
|
|
|
|
menu.push({
|
|
|
@@ -132,10 +134,10 @@ function checkConfirm(init){
|
|
|
if(!init) previewKey.value++;
|
|
|
|
|
|
showVideo()
|
|
|
+ showrEditRow.value = true
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+const showrEditRow = ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
@@ -169,23 +171,72 @@ function hideVideo(){
|
|
|
}
|
|
|
|
|
|
const loading = ref(false)
|
|
|
-
|
|
|
+const editData = ref(null);
|
|
|
+const imageTplPath = ref(null)
|
|
|
function takePictures() {
|
|
|
+ console.log(editData);
|
|
|
+ console.log(editData.value.editRowData);
|
|
|
+
|
|
|
if (clientStore.isClient) {
|
|
|
- clientStore.ipc.removeAllListeners(icpList.camera.takePictures);
|
|
|
- clientStore.ipc.send(icpList.camera.takePictures);
|
|
|
- clientStore.ipc.on(icpList.camera.takePictures, async (event, result) => {
|
|
|
|
|
|
- if(interval) clearInterval(interval)
|
|
|
- loading.value = true;
|
|
|
- imageUrlkey.value++;
|
|
|
- setTimeout(()=>{
|
|
|
- hideVideo()
|
|
|
- step.value = 2
|
|
|
- imageUrlkey.value++;
|
|
|
- loading.value = false;
|
|
|
- },8000)
|
|
|
+ loading.value = true;
|
|
|
+
|
|
|
+ socketStore.sendMessage({
|
|
|
+ type: 'run_mcu_single',
|
|
|
+ data: {
|
|
|
+ camera_height: Number(editData.value.editRowData.camera_height),
|
|
|
+ camera_angle: Number(editData.value.editRowData.camera_angle),
|
|
|
+ led_switch:editData.value.editRowData.led_switch,
|
|
|
+ id:0,
|
|
|
+ mode_type:editData.value.editRowData.mode_type,
|
|
|
+ turntable_position:Number(editData.value.editRowData.turntable_position),
|
|
|
+ action_name:editData.value.editRowData.action_name || '测试',
|
|
|
+ turntable_angle: Number(editData.value.editRowData.turntable_angle),
|
|
|
+ shoe_upturn: Number(editData.value.editRowData.shoe_upturn),
|
|
|
+ action_index:1,
|
|
|
+ number_focus:0,
|
|
|
+ take_picture:true,
|
|
|
+ pre_delay:0,
|
|
|
+ after_delay:0,
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ clientStore.ipc.on(icpList.socket.message+'_run_mcu_single', async (event, result) => {
|
|
|
+ console.log('_run_mcu_single_check')
|
|
|
+ console.log(result)
|
|
|
+ if(result.code === 0 && result.data?.file_path){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.utils.createMainImage);
|
|
|
+ clientStore.ipc.send(icpList.utils.createMainImage,{
|
|
|
+ file_path:result.data.file_path
|
|
|
+ });
|
|
|
+ clientStore.ipc.on(icpList.utils.createMainImage, async (event, result) => {
|
|
|
+ console.log('icpList.utils.createMainImage');
|
|
|
+
|
|
|
+ if(result.code === 0 && result.data?.main_out_path){
|
|
|
+ imageTplPath.value = result.data?.main_out_path
|
|
|
+ hideVideo()
|
|
|
+ step.value = 2
|
|
|
+ loading.value = false;
|
|
|
+ }else if(result.msg){
|
|
|
+
|
|
|
+ ElMessage.error(result.msg)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ }else if(result.msg){
|
|
|
+
|
|
|
+ ElMessage.error(result.msg)
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|