|
@@ -10,7 +10,7 @@
|
|
|
<img src="@/assets/images/setting/icon1a.png" class="nav-icon" v-else/>
|
|
<img src="@/assets/images/setting/icon1a.png" class="nav-icon" v-else/>
|
|
|
<span>基础配置</span>
|
|
<span>基础配置</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="nav-item" v-if="configInfoStore.appModel === 1" :class="{'active': activeIndex === 3}" @click="toggleTab(3)" v-log="{ describe: { action: '点击切换设置Tab', tab: '相机配置' } }">
|
|
|
|
|
|
|
+ <div class="nav-item" :class="{'active': activeIndex === 3}" @click="toggleTab(3)" v-log="{ describe: { action: '点击切换设置Tab', tab: '相机配置' } }">
|
|
|
<img src="@/assets/images/setting/icon2.png" class="nav-icon" v-if="activeIndex !== 3"/>
|
|
<img src="@/assets/images/setting/icon2.png" class="nav-icon" v-if="activeIndex !== 3"/>
|
|
|
<img src="@/assets/images/setting/icon2a.png" class="nav-icon" v-else/>
|
|
<img src="@/assets/images/setting/icon2a.png" class="nav-icon" v-else/>
|
|
|
<span>相机配置</span>
|
|
<span>相机配置</span>
|
|
@@ -20,7 +20,7 @@
|
|
|
<img src="@/assets/images/setting/icon3a.png" class="nav-icon" v-else/>
|
|
<img src="@/assets/images/setting/icon3a.png" class="nav-icon" v-else/>
|
|
|
<span>其他设置</span>
|
|
<span>其他设置</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="nav-item" v-if="configInfoStore.appModel === 1" :class="{'active': activeIndex === 4}" @click="toggleTab(4)" v-log="{ describe: { action: '点击切换设置Tab', tab: '左右脚程序设置' } }">
|
|
|
|
|
|
|
+ <div class="nav-item" :class="{'active': activeIndex === 4}" @click="toggleTab(4)" v-log="{ describe: { action: '点击切换设置Tab', tab: '左右脚程序设置' } }">
|
|
|
<img src="@/assets/images/setting/icon4.png" class="nav-icon" v-if="activeIndex !== 4"/>
|
|
<img src="@/assets/images/setting/icon4.png" class="nav-icon" v-if="activeIndex !== 4"/>
|
|
|
<img src="@/assets/images/setting/icon4a.png" class="nav-icon" v-else/>
|
|
<img src="@/assets/images/setting/icon4a.png" class="nav-icon" v-else/>
|
|
|
<span>左右脚程序设置</span>
|
|
<span>左右脚程序设置</span>
|
|
@@ -78,7 +78,7 @@
|
|
|
<!--基础配置-->
|
|
<!--基础配置-->
|
|
|
<!--相机配置-->
|
|
<!--相机配置-->
|
|
|
<template v-if="activeIndex === 3">
|
|
<template v-if="activeIndex === 3">
|
|
|
- <CameraConfig ref="cameraConfigRef"/>
|
|
|
|
|
|
|
+ <CameraConfig ref="cameraConfigRef" :camera_configs="formData.camera_configs" @update:camera_configs="updateCameraConfigs"/>
|
|
|
|
|
|
|
|
</template>
|
|
</template>
|
|
|
<!--相机配置-->
|
|
<!--相机配置-->
|
|
@@ -148,6 +148,7 @@
|
|
|
import { ref, reactive } from 'vue';
|
|
import { ref, reactive } from 'vue';
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
import { onMounted, watch } from 'vue';
|
|
import { onMounted, watch } from 'vue';
|
|
|
|
|
+import { getAllUserConfigs, setAllUserConfigs } from '@/apis/setting'
|
|
|
import socket from "@/stores/modules/socket";
|
|
import socket from "@/stores/modules/socket";
|
|
|
import headerBar from '@/components/header-bar/index.vue';
|
|
import headerBar from '@/components/header-bar/index.vue';
|
|
|
import client from "@/stores/modules/client";
|
|
import client from "@/stores/modules/client";
|
|
@@ -190,6 +191,7 @@ function handleSettingClick() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
// 路由和状态管理初始化
|
|
// 路由和状态管理初始化
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
@@ -226,7 +228,7 @@ const formData = reactive({
|
|
|
"device_speed": "",//设备运动速度
|
|
"device_speed": "",//设备运动速度
|
|
|
"running_mode": "" //运行模式
|
|
"running_mode": "" //运行模式
|
|
|
},
|
|
},
|
|
|
- captureOneFolder: '', // Capture One文件夹路径
|
|
|
|
|
|
|
+/* captureOneFolder: '', // Capture One文件夹路径
|
|
|
mainImageSize: '', // 主图尺寸
|
|
mainImageSize: '', // 主图尺寸
|
|
|
imageFormat: '', // 图片格式
|
|
imageFormat: '', // 图片格式
|
|
|
imageSharpening: '', // 图片锐化
|
|
imageSharpening: '', // 图片锐化
|
|
@@ -243,7 +245,7 @@ const formData = reactive({
|
|
|
left: '', // 左脚配置
|
|
left: '', // 左脚配置
|
|
|
right: '', // 右脚配置
|
|
right: '', // 右脚配置
|
|
|
up: '', // 上移配置
|
|
up: '', // 上移配置
|
|
|
- down: '', // 下移配置
|
|
|
|
|
|
|
+ down: '', // 下移配置*/
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// 配置选项列表
|
|
// 配置选项列表
|
|
@@ -340,48 +342,18 @@ const indexKey ={
|
|
|
2:"other_configs",
|
|
2:"other_configs",
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 监听路由参数变化,更新activeIndex和activeTab。
|
|
* 监听路由参数变化,更新activeIndex和activeTab。
|
|
|
*/
|
|
*/
|
|
|
watch(() => route.query.type, async (newType,oldType) => {
|
|
watch(() => route.query.type, async (newType,oldType) => {
|
|
|
|
|
|
|
|
- if(['0','1','2'].includes(oldType)){
|
|
|
|
|
- // await saveSetting(oldType)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
const typeValue = parseInt(newType) || 0;
|
|
const typeValue = parseInt(newType) || 0;
|
|
|
if([3,4].includes(typeValue)) return;
|
|
if([3,4].includes(typeValue)) return;
|
|
|
- switch (typeValue) {
|
|
|
|
|
- default:
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.getSysConfig);
|
|
|
|
|
- clientStore.ipc.send(icpList.setting.getSysConfig,{
|
|
|
|
|
- key: indexKey[typeValue]
|
|
|
|
|
- });
|
|
|
|
|
- clientStore.ipc.on(icpList.setting.getSysConfig, (event, result) => {
|
|
|
|
|
- if(result.code == 0 && result.data){
|
|
|
|
|
-
|
|
|
|
|
- formData[indexKey[typeValue]] = result.data
|
|
|
|
|
- const presetSizes = mainImageSizeList.value.map(item => item.value);
|
|
|
|
|
- const receivedSizes = result.data.main_image_size ? [...result.data.main_image_size] : [];
|
|
|
|
|
-
|
|
|
|
|
- // 分离自定义值
|
|
|
|
|
- const customValues = receivedSizes.filter(v => !presetSizes.includes(v));
|
|
|
|
|
- if (customValues.length > 0) {
|
|
|
|
|
- customInput.value = customValues[0]; // 保留第一个自定义值
|
|
|
|
|
- // 更新选中状态
|
|
|
|
|
- formData.basic_configs.main_image_size = receivedSizes
|
|
|
|
|
- .filter(v => presetSizes.includes(v))
|
|
|
|
|
- .concat('custom');
|
|
|
|
|
- } else {
|
|
|
|
|
- formData.basic_configs.main_image_size = receivedSizes;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- console.log('icpList.setting.getSysConfig')
|
|
|
|
|
- console.log(result)
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.getSysConfig);
|
|
|
|
|
- });
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
-}, { immediate: true });
|
|
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -396,12 +368,42 @@ watch(() => activeIndex.value, (newIndex) => {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+const getConfig = async (typeValue)=>{
|
|
|
|
|
+
|
|
|
|
|
+ const resultPHP = await getAllUserConfigs();
|
|
|
|
|
+ if(resultPHP.code == 0 && resultPHP.data.configs ){
|
|
|
|
|
+ Object.keys(resultPHP.data.configs).map(item=>{
|
|
|
|
|
+ formData[item] = resultPHP.data.configs[item]
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ console.log(formData);
|
|
|
|
|
+ const presetSizes = mainImageSizeList.value.map(item => item.value);
|
|
|
|
|
+ const receivedSizes = formData.basic_configs.main_image_size ? [...formData.basic_configs.main_image_size] : [];
|
|
|
|
|
+
|
|
|
|
|
+ // 分离自定义值
|
|
|
|
|
+ const customValues = receivedSizes.filter(v => !presetSizes.includes(v));
|
|
|
|
|
+ if (customValues.length > 0) {
|
|
|
|
|
+ customInput.value = customValues[0]; // 保留第一个自定义值
|
|
|
|
|
+ // 更新选中状态
|
|
|
|
|
+ formData.basic_configs.main_image_size = receivedSizes
|
|
|
|
|
+ .filter(v => presetSizes.includes(v))
|
|
|
|
|
+ .concat('custom');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ formData.basic_configs.main_image_size = receivedSizes;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
/**
|
|
/**
|
|
|
* 组件挂载时初始化activeIndex。
|
|
* 组件挂载时初始化activeIndex。
|
|
|
*/
|
|
*/
|
|
|
-onMounted(() => {
|
|
|
|
|
|
|
+onMounted(async () => {
|
|
|
|
|
+ getConfig()
|
|
|
|
|
+
|
|
|
|
|
+ let type = 0 ;
|
|
|
if (route.query.type) {
|
|
if (route.query.type) {
|
|
|
const typeValue = parseInt(route.query.type);
|
|
const typeValue = parseInt(route.query.type);
|
|
|
|
|
+ type = typeValue
|
|
|
if (!isNaN(typeValue) && typeValue >= 0 && typeValue <= 3) {
|
|
if (!isNaN(typeValue) && typeValue >= 0 && typeValue <= 3) {
|
|
|
activeIndex.value = typeValue;
|
|
activeIndex.value = typeValue;
|
|
|
}
|
|
}
|
|
@@ -426,6 +428,11 @@ const handleInput = (value) => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// 添加更新camera_configs的方法
|
|
|
|
|
+const updateCameraConfigs = (configs) => {
|
|
|
|
|
+ formData.camera_configs = configs;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const toggleTab = async (item) => {
|
|
const toggleTab = async (item) => {
|
|
|
const oldType = activeIndex.value;
|
|
const oldType = activeIndex.value;
|
|
|
// 切换前保存当前 Tab 配置(包含相机配置 3)
|
|
// 切换前保存当前 Tab 配置(包含相机配置 3)
|
|
@@ -453,12 +460,11 @@ const saveSetting = async (index) => {
|
|
|
// 构建临时提交数据
|
|
// 构建临时提交数据
|
|
|
if(index === 3) {
|
|
if(index === 3) {
|
|
|
if (cameraConfigRef.value && typeof cameraConfigRef.value.save === 'function') {
|
|
if (cameraConfigRef.value && typeof cameraConfigRef.value.save === 'function') {
|
|
|
- return await cameraConfigRef.value.save()
|
|
|
|
|
|
|
+ if(! cameraConfigRef.value.save()) return false;
|
|
|
}
|
|
}
|
|
|
- return false
|
|
|
|
|
}
|
|
}
|
|
|
const submitData = {
|
|
const submitData = {
|
|
|
- ...formData[indexKey[index]]
|
|
|
|
|
|
|
+ ...formData
|
|
|
};
|
|
};
|
|
|
if(index === 0) {
|
|
if(index === 0) {
|
|
|
if (formData.basic_configs.main_image_size.length === 0) {
|
|
if (formData.basic_configs.main_image_size.length === 0) {
|
|
@@ -485,24 +491,13 @@ const saveSetting = async (index) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- console.log(submitData);
|
|
|
|
|
- await new Promise((resolve, reject) => {
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.updateSysConfigs);
|
|
|
|
|
- clientStore.ipc.send(icpList.setting.updateSysConfigs,{
|
|
|
|
|
- key: indexKey[index],
|
|
|
|
|
- value: JSON.stringify(submitData)
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- clientStore.ipc.on(icpList.setting.updateSysConfigs, async (event, result) => {
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.updateSysConfigs);
|
|
|
|
|
- if(result.code === 0 && result.msg){
|
|
|
|
|
- resolve(true)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const params = JSON.parse(JSON.stringify({
|
|
|
|
|
+ configs:submitData
|
|
|
|
|
+ }))
|
|
|
|
|
+ const result = await setAllUserConfigs(params)
|
|
|
|
|
+ if(result.code != 0) return false;
|
|
|
|
|
+ return true;
|
|
|
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
@@ -519,20 +514,20 @@ const saveSetting = async (index) => {
|
|
|
padding-top: 30px;
|
|
padding-top: 30px;
|
|
|
padding-left: 100px;
|
|
padding-left: 100px;
|
|
|
border-bottom: 1px solid rgba(0,0,0,0.1);
|
|
border-bottom: 1px solid rgba(0,0,0,0.1);
|
|
|
- :deep(.el-tabs__header){
|
|
|
|
|
|
|
+ ::v-deep(.el-tabs__header){
|
|
|
padding-left: 0;
|
|
padding-left: 0;
|
|
|
}
|
|
}
|
|
|
- :deep(.el-tabs--card>.el-tabs__header){
|
|
|
|
|
|
|
+ ::v-deep(.el-tabs--card>.el-tabs__header){
|
|
|
border-bottom: 1px solid #CCCCCC;
|
|
border-bottom: 1px solid #CCCCCC;
|
|
|
}
|
|
}
|
|
|
- :deep(.el-tabs__item){
|
|
|
|
|
|
|
+ ::v-deep(.el-tabs__item){
|
|
|
height: 30px;
|
|
height: 30px;
|
|
|
line-height: 30px;
|
|
line-height: 30px;
|
|
|
}
|
|
}
|
|
|
- :deep(.el-tabs__nav-wrap){
|
|
|
|
|
|
|
+ ::v-deep(.el-tabs__nav-wrap){
|
|
|
margin-bottom: 0;
|
|
margin-bottom: 0;
|
|
|
}
|
|
}
|
|
|
- :deep(.el-tabs__item.is-active){
|
|
|
|
|
|
|
+ ::v-deep(.el-tabs__item.is-active){
|
|
|
color: #333;
|
|
color: #333;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
|
background: #fff;
|
|
background: #fff;
|
|
@@ -555,7 +550,7 @@ const saveSetting = async (index) => {
|
|
|
.select-wrapper {
|
|
.select-wrapper {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
width: 200px;
|
|
width: 200px;
|
|
|
- :deep(.el-input__inner){
|
|
|
|
|
|
|
+ ::v-deep(.el-input__inner){
|
|
|
border-radius: 6px;
|
|
border-radius: 6px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -688,14 +683,14 @@ body {
|
|
|
.flex-row{
|
|
.flex-row{
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- :deep(.el-radio){
|
|
|
|
|
|
|
+ ::v-deep(.el-radio){
|
|
|
margin-right: 6px !important;
|
|
margin-right: 6px !important;
|
|
|
}
|
|
}
|
|
|
- :deep(.el-radio__label){
|
|
|
|
|
|
|
+ ::v-deep(.el-radio__label){
|
|
|
padding-left: 4px;
|
|
padding-left: 4px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- :deep(.el-form-item) {
|
|
|
|
|
|
|
+ ::v-deep(.el-form-item) {
|
|
|
margin-bottom: 0;
|
|
margin-bottom: 0;
|
|
|
.el-form-item__label {
|
|
.el-form-item__label {
|
|
|
width: 120px !important;
|
|
width: 120px !important;
|
|
@@ -745,7 +740,7 @@ body {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
input[type="number"] {
|
|
input[type="number"] {
|
|
|
- -moz-appearance: number-input; /* Firefox */
|
|
|
|
|
|
|
+ -moz-appearance: textfield; /* Firefox */
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|