From 38b2a8369513ebcc34c6dd01a176593b825fe71e Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期日, 09 六月 2024 17:06:08 +0800 Subject: [PATCH] 工单管理更新 --- src/api/tigerapi/system.ts | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/src/api/tigerapi/system.ts b/src/api/tigerapi/system.ts index c961bb2..c5651ec 100644 --- a/src/api/tigerapi/system.ts +++ b/src/api/tigerapi/system.ts @@ -32,6 +32,7 @@ } from './model/systemModel'; import { defHttp } from '/@/utils/http/axios'; import { isNullOrEmpty, isTimeType } from '/@/utils/is'; +import { MES_ROUTE_EDGE, MES_ROUTE_NODE } from './model/router'; export enum Api { QueryUrl = '/Base/Query', @@ -829,3 +830,31 @@ }, ); }; + +/* + * 杞崲宸ヨ壓璺嚎涓烘爲褰son + */ +function convertRouteToTreeData( + nodes: MES_ROUTE_NODE[], + edges: MES_ROUTE_EDGE[], + parentId: string, + id: string, + pid?: string, +) { + const result: treeParamsListItem[] = []; + let temp: treeParamsListItem[] = []; + const _pid = pid == undefined ? '' : pid; + for (let i = 0; i < nodes.length; i++) { + const currPid = data[i][parentId] == null ? '' : data[i][parentId]; + if (currPid === _pid) { + const obj: treeParamsListItem = data[i]; + obj.PARAM_TYPE = _pid == '' ? '0' : '1'; //澧炲姞绫诲瀷 + temp = convertToTreeData(data, parentId, id, data[i][id]); + if (temp.length > 0) { + obj.children = temp; + } + result.push(obj); + } + } + return result; +} -- Gitblit v1.9.3