Skip to content

数据格式说明

  DFlow提供了三种数据用于满足不同的场景需求,分别是流程数据BpmnXML设计数据

流程数据

  流程数据是一个JSON,采用有向图数据结构,仅保存了流程节点和业务属性(如:编码名称责任人下步任务条件等)。

  流程数据可以通过遍历解析流程图中各个节点,将其转换为后台业务能够识别的数据格式。适合没有基于JBPM/Activiti二次开发,而是采用完全自研的流程引擎规则引擎任务引擎

通过APItoFlowObject方法可以获取流程数据

javascript
  //获取编辑器 
  let editor = this.$refs["ddei_editor_1"].editor;
  //获取flowAPI
  let flowAPI = editor.flow
  //获取流程数据
  let flowObj = flowAPI.toFlowObject()
  //打印流程数据
  console.log(flowObj)
  //打印流程数据JSON
  console.log(JSON.stringify(flowObj))

示例

流程数据-示例-流程图

json
{
    "id": "stage_1",
    "nodes": {
        "start": {
            "id": "start_6",
            "code": "start",
            "nextNodes": [
                "line_9"
            ],
            "bpmnType": "StartEvent",
            "bpmnSubType": 1,
            "bpmnBaseType": "Event"
        },
        "userTask1": {
            "id": "user_task_8",
            "code": "userTask1",
            "name": "用户任务1",
            "prevNodes": [
                "line_9"
            ],
            "nextNodes": [
                "line_11"
            ],
            "bpmnType": "UserTask",
            "bpmnBaseType": "Activity"
        },
        "line_9": {
            "id": "line_9",
            "prevNode": "start",
            "nextNode": "userTask1",
            "ep": {
                "type": 51
            },
            "bpmnSubType": 1,
            "bpmnBaseType": "Sequence"
        },
        "scriptTask1": {
            "id": "script_task_10",
            "code": "scriptTask1",
            "name": "脚本1",
            "prevNodes": [
                "line_11"
            ],
            "nextNodes": [
                "line_13",
                "line_55"
            ],
            "bpmnType": "ScriptTask",
            "bpmnBaseType": "Activity"
        },
        "line_11": {
            "id": "line_11",
            "prevNode": "userTask1",
            "nextNode": "scriptTask1",
            "ep": {
                "type": 51
            },
            "bpmnSubType": 1,
            "bpmnBaseType": "Sequence"
        },
        "parallel_gateway_12": {
            "id": "parallel_gateway_12",
            "name": "并行网关",
            "prevNodes": [
                "line_13"
            ],
            "nextNodes": [
                "line_20"
            ],
            "bpmnType": "ParallelGateway",
            "bpmnBaseType": "Gateway"
        },
        "line_13": {
            "id": "line_13",
            "prevNode": "scriptTask1",
            "nextNode": "parallel_gateway_12",
            "ep": {
                "type": 51
            },
            "bpmnSubType": 1,
            "bpmnBaseType": "Sequence"
        },
        "subprocess_16": {
            "id": "subprocess_16",
            "name": "子流程",
            "prevNodes": [
                "line_20"
            ],
            "nextNodes": [
                "line_36"
            ],
            "bpmnType": "SubProcess",
            "bpmnSubType": 3,
            "bpmnBaseType": "Activity",
            "nodes": {
                "substart": {
                    "id": "start_18",
                    "code": "substart",
                    "prevNodes": [
                        "line_66"
                    ],
                    "nextNodes": [
                        "line_22"
                    ],
                    "subProcesses": [
                        "subprocess_16"
                    ],
                    "bpmnType": "StartEvent",
                    "bpmnSubType": 1,
                    "bpmnBaseType": "Event"
                },
                "user_task_21": {
                    "id": "user_task_21",
                    "name": "子任务1",
                    "prevNodes": [
                        "line_22"
                    ],
                    "nextNodes": [
                        "line_24",
                        "line_66"
                    ],
                    "subProcesses": [
                        "subprocess_16"
                    ],
                    "bpmnType": "UserTask",
                    "bpmnBaseType": "Activity"
                },
                "user_task_23": {
                    "id": "user_task_23",
                    "name": "子任务2",
                    "prevNodes": [
                        "line_24"
                    ],
                    "nextNodes": [
                        "line_26"
                    ],
                    "subProcesses": [
                        "subprocess_16"
                    ],
                    "bpmnType": "UserTask",
                    "bpmnBaseType": "Activity"
                },
                "subend": {
                    "id": "end_25",
                    "code": "subend",
                    "prevNodes": [
                        "line_26"
                    ],
                    "subProcesses": [
                        "subprocess_16"
                    ],
                    "bpmnType": "EndEvent",
                    "bpmnSubType": 1,
                    "bpmnBaseType": "Event"
                }
            },
            "startNodes": [
                "substart"
            ],
            "endNodes": [
                "subend"
            ]
        },
        "substart": {
            "id": "start_18",
            "code": "substart",
            "prevNodes": [
                "line_66"
            ],
            "nextNodes": [
                "line_22"
            ],
            "subProcesses": [
                "subprocess_16"
            ],
            "bpmnType": "StartEvent",
            "bpmnSubType": 1,
            "bpmnBaseType": "Event"
        },
        "line_20": {
            "id": "line_20",
            "prevNode": "parallel_gateway_12",
            "nextNode": "subprocess_16",
            "ep": {
                "type": 51
            },
            "sp": {
                "type": 4
            },
            "bpmnSubType": 2,
            "bpmnBaseType": "Sequence"
        },
        "line_22": {
            "id": "line_22",
            "prevNode": "substart",
            "nextNode": "user_task_21",
            "ep": {
                "type": 51
            },
            "bpmnSubType": 1,
            "bpmnBaseType": "Sequence"
        },
        "line_24": {
            "id": "line_24",
            "prevNode": "user_task_21",
            "nextNode": "user_task_23",
            "ep": {
                "type": 51
            },
            "bpmnSubType": 1,
            "bpmnBaseType": "Sequence"
        },
        "subend": {
            "id": "end_25",
            "code": "subend",
            "prevNodes": [
                "line_26"
            ],
            "subProcesses": [
                "subprocess_16"
            ],
            "bpmnType": "EndEvent",
            "bpmnSubType": 1,
            "bpmnBaseType": "Event"
        },
        "line_26": {
            "id": "line_26",
            "prevNode": "user_task_23",
            "nextNode": "subend",
            "ep": {
                "type": 51
            },
            "bpmnSubType": 1,
            "bpmnBaseType": "Sequence"
        },
        "complex_gateway_33": {
            "id": "complex_gateway_33",
            "prevNodes": [
                "line_36"
            ],
            "nextNodes": [
                "line_42"
            ],
            "bpmnType": "ComplexGateway",
            "bpmnBaseType": "Gateway"
        },
        "line_36": {
            "id": "line_36",
            "prevNode": "subprocess_16",
            "nextNode": "complex_gateway_33",
            "ep": {
                "type": 51
            },
            "bpmnSubType": 1,
            "bpmnBaseType": "Sequence"
        },
        "end": {
            "id": "end_41",
            "code": "end",
            "prevNodes": [
                "line_42"
            ],
            "bpmnType": "EndEvent",
            "bpmnSubType": 1,
            "bpmnBaseType": "Event"
        },
        "line_42": {
            "id": "line_42",
            "prevNode": "complex_gateway_33",
            "nextNode": "end",
            "ep": {
                "type": 51
            },
            "bpmnSubType": 1,
            "bpmnBaseType": "Sequence"
        },
        "comment_53": {
            "id": "comment_53",
            "prevNodes": [
                "line_55"
            ],
            "text": "自动执行脚本",
            "bpmnType": "Comment",
            "bpmnBaseType": "Comment"
        },
        "line_55": {
            "id": "line_55",
            "prevNode": "scriptTask1",
            "nextNode": "comment_53",
            "ep": {
                "type": 0
            },
            "sp": {
                "type": 0
            },
            "bpmnSubType": 5,
            "bpmnBaseType": "Sequence"
        },
        "line_66": {
            "id": "line_66",
            "prevNode": "user_task_21",
            "nextNode": "substart",
            "ep": {
                "type": 51
            },
            "bpmnSubType": 1,
            "bpmnBaseType": "Sequence"
        }
    },
    "startNodes": [
        "start"
    ],
    "endNodes": [
        "end"
    ]
}

说明

DDeiFlowGraph--流程图

  DDeiFlowGraph是顶级节点,是一个包含了所有流程节点、子流程和连线的流程图。

属性名说明数据类型默认值备注
id流程图IDstring系统生成流程图ID
name名称string流程图名称
nodes流程节点Map<string,DDeiFlowNode|DDeiFlowSequence>所有节点、子流程、连线
startNodes开始节点DDeiFlowNode[]所有顶级开始节点
endNodes结束节点DDeiFlowNode[]所有顶级结束节点
isolatedNodes孤立节点DDeiFlowNode[]所有孤立节点
groups分组DDeiFlowGroup[]所有分组

DDeiFlowNode--流程节点

  DDeiFlowNode表示一流程中的节点、可以是开始、结束、任务以及子流程。

属性名说明数据类型默认值备注
id节点string系统生成
code编码string
name名称string
text文本string
desc备注string
prevNodes前置节点DDeiFlowNode[]|DDeiFlowSequence[]所有前置节点
nextNodes后置节点DDeiFlowNode[]|DDeiFlowSequence[]所有后置节点
attachNodes依附节点DDeiFlowNode[]所有依附于本节点的节点
attachPNode依附节点(父)string本节点所依附节点的Key
subProcesses所属子流程IDDDeiSubProcess[]本节点所属所有子流程,按照层级关系从深到浅排列

  DDeiFlowSequence表示一流程中的连接线,用于连接前后两个节点。

属性名说明数据类型默认值备注
id节点string系统生成连线id
code编码string
name名称string
text文本string
desc备注string
prevNode前置节点DDeiFlowNode前置节点
nextNode后置节点DDeiFlowNode后置节点
condition条件string
default缺省节点boolean

  DDeiFlowSubProcess表示一个子流程,继承自DDeiFlowNode,子流程可以嵌套。

属性名说明数据类型默认值备注
id节点string系统生成子流程ID
code编码string
name名称string
text文本string
desc备注string
prevNodes前置节点DDeiFlowNode[]|DDeiFlowSequence[]所有前置节点
nextNodes后置节点DDeiFlowNode[]|DDeiFlowSequence[]所有后置节点
attachNodes依附节点DDeiFlowNode[]所有依附于本节点的节点
attachPNode依附节点(父)string本节点所依附节点的Key
subProcesses所属子流程IDstring[]本节点所属所有子流程ID,按照层级关系从深到浅排列
nodes流程节点Map<string,DDeiFlowNode|DDeiFlowSequence>当前子流程的所有节点、子流程、连线
startNodes开始节点DDeiFlowNode[]当前子流程开始节点
endNodes结束节点DDeiFlowNode[]当前子流程结束节点
isolatedNodes孤立节点DDeiFlowNode[]当前子流程孤立节点

  DDeiFlowGroup表示一个分组,分组只是在图形显示上对节点进行分类,一般不影响流程。

属性名说明数据类型默认值备注
id节点string系统生成
code编码string
name名称string
text文本string
desc备注string
nodes流程节点Map<string,DDeiFlowNode|DDeiFlowSequence>分组中范围中的所有节点

DDeiFlowFile--流程文件

  DDeiFlowFile是流程文件节点,只有当返回数据中包含多个流程图时,才会包装为DDeiFlowFile

属性名说明数据类型默认值备注
id文件idstring系统生成流程文件ID
name名称string文件名称
graphics分组DDeiFlowGraph[]所有流程图

BpmnXML

  BpmnXML是一个BPMN规范制定的一个标准,采用XML作为数据格式,可以用来完整的描述复杂的流程图。

  BpmnXML可以很方便的与主流的流程引擎JBPMActiviti集成,这些引擎都遵循BPMN规范,提供了将BpmnXML转换为流程定义的能力,同时支持在XML中扩展内容。这种格式适合基于JBPM/Activit二次开发的流程引擎规则引擎任务引擎

通过APItoBPMNXML()方法可以获取BpmnXML

javascript
  //获取编辑器 
  let editor = this.$refs["ddei_editor_1"].editor;
  //获取flowAPI
  let flowAPI = editor.flow
  //获取流程数据
  let bpmnXML = flowAPI.toBPMNXML()
  //打印bpmnXML
  console.log(bpmnXML)

示例

流程数据-示例-流程图

xml
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions id="a8bfc36085a06dda9812567699ae4493"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
    xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
    xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
    xmlns:di="http://www.omg.org/spec/DD/20100524/DI" targetNamespace="http://bpmn.io/schema/bpmn">
    <bpmn:process id="stage_1" isExecutable="true">
        <bpmn:startEvent id="start_6"/>
        <bpmn:userTask id="userTask1" name="用户任务1">
            <bpmn:incoming>line_9</bpmn:incoming>
            <bpmn:outgoing>line_11</bpmn:outgoing>
        </bpmn:userTask>
        <bpmn:sequenceFlow id="line_9" sourceRef="start" targetRef="userTask1"/>
        <bpmn:scriptTask id="scriptTask1" name="脚本1">
            <bpmn:incoming>line_11</bpmn:incoming>
            <bpmn:outgoing>line_13</bpmn:outgoing>
            <bpmn:outgoing>line_55</bpmn:outgoing>
        </bpmn:scriptTask>
        <bpmn:sequenceFlow id="line_11" sourceRef="userTask1" targetRef="scriptTask1"/>
        <bpmn:parallelGateway id="parallel_gateway_12" name="并行网关">
            <bpmn:incoming>line_13</bpmn:incoming>
            <bpmn:outgoing>line_20</bpmn:outgoing>
        </bpmn:parallelGateway>
        <bpmn:sequenceFlow id="line_13" sourceRef="scriptTask1" targetRef="parallel_gateway_12"/>
        <bpmn:transaction id="subprocess_16" name="子流程">
            <bpmn:startEvent id="start_18"/>
            <bpmn:userTask id="user_task_21" name="子任务1"/>
            <bpmn:userTask id="user_task_23" name="子任务2"/>
            <bpmn:endEvent id="end_25"/>
            <bpmn:transaction/>
            <bpmn:startEvent id="start_18"/>
            <bpmn:sequenceFlow id="line_20" sourceRef="parallel_gateway_12" targetRef="subprocess_16"/>
            <bpmn:sequenceFlow id="line_22" sourceRef="substart" targetRef="user_task_21"/>
            <bpmn:sequenceFlow id="line_24" sourceRef="user_task_21" targetRef="user_task_23"/>
            <bpmn:endEvent id="end_25"/>
            <bpmn:sequenceFlow id="line_26" sourceRef="user_task_23" targetRef="subend"/>
            <bpmn:complexGateway id="complex_gateway_33">
                <bpmn:incoming>line_36</bpmn:incoming>
                <bpmn:outgoing>line_42</bpmn:outgoing>
            </bpmn:complexGateway>
            <bpmn:sequenceFlow id="line_36" sourceRef="subprocess_16" targetRef="complex_gateway_33"/>
            <bpmn:endEvent id="end_41"/>
            <bpmn:sequenceFlow id="line_42" sourceRef="complex_gateway_33" targetRef="end"/>
            <bpmn:textAnnotation id="comment_53">
                <bpmn:text>自动执行脚本</bpmn:text>
            </bpmn:textAnnotation>
            <bpmn:association id="line_55" targetRef="comment_53" sourceRef="scriptTask1" associationDirection="None"/>
            <bpmn:sequenceFlow id="line_66" sourceRef="user_task_21" targetRef="substart"/>
        </bpmn:process>
        <bpmndi:BPMNDiagram id="Diagram_a8bfc36085a06dda9812567699ae4493">
            <bpmndi:BPMNPlane id="Plane_stage_1" bpmnElement="stage_1">
                <bpmndi:BPMNShape id="start_id" bpmnElement="start">
                    <dc:Bounds x="636.5198768402898" y="1551.4017666040695" width="39.9996163981607" height="39.99961639816047"/>
                </bpmndi:BPMNShape>
                <bpmndi:BPMNShape id="userTask1_id" bpmnElement="userTask1">
                    <dc:Bounds x="736.5194932384504" y="1536.4015748031497" width="110" height="70"/>
                </bpmndi:BPMNShape>
                <bpmndi:BPMNEdge id="line_9_id" bpmnElement="line_9">
                    <di:waypoint x="676.5194932384505" y="1571.4015748031497"/>
                    <di:waypoint x="736.5194932384504" y="1571.4015748031497"/>
                </bpmndi:BPMNEdge>
                <bpmndi:BPMNShape id="scriptTask1_id" bpmnElement="scriptTask1">
                    <dc:Bounds x="906.5194932384501" y="1536.4015748031497" width="110.00000000000023" height="70"/>
                </bpmndi:BPMNShape>
                <bpmndi:BPMNEdge id="line_11_id" bpmnElement="line_11">
                    <di:waypoint x="846.5194932384504" y="1571.4015748031497"/>
                    <di:waypoint x="906.5194932384504" y="1571.4015748031497"/>
                </bpmndi:BPMNEdge>
                <bpmndi:BPMNShape id="parallel_gateway_12_id" bpmnElement="parallel_gateway_12">
                    <dc:Bounds x="1076.5194932384507" y="1546.4015748031497" width="50" height="50"/>
                </bpmndi:BPMNShape>
                <bpmndi:BPMNEdge id="line_13_id" bpmnElement="line_13">
                    <di:waypoint x="1016.5194932384503" y="1571.4015748031497"/>
                    <di:waypoint x="1076.5194932384507" y="1571.4015748031497"/>
                </bpmndi:BPMNEdge>
                <bpmndi:BPMNShape id="subprocess_16_id" bpmnElement="subprocess_16">
                    <dc:Bounds x="1205.5196850393709" y="1430" width="406.9999999999982" height="283"/>
                </bpmndi:BPMNShape>
                <bpmndi:BPMNShape id="substart_id" bpmnElement="substart">
                    <dc:Bounds x="1210.5198768402893" y="1551.5001918009198" width="39.99961639816047" height="39.99961639816047"/>
                </bpmndi:BPMNShape>
                <bpmndi:BPMNEdge id="line_20_id" bpmnElement="line_20">
                    <di:waypoint x="1126.5194932384507" y="1571.4015748031497"/>
                    <di:waypoint x="1205.5196850393709" y="1571.5"/>
                </bpmndi:BPMNEdge>
                <bpmndi:BPMNEdge id="line_22_id" bpmnElement="line_22">
                    <di:waypoint x="1250.5194932384502" y="1571.5"/>
                    <di:waypoint x="1284.5194932384502" y="1571.5"/>
                </bpmndi:BPMNEdge>
                <bpmndi:BPMNEdge id="line_24_id" bpmnElement="line_24">
                    <di:waypoint x="1394.5194932384497" y="1571.5"/>
                    <di:waypoint x="1420.0196850393704" y="1571.5"/>
                </bpmndi:BPMNEdge>
                <bpmndi:BPMNShape id="subend_id" bpmnElement="subend">
                    <dc:Bounds x="1565.019685039369" y="1551.5001918009198" width="39.99961639816138" height="39.99961639816047"/>
                </bpmndi:BPMNShape>
                <bpmndi:BPMNEdge id="line_26_id" bpmnElement="line_26">
                    <di:waypoint x="1530.01968503937" y="1571.5"/>
                    <di:waypoint x="1565.01968503937" y="1571.5"/>
                </bpmndi:BPMNEdge>
                <bpmndi:BPMNShape id="complex_gateway_33_id" bpmnElement="complex_gateway_33">
                    <dc:Bounds x="1652.4864532214012" y="1546.4015748031497" width="50.000000000001364" height="50"/>
                </bpmndi:BPMNShape>
                <bpmndi:BPMNEdge id="line_36_id" bpmnElement="line_36">
                    <di:waypoint x="1612.519685039369" y="1571.5"/>
                    <di:waypoint x="1652.4864532214037" y="1571.4015748031497"/>
                </bpmndi:BPMNEdge>
                <bpmndi:BPMNShape id="end_id" bpmnElement="end">
                    <dc:Bounds x="1762.4864532214033" y="1551.4017666040695" width="39.99961639815956" height="39.99961639816047"/>
                </bpmndi:BPMNShape>
                <bpmndi:BPMNEdge id="line_42_id" bpmnElement="line_42">
                    <di:waypoint x="1702.4864532214015" y="1571.4015748031497"/>
                    <di:waypoint x="1762.4864532214028" y="1571.4015748031497"/>
                </bpmndi:BPMNEdge>
                <bpmndi:BPMNShape id="comment_53_id" bpmnElement="comment_53">
                    <dc:Bounds x="932.7541871160014" y="1429.8990237827416" width="105.53061224489795" height="40.25510204081638"/>
                </bpmndi:BPMNShape>
                <bpmndi:BPMNEdge id="line_55_id" bpmnElement="line_55">
                    <di:waypoint x="961.5194932384502" y="1536.4015748031497"/>
                    <di:waypoint x="985.5194932384504" y="1470.154125823558"/>
                </bpmndi:BPMNEdge>
                <bpmndi:BPMNEdge id="line_66_id" bpmnElement="line_66">
                    <di:waypoint x="1284.5194932384502" y="1571.5"/>
                    <di:waypoint x="1250.5194932384497" y="1571.5"/>
                </bpmndi:BPMNEdge>
            </bpmndi:BPMNPlane>
        </bpmndi:BPMNDiagram>
    </bpmn:definitions>

说明

  关于BpmnXML可以参考BPMN的规范或JBPM/Activiti的相关文档。

设计数据

  设计数据是一个JSON,保存了所绘流程图的完整信息,包括图形属性(如:大小位置颜色字体等)和业务属性(如:编码名称责任人节点连接等)。通过DDeiEditorfiles属性能够获取所有打开文件的文件,通过DDeiFiletoJSON方法就能够得到如下JSON。可以结合设计图可以很了解其结构,JSON是从DDeiFile这一层级开始。

  设计数据可以完整的还原流程图,并且可以转换为流程数据BpmnXML。适合用来回显流程图。由于需要存储所有设计细节,占用空间较大,不利于便利和检索。在上一节的loadData方法中,我们传入的就是设计数据

设计器中的所有都是以文件形式保存,通过APIfiles对象,可以获取完整的设计数据

javascript
  //获取编辑器 
  let editor = this.$refs["ddei_editor_1"].editor;
  //获取JSON对象(设计数据)
  let file = editor.files[0]
  //将文件对象转换为JSON字符串(设计数据)
  let designData = file.toJSON()
  //打印设计数据
  console.log(designData)
  //打印设计数据JSON
  console.log(JSON.stringify(designData))

设计数据-数据结构

示例

json
{
    "id": "1234567890", 
    "name": "新建文件_NEW",
    "desc": "",
    "extData": {},
    "state": 2,
    "publish": "0",
    "lastUpdateTime": 1720510890856,
    "path": "/新建文件_NEW",
    "currentSheetIndex": 0,
    "modelType": "DDeiFile",
    "modelNumber": 6,
    "unicode": "7c2e23e9a3786cd895d4999084ef6262",
    "ddeiVersion": 1237,
    "sheets": [
        {
            "name": "页面-1",
            "desc": "页面-1",
            "stage": {
                "id": "stage_1",
                "layers": [
                    {
                        "id": "layer_11",
                        "name": "图层1",
                        "models": {
                            "end_17": {
                                "id": "end_17",
                                "modelCode": "102090",
                                "modelType": "DDeiPolygon",
                                "cpv": {
                                    "x": 175.48749999999998,
                                    "y": 110.159375,
                                    "z": 1
                                },
                                "hpv": [
                                    {
                                        "x": 175.48749999999998,
                                        "y": 110.159375,
                                        "z": 1
                                    },
                                    {
                                        "x": 201.94583333333333,
                                        "y": 110.159375,
                                        "z": 1
                                    }
                                ],
                                "exPvs": {},
                                "poly": 2,
                                "mirrorX": false,
                                "mirrorY": false,
                                "sptStyle": {},
                                "fill": {
                                    "color": "black"
                                },
                                "bpv": {
                                    "x": 186.07083333333333,
                                    "y": 120.74270833333333,
                                    "z": 1
                                }
                            },
                            "start_19": {
                                "id": "start_19",
                                "modelCode": "102001",
                                "modelType": "DDeiPolygon",
                                "cpv": {
                                    "x": 175.48749999999998,
                                    "y": 65.18020833333334,
                                    "z": 1
                                },
                                "hpv": [
                                    {
                                        "x": 175.48749999999998,
                                        "y": 65.18020833333334,
                                        "z": 1
                                    },
                                    {
                                        "x": 201.94583333333333,
                                        "y": 65.18020833333334,
                                        "z": 1
                                    }
                                ],
                                "exPvs": {},
                                "poly": 2,
                                "mirrorX": false,
                                "mirrorY": false,
                                "sptStyle": {},
                                "bpv": {
                                    "x": 186.07083333333333,
                                    "y": 75.76354166666667,
                                    "z": 1
                                }
                            }
                        },
                        "midList": [
                            "end_17",
                            "start_19"
                        ],
                        "modelType": "DDeiLayer",
                        "baseModelType": "DDeiLayer",
                        "index": 0,
                        "background": null,
                        "display": 1,
                        "lock": false,
                        "print": true,
                        "centerOpPoints": [],
                        "modelCode": "DDeiLayer",
                        "modelChanged": true,
                        "modelNumber": 2
                    },
                    {
                        "id": "layer_default",
                        "name": "图层",
                        "models": {
                            "task_6": {
                                "id": "task_6",
                                "modelCode": "102010",
                                "modelType": "DDeiPolygon",
                                "cpv": {
                                    "x": 92.14375000000001,
                                    "y": 65.70937500000001,
                                    "z": 1
                                },
                                "hpv": [
                                    {
                                        "x": 92.14375000000001,
                                        "y": 65.70937500000001,
                                        "z": 1
                                    },
                                    {
                                        "x": 118.60208333333334,
                                        "y": 65.70937500000001,
                                        "z": 1
                                    }
                                ],
                                "exPvs": {
                                    "_84b25e15bf91626b80631bd0d088255e": {
                                        "x": 92.14375000000001,
                                        "y": 74.96979166666667,
                                        "z": 1,
                                        "rate": 0.5,
                                        "sita": 90,
                                        "index": 0,
                                        "id": "_84b25e15bf91626b80631bd0d088255e"
                                    }
                                },
                                "poly": 2,
                                "mirrorX": false,
                                "mirrorY": false,
                                "sptStyle": {},
                                "text": "A",
                                "bpv": {
                                    "x": 121.24791666666667,
                                    "y": 84.23020833333334,
                                    "z": 1
                                }
                            },
                            "task_8": {
                                "id": "task_8",
                                "modelCode": "102011",
                                "modelType": "DDeiPolygon",
                                "cpv": {
                                    "x": 135.53541666666666,
                                    "y": 124.71145833333333,
                                    "z": 1
                                },
                                "hpv": [
                                    {
                                        "x": 135.53541666666666,
                                        "y": 124.71145833333333,
                                        "z": 1
                                    },
                                    {
                                        "x": 161.99375,
                                        "y": 124.71145833333333,
                                        "z": 1
                                    }
                                ],
                                "exPvs": {
                                    "_b9bcf285ebba6247bf5593eaa3f1fdb7": {
                                        "x": 135.53541666666666,
                                        "y": 115.45104166666667,
                                        "z": 1,
                                        "rate": 0.5,
                                        "sita": -90,
                                        "index": 2,
                                        "id": "_b9bcf285ebba6247bf5593eaa3f1fdb7"
                                    }
                                },
                                "poly": 2,
                                "mirrorX": false,
                                "mirrorY": false,
                                "sptStyle": {},
                                "text": "B",
                                "border": {
                                    "round": 5
                                },
                                "bpv": {
                                    "x": 164.63958333333335,
                                    "y": 143.23229166666667,
                                    "z": 1
                                }
                            },
                            "line_10": {
                                "id": "line_10",
                                "modelCode": "100401",
                                "modelType": "DDeiLine",
                                "hpv": [
                                    {
                                        "x": 92.14375000000001,
                                        "y": 74.96979166666667,
                                        "z": 1
                                    },
                                    {
                                        "x": 118.60208333333334,
                                        "y": 74.96979166666667,
                                        "z": 1
                                    }
                                ],
                                "pvs": [
                                    {
                                        "x": 92.14375000000001,
                                        "y": 74.96979166666667,
                                        "z": 1,
                                        "isVector3": true
                                    },
                                    {
                                        "x": 92.14375000000001,
                                        "y": 95.21041666666667,
                                        "z": 1
                                    },
                                    {
                                        "x": 135.53541666666666,
                                        "y": 95.21041666666667,
                                        "z": 1
                                    },
                                    {
                                        "x": 135.53541666666666,
                                        "y": 115.45104166666667,
                                        "z": 1,
                                        "isVector3": true
                                    }
                                ],
                                "exPvs": {},
                                "mirrorX": false,
                                "mirrorY": false,
                                "sptStyle": {},
                                "type": 2,
                                "linkModels": {
                                    "lsm_10": {
                                        "type": 3,
                                        "dmid": "lsm_10"
                                    }
                                },
                                "freeze": 0
                            },
                            "lsm_10": {
                                "id": "lsm_10",
                                "modelCode": "100200",
                                "modelType": "DDeiPolygon",
                                "cpv": {
                                    "x": 113.83958333333334,
                                    "y": 95.21041666666667,
                                    "z": 1
                                },
                                "hpv": [
                                    {
                                        "x": 113.83958333333334,
                                        "y": 95.21041666666667,
                                        "z": 1
                                    },
                                    {
                                        "x": 140.29791666666665,
                                        "y": 95.21041666666667,
                                        "z": 1
                                    }
                                ],
                                "exPvs": {},
                                "poly": 2,
                                "mirrorX": false,
                                "mirrorY": false,
                                "sptStyle": {},
                                "borderType": 0,
                                "text": "连接",
                                "font": {
                                    "size": 12
                                },
                                "bpv": {
                                    "x": 135.00625,
                                    "y": 101.82499999999999,
                                    "z": 1
                                }
                            }
                        },
                        "midList": [
                            "task_6",
                            "task_8",
                            "line_10",
                            "lsm_10"
                        ],
                        "modelType": "DDeiLayer",
                        "baseModelType": "DDeiLayer",
                        "index": 1,
                        "background": null,
                        "display": 1,
                        "lock": true,
                        "print": true,
                        "centerOpPoints": [],
                        "modelCode": "DDeiLayer",
                        "modelChanged": true,
                        "modelNumber": 4
                    }
                ],
                "layerIndex": 0,
                "idIdx": 20,
                "modelType": "DDeiStage",
                "ratio": 1,
                "width": 2245.0393700787404,
                "height": 1587.4015748031497,
                "wpv": {
                    "x": -658.5196850393702,
                    "y": -488.20078740157487,
                    "z": 0
                },
                "links": [
                    {
                        "smid": "task_6",
                        "dmid": "line_10",
                        "smpath": "exPvs._84b25e15bf91626b80631bd0d088255e",
                        "dmpath": "startPoint"
                    },
                    {
                        "smid": "task_8",
                        "dmid": "line_10",
                        "smpath": "exPvs._b9bcf285ebba6247bf5593eaa3f1fdb7",
                        "dmpath": "endPoint"
                    }
                ],
                "spv": {
                    "x": 561.2598425196851,
                    "y": 396.85039370078744,
                    "z": 1
                },
                "modelCode": "DDeiStage",
                "unit": "mm"
            },
            "active": 1,
            "modelType": "DDeiSheet",
            "unicode": "741d8249192061ceb6228a5ba7df035f"
        }
    ]
}

说明

第一级DDeiFile

属性名说明数据类型默认值备注
ididstring文件唯一标识
unicode标识码string唯一标识
name名称string文件名称
path路径string文件路径
desc说明string文件说明
modelNumber模型数量number文件的所有页签的图形数量总和
modelType模型类型stringDDeiFile文件的模型类别
state状态number文件状态
publish发布状态number0未发布,1已发布
lastUpdateTime最后更新时间number最后修改文件的时间
extData扩展数据object用于存储一些业务相关的扩展数据
ddeiVersionDDei版本number当前文件保存时的DDei版本,用于兼容性检查
currentSheetIndex当前页签下标number0当前哪个页签处于激活状态
sheets页签object[]文件所包含的页签集合,至少包含1个页签,参考第二级DDeiSheet

第二级DDeiSheet

属性名说明数据类型默认值备注
unicode标识码string页签唯一标识
name页签名称string页签的显示标题名称
desc页签说明string页签的说明备注
modelType模型类型stringDDeiSheet页签的模型类型
active激活状态number01激活/0未激活
stage舞台object页签的舞台,一个页签有且只有一个舞台,参考第三级DDeiStage

第三级DDeiStage

属性名说明数据类型默认值备注
id舞台IDstring舞台的唯一标识
unicode唯一编号string系统生成自动编码
modelCode模型类型stringDDeiStage舞台的模型类型
modelType模型类型stringDDeiStage舞台的模型类型
idIdx当前图形的ID种子number
ratio缩放比率number1.0
width画布宽度number
height画布高度number
wpv视窗开始点object(0,0,0)
spv纸张标量开始点object中心
mark水印object查看详情
paper纸张object查看详情
ruler标尺object查看详情
grid网格线object查看详情
unit单位stringpxpx像素/cm厘米/mm毫米/inch英寸/m米,当前舞台用来表示大小和位置的单位
links链接集合object[]记录了舞台中所有连线和图形的链接信息,可以用此对象来判定两个图形的前后连接关系
links[n].smid源对象IDstring一般为图形的ID
links[n].dmid目标对象IDstring一般为线的ID
links[n].smpath源对象属性路径string一般为线的端点之一
links[n].dmpath目标对象属性路径string一般为图形的扩展端点
layerIndex当前的图层下标number-1
layers图层集合object[]舞台的所有图层结合,参考第四级DDeiLayer

第四级DDeiLayers

属性名说明数据类型默认值备注
id图层IDstring
unicode唯一编号string系统生成自动编码
name名称string系统生成
models控件集合object<string,object>key为控件ID,value为控件对象,参考控件和容器
midList控件ID集合string[]子控件id列表,带排序
index下标number当前layer所在stage的下标
display是否显示number10不显示/1显示
lock锁定booleanfalse
print打印booleantrue
modelNumber模型总数量object0
bg背景object查看详情
modelType模型类型stringDDeiLayer

控件和容器

  到这一级就能够获取到具体控件的属性了,由于图形控件的属性支持自定义,因此只列举公共的属性。在这一层中有一种特殊情况,当出现组合控件或容器控件时,需要继续通过midListmodels进行遍历。才能获取更深层次的控件。

属性名说明数据类型默认值备注
id图形IDstring画布唯一
unicode唯一编号string系统生成自动编码
code编码string
text文本string
poly坐标策略number11直角坐标/2极坐标
rotate旋转量number1.0只读
cpv中心点向量object(0,0,0)中心点坐标
hpv平行拉伸向量objec[]用于计算旋转/拉伸量
pvs点向量object[]构成图形的所有点
essBounds实际大小object未经旋转、缩放的实际大小
text文本string显示文本
sptStyle特殊文本样式object[]
zIndex图层层次number影响渲染顺序
state背景DDeiEnumControlStateDEFAULT
stage所属舞台DDeiStage
layer所属图层DDeiLayer
pModel所属容器DDeiContainer
modelCode模型的编码string区分modelType相同,但业务含义不同的模型
modelType模型类型stringAbstractShape
border边框object
border.type边框类型number0无/1实线
border.color边框颜色string
border.opacity透明度number0-1之间1
border.width宽度number>01
border.dash线段样式Array>0
border.roung圆角number0-100
fill填充object
fill.type填充类型number0无/1纯色/2图片
fill.color填充颜色string
fill.image填充图片string
fill.opacity透明度number0-1之间1
font字体object
font.family字体名称string系统默认
font.color字体颜色stringblack
font.size字体大小string14
textStyle文本样式object
textStyle.align横向对齐number1左/2中/3右2
textStyle.valign纵向对齐number1上/2中/3下2
textStyle.feed自动换行number1是/0否1
textStyle.scale超范围策略number0隐藏/1省略/2缩小/3扩展0
textStyle.lockWidth锁定宽度number0否/1是0
textStyle.hollow镂空number0否/1是0
textStyle.bold加粗number0否/1是0
textStyle.italic斜体number0否/1是0
textStyle.underline下划线number0否/1是0
textStyle.deleteline删除线number0否/1是0
textStyle.bgcolor文本背景string
textStyle.hspace水平间距number0-100.5
textStyle.vspace垂直间距number0-100.5
mirrorX水平镜像booleanfalse
mirrorY垂直镜像booleanfalse

技术支持

QQ:3697355039
微信公众号:ddei757