Initial commit

This commit is contained in:
libertyspy
2026-02-08 20:27:40 +08:00
parent e12c3c0302
commit b544391b5c
7 changed files with 56 additions and 58 deletions

View File

@@ -111,9 +111,9 @@
<script lang="ts">
import { defineComponent, onMounted, type PropType, ref, watch } from 'vue';
import { CheckOutlined } from '@ant-design/icons-vue';
import type { ElementVariable, SettingTaskNodeElement } from './builder/element';
import type { ElementVariable, GraphTaskElement } from './builder/element';
import type { Graph, Node, NodeProperties } from '@antv/x6';
import {generateKey} from '@/utils/strings'
import { generateKey } from '@/utils/strings';
const actionSpaceColumns = [
{ title: '序号', dataIndex: 'index', key: 'index', width: 40 },
@@ -136,7 +136,7 @@ export default defineComponent({
const activeBottomTabs2Key = ref<string>('1');
const currentNode = ref<Node | null>(props.node ?? null);
const currentElement = ref<SettingTaskNodeElement | null>(null);
const currentElement = ref<GraphTaskElement | null>(null);
const load = () => {
};
@@ -145,7 +145,7 @@ export default defineComponent({
currentNode.value = n ?? null;
if (n) {
const data = n.getData();
currentElement.value = JSON.parse(JSON.stringify(data || {})) as SettingTaskNodeElement;
currentElement.value = JSON.parse(JSON.stringify(data || {})) as GraphTaskElement;
} else {
currentElement.value = null;
}
@@ -178,7 +178,7 @@ export default defineComponent({
const updateNode = () => {
if (currentNode.value && currentElement.value) {
// 深拷贝当前元素数据
const newElement = JSON.parse(JSON.stringify(currentElement.value)) as SettingTaskNodeElement;
const newElement = JSON.parse(JSON.stringify(currentElement.value)) as GraphTaskElement;
// 更新节点数据
currentNode.value.replaceData(newElement);
// 触发事件通知父组件