fix(网关调试): 调整南向北向逻辑
This commit is contained in:
parent
8e832298ec
commit
9b16a3bd58
|
@ -4,3 +4,4 @@ out
|
|||
*.log*
|
||||
/dist/
|
||||
/dist.zip
|
||||
.idea
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/node_modules" />
|
||||
</content>
|
||||
<content url="file://$MODULE_DIR$/node_modules" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<!-- http-equiv="Content-Security-Policy"-->
|
||||
<!-- content="default-src 'self'; connect-src 'self' *; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:"-->
|
||||
<!-- />-->
|
||||
<script type="text/javascript" src="./videoplayer/EasyPlayer-element.min.js"></script>
|
||||
<script type="text/javascript" src="/videoplayer/EasyPlayer-element.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -16,22 +16,22 @@
|
|||
// wsUrl: 'ws://127.0.0.1:8000'
|
||||
// }
|
||||
|
||||
// export default {
|
||||
// url: 'http://127.0.0.1:8888',
|
||||
// wsUrl: 'ws://127.0.0.1:8888',
|
||||
// swichWsUrl: 'ws://127.0.0.1:8001',
|
||||
// serialPortUrl: 'http://127.0.0.1:8888',
|
||||
//
|
||||
// // 远程连接串口使用
|
||||
// // serialPortUrl: 'http://120.77.172.42:7202',
|
||||
// // serialPortUrl: 'http://192.168.1.17:8888',
|
||||
// }
|
||||
export default {
|
||||
url: 'http://127.0.0.1:8888',
|
||||
wsUrl: 'ws://127.0.0.1:8888',
|
||||
swichWsUrl: 'ws://127.0.0.1:8001',
|
||||
serialPortUrl: 'http://127.0.0.1:8888',
|
||||
|
||||
// 远程连接串口使用
|
||||
// serialPortUrl: 'http://120.77.172.42:7202',
|
||||
// serialPortUrl: 'http://192.168.1.17:8888',
|
||||
}
|
||||
|
||||
|
||||
// 手动配置的地址
|
||||
export default {
|
||||
url: 'http://192.168.1.17:8000',
|
||||
wsUrl: 'ws://192.168.1.17:8000',
|
||||
swichWsUrl: 'ws://192.168.1.17:8001',
|
||||
serialPortUrl: 'http://127.0.0.1:8888',
|
||||
}
|
||||
// export default {
|
||||
// url: 'http://192.168.1.17:8000',
|
||||
// wsUrl: 'ws://192.168.1.17:8000',
|
||||
// swichWsUrl: 'ws://192.168.1.17:8001',
|
||||
// serialPortUrl: 'http://127.0.0.1:8888',
|
||||
// }
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
<el-switch v-model="scope.row.pushConf.isUseResumeBrokenTransfer" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="protocol.params.linkPar" label="设备地址" >
|
||||
<el-table-column prop="tasks" label="任务ID" >
|
||||
<template #default="scope">
|
||||
{{scope.row.tasks?scope.row.tasks.join():''}}
|
||||
</template>
|
||||
|
@ -97,9 +97,10 @@
|
|||
empty-text="配置为空"
|
||||
>
|
||||
<el-table-column type="index" label="序号" align="center" width="60" />
|
||||
<el-table-column prop="taskId" label="任务ID" >
|
||||
<el-table-column prop="taskId" label="任务ID" align="center">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.taskId" placeholder="请输入任务ID" />
|
||||
{{scope.row.taskId}}
|
||||
<!-- <el-input v-model="scope.row.taskId" placeholder="请输入任务ID" />-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="uploadMode" label="上报策略" >
|
||||
|
@ -120,7 +121,7 @@
|
|||
<h2>上报测点{{activeDeviceConfig.taskId}}</h2>
|
||||
<div class="table-box">
|
||||
<el-table
|
||||
:data="activeDeviceConfig.dataId_entire"
|
||||
:data="activeDeviceConfig.dataIdEntire"
|
||||
border
|
||||
size="small"
|
||||
height="100%"
|
||||
|
@ -130,8 +131,8 @@
|
|||
>
|
||||
<el-table-column type="index" label="序号" align="center" width="60" fixed />
|
||||
<el-table-column prop="equipId" label="设备ID" align="center"/>
|
||||
<el-table-column prop="idInfo.id" label="数据ID" align="center"/>
|
||||
<el-table-column prop="idInfo.uploadMode" label="上报策略" align="center"/>
|
||||
<el-table-column prop="idInfo[0].id" label="数据ID" align="center"/>
|
||||
<el-table-column prop="idInfo[0].uploadMode" label="上报策略" align="center"/>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -288,209 +289,11 @@ const createFilter = (queryString) => {
|
|||
}
|
||||
//北向任务列表(后面换请求获取)
|
||||
const taskList = ref([
|
||||
{
|
||||
"dataId_entire": [
|
||||
{
|
||||
"equipId": "dev102",
|
||||
"idInfo": [{ "id": "", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
},
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "as", "uploadMode": "timer 10 || change 10" }]
|
||||
}
|
||||
],
|
||||
"taskId": "T1",
|
||||
"taskType": "",
|
||||
"uploadMode": "timer 1 || change 0.1"
|
||||
},
|
||||
{
|
||||
"dataId_entire": [
|
||||
{
|
||||
"equipId": "dev103",
|
||||
"idInfo": [{ "id": "xc", "uploadMode": "" }]
|
||||
}
|
||||
],
|
||||
"taskId": "T2",
|
||||
"taskType": "",
|
||||
"uploadMode": "timer 10 || change 1"
|
||||
},
|
||||
{
|
||||
"dataId_entire": [],
|
||||
"taskId": "T3",
|
||||
"taskType": "",
|
||||
"uploadMode": "timer 120 || change 0.1"
|
||||
},
|
||||
{
|
||||
"dataId_entire": [],
|
||||
"taskId": "T4",
|
||||
"taskType": "",
|
||||
"uploadMode": "timer 120 || change 1"
|
||||
},
|
||||
{
|
||||
"dataId_entire": [],
|
||||
"taskId": "T5",
|
||||
"taskType": "",
|
||||
"uploadMode": "timer 120 || change 3"
|
||||
}
|
||||
]);
|
||||
const platConfigTableRef = ref();
|
||||
const deviceDataTableRef = ref();
|
||||
const tabelBox = ref(884)
|
||||
const platConfigList = ref([])
|
||||
// const platConfigList = ref([
|
||||
// {
|
||||
// // 平台IP地址
|
||||
// "PlatformIp": "",
|
||||
// // 任务列表
|
||||
// "tasks": [
|
||||
// "T1",
|
||||
// "T2",
|
||||
// "T3",
|
||||
// "T4",
|
||||
// "T5"
|
||||
// ],
|
||||
// // 平台类型
|
||||
// "type": "",
|
||||
// // MQTT配置
|
||||
// "mqtt": {
|
||||
// // MQTT用户名
|
||||
// "user": "",
|
||||
// // MQTT密码
|
||||
// "passwd": "",
|
||||
// // 是否使用SSL
|
||||
// "isUseSsl": false,
|
||||
// // 是否使用SSL配置
|
||||
// "isUseSslConf": false,
|
||||
// // SSL配置
|
||||
// "sslConf": {
|
||||
// // 本地证书文件
|
||||
// "localCertificate_file": "/etc/custom/sslConf/pupu_core_3501000001.pem",
|
||||
// // 私钥文件
|
||||
// "privateKey_file": "/etc/custom/sslConf/pupu_core_3501000001.prv"
|
||||
// }
|
||||
// },
|
||||
// // 推送配置
|
||||
// "pushConf": {
|
||||
// // 是否运行推送
|
||||
// "isRun": true,
|
||||
// // 是否使用断点续传
|
||||
// "isUseResumeBrokenTransfer": false,
|
||||
// // 断点续传配置
|
||||
// "broken": {
|
||||
// // 续传间隔时间(毫秒)
|
||||
// "resume": {
|
||||
// "intervalTime_ms": 1000
|
||||
// },
|
||||
// // 过滤配置
|
||||
// "filter": {
|
||||
// // 过滤时间窗口(秒)
|
||||
// "filter_s": 600,
|
||||
// // 相关任务ID列表
|
||||
// "relevanceTaskId": [
|
||||
// "T1",
|
||||
// "T2",
|
||||
// "T3",
|
||||
// "T4",
|
||||
// "T5"
|
||||
// ]
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// // 加密解密配置
|
||||
// "encrypt_decrypt": {
|
||||
// // 加密配置
|
||||
// "encrypt_1": {
|
||||
// // 加密算法
|
||||
// "algorithm": "AES",
|
||||
// // 加密参数
|
||||
// "param": {
|
||||
// "mode": "CBC",
|
||||
// "key": "0123456789abcdef",
|
||||
// "ivec": "0123456789abcdef",
|
||||
// "bits": 128
|
||||
// },
|
||||
// // 是否启用加密
|
||||
// "enable": false
|
||||
// },
|
||||
// // 解密配置
|
||||
// "decrypt_1": {
|
||||
// // 解密算法
|
||||
// "algorithm": "AES",
|
||||
// // 解密参数
|
||||
// "param": {
|
||||
// "mode": "CBC",
|
||||
// "key": "0123456789abcdef",
|
||||
// "ivec": "0123456789abcdef",
|
||||
// "bits": 128
|
||||
// },
|
||||
// // 是否启用解密
|
||||
// "enable": false
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// ]);
|
||||
|
||||
const activeTaskIndex = ref(0);
|
||||
|
||||
const uploadType = ref([
|
||||
{ label: 'DT-MQTT-DEFAULT', value: 'DT-MQTT-DEFAULT'},
|
||||
|
@ -591,18 +394,34 @@ const getDeviceConfig = () => {
|
|||
if (response.data.code == 0) {
|
||||
//缓存上下行主题
|
||||
platConfigList.value = response.data.data.PlatformPar || [];
|
||||
|
||||
taskList.value = response.data.data.tasks.map(item=>{
|
||||
if(item.dataIdEntire!=[]){
|
||||
let dataIdEntireList = [];
|
||||
item.dataIdEntire.forEach(val=>{
|
||||
val.idInfo.forEach(info=>{
|
||||
dataIdEntireList.push({
|
||||
equipId: val.equipId,
|
||||
idInfo:[info]
|
||||
})
|
||||
})
|
||||
})
|
||||
item.dataIdEntire = dataIdEntireList;
|
||||
}
|
||||
return item;
|
||||
}) || [];
|
||||
// taskList.value = taskDataList;
|
||||
console.log("格式化后数据",taskList.value)
|
||||
if(!platConfigList.value.length){
|
||||
addDeviceConfig()
|
||||
}
|
||||
// if(platConfigList.value.length){
|
||||
// if(platConfigList.value.length>ActiveRowIndex.value){
|
||||
// activeDeviceConfig.value = platConfigList.value[ActiveRowIndex.value];
|
||||
// }else{
|
||||
// activeDeviceConfig.value = platConfigList.value[0];
|
||||
// }
|
||||
// }else{
|
||||
// addDeviceConfig()
|
||||
// }
|
||||
if(platConfigList.value.length){
|
||||
if(platConfigList.value.length>ActiveRowIndex.value){
|
||||
activeDeviceConfig.value = platConfigList.value[ActiveRowIndex.value];
|
||||
}else{
|
||||
activeDeviceConfig.value = platConfigList.value[0];
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
ElMessage.error(response.data.message);
|
||||
|
@ -617,7 +436,7 @@ const getDeviceConfig = () => {
|
|||
const setDeviceConfig = () => {
|
||||
console.log('提交配置',platConfigList.value)
|
||||
axios
|
||||
.post(config.url + '/config/platform/add', {PlatformPar: platConfigList.value})
|
||||
.post(config.url + '/config/platform/add', {PlatformPar: platConfigList.value,tasks:taskList.value})
|
||||
.then(response => {
|
||||
// 成功响应后的处理
|
||||
console.log(response); // 打印响应数据
|
||||
|
@ -744,7 +563,7 @@ const activeDeviceConfig = ref({
|
|||
watch(
|
||||
() => ({ ...activeDeviceConfig.value }),
|
||||
(newVal) => {
|
||||
// console.log("数据变化",newVal)
|
||||
console.log("数据变化",newVal)
|
||||
platConfigList.value[ActiveRowIndex.value] = newVal;
|
||||
},
|
||||
{ deep: true }
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue