|
@@ -7,14 +7,15 @@
|
|
|
:isShowActionColumn="true"
|
|
|
:isShowSelect="false"
|
|
|
title="设备监测"
|
|
|
- :scroll="{ y: scroll.y - 30 }"
|
|
|
+ :scroll="{ y: scroll.y - 60 }"
|
|
|
>
|
|
|
<template #action="{ record }">
|
|
|
<TableAction
|
|
|
:actions="[
|
|
|
{
|
|
|
+ ifShow: () => showDetailButton,
|
|
|
label: '详情',
|
|
|
- onClick: (e) => deviceEdit(e, 'reportInfo', record),
|
|
|
+ onClick: () => $emit('detail', record),
|
|
|
},
|
|
|
{
|
|
|
label: '定位',
|
|
@@ -40,62 +41,74 @@
|
|
|
<a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == '0' ? '#f00' : 'green'">
|
|
|
{{ record.netStatus == '0' ? '断开' : '连接' }}
|
|
|
</a-tag>
|
|
|
+ <span v-if="column.dataIndex === 'isLeakage'" :color="record.isLeakage == '0' ? 'green' : '#f00'">
|
|
|
+ {{ record.isLeakage == '0' ? '未泄露' : `${record.ld_x}m处泄露` }}
|
|
|
+ </span>
|
|
|
</template>
|
|
|
</MonitorTable>
|
|
|
- <DeviceBaseInfo @register="registerModal" device-type="gaspipe" />
|
|
|
+ <!-- <DeviceBaseInfo @register="registerModal" device-type="gaspipe" /> -->
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import MonitorTable from './MonitorTable.vue';
|
|
|
- import DeviceBaseInfo from './components/DeviceBaseInfo.vue';
|
|
|
+ // import DeviceBaseInfo from './components/DeviceBaseInfo.vue';
|
|
|
import { TableAction } from '/@/components/Table';
|
|
|
- import { useModal } from '/@/components/Modal';
|
|
|
+ // import { useModal } from '/@/components/Modal';
|
|
|
import { onMounted } from 'vue';
|
|
|
import { getGasDeviceInfo } from './comment.api';
|
|
|
import { gasPipeColumns } from './comment.data';
|
|
|
import { ref } from 'vue';
|
|
|
import { forEach, get } from 'lodash-es';
|
|
|
|
|
|
- defineProps<{
|
|
|
- scroll: { y: number };
|
|
|
- }>();
|
|
|
+ withDefaults(
|
|
|
+ defineProps<{
|
|
|
+ scroll: { y: number };
|
|
|
+ showDetailButton?: boolean;
|
|
|
+ }>(),
|
|
|
+ {
|
|
|
+ showDetailButton: false,
|
|
|
+ }
|
|
|
+ );
|
|
|
|
|
|
- defineEmits(['locate']);
|
|
|
+ defineEmits(['locate', 'detail']);
|
|
|
|
|
|
- const [registerModal, { openModal }] = useModal();
|
|
|
+ // const [registerModal, { openModal }] = useModal();
|
|
|
|
|
|
- function deviceEdit(e: Event, type: string, record) {
|
|
|
- e.stopPropagation();
|
|
|
- openModal(true, {
|
|
|
- type,
|
|
|
- deviceId: record['deviceID'],
|
|
|
- });
|
|
|
- }
|
|
|
+ // function deviceEdit(e: Event, type: string, record) {
|
|
|
+ // e.stopPropagation();
|
|
|
+ // openModal(true, {
|
|
|
+ // type,
|
|
|
+ // deviceId: record['deviceID'],
|
|
|
+ // });
|
|
|
+ // }
|
|
|
|
|
|
const dataSource = ref<any[]>([]);
|
|
|
|
|
|
function getDataSource() {
|
|
|
getGasDeviceInfo({ devicetype: 'gasmonitor', pagetype: 'normal' }).then((res) => {
|
|
|
dataSource.value = get(res, 'msgTxt[0].datalist', []).map((e) => {
|
|
|
- const item = {};
|
|
|
const start = {
|
|
|
...e.start.readData,
|
|
|
- strinstallpos: e.start.strinstallpos,
|
|
|
+ ...e.start,
|
|
|
readData: null,
|
|
|
};
|
|
|
const end = {
|
|
|
...e.end.readData,
|
|
|
- strinstallpos: e.end.strinstallpos,
|
|
|
+ ...e.end,
|
|
|
readData: null,
|
|
|
};
|
|
|
- forEach(start, (val, key) => {
|
|
|
- item[`${key}_start`] = val;
|
|
|
- });
|
|
|
+ const gasGlFaultDia = JSON.parse(e.gasGlFaultDia);
|
|
|
+
|
|
|
forEach(end, (val, key) => {
|
|
|
- item[`${key}_end`] = val;
|
|
|
+ end[`${key}_end`] = val;
|
|
|
+ delete end[key];
|
|
|
});
|
|
|
|
|
|
- return item;
|
|
|
+ return {
|
|
|
+ ...start,
|
|
|
+ ...end,
|
|
|
+ ...gasGlFaultDia,
|
|
|
+ };
|
|
|
});
|
|
|
});
|
|
|
}
|