<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@include file="/WEB-INF/ehr/commons/jsp/commonInclude.jsp" %>
<script type="text/javascript">

    /* *************************** 模块初始化 ***************************** */
    var editorParam = {
        //form

        init: function () {

            this.initForm();
            this.bindEvents();
        },
        initForm: function () {
            var me = this;
           var data;
            var modelString = "${model.id}";
            if(modelString!=undefined && modelString!=null && modelString.length>0)
            {
               data={
                    id: "${model.id}",
                    name: "${model.name}",
                   code: "${model.code}",
                   status: "${model.status}",
                   developer: "${model.developer}",
                   icon: "${model.icon}",
                   appUrl: "${model.appUrl}",
                   appKey: "${model.appKey}",
                   appSecret: "${model.appSecret}",
                };

            }

            $("#div_info_form").ligerAutoForm({
                data:data,
                validate:{
                    name:"required",
                    appUrl:"required",
                    appKey:"required",
                    appSecret: {
                        required:true
                    }

                },

            });
        },
        bindEvents: function () {
            var me = this;

            $(".m-form-bottom").on("click","#btnCancel",function () {
                parent.app.dialog.close();
            });

            $(".m-form-bottom").on("click","#btnEditor",function () {
                //TODO 详情页面变编辑
                parent.app.dialog.close();

            });

            $("#status").ligerComboBox({data : [{"value":"有效","code":"1"},{"value":"无效","code":"0"}],
                cancelable:false,
                onSuccess:function(data){
                }});

            liger.get("status")._setValue(${model.status});

        }
    };



    $(function () {
        editorParam.init();

    });
</script>