js前端页面回显的方式

function load() {
    $('#departTable')
        .bootstrapTable(
            {
                method : 'get', // 服务器数据的请求方式 get or post
                url : prefix + "/list", // 服务器数据的加载地址
                striped : true, // 设置为true会有隔行变色效果
                dataType : "json", // 服务器返回的数据类型
                pagination : true, // 设置为true会在底部显示分页条
                // queryParamsType : "limit",
                // //设置为limit则会发送符合RESTFull格式的参数
                singleSelect : false, // 设置为true将禁止多选
                iconSize : 'outline',
                pageSize : 10, // 如果设置了分页,每页数据条数
                pageNumber : 1, // 如果设置了分布,首页页码
                search : true, // 是否显示搜索框
                showColumns : true, // 是否显示内容下拉框(选择显示的列)
                sidePagination : "server",// 设置在哪里进行分页,可选值为"client" 或者
                // "server"
                // queryParams : queryParams,
                // //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
                // queryParamsType = 'limit' ,返回参数必须包含
                // limit, offset, search, sort, order 否则, 需要包含:
                // pageSize, pageNumber, searchText, sortName,
                // sortOrder.
                // 返回false将会终止请求
                columns : [
                    {
                        field : 'id', // 列字段名
                        title : '序号' // 列标题
                    },
                    {
                        field : 'deptNamee',
                        title : '单位名称'
                    },
                    {
                        field : 'detailAddress',
                        title : '单位地址'
                    },
                    {
                        field : 'postalcode',
                        title : '邮政编码'
                    },
                    {
                        field : 'adminDivision',
                        title : '行政区划代码'
                    },
                    {
                        field : 'principalName',
                        title : '单位负责人'
                    },
                    {
                        field : 'principalJob',
                        title : '职务'
                    },
                    {
                        field : 'principalPhone',
                        title : '办公电话'
                    },
                    {
                        field : 'principalCellPhone',
                        title : '移动电话'
                    },
                    {
                        field : 'principalEmail',
                        title : '电子邮件'
                    },
                    {
                        field : 'subjection',
                        title : '隶属关系'
                    },
                    {
                        field : 'unitType',
                        title : '单位类型'
                    },
                    {
                        field : 'industryType',
                        title : '行业类别'
                    },
                    {
                        field : 'count',
                        title : '信息系统总数总数'
                    }]
            });
}

这种方式实际上是通过js向后端发请求,去执行任务,然后将结果返回给前端去显示的。

 <script src="/js/appjs/nsmp/analysis/deptAnalysis.js"></script>

这是页面前端的调用,实际上流程是:

controller页面加载通过controller层去完成加载,然后html层加载调用js层,js层加载发送接口到controller层,controller层通过方法去调用后端的service层,service层的IMPL去实现方法,通过dao层去调用XML层,然后XML去操作数据库。

猜你喜欢

转载自blog.csdn.net/wyqwilliam/article/details/83867055