|
|
@@ -141,12 +141,12 @@
|
|
|
</el-row>
|
|
|
</el-card>
|
|
|
|
|
|
- <el-card class="box-card" style="margin-top: 20px">
|
|
|
+ <el-card class="box-card" style="margin-top: 20px" v-if="route.query['type']==1">
|
|
|
<template #header>
|
|
|
<div class="card-header">
|
|
|
<span>设备台账</span>
|
|
|
<div>
|
|
|
- <el-button type="primary" plain @click="addshow = true">添加</el-button>
|
|
|
+ <el-button type="primary" plain @click="adddevice">添加</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -155,7 +155,18 @@
|
|
|
<el-col :span="24">
|
|
|
<el-table :data="tabledata" border>
|
|
|
<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" >
|
|
|
+ <template #default="scope">
|
|
|
+ <el-popconfirm title="解绑该设备?" @confirm="deleterow(scope.row)">
|
|
|
+ <template #reference>
|
|
|
+ <el-button link
|
|
|
+ ><el-tooltip effect="dark" content="删除"
|
|
|
+ ><el-icon><Delete /></el-icon></el-tooltip
|
|
|
+ ></el-button>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
@@ -183,21 +194,20 @@
|
|
|
title="设备台账"
|
|
|
v-model="addshow">
|
|
|
|
|
|
- <el-table height="400px">
|
|
|
+ <el-table :data="alldevice" height="400px">
|
|
|
<el-table-column type="selection" width="55" fixed="left" />
|
|
|
<el-table-column v-for="item in columns.filter(i=>i.visible)" :prop="item.prop" :label="item.label" ></el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<div style="text-align: center;display: flex;justify-content: center;margin-top: 10px" >
|
|
|
-
|
|
|
<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"
|
|
|
+ :total="pagedata1.total"
|
|
|
+ :page-size="pagedata1.size"
|
|
|
+ :current-page="pagedata1.current"
|
|
|
+ @current-change="onchangepage1"
|
|
|
class="mt-4"
|
|
|
/>
|
|
|
|
|
|
@@ -216,10 +226,10 @@ import {useRoute, useRouter} from "vue-router";
|
|
|
|
|
|
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 {delModbusRtu, listModbusRtu} from "@/api/data/modbusRtu";
|
|
|
import {listModbusTcp} from "@/api/data/modbusTcp";
|
|
|
import {updateGateway} from "@/api/data/gateway";
|
|
|
-import {listGatewayEquipments} from "@/api/data/equipment"
|
|
|
+import {listGatewayEquipmentSbook,updateEquipmentSbook} from "@/api/data/equipmentSbook"
|
|
|
import {ElMessage} from "element-plus";
|
|
|
|
|
|
|
|
|
@@ -227,34 +237,29 @@ const route = useRoute();
|
|
|
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},
|
|
|
+ {label: '上层位置', prop: 'equipmentTreeId', visible: true},
|
|
|
+ {label: '设备编码', prop: 'sn', visible: true},
|
|
|
+ {label: '备用编码', prop: 'spareSn', visible: true},
|
|
|
+ {label: '设备名称', prop: 'name', visible: true},
|
|
|
+ {label: '设备信息', prop: 'equipmentInfoId', visible: true},
|
|
|
+ {label: '所属公司', prop: 'deptId', visible: true},
|
|
|
+ {label: '所属组织机构', prop: 'deptName', visible: true},
|
|
|
+ {label: '所属类型', prop: 'equipmentTypeId', visible: true},
|
|
|
+ {label: '负责人', prop: 'personInCharge', visible: true},
|
|
|
+ {label: '安装日期', prop: 'installationDate', visible: true},
|
|
|
+ {label: '安装地点地址', prop: 'address', visible: true},
|
|
|
+ {label: '所属网关', prop: 'gatewayId', visible: true},
|
|
|
+ {label: '标签', prop: 'tagids', visible: true},
|
|
|
+ {label: '状态', prop: 'status', visible: true},
|
|
|
+ {label: '保修期结束日期', prop: 'endOfWarrantyPeriod', visible: true},
|
|
|
+ {label: '制造日期', prop: 'manufacturingDate', visible: true},
|
|
|
+ {label: '资产编码', prop: 'assetNo', visible: true},
|
|
|
+ {label: '资产编号', prop: 'serialNumber', visible: true},
|
|
|
+ {label: '使用证编号', prop: 'useCertificateNo', visible: true},
|
|
|
+ {label: '安全级别', prop: 'usefulLife', visible: true},
|
|
|
+ {label: '变动日期', prop: 'changeDate', visible: true},
|
|
|
+ {label: '供货厂家', prop: 'supplier', visible: true},
|
|
|
+ {label: '备注', prop: 'remark', visible: true},
|
|
|
|
|
|
])
|
|
|
|
|
|
@@ -276,6 +281,19 @@ const currentgateway = ref({
|
|
|
});
|
|
|
|
|
|
|
|
|
+const adddevice = () => {
|
|
|
+ addshow.value = true;
|
|
|
+ getalldevicedata();
|
|
|
+}
|
|
|
+const deleterow =(item)=>{
|
|
|
+ item.gatewayId = 0;
|
|
|
+ updateEquipmentSbook(item).then((res)=>{
|
|
|
+ ElMessage.success("解绑成功");
|
|
|
+ getalldata();
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
const savedata = () => {
|
|
|
updateGateway(currentgateway.value).then(res => {
|
|
|
ElMessage.success("修改成功")
|
|
|
@@ -300,6 +318,7 @@ const initdata = () => {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
+const alldevice = ref([]);
|
|
|
|
|
|
const protocallist = ref([]);
|
|
|
|
|
|
@@ -327,12 +346,28 @@ const pagedata = ref({
|
|
|
size: 10,
|
|
|
current: 1
|
|
|
});
|
|
|
+
|
|
|
+const getalldevicedata = () => {
|
|
|
+ listGatewayEquipmentSbook({gatewayId:0, ...pagedata1.value}).then(res => {
|
|
|
+ alldevice.value = res.rows;
|
|
|
+ })
|
|
|
+}
|
|
|
+const onchangepage1 = (page) => {
|
|
|
+ pagedata1.value.current = page;
|
|
|
+ getalldevicedata();
|
|
|
+}
|
|
|
+
|
|
|
+const pagedata1 = ref({
|
|
|
+ total: 0,
|
|
|
+ size: 10,
|
|
|
+ current: 1
|
|
|
+});
|
|
|
const getalldata = () => {
|
|
|
- listGatewayEquipments({pageSize: 10000}).then(res => {
|
|
|
+ listGatewayEquipmentSbook({...pagedata.value,gatewayId:currentgateway.value.id}).then(res => {
|
|
|
tabledata.value = res.rows;
|
|
|
})
|
|
|
}
|
|
|
-getalldata();
|
|
|
+
|
|
|
|
|
|
|
|
|
const addshow = ref(false);
|
|
|
@@ -346,6 +381,7 @@ onMounted(() => {
|
|
|
route.query["type"] = 0;
|
|
|
}
|
|
|
}
|
|
|
+ getalldata();
|
|
|
})
|
|
|
|
|
|
|