区域绑定物联设备

This commit is contained in:
曹磊 2026-04-02 14:49:03 +08:00
parent 157daa2565
commit f858a4ce13
21 changed files with 2026 additions and 6 deletions

View File

@ -103,7 +103,8 @@
import { saveOrUpdate, hldyQyty } from './NuBaseInfo.api';
import NuBaseInfoModal from './components/NuBaseInfoModal.vue'
import NuBaseInfoAddModal from './components/NuBaseInfoAddModal.vue'
import BaseWlsbListModal from './components/BaseWlsbListModal.vue'
// import BaseWlsbListModal from './components/BaseWlsbListModal.vue'
import BaseWlsbListModal from '/@/views/biz/nuBaseInfo/devicesBind/DevicesModal.vue'
import QyghListModal from './components/QyghListModal.vue'
import EwmModal from './components/EwmModal.vue'
import IotDevicesModall from '/@/views/biz/nuBaseInfo/iotDevices/IotDevicesModal.vue'
@ -157,7 +158,7 @@ const { createMessage } = useMessage();
}
/**
* 二维码
* @param record
* @param record
*/
function handleEwm(record) {
ewmModal.value.disableSubmit = true;
@ -178,7 +179,7 @@ function handleJcfy(record) {
//
function handleWlsb(record) {
wlsbModal.value.disableSubmit = true;
wlsbModal.value.edit(record);
wlsbModal.value.add(record);
}
/**

View File

@ -0,0 +1,98 @@
<template>
<div>
<SectionDivider :title="'电表列表'" />
<a-table :columns="baseDbColumns" :data-source="dataList.records" :pagination="pageParams" @change="handleTableChange" >
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<span style="margin-right: 10px;" v-show="record.relayState !=null">
<span v-show="record.relayState =='1'">
<a @click="handleSelect(record)">拉闸</a>
</span>
<span v-show="record.relayState =='0'">
<a @click="handleSelect(record)">合闸</a>
</span>
</span>
<span v-show="record.relayState !=null">
<a @click="handleSelect(record)">选择</a>
</span>
</template>
</template>
</a-table>
</div>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { baseDbColumns } from './DevicesBind.data';
import { electricityMeterUnbindList } from './DevicesBind.api';
import { Pagination } from 'ant-design-vue';
const formRef = ref();
const queryParam = reactive<any>({checkType:''});
const emit = defineEmits(['register', 'ok']);
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
const dataList= ref<any>([]);
const checkDataList= ref<any>([]);
const baseIotInfo= ref<any>({});
const pageParams = ref({ pageNo: 1, pageSize: 15, total: 0, showTotal: (total) => `${total} 条数据` })
/**
* 初始化
*/
function init(record) {
console.log("🚀 ~ init ~ record:", record)
baseIotInfo.value = record;
queryParam.pageNo = 1;
queryParam.checkType = '0';
getDataList();
}
/**
* 分页触发方法
*/
function handleTableChange(record){
queryParam.pageNo = record.current;
getDataList();
}
/**
* 获取数据列表
*/
function getDataList() {
queryParam.pageSize = pageParams.value.pageSize;
electricityMeterUnbindList({params:queryParam}).then((res) => {
dataList.value = res;
pageParams.value.total = res.total;
});
}
function handleSelect(record){
emit("ok",record)
}
/**
* 提交数据
*/
function submitForm() {
}
defineExpose({
init,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
.jcxxClass{
margin-left: 35px;
}
</style>

View File

@ -0,0 +1,70 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
<DbForm ref="registerForm" @ok="submitCallback"></DbForm>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import DbForm from './CheckDbForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('80%');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function init(record) {
title.value = '电表';
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback(record) {
handleCancel();
emit('success',record);
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
init,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,98 @@
<template>
<div>
<SectionDivider :title="'水表列表'" />
<a-table :columns="baseSbColumns" :data-source="dataList.records" :pagination="pageParams" @change="handleTableChange" >
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<span style="margin-right: 10px;" v-show="record.relayState !=null">
<span v-show="record.relayState =='1'">
<a @click="handleSelect(record)">关阀</a>
</span>
<span v-show="record.relayState =='0'">
<a @click="handleSelect(record)">开阀</a>
</span>
</span>
<span v-show="record.relayState !=null">
<a @click="handleSelect(record)">选择</a>
</span>
</template>
</template>
</a-table>
</div>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { baseSbColumns } from './DevicesBind.data';
import { waterMeterUnbindList } from './DevicesBind.api';
import { Pagination } from 'ant-design-vue';
const formRef = ref();
const queryParam = reactive<any>({checkType:''});
const emit = defineEmits(['register', 'ok']);
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
const dataList= ref<any>([]);
const checkDataList= ref<any>([]);
const baseIotInfo= ref<any>({});
const pageParams = ref({ pageNo: 1, pageSize: 15, total: 0, showTotal: (total) => `${total} 条数据` })
/**
* 初始化
*/
function init(record) {
console.log("🚀 ~ init ~ record:", record)
baseIotInfo.value = record;
queryParam.pageNo = 1;
queryParam.checkType = '0';
getDataList();
}
/**
* 分页触发方法
*/
function handleTableChange(record){
queryParam.pageNo = record.current;
getDataList();
}
/**
* 获取数据列表
*/
function getDataList() {
queryParam.pageSize = pageParams.value.pageSize;
waterMeterUnbindList({params:queryParam}).then((res) => {
dataList.value = res;
pageParams.value.total = res.total;
});
}
function handleSelect(record){
emit("ok",record)
}
/**
* 提交数据
*/
function submitForm() {
}
defineExpose({
init,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
.jcxxClass{
margin-left: 35px;
}
</style>

View File

@ -0,0 +1,70 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
<CheckSbForm ref="registerForm" @ok="submitCallback"></CheckSbForm>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import CheckSbForm from './CheckSbForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('80%');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function init(record) {
title.value = '电表';
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback(record) {
handleCancel();
emit('success',record);
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
init,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,98 @@
<template>
<div>
<SectionDivider :title="'摄像头列表'" />
<a-table :columns="baseSxtColumns" :data-source="dataList.records" :pagination="pageParams" @change="handleTableChange" >
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<span style="margin-right: 10px;" v-show="record.deviceStatus !=null">
<a @click="handleSelect(record)">预览</a>
</span>
<span v-show="record.deviceStatus !=null">
<a @click="handleSelect(record)">选择</a>
</span>
</template>
</template>
</a-table>
</div>
</template>
<script lang="ts" setup>
import{ ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { baseSxtColumns } from './DevicesBind.data';
import { cameraInfoUnbindList } from './DevicesBind.api';
import { Pagination } from 'ant-design-vue';
const formRef = ref();
const queryParam = reactive<any>({checkType:''});
const emit = defineEmits(['register', 'ok']);
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
const dataList= ref<any>([]);
const checkDataList= ref<any>([]);
const baseIotInfo= ref<any>({});
const pageParams = ref({ pageNo: 1, pageSize: 15, total: 0, showTotal: (total) => `${total} 条数据` })
/**
* 初始化
*/
function init(record) {
console.log("🚀 ~ init ~ record:", record)
baseIotInfo.value = record;
queryParam.pageNo = 1;
queryParam.checkType = '0';
getDataList();
}
/**
* 分页触发方法
*/
function handleTableChange(record){
queryParam.pageNo = record.current;
getDataList();
}
/**
* 获取数据列表
*/
function getDataList() {
queryParam.pageSize = pageParams.value.pageSize;
cameraInfoUnbindList({params:queryParam}).then((res) => {
dataList.value = res;
pageParams.value.total = res.total;
});
}
/**
* 选择摄像头
*/
function handleSelect(record){
console.log("🚀 ~ handleSelect ~ record:", record)
emit("ok",record)
}
function handleUnSelect(record){
checkDataList.value.records = checkDataList.value.records.filter(item => item.id !== record.id)
}
/**
* 提交数据
*/
function submitForm() {
}
defineExpose({
init,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
.jcxxClass{
margin-left: 35px;
}
</style>

View File

@ -0,0 +1,71 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
<SxtForm ref="registerForm" @ok="submitCallback"></SxtForm>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<!-- <a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button> -->
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import SxtForm from './CheckSxtForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('1200');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function init(record) {
title.value = '摄像头';
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback(record) {
handleCancel();
emit('success',record);
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
init,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,90 @@
<template>
<div class="p-2">
<SectionDivider :title="'温湿度计列表'" />
<a-table :columns="baseWsdColumns" :data-source="dataList.records" :pagination="pageParams" @change="handleTableChange" >
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<span v-show="record.status !=null">
<a @click="handleSelect(record)">选择</a>
</span>
</template>
</template>
</a-table>
</div>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { baseWsdColumns } from './DevicesBind.data';
import { humidDeviceUnbindList } from './DevicesBind.api';
import { Pagination } from 'ant-design-vue';
const formRef = ref();
const queryParam = reactive<any>({checkType:''});
const emit = defineEmits(['register', 'ok']);
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
const dataList= ref<any>([]);
const checkDataList= ref<any>([]);
const baseIotInfo= ref<any>({});
const pageParams = ref({ pageNo: 1, pageSize: 15, total: 0, showTotal: (total) => `${total} 条数据` })
/**
* 初始化
*/
function init(record) {
console.log("🚀 ~ init ~ record:", record)
baseIotInfo.value = record;
queryParam.pageNo = 1;
queryParam.checkType = '0';
getDataList();
}
/**
* 分页触发方法
*/
function handleTableChange(record){
queryParam.pageNo = record.current;
getDataList();
}
/**
* 获取数据列表
*/
function getDataList() {
queryParam.pageSize = pageParams.value.pageSize;
humidDeviceUnbindList({params:queryParam}).then((res) => {
dataList.value = res;
pageParams.value.total = res.total;
});
}
function handleSelect(record){
emit("ok",record)
}
/**
* 提交数据
*/
function submitForm() {
}
defineExpose({
init,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
.jcxxClass{
margin-left: 35px;
}
</style>

View File

@ -0,0 +1,70 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
<CheckWsdjForm ref="registerForm" @ok="submitCallback"></CheckWsdjForm>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import CheckWsdjForm from './CheckWsdjForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('80%');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function init(record) {
title.value = '电表';
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback(record) {
handleCancel();
emit('success',record);
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
init,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,224 @@
<template>
<a-col v-for="(item,index) in tableData" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" style="padding: 8px;">
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '60px', 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;">
SN<span style="font-weight: bold;font-size: 14px;">{{item.sn}}</span>
<!-- <div style="font-size: 12px;">NUID<span style="font-weight: bold;font-size: 14px;">{{item.nuId}}</span></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>
<a-col :span="24" style="margin-top: -10px;">
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:10px;">NUID: {{item.nuId?item.nuId:'未配置'}}</span>
</a-col>
<a-col :span="14" style="font-size: 44px;font-weight: bold;height: 75px;display: flex;justify-content: flex-end;margin-top: 10px;">
<span>{{item.eleValue?item.eleValue:'0.00'}}</span>
</a-col>
<a-col :span="8" style="padding: 20px 0 0 5px;">
<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-col :span="12" style="text-align: left;margin-top:9px;">
<div style="font-size: 12px;">设备类型<a-tag color="red">电表</a-tag></div>
</a-col>
<a-col :span="12" style="text-align: right;margin-top:9px;">
<div style="font-weight: 700;font-size:16px;">
<span v-if="item.maintainStatus=='正常'">正常</span>
<span v-if="item.maintainStatus=='损坏'" style="color: red;">损坏</span>
</div>
<div style="font-size: 12px;">维修状态</div>
</a-col>
<a-col>
<a-divider style="margin: 12px 0 16px 0px;" />
</a-col>
<a-col :span="24" 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:10px;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:10px;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:10px;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:10px;cursor: pointer;" @click="showApiLog(item)">
<span class="tbClass"><img src="../../../../assets/iot/a4.png" style="width:20px;" /></span><br />
<span class="antTitle">日志</span>
</span>
</a-col>
</a-row>
</a-card>
</a-col>
<ApiLogModal ref="apiLogModal"></ApiLogModal>
</template>
<script lang="ts" name="iot-nuIotCameraInfo" setup>
import {h, ref} from 'vue';
import {Modal} from 'ant-design-vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { c } from 'node_modules/vite/dist/node/moduleRunnerTransport.d-DJ_mE5sf';
import { defHttp } from '/@/utils/http/axios';
import ApiLogModal from "@/views/iot/tq/electricity/apilog/ApiLogModal.vue";
import {eleControl, eleReset} from "@/views/iot/tq/electricity/electricity.api";
const apiLogModal = ref();
const { createMessage } = useMessage();
const emit = defineEmits(['register', 'ok']);
const props = defineProps({
tableData: { type: Object, default: () => ([]) },
});
//
async function handleRead(record) {
const params = {
'sn' : record.sn
};
await defHttp.get({ url: '/iot/tq/electricityMeter/eleRead', params }).then((res) => {
console.log("🚀 ~ handleRead ~ res:", res)
});
setTimeout(() => {
emit("ok");
}, 4000);
}
//
async function handleControlLz(record) {
if (record.relayState == '0') {
Modal.info({
title: '拉闸',
content: h('div', {}, [
h('p', '此电表已拉闸!'),
]),
onOk() { },
});
return;
}
const params = {
'sn' : record.sn,
'type': '10'
};
await eleControl(params);
setTimeout(() => {
emit("ok");
}, 4000);
}
//
async function handleControlHz(record) {
if (record.relayState == '1') {
Modal.info({
title: '合闸',
content: h('div', {}, [
h('p', '此电表已合闸!'),
]),
onOk() { },
});
return;
}
const params = {
'sn' : record.sn,
'type': '11',
};
await eleControl(params);
setTimeout(() => {
emit("ok");
}, 4000);
}
//
async function handleReset(record) {
const params = {
'sn': record.sn,
};
await eleReset(params);
setTimeout(() => {
emit("ok");
}, 4000);
}
/**
* 查看电表api日志
*/
function showApiLog(record) {
console.log(record);
apiLogModal.value.disableSubmit = true;
apiLogModal.value.showApiLog(record);
}
</script>
<style lang="less" scoped>
.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;
}
.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;
}
.tbClass{
background: #f6f6f6;
padding: 8px;
border-radius: 5px;
}
.antTitle{
margin-top: 10px;
display: block;
font-size: 12px;
}
.ytbClass{
font-size:12px;
background: linear-gradient(to right, #1ea0fa, #017de9);
border-radius: 8px;
height: 20px;
color: white;
line-height: 20px;
}
.wtbClass{
font-size:12px;
background: linear-gradient(to right, #cccccc, #cccccc);
border-radius: 8px;
height: 20px;
color: white;
line-height: 20px;
}
</style>

View File

@ -0,0 +1,25 @@
import { defHttp } from '/@/utils/http/axios';
enum Api {
bindedList = '/iot/device/manager/bindedList',
cameraInfoUnbindList = '/iot/device/manager/cameraInfoUnbindList',
electricityMeterUnbindList = '/iot/device/manager/electricityMeterUnbindList',
waterMeterUnbindList = '/iot/device/manager/waterMeterUnbindList',
humidDeviceUnbindList = '/iot/device/manager/humidDeviceUnbindList',
bindDevice = '/iot/device/manager/bindDevice',
}
/**
*
* @returns
*/
export const bindedList = (params) => defHttp.get({ url: Api.bindedList, params });
export const cameraInfoUnbindList = (params) => defHttp.get({ url: Api.cameraInfoUnbindList, params });
export const electricityMeterUnbindList = (params) => defHttp.get({ url: Api.electricityMeterUnbindList, params });
export const waterMeterUnbindList = (params) => defHttp.get({ url: Api.waterMeterUnbindList, params });
export const humidDeviceUnbindList = (params) => defHttp.get({ url: Api.humidDeviceUnbindList, params });
export const bindDevice = (params) => defHttp.post({ url: Api.bindDevice, params });

View File

@ -0,0 +1,134 @@
import {BasicColumn} from '/@/components/Table';
//列表数据
export const baseSxtColumns: BasicColumn[] = [
{
title: '设备维度',
align: "center",
dataIndex: 'dimension',
},
{
title: '设备标识',
align: "center",
dataIndex: 'sn',
},
{
title: '规格型号',
align: "center",
dataIndex: 'deviceModel'
},
{
title: '在线状态',
align: "center",
dataIndex: 'deviceStatus',
customRender:({record})=>{
return record.deviceStatus?(record.deviceStatus=='1'?'在线':'离线'):'待集成';
},
},
{
title: '操作',
align: "center",
dataIndex: 'action',
width: 180,
},
];
//列表数据
export const baseDbColumns: BasicColumn[] = [
{
title: '设备维度',
align: "center",
dataIndex: 'dimension',
},
{
title: '设备标识',
align: "center",
dataIndex: 'sn',
},
{
title: '规格型号',
align: "center",
dataIndex: 'deviceModel'
},
{
title: '在线状态',
align: "center",
dataIndex: 'relayState',
customRender:({record})=>{
return record.relayState?(record.relayState=='1'?'合闸':'拉闸'):'待集成';
},
},
{
title: '操作',
align: "center",
dataIndex: 'action',
width: 180,
},
];
//列表数据
export const baseSbColumns: BasicColumn[] = [
{
title: '设备维度',
align: "center",
dataIndex: 'dimension',
},
{
title: '设备标识',
align: "center",
dataIndex: 'sn',
},
{
title: '规格型号',
align: "center",
dataIndex: 'deviceModel'
},
{
title: '设备状态',
align: "center",
dataIndex: 'relayState',
customRender:({record})=>{
return record.relayState?(record.relayState=='1'?'开阀':'关阀'):'待集成';
},
},
{
title: '操作',
align: "center",
dataIndex: 'action',
width: 180,
},
];
//列表数据
export const baseWsdColumns: BasicColumn[] = [
{
title: '设备维度',
align: "center",
dataIndex: 'dimension',
},
{
title: '设备标识',
align: "center",
dataIndex: 'sn'
},
{
title: '规格型号',
align: "center",
dataIndex: 'deviceModel'
},
{
title: '在线状态',
align: "center",
dataIndex: 'status',
customRender:({record})=>{
return record.status?(record.status=='0'?'在线':'离线'):'待集成';
},
},
{
title: '操作',
align: "center",
dataIndex: 'action',
width: 180,
},
];

View File

@ -0,0 +1,165 @@
<template>
<a-spin :spinning="confirmLoading">
<a-row>
<a-col :span="24">
<a-button type="primary" @click="checkSxt" preIcon="ant-design:plus-outlined" style="margin-left:10px;"> 摄像头</a-button>
<a-button type="primary" @click="checkDb" preIcon="ant-design:plus-outlined" style="margin-left:10px;"> 电表</a-button>
<a-button type="primary" @click="checkSb" preIcon="ant-design:plus-outlined" style="margin-left:10px;"> 水表</a-button>
<a-button type="primary" @click="checkWsdj" preIcon="ant-design:plus-outlined" style="margin-left:10px;"> 温湿度计</a-button>
</a-col>
<a-col :span="24">
<a-row>
<SxtList :tableData="dataList.cameraInfoList" @ok="hadleSuccess"></SxtList>
<DbList :tableData="dataList.electricityMeterList" @ok="hadleSuccess"></DbList>
<SbList :tableData="dataList.waterMeterList" @ok="hadleSuccess"></SbList>
<WsdjList :tableData="dataList.humidDeviceList" @ok="hadleSuccess"></WsdjList>
</a-row>
</a-col>
</a-row>
<CheckSxtModal ref="checkSxtModal" @success="handleSuccess"/>
<CheckDbModal ref="checkDbModal" @success="handleSuccess"/>
<CheckSbModal ref="checkSbModal" @success="handleSuccess"/>
<CheckWsdjModal ref="checkWsdjModal" @success="handleSuccess"/>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { bindedList,bindDevice } from './DevicesBind.api'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { Form,Modal } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import SxtList from './SxtList.vue'
import DbList from './DbList.vue'
import SbList from './SbList.vue'
import WsdjList from './WsdjList.vue'
import CheckSxtModal from './CheckSxtModal.vue'
import CheckDbModal from './CheckDbModal.vue'
import CheckSbModal from './CheckSbModal.vue'
import CheckWsdjModal from './CheckWsdjModal.vue'
import { set } from 'lodash-es';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({}) },
formBpm: { type: Boolean, default: true },
});
const formRef = ref();
const checkSxtModal = ref();
const checkDbModal = ref();
const checkSbModal = ref();
const checkWsdjModal = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({});
const nuInfo = ref<any>({})
const dataList = ref<any>({cameraInfoList:[], waterMeterList:[], electricityMeterList:[], humidDeviceList:[]})
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
areaFlag : [{ required: true, message: '请选择区域属性!'},],
iot : [{ required: true, message: '请选择摄像头!'},],
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
const disabled = computed(() => {
if (props.formBpm === true) {
if (props.formData.disabled === false) {
return false;
} else {
return true;
}
}
return props.formDisabled;
});
//湿
function checkWsdj(){
checkWsdjModal.value.disabled = true;
checkWsdjModal.value.init({nuId:nuInfo.value.nuId})
}
//
function checkSb(){
checkSbModal.value.disabled = true;
checkSbModal.value.init({nuId:nuInfo.value.nuId})
}
//
function checkDb(){
checkDbModal.value.disabled = true;
checkDbModal.value.init({nuId:nuInfo.value.nuId})
}
//
function checkSxt(){
checkSxtModal.value.disabled = true;
checkSxtModal.value.init({nuId:nuInfo.value.nuId})
}
//
async function handleSuccess(record) {
let params = {
id: record.id,
nuId: nuInfo.value.nuId,
}
console.log(params);
await bindDevice(params).then(() => {
reload();
});
}
function hadleSuccess(){
reload();
}
/**
* 新增
*/
function add(record) {
console.log("🚀 ~ add ~ record:", record)
nextTick(() => {
resetFields();
nuInfo.value = record;
reload();
});
}
function reload() {
bindedList({ nuId: nuInfo.value.nuId }).then((res) => {
console.log("🚀 ~ reload ~ res:", res)
dataList.value = res;
});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
});
}
/**
* 提交数据
*/
async function submitForm() {
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,83 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
<DevicesForm ref="devicesForm" @ok="submitCallback" :orgCode="orgCode" :formDisabled="disableSubmit"
:formBpm="false"></DevicesForm>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<!-- <a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button> -->
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import DevicesForm from './DevicesForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('80%');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const devicesForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add(record) {
title.value = '设备管理';
visible.value = true;
nextTick(() => {
devicesForm.value.add(record);
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
devicesForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
devicesForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,133 @@
<template>
<a-spin :spinning="confirmLoading">
<div style="width: 236px;float:left;margin-top:14px;">
<a-menu
style="width: 236px;margin-top: -11px;border-radius: 8px;"
mode="inline"
v-model:selectedKeys="current"
>
<a-sub-menu :key="item.nuId" v-for="(item,index) in dataList" @titleClick="handleSblist(item.map,'all','')">
<template #title >NUID{{item.nuId}}</template>
<a-menu-item @click="handleSblist(item.map,'1',itemA.id)" :key="itemA.id" v-for="(itemA,index) in item.map.cameraInfoList" >{{itemA.sn}}[摄像头]</a-menu-item>
<a-menu-item @click="handleSblist(item.map,'2',itemB.id)" :key="itemB.id" v-for="(itemB,index) in item.map.electricityMeterList" >{{itemB.cid}}[电表]</a-menu-item>
<a-menu-item @click="handleSblist(item.map,'3',itemC.id)" :key="itemC.id" v-for="(itemC,index) in item.map.humidDeviceList" >{{itemC.sn}}[温湿度计]</a-menu-item>
<a-menu-item @click="handleSblist(item.map,'4',itemD.id)" :key="itemD.id" v-for="(itemD,index) in item.map.waterMeterList" >{{itemD.cid}}[水表]</a-menu-item>
<a-menu-item :key="item.id" @click="handleSblist(null,'all','')" v-if="getSblb(item)" >暂无数据</a-menu-item>
</a-sub-menu>
</a-menu>
</div>
<div style="width: calc(100% - 236px);float:left;margin-top: -10px;">
<a-row>
<SxtList :tableData="sbList.cameraInfoList" @ok="hadleSuccess"></SxtList>
<DbList :tableData="sbList.electricityMeterList" @ok="hadleSuccess"></DbList>
<SbList :tableData="sbList.waterMeterList" @ok="hadleSuccess"></SbList>
<WsdjList :tableData="sbList.humidDeviceList" @ok="hadleSuccess"></WsdjList>
</a-row>
<a-row v-if="sbList.cameraInfoList.length==0 && sbList.electricityMeterList.length==0 && sbList.waterMeterList.length==0 && sbList.humidDeviceList.length==0">
<a-col>
<a-empty></a-empty>
</a-col>
</a-row>
</div>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { Form,Modal } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import SxtList from './SxtList.vue'
import DbList from './DbList.vue'
import SbList from './SbList.vue'
import WsdjList from './WsdjList.vue'
import { set } from 'lodash-es';
const formRef = ref();
const useForm = Form.useForm;
const nuInfo = ref<any>({})
const dataList = ref<any>([])
const sbList = ref<any>({cameraInfoList:[], waterMeterList:[], electricityMeterList:[], humidDeviceList:[]})
const { createMessage } = useMessage();
const confirmLoading = ref<boolean>(false);
const rootSubmenuKeys = [];
const openKeys= ref<any>([]);
const selectedKeys= [];
const current = ref<string[]>([]);
function hadleSuccess(){
reload();
}
function getSblb(item){
var listA = item.map.cameraInfoList;
var listB = item.map.electricityMeterList;
var listC = item.map.humidDeviceList;
var listD = item.map.waterMeterList;
if(!listA && !listB && !listC && !listD){
return true;
}else if(listA.length == 0 && listB.length == 0 && listC.length == 0 && listD.length == 0){
return true;
}else{
return false;
}
}
/**
* 初始化
*/
function init(record) {
console.log("🚀 ~ add ~ record:", record)
nextTick(() => {
nuInfo.value = record;
reload();
});
}
function reload() {
sbList.value = {}
defHttp.get({ url: '/iot/devicesIot/priviewList', params: { orgCode: nuInfo.value.orgCode } }).then((res) => {
console.log("🚀 ~ reload ~ res:", res)
dataList.value = res;
if(res.length>0){
sbList.value = res[0].map;
openKeys.value.push(res[1].nuId) ;
console.log("🚀 ~ reload ~ sbList.value:", sbList.value)
}
});
}
function handleSblist(dataSource,type,deviceId){
console.log("🚀 ~ handleSblist ~ type:", type)
sbList.value = {cameraInfoList:[], waterMeterList:[], electricityMeterList:[], humidDeviceList:[]};
if(type == 'all'){
if(dataSource){
sbList.value = dataSource;
}
}else if(type == '1'){
sbList.value.cameraInfoList = dataSource.cameraInfoList.filter(item=>item.id == deviceId);
}else if(type == '2'){
sbList.value.electricityMeterList = dataSource.electricityMeterList.filter(item=>item.id == deviceId);
}else if(type == '3'){
sbList.value.humidDeviceList = dataSource.humidDeviceList.filter(item=>item.id == deviceId);
}else if(type == '4'){
sbList.value.waterMeterList = dataSource.waterMeterList.filter(item=>item.id == deviceId);
}
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,70 @@
<template>
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" @close="handleCancel">
<DevicesPriviewForm ref="devicesPriviewRef" @ok="submitCallback" :orgCode="orgCode" :formDisabled="disableSubmit"
:formBpm="false"></DevicesPriviewForm>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<!-- <a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button> -->
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import DevicesPriviewForm from './DevicesPriviewForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('90%');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const devicesPriviewRef = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function init(record) {
title.value = '预览';
visible.value = true;
nextTick(() => {
devicesPriviewRef.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
init,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,226 @@
<template>
<a-col v-for="(item,index) in tableData" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" style="padding: 8px;">
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '60px', 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 style="font-size: 14px;">SN<span style="font-weight: bold;">{{item.cid}}</span></div>
<!-- <div style="font-size: 12px;">设备类型<a-tag color="blue">水表</a-tag></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>
<a-col :span="24" style="margin-top: -10px;">
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:10px;">NUID: {{item.nuId?item.nuId:'未配置'}}</span>
</a-col>
<a-col :span="14" style="font-size: 44px;font-weight: bold;height: 75px;display: flex;justify-content: flex-end;margin-top: 10px;">
<span>{{item.waterValue?item.waterValue:'0.00'}}</span>
</a-col>
<a-col :span="8" style="padding: 20px 0 0 5px;">
<div style="font-size: 12px;margin: 8px 0 -5px 2px;"></div>
<div style="margin-top:-3px;"><span style="background:#eeeeee;padding: 2px;border-radius:5px;font-size:11px;">用水量</span></div>
</a-col>
<a-col :span="12" style="text-align: left;margin-top:9px;">
<div style="font-size: 12px;">设备类型<a-tag color="blue">水表</a-tag></div>
</a-col>
<a-col :span="12" style="text-align: right;margin-top:9px;">
<div style="font-weight: 700;font-size:16px;">
<span v-if="item.maintainStatus=='正常'">正常</span>
<span v-if="item.maintainStatus=='损坏'" style="color: red;">损坏</span>
</div>
<div style="font-size: 12px;">维修状态</div>
</a-col>
<a-col>
<a-divider style="margin: 12px 0 16px 0px;" />
</a-col>
<a-col :span="24" style="text-align: center;">
<span style="display:inline-block;cursor: pointer;" @click="handleRead(item)">
<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:10px;cursor: pointer;" @click="handleSbControlLz(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:10px;cursor: pointer;" @click="handleSbControlHz(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:10px;cursor: pointer;" @click="handleSbReset(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:10px;cursor: pointer;" @click="showApiWaterLog(item)">
<span class="tbClass"><img src="../../../../assets/iot/a4.png" style="width:20px;" /></span><br />
<span class="antTitle">日志</span>
</span>
</a-col>
</a-row>
</a-card>
</a-col>
<ApiLogWaterModal ref="apiLogWaterModal"></ApiLogWaterModal>
</template>
<script lang="ts" name="iot-nuIotCameraInfo" setup>
import {h, ref} from 'vue';
import {Modal} from 'ant-design-vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { c } from 'node_modules/vite/dist/node/moduleRunnerTransport.d-DJ_mE5sf';
import { defHttp } from '/@/utils/http/axios';
import ApiLogWaterModal from "@/views/iot/tq/electricity/apilog/WaterApiLogModal.vue";
import {eleSbControl, eleSbReset} from "@/views/iot/tq/water/water.api";
const apiLogWaterModal = ref();
const { createMessage } = useMessage();
const emit = defineEmits(['register', 'ok']);
const props = defineProps({
tableData: { type: Object, default: () => ([]) },
});
//
async function handleRead(record) {
const params = {
'cid' : record.cid,
'address' : record.address,
};
await defHttp.get({ url: '/iot/tq/waterMeter/waterRead', params }).then((res) => {
console.log("🚀 ~ handleRead ~ res:", res)
});
setTimeout(() => {
emit("ok");
}, 4000);
}
//
async function handleSbControlLz(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 eleSbControl(params);
setTimeout(() => {
emit("ok");
}, 4000);
}
//
async function handleSbControlHz(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 eleSbControl(params);
setTimeout(() => {
emit("ok");
}, 4000);
}
//
async function handleSbReset(record) {
const params = {
'cid': record.cid,
'address': record.address,
};
await eleSbReset(params);
setTimeout(() => {
emit("ok");
}, 4000);
}
/**
* 查看水表api日志
*/
function showApiWaterLog(record) {
apiLogWaterModal.value.disableSubmit = true;
apiLogWaterModal.value.showApiLog(record);
}
</script>
<style lang="less" scoped>
.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;
}
.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;
}
.tbClass{
background: #f6f6f6;
padding: 8px;
border-radius: 5px;
}
.antTitle{
margin-top: 10px;
display: block;
font-size: 12px;
}
.ytbClass{
font-size:12px;
background: linear-gradient(to right, #1ea0fa, #017de9);
border-radius: 8px;
height: 20px;
color: white;
line-height: 20px;
}
.wtbClass{
font-size:12px;
background: linear-gradient(to right, #cccccc, #cccccc);
border-radius: 8px;
height: 20px;
color: white;
line-height: 20px;
}
</style>

View File

@ -0,0 +1,131 @@
<template>
<a-col v-for="(item,index) in tableData" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" style="padding: 8px;">
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '60px', 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 style="font-size: 14px;">SN<span style="font-weight: bold;">{{item.sn}}</span></div>
<!-- <div style="font-size: 12px;">设备类型<a-tag color="purple">摄像头</a-tag></div>-->
</a-col>
<a-col :span="6" style="display: flex; justify-content: flex-end;">
<div :class="item.deviceStatus=='1'?'zxClass':'lxClass'">{{item.deviceStatus =='1'?'在线':'离线'}}</div>
</a-col>
<a-col :span="24" >
<a-divider style="margin: 10px 0 0 0" />
</a-col>
</a-row>
</template>
<a-row>
<a-col :span="24" style="margin-top: -10px;">
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:10px;">NUID: {{item.nuId?item.nuId:'未配置'}}</span>
</a-col>
<a-col :span="24" style="text-align: center;">
<img src="../../../../assets/iot/sxt.png" style="height: 75px;margin-top: 10px;">
</a-col>
<a-col :span="12" style="text-align: left;margin-top:9px;">
<div style="font-size: 12px;">设备类型<a-tag color="purple">摄像头</a-tag></div>
</a-col>
<a-col :span="12" style="text-align: right;margin-top:9px;">
<div style="font-weight: 700;font-size:16px;">
<span v-if="item.maintainStatus=='正常'">正常</span>
<span v-if="item.maintainStatus=='损坏'" style="color: red;">损坏</span>
</div>
<div style="font-size: 12px;">维修状态</div>
</a-col>
<a-col>
<a-divider style="margin: 12px 0 16px 0px;" />
</a-col>
<a-col :span="24" style="text-align: center;">
<span style="display:inline-block;cursor: pointer;" @click="handlePreview(item)">
<span class="tbClass"><img src="../../../../assets/iot/a14.png" style="width:20px;" /></span><br/>
<span class="antTitle">预览</span>
</span>
</a-col>
</a-row>
</a-card>
</a-col>
<CameraPreviewModal ref="previewModal"></CameraPreviewModal>
</template>
<script lang="ts" name="iot-nuIotCameraInfo" setup>
import {ref} from 'vue';
import {Modal} from 'ant-design-vue';
import { useMessage } from '/@/hooks/web/useMessage';
import CameraPreviewModal from '/@/views/iot/tplink/camera/components/CameraPreviewModal.vue'
import { c } from 'node_modules/vite/dist/node/moduleRunnerTransport.d-DJ_mE5sf';
import { defHttp } from '/@/utils/http/axios';
const previewModal = ref();
const { createMessage } = useMessage();
const emit = defineEmits(['register', 'ok']);
const props = defineProps({
tableData: { type: Object, default: () => ([]) },
});
/**
* 预览
*/
function handlePreview(record) {
previewModal.value.disableSubmit = true;
previewModal.value.edit(record);
}
</script>
<style lang="less" scoped>
.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;
}
.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;
}
.tbClass{
background: #f6f6f6;
padding: 8px;
border-radius: 5px;
}
.antTitle{
margin-top: 10px;
display: block;
font-size: 12px;
}
.ytbClass{
font-size:12px;
background: linear-gradient(to right, #1ea0fa, #017de9);
border-radius: 8px;
height: 20px;
color: white;
line-height: 20px;
}
.wtbClass{
font-size:12px;
background: linear-gradient(to right, #cccccc, #cccccc);
border-radius: 8px;
height: 20px;
color: white;
line-height: 20px;
}
</style>

View File

@ -0,0 +1,163 @@
<template>
<a-col v-for="(item,index) in tableData" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" style="padding: 8px;">
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '60px', 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 style="font-size: 14px;">SN<span style="font-weight: bold;">{{item.sn}}</span></div>
<!-- <div style="font-size: 12px;">设备类型<a-tag color="green">温湿度计</a-tag></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>
<a-col :span="24" style="margin-top: -10px;">
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:10px;">NUID: {{item.nuId?item.nuId:'未配置'}}</span>
</a-col>
<a-col :span="24" style="padding: 18px 0 0 5px;height: 85px;">
<a-row>
<a-col :span="11" style="text-align: center;">
<span><img src="../../../../assets/iot/a8.png" style="width:25px;margin-top: -18px;" /></span>
<span style="font-size: 36px;font-weight:700;">{{item.temperature?item.temperature:'-'}}</span>
<span style="font-size: 18px;"></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: -18px;" /></span>
<span style="font-size: 36px;font-weight:700;margin-left: 6px;">{{item.humidity?item.humidity:'-'}}</span>
<span style="font-size: 18px;">%</span>
</a-col>
</a-row>
</a-col>
<a-col :span="12" style="text-align: left;margin-top:9px;">
<div style="font-size: 12px;">设备类型<a-tag color="green">温湿度计</a-tag></div>
</a-col>
<a-col :span="12" style="text-align: right;margin-top:9px;">
<div style="font-weight: 700;font-size:16px;">
<span v-if="item.maintainStatus=='正常'">正常</span>
<span v-if="item.maintainStatus=='损坏'" style="color: red;">损坏</span>
</div>
<div style="font-size: 12px;">维修状态</div>
</a-col>
<a-col>
<a-divider style="margin: 12px 0 16px 0px;" />
</a-col>
<a-col :span="24" 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:10px;cursor: pointer;" @click="showWsdjApiLog(item)">
<span class="tbClass"><img src="../../../../assets/iot/a4.png" style="width:20px;" /></span><br />
<span class="antTitle">日志</span>
</span>
</a-col>
</a-row>
</a-card>
</a-col>
<ApiLogAlarmModal ref="apiLogAlarmModal"></ApiLogAlarmModal>
</template>
<script lang="ts" name="iot-nuIotCameraInfo" setup>
import {ref} from 'vue';
import {Modal} from 'ant-design-vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { c } from 'node_modules/vite/dist/node/moduleRunnerTransport.d-DJ_mE5sf';
import { defHttp } from '/@/utils/http/axios';
import ApiLogAlarmModal from '/@/views/iot/yiweilian/components/ApiLogAlarmModal.vue'
const apiLogAlarmModal = ref();
const { createMessage } = useMessage();
const emit = defineEmits(['register', 'ok']);
const props = defineProps({
tableData: { type: Object, default: () => ([]) },
});
// 湿
async function handleRead(record) {
const params = {
'sn' : record.sn,
};
await defHttp.get({ url: '/iot/yiweilian/humidDevice/updateDeviceRealTime', params }).then((res) => {
console.log("🚀 ~ handleRead ~ res:", res)
});
setTimeout(() => {
emit("ok");
}, 4000);
}
/**
* 温湿度计查看api日志
*/
function showWsdjApiLog(record) {
apiLogAlarmModal.value.disableSubmit = true;
apiLogAlarmModal.value.showLogAlarm(record);
}
</script>
<style lang="less" scoped>
.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;
}
.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;
}
.tbClass{
background: #f6f6f6;
padding: 8px;
border-radius: 5px;
}
.antTitle{
margin-top: 10px;
display: block;
font-size: 12px;
}
.ytbClass{
font-size:12px;
background: linear-gradient(to right, #1ea0fa, #017de9);
border-radius: 8px;
height: 20px;
color: white;
line-height: 20px;
}
.wtbClass{
font-size:12px;
background: linear-gradient(to right, #cccccc, #cccccc);
border-radius: 8px;
height: 20px;
color: white;
line-height: 20px;
}
</style>

View File

@ -153,12 +153,12 @@
{
label: '损坏',
onClick: handleDeviceBroken.bind(null, record),
ifShow: record.deviceStatus != '损坏'
ifShow: (record.onlineStatus!='待集成' && record.deviceStatus != '损坏')
},
{
label: '更换',
onClick: handleDeviceGh.bind(null, record),
ifShow: (record.dimension == '区域维度' && record.deviceStatus != '损坏')
ifShow: (record.onlineStatus!='待集成' && record.dimension == '区域维度' && record.deviceStatus != '损坏')
},
]
}

View File

@ -39,7 +39,7 @@ function getDataList(type, record) {
console.log("🚀 ~ getDataList ~ type, record:", type, record)
var params = {
type: type,
cid: record.cid
cid: record.sn
}
if (type == '9') {
ApiRequestLogListModal9.value.init(params);