From a0d8f555f9b370a9629281b86327e039e62e7984 Mon Sep 17 00:00:00 2001 From: libertyspy Date: Tue, 31 Mar 2026 14:32:54 +0800 Subject: [PATCH] UPDATE: VERSION-20260331 --- modeler/src/style.less | 49 +++++++++++++++++-- modeler/src/views/decision/api.ts | 8 ++- .../src/views/decision/designer/designer.vue | 19 ++++++- .../views/decision/designer/properties.vue | 21 +++++++- modeler/src/views/decision/types/command.ts | 21 ++++++++ modeler/src/views/decision/types/index.ts | 3 +- 6 files changed, 110 insertions(+), 11 deletions(-) create mode 100644 modeler/src/views/decision/types/command.ts diff --git a/modeler/src/style.less b/modeler/src/style.less index b4c09aa..c14bddb 100644 --- a/modeler/src/style.less +++ b/modeler/src/style.less @@ -1204,7 +1204,7 @@ .ant-tabs-content { //padding: 15px; padding: 4px; - background: #041b36db; + background: #041832; } &.settings-tab, @@ -1508,9 +1508,7 @@ border-inline-end-width: 1px; } } -.ant-select:not(.ant-select-customize-input) .ant-select-selector{ - border: 1px solid #2c2a2a; -} + .ant-select .ant-select-selection-placeholder, .ant-select .ant-select-selection-search-input{ background: transparent @@ -1831,4 +1829,45 @@ } } -} \ No newline at end of file +} + +.ks-add-parameter-action{ + color: #eee; + position: absolute; + right: 14px; + top: 6px; + cursor: pointer; +} + +.ks-parameter-setting-tabs{ + .ant-tabs-nav{ + background: none; + } + .ant-tabs-nav-list{ + margin-left: 0; + } + &.ant-tabs-left >.ant-tabs-content-holder, + &.ant-tabs-left >div>.ant-tabs-content-holder{ + border-left-color: #09264b; + } + .ant-tabs-tab-remove{ + //position: absolute; + //right: 10px; + //top: 7px; + .anticon{ + color: rgb(173 206 224); + } + } + &.ant-tabs-left >.ant-tabs-nav .ant-tabs-tab{ + border-radius: 0!important; + } + &.ant-tabs-card >.ant-tabs-nav .ant-tabs-tab-active, + &.ant-tabs-card >div>.ant-tabs-nav .ant-tabs-tab-active { + background: #09264c; + } + + &.ant-tabs-left >.ant-tabs-content-holder >.ant-tabs-content>.ant-tabs-tabpane, + &.ant-tabs-left >div>.ant-tabs-content-holder >.ant-tabs-content>.ant-tabs-tabpane{ + padding-left: 5px; + } +} diff --git a/modeler/src/views/decision/api.ts b/modeler/src/views/decision/api.ts index b1a4096..a88b542 100644 --- a/modeler/src/views/decision/api.ts +++ b/modeler/src/views/decision/api.ts @@ -9,7 +9,7 @@ import { HttpRequestClient } from '@/utils/request'; import type { BasicResponse } from '@/types'; -import type { PlatformListableResponse } from './types'; +import type { NodeCommandListResponse, PlatformListableResponse } from './types'; const req = HttpRequestClient.create({ baseURL: '/api', @@ -18,4 +18,8 @@ const req = HttpRequestClient.create({ export const findAllBasicPlatforms = (): Promise => { return req.get('/system/firerule/platforms/basic'); -}; \ No newline at end of file +}; + +export const findAllNodeCommands = (): Promise => { + return req.get('/node/command/all') +} \ No newline at end of file diff --git a/modeler/src/views/decision/designer/designer.vue b/modeler/src/views/decision/designer/designer.vue index 12cbf9c..4be2cfd 100644 --- a/modeler/src/views/decision/designer/designer.vue +++ b/modeler/src/views/decision/designer/designer.vue @@ -43,6 +43,7 @@ (false); const treesCardRef = ref | null>(null); const platforms = ref([]); + const nodeCommands = ref([]) const currentScenarioId = ref(null); const { @@ -138,6 +140,18 @@ export default defineComponent({ }); }; + const loadNodeCommands = ()=> { + nodeCommands.value = [] + findAllNodeCommands().then(r=> { + nodeCommands.value = r.data ?? [] + }) + } + + const loadDatasource = ()=> { + loadPlatforms(); + loadNodeCommands(); + } + // 处理拖动开始 const handleDragStart = (nm: NodeDragTemplate) => { draggedNodeData.value = nm; @@ -449,13 +463,14 @@ export default defineComponent({ // 初始化 onMounted(() => { init(); - loadPlatforms(); + loadDatasource(); }); // 清理 onBeforeUnmount(() => destroy()); return { + nodeCommands, currentScenarioId, platforms, treesCardRef, diff --git a/modeler/src/views/decision/designer/properties.vue b/modeler/src/views/decision/designer/properties.vue index 7924bf9..ed0e85a 100644 --- a/modeler/src/views/decision/designer/properties.vue +++ b/modeler/src/views/decision/designer/properties.vue @@ -111,6 +111,11 @@ v-else-if="setting.paramKey === 'platforms'" v-model:value="setting.defaultValue"> {{pl.description}} + + {{pl.chineseName}} + @@ -127,6 +132,16 @@ + + {{ pl.description }} + + + {{pl.chineseName}} + @@ -161,7 +176,7 @@ import type { ElementParameter, ElementVariable, GraphTaskElement } from '../gra import type { BehaviorTree } from './tree'; import type { Graph, Node, NodeProperties } from '@antv/x6'; import { generateKey } from '@/utils/strings'; -import type { Platform } from '@/views/decision/types'; +import type { NodeCommand, Platform } from '../types'; const actionSpaceColumns = [ { title: '序号', dataIndex: 'index', key: 'index', width: 40 }, @@ -179,10 +194,12 @@ export default defineComponent({ node: { type: [Object, null] as PropType | null | undefined>, required: false }, graph: { type: [Object, null] as PropType, required: true }, platforms: { type: Array as PropType, required: true }, + nodeCommands: { type: Array as PropType, required: true }, }, emits: ['update-element', 'update-tree'], setup(props, { emit }) { const platforms = ref(props.platforms ?? []); + const nodeCommands = ref(props.nodeCommands ?? []); const activeTopTabsKey = ref('1'); const activeBottomTabsKey = ref('1'); @@ -370,11 +387,13 @@ export default defineComponent({ watch(() => currentElement.value, () => updateNode(), { deep: true }); + watch(() => props.nodeCommands, (n: NodeCommand[] | null | undefined) => nodeCommands.value = n ?? [], { deep: true, immediate: true }); watch(() => props.platforms, (n: Platform[] | null | undefined) => platforms.value = n ?? [], { deep: true, immediate: true }); onMounted(() => load()); return { + nodeCommands, platforms, addParameterTab, groupedParametersActiveTab, diff --git a/modeler/src/views/decision/types/command.ts b/modeler/src/views/decision/types/command.ts new file mode 100644 index 0000000..cba9553 --- /dev/null +++ b/modeler/src/views/decision/types/command.ts @@ -0,0 +1,21 @@ +/* + * 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 NodeCommand { + id: number, + command: NullableString, + chineseName: NullableString, + description: NullableString, +} + +export interface NodeCommandListResponse extends ApiDataResponse { + +} \ No newline at end of file diff --git a/modeler/src/views/decision/types/index.ts b/modeler/src/views/decision/types/index.ts index 0a425d0..4e201b4 100644 --- a/modeler/src/views/decision/types/index.ts +++ b/modeler/src/views/decision/types/index.ts @@ -7,4 +7,5 @@ * that was distributed with this source code. */ -export * from './platform' \ No newline at end of file +export * from './platform' +export * from './command' \ No newline at end of file