From ef80aff1511388e68c8170a032f4ea76e95313f6 Mon Sep 17 00:00:00 2001 From: yexb <553699424@qq.com> Date: Mon, 15 Jun 2026 08:40:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(steady):=20=E9=87=8D=E6=9E=84=E7=A8=B3?= =?UTF-8?q?=E6=80=81=E6=A0=A1=E9=AA=8C=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=95=8C=E9=9D=A2=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新 API 接口路径从 /steady/data-view/checksquare/* 到 /steady/checksquare/* - 修改校验任务状态枚举值 FAILED 为 FAIL 并更新相关处理逻辑 - 移除缺失率和最大连续缺失分钟数字段,简化数据完整性计算 - 添加新的创建结果面板组件 ChecksquareCreateResultPanel.vue - 调整创建对话框布局,采用两行搜索控件设计 - 更新任务表头部按钮文字为"新增"并调整搜索列配置为5列 - 修改详情面板显示开始时间和结束时间字段 - 重构工作台界面布局,使用 flex 布局替代 grid 布局 - 更新设备类型相关 API 接口和数据结构定义 - 添加设备类型字典常量并更新路由配置 - 优化搜索表单展开收起逻辑的计算方式 - 调整创建流程不再轮询获取任务详情,改为直接显示摘要信息 - 更新数据完整性格式化函数参数和调用方式 - 修改创建对话框样式类名和尺寸配置 - 添加设备类型管理相关的接口定义和实现方法 --- .gitignore | 11 + .../src/api/steady/steadyDataView/index.ts | 10 +- .../steady/steadyDataView/interface/index.ts | 26 +- frontend/src/api/tools/mmsmapping/index.ts | 60 +- .../api/tools/mmsmapping/interface/index.ts | 88 +- frontend/src/components/SearchForm/index.vue | 10 +- frontend/src/constants/dictCodes.ts | 6 +- frontend/src/routers/modules/dynamicRouter.ts | 1 + frontend/src/routers/modules/staticRouter.ts | 13 +- .../check-square-api-debug_20260613.md | 417 ++++++++ .../ChecksquareCreateResultPanel.vue | 215 ++++ .../components/ChecksquareDetailPanel.vue | 5 +- .../components/ChecksquareSummaryTable.vue | 2 +- .../components/ChecksquareTaskTable.vue | 6 +- .../components/ChecksquareWorkbench.vue | 58 +- .../check-checksquare-feature-contract.mjs | 155 ++- .../src/views/steady/checksquare/index.vue | 50 +- .../checksquare/utils/checksquareTable.ts | 22 +- .../checksquare/utils/checksquareTaskTable.ts | 13 +- .../contracts/check-api-contract.mjs | 67 ++ .../check-no-icd-dialog-contract.mjs | 30 + .../contracts/check-route-contract.mjs | 43 + .../contracts/check-table-contract.mjs | 119 +++ .../src/views/tools/deviceTypes/index.vue | 605 +++++++++++ frontend/src/views/tools/index.vue | 4 +- .../components/IcdPathCheckDialog.vue | 376 +++++++ .../components/IcdPathFormDialog.vue | 282 +++++ .../mmsMapping/components/JsonMappingTree.vue | 7 +- .../components/MappingConfirmDialog.vue | 4 +- .../contracts/check-flow-contract.mjs | 45 + .../check-icd-path-page-contract.mjs | 116 +++ .../check-panel-title-tabs-contract.mjs | 35 + .../tools/mmsMapping/deviceTypes/index.vue | 287 ------ frontend/src/views/tools/mmsMapping/index.vue | 968 ++++++------------ .../mmsMapping/utils/useMmsMappingFlow.ts | 788 ++++++++++++++ .../components/MappingConfigPanel.vue | 51 +- .../components/MappingRequestPanel.vue | 63 +- .../components/MappingResultPanel.vue | 361 ++++--- 38 files changed, 4165 insertions(+), 1254 deletions(-) create mode 100644 frontend/src/views/steady/checksquare/check-square-api-debug_20260613.md create mode 100644 frontend/src/views/steady/checksquare/components/ChecksquareCreateResultPanel.vue create mode 100644 frontend/src/views/tools/deviceTypes/contracts/check-api-contract.mjs create mode 100644 frontend/src/views/tools/deviceTypes/contracts/check-no-icd-dialog-contract.mjs create mode 100644 frontend/src/views/tools/deviceTypes/contracts/check-route-contract.mjs create mode 100644 frontend/src/views/tools/deviceTypes/contracts/check-table-contract.mjs create mode 100644 frontend/src/views/tools/deviceTypes/index.vue create mode 100644 frontend/src/views/tools/mmsMapping/components/IcdPathCheckDialog.vue create mode 100644 frontend/src/views/tools/mmsMapping/components/IcdPathFormDialog.vue create mode 100644 frontend/src/views/tools/mmsMapping/contracts/check-flow-contract.mjs create mode 100644 frontend/src/views/tools/mmsMapping/contracts/check-icd-path-page-contract.mjs create mode 100644 frontend/src/views/tools/mmsMapping/contracts/check-panel-title-tabs-contract.mjs delete mode 100644 frontend/src/views/tools/mmsMapping/deviceTypes/index.vue create mode 100644 frontend/src/views/tools/mmsMapping/utils/useMmsMappingFlow.ts diff --git a/.gitignore b/.gitignore index d108ac1..c9fd191 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,14 @@ public/electron/ pnpm-lock.yaml CLAUDE.md /public/dist/ +/build/extraResources/influxdb-1.7.0/data/_internal/_series/00/0000 +/build/extraResources/influxdb-1.7.0/meta/meta.db +/build/extraResources/influxdb-1.7.0/influxdb.runtime.conf +/build/extraResources/influxdb-1.7.0/wal/_internal/monitor/1/_00001.wal +/build/extraResources/influxdb-1.7.0/data/_internal/_series/07/0000 +/build/extraResources/influxdb-1.7.0/data/_internal/_series/06/0000 +/build/extraResources/influxdb-1.7.0/data/_internal/_series/05/0000 +/build/extraResources/influxdb-1.7.0/data/_internal/_series/04/0000 +/build/extraResources/influxdb-1.7.0/data/_internal/_series/03/0000 +/build/extraResources/influxdb-1.7.0/data/_internal/_series/02/0000 +/build/extraResources/influxdb-1.7.0/data/_internal/_series/01/0000 diff --git a/frontend/src/api/steady/steadyDataView/index.ts b/frontend/src/api/steady/steadyDataView/index.ts index 2f088e1..8dbc197 100644 --- a/frontend/src/api/steady/steadyDataView/index.ts +++ b/frontend/src/api/steady/steadyDataView/index.ts @@ -18,29 +18,29 @@ export const querySteadyTrendDay = (params: SteadyDataView.SteadyTrendQueryParam } export const querySteadyChecksquareTasks = (params: SteadyDataView.SteadyChecksquareTaskQueryParams) => { - return http.post>('/steady/data-view/checksquare/query', params, { + return http.post>('/steady/checksquare/query', params, { loading: false }) } export const createSteadyChecksquareTask = (params: SteadyDataView.SteadyChecksquareCreateParams) => { - return http.post('/steady/data-view/checksquare/create', params, { + return http.post('/steady/checksquare/create', params, { loading: false }) } export const deleteSteadyChecksquareTasks = (taskIds: SteadyDataView.SteadyChecksquareDeleteParams) => { - return http.post('/steady/data-view/checksquare/delete', taskIds, { + return http.post('/steady/checksquare/delete', taskIds, { loading: false }) } export const getSteadyChecksquareDetail = (taskId: string) => { - return http.get('/steady/data-view/checksquare/detail', { taskId }, { loading: false }) + return http.get('/steady/checksquare/detail', { taskId }, { loading: false }) } export const getSteadyChecksquareItemDetail = (params: SteadyDataView.SteadyChecksquareItemDetailParams) => { - return http.get('/steady/data-view/checksquare/item-detail', params, { + return http.get('/steady/checksquare/item-detail', params, { loading: false }) } diff --git a/frontend/src/api/steady/steadyDataView/interface/index.ts b/frontend/src/api/steady/steadyDataView/interface/index.ts index a431d6e..6545215 100644 --- a/frontend/src/api/steady/steadyDataView/interface/index.ts +++ b/frontend/src/api/steady/steadyDataView/interface/index.ts @@ -113,26 +113,13 @@ export namespace SteadyDataView { timeStart?: string timeEnd?: string intervalMinutes?: number - taskStatus?: 'SUCCESS' | string + taskStatus?: 'RUNNING' | 'SUCCESS' | 'FAIL' | string itemCount?: number abnormalItemCount?: number minDataIntegrity?: number | null - maxMissingRate?: number | null createTime?: string } - export interface SteadyChecksquareCreateResult { - taskId: string - taskNo?: string - lineId?: string - lineName?: string - timeStart?: string - timeEnd?: string - intervalMinutes?: number - itemCount?: number - abnormalItemCount?: number - } - export interface SteadyChecksquareSegment { startTime: string endTime: string @@ -151,9 +138,6 @@ export namespace SteadyDataView { missingPointCount?: number dataIntegrity?: number | null dataIntegrityText?: string | null - missingRate?: number | null - missingRateText?: string | null - maxContinuousMissingMinutes?: number } export interface SteadyChecksquareStatDetail { @@ -174,9 +158,6 @@ export namespace SteadyDataView { missingPointCount?: number dataIntegrity?: number | null dataIntegrityText?: string | null - missingRate?: number | null - missingRateText?: string | null - maxContinuousMissingMinutes?: number abnormal?: boolean abnormalPointCount?: number harmonicParityAbnormal?: boolean @@ -194,6 +175,11 @@ export namespace SteadyDataView { timeStart: string timeEnd: string intervalMinutes?: number + taskStatus?: 'RUNNING' | 'SUCCESS' | 'FAIL' | string + itemCount?: number + abnormalItemCount?: number + minDataIntegrity?: number | null + createTime?: string items: SteadyChecksquareItem[] } diff --git a/frontend/src/api/tools/mmsmapping/index.ts b/frontend/src/api/tools/mmsmapping/index.ts index db8b157..b8c4dc7 100644 --- a/frontend/src/api/tools/mmsmapping/index.ts +++ b/frontend/src/api/tools/mmsmapping/index.ts @@ -9,20 +9,72 @@ const buildIcdFormData = (icdFile: File) => { return formData } +const buildIcdPathFormData = (icdFile: File, request: MmsMapping.CreateIcdPathRequest | MmsMapping.UpdateIcdPathRequest) => { + const formData = buildIcdFormData(icdFile) + + formData.append('request', new Blob([JSON.stringify(request)], { type: 'application/json' })) + + return formData +} + export const listDeviceTypesApi = () => { - return http.get('/api/mms-mapping/dev-types') + return http.get('/api/device-types') } export const createDeviceTypeApi = (params: MmsMapping.CreateDeviceTypeRequest) => { - return http.post('/api/mms-mapping/dev-types', params) + return http.post('/api/device-types/add', params) +} + +export const updateDeviceTypeApi = (params: MmsMapping.UpdateDeviceTypeRequest) => { + return http.post('/api/device-types/update', params) +} + +export const deleteDeviceTypesApi = (ids: string[]) => { + return http.post('/api/device-types/delete', ids) } export const saveIcdCheckResultApi = (id: string, params: MmsMapping.SaveIcdCheckResultRequest) => { - return http.post(`/api/mms-mapping/dev-types/${id}/icd-check-result`, params) + return http.post(`/api/device-types/${id}/icd-check-result`, params) } export const pqdifCheckApi = (id: string) => { - return http.post(`/api/mms-mapping/dev-types/${id}/pqdif-check`) + return http.post(`/api/device-types/${id}/pqdif-check`) +} + +export const listIcdPathsApi = (params: MmsMapping.IcdPathListRequest) => { + return http.post('/api/mms-mapping/icd-paths/list', params) +} + +export const createIcdPathApi = (params: MmsMapping.CreateIcdPathRequest) => { + return http.post('/api/mms-mapping/icd-paths/add', params) +} + +export const createIcdPathWithFileApi = (params: MmsMapping.CreateIcdPathWithFileRequest) => { + return http.post('/api/mms-mapping/icd-paths/add', buildIcdPathFormData(params.icdFile, params.request), { + headers: { 'Content-Type': 'multipart/form-data' } + }) +} + +export const updateIcdPathApi = (params: MmsMapping.UpdateIcdPathRequest) => { + return http.post('/api/mms-mapping/icd-paths/update', params) +} + +export const updateIcdPathWithFileApi = (params: MmsMapping.UpdateIcdPathWithFileRequest) => { + return http.post('/api/mms-mapping/icd-paths/update', buildIcdPathFormData(params.icdFile, params.request), { + headers: { 'Content-Type': 'multipart/form-data' } + }) +} + +export const deleteIcdPathsApi = (ids: string[]) => { + return http.post('/api/mms-mapping/icd-paths/delete', ids) +} + +export const saveIcdPathCheckResultApi = (id: string, params: MmsMapping.SaveIcdPathCheckResultRequest) => { + return http.post(`/api/mms-mapping/icd-paths/${id}/icd-check-result`, params) +} + +export const checkIcdJsonConsistencyApi = (params: MmsMapping.IcdJsonConsistencyCheckRequest) => { + return http.post('/api/mms-mapping/check-icd-json-consistency', params) } export const getIcdApi = (params: MmsMapping.GetIcdParams) => { diff --git a/frontend/src/api/tools/mmsmapping/interface/index.ts b/frontend/src/api/tools/mmsmapping/interface/index.ts index 497c055..b64bd5d 100644 --- a/frontend/src/api/tools/mmsmapping/interface/index.ts +++ b/frontend/src/api/tools/mmsmapping/interface/index.ts @@ -65,6 +65,7 @@ export namespace MmsMapping { export interface GetXmlFromJsonRequestPayload { mappingJson: string + configType?: number } export interface GetXmlFromJsonParams { @@ -137,6 +138,11 @@ export namespace MmsMapping { icdPath?: string icdResult?: number icdMsg?: string + power?: string + devVolt?: number + devCurr?: number + devChns?: number + waveCmd?: string reportName?: string canCheckIcd?: boolean canCheckPqdif?: boolean @@ -144,12 +150,19 @@ export namespace MmsMapping { export interface CreateDeviceTypeRequest { name: string - icdId?: string - icdName?: string - icdPath?: string + icd?: string + power?: string + devVolt?: number + devCurr?: number + devChns?: number + waveCmd?: string reportName?: string } + export interface UpdateDeviceTypeRequest extends CreateDeviceTypeRequest { + id: string + } + export interface SaveIcdCheckResultRequest { mappingJson?: string xml?: string @@ -157,6 +170,75 @@ export namespace MmsMapping { msg?: string } + export interface IcdPathRecord { + id?: string + name?: string + path?: string + angle?: number + usePhaseIndex?: number + state?: number + jsonStr?: string + xmlStr?: string + result?: number + msg?: string + type?: number + referenceIcdId?: string + createBy?: string + createTime?: string + updateBy?: string + updateTime?: string + } + + export interface IcdPathListRequest { + keyword?: string + type?: number + result?: number + } + + export interface CreateIcdPathRequest { + name: string + path: string + angle?: number + usePhaseIndex?: number + type?: number + } + + export interface CreateIcdPathWithFileRequest { + icdFile: File + request: CreateIcdPathRequest + } + + export interface UpdateIcdPathRequest extends CreateIcdPathRequest { + id: string + } + + export interface UpdateIcdPathWithFileRequest { + icdFile: File + request: UpdateIcdPathRequest + } + + export interface SaveIcdPathCheckResultRequest { + mappingJson?: string + xml?: string + result?: number + msg?: string + } + + export interface IcdJsonConsistencyCheckRequest { + checkedJson: string + standardJson: string + saveToDisk?: boolean + outputDir?: string + } + + export interface IcdJsonConsistencyCheckResponse { + result?: number + message?: string + issues?: string[] + issuesJson?: string + correctedJson?: string + } + export interface PqdifCheckPlaceholder { status?: string message?: string diff --git a/frontend/src/components/SearchForm/index.vue b/frontend/src/components/SearchForm/index.vue index bed1fff..bbbe749 100644 --- a/frontend/src/components/SearchForm/index.vue +++ b/frontend/src/components/SearchForm/index.vue @@ -80,15 +80,15 @@ const breakPoint = computed(() => gridRef.value?.breakPoint) // 判断是否显示 展开/合并 按钮 const showCollapse = computed(() => { let show = false + const searchColCount = + typeof props.searchCol !== 'number' ? props.searchCol[breakPoint.value] : props.searchCol + const firstRowSearchCols = Math.max(searchColCount - 1, 1) + props.columns.reduce((prev, current) => { prev += (current.search![breakPoint.value]?.span ?? current.search?.span ?? 1) + (current.search![breakPoint.value]?.offset ?? current.search?.offset ?? 0) - if (typeof props.searchCol !== 'number') { - if (prev > props.searchCol[breakPoint.value]) show = true - } else { - if (prev > props.searchCol) show = true - } + if (prev > firstRowSearchCols) show = true return prev }, 0) return show diff --git a/frontend/src/constants/dictCodes.ts b/frontend/src/constants/dictCodes.ts index 48003d5..7293173 100644 --- a/frontend/src/constants/dictCodes.ts +++ b/frontend/src/constants/dictCodes.ts @@ -3,7 +3,11 @@ export const DICT_CODES = { EVENT_TYPE: 'event_type', LEDGER_DEVICE_TYPE: 'ledger_device_type', LEDGER_DEVICE_MODEL: 'Ex-factory_Dev_Type', - LEDGER_TERMINAL_MODEL: 'Dev_Type' + LEDGER_TERMINAL_MODEL: 'Dev_Type', + DEVICE_TYPE_WORK_POWER: 'Dev_Power', + DEVICE_TYPE_CHANNEL_COUNT: 'Dev_Chns', + DEVICE_TYPE_RATED_VOLTAGE: 'Dev_Volt', + DEVICE_TYPE_RATED_CURRENT: 'Dev_Curr' } as const export type DictCode = (typeof DICT_CODES)[keyof typeof DICT_CODES] diff --git a/frontend/src/routers/modules/dynamicRouter.ts b/frontend/src/routers/modules/dynamicRouter.ts index 7a00002..cedc37d 100644 --- a/frontend/src/routers/modules/dynamicRouter.ts +++ b/frontend/src/routers/modules/dynamicRouter.ts @@ -43,6 +43,7 @@ const STATIC_ROUTE_NAMES = new Set([ 'tools', 'toolWaveform', 'toolMmsMapping', + 'deviceTypes', 'toolAddData', 'toolAddLedger', 'eventList', diff --git a/frontend/src/routers/modules/staticRouter.ts b/frontend/src/routers/modules/staticRouter.ts index 83391e2..fa27ac3 100644 --- a/frontend/src/routers/modules/staticRouter.ts +++ b/frontend/src/routers/modules/staticRouter.ts @@ -60,17 +60,16 @@ export const staticRouter: RouteRecordRaw[] = [ component: () => import('@/views/tools/mmsMapping/index.vue'), meta: { cacheName: 'MmsMappingView', - title: 'MMS 映射' + title: '模型映射管理' } }, { - path: '/tools/mmsMapping/deviceTypes', - name: 'toolMmsMappingDeviceTypes', - alias: ['/tools/mmsmapping/deviceTypes', '/tools/mms-mapping/device-types'], - component: () => import('@/views/tools/mmsMapping/deviceTypes/index.vue'), + path: '/tools/deviceTypes', + name: 'deviceTypes', + component: () => import('@/views/tools/deviceTypes/index.vue'), meta: { cacheName: 'MmsDeviceTypesView', - title: '设备类型校验' + title: '设备类型管理' } }, { @@ -159,7 +158,7 @@ export const staticRouter: RouteRecordRaw[] = [ component: () => import('@/views/steady/checksquare/index.vue'), meta: { cacheName: 'ChecksquareView', - title: '数据验证入库' + title: '数据验证' } }, { diff --git a/frontend/src/views/steady/checksquare/check-square-api-debug_20260613.md b/frontend/src/views/steady/checksquare/check-square-api-debug_20260613.md new file mode 100644 index 0000000..9566244 --- /dev/null +++ b/frontend/src/views/steady/checksquare/check-square-api-debug_20260613.md @@ -0,0 +1,417 @@ +# check-square API 调试文档 + +## 1. 模块说明 + +- 模块路径:`steady/check-square` +- 接口基础路径:`/steady/checksquare` +- 返回包装:接口统一返回 `HttpResult`,调试时重点查看响应体中的业务数据字段 `data`。 +- 时间格式:`yyyy-MM-dd HH:mm:ss` + +本模块用于按监测点、时间范围和指标执行稳态数据校验,并提供任务列表、任务详情、检测项明细查询和任务删除能力。 + +## 2. 通用约定 + +### 2.1 请求头 + +| 名称 | 示例 | 说明 | +| --- | --- | --- | +| `Content-Type` | `application/json` | `POST` 请求使用 JSON 请求体 | +| `Authorization` | 登录态 Token | 如当前环境开启认证,需携带现有登录接口返回的认证信息 | + +### 2.2 任务状态 + +| 值 | 说明 | +| --- | --- | +| `RUNNING` | 执行中 | +| `SUCCESS` | 执行成功 | +| `FAIL` | 执行失败 | + +### 2.3 明细类型 + +| 值 | 说明 | +| --- | --- | +| `SEGMENT` | 缺失区间 | +| `VALUE_ORDER` | 指标值大小关系异常明细 | +| `HARMONIC_PARITY` | 谐波奇偶关系异常明细 | + +## 3. 调试顺序建议 + +1. 调用 `POST /steady/checksquare/create`:按监测点和时间范围创建或获取任务。 +2. 读取 `/create` 返回的 `data.taskId`:该返回值是任务列表中的行信息。 +3. 调用 `GET /steady/checksquare/detail`:用 `taskId` 查询任务下的检测项。 +4. 读取 `/detail` 返回的 `items[].itemId`:按检测项继续查询缺失区间或异常明细。 +5. 调用 `GET /steady/checksquare/item-detail`:按 `itemId + detailType` 查询具体明细。 +6. 调用 `POST /steady/checksquare/query`:按条件分页查询历史任务列表。 +7. 需要清理任务时调用 `POST /steady/checksquare/delete`。 + +注意:旧的获取或创建兼容接口已移除。创建或复用任务的逻辑已经合并到 `/create` 中。 + +## 4. 创建或获取任务 + +### 4.1 接口 + +`POST /steady/checksquare/create` + +### 4.2 行为说明 + +接口开始执行前,会先按 `lineId + timeStart + timeEnd` 查询是否存在未删除的任务: + +- 已存在:直接返回该任务的任务列表行信息。 +- 不存在:创建任务,执行校验,任务执行完成后返回任务列表行信息。 + +返回对象为 `SteadyChecksquareTaskVO`,用于页面任务列表展示。若要查看检测项明细,需要再调用 `GET /steady/checksquare/detail`。 + +### 4.3 请求字段 + +| 字段 | 类型 | 必填 | 说明 | +| --- | --- | --- | --- | +| `lineId` | `String` | 是 | 监测点 ID | +| `indicatorCodes` | `Array` | 是 | 指标编码列表 | +| `timeStart` | `String` | 是 | 开始时间,格式 `yyyy-MM-dd HH:mm:ss` | +| `timeEnd` | `String` | 是 | 结束时间,格式 `yyyy-MM-dd HH:mm:ss` | + +`indicatorCodes` 是数组;不要传成单个字符串。 + +### 4.4 请求示例 + +```http +POST /steady/checksquare/create +Content-Type: application/json +``` + +```json +{ + "lineId": "LINE_001", + "indicatorCodes": ["VOLTAGE_A", "CURRENT_A"], + "timeStart": "2026-06-13 00:00:00", + "timeEnd": "2026-06-13 01:00:00" +} +``` + +### 4.5 响应字段 `data` + +| 字段 | 类型 | 说明 | +| --- | --- | --- | +| `taskId` | `String` | 任务 ID | +| `taskNo` | `String` | 任务编号 | +| `lineId` | `String` | 监测点 ID | +| `lineName` | `String` | 监测点名称 | +| `timeStart` | `String` | 开始时间 | +| `timeEnd` | `String` | 结束时间 | +| `intervalMinutes` | `Integer` | 统计间隔,单位分钟 | +| `taskStatus` | `String` | 任务状态:`RUNNING`、`SUCCESS`、`FAIL` | +| `itemCount` | `Integer` | 检测项数量 | +| `abnormalItemCount` | `Integer` | 异常检测项数量 | +| `minDataIntegrity` | `BigDecimal` | 最低数据完整率 | +| `createTime` | `String` | 创建时间 | + +### 4.6 响应示例 + +```json +{ + "code": 200, + "msg": "success", + "data": { + "taskId": "1812345678901234567", + "taskNo": "CS202606130001", + "lineId": "LINE_001", + "lineName": "1号监测点", + "timeStart": "2026-06-13 00:00:00", + "timeEnd": "2026-06-13 01:00:00", + "intervalMinutes": 1, + "taskStatus": "SUCCESS", + "itemCount": 2, + "abnormalItemCount": 1, + "minDataIntegrity": 98.50, + "createTime": "2026-06-13 09:30:00" + } +} +``` + +## 5. 查询任务列表 + +### 5.1 接口 + +`POST /steady/checksquare/query` + +### 5.2 请求字段 + +| 字段 | 类型 | 必填 | 说明 | +| --- | --- | --- | --- | +| `lineId` | `String` | 否 | 监测点 ID | +| `indicatorCode` | `String` | 否 | 指标编码 | +| `timeStart` | `String` | 否 | 检测开始时间,格式 `yyyy-MM-dd HH:mm:ss` | +| `timeEnd` | `String` | 否 | 检测结束时间,格式 `yyyy-MM-dd HH:mm:ss` | +| `hasAbnormal` | `Boolean` | 否 | 是否存在异常 | +| `pageNum` | `Integer` | 否 | 页码 | +| `pageSize` | `Integer` | 否 | 每页条数 | + +`indicatorCode` 是单个字符串,用于历史任务筛选;和 `/create` 的 `indicatorCodes` 数组不同。 + +### 5.3 请求示例 + +```http +POST /steady/checksquare/query +Content-Type: application/json +``` + +```json +{ + "lineId": "LINE_001", + "indicatorCode": "VOLTAGE_A", + "timeStart": "2026-06-13 00:00:00", + "timeEnd": "2026-06-13 23:59:59", + "hasAbnormal": true, + "pageNum": 1, + "pageSize": 10 +} +``` + +### 5.4 响应说明 + +`data` 为 MyBatis-Plus `Page` 分页对象,常用字段如下: + +| 字段 | 类型 | 说明 | +| --- | --- | --- | +| `records` | `Array` | 任务列表,每项字段同 `/create` 返回的 `SteadyChecksquareTaskVO` | +| `total` | `Long` | 总记录数 | +| `size` | `Long` | 每页条数 | +| `current` | `Long` | 当前页码 | +| `pages` | `Long` | 总页数 | + +### 5.5 响应示例 + +```json +{ + "code": 200, + "msg": "success", + "data": { + "records": [ + { + "taskId": "1812345678901234567", + "taskNo": "CS202606130001", + "lineId": "LINE_001", + "lineName": "1号监测点", + "timeStart": "2026-06-13 00:00:00", + "timeEnd": "2026-06-13 01:00:00", + "intervalMinutes": 1, + "taskStatus": "SUCCESS", + "itemCount": 2, + "abnormalItemCount": 1, + "minDataIntegrity": 98.50, + "createTime": "2026-06-13 09:30:00" + } + ], + "total": 1, + "size": 10, + "current": 1, + "pages": 1 + } +} +``` + +## 6. 查询任务详情 + +### 6.1 接口 + +`GET /steady/checksquare/detail?taskId={taskId}` + +### 6.2 请求参数 + +| 字段 | 类型 | 必填 | 说明 | +| --- | --- | --- | --- | +| `taskId` | `String` | 是 | 任务 ID | + +### 6.3 请求示例 + +```http +GET /steady/checksquare/detail?taskId=1812345678901234567 +``` + +### 6.4 响应字段 `data` + +| 字段 | 类型 | 说明 | +| --- | --- | --- | +| `taskId` | `String` | 任务 ID | +| `taskNo` | `String` | 任务编号 | +| `lineId` | `String` | 监测点 ID | +| `lineName` | `String` | 监测点名称 | +| `timeStart` | `String` | 开始时间 | +| `timeEnd` | `String` | 结束时间 | +| `intervalMinutes` | `Integer` | 统计间隔,单位分钟 | +| `items` | `Array` | 检测项列表 | + +### 6.5 检测项字段 `items[]` + +| 字段 | 类型 | 说明 | +| --- | --- | --- | +| `itemId` | `String` | 检测项 ID,用于查询明细 | +| `itemKey` | `String` | 检测项唯一键 | +| `indicatorCode` | `String` | 指标编码 | +| `indicatorName` | `String` | 指标名称 | +| `harmonicOrder` | `Integer` | 谐波次数 | +| `intervalMinutes` | `Integer` | 当前检测项统计间隔,单位分钟 | +| `hasData` | `Boolean` | 时间范围内是否存在任意数据 | +| `expectedPointCount` | `Integer` | 期望点数 | +| `actualPointCount` | `Integer` | 实际点数 | +| `missingPointCount` | `Integer` | 缺失点数 | +| `dataIntegrity` | `BigDecimal` | 数据完整率 | +| `dataIntegrityText` | `String` | 数据完整率文本 | +| `abnormal` | `Boolean` | 指标值大小关系是否异常 | +| `abnormalPointCount` | `Integer` | 指标值大小关系异常点数 | +| `abnormalDetails` | `Array` | 指标值大小关系异常明细摘要 | +| `harmonicParityAbnormal` | `Boolean` | 谐波奇偶关系是否异常 | +| `harmonicParityAbnormalPointCount` | `Integer` | 谐波奇偶关系异常点数 | +| `harmonicParityAbnormalDetails` | `Array` | 谐波奇偶关系异常明细摘要 | +| `statSummaries` | `Array` | 统计类型摘要 | +| `statDetails` | `Array` | 统计类型明细 | + +### 6.6 响应示例 + +```json +{ + "code": 200, + "msg": "success", + "data": { + "taskId": "1812345678901234567", + "taskNo": "CS202606130001", + "lineId": "LINE_001", + "lineName": "1号监测点", + "timeStart": "2026-06-13 00:00:00", + "timeEnd": "2026-06-13 01:00:00", + "intervalMinutes": 1, + "items": [ + { + "itemId": "1812345678901234568", + "itemKey": "LINE_001:VOLTAGE_A", + "indicatorCode": "VOLTAGE_A", + "indicatorName": "A相电压", + "harmonicOrder": null, + "intervalMinutes": 1, + "hasData": true, + "expectedPointCount": 60, + "actualPointCount": 59, + "missingPointCount": 1, + "dataIntegrity": 98.33, + "dataIntegrityText": "98.33%", + "abnormal": true, + "abnormalPointCount": 1, + "abnormalDetails": [], + "harmonicParityAbnormal": false, + "harmonicParityAbnormalPointCount": 0, + "harmonicParityAbnormalDetails": [], + "statSummaries": [], + "statDetails": [] + } + ] + } +} +``` + +## 7. 查询检测项明细 + +### 7.1 接口 + +`GET /steady/checksquare/item-detail` + +### 7.2 请求参数 + +| 字段 | 类型 | 必填 | 说明 | +| --- | --- | --- | --- | +| `itemId` | `String` | 是 | 检测项 ID | +| `detailType` | `String` | 是 | 明细类型:`SEGMENT`、`VALUE_ORDER`、`HARMONIC_PARITY` | +| `statType` | `String` | 否 | 统计类型;查询统计明细时使用 | +| `pageNum` | `Integer` | 否 | 页码 | +| `pageSize` | `Integer` | 否 | 每页条数 | + +### 7.3 请求示例 + +```http +GET /steady/checksquare/item-detail?itemId=1812345678901234568&detailType=SEGMENT&pageNum=1&pageSize=10 +``` + +### 7.4 响应字段 `data` + +| 字段 | 类型 | 说明 | +| --- | --- | --- | +| `itemId` | `String` | 检测项 ID | +| `detailType` | `String` | 明细类型 | +| `statType` | `String` | 统计类型 | +| `pageNum` | `Integer` | 当前页码;未分页查询时为空 | +| `pageSize` | `Integer` | 每页条数;未分页查询时为空 | +| `total` | `Long` | 总记录数;未分页查询时为空 | +| `segments` | `Array` | 缺失区间,`detailType=SEGMENT` 时查看 | +| `valueOrderDetails` | `Array` | 指标值大小关系异常明细,`detailType=VALUE_ORDER` 时查看 | +| `harmonicParityDetails` | `Array` | 谐波奇偶关系异常明细,`detailType=HARMONIC_PARITY` 时查看 | + +### 7.5 响应示例 + +```json +{ + "code": 200, + "msg": "success", + "data": { + "itemId": "1812345678901234568", + "detailType": "SEGMENT", + "statType": null, + "pageNum": 1, + "pageSize": 10, + "total": 1, + "segments": [ + { + "segmentStart": "2026-06-13 00:10:00", + "segmentEnd": "2026-06-13 00:10:00", + "pointCount": 1 + } + ], + "valueOrderDetails": [], + "harmonicParityDetails": [] + } +} +``` + +## 8. 删除任务 + +### 8.1 接口 + +`POST /steady/checksquare/delete` + +### 8.2 请求字段 + +请求体直接传任务 ID 数组。 + +| 字段 | 类型 | 必填 | 说明 | +| --- | --- | --- | --- | +| `taskIds` | `Array` | 是 | 任务 ID 数组 | + +### 8.3 请求示例 + +```http +POST /steady/checksquare/delete +Content-Type: application/json +``` + +```json +[ + "1812345678901234567" +] +``` + +### 8.4 响应示例 + +```json +{ + "code": 200, + "msg": "success", + "data": true +} +``` + +## 9. 常见调试注意事项 + +- `/create` 返回的是任务列表行信息,不是详情页完整数据。 +- `/create` 如果命中已存在任务,会直接返回该任务;不会生成重复任务。 +- `/detail` 需要使用 `/create` 或 `/query` 返回的 `taskId`。 +- `/item-detail` 需要使用 `/detail` 返回的 `items[].itemId`。 +- `/query` 使用 `indicatorCode` 单值筛选;`/create` 使用 `indicatorCodes` 数组创建检测项。 +- 当前文档只覆盖现有有效接口,不包含旧的任务获取或创建兼容接口。 diff --git a/frontend/src/views/steady/checksquare/components/ChecksquareCreateResultPanel.vue b/frontend/src/views/steady/checksquare/components/ChecksquareCreateResultPanel.vue new file mode 100644 index 0000000..eb9a220 --- /dev/null +++ b/frontend/src/views/steady/checksquare/components/ChecksquareCreateResultPanel.vue @@ -0,0 +1,215 @@ + + + + + diff --git a/frontend/src/views/steady/checksquare/components/ChecksquareDetailPanel.vue b/frontend/src/views/steady/checksquare/components/ChecksquareDetailPanel.vue index 6c1d3a3..1090a5f 100644 --- a/frontend/src/views/steady/checksquare/components/ChecksquareDetailPanel.vue +++ b/frontend/src/views/steady/checksquare/components/ChecksquareDetailPanel.vue @@ -8,7 +8,7 @@
数据完整性 - {{ formatDataIntegrity(selectedItem.dataIntegrity, selectedItem.dataIntegrityText, selectedItem.missingRate) }} + {{ formatDataIntegrity(selectedItem.dataIntegrity, selectedItem.dataIntegrityText) }}
@@ -45,7 +45,8 @@ - + + diff --git a/frontend/src/views/steady/checksquare/components/ChecksquareSummaryTable.vue b/frontend/src/views/steady/checksquare/components/ChecksquareSummaryTable.vue index 06c017f..08d7829 100644 --- a/frontend/src/views/steady/checksquare/components/ChecksquareSummaryTable.vue +++ b/frontend/src/views/steady/checksquare/components/ChecksquareSummaryTable.vue @@ -121,7 +121,7 @@ const hasAbnormalCount = (value?: number | null) => Number(value || 0) > 0 const stripPercentUnit = (value: string) => value.replace(/%$/, '') const formatSummaryDataIntegrity = (row: SteadyDataView.SteadyChecksquareItem) => { - return stripPercentUnit(formatDataIntegrity(row.dataIntegrity, row.dataIntegrityText, row.missingRate)) + return stripPercentUnit(formatDataIntegrity(row.dataIntegrity, row.dataIntegrityText)) } const formatSummaryStatIntegrity = ( diff --git a/frontend/src/views/steady/checksquare/components/ChecksquareTaskTable.vue b/frontend/src/views/steady/checksquare/components/ChecksquareTaskTable.vue index 43dc7d5..ec0d9b5 100644 --- a/frontend/src/views/steady/checksquare/components/ChecksquareTaskTable.vue +++ b/frontend/src/views/steady/checksquare/components/ChecksquareTaskTable.vue @@ -4,10 +4,10 @@ row-key="taskId" :columns="columns" :request-api="getTableList" - :search-col="{ xs: 1, sm: 2, md: 2, lg: 4, xl: 4 }" + :search-col="{ xs: 1, sm: 2, md: 2, lg: 5, xl: 5 }" > @@ -210,7 +214,7 @@ watch( diff --git a/frontend/src/views/steady/checksquare/contracts/check-checksquare-feature-contract.mjs b/frontend/src/views/steady/checksquare/contracts/check-checksquare-feature-contract.mjs index db4cfaf..8f0e3a0 100644 --- a/frontend/src/views/steady/checksquare/contracts/check-checksquare-feature-contract.mjs +++ b/frontend/src/views/steady/checksquare/contracts/check-checksquare-feature-contract.mjs @@ -14,6 +14,7 @@ const files = { taskTable: path.resolve(rootDir, 'views/steady/checksquare/components/ChecksquareTaskTable.vue'), summaryTable: path.resolve(rootDir, 'views/steady/checksquare/components/ChecksquareSummaryTable.vue'), detailPanel: path.resolve(rootDir, 'views/steady/checksquare/components/ChecksquareDetailPanel.vue'), + createResultPanel: path.resolve(rootDir, 'views/steady/checksquare/components/ChecksquareCreateResultPanel.vue'), measurementPointDialog: path.resolve(rootDir, 'views/steady/checksquare/components/ChecksquareMeasurementPointDialog.vue'), payload: path.resolve(rootDir, 'views/steady/checksquare/utils/checksquarePayload.ts'), ledgerUtils: path.resolve(rootDir, 'views/steady/checksquare/utils/checksquareLedger.ts'), @@ -34,11 +35,12 @@ const checks = [ () => { const api = read(files.api) return ( - /\/steady\/data-view\/checksquare\/query/.test(api) && - /\/steady\/data-view\/checksquare\/create/.test(api) && - /\/steady\/data-view\/checksquare\/delete/.test(api) && - /\/steady\/data-view\/checksquare\/detail/.test(api) && - /\/steady\/data-view\/checksquare\/item-detail/.test(api) + /\/steady\/checksquare\/query/.test(api) && + /\/steady\/checksquare\/create/.test(api) && + !/\/steady\/checksquare\/get-or-create/.test(api) && + /\/steady\/checksquare\/delete/.test(api) && + /\/steady\/checksquare\/detail/.test(api) && + /\/steady\/checksquare\/item-detail/.test(api) ) } ], @@ -48,7 +50,7 @@ const checks = [ /export const deleteSteadyChecksquareTasks = \(taskIds: SteadyDataView\.SteadyChecksquareDeleteParams\)/.test( read(files.api) ) && - /http\.post\('\/steady\/data-view\/checksquare\/delete', taskIds/.test(read(files.api)) && + /http\.post\('\/steady\/checksquare\/delete', taskIds/.test(read(files.api)) && /export type SteadyChecksquareDeleteParams = string\[\]/.test(read(files.apiTypes)) ], [ @@ -76,7 +78,10 @@ const checks = [ ['task table uses ProTable like event list', () => / /