|
@@ -2,6 +2,7 @@ import { GET,POST } from "@/utils/http";
|
|
|
import client from "@/stores/modules/client";
|
|
import client from "@/stores/modules/client";
|
|
|
import icpList from '@/utils/ipc'
|
|
import icpList from '@/utils/ipc'
|
|
|
import tokenInfo from '@/stores/modules/token';
|
|
import tokenInfo from '@/stores/modules/token';
|
|
|
|
|
+import useUserInfo from '@/stores/modules/user';
|
|
|
|
|
|
|
|
//获取配置
|
|
//获取配置
|
|
|
export async function getAllUserConfigs(data){
|
|
export async function getAllUserConfigs(data){
|
|
@@ -19,8 +20,11 @@ export async function setAllUserConfigs(data){
|
|
|
const clientStore = client();
|
|
const clientStore = client();
|
|
|
const tokenInfoStore = tokenInfo();
|
|
const tokenInfoStore = tokenInfo();
|
|
|
const token = tokenInfoStore.getToken;
|
|
const token = tokenInfoStore.getToken;
|
|
|
|
|
+ const userInfoStore = useUserInfo();
|
|
|
|
|
+ await userInfoStore.checkCompanyStatus();
|
|
|
await clientStore.ipc.invoke(icpList.setting.syncSysConfigs, {
|
|
await clientStore.ipc.invoke(icpList.setting.syncSysConfigs, {
|
|
|
- token: token || ''
|
|
|
|
|
|
|
+ token: token || '',
|
|
|
|
|
+ camera_counts: userInfoStore.isMultiCameraMode
|
|
|
});
|
|
});
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('同步系统配置到Python失败:', error);
|
|
console.error('同步系统配置到Python失败:', error);
|
|
@@ -55,10 +59,13 @@ export async function setLeftRightConfig(data){
|
|
|
const clientStore = client();
|
|
const clientStore = client();
|
|
|
const tokenInfoStore = tokenInfo();
|
|
const tokenInfoStore = tokenInfo();
|
|
|
const token = tokenInfoStore.getToken;
|
|
const token = tokenInfoStore.getToken;
|
|
|
|
|
+ const userInfoStore = useUserInfo();
|
|
|
|
|
+ await userInfoStore.checkCompanyStatus();
|
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
|
token: token || '',
|
|
token: token || '',
|
|
|
action: 'update',
|
|
action: 'update',
|
|
|
- data: data
|
|
|
|
|
|
|
+ data: data,
|
|
|
|
|
+ camera_counts: userInfoStore.isMultiCameraMode
|
|
|
});
|
|
});
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('同步左右脚配置到Python失败:', error);
|
|
console.error('同步左右脚配置到Python失败:', error);
|
|
@@ -78,10 +85,13 @@ export async function restConfig(data){
|
|
|
const clientStore = client();
|
|
const clientStore = client();
|
|
|
const tokenInfoStore = tokenInfo();
|
|
const tokenInfoStore = tokenInfo();
|
|
|
const token = tokenInfoStore.getToken;
|
|
const token = tokenInfoStore.getToken;
|
|
|
|
|
+ const userInfoStore = useUserInfo();
|
|
|
|
|
+ await userInfoStore.checkCompanyStatus();
|
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
|
token: token || '',
|
|
token: token || '',
|
|
|
action: 'reset',
|
|
action: 'reset',
|
|
|
- tab_id: data.tab_id
|
|
|
|
|
|
|
+ tab_id: data.tab_id,
|
|
|
|
|
+ camera_counts: userInfoStore.isMultiCameraMode
|
|
|
});
|
|
});
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('同步重置配置到Python失败:', error);
|
|
console.error('同步重置配置到Python失败:', error);
|
|
@@ -103,9 +113,12 @@ export async function sortDeviceConfig(data){
|
|
|
const clientStore = client();
|
|
const clientStore = client();
|
|
|
const tokenInfoStore = tokenInfo();
|
|
const tokenInfoStore = tokenInfo();
|
|
|
const token = tokenInfoStore.getToken;
|
|
const token = tokenInfoStore.getToken;
|
|
|
|
|
+ const userInfoStore = useUserInfo();
|
|
|
|
|
+ await userInfoStore.checkCompanyStatus();
|
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
|
token: token || '',
|
|
token: token || '',
|
|
|
action: 'sort',
|
|
action: 'sort',
|
|
|
|
|
+ camera_counts: userInfoStore.isMultiCameraMode
|
|
|
});
|
|
});
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('同步重置配置到Python失败:', error);
|
|
console.error('同步重置配置到Python失败:', error);
|
|
@@ -125,11 +138,14 @@ export async function setTabName(data){
|
|
|
const clientStore = client();
|
|
const clientStore = client();
|
|
|
const tokenInfoStore = tokenInfo();
|
|
const tokenInfoStore = tokenInfo();
|
|
|
const token = tokenInfoStore.getToken;
|
|
const token = tokenInfoStore.getToken;
|
|
|
|
|
+ const userInfoStore = useUserInfo();
|
|
|
|
|
+ await userInfoStore.checkCompanyStatus();
|
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
|
token: token || '',
|
|
token: token || '',
|
|
|
action: 'rename',
|
|
action: 'rename',
|
|
|
id: data.id,
|
|
id: data.id,
|
|
|
- mode_name: data.mode_name
|
|
|
|
|
|
|
+ mode_name: data.mode_name,
|
|
|
|
|
+ camera_counts: userInfoStore.isMultiCameraMode
|
|
|
});
|
|
});
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('同步重命名配置到Python失败:', error);
|
|
console.error('同步重命名配置到Python失败:', error);
|
|
@@ -151,11 +167,14 @@ export async function copyDeviceConfig(data){
|
|
|
const clientStore = client();
|
|
const clientStore = client();
|
|
|
const tokenInfoStore = tokenInfo();
|
|
const tokenInfoStore = tokenInfo();
|
|
|
const token = tokenInfoStore.getToken;
|
|
const token = tokenInfoStore.getToken;
|
|
|
|
|
+ const userInfoStore = useUserInfo();
|
|
|
|
|
+ await userInfoStore.checkCompanyStatus();
|
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
|
token: token || '',
|
|
token: token || '',
|
|
|
action: 'copy_device_config',
|
|
action: 'copy_device_config',
|
|
|
id: data.tab_id,
|
|
id: data.tab_id,
|
|
|
- mode_name: data.tab_name
|
|
|
|
|
|
|
+ mode_name: data.tab_name,
|
|
|
|
|
+ camera_counts: userInfoStore.isMultiCameraMode
|
|
|
});
|
|
});
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('同步重命名配置到Python失败:', error);
|
|
console.error('同步重命名配置到Python失败:', error);
|
|
@@ -174,10 +193,13 @@ export async function delDviceConfig(data){
|
|
|
const clientStore = client();
|
|
const clientStore = client();
|
|
|
const tokenInfoStore = tokenInfo();
|
|
const tokenInfoStore = tokenInfo();
|
|
|
const token = tokenInfoStore.getToken;
|
|
const token = tokenInfoStore.getToken;
|
|
|
|
|
+ const userInfoStore = useUserInfo();
|
|
|
|
|
+ await userInfoStore.checkCompanyStatus();
|
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
|
token: token || '',
|
|
token: token || '',
|
|
|
action: 'delete',
|
|
action: 'delete',
|
|
|
- id: data.id
|
|
|
|
|
|
|
+ id: data.id,
|
|
|
|
|
+ camera_counts: userInfoStore.isMultiCameraMode
|
|
|
});
|
|
});
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('同步删除配置到Python失败:', error);
|
|
console.error('同步删除配置到Python失败:', error);
|
|
@@ -213,10 +235,13 @@ export async function saveDeviceConfig(data){
|
|
|
const clientStore = client();
|
|
const clientStore = client();
|
|
|
const tokenInfoStore = tokenInfo();
|
|
const tokenInfoStore = tokenInfo();
|
|
|
const token = tokenInfoStore.getToken;
|
|
const token = tokenInfoStore.getToken;
|
|
|
|
|
+ const userInfoStore = useUserInfo();
|
|
|
|
|
+ await userInfoStore.checkCompanyStatus();
|
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
|
token: token || '',
|
|
token: token || '',
|
|
|
action: 'save',
|
|
action: 'save',
|
|
|
- data: data
|
|
|
|
|
|
|
+ data: data,
|
|
|
|
|
+ camera_counts: userInfoStore.isMultiCameraMode
|
|
|
});
|
|
});
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('同步保存配置到Python失败:', error);
|
|
console.error('同步保存配置到Python失败:', error);
|
|
@@ -238,27 +263,37 @@ export async function syncAfterLogin() {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 检查企业状态,获取多相机模式标识
|
|
|
|
|
+ const userInfoStore = useUserInfo();
|
|
|
|
|
+ await userInfoStore.checkCompanyStatus();
|
|
|
|
|
+ const isMultiCameraMode = userInfoStore.isMultiCameraMode;
|
|
|
|
|
+ console.log('syncAfterLogin');
|
|
|
|
|
+ console.log(isMultiCameraMode);
|
|
|
// 同步系统配置
|
|
// 同步系统配置
|
|
|
await clientStore.ipc.invoke(icpList.setting.syncSysConfigs, {
|
|
await clientStore.ipc.invoke(icpList.setting.syncSysConfigs, {
|
|
|
- token: token
|
|
|
|
|
|
|
+ token: token,
|
|
|
|
|
+ camera_counts: isMultiCameraMode
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// 同步动作配置
|
|
// 同步动作配置
|
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
await clientStore.ipc.invoke(icpList.setting.syncActions, {
|
|
|
token: token,
|
|
token: token,
|
|
|
- action: 'sync_all'
|
|
|
|
|
|
|
+ action: 'sync_all',
|
|
|
|
|
+ camera_counts: isMultiCameraMode
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
// 线上数据同步到本地
|
|
// 线上数据同步到本地
|
|
|
await clientStore.ipc.invoke(icpList.setting.syncSysConfigs, {
|
|
await clientStore.ipc.invoke(icpList.setting.syncSysConfigs, {
|
|
|
- token: token
|
|
|
|
|
|
|
+ token: token,
|
|
|
|
|
+ camera_counts: isMultiCameraMode
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
// 拍摄历史记录同步
|
|
// 拍摄历史记录同步
|
|
|
await clientStore.ipc.invoke(icpList.setting.syncPhotoRecord, {
|
|
await clientStore.ipc.invoke(icpList.setting.syncPhotoRecord, {
|
|
|
- token: token
|
|
|
|
|
|
|
+ token: token,
|
|
|
|
|
+ camera_counts: isMultiCameraMode
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
console.log('登录后数据同步成功');
|
|
console.log('登录后数据同步成功');
|