diff --git a/src/api/admin/reactor.ts b/src/api/admin/ReactorApi.ts similarity index 100% rename from src/api/admin/reactor.ts rename to src/api/admin/ReactorApi.ts diff --git a/src/api/admin/ReactorEPSettingApi.ts b/src/api/admin/ReactorEPSettingApi.ts new file mode 100644 index 0000000..27dfcbf --- /dev/null +++ b/src/api/admin/ReactorEPSettingApi.ts @@ -0,0 +1,27 @@ +import { RequestParams } from './http-client' +import { ContentType, HttpClient } from './http-client' + +export class ReactorEPSettingApi extends HttpClient { + /** + * 批量更新 + */ + batchUpdate = (data: any[], params: RequestParams = {}) => + this.request({ + path: `/api/admin/ep-setting-equ-reactor/batch-update`, + method: 'POST', + body: data, + type: ContentType.Json, + ...params, + }) + + /** + * 根据反应器ID获取报警设置列表 + */ + getListByEquReactor = (params: { equReactorId: number }, requestParams: RequestParams = {}) => + this.request({ + path: `/api/admin/ep-setting-equ-reactor/get-list-by-equ-reactor`, + method: 'GET', + query: params, + ...requestParams, + }) +} diff --git a/src/api/types/ReactorType.ts b/src/api/types/ReactorType.ts index a0de90c..0d43842 100644 --- a/src/api/types/ReactorType.ts +++ b/src/api/types/ReactorType.ts @@ -75,6 +75,8 @@ export interface ReactorDto { createdTime?: string | null /** 修改时间 */ modifiedTime?: string | null + /** 压力单位 */ + pressureUnit?: string | null } /** 反应器添加和更新输入接口 */ diff --git a/src/api/types/reactorEPSetting.ts b/src/api/types/reactorEPSetting.ts new file mode 100644 index 0000000..58d8f3d --- /dev/null +++ b/src/api/types/reactorEPSetting.ts @@ -0,0 +1,38 @@ +// 反应器报警设置类型定义 +export interface ReactorEPSetting { + /** 主键ID */ + id: number + /** 设备反应器ID */ + equReactorId: number + /** EP定义ID */ + epDefId: number + /** EP定义 */ + epDefName: string + /** EP定义别名 */ + epDefAlias: string + /** 告警下限 */ + warningLowerLimit: number + /** 告警下限缓冲 */ + warningLowerBuffer: number + /** 告警上限 */ + warningUpperLimit: number + /** 告警上限缓冲 */ + warningUpperBuffer: number + /** 动作下限 */ + actionLowerLimit: number + /** 动作上限 */ + actionUpperLimit: number + /** 动作时间缓冲 */ + actionTimeBuffer: number + /** 预警时间缓冲 */ + warningTimeBuffer: number + /** 是否启用 */ + isEnable: boolean + /** 状态 */ + status: boolean + + /** 计量单位 */ + unit: string + /** OPC名称 */ + needConfig: boolean +} diff --git a/src/views/admin/reactor/components/alarm-setting-form.vue b/src/views/admin/reactor/components/alarm-setting-form.vue new file mode 100644 index 0000000..00ce193 --- /dev/null +++ b/src/views/admin/reactor/components/alarm-setting-form.vue @@ -0,0 +1,125 @@ + + + + + \ No newline at end of file diff --git a/src/views/admin/reactor/components/reactor-form.vue b/src/views/admin/reactor/components/reactor-form.vue index ffa8d97..2853c6c 100644 --- a/src/views/admin/reactor/components/reactor-form.vue +++ b/src/views/admin/reactor/components/reactor-form.vue @@ -355,7 +355,7 @@ import { ref, reactive, onMounted, watch, getCurrentInstance } from 'vue' import { ElMessage } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' -import { ReactorApi } from '/@/api/admin/reactor' +import { ReactorApi } from '../../../../api/admin/ReactorApi' import { RoomApi } from '/@/api/admin/Room' import { UserApi } from '/@/api/admin/User' import { DictApi } from '/@/api/admin/Dict' @@ -369,9 +369,9 @@ import { MaintenanceFlagEnum, ReactorAddInputAndUpdateInput, PumpConfig, - defaultPumpConfig + defaultPumpConfig, + ReactorTypeEnumItem } from '/@/api/types/ReactorType' -import type { ReactorTypeEnumItem } from '/@/api/types/ReactorType' import { toOptionsByValue } from '/@/utils/enum' import { EnumPressureUnit } from '/@/api/admin/enum-contracts' import eventBus from '/@/utils/mitt' @@ -743,6 +743,9 @@ const submitForm = async () => { state.sureLoading = false // 结束加载 } } + else { + ElMessage.warning('存在未填写的必填项') + } }) } diff --git a/src/views/admin/reactor/index.vue b/src/views/admin/reactor/index.vue index d61cb56..0dc4b01 100644 --- a/src/views/admin/reactor/index.vue +++ b/src/views/admin/reactor/index.vue @@ -56,10 +56,11 @@ - + @@ -73,13 +74,14 @@ +