|
@@ -6,6 +6,7 @@ import client from "./client";
|
|
|
import {ElMessage} from "element-plus";
|
|
import {ElMessage} from "element-plus";
|
|
|
import configInfo from '@/stores/modules/config';
|
|
import configInfo from '@/stores/modules/config';
|
|
|
import { useUserInfo } from './user';
|
|
import { useUserInfo } from './user';
|
|
|
|
|
+import i18n from '@/locales';
|
|
|
const socketStore = socket();
|
|
const socketStore = socket();
|
|
|
const clientStore = client();
|
|
const clientStore = client();
|
|
|
const userInfoStore = useUserInfo();
|
|
const userInfoStore = useUserInfo();
|
|
@@ -22,22 +23,22 @@ export const checkInfo = defineStore('checkInfo', () => {
|
|
|
mcu: {
|
|
mcu: {
|
|
|
status: 0,
|
|
status: 0,
|
|
|
msg_type: "connect_mcu",
|
|
msg_type: "connect_mcu",
|
|
|
- msg: "未连接",
|
|
|
|
|
|
|
+ msg: i18n.global.t('checkStore.notConnected'),
|
|
|
},
|
|
},
|
|
|
blue_tooth: {
|
|
blue_tooth: {
|
|
|
status: 0,
|
|
status: 0,
|
|
|
msg_type: "connect_bluetooth",
|
|
msg_type: "connect_bluetooth",
|
|
|
- msg: "未连接",
|
|
|
|
|
|
|
+ msg: i18n.global.t('checkStore.notConnected'),
|
|
|
},
|
|
},
|
|
|
cam_control: {
|
|
cam_control: {
|
|
|
status: 0,
|
|
status: 0,
|
|
|
msg_type: "cam_control",
|
|
msg_type: "cam_control",
|
|
|
- msg: "未连接",
|
|
|
|
|
|
|
+ msg: i18n.global.t('checkStore.notConnected'),
|
|
|
},
|
|
},
|
|
|
/* camera: {
|
|
/* camera: {
|
|
|
status: 0,
|
|
status: 0,
|
|
|
msg_type: "camera",
|
|
msg_type: "camera",
|
|
|
- msg: "未连接",
|
|
|
|
|
|
|
+ msg: i18n.global.t('checkStore.notConnected'),
|
|
|
},*/
|
|
},*/
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -101,7 +102,7 @@ export const checkInfo = defineStore('checkInfo', () => {
|
|
|
clearInterval(CKTimerInterval)
|
|
clearInterval(CKTimerInterval)
|
|
|
checkTime.value = 0
|
|
checkTime.value = 0
|
|
|
mcu.isInitSend = false
|
|
mcu.isInitSend = false
|
|
|
- return '拍照机连接失败,请重新检查,可以尝试重新启动拍照机,插拔USB口,强制初始化等,请检查相机和支撑转盘是否待机休眠。如果确认未休眠,请检查各种连接线是否,正常连上。然后再重试一次,一直无法解决问题,请致电:15957854217,18805712182。';
|
|
|
|
|
|
|
+ return i18n.global.t('checkStore.photoMachineConnectFailedDetail');
|
|
|
}
|
|
}
|
|
|
for (const device of Object.values(devices)) {
|
|
for (const device of Object.values(devices)) {
|
|
|
if (device.status === -1 && device.msg_type !== 'connect_bluetooth') {
|
|
if (device.status === -1 && device.msg_type !== 'connect_bluetooth') {
|
|
@@ -155,7 +156,7 @@ export const checkInfo = defineStore('checkInfo', () => {
|
|
|
|
|
|
|
|
if(!result && checkTime.value > 0){
|
|
if(!result && checkTime.value > 0){
|
|
|
devices.cam_control.status = -1;
|
|
devices.cam_control.status = -1;
|
|
|
- devices.cam_control.msg = '相机未连接,请链接相机。';
|
|
|
|
|
|
|
+ devices.cam_control.msg = i18n.global.t('checkStore.cameraNotConnected');
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -246,7 +247,7 @@ export const checkInfo = defineStore('checkInfo', () => {
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error(`Error checking ${deviceName}:`, error);
|
|
console.error(`Error checking ${deviceName}:`, error);
|
|
|
devices[deviceName].status = -1;
|
|
devices[deviceName].status = -1;
|
|
|
- devices[deviceName].msg = `检查失败: ${error.message}`;
|
|
|
|
|
|
|
+ devices[deviceName].msg = i18n.global.t('checkStore.checkFailed', { error: error.message });
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -276,7 +277,7 @@ export const checkInfo = defineStore('checkInfo', () => {
|
|
|
const reCheckAction = async () => {
|
|
const reCheckAction = async () => {
|
|
|
for (const device of Object.values(devices)) {
|
|
for (const device of Object.values(devices)) {
|
|
|
device.status = 0;
|
|
device.status = 0;
|
|
|
- device.msg = "未连接";
|
|
|
|
|
|
|
+ device.msg = i18n.global.t('checkStore.notConnected');
|
|
|
}
|
|
}
|
|
|
mcu.status = -0;
|
|
mcu.status = -0;
|
|
|
mcu.isInitSend = false;
|
|
mcu.isInitSend = false;
|
|
@@ -294,11 +295,11 @@ export const checkInfo = defineStore('checkInfo', () => {
|
|
|
devices.mcu.status = -1;
|
|
devices.mcu.status = -1;
|
|
|
mcu.status = -1;
|
|
mcu.status = -1;
|
|
|
mcu.isInitSend = false;
|
|
mcu.isInitSend = false;
|
|
|
- devices.mcu.msg = '拍照机连接失败';
|
|
|
|
|
|
|
+ devices.mcu.msg = i18n.global.t('checkStore.photoMachineConnectFailed');
|
|
|
}
|
|
}
|
|
|
if( devices.cam_control.status !== 2 ){
|
|
if( devices.cam_control.status !== 2 ){
|
|
|
devices.cam_control.status = -1;
|
|
devices.cam_control.status = -1;
|
|
|
- devices.cam_control.msg = '拍照机连接失败';
|
|
|
|
|
|
|
+ devices.cam_control.msg = i18n.global.t('checkStore.photoMachineConnectFailed');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},1000)
|
|
},1000)
|