|
@@ -90,42 +90,8 @@
|
|
|
</div>
|
|
</div>
|
|
|
<!--其他设置-->
|
|
<!--其他设置-->
|
|
|
<div class="selectBox" style="padding-top: 0px;padding-left: 0;" v-if="activeIndex === 4">
|
|
<div class="selectBox" style="padding-top: 0px;padding-left: 0;" v-if="activeIndex === 4">
|
|
|
- <el-tabs v-model="activeTab" type="card">
|
|
|
|
|
- <el-tab-pane label="执行左脚程序" name="left">
|
|
|
|
|
- </el-tab-pane>
|
|
|
|
|
- <el-tab-pane label="执行右脚程序" name="right"></el-tab-pane>
|
|
|
|
|
- </el-tabs>
|
|
|
|
|
- <div class="form-table">
|
|
|
|
|
- <div class="btnBox">
|
|
|
|
|
- <div class="primary-btn" @click="addRow">新增一行</div>
|
|
|
|
|
- <div class="normal-btn" @click="resetConfig">重新初始化</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <el-table max-height="700" :data="activeTab === 'left' ? lefttableData : righttableData" style="width: 100%" border>
|
|
|
|
|
- <el-table-column prop="id" label="id" />
|
|
|
|
|
- <el-table-column prop="action_name" label="步骤" />
|
|
|
|
|
- <el-table-column prop="take_picture" label="是否拍照" width="200px">
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <el-radio-group v-model="scope.row.take_picture" v-if="!scope.row.is_system">
|
|
|
|
|
- <el-radio :label="true">拍照</el-radio>
|
|
|
|
|
- <el-radio :label="false">不拍照</el-radio>
|
|
|
|
|
- </el-radio-group>
|
|
|
|
|
- <span v-else></span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
-<!-- <el-table-column prop="action_index" label="排序" >
|
|
|
|
|
- <template #default="{row, $index}">
|
|
|
|
|
- <a v-if="$index !== 0" class="cursor-pointer" @click="upRow(row)">上移</a>
|
|
|
|
|
- <a class="mar-left-10 cursor-pointer" v-if="$index !== activeTab === 'left' ? lefttableData.length - 1 : righttableData.length - 1" @click="downRow(row)">下移</a>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>-->
|
|
|
|
|
- <el-table-column prop="value" label="操作" >
|
|
|
|
|
- <template #default="{row, $index}">
|
|
|
|
|
- <a class="mar-right-10 cursor-pointer" @click="editRow(row, $index)">编辑</a>
|
|
|
|
|
- <a class="cursor-pointer" v-if="!row.is_system" @click="deleteRow(row, $index)">删除</a>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <actionConfig/>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="text-center mt-8">
|
|
<div class="text-center mt-8">
|
|
@@ -134,13 +100,6 @@
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <EditDialog
|
|
|
|
|
- v-if="dialogVisible"
|
|
|
|
|
- v-model="dialogVisible"
|
|
|
|
|
- :id="editId"
|
|
|
|
|
- :addRowData="addRowData"
|
|
|
|
|
- @confirm="getList"
|
|
|
|
|
- />
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -156,7 +115,6 @@ import { useRoute, useRouter } from 'vue-router';
|
|
|
import { onMounted, watch } from 'vue';
|
|
import { onMounted, watch } from 'vue';
|
|
|
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 EditDialog from './components/EditDialog'
|
|
|
|
|
import client from "@/stores/modules/client";
|
|
import client from "@/stores/modules/client";
|
|
|
import icpList from '@/utils/ipc';
|
|
import icpList from '@/utils/ipc';
|
|
|
const clientStore = client();
|
|
const clientStore = client();
|
|
@@ -164,6 +122,7 @@ import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
import { digiCamControlWEB } from '@/utils/appconfig'
|
|
import { digiCamControlWEB } from '@/utils/appconfig'
|
|
|
import { useCheckInfo } from '@/composables/userCheck';
|
|
import { useCheckInfo } from '@/composables/userCheck';
|
|
|
import { preview } from '@planckdev/element-plus/utils'
|
|
import { preview } from '@planckdev/element-plus/utils'
|
|
|
|
|
+import actionConfig from './components/action_config.vue'
|
|
|
useCheckInfo();
|
|
useCheckInfo();
|
|
|
|
|
|
|
|
// 路由和状态管理初始化
|
|
// 路由和状态管理初始化
|
|
@@ -271,6 +230,7 @@ const deviceSpeedList = ref([
|
|
|
{ label: '二档', value: '2' },
|
|
{ label: '二档', value: '2' },
|
|
|
{ label: '三档', value: '3' },
|
|
{ label: '三档', value: '3' },
|
|
|
]);
|
|
]);
|
|
|
|
|
+/*
|
|
|
const runModeList = ref([
|
|
const runModeList = ref([
|
|
|
{ label: '普通模式', value: '普通模式' },
|
|
{ label: '普通模式', value: '普通模式' },
|
|
|
{ label: '待用户确认模式', value: '待用户确认模式' }
|
|
{ label: '待用户确认模式', value: '待用户确认模式' }
|
|
@@ -300,16 +260,7 @@ const downList = ref([
|
|
|
{ label: '下移', value: '2' },
|
|
{ label: '下移', value: '2' },
|
|
|
{ label: '左右移', value: '3' },
|
|
{ label: '左右移', value: '3' },
|
|
|
]);
|
|
]);
|
|
|
-
|
|
|
|
|
-// 表格数据和对话框状态
|
|
|
|
|
-const lefttableData = ref([]); // 左脚配置表格数据
|
|
|
|
|
-const righttableData = ref([]); // 右脚配置表格数据
|
|
|
|
|
-const dialogVisible = ref(false); // 编辑对话框可见状态
|
|
|
|
|
-const editTitle = ref(''); // 编辑对话框标题
|
|
|
|
|
-const addRowData = ref({}); // 新增行
|
|
|
|
|
-const activeTab = ref('left'); // 当前激活的标签页
|
|
|
|
|
-const editId = ref(0); // 当前编辑行的索引
|
|
|
|
|
-const isDefault = ref(false); // 是否为默认配置
|
|
|
|
|
|
|
+*/
|
|
|
|
|
|
|
|
const indexKey ={
|
|
const indexKey ={
|
|
|
0:"basic_configs",
|
|
0:"basic_configs",
|
|
@@ -326,20 +277,8 @@ watch(() => route.query.type, async (newType,oldType) => {
|
|
|
await saveSetting(oldType)
|
|
await saveSetting(oldType)
|
|
|
}
|
|
}
|
|
|
const typeValue = parseInt(newType) || 0;
|
|
const typeValue = parseInt(newType) || 0;
|
|
|
|
|
+ if(typeValue === 4) return;
|
|
|
switch (typeValue) {
|
|
switch (typeValue) {
|
|
|
- case 4:
|
|
|
|
|
- activeTab.value = 'left';
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.getDeviceConfigList);
|
|
|
|
|
- clientStore.ipc.send(icpList.setting.getDeviceConfigList, {
|
|
|
|
|
- mode_type: '执行左脚程序'
|
|
|
|
|
- });
|
|
|
|
|
- clientStore.ipc.on(icpList.setting.getDeviceConfigList, (event, result) => {
|
|
|
|
|
- if (result?.data?.list) {
|
|
|
|
|
- lefttableData.value = result.data.list;
|
|
|
|
|
- }
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.getDeviceConfigList);
|
|
|
|
|
- });
|
|
|
|
|
- break;
|
|
|
|
|
default:
|
|
default:
|
|
|
clientStore.ipc.removeAllListeners(icpList.setting.getSysConfig);
|
|
clientStore.ipc.removeAllListeners(icpList.setting.getSysConfig);
|
|
|
clientStore.ipc.send(icpList.setting.getSysConfig,{
|
|
clientStore.ipc.send(icpList.setting.getSysConfig,{
|
|
@@ -357,34 +296,6 @@ watch(() => route.query.type, async (newType,oldType) => {
|
|
|
}
|
|
}
|
|
|
}, { immediate: true });
|
|
}, { immediate: true });
|
|
|
|
|
|
|
|
-/**
|
|
|
|
|
- * 监听activeTab变化,获取对应标签页的设备配置列表。
|
|
|
|
|
- */
|
|
|
|
|
-watch(() => activeTab.value, (newTab) => {
|
|
|
|
|
- if (newTab === 'left') {
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.getDeviceConfigList);
|
|
|
|
|
- clientStore.ipc.send(icpList.setting.getDeviceConfigList, {
|
|
|
|
|
- mode_type: '执行左脚程序'
|
|
|
|
|
- });
|
|
|
|
|
- clientStore.ipc.on(icpList.setting.getDeviceConfigList, (event, result) => {
|
|
|
|
|
- if (result?.data?.list) {
|
|
|
|
|
- lefttableData.value = result.data.list;
|
|
|
|
|
- }
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.getDeviceConfigList);
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.getDeviceConfigList);
|
|
|
|
|
- clientStore.ipc.send(icpList.setting.getDeviceConfigList, {
|
|
|
|
|
- mode_type: '执行右脚程序'
|
|
|
|
|
- });
|
|
|
|
|
- clientStore.ipc.on(icpList.setting.getDeviceConfigList, (event, result) => {
|
|
|
|
|
- if (result?.data?.list) {
|
|
|
|
|
- righttableData.value = result.data.list;
|
|
|
|
|
- }
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.getDeviceConfigList);
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-});
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 监听activeIndex变化,更新URL中的查询参数。
|
|
* 监听activeIndex变化,更新URL中的查询参数。
|
|
@@ -413,18 +324,6 @@ onMounted(() => {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 打开文件夹选择对话框并更新表单数据。
|
|
|
|
|
- */
|
|
|
|
|
-const selectFolder = () => {
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
|
|
|
|
|
- clientStore.ipc.send(icpList.utils.openDirectory);
|
|
|
|
|
- clientStore.ipc.on(icpList.utils.openDirectory, async (event, result) => {
|
|
|
|
|
- formData.captureOneFolder = result;
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.utils.openDirectory);
|
|
|
|
|
- });
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
* 保存当前表单配置。
|
|
* 保存当前表单配置。
|
|
|
*/
|
|
*/
|
|
|
const saveSetting = async (index) => {
|
|
const saveSetting = async (index) => {
|
|
@@ -457,132 +356,6 @@ const saveSetting = async (index) => {
|
|
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/**
|
|
|
|
|
- * 新增一行配置。
|
|
|
|
|
- */
|
|
|
|
|
-const addRow = () => {
|
|
|
|
|
- if (activeTab.value === 'left') {
|
|
|
|
|
- editId.value = -1
|
|
|
|
|
- addRowData.value = {
|
|
|
|
|
- mode_type: '执行左脚程序',
|
|
|
|
|
- action_name: '',
|
|
|
|
|
- take_picture: false,
|
|
|
|
|
- camera_height: 0,
|
|
|
|
|
- camera_angle: 0,
|
|
|
|
|
- turntable_position: 0,
|
|
|
|
|
- turntable_angle: 0,
|
|
|
|
|
- shoe_upturn: false,
|
|
|
|
|
- led_switch: false,
|
|
|
|
|
- number_focus: 0,
|
|
|
|
|
- pre_delay: 0,
|
|
|
|
|
- after_delay: 0,
|
|
|
|
|
- };
|
|
|
|
|
- dialogVisible.value = true;
|
|
|
|
|
- editTitle.value = '新增步骤';
|
|
|
|
|
- } else {
|
|
|
|
|
- editId.value = -1
|
|
|
|
|
- addRowData.value = {
|
|
|
|
|
- mode_type: '执行右脚程序',
|
|
|
|
|
- action_name: '',
|
|
|
|
|
- take_picture: false,
|
|
|
|
|
- camera_height: 0,
|
|
|
|
|
- camera_angle: 0,
|
|
|
|
|
- turntable_position: 0,
|
|
|
|
|
- turntable_angle: 0,
|
|
|
|
|
- shoe_upturn: false,
|
|
|
|
|
- led_switch: false,
|
|
|
|
|
- number_focus: 0,
|
|
|
|
|
- pre_delay: 0,
|
|
|
|
|
- after_delay: 0,
|
|
|
|
|
- };
|
|
|
|
|
- dialogVisible.value = true;
|
|
|
|
|
- editTitle.value = '新增步骤';
|
|
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
- * 获取设备配置列表。
|
|
|
|
|
- */
|
|
|
|
|
-const getList = () => {
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.getDeviceConfigList);
|
|
|
|
|
- clientStore.ipc.send(icpList.setting.getDeviceConfigList, {
|
|
|
|
|
- mode_type: activeTab.value === 'left' ? '执行左脚程序' : '执行右脚程序'
|
|
|
|
|
- });
|
|
|
|
|
- clientStore.ipc.on(icpList.setting.getDeviceConfigList, (event, result) => {
|
|
|
|
|
- if (result.code == 0) {
|
|
|
|
|
- if (activeTab.value === 'left') {
|
|
|
|
|
- lefttableData.value = result.data.list;
|
|
|
|
|
- } else {
|
|
|
|
|
- righttableData.value = result.data.list;
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- ElMessage.error('获取列表失败');
|
|
|
|
|
- }
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.getDeviceConfigList);
|
|
|
|
|
- });
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
- * 编辑指定行的配置。
|
|
|
|
|
- * @param {Object} row - 当前行的数据
|
|
|
|
|
- * @param {number} index - 当前行的索引
|
|
|
|
|
- */
|
|
|
|
|
-const editRow = (row, index) => {
|
|
|
|
|
- dialogVisible.value = true;
|
|
|
|
|
- editId.value = row.id
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
- * 删除指定行的配置。
|
|
|
|
|
- * @param {Object} row - 当前行的数据
|
|
|
|
|
- * @param {number} index - 当前行的索引
|
|
|
|
|
- */
|
|
|
|
|
-const deleteRow = (row, index) => {
|
|
|
|
|
- ElMessageBox.confirm('确定删除该步骤吗?', '提示', {
|
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
- type: 'warning'
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- clientStore.ipc.send(icpList.setting.removeDeviceConfig, {
|
|
|
|
|
- id: row.id
|
|
|
|
|
- });
|
|
|
|
|
- clientStore.ipc.on(icpList.setting.removeDeviceConfig, (event, result) => {
|
|
|
|
|
- if (result.code == 0) {
|
|
|
|
|
- getList();
|
|
|
|
|
- ElMessage.success('删除成功');
|
|
|
|
|
- } else {
|
|
|
|
|
- ElMessage.error('删除失败');
|
|
|
|
|
- }
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.removeDeviceConfig);
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
- * 重置设备配置。
|
|
|
|
|
- */
|
|
|
|
|
-const resetConfig = () => {
|
|
|
|
|
- ElMessageBox.confirm(`确定初始化执行${activeTab.value === 'left' ? '左脚' : '右脚'}程序吗?`, '提示', {
|
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
- type: 'warning'
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- clientStore.ipc.send(icpList.setting.resetDeviceConfig, {
|
|
|
|
|
- mode_type: activeTab.value === 'left' ? '执行左脚程序' : '执行右脚程序'
|
|
|
|
|
- });
|
|
|
|
|
- clientStore.ipc.on(icpList.setting.resetDeviceConfig, (event, result) => {
|
|
|
|
|
- if (result.code == 0) {
|
|
|
|
|
- getList();
|
|
|
|
|
- ElMessage.success('重置成功');
|
|
|
|
|
- } else {
|
|
|
|
|
- ElMessage.error('重置失败');
|
|
|
|
|
- }
|
|
|
|
|
- clientStore.ipc.removeAllListeners(icpList.setting.resetDeviceConfig);
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
</script>
|
|
@@ -743,94 +516,6 @@ body {
|
|
|
padding: 30px 0;
|
|
padding: 30px 0;
|
|
|
height: 100px;
|
|
height: 100px;
|
|
|
}
|
|
}
|
|
|
-.form-table{
|
|
|
|
|
- margin-top: 10px;
|
|
|
|
|
- .btnBox{
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- margin-bottom: 12px;
|
|
|
|
|
- }
|
|
|
|
|
- :deep(.el-table .el-table__header){
|
|
|
|
|
- padding: 0;
|
|
|
|
|
- height: 30px;
|
|
|
|
|
- .el-table__cell{
|
|
|
|
|
- background: #F1F4FF;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- :deep(.el-table .el-table__cell){
|
|
|
|
|
- padding: 0;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- }
|
|
|
|
|
- :deep(.el-table__row) {
|
|
|
|
|
- height: 30px;
|
|
|
|
|
- padding: 0;
|
|
|
|
|
- &:nth-child(even) {
|
|
|
|
|
- background: #F1F4FF;
|
|
|
|
|
- }
|
|
|
|
|
- &:nth-child(odd) {
|
|
|
|
|
- background: #FFFFFF;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- .primary-btn{
|
|
|
|
|
- width: 80px;
|
|
|
|
|
- height: 30px;
|
|
|
|
|
- background: linear-gradient( 135deg, #2FB0FF 0%, #B863FB 100%);
|
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
- color: #fff;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- line-height: 30px;
|
|
|
|
|
- margin-right: 10px;
|
|
|
|
|
- }
|
|
|
|
|
- .normal-btn{
|
|
|
|
|
- width: 80px;
|
|
|
|
|
- height: 30px;
|
|
|
|
|
- background: #fff;
|
|
|
|
|
- border: 1px solid #CCCCCC;
|
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- line-height: 30px;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- }
|
|
|
|
|
- .cursor-pointer{
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-.editDialog{
|
|
|
|
|
- .el-dialog__body{
|
|
|
|
|
- padding: 0 !important;
|
|
|
|
|
- }
|
|
|
|
|
- .btn-row{
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: flex-end;
|
|
|
|
|
- gap: 10px;
|
|
|
|
|
- }
|
|
|
|
|
- .primary-btn{
|
|
|
|
|
- width: 100px;
|
|
|
|
|
- height: 30px;
|
|
|
|
|
- background: linear-gradient( 135deg, #2FB0FF 0%, #B863FB 100%);
|
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
- color: #fff;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- line-height: 30px;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- }
|
|
|
|
|
- .normal-btn{
|
|
|
|
|
- width: 100px;
|
|
|
|
|
- height: 30px;
|
|
|
|
|
- background: #fff;
|
|
|
|
|
- border: 1px solid #CCCCCC;
|
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- line-height: 30px;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
.config-type{
|
|
.config-type{
|
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
|
color: #333333;
|
|
color: #333333;
|