Ver código fonte

git-svn-id: https://192.168.57.71/svn/jsgkj@1076 931142cf-59ea-a443-aa0e-51397b428577

ld_zhoutl 8 anos atrás
pai
commit
37c3d0c90f

+ 0 - 1
gkaqv2/trunk/modules/web/src/main/webapp/static/css/common/basic.css

@@ -112,7 +112,6 @@ body {
   margin: 0;
   padding: 0px 0px 0px;
   border:1px solid #939393;
-  width: 1280px;
 }
 .page-header {
   margin: 0 0 12px;

+ 5 - 7
gkaqv2/trunk/modules/web/src/main/webapp/static/css/common/main.css

@@ -8,22 +8,21 @@
 .p_all {
 	height:100%;
 	text-align:center;
+	background-image:url('../../images/list/repeat_bg.png');
 }
 .p_block {
-	min-width:1280px;
-	width:1280px;
+	width:100%;
 	margin:0 auto;
 	position:relative;
 }
 .p_headblock {
 	background-color:#23A5B8;
-	width:1280px;
+	width:100%;
 	height:34px;
 	margin:0 auto;
 	position:relative;
 }
 .p_headleft {
-	min-width:1280px;
 	width:100%;
 	text-align:left;
 	padding:7px 0px 0px 10px;
@@ -32,7 +31,6 @@
 }
 
 .p_buttondiv {
-	min-width:1280px;
 	width:100%;
 	text-align:left;
 	padding:6px 0px 6px 20px;
@@ -55,8 +53,7 @@
 
 .p_searchdiv {
 	display:none;
-	min-width:1280px;
-	width:1280px;
+	width:100%;
 	padding:0px 0px 0px 0px;
 	text-align:center;
 }
@@ -242,6 +239,7 @@ body .demo-class iframe{border-bottom-left-radius:0px;border-bottom-right-radius
 easyui²¼¾Ö¹²Í¨¶¨Òå
 */
 .regionCenterStyle{
+	width:auto;
 	border:0px;
 }
 .regionNorthStyle{

+ 7 - 1
gkaqv2/trunk/modules/web/src/main/webapp/static/js/common/common.js

@@ -186,7 +186,13 @@ function setMulti() {
 
 function resizePageGrid(grid_selector) {
 	$(window).on('resize.jqGrid', function() {
-		$(grid_selector).jqGrid('setGridWidth', $(".page-content").width());
+	    var height1 = $(window).height();
+	    $(".easyui-layout").attr("style","width:100%;height:"+height1+"px");  
+        $(".easyui-layout").layout("resize",{  
+            width:"100%",
+            height:height1+"px"
+        });  
+		$(grid_selector).jqGrid('setGridWidth', $(".page-content").width()-1);
 	});
 	//resize on sidebar collapse/expand
 	var parent_column = $(grid_selector).closest('[class*="col-"]');

+ 205 - 0
gkaqv2/trunk/modules/web/src/main/webapp/static/js/zyfzsq/index.js

@@ -0,0 +1,205 @@
+/**
+ * js
+ */
+var grid_selector = "#grid-table";
+var pager_selector = "#grid-pager";
+jQuery(function($) {
+    // 初始化Grid
+    initGrid();
+});
+
+
+/**
+ * 初始化Grid
+ */
+function initGrid() {
+    //resize to fit page size
+    resizePageGrid(grid_selector);
+    // 数据表格初始化
+    jQuery(grid_selector).jqGrid({
+        url : basePath + '/zyfzsq/list',
+        mtype : "POST", //提交方式
+        datatype : "json",
+        autowidth: false,
+        height :"auto",
+        shrinkToFit: true,
+        sortname : "", //默认的排序列
+        sortorder : "", //默认的排序列
+        colNames : [ 'id','用户名','登录名','用户名','登录名'],
+        colModel : [ {
+            name : 'id',
+            index : 'id',
+            key : true,
+            hidden:true,
+            editable : false,
+            sortable : false
+        },{
+            name : 'realName',
+            index : 'realName',
+            editable : false,
+            sortable : false
+        },{
+            name : 'loginName',
+            index : 'loginName',
+            editable : false,
+            sortable : false
+        },{
+            name : 'realName',
+            index : 'realName',
+            editable : false,
+            sortable : false
+        },{
+            name : 'loginName',
+            index : 'loginName',
+            editable : false,
+            sortable : false
+        } ],
+        rowNum : _rowNum, //每页显示记录数
+        rowList : _rowList, //用于改变显示行数的下拉列表框的元素数组。
+        pager : pager_selector, //定义翻页用的导航栏
+        page : 1, //设置初始的页码,初始为1
+        rownumbers : true,
+        pagerpos : 'center', //指定分页栏的位置
+        altRows : true, //设置为交替行表格,默认为false
+        multiselect : true, //可以多选
+        multiboxonly : true, //只有选择checkbox才会起作用 
+        loadComplete : function() {
+            var table = this;
+            setTimeout(function() {
+                updatePagerIcons(table);
+                enableTooltips(table);
+            }, 0);
+        },
+        prmNames : {
+             oper : "oper",
+             page : "page",
+             rows : "rows",
+             sort : "sidx",
+             order : "sord"
+        },
+        postData :{
+            condition1 : function(){ return ""; },//查询条件1
+            condition2 : function(){ return ""; }//查询条件2
+        },
+        jsonReader : {
+            root : "list", // json中代表实际模型数据的入口
+            page : "page", // json中代表当前页码的数据
+            total : "pages", // json中代表页码总数的数据
+            records : "total", // json中代表数据行总数的数据
+            repeatitems : false// 如果设为false,则jqGrid在解析json时,会根据name来搜索对应的数据元素
+        },
+        gridComplete: function () {
+            comGridComplete("grid-table", "editRecord");
+        },
+        onPaging: function(){
+            comGridPage("grid-table");
+        }
+    });
+    // 调整jqgrid
+    ajustJqGrid(grid_selector, pager_selector);
+};
+
+/**
+ * 查询事件
+ */
+function searchRecord() {
+     jQuery(grid_selector).trigger("reloadGrid", [{ page: 1 }]);
+};
+
+
+/**
+ * 弹窗显示
+ * @param 
+ */
+function save() {
+    $.ajax({
+        type : "post",
+        url : basePath + '/zyfzsq/save',
+        dataType:'json',
+        data : $('#form').serialize()
+        , //表单序列化,获取数据
+        success : function(data) {
+            // 成功删除后刷新页面
+            if (data && data.success == true) {
+                layer.alert("数据已成功保存!");
+                closeWin();
+                searchRecord();
+            } else {
+                layer.alert("数据保存失败!");
+            }
+        }, //操作成功后的操作!data是后台传过来的值 
+        error: function (XMLHttpRequest, textStatus, errorThrown) {
+            layer.alert("error:" + errorThrown);
+        }
+    });
+}
+
+/**
+ * 增加信息
+ */
+function addInfo() {
+    // 清空表单信息
+    comClearFormData("form");
+    // 弹出模态框
+    showModelDialog("myModal", "新增");
+};
+
+/**
+ * 删除信息
+ */
+function delInfo() {
+    // 获取选择行
+    var ids = getMultiData(grid_selector);
+    if(!isNull(ids)) {
+        layer.confirm('确定删除吗?', {icon: 3, title:'提示'}, function(index){
+            $.ajax({
+                type : 'POST',
+                dataType : "json",
+                data : {"ids":ids},
+                url : basePath + '/zyfzsq/del',//请求的路径                
+                success : function(data) {
+                    layer.close(index);
+                    searchRecord();
+                },
+                error: function (XMLHttpRequest, textStatus, errorThrown) {
+                    layer.close(index);
+                }
+            });
+        });
+    } else {
+        layer.alert("请选择记录");
+    }
+};
+
+/**
+ * 编辑信息
+ */
+function editInfo() {
+    // 获取选择行
+    var ids = getMultiData(grid_selector);
+    if(isNull(ids) || ids.indexOf(",")!=-1) {
+        layer.alert("请选择且只选择一条记录");
+    } else {
+        $.ajax({
+            type : 'POST',
+            dataType : "json",
+            data : {"id":ids},
+            url : basePath + '/zyfzsq/initEdit',//请求的路径               
+            success : function(data) {
+                $("#id").val(data.id);
+                $("#realName").val(data.realName);
+                $("#loginName").val(data.loginName);
+                showModelDialog("myModal", "编辑");
+            },
+            error: function (XMLHttpRequest, textStatus, errorThrown) {
+            }
+        });
+    }
+};
+
+/**
+ * 关闭当前窗口
+ */
+function closeWin() {
+    hideModelDialog("myModal");
+}