/** * Created by Syusuke on 2017/3/22. */ //-----------------------------------------------获取参数对象 var paramStr = getQueryString("params"); var params = JSON.parse(paramStr); function getQueryString(key){ var reg = new RegExp("(^|&)"+key+"=([^&]*)(&|$)"); var result = window.location.search.substr(1).match(reg); return result?decodeURIComponent(result[2]):null; } //-----------------------------------------------页面跳转 $("#drirect-dinge").click(function(){ // window.location = "/rationLibEditor/rationLib" + "?params=" + JSON.stringify(params); $(this).attr('href', "/rationLibEditor/rationLib" + "?params=" + JSON.stringify(params)) }) //-----------------------------------------------页面初始化 var spSetting_GLJ = { spType:"GLJList", header:[ {headerName:"编码",headerWidth:120,data:"GLJCode"}, {headerName:"名称",headerWidth:400,data:"GLJName"}, {headerName:"规格",headerWidth:120,data:"specs"}, {headerName:"单位",headerWidth:120,data:"unit"}, {headerName:"基价单价",headerWidth:120,data:"basePrice"}, {headerName:"类型",headerWidth:120,data:"type"} ], view:{ comboBox:[ {row:-1,col:3,rowCount:-1,colCount:1} ], lockedCells:[ ] } }; $(document).ready(function(){ $.fn.zTree.init($("#treeDemo"), setting, zNodes); var rationSpread = $.fn.Spread.init($("#GLJListSheet"),spSetting_GLJ); });