|
@@ -3,10 +3,10 @@
|
|
|
<el-card class="box-card">
|
|
<el-card class="box-card">
|
|
|
<template #header>
|
|
<template #header>
|
|
|
<div class="card-header">
|
|
<div class="card-header">
|
|
|
- <span>网关管理-新增</span>
|
|
|
|
|
|
|
+ <span>网关管理-{{route.query['type']==1?'编辑':'新增'}}</span>
|
|
|
<div>
|
|
<div>
|
|
|
- <el-button type="warning" @click="">复位</el-button>
|
|
|
|
|
- <el-button type="primary" @click="">保存</el-button>
|
|
|
|
|
|
|
+ <el-button type="warning" @click="initdata">复位</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="savedata">保存</el-button>
|
|
|
<el-button type="primary" plain @click="router.back();">返回</el-button>
|
|
<el-button type="primary" plain @click="router.back();">返回</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -24,7 +24,7 @@
|
|
|
|
|
|
|
|
</template>
|
|
</template>
|
|
|
<div class="content-w">
|
|
<div class="content-w">
|
|
|
- <el-input placeholder="请输入"/>
|
|
|
|
|
|
|
+ <el-input v-model="currentgateway.name" placeholder="请输入"/>
|
|
|
</div>
|
|
</div>
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item>
|
|
<el-descriptions-item>
|
|
@@ -34,7 +34,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<div class="content-w">
|
|
<div class="content-w">
|
|
|
- <el-input placeholder="请输入"/>
|
|
|
|
|
|
|
+ <el-input v-model="currentgateway.sn" placeholder="请输入"/>
|
|
|
</div>
|
|
</div>
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
|
|
|
|
@@ -45,7 +45,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<div class="content-w">
|
|
<div class="content-w">
|
|
|
- <el-input placeholder="请输入"/>
|
|
|
|
|
|
|
+ <el-input v-model="currentgateway.gatewayId" placeholder="请输入"/>
|
|
|
</div>
|
|
</div>
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item >
|
|
<el-descriptions-item >
|
|
@@ -55,7 +55,9 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<div class="content-w">
|
|
<div class="content-w">
|
|
|
- <el-input placeholder="请输入"/>
|
|
|
|
|
|
|
+ <el-select v-model="currentgateway.status">
|
|
|
|
|
+ <el-option v-for="item in gateway_status" :key="item.value" :value="item.value" :label="item.label"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
</div>
|
|
</div>
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
|
|
|
|
@@ -66,7 +68,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<div class="content-w">
|
|
<div class="content-w">
|
|
|
- <el-input placeholder="请输入"/>
|
|
|
|
|
|
|
+ <el-input v-model="currentgateway.remoteManage" placeholder="请输入"/>
|
|
|
</div>
|
|
</div>
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
|
|
|
|
@@ -77,7 +79,9 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<div class="content-w">
|
|
<div class="content-w">
|
|
|
- <el-input placeholder="请输入"/>
|
|
|
|
|
|
|
+ <el-input v-model="currentgateway.flowControl" placeholder="请输入"/><el-select v-model="currentgateway.flowControlType">
|
|
|
|
|
+ <el-option v-for="item in flow_units" :key="item.value" :value="item.value" :label="item.label"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
</div>
|
|
</div>
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
|
|
|
|
@@ -88,7 +92,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<div class="content-w">
|
|
<div class="content-w">
|
|
|
- <el-input placeholder="请输入"/>
|
|
|
|
|
|
|
+ <el-input v-model="currentgateway.belongService" placeholder="请输入"/>
|
|
|
</div>
|
|
</div>
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item >
|
|
<el-descriptions-item >
|
|
@@ -98,31 +102,43 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<div class="content-w">
|
|
<div class="content-w">
|
|
|
- <el-input placeholder="请输入"/>
|
|
|
|
|
|
|
+ <el-input v-model="currentgateway.version" placeholder="请输入"/>
|
|
|
</div>
|
|
</div>
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
|
|
|
|
|
|
|
+ <el-descriptions-item :span="4">
|
|
|
|
|
+ <template #label>
|
|
|
|
|
+ <div style="display: inline-block;min-width: 100px;text-align: right; vertical-align: top;">
|
|
|
|
|
+ <span style="color: red">*</span> 协议
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <div class="content-w" style="min-width: 550px">
|
|
|
|
|
+ <el-select @change="changeProtocalType" v-model="currentgateway.protocalType" placeholder="请选择">
|
|
|
|
|
+ <el-option v-for="item in protocal_type" :key="item.value" :value="parseInt(item.value)" :label="item.label"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <el-select v-if="currentgateway.protocalType!=3" v-model="currentgateway.protocalId" placeholder="请选择">
|
|
|
|
|
+ <el-option v-for="item in protocallist" :key="item.name" :value="item.id" :label="item.protocolName"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
|
|
|
|
- <el-descriptions-item :span="2">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <el-descriptions-item :span="4">
|
|
|
<template #label>
|
|
<template #label>
|
|
|
<div style="display: inline-block;min-width: 100px;text-align: right; vertical-align: top;">
|
|
<div style="display: inline-block;min-width: 100px;text-align: right; vertical-align: top;">
|
|
|
描述
|
|
描述
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<div class="content-w" style="min-width: 550px">
|
|
<div class="content-w" style="min-width: 550px">
|
|
|
- <el-input type="textarea" :line-count="5" show-word-limit maxlength="200" placeholder="请输入描述"/>
|
|
|
|
|
|
|
+ <el-input v-model="currentgateway.description" type="textarea" :line-count="5" show-word-limit maxlength="200" placeholder="请输入描述"/>
|
|
|
</div>
|
|
</div>
|
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
|
|
|
|
|
</el-descriptions>
|
|
</el-descriptions>
|
|
|
|
|
|
|
|
</el-col>
|
|
</el-col>
|
|
|
-
|
|
|
|
|
</el-row>
|
|
</el-row>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
|
|
|
<el-card class="box-card" style="margin-top: 20px">
|
|
<el-card class="box-card" style="margin-top: 20px">
|
|
@@ -138,36 +154,7 @@
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
<el-table :data="tabledata" border>
|
|
<el-table :data="tabledata" border>
|
|
|
- <el-table-column type="selection" width="55" />
|
|
|
|
|
- <el-table-column label="上层位置"></el-table-column>
|
|
|
|
|
- <el-table-column label="设备编码"></el-table-column>
|
|
|
|
|
- <el-table-column label="备用编码"></el-table-column>
|
|
|
|
|
- <el-table-column label="设备名称"></el-table-column>
|
|
|
|
|
- <el-table-column label="设备信息"></el-table-column>
|
|
|
|
|
- <el-table-column label="所属公司"></el-table-column>
|
|
|
|
|
- <el-table-column label="所属组织机构"></el-table-column>
|
|
|
|
|
- <el-table-column label="所属类型"></el-table-column>
|
|
|
|
|
- <el-table-column label="负责人"></el-table-column>
|
|
|
|
|
- <el-table-column label="安装日期"></el-table-column>
|
|
|
|
|
- <el-table-column label="安装地点地址"></el-table-column>
|
|
|
|
|
- <el-table-column label="关联设备Id"></el-table-column>
|
|
|
|
|
- <el-table-column label="标签"></el-table-column>
|
|
|
|
|
- <el-table-column label="状态"></el-table-column>
|
|
|
|
|
- <el-table-column label="保修期结束日期"></el-table-column>
|
|
|
|
|
- <el-table-column label="制造日期"></el-table-column>
|
|
|
|
|
- <el-table-column label="资产编码"></el-table-column>
|
|
|
|
|
- <el-table-column label="资产编号"></el-table-column>
|
|
|
|
|
- <el-table-column label="使用证编号"></el-table-column>
|
|
|
|
|
- <el-table-column label="安全级别"></el-table-column>
|
|
|
|
|
- <el-table-column label="使用年限"></el-table-column>
|
|
|
|
|
- <el-table-column label="变动日期"></el-table-column>
|
|
|
|
|
- <el-table-column label="供货厂家"></el-table-column>
|
|
|
|
|
- <el-table-column label="创建人"></el-table-column>
|
|
|
|
|
- <el-table-column label="创建时间"></el-table-column>
|
|
|
|
|
- <el-table-column label="更新人"></el-table-column>
|
|
|
|
|
- <el-table-column label="更新时间"></el-table-column>
|
|
|
|
|
- <el-table-column label="备注"></el-table-column>
|
|
|
|
|
- <el-table-column label="设备编码"></el-table-column>
|
|
|
|
|
|
|
+ <el-table-column v-for="item in columns.filter(i=>i.visible)" :prop="item.prop" :label="item.label" ></el-table-column>
|
|
|
<el-table-column label="操作" fixed="right" ></el-table-column>
|
|
<el-table-column label="操作" fixed="right" ></el-table-column>
|
|
|
|
|
|
|
|
</el-table>
|
|
</el-table>
|
|
@@ -177,7 +164,10 @@
|
|
|
small
|
|
small
|
|
|
background
|
|
background
|
|
|
layout="prev, pager, next"
|
|
layout="prev, pager, next"
|
|
|
- :total="50"
|
|
|
|
|
|
|
+ :total="pagedata.total"
|
|
|
|
|
+ :page-size="pagedata.size"
|
|
|
|
|
+ :current-page="pagedata.current"
|
|
|
|
|
+ @current-change="onchangepage"
|
|
|
class="mt-4"
|
|
class="mt-4"
|
|
|
/>
|
|
/>
|
|
|
</el-col>
|
|
</el-col>
|
|
@@ -195,47 +185,21 @@
|
|
|
|
|
|
|
|
<el-table height="400px">
|
|
<el-table height="400px">
|
|
|
<el-table-column type="selection" width="55" fixed="left" />
|
|
<el-table-column type="selection" width="55" fixed="left" />
|
|
|
- <el-table-column label="上层位置"></el-table-column>
|
|
|
|
|
- <el-table-column label="设备编码"></el-table-column>
|
|
|
|
|
- <el-table-column label="备用编码"></el-table-column>
|
|
|
|
|
- <el-table-column label="设备名称"></el-table-column>
|
|
|
|
|
- <el-table-column label="设备信息"></el-table-column>
|
|
|
|
|
- <el-table-column label="所属公司"></el-table-column>
|
|
|
|
|
- <el-table-column label="所属组织机构"></el-table-column>
|
|
|
|
|
- <el-table-column label="所属类型"></el-table-column>
|
|
|
|
|
- <el-table-column label="负责人"></el-table-column>
|
|
|
|
|
- <el-table-column label="安装日期"></el-table-column>
|
|
|
|
|
- <el-table-column label="安装地点地址"></el-table-column>
|
|
|
|
|
- <el-table-column label="关联设备Id"></el-table-column>
|
|
|
|
|
- <el-table-column label="标签"></el-table-column>
|
|
|
|
|
- <el-table-column label="状态"></el-table-column>
|
|
|
|
|
- <el-table-column label="保修期结束日期"></el-table-column>
|
|
|
|
|
- <el-table-column label="制造日期"></el-table-column>
|
|
|
|
|
- <el-table-column label="资产编码"></el-table-column>
|
|
|
|
|
- <el-table-column label="资产编号"></el-table-column>
|
|
|
|
|
- <el-table-column label="使用证编号"></el-table-column>
|
|
|
|
|
- <el-table-column label="安全级别"></el-table-column>
|
|
|
|
|
- <el-table-column label="使用年限"></el-table-column>
|
|
|
|
|
- <el-table-column label="变动日期"></el-table-column>
|
|
|
|
|
- <el-table-column label="供货厂家"></el-table-column>
|
|
|
|
|
- <el-table-column label="创建人"></el-table-column>
|
|
|
|
|
- <el-table-column label="创建时间"></el-table-column>
|
|
|
|
|
- <el-table-column label="更新人"></el-table-column>
|
|
|
|
|
- <el-table-column label="更新时间"></el-table-column>
|
|
|
|
|
- <el-table-column label="备注"></el-table-column>
|
|
|
|
|
- <el-table-column label="设备编码"></el-table-column>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <el-table-column v-for="item in columns.filter(i=>i.visible)" :prop="item.prop" :label="item.label" ></el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
<div style="text-align: center;display: flex;justify-content: center;margin-top: 10px" >
|
|
<div style="text-align: center;display: flex;justify-content: center;margin-top: 10px" >
|
|
|
|
|
|
|
|
- <el-pagination
|
|
|
|
|
- small
|
|
|
|
|
- background
|
|
|
|
|
- layout="prev, pager, next"
|
|
|
|
|
- :total="50"
|
|
|
|
|
- class="mt-4"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-pagination style="float: right;"
|
|
|
|
|
+ small
|
|
|
|
|
+ background
|
|
|
|
|
+ layout="prev, pager, next"
|
|
|
|
|
+ :total="pagedata.total"
|
|
|
|
|
+ :page-size="pagedata.size"
|
|
|
|
|
+ :current-page="pagedata.current"
|
|
|
|
|
+ @current-change="onchangepage"
|
|
|
|
|
+ class="mt-4"
|
|
|
|
|
+ />
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -246,18 +210,144 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
-<script setup lang="ts" >
|
|
|
|
|
-import {ref} from "vue";
|
|
|
|
|
|
|
+<script setup>
|
|
|
|
|
+import {onMounted, ref} from "vue";
|
|
|
import {useRoute, useRouter} from "vue-router";
|
|
import {useRoute, useRouter} from "vue-router";
|
|
|
-import ModbusTcp from "@/views/data/modbusTcp/index.vue";
|
|
|
|
|
|
|
+
|
|
|
|
|
+const {proxy} = getCurrentInstance();
|
|
|
|
|
+const {gateway_status, flow_units, protocal_type} = proxy.useDict("gateway_status", "flow_units", "protocal_type");
|
|
|
|
|
+import {listModbusRtu} from "@/api/data/modbusRtu";
|
|
|
|
|
+import {listModbusTcp} from "@/api/data/modbusTcp";
|
|
|
|
|
+import {updateGateway} from "@/api/data/gateway";
|
|
|
|
|
+import {listGatewayEquipments} from "@/api/data/equipment"
|
|
|
|
|
+import {ElMessage} from "element-plus";
|
|
|
|
|
|
|
|
|
|
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
|
|
+const columns = ref([
|
|
|
|
|
+ {label: '上层位置', prop: 'v', visible: true},
|
|
|
|
|
+ {label: '设备编码', prop: 'commPortId', visible: true},
|
|
|
|
|
+ {label: '备用编码', prop: 'commPortType', visible: true},
|
|
|
|
|
+ {label: '设备名称', prop: 'baudRate', visible: true},
|
|
|
|
|
+ {label: '设备信息', prop: 'dateBits', visible: true},
|
|
|
|
|
+ {label: '所属公司', prop: 'parity', visible: true},
|
|
|
|
|
+ {label: '所属组织机构', prop: 'stopBits', visible: true},
|
|
|
|
|
+ {label: '所属类型', prop: 'apiUrl', visible: true},
|
|
|
|
|
+ {label: '负责人', prop: 'uuid', visible: true},
|
|
|
|
|
+ {label: '安装日期', prop: 'intervals', visible: true},
|
|
|
|
|
+ {label: '安装地点地址', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '关联设备Id', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '标签', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '状态', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '保修期结束日期', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '制造日期', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '资产编码', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '资产编号', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '使用证编号', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '安全级别', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '变动日期', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '供货厂家', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '创建人', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '创建时间', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '更新人', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '更新时间', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '备注', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+ {label: '设备编码', prop: 'protocolDesc', visible: true},
|
|
|
|
|
+
|
|
|
|
|
+])
|
|
|
|
|
+
|
|
|
|
|
+const currentgateway = ref({
|
|
|
|
|
+ "sn": "",
|
|
|
|
|
+ "name": "",
|
|
|
|
|
+ "gatewayId": "",
|
|
|
|
|
+ "status": "",
|
|
|
|
|
+ "remoteManage": "",
|
|
|
|
|
+ "flowControl": 0,
|
|
|
|
|
+ "flowControlType": "",
|
|
|
|
|
+ "belongService": "",
|
|
|
|
|
+ "description": "",
|
|
|
|
|
+ "remark": "",
|
|
|
|
|
+ "protocalType": null,
|
|
|
|
|
+ "protocalId": null,
|
|
|
|
|
+ "longitude": null,
|
|
|
|
|
+ "latitude": null
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+const savedata = () => {
|
|
|
|
|
+ updateGateway(currentgateway.value).then(res => {
|
|
|
|
|
+ ElMessage.success("修改成功")
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+const initdata = () => {
|
|
|
|
|
+ currentgateway.value = {
|
|
|
|
|
+ "sn": "",
|
|
|
|
|
+ "name": "",
|
|
|
|
|
+ "gatewayId": "",
|
|
|
|
|
+ "status": "",
|
|
|
|
|
+ "remoteManage": "",
|
|
|
|
|
+ "flowControl": 0,
|
|
|
|
|
+ "flowControlType": "",
|
|
|
|
|
+ "belongService": "",
|
|
|
|
|
+ "description": "",
|
|
|
|
|
+ "remark": "",
|
|
|
|
|
+ "protocalType": null,
|
|
|
|
|
+ "protocalId": null,
|
|
|
|
|
+ "longitude": null,
|
|
|
|
|
+ "latitude": null
|
|
|
|
|
+ };
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+const protocallist = ref([]);
|
|
|
|
|
+
|
|
|
|
|
+const changeProtocalType = (item) => {
|
|
|
|
|
+
|
|
|
|
|
+ if (item == 1) {
|
|
|
|
|
+ listModbusTcp({pageSize: 10000}).then(res => {
|
|
|
|
|
+ protocallist.value = res.rows;
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item == 2) {
|
|
|
|
|
+ listModbusRtu({pageSize: 10000}).then(res => {
|
|
|
|
|
+ protocallist.value = res.rows;
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const onchangepage = (page) => {
|
|
|
|
|
+ pagedata.value.current = page;
|
|
|
|
|
+ getalldata();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const pagedata = ref({
|
|
|
|
|
+ total: 0,
|
|
|
|
|
+ size: 10,
|
|
|
|
|
+ current: 1
|
|
|
|
|
+});
|
|
|
|
|
+const getalldata = () => {
|
|
|
|
|
+ listGatewayEquipments({pageSize: 10000}).then(res => {
|
|
|
|
|
+ tabledata.value = res.rows;
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+getalldata();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
const addshow = ref(false);
|
|
const addshow = ref(false);
|
|
|
const tabledata = ref([1]);
|
|
const tabledata = ref([1]);
|
|
|
|
|
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ if (route.query["type"] == 1) {
|
|
|
|
|
+ if (localStorage.getItem("gatewaydata")) {
|
|
|
|
|
+ currentgateway.value = JSON.parse(localStorage.getItem("gatewaydata"))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ route.query["type"] = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|