{% set definitions = get_org_flow_definition(request) %} {% if definitions %} { "widgettype": "menu", "options": { "cwidth": 10, "target": "page-center", "height": "100%", "items": [ { "name": "instances", "icon": "{{entire_url('/bricks/imgs/workflow.svg')}}", "label": "新建流程", "url": "{{entire_url('new_definition')}}" }, {% for d in definitions %} { "name": "{{d.id}}", "icon": "{{entire_url('/bricks/imgs/mywork.svg')}}", "label": "{{d.name}}", "tip": "{{d.desciption}}", "items": [ { "name": "instances", "icon": "{{entire_url('/bricks/imgs/wf-instance.svg')}}", "label": "新建流程", "url": "{{entire_url('new_instance.ui')}}" }, {% set instances = list_org_instances(request, flow_def_id=d.id) %} {% for inst in instances %} { "name": "{{inst.id}}", "icon": "{{entire_url('/bricks/imgs/wf-instance.svg')}}", "label": "{{inst.name}}:{{inst.id}}", "items": [ { "name": "{{inst.id}}_show", "icon": "{{entire_url('/bricks/imgs/wf-instance.svg')}}", "label": "实例明细:{{inst.id}}", “url": "{{entire_url('show_instance.ui')}}" }, {% set works = get_my_flow_works(request) %} {% for work in works %} { "name": "{{inst.id}}_show", "icon": "{{entire_url('/bricks/imgs/wf-instance.svg')}}", "label": "我的工作:{{inst.id}}", "items": [ ] }{% if not loop.last %},{% endif %} {% endfor %} ] }{% if not loop.last %},{% endif %} {% endfor %} ] }{% if not loop.last %},{% endif %} {% endfor %} ] } } {% endif %}