This commit is contained in:
1378012178@qq.com 2025-06-19 15:01:26 +08:00
commit 109de00181
27 changed files with 2161 additions and 113 deletions

View File

@ -1,12 +1,12 @@
<template>
<div class="p-2">
<a-tabs v-model:activeKey="activeKey" type="card" @change="handleChange">
<a-tab-pane key="9" tab="清零">
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal9"></NuIotTqApiRequestLogList>
</a-tab-pane>
<a-tab-pane key="3" tab="抄表" force-render>
<a-tab-pane key="3" tab="抄表" >
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal3"></NuIotTqApiRequestLogList>
</a-tab-pane>
<a-tab-pane key="9" tab="清零" force-render>
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal9"></NuIotTqApiRequestLogList>
</a-tab-pane>
<a-tab-pane key="10" tab="电表拉闸" force-render>
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal10"></NuIotTqApiRequestLogList>
</a-tab-pane>
@ -22,14 +22,14 @@
import NuIotTqApiRequestLogList from '/@/views/iot/tq/nuIotTqApiRequestLog/NuIotTqApiRequestLogList.vue';
const activeKey= ref('9');
const activeKey= ref('3');
const dbsbInfo = ref<any>({});
const nuIotTqApiRequestLogListModal9 = ref();
const nuIotTqApiRequestLogListModal3 = ref();
const nuIotTqApiRequestLogListModal10 = ref();
const nuIotTqApiRequestLogListModal11 = ref();
function initLog(record){
activeKey.value = "9";
activeKey.value = "3";
getDataList(activeKey.value, record);
dbsbInfo.value = record;
}

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

@ -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",
@ -72,16 +78,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,17 +4,10 @@
<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'">
<a @click="showApiLog(record)"> {{record.address}} </a>
</template>
<template v-if="column.dataIndex === 'departName'">
<span v-if="!record.departName"><a @click="handlePzjg(record)"> 未配置 </a></span>
<span v-else><a @click="handlePzjg(record)"> {{record.departName}} </a></span>
</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>
@ -52,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>
@ -69,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();
@ -101,7 +91,7 @@ import { defHttp } from '/@/utils/http/axios';
],
},
actionColumn: {
width: 240,
width: 290,
fixed:'right'
},
beforeFetch: (params) => {
@ -119,25 +109,14 @@ 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",
params:params.value
url: "/iot/tq/electricityMeter/editHldy",
params:params
}).then(res=>{
console.log("🚀 ~ getTableAction ~ res:", res)
reload();
})
}
//
@ -171,6 +150,10 @@ import { defHttp } from '/@/utils/http/axios';
placement: 'topLeft',
},
},
{
label: '日志',
onClick: showApiLog.bind(null, record),
},
{
label: '同步',
onClick: handleSync.bind(null, record),
@ -178,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) {
@ -273,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,44 +16,80 @@ export const columns: BasicColumn[] = [
dataIndex: 'type_dictText'
},
{
title: '请求时的值',
title: '上次请求值',
align: "center",
dataIndex: 'requestValue'
},
{
title: '请求时间',
align: "center",
dataIndex: 'requestTime'
},
{
title: '请求状态',
align: "center",
dataIndex: 'requestStatus_dictText'
},
{
title: '请求描述',
align: "center",
dataIndex: 'requestRemark'
},
{
title: '反馈值',
title: '本次请求值',
align: "center",
dataIndex: 'resolveValue'
},
{
title: '反馈时间',
title: '本次请求时间',
align: "center",
dataIndex: 'requestTime'
},
{
title: '本次请求状态',
align: "center",
dataIndex: 'requestStatus_dictText'
},
{
title: '本次反馈时间',
align: "center",
dataIndex: 'resolveTime'
},
{
title: '反馈状态',
title: '本次反馈状态',
align: "center",
dataIndex: 'resolveStatus_dictText'
},
{
title: '反馈描述',
align: "center",
dataIndex: 'resolveRemark'
dataIndex: 'resolveRemark',
defaultHidden: true
},
];
//列表数据
export const columns2: BasicColumn[] = [
{
title: '表号',
align: "center",
dataIndex: 'address'
},
{
title: '类型',
align: "center",
dataIndex: 'type_dictText'
},
{
title: '本次请求时间',
align: "center",
dataIndex: 'requestTime'
},
{
title: '本次请求状态',
align: "center",
dataIndex: 'requestStatus_dictText'
},
{
title: '本次反馈时间',
align: "center",
dataIndex: 'resolveTime'
},
{
title: '本次反馈状态',
align: "center",
dataIndex: 'resolveStatus_dictText'
},
{
title: '反馈描述',
align: "center",
dataIndex: 'resolveRemark',
defaultHidden: true
},
];

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

@ -0,0 +1,114 @@
<template>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</template>
<script lang="ts" name="yiweilian-apiLogList" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { alarmColumns, alarmQuerySchema } from '../humid.data';
import { alarmList } from '../humid.api';
import { useUserStore } from '/@/store/modules/user';
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext } = useListPage({
tableProps: {
title: '告警日志',
api: alarmList,
columns:alarmColumns,
canResize:false,
showActionColumn: false,
// showTableSetting: false,
formConfig: {
//labelWidth: 120,
schemas: alarmQuerySchema,
autoSubmitOnEnter:false,
showAdvancedButton:false,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
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:8,
xl:6,
xxl:8
});
const wrapperCol = reactive({
xs: 24,
sm: 16,
});
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
function init(record) {
console.log("🚀 ~ init ~ record:", record)
queryParam.sn = record.sn;
reload();
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
</style>

View File

@ -0,0 +1,56 @@
<template>
<a-tabs v-model:activeKey="activeKey" type="card" @change="handleChange">
<a-tab-pane key="1" tab="抄表">
<ApiLogList ref="apiLogList"></ApiLogList>
</a-tab-pane>
<a-tab-pane key="2" tab="告警" force-render>
<AlarmList ref="alarmList"></AlarmList>
</a-tab-pane>
</a-tabs>
</template>
<script lang="ts" name="departUtils-sysDepart" setup>
import { ref, reactive } from 'vue';
import ApiLogList from './ApiLogList.vue';
import AlarmList from './AlarmList.vue';
const activeKey= ref('1');
const dbsbInfo = ref<any>({});
const apiLogList = ref();
const alarmList = ref();
function init(record){
activeKey.value = "1";
getDataList(activeKey.value, record);
dbsbInfo.value = record;
}
function getDataList(type, record) {
console.log("🚀 ~ getDataList ~ type, record:", type, record)
var params = {
sn: record.sn
}
if(type == '1'){
apiLogList.value.init(params);
}else if(type == '2'){
alarmList.value.init(params);
}
}
function handleChange(key) {
console.log("🚀 ~ handleChange ~ key:", key)
activeKey.value = key;
getDataList(key, dbsbInfo.value);
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
//:deep(.ant-tabs-nav){
// margin: 0 !important;
//}
</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="关闭">
<ApiLogAlarmList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ApiLogAlarmList>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ApiLogAlarmList from './ApiLogAlarmList.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 showLogAlarm(record) {
title.value = '日志';
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback(params) {
handleCancel();
emit('success',params);
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
showLogAlarm,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,114 @@
<template>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</template>
<script lang="ts" name="yiweilian-apiLogList" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { logColumns, logQuerySchema } from '../humid.data';
import { logList } from '../humid.api';
import { useUserStore } from '/@/store/modules/user';
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext } = useListPage({
tableProps: {
title: '操作日志',
api: logList,
columns:logColumns,
canResize:false,
showActionColumn: false,
// showTableSetting: false,
formConfig: {
//labelWidth: 120,
schemas: logQuerySchema,
autoSubmitOnEnter:false,
showAdvancedButton:false,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
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:8,
xl:6,
xxl:8
});
const wrapperCol = reactive({
xs: 24,
sm: 16,
});
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
function init(record) {
console.log("🚀 ~ init ~ record:", record)
queryParam.sn = record.sn;
reload();
}
defineExpose({
init,
});
</script>
<style lang="less" scoped>
</style>

View File

@ -0,0 +1,119 @@
<template>
<BasicDrawer
v-bind="$attrs"
@register="registerDrawer"
:title="getTitle"
:width="adaptiveWidth"
@ok="handleSubmit"
:showFooter="showFooter"
destroyOnClose
>
<BasicForm @register="registerForm" >
<template #customInput="{ model, field }">
<a-button preIcon="ant-design:appstore-outlined" @click="readParameters(model)">读取</a-button>
</template>
</BasicForm>
</BasicDrawer>
</template>
<script lang="ts" setup>
import {defineComponent, ref, computed, unref, useAttrs, createVNode, h} from 'vue';
import { BasicForm, useForm } from '/@/components/Form/index';
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
import { useDrawerAdaptiveWidth } from '/@/hooks/jeecg/useAdaptiveWidth';
import {Modal} from "ant-design-vue";
import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
import { formSchema } from "../humid.data";
import {insertDevice, updateDevice, getDeviceParameters} from '../humid.api';
import {getMultitransUrl} from "@/views/iot/tplink/camera/camera.api";
// Emits
const emit = defineEmits(['success', 'register']);
const attrs = useAttrs();
const isUpdate = ref(true);
const rowId = ref('');
const departOptions = ref([]);
let isFormDepartUser = false;
//
const [registerForm, { setProps, resetFields, setFieldsValue, validate, updateSchema }] = useForm({
labelWidth: 90,
schemas: formSchema,
showActionButtonGroup: false,
});
const showFooter = ref(true);
//
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
await resetFields();
showFooter.value = data?.showFooter ?? true;
setDrawerProps({ confirmLoading: false, showFooter: showFooter.value });
isUpdate.value = !!data?.isUpdate;
//
if (typeof data.record === 'object') {
setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !showFooter.value });
});
//
const getTitle = computed(() => {
if (!unref(isUpdate)) {
return '新增温湿度';
} else {
return unref(showFooter) ? '编辑温湿度' : '温湿度详情';
}
});
const { adaptiveWidth } = useDrawerAdaptiveWidth();
/**
* 提交事件
*/
async function handleSubmit() {
try {
let values = await validate();
console.log('values==>',values);
setDrawerProps({ confirmLoading: true });
let params = values;
console.log('params==>',params);
if (!unref(isUpdate)) {
//
await insertDevice(params);
} else {
//
await updateDevice(params);
}
//
closeDrawer();
//
emit('success');
} finally {
setDrawerProps({ confirmLoading: false });
}
}
/**
* 读取参数
* @param record
*/
function readParameters(record){
getDeviceParameters({
"sn":record.sn
}).then(res=> {
console.log(res);
if (typeof res === 'object') {
setFieldsValue({
...res,
});
}
})
}
</script>
<style scoped>
:deep(.ant-input-number) {
width: 100%;
}
</style>

View File

@ -0,0 +1,60 @@
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/iot/yiweilian/humidDevice/list',
insertDevice = '/iot/yiweilian/humidDevice/insertDevice',
updateDevice = '/iot/yiweilian/humidDevice/updateDevice',
deleteDevice = '/iot/yiweilian/humidDevice/deleteDevice',
getDeviceParameters = '/iot/yiweilian/humidDevice/getDeviceParameters',
updateDeviceRealTime = '/iot/yiweilian/humidDevice/updateDeviceRealTime',
logList = '/iot/yiweilian/humidDevice/logList',
alarmList = '/iot/yiweilian/humidAlarm/list',
}
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
*/
export const insertDevice = (params?) => defHttp.get({ url: Api.insertDevice, params });
/**
*
* @param params
*/
export const updateDevice = (params?) => defHttp.get({ url: Api.updateDevice, params });
/**
*
* @param params
*/
export const deleteDevice = (params?) => defHttp.get({ url: Api.deleteDevice, params });
/**
*
* @param params
*/
export const getDeviceParameters = (params?) => defHttp.get({ url: Api.getDeviceParameters, params });
/**
*
* @param params
*/
export const updateDeviceRealTime = (params?) => defHttp.get({ url: Api.updateDeviceRealTime, params });
/**
*
* @param params
*/
export const logList = (params?) => defHttp.get({ url: Api.logList, params });
/**
*
* @param params
*/
export const alarmList = (params?) => defHttp.get({ url: Api.alarmList, params });

View File

@ -0,0 +1,538 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
{
title: '单元编码',
align: "center",
dataIndex: 'nuId'
},
{
title: '单元名称',
align: "center",
dataIndex: 'nuName'
},
{
title: '设备序号',
align: "center",
dataIndex: 'sn'
},
{
title: '设备名称',
align: "center",
dataIndex: 'deviceName'
},
{
title: '机构',
align: "center",
dataIndex: 'departName'
},
{
title: '温度',
align: "center",
dataIndex: 'temperature'
},
{
title: '湿度',
align: "center",
dataIndex: 'humidity'
},
{
title: '最新上报时间',
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',
defaultHidden: true,
},
{
title: '在线状态',
align: "center",
dataIndex: 'status',
customRender:({record})=>{
return record.status?(record.status=='0'?'在线':'离线'):'';
},
},
];
export const searchFormSchema: FormSchema[] = [
{
label: '机构',
field: 'deviceStatus',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择机构',
dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc',
},
colProps: { span: 6 },
},
{
label: '护理单元',
field: 'deviceStatus',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择护理单元',
dictCode: 'nu_base_info,nu_name,id,del_flag = 0 order by nu_name asc',
},
colProps: { span: 6 },
},
{
label: '设备序号',
field: 'sn',
component: 'Input',
colProps: { span: 6 },
},
{
label: '在线状态',
field: 'status',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择状态',
options: [
{ label: '在线', value: '0' },
{ label: '离线', value: '1' },
],
},
colProps: { span: 6 },
},
];
export const formSchema: FormSchema[] = [
{
label: '',
field: 'isUpdate',
component: 'Input',
ifShow: false,
},
{
label: '设备序号',
field: 'sn',
component: 'Input',
dynamicDisabled: ({ values }) => {
return values.isUpdate;
},
required: true,
labelWidth: '160px'
},
{
label: '设备名称',
field: 'deviceName',
component: 'Input',
required: true,
labelWidth: '160px'
},
{
label: '时区',
field: 'timeCode',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择时区',
options: [
{ label: '北京时间', value: '01' },
/* { label: '纽约时间', value: '02' },*/
],
},
required: true,
labelWidth: '160px'
},
{
label: '设备类型',
field: 'deviceTypes',
component: 'Input',
show: false,
},
{
label: '记录间隔(分钟)',
field: 'recordInterval',
component: 'InputNumber',
ifShow: ({ values }) => {
//有值就是显示
return values.isUpdate;
},
required: true,
labelWidth: '160px'
},
{
label: '上报间隔(分钟)',
field: 'reportingInterval',
component: 'InputNumber',
ifShow: ({ values }) => {
//有值就是显示
return values.isUpdate;
},
required: true,
labelWidth: '160px'
},
{
label: '历史上报时刻(00:00)',
field: 'historyReportTime',
component: 'Input',
componentProps: {
size:'default',
showNow: true,
},
ifShow: ({ values }) => {
//有值就是显示
return values.isUpdate;
},
required: true,
labelWidth: '160px'
},
{
label: '历史上报间隔(小时)',
field: 'historyInterval',
component: 'InputNumber',
ifShow: ({ values }) => {
//有值就是显示
return values.isUpdate;
},
required: true,
labelWidth: '160px'
},
{
label: '温度预警-上限',
field: 'temperatureHigh',
component: 'InputNumber',
ifShow: ({ values }) => {
//有值就是显示
return values.isUpdate;
},
required: true,
labelWidth: '160px'
},
{
label: '温度预警-下限',
field: 'temperatureLow',
component: 'InputNumber',
ifShow: ({ values }) => {
//有值就是显示
return values.isUpdate;
},
required: true,
labelWidth: '160px'
},
{
label: '温度缓冲值',
field: 'temperatureBuffer',
component: 'InputNumber',
ifShow: ({ values }) => {
//有值就是显示
return values.isUpdate;
},
required: true,
labelWidth: '160px'
},
{
label: '湿度预警-上限',
field: 'humidityHigh',
component: 'InputNumber',
ifShow: ({ values }) => {
//有值就是显示
return values.isUpdate;
},
required: true,
labelWidth: '160px'
},
{
label: '湿度预警-下限',
field: 'humidityLow',
component: 'InputNumber',
ifShow: ({ values }) => {
//有值就是显示
return values.isUpdate;
},
required: true,
labelWidth: '160px'
},
{
label: '湿度缓冲值',
field: 'humidityBuffer',
component: 'InputNumber',
ifShow: ({ values }) => {
//有值就是显示
return values.isUpdate;
},
required: true,
labelWidth: '160px'
},
{
label: '断电报警开关',
field: 'izOutages',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择开关',
options: [
{ label: '开启', value: '0' },
{ label: '关闭', value: '1' },
],
},
ifShow: ({ values }) => {
//有值就是显示
return values.isUpdate;
},
required: true,
labelWidth: '160px'
},
{
label: '低电报警开关',
field: 'izLowBattery',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择开关',
options: [
{ label: '开启', value: '0' },
{ label: '关闭', value: '1' },
],
},
ifShow: ({ values }) => {
//有值就是显示
return values.isUpdate;
},
required: true,
labelWidth: '160px'
},
{
label: '上下线通知开关',
field: 'izOnline',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择开关',
options: [
{ label: '开启', value: '0' },
{ label: '关闭', value: '1' },
],
},
ifShow: ({ values }) => {
//有值就是显示
return values.isUpdate;
},
required: true,
labelWidth: '160px'
},
{
label: '读取参数',
field: 'id',
component: 'Input',
slot: 'customInput',
ifShow: ({ values }) => {
//有值就是显示
return values.isUpdate;
},
labelWidth: '160px'
}
];
//列表数据
export const logColumns: BasicColumn[] = [
{
title: '设备序号',
align: "center",
dataIndex: 'sn'
},
{
title: '操作时间',
align: "center",
dataIndex: 'optTime'
},
{
title: '操作人',
align: "center",
dataIndex: 'optBy'
},
{
title: '操作类型',
align: "center",
dataIndex: 'optType',
customRender:({record})=>{
if(record.optType == 'insert'){
return '新增';
}else if(record.optType == 'update'){
return '修改';
}else if(record.optType == 'delete'){
return '删除';
}else{
return '';
}
},
},
{
title: '记录间隔',
align: "center",
dataIndex: 'recordInterval'
},
{
title: '上报间隔',
align: "center",
dataIndex: 'reportingInterval'
},
{
title: '历史数据上报时刻',
align: "center",
dataIndex: 'historyReportTime'
},
{
title: '历史数据上报间隔',
align: "center",
dataIndex: 'historyInterval'
},
{
title: '温度预警-上限',
align: "center",
dataIndex: 'temperatureHigh'
},
{
title: '温度预警-下限',
align: "center",
dataIndex: 'temperatureLow'
},
{
title: '温度缓冲值',
align: "center",
dataIndex: 'temperatureBuffer'
},
{
title: '湿度预警-上限',
align: "center",
dataIndex: 'humidityHigh'
},
{
title: '湿度预警-下限',
align: "center",
dataIndex: 'humidityLow'
},
{
title: '湿度缓冲值',
align: "center",
dataIndex: 'humidityBuffer'
},
{
title: '断电报警',
align: "center",
dataIndex: 'izOutages',
customRender:({record})=>{
return record.izOutages?(record.izOutages=='0'?'开启':'关闭'):'';
},
},
{
title: '低电报警',
align: "center",
dataIndex: 'izLowBattery',
customRender:({record})=>{
return record.izLowBattery?(record.izLowBattery=='0'?'开启':'关闭'):'';
},
},
{
title: '上下线通知',
align: "center",
dataIndex: 'izOnline',
customRender:({record})=>{
return record.izOnline?(record.izOnline=='0'?'开启':'关闭'):'';
},
},
];
export const logQuerySchema: FormSchema[] = [
{
label: '操作类型',
field: 'optType',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择操作类型',
options: [
{ label: '新增', value: 'insert' },
{ label: '修改', value: 'update' },
{ label: '删除', value: 'delete' },
],
},
colProps: { span: 6 },
},
];
//列表数据
export const alarmColumns: BasicColumn[] = [
{
title: '设备序号',
align: "center",
dataIndex: 'sn'
},
{
title: '状态',
align: "center",
dataIndex: 'status',
customRender:({record})=>{
if(record.optType == '0'){
return '告警';
}else {
return '清除';
}
},
},
{
title: '告警时间',
align: "center",
dataIndex: 'wrDate'
},
{
title: '告警内容',
align: "center",
dataIndex: 'wrContent'
},
{
title: '告警值',
align: "center",
dataIndex: 'wrData'
},
{
title: '清除时间',
align: "center",
dataIndex: 'clearDate'
},
{
title: '清除内容',
align: "center",
dataIndex: 'clearContent'
},
{
title: '清除值',
align: "center",
dataIndex: 'clearData'
},
];
export const alarmQuerySchema: FormSchema[] = [
{
label: '告警状态',
field: 'status',
component: 'JDictSelectTag',
componentProps: {
placeholder: '请选择告警状态',
options: [
{ label: '告警', value: '0' },
{ label: '清除', value: '1' },
],
},
colProps: { span: 6 },
},
];

View File

@ -0,0 +1,194 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
<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">
在线
</span>
<span v-else style="color:red">
离线
</span>
</template>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
</BasicTable>
<DeviceInfoDrawer @register="registerDrawer" @success="handleSuccess" />
<ApiLogAlarmModal ref="apiLogAlarmModal"></ApiLogAlarmModal>
<HldyUtilsModal ref="hldyUtilsModal" @success="handleHldyParams" ></HldyUtilsModal>
<HumidDeviceSyncLogListModal ref="syncLogModal"></HumidDeviceSyncLogListModal>
</div>
</template>
<script lang="ts" name="iot-nuIotRegionInfo" setup>
import {reactive, ref,h} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { useUserStore } from '/@/store/modules/user';
import {Modal} from "ant-design-vue";
import {list, deleteDevice, updateDeviceRealTime} from './humid.api';
import { columns, searchFormSchema } from './humid.data';
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>({});
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '温湿度',
api: list,
columns,
canResize:false,
showIndexColumn: true,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
actionColumn: {
width: 290,
fixed:'right'
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '抄表',
onClick: handleRead.bind(null, record),
},
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
},
{
label: '日志',
onClick: handleApiLogAlarm.bind(null, record),
},
{
label: '同步',
onClick: handleSync.bind(null, record),
},
]
}
//
async function handleRead(record: Recordable) {
const params = {
'sn' : record.sn,
};
await updateDeviceRealTime(params);
handleSuccess()
}
function handleInsert(){
let record = {};
record["isUpdate"] = false;
openDrawer(true, {
isUpdate: false,
showFooter: true,
tenantSaas: false,
});
}
//
async function handleEdit(record: Recordable) {
record["isUpdate"] = true;
console.log(record);
openDrawer(true, {
record,
isUpdate: true,
showFooter: true,
tenantSaas: false,
});
}
//
async function handleDelete(record: Recordable) {
const params = {
'sn' : record.sn,
};
await deleteDevice(params);
handleSuccess();
}
function handleApiLogAlarm(record){
apiLogAlarmModal.value.disableSubmit = true;
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>

View File

@ -6,24 +6,28 @@ import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '机构/部门名称',
title: '机构名称',
align: "center",
dataIndex: 'departName'
},
{
title: '机构编码',
align: "center",
dataIndex: 'orgCode'
dataIndex: 'orgCode',
width: '120px'
},
{
title: '运营开始时间',
align: "center",
dataIndex: 'operationStartTime'
dataIndex: 'operationStartTime',
width: '150px',
defaultHidden: true
},
{
title: '运营到期时间',
align: "center",
dataIndex: 'operationEndTime'
dataIndex: 'operationEndTime',
width: '150px'
},
];

View File

@ -11,6 +11,7 @@
<BasicTable @register="registerTable" >
<!--插槽:table标题-->
<template #tableTitle>
护理机构
</template>
<!--操作栏-->
<template #action="{ record }">
@ -49,7 +50,7 @@ import { e } from 'unocss';
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
width: 80,
fixed: 'right',
},
beforeFetch: async (params) => {
@ -105,7 +106,7 @@ function edit(record) {
departInfo.value.departName = record.departName;
departInfo.value.departServerUrl = record.orgCode;
console.log("🚀 ~ handleEdit ~ departInfo.value:", departInfo.value)
emit("ok",departInfo);
emit("ok",departInfo.value);
}
/**

View File

@ -6,19 +6,21 @@ import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '护理单元名称',
title: '单元名称',
align: "center",
dataIndex: 'nuName'
},
{
title: '编码',
title: '单元编码',
align: "center",
dataIndex: 'code'
dataIndex: 'nuId',
width: '150px'
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime'
dataIndex: 'createTime',
width: '150px'
},
];

View File

@ -0,0 +1,80 @@
<template>
<div class="p-2">
<a-row>
<a-col :span="12">
<DepartUtilsList ref="departUtilsListModal" @ok="departCallback" ></DepartUtilsList>"
</a-col>
<a-col :span="12">
<HldyUtilsList ref="hldyUtilsListModal" @ok="hldyCallback" ></HldyUtilsList>
</a-col>
</a-row>
</div>
</template>
<script lang="ts" name="departUtils-sysDepart" setup>
import { ref, reactive } from 'vue';
import HldyUtilsList from '/@/views/utils/nuUtils/HldyUtilsList.vue'
import DepartUtilsList from '/@/views/utils/departUtils/DepartUtilsList.vue'
const departUtilsListModal = ref();
const hldyUtilsListModal = ref();
const departInfo = ref<any>({});
const emit = defineEmits(['register', 'ok']);
//
function hldyCallback(record) {
console.log("🚀 ~ hldyCallback ~ record:", record)
console.log("🚀 ~ handleEdit ~ record:", record)
departInfo.value.nuId = record.nuId;
departInfo.value.nuName = record.nuName;
departInfo.value.departId = record.departId;
departInfo.value.departName = record.departName;
departInfo.value.departServerUrl = record.departServerUrl;
console.log("🚀 ~ handleEdit ~ departInfo.value:", departInfo.value)
emit("ok",departInfo.value);
}
//
function departCallback(record) {
console.log("🚀 ~ departCallback ~ record:", record)
hldyUtilsListModal.value.edit(record);
}
function edit(record) {
console.log("🚀 ~ edit ~ record:", record.departServerUrl)
departInfo.value = record;
// queryParam.sysOrgCode = record.departServerUrl;
}
defineExpose({
edit,
});
</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

@ -11,6 +11,7 @@
<BasicTable @register="registerTable" >
<!--插槽:table标题-->
<template #tableTitle>
护理单元
</template>
<!--操作栏-->
<template #action="{ record }">
@ -89,10 +90,10 @@ import { e } from 'unocss';
*/
function handleEdit(record: Recordable) {
console.log("🚀 ~ handleEdit ~ record:", record)
departInfo.value.nuId = record.id;
departInfo.value.nuId = record.nuId;
departInfo.value.nuName = record.nuName;
console.log("🚀 ~ handleEdit ~ departInfo.value:", departInfo.value)
emit("ok",departInfo);
emit("ok",departInfo.value);
}
/**

View File

@ -1,16 +1,16 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<DepartUtilsList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></DepartUtilsList>
<HldyUtilsIndex ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></HldyUtilsIndex>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import DepartUtilsList from './HldyUtilsList.vue'
import HldyUtilsIndex from './HldyUtilsIndex.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const width = ref<string>('85%');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();