1、调整智能电表-日志-抄表-上次抄表值、本次抄表值的显示逻辑:抄表失败显示'-' 超标值为0时统一格式化内容为0 其它情况直接展示
2、解决温湿度计查询无法应问题 3、调整温湿度计、智能电表、智能水表sn查询永远没有结果问题、调整sn为模糊查询
This commit is contained in:
parent
cb8aada8b3
commit
cce6e5100d
|
|
@ -10,6 +10,12 @@
|
|||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<template v-if="column.dataIndex === 'requestValue'">
|
||||
<span >{{ (text == null || text == undefined) ? '-' : ((text == '0' || text == '0.00') ? 0 : text ) }}</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'resolveValue'">
|
||||
<span >{{ (text == null || text == undefined) ? '-' : ((text == '0' || text == '0.00') ? 0 : text ) }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
|
|
|
|||
|
|
@ -2,89 +2,98 @@
|
|||
<div style="padding: 4px;">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="address">
|
||||
<template #label><span title="SN">SN</span></template>
|
||||
<j-input placeholder="请输入SN" v-model:value="queryParam.address" allow-clear ></j-input>
|
||||
<j-input placeholder="请输入SN" v-model:value="queryParam.address" allow-clear :type="'default'"></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="nuId">
|
||||
<template #label><span title="区域">区域</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,nu_id`" placeholder="请选区域" allow-clear />
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,nu_id`"
|
||||
placeholder="请选区域" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="reload">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="reload">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
||||
style="margin-left: 8px">重置</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<a-row style="margin-top: -18px;">
|
||||
<a-col v-for="(item,index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" style="padding: 8px 6px 6px 8px;">
|
||||
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '70px', padding: '0 24px',border:'0px' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }">
|
||||
<a-col v-for="(item, index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6"
|
||||
style="padding: 8px 6px 6px 8px;">
|
||||
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '70px', padding: '0 24px', border: '0px' }"
|
||||
:bodyStyle="{ padding: '24px 24px 4px 24px' }">
|
||||
<template #title>
|
||||
<a-row style="font-weight: normal;">
|
||||
<a-col :span="18" style="font-size: 14px;">
|
||||
<div>SN:<span style="font-weight: bold;">{{item.address}}</span></div>
|
||||
<div style="font-size: 12px;">抄表时间:{{item.readTime?item.readTime:'未抄表'}}</div>
|
||||
</a-col>
|
||||
<a-col :span="6" style="display: flex; justify-content: flex-end;">
|
||||
<div :class="item.relayState=='1'?'zxClass':'lxClass'">{{item.relayState=='1'?'合闸':'拉闸'}}</div>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-divider style="margin: 10px 0 0 0" />
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row style="font-weight: normal;">
|
||||
<a-col :span="18" style="font-size: 14px;">
|
||||
<div>SN:<span style="font-weight: bold;">{{ item.address }}</span></div>
|
||||
<div style="font-size: 12px;">抄表时间:{{ item.readTime ? item.readTime : '未抄表' }}</div>
|
||||
</a-col>
|
||||
<a-col :span="6" style="display: flex; justify-content: flex-end;">
|
||||
<div :class="item.relayState == '1' ? 'zxClass' : 'lxClass'">{{ item.relayState == '1' ? '合闸' : '拉闸' }}</div>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-divider style="margin: 10px 0 0 0" />
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<a-row style="margin-top:-10px;">
|
||||
<a-col :span="12" style="margin-top: -10px;">{{item.nuId_dictText?item.nuId_dictText:'未配置'}}</a-col>
|
||||
<a-col :span="12" style="text-align: right;margin-top: -10px;">
|
||||
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID: {{item.nuId?item.nuId:'未配置'}}</span>
|
||||
</a-col>
|
||||
<a-col :span="14" style="text-align: right;font-size: 44px;font-weight: bold;margin-top:18px;">
|
||||
<span>{{item.eleValue?item.eleValue:'0.00'}}</span>
|
||||
</a-col>
|
||||
<a-col :span="8" style="padding: 12px 0 0 5px;margin-top:18px;">
|
||||
<div style="font-size: 12px;margin: 5px 0 -5px 2px;padding:2px;">KWH</div>
|
||||
<div style="margin-top:-3px;"><span style="background:#eeeeee;padding: 2px;border-radius:5px;font-size:11px;">用电量</span></div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<p style="text-align:center;">
|
||||
<span style="display:inline-block;cursor: pointer;" @click="handleRead(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a1.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">抄表</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlLz(item)" v-if="item.relayState=='1'">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a5.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">拉闸</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlHz(item)" v-if="item.relayState=='0'">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a2.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">合闸</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleReset(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a3.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">清零</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="showApiLog(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a4.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">日志</span>
|
||||
</span>
|
||||
</p>
|
||||
<a-row style="margin-top:-10px;">
|
||||
<a-col :span="12" style="margin-top: -10px;">{{ item.nuId_dictText ? item.nuId_dictText : '未配置' }}</a-col>
|
||||
<a-col :span="12" style="text-align: right;margin-top: -10px;">
|
||||
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID:
|
||||
{{ item.nuId ? item.nuId : '未配置' }}</span>
|
||||
</a-col>
|
||||
<a-col :span="14" style="text-align: right;font-size: 44px;font-weight: bold;margin-top:18px;">
|
||||
<span>{{ item.eleValue ? item.eleValue : '0.00' }}</span>
|
||||
</a-col>
|
||||
<a-col :span="8" style="padding: 12px 0 0 5px;margin-top:18px;">
|
||||
<div style="font-size: 12px;margin: 5px 0 -5px 2px;padding:2px;">KWH</div>
|
||||
<div style="margin-top:-3px;"><span
|
||||
style="background:#eeeeee;padding: 2px;border-radius:5px;font-size:11px;">用电量</span></div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<p style="text-align:center;">
|
||||
<span style="display:inline-block;cursor: pointer;" @click="handleRead(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a1.png" style="width:20px;" /></span><br />
|
||||
<span class="antTitle">抄表</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlLz(item)"
|
||||
v-if="item.relayState == '1'">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a5.png" style="width:20px;" /></span><br />
|
||||
<span class="antTitle">拉闸</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlHz(item)"
|
||||
v-if="item.relayState == '0'">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a2.png" style="width:20px;" /></span><br />
|
||||
<span class="antTitle">合闸</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleReset(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a3.png" style="width:20px;" /></span><br />
|
||||
<span class="antTitle">清零</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="showApiLog(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a4.png" style="width:20px;" /></span><br />
|
||||
<span class="antTitle">日志</span>
|
||||
</span>
|
||||
</p>
|
||||
</a-card>
|
||||
</a-col>
|
||||
<a-col v-if="tableData.total==0" >
|
||||
<a-col v-if="tableData.total == 0">
|
||||
<div style="margin: 30px auto;">
|
||||
<a-empty />
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<div v-if="tableData.total > 0"
|
||||
<div v-if="tableData.total > 0"
|
||||
style="float:right;bottom: 20px;z-index: 999;padding: 8px 16px;border-radius: 4px;display: flex;align-items: center;">
|
||||
<span style="margin-right: 10px;">共 {{ tableData.total }} 条数据</span>
|
||||
<Pagination showLessItems v-model:current="pageParams.pageNo" :pageSize="pageParams.pageSize" size="small"
|
||||
|
|
@ -96,143 +105,143 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" name="iot-nuIotRegionInfo" setup>
|
||||
import {reactive, ref,h,onMounted} from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { Statistic } from 'ant-design-vue';
|
||||
import {Modal} from "ant-design-vue";
|
||||
import {list, eleReset, eleControl, eleRead } from './electricity.api';
|
||||
import { reactive, ref, h, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { Statistic } from 'ant-design-vue';
|
||||
import { Modal } from "ant-design-vue";
|
||||
import { list, eleReset, eleControl, eleRead } from './electricity.api';
|
||||
import { Pagination } from 'ant-design-vue';
|
||||
import { JInput } from '/@/components/Form';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
|
||||
import ApiLogModal from "@/views/iot/tq/electricity/apilog/ApiLogModal.vue";
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
|
||||
import ApiLogModal from "@/views/iot/tq/electricity/apilog/ApiLogModal.vue";
|
||||
import { set } from 'lodash-es';
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const apiLogModal = ref();
|
||||
const tableData = ref<any>([]);
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const apiLogModal = ref();
|
||||
const tableData = ref<any>([]);
|
||||
const pageParams = ref({ pageNo: 1, pageSize: 8 })
|
||||
|
||||
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
sm:4,
|
||||
xl:6,
|
||||
xxl:4
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
const labelCol = reactive({
|
||||
xs: 24,
|
||||
sm: 4,
|
||||
xl: 6,
|
||||
xxl: 4
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
//刷新数据
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
// 抄电表
|
||||
async function handleRead(record) {
|
||||
const params = {
|
||||
'cid': record.cid,
|
||||
'address': record.address,
|
||||
};
|
||||
await eleRead(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}
|
||||
// 抄电表
|
||||
async function handleRead(record) {
|
||||
const params = {
|
||||
'cid' : record.cid,
|
||||
'address' : record.address,
|
||||
};
|
||||
await eleRead(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
// 电表拉闸
|
||||
async function handleControlLz(record) {
|
||||
if(record.relayState == '0'){
|
||||
Modal.info({
|
||||
title: '拉闸',
|
||||
content: h('div', {}, [
|
||||
h('p', '此电表已拉闸!'),
|
||||
]),
|
||||
onOk() {},
|
||||
});
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
'cid' : record.cid,
|
||||
'address' : record.address,
|
||||
'type' : '10',
|
||||
};
|
||||
await eleControl(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
// 电表合闸
|
||||
async function handleControlHz(record) {
|
||||
if(record.relayState == '1'){
|
||||
Modal.info({
|
||||
title: '合闸',
|
||||
content: h('div', {}, [
|
||||
h('p', '此电表已合闸!'),
|
||||
]),
|
||||
onOk() {},
|
||||
});
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
'cid' : record.cid,
|
||||
'address' : record.address,
|
||||
'type' : '11',
|
||||
};
|
||||
await eleControl(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
// 电表清零
|
||||
async function handleReset(record) {
|
||||
const params = {
|
||||
'cid' : record.cid,
|
||||
'address' : record.address,
|
||||
};
|
||||
await eleReset(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看api日志
|
||||
*/
|
||||
function showApiLog(record){
|
||||
console.log(record);
|
||||
apiLogModal.value.disableSubmit = true;
|
||||
apiLogModal.value.showApiLog(record);
|
||||
}
|
||||
|
||||
function reload(){
|
||||
queryParam.pageSize = pageParams.value.pageSize;
|
||||
queryParam.pageNo = pageParams.value.pageNo;
|
||||
defHttp.get({url: '/iot/tq/electricityMeter/list',params:queryParam}).then(res => {
|
||||
console.log("🚀 ~ defHttp.get ~ res:", res)
|
||||
tableData.value = res;
|
||||
// 电表拉闸
|
||||
async function handleControlLz(record) {
|
||||
if (record.relayState == '0') {
|
||||
Modal.info({
|
||||
title: '拉闸',
|
||||
content: h('div', {}, [
|
||||
h('p', '此电表已拉闸!'),
|
||||
]),
|
||||
onOk() { },
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 自动请求并暴露内部方法
|
||||
onMounted(() => {
|
||||
const params = {
|
||||
'cid': record.cid,
|
||||
'address': record.address,
|
||||
'type': '10',
|
||||
};
|
||||
await eleControl(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
// 电表合闸
|
||||
async function handleControlHz(record) {
|
||||
if (record.relayState == '1') {
|
||||
Modal.info({
|
||||
title: '合闸',
|
||||
content: h('div', {}, [
|
||||
h('p', '此电表已合闸!'),
|
||||
]),
|
||||
onOk() { },
|
||||
});
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
'cid': record.cid,
|
||||
'address': record.address,
|
||||
'type': '11',
|
||||
};
|
||||
await eleControl(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
// 电表清零
|
||||
async function handleReset(record) {
|
||||
const params = {
|
||||
'cid': record.cid,
|
||||
'address': record.address,
|
||||
};
|
||||
await eleReset(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看api日志
|
||||
*/
|
||||
function showApiLog(record) {
|
||||
console.log(record);
|
||||
apiLogModal.value.disableSubmit = true;
|
||||
apiLogModal.value.showApiLog(record);
|
||||
}
|
||||
|
||||
function reload() {
|
||||
queryParam.pageSize = pageParams.value.pageSize;
|
||||
queryParam.pageNo = pageParams.value.pageNo;
|
||||
defHttp.get({ url: '/iot/tq/electricityMeter/list', params: queryParam }).then(res => {
|
||||
console.log("🚀 ~ defHttp.get ~ res:", res)
|
||||
tableData.value = res;
|
||||
});
|
||||
}
|
||||
|
||||
// 自动请求并暴露内部方法
|
||||
onMounted(() => {
|
||||
reload();
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.cardTitle{
|
||||
.cardTitle {
|
||||
background: #1ea0fa;
|
||||
width: 100%;
|
||||
margin: -28px -24px;
|
||||
|
|
@ -243,35 +252,38 @@ const pageParams = ref({ pageNo: 1, pageSize: 8 })
|
|||
display: block;
|
||||
position: absolute;
|
||||
}
|
||||
.zxClass{
|
||||
font-size:14px;
|
||||
|
||||
.zxClass {
|
||||
font-size: 14px;
|
||||
background: linear-gradient(to right, #1ea0fa, #017de9);
|
||||
border-radius: 8px;
|
||||
height: 25px;
|
||||
color: white;
|
||||
line-height: 25px;
|
||||
text-align: center;
|
||||
width:50px;
|
||||
margin-top:11px;
|
||||
width: 50px;
|
||||
margin-top: 11px;
|
||||
}
|
||||
|
||||
.lxClass{
|
||||
font-size:14px;
|
||||
.lxClass {
|
||||
font-size: 14px;
|
||||
background: linear-gradient(to right, #cccccc, #cccccc);
|
||||
border-radius: 8px;
|
||||
height: 25px;
|
||||
color: white;
|
||||
line-height: 25px;
|
||||
text-align: center;
|
||||
width:50px;
|
||||
margin-top:11px;
|
||||
width: 50px;
|
||||
margin-top: 11px;
|
||||
}
|
||||
.tbClass{
|
||||
|
||||
.tbClass {
|
||||
background: #f6f6f6;
|
||||
padding: 8px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.antTitle{
|
||||
|
||||
.antTitle {
|
||||
margin-top: 10px;
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
|
|
|
|||
|
|
@ -2,89 +2,98 @@
|
|||
<div style="padding: 4px;">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="address">
|
||||
<template #label><span title="SN">SN</span></template>
|
||||
<j-input placeholder="请输入SN" v-model:value="queryParam.address" allow-clear ></j-input>
|
||||
<j-input placeholder="请输入SN" v-model:value="queryParam.address" :type="'default'" allow-clear></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="nuId">
|
||||
<template #label><span title="区域">区域</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,nu_id`" placeholder="请选区域" allow-clear />
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,nu_id`"
|
||||
placeholder="请选区域" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="reload">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="reload">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
||||
style="margin-left: 8px">重置</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<a-row style="margin-top: -18px;">
|
||||
<a-col v-for="(item,index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" style="padding: 8px 6px 6px 8px;">
|
||||
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '70px', padding: '0 24px',border:'0px' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }">
|
||||
<a-col v-for="(item, index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6"
|
||||
style="padding: 8px 6px 6px 8px;">
|
||||
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '70px', padding: '0 24px', border: '0px' }"
|
||||
:bodyStyle="{ padding: '24px 24px 4px 24px' }">
|
||||
<template #title>
|
||||
<a-row style="font-weight: normal;">
|
||||
<a-col :span="18" style="font-size: 14px;">
|
||||
<div>SN:<span style="font-weight: bold;">{{item.address}}</span></div>
|
||||
<div style="font-size: 12px;">抄表时间:{{item.readTime?item.readTime:'未抄表'}}</div>
|
||||
</a-col>
|
||||
<a-col :span="6" style="display: flex; justify-content: flex-end;">
|
||||
<div :class="item.relayState=='1'?'zxClass':'lxClass'">{{item.relayState=='1'?'开阀':'关阀'}}</div>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-divider style="margin: 10px 0 0 0" />
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row style="font-weight: normal;">
|
||||
<a-col :span="18" style="font-size: 14px;">
|
||||
<div>SN:<span style="font-weight: bold;">{{ item.address }}</span></div>
|
||||
<div style="font-size: 12px;">抄表时间:{{ item.readTime ? item.readTime : '未抄表' }}</div>
|
||||
</a-col>
|
||||
<a-col :span="6" style="display: flex; justify-content: flex-end;">
|
||||
<div :class="item.relayState == '1' ? 'zxClass' : 'lxClass'">{{ item.relayState == '1' ? '开阀' : '关阀' }}</div>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-divider style="margin: 10px 0 0 0" />
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<a-row style="margin-top:-10px;">
|
||||
<a-col :span="12" style="margin-top: -10px;">{{item.nuId_dictText?item.nuId_dictText:'未配置'}}</a-col>
|
||||
<a-col :span="12" style="text-align: right;margin-top: -10px;">
|
||||
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID: {{item.nuId?item.nuId:'未配置'}}</span>
|
||||
</a-col>
|
||||
<a-col :span="14" style="text-align: right;font-size: 44px;font-weight: bold;margin-top:18px;">
|
||||
<span>{{item.waterValue?item.waterValue:'0.00'}}</span>
|
||||
</a-col>
|
||||
<a-col :span="8" style="padding: 12px 0 0 5px;margin-top:18px;">
|
||||
<div style="font-size: 12px;margin: 8px 0 -5px 2px;">m³</div>
|
||||
<div style="margin-top:-3px;"><span style="background:#eeeeee;padding: 2px;border-radius:5px;font-size:11px;">用水量</span></div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<p style="text-align:center;">
|
||||
<span style="display:inline-block;cursor: pointer;" @click="handleRead(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a1.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">抄表</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlLz(item)" v-if="item.relayState=='0'">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a10.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">开阀</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlHz(item)" v-if="item.relayState=='1'">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a11.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">关阀</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleReset(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a3.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">清零</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="showApiLog(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a4.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">日志</span>
|
||||
</span>
|
||||
</p>
|
||||
<a-row style="margin-top:-10px;">
|
||||
<a-col :span="12" style="margin-top: -10px;">{{ item.nuId_dictText ? item.nuId_dictText : '未配置' }}</a-col>
|
||||
<a-col :span="12" style="text-align: right;margin-top: -10px;">
|
||||
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID:
|
||||
{{ item.nuId ? item.nuId : '未配置' }}</span>
|
||||
</a-col>
|
||||
<a-col :span="14" style="text-align: right;font-size: 44px;font-weight: bold;margin-top:18px;">
|
||||
<span>{{ item.waterValue ? item.waterValue : '0.00' }}</span>
|
||||
</a-col>
|
||||
<a-col :span="8" style="padding: 12px 0 0 5px;margin-top:18px;">
|
||||
<div style="font-size: 12px;margin: 8px 0 -5px 2px;">m³</div>
|
||||
<div style="margin-top:-3px;"><span
|
||||
style="background:#eeeeee;padding: 2px;border-radius:5px;font-size:11px;">用水量</span></div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<p style="text-align:center;">
|
||||
<span style="display:inline-block;cursor: pointer;" @click="handleRead(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a1.png" style="width:20px;" /></span><br />
|
||||
<span class="antTitle">抄表</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlLz(item)"
|
||||
v-if="item.relayState == '0'">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a10.png" style="width:20px;" /></span><br />
|
||||
<span class="antTitle">开阀</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleControlHz(item)"
|
||||
v-if="item.relayState == '1'">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a11.png" style="width:20px;" /></span><br />
|
||||
<span class="antTitle">关阀</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleReset(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a3.png" style="width:20px;" /></span><br />
|
||||
<span class="antTitle">清零</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="showApiLog(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a4.png" style="width:20px;" /></span><br />
|
||||
<span class="antTitle">日志</span>
|
||||
</span>
|
||||
</p>
|
||||
</a-card>
|
||||
</a-col>
|
||||
<a-col v-if="tableData.total==0" >
|
||||
<a-col v-if="tableData.total == 0">
|
||||
<div style="margin: 30px auto;">
|
||||
<a-empty />
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<div v-if="tableData.total > 0"
|
||||
<div v-if="tableData.total > 0"
|
||||
style="float:right;bottom: 20px;z-index: 999;padding: 8px 16px;border-radius: 4px;display: flex;align-items: center;">
|
||||
<span style="margin-right: 10px;">共 {{ tableData.total }} 条数据</span>
|
||||
<Pagination showLessItems v-model:current="pageParams.pageNo" :pageSize="pageParams.pageSize" size="small"
|
||||
|
|
@ -96,143 +105,143 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" name="iot-nuIotRegionInfo" setup>
|
||||
import {reactive, ref,h,onMounted} from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { Statistic } from 'ant-design-vue';
|
||||
import {Modal} from "ant-design-vue";
|
||||
import {list, eleReset, eleControl, eleRead } from './water.api';
|
||||
import { reactive, ref, h, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { Statistic } from 'ant-design-vue';
|
||||
import { Modal } from "ant-design-vue";
|
||||
import { list, eleReset, eleControl, eleRead } from './water.api';
|
||||
import { Pagination } from 'ant-design-vue';
|
||||
|
||||
import ApiLogModal from "@/views/iot/tq/electricity/apilog/WaterApiLogModal.vue";
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
|
||||
import ApiLogModal from "@/views/iot/tq/electricity/apilog/WaterApiLogModal.vue";
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { set } from 'lodash-es';
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const apiLogModal = ref();
|
||||
const tableData = ref<any>([]);
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const apiLogModal = ref();
|
||||
const tableData = ref<any>([]);
|
||||
const pageParams = ref({ pageNo: 1, pageSize: 8 })
|
||||
|
||||
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
sm:4,
|
||||
xl:6,
|
||||
xxl:4
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
const labelCol = reactive({
|
||||
xs: 24,
|
||||
sm: 4,
|
||||
xl: 6,
|
||||
xxl: 4
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
//刷新数据
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
// 抄水表
|
||||
async function handleRead(record) {
|
||||
const params = {
|
||||
'cid': record.cid,
|
||||
'address': record.address,
|
||||
};
|
||||
await eleRead(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}
|
||||
// 抄水表
|
||||
async function handleRead(record) {
|
||||
const params = {
|
||||
'cid' : record.cid,
|
||||
'address' : record.address,
|
||||
};
|
||||
await eleRead(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
// 水表开阀
|
||||
async function handleControlLz(record) {
|
||||
if(record.relayState == '1'){
|
||||
Modal.info({
|
||||
title: '开阀',
|
||||
content: h('div', {}, [
|
||||
h('p', '此水表已开阀!'),
|
||||
]),
|
||||
onOk() {},
|
||||
});
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
'cid' : record.cid,
|
||||
'address' : record.address,
|
||||
'type' : '43',
|
||||
};
|
||||
await eleControl(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
// 水表关阀
|
||||
async function handleControlHz(record) {
|
||||
if(record.relayState == '0'){
|
||||
Modal.info({
|
||||
title: '关阀',
|
||||
content: h('div', {}, [
|
||||
h('p', '此水表已关阀!'),
|
||||
]),
|
||||
onOk() {},
|
||||
});
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
'cid' : record.cid,
|
||||
'address' : record.address,
|
||||
'type' : '53',
|
||||
};
|
||||
await eleControl(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
// 水表清零
|
||||
async function handleReset(record) {
|
||||
const params = {
|
||||
'cid' : record.cid,
|
||||
'address' : record.address,
|
||||
};
|
||||
await eleReset(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看api日志
|
||||
*/
|
||||
function showApiLog(record){
|
||||
console.log(record);
|
||||
apiLogModal.value.disableSubmit = true;
|
||||
apiLogModal.value.showApiLog(record);
|
||||
}
|
||||
|
||||
function reload(){
|
||||
queryParam.pageSize = pageParams.value.pageSize;
|
||||
queryParam.pageNo = pageParams.value.pageNo;
|
||||
defHttp.get({url: '/iot/tq/waterMeter/list',params:queryParam}).then(res => {
|
||||
console.log("🚀 ~ defHttp.get ~ res:", res)
|
||||
tableData.value = res;
|
||||
// 水表开阀
|
||||
async function handleControlLz(record) {
|
||||
if (record.relayState == '1') {
|
||||
Modal.info({
|
||||
title: '开阀',
|
||||
content: h('div', {}, [
|
||||
h('p', '此水表已开阀!'),
|
||||
]),
|
||||
onOk() { },
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 自动请求并暴露内部方法
|
||||
onMounted(() => {
|
||||
const params = {
|
||||
'cid': record.cid,
|
||||
'address': record.address,
|
||||
'type': '43',
|
||||
};
|
||||
await eleControl(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
// 水表关阀
|
||||
async function handleControlHz(record) {
|
||||
if (record.relayState == '0') {
|
||||
Modal.info({
|
||||
title: '关阀',
|
||||
content: h('div', {}, [
|
||||
h('p', '此水表已关阀!'),
|
||||
]),
|
||||
onOk() { },
|
||||
});
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
'cid': record.cid,
|
||||
'address': record.address,
|
||||
'type': '53',
|
||||
};
|
||||
await eleControl(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
// 水表清零
|
||||
async function handleReset(record) {
|
||||
const params = {
|
||||
'cid': record.cid,
|
||||
'address': record.address,
|
||||
};
|
||||
await eleReset(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看api日志
|
||||
*/
|
||||
function showApiLog(record) {
|
||||
console.log(record);
|
||||
apiLogModal.value.disableSubmit = true;
|
||||
apiLogModal.value.showApiLog(record);
|
||||
}
|
||||
|
||||
function reload() {
|
||||
queryParam.pageSize = pageParams.value.pageSize;
|
||||
queryParam.pageNo = pageParams.value.pageNo;
|
||||
defHttp.get({ url: '/iot/tq/waterMeter/list', params: queryParam }).then(res => {
|
||||
console.log("🚀 ~ defHttp.get ~ res:", res)
|
||||
tableData.value = res;
|
||||
});
|
||||
}
|
||||
|
||||
// 自动请求并暴露内部方法
|
||||
onMounted(() => {
|
||||
reload();
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.cardTitle{
|
||||
.cardTitle {
|
||||
background: #1ea0fa;
|
||||
width: 100%;
|
||||
margin: -28px -24px;
|
||||
|
|
@ -243,35 +252,38 @@ const pageParams = ref({ pageNo: 1, pageSize: 8 })
|
|||
display: block;
|
||||
position: absolute;
|
||||
}
|
||||
.zxClass{
|
||||
font-size:14px;
|
||||
|
||||
.zxClass {
|
||||
font-size: 14px;
|
||||
background: linear-gradient(to right, #1ea0fa, #017de9);
|
||||
border-radius: 8px;
|
||||
height: 25px;
|
||||
color: white;
|
||||
line-height: 25px;
|
||||
text-align: center;
|
||||
width:50px;
|
||||
margin-top:11px;
|
||||
width: 50px;
|
||||
margin-top: 11px;
|
||||
}
|
||||
|
||||
.lxClass{
|
||||
font-size:14px;
|
||||
.lxClass {
|
||||
font-size: 14px;
|
||||
background: linear-gradient(to right, #cccccc, #cccccc);
|
||||
border-radius: 8px;
|
||||
height: 25px;
|
||||
color: white;
|
||||
line-height: 25px;
|
||||
text-align: center;
|
||||
width:50px;
|
||||
margin-top:11px;
|
||||
width: 50px;
|
||||
margin-top: 11px;
|
||||
}
|
||||
.tbClass{
|
||||
|
||||
.tbClass {
|
||||
background: #f6f6f6;
|
||||
padding: 8px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.antTitle{
|
||||
|
||||
.antTitle {
|
||||
margin-top: 10px;
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
|
|
|
|||
|
|
@ -2,88 +2,96 @@
|
|||
<div style="padding: 4px;">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="sn">
|
||||
<template #label><span title="SN">SN</span></template>
|
||||
<j-input placeholder="请输入SN" v-model:value="queryParam.sn" allow-clear ></j-input>
|
||||
<JInput placeholder="请输入SN" v-model:value="queryParam.sn" allow-clear :type="'default'"></JInput>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="nuId">
|
||||
<template #label><span title="区域">区域</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,nu_id`" placeholder="请选区域" allow-clear />
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,nu_id`"
|
||||
placeholder="请选区域" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span class="table-page-search-submitButtons">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
||||
style="margin-left: 8px">重置</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="reload">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
||||
style="margin-left: 8px">重置</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<a-row style="margin-top: -18px;">
|
||||
<a-col v-for="(item,index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" style="padding: 8px 6px 6px 8px;">
|
||||
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '70px', padding: '0 24px',border:'0px' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }">
|
||||
<a-col v-for="(item, index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8"
|
||||
:xxl="6" style="padding: 8px 6px 6px 8px;">
|
||||
<a-card style="width: 100%;border-radius: 8px;"
|
||||
:headStyle="{ height: '70px', padding: '0 24px', border: '0px' }"
|
||||
:bodyStyle="{ padding: '24px 24px 4px 24px' }">
|
||||
<template #title>
|
||||
<a-row style="font-weight: normal;">
|
||||
<a-col :span="18" style="font-size: 14px;">
|
||||
<div>SN:<span style="font-weight: bold;">{{item.sn}}</span></div>
|
||||
<div style="font-size: 12px;">抄表时间:{{item.reportingTime?item.reportingTime:'未抄表'}}</div>
|
||||
</a-col>
|
||||
<a-col :span="6" style="display: flex; justify-content: flex-end;">
|
||||
<div :class="item.status=='0'?'zxClass':'lxClass'">{{item.status=='0'?'在线':'离线'}}</div>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-divider style="margin: 10px 0 0 0" />
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row style="font-weight: normal;">
|
||||
<a-col :span="18" style="font-size: 14px;">
|
||||
<div>SN:<span style="font-weight: bold;">{{ item.sn }}</span></div>
|
||||
<div style="font-size: 12px;">抄表时间:{{ item.reportingTime ? item.reportingTime : '未抄表' }}</div>
|
||||
</a-col>
|
||||
<a-col :span="6" style="display: flex; justify-content: flex-end;">
|
||||
<div :class="item.status == '0' ? 'zxClass' : 'lxClass'">{{ item.status == '0' ? '在线' : '离线' }}</div>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-divider style="margin: 10px 0 0 0" />
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
<a-row style="margin-top:-10px;">
|
||||
<a-col :span="12" style="margin-top: -10px;">{{item.nuId_dictText?item.nuId_dictText:'未配置'}}</a-col>
|
||||
<a-col :span="12" style="text-align: right;margin-top: -10px;">
|
||||
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID: {{item.nuId?item.nuId:'未配置'}}</span>
|
||||
<a-row style="margin-top:-10px;">
|
||||
<a-col :span="12" style="margin-top: -10px;">{{ item.nuId_dictText ? item.nuId_dictText : '未配置' }}</a-col>
|
||||
<a-col :span="12" style="text-align: right;margin-top: -10px;">
|
||||
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID:
|
||||
{{ item.nuId ? item.nuId : '未配置' }}</span>
|
||||
</a-col>
|
||||
<a-col :span="24" style="padding: 12px 0 0 5px;margin-top:18px;">
|
||||
<a-row>
|
||||
<a-col :span="11" style="text-align: center;">
|
||||
<span><img src="../../../assets/iot/a8.png" style="width:25px;margin-top: -15px;" /></span>
|
||||
<span style="font-size: 30px;font-weight:700;">{{ item.temperature ? item.temperature : '-' }}</span>
|
||||
<span style="font-size: 16px;">℃</span>
|
||||
</a-col>
|
||||
<a-col :span="24" style="padding: 12px 0 0 5px;margin-top:18px;">
|
||||
<a-row>
|
||||
<a-col :span="11" style="text-align: center;">
|
||||
<span><img src="../../../assets/iot/a8.png" style="width:25px;margin-top: -15px;" /></span>
|
||||
<span style="font-size: 30px;font-weight:700;">{{item.temperature?item.temperature:'-'}}</span>
|
||||
<span style="font-size: 16px;">℃</span>
|
||||
</a-col>
|
||||
<a-col :span="2" style="text-align: center;">
|
||||
<a-divider type="vertical" style="height: 40px;"/>
|
||||
</a-col>
|
||||
<a-col :span="11" style="text-align: center;">
|
||||
<span style="margin-top:0px;"><img src="../../../assets/iot/a9.png" style="width:25px;margin-top: -15px;" /></span>
|
||||
<span style="font-size: 30px;font-weight:700;margin-left: 6px;">{{item.humidity?item.humidity:'-'}}</span>
|
||||
<span style="font-size: 16px;">%</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-col :span="2" style="text-align: center;">
|
||||
<a-divider type="vertical" style="height: 40px;" />
|
||||
</a-col>
|
||||
<a-col :span="11" style="text-align: center;">
|
||||
<span style="margin-top:0px;"><img src="../../../assets/iot/a9.png"
|
||||
style="width:25px;margin-top: -15px;" /></span>
|
||||
<span style="font-size: 30px;font-weight:700;margin-left: 6px;">{{ item.humidity ? item.humidity : '-'
|
||||
}}</span>
|
||||
<span style="font-size: 16px;">%</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<p style="text-align:center;">
|
||||
<span style="display:inline-block;cursor: pointer;" @click="handleRead(item)">
|
||||
<span class="tbClass"><img src="../../../assets/iot/a7.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">抄表</span>
|
||||
</span>
|
||||
<!-- <span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleEdit(item)">
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<p style="text-align:center;">
|
||||
<span style="display:inline-block;cursor: pointer;" @click="handleRead(item)">
|
||||
<span class="tbClass"><img src="../../../assets/iot/a7.png" style="width:20px;" /></span><br />
|
||||
<span class="antTitle">抄表</span>
|
||||
</span>
|
||||
<!-- <span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="handleEdit(item)">
|
||||
<span class="tbClass"><img src="../../../assets/iot/a6.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">配置</span>
|
||||
</span> -->
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="showApiLog(item)">
|
||||
<span class="tbClass"><img src="../../../assets/iot/a4.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">日志</span>
|
||||
</span>
|
||||
</p>
|
||||
<span style="display:inline-block;margin-left:10%;cursor: pointer;" @click="showApiLog(item)">
|
||||
<span class="tbClass"><img src="../../../assets/iot/a4.png" style="width:20px;" /></span><br />
|
||||
<span class="antTitle">日志</span>
|
||||
</span>
|
||||
</p>
|
||||
</a-card>
|
||||
</a-col>
|
||||
<a-col v-if="tableData.total==0" >
|
||||
<a-col v-if="tableData.total == 0">
|
||||
<div style="margin: 30px auto;">
|
||||
<a-empty />
|
||||
</div>
|
||||
|
|
@ -102,97 +110,97 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" name="iot-nuIotRegionInfo" setup>
|
||||
import {reactive, ref,h,onMounted} from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { Statistic } from 'ant-design-vue';
|
||||
import {Modal} from "ant-design-vue";
|
||||
import {updateDeviceRealTime} from './humid.api';
|
||||
import { Pagination } from 'ant-design-vue';
|
||||
import { reactive, ref, h, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { Statistic } from 'ant-design-vue';
|
||||
import { Modal } from "ant-design-vue";
|
||||
import { updateDeviceRealTime } from './humid.api';
|
||||
import { Pagination } from 'ant-design-vue';
|
||||
|
||||
import ApiLogAlarmModal from './components/ApiLogAlarmModal.vue'
|
||||
import DeviceInfoDrawer from "./components/DeviceInfoDrawer.vue";
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { set } from 'lodash-es';
|
||||
import {useDrawer} from "@/components/Drawer";
|
||||
import ApiLogAlarmModal from './components/ApiLogAlarmModal.vue'
|
||||
import DeviceInfoDrawer from "./components/DeviceInfoDrawer.vue";
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { set } from 'lodash-es';
|
||||
import { useDrawer } from "@/components/Drawer";
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
|
||||
//注册drawer
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const apiLogAlarmModal = ref();
|
||||
const tableData = ref<any>([]);
|
||||
//注册drawer
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const apiLogAlarmModal = ref();
|
||||
const tableData = ref<any>([]);
|
||||
const pageParams = ref({ pageNo: 1, pageSize: 8 })
|
||||
|
||||
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
sm:4,
|
||||
xl:6,
|
||||
xxl:4
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
const labelCol = reactive({
|
||||
xs: 24,
|
||||
sm: 4,
|
||||
xl: 6,
|
||||
xxl: 4
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
//刷新数据
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
// 抄表
|
||||
async function handleRead(record) {
|
||||
const params = {
|
||||
'sn': record.sn,
|
||||
};
|
||||
await updateDeviceRealTime(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}
|
||||
// 抄表
|
||||
async function handleRead(record) {
|
||||
const params = {
|
||||
'sn' : record.sn,
|
||||
};
|
||||
await updateDeviceRealTime(params);
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
}, 4000);
|
||||
}
|
||||
}, 4000);
|
||||
}
|
||||
|
||||
// 编辑
|
||||
async function handleEdit(record) {
|
||||
record["isUpdate"] = true;
|
||||
console.log(record);
|
||||
openDrawer(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
tenantSaas: false,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查看api日志
|
||||
*/
|
||||
function showApiLog(record){
|
||||
apiLogAlarmModal.value.disableSubmit = true;
|
||||
apiLogAlarmModal.value.showLogAlarm(record);
|
||||
}
|
||||
|
||||
function reload(){
|
||||
queryParam.pageSize = pageParams.value.pageSize;
|
||||
queryParam.pageNo = pageParams.value.pageNo;
|
||||
defHttp.get({url: '/iot/yiweilian/humidDevice/list',params:queryParam}).then(res => {
|
||||
console.log("🚀 ~ defHttp.get ~ res:", res)
|
||||
tableData.value = res;
|
||||
});
|
||||
}
|
||||
|
||||
// 自动请求并暴露内部方法
|
||||
onMounted(() => {
|
||||
reload();
|
||||
// 编辑
|
||||
async function handleEdit(record) {
|
||||
record["isUpdate"] = true;
|
||||
console.log(record);
|
||||
openDrawer(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
tenantSaas: false,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查看api日志
|
||||
*/
|
||||
function showApiLog(record) {
|
||||
apiLogAlarmModal.value.disableSubmit = true;
|
||||
apiLogAlarmModal.value.showLogAlarm(record);
|
||||
}
|
||||
|
||||
function reload() {
|
||||
queryParam.pageSize = pageParams.value.pageSize;
|
||||
queryParam.pageNo = pageParams.value.pageNo;
|
||||
defHttp.get({ url: '/iot/yiweilian/humidDevice/list', params: queryParam }).then(res => {
|
||||
console.log("🚀 ~ defHttp.get ~ res:", res)
|
||||
tableData.value = res;
|
||||
});
|
||||
}
|
||||
|
||||
// 自动请求并暴露内部方法
|
||||
onMounted(() => {
|
||||
reload();
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.cardTitle{
|
||||
.cardTitle {
|
||||
background: #1ea0fa;
|
||||
width: 100%;
|
||||
margin: -28px -24px;
|
||||
|
|
@ -203,35 +211,38 @@ const pageParams = ref({ pageNo: 1, pageSize: 8 })
|
|||
display: block;
|
||||
position: absolute;
|
||||
}
|
||||
.zxClass{
|
||||
font-size:14px;
|
||||
|
||||
.zxClass {
|
||||
font-size: 14px;
|
||||
background: linear-gradient(to right, #1ea0fa, #017de9);
|
||||
border-radius: 8px;
|
||||
height: 25px;
|
||||
color: white;
|
||||
line-height: 25px;
|
||||
text-align: center;
|
||||
width:50px;
|
||||
margin-top:11px;
|
||||
width: 50px;
|
||||
margin-top: 11px;
|
||||
}
|
||||
|
||||
.lxClass{
|
||||
font-size:14px;
|
||||
.lxClass {
|
||||
font-size: 14px;
|
||||
background: linear-gradient(to right, #cccccc, #cccccc);
|
||||
border-radius: 8px;
|
||||
height: 25px;
|
||||
color: white;
|
||||
line-height: 25px;
|
||||
text-align: center;
|
||||
width:50px;
|
||||
margin-top:11px;
|
||||
width: 50px;
|
||||
margin-top: 11px;
|
||||
}
|
||||
.tbClass{
|
||||
|
||||
.tbClass {
|
||||
background: #f6f6f6;
|
||||
padding: 8px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.antTitle{
|
||||
|
||||
.antTitle {
|
||||
margin-top: 10px;
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
|
|
|
|||
Loading…
Reference in New Issue