diff --git a/src/api/alert/run/instant/index.ts b/src/api/alert/run/instant/index.ts index a4747ce..fccbb4e 100644 --- a/src/api/alert/run/instant/index.ts +++ b/src/api/alert/run/instant/index.ts @@ -54,6 +54,16 @@ export interface EXAPoint { Comment?: string Note?: string } + +export interface InstantCalcReqVO { + startTime?: Date + endTime?: Date + interval?: string + mpId?: number +} + + + // 查询模型实例列表 export function getInstantPage(params: InstantPageReqVO) { return defHttp.get({ url: '/alert/instant/page', params }) @@ -92,3 +102,10 @@ export function getInstantPoint(mpId: number) { export function getInstantChart(data: InstantChartReqVO) { return defHttp.post({ url: `/alert/instant/getChart`, data }) } + +// 回算模型实例 +export function calcInstant(data: InstantCalcReqVO) { + return defHttp.post({ url: `/alert/instant/calc`, data }) +} + + diff --git a/src/api/alert/warn/index.ts b/src/api/alert/warn/index.ts index b71c2d5..4ca8de8 100644 --- a/src/api/alert/warn/index.ts +++ b/src/api/alert/warn/index.ts @@ -21,6 +21,10 @@ export interface EXAHistoryReqVO { export function getWarnPage(params: WarnPageReqVO) { return defHttp.get({ url: '/alert/warn/page', params }) } +// 查询预警列表-分页-转换实时值 +export function getWarnPageReal(params: WarnPageReqVO) { + return defHttp.get({ url: '/alert/warn/page-real', params }) +} // 修改预警 export function updateWarn(data: WarnVO) { diff --git a/src/locales/lang/en/action.json b/src/locales/lang/en/action.json index 562ff38..529585c 100644 --- a/src/locales/lang/en/action.json +++ b/src/locales/lang/en/action.json @@ -15,5 +15,6 @@ "createInstant": "CreateInstant", "pointConfig": "PointConfig", "warnConfig": "WarnConfig", - "backCalc": "backCalc" + "backCalc": "backCalc", + "calcIng": "calcIng" } diff --git a/src/locales/lang/zh-CN/action.json b/src/locales/lang/zh-CN/action.json index c84a365..5c0bb93 100644 --- a/src/locales/lang/zh-CN/action.json +++ b/src/locales/lang/zh-CN/action.json @@ -16,5 +16,6 @@ "createInstant": "新增实例", "pointConfig": "测点配置", "warnConfig": "预警配置", - "backCalc": "回算" + "backCalc": "回算", + "calcIng": "回算中" } diff --git a/src/views/run/calc/calc.data.ts b/src/views/run/calc/calc.data.ts index f0df0ad..9b4c4dd 100644 --- a/src/views/run/calc/calc.data.ts +++ b/src/views/run/calc/calc.data.ts @@ -5,59 +5,62 @@ import type { BasicColumn, FormSchema } from '@/components/Table' import { DICT_TYPE, getDictOptions } from '@/utils/dict' import { optionListApi, subSystemListApi } from '@/api/alert/model/select' import type { systemSelectParams } from '@/api/alert/model/model/optionsModel' +import {Tag} from "ant-design-vue"; export const columns: BasicColumn[] = [ { title: '编号', - dataIndex: 'id', - width: 80, + dataIndex: 'mpId', + width: 60, fixed: 'left', }, { title: '模型名称', dataIndex: 'modelName', - width: 250, + width: 200, className: 'instant', slots: { customRender: 'detail' }, fixed: 'left', }, { title: '算法', - dataIndex: 'Algorithm', - width: 200, + dataIndex: 'algorithmShortname', + width: 100, }, { title: '模式覆盖率', dataIndex: 'CoveredPercent', - width: 200, + width: 100 }, { title: '报警次数', dataIndex: 'AlarmNumber', - width: 200, + width: 100, }, { title: '总报警时间(m)', dataIndex: 'AlarmToatlMinutes', - width: 200, + width: 100, }, { title: '系统维度', dataIndex: 'Dimension', - width: 200, + width: 100, + }, { title: '计算耗时(s)', dataIndex: 'CalcSeconds', - width: 200, + width: 100, }, { title: '状态', - dataIndex: 'status', + dataIndex: 'calcStatus', width: 100, - slots: { customRender: 'status' }, fixed: 'right', + slots: { customRender: 'calcStatus' }, + }, ] @@ -65,13 +68,14 @@ const optionList = await optionListApi() const systemOptions = ref([]) systemOptions.value = optionList.systems +console.log(systemOptions.value) export const searchFormSchema: FormSchema[] = [ { label: '机组', field: 'unit', component: 'Select', defaultValue: optionList.units[0].id || null, - colProps: { span: 4 }, + colProps: { span: 5 }, componentProps: ({ formModel }) => { return { @@ -80,10 +84,6 @@ export const searchFormSchema: FormSchema[] = [ placeholder: '请选择机组', options: optionList.units.map(unit => ({ value: unit.id, label: unit.name })), onChange: async (e: any) => { - // const { reload } = tableAction - // reload() - // or - console.log(e) const param: systemSelectParams = { unitId: e, typeId: formModel.type, @@ -99,22 +99,19 @@ export const searchFormSchema: FormSchema[] = [ field: 'type', component: 'Select', defaultValue: optionList.types[0].id || null, - colProps: { span: 4 }, + colProps: { span: 5 }, componentProps: ({ formModel }) => { return { allowClear: false, placeholder: '请选择系统', options: optionList.types.map(type => ({ value: type.id, label: type.name })), onChange: async (e: any) => { - // const { reload } = tableAction - // reload() - // or - console.log(e) const param: systemSelectParams = { unitId: formModel.unit, typeId: e, } systemOptions.value = await subSystemListApi(param) + console.log(systemOptions.value) }, } }, @@ -124,7 +121,7 @@ export const searchFormSchema: FormSchema[] = [ field: 'system', component: 'Select', defaultValue: systemOptions.value[0].id || null, - colProps: { span: 4 }, + colProps: { span: 5 }, componentProps: () => { return { allowClear: false, @@ -143,7 +140,7 @@ export const searchFormSchema: FormSchema[] = [ componentProps: { placeholder: '请输入模型名称', }, - colProps: { span: 4 }, + colProps: { span: 6 }, }, ] @@ -163,15 +160,18 @@ export const calcFormSchemas: FormSchema[] = [ onChange: (e: any) => { console.log(e) }, + + allowClear: false, // ← 必须用这个 }, + required: true, colProps: { - span: 8, + span: 10, }, }, { - label: '回算采样周期', + label: '采样周期', field: 'interval', component: 'Select', defaultValue: 60, @@ -181,7 +181,7 @@ export const calcFormSchemas: FormSchema[] = [ }, required: true, colProps: { - span: 4, + span: 5, }, }, diff --git a/src/views/run/calc/index.vue b/src/views/run/calc/index.vue index efe594c..a44a829 100644 --- a/src/views/run/calc/index.vue +++ b/src/views/run/calc/index.vue @@ -1,33 +1,38 @@ diff --git a/src/views/warn/alarm/alarm.data.ts b/src/views/warn/alarm/alarm.data.ts new file mode 100644 index 0000000..589b208 --- /dev/null +++ b/src/views/warn/alarm/alarm.data.ts @@ -0,0 +1,183 @@ +import type { BasicColumn, FormSchema } from '@/components/Table' +import {optionListApi, subSystemListApi} from "@/api/alert/model/select"; +import {h, ref} from "vue"; +import {systemSelectParams} from "@/api/alert/model/model/optionsModel"; +import {FileItem, UploadResultStatus} from "@/components/Upload/src/typing"; +import {Progress} from "ant-design-vue"; +const optionList = await optionListApi() + +const systemOptions = ref([]) +systemOptions.value = optionList.systems +export const searchFormSchema: FormSchema[] = [ + { + label: '机组', + field: 'unit', + component: 'Select', + defaultValue: optionList.units[0].id || null, + colProps: { span: 4 }, + + componentProps: ({ schema, tableAction, formActionType, formModel }) => { + return { + // xxxx props + allowClear: false, + placeholder: '请选择机组', + options: optionList.units.map(unit => ({ value: unit.id, label: unit.name })), + onChange: async (e: any) => { + // const { reload } = tableAction + // reload() + // or + console.log(e) + const param: systemSelectParams = { + unitId: e, + typeId: formModel.type, + } + systemOptions.value = await subSystemListApi(param) + formModel.system = systemOptions.value[0].id + }, + } + }, + }, + { + label: '系统', + field: 'type', + component: 'Select', + defaultValue: optionList.types[0].id || null, + colProps: { span: 4 }, + componentProps: ({ formModel }) => { + return { + allowClear: false, + placeholder: '请选择系统', + options: optionList.types.map(type => ({ value: type.id, label: type.name })), + onChange: async (e: any) => { + // const { reload } = tableAction + // reload() + // or + console.log(e) + const param: systemSelectParams = { + unitId: formModel.unit, + typeId: e, + } + systemOptions.value = await subSystemListApi(param) + }, + } + }, + }, + { + label: '子系统', + field: 'system', + component: 'Select', + defaultValue: systemOptions.value[0].id || null, + colProps: { span: 4 }, + componentProps: () => { + return { + allowClear: false, + placeholder: '请选择子系统', + options: systemOptions.value.map(system => ({ value: system.id, label: system.name })), + } + }, + }, + + { + label: '模型实例名称', + field: 'mpName', + component: 'Input', + labelWidth: 120, + defaultValue: '', + colProps: { span: 7 }, + } +] + +export const columns: BasicColumn[] = [ + { + title: '编号', + dataIndex: 'warnId', + width: 80, + fixed: 'left', + }, + { + title: '机组', + dataIndex: 'unitName', + width: 80, + fixed: 'left', + }, + { + title: '报警名称', + dataIndex: 'alarmName', + width: 180, + fixed: 'left', + // 将 JSX 改为 h 函数调用 + customRender: ({ record }) => { + return h('div', [ + h('div', record.pointName), + h('div', { style: 'color: #999; font-size: 12px' }, record.pointId) + ]); + }, + }, + { + title: '单位', + dataIndex: 'unit', + width: 50, + fixed: 'left', + }, + { + title: '测点值', + dataIndex: 'unit', + width: 150, + // 将 JSX 改为 h 函数调用 + customRender: ({ record }) => { + return h('div', [ + h('div', { style: 'color: #006400;font-weight:bold' },'实时值:'+record.pointValue), + h('div', { style: 'color: #0960BD;font-weight:bold' },'重构值:'+record.outputPointValue), + ]); + }, + }, + { + title: '偏差值', + dataIndex: 'biasValue', + width: 50 + }, + { + title: '安全区间', + dataIndex: 'limit', + width: 100, + // 将 JSX 改为 h 函数调用 + customRender: ({ record }) => { + return h('div', [ + h('div', record.lowlimit), + h('div', record.uplimit), + ]); + }, + + }, + { + title: '模型实例名称', + dataIndex: 'mpName', + width: 150, + ellipsis: false, // ⭐ 关键 + + }, + { + title: '预警时间', + dataIndex: 'createTime', + width: 150 + }, + { + title: '持续时长', + dataIndex: 'timeDiffStr', + width: 90, + ellipsis: false, // ⭐ 关键 + + }, + { + title: '告警级别', + dataIndex: 'alarmModelRuleName', + width: 80, + ellipsis: false, // ⭐ 关键 + + }, + { + title: '专业', + dataIndex: 'systemName', + width: 100, + } +] diff --git a/src/views/warn/alarm/index.vue b/src/views/warn/alarm/index.vue new file mode 100644 index 0000000..4730507 --- /dev/null +++ b/src/views/warn/alarm/index.vue @@ -0,0 +1,117 @@ + + + + +