<html>

<head>
  <title>天翎引擎式开发后台</title>
  <!-- <link rel="shortcut icon" type="images/x-icon" href="/designer/resource/images/preview/favicon.ico" media="screen" />
         -->
  <link href="style/bootstrap.min.css" rel="stylesheet" type="text/css" />
  <!-- <link href="style/bootstrap.min.css.map" rel="stylesheet" type="text/css" /> -->
  <link href="../js/jquery-ui/external/ui.dialog.maximize.css" rel="stylesheet" type="text/css" />
  <link href="../js/jquery-ui/css/smoothness/jquery-ui-1.9.2.custom.css" rel="stylesheet" type="text/css" />
  <link href="style/design.css" rel="stylesheet" type="text/css" />

  <script src="./script/jquery-1.11.3.min.js"></script>
  <!-- <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script> -->
  <script
    src="https://cdn.jsdelivr.net/gh/jquery-i18n-properties/jquery-i18n-properties/jquery.i18n.properties.min.js"></script>
  <!-- <script src="../js/jquery-ui/js/jquery-obpm-extend.js"></script>
    <script src="../js/jquery-ui/js/jquery-ui-1.9.2.custom.dialog.min.js"></script>
    <script src="../js/jquery-ui/plugins/jquery.form.js"></script>
    <script src="../js/jquery-ui/external/jquery.bgiframe-2.1.1.js"></script>
    <script src="../js/jquery-ui/external/ui.dialog.maximize.js"></script>
    <script src="../js/jquery-ui/external/jquery-framedialog.js"></script> -->

  <script src="../js/jquery-ui/plugins/layout/jquery.layout.js"></script>
  <script src="../js/util.js"></script>
  <script src="../js/list.js"></script>
  <script src="../js/generic.js"></script>
</head>

<body>
  <div class="workflows-topbar">
    <div class="d-inline-block" data-lang="Workflow_Info">流程信息</div>
    <div class="float-right">
      <button class="bpm-btn bpm-btn-primary handleTest" onclick="handleTest(this)" data-lang="fullscreen">全屏操作</button>
      <button class="bpm-btn bpm-btn-primary closeAllScren" onclick="closeAllScren(this)" style="display:none"
        data-lang="cancelFullScreen">取消全屏</button>

      <button class="activity-save bpm-btn bpm-btn-primary" data-lang="save">保存</button>
      <button class="activity-exit bpm-btn" data-lang="exit">退出</button>
    </div>
  </div>
  <div class="workflows-content" style="overflow:hidden">
    <div class="bpm-activitybar workflows-activitybar border py-1 text-center" style="position: relative;">
      <div>
        <button class="activity-relation p-0 mb2">
          <img src="./images/relation.png" title="箭头'/'" class="w30" />
        </button>
        <button class="activity-start p-0 mb2">
          <img src="./images/ic_start1.png" title="开始节点" class="w30"  draggable="true" ondragstart="drag(event)"/>
        </button>
        <button class="activity-complete p-0 mb2">
          <img src="./images/ic_complate1.png" title="完成节点" class="w30" draggable="true"  ondragstart="drag(event)"/>
        </button>
        <!-- <button class="activity-gateway p-0 mb2">
          <img src="./images/ic_gateway.png" title="网关节点" class="w30" />
        </button> -->
        <button class="activity-auto p-0 mb2">
          <img src="./images/ic_auto.png" title="自动节点" class="w30" draggable="true"  ondragstart="drag(event)"/>
        </button>
        <button class="activity-manual p-0 mb2">
          <img src="./images/ic_manual.png" title="人工节点" class="w30" draggable="true"  ondragstart="drag(event)" />
        </button>
        <button class="activity-subflow p-0 mb2">
          <img src="./images/ic_subflow.png" title="子流程节点" class="w30" draggable="true"  ondragstart="drag(event)"/>
        </button>
      </div>
      <div style="position: absolute; bottom: 0;">
        <button class="activity-eraser p-0 mb2">
          <img src="./images/erase.png" title="清除" class="w30" />
        </button>
        <button class="activity-big p-0 mb2">
          <img src="./images/bigCanvas.png" title="放大" class="w30" />
        </button>
        <button class="activity-small p-0 mb2">
          <img src="./images/smallCanvas.png" title="缩小" class="w30" />
        </button>
      </div>
    </div>
    
    <div class="bpm-card border" style="width: calc(100% - 42px - 240px);">
      <div class="workflows-toolbar">
        <button class="alignLeft" title="左对齐"><img src="./images/alignLeft.png" class="w16" /></button>
        <button class="alignVertical" title="垂直对齐"><img src="./images/alignVertical.png" class="w16" /></button>
        <button class="alignRight" title="右对齐"><img src="./images/alignRight.png" class="w16" /></button>
        <button class="alignTop" title="上对齐"><img src="./images/alignTop.png" class="w16" /></span>
        <button class="alignHorizontal" title="居中对齐"><img src="./images/alignHorizontal.png" class="w16" /></span>
        <button class="alignBottom" title="底部对齐"><img src="./images/alignBottom.png" class="w16" /></span>
      </div>
      <div style="height: calc(100% - 30px);" class="workflows-canvas" id="diagramProcess" ondragover="allowDrop(event)">
        <canvas id="workflows-canvas" width="10000" height="1536"></canvas>
      </div>
    </div>
    <div class="bpm-card workflows-setting d-flex flex-column border">
      <div class="edit-title d-flex">
        <div class="edit-title-txt"></div>
      </div>
      <div class="edit-content-panel p-2" style="overflow:visible !important">
        <div class="edit-content"></div>
      </div>
    </div>
    <form action="save.action" method="post" id="formItem" onsubmit="ev_onsubmit();" theme="simple" name="flow">
      <input type="hidden" name="content.parentId" />
      <!-- value="${content.parentId}" -->
      <input type="text" id="flexmulti" name="flexmulti" style="display: none" />
      <input type="hidden" name="parentId" /><!-- value="${param['parentId']}" -->
      <input type="hidden" name="_moduleid" /><!-- value="${param['parentId']}"  -->
      <input type="hidden" name="content.checkout" />
      <!-- value="${content.checkout}" -->
      <input type="hidden" name="content.checkoutHandler" />
      <!-- value="${content.checkoutHandler}" -->

      <input type="hidden" name="sm_subject" /><!-- value="${param['sm_subject']}"  -->
      <input type="hidden" class="input-cmd" id="content.subject" name="content.subject" />
      <!-- value="${content.subject}" -->
      <input type="hidden" class="input-cmd" id="authorname" />
      <!-- value="${sessionScope.USER.name}" -->
      <input type="hidden" class="input-cmd" name="content.authorname" />
      <!-- value="${sessionScope.USER.id}" -->
      <input type="hidden" class="input-cmd" name="content.id" />
      <!-- value="${content.id}" -->
      <!-- <c:if test="${content.id}">
          <f_rt:formatDate value="${content.lastmodify}" pattern="yyyy-MM-dd" />
        </c:if> -->
      <div id="xmlcontent" style="display: none; width:750px; height:300px;">
        <textarea id="flow_container" name="content.flow" style="width:700px;height:350px;color:gray">
          </textarea>
      </div>
    </form>
  </div>
</body>
<!-- 流程面板主题 -->
<script type="text" id="editflowdiagram-tmpl">
    <div id="flowDiagram">
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#BasicInfo" id="baseInfo" data-lang="basic_info">基本信息</div>
            <!-- {*[cn.myapps.runtime.workflow.basic_info]*}  {*[Subject]*}   {*[Author]*}   {*[cn.myapps.runtime.workflow.show_code]*}-->
            <div id="BasicInfo" class="collapse show" data-parent="#flowDiagram">
                <div class="m-2" data-lang="subject">主题:</div>
                <div class="m-2"><input class="subject" value="{{subject}}" /></div>
                <div class="m-2" data-lang="author">作者:</div>
                <div class="m-2"><input class="authorname" value="{{authorname}}" /></div>

                <div class="m-2 mt-3">
                    <button name="showCode" data-lang="show_code">查看源代码</button>
                </div>
            </div>
        </div>
    </div>
  </script>
<!-- 开始和结束节点 -->
<script type="text" id="editstartnode-tmpl">
    <div id="startNode">
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#BasicInfo" data-lang="basic_info">基本信息</div>
            <div id="BasicInfo" class="collapse show" data-parent="#startNode">
                <div class="m-2" data-lang="name">名称:</div>
                <div class="m-2"><input class="name" value="{{name}}" /></div>
                <div class="m-2" data-lang="statelabel">状态标签:</div>
                <div class="m-2"><input class="statelabel" value="{{statelabel}}" /></div>
            </div>
        </div>
    </div>
  </script>
<!-- 完成节点 -->
<script type="text" id="editcompletenode-tmpl">
    <div id="completeNode">
        <div class="card bpm-collapse-item">
            <div class="card-header p-2" data-toggle="collapse" data-target="#BasicInfo" data-lang="basic_info">基本信息</div>
            <div id="BasicInfo" class="collapse show" data-parent="#completeNode">
                <div class="m-2" data-lang="name">名称:</div>
                <div class="m-2"><input class="name" value="{{name}}" /></div>
                <div class="m-2" data-lang="statelabel">标签状态:</div>
                <div class="m-2"><input class="statelabel" value="{{statelabel}}" /></div>
                <div class="m-2" data-lang="orderNum">排序号:</div>
                <div class="m-2"><input class="orderNum" value="{{orderNum}}" type="number" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"/></div>
            </div>
        </div>
        <div class="card bpm-collapse-item">
            <div class="card-header p-2" data-toggle="collapse" data-target="#AuditSet" data-lang="audit_setup">审批设置</div>
            <div id="AuditSet" class="collapse" data-parent="#completeNode">
                <div class="m-2" data-lang="centralized">审批到达设置:</div>
                <div class="m-2">
                    <input type="radio" name="isgather" {{if isgather == true}}checked{{/if}} value="true" />
                    <span data-lang="step-by-step_approval_node">(聚合)当上步有多个审批节点时,所有节点完成,流程可以到达</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="isgather" {{if isgather == false}}checked{{/if}} value="false" />
                    <span data-lang="multiple-step_approval_nodes">(非聚合)当上步有多个审批节点时,只要任一节点完成,则流程到达</span>
                </div>
                <div class="m-2 {{if isgather == false}}d-none{{/if}}"data-componentName="isgather" data-value="true" >
                    <select class="w-100" name="splitStartNode">
                        {{each splitStartOptions as options}}
                        <option value="{{options.id}}" {{if options.id == splitStartNode}}selected{{/if}}>{{options.name}}</option>
                        {{/each}}
                    </select>
                </div>
            </div>
        </div>
        <div class="card bpm-collapse-item">
            <div class="card-header p-2" data-toggle="collapse" data-target="#AutoArchiveSet" data-lang="archive">自动归档</div>
            <div id="AutoArchiveSet" class="collapse" data-parent="#completeNode">
                <div class="m-2">
                    <input type="checkbox" name="isAutoArchive" {{if isAutoArchive == true}}checked{{/if}} /><span data-lang="turnOnArchive">启动自动归档</span>
                </div>
            </div>
        </div>
    </div>
</script>
<!-- 网关节点 -->
<script type="text" id="editgatewaynode-tmpl">
  <div id="gatewayNode">
    <div class="card bpm-collapse-item">
      <div class="card-header p-2" data-toggle="collapse" data-target="#BasicInfo" data-lang="basic_info">基本信息</div>
      <div id="BasicInfo" class="collapse show" data-parent="#gatewayNode">
        <div class="m-2" data-lang="name">名称:</div>
        <div class="m-2"><input class="name" value="{{name}}" /></div>
        <div class="m-2" data-lang="statelabel">标签状态:</div>
        <div class="m-2"><input class="statelabel" value="{{statelabel}}" /></div>
        <div class="m-2" data-lang="orderNum">排序号:</div>
        <div class="m-2"><input class="orderNum" value="{{orderNum}}" type="number"
            onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" /></div>
      </div>
    </div>
    <div class="card bpm-collapse-item">
      <div class="card-header p-2" data-toggle="collapse" data-target="#AuditSet" data-lang="audit_setup">审批设置</div>
      <div id="AuditSet" class="collapse" data-parent="#gatewayNode">
        <div class="m-2 mt-3" data-lang="distribute">审批送出设置:</div>
        <div class="m-2">
          <input type="radio" name="issplit" {{if issplit}}checked{{/if}} value="true" />
          <span data-lang="step-by-step_approval_current_node">(并行)当下步有多个审批节点时,可以到达多个节点</span>
        </div>
        <div class="m-2">
          <input type="radio" name="issplit" {{if !issplit}}checked{{/if}} value="false" />
          <span data-lang="step-by-step_approval_current_node_only_arrival">(串行)当下步有多个审批节点时,只能到达一个节点</span>
        </div>
        <div class="m-2" data-lang="centralized">审批到达设置:</div>
        <div class="m-2">
          <input type="radio" name="isgather" {{if isgather==true}}checked{{/if}} value="true" />
          <span data-lang="step-by-step_approval_node">(聚合)当上步有多个审批节点时,所有节点完成,流程可以到达</span>
        </div>
        <div class="m-2">
          <input type="radio" name="isgather" {{if isgather==false}}checked{{/if}} value="false" />
          <span data-lang="multiple-step_approval_nodes">(非聚合)当上步有多个审批节点时,只要任一节点完成,则流程到达</span>
        </div>
        <div class="m-2 {{if isgather == false}}d-none{{/if}}" data-componentName="isgather" data-value="true">
          <select class="w-100" name="splitStartNode">
            {{each splitStartOptions as options}}
            <option value="{{options.id}}" {{if options.id==splitStartNode}}selected{{/if}}>{{options.name}}</option>
            {{/each}}
          </select>
        </div>
      </div>
    </div>
  </div>
</script>
<!-- 自动节点 -->
<script type="text" id="editautonode-tmpl">
    <div id="autoNode">
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#BaseInfo" data-lang="basic_info">基本信息</div>
            <div id="BaseInfo" class="collapse show" data-parent="#autoNode">
                <div class="m-2" data-lang="name">名称:</div>
                <div class="m-2"><input class="name" value="{{name}}" /></div>
                <div class="m-2" data-lang="statelabel">状态标签:</div>
                <div class="m-2"><input class="statelabel" value="{{statelabel}}" /></div>
                <div class="m-2" data-lang="orderNum">排序号:</div>
                <div class="m-2"><input class="orderNum" value="{{orderNum}}"  type="number" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"/></div>
                <div class="m-2 mt-3" data-lang="distribute">审批送出设置:</div>
                <div class="m-2">
                    <input type="radio" name="issplit" {{if issplit}}checked{{/if}} value="true" />
                    <span data-lang="step-by-step_approval_current_node">(并行)当下步有多个审批节点时,可以到达多个节点</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="issplit" {{if !issplit}}checked{{/if}} value="false" />
                    <span data-lang="step-by-step_approval_current_node_only_arrival">(串行)当下步有多个审批节点时,只能到达一个节点</span>
                </div>
                <div class="m-2 mt-3" data-lang="centralized">审批到达设置:</div>
                <div class="m-2">
                    <input type="radio" name="isgather" {{if isgather == true}}checked{{/if}} value="true" />
                    <span data-lang="step-by-step_approval_node">(聚合)当上步有多个审批节点时,所有节点完成,流程可以到达</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="isgather" {{if isgather == false}}checked{{/if}} value="false" />
                    <span data-lang="multiple-step_approval_nodes">(非聚合)当上步有多个审批节点时,只要任一节点完成,则流程到达</span>
                </div>
                <div class="m-2 {{if isgather == false}}d-none{{/if}}" data-componentName="isgather" data-value="true">
                    <select class="w-100" name="splitStartNode">
                        {{each splitStartOptions as options}}
                        <option value="{{options.id}}" {{if options.id == splitStartNode}}selected{{/if}}>{{options.name}}</option>
                        {{/each}}
                    </select>
                </div>

                <div class="m-2 mt-3">
                    <input type="radio" name="autoAuditTimeEditMode" {{if autoAuditTimeEditMode == 1}}checked{{/if}} value="1" /> <span data-lang="design">设计</span>
                    <input type="radio" name="autoAuditTimeEditMode" {{if autoAuditTimeEditMode == 2}}checked{{/if}} value="2" /> <span data-lang="script">脚本</span>
                </div>

                <div class="m-2 {{if autoAuditTimeEditMode != 1}}d-none{{/if}}" data-componentName="autoAuditTimeEditMode" data-value="1">
                    <span data-lang="trigger_time">触发时机:</span>
                    <input type="radio" name="autoAuditType" value="1" {{if autoAuditType == 1}}checked{{/if}}/> <span data-lang="immediately_trigger">立即触发</span>
                    <input type="radio" name="autoAuditType" value="2" {{if autoAuditType == 2}}checked{{/if}}/> <span data-lang="trigger_at_specified_time">指定时间触发</span>
                    <input type="radio" name="autoAuditType" value="3" {{if autoAuditType == 3}}checked{{/if}}/> <span data-lang="triggered_by_hour_day">在*小时/天后触发</span>

                    <div data-componentName="autoAuditType" data-value="2" {{if autoAuditType != 2}}class="d-none"{{/if}}>
                      <span data-lang="date_time">日期时间:</span>
                      <!-- <input type="datetime-local" name="auditDateTime" value="{{auditDateTime}}" /> -->
                        <input type="text" id="auditDateTime" name="auditDateTime" onfocus="agentStart();" class="Wdate" value="{{auditDateTime}}"/>
                    </div>
                  <div data-componentName="autoAuditType" data-value="3" {{if autoAuditType != 3}}class="d-none"{{/if}}>
                    <span data-lang="delay_time">滞后时间:</span>    
                    <br />
                        <input class="timeLimit" name="delayDay" value="{{delayDay}}"/><span data-lang="day">日</span> <input class="timeLimit" name="delayHour" value="{{delayHour}}"/><span>小时</span> <input class="timeLimit" name="delayMinute" value="{{delayMinute}}"/><span>分钟</span>
                    </div>
                </div>
                <div class="m-2 {{if autoAuditTimeEditMode != 2}}d-none{{/if}}" data-componentName="autoAuditTimeEditMode" data-value="2">
                  <span data-lang="script">脚本:</span>  
                  <button class="button-srcipt" name="iscriptEdit" title="自动审批脚本" data-fieldname="auditDateTimeScript">
                    <img src="images/editor.png">
                  </button>
                  <textarea class="d-none" name="auditDateTimeScript">{{auditDateTimeScript}}</textarea>
                </div>
            </div>
        </div>
    </div>
</script>
<!-- 人工节点 -->
<script type="text" id="editmanualnode-tmpl">
    <div id="editManualNode">
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#BasicInfo" data-lang="basic_info">基本信息</div>
            <div id="BasicInfo" class="collapse show" data-parent="#editManualNode">
                <div class="m-2" data-lang="name">名称:</div>
                <div class="m-2"><input class="name" value="{{name}}" /></div>
                <div class="m-2" data-lang="statelabel">状态标签:</div>
                <div class="m-2"><input class="statelabel" value="{{statelabel}}" /></div>
                <div class="m-2" data-lang="orderNum">排序号:</div>
                <div class="m-2"><input class="orderNum" value="{{orderNum}}" placeholder="0"  type="number" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"/></div>
                <div class="m-2" data-lang="setup_form_authority">设置表单权限:</div>
                <div class="m-2">
                    <input readonly type="hidden" name="fieldpermlist" value="{{fieldpermlist}}" />
                    <input readonly type="hidden" name="activityPermList" value="{{activityPermList}}" />
                    <input readonly name="formname" value="{{formname}}" />
                    <button name="selectForm" data-lang="choose">选择</button>
                </div>
                <!--暂时先屏蔽前台手动调整流程-->
                <!-- <div class="m-2">
                    <input type="checkbox" name="isFrontEdit" {{if isFrontEdit}}checked{{/if}} />
                    {*[cn.myapps.runtime.workflow.front_manual_adjustment_flow]*}
                </div> -->
                <div class="m-2">
                    <input type="checkbox" name="isAllowEditAuditor" {{if isAllowEditAuditor}}checked{{/if}} value="true" />
                    <span data-lang="permission_to_edit_the_current_node">允许编辑当前节点的审批人</span>
                </div>
                <!-- yx -->
                <div class="m-2 {{if !isAllowEditAuditor}}d-none{{/if}}" data-value="true" data-componentName="isAllowEditAuditor">
                    允许编辑当前审批人脚本
                    <button class="button-srcipt" name="iscriptEdit" title="允许编辑当前审批人脚本" data-fieldname="allowEditAuditorScript">
                        <img src="images/editor.png">
                    </button>
                    <textarea class="d-none" name="allowEditAuditorScript">{{allowEditAuditorScript}}</textarea>
                </div>
                <div class="m-2">
                    <input type="checkbox" name="isAllowTermination" {{if isAllowTermination}}checked{{/if}} />
                    <span data-lang="allow_the_approver_to_terminate_the_process">允许审批人终止流程</span>
                </div>
                <div class="m-2">
                  <input type="checkbox" name="isApproverEdit" {{if isApproverEdit}}checked{{/if}} value="true"/>  
                  允许加签主办人
                </div>
                {{isApproverEdit}}
                <div class="m-2 {{if !isApproverEdit}}d-none{{/if}}" data-value="true" data-componentName="isApproverEdit">
                    允许加签主办人脚本
                    <button class="button-srcipt" name="iscriptEdit" title="允许加签主办人脚本" data-fieldname="approverEditScript">
                        <img src="images/editor.png">
                    </button>
                    <textarea class="d-none" name="approverEditScript">{{approverEditScript}}</textarea>
                </div>
                <div class="m-2">
                  <input type="checkbox" name="isCoApproverEdit" {{if isCoApproverEdit}}checked{{/if}} value="true"/>  
                  允许加签协办人
                </div>
                <div class="m-2 {{if !isCoApproverEdit}}d-none{{/if}}"  data-value="true" data-componentName="isCoApproverEdit">
                    允许加签协办人脚本
                    <button class="button-srcipt" name="iscriptEdit" title="允许加签协办人脚本" data-fieldname="coApproverEditScript">
                        <img src="images/editor.png">
                    </button>
                    <textarea class="d-none" name="coApproverEditScript">{{coApproverEditScript}}</textarea>
                </div>
          <div class="m-2">
                    <input type="checkbox" name="isSupplementComments" {{if isSupplementComments}}checked{{/if}} />
                    <span data-lang="allow_supplement_comments">允许添加/补签意见</span>
                </div>
            </div>
        </div>
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#AuditorSet" data-lang="auditor_setup">审批人设置</div>
            <div id="AuditorSet" class="collapse" data-parent="#editManualNode">
                <div class="m-2">
                  <span data-lang="approval">通过</span> 
                  <select class="w-100" name="actorEditMode">
                    <option {{if actorEditMode == 0}}selected{{/if}} value="0" data-lang="role">
                      部门和角色
                    </option>
                    <option {{if actorEditMode == 1}}selected{{/if}} value="1" data-lang="script">脚本</option>
                    <option {{if actorEditMode == 3}}selected{{/if}} value="3" data-lang="organization">组织</option>
                  </select> 
                  <span data-lang="specify_auditor">指定审批人</span>
                </div>
                <div class="{{if actorEditMode != 0}}d-none{{/if}}"  data-componentName="actorEditMode" data-value="0">
                    <div class="m-2" data-lang="deptAs">部门为:</div>
                    <div class="m-2">
                        <input type="text" name="deptlist" value="{{deptList}}" placeholder="默认为所有部门"/>
                        <p data-lang="empty_default_all_dept">输入格式：<br/>例如天翎/产品部/测试组（全拼）</p>
                    </div>
                    <div class="m-2" data-lang="role_range">角色范围:</div>
                    <div class="m-2">
                        <input type="hidden" readonly name="namelist" value="{{nameList}}"/>
                        <input readonly name="namelistShow" value="{{nameListShow}}"/>
                        <button name="selectRole" data-fieldname="namelist" data-lang="choose">选择</button>
                    </div>
                </div>
                <div class="m-2 {{if actorEditMode != 1}}d-none{{/if}}" data-componentName="actorEditMode" data-value="1">
                    <span data-lang="script">脚本:</span>
                    <button class="button-srcipt" name="iscriptEdit" title="审批设置脚本" data-fieldname="actorListScript">
                        <img src="images/editor.png">
                    </button>
                    <textarea class="d-none" name="actorListScript">{{actorListScript}}</textarea>
                </div>
                <div class="{{if actorEditMode != 3}}d-none{{/if}}" data-componentName="actorEditMode" data-value="3">
                    <div class="m-2" data-lang="organizational_scope">组织范围:</div>
                    <div class="m-2"><select class="w-100" name="orgField">
                        <option {{if orgField == "auditor"}}selected{{/if}} value="auditor" data-lang="last_node_final_processor">上一节点最后处理人</option>
                        <option {{if orgField == "initiator"}}selected{{/if}} value="initiator" data-lang="process_initiator">流程发起人</option>
                        <option {{if orgField == "curruser"}}selected{{/if}} value="curruser" data-lang="submit_yourself">提交者自己</option>
                    </select></div>
                    <div class="m-2">的提交者自己</div>
                    <div class="m-2"><input type="radio" {{if orgScope == "superior"}}checked{{/if}} name="orgScope" value="superior" data-lang="authfield_scope_superior" /> 所有上级用户</div>
                    <div class="m-2"><input type="radio" {{if orgScope == "lower"}}checked{{/if}} name="orgScope" value="lower" data-lang="authfield_scope_lower"/> 所有下级用户</div>
                    <div class="m-2"><input type="radio" {{if orgScope == "default"}}checked{{/if}} name="orgScope" value="default" data-lang="authfield_scope_author_dept_default"/> 默认部门</div>
                    <div class="m-2"><input type="radio" {{if orgScope == "lineSuperior"}}checked{{/if}} name="orgScope" value="lineSuperior" data-lang="authfield_scope_author_dept_linesuperior"/>直属上级部门</div>
                    <div class="m-2"><input type="radio" {{if orgScope == "lineLower"}}checked{{/if}} name="orgScope" value="lineLower" data-lang="authfield_scope_author_dept_linelower"/>直属下级部门</div>
                    <div class="m-2"><input type="radio" {{if orgScope == "allSuperior"}}checked{{/if}} name="orgScope" value="allSuperior" data-lang="authfield_scope_author_dept_allsuperior"/>所有上级部门</div>
                    <div class="m-2"><input type="radio" {{if orgScope == "allLower"}}checked{{/if}} name="orgScope" value="allLower" data-lang="authfield_scope_author_dept_alllower"/>所有下级部门</div>
                    <div class="m-2"><input type="radio" {{if orgScope == "self"}}checked{{/if}} name="orgScope" value="self" data-lang="authfield_scope_itself"/>自己</div>
                    <div class="m-2" data-lang="and_name_role_scope">且名称(角色范围):</div>
                    <div class="m-2">
                        <input type="hidden" readonly name="orgRoleCondition" value="{{orgRoleCondition}}" />
                        <input readonly name="orgRoleConditionShow" value="{{orgRoleConditionShow}}" />
                        <button name="selectRole" data-fieldname="orgRoleCondition" data-lang="choose">选择</button>
                    </div>
                </div>
                <div class="m-2" data-lang="and_filter_conditions">且(筛选条件):</div>
                <div class="m-2">
                    <input type="radio" {{if roleCondition == ""}}checked{{/if}} name="roleCondition" value=""/><span data-lang="nothing">无</span>
                </div>
                <div class="m-2">
                    <input type="radio" {{if roleCondition == "initiator_superior"}}checked{{/if}} name="roleCondition" value="initiator_superior"/> <span data-lang="auditor_Super">审批人为发起人上级</span>
                </div>
                <div class="m-2">
                    <input type="radio" {{if roleCondition == "initiator_dep_superior"}}checked{{/if}} name="roleCondition" value="initiator_dep_superior"/><span data-lang="auditor_super_departmet">审批人部门为发起人上级部门</span>
                </div>
                <div class="m-2 mt-3">
                    <span data-lang="next_approver_is_only_one_person">上一节点允许用户指定下一步审批人，在选择此节点审批人时</span>：
                    <br>
                    <input type="radio" {{if approverNumType == 0}}checked{{/if}} name="approverNumType" value="0" /><span data-lang="multiple">多选</span><br>
                    <input type="radio" {{if approverNumType == 1}}checked{{/if}} name="approverNumType" value="1" /><span data-lang="single">单选</span>

                </div>
                <div class="m-2 mt-3">
                    <input type="checkbox" name="isToPerson" {{if isToPerson}}checked{{/if}} />
                    <span data-lang="allow_the_current_process_executor_to_specify_the_next_approver">允许当前流程执行人指定下一步审批人</span>
                    <input type="checkbox" name="checkedOnSinglePerson" {{if checkedOnSinglePerson}}checked{{/if}} /> 
                    <span data-lang="next_approver_is_only_one_person_that_person_is_selected_by_default">当下一步审批人只有一人，默认选中该人</span>
                    <input type="checkbox" name="checkedOnMultiplePerson" {{if checkedOnMultiplePerson}}checked{{/if}} /> 
                    <span data-lang="prev_approver_is_only_one_person_that_is_all_by_default">上一步提交该节点默认选中所有人</span>
                  </div>
            </div>
        </div>
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#AuditTimeLimitSet" data-lang="audit_timelimit_setup">审批时限设置</div>
            <div id="AuditTimeLimitSet" class="collapse" data-parent="#editManualNode">
                <div class="m-2">
                    <input type="checkbox" name="isLimited" {{if isLimited}}checked{{/if}} value="true">
                    <span data-lang="opening_time_limit_for_approval">开启审批时限设置</span>
                </div>
                <div class="m-2" data-lang="remark">备注:</div>
                <div class="m-2" data-lang="automatically_commit_timeout_to_the_next_node">1 超时自动提交到下一节点</div>
                <div class="{{if !isLimited}}d-none{{/if}}" data-componentName="isLimited" data-value="true">
                    <div class="m-2 mt-3" data-lang="auditing_edit_mode">审批编辑模式:</div>
                    <div class="m-2">
                        <input type="radio" name="timeLimitEditMode" {{if timeLimitEditMode == 0}}checked{{/if}} value="0"><span data-lang="design">设计</span>
                        <input type="radio" name="timeLimitEditMode" {{if timeLimitEditMode == 1}}checked{{/if}} value="1"><span data-lang="script">脚本</span>
                    </div>
                    <div class="m-2 {{if timeLimitEditMode != 0}}d-none{{/if}}" data-componentName="timeLimitEditMode" data-value="0">
                        <input class="timeLimit" name="timeLimitDay" value="{{timeLimitDay}}"/><span data-lang="day">日</span>
                        <input class="timeLimit" name="timeLimitHour" value="{{timeLimitHour}}"/><span data-lang="hour">小时</span>
                        <input class="timeLimit" name="timeLimitMinute" value="{{timeLimitMinute}}"/><span data-lang="min">分钟</span>
                    </div>
                    <div class="m-2 {{if timeLimitEditMode != 1}}d-none{{/if}}" data-componentName="timeLimitEditMode" data-value="1">
                        <span data-lang="script">脚本</span>:
                        <button class="button-srcipt" name="iscriptEdit" title="审批时限设置脚本" data-fieldname="timeLimitScript">
                            <img src="images/editor.png">
                        </button>
                        <textarea class="d-none" name="timeLimitScript">{{timeLimitScript}}</textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#AssistSet" data-lang="co_setup">协办设置</div>
            <div id="AssistSet" class="collapse" data-parent="#editManualNode">
                <div class="m-2">
                    <input type="checkbox" name="isAssist" {{if isAssist}}checked{{/if}} value="true">
                    <span data-lang="startup">启动</span>
                </div>
                <div class="{{if !isAssist}}d-none{{/if}}" data-componentName="isAssist" data-value="true">
                    <div class="m-2">
                        <span data-lang="range">范围</span>:<span data-lang="approval">通过</span>
                        <select class="w-100" name="assistEditMode">
                            <option {{if assistEditMode == 0}}selected{{/if}} value="0"><span data-lang="role">角色</span></option>
                            <option {{if assistEditMode == 1}}selected{{/if}} value="1"><span data-lang="script">脚本</span></option>
                        </select> <span data-lang="specify">指定</span>
                    </div>
                    <div class="{{if assistEditMode != 0}}d-none{{/if}}" data-componentName="assistEditMode" data-value="0">
                        <div class="m-2" data-lang="role">角色:</div>
                        <div class="m-2">
                          <input type="hidden" readonly name="assistNamelist" value="{{assistNamelist}}"/>
                          <input readonly name="assistNamelistShow" value="{{assistNamelistShow}}"/>
                          <button name="selectRole" data-fieldname="assistNamelist") data-lang="choose">选择</button>
                        </div>
                    </div>
                    <div class="m-2 {{if assistEditMode != 1}}d-none{{/if}}" data-componentName="assistEditMode" data-value="1">
                        <span data-lang="script">脚本</span>:
                        <button class="button-srcipt" name="iscriptEdit" title="抄送审批脚本" data-fieldname="assistListScript">
                            <img src="images/editor.png">
                        </button>
                        <textarea class="d-none" name="assistListScript">{{assistListScript}}</textarea>
                    </div>
            <!--
                    <div class="m-2 mt-3">
                        <input type="checkbox" name="isSelectAssistUser" {{if isSelectAssistUser}}checked{{/if}}>
                        <span data-lang="allows_designated_next_circulator">允许当前流程执行人指定抄送人</span>
                    </div>-->
                </div>
            </div>
        </div>
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#CopySet" data-lang="copy_set">抄送设置</div>
            <div id="CopySet" class="collapse" data-parent="#editManualNode">
                <div class="m-2">
                    <input type="checkbox" name="isCarbonCopy" {{if isCarbonCopy}}checked{{/if}} value="true">
                    <span data-lang="startup">启动</span>
                </div>
                <div class="{{if !isCarbonCopy}}d-none{{/if}}" data-componentName="isCarbonCopy" data-value="true">
                    <div class="m-2">
                      <span data-lang="range">范围</span>:<span data-lang="approval">通过</span>
                      <select class="w-100" name="circulatorEditMode">
                          <option {{if circulatorEditMode == 0}}selected{{/if}} value="0"><span data-lang="role">角色</span></option>
                          <option {{if circulatorEditMode == 1}}selected{{/if}} value="1"><span data-lang="script">脚本</span></option>
                      </select><span data-lang="specify">指定</span>
                    </div>
                    <div class="{{if circulatorEditMode != 0}}d-none{{/if}}" data-componentName="circulatorEditMode" data-value="0">
                        <div class="m-2" data-lang="role">角色:</div>
                        <div class="m-2">
                            <input type="hidden" readonly name="circulatorNamelist" value="{{circulatorNamelist}}"/>
                            <input readonly name="circulatorNamelistShow" value="{{circulatorNamelistShow}}"/>
                            <button name="selectRole" data-fieldname="circulatorNamelist" data-lang="choose">选择</button>
                        </div>
                    </div>
                    <div class="m-2 {{if circulatorEditMode != 1}}d-none{{/if}}" data-componentName="circulatorEditMode" data-value="1">
                        <span data-lang="script">脚本</span>:
                        <button class="button-srcipt" name="iscriptEdit" title="抄送审批脚本" data-fieldname="circulatorListScript">
                            <img src="images/editor.png">
                        </button>
                        <textarea class="d-none" name="circulatorListScript">{{circulatorListScript}}</textarea>
                    </div>
                    <div class="m-2 mt-3">
                        <input type="checkbox" name="isSelectCirculator" {{if isSelectCirculator}}checked{{/if}}>
                        <span data-lang="allows_designated_next_circulator">允许当前流程执行人指定抄送人</san>
                    </div>
                </div>
            </div>
        </div>
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#AuditSet" data-lang="audit_setup">审批设置</div>
            <div id="AuditSet" class="collapse" data-parent="#editManualNode">
                <div class="m-2" data-lang="distribute">审批送出设置:</div>
                <div class="m-2">
                    <input type="radio" name="issplit" {{if issplit}}checked{{/if}} value="true">
                    <span data-lang="step-by-step_approval_current_node">(并行)当下步有多个审批节点时,可以到达多个节点</span>
                </div>
                <div class="pl-3 {{if !issplit}}d-none{{/if}}" data-componentName="issplit" data-value="true">
                    <div class="m-2">
                        <input type="radio" name="nextNodeCheckedStatus" {{if nextNodeCheckedStatus == 0}}checked{{/if}} value="0">
                        <span data-lang="nextNodeChecked">下一步节点的选中状态默认选中</span>
                    </div>
                    <div class="m-2">
                        <input type="radio" name="nextNodeCheckedStatus" {{if nextNodeCheckedStatus == 1}}checked{{/if}} value="1">
                        <span data-lang="nextNodeNoChecked">下一步节点的选中状态默认不选中</span>
                    </div>
                    <div class="m-2">
                        <input type="radio" name="nextNodeCheckedStatus" {{if nextNodeCheckedStatus == 2}}checked{{/if}} value="2">
                        <span data-lang="nextNodeCheckedAndLock">下一步节点的选中状态默认选中且锁定</span>
                    </div>
                </div>

                <div class="m-2">
                    <input type="radio" name="issplit" {{if !issplit}}checked{{/if}} value="false">
                    <span data-lang="step-by-step_approval_current_node_only_arrival">(串行)当下步有多个审批节点时,只能到达一个节点</span>
                </div>

                <div class="m-2 pt-2 border-top" data-lang="centralized">审批到达设置</div>
                <div class="m-2">
                    <input type="radio" name="isgather" {{if isgather}}checked{{/if}} value="true">
                    <span data-lang="step-by-step_approval_node">(聚合)当上步有多个审批节点时,所有节点完成,流程可以到达</span>
                </div>
                <div class="m-2 {{if !isgather}}d-none{{/if}}" data-componentName="isgather" data-value="true">
                    <select class="w-100" name="splitStartNode">
                        {{each splitStartOptions as options}}
                        <option value="{{options.id}}" {{if options.id == splitStartNode}}selected{{/if}}>{{options.name}}</option>
                        {{/each}}
                    </select>
                </div>
                <div class="m-2">
                    <input type="radio" name="isgather" {{if !isgather}}checked{{/if}} value="false">
                    <span data-lang="multiple-step_approval_nodes">(非聚合)当上步有多个审批节点时,只要任一节点完成,则流程到达</span>
                </div>

                <div class="m-2 pt-2 border-top" data-lang="node_passing_condition">节点通过条件</div>
                <div class="m-2">
                    <input type="radio" name="passcondition" {{if passcondition == 0}}checked{{/if}} value="0">
                    <span data-lang="through_any_approval_node_through">(或)任一审批人通过,则节点通过</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="passcondition" {{if passcondition == 1}}checked{{/if}} value="1">
                    <span data-lang="through_all_approval_node_through">(且)所有审批人通过,则节点通过</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="passcondition" {{if passcondition == 2}}checked{{/if}} value="2">
                    <span data-lang="through_one_approval_node_through">(且)所有审批人一个接一个审批通过,则节点通过（按顺序审批）</span>
                </div>
                <div class="m-2 {{if passcondition != 2}}d-none{{/if}}" data-componentName="passcondition" data-value="2">

                </div>
                <div class="m-2 pt-2 border-top">
                    <input type="checkbox" name="isAllowSkip" {{if isAllowSkip}}checked{{/if}} />
                    <span data-lang="when_the_node_approves_the_previous_submission_it_is_allowed_to_skip_this_node_and_go_directly_to_the_next_step">当此节点审批人为上一步提交人时,允许跳过此节点直接流转到下一步</span>
                </div>
            </div>
        </div>
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#ActivitySet" data-lang="rollback_retracement_hang_up">回退回撤挂起催办</div>
            <div id="ActivitySet" class="collapse" data-parent="#editManualNode">
                <div class="m-2" data-lang="return_setup">回退设置:</div>
                <div class="m-2">
                    <input type="checkbox" name="cBack" {{if cBack}}checked{{/if}} value="true" />
                    <span data-lang="allow_return">允许回退</span>
                </div>
                <div class="{{if !cBack}}d-none{{/if}}" data-componentName="cBack" data-value="true">
                    <div class="m-2">
                        <input type="radio" name="backType" {{if backType == 0}}checked{{/if}} value="0">
                        <span data-lang="foreground_operation_user_specified_return_node">前台操作用户指定回退节点</span>
                    </div>
                    <div class="m-2">
                        <input type="radio" name="backType" {{if backType == 1}}checked{{/if}} value="1">
                        <span data-lang="regression_to_specified_node">回退至指定节点</span>
                    </div>
                    <div class="m-2 {{if backType != 1}}d-none{{/if}}" data-componentName="backType" data-value="1">
                        <select class="w-100" name="bnodelist">
                            {{each bnodelistOptions as options}}
                            <option value="{{options.id}}" {{if options.id == bnodelist}}selected{{/if}}>{{options.name}}</option>
                            {{/each}}
                        </select>
                    </div>
                </div>
                <div class="m-2 mt-3" data-lang="retracement_setup">回撤设置:</div>
                <div class="m-2">
                    <input type="radio" name="retracementSet" {{if retracementSet == 1}}checked{{/if}} value="1" />
                    <span data-lang="can_retracement">可回撤</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="retracementSet" {{if retracementSet == 2}}checked{{/if}} value="2" />
                    <span data-lang="can_not_retracement">不可回撤</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="retracementSet" {{if retracementSet == 3}}checked{{/if}} value="3" />
                    <span data-lang="script">脚本</span>
                </div>
                <div class="m-2 {{if retracementSet != 3}}d-none{{/if}}" data-componentName="retracementSet" data-value="3">
                  <span data-lang="script">脚本</span>:
                  <button class="button-srcipt" name="iscriptEdit" title="回撤设置脚本" data-fieldname="retracementScript">
                      <img src="images/editor.png">
                  </button>
                  <textarea class="d-none" name="retracementScript">{{retracementScript}}</textarea>
                </div>

                <div class="m-2 mt-3" data-lang="hang_up_setting">挂起设置:</div>
                <div class="m-2">
                    <input type="radio" name="handupSet" {{if handupSet == 1}}checked{{/if}} value="1" />
                    <span data-lang="can_hang_up">可挂起</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="handupSet" {{if handupSet == 2}}checked{{/if}} value="2" />
                    <span data-lang="cannot_hang_up">不可挂起</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="handupSet" {{if handupSet == 3}}checked{{/if}} value="3" />
                    <span data-lang="script">脚本</span>
                </div>
                <div class="m-2 {{if handupSet != 3}}d-none{{/if}}" data-componentName="handupSet" data-value="3">
                  <span data-lang="script">脚本</span>:
                  <button class="button-srcipt" name="iscriptEdit" title="挂起设置脚本" data-fieldname="handupScript">
                      <img src="images/editor.png">
                  </button>
                  <textarea class="d-none" name="handupScript">{{handupScript}}</textarea>
                </div>

                <div class="m-2 mt-3" data-lang="urging_setup">催办设置:</div>
                <div class="m-2">
                    <input type="radio" name="allowUrgeSet" {{if allowUrgeSet == 1}}checked{{/if}} value="1" />
                    <span data-lang="allowed_to_be_urged">允许被催办</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="allowUrgeSet" {{if allowUrgeSet == 2}}checked{{/if}} value="2" />
                    <span data-lang="not_allowed_to_be_urged">不允许被催办</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="allowUrgeSet" {{if allowUrgeSet == 3}}checked{{/if}} value="3" />
                    <span data-lang="script">脚本</span>
                </div>
                <div class="m-2 {{if allowUrgeSet != 3}}d-none{{/if}}" data-componentName="allowUrgeSet" data-value="3">
                  <span data-lang="script">脚本</span>:
                  <button class="button-srcipt" name="iscriptEdit" title="催办设置脚本" data-fieldname="allowUrge2ApprovalScript">
                      <img src="images/editor.png">
                  </button>
                  <textarea class="d-none" name="allowUrge2ApprovalScript">{{allowUrge2ApprovalScript}}</textarea>
                </div>
            </div>
        </div>


        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#NotificationAccordion" data-lang="notification">通知</div>
                <div id="NotificationAccordion" class="collapse" data-parent="#editManualNode">
                    <div class="m-2" data-lang="trigger_when_submitted">提交时触发:</div>
                    <div class="m-2">
                        <input type="checkbox" name="noteSend" {{if notificationStrategyJSON != "" && notificationStrategyJSON.send}}checked{{/if}} value="true"/>
                        <span data-lang="startup">启动</span>
                    </div>
                    <div class="{{if notificationStrategyJSON == "" || !notificationStrategyJSON.send}}d-none{{/if}}" data-componentName="noteSend" data-value="true">
                        <div class="m-2" data-lang="receiving_object">接收对象:</div>
                        <div class="m-2">
                            <input type="checkbox" name="receiverTypesOfSend"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.send}}
                            {{each notificationStrategyJSON.send.receiverTypes as receiverTypes}}
                            {{if receiverTypes == 16}}checked{{/if}}
                            {{/each}}{{/if}} value="16" /><span data-lang="workflow_form_creator">表单创建人</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="receiverTypesOfSend"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.send}}
                            {{each notificationStrategyJSON.send.receiverTypes as receiverTypes}}
                            {{if receiverTypes == 256}}checked{{/if}}
                            {{/each}}{{/if}} value="256" /><span data-lang="current_node_processor">当前节点原处理人</span>
                        </div>
                        <div class="m-2" data-lang="smsmode">发送方式:</div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfSend"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.send}}
                            {{each notificationStrategyJSON.send.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 0}}checked{{/if}}
                            {{/each}}{{/if}} value="0" /> <span data-lang="email">邮件</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfSend"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.send}}
                            {{each notificationStrategyJSON.send.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 1}}checked{{/if}}
                            {{/each}}{{/if}} value="1" /><span data-lang="mobile_sms">手机短信</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfSend"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.send}}
                            {{each notificationStrategyJSON.send.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 2}}checked{{/if}}
                            {{/each}}{{/if}} value="2" /><span data-lang="personal_message">消息中心</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfSend"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.send}}
                            {{each notificationStrategyJSON.send.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 3}}checked{{/if}}
                            {{/each}}{{/if}} value="3" /><span data-lang="enterprise_wechat">企业微信</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfSend"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.send}}
                            {{each notificationStrategyJSON.send.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 4}}checked{{/if}}
                            {{/each}}{{/if}} value="4" /><span data-lang="dingding">钉钉</span>
                        </div>
                        <div class="m-2" data-lang="send_content_form_summary">发送内容(表单摘要):</div>
                        <div class="m-2">
                            <select class="w-100" name="templateOfSend"></select>
                        </div>
                    </div>

                    <div class="m-2 pt-2 border-top" data-lang="trigger_when_expired">到达时触发:</div>
                    <div class="m-2">
                        <input type="checkbox" name="noteArrive" {{if notificationStrategyJSON != "" && notificationStrategyJSON.arrive}}checked{{/if}} value="true"/>
                        <span data-lang="startup">启动</span>
                    </div>
                    <div class="{{if notificationStrategyJSON == "" || !notificationStrategyJSON.arrive}}d-none{{/if}}" data-componentName="noteArrive" data-value="true">
                        <div class="m-2"><span data-lang="receiving_object">接收对象</span>: <span data-lang="current_node_submission">当前节点提交人</span></div>
                        <!--
                        <div class="m-2">
                            <input type="checkbox" name="smsApprovalOfArrive" {{if notificationStrategyJSON != "" && notificationStrategyJSON.arrive && notificationStrategyJSON.arrive.smsApproval}}checked{{/if}}>
                            {*[cn.myapps.runtime.workflow.smsmode.open.sms.approval]*}
                        </div>
                        -->
                        <div class="m-2" data-lang="smsmode">发送方式:</div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfArrive"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.arrive}}
                            {{each notificationStrategyJSON.arrive.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 0}}checked{{/if}}
                            {{/each}}{{/if}} value="0" /><span data-lang="email">邮件</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfArrive"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.arrive}}
                            {{each notificationStrategyJSON.arrive.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 1}}checked{{/if}}
                            {{/each}}{{/if}} value="1" /><span data-lang="mobile_sms">手机短信</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfArrive"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.arrive}}
                            {{each notificationStrategyJSON.arrive.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 2}}checked{{/if}}
                            {{/each}}{{/if}} value="2" /><span data-lang="personal_message">消息中心</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfArrive"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.arrive}}
                            {{each notificationStrategyJSON.arrive.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 3}}checked{{/if}}
                            {{/each}}{{/if}} value="3" /><span data-lang="enterprise_wechat">企业微信</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfArrive"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.arrive}}
                            {{each notificationStrategyJSON.arrive.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 4}}checked{{/if}}
                            {{/each}}{{/if}} value="4" /><span data-lang="dingding">钉钉</span>
                        </div>
                        <div class="m-2" data-lang="send_content_form_summary">发送内容(表单摘要):</div>
                        <div class="m-2">
                            <select class="w-100" name="templateOfArrive"></select>
                        </div>
                    </div>

                    <div class="m-2 pt-2 border-top" data-lang="triggered_when_returned">被回退时触发:</div>
                    <div class="m-2">
                        <input type="checkbox" name="noteReject" {{if notificationStrategyJSON != "" && notificationStrategyJSON.reject}}checked{{/if}} value="true">
                        <span data-lang="startup">启动</span>
                    </div>
                    <div class="{{if notificationStrategyJSON == "" || !notificationStrategyJSON.reject}}d-none{{/if}}" data-componentName="noteReject" data-value="true">
                        <div class="m-2" data-lang="receiving_object">接收对象</div>
                        <div class="m-2">
                          <span data-lang="return_to">回退给</span>:
                          <select name="responsibleTypeOfReject">
                                <option {{if notificationStrategyJSON != "" && notificationStrategyJSON.reject}}
                                {{if notificationStrategyJSON.reject.responsibleType == 1}}selected{{/if}}
                                {{/if}} value="1"><span data-lang="workflow_form_creator">表单创建人</span></option>
                                <option {{if notificationStrategyJSON != "" && notificationStrategyJSON.reject}}
                                {{if notificationStrategyJSON.reject.responsibleType == 16}}selected{{/if}}
                                {{/if}} value="16"><span data-lang="current_node_submission">当前节点提交人</span></option>
                                <option {{if notificationStrategyJSON != "" && notificationStrategyJSON.reject}}
                                {{if notificationStrategyJSON.reject.responsibleType == 256}}selected{{/if}}
                                {{/if}} value="256"><span data-lang="current_node_processor">当前节点原处理人</span></option>
                            </select>
                        </div>
                        <div class="m-2" data-lang="smsmode">发送方式:</div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfReject"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.reject}}
                            {{each notificationStrategyJSON.reject.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 0}}checked{{/if}}
                            {{/each}}{{/if}} value="0" /><span data-lang="email">邮件</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfReject"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.reject}}
                            {{each notificationStrategyJSON.reject.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 1}}checked{{/if}}
                            {{/each}}{{/if}} value="1" /><span data-lang="mobile_sms">手机短信</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfReject"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.reject}}
                            {{each notificationStrategyJSON.reject.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 2}}checked{{/if}}
                            {{/each}}{{/if}} value="2" /><span data-lang="personal_message">消息中心</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfReject"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.reject}}
                            {{each notificationStrategyJSON.reject.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 3}}checked{{/if}}
                            {{/each}}{{/if}} value="3" /><span data-lang="enterprise_wechat">企业微信</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfReject"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.reject}}
                            {{each notificationStrategyJSON.reject.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 4}}checked{{/if}}
                            {{/each}}{{/if}} value="4" /><span data-lang="dingding">钉钉</span>
                        </div>
                        <div class="m-2" data-lang="send_content_form_summary">发送内容(表单摘要):</div>
                        <div class="m-2">
                            <select class="w-100" name="templateOfReject"></select>
                        </div>
                    </div>

                    <div class="m-2 pt-2 border-top" data-lang="trigger_when_expired">过期时触发:</div>
                    <div class="m-2">
                        <input type="checkbox" name="noteOverdue" {{if notificationStrategyJSON != "" && notificationStrategyJSON.overdue}}checked{{/if}} value="true">
                        <span data-lang="startup">启动</span>
                    </div>
                    <div class="{{if notificationStrategyJSON == "" || !notificationStrategyJSON.overdue}}d-none{{/if}}" data-componentName="noteOverdue" data-value="true">
                        <div class="m-2"><span data-lang="receiving_object">接收对象</span>:<span data-lang="current_node_processor">当前节点原处理人</span></div>
                        <div class="m-2">
                            <input type="checkbox" name="isnotifysuperiorOfOverdue" {{if notificationStrategyJSON != "" && notificationStrategyJSON.overdue && notificationStrategyJSON.overdue.isnotifysuperior}}checked{{/if}}>
                            <span data-lang="is_notify_superior">是否通知上级</span>
                        </div>
                        <div class="m-2">
                            <input type="radio" name="editModeOfOverdue" value="0" {{if notificationStrategyJSON != "" && notificationStrategyJSON.overdue && notificationStrategyJSON.overdue.editMode == 0}}checked{{/if}}> <span data-lang="design_name">设计</span>
                            <input type="radio" name="editModeOfOverdue" value="1" {{if notificationStrategyJSON != "" && notificationStrategyJSON.overdue && notificationStrategyJSON.overdue.editMode == 1}}checked{{/if}}> <span data-lang="iscript_name">脚本</span>
                        </div>
                        <div id="designName" class="d-none" data-componentName="editModeOfOverdue" data-value="0">
                            <div class="m-2"><span data-lang="time_limit">时限</span> <input name="limittimecountOfOverdue" value="{{notificationStrategyJSON != '' && notificationStrategyJSON.overdue ? notificationStrategyJSON.overdue.limittimecount : ''}}" /></div>
                            <div class="m-2"><span data-lang="unit">单位</span>: <select class="w-100" name="timeunitOfOverdue">
                                <option {{if notificationStrategyJSON != "" && notificationStrategyJSON.overdue}}
                                {{if notificationStrategyJSON.overdue.timeunit == 0}}selected{{/if}}
                                {{/if}}value="0"><span data-lang="hour">小时</span></option>
                                <option {{if notificationStrategyJSON != "" && notificationStrategyJSON.overdue}}
                                {{if notificationStrategyJSON.overdue.timeunit == 1}}selected{{/if}}
                                {{/if}}value="1"><span data-lang="day">日</span></option>
                            </select></div>
                        </div>
                        <div id="scriptName" class="m-2 d-none" data-componentName="editModeOfOverdue" data-value="1">
                          <span data-lang="script">脚本</span>:
                            <button class="button-srcipt" name="iscriptEdit" title="审批时限设置脚本" data-fieldname="limittimeScriptOfOverdue">
                                <img src="images/editor.png">
                            </button>
                            <textarea class="d-none" name="limittimeScriptOfOverdue">{{notificationStrategyJSON != '' && notificationStrategyJSON.overdue ? notificationStrategyJSON.overdue.limittimeScript : ''}}</textarea>
                        </div>
                        <div class="m-2" data-lang="smsmode">发送方式:</div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfOverdue"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.overdue}}
                            {{each notificationStrategyJSON.overdue.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 0}}checked{{/if}}
                            {{/each}}{{/if}} value="0" /><span data-lang="email">邮件</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfOverdue"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.overdue}}
                            {{each notificationStrategyJSON.overdue.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 1}}checked{{/if}}
                            {{/each}}{{/if}} value="1" /><span data-lang="mobile_sms">手机短信</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfOverdue"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.overdue}}
                            {{each notificationStrategyJSON.overdue.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 2}}checked{{/if}}
                            {{/each}}{{/if}} value="2" /><span data-lang="personal_message">消息中心</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfOverdue"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.overdue}}
                            {{each notificationStrategyJSON.overdue.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 3}}checked{{/if}}
                            {{/each}}{{/if}} value="3" /><span data-lang="enterprise_wechat">企业微信</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfOverdue"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.overdue}}
                            {{each notificationStrategyJSON.overdue.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 4}}checked{{/if}}
                            {{/each}}{{/if}} value="4" /><span data-lang="dingding">钉钉</span>
                        </div>
                        <div class="m-2" data-lang="send_content_form_summary">发送内容(表单摘要):</div>
                        <div class="m-2">
                            <select class="w-100" name="templateOfOverdue"></select>
                        </div>
                    </div>

                    <div class="m-2 pt-2 border-top" data-lang="trigger_when_prompted">催办时触发:</div>
                    <div class="m-2">
                        <input type="checkbox" name="noteReminder" {{if notificationStrategyJSON != "" && notificationStrategyJSON.reminder}}checked{{/if}} value="true">
                        <span data-lang="startup">启动</span>
                    </div>
                    <div class="{{if notificationStrategyJSON == "" || !notificationStrategyJSON.reminder}}d-none{{/if}}" data-componentName="noteReminder" data-value="true">
                        <div class="m-2"><span data-lang="receiving_object">接收对象</span>:<span data-lang="the_person_under_the_push_node">被催办节点下的处理人</span></div>
                        <div class="m-2" data-lang="smsmode">发送方式:</div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfReminder"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.reminder}}
                            {{each notificationStrategyJSON.reminder.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 0}}checked{{/if}}
                            {{/each}}{{/if}} value="0" /><span data-lang="email">邮件</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfReminder"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.reminder}}
                            {{each notificationStrategyJSON.reminder.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 1}}checked{{/if}}
                            {{/each}}{{/if}} value="1" /><span data-lang="mobile_sms">手机短信</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfReminder"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.reminder}}
                            {{each notificationStrategyJSON.reminder.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 2}}checked{{/if}}
                            {{/each}}{{/if}} value="2" /><span data-lang="personal_message">消息中心</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfReminder"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.reminder}}
                            {{each notificationStrategyJSON.reminder.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 3}}checked{{/if}}
                            {{/each}}{{/if}} value="3" /><span data-lang="enterprise_wechat">企业微信</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfReminder"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.reminder}}
                            {{each notificationStrategyJSON.reminder.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 4}}checked{{/if}}
                            {{/each}}{{/if}} value="4" /><span data-lang="dingding">钉钉</span>
                        </div>
                    </div>

                    <div class="m-2 pt-2 border-top" data-lang="trigger_when_arriving_at_co_operation">到达协办时触发:</div>
                    <div class="m-2">
                        <input type="checkbox" name="noteAssist" {{if notificationStrategyJSON != "" && notificationStrategyJSON.assist}}checked{{/if}} value="true">
                        <span data-lang="startup">启动</span>
                    </div>
                    <div class="{{if notificationStrategyJSON == "" || !notificationStrategyJSON.assist}}d-none{{/if}}" data-componentName="noteAssist" data-value="true">
                        <div class="m-2" data-lang="smsmode">发送方式:</div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfAssist"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.assist}}
                            {{each notificationStrategyJSON.assist.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 0}}checked{{/if}}
                            {{/each}}{{/if}} value="0" /><span data-lang="email">邮件</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfAssist"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.assist}}
                            {{each notificationStrategyJSON.assist.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 1}}checked{{/if}}
                            {{/each}}{{/if}} value="1" /><span data-lang="mobile_sms">手机短信</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfAssist"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.assist}}
                            {{each notificationStrategyJSON.assist.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 2}}checked{{/if}}
                            {{/each}}{{/if}} value="2" /><span data-lang="personal_message">消息中心</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfAssist"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.assist}}
                            {{each notificationStrategyJSON.assist.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 3}}checked{{/if}}
                            {{/each}}{{/if}} value="3" /><span data-lang="enterprise_wechat">企业微信</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfAssist"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.assist}}
                            {{each notificationStrategyJSON.assist.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 4}}checked{{/if}}
                            {{/each}}{{/if}} value="4" /><span data-lang="dingding">钉钉</span>
                        </div>
                        <div class="m-2" data-lang="send_content_form_summary">发送内容(表单摘要):</div>
                        <div class="m-2">
                            <select class="w-100" name="templateOfAssist"></select>
                        </div>
                    </div>

                    <div class="m-2 pt-2 border-top" data-lang="trigger_when_copying">抄送时触发:</div>
                    <div class="m-2">
                        <input type="checkbox" name="noteCarbonCopy" {{if notificationStrategyJSON != "" && notificationStrategyJSON.carbonCopy}}checked{{/if}} value="true">
                        <span data-lang="startup">启动</span>
                    </div>
                    <div class="{{if notificationStrategyJSON == "" || !notificationStrategyJSON.carbonCopy}}d-none{{/if}}" data-componentName="noteCarbonCopy" data-value="true">
                        <div class="m-2"><span data-lang="receiving_object">接收对象</span>:<span data-lang="specified_copy_objects">指定的抄送对象</span></div>
                        <div class="m-2" data-lang="smsmode">发送方式:</div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfCarbonCopy"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.carbonCopy}}
                            {{each notificationStrategyJSON.carbonCopy.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 0}}checked{{/if}}
                            {{/each}}{{/if}} value="0" /><span data-lang="email">邮件</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfCarbonCopy"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.carbonCopy}}
                            {{each notificationStrategyJSON.carbonCopy.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 1}}checked{{/if}}
                            {{/each}}{{/if}} value="1" /><span data-lang="mobile_sms">手机短信</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfCarbonCopy"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.carbonCopy}}
                            {{each notificationStrategyJSON.carbonCopy.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 2}}checked{{/if}}
                            {{/each}}{{/if}} value="2" /><span data-lang="personal_message">消息中心</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfCarbonCopy"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.carbonCopy}}
                            {{each notificationStrategyJSON.carbonCopy.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 3}}checked{{/if}}
                            {{/each}}{{/if}} value="3" /><span data-lang="enterprise_wechat">企业微信</span>
                        </div>
                        <div class="m-2">
                            <input type="checkbox" name="sendModeCodesOfCarbonCopy"
                            {{if notificationStrategyJSON != "" && notificationStrategyJSON.carbonCopy}}
                            {{each notificationStrategyJSON.carbonCopy.sendModeCodes as sendModeCodes}}
                            {{if sendModeCodes == 4}}checked{{/if}}
                            {{/each}}{{/if}} value="4" /><span data-lang="dingding">钉钉</span>
                        </div>
                        <div class="m-2" data-lang="send_content_form_summary">发送内容(表单摘要):</div>
                        <div class="m-2">
                            <select class="w-100" name="templateOfCarbonCopy"></select>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>
<!-- 子流程节点 -->
<script type="text" id="editsubflow-tmpl">
    <div id="editSubFlow">
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#BasicInfo" data-lang="basic_info">基本信息</div>
            <div id="BasicInfo" class="collapse show" data-parent="#editSubFlow">
                <div class="m-2" data-lang="name">名称:</div>
                <div class="m-2"><input class="name" value="{{name}}" /></div>
                <div class="m-2" data-lang="statelabel">状态标签:</div>
                <div class="m-2"><input class="statelabel" value="{{statelabel}}" /></div>
                <div class="m-2" data-lang="orderNum">排序号:</div>
                <div class="m-2"><input class="orderNum" value="{{orderNum}}"  type="number" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"/></div>
                <div class="m-2" data-lang="specify_subFlow">指定子流程:</div>
                <div class="m-2"><input type="radio" name="subFlowDefiType" {{if subFlowDefiType == "01"}}checked{{/if}} value="01" /> <span data-lang="specify_by_selection">通过选择指定</span></div>
                <div class="m-2"><input type="radio" name="subFlowDefiType" {{if subFlowDefiType == "02"}}checked{{/if}} value="02" /> <span data-lang="specified_by_iscript">通过iscript脚本指定</span></div>
                <div class="m-2 {{if subFlowDefiType != "01"}}d-none{{/if}}" data-componentName="subFlowDefiType" data-value="01">
                    <input type="hidden" readonly name="subflowid" value="{{subflowid}}"/>
                    <input readonly name="subflowname" value="{{subflowname}}" />
                    <button name="selectSubFlow" data-lang="choose">选择</button>
                </div>
                <div class="m-2 {{if subFlowDefiType != "02"}}d-none{{/if}}" data-componentName="subFlowDefiType" data-value="02">
                  <span data-lang="script">脚本</span>:
                  <button class="button-srcipt" name="iscriptEdit" title="回调脚本" data-fieldname="subflowScript">
                      <img src="images/editor.png">
                  </button>
                  <textarea class="d-none" name="subflowScript">{{subflowScript}}</textarea>
                </div>
            </div>
        </div>
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#Startup" data-lang="startup">启动</div>
            <div id="Startup" class="collapse" data-parent="#editSubFlow">
                <div class="m-2">
                    <input type="checkbox" name="isToPerson" {{if isToPerson}}checked{{/if}} value="true"/>
                    <span data-lang="sub-process-initiator-sets-the-approver-for-the-first-artificial-node-of-the-sub-process">由子流程启动人设定该子流程第一个人工节点的审批人</span>
                <input type="checkbox" name="checkedOnMultiplePerson" {{if checkedOnMultiplePerson}}checked{{/if}} />
                上一步提交该节点默认选中所有人
                </div>
                <div class="m-2" data-lang="startup_example_count">启动实例数:</div>
                <div class="m-2">
                    <input type="radio" name="numberSetingType" {{if numberSetingType == "01"}}checked{{/if}} value="01" />
                    <span data-lang="predefined_extends">通过预定义指定</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="numberSetingType" {{if numberSetingType == "02"}}checked{{/if}} value="02" />
                    <span data-lang="parent_form_extends">通过父表单字段值指定</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="numberSetingType" {{if numberSetingType == "03"}}checked{{/if}} value="03" />
                    <span data-lang="iscript_extends">通过iScript指定</span>
                </div>
                <div class="m-2 {{if !isToPerson}}d-none{{/if}}" data-componentName="isToPerson" data-value="true">
                    <input type="radio" name="numberSetingType" {{if numberSetingType == "04"}}checked{{/if}} value="04" />
                    <span data-lang="add_process_number_manually">通过手动添加流程数指定</span>
                </div>
                <div class="m-2 {{if !isToPerson}}d-none{{/if}}" data-componentName="isToPerson" data-value="true">
                    <input type="radio" name="numberSetingType" {{if numberSetingType == "05"}}checked{{/if}} value="05" />
                    <span data-lang="approver_number">通过审批人数量指定</span>
                </div>

                <div class="{{if numberSetingType != "01"}}d-none{{/if}}" data-componentName="numberSetingType" data-value="01">
                    <div class="m-2" data-lang="predefined">预定义:</div>
                    <div class="m-2">
                        <input type="number" name="numberSetingContent" value="{{numberSetingContent}}">
                    </div>
                </div>
                <div class="{{if numberSetingType != "02"}}d-none{{/if}}" data-componentName="numberSetingType" data-value="02">
                    <div class="m-2" data-lang="parentflow_form">父流程表单:</div>
                    <div class="m-2">
                        <input type="hidden" readonly name="parentFlowFormId" value="{{parentFlowFormId}}">
                        <input readonly name="parentFlowFormName" value="{{parentFlowFormName}}" />
                        <button name="selectParentFlowForm" data-lang="choose">选择</button>
                    </div>
                    <div class="m-2" data-lang="parent_form_colum">父表单字段值:</div>
                    <div class="m-2">
                        <select class="w-100" id="numberSetingContentSelect" name="numberSetingContentSelect">{{numberSetingContent}}</select>
                    </div>
                </div>
                <div class="m-2 {{if numberSetingType != "03"}}d-none{{/if}}" data-componentName="numberSetingType" data-value="03">
                  <span data-lang="script">脚本</span>:
                    <button class="button-srcipt" name="iscriptEdit" data-fieldname="numberSetingContent">
                        <img src="images/editor.png">
                    </button>
                    <textarea class="d-none" name="numberSetingContent">{{numberSetingContent}}</textarea>
                </div>
            </div>
        </div>
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#AuditSet" data-lang="audit_setup">审批设置</div>
            <div id="AuditSet" class="collapse" data-parent="#editSubFlow">
                <div class="m-2" data-lang="distribute">审批送出设置:</div>
                <div class="m-2">
                    <input type="radio" name="issplit" {{if issplit}}checked{{/if}} value="true" />
                    <span data-lang="step-by-step_approval_current_node">(并行)当下步有多个审批节点时,可以到达多个节点</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="issplit" {{if !issplit}}checked{{/if}} value="false" />
                    <span data-lang="step-by-step_approval_current_node_only_arrival">(串行)当下步有多个审批节点时,只能到达一个节点</span>
                </div>
                <div class="m-2 mt-3" data-lang="centralized">审批到达设置:</div>
                <div class="m-2">
                    <input type="radio" name="isgather" {{if isgather == true}}checked{{/if}} value="true" />
                    <span data-lang="step-by-step_approval_node">(聚合)当上步有多个审批节点时,所有节点完成,流程可以到达</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="isgather" {{if isgather == false}}checked{{/if}} value="false" />
                    <span data-lang="multiple-step_approval_nodes">(非聚合)当上步有多个审批节点时,只要任一节点完成,则流程到达</span>
                </div>
                <div class="m-2 {{if isgather == false}}d-none{{/if}}" data-componentName="isgather" data-value="true">
                    <select class="w-100" name="splitStartNode">
                        {{each splitStartOptions as options}}
                        <option value="{{options.id}}" {{if options.id == splitStartNode}}selected{{/if}}>{{options.name}}</option>
                        {{/each}}
                    </select>
                </div>
            </div>
        </div>
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#Paramstransfer" data-lang="params_transfer">参数传递</div>
            <div id="Paramstransfer" class="collapse" data-parent="#editSubFlow">
                <div class="m-2">
                  <span data-lang="edit">编辑</span>:
                    <button type="button" class="button-srcipt">
                      <img src="images/editor.png">
                    </button>
                    <input type="hidden" name="fieldMappingXML" value="{{fieldMappingXML}}"/>
                    <input type="hidden" name="paramPassingType" value="{{paramPassingType}}"/>

                    <input type="hidden" name="paramPassingScript" value="{{paramPassingScript}}"/>
                    <input type="hidden" name="parentFlowFormId" value="{{parentFlowFormId}}"/>
                    <input type="hidden" name="parentFlowFormName" value="{{parentFlowFormName}}"/>
                    <input type="hidden" name="subFlowFormId" value="{{subFlowFormId}}"/>
                    <input type="hidden" name="subFlowFormName" value="{{subFlowFormName}}"/>
                </div>
            </div>
        </div>
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#Flowwait" data-lang="flow_wait">流程等待</div>
            <div id="Flowwait" class="collapse" data-parent="#editSubFlow">
                <div class="m-2" data-lang="callback_wait_setting">回调等待设置:</div>
                <div class="m-2">
                    <input type="radio" name="callback" {{if !callback}}checked{{/if}} value="false">
                    <span data-lang="startup_sub_flow_then_parent_flow_startup_next_node_rightnow">启动子流程后，父流程立即启动下一节点</span>
                </div>
                <div class="m-2">
                    <input type="radio" name="callback" {{if callback}}checked{{/if}} value="true">
                    <span data-lang="all_sub_flow_finish_parent_flow_startup_next_node">当全部子流程执行完成后，父流程才启动下一节点</span>
                </div>
                <div class="m-2 {{if !callback}}d-none{{/if}}" data-componentName="callback" data-value="true">
                    <span data-lang="iscript_script_is_executed_when_process_callbacks_nocite">注意: 流程回调时执行iscript脚本</span>
                    <span data-lang="edit">编辑</span>:
                    <button type="button" name="iscriptEdit" data-fieldname="callbackScript" class="button-srcipt">
                      <img src="images/editor.png">
                    </button>
                    <textarea class="d-none" name="callbackScript">{{callbackScript}}</textarea>
                </div>
            </div>
        </div>
    </div>
</script>
<!-- 关连线 -->
<script type="text" id="editrelation-tmpl">
    <div id="editRelation">
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#BasicInfo" data-lang="basic_info">基本信息</div>
            <div id="BasicInfo" class="collapse show" data-parent="#editRelation">
                <div class="m-2" data-lang="name">名称:</div>
                <div class="m-2"><input class="name" value="{{name}}" /></div>
            </div>
        </div>
        {{if !isStart}}
        <div class="card">
            <div class="card-header p-2" data-toggle="collapse" data-target="#PathConditionScript" data-lang="path_condition_script">路径进入条件脚本</div>
            <div id="PathConditionScript" class="collapse" data-parent="#editRelation">
                <div class="m-2" data-lang="enter_conditions">注意:任何判断此路径条件是否通过时都将触发一次(并非仅在路径通过时触发)</div>
                <div class="m-2">
                  <input type="radio" name="editMode" {{if editMode == "00"}}checked{{/if}} value="00" /> <span data-lang="design">设计</design>
                </div>
                <div class="m-2 {{if editMode != "00"}}d-none{{/if}}" data-componentName="editMode" data-value="00">
                  <span data-lang="edit">编辑</span>:
                  <button class="button-srcipt" name="relationEdit">
                    <img src="images/editor.png">
                  </button>
                    <input type="hidden" name="formlist"  value="{{formlist}}"/>
                    <input type="hidden" name="filtercondition" value="{{filtercondition}}"/>
                    <input type="hidden" name="processDescription" value="{{processDescription}}"/>
                </div>
                <div class="m-2">
                    <input type="radio" name="editMode" {{if editMode == "01"}}checked{{/if}} value="01" /> <span data-lang="script">脚本</span>
                </div>
                <div class="m-2 {{if editMode != "01"}}d-none{{/if}}" data-componentName="editMode" data-value="01">
                  <span data-lang="script">脚本</span>:
                  <button class="button-srcipt" title="路径进入条件脚本" name="iscriptEdit" data-fieldname="condition">
                      <img src="images/editor.png">
                  </button>
                  <textarea class="d-none" name="condition">{{condition}}</textarea>
                </div>
            </div>
        </div>
        {{/if}}
        <div class="card">
          <div class="card-header p-2" data-toggle="collapse" data-target="#PathActionScript" data-lang="path_action_script">路径执行脚本</div>
          <div id="PathActionScript" class="collapse" data-parent="#editRelation">
            <div class="m-2">
              <span data-lang="script">脚本</span>:  
              <button class="button-srcipt" title="路径执行脚本" name="iscriptEdit" data-fieldname="action">
                <img src="images/editor.png">
              </button>
              <textarea class="d-none" name="action">{{action}}</textarea>
            </div>
          </div>
        </div>
        {{if !isStart}}
        <div class="card">
          <div class="card-header p-2" data-toggle="collapse" data-target="#PathValidateScript" data-lang="path_action_script">路径送出校验脚本</div>
          <div id="PathValidateScript" class="collapse" data-parent="#editRelation">
              <div class="m-2">
                <span data-lang="script">脚本</span>:  
                <button class="button-srcipt" title="路径送出校验脚本" name="iscriptEdit" data-fieldname="validateScript">  
                  <img src="images/editor.png">
                </button>
                <textarea class="d-none" name="validateScript">{{validateScript}}</textarea>
              </div>
          </div>
        </div>
        {{/if}}
    </div>
</script>
<!-- <script src="./script/jquery-1.11.3.min.js"></script> -->
<script src="FlowDiagram/script/flowDiagram.js"></script>
<script src="script/bootstrap.min.js"></script>
<script src="script/template.js"></script>
<script src="./script/design.js"></script>
<script src="script/jquery.nicescroll.js"></script>

<script src="../js/jquery-ui/js/jquery-obpm-extend.js"></script>
<script src="../js/jquery-ui/js/jquery-ui-1.9.2.custom.dialog.min.js"></script>
<script src="../js/jquery-ui/plugins/jquery.form.js"></script>
<script src="../js/jquery-ui/external/jquery.bgiframe-2.1.1.js"></script>
<script src="../js/jquery-ui/external/ui.dialog.maximize.js"></script>
<script src="../js/jquery-ui/external/jquery-framedialog.js"></script>


<script src="script/jquery-bridge.js"></script>



<script>
  var ajax = function (data) {
    return new Promise((resolve, reject) => {
      var xhr = new XMLHttpRequest();
      xhr.onreadystatechange = function () {
        if (xhr.readyState === 4) {
          if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304) {
            // resolve(xhr.responseText);
            data.success(xhr.responseText);
          } else {
            reject(xhr.status);
          }
        } else {
          // HTTP请求还在继续...
        }
      };
      xhr.open(data.methods, data.url, true);
      xhr.setRequestHeader("content-type", "application/json");

      delete data.methods;
      delete data.url;
      xhr.send(JSON.stringify(data.data));
    });
  };
  var title_uf = "{*[UserField]*}";
  var title_df = "{*[DepartmentField]*}";
  var title_more = "{*[More]*}";

  var cmdReturn = "core/workflow/list.action";
  var cmdSave = "core/workflow/save.action";
  var cmdEdit = "core/workflow/edit.action";
  var currentId = "appletcontent";
  var isEditNow = false;
  var errorMessage = "";
  // console.log(window.location.search)
  var str = window.location.search.replace(/\?/, '').split("&");
  var params = {};
  str.forEach(function (el, index) {
    params[el.split("=")[0]] = el.split("=")[1];
  });
  // console.log('params',params)
  var contextPath = params.contextPath;
  var staticPath = params.staticPath;

  var applicationId = params.applicationId;
  $("input[name='_moduleid']").val(params.moduleId);
  // var applicationId = $("input[name='application']").val();
  function caclcuHeight() {
    $(".workflows-content").css(
      "height",
      $("body").height() - $(".workflows-topbar").height()
    );
    $(".workflows-canvas").niceScroll({
      cursorcolor: "#ccc",
      cursoropacitymax: 1,
      touchbehavior: false,
      cursorwidth: "7px",
      cursorborder: "0",
      cursorborderradius: "7px",
      autohidemode: "leave"
    });
    // $(".edit-content-panel").niceScroll({
    //   cursorcolor: "#ccc",
    //   cursoropacitymax: 1,
    //   touchbehavior: false,
    //   cursorwidth: "7px",
    //   cursorborder: "0",
    //   cursorborderradius: "7px",
    //   autohidemode: "leave"
    // });
  }
  function allowDrop(ev) {
        ev.preventDefault();
     }
  function drag(ev){
      ev.dataTransfer.setData("Text",ev.target.id);
  }
  function handleTest(event) {
    window.parent['handleSpanClick'](true);
    $(".handleTest").css("display", 'none')
    $(".closeAllScren").css("display", 'inline-block')
  }
  function closeAllScren(event) {
    window.parent['handleSpanClick'](false);
    $(".handleTest").css("display", 'inline-block')
    $(".closeAllScren").css("display", 'none')
  }
  $(function () {

    var getFlowDetail = {
      methods: "get",
      url: `${params.contextPath}/designtime/applications/modules/workflows/${params.flowId}`,
      success: function (result) {
        var detail = JSON.parse(result).data;
        $("#flow_container").html(detail.flow);

        $("[name='content.subject']").val(detail.name);
        $("#authorname").val(detail.authorname);

        $("[name='content.id").val(detail.id);
      }
    };
    $("[name='content.parentId']").val(params.moduleId);
    $("[name='parentId']").val(params.moduleId);
    $("[name='_moduleid']").val(params.moduleId);
    if (params.flowId) {
      ajax(getFlowDetail);
    }

    var $workflow = $(".workflows-canvas");
    var $editPanel = $(".edit-content-panel");

    $workflow.niceScroll({
      cursorcolor: "#CFCFCF",
      cursorwidth: "7px"
    });

    // $editPanel.niceScroll({
    //   cursorcolor: "#CFCFCF",
    //   cursorwidth: "7px"
    // });

    WorkFlowDesign.Core.init();
    //计算流程画布的高
    $(".workflows-content").css(
      "height",
      $("body").height() - $(".workflows-topbar").height()
    );
    $(".workflows-canvas").niceScroll({
      cursorcolor: "#ccc",
      cursoropacitymax: 1,
      touchbehavior: false,
      cursorwidth: "7px",
      cursorborder: "0",
      cursorborderradius: "7px",
      autohidemode: "leave"
    });
    $editPanel.niceScroll({
      cursorcolor: "#ccc",
      cursoropacitymax: 1,
      touchbehavior: false,
      cursorwidth: "7px",
      cursorborder: "0",
      cursorborderradius: "7px",
      autohidemode: "leave"
    });
  });

  function getMessage() {
    var $msgDivObj = jQuery("#msg").find(".msgSub");
    var msgType = $msgDivObj.attr("msgType"); //消息类型
    var content = $msgDivObj.html();
    if (jQuery.trim(content) != "") {
      if (msgType == "error") {
        alert(jQuery.trim(content));
      } else {
        alert(jQuery.trim(content));
      }
    }
  }

  function ev_save() {
    document.getElementsByName("content.flow")[0].value = decodeURIComponent(
      document.WorkFlowDiagram.saveToXML()
    );
    formItem.submit();
  }

  function tempsubject(sj) {
    sj = decodeURIComponent(sj);
    document.getElementsByName("content.subject")[0].value = sj;
  }

  function deSelect() {
    document.WorkFlowDiagram.deSelect();
  }

  function addManualNode() {
    document.WorkFlowDiagram.addManualNode();
    window.top.toThisHelpPage("application_module_workflows_info");
  }

  function addStartNode() {
    document.WorkFlowDiagram.addStartNode();
    window.top.toThisHelpPage("application_module_workflows_info");
  }
  function addGatewayNode() {
    document.WorkFlowDiagram.addGatewayNode();
    // window.top.toThisHelpPage("application_module_workflows_info");
  }

  function addAbortNode() {
    document.WorkFlowDiagram.addAbortNode();
    window.top.toThisHelpPage("application_module_workflows_info");
  }

  function addTerminateNode() {
    document.WorkFlowDiagram.addTerminateNode();
    window.top.toThisHelpPage("application_module_workflows_info");
  }

  function addSuspendNode() {
    document.WorkFlowDiagram.addSuspendNode();
    window.top.toThisHelpPage("application_module_workflows_info");
  }

  function addCompleteNode() {
    document.WorkFlowDiagram.addCompleteNode();
    window.top.toThisHelpPage("application_module_workflows_info");
  }

  function addAutoNode() {
    document.WorkFlowDiagram.addAutoNode();
    window.top.toThisHelpPage("application_module_workflows_info");
  }

  function addSubflow() {
    document.WorkFlowDiagram.addSubFlow();
    window.top.toThisHelpPage("application_module_workflows_info");
  }

  function addRelation() {
    document.WorkFlowDiagram.addRelation();
    window.top.toThisHelpPage("application_module_workflows_info");
  }

  function removeElement() {
    if (document.WorkFlowDiagram.isAssignBack()) {
      alert("{*[It's a specified return-to node,can't delete]*}");
      return;
    } else if (isEditNow) {
      alert("{*[It's a node whom is editing,can't delete]*}");
    } else {
      document.WorkFlowDiagram.removeElement();
    }
  }
  function moveElement() { }

  function hiddenDiv() {
    var isFirefox = navigator.userAgent.indexOf("Firefox") > 0 ? true : false;
    //是火狐浏览器不给定位，因为定位后再返回会刷新flash。
    if (!isFirefox) {
      document.getElementById("appletcontent").style.position = "absolute";
      document.getElementById("appletcontent").style.top = -1000 + "px";
    }
  }
  function showDiv() {
    document.getElementById("appletcontent").style.position = "static";
  }

  function editSubflow(className, currToEdit) {
    var s_module = params.moduleId;
    var url = "addSubflow_parentFlowForm.html?s_module=" +
      params.moduleId +
      "&applicationId=" +
      applicationId + "&contextPath=" +
      contextPath;
    var actorAttr = new Object();
    var ieheight = document.body.clientHeight;
    var oldAttr = currToEdit;
    if (oldAttr == null) return;
    var attr = {};
    attr.name = oldAttr.name;
    attr.statelabel = oldAttr.statelabel;
    attr.subFlowDefiType = oldAttr.subFlowDefiType;
    attr.subflowid = oldAttr.subflowid;
    attr.subflowname = oldAttr.subflowname;
    attr.subflowScript = oldAttr.subflowScript;
    attr.numberSetingContent = oldAttr.numberSetingContent;
    attr.numberSetingType = oldAttr.numberSetingType;
    attr.paramPassingType = oldAttr.paramPassingType;
    attr.parentFlowFormId = oldAttr.parentFlowFormId;
    attr.subFlowFormId = oldAttr.subFlowFormId;
    attr.parentFlowFormName = oldAttr.parentFlowFormName;
    attr.subFlowFormName = oldAttr.subFlowFormName;
    attr.fieldMappingXML = oldAttr.fieldMappingXML;
    attr.paramPassingScript = oldAttr.paramPassingScript;
    attr.callback = oldAttr.callback;
    attr.callbackScript = oldAttr.callbackScript;
    attr.issplit = oldAttr.issplit;
    attr.isgather = oldAttr.isgather;
    attr.splitStartNode = oldAttr.splitStartNode;
    attr.isToPerson = oldAttr.isToPerson;
    $.dialog.show({
      //opener:window.parent.parent,
      width: 650,
      height: ieheight + 20,
      url: url,
      args: { oldAttr: attr },
      title: "参数传递方式",
      close: function (actorAttr) {
        if (actorAttr != null) {
          $("input[name='fieldMappingXML']").val(actorAttr.fieldMappingXML);
          $("input[name='paramPassingType']").val(actorAttr.paramPassingType);

          $("input[name='paramPassingScript']").val(
            actorAttr.paramPassingScript
          );
          $("input[name='parentFlowFormId']").val(actorAttr.parentFlowFormId);
          $("input[name='parentFlowFormName']").val(
            actorAttr.parentFlowFormName
          );
          $("input[name='subFlowFormId']").val(actorAttr.subFlowFormId);
          $("input[name='subFlowFormName']").val(actorAttr.subFlowFormName);
          currToEdit.fieldMappingXML = actorAttr.fieldMappingXML;
          currToEdit.paramPassingType = actorAttr.paramPassingType;

          currToEdit.paramPassingScript = actorAttr.paramPassingScript;
          currToEdit.parentFlowFormId = actorAttr.parentFlowFormId;
          currToEdit.parentFlowFormName = actorAttr.parentFlowFormName;
          currToEdit.subFlowFormId = actorAttr.subFlowFormId;
          currToEdit.subFlowFormName = actorAttr.subFlowFormName;
          WorkFlowDesign.Core.editSubFlow(currToEdit);
        }
        //window.top.toThisHelpPage("application_module_workflows_info");
      }
    });
  }

  /**
   * 给流程编辑器脚本调用
   */
  function flexOpenIsCriptEditor(str, value, className, currToEdit) {
    str = decodeURIComponent(str);
    var strs = JSON.parse(str);
    var nodeId = strs.nodeId;
    var fieldName = strs.fieldName;
    var label = strs.label;
    var url = `../publicHtml/iscripteditor.html?contextPath=${params.contextPath}&staticPath=${params.staticPath}`;
    var t = window;
    // debugger
    $.dialog.show({
      width: t.document.body.clientWidth - 200,
      height: t.document.body.clientHeight - 100,
      url: url,
      args: {
        fieldName: WorkFlowDesign.Utils.dencodeHTML(value),
        label: label,
        feedbackMsg: "",
        parent: window,
        type: 'flow'
      },
      title: "脚本编辑器",
      close: function (result) {
        if (result != null && result != "undefined" && result != "null") {
          $("[name='" + fieldName + "']").val(result);
          if (className == "cn.myapps.runtime.workflow.element.AutoNode") {
            WorkFlowDesign.Core.editAutoNode(currToEdit);
          } else if (
            className == "cn.myapps.runtime.workflow.element.ManualNode"
          ) {
            WorkFlowDesign.Core.editManualNode(currToEdit);
          } else if (
            className == "cn.myapps.runtime.workflow.element.SubFlow"
          ) {
            WorkFlowDesign.Core.editSubFlow(currToEdit);
          } else if (
            className == "cn.myapps.runtime.workflow.element.Relation"
          ) {
            WorkFlowDesign.Core.editRelation(currToEdit);
          }
        } else if (!result) {
          $("[name='" + fieldName + "']").val(value);
        }
        WorkFlowDesign.Core.savePropWithEditNode();
      }
    });
  }

  //编辑关联
  function editRelation(className, currToEdit) {
    var s_module = params.moduleId;
    var url = "./addRelation_parentFlowForm.html"
    if (className == "cn.myapps.runtime.workflow.element.Relation") {
      var attr = {};
      attr.name = currToEdit.name;
      attr.condition = currToEdit.condition;
      attr.action = currToEdit.action;
      attr.validateScript = currToEdit.validateScript;
      attr.filtercondition = currToEdit.filtercondition;
      attr.editMode = currToEdit.editMode;
      attr.processDescription = currToEdit.processDescription;
      attr.formlist = currToEdit.formlist;
      $.dialog.show({
        width: 600,
        height: 500,
        url: url,
        args: { oldAttr: attr, applicationId: params.applicationId, contextPath: params.contextPath, moduleId: params.moduleId, },
        title: "路径进入条件脚本",
        close: function (actorAttr) {
          if (actorAttr != null) {
            $("input[name='filtercondition']").val(actorAttr.filtercondition);
            $("input[name='formlist']").val(actorAttr.formlist);
            $("input[name='processDescription']").val(
              actorAttr.processDescription
            );
            WorkFlowDesign.Core.editRelation(currToEdit);
          }
        }
      });
    } else {
      return;
    }
  }

  /**
   * 选择角色
   * @param {*} className
   * @param {*} currToEdit
   * @param {*} fieldname
   */
  function selectRole(className, currToEdit, fieldname) {
    //(R11e8-79d3-9d7486f4-92a7-5b1b03191a88|系统管理员;)
    var datas = [];
    var fieldData = $("[name='" + fieldname + "']").val();
    var tempFieldData = fieldData;
    if (tempFieldData && tempFieldData.length > 3) {
      if (tempFieldData[0] == "(") {
        tempFieldData = tempFieldData.substr(1, tempFieldData.length - 1);
      }
      if (tempFieldData[tempFieldData.length - 1] == ")") {
        tempFieldData = tempFieldData.substr(0, tempFieldData.length - 1);
      }
      if (tempFieldData[tempFieldData.length - 1] == ";") {
        tempFieldData = tempFieldData.substr(0, tempFieldData.length - 1);
      }
      var roleDataArray = tempFieldData.split(";");
      for (
        var roleDataIndex = 0;
        roleDataIndex < roleDataArray.length;
        roleDataIndex++
      ) {
        var roleDataItem = roleDataArray[roleDataIndex];
        var roleDataId = roleDataItem.split("|")[0];
        var roleDataName = roleDataItem.split("|")[1];
        if (roleDataId[0] == "R") {
          roleDataId = roleDataId.substr(1, roleDataId.length - 1);
        }
        var dataItem = { id: roleDataId, name: roleDataName };
        datas.push(dataItem);
      }
    }
    var url = './selectRole.html';
    window.top.selectRoleListPre = datas;
    $.dialog.show({
      width: 360,
      height: 430,
      url: url,
      args: {
        applicationId: params.applicationId,
        contextPath: params.contextPath,
        data: datas
      },
      title: "选择角色",
      close: function (result) {
        result2 = window.top.selectRoleList;

        if (result == null || result === undefined) {
          //取消按钮
        } else {
          //确认按钮
          var str = "";
          var showStr = "";
          if (result.length > 0) {
            str += "(";
            if (datas.length > 0) {
              for (var j = 0; j < datas.length; j++) {
                for (var k = 0; k < result.length; k++) {
                  if (result[k].id == datas[j].id) {
                    // str += "R" + result[k].id + "|" + result[k].name + ";";
                    // showStr += result[k].name + ";";

                    break;
                  }
                }
              }
            }
            for (var i = 0; i < result.length; i++) {
              var roleId = result[i].id;
              var roleName = result[i].name;

              // yx 角色选择不加入框中
              if (roleId != params.applicationId) {
                str += "R" + roleId + "|" + roleName + ";";
                showStr += roleName + ";";
              }
            }
            str += ")";
          }

          $("[name='" + fieldname + "']").val(str);
          $("[name='" + fieldname + "Show']").val(showStr);
          if (className == "cn.myapps.runtime.workflow.element.ManualNode") {
            WorkFlowDesign.Core.editManualNode(currToEdit);
          }
        }
        WorkFlowDesign.Core.savePropWithEditNode();
      }
    });
  }

  //选择角色得到按先后选择顺序的结果

  function selectRoleChange(text) { }

  function selectForm(className, currToEdit) {
    var url = './selectForm.html';
    url = addParam(url, "s_module", params.moduleId);
    url = addParam(url, "application", params.appId);
    var obj = new Object();
    var ieheight = document.body.clientHeight;
    obj.fieldPermList = decodeURIComponent(currToEdit.fieldpermlist);
    obj.activityPermList = decodeURIComponent(currToEdit.activityPermList);
    $.dialog.show({
      //opener:window.parent.parent,
      width: 700,
      height: ieheight + 20,
      url: url,
      args: {
        pObj: obj,
        appId: params.appId,
        moduleId: params.moduleId,
        contextPath: params.contextPath
      },
      title: "选择表单",
      close: function (rtn) {
        var formList = "";
        var fieldpermlist = "";

        if(rtn){
          if (rtn.fieldPermList == null) {
          rtn.fieldPermList = obj.fieldPermList;
        }

        if (rtn.fieldPermList) {
          try {
            var list = eval(rtn.fieldPermList);

            for (var i = 0; i < list.length; i++) {
              formList += list[i].formname + ",";
            }
            fieldpermlist = rtn.fieldPermList;
          } catch (ex) { }
        }

        if (formList) {
          formList = formList.substring(0, formList.lastIndexOf(","));
        }

        var activity_FormList = "";
        var activityPermList = "";

        if (rtn.activityPermList == null) {
          rtn.activityPermList = obj.activityPermList;
        }

        if (rtn.activityPermList) {
          try {
            var list = eval(rtn.activityPermList);

            for (var i = 0; i < list.length; i++) {
              activity_FormList += list[i].formname + ",";
            }
            activityPermList = rtn.activityPermList;
          } catch (ex) { }
        }

        if (activity_FormList) {
          activity_FormList = activity_FormList.substring(
            0,
            activity_FormList.lastIndexOf(",")
          );
        }

        formList =
          "字段:[" + formList + "]操作按钮:[" + activity_FormList + "]";

        if (className == "cn.myapps.runtime.workflow.element.ManualNode") {
          $("[name='fieldpermlist']").val(fieldpermlist);
          $("[name='activityPermList']").val(activityPermList);
          $("[name='formname']").val(formList);
          WorkFlowDesign.Core.editManualNode(currToEdit);
        }
        WorkFlowDesign.Core.savePropWithEditNode();
        }
      }
    });
  }

  function ev_onsubmit() {
    var obj = {};
    obj.name = $("[name='content.subject']").val()
    // var tempsubject = $("[name='content.subject']").val();
    if (obj.name == "") {
      alert("流程名称必填");
      return false;
    }
    if (params.flowId) {
      obj.authorname = $("#authorname").val();
      // obj.lastmodify="";
      obj.subject = $("[name='content.subject']").val();
      obj.flow = $("#flow_container").val();
      if(JSON.parse(sessionStorage.getItem('software')).type != 1){
        obj.parentId = $("[name='content.parentId']").val();
      }else{
        obj.parentId = sessionStorage.getItem('appId')
      }
      obj.applicationId = sessionStorage.getItem('appId')
      var submit = {
        methods: "put",
        data: obj,
        url: `${params.contextPath}/designtime/applications/modules/workflows/${params.flowId}`,
        success: function (result) {
          ev_onexit(result)
        }
      }
      ajax(submit);
    }
    else {
      var obj2 = {};
      obj2.name = $("[name='content.subject']").val();
      obj2.authorname = $("#authorname").val();
      obj2.subject = $("[name='content.subject']").val();
      obj2.flow = $("#flow_container").val();
      if(JSON.parse(sessionStorage.getItem('software')).type != 1){
        obj2.parentId = $("[name='content.parentId']").val();
      }else{
        obj2.parentId = sessionStorage.getItem('appId')
      }
      obj2.applicationId = sessionStorage.getItem('appId')

      let moduleid = params.moduleId==='undefined'?sessionStorage.getItem('appId'):params.moduleId

      var newSubmit = {
        methods: "post",
        data: obj2,
        url: `${params.contextPath}/designtime/applications/${params.applicationId}/modules/${moduleid}/workflows`,
        success: function (result) {
          params.flowId = JSON.parse(result).data.id
          ev_onexit(result)
        }
      }
      ajax(newSubmit)
    }

    // document.forms["flow"].action = '<o:url action="save"></o:url>';
    // document.forms["flow"].submit();
    //console.log(document.forms['flow'])
  }

  function ev_onexit(result) {
    window.parent["processList"](result);
    // document.forms[0].action = '<o:url action="list"></o:url>';
    // document.forms[0].submit();
  }

  function ev_switchsheet(id) {
    /* 	document.getElementById('appletcontent').style.display="none"; */
    var isChrome = navigator.userAgent.indexOf("Chrome") > 0 ? true : false;
    if (isChrome) {
      document.getElementById("xmlcontent").style.display = "none";
      document.getElementById(id).style.display = "";
      if (id != currentId)
        if (id == "appletcontent") {
          var xml = document.getElementsByName("content.flow")[0].value;
          document.WorkFlowDiagram.loadXML(xml);
          document.getElementsByName("modify")[0].checked = false;
          document.getElementById("appletcontent").style.position = "static";
          document.getElementsByName("content.flow")[0].style.color = "gray";
        } else {
          document.getElementById("appletcontent").style.position =
            "absolute";
          document.getElementById("appletcontent").style.top = -1000 + "px";
          document.getElementsByName(
            "content.flow"
          )[0].value = decodeURIComponent(
            document.WorkFlowDiagram.saveToXML()
          );
          errorMessage = "";
        }
      currentId = id;
    } else {
      document.getElementById("appletcontent").style.display = "none";
      document.getElementById("xmlcontent").style.display = "none";
      document.getElementById(id).style.display = "";
      if (id != currentId)
        if (id == "appletcontent") {
          var xml = document.getElementsByName("content.flow")[0].value;
          document.WorkFlowDiagram.loadXML(xml);
          document.getElementsByName("modify")[0].checked = false;
          document.getElementsByName("content.flow")[0].style.color = "gray";
        } else {
          document.getElementsByName(
            "content.flow"
          )[0].value = document.WorkFlowDiagram.saveToXML();
          errorMessage = "";
        }
      currentId = id;
    }
  }

  function textAlert(k) {
    alert(k);
  }

  function ev_init() {
    var height = document.body.clientHeight;
  }

  function checkJRE() {
    try {
      if (document.getElementById("workflowApplet").isActive()) {
        //alert('yes');
      }
    } catch (error) {
      if (confirm("您的浏览器暂不支持此控件,是否要下载安装")) {
        window.open("http://www.java.com/zh_CN/");
      }
    }
  }

  function resize_workflowApplet() {
    var iewidth = jQuery("body").width() - 100;
    var ieheight = document.body.clientHeight - 150;
    jQuery("#workflowApplet").attr("width", iewidth);
    jQuery("#workflowApplet").attr("height", ieheight);
    jQuery("table[name=test]").attr(
      "height",
      document.body.clientHeight - 50
    );
  }
  /* 签入
   */
  function ev_checkin() {
    document.getElementsByName("content.flow")[0].value = decodeURIComponent(
      document.WorkFlowDiagram.saveToXML()
    );
    document.forms[0].action = '<o:url action="checkin"></o:url>';
    document.forms[0].submit();
  }
  /*
   * 签出
   */
  function ev_checkout() {
    document.getElementsByName("content.flow")[0].value = decodeURIComponent(
      document.WorkFlowDiagram.saveToXML()
    );
    document.forms[0].action = '<o:url action="checkout"></o:url>';
    document.forms[0].submit();
  }

  function toJson() {
    var limittimecount = document.WorkFlowDiagram.getLimittimecount();
    var timeunit = document.WorkFlowDiagram.getTimeunit();
    var isnotifysuperior = document.WorkFlowDiagram.getIsnotifysuperior();
    var responsibleType = document.WorkFlowDiagram.getResponsibleType();
    var overridetimeeditmode = document.WorkFlowDiagram.getOverridetimeEditMode();
    var overridetimeScript = decodeURIComponent(
      document.WorkFlowDiagram.getOverrideTimeLimitScript()
    );

    var map = {};
    var notificationTypeArray = document.WorkFlowDiagram.getNotificationTypeArray();
    for (var i = 0; i < notificationTypeArray.length; i++) {
      // 创建提醒,设置发送方式
      var notificationType = notificationTypeArray[i];
      var notification = createNotification(notificationType);
      if (!notification) {
        continue;
      }
      map[notificationType] = notification;
      // 根据不同的类型配置属性
      if (notificationType == "send") {
        var receiverArray = document.WorkFlowDiagram.getSendReceiver();
        // 接收者处理
        notification.receiverTypes = receiverArray;
      } else if (notificationType == "arrive") {
        // 短信审批
        notification.smsApproval = document.WorkFlowDiagram.getSmsApproval();
      } else if (notificationType == "reject") {
        notification.responsibleType = responsibleType;
      } else if (notificationType == "overdue") {
        notification.limittimecount = limittimecount;
        notification.timeunit = timeunit;
        notification.isnotifysuperior = document.WorkFlowDiagram.getCheckBoxValue2();
        notification.editMode = overridetimeeditmode;
        notification.limittimeScript = overridetimeScript;
      } else if (notificationType == "reminder") {
        notification.responsibleType = responsibleType;
      }
      // 设置模板
      if (notificationType != "reminder") {
        notification.template = document.WorkFlowDiagram.getTemplate(
          notificationType
        );
      }
    }
    return jQuery.json2Str(map);
  }

  function createNotification(type) {
    //新增了一个参数，type ，用来标示是 那个一种发送方式里面的 方法， 例如 “发送”，方式里的发送到手机方法
    var sendModeCodes = document.WorkFlowDiagram.getCheckBoxValue(type);
    if (sendModeCodes.length > 0) {
      var notification = new Object();
      notification.sendModeCodes = sendModeCodes;
      return notification;
    } else {
      return null;
    }
  }

  function flexToParse(text) {
    text = decodeURIComponent(text);
    var notificationStrategyJSON = HTMLDencode(text);
    return JSON.parse(notificationStrategyJSON);
  }

  function flexToJson2(array) {
    return jQuery.json2Str(array);
  }
</script>



<script>
  // 一定要写在body后面【加载多语言】
  jQuery(document).ready(function () {
    let lang = getCookie('designerLanguage')
    // clearTimeout(timer)
    let timer = setTimeout(() => {
      jQuery.i18n.properties({//加载资浏览器语言对应的资源文件
        name: "strings", //资源文件名称
        path: 'i18n/', //资源文件路径
        language: lang,
        cache: false,
        mode: 'map', //用Map的方式使用资源文件中的值
        callback: function () {//加载成功后设置显示内容
          for (let i in $.i18n.map) {
            $('[data-lang="' + i + '"]').text($.i18n.map[i]);
          }
          // document.title = $.i18n.map['title'];
        }
      });
    }, 1000)
  })

</script>

</html>