123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="renderer" content="webkit|ie-comp|ie-stand">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
- <meta http-equiv="Cache-Control" content="no-siteapp" />
- <!--[if lt IE 9]>
- <script type="text/javascript" src="${ctx}/assets/lib/html5.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/respond.min.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/PIE_IE678.js"></script>
- <![endif]-->
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui/css/H-ui.min.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/H-ui.admin.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/Hui-iconfont/1.0.7/iconfont.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/icheck/icheck.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/skin/default/skin.css" id="skin" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/style.css" />
- <script type="text/ecmascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.js"></script>
- <script type="text/javascript" src="${ctx}/assets/static/h-ui/js/H-ui.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/layer/3.0.3/layer.js"></script>
- <script type="text/javascript" src="${ctx}/assets/js/validate.js"></script>
- <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqueryui/jquery-ui.css" />
- <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqgrid/css/ui.jqgrid.css" />
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqueryui/jquery-ui.js"></script>
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/i18n/grid.locale-cn.js"></script>
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/jquery.jqGrid.min.js"></script>
- <link rel="stylesheet" href="${ctx}/assets/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
- <script type="text/javascript" src="${ctx}/assets/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
- <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
- <style type="text/css">
- ul.ztree {margin-top: 10px;border: 1px solid #617775;background: #f0f6e4;width:220px;height:360px;overflow-y:scroll;overflow-x:auto;}
- </style>
-
- <!--[if IE 6]>
- <script type="text/javascript" src="${ctx}/assets/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
- <script>DD_belatedPNG.fix('*');</script>
- <![endif]-->
- <style type="text/css">
- select{width: 243px;}
- input{outline:none;line-height:28px;height:28px;border:#ddd 1px solid;}
- </style>
- <script type="text/javascript">
- function addRow(parentid){
- $("#tablefield").append("<li style='margin-top:10px;height:30px;float:left;width:100%;'><form><input type='hidden' name='oper' value='add'><input type='hidden' name='site.parentid' value='"+parentid+"'><dt style='width:40%;text-align:center;float:left;'><input type='text' name='site.sitename' class='sitename' maxlength='30' size='30' vmode='not null' vdisp='站点名称' vtype='string'></dt><dd style='width:40%;text-align:center;float:left;'><input type='text' name='site.siteid' class='siteid' maxlength='30' size='30' vmode='not null' vdisp='站点编号' vtype='string'></dd><i style='float:left;width:20%;text-align:center;'><input style='padding:0 10px;' type='button' value='删除' onclick='deleteRow(this)'></i></form></li>");
- }
- function deleteRow(obj){
- $(obj).parents("li").remove();
- }
- $(function() {
- $("body").on("change", ".sitename", function(){
- var _this=$(this);
- if(_this.val()!=""){
- $.post("${ctx}/myconsole/pinyin/getFirstSpell",{"chinese":_this.val()},function(data){
- _this.parents("li").find(".siteid").val(data);
- })
- }
- })
-
- $(window).resize(function(){
- $("#tree").setGridWidth($(window).width()-40);
- });
- $("#tree").jqGrid({
- caption:'站点管理',
- url : '${ctx}/myconsole/site/getByTree',
- editurl:"${ctx}/myconsole/site/saveOrUpdate", //定义对form编辑时的url
- mtype : "POST", // ajax提交方式。POST或者GET,默认GET
- hoverrows:false, // 当为false时mouse hovering会被禁用 默认 false
- viewrecords:false, // 定义是否要显示总记录数
- gridview:true, // 构造一行数据后添加到grid中,如果设为true则是将整个表格的数据都构造完成后再添加到grid中,但treeGrid, subGrid, or afterInsertRow 不能用 默认为false
- height:"auto", // 表格高度,可以是数字,像素值或者百分比
- rowNum:100, // 在grid上显示记录条数,这个参数是要被传递到后台
- scrollrows:true, // 当为true时让所选择的行可见
- treeGrid:true, // 启用或者禁用treegrid模式 默认false
- ExpandColumn:"sitename", // 指定那列来展开tree grid,默认为第一列,只有在treeGrid为true时起作用
- treedatatype:"json", // 数据类型,通常情况下与datatype相同,不会变
- treeGridModel:"adjacency", // treeGrid所使用的方法
- sortorder:"asc", // 排序顺序,升序或者降序(asc or desc) 默认asc
- autowidth : true, // 如果为ture时,则当表格在首次被创建时会根据父元素比例重新调整表格宽度。如果父元素宽度改变,为了使表格宽度能够自动调整则需要实现函数:setGridWidth 默认 false
- datatype:"json",
- pager:"#pager", // 定义翻页用的导航栏,必须是有效的html元素。翻页工具栏可以放置在html页面任意位置
- prmNames : { //定义表单的主键 // Default valuesprmNames: {page:“page”,rows:“rows”, sort: “sidx”,order: “sord”, search:“_search”, nd:“nd”, npage:null} 当参数为null时不会被发到服务器端
- id: "siteid",
- oper:"oper",
- addoper:"add",
- editoper:"edit",
- deloper:"del"
-
- },
- colModel : [ {
- label : '数据编号',
- name : 'keyid',
- editable: false,
- hidden:true
- }, {
- label : '站点名称',
- name : 'sitename',
- editable: true,
- edittype:"text",
- width : 100,
- sortable:false,
- editoptions: {
- size:31,
- maxlength: 50
- },
- editrules:{
- required: true
- },
- formoptions:{
- elmsuffix:" <span style='color:red'>*</span>",
- rowpos:1,
- colpos:1
- }
- },{
- label : '站点编号',
- name : 'siteid',
- editable: true,
- edittype: "text",
- key : true,
- width : 50,
- sortable:false,
- editoptions: {
- size:31,
- maxlength: 50
- },
- editrules:{
- edithidden:true,
- required: true,
- custom:true,
- custom_func: function(strFieldValue, strFieldName){
- var strEnglish = /^([a-zA-Z|\s*]+)?$/;
- if(!strEnglish.test(strFieldValue)){
- return [false, strFieldName+"应该为纯粹的大小写英文字母,不能包含汉字,数字或者符号!"];
- }
- else
- {
- return [true,""];
- }
- }
- },
- formoptions:{
- elmsuffix:"<span style='color:red'>*</span>首次保存后将不允许修改",
- rowpos:1,
- colpos:2
- }
- },{
- label : '上级站点',
- name : 'parentid',
- editable: true,
- edittype: "text",
- hidden : true,
- width : 100,
- editoptions: {
- maxlength: 50
- },
- formoptions:{
- rowpos:2,
- colpos:1
-
- },
- editrules:{edithidden:true}
- },{
- label : '模板组',
- name : 'templategroupkeyid',
- editable: true,
- width : 100,
- formatter:"select",
- edittype: "select",
- width : 30,
- editrules:{
- edithidden : true
- },
- editoptions:{
- value:"${templateGroupKeyIDOption}"
- },
- formoptions:{
- rowpos:2,
- colpos:2
- }
- },{
- label : 'PC端模板',
- name : 'pctemplet',
- editable: true,
- hidden : true,
- edittype: "select",
- width : 30,
- editrules:{
- edithidden : true
- },
- editoptions:{
- value:"${indextemplet}"
- },
- formoptions:{
- width : 30,
- rowpos:3,
- colpos:1
- }
- },{
- label : '移动端模板',
- name : 'mobiletemplet',
- editable: true,
- hidden : true,
- edittype: "select",
- width : 30,
- editrules:{
- edithidden : true
- },
- editoptions:{
- value:"${indextemplet}"
- },
- formoptions:{
- width : 30,
- rowpos:3,
- colpos:2
- }
- },{
- label : '排序值',
- name : 'sortid',
- editable: true,
- hidden : true,
- edittype: "text",
- width : 100,
- editoptions: {
- size:31,
- maxlength: 5
- },
- editrules:{
- edithidden:true,
- required: true,
- custom:true,
- custom_func: function(strFieldValue, strFieldName){
- var strFloat = /^([-\+]?(((\d+)(\.\d+))|(\.\d+)|(\d*)))?$/;
- if(!strFloat.test(strFieldValue)){
- return [false, strFieldName+"应该为实数"];
- }
- else
- {
- return [true,""];
- }
- }
- },
- formoptions:{
- elmsuffix:" <span style='color:red'>*</span>",
- rowpos:4,
- colpos:1
- }
- },{
- label : '站点状态',
- name : 'tstate',
- editable: true,
- edittype: "select",
- width : 50,
- sortable:false,
- editrules:{
- edithidden : true
- },
- editoptions:{
- maxlength: 40,
- value : "启用:启用;停用:停用"
- },
- formoptions:{
- rowpos:4,
- colpos:2
- }
- },{
- label : 'SEO标题',
- name : 'seotitle',
- editable: true,
- hidden : true,
- edittype: "text",
- width : 100,
- editrules:{
- edithidden : true
- },
- editoptions: {
- size:31,
- maxlength: 50
- },
- formoptions:{
- rowpos:5,
- colpos:1
- }
- },{
- label : 'SEO关键字',
- name : 'seokeyword',
- editable: true,
- hidden : true,
- edittype: "text",
- width : 100,
- editrules:{
- edithidden : true
- },
- editoptions: {
- size:31,
- maxlength: 50
- },
- formoptions:{
- rowpos:5,
- colpos:2
- }
- }, {
- label : 'SEO描述',
- name : 'seodesc',
- editable: true,
- width : 100,
- edittype : "textarea",
- hidden : true,
- editrules:{
- edithidden : true
- },
- editoptions: {
- dataInit: function(elem){
- $(elem).width(565);
- },
- maxlength: 200,
- rows:"4",
- cols:"80"
- },
- formoptions:{
- rowpos:6,
- colpos:1
- }
- }, {
- label : '版权信息',
- name : 'copyright',
- editable: true,
- width : 100,
- edittype : "textarea",
- hidden : true,
- editrules:{
- edithidden : true
- },
- editoptions: {
- dataInit: function(elem){
- $(elem).width(565);
- },
- maxlength: 400,
- rows:"4",
- cols:"80"
- },
- formoptions:{
- rowpos:6,
- colpos:2
- }
- },{
- label : '存储空间',
- name : 'savespace',
- editable: true,
- hidden : true,
- edittype: "select",
- width : 30,
- editrules:{
- edithidden : true
- },
- editoptions:{
- value:"${dic_savespace}"
- },
- formoptions:{
- width : 30,
- rowpos:7,
- colpos:1
- }
- },{
- label : '是否静态化',
- name : 'isstatic',
- editable: true,
- hidden : true,
- edittype: "select",
- width : 50,
- editrules:{
- edithidden : true
- },
- editoptions:{
- maxlength: 40,
- value : "是:是;否:否"
- },
- formoptions:{
- rowpos:7,
- colpos:2
- }
- },{
- label : '图片水印',
- name : 'watermarkid',
- editable: true,
- hidden : true,
- edittype: "select",
- width : 50,
- editrules:{
- edithidden : true
- },
- editoptions:{
- maxlength: 40,
- value : "${dic_watermark}"
- },
- formoptions:{
- rowpos:8,
- colpos:1
- }
- },{
- label : '地址前缀',
- name : 'urlprefix',
- editable: true,
- hidden : true,
- edittype: "select",
- width : 50,
- editrules:{
- edithidden : true
- },
- editoptions:{
- maxlength: 40,
- value : "true:是;false:否"
- },
- formoptions:{
- rowpos:8,
- colpos:2
- }
- }, {
- label : '发布规则',
- name : 'urlrulegroupkeyid',
- editable: true,
- width : 100,
- edittype: "select",
- formatter:"select",
- hidden : true,
- editrules:{
- required: true,
- edithidden : true
- },
- editoptions: {
- dataInit: function(elem){
- $(elem).width(225);
- },
- maxlength: 10,
- value : "${urlRuleGroupKeyIDs}"
- },
- formoptions:{
- elmsuffix:" <span style='color:red'>*</span>",
- rowpos:9,
- colpos:1
- }
- }, {
- label : '创建人',
- name : 'insertusername',
- width : 60,
- editable: false,
- sortable:false,
- edittype:"text"
- }, {
- label : '创建时间',
- name : 'inserttime',
- width : 60,
- editable: false,
- sortable:false,
- edittype:"text"
- }, {
- "name":"treelevel",
- "hidden":true
- } ],
- "treeReader":{
- "level_field":"treelevel",
- "leaf_field":"isleaf",
- "expanded_field":"expanded",
- "loaded":"loaded",
- "parent_id_field":"parentid",
- "icon_field":"icon"
- },
- loadComplete: function() {
- var jsonSelfButtonFlag=${selfbuttonflag};
- if (jsonSelfButtonFlag.copy==false){
- $('td[title="复制新建"]').hide();
- }
- }
- });
- function getSiteURL(){
- var siteName=$("#sitename").val();
- if(siteName!=""){
- $.post("${ctx}/myconsole/pinyin/getFirstSpell",{"chinese":$("#sitename").val()},function(data){
- $("#siteid").val(data);
- })
- }
- }
-
-
-
- jQuery('#tree').jqGrid('navGrid','#pager',
- {
- ${buttonflag}
- search : false,
- refresh : true,
- view : false,
- position : "left",
- cloneToTop : true
- },
- //编辑按钮事件处理
- {
- closeAfterEdit : true,
- recreateForm : true,
- width:800,
- afterShowForm : function(formid) {
- var siteidObj = formid.find('#siteid');
- siteidObj.attr('readOnly',true);
- siteidObj.css({'background':'#cccccc'});
-
- makeTree("parentid","/myconsole/site/getSiteTree","radio");
- $(".FormElement").width(218);
- var parentid1Obj = formid.find('#_parentid');
- parentid1Obj.attr('readOnly',true);
- parentid1Obj.css({'background':'#cccccc'});
- },
- beforeSubmit: function(postdata, formid){
- // 编辑时jqgrid 将主键变成 tree_id 手动添加 keyid
- //postdata["keyid"] = postdata.tree_id;
-
- $.each(postdata,function (index, value) {
- if(index!="oper"){
- modifyJosnKey(postdata,index,"site."+index);
- }
- })
-
- return [true,'']; //返回值必须这么写 目前没找到原因,用true 和 返回对象都不好使。待查
- },
- afterSubmit: function(response,postdata)
- {
- var res=eval('(' + response.responseText + ')');
- if(res.flag)
- {
- layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [true,res.message,''];
-
- }
- else
- {
- layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [false,res.message,''];
-
- }
-
- },
- afterComplete : function (response, postdata, formid) {
- //取消选择
- $("#tree").jqGrid("resetSelection");
- //关闭对话框
- $(".ui-icon-closethick").trigger('click');
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },
- //添加按钮处理事件
- {
- closeAfterAdd : true,
- recreateForm : true,
- checkOnUpdate : true,
- checkOnSubmit : true,
- width:800,
- afterShowForm : function(formid) {
- $(".FormElement").width(218);
- var parentidObj = formid.find('#parentid');
- parentidObj.attr('readOnly',true);
- parentidObj.css({'background':'#cccccc'});
- $("#sitename").blur(function(){
- getSiteURL();
- });
- },
- serializeEditData: function(postdata) {
-
- //对主键字段进行赋值传递 韩林平
- var selRowId = $("#tree").jqGrid ('getGridParam', 'selrow');
- if(selRowId == null) selRowId = "";
- //获取选中的父节点主键值,添加下级站点
- postdata.parentid=selRowId;
-
- $.each(postdata,function(index,value){
- if(index!="oper"){
- modifyJosnKey(postdata,index,"site."+index);
- }
- })
- //jqgrid 做添加操作会把主键id的值设置成“_empty”;这里修改成空;
- postdata["site.keyid"]="";
- return postdata;
- },
- afterSubmit: function(response,postdata)
- {
- var res=eval('(' + response.responseText + ')');
- if(res.flag)
- {
- layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [true,res.message,''];
-
- }
- else
- {
- layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [false,res.message,''];
-
- }
-
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },
- // options for the Delete Dailog
- {
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- },
- afterSubmit: function(response,postdata)
- {
- var res=eval('(' + response.responseText + ')');
- if(res.flag)
- {
- //alert(res.message);
- layer.alert(res.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return [true,res.message,''];
-
- }
- else
- {
-
- return [false,res.message,''];
-
- }
-
- }
- }).navButtonAdd('#pager',{
- title:"复制新建",
- caption:"复制新建",
- buttonicon:"ui-icon-copy",
- onClickButton: function(){
- var selectedRowId = $("#tree").jqGrid("getGridParam", "selrow");
- if (!selectedRowId) {
-
- layer.alert('请先选择需要复制的站点!', {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- return false;
- } else {
- layer.open({
- type: 1,
- title: '输入站点的名称和编号',
- btn: ['确定','取消'],
- yes:function(index, layero){
- if($(layero).find("#NewSiteName").val()=='') {
- layer.alert('新站点名称不能为空!', {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- } else {
- if($(layero).find("#NewSiteID").val()=='') {
- layer.alert('新站点编号不能为空!', {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- } else {
- var strEnglish = /^([a-zA-Z|\s*]+)?$/;
- if(!strEnglish.test($(layero).find("#NewSiteID").val())){
- layer.alert('新站点编号只能为英文字母!', {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- } else {
- $.post("${ctx}/myconsole/site/copy",{'OldSiteID':selectedRowId,'NewSiteID' : $(layero).find("#NewSiteID").val(),'NewSiteName':$(layero).find("#NewSiteName").val()},function(data){
- if(data.status == 'y'){
- layer.alert(data.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- } else {
- layer.alert(data.message, {
- skin: 'layui-layer-molv' //样式类名
- ,closeBtn: 0
- });
- }
- })
- layer.close(index);
- }
- }
- }
- },
- skin: 'layui-layer-rim', //加上边框
- area: ['450px', '280px'], //宽高
- content: '<div class="page-container"><br><div class="row cl"><label class="form-label col-xs-1 col-sm-5"> 站点名称:</label>'+
- '<div class="formControls col-xs-1 col-sm-6"><input type="text" class="input-text" id="NewSiteName" name="NewSiteName"></div></div>'+
- '<br><div class="row cl"><label class="form-label col-xs-1 col-sm-5"> 站点编号:</label>'+
- '<div class="formControls col-xs-1 col-sm-6"><input type="text" class="input-text" id="NewSiteID" name="NewSiteID"></div></div></div>',
- success:function(layero, index){
- $(layero).find("#NewSiteID").on("click",function(){
- var strNewSiteName=$(layero).find("#NewSiteName").val();
- if(strNewSiteName!="")
- {
- $.post("${ctx}/myconsole/pinyin/getFirstSpell",{"chinese":strNewSiteName},function(data){
- $(layero).find("#NewSiteID").val(data);
- })
- }
- })
- }
- });
- }
- }
- }).navButtonAdd('#pager',{
- title:"批量建站",
- caption:"批量建站",
- buttonicon:"ui-icon-copy",
- onClickButton: function(){
- var selectedRowId = $("#tree").jqGrid("getGridParam", "selrow");
- if (!selectedRowId) {
- selectedRowId="0";
- }
- layer.open({
- type: 1,
- title: '输入站点的名称和编号',
- btn: ['确定','取消'],
- yes:function(index, layero){
- var validate=true;
- $("form").each(function(){
- if(doValidate($(this)[0])){
-
- }else{
- validate=false;
- }
- });
- if(validate){
- $("form").each(function(){
- var params_= $(this).serialize();
- //$.post("${ctx}/myconsole/site/saveOrUpdate",params_);
- $.ajax({
- async: false,
- type : "POST",
- data: params_,
- url : "${ctx}/myconsole/site/saveOrUpdate",
- dataType : 'json',
- success : function(data) {
- }
- });
- })
- layer.close(index);
- $("#tree").trigger("reloadGrid");
- }
-
- },
- skin: 'layui-layer-rim', //加上边框
- area: ['650px', '580px'], //宽高
- content: "<ul id='tablefield' style='margin-top:2px;width:100%;text=align:center;'> <li style='width:100%;float:left;margin-top:10px;'> <dt style='width:40%;text-align:center;float:left;'>站点名称</dt> <dd style='width:40%;text-align:center;float:left;'>站点编号</dd> <i style='width:20%;text-align:center;float:left;'><input style='padding:0 10px;' onclick=addRow('"+selectedRowId+"') type='button' value='添加'/> </i> </li> </ul>",
- success:function(layero, index){
-
- }
- });
- }
- });
- jQuery('#tree').jqGrid('bindKeys');
-
- })
- var zTree;
- var setting = {
- check: {
- enable: true,
- chkStyle: "radio",
- radioType: "all"
- },
- data: {
- simpleData: {
- enable: true,
- idKey: "KeyID",
- pIdKey: "ParentID",
- rootPId: 0
- },
- key:{
- name:"SiteName"
- }
- },
- callback: {
- onClick: onClick,
- onCheck: onCheck
- }
- };
- var zNodes =${sites};
-
- function onClick(e, treeId, treeNode) {
- var zTree = $.fn.zTree.getZTreeObj("treeSite");
- zTree.checkNode(treeNode, !treeNode.checked, null, true);
- return false;
- }
- function onCheck(){
-
- }
- function showMenu() {
- var cityObj = $("#citySel");
- var cityOffset = $("#citySel").offset();
- $("#menuContent").css({left:cityOffset.left + "px", top:cityOffset.top + cityObj.outerHeight() + "px"}).slideDown("fast");
- $("body").bind("mousedown", onBodyDown);
- }
- function hideMenu() {
- $("#menuContent").fadeOut("fast");
- $("body").unbind("mousedown", onBodyDown);
- }
- function onBodyDown(event) {
- if (!(event.target.id == "menuBtn" || event.target.id == "citySel" || event.target.id == "menuContent" || $(event.target).parents("#menuContent").length>0)) {
- hideMenu();
- }
- }
-
- $(function(){
- zTree=$.fn.zTree.init($("#treeSite"), setting, zNodes);
-
- });
- //表单验证
-
-
-
-
- </script>
- <title>我的桌面</title>
- <style>
- .ui-dialog {
- overflow: hidden;
- position: absolute;
- top: 0;
- left: 0;
- padding: 0;
- outline: 0;
- }
- .ui-jqdialog { display: none; width: 300px; position: absolute; padding: 0; font-size:11px; overflow:visible;}
- .ui-jqdialog .ui-jqdialog-titlebar { padding: .3em .2em; position: relative;}
- </style>
- </head>
- <body>
- <div class="page-container">
- <table id="tree"></table>
- <div id="pager"></div>
-
- </div>
- <div id="menuContent" class="menuContent" style="display:none; position: absolute;">
- <ul id="treeSite" class="ztree" style="margin-top:0; width:300px; height: 300px;"></ul>
- </div>
- <footer class="footer mt-20">
- <div class="container">
- <p> </p>
- </div>
- </footer>
- </body>
- </html>
|