| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378 |
- <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=GBK">
- <title>广告发布列表</title>
- <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
- <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script type="text/javascript" src="/shares/js/file.js"></script>
- <script type="text/javascript" src="/shares/datePicker/WdatePicker.js"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
- <script type="text/javascript">
- var grid = null;
- var isNeedCheck = '${isNeedCheck}';
- $(function() {
- searchByKword();
- });
- function initTargetGrid(params) {
- var columns = [
- {
- display : '广告图片',
- name : 'photo_doc_id',
- width : 210,
- render : function(row) {
- var html = '';
- if(null==row.path){
- html += '<img src="'+row.path+'" width="200px;" height="150px;" alt="图片不存在"></img>';
- return html;
- }else{
- html += '<img src="'+row.path+'" width="200px;" height="150px;" onclick="view_img('+row.photo_doc_id+');"></img>';
- return html;
- }
- }
- }, {
- display : '广告投放位置',
- name : 'position_name',
- width : 100,
- render : function(row) {
- var html = '';
- html += '<span style="text-align:center;line-height:150px;">'+row.position_name+'</span>';
- return html;
- }
- }, {
- display : '发布范围',
- name : 'scope_name',
- width : 100,
- render : function(row) {
- var html = '';
- html += '<span style="text-align:center;line-height:150px;">'+row.scope_name+'</span>';
- return html;
- }
- },{
- display : '开始日期',
- name : 'start_date',
- width : 100,
- render : function(row) {
- var start_date = row.start_date;
- if(null!=start_date){
- start_date = start_date.substring(0,10);
- }else{
- start_date="";
- }
- var html = '';
- html += '<span style="text-align:center;line-height:150px;">'+start_date+'</span>';
- return html;
- }
- },{
- display : '截止日期',
- name : 'end_date',
- width : 100,
- render : function(row) {
- var end_date = row.end_date;
- if(null!=end_date){
- end_date = end_date.substring(0,10);
- }else{
- end_date="";
- }
- var html = '';
- html += '<span style="text-align:center;line-height:150px;">'+end_date+'</span>';
- return html;
- }
- },{
- display : '发布人',
- name : 'create_user_name',
- width : 80,
- render : function(row) {
- var html = '';
- html += '<span style="text-align:center;line-height:150px;">'+row.create_user_name+'</span>';
- return html;
- }
- },{
- display : '发布时间',
- name : 'create_time',
- width : 150,
- render : function(row) {
- var create_time = row.create_time;
- /* create_time = create_time.substring(0,10); */
- var html = '';
- html += '<span style="text-align:center;line-height:150px;">'+create_time+'</span>';
- return html;
- }
-
- },{
- display : '广告状态',
- name : 'state_name',
- width : 80,
- render : function(row) {
- var html = '';
- html += '<span style="text-align:center;line-height:150px;">'+row.state_name+'</span>';
- return html;
- }
- }
- ];
- if('true'==isNeedCheck){
- columns.push({
- display : '审核状态',
- name : 'au_state_name',
- width : 80,
- render : function(row) {
- var au_note = row.au_note ;
- var au_user_name = row.au_user_name;
- var au_time = row.au_time;
- if(null==au_user_name){
- au_user_name = "";
- }
- if(null==au_time){
- au_time = "";
- }
- if(null==au_note){
- au_note = "";
- }
- var html = '';
- if("0"==row.au_state){
- html += ''+'<span style="text-align:center;line-height:150px;">'+row.au_state_name+'</span>';
- }else{
- html += '<a style="color:blue;line-height:150px;" title="'
- +'审核人:'+au_user_name+' '
- +'审核时间:'+au_time+' '
- +'审核意见:'+au_note
- +'">'+row.au_state_name+'</a>';
- }
- return html;
- }
-
- });
- }
- columns
- .push({
- display : '操作',
- width : 130,
- isAllowHide : false,
- render : function(row) {
- var html = '';
- if('2'==row.state&&'1'==row.au_state){
- html += '<a style="line-height:150px;" href=\"#\" onclick=\"publishAd('+ row.universalid + ')\"><font color=blue>发布</font></a> ';
- html += '<a style="line-height:150px;" href=\"#\" onclick=\"editAd('+ row.universalid + ')\"><font color=blue>编辑</font></a> ';
- html += '<a style="line-height:150px;" href=\"#\" onclick=\"delAd('+ row.universalid + ')\"><font color=blue>删除</font></a> ';
- }else if('0'==row.state&&('0'==row.au_state||'2'==row.au_state)){
- html += '<a style="line-height:150px;" href=\"#\" onclick=\"editAd('+ row.universalid + ')\"><font color=blue>编辑</font></a> ';
- html += '<a style="line-height:150px;" href=\"#\" onclick=\"delAd('+ row.universalid + ')\"><font color=blue>删除</font></a> ';
- }else if('1'==row.state&&'1'==row.au_state){
- html += '<a style="line-height:150px;" href=\"#\" onclick=\"backAd('+ row.universalid + ')\"><font color=blue>撤销</font></a> ';
- }
- return html;
- }
- });
- grid = $("#maingrid4")
- .ligerGrid(
- {
- columns : columns,
- pageSize : getPageSize(grid),
- url : 'opAdAction.do?task=adPageList&time=' + new Date().getTime() + params,
- pageParmName : 'p', //页索引参数名,(提交给服务器)
- pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
- width : '99.9%',
- height : '99%',
- rowHeight : 150
- });
- $("#pageloading").hide();
- $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
- }
- function getPageSize(grid){
- if(grid){
- return grid.get("pageSize");
- }else{
- return 20;
- }
- }
- //查询
- function searchByKword() {
- var s = "";
- var position_id = $("#position_id").val(); //广告投放位置
- if (position_id != "" && typeof (position_id) != "undefined") {
- s += "&position_id=" + encodeURI(encodeURI(position_id));
- }
- var state = $("#state").val();//广告状态
- if (state != "" && typeof (state != "undefined")) {
- s += "&state=" + encodeURI(encodeURI(state));
- }
- var create_time_start = $("#create_time_start").val();//发布日期开始
- if (create_time_start != "" && typeof (create_time_start) != "undefined") {
- s += "&create_time_start=" + create_time_start ;
- }
- var create_time_end = $("#create_time_end").val();//发布日期结束
- if (create_time_end != "" && typeof (create_time_end) != "undefined") {
- s += "&create_time_end=" + create_time_end;
- }
- if(null!=grid){
- grid.set("newPage","1");
- }
- initTargetGrid(s);
- }
- function view_img(fileId){
- viewFile(fileId, null)
- }
- function f_select() {
- var rows = grid.getCheckedRows();
- return rows;
- }
- /**
- * 发布广告
- */
- function publishAd(universalid){
- $.ligerDialog.confirm('确定要发布广告吗?', function (yes)
- {
- if(yes){
- $.ajax({
- type:"POST",
- url:"opAdAction.do?task=publishAd",
- data : {"universalid":universalid},
- timeout:10000,
- cache:false,
- dataType:"json",
- success:function(data){
- var success = data.success;
- if(success){
- $.ligerDialog.success(success);
- searchByKword();
- }else{
- showAjaxError(null, data.error);
- }
- },
- error:showAjaxError
- });
- }
- });
- }
- /**
- * 撤销广告
- */
- function backAd(universalid){
- $.ligerDialog.confirm('确定要撤销广告吗?', function (yes)
- {
- if(yes){
- $.ajax({
- type:"POST",
- url:"opAdAction.do?task=backAd",
- data : {"universalid":universalid},
- timeout:10000,
- cache:false,
- dataType:"json",
- success:function(data){
- var success = data.success;
- if(success){
- $.ligerDialog.success(success);
- searchByKword();
- }else{
- showAjaxError(null, data.error);
- }
- },
- error:showAjaxError
- });
- }
- });
- }
- /**
- * 删除广告
- */
- function delAd(universalid){
- $.ligerDialog.confirm('确定要删除广告吗?', function (yes)
- {
- if(yes){
- $.ajax({
- type:"POST",
- url:"opAdAction.do?task=delAd",
- data : {"universalid":universalid},
- timeout:10000,
- cache:false,
- dataType:"json",
- success:function(data){
- var success = data.success;
- if(success){
- $.ligerDialog.success(success);
- searchByKword();
- }else{
- showAjaxError(null, data.error);
- }
- },
- error:showAjaxError
- });
- }
- });
- }
- /**
- * 编辑广告信息
- */
- function editAd(universalid){
- addTab('editAd' + getCurrentTabId(), '编辑广告', '${pageContext.request.contextPath }/opAdAction.do?task=toEditAd&universalid='
- + universalid + '&tabid=' + getCurrentTabId(),true,true);
- }
- /**
- * 查看广告信息
- */
- function viewAd(universalid){
- addTab('viewAd' + getCurrentTabId(), '查看广告', '${pageContext.request.contextPath }/opAdAction.do?task=viewAd&universalid='
- + universalid + '&tabid=' + getCurrentTabId(),true,true);
- }
- </script>
- </head>
- <body>
- <%@ include file="/include/message.jsp"%>
- <div class="container-layout">
- <div id="title" class="form-button">
- <input type="button" class="l-button" value="新增广告" onclick="addTab('toAddAd'+getCurrentTabId(), '新增广告', '${pageContext.request.contextPath }/opAdAction.do?task=toAddAd&tabid=' + getCurrentTabId(),true,true);" style="width: 90px"/>
- </div>
- <div class="default_search" >
- <ul class="list_search" >
- <li class="title" style="width:100px;">广告投放位置:</li>
- <li class="text">
- <select id="position_id" name="position_id">
- <option value="">--请选择--</option>
- <c:forEach items="${positionList }" var="pos">
- <option value="${pos.universalid }">${pos.position_name }</option>
- </c:forEach>
- </select>
- </li>
- </ul>
- <ul class="list_search" >
- <li class="title">广告状态:</li>
- <li class="text">
- <select id="state" name="state">
- <option value="">--请选择--</option>
- <c:forEach items="${adStateList }" var="state">
- <option value="${state.dvalue }">${state.dname }</option>
- </c:forEach>
- </select>
- </li>
- </ul>
- <ul class="list_search" >
- <li class="title"> 发布日期:</li>
- <li class="text" >
- <input type="text" class="Wdate" name="create_time_start" id="create_time_start" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'create_time_end\',{d:-1})}'})">
- 至
- <input type="text" class="Wdate" name="create_time_end" id="create_time_end" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'create_time_start\',{d:1})}'})">
- </li>
- </ul>
- <ul >
- <li class="search-button">
- <input type="button" class='l-button'
- name="search" onclick="searchByKword()" value="查询" /></li>
- </ul>
- </div>
- <div style="clear:both;"></div>
- <div id="searchbar">
- <div style="overflow: hidden; clear: both;">
- <div id="maingrid4" style="margin: 0; padding: 0"></div>
- </div>
- </div>
- </div>
- </body>
- </html>
|