Initial commit
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
import type { NullableString } from '@/types';
|
||||
import type { ModelParameters } from '@/views/ai/model/types';
|
||||
|
||||
export interface DraggableElement {
|
||||
id: number | null,
|
||||
@@ -19,4 +20,42 @@ export interface DraggableElement {
|
||||
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[];
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
*/
|
||||
|
||||
import { Edge, Graph, Path, Selection } from '@antv/x6';
|
||||
import type { ModelElement } from '../model/types';
|
||||
import type { ModelElement } from './element';
|
||||
import type { Connecting } from '@antv/x6/lib/graph/options';
|
||||
import {createLineOptions} from './line'
|
||||
import { createLineOptions } from './line';
|
||||
|
||||
Graph.registerConnector(
|
||||
'sequenceFlowConnector',
|
||||
|
||||
@@ -12,7 +12,8 @@ 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 '../model/types';
|
||||
import type { ModelElement } from './element';
|
||||
|
||||
// import {createLineOptions} from './line'
|
||||
|
||||
export interface UseGraphCanvas {
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, onMounted, onUnmounted, ref } from 'vue';
|
||||
import { elementProps } from './props';
|
||||
import type { ModelElement } from '../model/types';
|
||||
import type { ModelElement } from './element';
|
||||
import { DeleteOutlined, SettingOutlined } from '@ant-design/icons-vue';
|
||||
import type { Graph } from '@antv/x6';
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
import { Graph, Node } from '@antv/x6';
|
||||
import { type ExtractPropTypes, type PropType } from 'vue';
|
||||
import type { ModelElement } from '../model/types';
|
||||
import type { ModelElement } from './element';
|
||||
|
||||
export const elementProps = {
|
||||
node: {
|
||||
|
||||
@@ -10,19 +10,8 @@
|
||||
export const menuMap = [
|
||||
{
|
||||
key: '0',
|
||||
title: '工程空间',
|
||||
children: [
|
||||
{
|
||||
key: '0-1',
|
||||
title: '工程管理',
|
||||
path: '/app/ai/project/management',
|
||||
},
|
||||
{
|
||||
key: '0-2',
|
||||
title: '新建/自定义',
|
||||
path: '/app/ai/project/create',
|
||||
},
|
||||
],
|
||||
title: '指挥决策规则库管理',
|
||||
path: '/app/ai/project/management',
|
||||
},
|
||||
{
|
||||
key: '1',
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<a-layout-header class="ks-layout-header">
|
||||
<a-flex>
|
||||
<div class="ks-layout-header-logo">
|
||||
<router-link :to="{path: '/app/ai/project/management'}">博弈竞赛环境</router-link>
|
||||
</div>
|
||||
<div class="ks-layout-header-actions">
|
||||
<span class="dev top active">开发</span>
|
||||
<span class="training bottom">训练</span>
|
||||
<span class="apps top">博弈对抗</span>
|
||||
<router-link :to="{path: '/app/ai/project/management'}">决策管理</router-link>
|
||||
</div>
|
||||
<!-- <div class="ks-layout-header-actions">-->
|
||||
<!-- <span class="dev top active">开发</span>-->
|
||||
<!-- <span class="training bottom">训练</span>-->
|
||||
<!-- <span class="apps top">博弈对抗</span>-->
|
||||
<!-- </div>-->
|
||||
<div class="ks-layout-header-right">
|
||||
<a-space size="large">
|
||||
<span><QuestionCircleOutlined /> 帮助文档</span>
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
<template #title>
|
||||
<a-flex>
|
||||
<span class="icon"></span>
|
||||
<span class="text">工程空间</span>
|
||||
<!-- <span class="text">工程空间</span>-->
|
||||
</a-flex>
|
||||
</template>
|
||||
|
||||
<div class="w-full p-3">
|
||||
<a-flex class="w-full">
|
||||
<a-input style="width: 70%" placeholder="导入"></a-input>
|
||||
<a-button style="margin-left: auto">导入</a-button>
|
||||
</a-flex>
|
||||
</div>
|
||||
<!-- <div class="w-full p-3">-->
|
||||
<!-- <a-flex class="w-full">-->
|
||||
<!-- <a-input style="width: 70%" placeholder="导入"></a-input>-->
|
||||
<!-- <a-button style="margin-left: auto">导入</a-button>-->
|
||||
<!-- </a-flex>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<a-menu
|
||||
v-model:openKeys="openKeys"
|
||||
|
||||
Reference in New Issue
Block a user