Initial commit
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -9,23 +9,27 @@
|
||||
>
|
||||
<template #title>
|
||||
<a-space>
|
||||
<span class="ks-designer-node-icon"></span>
|
||||
<div class="port port-in" data-port="in-0" magnet="passive"></div>
|
||||
<span class="ks-designer-node-title">{{ element?.name ?? '-' }}</span>
|
||||
<div class="port port-out" data-port="out-0" magnet="active"></div>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<!-- 节点内容区域 -->
|
||||
<div class="w-full">
|
||||
<a-tooltip>
|
||||
<template #title>
|
||||
{{element?.description}}
|
||||
</template>
|
||||
<div class="ks-designer-node-content">
|
||||
<div class="ks-designer-node-row">
|
||||
<div class="port port-in" data-port="in-0" magnet="passive"></div>
|
||||
<div class="ks-designer-node-name" v-if="element?.category !== 'component'">
|
||||
{{ element?.name ?? '-' }}
|
||||
</div>
|
||||
<div class="port port-out" data-port="out-0" magnet="active"></div>
|
||||
<div class="ks-designer-node-name">
|
||||
{{ substring(element?.description ?? '-' ,40) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
</div>
|
||||
</a-card>
|
||||
|
||||
<template #overlay>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -9,4 +9,3 @@
|
||||
|
||||
export * from './tree'
|
||||
export * from './template'
|
||||
export * from './parameter'
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
* This file is part of the kernelstudio package.
|
||||
*
|
||||
* (c) 2014-2026 zlin <admin@kernelstudio.com>
|
||||
*
|
||||
* 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;
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
10
modeler/types/components.d.ts
vendored
10
modeler/types/components.d.ts
vendored
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user