From 9ded6b757c6fe27a9b341f5546f25607f34def1c Mon Sep 17 00:00:00 2001 From: libertyspy Date: Sun, 8 Feb 2026 15:59:14 +0800 Subject: [PATCH] Initial commit --- modeler/src/router/config.ts | 20 +- modeler/src/style.less | 724 +++++------------- modeler/src/types/core.ts | 6 + modeler/src/views/ai/api.ts | 22 - modeler/src/views/ai/applications/api.ts | 36 - .../ai/applications/charts/area-options.ts | 117 --- .../ai/applications/charts/bar-options.ts | 96 --- .../ai/applications/charts/charts-001.vue | 77 -- .../ai/applications/charts/charts-002-1.vue | 97 --- .../ai/applications/charts/charts-002-2.vue | 94 --- .../ai/applications/charts/charts-002-3.vue | 94 --- .../ai/applications/charts/charts-002-4.vue | 94 --- .../ai/applications/charts/charts-002.vue | 72 -- .../ai/applications/charts/charts-003.vue | 72 -- .../ai/applications/charts/charts-004.vue | 73 -- .../ai/applications/charts/charts-005.vue | 72 -- .../applications/charts/charts-006-impl.vue | 74 -- .../ai/applications/charts/charts-006.vue | 84 -- .../ai/applications/charts/charts-007.vue | 77 -- .../ai/applications/charts/charts-008.vue | 72 -- .../applications/charts/charts-009-impl.vue | 74 -- .../ai/applications/charts/charts-009.vue | 97 --- .../ai/applications/charts/charts-blue.vue | 87 --- .../ai/applications/charts/charts-modal.vue | 246 ------ .../ai/applications/charts/charts-red.vue | 87 --- .../views/ai/applications/charts/charts.vue | 376 --------- .../views/ai/applications/charts/config.ts | 110 --- .../ai/applications/charts/line-options.ts | 265 ------- .../ai/applications/charts/pie-options.ts | 173 ----- .../ai/applications/charts/scatter-options.ts | 126 --- .../src/views/ai/applications/charts/types.ts | 30 - .../src/views/ai/applications/charts/utils.ts | 25 - modeler/src/views/ai/applications/config.ts | 35 - .../src/views/ai/applications/gambling.vue | 673 ---------------- .../views/ai/applications/ranking-modal.vue | 692 ----------------- modeler/src/views/ai/applications/types.ts | 222 ------ modeler/src/views/ai/builder/element.ts | 61 -- modeler/src/views/ai/builder/graph.ts | 177 ----- modeler/src/views/ai/builder/line.ts | 47 -- modeler/src/views/ai/builder/node.vue | 322 -------- modeler/src/views/ai/builder/ports.ts | 51 -- modeler/src/views/ai/builder/props.ts | 29 - modeler/src/views/ai/config.ts | 70 -- modeler/src/views/ai/dashboard.vue | 47 -- modeler/src/views/ai/finder.vue | 274 ------- modeler/src/views/ai/header.vue | 77 -- modeler/src/views/ai/layout.vue | 47 -- modeler/src/views/ai/menu.vue | 58 -- modeler/src/views/ai/model/algorithm-card.vue | 47 -- modeler/src/views/ai/model/api.ts | 48 -- modeler/src/views/ai/model/builder-inputs.vue | 148 ---- .../ai/model/builder-left-components.vue | 90 --- .../views/ai/model/builder-right-control.vue | 88 --- .../views/ai/model/builder-right-manager.vue | 60 -- .../ai/model/builder-right-situation.vue | 49 -- .../src/views/ai/model/builder-right-v1.vue | 376 --------- modeler/src/views/ai/model/builder-right.vue | 281 ------- modeler/src/views/ai/model/builder.vue | 511 ------------ modeler/src/views/ai/model/components.vue | 208 ----- modeler/src/views/ai/model/config.ts | 65 -- modeler/src/views/ai/model/control-options.ts | 264 ------- modeler/src/views/ai/model/hooks.ts | 8 - modeler/src/views/ai/model/inputs.ts | 186 ----- modeler/src/views/ai/model/management.vue | 228 ------ modeler/src/views/ai/model/rules/fuzzy.json | 402 ---------- .../src/views/ai/model/rules/heuristic.json | 402 ---------- modeler/src/views/ai/model/rules/neural.json | 402 ---------- modeler/src/views/ai/model/types/types.ts | 205 ----- modeler/src/views/ai/model/utils.ts | 127 --- modeler/src/views/ai/project/api.ts | 52 -- modeler/src/views/ai/project/config.ts | 119 --- modeler/src/views/ai/project/config.vue | 256 ------- modeler/src/views/ai/project/create-v1.vue | 208 ----- modeler/src/views/ai/project/create.vue | 190 ----- modeler/src/views/ai/project/management.vue | 34 - .../src/views/ai/project/project-lists.vue | 154 ---- .../views/ai/project/resource-templates.vue | 178 ----- modeler/src/views/ai/project/types.ts | 65 -- modeler/src/views/ai/project/workspace.vue | 278 ------- modeler/src/views/ai/router.ts | 178 ----- modeler/src/views/ai/sidebar.vue | 207 ----- modeler/src/views/ai/training/api.ts | 41 - modeler/src/views/ai/training/config.ts | 86 --- .../views/ai/training/resource-monitor.vue | 30 - .../src/views/ai/training/task-configurer.vue | 512 ------------- .../src/views/ai/training/task-management.vue | 181 ----- .../src/views/ai/training/task-monitor.vue | 30 - modeler/src/views/ai/training/types.ts | 139 ---- modeler/src/views/ai/types.ts | 25 - modeler/src/views/behaviour/config.ts | 16 - modeler/src/views/behaviour/graph/element.ts | 61 -- modeler/src/views/behaviour/graph/hooks.ts | 250 ------ modeler/src/views/behaviour/graph/index.ts | 11 - modeler/src/views/behaviour/graph/line.ts | 47 -- modeler/src/views/behaviour/graph/node.vue | 322 -------- modeler/src/views/behaviour/graph/ports.ts | 51 -- modeler/src/views/behaviour/graph/register.ts | 50 -- modeler/src/views/behaviour/header.vue | 77 -- modeler/src/views/behaviour/layout.vue | 47 -- modeler/src/views/behaviour/menu.vue | 58 -- modeler/src/views/behaviour/router.ts | 47 -- .../src/views/behaviour/rules/management.vue | 20 - modeler/src/views/behaviour/sidebar.vue | 169 ---- modeler/src/views/decision/actions.vue | 61 ++ modeler/src/views/decision/api.ts | 51 ++ .../graph => decision/builder}/graph.ts | 71 +- .../views/{ai => decision}/builder/hooks.ts | 59 +- .../views/{ai => decision}/builder/index.ts | 0 modeler/src/views/decision/builder/node.vue | 194 +++++ modeler/src/views/decision/builder/ports.ts | 43 ++ .../graph => decision/builder}/props.ts | 4 +- .../{ai => decision}/builder/register.ts | 24 +- modeler/src/views/decision/constants.ts | 41 + modeler/src/views/decision/designer.vue | 375 +++++++++ modeler/src/views/decision/header.vue | 32 + modeler/src/views/decision/layout.vue | 24 + modeler/src/views/decision/nodes-card.vue | 217 ++++++ modeler/src/views/decision/properties.vue | 211 +++++ modeler/src/views/decision/trees-card.vue | 98 +++ .../{ai/model => decision}/types/index.ts | 5 +- modeler/src/views/decision/types/node.ts | 73 ++ modeler/src/views/decision/types/parameter.ts | 20 + modeler/src/views/decision/types/template.ts | 35 + modeler/src/views/decision/types/tree.ts | 92 +++ modeler/src/views/decision/utils/node.ts | 146 ++++ modeler/types/components.d.ts | 8 + 126 files changed, 2007 insertions(+), 14912 deletions(-) delete mode 100644 modeler/src/views/ai/api.ts delete mode 100644 modeler/src/views/ai/applications/api.ts delete mode 100644 modeler/src/views/ai/applications/charts/area-options.ts delete mode 100644 modeler/src/views/ai/applications/charts/bar-options.ts delete mode 100644 modeler/src/views/ai/applications/charts/charts-001.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-002-1.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-002-2.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-002-3.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-002-4.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-002.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-003.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-004.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-005.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-006-impl.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-006.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-007.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-008.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-009-impl.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-009.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-blue.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-modal.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts-red.vue delete mode 100644 modeler/src/views/ai/applications/charts/charts.vue delete mode 100644 modeler/src/views/ai/applications/charts/config.ts delete mode 100644 modeler/src/views/ai/applications/charts/line-options.ts delete mode 100644 modeler/src/views/ai/applications/charts/pie-options.ts delete mode 100644 modeler/src/views/ai/applications/charts/scatter-options.ts delete mode 100644 modeler/src/views/ai/applications/charts/types.ts delete mode 100644 modeler/src/views/ai/applications/charts/utils.ts delete mode 100644 modeler/src/views/ai/applications/config.ts delete mode 100644 modeler/src/views/ai/applications/gambling.vue delete mode 100644 modeler/src/views/ai/applications/ranking-modal.vue delete mode 100644 modeler/src/views/ai/applications/types.ts delete mode 100644 modeler/src/views/ai/builder/element.ts delete mode 100644 modeler/src/views/ai/builder/graph.ts delete mode 100644 modeler/src/views/ai/builder/line.ts delete mode 100644 modeler/src/views/ai/builder/node.vue delete mode 100644 modeler/src/views/ai/builder/ports.ts delete mode 100644 modeler/src/views/ai/builder/props.ts delete mode 100644 modeler/src/views/ai/config.ts delete mode 100644 modeler/src/views/ai/dashboard.vue delete mode 100644 modeler/src/views/ai/finder.vue delete mode 100644 modeler/src/views/ai/header.vue delete mode 100644 modeler/src/views/ai/layout.vue delete mode 100644 modeler/src/views/ai/menu.vue delete mode 100644 modeler/src/views/ai/model/algorithm-card.vue delete mode 100644 modeler/src/views/ai/model/api.ts delete mode 100644 modeler/src/views/ai/model/builder-inputs.vue delete mode 100644 modeler/src/views/ai/model/builder-left-components.vue delete mode 100644 modeler/src/views/ai/model/builder-right-control.vue delete mode 100644 modeler/src/views/ai/model/builder-right-manager.vue delete mode 100644 modeler/src/views/ai/model/builder-right-situation.vue delete mode 100644 modeler/src/views/ai/model/builder-right-v1.vue delete mode 100644 modeler/src/views/ai/model/builder-right.vue delete mode 100644 modeler/src/views/ai/model/builder.vue delete mode 100644 modeler/src/views/ai/model/components.vue delete mode 100644 modeler/src/views/ai/model/config.ts delete mode 100644 modeler/src/views/ai/model/control-options.ts delete mode 100644 modeler/src/views/ai/model/hooks.ts delete mode 100644 modeler/src/views/ai/model/inputs.ts delete mode 100644 modeler/src/views/ai/model/management.vue delete mode 100644 modeler/src/views/ai/model/rules/fuzzy.json delete mode 100644 modeler/src/views/ai/model/rules/heuristic.json delete mode 100644 modeler/src/views/ai/model/rules/neural.json delete mode 100644 modeler/src/views/ai/model/types/types.ts delete mode 100644 modeler/src/views/ai/model/utils.ts delete mode 100644 modeler/src/views/ai/project/api.ts delete mode 100644 modeler/src/views/ai/project/config.ts delete mode 100644 modeler/src/views/ai/project/config.vue delete mode 100644 modeler/src/views/ai/project/create-v1.vue delete mode 100644 modeler/src/views/ai/project/create.vue delete mode 100644 modeler/src/views/ai/project/management.vue delete mode 100644 modeler/src/views/ai/project/project-lists.vue delete mode 100644 modeler/src/views/ai/project/resource-templates.vue delete mode 100644 modeler/src/views/ai/project/types.ts delete mode 100644 modeler/src/views/ai/project/workspace.vue delete mode 100644 modeler/src/views/ai/router.ts delete mode 100644 modeler/src/views/ai/sidebar.vue delete mode 100644 modeler/src/views/ai/training/api.ts delete mode 100644 modeler/src/views/ai/training/config.ts delete mode 100644 modeler/src/views/ai/training/resource-monitor.vue delete mode 100644 modeler/src/views/ai/training/task-configurer.vue delete mode 100644 modeler/src/views/ai/training/task-management.vue delete mode 100644 modeler/src/views/ai/training/task-monitor.vue delete mode 100644 modeler/src/views/ai/training/types.ts delete mode 100644 modeler/src/views/ai/types.ts delete mode 100644 modeler/src/views/behaviour/config.ts delete mode 100644 modeler/src/views/behaviour/graph/element.ts delete mode 100644 modeler/src/views/behaviour/graph/hooks.ts delete mode 100644 modeler/src/views/behaviour/graph/index.ts delete mode 100644 modeler/src/views/behaviour/graph/line.ts delete mode 100644 modeler/src/views/behaviour/graph/node.vue delete mode 100644 modeler/src/views/behaviour/graph/ports.ts delete mode 100644 modeler/src/views/behaviour/graph/register.ts delete mode 100644 modeler/src/views/behaviour/header.vue delete mode 100644 modeler/src/views/behaviour/layout.vue delete mode 100644 modeler/src/views/behaviour/menu.vue delete mode 100644 modeler/src/views/behaviour/router.ts delete mode 100644 modeler/src/views/behaviour/rules/management.vue delete mode 100644 modeler/src/views/behaviour/sidebar.vue create mode 100644 modeler/src/views/decision/actions.vue create mode 100644 modeler/src/views/decision/api.ts rename modeler/src/views/{behaviour/graph => decision/builder}/graph.ts (73%) rename modeler/src/views/{ai => decision}/builder/hooks.ts (81%) rename modeler/src/views/{ai => decision}/builder/index.ts (100%) create mode 100644 modeler/src/views/decision/builder/node.vue create mode 100644 modeler/src/views/decision/builder/ports.ts rename modeler/src/views/{behaviour/graph => decision/builder}/props.ts (87%) rename modeler/src/views/{ai => decision}/builder/register.ts (53%) create mode 100644 modeler/src/views/decision/constants.ts create mode 100644 modeler/src/views/decision/designer.vue create mode 100644 modeler/src/views/decision/header.vue create mode 100644 modeler/src/views/decision/layout.vue create mode 100644 modeler/src/views/decision/nodes-card.vue create mode 100644 modeler/src/views/decision/properties.vue create mode 100644 modeler/src/views/decision/trees-card.vue rename modeler/src/views/{ai/model => decision}/types/index.ts (69%) create mode 100644 modeler/src/views/decision/types/node.ts create mode 100644 modeler/src/views/decision/types/parameter.ts create mode 100644 modeler/src/views/decision/types/template.ts create mode 100644 modeler/src/views/decision/types/tree.ts create mode 100644 modeler/src/views/decision/utils/node.ts diff --git a/modeler/src/router/config.ts b/modeler/src/router/config.ts index 6cb6855..819fbc0 100644 --- a/modeler/src/router/config.ts +++ b/modeler/src/router/config.ts @@ -7,9 +7,23 @@ * that was distributed with this source code. */ -import { type RouteRecordRaw } from 'vue-router'; -import { routers } from '@/views/behaviour/router'; +import { type RouteRecordRaw, type RouteRecordRedirect } from 'vue-router'; export const routes: RouteRecordRaw[] = [ - ...routers, + { + name: 'index', + path: '/', + redirect: '/app/decision/designer', + meta: { + hidden: true, + }, + } as RouteRecordRedirect, + { + name: 'decision-designer', + path: '/app/decision/designer', + meta: { + title: '决策树', + }, + component: () => import('@/views/decision/designer.vue'), + }, ] \ No newline at end of file diff --git a/modeler/src/style.less b/modeler/src/style.less index 18e1579..f263573 100644 --- a/modeler/src/style.less +++ b/modeler/src/style.less @@ -27,60 +27,6 @@ background: #505861; } -@keyframes running-line { - to { - stroke-dashoffset: -1000; - } -} - -@keyframes flow-animation { - from { stroke-dashoffset: 100; } - to { stroke-dashoffset: 0; } -} - -.x6-edge-flow { - animation: flow-animation 3s infinite linear; - stroke: #3471F9; /* 流动线条颜色 */ - stroke-width: 2; /* 流动线条宽度 */ - stroke-linecap: round; -} - -@keyframes ant-line { - 0% { - stroke-dashoffset: 0; - } - 100% { - stroke-dashoffset: -210; - } -} -@keyframes flow { - 0% { - stroke-dashoffset: 0; - } - 100% { - stroke-dashoffset: 20; - } -} - -/* 为流动线条添加动画 */ -.flow-edge .flow-line { - animation: flow 2s linear infinite; -} - - -@keyframes flow-dot { - 0% { - stroke-dashoffset: 0; - } - 100% { - stroke-dashoffset: 20; /* 与 strokeDasharray 中的间隔值一致 */ - } -} - -/* 如果需要,可以为不同状态的连线添加不同颜色的圆点 */ -.running-line .x6-edge-path { - animation: flow-dot 2s linear infinite; -} // 4.0 以上需要使用css名称作为切换主题需要如下配置 // https://tailwindcss.com/docs/dark-mode#toggling-dark-mode-manually @@ -89,10 +35,6 @@ @config "./tailwind.ts"; @import 'tailwindcss'; -.ant-modal-root .ant-modal-mask { - background-color: rgb(0 0 0 / 80%); -} - .ks-page-loading-overlay { position: fixed; top: 0; @@ -131,53 +73,21 @@ display: none !important; } -.ks-page-card-goback{ - margin-left: 20px; - margin-top: 5px; - cursor: pointer; - color: #7ae8fc; - background: transparent; - line-height: 13px; - border: 1px solid #0d6da2; - border-radius: 5px; - padding: 4px; - min-width: 60px; - height: 25px; - box-shadow: 0px 0px 0px #7dd3f9; - font-size: 13px; - position: absolute; - top: 3px; - - & > span { - margin-top: -1px!important; - display: block!important; - float: left!important; - } -} .bg-wrapper { - color: #a2b1ba; + color: #eee; background-size: cover; background: url('@/assets/images/bg.jpeg') no-repeat fixed center; overflow: hidden; height: 100vh; - background: #010b1c; - transition: all 0.2s, background 0s; //background: #fefefe; - .sidebar-collapsed{ - .ks-layout-main{ - margin-left: 0; - transition: all 0.2s, background 0s; - } - } - .ant-layout { .ks-layout-header { height: 60px; line-height: 50px; background: #071327de; - color: #a2b1ba; + color: #7494a9; padding: 0; } @@ -192,7 +102,7 @@ cursor: pointer; a { - color: #a2b1ba; + color: #6c818e; } } @@ -242,7 +152,6 @@ background: transparent; //height: calc(100vh - 60px); padding: 15px; - transition: all 0.2s, background 0s; } } @@ -258,13 +167,11 @@ .ks-layout-sidebar { height: 90vh; background: #071327de; - transition: all 0.2s, background 0s; .ks-layout-sidebar-card { background: transparent; border-radius: 0; border: 0; - transition: all 0.2s, background 0s; .ant-card-head { border: 0; @@ -274,7 +181,7 @@ } .ant-card-head-title { - color: #a2b1ba; + color: #0ec0ec; & .icon { background: url('@/assets/icons/list.png') center / 100% 100%; @@ -286,7 +193,6 @@ & .text { margin-left: 40px; font-size: 16px; - color: #eee; } } @@ -300,7 +206,7 @@ border: 0; border-inline-end: 0 !important; background: transparent; - color: #a2b1ba; + color: #477597; .ant-menu-submenu, .ant-menu-submenu-title, @@ -313,30 +219,25 @@ & > .ant-menu-submenu { & > .ant-menu-submenu-title { - color: #a2b1ba; + color: #1661a2; font-size: 16px; &:hover { - color: #FFF; + color: #2273b9; } } } - .ant-menu-submenu-title:hover, .ant-menu-submenu-title:active, .ant-menu-item:not(.ant-menu-item-selected):active, - .ant-menu-item-active, .ant-menu-item-selected { - //background: url('@/assets/icons/bg-menu-active.png') center / 100% 100%; - background: linear-gradient(90deg, #0f4a7c 0%, #0a365b 100%); - background: linear-gradient(359deg, #082f56 1%, #144f88 55%); - transition: all 0.4s; + background: url('@/assets/icons/bg-menu-active.png') center / 100% 100%; & > .ant-menu-submenu-title { - color: #a2b1ba; + color: #1661a2; &:hover { - color: #FFF; + color: #2273b9; } } @@ -353,38 +254,15 @@ } } - .ant-menu-item-selected, .ant-menu-item:hover:not(.ant-menu-item-selected):not(.ant-menu-submenu-selected), .ant-menu-submenu-title:hover:not(.ant-menu-item-selected):not(.ant-menu-submenu-selected) { - color: #fff; - } - - &>.ant-menu-item{ - &>.ant-menu-title-content{ - & > .ks-menu-item-label { - color: #a2b1ba; - font-size: 16px; - &:before{ - display: none; - opacity: 0; - } - } - } - &.ant-menu-item-selected, - &:hover{ - &>.ant-menu-title-content{ - & > .ks-menu-item-label { - color: #fff; - } - } - } + color: #2273b9; } } .ks-layout-main { margin-left: 15px; - transition: all 0.2s, background 0s; } .ks-page-card { @@ -392,68 +270,20 @@ border-radius: 0; min-height: calc(100vh - 90px); background: transparent; - background: url('@/assets/icons/bg-fk.png') center / 100% 100%; - - .ant-tabs .ant-tabs-ink-bar { - position: absolute; - background: transparent; - pointer-events: none; - } - - - .ant-steps-horizontal{ - &.ant-steps.ant-steps-navigation .ant-steps-item.ant-steps-item-active::before { - width: 30%; - margin-left: 37%; - display: none; - } - .ant-steps-item-active{ - .ant-steps-item-container{ - &:after{ - height: 1px; - content: ''; - position: absolute; - bottom: 0; - background: #377ead; - display: block; - width: 100px; - } - } - } - - } - .ant-card-head { border: 0; - color: #a2b1ba; + color: #11aed7; } & > .ant-card-head { - height: 40px; + height: 50px; min-height: 40px; - border-radius: 0; - padding: 5px 10px; + font-size: 16px; } & > .ant-card-head { background: url('@/assets/icons/page-card-head.png') center / 100% 100%; - background: url('@/assets/icons/bg-fk-title.png') center / 100% 100%; - color: #eee; - - .point { - background: url('@/assets/icons/bg-fk-point.png') center / 100% 100%; - width: 25px; - height: 25px; - display: block; - margin-top: 5px; - } - - .text { - margin-top: 5px; - display: block; - font-size: 16px; - } } & > .ant-card-body { @@ -463,22 +293,6 @@ } - .ant-card { - &.ks-pks-card, - &.ks-apps-card{ - //background: url('@/assets/icons/bg-steps-card.png') center / 100% 100%!important; - margin: 0!important; - &> .ant-card-head{ - } - &>.ant-card-body{ - height: 73.1vh; - overflow-x: hidden; - overflow-y: auto; - } - } - } - - .ks-page-tabs { .ant-tabs-nav-list { background: transparent; @@ -488,7 +302,7 @@ .ant-tabs-tab { padding: 10px 48px; font-size: 15px; - color: #a2b1ba; + color: #90caf6; margin: 0; &:first-child { @@ -496,7 +310,7 @@ &.ant-tabs-tab-active { &, .ant-tabs-tab-btn { - color: #fff; + color: #16d9f6; } } } @@ -543,7 +357,7 @@ & > tr > td { background: #081e3b; border-bottom: 1px solid #455e72; - color: #a2b1ba; + color: #6c818e; padding: 10px 8px; } @@ -565,7 +379,7 @@ &:not(.ant-table-bordered) .ant-table-tbody > tr > td { border-top: 1px solid #455e72; border-bottom: transparent; - color: #a2b1ba; + color: #6c818e; } .ant-table-thead > tr > th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan])::before, @@ -576,7 +390,7 @@ &.ant-table-bordered { .ant-table-tbody > tr > td { border-bottom: 1px solid #243644; - color: #a2b1ba; + color: #6c818e; } & > .ant-table-container { @@ -603,19 +417,17 @@ } } - //.ks-tabs-btn { - // border-radius: 2px; - // //border-color: #144087; - // //background: linear-gradient(90deg, #0f4a7c 0%, #0a365b 100%); - // border-color: #166094; - // background: linear-gradient(90deg, #3687bc 0%, #074375 100%); - // - // &:hover, - // &:active { - // border-color: #2a5195; - // background: linear-gradient(0deg, #284e91 0, #2c5dad 100%); - // } - //} + .ks-tabs-btn { + border-radius: 2px; + background: #2aaceb; + border-color: #2aaceb; + + &:hover, + &:active { + background: #2295cd; + border-color: #2295cd; + } + } .ks-page-steps { @@ -755,7 +567,6 @@ span { color: #96bbda; margin: 5px; - font-size: 13px; } .title-left { @@ -785,35 +596,9 @@ .card-description { margin-left: 10px; - color: #96bcda; } } - - &.simulation-card{ - background: none; - border-radius: 2px; - .card-header { - padding: 0 0 0 5px; - height: 30px; - //display: none; - background: linear-gradient(359deg, #082f56 1%, #144f88 55%); - span { - font-size: 12px; - } - } - .card-body{ - min-height: 75px; - padding: 15px 20px; - background: linear-gradient(359deg, #082f56 1%, #144f88 55%); - } - .card-description { - font-size: 13px; - } - .card-select-icon { - top: -3px; - } - } } .ks-card-subtitle { @@ -961,185 +746,49 @@ } } -.icon-action{ - width: 23px; - height: 23px; - display: block; - &.delete { - background: url('@/assets/actions/delete.svg') center / 100% 100%; +.ks-pk-card { + border-radius: 2px !important; + background: hsl(219.04deg 83.84% 19.41% / 81%) !important; + + .ant-card-head { + background: hsl(218.18deg 86.27% 20%) !important; + border-radius: 2px; + height: 30px !important; + min-height: 30px !important; } - &.eye { - background: url('@/assets/actions/eye.svg') center / 100% 100%; - width: 22px; - height: 22px; + + .ant-card-body { + background: hsl(219.04deg 83.84% 19.41% / 81%); + height: 130px; + padding: 0; } - &.pause { - background: url('@/assets/actions/pause.svg') center / 100% 100%; + + .pk-teams { + background: url('@/assets/icons/bg-pk.png') center / 100% 100%; + height: 130px; + display: block; + position: relative; } - &.start { - background: url('@/assets/actions/start.svg') center / 100% 100%; + + .right-team, + .left-team { + color: #fff; + font-size: 16px; + } + + .left-team { + margin-top: 45px; + position: absolute; + left: 50px; + } + + .right-team { + margin-top: 58px; + position: absolute; + right: 50px; } } -.bg-wrapper .ks-cards-wrapper .ant-card { - &.ks-pk-card { - border-radius: 2px !important; - background: hsl(219.04deg 83.84% 19.41% / 81%) !important; - cursor: pointer; - border: 1px solid #07265c; - - &:hover { - border-color: #74a3f4; - .pk-overlay { - background: #06265f00; - } - } - - .ant-card-extra{ - position: absolute; - right: 10px; - top: 4px; - } - - .ant-card-extra, - .ant-card-actions { - //border-top: 1px solid #25284b; - //background: #072869; - - & > li:not(:last-child) { - border-inline-end: 1px solid #25284b; - } - - .anticon { - color: #a5a9ca; - width: 18px; - height: 18px; - border: 1px solid #a2b1ba; - padding: 4px; - line-height: 0px; - text-align: center; - border-radius: 50%; - font-size: 14px; - &:hover { - color: #FFF; - } - } - - & > li { - margin: 0; - padding: 4px; - text-align: center; - } - } - - .ant-card-head { - //background: hsl(218.18deg 86.27% 20%) !important; - border-radius: 2px; - height: 30px !important; - min-height: 30px !important; - background: url('@/assets/icons/bg-pk-header.png') center / 100% 100% !important; - padding: 0 10px; - } - - .ant-card-body { - background: hsla(219.04, 83.84%, 19.41%, 0.81); // 半透明底色(可选,叠在背景图下) - height: 130px; - padding: 0; - position: relative; - // 背景图片核心设置:合并简写,避免属性冲突 - background-image: url('@/assets/icons/bg-pk-body.png'); - background-position: center; - background-repeat: no-repeat; - background-size: cover; // 初始覆盖整个容器 - // 关键:隐藏超出边界的部分,裁剪放大的背景图 - overflow: hidden; - // 过渡动画:仅针对背景尺寸,比 all 更高效 - transition: all 2s ease; - } - - &:hover { - .ant-card-body { - //background-size: 120%; - } - } - - .pk-overlay { - position: absolute; - width: 100%; - height: 100%; - background: #07276040; - z-index: 1; - } - - .pk-teams { - //background: url('@/assets/icons/bg-pk.png') center / 100% 100%; - height: 100px; - display: block; - position: relative; - } - - .pk-footer { - position: absolute; - width: 100%; - bottom: 10px; - z-index: 10; - padding: 0 10px; - - .pk-details-btn{ - font-size: 12px; - border-color: #5f718e; - background: linear-gradient(0deg, #000000 0, #1c51a7 100%); - width: 60px; - &.selected, &:not(:disabled):hover, &:hover, &:active { - color: #fff; - border-color: #3d6f93; - background: linear-gradient(90deg, #175e8c 0%, #1577c8 100%); - } - } - - .ant-progress { - margin: 0; - //padding: 0px 25px 0 10px; - - .ant-progress-text { - color: #eee; - } - - .ant-progress-inner { - background-color: #08255c; - } - } - } - - .right-team, - .left-team { - color: #fff; - font-size: 16px; - width: 120px; - margin-top: 12px; - z-index: 10; - } - - .left-team { - background: url('@/assets/icons/bg-pk-left.png') center / 100% 100%; - position: absolute; - left: -10px; - width: 100px; - text-align: right; - padding-right: 10px; - } - - .right-team { - background: url('@/assets/icons/bg-pk-right.png') center / 100% 100%; - position: absolute; - right: -24px; - text-align: left; - padding-left: 10px; - } - } -} - - .ks-model-builder-body { .ks-model-builder-back { @@ -1153,6 +802,7 @@ } .ks-model-builder-left, + .ks-model-builder-content, .ks-model-builder-right { height: calc(100vh - 90px); @@ -1237,7 +887,7 @@ border: 1px solid #0d6da2; border-radius: 5px; padding: 4px; - min-width: 60px; + width: 60px; height: 25px; box-shadow: 0px 0px 0px #7dd3f9; font-size: 13px; @@ -1251,12 +901,50 @@ .ks-model-builder-left { width: 250px; float: left; + background: #081e3bcc; + + .tress-list-card { + .ant-card-body{ + height: 37vh; + overflow: auto; + } + } + + .ant-collapse { + .ant-collapse-header { + height: 35px; + min-height: 35px; + padding: 6px 16px; + background: url('@/assets/icons/card-head.png') left / 180% 100%; + border-radius: 0; + + .ant-collapse-header-text { + padding-left: 40px; + color: #82c4e9; + font-size: 16px; + } + } + + .ant-collapse-content { + border-top: 0; + } + + & > .ant-collapse-item { + border-bottom: 0; + } + + .ant-collapse-item { + border-radius: 0; + } + + .ant-collapse-content-box { + max-height: 38vh; + overflow: auto; + } + } .ks-model-builder-card { - height: 40vh; - &.algorithm-card{ - height: 32vh; - } + //min-height: 72.1vh } .ks-model-builder-body .ks-model-builder-title-icon { left: 8px; @@ -1344,14 +1032,20 @@ } .ks-model-drag-item { - width: 50%; + //width: 50%; + //text-align: center; + //font-size: 12px; + //cursor: pointer; + //float: left; + //padding: 4px; + //margin-bottom: 10px; + //height: 110px; + width: 100%; text-align: center; font-size: 12px; cursor: pointer; - float: left; padding: 4px; - margin-bottom: 10px; - height: 95px; + margin-bottom: 5px; .icon { width: 50px; @@ -1378,23 +1072,15 @@ white-space: nowrap; text-overflow: ellipsis; - &.control-item{ - width: 100%; - } - & > .anticon { position: absolute; right: 4px; top: 3px; } - &:hover, &.selected { background: #7ed4f9; color: #1d1a1a; - background: linear-gradient(0deg, rgb(15 74 124) 0, rgb(58 133 210) 100%); - color: #fff; - cursor: pointer; } &.selected-total-item { @@ -1404,31 +1090,8 @@ margin: 0 auto; } } - } -.control-container{ - - .control-wrapper{ - width: 32%; - margin-left: 2%; - border-left: 1px solid #0d385f; - padding-left: 5px; - border-radius: 2px; - &:first-child{ - border-left: 0; - } - } - .control-title{ - margin-bottom: 5px; - line-height: 30px; - } - - .ks-model-item{ - width: 50%; - padding-left: 5px; - } -} .ks-model-builder-tabs { .ant-tabs-nav { @@ -1449,16 +1112,22 @@ &.multiply{ - .ant-tabs-tab:first-child:after { - position: absolute; - z-index: 1; - transition: opacity 0.3s; - content: '/'; - pointer-events: none; - right: -19px; - line-height: 35px; - height: 35px; - top: 0; + .ant-tabs-nav-list{ + //.ant-tabs-tab:after { + // position: absolute; + // z-index: 1; + // transition: opacity 0.3s; + // content: '/'; + // pointer-events: none; + // right: -19px; + // line-height: 35px; + // height: 35px; + // top: 0; + //} + //.ant-tabs-tab:last-child{ + // display: none; + // content: ''; + //} } } @@ -1483,22 +1152,30 @@ .ant-tabs-content { //padding: 15px; + padding: 4px; background: #041b36db; } - .ant-tabs-content { - padding: 4px; - //height: 40vh; - //height: 36vh; - height: 26.3vh; - overflow: auto; + &.settings-tab, + &.parameters-tabs { + .ant-tabs-content { + height: 41.3vh; + overflow: auto; + padding: 10px 5px; + } + } + + &.design-tabs { + .ant-tabs-content { + height: 25.2vh; + } } .ant-select .ant-select-selection-placeholder, .ant-select .ant-select-selection-search-input, .ant-select:not(.ant-select-customize-input) .ant-select-selector, .ant-input { background-color: #081e3b; border-color: #475f71; - color: #a2b1ba; + color: #6c818e; } } @@ -1520,7 +1197,7 @@ .ant-pagination-item-active { background-color: #081e3b; border-color: #475f71; - color: #a2b1ba; + color: #6c818e; } } @@ -1555,7 +1232,7 @@ .ant-input { background-color: #081e3b; border-color: #475f71; - color: #a2b1ba; + color: #6c818e; &::placeholder { color: rgba(233, 237, 240, 0.6) !important; @@ -1563,7 +1240,6 @@ } } -.ant-input-number .ant-input-number-input, .ant-input-affix-wrapper.ant-input-password input:-webkit-autofill, .ant-input-affix-wrapper.ant-input-password input:-webkit-autofill:hover, .ant-input-affix-wrapper.ant-input-password input:-webkit-autofill:focus, @@ -1572,7 +1248,7 @@ /* 背景色设置为暗黑模式的背景色 */ -webkit-box-shadow: 0 0 0 100px #081e3b inset !important; /* 文字颜色设置为白色 */ - -webkit-text-fill-color: #a2b1ba !important; + -webkit-text-fill-color: #fff !important; /* 保留透明的背景色,让 box-shadow 生效 */ background-color: #081e3b !important; } @@ -1604,7 +1280,7 @@ border-radius: 2px; background-color: #081e3b; border-color: #475f71; - color: #a2b1ba; + color: #6c818e; opacity: 1 !important; .ant-select-selection-placeholder, @@ -1634,43 +1310,19 @@ } .ant-btn-primary { - color: #eee; - //border-color: #1b5b7d; - //background: linear-gradient(90deg, #1e4c65 0%, #0b3a62 100%); - border-color: #29759c; - background: linear-gradient(0deg, #0f374c 0, #154c69 100%); - &.selected, - &:not(:disabled):hover, - &:hover, - &:active { - border-color: #166094; - background: linear-gradient(90deg, #3687bc 0%, #074375 100%); - color: #fff; + background: #1875a5; + border-color: #1875a5; + + &:hover { + background: #125f87; + border-color: #125f87; } } .ant-btn-default { - color: #eee; - //border-color: #144087; - //background: linear-gradient(90deg, #0f4a7c 0%, #0a365b 100%); - border-color: #1c468b; - background: linear-gradient(0deg, #284e91 0, #2c5dad 100%); - background: linear-gradient(0deg, #14223b 0, #1c468b 100%); - &.selected, - &:not(:disabled):hover, - &:hover, - &:active { - color: #fff; - border-color: #166094; - background: linear-gradient(90deg, #3687bc 0%, #074375 100%); - } - &:disabled, - &.disabled{ - color: #a9a3a3; - &:hover{ - color:#eee; - } - } + background: #7dd3f9; + border-color: #7dd3f9; + color: #000; } .btn-field { @@ -1705,13 +1357,13 @@ .ant-select-dropdown .ant-select-item, .ant-select-dropdown { background-color: #081e3b; - color: #a2b1ba!important; + color: #6c818e!important; } .ant-select-dropdown .ant-select-item-option-selected, .ant-select-dropdown .ant-select-item-option-selected:not(.ant-select-item-option-disabled){ color: rgb(187 185 185 / 88%); font-weight: 600; - background-color: #475f71; + background-color: #292929; } .ant-modal { @@ -1759,19 +1411,31 @@ color: #fff; } +.ant-input-number .ant-input-number-handler-wrap, .ant-tooltip .ant-tooltip-inner, .ant-tooltip .ant-tooltip-arrow:before, .ant-popover .ant-popover-arrow:before, .ant-popover .ant-popover-inner{ - background-color: #00294b; + background-color: #519bd9; } +.ant-input-number { + .ant-input-number-handler-up-inner, + .ant-input-number-handler-down-inner, + .ant-input-number-handler-down, + .ant-input-number-handler { + color: #fff; + border-block-start-color: #4096ff; + border-inline-color: #4096ff; + } +} + .ant-popconfirm .ant-popconfirm-message { color: rgb(255 255 255 / 88%); } .ant-dropdown .ant-dropdown-menu, .ant-dropdown-menu-submenu .ant-dropdown-menu { - background-color: #475f71; + background-color: #2874b4; min-width: 120px; border-radius: 3px; padding: 0; @@ -1788,7 +1452,7 @@ .ant-input[disabled] { background-color: rgba(0, 0, 0, 0.04); border-color: #2c2a2a; - color: #a2b1ba; + color: #6c818e; &:hover{ border-color: #3a547b; border-inline-end-width: 1px; @@ -1807,19 +1471,17 @@ } } -.ant-input-number{ - border-radius: 2px; +.ant-collapse { + border: 0; + border-radius: 0; + + .ant-collapse-content { + color: #fff; + background-color: #041b35; + border-top: 1px solid #041b35; + } } -.ant-input-search >.ant-input-group >.ant-input-group-addon:last-child .ant-input-search-button:not(.ant-btn-primary) { - color: rgb(255 255 255 / 45%); -} - -.ant-slider .ant-slider-rail { - background-color: rgb(42 73 134 / 60%)!important; -} - -.ant-popover .ant-popover-inner-content { - color: #a2b1ba; - min-width: 180px; +.ant-divider { + border-block-start: 1px solid rgb(255 255 255 / 17%); } \ No newline at end of file diff --git a/modeler/src/types/core.ts b/modeler/src/types/core.ts index 91282f9..6d6b00d 100644 --- a/modeler/src/types/core.ts +++ b/modeler/src/types/core.ts @@ -34,3 +34,9 @@ export interface PageableResponse extends BasicResponse { [key: string]: unknown; } + +export interface ApiPaginationQuery { + page: number; + limit: number; + keyword: NullableString; +} \ No newline at end of file diff --git a/modeler/src/views/ai/api.ts b/modeler/src/views/ai/api.ts deleted file mode 100644 index 7c66d8e..0000000 --- a/modeler/src/views/ai/api.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import request from '@/utils/request'; -import type { DeductionTestResponse, FinderBrowserResult } from './types'; -import type { NullableString } from '@/types'; - -export const findFinderBrowser = (path: NullableString): Promise => { - return request.post('/finder/browser', { - path: path, - }); -}; - -export const startDeduction = (): Promise => { - return request.postJson('/deductionTest/startDeduction', {}); -}; \ No newline at end of file diff --git a/modeler/src/views/ai/applications/api.ts b/modeler/src/views/ai/applications/api.ts deleted file mode 100644 index 823ce5a..0000000 --- a/modeler/src/views/ai/applications/api.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import request from '@/utils/request'; -import type { DeductionPodResult, ModelDeduction, ModelDeductionDataResponse, ModelDeductionDetailsResponse, ModelDeductionPodStatusResponse } from './types'; -import type { BasicResponse } from '@/types'; - -export const findDeductionPodResult = (query: Record = { pageSize: 1000 }): Promise => { - return request.get('/deductionPodInfo/listAll', query); -}; - -export const createModelDeduction = (deduction: Partial): Promise => { - return request.postJson('/deductionPodInfo/add', deduction); -}; - -export const deleteModelDeduction = (id: number): Promise => { - return request.delete(`/deductionPodInfo/${id}`); -}; - -export const findOneModelDeductionDetails = (id: number): Promise => { - return request.get(`/deductionPodInfo/${id}`); -} - -export const findChartsDataById = (id: number): Promise => { - return request.get(`/deductionPodData/listByPodId/${id}`); -}; - -export const runDeductionPodAfsimControl = (data: any): Promise => { - return request.postJson(`/deductionPodInfo/afsimControl`, data); -}; \ No newline at end of file diff --git a/modeler/src/views/ai/applications/charts/area-options.ts b/modeler/src/views/ai/applications/charts/area-options.ts deleted file mode 100644 index f5d6aab..0000000 --- a/modeler/src/views/ai/applications/charts/area-options.ts +++ /dev/null @@ -1,117 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import { xAxisConfig } from './config'; -import * as echarts from 'echarts'; -import type { ChartOption } from './types'; - -export const createAreaChartOption = (options: ChartOption) => { - let blueName = options.blueName ?? '蓝方'; - let redName = options.redName ?? '红方'; - - return { - title: { - text: options.title, - textStyle: { - color: '#eee', - fontSize: 16, - }, - }, - tooltip: { - trigger: 'axis', - textStyle: { - color: '#999', - }, - }, - grid: { - left: '1%', - right: '5%', - bottom: '15%', - containLabel: true, - }, - legend: { - data: [blueName, redName], - textStyle: { - color: '#ddd', - fontSize: 14, - }, - }, - xAxis: { - type: 'category', - data: options.xAxisData, - boundaryGap: [0.1, 0.1], - ...xAxisConfig, - }, - yAxis: { - type: 'value', - boundaryGap: [0, 0.1], - ...xAxisConfig, - }, - series: [ - { - name: blueName, - data: options.blueData, - type: 'line', - areaStyle: { - opacity: 0.8, - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: '#0f86d7', - }, - { - offset: 1, - color: '#0f1e48cc', - }, - ]), - }, - itemStyle: { - color: '#409EFF', // 轮数1整体颜色 - }, - label: { - show: false, // 开启数值显示 - position: 'top', // 数值显示在柱子顶部(可选:top/inside/outside/bottom等) - textStyle: { - color: '#eee', // 数值文字颜色 - fontSize: 12, // 数值文字大小 - }, - }, - }, - { - name: redName, - data: options.redData, - type: 'line', - areaStyle: { - opacity: 0.8, - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { - offset: 0, - color: '#dc5959', - }, - { - offset: 1, - color: '#bc1f1f', - }, - ]), - }, - itemStyle: { - color: '#bc1f1f', // 轮数2整体颜色 - }, - label: { - show: false, // 开启数值显示 - position: 'top', // 数值显示在柱子顶部(可选:top/inside/outside/bottom等) - textStyle: { - color: '#eee', // 数值文字颜色 - fontSize: 12, // 数值文字大小 - }, - }, - }, - ], - }; -}; \ No newline at end of file diff --git a/modeler/src/views/ai/applications/charts/bar-options.ts b/modeler/src/views/ai/applications/charts/bar-options.ts deleted file mode 100644 index 9d6c304..0000000 --- a/modeler/src/views/ai/applications/charts/bar-options.ts +++ /dev/null @@ -1,96 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import { getVerticalGradient, xAxisConfig } from './config'; -import type { ChartOption } from './types'; - -export const createBarChartOption = (options: ChartOption) => { - let blueName = options.blueName ?? '蓝方'; - let redName = options.redName ?? '红方'; - - return { - title: { - text: options.title, - textStyle: { - color: '#eee', - fontSize: 16 - } - }, - tooltip: { - trigger: 'axis', - textStyle: { - color: '#999' - } - }, - grid: { - left: '1%', - right: '5%', - bottom: '15%', - containLabel: true - }, - legend: { - data: [blueName, redName], - textStyle: { - color: '#ddd', - fontSize: 14 - } - }, - xAxis: { - type: 'category', - data: options.xAxisData, - boundaryGap: [0.1, 0.1], - ...xAxisConfig - }, - yAxis: { - type: 'value', - boundaryGap: [0.1, 0.5], - ...xAxisConfig - }, - series: [ - { - name: blueName, - data: options.blueData, - type: 'bar', - barWidth: '20%', - barGap: '10%', - barCategoryGap: '30%', - itemStyle: { - color: getVerticalGradient('#409EFF', '#87CEFA') - }, - label: { - show: false, // 开启数值显示 - position: 'top', // 数值显示在柱子顶部(可选:top/inside/outside/bottom等) - textStyle: { - color: '#eee', // 数值文字颜色 - fontSize: 12 // 数值文字大小 - } - } - }, - { - name: redName, - data: options.redData, - type: 'bar', - barWidth: '20%', - barGap: '10%', - barCategoryGap: '30%', - itemStyle: { - color: getVerticalGradient('#bc1f1f', '#e67e7e') - }, - label: { - show: false, // 开启数值显示 - position: 'top', // 数值显示在柱子顶部(可选:top/inside/outside/bottom等) - textStyle: { - color: '#eee', // 数值文字颜色 - fontSize: 12 // 数值文字大小 - } - } - } - ] - }; -}; \ No newline at end of file diff --git a/modeler/src/views/ai/applications/charts/charts-001.vue b/modeler/src/views/ai/applications/charts/charts-001.vue deleted file mode 100644 index f2979f4..0000000 --- a/modeler/src/views/ai/applications/charts/charts-001.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - diff --git a/modeler/src/views/ai/applications/charts/charts-002-1.vue b/modeler/src/views/ai/applications/charts/charts-002-1.vue deleted file mode 100644 index fde0054..0000000 --- a/modeler/src/views/ai/applications/charts/charts-002-1.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - diff --git a/modeler/src/views/ai/applications/charts/charts-002-2.vue b/modeler/src/views/ai/applications/charts/charts-002-2.vue deleted file mode 100644 index 003c21a..0000000 --- a/modeler/src/views/ai/applications/charts/charts-002-2.vue +++ /dev/null @@ -1,94 +0,0 @@ - - - diff --git a/modeler/src/views/ai/applications/charts/charts-002-3.vue b/modeler/src/views/ai/applications/charts/charts-002-3.vue deleted file mode 100644 index de4de83..0000000 --- a/modeler/src/views/ai/applications/charts/charts-002-3.vue +++ /dev/null @@ -1,94 +0,0 @@ - - - diff --git a/modeler/src/views/ai/applications/charts/charts-002-4.vue b/modeler/src/views/ai/applications/charts/charts-002-4.vue deleted file mode 100644 index 4ccecf3..0000000 --- a/modeler/src/views/ai/applications/charts/charts-002-4.vue +++ /dev/null @@ -1,94 +0,0 @@ - - - diff --git a/modeler/src/views/ai/applications/charts/charts-002.vue b/modeler/src/views/ai/applications/charts/charts-002.vue deleted file mode 100644 index 878632e..0000000 --- a/modeler/src/views/ai/applications/charts/charts-002.vue +++ /dev/null @@ -1,72 +0,0 @@ - - - diff --git a/modeler/src/views/ai/applications/charts/charts-003.vue b/modeler/src/views/ai/applications/charts/charts-003.vue deleted file mode 100644 index 1ac7c18..0000000 --- a/modeler/src/views/ai/applications/charts/charts-003.vue +++ /dev/null @@ -1,72 +0,0 @@ - - - diff --git a/modeler/src/views/ai/applications/charts/charts-004.vue b/modeler/src/views/ai/applications/charts/charts-004.vue deleted file mode 100644 index 87263bc..0000000 --- a/modeler/src/views/ai/applications/charts/charts-004.vue +++ /dev/null @@ -1,73 +0,0 @@ - - - diff --git a/modeler/src/views/ai/applications/charts/charts-005.vue b/modeler/src/views/ai/applications/charts/charts-005.vue deleted file mode 100644 index 431bb05..0000000 --- a/modeler/src/views/ai/applications/charts/charts-005.vue +++ /dev/null @@ -1,72 +0,0 @@ - - - diff --git a/modeler/src/views/ai/applications/charts/charts-006-impl.vue b/modeler/src/views/ai/applications/charts/charts-006-impl.vue deleted file mode 100644 index af5f46c..0000000 --- a/modeler/src/views/ai/applications/charts/charts-006-impl.vue +++ /dev/null @@ -1,74 +0,0 @@ - - - - - diff --git a/modeler/src/views/ai/applications/charts/charts-006.vue b/modeler/src/views/ai/applications/charts/charts-006.vue deleted file mode 100644 index 719d9d0..0000000 --- a/modeler/src/views/ai/applications/charts/charts-006.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - diff --git a/modeler/src/views/ai/applications/charts/charts-007.vue b/modeler/src/views/ai/applications/charts/charts-007.vue deleted file mode 100644 index f91e205..0000000 --- a/modeler/src/views/ai/applications/charts/charts-007.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - diff --git a/modeler/src/views/ai/applications/charts/charts-008.vue b/modeler/src/views/ai/applications/charts/charts-008.vue deleted file mode 100644 index 6ac9f41..0000000 --- a/modeler/src/views/ai/applications/charts/charts-008.vue +++ /dev/null @@ -1,72 +0,0 @@ - - - diff --git a/modeler/src/views/ai/applications/charts/charts-009-impl.vue b/modeler/src/views/ai/applications/charts/charts-009-impl.vue deleted file mode 100644 index 30ec062..0000000 --- a/modeler/src/views/ai/applications/charts/charts-009-impl.vue +++ /dev/null @@ -1,74 +0,0 @@ - - - - - diff --git a/modeler/src/views/ai/applications/charts/charts-009.vue b/modeler/src/views/ai/applications/charts/charts-009.vue deleted file mode 100644 index 4697aef..0000000 --- a/modeler/src/views/ai/applications/charts/charts-009.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - diff --git a/modeler/src/views/ai/applications/charts/charts-blue.vue b/modeler/src/views/ai/applications/charts/charts-blue.vue deleted file mode 100644 index df6c519..0000000 --- a/modeler/src/views/ai/applications/charts/charts-blue.vue +++ /dev/null @@ -1,87 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/applications/charts/charts-modal.vue b/modeler/src/views/ai/applications/charts/charts-modal.vue deleted file mode 100644 index b94da01..0000000 --- a/modeler/src/views/ai/applications/charts/charts-modal.vue +++ /dev/null @@ -1,246 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modeler/src/views/ai/applications/charts/charts-red.vue b/modeler/src/views/ai/applications/charts/charts-red.vue deleted file mode 100644 index 85d8515..0000000 --- a/modeler/src/views/ai/applications/charts/charts-red.vue +++ /dev/null @@ -1,87 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/applications/charts/charts.vue b/modeler/src/views/ai/applications/charts/charts.vue deleted file mode 100644 index 1fd7582..0000000 --- a/modeler/src/views/ai/applications/charts/charts.vue +++ /dev/null @@ -1,376 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modeler/src/views/ai/applications/charts/config.ts b/modeler/src/views/ai/applications/charts/config.ts deleted file mode 100644 index 566b438..0000000 --- a/modeler/src/views/ai/applications/charts/config.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -export const commonAxisConfig = { - axisLabel: { - color: '#eee', - fontSize: 12 - }, - axisLine: { - lineStyle: { - color: '#1e3150' - } - }, - axisTick: { - lineStyle: { - color: '#1e3150' - } - }, - splitLine: { - lineStyle: { - color: 'rgba(255, 255, 255, 0.1)' - } - } -}; - -export const getRadialGradient = (colorStart: string, colorEnd: string) => { - return { - type: 'radial', // 径向渐变(饼图首选) - x: 0.5, // 渐变中心x坐标(0-1,0.5为饼图中心) - y: 0.5, // 渐变中心y坐标 - r: 0.5, // 渐变半径(0-1,0.5适配饼图内半径到外半径) - colorStops: [ - { offset: 0, color: colorStart }, // 中心颜色(深) - { offset: 1, color: colorEnd } // 边缘颜色(浅) - ], - global: false // 局部渐变(仅作用于当前扇区) - }; -}; - -export const getVerticalGradient = (colorStart: string, colorEnd: string) => { - return { - type: 'linear', - x: 0, - y: 0, - x2: 0, - y2: 1, - colorStops: [ - { offset: 0, color: colorStart }, // 顶部颜色(深) - { offset: 1, color: colorEnd } // 底部颜色(浅) - ] - }; -}; - -export const xAxisConfig = { - splitLine: { - show: true, - lineStyle: { - color: 'rgba(255, 255, 255, 0.1)' // 网格线颜色(半透明白色) - } - }, - axisLabel: { - color: '#eee', - textStyle: { - color: '#EEE', // 标题字体颜色 - fontSize: 14 - } - }, - axisLine: { - show: true, - lineStyle: { - color: '#1e3150' // X轴线颜色(可选) - }, - textStyle: { - color: '#EEE', // 标题字体颜色 - fontSize: 14 - } - }, -} - -export const yAxisConfig = { - splitLine: { - show: true, - lineStyle: { - color: 'rgba(255, 255, 255, 0.1)' // 网格线颜色(半透明白色) - } - }, - axisLabel: { - color: '#eee', - textStyle: { - color: '#EEE', // 标题字体颜色 - fontSize: 14 - } - }, - axisLine: { - show: true, - lineStyle: { - color: '#1e3150' // X轴线颜色(可选) - }, - textStyle: { - color: '#EEE', // 标题字体颜色 - fontSize: 14 - } - }, -} \ No newline at end of file diff --git a/modeler/src/views/ai/applications/charts/line-options.ts b/modeler/src/views/ai/applications/charts/line-options.ts deleted file mode 100644 index 2bb0fc0..0000000 --- a/modeler/src/views/ai/applications/charts/line-options.ts +++ /dev/null @@ -1,265 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import { xAxisConfig } from './config'; -import type { ChartOption } from './types'; - -export interface LineChartOption extends ChartOption{ -} - -export const createLineChartOption = (options: LineChartOption = {}) => { - let blueName = options.blueName ?? '蓝方'; - let redName = options.redName ?? '红方'; - return { - title: { - text: options.title, - textStyle: { - color: '#EEE', // 标题字体颜色 - fontSize: 16, - }, - }, - tooltip: { - trigger: 'axis', - textStyle: { - color: '#999', // 提示框字体颜色 - }, - }, - grid: { - left: '1%', - right: '5%', - bottom: options.xAxisDataVisible ? '15%' : '10%', - containLabel: true, - }, - legend: { - data: [blueName, redName], - textStyle: { - color: '#ddd', - fontSize: 14, - }, - }, - xAxis: { - show: options.xAxisDataVisible, - type: 'category', - data: options.xAxisData, - boundaryGap: [0.1, 0.1], - ...xAxisConfig, - }, - yAxis: { - type: 'value', - boundaryGap: [0.1, 0.1], - ...xAxisConfig, - }, - series: [ - { - name: blueName, - type: 'line', - // stack: 'Total', - data: options.blueData, - lineStyle: { - color: '#409EFF', - width: 2, - }, - itemStyle: { - color: '#409EFF', - }, - emphasis: { - itemStyle: { - color: 'blue', // 高亮时填充色(白色) - borderColor: '#409EFF', // 高亮时边框色 - borderWidth: 4, - }, - symbolSize: 12, // 高亮时圆点放大 - }, - label: { - show: options.labelVisible, // 开启数值显示 - position: 'top', // 数值显示在柱子顶部(可选:top/inside/outside/bottom等) - textStyle: { - color: '#eee', // 数值文字颜色 - fontSize: 12, // 数值文字大小 - }, - }, - }, - { - name: redName, - type: 'line', - // stack: 'Total', - data: options.redData, - lineStyle: { - color: '#bc1f1f', - width: 2, - }, - itemStyle: { - color: '#bc1f1f', - }, - emphasis: { - itemStyle: { - color: 'blue', // 高亮时填充色(白色) - borderColor: 'red', // 高亮时边框色 - borderWidth: 4, - }, - symbolSize: 12, // 高亮时圆点放大 - }, - label: { - show: options.labelVisible, // 开启数值显示 - position: 'top', // 数值显示在柱子顶部(可选:top/inside/outside/bottom等) - textStyle: { - color: '#eee', // 数值文字颜色 - fontSize: 12, // 数值文字大小 - }, - }, - }, - ], - }; -}; - - -// line-options.ts -export interface ChartOptimizationOptions { - showAllSymbol?: boolean; - animation?: boolean; - large?: boolean; - progressive?: number; - progressiveThreshold?: number; -} - -export const createOptimizedLineChartOption = ( - title: string, - xAxisData: string[], - blueData: number[], - redData: number[], - optimization: ChartOptimizationOptions = {} -): echarts.EChartsOption => { - const { - showAllSymbol = false, - animation = false, - large = true, - progressive = 500, - progressiveThreshold = 1000, - } = optimization; - - return { - title: { - text: title, - left: 'center', - textStyle: { - fontSize: 16, - fontWeight: 'bold' - } - }, - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'cross' - }, - // 大数据时优化tooltip性能 - confine: true, - appendToBody: true, - }, - legend: { - data: ['蓝方轨迹', '红方轨迹'], - bottom: 10 - }, - grid: { - left: '3%', - right: '4%', - bottom: '15%', - top: '15%', - containLabel: true - }, - xAxis: { - type: 'category', - data: xAxisData, - axisLabel: { - rotate: 45, - // 减少标签显示密度 - interval: (index: number) => index % 50 === 0, - }, - // 大数据优化 - splitLine: { - show: false - } - }, - yAxis: { - type: 'value', - name: '归一化值', - // 大数据优化 - splitLine: { - lineStyle: { - type: 'dashed' - } - } - }, - dataZoom: [ - { - type: 'inside', - start: 0, - end: 100, - minValueSpan: 10 - }, - { - show: true, - type: 'slider', - top: '90%', - start: 0, - end: 100 - } - ], - series: [ - { - name: '蓝方轨迹', - type: 'line', - data: blueData, - smooth: false, // 大数据时关闭平滑,提高性能 - lineStyle: { - width: 1 // 减小线宽 - }, - itemStyle: { - color: '#1890ff' - }, - // 性能优化配置 - showSymbol: showAllSymbol, - symbol: 'circle', - symbolSize: 2, // 减小符号大小 - animation: animation, - animationThreshold: 2000, - animationDuration: 1000, - animationEasing: 'cubicOut', - // 大数据模式优化 - progressive: progressive, - progressiveThreshold: progressiveThreshold, - progressiveChunkMode: 'mod', - // 采样策略 - sampling: 'lttb', // 使用LTTB采样算法,保留趋势特征 - }, - { - name: '红方轨迹', - type: 'line', - data: redData, - smooth: false, - lineStyle: { - width: 1 - }, - itemStyle: { - color: '#ff4d4f' - }, - showSymbol: showAllSymbol, - symbol: 'circle', - symbolSize: 2, - animation: animation, - animationThreshold: 2000, - animationDuration: 1000, - animationEasing: 'cubicOut', - progressive: progressive, - progressiveThreshold: progressiveThreshold, - progressiveChunkMode: 'mod', - sampling: 'lttb', - } - ] - }; -}; \ No newline at end of file diff --git a/modeler/src/views/ai/applications/charts/pie-options.ts b/modeler/src/views/ai/applications/charts/pie-options.ts deleted file mode 100644 index 1a0c194..0000000 --- a/modeler/src/views/ai/applications/charts/pie-options.ts +++ /dev/null @@ -1,173 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -// 限定核心取值范围,同时保留扩展空间 -export type PieChartSide = 'blue' | 'red' | string - -export const createPieChartOption = ( - title: string, - side: PieChartSide, - progressPercent: number | null, - centerText: string, - blueName: string, - redName: string, -) => { - // 定义基础颜色常量,提升可读性 - const RED = '#bc1f1f'; - const BLUE = '#205aae'; - let color: string[]; - - // side=blue → 已占用(第一个元素)=红色,未占用(第二个)=蓝色 - // side=red → 已占用(第一个元素)=蓝色,未占用(第二个)=红色 - if (side === 'blue') { - color = [RED, BLUE]; - } else if (side === 'red') { - color = [BLUE, RED]; - } else { - // 兼容其他字符串值,使用默认逻辑 - color = [RED, BLUE]; - } - - let blueNameText = blueName ?? '蓝方'; - let redNameText = redName ?? '红方'; - - // 处理 null 值,避免显示 null% - const safeProgressPercent = Number(Number(progressPercent ?? 0).toFixed(2)); - - const realData = [ - { value: safeProgressPercent, name: side === 'blue' ? redNameText : blueNameText }, - { value: Number(Number(100 - safeProgressPercent).toFixed(2)), name: side === 'blue' ? blueNameText : redNameText } - ] - - // 核心修改1:文本截取逻辑 - 只显示前4个字符 - const displayText = centerText.length > 4 ? `${centerText.substring(0, 4)}...` : centerText; - // 保存完整文本用于tooltip显示 - const fullCenterText = centerText; - - console.error('realData',realData) - - return { - title: { - text: title, - textStyle: { - color: '#eee', - fontSize: 16 - } - }, - tooltip: { - trigger: 'item', - textStyle: { - color: '#999' - }, - // 核心修改2:自定义tooltip格式化内容,显示完整文本 - formatter: (params: any) => { - return ` -
-
${params.name}: ${params.value}%
-
${fullCenterText}
-
- `; - } - }, - grid: { - left: '1%', - right: '5%', - bottom: '1%', - top: '30%', - containLabel: true - }, - xAxis: { - show: false, - axisLabel: { - color: '#eee', - textStyle: { - color: '#EEE', // 标题字体颜色 - fontSize: 14 - } - }, - axisLine: { - lineStyle: { - color: '#eee' // X轴线颜色(可选) - }, - textStyle: { - color: '#EEE', // 标题字体颜色 - fontSize: 14 - } - }, - }, - yAxis: { - show: false, - axisLabel: { - color: '#eee', - textStyle: { - color: '#EEE', // 标题字体颜色 - fontSize: 14 - } - }, - axisLine: { - lineStyle: { - color: '#eee' // X轴线颜色(可选) - }, - textStyle: { - color: '#EEE', // 标题字体颜色 - fontSize: 14 - } - }, - }, - series: [ - { - type: 'pie', - radius: ['40%', '60%'], - center: ['50%', '50%'], - data: realData, - color: color, - itemStyle: { - borderWidth: 0 - }, - // 启用饼图中心标签 - label: { - show: true, - position: 'center', - // 核心修改3:使用截取后的文本显示 - formatter: `{a|${safeProgressPercent}%}\n{b|${displayText}}`, - rich: { - a: { - fontSize: 28, - fontWeight: 'bold', - color: '#eee', - lineHeight: 36 - }, - b: { - fontSize: 16, - color: '#ccc', - lineHeight: 24 - } - } - }, - // 禁用外部标签 - labelLine: { - show: false - }, - emphasis: { - itemStyle: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - }, - // 悬停时也显示中心标签 - label: { - show: true, - fontSize: 28, - fontWeight: 'bold' - } - } - } - ] - }; -}; \ No newline at end of file diff --git a/modeler/src/views/ai/applications/charts/scatter-options.ts b/modeler/src/views/ai/applications/charts/scatter-options.ts deleted file mode 100644 index 45390fc..0000000 --- a/modeler/src/views/ai/applications/charts/scatter-options.ts +++ /dev/null @@ -1,126 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import { xAxisConfig } from './config'; -import type { ChartOption } from './types'; - -export interface ScatterChartOption extends ChartOption{ - -} - -// 自定义三角形路径(调整尺寸适配显示) -export const triangleSymbol = 'path://M0,-6 L6,6 L-6,6 Z'; - -export const createScatterChartOption = (options: ScatterChartOption) => { - let blueName = options.blueName ?? '蓝方'; - let redName = options.redName ?? '红方'; - - return { - title: { - text: options.title, - textStyle: { - color: '#eee', - fontSize: 16 - } - }, - tooltip: { - trigger: 'axis', - textStyle: { - color: '#999' - } - }, - grid: { - left: '1%', - right: '5%', - bottom: '15%', - containLabel: true - }, - legend: { - data: [blueName, redName], - textStyle: { - color: '#ddd', - fontSize: 14 - } - }, - xAxis: { - type: 'category', - data: options.xAxisData, - boundaryGap: [0.1, 0.1], - ...xAxisConfig - }, - yAxis: { - type: 'value', - boundaryGap: [0.1, 0.5], - ...xAxisConfig - }, - series: [ - { - name: blueName, - type: 'scatter', - data: options.blueData, - symbol: 'circle', // 显式指定蓝方使用圆点(ECharts默认也是circle,显式设置更清晰) - symbolSize: 8, // 圆点大小 - itemStyle: { - color: '#409EFF' // 圆点颜色 - }, - emphasis: { - itemStyle: { - color: 'white', - borderColor: '#409EFF', - borderWidth: 2 - }, - symbolSize: 12 - }, - // 数值标签配置 - 显示在圆点上方 - label: { - show: false, - position: 'top', - formatter: '{c}', // 直接显示数据值 - textStyle: { - color: '#eee', - fontSize: 12, - fontWeight: 'bold' - }, - offset: [0, -10] // 调整偏移量,让标签在圆点上方显示更美观 - } - // 移除了markPoint配置(去掉额外的三角形) - }, - { - name: redName, - type: 'scatter', - data: options.redData, - symbol: triangleSymbol, // 红方使用自定义三角形 - symbolSize: 12, // 三角形尺寸(比原圆点稍大,保证视觉清晰) - itemStyle: { - color: '#bc1f1f' // 三角形颜色 - }, - emphasis: { - itemStyle: { - color: 'white', - borderColor: '#bc1f1f', - borderWidth: 2 - }, - symbolSize: 16 // 高亮时三角形放大 - }, - // 红方的数值标签配置 - label: { - show: false, - position: 'top', - formatter: '{c}', // 直接显示数据值 - textStyle: { - color: '#eee', - fontSize: 12, - fontWeight: 'bold' - }, - offset: [0, -15] // 三角形高度更高,标签偏移量稍大 - } - }, - ] - } -}; \ No newline at end of file diff --git a/modeler/src/views/ai/applications/charts/types.ts b/modeler/src/views/ai/applications/charts/types.ts deleted file mode 100644 index f06caad..0000000 --- a/modeler/src/views/ai/applications/charts/types.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import type { ModelDeductionData } from '../types'; - -export interface ChartOption { - title?: string, - blueName?: string|undefined, - redName?: string|undefined, - xAxisData?: string[], - blueData?: any[], - redData?: any[], - xAxisDataVisible?: boolean, - labelVisible?: boolean, -} - -export interface ChartLineData { - name: string, - xAxisData: string[], - blueData: number[], - redData: number [], - options: any, - deduction: ModelDeductionData, -} \ No newline at end of file diff --git a/modeler/src/views/ai/applications/charts/utils.ts b/modeler/src/views/ai/applications/charts/utils.ts deleted file mode 100644 index c46063a..0000000 --- a/modeler/src/views/ai/applications/charts/utils.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -export const downSampleData = (data: number[], targetCount = 200): number[] => { - if (!data.length || data.length <= targetCount) return data; - - const step = Math.ceil(data.length / targetCount); - const sampledData: number[] = []; - - for (let i = 0; i < data.length; i += step) { - sampledData.push(data[i] as any); - } - - if (sampledData[sampledData.length - 1] !== data[data.length - 1]) { - sampledData[Number(sampledData?.length - 1)] = data[data.length - 1] as number; - } - - return sampledData; -}; \ No newline at end of file diff --git a/modeler/src/views/ai/applications/config.ts b/modeler/src/views/ai/applications/config.ts deleted file mode 100644 index e7d1920..0000000 --- a/modeler/src/views/ai/applications/config.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import type { ModelDeduction } from './types'; - -export const defaultModelDeduction = { - // 推演记录ID - id: null, - deductionId: null, - // 部署模型路径 - deploymentModelPath: null, - // 对抗轮数配置 - competitionRound: null, - // 对抗场次配置 - competitionSession: 1, - // 推演倍数设置 - deductionMultiple: 1, - // 并发调度配置 - balanceStrategy: 1, - // 对抗模式选择 - competitionMode: 1, - // 蓝方名称 - blueNames: null, - // 红方名称 - redNames: null, - // 数据状态(1-正常,0-已删除) - status: null, - stopped: false, -} as ModelDeduction; \ No newline at end of file diff --git a/modeler/src/views/ai/applications/gambling.vue b/modeler/src/views/ai/applications/gambling.vue deleted file mode 100644 index 59b2540..0000000 --- a/modeler/src/views/ai/applications/gambling.vue +++ /dev/null @@ -1,673 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modeler/src/views/ai/applications/ranking-modal.vue b/modeler/src/views/ai/applications/ranking-modal.vue deleted file mode 100644 index 14d2e88..0000000 --- a/modeler/src/views/ai/applications/ranking-modal.vue +++ /dev/null @@ -1,692 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modeler/src/views/ai/applications/types.ts b/modeler/src/views/ai/applications/types.ts deleted file mode 100644 index cc8363e..0000000 --- a/modeler/src/views/ai/applications/types.ts +++ /dev/null @@ -1,222 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import type { ApiDataResponse, NullableString } from '@/types'; - -export interface DeductionPodMetricsDetails { - // 开火奖励累计值 - fire_reward: NullableString; - // 接近敌机奖励累计值 - approach_reward: NullableString; - // 越界惩罚累计值 - boundary_penalty: NullableString; - lock_reward: NullableString; - damage_reward: NullableString; - // 胜利奖励值 - win_bonus: NullableString; - [key: string]: unknown; - -} - -export interface DeductionPodMetrics { - // 本轮总奖励。该 Episode 获得的总分。 - reward: NullableString; - // 本轮生存步数。该 Episode 持续的步数, - steps: number; - // 胜负判定。1 表示胜利,0表示失败/平局。 - is_win: number; - // 环境分项奖励明细。包含环境返回的所有细分奖励项(动态字段)。 - details: null | DeductionPodMetricsDetails; - - [key: string]: unknown; -} - -export interface DeductionPod { - id: number; - // 关联推演ID - deductionId: number; - // RayJob名称 - jobName: NullableString; - // RayJob主机IP - jobHostIp: NullableString; - // 8000端口映射 - jobNodePort8000: NullableString; - // 8265端口映射 - jobNodePort8265: NullableString; - // Afsim主机IP - afsimHostIp: NullableString; - // 6901端口映射 - afsimNodePort6901: NullableString; - // 50051端口映射 - afsimNodePort50051: NullableString; - // 状态(1-正常,0-已删除) - status: number; - // 推演任务Job_ID - jobId: NullableString; - // 总轮数 - totalRound: number; - // 当前轮数 - currentRound: number; - // 内部详细指标,JSON格式 - metrics: NullableString; - // 红方名称 - redName: NullableString, - // 蓝方名称 - blueName: NullableString; - // 仿真状态(1-运行,2-暂停) - simulationStatus: Number; - - metricsParsed: null | DeductionPodMetrics; - [key: string]: unknown; -} - -export interface DeductionPodResult extends ApiDataResponse { - -} - -export interface ModelDeduction { - // 推演记录ID - id: number | null, - deductionId: number | null, - // 部署模型路径 - deploymentModelPath: NullableString, - // 对抗轮数配置 - competitionRound: NullableString, - // 对抗场次配置 - competitionSession: number, - // 并发调度配置 - balanceStrategy: NullableString | number | undefined, - // 推演倍数设置 - deductionMultiple: number, - // 对抗模式选择 - competitionMode: NullableString | number | undefined | null, - // 数据状态(1-正常,0-已删除) - status: number | null, - // 蓝方名称 - blueNames: NullableString, - // 红方名称 - redNames: NullableString, - - stopped: boolean; - - [key: string]: unknown; -} - -export interface ModelDeductionData { - id: number | null, - // 关联Pod信息ID - deductionPodId: number, - // 当前轮数 - currentEpisode: number, - // 累计总步数 - totalSteps: number, - // 蓝方总开火次数 - fireTimesBlue: number, - // 红方总开火次数 - fireTimesRed: number, - // 蓝方本轮回报 - episodeReturnsBlue: number, - // 红方本轮回报 - episodeReturnsRed: number, - // 当前轮次生存步数 - episodeLengths: number, - // 胜负历史 - winHistory: NullableString, - // 蓝方最近10轮平均回报 - avgReturn1Last10: number, - // 蓝方最近100轮平均回报 - avgReturn1Last100: number, - // 红方最近10轮平均回报 - avgReturn2Last10: number, - // 红方最近100轮平均回报 - avgReturn2Last100: number, - // 平均每轮步数 - avgEpisodeLength: number, - // 蓝方胜率 - winRate: number, - // 蓝方败率 - lossRate: number, - // 平局率 - drawRate: number, - // 当前轮步数 - stepInEpisode: number, - // 蓝方回报分量详情 - returnComponentsBlue: NullableString, - // 红方回报分量详情 - returnComponentsRed: NullableString, - // 蓝方本轮惩罚值 - returnDelnatyBlue: number, - // 红方本轮惩罚值 - returnDelnatyRed: number, - // 蓝方每轮弹药消耗量 - fireConsumeBlue: number, - // 红方每轮弹药消耗量 - fireConsumeRed: number, - // 蓝方本轮首次开火时间步 - firstFireTimeBlue: number, - // 红方本轮首次开火时间步 - firstFireTimeRed: number, - // 蓝方攻击持续时间 - attackTimeBlue: number, - // 蓝方生存步数 - episodeLengthsBlue: number | null, - // 红方生存步数 - episodeLengthsRed: number | null, - // 蓝方胜次数 - blueWinRounds: number, - // 红方胜次数 - redWinRounds: number, - // 红方攻击持续时间 - attackTimeRed: number, - // 能量优势序列(JSON数组,1=优势,0=劣势) - energyAdvantage: NullableString, - // 蓝方轨迹纬度序列(JSON数组) - trajectoryBlueLat: NullableString, - // 蓝方轨迹经度序列(JSON数组 - trajectoryBlueLon: NullableString, - // 蓝方轨迹高度序列(JSON数组) - trajectoryBlueAlt: NullableString, - // 红方轨迹纬度序列(JSON数组) - trajectoryRedLat: NullableString, - // 红方轨迹经度序列(JSON数组) - trajectoryRedLon: NullableString, - // 红方轨迹高度序列(JSON数组 - trajectoryRedAlt: NullableString, - // 状态(1-正常,0-已删除) - status: number, - // 创建者 - createBy: NullableString, - // 创建时间 - createTime: NullableString, - // 备注 - remark: NullableString, - normalizedBlueTrajectory: number[]; - normalizedRedTrajectory: number[]; - - [key: string]: unknown; - -} - -export interface ModelDeductionDataResponse extends ApiDataResponse { - -} - -export interface ModelDeductionDetailsResponse extends ApiDataResponse { - -} - -export interface ModelDeductionPodStatus { - status: NullableString, - state: NullableString, - stateDescription: NullableString, -} - -export interface ModelDeductionPodStatusResponse extends ApiDataResponse { - -} \ No newline at end of file diff --git a/modeler/src/views/ai/builder/element.ts b/modeler/src/views/ai/builder/element.ts deleted file mode 100644 index bbc7b4d..0000000 --- a/modeler/src/views/ai/builder/element.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import type { NullableString } from '@/types'; -import type { ModelParameters } from '@/views/ai/model/types'; - -export interface DraggableElement { - id: number | null, - key?: NullableString, - name: NullableString, - description: NullableString, - category: NullableString, - draggable: boolean, - parent?: DraggableElement, - children: DraggableElement[] - [key: string]: unknown; -} - -export interface ModelElementPosition { - x: number; - y: number; -} - -export interface ModelElementEdge { - key: NullableString; - sourceKey: NullableString; - sourceName: NullableString; - targetKey: NullableString; - targetName: NullableString; -} - -export interface ModelBaseElement { - key: string; - name: string; - type: string; - width: number; - height: number; - position: ModelElementPosition; - category: NullableString; - element?: DraggableElement; - - [key: string]: unknown; -} - -export interface ModelElement extends ModelBaseElement { - // 连线 - edges: ModelElementEdge[]; - // 模型参数设置 - parameters: ModelParameters; -} - -export interface SavedGraphData { - nodes: ModelElement[]; - edges: any[]; -} diff --git a/modeler/src/views/ai/builder/graph.ts b/modeler/src/views/ai/builder/graph.ts deleted file mode 100644 index 9fceb78..0000000 --- a/modeler/src/views/ai/builder/graph.ts +++ /dev/null @@ -1,177 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import { Edge, Graph, Path, Selection } from '@antv/x6'; -import type { ModelElement } from './element'; -import type { Connecting } from '@antv/x6/lib/graph/options'; -import { createLineOptions } from './line'; - -Graph.registerConnector( - 'sequenceFlowConnector', - (s, e) => { - const offset = 4; - const deltaY = Math.abs(e.y - s.y); - const control = Math.floor((deltaY / 3) * 2); - - const v1 = { x: s.x, y: s.y + offset + control }; - const v2 = { x: e.x, y: e.y - offset - control }; - - return Path.parse( - ` - M ${s.x} ${s.y} - L ${s.x} ${s.y + offset} - C ${v1.x} ${v1.y} ${v2.x} ${v2.y} ${e.x} ${e.y - offset} - L ${e.x} ${e.y} - `, - ).serialize(); - }, - true, -); - -export const createGraphConnectingAttributes = (): Partial => { - const lineOptions = createLineOptions(); - return { - snap: true, // 当 snap 设置为 true 时连线的过程中距离节点或者连接桩 50px 时会触发自动吸附 - allowBlank: false, // 是否允许连接到画布空白位置的点,默认为 true - allowLoop: false, // 是否允许创建循环连线,即边的起始节点和终止节点为同一节点,默认为 true - highlight: true, // 当连接到节点时,通过 sourceAnchor 来指定源节点的锚点。 - connector: 'smooth', - connectionPoint: 'anchor', // 指定连接点,默认值为 boundary。 - anchor: 'center', - // validateMagnet({ magnet }) { - // return magnet.getAttribute('port-group') !== 'top' - // }, - // 验证连接 - createEdge(this: Graph) { - const edge: Edge = this.createEdge({ - shape: 'edge', - ...lineOptions, // 应用动画配置 - attrs: lineOptions.attrs, - animation: lineOptions.animation, - markup: lineOptions.markup, - }) - return edge; - }, - validateConnection(this: Graph, { sourceCell, targetCell }) { - console.error('validateConnection'); - if (!sourceCell || !targetCell) return false; - - // 核心逻辑:禁止节点连接自己(自环) - if (sourceCell === targetCell) { - return false; - } - - // const sourceData = sourceCell.getData() as GraphElement; - const targetData = targetCell.getData() as ModelElement; - - // 根节点不能作为子节点 - if (targetData.type === 'startEvent') { - return false; - } - - // 4. 新增核心逻辑:检查源节点是否已有出边(已连接其他节点) - // const hasOutgoingEdge = this.getOutgoingEdges(sourceCell); - // if (hasOutgoingEdge && hasOutgoingEdge.length > 1) { - // return false; - // } - - // 检查是否已存在相同连接 - // const edges: Edge[] = this.getEdges(); - // const existingConnection = edges.find(edge => - // edge.getSourceCell() === sourceCell && - // edge.getTargetCell() === targetCell, - // ); - // - // return !existingConnection; - return true; - }, - }; -}; - -export const createGraphCanvas = (container: HTMLDivElement, readonly: boolean = false): Graph => { - const graph = new Graph({ - container: container, - grid: { - size: 20, - visible: true, - type: 'dot', - // color: '#e5e7eb' - }, - // 确保启用了异步渲染 - async: true, - panning: { - enabled: true, - eventTypes: ['leftMouseDown', 'mouseWheel'], - }, - mousewheel: { - enabled: true, - modifiers: 'ctrl', - factor: 1.1, - maxScale: 1.5, - minScale: 0.5, - }, - highlighting: { - magnetAdsorbed: { - name: 'stroke', - args: { - attrs: { - fill: '#fff', - stroke: '#31d0c6', - strokeWidth: 4, - }, - }, - }, - }, - connecting: createGraphConnectingAttributes(), - - scaling: { - min: 0.5, - max: 2, - }, - - // 背景配置 - background: {}, - - // 交互配置 - interacting: (cellView) => { - if (readonly) { - return false; // 只读模式下禁用所有交互 - } - - // 确保边(edge)的顶点交互权限开启 - if (cellView.cell.isEdge()) { - return { - vertexAddable: true, // 允许添加顶点 - vertexMovable: true, // 允许移动顶点 - vertexDeletable: true, // 允许删除顶点 - edgeMovable: true, // 允许整体拖动连线 - arrowheadMovable: true, // 允许拖动箭头调整端点 - }; - } - - // 节点的交互配置(保持不变) - return { - nodeMovable: true, - }; - }, - }); - - graph.use( - new Selection({ - multiple: true, - rubberEdge: true, - rubberNode: true, - modifiers: 'shift', - rubberband: true, - }), - ); - - return graph; - -}; \ No newline at end of file diff --git a/modeler/src/views/ai/builder/line.ts b/modeler/src/views/ai/builder/line.ts deleted file mode 100644 index 7ee5b4e..0000000 --- a/modeler/src/views/ai/builder/line.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import { Shape } from '@antv/x6'; - -export const createLineOptions = (): any => { - return { - markup: [ - { - tagName: 'circle', - selector: 'marker', - attrs: { - stroke: 'none', - r: 3, - }, - }, - ...Shape.Edge.getMarkup() as any, - ], - attrs: { - line: { - stroke: '#5da0df', - strokeWidth: 2, - strokeDasharray: ' ', - strokeDashoffset: 0, - }, - marker: { - fill: '#5da0df', - atConnectionRatio: 0, - }, - }, - animation: [ - [ - { 'attrs/marker/atConnectionRatio': 1 }, - { - duration: 2000, - iterations: Infinity, - }, - ], - ], - } -} \ No newline at end of file diff --git a/modeler/src/views/ai/builder/node.vue b/modeler/src/views/ai/builder/node.vue deleted file mode 100644 index aae3806..0000000 --- a/modeler/src/views/ai/builder/node.vue +++ /dev/null @@ -1,322 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modeler/src/views/ai/builder/ports.ts b/modeler/src/views/ai/builder/ports.ts deleted file mode 100644 index cd24310..0000000 --- a/modeler/src/views/ai/builder/ports.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -export const createPort = (name: string = 'top', args: Record = { dx: 0 }) => { - return { - position: { name: name, args: args }, - attrs: { - circle: { - r: 4, // 大小 - magnet: true, - stroke: '#1b5e9f', // 边框颜色 - strokeWidth: 1, // 边框大小 - fill: '#3578bf', // 填充颜色 - style: { - visibility: 'visible', // 是否可见 - }, - }, - }, - }; -}; - -export const createPorts = (top: boolean = true, right: boolean = true, bottom: boolean = true, left: boolean = true) => { - const groups: any = {}; - const items: any = []; - if (top) { - groups['top'] = createPort('top'); - items.push({ group: 'top', id: 'top' }); - } - if (right) { - groups['right'] = createPort('right'); - items.push({ group: 'right', id: 'right' }); - } - if (bottom) { - groups['bottom'] = createPort('bottom'); - items.push({ group: 'bottom', id: 'bottom' }); - } - if (left) { - groups['left'] = createPort('left'); - items.push({ group: 'left', id: 'left' }); - } - return { - groups: groups, - items: items, - }; -}; \ No newline at end of file diff --git a/modeler/src/views/ai/builder/props.ts b/modeler/src/views/ai/builder/props.ts deleted file mode 100644 index dc093e6..0000000 --- a/modeler/src/views/ai/builder/props.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import { Graph, Node } from '@antv/x6'; -import { type ExtractPropTypes, type PropType } from 'vue'; -import type { ModelElement } from './element'; - -export const elementProps = { - node: { - type: Object as PropType, - required: true, - }, - graph: { - type: Object as PropType, - required: true, - }, - element: { - type: Object as PropType, - required: false, - }, -}; - -export type ElementPropsType = ExtractPropTypes \ No newline at end of file diff --git a/modeler/src/views/ai/config.ts b/modeler/src/views/ai/config.ts deleted file mode 100644 index 853dde1..0000000 --- a/modeler/src/views/ai/config.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -export const menuMap = [ - { - key: '0', - title: '指挥决策规则库管理', - path: '/app/ai/project/management', - }, - { - key: '1', - title: '智能体构建工具', - children: [ - { - key: '1-1', - title: '智能体管理', - path: '/app/ai/model/management', - }, - ], - }, - { - key: '2', - title: 'AI模型训练', - children: [ - { - key: '2-0', - title: '训练任务管理', - path: '/app/ai/training/task/management', - }, - { - key: '2-1', - title: '训练任务配置', - path: '/app/ai/training/task/configurer', - }, - // { - // key: '2-4', - // title: '训练任务监控', - // path: '/app/ai/training/task/monitor', - // }, - ], - }, - { - key: '3', - title: '博弈竞赛应用', - children: [ - { - key: '3-1', - title: '博弈竞赛单元运行环境', - path: '/app/ai/applications/gambling', - }, - { - key: '3-2', - title: '仿真测试推演脚本', - type: 'open-script-window' - }, - ], - }, - { - key: '2-3', - title: '训练资源监控', - path: '/app/ai/training/resources/monitor', - children: [] - }, -]; \ No newline at end of file diff --git a/modeler/src/views/ai/dashboard.vue b/modeler/src/views/ai/dashboard.vue deleted file mode 100644 index 1a04893..0000000 --- a/modeler/src/views/ai/dashboard.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - diff --git a/modeler/src/views/ai/finder.vue b/modeler/src/views/ai/finder.vue deleted file mode 100644 index 4f18fa0..0000000 --- a/modeler/src/views/ai/finder.vue +++ /dev/null @@ -1,274 +0,0 @@ - - - - \ No newline at end of file diff --git a/modeler/src/views/ai/header.vue b/modeler/src/views/ai/header.vue deleted file mode 100644 index 76ca76e..0000000 --- a/modeler/src/views/ai/header.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/layout.vue b/modeler/src/views/ai/layout.vue deleted file mode 100644 index 8c4826e..0000000 --- a/modeler/src/views/ai/layout.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/menu.vue b/modeler/src/views/ai/menu.vue deleted file mode 100644 index 8b7f121..0000000 --- a/modeler/src/views/ai/menu.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/model/algorithm-card.vue b/modeler/src/views/ai/model/algorithm-card.vue deleted file mode 100644 index 45376e0..0000000 --- a/modeler/src/views/ai/model/algorithm-card.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - - diff --git a/modeler/src/views/ai/model/api.ts b/modeler/src/views/ai/model/api.ts deleted file mode 100644 index 0ffcb20..0000000 --- a/modeler/src/views/ai/model/api.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import request from '@/utils/request'; -import type { Model, ModelQueryResult, ModelResult, NetworkModelResult, ObservationType, ObservationTypeResult, RewardDesign, RewardDesignResult } from './types'; -import type { ApiDataResponse, BasicResponse } from '@/types'; - -export const findAllNetworkModel = (): Promise => { - return request.get('/networkModel/all'); -}; - -export const findRewardDesignByQuery = (query: Partial = {}): Promise => { - return request.get('/rewardDesign/list', query); -}; - -export const findObservationTypeByQuery = (query: Partial = {}): Promise => { - return request.get('/observationType/list', query); -}; - -export const findModelByQuery = (query: Partial = {}): Promise => { - return request.get('/model/list', query); -}; - -export const findAllModels = (): Promise> => { - return request.get>('/model/all'); -}; - -export const findOneModelById = (id: number | string): Promise => { - return request.get(`/model/get/${id}`); -}; - -export const createModel = (rt: Partial): Promise => { - return request.postJson('/model/add', rt); -}; - -export const updateModel = (rt: Partial): Promise => { - return request.putJson('/model/edit', rt); -}; - -export const deleteModel = (id: number | string): Promise => { - return request.delete(`/model/logic/${id}`); -}; diff --git a/modeler/src/views/ai/model/builder-inputs.vue b/modeler/src/views/ai/model/builder-inputs.vue deleted file mode 100644 index 39e4f8c..0000000 --- a/modeler/src/views/ai/model/builder-inputs.vue +++ /dev/null @@ -1,148 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modeler/src/views/ai/model/builder-left-components.vue b/modeler/src/views/ai/model/builder-left-components.vue deleted file mode 100644 index 62105c5..0000000 --- a/modeler/src/views/ai/model/builder-left-components.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/model/builder-right-control.vue b/modeler/src/views/ai/model/builder-right-control.vue deleted file mode 100644 index 6980bea..0000000 --- a/modeler/src/views/ai/model/builder-right-control.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/model/builder-right-manager.vue b/modeler/src/views/ai/model/builder-right-manager.vue deleted file mode 100644 index 731c03b..0000000 --- a/modeler/src/views/ai/model/builder-right-manager.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/model/builder-right-situation.vue b/modeler/src/views/ai/model/builder-right-situation.vue deleted file mode 100644 index f62da08..0000000 --- a/modeler/src/views/ai/model/builder-right-situation.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/model/builder-right-v1.vue b/modeler/src/views/ai/model/builder-right-v1.vue deleted file mode 100644 index 2e8e65f..0000000 --- a/modeler/src/views/ai/model/builder-right-v1.vue +++ /dev/null @@ -1,376 +0,0 @@ - - - diff --git a/modeler/src/views/ai/model/builder-right.vue b/modeler/src/views/ai/model/builder-right.vue deleted file mode 100644 index be457ad..0000000 --- a/modeler/src/views/ai/model/builder-right.vue +++ /dev/null @@ -1,281 +0,0 @@ - - - diff --git a/modeler/src/views/ai/model/builder.vue b/modeler/src/views/ai/model/builder.vue deleted file mode 100644 index 6bd9624..0000000 --- a/modeler/src/views/ai/model/builder.vue +++ /dev/null @@ -1,511 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/model/components.vue b/modeler/src/views/ai/model/components.vue deleted file mode 100644 index a337cd2..0000000 --- a/modeler/src/views/ai/model/components.vue +++ /dev/null @@ -1,208 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/model/config.ts b/modeler/src/views/ai/model/config.ts deleted file mode 100644 index e462c8a..0000000 --- a/modeler/src/views/ai/model/config.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import type { TableColumnType } from 'ant-design-vue'; -import type { Model, SavedGraphData } from './types'; - -export const defaultSavedGraphData = { - nodes: [], - edges: [], - observations: [], - rewards: [], - actionSpaces: [], -} as SavedGraphData - -export const modelColumns: TableColumnType[] = [ - { - title: '序号', - dataIndex: 'index', - key: 'index', - }, - { - title: '智能体名称', - dataIndex: 'name', - key: 'name', - }, - { - title: '所属工程', - dataIndex: 'projectSpaceName', - key: 'projectSpaceName', - }, - { - title: '智能体描述', - dataIndex: 'description', - key: 'description', - }, - { - title: '存储位置', - dataIndex: 'storageLocation', - key: 'storageLocation', - }, - { - title: '操作', - dataIndex: '_actions', - key: '_actions', - width: 100, - }, -]; - -export const defaultModel: Model = { - id: 0, - projectId: undefined, - projectSpaceName: null, - name: null, - description: null, - storageLocation: null, - configInfo: null, - status: 1, - createTime: null, -}; diff --git a/modeler/src/views/ai/model/control-options.ts b/modeler/src/views/ai/model/control-options.ts deleted file mode 100644 index 72c1caa..0000000 --- a/modeler/src/views/ai/model/control-options.ts +++ /dev/null @@ -1,264 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - - -import type { ElementInput } from './inputs'; - -export const taskInputs: ElementInput[] = [ - { - id: null, - name: '空中扫荡', - description: '', - category: 'task', - draggable: true, - children: [], - }, - { - id: null, - name: '战斗巡逻', - description: '', - category: 'task', - draggable: true, - children: [], - }, - { - id: null, - name: '空中护航', - description: '', - category: 'task', - draggable: true, - children: [], - }, - { - id: null, - name: '空中加油', - description: '', - category: 'task', - draggable: true, - children: [], - }, - { - id: null, - name: '侦察监视', - description: '', - category: 'task', - draggable: true, - children: [], - }, - { - id: null, - name: '压制防空', - description: '', - category: 'task', - draggable: true, - children: [], - }, -]; - -export const controlInputs: ElementInput[] = [ - { - id: null, - name: '追击', - description: '', - category: 'control', - draggable: true, - children: [], - }, - { - id: null, - name: '开火', - description: '', - category: 'control', - draggable: true, - children: [], - }, - { - id: null, - name: '偏置', - description: '', - category: 'control', - draggable: true, - children: [], - }, - { - id: null, - name: '脱离', - description: '', - category: 'control', - draggable: true, - children: [], - }, - { - id: null, - name: '目视追击', - description: '', - category: 'control', - draggable: true, - children: [], - }, - { - id: null, - name: '夹击追击', - description: '', - category: 'control', - draggable: true, - children: [], - }, - { - id: null, - name: '交替脱离', - description: '', - category: 'control', - draggable: true, - children: [], - }, - { - id: null, - name: '交替追击', - description: '', - category: 'control', - draggable: true, - children: [], - }, - { - id: null, - name: '航线巡逻', - description: '', - category: 'control', - draggable: true, - children: [], - }, -]; - -export const flyInputs: ElementInput[] = [ - { - id: null, - name: '滚转角', - description: '', - category: 'parameter', - draggable: true, - children: [], - }, - { - id: null, - name: '俯仰角', - description: '', - category: 'parameter', - draggable: true, - children: [], - }, - { - id: null, - name: '偏航角', - description: '', - category: 'parameter', - draggable: true, - children: [], - }, - { - id: null, - name: '油门', - description: '', - category: 'parameter', - draggable: true, - children: [], - }, - { - id: null, - name: '开火', - description: '', - category: 'parameter', - draggable: true, - children: [], - }, - { - id: null, - name: '飞行到点/位', - description: '', - category: 'parameter', - draggable: true, - children: [], - }, - { - id: null, - name: '飞行到位置', - description: '', - category: 'parameter', - draggable: true, - children: [], - }, - { - id: null, - name: '飞行到高度', - description: '', - category: 'parameter', - draggable: true, - children: [], - }, - { - id: null, - name: '转头', - description: '', - category: 'parameter', - draggable: true, - children: [], - }, - { - id: null, - name: '相对斜距转向', - description: '', - category: 'parameter', - draggable: true, - children: [], - }, - { - id: null, - name: '指定速度', - description: '', - category: 'parameter', - draggable: true, - children: [], - }, -]; - - -export const managerInputs: ElementInput[] = [ - { - id: null, - name: '启动', - description: '', - category: 'action', - draggable: true, - children: [], - }, - { - id: null, - name: '恢复', - description: '', - category: 'action', - draggable: true, - children: [], - }, - { - id: null, - name: '暂停', - description: '', - category: 'action', - draggable: true, - children: [], - }, - { - id: null, - name: '删除', - description: '', - category: 'action', - draggable: true, - children: [], - } -]; \ No newline at end of file diff --git a/modeler/src/views/ai/model/hooks.ts b/modeler/src/views/ai/model/hooks.ts deleted file mode 100644 index a47cc82..0000000 --- a/modeler/src/views/ai/model/hooks.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ diff --git a/modeler/src/views/ai/model/inputs.ts b/modeler/src/views/ai/model/inputs.ts deleted file mode 100644 index e7daff8..0000000 --- a/modeler/src/views/ai/model/inputs.ts +++ /dev/null @@ -1,186 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import { findObservationTypeByQuery } from './api'; -import type { DraggableElement } from '../builder/element'; - -export interface ElementInput extends DraggableElement { - [key: string]: unknown; -} - -export const defaultBasicInputs: ElementInput[] = [ - { - id: null, - name: '基础状态', - description: null, - draggable: true, - category: 'input', - children:[ - { - id: null, - name: '时间数据', - description: null, - draggable: true, - category: 'input', - children:[] - }, - { - id: null, - name: '阵营数据', - description: null, - draggable: true, - category: 'input', - children:[] - } - ] - } -] - -export const defaultManeuverInputs: ElementInput[] = [ - { - id: null, - name: '机动状态', - description: null, - draggable: true, - category: 'input', - children:[] - } -] - -export const defaultWeaponInputs: ElementInput[] = [ - { - id: null, - name: '武器状态', - description: null, - draggable: true, - category: 'input', - children:[ - { - id: null, - name: '挂载武器', - description: null, - draggable: true, - category: 'input', - children:[] - }, - { - id: null, - name: '导弹状态', - description: null, - draggable: true, - category: 'input', - children:[] - } - ] - } -] - - -export const defaultSensorInputs: ElementInput[] = [ - { - id: null, - name: '传感器状态', - description: null, - draggable: true, - category: 'input', - children:[ - { - id: null, - name: '传感器名称', - description: null, - draggable: true, - category: 'input', - children:[] - }, - { - id: null, - name: '类型信息', - description: null, - draggable: true, - category: 'input', - children:[] - }, - { - id: null, - name: '激活状态', - description: null, - draggable: true, - category: 'input', - children:[] - } - ] - } -] - -export const defaultFuelInputs: ElementInput[] = [ - { - id: null, - name: '燃油状态', - description: null, - draggable: true, - category: 'input', - children:[ - { - id: null, - name: '当前燃油', - description: null, - draggable: true, - category: 'input', - children:[] - }, - { - id: null, - name: '当前油耗', - description: null, - draggable: true, - category: 'input', - children:[] - }, - ] - } -] - -export const resolveElementInputs = () : Promise=> { - return new Promise((resolve,reject)=> { - findObservationTypeByQuery().then(r => { - let items = []; - let item: ElementInput = { - id: null, - name: '机动状态', - description: null, - draggable: true, - category: 'input', - children:[] - }; - if(r.rows){ - r.rows.forEach(i=> { - item.children.push({ - name: i.typeName, - id: i.id, - description: i.description, - draggable: true, - category: 'input', - children: [], - }) - }) - } - items.push(item); - - resolve([ - ...defaultBasicInputs, - ...items, - ...defaultWeaponInputs, - ...defaultSensorInputs, - ...defaultFuelInputs, - ]) - }).catch((e:any)=> { - reject(e); - }); - }) -} \ No newline at end of file diff --git a/modeler/src/views/ai/model/management.vue b/modeler/src/views/ai/model/management.vue deleted file mode 100644 index 6b80c8f..0000000 --- a/modeler/src/views/ai/model/management.vue +++ /dev/null @@ -1,228 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/model/rules/fuzzy.json b/modeler/src/views/ai/model/rules/fuzzy.json deleted file mode 100644 index cd29a53..0000000 --- a/modeler/src/views/ai/model/rules/fuzzy.json +++ /dev/null @@ -1,402 +0,0 @@ -[ - { - "id": 1, - "name": "三角隶属度模糊规则(Mamdani 型)" - }, - { - "id": 2, - "name": "高斯隶属度模糊规则(Mamdani 型)" - }, - { - "id": 3, - "name": "梯形隶属度模糊规则(Mamdani 型)" - }, - { - "id": 4, - "name": "钟形隶属度模糊规则(Mamdani 型)" - }, - { - "id": 5, - "name": "S 型隶属度模糊规则(Mamdani 型)" - }, - { - "id": 6, - "name": "Z 型隶属度模糊规则(Mamdani 型)" - }, - { - "id": 7, - "name": "单点隶属度模糊规则(Sugeno 型)" - }, - { - "id": 8, - "name": "线性隶属度模糊规则(Sugeno 型)" - }, - { - "id": 9, - "name": "二次函数隶属度模糊规则(Sugeno 型)" - }, - { - "id": 10, - "name": "最大 - 最小推理模糊规则(三角隶属度)" - }, - { - "id": 11, - "name": "最大 - 乘积推理模糊规则(三角隶属度)" - }, - { - "id": 12, - "name": "最小 - 最大推理模糊规则(高斯隶属度)" - }, - { - "id": 13, - "name": "最小 - 乘积推理模糊规则(高斯隶属度)" - }, - { - "id": 14, - "name": "重心法去模糊化模糊规则(Mamdani)" - }, - { - "id": 15, - "name": "最大隶属度法去模糊化模糊规则(Mamdani)" - }, - { - "id": 16, - "name": "加权平均法去模糊化模糊规则(Sugeno)" - }, - { - "id": 17, - "name": "中位数法去模糊化模糊规则(Mamdani)" - }, - { - "id": 18, - "name": "左最大隶属度法去模糊化模糊规则(Mamdani)" - }, - { - "id": 19, - "name": "右最大隶属度法去模糊化模糊规则(Mamdani)" - }, - { - "id": 20, - "name": "多输入单输出(MISO)模糊规则(三角隶属度)" - }, - { - "id": 21, - "name": "多输入多输出(MIMO)模糊规则(三角隶属度)" - }, - { - "id": 22, - "name": "单输入单输出(SISO)模糊规则(高斯隶属度)" - }, - { - "id": 23, - "name": "单输入多输出(SIMO)模糊规则(高斯隶属度)" - }, - { - "id": 24, - "name": "基于专家经验的静态模糊规则" - }, - { - "id": 25, - "name": "基于数据驱动的动态模糊规则" - }, - { - "id": 26, - "name": "自学习更新模糊规则(梯度下降)" - }, - { - "id": 27, - "name": "增量式更新模糊规则(新增数据适配)" - }, - { - "id": 28, - "name": "模糊聚类生成模糊规则(FCM)" - }, - { - "id": 29, - "name": "粗糙集约简模糊规则(去冗余)" - }, - { - "id": 30, - "name": "遗传算法优化模糊规则(规则库精简)" - }, - { - "id": 31, - "name": "粒子群优化模糊规则(隶属度参数优化)" - }, - { - "id": 32, - "name": "禁忌搜索优化模糊规则(规则排序优化)" - }, - { - "id": 33, - "name": "模糊关联规则(挖掘数据隐含关联)" - }, - { - "id": 34, - "name": "模糊产生式规则(if-then-else 拓展)" - }, - { - "id": 35, - "name": "模糊时序规则(处理时间序列数据)" - }, - { - "id": 36, - "name": "模糊空间规则(处理地理空间数据)" - }, - { - "id": 37, - "name": "模糊概率规则(融合概率分布)" - }, - { - "id": 38, - "name": "模糊可能性规则(基于可能性理论)" - }, - { - "id": 39, - "name": "模糊证据规则(融合 D-S 证据理论)" - }, - { - "id": 40, - "name": "直觉模糊规则(考虑隶属度与非隶属度)" - }, - { - "id": 41, - "name": "区间值模糊规则(隶属度为区间值)" - }, - { - "id": 42, - "name": "二型模糊规则(解决隶属度不确定性)" - }, - { - "id": 43, - "name": "区间二型模糊规则(二型模糊简化版)" - }, - { - "id": 44, - "name": "广义模糊规则(拓展隶属度函数空间)" - }, - { - "id": 45, - "name": "模糊逻辑控制规则(温控场景)" - }, - { - "id": 46, - "name": "模糊逻辑决策规则(金融风控场景)" - }, - { - "id": 47, - "name": "模糊逻辑分类规则(图像识别场景)" - }, - { - "id": 48, - "name": "模糊逻辑回归规则(预测场景)" - }, - { - "id": 49, - "name": "模糊规则插值(弥补规则库空缺)" - }, - { - "id": 50, - "name": "模糊规则约简(降低计算复杂度)" - }, - { - "id": 51, - "name": "三角隶属度 + 重心法模糊规则(经典组合)" - }, - { - "id": 52, - "name": "高斯隶属度 + 加权平均法模糊规则(高精度组合)" - }, - { - "id": 53, - "name": "梯形隶属度 + 最大隶属度法模糊规则(工业场景)" - }, - { - "id": 54, - "name": "钟形隶属度 + 中位数法模糊规则(平滑输出)" - }, - { - "id": 55, - "name": "多隶属度融合模糊规则(三角 + 高斯)" - }, - { - "id": 56, - "name": "分层模糊规则(多层级决策)" - }, - { - "id": 57, - "name": "并行模糊规则(多规则同步推理)" - }, - { - "id": 58, - "name": "串行模糊规则(规则链式推理)" - }, - { - "id": 59, - "name": "模糊规则库分级(核心规则 + 辅助规则)" - }, - { - "id": 60, - "name": "自适应隶属度模糊规则(动态调整参数)" - }, - { - "id": 61, - "name": "鲁棒模糊规则(抗数据噪声干扰)" - }, - { - "id": 62, - "name": "稀疏模糊规则(适用于高维数据)" - }, - { - "id": 63, - "name": "稠密模糊规则(适用于低维高精度场景)" - }, - { - "id": 64, - "name": "模糊规则可视化(规则库图形化)" - }, - { - "id": 65, - "name": "自然语言模糊规则(贴近人类表述)" - }, - { - "id": 66, - "name": "模糊数学规则(基于模糊集合运算)" - }, - { - "id": 67, - "name": "模糊矩阵规则(矩阵形式表示规则)" - }, - { - "id": 68, - "name": "模糊向量规则(向量空间映射规则)" - }, - { - "id": 69, - "name": "模糊变换规则(基于模糊线性变换)" - }, - { - "id": 70, - "name": "模糊阈值规则(设定模糊决策阈值)" - }, - { - "id": 71, - "name": "模糊滞后规则(处理系统滞后特性)" - }, - { - "id": 72, - "name": "模糊超前规则(预测系统未来状态)" - }, - { - "id": 73, - "name": "模糊自适应控制规则(机器人场景)" - }, - { - "id": 74, - "name": "模糊 PID 控制规则(工业过程控制)" - }, - { - "id": 75, - "name": "模糊滑模控制规则(非线性系统控制)" - }, - { - "id": 76, - "name": "模糊模型预测控制规则(多变量系统)" - }, - { - "id": 77, - "name": "模糊故障诊断规则(设备运维场景)" - }, - { - "id": 78, - "name": "模糊质量评估规则(产品检测场景)" - }, - { - "id": 79, - "name": "模糊信用评级规则(金融场景)" - }, - { - "id": 80, - "name": "模糊风险评估规则(项目管理场景)" - }, - { - "id": 81, - "name": "模糊图像分割规则(医学影像场景)" - }, - { - "id": 82, - "name": "模糊语音识别规则(语音处理场景)" - }, - { - "id": 83, - "name": "模糊文本分类规则(自然语言处理)" - }, - { - "id": 84, - "name": "模糊推荐规则(电商推荐场景)" - }, - { - "id": 85, - "name": "模糊聚类规则(客户分群场景)" - }, - { - "id": 86, - "name": "模糊特征选择规则(数据预处理场景)" - }, - { - "id": 87, - "name": "模糊异常检测规则(安防监控场景)" - }, - { - "id": 88, - "name": "模糊趋势预测规则(股市预测场景)" - }, - { - "id": 89, - "name": "模糊负荷预测规则(电力系统场景)" - }, - { - "id": 90, - "name": "模糊水文预报规则(水利工程场景)" - }, - { - "id": 91, - "name": "模糊气象预测规则(气象服务场景)" - }, - { - "id": 92, - "name": "模糊农业灌溉规则(智慧农业场景)" - }, - { - "id": 93, - "name": "模糊交通调度规则(智能交通场景)" - }, - { - "id": 94, - "name": "模糊物流优化规则(物流配送场景)" - }, - { - "id": 95, - "name": "模糊资源分配规则(企业管理场景)" - }, - { - "id": 96, - "name": "模糊人员调度规则(人力资源场景)" - }, - { - "id": 97, - "name": "模糊能耗优化规则(节能降耗场景)" - }, - { - "id": 98, - "name": "模糊环境监测规则(环保场景)" - }, - { - "id": 99, - "name": "模糊医疗诊断规则(临床医疗场景)" - }, - { - "id": 100, - "name": "模糊教育评估规则(教育教学场景)" - } -] \ No newline at end of file diff --git a/modeler/src/views/ai/model/rules/heuristic.json b/modeler/src/views/ai/model/rules/heuristic.json deleted file mode 100644 index 8c4b3ab..0000000 --- a/modeler/src/views/ai/model/rules/heuristic.json +++ /dev/null @@ -1,402 +0,0 @@ -[ - { - "id": 1, - "name": "基本爬山法(最速上升 / 下降)" - }, - { - "id": 2, - "name": "随机爬山法(随机选择邻域解)" - }, - { - "id": 3, - "name": "随机重启爬山法(避免局部最优)" - }, - { - "id": 4, - "name": "模拟退火算法(经典 Metropolis 准则)" - }, - { - "id": 5, - "name": "快速模拟退火算法(加速收敛)" - }, - { - "id": 6, - "name": "自适应模拟退火算法(动态调整温度)" - }, - { - "id": 7, - "name": "禁忌搜索算法(基本禁忌表)" - }, - { - "id": 8, - "name": "自适应禁忌搜索算法(动态调整禁忌长度)" - }, - { - "id": 9, - "name": "带藐视准则的禁忌搜索算法(优质解豁免)" - }, - { - "id": 10, - "name": "并行禁忌搜索算法(多线程搜索)" - }, - { - "id": 11, - "name": "遗传算法(基本选择 / 交叉 / 变异)" - }, - { - "id": 12, - "name": "二进制遗传算法(编码为二进制串)" - }, - { - "id": 13, - "name": "实数编码遗传算法(适用于连续优化)" - }, - { - "id": 14, - "name": "整数编码遗传算法(适用于离散优化)" - }, - { - "id": 15, - "name": "自适应遗传算法(动态调整交叉 / 变异概率)" - }, - { - "id": 16, - "name": "精英保留遗传算法(保留最优个体)" - }, - { - "id": 17, - "name": "并行遗传算法(多种群同步进化)" - }, - { - "id": 18, - "name": "混合遗传算法(融合局部搜索)" - }, - { - "id": 19, - "name": "多目标遗传算法(NSGA-II)" - }, - { - "id": 20, - "name": "多目标遗传算法(MOEA/D)" - }, - { - "id": 21, - "name": "粒子群优化算法(基本 PSO)" - }, - { - "id": 22, - "name": "标准粒子群优化算法(SPSO)" - }, - { - "id": 23, - "name": "惯性权重自适应粒子群优化(WPSO)" - }, - { - "id": 24, - "name": "压缩因子粒子群优化(CPSO)" - }, - { - "id": 25, - "name": "离散粒子群优化(适用于离散问题)" - }, - { - "id": 26, - "name": "二进制粒子群优化(BPSO)" - }, - { - "id": 27, - "name": "多目标粒子群优化(MOPSO)" - }, - { - "id": 28, - "name": "并行粒子群优化(PPSO)" - }, - { - "id": 29, - "name": "带变异操作的粒子群优化(避免早熟)" - }, - { - "id": 30, - "name": "蚁群优化算法(基本 ACO)" - }, - { - "id": 31, - "name": "蚁群系统(ACS)" - }, - { - "id": 32, - "name": "最大最小蚁群系统(MMAS)" - }, - { - "id": 33, - "name": "精英蚁群系统(EACS)" - }, - { - "id": 34, - "name": "离散蚁群优化(适用于 TSP 问题)" - }, - { - "id": 35, - "name": "连续蚁群优化(适用于连续优化)" - }, - { - "id": 36, - "name": "多目标蚁群优化(MOACO)" - }, - { - "id": 37, - "name": "蚁群 - 遗传混合优化算法" - }, - { - "id": 38, - "name": "灰狼优化算法(基本 GWO)" - }, - { - "id": 39, - "name": "自适应灰狼优化算法(AGWO)" - }, - { - "id": 40, - "name": "改进灰狼优化算法(融入局部搜索)" - }, - { - "id": 41, - "name": "多目标灰狼优化算法(MOGWO)" - }, - { - "id": 42, - "name": "离散灰狼优化算法(DGWO)" - }, - { - "id": 43, - "name": "麻雀搜索算法(基本 SSA)" - }, - { - "id": 44, - "name": "自适应麻雀搜索算法(ASSA)" - }, - { - "id": 45, - "name": "改进麻雀搜索算法(融入变异操作)" - }, - { - "id": 46, - "name": "多目标麻雀搜索算法(MOSSA)" - }, - { - "id": 47, - "name": "鲸鱼优化算法(基本 WOA)" - }, - { - "id": 48, - "name": "自适应鲸鱼优化算法(AWOA)" - }, - { - "id": 49, - "name": "改进鲸鱼优化算法(避免局部最优)" - }, - { - "id": 50, - "name": "多目标鲸鱼优化算法(MOWOA)" - }, - { - "id": 51, - "name": "蝴蝶优化算法(基本 BOA)" - }, - { - "id": 52, - "name": "自适应蝴蝶优化算法(ABOA)" - }, - { - "id": 53, - "name": "混合蝴蝶优化算法(融合 GA)" - }, - { - "id": 54, - "name": "萤火虫算法(基本 FA)" - }, - { - "id": 55, - "name": "自适应萤火虫算法(AFA)" - }, - { - "id": 56, - "name": "多目标萤火虫算法(MOFA)" - }, - { - "id": 57, - "name": "果蝇优化算法(基本 FOA)" - }, - { - "id": 58, - "name": "改进果蝇优化算法(修正距离计算)" - }, - { - "id": 59, - "name": "自适应果蝇优化算法(AFOA)" - }, - { - "id": 60, - "name": "蝙蝠算法(基本 BA)" - }, - { - "id": 61, - "name": "自适应蝙蝠算法(ABA)" - }, - { - "id": 62, - "name": "改进蝙蝠算法(融入惯性权重)" - }, - { - "id": 63, - "name": "多目标蝙蝠算法(MOBA)" - }, - { - "id": 64, - "name": "花授粉算法(基本 FPA)" - }, - { - "id": 65, - "name": "改进花授粉算法(自适应步长)" - }, - { - "id": 66, - "name": "多目标花授粉算法(MOFPA)" - }, - { - "id": 67, - "name": "差分进化算法(基本 DE)" - }, - { - "id": 68, - "name": "自适应差分进化算法(ADE)" - }, - { - "id": 69, - "name": "精英保留差分进化算法(EDE)" - }, - { - "id": 70, - "name": "多目标差分进化算法(MODE)" - }, - { - "id": 71, - "name": "人工蜂群算法(基本 ABC)" - }, - { - "id": 72, - "name": "改进人工蜂群算法(IABC)" - }, - { - "id": 73, - "name": "自适应人工蜂群算法(AABC)" - }, - { - "id": 74, - "name": "多目标人工蜂群算法(MOABC)" - }, - { - "id": 75, - "name": "人工鱼群算法(基本 AFSA)" - }, - { - "id": 76, - "name": "自适应人工鱼群算法(AAFSA)" - }, - { - "id": 77, - "name": "改进人工鱼群算法(避免局部最优)" - }, - { - "id": 78, - "name": "布谷鸟搜索算法(基本 CS)" - }, - { - "id": 79, - "name": "改进布谷鸟搜索算法(自适应发现概率)" - }, - { - "id": 80, - "name": "多目标布谷鸟搜索算法(MOCS)" - }, - { - "id": 81, - "name": "鸡群优化算法(基本 CSO)" - }, - { - "id": 82, - "name": "自适应鸡群优化算法(ACSO)" - }, - { - "id": 83, - "name": "改进鸡群优化算法(融入局部搜索)" - }, - { - "id": 84, - "name": "鸽群优化算法(基本 PIO)" - }, - { - "id": 85, - "name": "改进鸽群优化算法(修正地图与罗盘算子)" - }, - { - "id": 86, - "name": "多目标鸽群优化算法(MOPIO)" - }, - { - "id": 87, - "name": "蝗虫优化算法(基本 LOA)" - }, - { - "id": 88, - "name": "自适应蝗虫优化算法(ALOA)" - }, - { - "id": 89, - "name": "改进蝗虫优化算法(融合 PSO)" - }, - { - "id": 90, - "name": "蜻蜓算法(基本 DA)" - }, - { - "id": 91, - "name": "自适应蜻蜓算法(ADA)" - }, - { - "id": 92, - "name": "多目标蜻蜓算法(MODA)" - }, - { - "id": 93, - "name": "沙蚕群优化算法(基本 CSE)" - }, - { - "id": 94, - "name": "自适应沙蚕群优化算法(ACSE)" - }, - { - "id": 95, - "name": "改进沙蚕群优化算法(融入禁忌搜索)" - }, - { - "id": 96, - "name": "人工免疫系统(基本 AIS)" - }, - { - "id": 97, - "name": "克隆选择算法(CSA)" - }, - { - "id": 98, - "name": "免疫遗传算法(IGA)" - }, - { - "id": 99, - "name": "梯度启发式算法(融合梯度信息)" - }, - { - "id": 100, - "name": "混合启发式算法(GA+PSO+SA,多算法融合)" - } -] \ No newline at end of file diff --git a/modeler/src/views/ai/model/rules/neural.json b/modeler/src/views/ai/model/rules/neural.json deleted file mode 100644 index 9f74d8f..0000000 --- a/modeler/src/views/ai/model/rules/neural.json +++ /dev/null @@ -1,402 +0,0 @@ -[ - { - "id": 1, - "name": "基本 BP 神经网络(反向传播)" - }, - { - "id": 2, - "name": "多层 BP 神经网络(多隐藏层)" - }, - { - "id": 3, - "name": "自适应 BP 神经网络(动态调整学习率)" - }, - { - "id": 4, - "name": "弹性 BP 神经网络(RPROP)" - }, - { - "id": 5, - "name": "共轭梯度 BP 神经网络" - }, - { - "id": 6, - "name": "Levenberg-Marquardt BP 神经网络" - }, - { - "id": 7, - "name": "正则化 BP 神经网络(L1 正则)" - }, - { - "id": 8, - "name": "正则化 BP 神经网络(L2 正则)" - }, - { - "id": 9, - "name": "带 Dropout 的 BP 神经网络(防止过拟合)" - }, - { - "id": 10, - "name": "带 Batch Normalization 的 BP 神经网络(加速收敛)" - }, - { - "id": 11, - "name": "感知机(单层)" - }, - { - "id": 12, - "name": "多层感知机(MLP,基本型)" - }, - { - "id": 13, - "name": "深度多层感知机(DMLP,多隐藏层)" - }, - { - "id": 14, - "name": "稀疏多层感知机(稀疏权重)" - }, - { - "id": 15, - "name": "正则化多层感知机(L1+L2 正则)" - }, - { - "id": 16, - "name": "卷积神经网络(LeNet-5,经典入门)" - }, - { - "id": 17, - "name": "卷积神经网络(AlexNet,深度学习里程碑)" - }, - { - "id": 18, - "name": "卷积神经网络(VGG16,深度卷积)" - }, - { - "id": 19, - "name": "卷积神经网络(VGG19,更深卷积)" - }, - { - "id": 20, - "name": "卷积神经网络(GoogLeNet/Inception v1,多分支结构)" - }, - { - "id": 21, - "name": "卷积神经网络(Inception v2,批量归一化)" - }, - { - "id": 22, - "name": "卷积神经网络(Inception v3,优化结构)" - }, - { - "id": 23, - "name": "卷积神经网络(Inception v4,融合 ResNet)" - }, - { - "id": 24, - "name": "残差网络(ResNet18,残差连接)" - }, - { - "id": 25, - "name": "残差网络(ResNet34,更深残差)" - }, - { - "id": 26, - "name": "残差网络(ResNet50,瓶颈结构)" - }, - { - "id": 27, - "name": "残差网络(ResNet101,深层模型)" - }, - { - "id": 28, - "name": "残差网络(ResNet152,超深层模型)" - }, - { - "id": 29, - "name": "改进残差网络(ResNeXt,分组卷积)" - }, - { - "id": 30, - "name": "密集连接网络(DenseNet,密集连接)" - }, - { - "id": 31, - "name": "轻量级卷积网络(MobileNet v1,深度可分离卷积)" - }, - { - "id": 32, - "name": "轻量级卷积网络(MobileNet v2,倒残差结构)" - }, - { - "id": 33, - "name": "轻量级卷积网络(MobileNet v3,神经架构搜索)" - }, - { - "id": 34, - "name": "轻量级卷积网络(ShuffleNet v1,通道混洗)" - }, - { - "id": 35, - "name": "轻量级卷积网络(ShuffleNet v2,高效结构)" - }, - { - "id": 36, - "name": "循环神经网络(RNN,基本型)" - }, - { - "id": 37, - "name": "循环神经网络(Elman RNN,局部反馈)" - }, - { - "id": 38, - "name": "循环神经网络(Jordan RNN,全局反馈)" - }, - { - "id": 39, - "name": "长短期记忆网络(LSTM,基本型,解决梯度消失)" - }, - { - "id": 40, - "name": "门控循环单元(GRU,简化 LSTM)" - }, - { - "id": 41, - "name": "双向 LSTM(Bi-LSTM,双向时序学习)" - }, - { - "id": 42, - "name": "双向 GRU(Bi-GRU,双向简化时序学习)" - }, - { - "id": 43, - "name": "堆叠 LSTM(Stacked LSTM,多层 LSTM)" - }, - { - "id": 44, - "name": "堆叠 GRU(Stacked GRU,多层 GRU)" - }, - { - "id": 45, - "name": "带 Dropout 的 LSTM(防止过拟合)" - }, - { - "id": 46, - "name": "带 Batch Normalization 的 LSTM(加速收敛)" - }, - { - "id": 47, - "name": "长短期记忆网络(LSTM-LN,层归一化)" - }, - { - "id": 48, - "name": "门控循环单元(GRU-LN,层归一化)" - }, - { - "id": 49, - "name": "时序卷积网络(TCN,替代 RNN 处理时序)" - }, - { - "id": 50, - "name": "双向时序卷积网络(Bi-TCN)" - }, - { - "id": 51, - "name": "变压器网络(Transformer,注意力机制)" - }, - { - "id": 52, - "name": "迷你 Transformer(轻量级,适用于小数据)" - }, - { - "id": 53, - "name": "双向 Transformer(Bi-Transformer)" - }, - { - "id": 54, - "name": "预训练 Transformer(BERT,自然语言处理)" - }, - { - "id": 55, - "name": "预训练 Transformer(GPT,生成式模型)" - }, - { - "id": 56, - "name": "自编码器(AE,基本型,无监督学习)" - }, - { - "id": 57, - "name": "稀疏自编码器(Sparse AE,稀疏隐藏层)" - }, - { - "id": 58, - "name": "降噪自编码器(Denoising AE,抗噪声)" - }, - { - "id": 59, - "name": "卷积自编码器(Convolutional AE,处理图像)" - }, - { - "id": 60, - "name": "循环自编码器(Recurrent AE,处理时序)" - }, - { - "id": 61, - "name": "变分自编码器(VAE,生成式模型)" - }, - { - "id": 62, - "name": "深度变分自编码器(Deep VAE)" - }, - { - "id": 63, - "name": "生成对抗网络(GAN,基本型,生成式模型)" - }, - { - "id": 64, - "name": "深度卷积 GAN(DCGAN,处理图像)" - }, - { - "id": 65, - "name": "条件 GAN(CGAN,带条件约束)" - }, - { - "id": 66, - "name": "循环 GAN(CycleGAN,风格迁移)" - }, - { - "id": 67, - "name": "生成式对抗网络(WGAN,改进损失函数)" - }, - { - "id": 68, - "name": "生成式对抗网络(WGAN-GP,梯度惩罚)" - }, - { - "id": 69, - "name": "径向基函数神经网络(RBF,局部逼近)" - }, - { - "id": 70, - "name": "正交径向基函数神经网络(Orthogonal RBF)" - }, - { - "id": 71, - "name": "自适应径向基函数神经网络(Adaptive RBF)" - }, - { - "id": 72, - "name": "小波神经网络(WNN,融合小波变换)" - }, - { - "id": 73, - "name": "自适应小波神经网络(Adaptive WNN)" - }, - { - "id": 74, - "name": "模糊神经网络(FNN,融合模糊逻辑)" - }, - { - "id": 75, - "name": "神经模糊网络(NFN,模糊与神经深度融合)" - }, - { - "id": 76, - "name": "支持向量机神经网络(SVM-NN,融合 SVM)" - }, - { - "id": 77, - "name": "极限学习机(ELM,单隐藏层,快速训练)" - }, - { - "id": 78, - "name": "深度极限学习机(DELM,多隐藏层)" - }, - { - "id": 79, - "name": "正则化极限学习机(Regularized ELM)" - }, - { - "id": 80, - "name": "带 Dropout 的极限学习机(Dropout ELM)" - }, - { - "id": 81, - "name": "图神经网络(GNN,处理图结构数据)" - }, - { - "id": 82, - "name": "图卷积网络(GCN,卷积操作拓展到图)" - }, - { - "id": 83, - "name": "图注意力网络(GAT,注意力机制拓展到图)" - }, - { - "id": 84, - "name": "图循环网络(GRN,循环操作拓展到图)" - }, - { - "id": 85, - "name": "深度图卷积网络(Deep GCN)" - }, - { - "id": 86, - "name": "胶囊网络(CapsNet,替代卷积处理空间关系)" - }, - { - "id": 87, - "name": "深度胶囊网络(Deep CapsNet)" - }, - { - "id": 88, - "name": "注意力机制神经网络(Attention-NN,通用注意力)" - }, - { - "id": 89, - "name": "自注意力神经网络(Self-Attention-NN)" - }, - { - "id": 90, - "name": "多头注意力神经网络(Multi-Head Attention-NN)" - }, - { - "id": 91, - "name": "强化学习神经网络(DQN,深度 Q 网络)" - }, - { - "id": 92, - "name": "强化学习神经网络(DDQN,双重 DQN)" - }, - { - "id": 93, - "name": "强化学习神经网络(Dueling DQN,竞争网络)" - }, - { - "id": 94, - "name": "强化学习神经网络(PPO,近端策略优化)" - }, - { - "id": 95, - "name": "迁移学习神经网络(Transfer-NN,迁移预训练权重)" - }, - { - "id": 96, - "name": "联邦学习神经网络(Federated-NN,隐私保护)" - }, - { - "id": 97, - "name": "增量学习神经网络(Incremental-NN,持续学习)" - }, - { - "id": 98, - "name": "在线学习神经网络(Online-NN,实时更新)" - }, - { - "id": 99, - "name": "鲁棒神经网络(Robust-NN,抗噪声与攻击)" - }, - { - "id": 100, - "name": "轻量化神经网络(Lightweight-NN,适用于嵌入式设备)" - } -] \ No newline at end of file diff --git a/modeler/src/views/ai/model/types/types.ts b/modeler/src/views/ai/model/types/types.ts deleted file mode 100644 index 18fe803..0000000 --- a/modeler/src/views/ai/model/types/types.ts +++ /dev/null @@ -1,205 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import type { ApiDataResponse, NullableString, PageableResponse } from '@/types'; -import type { DraggableElement } from '../../builder/element'; - -// 模型 -export interface Model { - id: number; - // 所属工程ID - projectId: number | undefined; - // 项目名称 - projectSpaceName: NullableString; - // 模型名称 - name: NullableString; - // 模型描述 - description: NullableString; - // 存储位置 - storageLocation: NullableString; - // 配置信息(JSON格式) - configInfo: NullableString; - // 状态 - status: number; - // 创建时间 - createTime: NullableString; - - [key: string]: unknown; -} - -export interface ModelResult extends ApiDataResponse { - - [key: string]: unknown; -} - -export interface ModelQueryResult extends PageableResponse { - - [key: string]: unknown; -} - -// 网络模型组件 -export interface NetworkModel { - id: number; - // 网络模型名称 - name: NullableString; - // 网络类型(如:mlp) - type: NullableString; - // 输入维度 - inputDim: number; - // 隐藏层大小(JSON数组格式,如:[256, 256, 128, 64]) - hiddenSizes: NullableString; - // 输出维度 - outputDim: number; - // 激活函数(如:relu) - activation: NullableString; - // 状态(1=正常,0=已删除) - status: number; - - [key: string]: unknown; -} - -export interface NetworkModelResult extends ApiDataResponse { - - [key: string]: unknown; -} - -// 观测类型 -export interface ObservationType { - id: number; - // 观测类型代码 - typeCode: NullableString; - // 观测类型名称 - typeName: NullableString; - // 字段类型 - fieldType: NullableString; - // 描述 - description: NullableString; - // 排序号 - sortOrder: number; - // 状态(1=正常,0=已删除 - status: number; - - [key: string]: unknown; -} - -export interface ObservationTypeResult extends PageableResponse { - - [key: string]: unknown; -} - -// 奖励设计 -export interface RewardDesign { - id: number; - // 奖励名称 - name: NullableString; - // 奖励代码 - rewardCode: NullableString; - // 奖励值 - reward: NullableString; - // 排序 - orderIndex: number; - // 说明 - description: NullableString; - // 组件ID - componentId: number; - // 状态(1=正常,0=已删除 - status: number; -} - -export interface RewardDesignResult extends PageableResponse { - data: RewardDesign[]; - - [key: string]: unknown; -} - -export interface ModelActionEntryAngleRange { - min: number; - max: number; -} - -export interface ModelActionEntryAngle { - // 俯仰角 - pitch?: ModelActionEntryAngleRange; - // 偏航角 - yaw?: ModelActionEntryAngleRange; - // 滚转角 - roll: ModelActionEntryAngleRange; - - [key: string]: unknown; -} - -export type ModelActionEntryArgs = ModelActionEntryAngle & Record; - -export interface ModelActionSpace { - // 动作实体 - entry: NullableString; - // 动作类型 - type: NullableString; - // 动作参数 - args: ModelActionEntryArgs; - - [key: string]: unknown; -} - -// 模型参数设置 -export interface ModelParameters { - // 隐藏纬度 - hiddenLatitude: NullableString; - // 激活函数 - activationFunction: NullableString; - - [key: string]: unknown; -} - -export interface ModelElementPosition { - x: number; - y: number; -} - -export type ModelElementStatus = 'default' | 'success' | 'failed' | 'running' | string | null - -export interface ModelBaseElement { - key: string; - name: string; - type: string; - width: number; - height: number; - position: ModelElementPosition; - category: NullableString; - element?: DraggableElement; - - [key: string]: unknown; -} - -export interface ModelElementEdge { - key: NullableString; - sourceKey: NullableString; - sourceName: NullableString; - targetKey: NullableString; - targetName: NullableString; -} - - -export interface ModelElement extends ModelBaseElement { - // 连线 - edges: ModelElementEdge[]; - // 模型参数设置 - parameters: ModelParameters; -} - -export interface SavedGraphData { - nodes: ModelElement[]; - edges: any[]; - // 观测类型 - observations: ObservationType[]; - // 奖励设计 - rewards: RewardDesign[]; - // 动作空间 - actionSpaces: ModelActionSpace[]; -} diff --git a/modeler/src/views/ai/model/utils.ts b/modeler/src/views/ai/model/utils.ts deleted file mode 100644 index b13893e..0000000 --- a/modeler/src/views/ai/model/utils.ts +++ /dev/null @@ -1,127 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import type { ModelElement } from './types'; -import { generateKey } from '@/utils/strings'; -import type { DraggableElement } from '../builder/element'; -import { createPorts } from '../builder/ports'; - -export const createNodePorts = (element: ModelElement): any => { - // 获取子元素数量,做更严谨的空值处理 - const childrenLength = element.element?.children?.length ?? 0; - - // 如果是组件类型、无分类或者无子元素,返回默认空连接桩 - if (element.category === 'component' || !element.category || childrenLength === 0) { - return createPorts(); - } - - return createPorts(); - - // // 存储分组配置和连接桩项 - // const groups: Record = {}; - // const items: Array<{ id: string; group: string }> = []; - // - // // 循环生成对应数量的左右侧连接桩 - // for (let i = 0; i < childrenLength; i++) { - // // 1. 左侧连接桩:使用X6支持的'left'作为位置名称,args配置偏移量(可选) - // const leftGroupKey = `left_port_group_${i}`; - // groups[leftGroupKey] = createPort('left', { dx: 0, dy: (i - (childrenLength - 1) / 2) * 20 + i + 10 }); - // // dy偏移量:让多个左侧连接桩垂直均匀分布,20是间距,可根据需求调整 - // - // // 2. 右侧连接桩:使用X6支持的'right'作为位置名称 - // const rightGroupKey = `right_port_group_${i}`; - // groups[rightGroupKey] = createPort('right', { dx: 0, dy: (i - (childrenLength - 1) / 2) * 20 + i + 10 }); - // - // // 生成左侧连接桩项(唯一ID) - // items.push({ - // id: `left_port_${i}`, - // group: leftGroupKey - // }); - // - // // 生成右侧连接桩项(唯一ID) - // items.push({ - // id: `right_port_${i}`, - // group: rightGroupKey - // }); - // } - // - // // 返回最终的连接桩配置 - // return { - // groups, - // items - // }; -}; - -export const defaultHeight: Record = { - component: 110, - // action: 80, - // task: 80, - // control: 110, -} - -export const createModelNode = (element: ModelElement, width: number = 250, height: number = 120): any => { - let realHeight = defaultHeight[element.category as string]; - if(!realHeight){ - realHeight = 110; - } - if(element?.element?.children){ - if(element.element?.children?.length > 4){ - realHeight = element.element?.children?.length * 35 - } else if(element.element?.children?.length <=1){ - realHeight = 100 - } - } - // if ('action' === element.category) { - // realHeight = 40; - // width = 140; - // } - return { - shape: element.type ?? 'model', - id: element.key, - position: { - x: element.position?.x || 0, - y: element.position?.y || 0, - }, - size: { - width: width, - height: realHeight, - }, - attrs: { - label: { - text: element.name, - }, - }, - data: element, - // ports: createNodePorts(element), - }; -}; - -export const createDraggableElement = (data: DraggableElement, x: number, y: number): ModelElement => { - return { - key: generateKey('model'), - type: 'model', - name: data.name || '', - element: data, - width: 250, - height: 120, - position: { - x, - y, - }, - category: data.category ?? 'component', - edges: [], - actionSpaces: [], - observations: [], - rewards: [], - parameters: { - hiddenLatitude: null, - activationFunction: 'relu', - }, - } as ModelElement; -}; \ No newline at end of file diff --git a/modeler/src/views/ai/project/api.ts b/modeler/src/views/ai/project/api.ts deleted file mode 100644 index d6559c1..0000000 --- a/modeler/src/views/ai/project/api.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import request from '@/utils/request'; -import type { Project, ProjectConfig, ProjectConfigResult, ProjectQueryResult, ResourceTemplate, ResourceTemplateResult } from './types'; -import type { ApiDataResponse, BasicResponse } from '@/types'; - -export const findProjectByQuery = (query: Partial = {}): Promise => { - return request.get('/projectSpace/list', query); -}; - -export const findAllProjects = (): Promise> => { - return request.get>('/projectSpace/all'); -}; - -export const createProjectConfig = (project: ProjectConfig): Promise => { - return request.postJson('/projectSpace/config', project); -}; - -export const updateProject = (project: Project): Promise => { - return request.putJson('/projectSpace/edit', project); -}; - -export const deleteProjectById = (id: number | string): Promise => { - return request.delete(`/projectSpace/logic/${id}`); -}; - -export const findAllResourceTemplates = (): Promise => { - return request.get('/resourceTemplate/all'); -}; - -export const findResourceTemplateByQuery = (query: Partial): Promise => { - return request.get('/resourceTemplate/list', query); -}; - -export const createResourceTemplate = (rt: Partial): Promise => { - return request.postJson('/resourceTemplate/add', rt); -}; - -export const updateResourceTemplate = (rt: Partial): Promise => { - return request.putJson('/resourceTemplate/edit', rt); -}; - -export const deleteResourceTemplate = (id: number): Promise => { - return request.delete(`/resourceTemplate/logic/${id}`); -}; \ No newline at end of file diff --git a/modeler/src/views/ai/project/config.ts b/modeler/src/views/ai/project/config.ts deleted file mode 100644 index 440c72f..0000000 --- a/modeler/src/views/ai/project/config.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import type { Project, ProjectConfig, ResourceTemplate } from './types'; - -export const projectColumns = [ - { - title: '序号', - dataIndex: 'index', - key: 'index', - }, - { - title: '名称', - dataIndex: 'name', - key: 'name', - }, - { - title: '训练实例数', - dataIndex: 'trainingInstanceCount', - key: 'trainingInstanceCount', - }, - { - title: '场景类型', - dataIndex: 'scene', - key: 'scene', - }, - // { - // title: '状态', - // dataIndex: 'status', - // key: 'status', - // }, - { - title: '描述', - dataIndex: 'description', - key: 'description', - }, - { - title: '操作', - dataIndex: '_actions', - key: '_actions', - width: 100, - }, -]; - -export const resourceTemplateColumns = [ - { - title: '序号', - dataIndex: 'index', - key: 'index', - }, - { - title: '名称', - dataIndex: 'name', - key: 'name', - }, - { - title: 'CPU数量配置', - dataIndex: 'cpuConfig', - key: 'cpuConfig', - }, - { - title: 'GPU数量配置', - dataIndex: 'gpuConfig', - key: 'gpuConfig', - }, - { - title: '存储资源配置', - dataIndex: 'storageConfig', - key: 'storageConfig', - }, - { - title: '状态', - dataIndex: 'status', - key: 'status', - }, - { - title: '操作', - dataIndex: '_actions', - key: '_actions', - }, -]; - -export const defaultProject: Project = { - id: 0, - name: null, - scene: 1, - trainingInstanceCount: 0, - description: null, - status: 1, -}; - -export const defaultResourceTemplate: ResourceTemplate = { - id: 0, - name: null, - projectSpaceId: null, - cpuConfig: null, - gpuConfig: null, - storageConfig: null, - status: 1, // 1=正常,0=已删除 -}; - -export const defaultProjectConfig: ProjectConfig = { - id: 0, - projectSpaceId: null, - genConfigId: null, - projectName: null, - taskName: null, - scenarioName: null, - storageLocation: null, - description: null, - trainingInstanceCount: null, - resourceTemplateId: undefined, -}; diff --git a/modeler/src/views/ai/project/config.vue b/modeler/src/views/ai/project/config.vue deleted file mode 100644 index 4064886..0000000 --- a/modeler/src/views/ai/project/config.vue +++ /dev/null @@ -1,256 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/project/create-v1.vue b/modeler/src/views/ai/project/create-v1.vue deleted file mode 100644 index ea84844..0000000 --- a/modeler/src/views/ai/project/create-v1.vue +++ /dev/null @@ -1,208 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/project/create.vue b/modeler/src/views/ai/project/create.vue deleted file mode 100644 index 267e2f2..0000000 --- a/modeler/src/views/ai/project/create.vue +++ /dev/null @@ -1,190 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/project/management.vue b/modeler/src/views/ai/project/management.vue deleted file mode 100644 index bfc3b08..0000000 --- a/modeler/src/views/ai/project/management.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/project/project-lists.vue b/modeler/src/views/ai/project/project-lists.vue deleted file mode 100644 index 84a691f..0000000 --- a/modeler/src/views/ai/project/project-lists.vue +++ /dev/null @@ -1,154 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/project/resource-templates.vue b/modeler/src/views/ai/project/resource-templates.vue deleted file mode 100644 index fcde388..0000000 --- a/modeler/src/views/ai/project/resource-templates.vue +++ /dev/null @@ -1,178 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/project/types.ts b/modeler/src/views/ai/project/types.ts deleted file mode 100644 index c182895..0000000 --- a/modeler/src/views/ai/project/types.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import type { ApiDataResponse, BasicResponse, NullableString, PageableResponse } from '@/types'; - -// 工程 -export interface Project { - id: number; - name: NullableString; - scene: number; // 1=运行,2=停止 - trainingInstanceCount: number; // 训练实例数 - description: NullableString; // 描述 - status: number; // 1=正常,0=停用 - [key: string]: unknown; -} - - -export interface ProjectQueryResult extends PageableResponse { - - [key: string]: unknown; -} - -export interface ProjectConfig { - id: number; - projectSpaceId: number | null; - genConfigId: number | null; - projectName: NullableString; - taskName: NullableString; - scenarioName: NullableString; - storageLocation: NullableString; - description: NullableString; - trainingInstanceCount: number | null; - resourceTemplateId: number | undefined | null; - - [key: string]: unknown; -} - -export interface ProjectConfigResult extends BasicResponse { - - [key: string]: unknown; -} - - -// 资源模版 -export interface ResourceTemplate { - id: number; - projectSpaceId: number | null; - name: NullableString; - cpuConfig: NullableString; - gpuConfig: NullableString; - storageConfig: NullableString; - status: number; // 1=正常,0=已删除 - [key: string]: unknown; -} - -export interface ResourceTemplateResult extends ApiDataResponse { - - [key: string]: unknown; -} \ No newline at end of file diff --git a/modeler/src/views/ai/project/workspace.vue b/modeler/src/views/ai/project/workspace.vue deleted file mode 100644 index 381edc3..0000000 --- a/modeler/src/views/ai/project/workspace.vue +++ /dev/null @@ -1,278 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/router.ts b/modeler/src/views/ai/router.ts deleted file mode 100644 index 4db3bd6..0000000 --- a/modeler/src/views/ai/router.ts +++ /dev/null @@ -1,178 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import {type RouteRecordRaw, type RouteRecordRedirect} from 'vue-router'; - -export const routers: RouteRecordRaw[] = [ - { - name: 'index', - path: '/', - redirect: '/app/ai/project/management', - meta: { - hidden: true, - }, - } as RouteRecordRedirect, - - { - name: 'signin', - path: '/signin', - meta: { - title: '登录', - }, - component: () => import('@/views/signin.vue') - }, - - { - path: '/', - meta: { - title: '工程空间', - }, - children: [ - { - name: 'ai-project-management', - path: '/app/ai/project/management', - meta: { - title: '工程管理', - }, - component: () => import('@/views/ai/project/management.vue') - }, - { - name: 'ai-project-create', - path: '/app/ai/project/create', - meta: { - title: '新建/自定义', - hidden: true, - }, - component: () => import('@/views/ai/project/create.vue') - }, - { - name: 'ai-project-workspace', - path: '/app/ai/project/workspace', - meta: { - title: '工程空间详情', - hidden: true, - }, - component: () => import('@/views/ai/project/workspace.vue') - }, - { - name: 'ai-training-task-monitor', - path: '/app/ai/training/task/monitor', - meta: { - title: '训练任务监控', - hidden: true, - }, - component: () => import('@/views/ai/training/task-monitor.vue') - }, - { - name: 'ai-training-resources-monitor', - path: '/app/ai/training/resources/monitor', - meta: { - title: '训练资源监控', - hidden: true, - }, - component: () => import('@/views/ai/training/resource-monitor.vue') - }, - { - name: 'ai-project-config', - path: '/app/ai/project/config', - meta: { - hidden: true, - }, - component: () => import('@/views/ai/project/config.vue') - }, - - ] - }, - - - { - path: '/', - meta: { - title: '模型构建', - }, - children: [ - { - name: 'ai-model-management', - path: '/app/ai/model/management', - meta: { - title: '模型管理', - }, - component: () => import('@/views/ai/model/management.vue') - }, - { - name: 'ai-model-builder-designer', - path: '/app/ai/model/builder/:id/designer', - meta: { - title: '模型构建', - }, - component: () => import('@/views/ai/model/builder.vue') - }, - { - name: 'ai-model-components', - path: '/app/ai/model/components', - meta: { - title: '模型组件设置', - }, - component: () => import('@/views/ai/model/components.vue') - }, - ] - }, - - { - path: '/', - meta: { - title: '模型训练', - }, - children: [ - { - name: 'ai-model-task-management', - path: '/app/ai/training/task/management', - meta: { - title: '任务管理', - }, - component: () => import('@/views/ai/training/task-management.vue') - }, - { - name: 'ai-training-task-configurer', - path: '/app/ai/training/task/configurer', - meta: { - title: '训练任务配置', - }, - component: () => import('@/views/ai/training/task-configurer.vue') - }, - ] - }, - - { - path: '/', - meta: { - title: '模型应用', - }, - children: [ - { - name: 'ai-applications-gambling', - path: '/app/ai/applications/gambling', - meta: { - title: '模型部署与推理', - }, - component: () => import('@/views/ai/applications/gambling.vue') - }, - { - name: 'ai-applications-gambling-charts', - path: '/app/ai/applications/gambling/:id/charts', - meta: { - title: '模型部署与推理', - }, - component: () => import('@/views/ai/applications/charts/charts.vue') - } - ] - }, - - -] \ No newline at end of file diff --git a/modeler/src/views/ai/sidebar.vue b/modeler/src/views/ai/sidebar.vue deleted file mode 100644 index eb7f3e4..0000000 --- a/modeler/src/views/ai/sidebar.vue +++ /dev/null @@ -1,207 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/training/api.ts b/modeler/src/views/ai/training/api.ts deleted file mode 100644 index 4361fc0..0000000 --- a/modeler/src/views/ai/training/api.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - - -import type { TrainingAlgorithmResult, TrainingMethodResult, TrainingTask, TrainingTaskConfig, TrainingTaskResult } from './types'; -import request from '@/utils/request'; -import type { BasicResponse } from '@/types'; - -export const deleteTask = (id: number | string): Promise => { - return request.delete(`/trainTask/logic/${id}`); -}; - -export const findTrainingTaskByQuery = (query: Partial = {}): Promise => { - return request.get('/trainTask/list', query); -}; - -export const createTrainingTask = (rt: Partial): Promise => { - return request.postJson('/trainTask/add', rt); -}; - -export const updateTrainingTask = (rt: Partial): Promise => { - return request.putJson('/trainTask/edit', rt); -}; - -export const configTrainingTask = (rt: Partial): Promise => { - return request.postJson('/trainTask/config', rt); -}; - -export const findTrainingMethods = (): Promise => { - return request.get('/trainingMethod/list'); -}; - -export const findTrainingAlgorithms = (): Promise => { - return request.get('/algorithm/list'); -}; diff --git a/modeler/src/views/ai/training/config.ts b/modeler/src/views/ai/training/config.ts deleted file mode 100644 index 1689227..0000000 --- a/modeler/src/views/ai/training/config.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import type { TableColumnType } from 'ant-design-vue'; -import type { Hyperparameter, TrainingResource, TrainingTask, TrainingTaskConfig } from './types'; - -export const trainingTaskColumns: TableColumnType[] = [ - { - title: '序号', - dataIndex: 'index', - key: 'index', - }, - { - title: '任务名称', - dataIndex: 'taskName', - key: 'name', - }, - { - title: '运行状态', - dataIndex: 'runStatus', - key: 'runStatus', - }, - { - title: '版本信息', - dataIndex: 'versionInfo', - key: 'versionInfo', - }, - { - title: '任务描述', - dataIndex: 'description', - key: 'description', - }, - { - title: '操作', - dataIndex: '_actions', - key: '_actions', - width: 100, - }, -]; - -export const defaultTrainingTask: TrainingTask = { - id: null, - taskName: null, - versionInfo: null, - description: null, - modelId: undefined, - modelName: null, - modelPath: null, - algorithmId: null, - algorithmCode: null, - trainingMethodId: null, - trainingMethodCode: null, - relatedTaskId: null, - evaluationMetricSystem: null, - runStatus: 0, - status: 1, -}; - -export const defaultHyperparameter: Hyperparameter = { - id: null, - dataCount: 0, - epoch: 0, - iterations: 0, - learningRate: null, -}; - -export const defaultTrainingResource: TrainingResource = { - id: null, - resourcePoolType: null, - specification: null, - computeNodeCount: 0, - simulationType: 'afsim', - deduceMultiple: 0, -}; - -export const defaultTrainingTaskConfig: TrainingTaskConfig = { - trainTask: Object.assign({}, defaultTrainingTask), - hyperparameter: Object.assign({}, defaultHyperparameter), - trainResource: Object.assign({}, defaultTrainingResource), -}; diff --git a/modeler/src/views/ai/training/resource-monitor.vue b/modeler/src/views/ai/training/resource-monitor.vue deleted file mode 100644 index 2e9622e..0000000 --- a/modeler/src/views/ai/training/resource-monitor.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/training/task-configurer.vue b/modeler/src/views/ai/training/task-configurer.vue deleted file mode 100644 index 244352d..0000000 --- a/modeler/src/views/ai/training/task-configurer.vue +++ /dev/null @@ -1,512 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/training/task-management.vue b/modeler/src/views/ai/training/task-management.vue deleted file mode 100644 index 085591e..0000000 --- a/modeler/src/views/ai/training/task-management.vue +++ /dev/null @@ -1,181 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/training/task-monitor.vue b/modeler/src/views/ai/training/task-monitor.vue deleted file mode 100644 index d60235e..0000000 --- a/modeler/src/views/ai/training/task-monitor.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/ai/training/types.ts b/modeler/src/views/ai/training/types.ts deleted file mode 100644 index 48a886c..0000000 --- a/modeler/src/views/ai/training/types.ts +++ /dev/null @@ -1,139 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import type { BasicResponse, NullableString, PageableResponse } from '@/types'; - -// 超参设置 -export interface Hyperparameter { - id: number | null; - // 数据条数 - dataCount: number; - // 迭代轮次/Epoch - epoch: number; - // 迭代步数/Iterations - iterations: number; - // 学习率/learning_rate - learningRate: NullableString; - - [key: string]: unknown; -} - - -// 训练资源配置 -export interface TrainingResource { - id: number | null; - // 资源池类型 - resourcePoolType: NullableString; - // 规格 - specification: NullableString; - // 计算节点个数 - computeNodeCount: number; - // 仿真容器类型选择 - simulationType: NullableString; - // 推演倍数 - deduceMultiple: number; - - [key: string]: unknown; -} - -// 训练任务配置 -export interface TrainingTaskConfig { - // 训练任务信息 - trainTask: TrainingTask; - // 超参设置 - hyperparameter: Hyperparameter; - // 训练资源配置 - trainResource: TrainingResource; - - [key: string]: unknown; - -} - -export interface TrainingTaskConfigResult extends BasicResponse { - - [key: string]: unknown; -} - -// 训练方法 -export interface TrainingMethod { - id: number; - methodName: NullableString; - methodCode: NullableString; - description: NullableString; - status: number; - - [key: string]: unknown; -} - -export interface TrainingMethodResult extends PageableResponse { - - [key: string]: unknown; -} - -// 算法 -export interface TrainingAlgorithm { - id: number; - // 算法名称 - algorithmName: NullableString; - // 算法代码(英文名称,如PPO、FULL_FINETUNE、LORA等) - algorithmCode: NullableString; - // 算法类型(如:微调、预训练、强化学习等 - algorithmType: NullableString; - // 算法描述 - description: NullableString; - - [key: string]: unknown; -} - -export interface TrainingAlgorithmResult extends PageableResponse { - - [key: string]: unknown; -} - - -export interface TrainingTask { - // 主键ID - id: number | null; - // 任务名称 - taskName: NullableString; - // 版本信息 - versionInfo: NullableString; - // 描述 - description: NullableString; - // 模型ID - modelId: number | undefined; - // 模型名称 - modelName: NullableString; - // 模型路径 - modelPath: NullableString; - // 算法表ID - algorithmId: number | null; - // 算法表code - algorithmCode: NullableString; - // 训练方法ID - trainingMethodId: number | null; - // 训练方法code - trainingMethodCode: NullableString; - // 关联任务ID - relatedTaskId: NullableString; - // 评估指标体系 - evaluationMetricSystem: NullableString; - // 运行状态(0=停止,1=运行中) - runStatus: number; - // 状态(1=正常,0=已删除) - status: number; - ip?: NullableString; - port?:NullableString; - [key: string]: unknown; -} - -export interface TrainingTaskResult extends PageableResponse { - - [key: string]: unknown; -} diff --git a/modeler/src/views/ai/types.ts b/modeler/src/views/ai/types.ts deleted file mode 100644 index 3cc3190..0000000 --- a/modeler/src/views/ai/types.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import type { ApiDataResponse, NullableString } from '@/types'; - -export interface FinderBrowser { - name: NullableString, - path: string, - directory: boolean, - children: FinderBrowser[] -} - -export interface FinderBrowserResult extends ApiDataResponse { - -} - -export interface DeductionTestResponse extends ApiDataResponse { - -} \ No newline at end of file diff --git a/modeler/src/views/behaviour/config.ts b/modeler/src/views/behaviour/config.ts deleted file mode 100644 index 5092819..0000000 --- a/modeler/src/views/behaviour/config.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -export const menuMap = [ - { - key: '0', - title: '指挥决策规则库管理', - path: '/app/behaviour/rules', - }, -]; \ No newline at end of file diff --git a/modeler/src/views/behaviour/graph/element.ts b/modeler/src/views/behaviour/graph/element.ts deleted file mode 100644 index bbc7b4d..0000000 --- a/modeler/src/views/behaviour/graph/element.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import type { NullableString } from '@/types'; -import type { ModelParameters } from '@/views/ai/model/types'; - -export interface DraggableElement { - id: number | null, - key?: NullableString, - name: NullableString, - description: NullableString, - category: NullableString, - draggable: boolean, - parent?: DraggableElement, - children: DraggableElement[] - [key: string]: unknown; -} - -export interface ModelElementPosition { - x: number; - y: number; -} - -export interface ModelElementEdge { - key: NullableString; - sourceKey: NullableString; - sourceName: NullableString; - targetKey: NullableString; - targetName: NullableString; -} - -export interface ModelBaseElement { - key: string; - name: string; - type: string; - width: number; - height: number; - position: ModelElementPosition; - category: NullableString; - element?: DraggableElement; - - [key: string]: unknown; -} - -export interface ModelElement extends ModelBaseElement { - // 连线 - edges: ModelElementEdge[]; - // 模型参数设置 - parameters: ModelParameters; -} - -export interface SavedGraphData { - nodes: ModelElement[]; - edges: any[]; -} diff --git a/modeler/src/views/behaviour/graph/hooks.ts b/modeler/src/views/behaviour/graph/hooks.ts deleted file mode 100644 index 64c7709..0000000 --- a/modeler/src/views/behaviour/graph/hooks.ts +++ /dev/null @@ -1,250 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import { computed, type ComputedRef, ref, type Ref } from 'vue'; -import { type Dom, Graph, Node } from '@antv/x6'; -import type { NodeViewPositionEventArgs } from '@antv/x6/es/view/node/type'; -import { createGraphCanvas } from './graph'; -import { EventListener } from '@/utils/event'; -import type { ModelElement } from './element'; - -// import {createLineOptions} from './line' - -export interface UseGraphCanvas { - container: Ref; - readonly: boolean; - eventListener: EventListener; - currentZoom: Ref; - graph: ComputedRef; - zoomIn: () => void; - zoomOut: () => void; - fitToScreen: () => void; - centerContent: () => void; - resizeCanvas: () => void; - handleGraphEvent: (name: string, fn: Function) => void; - emitGraphEvent: (name: string, options?: any) => void; - createCanvas: (c: HTMLDivElement) => Graph; -} - -export const useGraphCanvas = (readonly: boolean = false): UseGraphCanvas => { - - const graph = ref(null); - const container = ref(null); - const eventListener = new EventListener(); - const currentZoom = ref(0); - - const handleGraphEvent = (name: string, fn: Function) => { - eventListener.on(name, fn); - }; - - const emitGraphEvent = (name: string, options?: any): void => { - eventListener.emit(name, options); - }; - - const zoomIn = (): void => { - if (graph.value) { - const zoom = graph.value.zoom(); - graph.value.zoom(zoom + 0.1); - } - }; - - const zoomOut = (): void => { - if (graph.value) { - const zoom = graph.value.zoom(); - graph.value.zoom(Math.max(0.1, zoom - 0.1)); - } - }; - - const fitToScreen = () => { - if (graph.value) { - graph.value.zoomToFit({ padding: 20 }); - } - }; - - const centerContent = () => { - if (graph.value) { - graph.value.centerContent(); - } - }; - - const resizeCanvas = () => { - if (graph.value) { - graph.value?.resize(); - } - }; - - const initEvents = () => { - if (!graph.value) { - return; - } - graph.value.on('keydown', ({ e }: any) => { - if (e.key === 'Delete' || e.key === 'Backspace') { - const cells = graph.value?.getSelectedCells(); - if (cells && cells.length) { - graph.value?.removeCells(cells); - // 通知父组件更新状态 - emitGraphEvent('cells:removed', cells); - } - } - }); - - graph.value.on('scale', (ctx) => { - currentZoom.value = ctx.sx; - emitGraphEvent('scale', ctx); - }); - - // 监听画布空白点击 - graph.value.on('blank:click', () => { - graph.value?.cleanSelection(); - emitGraphEvent('blank:click'); - }); - - // 监听连线删除 - graph.value.on('edge:removed', ({ edge }) => { - emitGraphEvent('edge:removed', edge); // 添加此行 - }); - - graph.value.on('edge:added', ({ edge }) => { - // const lineOptions = createLineOptions(); - // edge.setAttrs(lineOptions.attrs); - // edge.set(lineOptions.animation); - // edge.setMarkup(lineOptions.markup); - emitGraphEvent('edge:added', edge); // 添加此行 - }); - - graph.value.on('edge:contextmenu', (ctx) => { - emitGraphEvent('edge:contextmenu', ctx); - }); - - graph.value.on('edge:connect:abort', () => { - // 当连线被拖拽到空白区域后释放,自动移除这条无效连线 - const edges = graph.value?.getEdges(); - const invalidEdges = (edges ?? []).filter(edge => - !edge.getSourceCell() || !edge.getTargetCell(), - ); - if (invalidEdges.length) { - graph.value?.removeCells(invalidEdges); - } - }); - - // 监听连接失败 - graph.value.on('edge:connect:invalid', () => { - emitGraphEvent('edge:connect:invalid'); - }); - - graph.value.on('edge:click', (edge) => { - emitGraphEvent('edge:connect:invalid', edge); - }); - - graph.value.on('edge:connected', ({ edge }) => { - const sourceNode = edge.getSourceCell() as Node; - const targetNode = edge.getTargetCell() as Node; - - if (sourceNode && targetNode) { - const sourceData = sourceNode.getData() as ModelElement; - const targetData = targetNode.getData() as ModelElement; - - // 将连线存储到节点数据中 - const sourceEdges = sourceData.edges || []; - const existingEdge = sourceEdges.find(e => e.targetKey === targetNode.id); - - if (!existingEdge) { - sourceEdges.push({ - key: edge.id, - sourceKey: sourceNode.id, - sourceName: sourceData.name, - targetKey: targetNode.id, - targetName: targetData.name, - }); - sourceNode.replaceData({ ...sourceData, edges: sourceEdges }); - } - } - - edge.attr('line/stroke', '#3b82f6'); // 显式设置颜色 - edge.attr('line/strokeWidth', 2); // 显式设置宽度 - // edge.refresh() // 刷新连线 - // graph.paint() // 重绘画布 - - emitGraphEvent('edge:connected', edge); - }); - - graph.value.on('node:click', (ctx: NodeViewPositionEventArgs) => { - console.info('node click', ctx); - emitGraphEvent('node:click', ctx); - }); - - // 监听节点选中事件 - graph.value.on('node:selected', ({ node }) => { - console.info('node select', node); - emitGraphEvent('node:selected', node); - }); - - // 监听节点取消选中 - graph.value.on('node:unselected', () => { - emitGraphEvent('node:unselected'); - }); - - // 监听节点鼠标移入,显示连接点 - graph.value.on('node:mouseenter', (ctx) => { - emitGraphEvent('node:mouseenter', ctx); - }); - - // 监听节点鼠标移出,隐藏连接点 - graph.value.on('node:mouseleave', (ctx) => { - emitGraphEvent('node:mouseleave', ctx); - }); - - // 监听节点状态变化 - graph.value.on('node:change:data', (ctx) => { - const edges = graph.value?.getIncomingEdges(ctx.node); - const { status } = ctx.node.getData(); - edges?.forEach((edge) => { - if (status === 'running') { - edge.attr('line/strokeDasharray', 5); - edge.attr('line/style/animation', 'running-line 30s infinite linear'); - } else { - edge.attr('line/strokeDasharray', ''); - edge.attr('line/style/animation', ''); - } - }); - emitGraphEvent('node:change:data', ctx); - }); - - }; - - const createCanvas = (c: HTMLDivElement): Graph => { - container.value = c; - graph.value = createGraphCanvas(c, readonly); - initEvents(); - - emitGraphEvent('created', graph.value); - - return graph.value as Graph; - }; - - const graphInstance = computed(() => graph.value); - - return { - container, - readonly, - graph: graphInstance, - eventListener, - currentZoom, - - emitGraphEvent, - handleGraphEvent, - - zoomIn, - zoomOut, - fitToScreen, - centerContent, - resizeCanvas, - createCanvas, - } as UseGraphCanvas; -}; \ No newline at end of file diff --git a/modeler/src/views/behaviour/graph/index.ts b/modeler/src/views/behaviour/graph/index.ts deleted file mode 100644 index 2c375c6..0000000 --- a/modeler/src/views/behaviour/graph/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -export { createGraphCanvas } from './graph'; -export * from './hooks'; \ No newline at end of file diff --git a/modeler/src/views/behaviour/graph/line.ts b/modeler/src/views/behaviour/graph/line.ts deleted file mode 100644 index 7ee5b4e..0000000 --- a/modeler/src/views/behaviour/graph/line.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2026 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import { Shape } from '@antv/x6'; - -export const createLineOptions = (): any => { - return { - markup: [ - { - tagName: 'circle', - selector: 'marker', - attrs: { - stroke: 'none', - r: 3, - }, - }, - ...Shape.Edge.getMarkup() as any, - ], - attrs: { - line: { - stroke: '#5da0df', - strokeWidth: 2, - strokeDasharray: ' ', - strokeDashoffset: 0, - }, - marker: { - fill: '#5da0df', - atConnectionRatio: 0, - }, - }, - animation: [ - [ - { 'attrs/marker/atConnectionRatio': 1 }, - { - duration: 2000, - iterations: Infinity, - }, - ], - ], - } -} \ No newline at end of file diff --git a/modeler/src/views/behaviour/graph/node.vue b/modeler/src/views/behaviour/graph/node.vue deleted file mode 100644 index aae3806..0000000 --- a/modeler/src/views/behaviour/graph/node.vue +++ /dev/null @@ -1,322 +0,0 @@ - - - - - \ No newline at end of file diff --git a/modeler/src/views/behaviour/graph/ports.ts b/modeler/src/views/behaviour/graph/ports.ts deleted file mode 100644 index cd24310..0000000 --- a/modeler/src/views/behaviour/graph/ports.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -export const createPort = (name: string = 'top', args: Record = { dx: 0 }) => { - return { - position: { name: name, args: args }, - attrs: { - circle: { - r: 4, // 大小 - magnet: true, - stroke: '#1b5e9f', // 边框颜色 - strokeWidth: 1, // 边框大小 - fill: '#3578bf', // 填充颜色 - style: { - visibility: 'visible', // 是否可见 - }, - }, - }, - }; -}; - -export const createPorts = (top: boolean = true, right: boolean = true, bottom: boolean = true, left: boolean = true) => { - const groups: any = {}; - const items: any = []; - if (top) { - groups['top'] = createPort('top'); - items.push({ group: 'top', id: 'top' }); - } - if (right) { - groups['right'] = createPort('right'); - items.push({ group: 'right', id: 'right' }); - } - if (bottom) { - groups['bottom'] = createPort('bottom'); - items.push({ group: 'bottom', id: 'bottom' }); - } - if (left) { - groups['left'] = createPort('left'); - items.push({ group: 'left', id: 'left' }); - } - return { - groups: groups, - items: items, - }; -}; \ No newline at end of file diff --git a/modeler/src/views/behaviour/graph/register.ts b/modeler/src/views/behaviour/graph/register.ts deleted file mode 100644 index a75a27e..0000000 --- a/modeler/src/views/behaviour/graph/register.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ -import { register } from '@antv/x6-vue-shape'; -import ModelElement from './node.vue'; - -export const registerNodeElement = () => { - console.info('registerNodeElement'); - register({ - shape: 'model', - component: ModelElement, - width: 120, - attrs: { - body: { - stroke: 'transparent', - strokeWidth: 0, - fill: 'transparent', - rx: 4, - ry: 4, - }, - }, - dragging: { - enabled: true, - }, - // 配置端口识别规则, - portMarkup: [ - { - tagName: 'div', - selector: 'port-body', - }, - ], - // 告诉 X6 如何识别 Vue 组件内的端口 - portAttribute: 'data-port', - // ports: createPorts(), - }); -}; \ No newline at end of file diff --git a/modeler/src/views/behaviour/header.vue b/modeler/src/views/behaviour/header.vue deleted file mode 100644 index 76ca76e..0000000 --- a/modeler/src/views/behaviour/header.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/behaviour/layout.vue b/modeler/src/views/behaviour/layout.vue deleted file mode 100644 index 8c4826e..0000000 --- a/modeler/src/views/behaviour/layout.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/behaviour/menu.vue b/modeler/src/views/behaviour/menu.vue deleted file mode 100644 index 8b7f121..0000000 --- a/modeler/src/views/behaviour/menu.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/behaviour/router.ts b/modeler/src/views/behaviour/router.ts deleted file mode 100644 index 1061150..0000000 --- a/modeler/src/views/behaviour/router.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -import { type RouteRecordRaw, type RouteRecordRedirect } from 'vue-router'; - -export const routers: RouteRecordRaw[] = [ - { - name: 'index', - path: '/', - redirect: '/app/behaviour/rules', - meta: { - hidden: true, - }, - } as RouteRecordRedirect, - - { - name: 'signin', - path: '/signin', - meta: { - title: '登录', - }, - component: () => import('@/views/signin.vue'), - }, - - { - path: '/', - meta: { - title: '指挥决策规则库管理', - }, - children: [ - { - name: 'app-behaviour-rules', - path: '/app/behaviour/rules', - meta: { - title: '指挥决策规则库管理', - }, - component: () => import('@/views/behaviour/rules/management.vue'), - }, - ], - }, -]; \ No newline at end of file diff --git a/modeler/src/views/behaviour/rules/management.vue b/modeler/src/views/behaviour/rules/management.vue deleted file mode 100644 index 044070a..0000000 --- a/modeler/src/views/behaviour/rules/management.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/behaviour/sidebar.vue b/modeler/src/views/behaviour/sidebar.vue deleted file mode 100644 index 6665bf8..0000000 --- a/modeler/src/views/behaviour/sidebar.vue +++ /dev/null @@ -1,169 +0,0 @@ - - - \ No newline at end of file diff --git a/modeler/src/views/decision/actions.vue b/modeler/src/views/decision/actions.vue new file mode 100644 index 0000000..9cdd530 --- /dev/null +++ b/modeler/src/views/decision/actions.vue @@ -0,0 +1,61 @@ + + + \ No newline at end of file diff --git a/modeler/src/views/decision/api.ts b/modeler/src/views/decision/api.ts new file mode 100644 index 0000000..adbf5a0 --- /dev/null +++ b/modeler/src/views/decision/api.ts @@ -0,0 +1,51 @@ +/* + * This file is part of the kernelstudio package. + * + * (c) 2014-2025 zlin + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */ + +import { HttpRequestClient } from '@/utils/request'; +import type { NodeTemplateQuery, NodeTemplatesResponse, TreeModelDetailsResponse, TreeModelGraph, TreeModelsResponse } from './types'; +import type { ApiPaginationQuery, BasicResponse } from '@/types'; + +const req = HttpRequestClient.create({ + baseURL: '/api', +}); + +export const findTemplatesByQuery = (query: Partial): Promise => { + return req.postJson('/node-templates', query); +}; + +export const findTreesByQuery = (query: Partial): Promise => { + return req.get('/system/behaviortree/list', query); +}; + +export const findOneTreeById = (id: number): Promise => { + return req.get(`/behavior-trees/${id}`); +}; + +export const updateTree = (rt: Partial): Promise => { + return req.postJson('/behavior-trees', rt); +}; + +export const createTree = (rt: Partial): Promise => { + return req.putJson('/behavior-trees', rt); +}; + + +// export const findOneTreeById = (id: number): Promise => { +// return req.postJson(`/tree-details`,{ +// tree_id: id +// }); +// }; +// +// export const updateTree = (rt: Partial): Promise => { +// return req.postJson('/update-tree', rt); +// }; +// +// export const createTree = (rt: Partial): Promise => { +// return req.postJson('/update-tree', rt); +// }; diff --git a/modeler/src/views/behaviour/graph/graph.ts b/modeler/src/views/decision/builder/graph.ts similarity index 73% rename from modeler/src/views/behaviour/graph/graph.ts rename to modeler/src/views/decision/builder/graph.ts index 9fceb78..4c2e9f0 100644 --- a/modeler/src/views/behaviour/graph/graph.ts +++ b/modeler/src/views/decision/builder/graph.ts @@ -7,10 +7,9 @@ * that was distributed with this source code. */ -import { Edge, Graph, Path, Selection } from '@antv/x6'; -import type { ModelElement } from './element'; +import { Clipboard, Edge, Graph, History, Keyboard, Path, Selection, Snapline, Transform } from '@antv/x6'; +import type { BaseElement } from '../types'; import type { Connecting } from '@antv/x6/lib/graph/options'; -import { createLineOptions } from './line'; Graph.registerConnector( 'sequenceFlowConnector', @@ -34,30 +33,30 @@ Graph.registerConnector( true, ); + export const createGraphConnectingAttributes = (): Partial => { - const lineOptions = createLineOptions(); return { snap: true, // 当 snap 设置为 true 时连线的过程中距离节点或者连接桩 50px 时会触发自动吸附 allowBlank: false, // 是否允许连接到画布空白位置的点,默认为 true allowLoop: false, // 是否允许创建循环连线,即边的起始节点和终止节点为同一节点,默认为 true highlight: true, // 当连接到节点时,通过 sourceAnchor 来指定源节点的锚点。 - connector: 'smooth', - connectionPoint: 'anchor', // 指定连接点,默认值为 boundary。 + connector: 'sequenceFlowConnector', + connectionPoint: 'boundary', // 指定连接点,默认值为 boundary。 anchor: 'center', + + router: 'manhattan', + // connector: { + // name: 'rounded', + // args: { + // radius: 8, + // }, + // }, + // connectionPoint: 'anchor', + // validateMagnet({ magnet }) { // return magnet.getAttribute('port-group') !== 'top' // }, // 验证连接 - createEdge(this: Graph) { - const edge: Edge = this.createEdge({ - shape: 'edge', - ...lineOptions, // 应用动画配置 - attrs: lineOptions.attrs, - animation: lineOptions.animation, - markup: lineOptions.markup, - }) - return edge; - }, validateConnection(this: Graph, { sourceCell, targetCell }) { console.error('validateConnection'); if (!sourceCell || !targetCell) return false; @@ -68,28 +67,21 @@ export const createGraphConnectingAttributes = (): Partial => { } // const sourceData = sourceCell.getData() as GraphElement; - const targetData = targetCell.getData() as ModelElement; + const targetData = targetCell.getData() as BaseElement; // 根节点不能作为子节点 - if (targetData.type === 'startEvent') { + if (targetData.type === 'root') { return false; } - // 4. 新增核心逻辑:检查源节点是否已有出边(已连接其他节点) - // const hasOutgoingEdge = this.getOutgoingEdges(sourceCell); - // if (hasOutgoingEdge && hasOutgoingEdge.length > 1) { - // return false; - // } + // 检查是否已存在相同连接(保留原有逻辑) + const edges: Edge[] = this.getEdges(); + const existingConnection = edges.find(edge => + edge.getSourceCell() === sourceCell && + edge.getTargetCell() === targetCell, + ); - // 检查是否已存在相同连接 - // const edges: Edge[] = this.getEdges(); - // const existingConnection = edges.find(edge => - // edge.getSourceCell() === sourceCell && - // edge.getTargetCell() === targetCell, - // ); - // - // return !existingConnection; - return true; + return !existingConnection; }, }; }; @@ -111,10 +103,10 @@ export const createGraphCanvas = (container: HTMLDivElement, readonly: boolean = }, mousewheel: { enabled: true, + zoomAtMousePosition: true, modifiers: 'ctrl', - factor: 1.1, - maxScale: 1.5, minScale: 0.5, + maxScale: 3, }, highlighting: { magnetAdsorbed: { @@ -170,7 +162,16 @@ export const createGraphCanvas = (container: HTMLDivElement, readonly: boolean = modifiers: 'shift', rubberband: true, }), - ); + ).use( + new Transform({ + resizing: false, + rotating: false, + }), + ) + .use(new Snapline()) + .use(new Keyboard()) + .use(new Clipboard()) + .use(new History()); return graph; diff --git a/modeler/src/views/ai/builder/hooks.ts b/modeler/src/views/decision/builder/hooks.ts similarity index 81% rename from modeler/src/views/ai/builder/hooks.ts rename to modeler/src/views/decision/builder/hooks.ts index 64c7709..71d7f38 100644 --- a/modeler/src/views/ai/builder/hooks.ts +++ b/modeler/src/views/decision/builder/hooks.ts @@ -8,13 +8,10 @@ */ import { computed, type ComputedRef, ref, type Ref } from 'vue'; -import { type Dom, Graph, Node } from '@antv/x6'; +import { type Dom, Graph } from '@antv/x6'; import type { NodeViewPositionEventArgs } from '@antv/x6/es/view/node/type'; import { createGraphCanvas } from './graph'; import { EventListener } from '@/utils/event'; -import type { ModelElement } from './element'; - -// import {createLineOptions} from './line' export interface UseGraphCanvas { container: Ref; @@ -88,7 +85,7 @@ export const useGraphCanvas = (readonly: boolean = false): UseGraphCanvas => { const cells = graph.value?.getSelectedCells(); if (cells && cells.length) { graph.value?.removeCells(cells); - // 通知父组件更新状态 + // 通知父节点更新状态 emitGraphEvent('cells:removed', cells); } } @@ -107,15 +104,7 @@ export const useGraphCanvas = (readonly: boolean = false): UseGraphCanvas => { // 监听连线删除 graph.value.on('edge:removed', ({ edge }) => { - emitGraphEvent('edge:removed', edge); // 添加此行 - }); - - graph.value.on('edge:added', ({ edge }) => { - // const lineOptions = createLineOptions(); - // edge.setAttrs(lineOptions.attrs); - // edge.set(lineOptions.animation); - // edge.setMarkup(lineOptions.markup); - emitGraphEvent('edge:added', edge); // 添加此行 + emitGraphEvent('cells:removed', edge); // 添加此行 }); graph.value.on('edge:contextmenu', (ctx) => { @@ -143,28 +132,28 @@ export const useGraphCanvas = (readonly: boolean = false): UseGraphCanvas => { }); graph.value.on('edge:connected', ({ edge }) => { - const sourceNode = edge.getSourceCell() as Node; - const targetNode = edge.getTargetCell() as Node; + // const sourceNode = edge.getSourceCell() as Node; + // const targetNode = edge.getTargetCell() as Node; - if (sourceNode && targetNode) { - const sourceData = sourceNode.getData() as ModelElement; - const targetData = targetNode.getData() as ModelElement; - - // 将连线存储到节点数据中 - const sourceEdges = sourceData.edges || []; - const existingEdge = sourceEdges.find(e => e.targetKey === targetNode.id); - - if (!existingEdge) { - sourceEdges.push({ - key: edge.id, - sourceKey: sourceNode.id, - sourceName: sourceData.name, - targetKey: targetNode.id, - targetName: targetData.name, - }); - sourceNode.replaceData({ ...sourceData, edges: sourceEdges }); - } - } + // if (sourceNode && targetNode) { + // const sourceData = sourceNode.getData() as TaskNodeElement; + // const targetData = targetNode.getData() as TaskNodeElement; + // + // // 将连线存储到节点数据中 + // const sourceEdges = sourceData.edges || []; + // const existingEdge = sourceEdges.find(e => e.targetKey === targetNode.id); + // + // if (!existingEdge) { + // sourceEdges.push({ + // key: edge.id, + // sourceKey: sourceNode.id, + // sourceName: sourceData.name, + // targetKey: targetNode.id, + // targetName: targetData.name, + // }); + // sourceNode.setData({ ...sourceData, edges: sourceEdges }); + // } + // } edge.attr('line/stroke', '#3b82f6'); // 显式设置颜色 edge.attr('line/strokeWidth', 2); // 显式设置宽度 diff --git a/modeler/src/views/ai/builder/index.ts b/modeler/src/views/decision/builder/index.ts similarity index 100% rename from modeler/src/views/ai/builder/index.ts rename to modeler/src/views/decision/builder/index.ts diff --git a/modeler/src/views/decision/builder/node.vue b/modeler/src/views/decision/builder/node.vue new file mode 100644 index 0000000..6a3da9a --- /dev/null +++ b/modeler/src/views/decision/builder/node.vue @@ -0,0 +1,194 @@ + + + + + \ No newline at end of file diff --git a/modeler/src/views/decision/builder/ports.ts b/modeler/src/views/decision/builder/ports.ts new file mode 100644 index 0000000..6d86652 --- /dev/null +++ b/modeler/src/views/decision/builder/ports.ts @@ -0,0 +1,43 @@ +/* + * This file is part of the kernelstudio package. + * + * (c) 2014-2025 zlin + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */ + +export const createPort = (name: string = 'top', args: Record = { dx: 0 }) => { + return { + position: { name: name, args: args }, + attrs: { + circle: { + r: 3, // 大小 + magnet: true, + stroke: '#999', // 边框颜色 + strokeWidth: 1, // 边框大小 + fill: '#ffffff', // 填充颜色 + style: { + visibility: 'visible', // 是否可见 + }, + }, + }, + }; +}; + +export const createPorts = () => { + return { + groups: { + top: createPort('top'), + right: createPort('right'), + bottom: createPort('bottom'), + left: createPort('left'), + }, + items: [ + { group: 'top', id: 'top' }, + { group: 'right', id: 'right' }, + { group: 'bottom', id: 'bottom' }, + { group: 'left', id: 'left' }, + ], + }; +}; \ No newline at end of file diff --git a/modeler/src/views/behaviour/graph/props.ts b/modeler/src/views/decision/builder/props.ts similarity index 87% rename from modeler/src/views/behaviour/graph/props.ts rename to modeler/src/views/decision/builder/props.ts index dc093e6..3f38b3f 100644 --- a/modeler/src/views/behaviour/graph/props.ts +++ b/modeler/src/views/decision/builder/props.ts @@ -9,7 +9,7 @@ import { Graph, Node } from '@antv/x6'; import { type ExtractPropTypes, type PropType } from 'vue'; -import type { ModelElement } from './element'; +import type { BaseElement } from '../types'; export const elementProps = { node: { @@ -21,7 +21,7 @@ export const elementProps = { required: true, }, element: { - type: Object as PropType, + type: Object as PropType, required: false, }, }; diff --git a/modeler/src/views/ai/builder/register.ts b/modeler/src/views/decision/builder/register.ts similarity index 53% rename from modeler/src/views/ai/builder/register.ts rename to modeler/src/views/decision/builder/register.ts index a75a27e..8d836dd 100644 --- a/modeler/src/views/ai/builder/register.ts +++ b/modeler/src/views/decision/builder/register.ts @@ -7,21 +7,14 @@ * that was distributed with this source code. */ -/* - * This file is part of the kernelstudio package. - * - * (c) 2014-2025 zlin - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ import { register } from '@antv/x6-vue-shape'; import ModelElement from './node.vue'; +import { createPorts } from './ports'; -export const registerNodeElement = () => { +export const registerNodeElement = (type: string = 'task') => { console.info('registerNodeElement'); register({ - shape: 'model', + shape: type, component: ModelElement, width: 120, attrs: { @@ -36,15 +29,6 @@ export const registerNodeElement = () => { dragging: { enabled: true, }, - // 配置端口识别规则, - portMarkup: [ - { - tagName: 'div', - selector: 'port-body', - }, - ], - // 告诉 X6 如何识别 Vue 组件内的端口 - portAttribute: 'data-port', - // ports: createPorts(), + ports: createPorts(), }); }; \ No newline at end of file diff --git a/modeler/src/views/decision/constants.ts b/modeler/src/views/decision/constants.ts new file mode 100644 index 0000000..7f3b81f --- /dev/null +++ b/modeler/src/views/decision/constants.ts @@ -0,0 +1,41 @@ +/* + * This file is part of the kernelstudio package. + * + * (c) 2014-2026 zlin + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */ + +import type { NodeTemplateData, NodeTemplateQuery, TreeModelsData } from './types'; +import type { ApiPagination, ApiPaginationQuery } from '@/types'; + +export const defaultPagination = { + page: 1, + limit: 10, + total: 0, + total_pages: 0, +} as ApiPagination; + +export const defaultTreeModelsData = { + trees: [], + pagination: { ...defaultPagination }, +} as TreeModelsData; + +export const defaultPaginationRequest = { + page: 1, + limit: 10, + keyword: null, +} as ApiPaginationQuery; + +export const defaultNodeTemplateQuery = { + page: 1, + limit: 1000, + keyword: null, + include_params: true, +} as NodeTemplateQuery; + +export const defaultNodeTemplateData = { + templates: [], + total: 0, +} as NodeTemplateData; \ No newline at end of file diff --git a/modeler/src/views/decision/designer.vue b/modeler/src/views/decision/designer.vue new file mode 100644 index 0000000..a3128aa --- /dev/null +++ b/modeler/src/views/decision/designer.vue @@ -0,0 +1,375 @@ + + + \ No newline at end of file diff --git a/modeler/src/views/decision/header.vue b/modeler/src/views/decision/header.vue new file mode 100644 index 0000000..2096219 --- /dev/null +++ b/modeler/src/views/decision/header.vue @@ -0,0 +1,32 @@ + + + \ No newline at end of file diff --git a/modeler/src/views/decision/layout.vue b/modeler/src/views/decision/layout.vue new file mode 100644 index 0000000..90ef707 --- /dev/null +++ b/modeler/src/views/decision/layout.vue @@ -0,0 +1,24 @@ + + + \ No newline at end of file diff --git a/modeler/src/views/decision/nodes-card.vue b/modeler/src/views/decision/nodes-card.vue new file mode 100644 index 0000000..912fa7d --- /dev/null +++ b/modeler/src/views/decision/nodes-card.vue @@ -0,0 +1,217 @@ + + + \ No newline at end of file diff --git a/modeler/src/views/decision/properties.vue b/modeler/src/views/decision/properties.vue new file mode 100644 index 0000000..0d514e0 --- /dev/null +++ b/modeler/src/views/decision/properties.vue @@ -0,0 +1,211 @@ + + + diff --git a/modeler/src/views/decision/trees-card.vue b/modeler/src/views/decision/trees-card.vue new file mode 100644 index 0000000..40ee330 --- /dev/null +++ b/modeler/src/views/decision/trees-card.vue @@ -0,0 +1,98 @@ + + + + + \ No newline at end of file diff --git a/modeler/src/views/ai/model/types/index.ts b/modeler/src/views/decision/types/index.ts similarity index 69% rename from modeler/src/views/ai/model/types/index.ts rename to modeler/src/views/decision/types/index.ts index e3a9302..37fd1e6 100644 --- a/modeler/src/views/ai/model/types/index.ts +++ b/modeler/src/views/decision/types/index.ts @@ -7,4 +7,7 @@ * that was distributed with this source code. */ -export * from './types' \ No newline at end of file +export * from './tree'; +export * from './template'; +export * from './parameter'; +export * from './node'; \ No newline at end of file diff --git a/modeler/src/views/decision/types/node.ts b/modeler/src/views/decision/types/node.ts new file mode 100644 index 0000000..50b169f --- /dev/null +++ b/modeler/src/views/decision/types/node.ts @@ -0,0 +1,73 @@ +/* + * This file is part of the kernelstudio package. + * + * (c) 2014-2026 zlin + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */ + +import type { NullableString } from '@/types'; +import type { NodeSetting } from './parameter'; + +export type ElementStatus = 'default' | 'success' | 'failed' | 'running' | string | null + +export interface ElementPosition { + x: number; + y: number; +} + +export interface ElementVariable { + key: NullableString; + name: NullableString; + value: NullableString; + defaults: NullableString; + unit: NullableString; +} + +export interface BaseElement { + id: number; + key: NullableString; + type: NullableString; + status: ElementStatus; +} + +export interface TaskNodeRect { + width?: number; + height?: number; + x?: number; + y?: number; +} + +export interface TaskNodeElement extends BaseElement { + template: number; + name: NullableString; + description: NullableString; + width: number; + height: number; + position: ElementPosition; + inputs: any; + outputs: any; + variables: ElementVariable[]; + parameters: Record; + + [key: string]: unknown; +} + +export interface SettingTaskNodeElement extends TaskNodeElement { + settings: NodeSetting[]; +} + + +export interface EdgeNodeElement extends BaseElement { + source: NullableString; + target: NullableString; + attrs: Record; + router: Record; + connector: any; +} + +export interface NodeGraph { + edges: EdgeNodeElement[]; + nodes: TaskNodeElement[]; +} \ No newline at end of file diff --git a/modeler/src/views/decision/types/parameter.ts b/modeler/src/views/decision/types/parameter.ts new file mode 100644 index 0000000..0abeacd --- /dev/null +++ b/modeler/src/views/decision/types/parameter.ts @@ -0,0 +1,20 @@ +/* + * This file is part of the kernelstudio package. + * + * (c) 2014-2026 zlin + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */ + +import type { NullableString } from '@/types'; + +export interface NodeSetting { + id: number; + name: NullableString; + type: NullableString; + default_value: NullableString; + data_type: NullableString; + required: boolean; + description: NullableString; +} \ No newline at end of file diff --git a/modeler/src/views/decision/types/template.ts b/modeler/src/views/decision/types/template.ts new file mode 100644 index 0000000..50b4cfd --- /dev/null +++ b/modeler/src/views/decision/types/template.ts @@ -0,0 +1,35 @@ +/* + * This file is part of the kernelstudio package. + * + * (c) 2014-2026 zlin + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */ + +import type { ApiPaginationQuery, ApiResponse, NullableString } from '@/types'; +import type { NodeSetting } from './parameter'; + +export interface NodeTemplate { + id: number; + name: NullableString; + type: NullableString; + english_name: NullableString; + description: NullableString; + parameter_defs: NodeSetting[]; +} + +export interface NodeTemplateData { + templates: NodeTemplate[]; + total: number; +} + +export interface NodeTemplateQuery extends ApiPaginationQuery { + include_params: boolean; + type: NullableString; +} + +export interface NodeTemplatesResponse extends ApiResponse { + +} + diff --git a/modeler/src/views/decision/types/tree.ts b/modeler/src/views/decision/types/tree.ts new file mode 100644 index 0000000..c11ea8d --- /dev/null +++ b/modeler/src/views/decision/types/tree.ts @@ -0,0 +1,92 @@ +/* + * This file is part of the kernelstudio package. + * + * (c) 2014-2025 zlin + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */ + +import type { ApiErrors, ApiPagination, ApiResponse, NullableString } from '@/types'; +import type { NodeGraph } from './node'; + +export type TreeModelStatus = string | 'active' + +export type TreeNodeType = 'selector' | string; + +// 获取树列表 +export interface TreeModel { + id: number; + name: NullableString; + english_name: NullableString; + description: NullableString; + created_at: NullableString; + updated_at: NullableString; + node_count: number; + status: TreeModelStatus; +} + +export interface TreeModelGraph extends TreeModel { + graph: NodeGraph; +} + +// 所有行为树列表 +export interface TreeModelsData { + trees: TreeModel[]; + pagination: ApiPagination; +} + +export interface TreeModelsResponse extends ApiResponse { + +} + +export interface TreeModelDetailsResponse extends ApiResponse { + +} + +// 创建行为树 +export interface RootTreeNodeConfig { + type: TreeNodeType; + instance_name: NullableString; +} + +export interface RootTreeNode { + id: number; + name: NullableString; + english_name: NullableString; + created_at: NullableString; + root_node_id: number; +} + +export interface CreateTreeModel { + name: NullableString; + english_name: NullableString; + description: NullableString; + template_id: number; + root_node_config: RootTreeNodeConfig; +} + +export type CreateTreeModelData = RootTreeNode | ApiErrors + +export interface CreateTreeModelResponse extends ApiResponse { + +} + +// 行为树详细信息 + +export interface TreeNodeDetailRequest { + tree_id: number; + include_structure: boolean; + include_parameters: boolean; +} + +export interface TreeNodeStructure { + id: number; + template_name: NullableString; + instance_name: NullableString; + children: TreeNodeStructure[]; +} + +export interface TreeNodeDetail { + tree: TreeModel; +} diff --git a/modeler/src/views/decision/utils/node.ts b/modeler/src/views/decision/utils/node.ts new file mode 100644 index 0000000..feaca5e --- /dev/null +++ b/modeler/src/views/decision/utils/node.ts @@ -0,0 +1,146 @@ +/* + * This file is part of the kernelstudio package. + * + * (c) 2014-2026 zlin + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */ + +import { Edge, Graph, Node } from '@antv/x6'; +import type { EdgeNodeElement, NodeGraph, NodeTemplate, SettingTaskNodeElement, TaskNodeElement, TaskNodeRect } from '../types'; +import { generateKey } from '@/utils/strings.ts'; + +export const createTaskNodeElementFromTemplate = ( + template: NodeTemplate, + rect?: TaskNodeRect, +): SettingTaskNodeElement => { + let realRect = { width: 200, height: 100, x: 0, y: 0, ...rect || {} }; + console.info('rect', rect); + return { + id: 0, + key: generateKey(template.type), + status: null, + template: template.id, + type: template.type, + name: template.name, + description: template.description, + position: { + x: realRect.x ?? 0, + y: realRect.y ?? 0, + }, + width: realRect.width, + height: realRect.height, + settings: JSON.parse(JSON.stringify(template.parameter_defs ?? [])), + inputs: null, + outputs: null, + parameters: {}, + variables: [ + { + key: generateKey('var_'), + name: '范围', + value: '1000', + defaults: '1000', + unit: 'KM', + }, + { + key: generateKey('var_'), + name: '武器名称', + value: '地对空导弹', + defaults: '地对空导弹', + unit: '个', + }, + ], + } as SettingTaskNodeElement; +}; + +export const createTaskNodeElement = (element: TaskNodeElement, width: number = 200, height: number = 100): any => { + return { + shape: 'task', + id: element.key, + position: { + x: element.position?.x || 0, + y: element.position?.y || 0, + }, + size: { + width: element.width ?? width, + height: element.height ?? height, + }, + attrs: { + label: { + text: element.name, + }, + }, + data: element, + }; +}; + +export const resolveNodeTaskElements = (graph: Graph): TaskNodeElement[] => { + const taskElements: TaskNodeElement[] = []; + if (graph) { + const nodes = graph?.getNodes() as Node[]; + if (nodes) { + nodes.forEach(node => { + const nodeData = node.getData() as TaskNodeElement; + const newElement = { + ...nodeData, + key: node.id, + position: node.getPosition(), + width: node.getSize().width, + height: node.getSize().height, + }; + taskElements.push(newElement); + }); + } + } + return taskElements; +}; + +export const resolveNodeEdgeElements = (graph: Graph): EdgeNodeElement[] => { + const edgeElements: EdgeNodeElement[] = []; + if (graph) { + const graphEdges = graph?.getEdges() ?? [] as Edge[]; + if (graphEdges) { + graphEdges.forEach(edge => { + const nodeData = edge.getData() as TaskNodeElement; + edgeElements.push({ + id: nodeData?.id ?? 0, + key: edge.id, + type: 'edge', + status: nodeData?.status, + source: edge.getSource() ? edge.getSource() as unknown as string : null, + target: edge.getSource() ? edge.getTarget() as unknown as string : null, + attrs: edge.getAttrs() ?? {}, + router: edge.getRouter() ?? {}, + connector: edge.getConnector() ?? null, + }); + }); + } + } + return edgeElements; +}; + +export const resolveNodeGraph = (graph: Graph): NodeGraph => { + const nodes: TaskNodeElement[] = resolveNodeTaskElements(graph); + const edges: EdgeNodeElement[] = resolveNodeEdgeElements(graph); + return { + nodes, + edges, + }; +}; + +export const hasElements = (graph: Graph): boolean => { + if (graph) { + const taskElements: TaskNodeElement[] = resolveNodeTaskElements(graph); + return taskElements.length > 0; + } + return false; +}; + +export const hasRootElementNode = (graph: Graph): boolean => { + if (graph) { + const taskElements: TaskNodeElement[] = resolveNodeTaskElements(graph); + return taskElements.filter(e => e.type === 'root').length === 1; + } + return false; +}; \ No newline at end of file diff --git a/modeler/types/components.d.ts b/modeler/types/components.d.ts index 4b39106..769cbcc 100644 --- a/modeler/types/components.d.ts +++ b/modeler/types/components.d.ts @@ -20,7 +20,9 @@ declare module 'vue' { ACol: typeof import('ant-design-vue/es')['Col'] ACollapse: typeof import('ant-design-vue/es')['Collapse'] ACollapsePanel: typeof import('ant-design-vue/es')['CollapsePanel'] + ADivider: typeof import('ant-design-vue/es')['Divider'] ADropdown: typeof import('ant-design-vue/es')['Dropdown'] + AEmpty: typeof import('ant-design-vue/es')['Empty'] AFlex: typeof import('ant-design-vue/es')['Flex'] AFloatButton: typeof import('ant-design-vue/es')['FloatButton'] AForm: typeof import('ant-design-vue/es')['Form'] @@ -35,6 +37,8 @@ declare module 'vue' { ALayoutContent: typeof import('ant-design-vue/es')['LayoutContent'] ALayoutHeader: typeof import('ant-design-vue/es')['LayoutHeader'] ALayoutSider: typeof import('ant-design-vue/es')['LayoutSider'] + AList: typeof import('ant-design-vue/es')['List'] + AListItem: typeof import('ant-design-vue/es')['ListItem'] AMenu: typeof import('ant-design-vue/es')['Menu'] AMenuItem: typeof import('ant-design-vue/es')['MenuItem'] AModal: typeof import('ant-design-vue/es')['Modal'] @@ -68,7 +72,9 @@ declare global { const ACol: typeof import('ant-design-vue/es')['Col'] const ACollapse: typeof import('ant-design-vue/es')['Collapse'] const ACollapsePanel: typeof import('ant-design-vue/es')['CollapsePanel'] + const ADivider: typeof import('ant-design-vue/es')['Divider'] const ADropdown: typeof import('ant-design-vue/es')['Dropdown'] + const AEmpty: typeof import('ant-design-vue/es')['Empty'] const AFlex: typeof import('ant-design-vue/es')['Flex'] const AFloatButton: typeof import('ant-design-vue/es')['FloatButton'] const AForm: typeof import('ant-design-vue/es')['Form'] @@ -83,6 +89,8 @@ declare global { const ALayoutContent: typeof import('ant-design-vue/es')['LayoutContent'] const ALayoutHeader: typeof import('ant-design-vue/es')['LayoutHeader'] const ALayoutSider: typeof import('ant-design-vue/es')['LayoutSider'] + const AList: typeof import('ant-design-vue/es')['List'] + const AListItem: typeof import('ant-design-vue/es')['ListItem'] const AMenu: typeof import('ant-design-vue/es')['Menu'] const AMenuItem: typeof import('ant-design-vue/es')['MenuItem'] const AModal: typeof import('ant-design-vue/es')['Modal']