通讯链路:添加协议配置

This commit is contained in:
高云鹏 2024-08-02 17:36:52 +08:00
parent 210dc5d8ff
commit f098983f8b
3 changed files with 68 additions and 16 deletions

View File

@ -75,15 +75,16 @@
<el-input v-model="searchLinkInput" class="defaultSearchInput tableSearchInput" clearable placeholder="请输入链路名称"></el-input>
<el-button :icon="Search" type="primary" @click="searchLink">查询</el-button>
</div>
<div class="mainHeaderRight">
<el-button :icon="Plus" type="primary" @click="addLinkList">新增</el-button>
<!-- <div class="mainHeaderRight">
<el-button :icon="Plus" type="primary" @click="addLinkList">新增</el-button>
<!-- <el-upload :show-file-list="false" :limit="1">
<el-upload :show-file-list="false" :limit="1">
<template #trigger>
<el-button :icon="Upload">导入</el-button>
</template>
</el-upload>
<el-button :icon="Download">导出</el-button> -->
</div>
<el-button :icon="Download">导出</el-button>
</div> -->
</template>
<template #mainMain>
<el-table :data="linkTableData" class="tablePart" highlight-current-row>
@ -582,12 +583,6 @@ $paginationHeight: 32px;
width: 220px;
}
}
.mainHeaderRight {
display: flex;
justify-content: space-between;
align-items: center;
width: 290px;
}
.tablePart {
height: calc(100% - $paginationHeight);
.el-button {

View File

@ -21,9 +21,9 @@
</template>
</el-popconfirm>
<el-popconfirm @confirm="goToNodePage" title="返回通讯链路">
<el-popconfirm @confirm="goToNodePage" title="确认退出么">
<template #reference>
<el-icon size="22" style="cursor: pointer"><RefreshLeft /></el-icon>
<el-button>退出</el-button>
</template>
</el-popconfirm>
</div>
@ -101,7 +101,7 @@ import { equipQuery, equipType } from '/@/api/backend'
import { ElRow, ElCol, ElButton, ElTree, ElDialog, ElMessage, ElUpload, genFileId } from 'element-plus'
import type { UploadRequestOptions, UploadInstance, UploadProps, UploadRawFile } from 'element-plus'
import type { TreeInstance } from 'element-plus'
import { Delete, RefreshLeft } from '@element-plus/icons-vue'
import { Delete } from '@element-plus/icons-vue'
import {
getMappingListReq,
saveMappingListReq,
@ -467,8 +467,11 @@ const resetExcel = () => {
}
const goToNodePage = () => {
// router.push({ path: route.query.prevPath as string })
router.go(-1)
router.push({ path: route.query.prevPath as string })
// console.log(router.getRoutes());
// router.go(-1)
}
onMounted(() => {
@ -543,7 +546,7 @@ onBeforeUnmount(() => {
display: flex;
justify-content: space-between;
align-items: center;
width: 410px;
width: 470px;
.el-button {
margin: 0;
}

View File

@ -168,6 +168,58 @@ export const excelDefaultConfig: any = {
R0C3: ['01', '02', '03', '04'],
},
},
8: {
//遥测138 ANALOG
138: {
name: '模拟量',
head: [
{
label: '信息体地址',
code: 'ioa',
},
],
},
//遥控147 CONTROL
147: {
name: '遥控量',
head: [
{
label: '信息体地址',
code: 'ioa',
},
],
},
//遥调146 SETPOINT
146: {
name: '遥调量',
head: [
{
label: '信息体地址',
code: 'ioa',
},
],
},
//遥脉139 ACCUMULATOR
139: {
name: '累计量',
head: [
{
label: '信息体地址',
code: 'ioa',
},
],
},
//遥信140 DISCRETE
140: {
name: '离散量',
head: [
{
label: '信息体地址',
code: 'ioa',
},
],
},
},
}
const DEFAULT_WORKBOOK_DATA = {
id: 'workbook-01',
@ -352,6 +404,8 @@ export const createSheetData = (data: any, protocol: string | number) => {
})
const result: any = {}
data[item].forEach((obj: any, index: number) => {
console.log(obj)
const params = obj.params && obj.params !== '' ? JSON.parse(obj.params) : {}
obj = { ...obj, ...params }
const row = index + 1