From 1058d666a0ea5b6fb661eb33300b43144b8e9a34 Mon Sep 17 00:00:00 2001 From: libertyspy Date: Sun, 8 Feb 2026 20:57:07 +0800 Subject: [PATCH] Initial commit --- modeler/src/views/decision/builder/element.ts | 17 +++++----- modeler/src/views/decision/builder/node.vue | 34 +++++++++++++------ modeler/src/views/decision/types/index.ts | 1 - modeler/src/views/decision/types/parameter.ts | 20 ----------- modeler/src/views/decision/utils/node.ts | 19 ++--------- modeler/types/components.d.ts | 10 ++++++ 6 files changed, 45 insertions(+), 56 deletions(-) delete mode 100644 modeler/src/views/decision/types/parameter.ts diff --git a/modeler/src/views/decision/builder/element.ts b/modeler/src/views/decision/builder/element.ts index b78152a..abb4b29 100644 --- a/modeler/src/views/decision/builder/element.ts +++ b/modeler/src/views/decision/builder/element.ts @@ -46,24 +46,26 @@ export interface ElementVariable { unit: NullableString; } +export interface GraphTaskRect { + width?: number; + height?: number; + x?: number; + y?: number; +} + export interface BaseElement { id: number; key: NullableString; name: NullableString; + description: NullableString; type: NullableString; width: number; height: number; position: GraphPosition; category: NullableString; element?: DraggableElement; - [key: string]: unknown; -} -export interface GraphTaskRect { - width?: number; - height?: number; - x?: number; - y?: number; + [key: string]: unknown; } export interface GraphTaskElement extends BaseElement { @@ -72,7 +74,6 @@ export interface GraphTaskElement extends BaseElement { outputs: any; variables: ElementVariable[]; parameters: ElementParameter[]; - children?: GraphTaskElement[], [key: string]: unknown; diff --git a/modeler/src/views/decision/builder/node.vue b/modeler/src/views/decision/builder/node.vue index 1cf2683..d0f3202 100644 --- a/modeler/src/views/decision/builder/node.vue +++ b/modeler/src/views/decision/builder/node.vue @@ -9,22 +9,26 @@ >
-
-
-
-
- {{ element?.name ?? '-' }} + + +
+
+
+ {{ substring(element?.description ?? '-' ,40) }} +
-
-
+
@@ -47,6 +51,7 @@ import { elementProps } from './props'; import type { ModelElement } from './element'; import { DeleteOutlined, SettingOutlined } from '@ant-design/icons-vue'; import type { Graph } from '@antv/x6'; +import {substring} from '@/utils/strings' export default defineComponent({ name: 'ModelElement', @@ -116,6 +121,7 @@ export default defineComponent({ return { element, + substring, handleMenuClick, handleVisibleChange, }; @@ -164,8 +170,8 @@ export default defineComponent({ border-radius: 0; font-size: 12px; padding: 8px 15px; - overflow-y: auto; border-top: 1px solid #195693; + overflow: hidden; } &.ks-designer-task-node { @@ -264,6 +270,10 @@ export default defineComponent({ height: 20px; display: block; background: url('@/assets/icons/point.svg') center / 100% 100%; + + position: absolute; + left: 5px; + top: 10px; } // 右侧出桩样式 @@ -277,6 +287,10 @@ export default defineComponent({ height: 20px; display: block; background: url('@/assets/icons/arrow-right.svg') center / 100% 100%; + + position: absolute; + right: 5px; + top: 10px; } // 节点文本样式 @@ -285,7 +299,7 @@ export default defineComponent({ line-height: 24px; overflow: hidden; text-overflow: ellipsis; - white-space: nowrap; + //white-space: nowrap; } } \ 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 64b6279..f49bae0 100644 --- a/modeler/src/views/decision/types/index.ts +++ b/modeler/src/views/decision/types/index.ts @@ -9,4 +9,3 @@ export * from './tree' export * from './template' -export * from './parameter' diff --git a/modeler/src/views/decision/types/parameter.ts b/modeler/src/views/decision/types/parameter.ts deleted file mode 100644 index 0abeacd..0000000 --- a/modeler/src/views/decision/types/parameter.ts +++ /dev/null @@ -1,20 +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'; - -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/utils/node.ts b/modeler/src/views/decision/utils/node.ts index e0552b4..924f68b 100644 --- a/modeler/src/views/decision/utils/node.ts +++ b/modeler/src/views/decision/utils/node.ts @@ -33,22 +33,7 @@ export const createGraphTaskElementFromTemplate = ( height: realRect.height, inputs: null, outputs: null, - parameters: [], - variables: [ - { - key: generateKey('var_'), - name: '范围', - value: '1000', - defaults: '1000', - unit: 'KM' - }, - { - key: generateKey('var_'), - name: '武器名称', - value: '地对空导弹', - defaults: '地对空导弹', - unit: '个' - } - ], + parameters: template.parameters ?? [], + variables: [], } as GraphTaskElement; }; diff --git a/modeler/types/components.d.ts b/modeler/types/components.d.ts index 3045962..fb8c90d 100644 --- a/modeler/types/components.d.ts +++ b/modeler/types/components.d.ts @@ -12,6 +12,7 @@ export {} /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { + AAvatar: typeof import('ant-design-vue/es')['Avatar'] AButton: typeof import('ant-design-vue/es')['Button'] ACard: typeof import('ant-design-vue/es')['Card'] ACol: typeof import('ant-design-vue/es')['Col'] @@ -21,13 +22,16 @@ declare module 'vue' { 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'] AFormItem: typeof import('ant-design-vue/es')['FormItem'] AInput: typeof import('ant-design-vue/es')['Input'] AInputNumber: typeof import('ant-design-vue/es')['InputNumber'] AInputPassword: typeof import('ant-design-vue/es')['InputPassword'] ALayout: typeof import('ant-design-vue/es')['Layout'] + 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'] @@ -35,6 +39,7 @@ declare module 'vue' { APopconfirm: typeof import('ant-design-vue/es')['Popconfirm'] ARow: typeof import('ant-design-vue/es')['Row'] ASpace: typeof import('ant-design-vue/es')['Space'] + ASubMenu: typeof import('ant-design-vue/es')['SubMenu'] ATable: typeof import('ant-design-vue/es')['Table'] ATabPane: typeof import('ant-design-vue/es')['TabPane'] ATabs: typeof import('ant-design-vue/es')['Tabs'] @@ -47,6 +52,7 @@ declare module 'vue' { // For TSX support declare global { + const AAvatar: typeof import('ant-design-vue/es')['Avatar'] const AButton: typeof import('ant-design-vue/es')['Button'] const ACard: typeof import('ant-design-vue/es')['Card'] const ACol: typeof import('ant-design-vue/es')['Col'] @@ -56,13 +62,16 @@ declare global { 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'] const AFormItem: typeof import('ant-design-vue/es')['FormItem'] const AInput: typeof import('ant-design-vue/es')['Input'] const AInputNumber: typeof import('ant-design-vue/es')['InputNumber'] const AInputPassword: typeof import('ant-design-vue/es')['InputPassword'] const ALayout: typeof import('ant-design-vue/es')['Layout'] + 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'] @@ -70,6 +79,7 @@ declare global { const APopconfirm: typeof import('ant-design-vue/es')['Popconfirm'] const ARow: typeof import('ant-design-vue/es')['Row'] const ASpace: typeof import('ant-design-vue/es')['Space'] + const ASubMenu: typeof import('ant-design-vue/es')['SubMenu'] const ATable: typeof import('ant-design-vue/es')['Table'] const ATabPane: typeof import('ant-design-vue/es')['TabPane'] const ATabs: typeof import('ant-design-vue/es')['Tabs']