添加水表,温湿度硬件配置及同步功能

This commit is contained in:
yangjun 2025-06-19 14:30:59 +08:00
parent ded861027a
commit b751f4aed7
13 changed files with 770 additions and 64 deletions

View File

@ -0,0 +1,92 @@
<template>
<div class="p-2">
<a-tabs v-model:activeKey="activeKey" type="card" @change="handleChange">
<a-tab-pane key="42" tab="抄表" >
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal42"></NuIotTqApiRequestLogList>
</a-tab-pane>
<a-tab-pane key="49" tab="清零" force-render>
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal49"></NuIotTqApiRequestLogList>
</a-tab-pane>
<a-tab-pane key="43" tab="开阀" force-render>
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal43"></NuIotTqApiRequestLogList>
</a-tab-pane>
<a-tab-pane key="53" tab="关阀" force-render>
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal43"></NuIotTqApiRequestLogList>
</a-tab-pane>
</a-tabs>
</div>
</template>
<script lang="ts" name="departUtils-sysDepart" setup>
import { ref, reactive } from 'vue';
import NuIotTqApiRequestLogList from '/@/views/iot/tq/nuIotTqApiRequestLog/NuIotTqApiRequestLogList.vue';
const activeKey= ref('42');
const dbsbInfo = ref<any>({});
const nuIotTqApiRequestLogListModal42 = ref();
const nuIotTqApiRequestLogListModal43 = ref();
const nuIotTqApiRequestLogListModal49 = ref();
const nuIotTqApiRequestLogListModal53 = ref();
function initLog(record){
activeKey.value = "42";
getDataList(activeKey.value, record);
dbsbInfo.value = record;
}
function getDataList(type, record) {
console.log("🚀 ~ getDataList ~ type, record:", type, record)
var params = {
type: type,
cid: record.cid
}
if(type == '42'){
nuIotTqApiRequestLogListModal42.value.init(params);
}else if(type == '43'){
nuIotTqApiRequestLogListModal43.value.init(params);
}else if(type == '49'){
nuIotTqApiRequestLogListModal49.value.init(params);
}else if(type == '53'){
nuIotTqApiRequestLogListModal53.value.init(params);
}
}
function handleChange(key) {
console.log("🚀 ~ handleChange ~ key:", key)
activeKey.value = key;
getDataList(key, dbsbInfo.value);
}
defineExpose({
initLog,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,66 @@
<template>
<j-modal :title="title" width="70%" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<WaterApiLogList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></WaterApiLogList>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import WaterApiLogList from './WaterApiLogList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 日志
* @param record
*/
function showApiLog(record) {
title.value = '日志';
visible.value = true;
nextTick(() => {
registerForm.value.initLog(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback(params) {
handleCancel();
emit('success',params);
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
showApiLog,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -45,7 +45,6 @@
<TableAction :actions="getTableAction(record)"/>
</template>
</BasicTable>
<DepartUtilsList ref="departUtilsModal" @success="handleParams"></DepartUtilsList>
<HldyUtilsModal ref="hldyUtilsModal" @success="handleHldyParams" ></HldyUtilsModal>
<ApiLogModal ref="apiLogModal"></ApiLogModal>
<NuIotTqElectricitySyncLogListModal ref="syncLogModal"></NuIotTqElectricitySyncLogListModal>
@ -62,14 +61,12 @@
import { columns, searchFormSchema } from './electricity.data';
import {useModal} from "@/components/Modal";
import DepartUtilsList from "@/views/utils/departUtils/DepartUtilsModal.vue";
import HldyUtilsModal from "@/views/utils/nuUtils/HldyUtilsModal.vue";
import ApiLogModal from "@/views/iot/tq/electricity/apilog/ApiLogModal.vue";
import NuIotTqElectricitySyncLogListModal from "/@/views/iot/tq/nuIotTqElectricitySyncLog/NuIotTqElectricitySyncLogListModal.vue";
import { defHttp } from '/@/utils/http/axios';
const queryParam = reactive<any>({});
const departUtilsModal = ref();
const apiLogModal = ref();
const syncLogModal = ref();
const hldyUtilsModal = ref();
@ -112,22 +109,10 @@ import { defHttp } from '/@/utils/http/axios';
(selectedRowKeys.value = []) && reload();
}
//
function handleParams(params){
console.log("🚀 ~ handleParams ~ params:", params)
defHttp.post({
url: "/iot/tq/electricityMeter/edit",
params:params.value
}).then(res=>{
console.log("🚀 ~ getTableAction ~ res:", res)
})
}
//
function handleHldyParams(params){
console.log("🚀 ~ handleParams ~ params:", params)
defHttp.post({
url: "/iot/tq/electricityMeter/edit",
url: "/iot/tq/electricityMeter/editHldy",
params:params
}).then(res=>{
console.log("🚀 ~ getTableAction ~ res:", res)
@ -176,13 +161,6 @@ import { defHttp } from '/@/utils/http/axios';
]
}
/**
* 配置机构信息
*/
function handlePzjg(record: Recordable){
departUtilsModal.value.disableSubmit = false;
departUtilsModal.value.edit(record);
}
//
async function handleRead(record: Recordable) {
@ -271,10 +249,8 @@ import { defHttp } from '/@/utils/http/axios';
* 配置护理单元
*/
function handlePzhldy(record){
console.log("🚀 ~ handlePzhldy ~ record:", record)
hldyUtilsModal.value.disableSubmit = true;
hldyUtilsModal.value.edit(record);
}
</script>

View File

@ -16,7 +16,7 @@ export const columns: BasicColumn[] = [
dataIndex: 'type_dictText'
},
{
title: '上次请求时的值',
title: '上次请求值',
align: "center",
dataIndex: 'requestValue'
},

View File

@ -0,0 +1,169 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="syncType">
<template #label><span title="同步类型">同步类型</span></template>
<a-input placeholder="请输入同步类型" v-model:value="queryParam.syncType" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="status">
<template #label><span title="状态">状态</span></template>
<a-input placeholder="请输入状态" v-model:value="queryParam.status" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<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-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" >
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleSync" preIcon="ant-design:sync-outlined"> 同步</a-button>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</div>
</template>
<script lang="ts" name="nuIotTqElectricitySyncLog-nuIotTqElectricitySyncLog" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuIotTqElectricitySyncLog.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuIotTqElectricitySyncLog.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuIotTqElectricitySyncLogModal from './components/NuIotTqElectricitySyncLogModal.vue'
import { useUserStore } from '/@/store/modules/user';
import { defHttp } from '/@/utils/http/axios';
const formRef = ref();
const queryParam = reactive<any>({});
const syncInfo = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '同步日志',
api: list,
columns,
canResize:false,
useSearchForm: false,
immediate: false,
showIndexColumn: true,
showActionColumn: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 同步事件
*/
function handleSync() {
defHttp.post({
url: '/iot/yiweilian/humidDevice/syncHumidDevice',
params: syncInfo.value,
}).then((res) => {
reload();
});
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
//
function init(record){
console.log("🚀 ~ init ~ record:", record)
syncInfo.value = record;
queryParam.mainId = record.sn;
reload();
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,66 @@
<template>
<j-modal :title="title" width="80%" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<HumidDeviceSyncLogList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></HumidDeviceSyncLogList>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import HumidDeviceSyncLogList from './HumidDeviceSyncLogList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
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 = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* 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

@ -133,7 +133,7 @@ import { defHttp } from '/@/utils/http/axios';
function init(record){
console.log("🚀 ~ init ~ record:", record)
syncInfo.value = record;
queryParam.mainId = record.id;
queryParam.mainId = record.cid;
reload();
}

View File

@ -0,0 +1,169 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="syncType">
<template #label><span title="同步类型">同步类型</span></template>
<a-input placeholder="请输入同步类型" v-model:value="queryParam.syncType" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="status">
<template #label><span title="状态">状态</span></template>
<a-input placeholder="请输入状态" v-model:value="queryParam.status" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<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-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" >
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleSync" preIcon="ant-design:sync-outlined"> 同步</a-button>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</div>
</template>
<script lang="ts" name="nuIotTqElectricitySyncLog-nuIotTqElectricitySyncLog" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuIotTqElectricitySyncLog.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuIotTqElectricitySyncLog.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuIotTqElectricitySyncLogModal from './components/NuIotTqElectricitySyncLogModal.vue'
import { useUserStore } from '/@/store/modules/user';
import { defHttp } from '/@/utils/http/axios';
const formRef = ref();
const queryParam = reactive<any>({});
const syncInfo = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '同步日志',
api: list,
columns,
canResize:false,
useSearchForm: false,
immediate: false,
showIndexColumn: true,
showActionColumn: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 同步事件
*/
function handleSync() {
defHttp.post({
url: '/iot/tq/waterMeter/syncElectricity',
params: syncInfo.value,
}).then((res) => {
reload();
});
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
//
function init(record){
console.log("🚀 ~ init ~ record:", record)
syncInfo.value = record;
queryParam.mainId = record.cid;
reload();
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,66 @@
<template>
<j-modal :title="title" width="80%" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<WaterSyncLogList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></WaterSyncLogList>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import WaterSyncLogList from './WaterSyncLogList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
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 = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* 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

@ -4,12 +4,16 @@
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" preIcon="ant-design:sync-outlined" @click="handleSyncDevice"> 同步设备</a-button>
<a-button preIcon="ant-design:sync-outlined" @click="handleSyncCollector"> 同步采集器</a-button>
<a-button type="primary" preIcon="ant-design:sync-outlined" @click="handleSyncDevice"> 拉取设备</a-button>
<a-button type="primary" preIcon="ant-design:sync-outlined" @click="handleSyncCollector"> 更新在线状态</a-button>
</template>
<template #bodyCell="{ column, record, index, text }">
<template v-if="column.dataIndex === 'address'">
<!-- <template v-if="column.dataIndex === 'address'">
<a @click="showApiLog(record)"> {{record.address}} </a>
</template> -->
<template v-if="column.dataIndex === 'nuName'">
<span v-if="!record.nuName"><a @click="handlePzhldy(record)"> 未配置 </a></span>
<span v-else><a @click="handlePzhldy(record)"> {{record.nuName}} </a></span>
</template>
<template v-if="column.dataIndex === 'relayState'">
<span v-if="record.relayState ==='1'" style="color:green">
@ -52,6 +56,9 @@
<TableAction :actions="getTableAction(record)"/>
</template>
</BasicTable>
<HldyUtilsModal ref="hldyUtilsModal" @success="handleHldyParams" ></HldyUtilsModal>
<ApiLogModal ref="apiLogModal"></ApiLogModal>
<SyncLogListModal ref="syncLogModal"></SyncLogListModal>
</div>
</template>
@ -64,8 +71,15 @@
import {list, waterReset, waterControl, waterRead, getAllMeter, getAllCollector} from './water.api';
import { columns, searchFormSchema } from './water.data';
import {useModal} from "@/components/Modal";
import { defHttp } from '/@/utils/http/axios';
import HldyUtilsModal from "@/views/utils/nuUtils/HldyUtilsModal.vue";
import ApiLogModal from "@/views/iot/tq/electricity/apilog/WaterApiLogModal.vue";
import SyncLogListModal from "/@/views/iot/tq/nuIotTqElectricitySyncLog/WaterSyncLogListModal.vue";
const queryParam = reactive<any>({});
const apiLogModal = ref();
const syncLogModal = ref();
const hldyUtilsModal = ref();
//model
const [registerModal, {openModal}] = useModal();
//table
@ -87,7 +101,7 @@
],
},
actionColumn: {
width: 200,
width: 290,
fixed:'right'
},
beforeFetch: (params) => {
@ -129,7 +143,15 @@
confirm: handleReset.bind(null, record),
placement: 'topLeft',
},
}
},
{
label: '日志',
onClick: showApiLog.bind(null, record),
},
{
label: '同步',
onClick: handleSync.bind(null, record),
},
]
}
@ -208,8 +230,35 @@
reload();
}
/**
* 查看api日志
*/
function showApiLog(record){
console.log(record);
apiLogModal.value.disableSubmit = true;
apiLogModal.value.showApiLog(record);
}
/**
* 配置护理单元
*/
function handlePzhldy(record){
hldyUtilsModal.value.disableSubmit = true;
hldyUtilsModal.value.edit(record);
}
//
function handleHldyParams(params){
defHttp.post({
url: "/iot/tq/waterMeter/editHldy",
params:params
}).then(res=>{
reload();
})
}
//
function handleSync(record: Recordable){
syncLogModal.value.disableSubmit = true;
syncLogModal.value.init(record);
}
</script>

View File

@ -4,12 +4,12 @@ import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
{
title: '机构',
title: '单元编码',
align: "center",
dataIndex: 'departName'
dataIndex: 'nuId'
},
{
title: '护理单元',
title: '单元名称',
align: "center",
dataIndex: 'nuName'
},
@ -19,10 +19,16 @@ export const columns: BasicColumn[] = [
dataIndex: 'address'
},
{
title: '采集器号',
title: '机构名称',
align: "center",
dataIndex: 'cid'
dataIndex: 'departName',
width: 220,
},
// {
// title: '采集器号',
// align: "center",
// dataIndex: 'cid'
// },
{
title: '设备状态',
align: "center",
@ -80,16 +86,16 @@ export const columns: BasicColumn[] = [
align: "center",
dataIndex: 'connectTime'
},
{
title: '上次掉线时间',
align: "center",
dataIndex: 'disconnectTime'
},
{
title: '描述',
align: "center",
dataIndex: 'remark'
},
// {
// title: '上次掉线时间',
// align: "center",
// dataIndex: 'disconnectTime'
// },
// {
// title: '描述',
// align: "center",
// dataIndex: 'remark'
// },
];
export const searchFormSchema: FormSchema[] = [

View File

@ -4,12 +4,12 @@ import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
{
title: '机构',
title: '单元编码',
align: "center",
dataIndex: 'departName'
dataIndex: 'nuId'
},
{
title: '护理单元',
title: '单元名称',
align: "center",
dataIndex: 'nuName'
},
@ -24,19 +24,9 @@ export const columns: BasicColumn[] = [
dataIndex: 'deviceName'
},
{
title: '告警数',
title: '机构',
align: "center",
dataIndex: 'alarmCn'
},
{
title: '记录间隔',
align: "center",
dataIndex: 'recordInterval'
},
{
title: '上报间隔',
align: "center",
dataIndex: 'reportingInterval'
dataIndex: 'departName'
},
{
title: '温度',
@ -53,10 +43,29 @@ export const columns: BasicColumn[] = [
align: "center",
dataIndex: 'reportingTime'
},
{
title: '告警数',
align: "center",
dataIndex: 'alarmCn',
defaultHidden: true,
},
{
title: '记录间隔',
align: "center",
dataIndex: 'recordInterval',
defaultHidden: true,
},
{
title: '上报间隔',
align: "center",
dataIndex: 'reportingInterval',
defaultHidden: true,
},
{
title: '电量',
align: "center",
dataIndex: 'electricity'
dataIndex: 'electricity',
defaultHidden: true,
},
{
title: '在线状态',

View File

@ -7,6 +7,10 @@
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleInsert"> 添加设备</a-button>
</template>
<template #bodyCell="{ column, record, index, text }">
<template v-if="column.dataIndex === 'nuName'">
<span v-if="!record.nuName"><a @click="handlePzhldy(record)"> 未配置 </a></span>
<span v-else><a @click="handlePzhldy(record)"> {{record.nuName}} </a></span>
</template>
<template v-if="column.dataIndex === 'status'">
<span v-if="record.status ==='0'" style="color:green">
在线
@ -23,6 +27,8 @@
</BasicTable>
<DeviceInfoDrawer @register="registerDrawer" @success="handleSuccess" />
<ApiLogAlarmModal ref="apiLogAlarmModal"></ApiLogAlarmModal>
<HldyUtilsModal ref="hldyUtilsModal" @success="handleHldyParams" ></HldyUtilsModal>
<HumidDeviceSyncLogListModal ref="syncLogModal"></HumidDeviceSyncLogListModal>
</div>
</template>
@ -37,7 +43,12 @@
import {useModal} from "@/components/Modal";
import {useDrawer} from "@/components/Drawer";
import ApiLogAlarmModal from './components/ApiLogAlarmModal.vue'
import HldyUtilsModal from "@/views/utils/nuUtils/HldyUtilsModal.vue";
import HumidDeviceSyncLogListModal from "/@/views/iot/tq/nuIotTqElectricitySyncLog/HumidDeviceSyncLogListModal.vue";
import { defHttp } from '/@/utils/http/axios';
const apiLogAlarmModal = ref();
const hldyUtilsModal = ref();
const syncLogModal = ref();
//drawer
const [registerDrawer, { openDrawer }] = useDrawer();
const queryParam = reactive<any>({});
@ -62,7 +73,7 @@
],
},
actionColumn: {
width: 200,
width: 290,
fixed:'right'
},
beforeFetch: (params) => {
@ -105,6 +116,10 @@
label: '日志',
onClick: handleApiLogAlarm.bind(null, record),
},
{
label: '同步',
onClick: handleSync.bind(null, record),
},
]
}
@ -153,4 +168,27 @@
apiLogAlarmModal.value.showLogAlarm(record);
}
//
function handleHldyParams(params){
defHttp.post({
url: "/iot/yiweilian/humidDevice/editHldy",
params:params
}).then(res=>{
console.log("🚀 ~ getTableAction ~ res:", res)
reload();
})
}
/**
* 配置护理单元
*/
function handlePzhldy(record){
hldyUtilsModal.value.disableSubmit = true;
hldyUtilsModal.value.edit(record);
}
//
function handleSync(record: Recordable){
syncLogModal.value.disableSubmit = true;
syncLogModal.value.init(record);
}
</script>