2 Commity 7c085cddd5 ... ea70759324

Autor SHA1 Wiadomość Data
  zhaoyk ea70759324 Merge branch 'develop' of http://39.106.8.246:3003/BDTP/digital-delivery 2 lat temu
  zhaoyk 840f94fbef 修改演示页的加载逻辑 2 lat temu

+ 8 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/controller/DemoDiagramController.java

@@ -42,6 +42,14 @@ public class DemoDiagramController {
     }
 
     /**
+     * 读取系统图内容
+     */
+    @GetMapping("getDiagram")
+    public CommonResult<Diagram> getDiagram(@RequestParam String id) {
+        return ResultHelper.single(diagramManager.getDiagram(id));
+    }
+
+    /**
      * 新建系统图
      *
      * @param params    新建参数,对象类型,包含字段 name:名称, type:系统图类型编码

+ 10 - 1
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/manage/DemoDiagramManager.java

@@ -38,7 +38,7 @@ public class DemoDiagramManager {
 		List<DiagramType> types = dataStrategy.getDiagramTypes();
 		List<Diagram> diagrams = dataStrategy.getDiagrams(projectId, systemId, groupCode);
 		for(Diagram diagram : diagrams) {
-			manager.buildDiagram(diagram);
+			diagram.setTemplate(null); //减少传输数据量,并给前端标识
 		}
 
 		BdtpRequest req = BdtpRequest.getCurrent();
@@ -70,6 +70,15 @@ public class DemoDiagramManager {
 	}
 
 	/**
+	 * 获取系统图内容
+	 */
+	public Diagram getDiagram(String diagramId){
+		Diagram diagram = dataStrategy.getDiagram(diagramId);
+		manager.buildDiagram(diagram);
+		return diagram;
+	}
+
+	/**
 	 * 创建新的系统图
 	 */
 	public Diagram createDiagram(String name, String type, String projectId, String systemId, String groupCode){