Initial commit
This commit is contained in:
@@ -46,24 +46,26 @@ export interface ElementVariable {
|
|||||||
unit: NullableString;
|
unit: NullableString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface GraphTaskRect {
|
||||||
|
width?: number;
|
||||||
|
height?: number;
|
||||||
|
x?: number;
|
||||||
|
y?: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface BaseElement {
|
export interface BaseElement {
|
||||||
id: number;
|
id: number;
|
||||||
key: NullableString;
|
key: NullableString;
|
||||||
name: NullableString;
|
name: NullableString;
|
||||||
|
description: NullableString;
|
||||||
type: NullableString;
|
type: NullableString;
|
||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
position: GraphPosition;
|
position: GraphPosition;
|
||||||
category: NullableString;
|
category: NullableString;
|
||||||
element?: DraggableElement;
|
element?: DraggableElement;
|
||||||
[key: string]: unknown;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GraphTaskRect {
|
[key: string]: unknown;
|
||||||
width?: number;
|
|
||||||
height?: number;
|
|
||||||
x?: number;
|
|
||||||
y?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GraphTaskElement extends BaseElement {
|
export interface GraphTaskElement extends BaseElement {
|
||||||
@@ -72,7 +74,6 @@ export interface GraphTaskElement extends BaseElement {
|
|||||||
outputs: any;
|
outputs: any;
|
||||||
variables: ElementVariable[];
|
variables: ElementVariable[];
|
||||||
parameters: ElementParameter[];
|
parameters: ElementParameter[];
|
||||||
|
|
||||||
children?: GraphTaskElement[],
|
children?: GraphTaskElement[],
|
||||||
|
|
||||||
[key: string]: unknown;
|
[key: string]: unknown;
|
||||||
|
|||||||
@@ -9,23 +9,27 @@
|
|||||||
>
|
>
|
||||||
<template #title>
|
<template #title>
|
||||||
<a-space>
|
<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>
|
<span class="ks-designer-node-title">{{ element?.name ?? '-' }}</span>
|
||||||
|
<div class="port port-out" data-port="out-0" magnet="active"></div>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- 节点内容区域 -->
|
<!-- 节点内容区域 -->
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
|
<a-tooltip>
|
||||||
|
<template #title>
|
||||||
|
{{element?.description}}
|
||||||
|
</template>
|
||||||
<div class="ks-designer-node-content">
|
<div class="ks-designer-node-content">
|
||||||
<div class="ks-designer-node-row">
|
<div class="ks-designer-node-row">
|
||||||
<div class="port port-in" data-port="in-0" magnet="passive"></div>
|
<div class="ks-designer-node-name">
|
||||||
<div class="ks-designer-node-name" v-if="element?.category !== 'component'">
|
{{ substring(element?.description ?? '-' ,40) }}
|
||||||
{{ element?.name ?? '-' }}
|
|
||||||
</div>
|
|
||||||
<div class="port port-out" data-port="out-0" magnet="active"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</a-tooltip>
|
||||||
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<template #overlay>
|
<template #overlay>
|
||||||
@@ -47,6 +51,7 @@ import { elementProps } from './props';
|
|||||||
import type { ModelElement } from './element';
|
import type { ModelElement } from './element';
|
||||||
import { DeleteOutlined, SettingOutlined } from '@ant-design/icons-vue';
|
import { DeleteOutlined, SettingOutlined } from '@ant-design/icons-vue';
|
||||||
import type { Graph } from '@antv/x6';
|
import type { Graph } from '@antv/x6';
|
||||||
|
import {substring} from '@/utils/strings'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ModelElement',
|
name: 'ModelElement',
|
||||||
@@ -116,6 +121,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
element,
|
element,
|
||||||
|
substring,
|
||||||
handleMenuClick,
|
handleMenuClick,
|
||||||
handleVisibleChange,
|
handleVisibleChange,
|
||||||
};
|
};
|
||||||
@@ -164,8 +170,8 @@ export default defineComponent({
|
|||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 8px 15px;
|
padding: 8px 15px;
|
||||||
overflow-y: auto;
|
|
||||||
border-top: 1px solid #195693;
|
border-top: 1px solid #195693;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.ks-designer-task-node {
|
&.ks-designer-task-node {
|
||||||
@@ -264,6 +270,10 @@ export default defineComponent({
|
|||||||
height: 20px;
|
height: 20px;
|
||||||
display: block;
|
display: block;
|
||||||
background: url('@/assets/icons/point.svg') center / 100% 100%;
|
background: url('@/assets/icons/point.svg') center / 100% 100%;
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
left: 5px;
|
||||||
|
top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 右侧出桩样式
|
// 右侧出桩样式
|
||||||
@@ -277,6 +287,10 @@ export default defineComponent({
|
|||||||
height: 20px;
|
height: 20px;
|
||||||
display: block;
|
display: block;
|
||||||
background: url('@/assets/icons/arrow-right.svg') center / 100% 100%;
|
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;
|
line-height: 24px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
//white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -9,4 +9,3 @@
|
|||||||
|
|
||||||
export * from './tree'
|
export * from './tree'
|
||||||
export * from './template'
|
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,
|
height: realRect.height,
|
||||||
inputs: null,
|
inputs: null,
|
||||||
outputs: null,
|
outputs: null,
|
||||||
parameters: [],
|
parameters: template.parameters ?? [],
|
||||||
variables: [
|
variables: [],
|
||||||
{
|
|
||||||
key: generateKey('var_'),
|
|
||||||
name: '范围',
|
|
||||||
value: '1000',
|
|
||||||
defaults: '1000',
|
|
||||||
unit: 'KM'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: generateKey('var_'),
|
|
||||||
name: '武器名称',
|
|
||||||
value: '地对空导弹',
|
|
||||||
defaults: '地对空导弹',
|
|
||||||
unit: '个'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
} as GraphTaskElement;
|
} as GraphTaskElement;
|
||||||
};
|
};
|
||||||
|
|||||||
10
modeler/types/components.d.ts
vendored
10
modeler/types/components.d.ts
vendored
@@ -12,6 +12,7 @@ export {}
|
|||||||
/* prettier-ignore */
|
/* prettier-ignore */
|
||||||
declare module 'vue' {
|
declare module 'vue' {
|
||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
|
AAvatar: typeof import('ant-design-vue/es')['Avatar']
|
||||||
AButton: typeof import('ant-design-vue/es')['Button']
|
AButton: typeof import('ant-design-vue/es')['Button']
|
||||||
ACard: typeof import('ant-design-vue/es')['Card']
|
ACard: typeof import('ant-design-vue/es')['Card']
|
||||||
ACol: typeof import('ant-design-vue/es')['Col']
|
ACol: typeof import('ant-design-vue/es')['Col']
|
||||||
@@ -21,13 +22,16 @@ declare module 'vue' {
|
|||||||
ADropdown: typeof import('ant-design-vue/es')['Dropdown']
|
ADropdown: typeof import('ant-design-vue/es')['Dropdown']
|
||||||
AEmpty: typeof import('ant-design-vue/es')['Empty']
|
AEmpty: typeof import('ant-design-vue/es')['Empty']
|
||||||
AFlex: typeof import('ant-design-vue/es')['Flex']
|
AFlex: typeof import('ant-design-vue/es')['Flex']
|
||||||
|
AFloatButton: typeof import('ant-design-vue/es')['FloatButton']
|
||||||
AForm: typeof import('ant-design-vue/es')['Form']
|
AForm: typeof import('ant-design-vue/es')['Form']
|
||||||
AFormItem: typeof import('ant-design-vue/es')['FormItem']
|
AFormItem: typeof import('ant-design-vue/es')['FormItem']
|
||||||
AInput: typeof import('ant-design-vue/es')['Input']
|
AInput: typeof import('ant-design-vue/es')['Input']
|
||||||
AInputNumber: typeof import('ant-design-vue/es')['InputNumber']
|
AInputNumber: typeof import('ant-design-vue/es')['InputNumber']
|
||||||
AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
|
AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
|
||||||
ALayout: typeof import('ant-design-vue/es')['Layout']
|
ALayout: typeof import('ant-design-vue/es')['Layout']
|
||||||
|
ALayoutContent: typeof import('ant-design-vue/es')['LayoutContent']
|
||||||
ALayoutHeader: typeof import('ant-design-vue/es')['LayoutHeader']
|
ALayoutHeader: typeof import('ant-design-vue/es')['LayoutHeader']
|
||||||
|
ALayoutSider: typeof import('ant-design-vue/es')['LayoutSider']
|
||||||
AList: typeof import('ant-design-vue/es')['List']
|
AList: typeof import('ant-design-vue/es')['List']
|
||||||
AListItem: typeof import('ant-design-vue/es')['ListItem']
|
AListItem: typeof import('ant-design-vue/es')['ListItem']
|
||||||
AMenu: typeof import('ant-design-vue/es')['Menu']
|
AMenu: typeof import('ant-design-vue/es')['Menu']
|
||||||
@@ -35,6 +39,7 @@ declare module 'vue' {
|
|||||||
APopconfirm: typeof import('ant-design-vue/es')['Popconfirm']
|
APopconfirm: typeof import('ant-design-vue/es')['Popconfirm']
|
||||||
ARow: typeof import('ant-design-vue/es')['Row']
|
ARow: typeof import('ant-design-vue/es')['Row']
|
||||||
ASpace: typeof import('ant-design-vue/es')['Space']
|
ASpace: typeof import('ant-design-vue/es')['Space']
|
||||||
|
ASubMenu: typeof import('ant-design-vue/es')['SubMenu']
|
||||||
ATable: typeof import('ant-design-vue/es')['Table']
|
ATable: typeof import('ant-design-vue/es')['Table']
|
||||||
ATabPane: typeof import('ant-design-vue/es')['TabPane']
|
ATabPane: typeof import('ant-design-vue/es')['TabPane']
|
||||||
ATabs: typeof import('ant-design-vue/es')['Tabs']
|
ATabs: typeof import('ant-design-vue/es')['Tabs']
|
||||||
@@ -47,6 +52,7 @@ declare module 'vue' {
|
|||||||
|
|
||||||
// For TSX support
|
// For TSX support
|
||||||
declare global {
|
declare global {
|
||||||
|
const AAvatar: typeof import('ant-design-vue/es')['Avatar']
|
||||||
const AButton: typeof import('ant-design-vue/es')['Button']
|
const AButton: typeof import('ant-design-vue/es')['Button']
|
||||||
const ACard: typeof import('ant-design-vue/es')['Card']
|
const ACard: typeof import('ant-design-vue/es')['Card']
|
||||||
const ACol: typeof import('ant-design-vue/es')['Col']
|
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 ADropdown: typeof import('ant-design-vue/es')['Dropdown']
|
||||||
const AEmpty: typeof import('ant-design-vue/es')['Empty']
|
const AEmpty: typeof import('ant-design-vue/es')['Empty']
|
||||||
const AFlex: typeof import('ant-design-vue/es')['Flex']
|
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 AForm: typeof import('ant-design-vue/es')['Form']
|
||||||
const AFormItem: typeof import('ant-design-vue/es')['FormItem']
|
const AFormItem: typeof import('ant-design-vue/es')['FormItem']
|
||||||
const AInput: typeof import('ant-design-vue/es')['Input']
|
const AInput: typeof import('ant-design-vue/es')['Input']
|
||||||
const AInputNumber: typeof import('ant-design-vue/es')['InputNumber']
|
const AInputNumber: typeof import('ant-design-vue/es')['InputNumber']
|
||||||
const AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
|
const AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
|
||||||
const ALayout: typeof import('ant-design-vue/es')['Layout']
|
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 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 AList: typeof import('ant-design-vue/es')['List']
|
||||||
const AListItem: typeof import('ant-design-vue/es')['ListItem']
|
const AListItem: typeof import('ant-design-vue/es')['ListItem']
|
||||||
const AMenu: typeof import('ant-design-vue/es')['Menu']
|
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 APopconfirm: typeof import('ant-design-vue/es')['Popconfirm']
|
||||||
const ARow: typeof import('ant-design-vue/es')['Row']
|
const ARow: typeof import('ant-design-vue/es')['Row']
|
||||||
const ASpace: typeof import('ant-design-vue/es')['Space']
|
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 ATable: typeof import('ant-design-vue/es')['Table']
|
||||||
const ATabPane: typeof import('ant-design-vue/es')['TabPane']
|
const ATabPane: typeof import('ant-design-vue/es')['TabPane']
|
||||||
const ATabs: typeof import('ant-design-vue/es')['Tabs']
|
const ATabs: typeof import('ant-design-vue/es')['Tabs']
|
||||||
|
|||||||
Reference in New Issue
Block a user