Merge pull request #575 from SuanmoSuanyangTechnology/feature/app_zy

Feature/app zy
This commit is contained in:
yingzhao
2026-03-16 16:15:13 +08:00
committed by GitHub
3 changed files with 21 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 16:27:52
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-13 17:12:59
* @Last Modified time: 2026-03-16 15:58:10
*/
import { type FC, useRef, useMemo, useCallback } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
@@ -97,10 +97,16 @@ const ConfigHeader: FC<ConfigHeaderProps> = ({
applicationModalRef.current?.handleOpen(application)
break;
case 'copy':
copyModalRef.current?.handleOpen()
appRef?.current?.handleSave(false)
.then(() => {
copyModalRef.current?.handleOpen()
})
break;
case 'export':
appExport(application.id, application.name)
appRef?.current?.handleSave(false)
.then(() => {
appExport(application.id, application.name)
})
break;
case 'delete':
handleDelete()

View File

@@ -1,8 +1,8 @@
/*
* @Author: ZhaoYing
* @Date: 2026-02-03 15:39:59
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-02 17:06:41
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-16 16:11:28
*/
import { type FC, useEffect, useState, useMemo } from "react";
import clsx from 'clsx'
@@ -88,7 +88,7 @@ const Properties: FC<PropertiesProps> = ({
useEffect(() => {
if (selectedNode && form) {
const { type = 'default', name = '', config } = selectedNode.getData() || {}
const { type = 'default', name = '', config, id } = selectedNode.getData() || {}
const initialValue: Record<string, any> = {}
Object.keys(config || {}).forEach(key => {
if (config && config[key] && 'defaultValue' in config[key]) {
@@ -98,7 +98,7 @@ const Properties: FC<PropertiesProps> = ({
form.setFieldsValue({
type,
id: selectedNode.id,
id,
name,
...initialValue,
})

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 15:17:48
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-07 15:23:39
* @Last Modified time: 2026-03-16 16:11:01
*/
import { useRef, useEffect, useState } from 'react';
import { useParams } from 'react-router-dom';
@@ -593,6 +593,13 @@ export const useWorkflowGraph = ({
if (!graphRef.current) return false;
const selectedNodes = graphRef.current.getNodes().filter(node => node.getData()?.isSelected);
if (selectedNodes.length) {
selectedNodes.forEach(node => {
const data = node.getData();
node.setData({
...data,
id: `${(data.type as string).replace(/-/g, '_')}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
});
});
graphRef.current.copy(selectedNodes);
}
return false;