123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350 |
- <!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>
- <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>
- <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/layer/3.0.3/layer.js"></script>
- <!--[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]-->
- <script type="text/javascript">
- $(function() {
- $(window).resize(function(){
- $("#jqGrid").setGridWidth($(window).width()-40);
- });
- $("#jqGrid").jqGrid({
- url : '${ctx}/myconsole/advert/getByPage',
- editurl:"${ctx}/myconsole/advert/saveOrUpdate2",
- mtype : "POST",
- datatype : "json",
- prmNames:{id:"keyid"},
- caption:'广告管理',
- colModel : [ {
- label : '编号',
- name : 'keyid',
- hidden : true,
- key : true,
- width : 50
- }, {
- label : '广告名称',
- name : 'advertname',
- editable: true,
- width : 80
- },{
- label : '广告内容',
- name : 'advertcontent',
- editable: true,
- hidden :true,
- editrules:{edithidden:true},
- edittype : "textarea",
- editoptions: {
- size:50,
- maxlength: 500,
- rows:"5",
- cols:"40"
- }
- }, {
- label : '广告链接',
- name : 'advertlink',
- editable: true,
- width : 80
- }, {
- label : '广告宽度',
- name : 'advertwidth',
- editable: true,
- width : 80
- }, {
- label : '广告高度',
- name : 'advertheight',
- editable: true,
- width : 80
- }, {
- label : '顶部位置',
- name : 'adverttop',
- editable: true,
- width : 80
- }, {
- label : '左侧位置',
- name : 'advertleft',
- editable: true,
- width : 80
- }, {
- label : '广告状态',
- name : 'tstate',
- editable: true,
- formatter:"select",
- edittype: "select",
- editoptions: {
- value: "true:启用;false:停用"
- },
- stype:"select",
- searchoptions:{
- value: "true:启用;false:停用"
- },
- width : 80
- }, {
- label : '展示方式',
- name : 'adverttype',
- editable: true,
- formatter:"select",
- edittype: "select",
- editoptions: {
- value: "bay:飘窗;fix:固定"
- },
- stype:"select",
- searchoptions:{
- value: "bay:飘窗;fix:固定"
- },
- width : 80
- }, {
- label : '广告位置',
- name : 'advertposition',
- editable: true,
- formatter:"select",
- edittype: "select",
- editoptions: {
- value: "${AdvertPosition}"
- },
- stype:"select",
- searchoptions:{
- value: "${AdvertPosition}"
- },
- }, {
- label : '是否可关闭',
- name : 'showclose',
- editable: true,
- formatter:"select",
- edittype: "select",
- editoptions: {
- value: "true:是;false:否"
- },
- stype:"select",
- searchoptions:{
- value: "true:是;false:否"
- },
- width : 80
- }, {
- label : '是否显示头部',
- name : 'showheader',
- editable: true,
- formatter:"select",
- edittype: "select",
- editoptions: {
- value: "true:是;false:否"
- },
- stype:"select",
- searchoptions:{
- value: "true:是;false:否"
- },
- width : 80
- }, {
- label : '是否固定位置',
- name : 'isfixed',
- editable: true,
- formatter:"select",
- edittype: "select",
- editoptions: {
- value: "true:是;false:否"
- },
- stype:"select",
- searchoptions:{
- value: "true:是;false:否"
- },
- width : 80
- }, {
- label : '延迟消失时间',
- name : 'delayhide',
- editable: true,
- formatter:"select",
- edittype: "select",
- editoptions: {
- value: "0:不消失;3000:3秒;5000:5秒;10000:10秒"
- },
- stype:"select",
- searchoptions:{
- value: "0:不消失;3000:3秒;5000:5秒;10000:10秒"
- },
- width : 80
- }, {
- label : '站点',
- name : 'siteid',
- editable: true,
- formatter:"select",
- edittype: "select",
- editoptions: {
- value: "${siteOption}"
- },
- stype:"select",
- searchoptions:{
- value: "${siteOption}"
- },
- width : 80
- },{
- label : '操作',
- name:'operMod',
- index:'operMod',
- align:"center",
- width:"40",
- formatter: function (cellvalue, options, rowdata) {
- var html = "";
- //html=html+"<button class='btn btn-success radius size-S' onclick=publish('"+rowdata.keyid+"')>发布</button>";
- return html;
- }
- }],
- rownumbers : true,//添加左侧行号
- viewrecords : true,//是否在浏览导航栏显示记录总数
- rowNum : 10,//每页显示记录数
- rowList : [10,15,20,30,40,50 ],//用于改变显示行数的下拉列表框的元素数组。
- autowidth : true,
- height : 'auto',
- pager : "#jqGridPager"
- });
- $('#jqGrid').navGrid('#jqGridPager',
- // the buttons to appear on the toolbar of the grid
- {
- edit : true,
- add : true,
- del : true,
- search : true,
- refresh : true,
- view : true,
- position : "left",
- cloneToTop : true
- },
- // options for the Edit Dialog
- {
- recreateForm : true,
- checkOnUpdate : true,
- checkOnSubmit : true,
- closeAfterEdit : true,
- onInitializeForm:function(formid) {
- },
- serializeEditData: function(postdata) {
- //myconsole.log(postdata);
- $.each(postdata,function (index, value) {
- //myconsole.log(index);
- if(index!="jqGrid_id" && index!="oper" && index!="keyid"){
- modifyJosnKey(postdata,index,"advert."+index);
- }
- if(index=="keyid"){
- postdata["advert."+index]=value
- }
- })
- //myconsole.log(postdata);
- return postdata;
- },
- afterSubmit: function (response, postdata) {
- // console.log(response);
- var res=eval('(' + response.responseText + ')');
- layer.msg(res.msg);
- return [res.state,res.msg,''];
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },
- // options for the Add Dialog
- {
- closeAfterAdd : true,
- recreateForm : true,
- beforeSubmit: function(postdata, formid){
- $.each(postdata,function (index, value) {
- if(index!="jqGrid_id" && index!="oper"){
- modifyJosnKey(postdata,index,"advert."+index);
- }
- })
- return[true,''];
- },
- afterSubmit: function (response, postdata) {
- // console.log(response);
- var res=eval('(' + response.responseText + ')');
- layer.msg(res.msg);
- return [res.state,res.msg,''];
- },
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },
- // options for the Delete Dailog
- {
- errorTextFormat : function(data) {
- return 'Error: ' + data.responseText
- }
- },{
- // search options 这里支持多条件查询
- multipleSearch: true,
- sopt:['eq','ne','cn','nc','lt','le','gt','ge'],
- afterSubmit: function(r, data) {
- var messageString = r.responseText;
- var mesObj = eval('(' + messageString + ')');
- return [mesObj.state, mesObj.message];
- }
- }
- );
- $("#publishAll").click(function(){
- $.post("${ctx}/myconsole/advert/publishAll",function(data){
- var msg="执行失败";
- if(data=="true"){
- msg="执行成功";
- }
- layer.msg(msg);
- })
- })
- })
- function publish(advertKeyID){
- $.post("${ctx}/myconsole/advert/publish",{"advertKeyID":advertKeyID},function(data){
- var msg="执行失败";
- if(data=="true"){
- msg="执行成功";
- }
- layer.msg(msg);
- })
- }
- </script>
- <title>我的桌面</title>
- </head>
- <body>
- <div class="page-container">
- <div style="text-align:right">
- <button id="publishAll" class="btn btn-primary radius" type="button"><i class="Hui-iconfont"></i>发布广告</button>
- </div>
- <table id="jqGrid"></table>
- <div id="jqGridPager"></div>
- </div>
- <footer class="footer mt-20">
- <div class="container">
- <p></p>
- </div>
- </footer>
- </body>
- </html>
|