物联设备BUG处理

This commit is contained in:
曹磊 2026-04-20 21:17:33 +08:00
parent d53327e7ed
commit 2f5a87de02
4 changed files with 127 additions and 4 deletions

View File

@ -75,6 +75,9 @@
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import CameraPreviewModal from '/@/views/iot/tplink/camera/components/CameraPreviewModal.vue' import CameraPreviewModal from '/@/views/iot/tplink/camera/components/CameraPreviewModal.vue'
import { eleControl } from "@/views/iot/tq/electricity/electricity.api";
import { eleSbControl } from "@/views/iot/tq/water/water.api";
import { updateDeviceRealTime } from '@/views/iot/yiweilian/humid.api';
const formRef = ref(); const formRef = ref();
const queryParam = reactive<any>({}); const queryParam = reactive<any>({});
@ -155,9 +158,34 @@
return [ return [
{ {
label: '预览', label: '预览',
onClick: handleCameraView.bind(null, record,"预览"), onClick: handleCameraView.bind(null, record),
ifShow: record.onlineStatus!='待集成' && record.deviceType == 'SURVEILLANCECAMERA' ifShow: record.onlineStatus!='待集成' && record.deviceType == 'SURVEILLANCECAMERA'
}, },
{
label: '拉闸',
onClick: handleDbLz.bind(null, record),
ifShow: record.onlineStatus!='待集成' && record.deviceType == 'db' && record.status == '在线'
},
{
label: '合闸',
onClick: handleDbHz.bind(null, record),
ifShow: record.onlineStatus!='待集成' && record.deviceType == 'db' && record.status == '离线'
},
{
label: '关阀',
onClick: handleSbGz.bind(null, record),
ifShow: record.onlineStatus!='待集成' && record.deviceType == 'sb' && record.status == '在线'
},
{
label: '开阀',
onClick: handleSbKz.bind(null, record),
ifShow: record.onlineStatus!='待集成' && record.deviceType == 'sb' && record.status == '离线'
},
{
label: '抄表',
onClick: handleWsdjCb.bind(null, record),
ifShow: record.onlineStatus!='待集成' && record.deviceType == 'wsdj'
},
{ {
label: '绑定区域', label: '绑定区域',
onClick: handleDeviceGh.bind(null, record,"绑定"), onClick: handleDeviceGh.bind(null, record,"绑定"),
@ -180,12 +208,82 @@
* 预览 * 预览
*/ */
function handleCameraView(record: Recordable) { function handleCameraView(record: Recordable) {
console.log(record);
record.streamType = 1; record.streamType = 1;
cameraViewRef.value.disableSubmit = true; cameraViewRef.value.disableSubmit = true;
cameraViewRef.value.edit(record); cameraViewRef.value.edit(record);
} }
/**
* 拉闸
*/
async function handleDbLz(record: Recordable) {
const params = {
'sn' : record.sn,
'type': '10'
};
await eleControl(params);
setTimeout(() => {
emit("ok");
}, 4000);
}
/**
* 合闸
*/
async function handleDbHz(record: Recordable) {
const params = {
'sn' : record.sn,
'type': '11',
};
await eleControl(params);
setTimeout(() => {
emit("ok");
}, 4000);
}
/**
* 开阀
*/
async function handleSbKz(record: Recordable) {
const params = {
'cid': record.sn,
'address': record.sn,
'type': '43',
};
await eleSbControl(params);
setTimeout(() => {
emit("ok");
}, 4000);
}
/**
* 关阀
*/
async function handleSbGz(record: Recordable) {
const params = {
'cid': record.sn,
'address': record.sn,
'type': '53',
};
await eleSbControl(params);
setTimeout(() => {
emit("ok");
}, 4000);
}
/**
* 温湿度计抄表
*/
async function handleWsdjCb(record: Recordable) {
const params = {
'sn' : record.sn,
};
await updateDeviceRealTime(params);
setTimeout(() => {
reload();
}, 4000);
}
/** /**
* 报损 * 报损
*/ */

View File

@ -26,6 +26,8 @@
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button> <a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" <a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button> style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls" style="margin-left: 8px"> 导出</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXlsHz" style="margin-left: 8px"> 导出汇总</a-button>
</a-col> </a-col>
</span> </span>
</a-col> </a-col>
@ -36,7 +38,6 @@
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<!--插槽:table标题--> <!--插槽:table标题-->
<template #tableTitle> <template #tableTitle>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
</template> </template>
<!--操作栏--> <!--操作栏-->
<template #action="{ record }"> <template #action="{ record }">
@ -55,13 +56,15 @@ import {ref, reactive, defineExpose, nextTick, createVNode} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import { previewColumns } from '../../manager.data'; import { previewColumns } from '../../manager.data';
import { previewList,getExportUrl } from '../../manager.api'; import { previewList,getExportUrl,exportDeviceHzExcel } from '../../manager.api';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
import DevicePreviewFormModal from './DevicePreviewFormModal.vue'; import DevicePreviewFormModal from './DevicePreviewFormModal.vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import {Modal} from "ant-design-vue"; import {Modal} from "ant-design-vue";
import {ExclamationCircleOutlined} from "@ant-design/icons-vue"; import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
import {useMethods} from "@/hooks/system/useMethods";
const { handleExportXls} = useMethods();
const formRef = ref(); const formRef = ref();
const queryParam = reactive<any>({}); const queryParam = reactive<any>({});
const formDrawer = ref(); const formDrawer = ref();
@ -108,6 +111,10 @@ const wrapperCol = reactive({
sm: 16, sm: 16,
}); });
async function onExportXlsHz() {
return handleExportXls('导出设备汇总', exportDeviceHzExcel, {});
}
/** /**
* 成功回调 * 成功回调
*/ */

View File

@ -7,6 +7,7 @@ enum Api {
edit = '/iot/device/manager/edit', edit = '/iot/device/manager/edit',
delete = '/iot/device/manager/delete', delete = '/iot/device/manager/delete',
exportXls = '/iot/device/manager/exportXls', exportXls = '/iot/device/manager/exportXls',
exportDeviceHzExcel = '/iot/device/manager/exportDeviceHzExcel',
bingLogList = '/iot/device/manager/bingLogList', bingLogList = '/iot/device/manager/bingLogList',
nuList = '/iot/device/manager/nuList', nuList = '/iot/device/manager/nuList',
addLog = '/iot/device/manager/addLog', addLog = '/iot/device/manager/addLog',
@ -17,6 +18,7 @@ enum Api {
* @param params * @param params
*/ */
export const getExportUrl = Api.exportXls; export const getExportUrl = Api.exportXls;
export const exportDeviceHzExcel = Api.exportDeviceHzExcel;
/** /**
* *
* @param params * @param params

View File

@ -3,6 +3,11 @@ import {FormSchema} from '/@/components/Table';
//列表数据 //列表数据
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{
title: '批次',
align: "center",
dataIndex: 'batchNo',
},
{ {
title: '区域编码', title: '区域编码',
align: "center", align: "center",
@ -73,6 +78,11 @@ export const columns: BasicColumn[] = [
//列表数据 //列表数据
export const previewColumns: BasicColumn[] = [ export const previewColumns: BasicColumn[] = [
{
title: '批次',
align: "center",
dataIndex: 'batchNo',
},
{ {
title: '设备名称', title: '设备名称',
align: "center", align: "center",
@ -187,6 +197,12 @@ export const logColumns: BasicColumn[] = [
dataIndex: 'optType', dataIndex: 'optType',
width: 100 width: 100
}, },
{
title: '备注',
align: "center",
dataIndex: 'remarks',
width: 200
},
]; ];
export const searchFormSchema: FormSchema[] = []; export const searchFormSchema: FormSchema[] = [];