物联设备管理同步推送

This commit is contained in:
曹磊 2026-04-08 17:46:41 +08:00
parent b22117610b
commit 94e37d2bee
8 changed files with 115 additions and 28 deletions

View File

@ -32,19 +32,21 @@
</a-row>
</a-form>
</div>
<a-spin :spinning="confirmLoading">
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="addBatch"> 新增批次</a-button>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="addBatch"> 新增批次</a-button>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</a-spin>
<!-- 表单区域 -->
<DeviceBatchFormModal ref="deviceBatchDrawer" @success="handleSuccess" />
<DepartPreviewModal ref="previewDrawer" @success="handleSuccess" />
@ -61,12 +63,15 @@ import { useUserStore } from '/@/store/modules/user';
import DeviceBatchFormModal from './DeviceBatchFormModal.vue';
import DepartPreviewModal from "../preview/DepartPreviewModal.vue";
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import {changeTheme} from "@/logics/theme";
const formRef = ref();
const queryParam = reactive<any>({});
const deviceBatchDrawer = ref();
const previewDrawer = ref();
const orgCode = ref<any>('');
const confirmLoading = ref<any>(false);
const izShow = ref<any>(true);
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
@ -134,8 +139,17 @@ function handlePreview(record: Recordable){
* 推送
*/
async function handleSend(record: Recordable){
await sendBatch(record);
reload();
izShow.value = false;
confirmLoading.value = true;
await sendBatch(record).then((res) => {
setTimeout(() => {
reload();
}, 8000);
}).finally(() => {
setTimeout(() => {
confirmLoading.value = false;
}, 8000);
});
}
/**
@ -167,12 +181,12 @@ function getTableAction(record) {
{
label: '推送清单',
onClick: handleSend.bind(null, record),
ifShow: record.izPush == 'N' && record.childrenCn > 0
ifShow: record.izPush == 'N' && record.childrenCn > 0 && izShow.value
},
{
label: '编辑',
onClick: handleEdit.bind(null, record),
ifShow: record.izPush == 'N'
ifShow: record.izPush == 'N' && izShow.value
},
{
label: '删除',
@ -180,7 +194,7 @@ function getTableAction(record) {
title: '是否确定删除?',
confirm: handleDelete.bind(null, record),
},
ifShow: record.izPush == 'N'
ifShow: record.izPush == 'N' && izShow.value
},
];
}

View File

@ -33,7 +33,7 @@ import { ref, reactive} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { deviceColumns } from './integration.data';
import { cameraList } from './integration.api';
import {cameraList, pullCamera} from './integration.api';
import { useUserStore } from '/@/store/modules/user';
import CameraPreviewModal from '/@/views/iot/tplink/camera/components/CameraPreviewModal.vue'
const previewModal = ref();
@ -115,6 +115,17 @@ function handlePreview(record: Recordable) {
previewModal.value.edit(record);
}
/**
* 拉取设备
*/
async function handlePull(record: Recordable) {
await pullCamera(record).then((res) => {
setTimeout(() => {
reload();
}, 4000);
})
}
/**
* 操作栏
*/
@ -122,7 +133,7 @@ function getTableAction(record) {
return [
{
label: '拉取设备',
onClick: handlePreview.bind(null, record),
onClick: handlePull.bind(null, record),
ifShow: record.sn != null && record.deviceStatus =='待集成'
},
{

View File

@ -32,8 +32,9 @@ import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { deviceColumns } from './integration.data';
import { electricityList } from './integration.api';
import { electricityList,pullElectricity } from './integration.api';
import { useUserStore } from '/@/store/modules/user';
import {sendBatch} from "@/views/device/manager/components/batch/batch.api";
const previewModal = ref();
const formRef = ref();
const queryParam = reactive<any>({});
@ -100,6 +101,17 @@ function searchReset() {
reload();
}
/**
* 拉取设备
*/
async function handlePull(record: Recordable) {
await pullElectricity(record).then((res) => {
setTimeout(() => {
reload();
}, 4000);
})
}
/**
* 操作栏
*/
@ -107,7 +119,7 @@ function getTableAction(record) {
return [
{
label: '拉取设备',
// onClick: handlePreview.bind(null, record),
onClick: handlePull.bind(null, record),
ifShow: record.sn != null && record.deviceStatus =='待集成'
},
];

View File

@ -32,7 +32,7 @@ import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { deviceColumns } from './integration.data';
import { humidList } from './integration.api';
import {humidList, pullHumid} from './integration.api';
import { useUserStore } from '/@/store/modules/user';
const previewModal = ref();
const formRef = ref();
@ -113,6 +113,17 @@ function handleConfig(record: Recordable) {
previewModal.value.edit(record);
}
/**
* 拉取设备
*/
async function handlePull(record: Recordable) {
await pullHumid(record).then((res) => {
setTimeout(() => {
reload();
}, 4000);
})
}
/**
* 操作栏
*/
@ -120,7 +131,7 @@ function getTableAction(record) {
return [
{
label: '拉取设备',
// onClick: handlePreview.bind(null, record),
onClick: handlePull.bind(null, record),
ifShow: record.sn != null && record.deviceStatus =='待集成'
},
{

View File

@ -32,7 +32,7 @@ import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { deviceColumns } from './integration.data';
import { networkList } from './integration.api';
import {networkList, pullNetwork} from './integration.api';
import { useUserStore } from '/@/store/modules/user';
const previewModal = ref();
const formRef = ref();
@ -100,6 +100,17 @@ function searchReset() {
reload();
}
/**
* 拉取设备
*/
async function handlePull(record: Recordable) {
await pullNetwork(record).then((res) => {
setTimeout(() => {
reload();
}, 4000);
})
}
/**
* 操作栏
*/
@ -107,7 +118,7 @@ function getTableAction(record) {
return [
{
label: '拉取设备',
// onClick: handlePreview.bind(null, record),
onClick: handlePull.bind(null, record),
ifShow: record.sn != null && record.deviceStatus =='待集成'
},
];

View File

@ -32,7 +32,7 @@ import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { deviceColumns } from './integration.data';
import { waterList } from './integration.api';
import {pullWater, waterList} from './integration.api';
import { useUserStore } from '/@/store/modules/user';
const previewModal = ref();
const formRef = ref();
@ -100,6 +100,17 @@ function searchReset() {
reload();
}
/**
* 拉取设备
*/
async function handlePull(record: Recordable) {
await pullWater(record).then((res) => {
setTimeout(() => {
reload();
}, 4000);
})
}
/**
* 操作栏
*/
@ -107,7 +118,7 @@ function getTableAction(record) {
return [
{
label: '拉取设备',
// onClick: handlePreview.bind(null, record),
onClick: handlePull.bind(null, record),
ifShow: record.sn != null && record.deviceStatus =='待集成'
},
];

View File

@ -6,6 +6,13 @@ enum Api {
electricityList = '/iot/device/manager/electricityList',
waterList = '/iot/device/manager/waterList',
humidList = '/iot/device/manager/humidList',
pullCamera = '/iot/device/manager/pullCamera',
pullNetwork = '/iot/device/manager/pullNetwork',
pullElectricity = '/iot/device/manager/pullElectricity',
pullWater = '/iot/device/manager/pullWater',
pullHumid = '/iot/device/manager/pullHumid',
}
/**
@ -18,4 +25,8 @@ export const electricityList = (params) => defHttp.get({ url: Api.electricityLis
export const waterList = (params) => defHttp.get({ url: Api.waterList, params });
export const humidList = (params) => defHttp.get({ url: Api.humidList, params });
export const pullCamera = (params) => defHttp.post({ url: Api.pullCamera, params });
export const pullNetwork = (params) => defHttp.post({ url: Api.pullNetwork, params });
export const pullElectricity = (params) => defHttp.post({ url: Api.pullElectricity, params });
export const pullWater = (params) => defHttp.post({ url: Api.pullWater, params });
export const pullHumid = (params) => defHttp.post({ url: Api.pullHumid, params });

View File

@ -15,6 +15,12 @@ export const deviceColumns: BasicColumn[] = [
dataIndex: 'sn',
width: 150
},
{
title: '设备名称',
align: "center",
dataIndex: 'deviceName',
width: 150
},
{
title: '设备类型',
align: "center",