Selaa lähdekoodia

fix: 修改bug

liaojiaxing 5 kuukautta sitten
vanhempi
commit
175d822979

+ 1 - 0
apps/designer/.gitignore

@@ -6,4 +6,5 @@
 /src/.umi-production
 /src/.umi-test
 /dist
+/systemDesign
 .swc

+ 1 - 0
apps/designer/.umirc.ts

@@ -3,6 +3,7 @@ import { defineConfig } from "umi";
 export default defineConfig({
   base: '/',
   publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
+  outputPath: 'systemDesign',
   favicons: [
     '/favicon.ico'
   ],

+ 1 - 1
apps/designer/src/app.ts

@@ -12,7 +12,7 @@ export const request: RequestConfig = {
   },
   requestInterceptors: [
     (url, options) => {
-      const baseUrl = 'http://ab.dev.jbpm.shalu.com' // https://edesign.shalu.com'
+      const baseUrl = process.env.NODE_ENV === 'production' ? '' : 'http://ab.dev.jbpm.shalu.com' // https://edesign.shalu.com'
       const enterpriseCode = sessionStorage.getItem('enterpriseCode');
       const token = localStorage.getItem('token_' + enterpriseCode);
  

+ 2 - 2
apps/designer/src/components/FlowExtra.tsx

@@ -64,12 +64,12 @@ export default function FlowExtra({ node }: { node: Node }) {
   }
 
   return (
-    <div className="absolute w-full h-full left-0 top-0 text-14px">
+    <div className="absolute w-50px h-30px bottom--20px right-0 text-14px">
       {attrs?.linkValue?.value && (
         <Tooltip
           title={`关联${linkTypeMap[attrs.linkType as CorrelationType].name}`}
         >
-          <i className="iconfont icon-lianjie color-#239edd cursor-pointer text-24px absolute right-0px bottom-0px rotate-45deg" onClick={handleOpenLink}/>
+          <i className="iconfont icon-lianjie color-#239edd cursor-pointer text-16px absolute right-0px bottom-0px rotate-45deg" onClick={handleOpenLink}/>
         </Tooltip>
       )}
     </div>

+ 2 - 2
apps/designer/src/components/mindMap/Topic.tsx

@@ -199,7 +199,7 @@ const component = ({ node, graph }: { node: Node; graph: Graph }) => {
       deep: false
     });
   }
-
+console.log(borderSize)
   return (
     <div>
       {selected && (
@@ -274,7 +274,7 @@ const component = ({ node, graph }: { node: Node; graph: Graph }) => {
                 />
               )}
               {remark && (
-                <Tooltip color="yellow" title={remark}>
+                <Tooltip color="#ffffdd" title={<span className="color-#333">{remark}</span>} autoAdjustOverflow trigger={['hover', 'click']}>
                   <i
                     className="iconfont icon-pinglun1 cursor-pointer ml-4px"
                     onClick={handleShowRemark}

+ 1 - 1
apps/designer/src/events/mindMapEvent.ts

@@ -241,7 +241,7 @@ export const bindMindMapEvents = (
       setMindProjectInfo &&
         updateTopic(
           args.cell.id,
-          { extraModules: current.extraModules },
+          { extraModules: current?.extraModules },
           setMindProjectInfo,
           graph
         );

+ 9 - 1
apps/designer/src/models/graphModel.ts

@@ -14,6 +14,7 @@ import { handleGraphEvent, handleGraphApiEvent } from "@/events/flowEvent";
 import { pageMenu, nodeMenu, edgeMenu } from "@/utils/contentMenu";
 import { bindKeys } from "@/utils/fastKey";
 import { useSessionStorageState } from "ahooks";
+import { handleSetEdgeStyle } from "@/utils";
 
 export default function GraphModel() {
   const [graph, setGraph] = useState<Graph>();
@@ -45,7 +46,6 @@ export default function GraphModel() {
   };
 
   const addPageNode = () => {
-    console.log('增加画布节点')
     const graph = graphRef.current;
     pageNodeRef.current = graph?.addNode({
       shape: "page-container-node",
@@ -136,6 +136,14 @@ export default function GraphModel() {
     });
   }, [pageState]);
 
+  // 修改跨线展示
+  useEffect(() => {
+    const edges = graphRef.current?.getEdges();
+    (edges || []).forEach(edge => {
+      handleSetEdgeStyle(edge, edge.data?.connectorType, pageState.jumpOver);
+    });
+  }, [pageState.jumpOver]);
+
   const enabledTransform = (node: Node) => {
     const data = node.getData<{ isPage: boolean; lock: boolean }>();
     return !data?.isPage && !data?.lock;

+ 2 - 0
apps/designer/src/models/mindMapModel.ts

@@ -8,6 +8,7 @@ import { History } from "@antv/x6-plugin-history";
 import { Transform } from "@antv/x6-plugin-transform";
 import { Scroller } from "@antv/x6-plugin-scroller";
 import { Clipboard } from "@antv/x6-plugin-clipboard";
+import { Export } from "@antv/x6-plugin-export";
 import { MindMapProjectInfo } from "@/types";
 import { bindMindMapEvents } from "@/events/mindMapEvent";
 import { useSessionStorageState } from "ahooks";
@@ -183,6 +184,7 @@ export default function mindMapModel() {
     instance.use(new Selection());
     instance.use(new Keyboard());
     instance.use(new Clipboard());
+    instance.use(new Export());
     instance.use(
       new Scroller({
         enabled: true,

+ 9 - 9
apps/designer/src/pages/flow/index.tsx

@@ -23,15 +23,15 @@ export default function HomePage() {
 
     const graphInfo = data?.result?.graph || {};
     const pageSetting = {
-      backgroundColor: graphInfo.backgroundColor || pageState.backgroundColor,
-      width: graphInfo.width || pageState.width,
-      height: graphInfo.height || pageState.height,
-      grid: graphInfo.grid || pageState.grid,
-      gridSize: graphInfo.gridSize || pageState.gridSize,
-      jumpOver: graphInfo.jumpover || pageState.jumpOver,
-      printLine: graphInfo.printLine || pageState.printLine,
-      showWatermark: graphInfo.showWatermark || pageState.showWatermark,
-      watermarkText: graphInfo.watermarkText || pageState.watermarkText,
+      backgroundColor: graphInfo.backgroundColor ?? pageState.backgroundColor,
+      width: graphInfo.width ?? pageState.width,
+      height: graphInfo.height ?? pageState.height,
+      grid: graphInfo.grid ?? pageState.grid,
+      gridSize: graphInfo.gridSize ?? pageState.gridSize,
+      jumpOver: graphInfo.jumpover ?? pageState.jumpOver,
+      printLine: graphInfo.printLine ?? pageState.printLine,
+      showWatermark: graphInfo.showWatermark ?? pageState.showWatermark,
+      watermarkText: graphInfo.watermarkText ?? pageState.watermarkText,
     };
     setPageState(pageSetting);
     setProjectInfo(data?.result || {});

+ 9 - 3
apps/designer/src/pages/home/All.tsx

@@ -91,7 +91,7 @@ export default function All({
     },
   });
 
-  useRequest(GetAllFolders, {
+  const { refresh: refreshFolderAll } = useRequest(GetAllFolders, {
     onSuccess: (res) => {
       setFolderList(res?.result || []);
     },
@@ -327,6 +327,9 @@ export default function All({
       refresh();
       setOpen(false);
     });
+    if(moveSource.current?.type === 'folder') {
+      refreshFolderAll();
+    }
   };
 
   const handleCopy = (targetFolderId: string) => {
@@ -472,6 +475,7 @@ export default function All({
                                                       name,
                                                     });
                                                     refresh();
+                                                    refreshFolderAll
                                                     message.success(
                                                       "重命名成功"
                                                     );
@@ -481,7 +485,7 @@ export default function All({
                                             },
                                             {
                                               key: "2",
-                                              label: "移动或复制",
+                                              label: "移动",
                                               onClick: () => {
                                                 handleOpenFolderModal(
                                                   item.id,
@@ -502,6 +506,8 @@ export default function All({
                                                       id: item.id,
                                                     });
                                                     message.success("删除成功");
+                                                    refresh();
+                                                    refreshFolderAll();
                                                   },
                                                 });
                                               },
@@ -616,7 +622,7 @@ export default function All({
       </PageContainer>
 
       <Modal
-        title="移动/复制到"
+        title="移动到"
         width={440}
         open={open}
         onCancel={() => {

+ 6 - 4
apps/designer/src/pages/home/ProjectCard.tsx

@@ -10,11 +10,13 @@ export default function ProjectCard({
   onFresh,
   onDelete,
   onChangeLocation,
+  hideRemove
 }: {
   record: any;
   onFresh: () => void;
   onDelete: () => void;
   onChangeLocation: (id: string) => void;
+  hideRemove?: boolean;
 }) {
   const [showMenu, setShowMenu] = useState(false);
   const handleToEdit = () => {
@@ -88,13 +90,13 @@ export default function ProjectCard({
                   });
                 },
               },
-              {
+              !hideRemove ? {
                 key: "2",
-                label: "移动或复制",
+                label: "移动",
                 onClick: () => {
                   onChangeLocation?.(record.id);
-                },
-              },
+                }
+              }: null,
               {
                 key: "3",
                 label: "删除",

+ 1 - 0
apps/designer/src/pages/home/Recently.tsx

@@ -114,6 +114,7 @@ export default function Recently(
                       onFresh={refresh}
                       onDelete={refresh}
                       onChangeLocation={() => {}}
+                      hideRemove={true}
                     />
                   </Col>
                 );

+ 1 - 1
apps/designer/src/pages/home/index.tsx

@@ -235,7 +235,7 @@ export default () => {
           return (
             <div className="flex-1">
               <div className="flex items-center h-20px">
-                {logo}
+                <span className="mr-8px">{logo}</span>
                 {title}
               </div>
               <div className="mt-32px">

+ 1 - 4
apps/designer/src/pages/mindmap/components/Config/NodeStyle.tsx

@@ -5,9 +5,6 @@ import {
   ItalicOutlined,
   StrikethroughOutlined,
   UnderlineOutlined,
-  VerticalAlignBottomOutlined,
-  VerticalAlignMiddleOutlined,
-  VerticalAlignTopOutlined,
 } from "@ant-design/icons";
 import { Button, Checkbox, Divider, InputNumber, Select, Tooltip } from "antd";
 import { Icon, useModel } from "umi";
@@ -128,7 +125,7 @@ export default function GraphStyle() {
         cell.setData({
           text: model.text,
           edge: model.edge,
-          BorderSize: model.borderSize,
+          borderSize: model.borderSize,
           fixedWidth: model.fixedWidth,
           fill: {
             ...model.fill,

+ 16 - 0
apps/designer/src/pages/mindmap/components/HeaderToolbar/index.tsx

@@ -120,6 +120,16 @@ export default function index() {
     setCorrelationEdgeInfo(currentNode[0]);
   };
 
+  // 导出图片
+  const handleExportImage = () => {
+    if (!graph) return;
+
+    graph.exportPNG("", {
+      quality: 1,
+      copyStyles: false,
+    });
+  };
+
   const menuData: MenuProps["items"] = [
     {
       key: "1",
@@ -207,6 +217,12 @@ export default function index() {
         findModalRef.current?.open();
       },
     },
+    {
+      key: "7",
+      label: "导出图片",
+      icon: <i className="w-20px iconfont icon-file-image" />,
+      onClick: handleExportImage,
+    },
     // {
     //   key: "6",
     //   label: "历史记录",

+ 5 - 5
apps/designer/src/utils/contentMenu.tsx

@@ -390,11 +390,11 @@ const topicMenuData: MenuItem[] = [
         fastKey: "Alt+C",
         handler: mindmapMenuHander.addIcon,
       },
-      {
-        key: "code",
-        label: "代码块",
-        handler: mindmapMenuHander.addCode,
-      },
+      // {
+      //   key: "code",
+      //   label: "代码块",
+      //   handler: mindmapMenuHander.addCode,
+      // },
     ],
   },
   {

+ 4 - 1
apps/designer/src/utils/mindmapHander.tsx

@@ -612,7 +612,10 @@ export const mindmapMenuHander = {
     tool.cell.isNode() && handleDeleteCurrentTopic(tool.graph, [tool.cell]);
   },
   exportImage(tool: ContextMenuTool) {
-    exportImage(tool.graph);
+    tool.graph.exportPNG("", {
+      quality: 1,
+      copyStyles: false,
+    });
   },
   copyImage(tool: ContextMenuTool) {
     // TODO复制为图片