|
@@ -64,6 +64,7 @@
|
|
|
@confirm="confirm"
|
|
@confirm="confirm"
|
|
|
ref="editData"
|
|
ref="editData"
|
|
|
@onClose="onClose"
|
|
@onClose="onClose"
|
|
|
|
|
+ @onRunMcuSingle="onRunMcuSingle"
|
|
|
:addRowData="addRowData"
|
|
:addRowData="addRowData"
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
@@ -86,6 +87,10 @@ const socketStore = socket(); // WebSocket状态管理实例
|
|
|
|
|
|
|
|
const emit = defineEmits([ 'confirm','onClose']);
|
|
const emit = defineEmits([ 'confirm','onClose']);
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+import configInfo from '@/stores/modules/config';
|
|
|
|
|
+const configInfoStore = configInfo();
|
|
|
|
|
+
|
|
|
const confirm = ()=>{
|
|
const confirm = ()=>{
|
|
|
hideVideo()
|
|
hideVideo()
|
|
|
emit('confirm')
|
|
emit('confirm')
|
|
@@ -120,14 +125,17 @@ import { digiCamControlWEB } from '@/utils/appconfig'
|
|
|
import { getFilePath } from '@/utils/appfun'
|
|
import { getFilePath } from '@/utils/appfun'
|
|
|
import {ElMessage} from "element-plus";
|
|
import {ElMessage} from "element-plus";
|
|
|
const previewKey = ref(0)
|
|
const previewKey = ref(0)
|
|
|
|
|
+
|
|
|
const preview = ref(digiCamControlWEB+'liveview.jpg')
|
|
const preview = ref(digiCamControlWEB+'liveview.jpg')
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
const previewSrc = computed(()=>{
|
|
const previewSrc = computed(()=>{
|
|
|
let time = new Date().getTime()
|
|
let time = new Date().getTime()
|
|
|
return preview.value+'?key='+previewKey.value+'&time='+time
|
|
return preview.value+'?key='+previewKey.value+'&time='+time
|
|
|
})
|
|
})
|
|
|
const step = ref(1)
|
|
const step = ref(1)
|
|
|
-function checkConfirm(init){
|
|
|
|
|
|
|
+async function checkConfirm(init){
|
|
|
step.value =1
|
|
step.value =1
|
|
|
if(menu.length === 0){
|
|
if(menu.length === 0){
|
|
|
menu.push({
|
|
menu.push({
|
|
@@ -143,6 +151,13 @@ function checkConfirm(init){
|
|
|
showrEditRow.value = true
|
|
showrEditRow.value = true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const init = ref(true)
|
|
|
|
|
+function onRunMcuSingle (){
|
|
|
|
|
+ if(init.value) {
|
|
|
|
|
+ loading.value = false
|
|
|
|
|
+ init.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
const showrEditRow = ref(false)
|
|
const showrEditRow = ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
@@ -160,7 +175,7 @@ function showVideo(){
|
|
|
interval = setInterval(()=>{
|
|
interval = setInterval(()=>{
|
|
|
previewKey.value++;
|
|
previewKey.value++;
|
|
|
},200)
|
|
},200)
|
|
|
- },2000)
|
|
|
|
|
|
|
+ },500)
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -176,7 +191,10 @@ function hideVideo(){
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const loading = ref(false)
|
|
|
|
|
|
|
+function goArts(){
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+const loading = ref(true)
|
|
|
const editData = ref(null);
|
|
const editData = ref(null);
|
|
|
const imageTplPath = ref(null)
|
|
const imageTplPath = ref(null)
|
|
|
function takePictures() {
|
|
function takePictures() {
|
|
@@ -212,33 +230,51 @@ function takePictures() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 获取主图
|
|
|
|
|
+function createMainImage (file_path){
|
|
|
|
|
+
|
|
|
|
|
+ loading.value = true;
|
|
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.takePhoto.createMainImage);
|
|
|
|
|
+ clientStore.ipc.send(icpList.takePhoto.createMainImage,{
|
|
|
|
|
+ file_path:file_path
|
|
|
|
|
+ });
|
|
|
|
|
+ clientStore.ipc.on(icpList.takePhoto.createMainImage, async (event, result) => {
|
|
|
|
|
+ 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){
|
|
|
|
|
+ loading.value = false;
|
|
|
|
|
+ showVideo()
|
|
|
|
|
+ if(result.code !== 0) ElMessage.error(result.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.takePhoto.createMainImage);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+//拍照成功 SmartShooter
|
|
|
|
|
+clientStore.ipc.on(icpList.socket.message+'_smart_shooter_photo_take', async (event, result) => {
|
|
|
|
|
+ console.log('_smart_shooter_photo_take');
|
|
|
|
|
+ console.log(result);
|
|
|
|
|
+ if(result.code === 0 && result.data?.photo_file_name){
|
|
|
|
|
+ createMainImage(result.data?.photo_file_name)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+//运行的时候 直接拍照 digiCamControl
|
|
|
clientStore.ipc.on(icpList.socket.message+'_run_mcu_single', async (event, result) => {
|
|
clientStore.ipc.on(icpList.socket.message+'_run_mcu_single', async (event, result) => {
|
|
|
- console.log('_run_mcu_single_check')
|
|
|
|
|
|
|
+ console.log('_run_mcu_single_check_on')
|
|
|
console.log(result)
|
|
console.log(result)
|
|
|
|
|
|
|
|
if(result.code === 0 && result.data?.file_path){
|
|
if(result.code === 0 && result.data?.file_path){
|
|
|
- clientStore.ipc.removeAllListeners(icpList.takePhoto.createMainImage);
|
|
|
|
|
- clientStore.ipc.send(icpList.takePhoto.createMainImage,{
|
|
|
|
|
- file_path:result.data.file_path
|
|
|
|
|
- });
|
|
|
|
|
- clientStore.ipc.on(icpList.takePhoto.createMainImage, async (event, result) => {
|
|
|
|
|
- console.log('icpList.utils.createMainImage');
|
|
|
|
|
- console.log(result);
|
|
|
|
|
- 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){
|
|
|
|
|
- loading.value = false;
|
|
|
|
|
- showVideo()
|
|
|
|
|
- if(result.code !== 0) ElMessage.error(result.msg)
|
|
|
|
|
- }
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.takePhoto.createMainImage);
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
|
|
+ createMainImage(result.data?.file_path)
|
|
|
|
|
|
|
|
}else if(result.msg){
|
|
}else if(result.msg){
|
|
|
if( result.msg.indexOf('处理失败,请重试') >= 0){
|
|
if( result.msg.indexOf('处理失败,请重试') >= 0){
|
|
@@ -250,8 +286,12 @@ clientStore.ipc.on(icpList.socket.message+'_run_mcu_single', async (event, resul
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
-onMounted(()=>{
|
|
|
|
|
- showVideo()
|
|
|
|
|
|
|
+onMounted(async ()=>{
|
|
|
|
|
+ if(isSetting.value) showVideo()
|
|
|
|
|
+ await configInfoStore.getAppConfig()
|
|
|
|
|
+ if(configInfoStore.appConfig.controlType === "SmartShooter"){
|
|
|
|
|
+ preview.value = configInfoStore.appConfig.userDataPath + "\\preview\\liveview.png"
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -262,6 +302,10 @@ onBeforeUnmount(() => {
|
|
|
clientStore.ipc.removeAllListeners(icpList.camera.takePictures);
|
|
clientStore.ipc.removeAllListeners(icpList.camera.takePictures);
|
|
|
clientStore.ipc.removeAllListeners(icpList.camera.PreviewHide);
|
|
clientStore.ipc.removeAllListeners(icpList.camera.PreviewHide);
|
|
|
clientStore.ipc.removeAllListeners(icpList.camera.PreviewShow);
|
|
clientStore.ipc.removeAllListeners(icpList.camera.PreviewShow);
|
|
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.socket.message+'_run_mcu_single');
|
|
|
|
|
+ clientStore.ipc.removeAllListeners(icpList.socket.message+'_smart_shooter_photo_take');
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|