From 3b13ee170864f26ff030e9f210e4d7d1f635e076 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Thu, 23 Oct 2025 14:23:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=81=94=E5=8A=A8=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=EF=BC=8C=E5=AE=9A=E6=97=B6=E6=8E=A7=E5=88=B6=EF=BC=8C=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=8E=A8=E9=80=81=E5=8A=9F=E8=83=BD=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/fishery/linkedCtrl/index.ts | 63 ++ src/api/fishery/linkedCtrl/types.ts | 113 +++ src/api/fishery/timingCtrl/index.ts | 63 ++ src/api/fishery/timingCtrl/types.ts | 98 ++ src/api/system/notice/types.ts | 11 + src/views/fishery/aquUser/index.vue | 1120 +++++++++++++++++++++- src/views/fishery/device/index.vue | 381 +++++++- src/views/fishery/deviceSwitch/index.vue | 166 +++- src/views/fishery/linkedCtrl/index.vue | 524 ++++++++++ src/views/fishery/timingCtrl/index.vue | 513 ++++++++++ src/views/system/notice/index.vue | 38 +- 11 files changed, 3034 insertions(+), 56 deletions(-) create mode 100644 src/api/fishery/linkedCtrl/index.ts create mode 100644 src/api/fishery/linkedCtrl/types.ts create mode 100644 src/api/fishery/timingCtrl/index.ts create mode 100644 src/api/fishery/timingCtrl/types.ts create mode 100644 src/views/fishery/linkedCtrl/index.vue create mode 100644 src/views/fishery/timingCtrl/index.vue diff --git a/src/api/fishery/linkedCtrl/index.ts b/src/api/fishery/linkedCtrl/index.ts new file mode 100644 index 0000000..b20a5c7 --- /dev/null +++ b/src/api/fishery/linkedCtrl/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { LinkedCtrlVO, LinkedCtrlForm, LinkedCtrlQuery } from '@/api/fishery/linkedCtrl/types'; + +/** + * 查询溶解氧联动控制列表 + * @param query + * @returns {*} + */ + +export const listLinkedCtrl = (query?: LinkedCtrlQuery): AxiosPromise => { + return request({ + url: '/fishery/linkedCtrl/list', + method: 'get', + params: query + }); +}; + +/** + * 查询溶解氧联动控制详细 + * @param id + */ +export const getLinkedCtrl = (id: string | number): AxiosPromise => { + return request({ + url: '/fishery/linkedCtrl/' + id, + method: 'get' + }); +}; + +/** + * 新增溶解氧联动控制 + * @param data + */ +export const addLinkedCtrl = (data: LinkedCtrlForm) => { + return request({ + url: '/fishery/linkedCtrl', + method: 'post', + data: data + }); +}; + +/** + * 修改溶解氧联动控制 + * @param data + */ +export const updateLinkedCtrl = (data: LinkedCtrlForm) => { + return request({ + url: '/fishery/linkedCtrl', + method: 'put', + data: data + }); +}; + +/** + * 删除溶解氧联动控制 + * @param id + */ +export const delLinkedCtrl = (id: string | number | Array) => { + return request({ + url: '/fishery/linkedCtrl/' + id, + method: 'delete' + }); +}; diff --git a/src/api/fishery/linkedCtrl/types.ts b/src/api/fishery/linkedCtrl/types.ts new file mode 100644 index 0000000..90e0bf1 --- /dev/null +++ b/src/api/fishery/linkedCtrl/types.ts @@ -0,0 +1,113 @@ +export interface LinkedCtrlVO { + /** + * 主键id + */ + id: string | number; + + /** + * 设备id + */ + deviceId: string | number; + + /** + * 溶解氧上限开关 + */ + oxyUpperOpen: number; + + /** + * 溶解氧上限值 + */ + oxyUpperValue: number; + + /** + * 溶解氧下限开关 + */ + oxyLowerOpen: number; + + /** + * 溶解氧下限值 + */ + oxyLowerValue: number; + + /** + * 是否触发上限关闭操作 + */ + isOxyUpperTrigger: number; + + /** + * 备注 + */ + remark: string; + +} + +export interface LinkedCtrlForm extends BaseEntity { + /** + * 主键id + */ + id?: string | number; + + /** + * 设备id + */ + deviceId?: string | number; + + /** + * 溶解氧上限开关 + */ + oxyUpperOpen?: number; + + /** + * 溶解氧上限值 + */ + oxyUpperValue?: number; + + /** + * 溶解氧下限开关 + */ + oxyLowerOpen?: number; + + /** + * 溶解氧下限值 + */ + oxyLowerValue?: number; + + /** + * 是否触发上限关闭操作 + */ + isOxyUpperTrigger?: number; + + /** + * 备注 + */ + remark?: string; + +} + +export interface LinkedCtrlQuery extends PageQuery { + + /** + * 设备id + */ + deviceId?: string | number; + + /** + * 溶解氧上限开关 + */ + oxyUpperOpen?: number; + + /** + * 溶解氧下限开关 + */ + oxyLowerOpen?: number; + + /** + * 是否触发上限关闭操作 + */ + isOxyUpperTrigger?: number; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/fishery/timingCtrl/index.ts b/src/api/fishery/timingCtrl/index.ts new file mode 100644 index 0000000..24c7d5f --- /dev/null +++ b/src/api/fishery/timingCtrl/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { TimingCtrlVO, TimingCtrlForm, TimingCtrlQuery } from '@/api/fishery/timingCtrl/types'; + +/** + * 查询开关定时控制列表 + * @param query + * @returns {*} + */ + +export const listTimingCtrl = (query?: TimingCtrlQuery): AxiosPromise => { + return request({ + url: '/fishery/timingCtrl/list', + method: 'get', + params: query + }); +}; + +/** + * 查询开关定时控制详细 + * @param id + */ +export const getTimingCtrl = (id: string | number): AxiosPromise => { + return request({ + url: '/fishery/timingCtrl/' + id, + method: 'get' + }); +}; + +/** + * 新增开关定时控制 + * @param data + */ +export const addTimingCtrl = (data: TimingCtrlForm) => { + return request({ + url: '/fishery/timingCtrl', + method: 'post', + data: data + }); +}; + +/** + * 修改开关定时控制 + * @param data + */ +export const updateTimingCtrl = (data: TimingCtrlForm) => { + return request({ + url: '/fishery/timingCtrl', + method: 'put', + data: data + }); +}; + +/** + * 删除开关定时控制 + * @param id + */ +export const delTimingCtrl = (id: string | number | Array) => { + return request({ + url: '/fishery/timingCtrl/' + id, + method: 'delete' + }); +}; diff --git a/src/api/fishery/timingCtrl/types.ts b/src/api/fishery/timingCtrl/types.ts new file mode 100644 index 0000000..c1e723d --- /dev/null +++ b/src/api/fishery/timingCtrl/types.ts @@ -0,0 +1,98 @@ +export interface TimingCtrlVO { + /** + * 主键id + */ + id: string | number; + + /** + * 开关id + */ + switchId: string | number; + + /** + * 开启时间 + */ + openTime: string; + + /** + * 关闭时间 + */ + closeTime: string; + + /** + * 循环类型 + */ + loopType: number; + + /** + * 是否启用 + */ + isOpen: number; + + /** + * 备注 + */ + remark: string; + +} + +export interface TimingCtrlForm extends BaseEntity { + /** + * 主键id + */ + id?: string | number; + + /** + * 开关id + */ + switchId?: string | number; + + /** + * 开启时间 + */ + openTime?: string; + + /** + * 关闭时间 + */ + closeTime?: string; + + /** + * 循环类型 + */ + loopType?: number; + + /** + * 是否启用 + */ + isOpen?: number; + + /** + * 备注 + */ + remark?: string; + +} + +export interface TimingCtrlQuery extends PageQuery { + + /** + * 开关id + */ + switchId?: string | number; + + /** + * 循环类型 + */ + loopType?: number; + + /** + * 是否启用 + */ + isOpen?: number; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/system/notice/types.ts b/src/api/system/notice/types.ts index abfd5b2..8539310 100644 --- a/src/api/system/notice/types.ts +++ b/src/api/system/notice/types.ts @@ -5,6 +5,15 @@ export interface NoticeVO extends BaseEntity { noticeContent: string; status: string; remark: string; + /** + * 优先级 + */ + priority: number; + + /** + * 有效期 + */ + deadTime: string; createByName: string; } @@ -22,5 +31,7 @@ export interface NoticeForm { noticeContent: string; status: string; remark: string; + priority: number, + deadTime: undefined, createByName: string; } diff --git a/src/views/fishery/aquUser/index.vue b/src/views/fishery/aquUser/index.vue index c71a6e2..3b74234 100644 --- a/src/views/fishery/aquUser/index.vue +++ b/src/views/fishery/aquUser/index.vue @@ -62,12 +62,17 @@ - - + - + + + + +
+ + + +

正在加载子账号信息...

+
+ + + + + +
+ + + + + + + + {{ warnPhones[0] }} + + 未设置 + + + + + {{ warnPhones[1] }} + + 未设置 + + + + + {{ warnPhones[2] }} + + 未设置 + + + +
+ 该用户暂未设置报警电话 +
+ + +
+ - - - - - - - - - - - - - + + +
+
+ + + +

正在加载塘口信息...

+
+
+ + +
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -578,9 +790,17 @@ import { listAquUser } from '@/api/fishery/aquUser'; import { AquUserVO } from '@/api/fishery/aquUser/types'; import { listPond } from '@/api/fishery/pond'; import { PondVO } from '@/api/fishery/pond/types'; +import { listDeviceSwitch } from '@/api/fishery/deviceSwitch'; +import { DeviceSwitchVO } from '@/api/fishery/deviceSwitch/types'; +import { listLinkedCtrl } from '@/api/fishery/linkedCtrl'; +import { LinkedCtrlVO } from '@/api/fishery/linkedCtrl/types'; +import { listTimingCtrl } from '@/api/fishery/timingCtrl'; +import { TimingCtrlVO } from '@/api/fishery/timingCtrl/types'; +import { listDeviceCorrectRecord } from '@/api/fishery/deviceCorrectRecord'; +import { DeviceCorrectRecordVO } from '@/api/fishery/deviceCorrectRecord/types'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; -const { aqu_device_type, open_close } = toRefs(proxy?.useDict('aqu_device_type', 'open_close')); +const { aqu_device_type, open_close, connect_voltage_type, yes_no, loop_type,is_linked_ctrl } = toRefs(proxy?.useDict('aqu_device_type', 'open_close', 'connect_voltage_type', 'yes_no', 'loop_type', 'is_linked_ctrl')); const deviceList = ref([]); const buttonLoading = ref(false); @@ -630,6 +850,40 @@ const pondQueryParams = reactive<{ }); const pondTotal = ref(0); +// 开关信息对话框 +const switchDialogVisible = ref(false); +const switchList = ref([]); +const switchLoading = ref(false); +const currentDevice = ref(null); + +// 联动控制对话框 +const linkedCtrlDialogVisible = ref(false); +const linkedCtrlList = ref([]); +const linkedCtrlLoading = ref(false); +const linkedCtrlTotal = ref(0); +const linkedCtrlQueryParams = reactive({ + pageNum: 1, + pageSize: 10, + deviceId: undefined as string | number | undefined +}); + +// 校时记录对话框 +const correctRecordDialogVisible = ref(false); +const correctRecordList = ref([]); +const correctRecordLoading = ref(false); +const correctRecordTotal = ref(0); +const correctRecordQueryParams = reactive({ + pageNum: 1, + pageSize: 10, + deviceId: undefined as string | number | undefined +}); + +// 开关定时控制对话框 +const switchTimingCtrlDialogVisible = ref(false); +const switchTimingCtrlList = ref([]); +const switchTimingCtrlLoading = ref(false); +const currentSwitch = ref(null); + const queryFormRef = ref(); const deviceFormRef = ref(); @@ -1069,6 +1323,129 @@ const cancelPondSelect = () => { pondSelectVisible.value = false; }; +/** 查看开关信息 */ +const handleViewSwitch = async (row: DeviceVO) => { + currentDevice.value = row; + switchLoading.value = true; + try { + const res = await listDeviceSwitch({ + pageNum: 1, + pageSize: 100, + deviceId: row.id + }); + switchList.value = res.rows || res.data || []; + switchDialogVisible.value = true; + } catch (error) { + console.error('加载开关信息失败:', error); + proxy?.$modal.msgError('加载开关信息失败'); + } finally { + switchLoading.value = false; + } +}; + +/** 关闭开关信息对话框 */ +const closeSwitchDialog = () => { + switchDialogVisible.value = false; + currentDevice.value = null; + switchList.value = []; +}; + +/** 查看联动控制 */ +const handleViewLinkedCtrl = async (row: DeviceVO) => { + currentDevice.value = row; + linkedCtrlQueryParams.deviceId = row.id; + linkedCtrlQueryParams.pageNum = 1; + await getLinkedCtrlList(); + linkedCtrlDialogVisible.value = true; +}; + +/** 获取联动控制列表 */ +const getLinkedCtrlList = async () => { + linkedCtrlLoading.value = true; + try { + const res = await listLinkedCtrl(linkedCtrlQueryParams); + linkedCtrlList.value = res.rows || res.data || []; + linkedCtrlTotal.value = res.total || 0; + } catch (error) { + console.error('加载联动控制失败:', error); + proxy?.$modal.msgError('加载联动控制失败'); + } finally { + linkedCtrlLoading.value = false; + } +}; + +/** 关闭联动控制对话框 */ +const closeLinkedCtrlDialog = () => { + linkedCtrlDialogVisible.value = false; + currentDevice.value = null; + linkedCtrlList.value = []; + linkedCtrlTotal.value = 0; +}; + +/** 查看校时记录 */ +const handleViewCorrectRecord = async (row: DeviceVO) => { + currentDevice.value = row; + correctRecordQueryParams.deviceId = row.id; + correctRecordQueryParams.pageNum = 1; + await getCorrectRecordList(); + correctRecordDialogVisible.value = true; +}; + +/** 获取校时记录列表 */ +const getCorrectRecordList = async () => { + correctRecordLoading.value = true; + try { + const res = await listDeviceCorrectRecord(correctRecordQueryParams); + correctRecordList.value = res.rows || res.data || []; + correctRecordTotal.value = res.total || 0; + } catch (error) { + console.error('加载校时记录失败:', error); + proxy?.$modal.msgError('加载校时记录失败'); + } finally { + correctRecordLoading.value = false; + } +}; + +/** 关闭校时记录对话框 */ +const closeCorrectRecordDialog = () => { + correctRecordDialogVisible.value = false; + currentDevice.value = null; + correctRecordList.value = []; + correctRecordTotal.value = 0; +}; + +/** 查看开关的定时控制 */ +const handleViewSwitchTimingCtrl = async (row: DeviceSwitchVO) => { + currentSwitch.value = row; + await getSwitchTimingCtrlList(row.id); + switchTimingCtrlDialogVisible.value = true; +}; + +/** 获取开关定时控制列表 */ +const getSwitchTimingCtrlList = async (switchId: string | number) => { + switchTimingCtrlLoading.value = true; + try { + const res = await listTimingCtrl({ + switchId: switchId, + pageNum: 1, + pageSize: 1000 // 获取所有数据 + }); + switchTimingCtrlList.value = res.rows || res.data || []; + } catch (error) { + console.error('加载定时控制失败:', error); + proxy?.$modal.msgError('加载定时控制失败'); + } finally { + switchTimingCtrlLoading.value = false; + } +}; + +/** 关闭开关定时控制对话框 */ +const closeSwitchTimingCtrlDialog = () => { + switchTimingCtrlDialogVisible.value = false; + currentSwitch.value = null; + switchTimingCtrlList.value = []; +}; + onMounted(() => { getList(); }); diff --git a/src/views/fishery/deviceSwitch/index.vue b/src/views/fishery/deviceSwitch/index.vue index 4e0ee43..bb74e5f 100644 --- a/src/views/fishery/deviceSwitch/index.vue +++ b/src/views/fishery/deviceSwitch/index.vue @@ -46,17 +46,17 @@ - - + + - + - + @@ -68,15 +68,19 @@ - + - - - + + + + - + + + + + + + + + + + + + + + + + + + @@ -233,9 +309,11 @@ import { listDeviceSwitch, getDeviceSwitch, delDeviceSwitch, addDeviceSwitch, up import { DeviceSwitchVO, DeviceSwitchQuery, DeviceSwitchForm } from '@/api/fishery/deviceSwitch/types'; import { listDevice } from '@/api/fishery/device'; import { DeviceVO } from '@/api/fishery/device/types'; +import { listTimingCtrl } from '@/api/fishery/timingCtrl'; +import { TimingCtrlVO } from '@/api/fishery/timingCtrl/types'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; -const { aqu_device_type, open_close, connect_voltage_type, is_linked_ctrl } = toRefs(proxy?.useDict('aqu_device_type', 'open_close', 'connect_voltage_type', 'is_linked_ctrl')); +const { aqu_device_type, open_close, connect_voltage_type, is_linked_ctrl, loop_type } = toRefs(proxy?.useDict('aqu_device_type', 'open_close', 'connect_voltage_type', 'is_linked_ctrl', 'loop_type')); const deviceSwitchList = ref([]); const buttonLoading = ref(false); @@ -254,20 +332,32 @@ const deviceSelectVisible = ref(false); const deviceQueryParams = reactive<{ pageNum: number; pageSize: number; + serialNum?: string; + deviceName?: string; deviceType?: number; params: { + userKeyword?: string; deviceKeyword?: string; }; }>({ pageNum: 1, pageSize: 10, + serialNum: undefined, + deviceName: undefined, deviceType: 2, // 默认查询测控一体机(假设值为2) params: { + userKeyword: undefined, deviceKeyword: undefined } }); const deviceTotal = ref(0); +// 定时控制对话框 +const timingCtrlDialogVisible = ref(false); +const timingCtrlList = ref([]); +const timingCtrlLoading = ref(false); +const currentSwitch = ref(null); + const queryFormRef = ref(); const deviceSwitchFormRef = ref(); @@ -469,7 +559,10 @@ const getDeviceList = async () => { const openDeviceSelect = () => { // 重置搜索条件 deviceQueryParams.pageNum = 1; + deviceQueryParams.serialNum = undefined; + deviceQueryParams.deviceName = undefined; deviceQueryParams.deviceType = 2; // 测控一体机类型 + deviceQueryParams.params.userKeyword = undefined; deviceQueryParams.params.deviceKeyword = undefined; getDeviceList(); deviceSelectVisible.value = true; @@ -484,7 +577,10 @@ const handleDeviceQuery = () => { /** 重置设备搜索 */ const resetDeviceQuery = () => { deviceQueryParams.pageNum = 1; + deviceQueryParams.serialNum = undefined; + deviceQueryParams.deviceName = undefined; deviceQueryParams.deviceType = 2; // 测控一体机类型 + deviceQueryParams.params.userKeyword = undefined; deviceQueryParams.params.deviceKeyword = undefined; getDeviceList(); }; @@ -515,6 +611,38 @@ const cancelDeviceSelect = () => { deviceSelectVisible.value = false; }; +/** 查看定时控制 */ +const handleViewTimingCtrl = async (row: DeviceSwitchVO) => { + currentSwitch.value = row; + await getTimingCtrlList(row.id); + timingCtrlDialogVisible.value = true; +}; + +/** 获取定时控制列表 */ +const getTimingCtrlList = async (switchId: string | number) => { + timingCtrlLoading.value = true; + try { + const res = await listTimingCtrl({ + switchId: switchId, + pageNum: 1, + pageSize: 1000 // 获取所有数据 + }); + timingCtrlList.value = res.rows || res.data || []; + } catch (error) { + console.error('加载定时控制失败:', error); + proxy?.$modal.msgError('加载定时控制失败'); + } finally { + timingCtrlLoading.value = false; + } +}; + +/** 关闭定时控制对话框 */ +const closeTimingCtrlDialog = () => { + timingCtrlDialogVisible.value = false; + currentSwitch.value = null; + timingCtrlList.value = []; +}; + onMounted(() => { getList(); }); diff --git a/src/views/fishery/linkedCtrl/index.vue b/src/views/fishery/linkedCtrl/index.vue new file mode 100644 index 0000000..74e13b6 --- /dev/null +++ b/src/views/fishery/linkedCtrl/index.vue @@ -0,0 +1,524 @@ + + + diff --git a/src/views/fishery/timingCtrl/index.vue b/src/views/fishery/timingCtrl/index.vue new file mode 100644 index 0000000..1626fd6 --- /dev/null +++ b/src/views/fishery/timingCtrl/index.vue @@ -0,0 +1,513 @@ + + + diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index c219828..b9a4473 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -48,23 +48,28 @@ + + - - - + + + - + + + +