From a2b3bc983967bec872d4850a1bb6b254d609fc89 Mon Sep 17 00:00:00 2001 From: Youngster_yj <907985037@qq.com> Date: Wed, 14 Aug 2024 17:29:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=84=E7=90=86=E5=AE=A1=E8=AE=A1?= =?UTF-8?q?=E6=A0=91=E7=BC=93=E5=AD=98=E5=BC=82=E5=B8=B8=E5=BC=95=E8=B5=B7?= =?UTF-8?q?=E7=9A=84=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../YakRunner/AuditCode/AuditCode.module.scss | 20 +++++++++++ .../pages/YakRunner/AuditCode/AuditCode.tsx | 33 ++++++++++++------- .../LeftSideBar/LeftSideBar.module.scss | 6 ++-- .../RightAuditDetail.module.scss | 1 + .../RightAuditDetail/RightAuditDetail.tsx | 13 ++++++++ .../main/src/pages/YakRunner/YakRunner.tsx | 15 ++++++--- .../src/utils/eventBus/events/yakRunner.ts | 2 ++ 7 files changed, 71 insertions(+), 19 deletions(-) diff --git a/app/renderer/src/main/src/pages/YakRunner/AuditCode/AuditCode.module.scss b/app/renderer/src/main/src/pages/YakRunner/AuditCode/AuditCode.module.scss index 0c4d6f04f5..550bf917b9 100644 --- a/app/renderer/src/main/src/pages/YakRunner/AuditCode/AuditCode.module.scss +++ b/app/renderer/src/main/src/pages/YakRunner/AuditCode/AuditCode.module.scss @@ -333,3 +333,23 @@ } } } + +.additional-params-divider { + margin: 16px 12px; + display: flex; + justify-content: space-between; + align-items: center; + gap: 4px; + .text-style { + color: #b4bbca; + font-size: 12px; + font-weight: 600; + line-height: 16px; + } + .divider-style { + flex: 1; + overflow: hidden; + height: 1px; + border-top: 1px dashed #eaecf3; + } +} \ No newline at end of file diff --git a/app/renderer/src/main/src/pages/YakRunner/AuditCode/AuditCode.tsx b/app/renderer/src/main/src/pages/YakRunner/AuditCode/AuditCode.tsx index 8524befde4..02b9e44695 100644 --- a/app/renderer/src/main/src/pages/YakRunner/AuditCode/AuditCode.tsx +++ b/app/renderer/src/main/src/pages/YakRunner/AuditCode/AuditCode.tsx @@ -272,7 +272,12 @@ export const AuditCode: React.FC = (props) => { if (itemDetail.ResourceType === "variable" || itemDetail.ResourceType === TopId) { obj.children = initAuditTree(childArr, depth + 1) - obj.isLeaf = false + // 数量为0时不展开 message除外 + if (parseInt(obj.Size + "") === 0 && itemDetail.ResourceType !== TopId) { + obj.isLeaf = true + } else { + obj.isLeaf = false + } } else { obj.isLeaf = true } @@ -424,6 +429,8 @@ export const AuditCode: React.FC = (props) => { } // 变量 if (ResourceType === "variable") { + console.log("yyy", Size, parseInt(Size + "")) + const id = `${path}${ResourceName}` variableIds.push(id) setMapAuditDetail(id, { @@ -760,8 +767,8 @@ export const AuditHistoryTable: React.FC = memo((props) try { await grpcFetchDeleteAudit(path) getAduitList() - console.log("ooo",path,projectNmae); - + console.log("ooo", path, projectNmae) + if (path === `/${projectNmae}`) { setLoadTreeType && setLoadTreeType("file") setFileTree && setFileTree([]) @@ -773,7 +780,7 @@ export const AuditHistoryTable: React.FC = memo((props) }) return ( -
event.stopPropagation()}> +
event.stopPropagation()}>
已编译项目
@@ -854,14 +861,16 @@ export const AuditHistoryTable: React.FC = memo((props)
{obj.path}
{obj.time}
- } - onClick={() => { - emiter.emit("onOpenAuditTree", item.ResourceName) - onClose() - }} - /> + + } + onClick={() => { + emiter.emit("onOpenAuditTree", item.ResourceName) + onClose() + }} + /> + {/* = (props) => { } }) + const onRefreshAuditDetailFun = useMemoizedFn(()=>{ + setNodeId(undefined) + }) + + useEffect(() => { + // 打开编译右侧详情 + emiter.on("onRefreshAuditDetail", onRefreshAuditDetailFun) + return () => { + emiter.off("onRefreshAuditDetail", onRefreshAuditDetailFun) + } + }, []) + useEffect(() => { if (!graph) return instance().then((viz) => { @@ -225,6 +237,7 @@ export const FlowChartBox: React.FC = (props) => { onMouseDown={handleMouseDown} onMouseUp={handleMouseUp} onMouseMove={handleMouseMove} + onMouseLeave={handleMouseUp} ref={svgBoxRef} /> {nodeId && ( diff --git a/app/renderer/src/main/src/pages/YakRunner/YakRunner.tsx b/app/renderer/src/main/src/pages/YakRunner/YakRunner.tsx index 6520d18d29..d0c34e64fc 100644 --- a/app/renderer/src/main/src/pages/YakRunner/YakRunner.tsx +++ b/app/renderer/src/main/src/pages/YakRunner/YakRunner.tsx @@ -210,10 +210,17 @@ export const YakRunner: React.FC = (props) => { } insertFileMap(keys[index]) }) - useEffect(() => { - loadIndexRef.current = 0 + + const clearMap = useMemoizedFn(()=>{ clearMapFileDetail() clearMapFolderDetail() + clearMapAuditDetail() + clearMapAuditChildDetail() + }) + + useEffect(() => { + loadIndexRef.current = 0 + clearMap() let id = setInterval(() => { loadFileMap() }, 100) @@ -229,8 +236,7 @@ export const YakRunner: React.FC = (props) => { return } loadIndexRef.current = 0 - clearMapFileDetail() - clearMapFolderDetail() + clearMap() // FileTree缓存清除 emiter.emit("onResetFileTree") }) @@ -966,6 +972,7 @@ export const YakRunner: React.FC = (props) => { const data: AuditEmiterYakUrlProps = JSON.parse(value) setAuditRightParams(data) setShowAuditDetail(true) + emiter.emit("onRefreshAuditDetail") } catch (error) {} }) diff --git a/app/renderer/src/main/src/utils/eventBus/events/yakRunner.ts b/app/renderer/src/main/src/utils/eventBus/events/yakRunner.ts index 6ad7eefc5a..dafdb92528 100644 --- a/app/renderer/src/main/src/utils/eventBus/events/yakRunner.ts +++ b/app/renderer/src/main/src/utils/eventBus/events/yakRunner.ts @@ -42,4 +42,6 @@ export type YakRunnerEventProps = { onOpenAuditTree: string // 重置审计模式缓存数据 onResetAuditStatus?: string + // 刷新审计详情(关闭节点信息) + onRefreshAuditDetail?: string } \ No newline at end of file