|
@@ -29,7 +29,7 @@
|
|
|
<div v-if="isSortMode" class="normal-btn" @click="cancelSort" v-log="{ describe: { action: '点击取消排序' } }">
|
|
<div v-if="isSortMode" class="normal-btn" @click="cancelSort" v-log="{ describe: { action: '点击取消排序' } }">
|
|
|
取消排序
|
|
取消排序
|
|
|
</div>
|
|
</div>
|
|
|
- <el-radio-group style="margin-left: 10px" v-model="selectID" @click="changeSelectId(activeTab.id)" v-log="{ describe: { action: '点击切换执行配置', tabId: activeTab.id } }" :disabled="isSortMode">
|
|
|
|
|
|
|
+ <el-radio-group style="margin-left: 10px" v-model="selectID" @click.native.stop="changeSelectId($event,activeTab.id)" :disabled="isSortMode">
|
|
|
<el-radio :label="activeTab.id">切换成执行配置</el-radio>
|
|
<el-radio :label="activeTab.id">切换成执行配置</el-radio>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</div>
|
|
</div>
|
|
@@ -99,6 +99,7 @@ const clientStore = client();
|
|
|
import socket from "@/stores/modules/socket";
|
|
import socket from "@/stores/modules/socket";
|
|
|
const socketStore = socket(); // WebSocket状态管理实例
|
|
const socketStore = socket(); // WebSocket状态管理实例
|
|
|
|
|
|
|
|
|
|
+import { getTopTabs, getDeviceConfigs,setLeftRightConfig,restConfig,setTabName } from '@/apis/setting'
|
|
|
|
|
|
|
|
// 表格数据和对话框状态
|
|
// 表格数据和对话框状态
|
|
|
const tableData = ref([]); // 配置表格数据
|
|
const tableData = ref([]); // 配置表格数据
|
|
@@ -149,32 +150,23 @@ watch(() => topsTab.value, (newTab) => {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const getTopList = ()=>{
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.getDeviceTabs);
|
|
|
|
|
- clientStore.ipc.send(icpList.setting.getDeviceTabs, {
|
|
|
|
|
|
|
+const getTopList = async ()=>{
|
|
|
|
|
+ const result = await getTopTabs({
|
|
|
type: topsTab.value == 'left' ? 0 :1
|
|
type: topsTab.value == 'left' ? 0 :1
|
|
|
})
|
|
})
|
|
|
- clientStore.ipc.on(icpList.setting.getDeviceTabs, (event, result) => {
|
|
|
|
|
- console.log('getDeviceTabs')
|
|
|
|
|
- console.log(topsTab.value)
|
|
|
|
|
- console.log(result)
|
|
|
|
|
- if(result.code == 0 && result.data){
|
|
|
|
|
- tabs.value = result.data.tabs
|
|
|
|
|
- tabs.value.some(item=>{
|
|
|
|
|
- console.log('=======' )
|
|
|
|
|
- console.log(item.id )
|
|
|
|
|
- console.log(result.data.select_configs[topsTab.value] )
|
|
|
|
|
- if(item.id === result.data.select_configs[topsTab.value]){
|
|
|
|
|
- selectID.value = item.id
|
|
|
|
|
- activeTab.value = item
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
|
|
|
- getList()
|
|
|
|
|
- }
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.getDeviceTabs);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if(result.code == 0 && result.data){
|
|
|
|
|
+ tabs.value = result.data.tabs
|
|
|
|
|
+ tabs.value.some(item=>{
|
|
|
|
|
+ if(item.id === result.data.select_configs[topsTab.value]){
|
|
|
|
|
+ selectID.value = item.id
|
|
|
|
|
+ activeTab.value = item
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ getList()
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -191,60 +183,43 @@ const calibrationId = ref(null) //校准位
|
|
|
/**
|
|
/**
|
|
|
* 获取设备配置列表。
|
|
* 获取设备配置列表。
|
|
|
*/
|
|
*/
|
|
|
-const getList = () => {
|
|
|
|
|
|
|
+const getList = async () => {
|
|
|
// 如果正在排序模式,先退出
|
|
// 如果正在排序模式,先退出
|
|
|
if (isSortMode.value) {
|
|
if (isSortMode.value) {
|
|
|
exitSortMode();
|
|
exitSortMode();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.getDeviceConfigList);
|
|
|
|
|
let params = {
|
|
let params = {
|
|
|
tab_id: activeTab.value.id
|
|
tab_id: activeTab.value.id
|
|
|
}
|
|
}
|
|
|
- clientStore.ipc.send(icpList.setting.getDeviceConfigList, params);
|
|
|
|
|
- clientStore.ipc.on(icpList.setting.getDeviceConfigList, (event, result) => {
|
|
|
|
|
- console.log('getDeviceConfigList')
|
|
|
|
|
- console.log(params)
|
|
|
|
|
- console.log(result)
|
|
|
|
|
- if (result.code == 0) {
|
|
|
|
|
- tableData.value = result.data.list;
|
|
|
|
|
- const calibration = result.data.list.filter(item=>(item.action_name === '侧视'))
|
|
|
|
|
- if(calibration.length >= 1){
|
|
|
|
|
- calibrationId.value = calibration[0].id
|
|
|
|
|
- }else{
|
|
|
|
|
|
|
+ const result = await getDeviceConfigs(params)
|
|
|
|
|
|
|
|
- calibrationId.value = tableData.value[0].id
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- ElMessage.error('获取列表失败');
|
|
|
|
|
|
|
+ if (result.code == 0) {
|
|
|
|
|
+ tableData.value = result.data.list;
|
|
|
|
|
+ const calibration = result.data.list.filter(item=>(item.action_name === '侧视'))
|
|
|
|
|
+ if(calibration.length >= 1){
|
|
|
|
|
+ calibrationId.value = calibration[0].id
|
|
|
|
|
+ }else{
|
|
|
|
|
+
|
|
|
|
|
+ calibrationId.value = tableData.value[0].id
|
|
|
}
|
|
}
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.getDeviceConfigList);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
-const changeSelectId = (id)=>{
|
|
|
|
|
|
|
+const changeSelectId = async (e,id)=>{
|
|
|
|
|
+ if (e.target.tagName === 'INPUT') return;
|
|
|
if (isSortMode.value) return; // 排序模式下禁用
|
|
if (isSortMode.value) return; // 排序模式下禁用
|
|
|
if(id === selectID.value) return;
|
|
if(id === selectID.value) return;
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.updateLeftRightConfig);
|
|
|
|
|
let params = {
|
|
let params = {
|
|
|
type: topsTab.value,
|
|
type: topsTab.value,
|
|
|
id,
|
|
id,
|
|
|
}
|
|
}
|
|
|
- clientStore.ipc.send(icpList.setting.updateLeftRightConfig, params);
|
|
|
|
|
- clientStore.ipc.on(icpList.setting.updateLeftRightConfig, (event, result) => {
|
|
|
|
|
- console.log('updateLeftRightConfig')
|
|
|
|
|
- console.log(params)
|
|
|
|
|
- console.log(result)
|
|
|
|
|
- if (result.code == 0) {
|
|
|
|
|
- selectID.value = id;
|
|
|
|
|
- } else if(result.mssg){
|
|
|
|
|
- ElMessage.error(result.mssg);
|
|
|
|
|
- }else{
|
|
|
|
|
- ElMessage.error('切换失败');
|
|
|
|
|
- }
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.updateLeftRightConfig);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const result = await setLeftRightConfig(params)
|
|
|
|
|
+ if (result.code == 0) {
|
|
|
|
|
+ selectID.value = id;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -301,22 +276,16 @@ const resetConfig = () => {
|
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
type: 'warning'
|
|
|
- }).then(() => {
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.resetDeviceConfig);
|
|
|
|
|
- clientStore.ipc.send(icpList.setting.resetDeviceConfig, {
|
|
|
|
|
|
|
+ }).then(async () => {
|
|
|
|
|
+
|
|
|
|
|
+ const result = await restConfig({
|
|
|
tab_id: activeTab.value.id
|
|
tab_id: activeTab.value.id
|
|
|
- });
|
|
|
|
|
- clientStore.ipc.on(icpList.setting.resetDeviceConfig, (event, result) => {
|
|
|
|
|
- if (result.code == 0) {
|
|
|
|
|
- getList();
|
|
|
|
|
- ElMessage.success('重置成功');
|
|
|
|
|
- } else if(result.mssg){
|
|
|
|
|
- ElMessage.error(result.mssg);
|
|
|
|
|
- } else {
|
|
|
|
|
- ElMessage.error('重置失败');
|
|
|
|
|
- }
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.resetDeviceConfig);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ if (result.code == 0) {
|
|
|
|
|
+ getList();
|
|
|
|
|
+ ElMessage.success('重置成功');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -335,28 +304,23 @@ const reName = ()=>{
|
|
|
return true;
|
|
return true;
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
- .then(({ value }) => {
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.updateTabName);
|
|
|
|
|
- clientStore.ipc.send(icpList.setting.updateTabName, {
|
|
|
|
|
|
|
+ .then(async ({ value }) => {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ const result = await setTabName({
|
|
|
id: activeTab.value.id,
|
|
id: activeTab.value.id,
|
|
|
mode_name:value,
|
|
mode_name:value,
|
|
|
- });
|
|
|
|
|
- clientStore.ipc.on(icpList.setting.updateTabName, (event, result) => {
|
|
|
|
|
- if (result.code == 0) {
|
|
|
|
|
- activeTab.value.mode_name = value
|
|
|
|
|
- tabs.value.some(item=>{
|
|
|
|
|
- if(item.id === activeTab.value.id){
|
|
|
|
|
- item.mode_name = activeTab.value.mode_name
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- ElMessage.success('重命名成功');
|
|
|
|
|
- } else if(result.mssg){
|
|
|
|
|
- ElMessage.error(result.mssg);
|
|
|
|
|
- }else {
|
|
|
|
|
- ElMessage.error('重命名失败');
|
|
|
|
|
- }
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.updateTabName);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ if (result.code == 0) {
|
|
|
|
|
+ activeTab.value.mode_name = value
|
|
|
|
|
+ tabs.value.some(item=>{
|
|
|
|
|
+ if(item.id === activeTab.value.id){
|
|
|
|
|
+ item.mode_name = activeTab.value.mode_name
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ ElMessage.success('重命名成功');
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -588,10 +552,22 @@ const exitSortMode = () => {
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.top_tabs {
|
|
.top_tabs {
|
|
|
- height: 30px;
|
|
|
|
|
|
|
+ height: 40px;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
border: 1px solid #c8c8c8;
|
|
border: 1px solid #c8c8c8;
|
|
|
border-bottom: none;
|
|
border-bottom: none;
|
|
|
|
|
+ ::v-deep {
|
|
|
|
|
+ .el-tabs__item {
|
|
|
|
|
+ height: 40px;
|
|
|
|
|
+ line-height: 40px;
|
|
|
|
|
+ padding: 0 15px;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ &.is-active {
|
|
|
|
|
+ color: #2957FF;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.two_tabs {
|
|
.two_tabs {
|
|
|
width: 100%;
|
|
width: 100%;
|