From d479d9fbcb37f8b861031c94a83d0e37761210c5 Mon Sep 17 00:00:00 2001 From: colly_wyx <wangyixiong_007@163.com> Date: Tue, 29 May 2018 09:07:03 +0800 Subject: [PATCH] 修改bug --- application/modules/Article/views/manager/list.phtml | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 56 insertions(+), 3 deletions(-) diff --git a/application/modules/Article/views/manager/list.phtml b/application/modules/Article/views/manager/list.phtml index f8807a9..6ae6518 100644 --- a/application/modules/Article/views/manager/list.phtml +++ b/application/modules/Article/views/manager/list.phtml @@ -6,8 +6,8 @@ ������������ </h1> <ol class="breadcrumb"> - <li><a href="#"><i class="fa fa-dashboard"></i> ������������</a></li> - <li><a href="#">������������</a></li> + <li><a href="/admin/index/index"><i class="fa fa-dashboard"></i> ������������</a></li> + <li><a href="/article/manager/list">������������</a></li> <li class="active">������������</li> </ol> </section> @@ -42,6 +42,7 @@ <script> $(function () { + var config = { "dom": 'l<"#toolbar">frtip', /* @@ -100,6 +101,30 @@ ], "columnDefs": [ { + "targets":1, + "searchable":false, + "render":function(data, type, row, meta){ + if(data == 0) { + return "���������������"; + } + else if(data == 1){ + return "������������"; + } + else if(data == 2){ + return "������������"; + } + else if(data == 3){ + return "���������������"; + } + else if(data == 4){ + return "������������"; + } + else{ + return ''; + } + } + }, + { "targets":2, "searchable":false, "render":function(data, type, row, meta){ @@ -115,16 +140,44 @@ "targets":4, "searchable":false, "render":function(data, type, row, meta){ - return '<a class="btn btn-primary" href="/<?php echo $route['module']?>/<?php echo $route['controller']?>/edit/id/'+row['_id']+'">������</a>' + return '<a class="btn btn-primary" href="/<?php echo $route['module']?>/<?php echo $route['controller']?>/edit/id/'+row['_id']+'">������</a> <a class="btn btn-danger del" data-id="'+row['_id']+'" data-target="/<?php echo $route['module']?>/<?php echo $route['controller']?>/del">������</a>' } } ], "initComplete": function(){ $("#toolbar").css("width", "100px").css("display", "inline").css("margin-left", "10px"); $("#toolbar").append('<a id="build" class="btn btn-success" data-toggle="modal" data-target="" href="/<?php echo $route['module']?>/<?php echo $route['controller']?>/add"> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>������ <a> '); + $(".del").bind('click', function(){ + if(confirm('���������������������������������')){ + $.ajax({ + type: "POST", + url: $(this).data('target'), + data: {id:$(this).data('id')}, + success:function(response){ + var dataObj=jQuery.parseJSON(response); + if(dataObj.code == 200) + { + $.scojs_message('������������', $.scojs_message.TYPE_OK); + setTimeout(function(){window.location.href = "/<?php echo $route['module']?>/<?php echo $route['controller']?>/<?php echo $route['action']?>";}, 600); + }else + { + $.scojs_message(dataObj.content, $.scojs_message.TYPE_ERROR); + } + }, + error: function (request, status, error) { + $.scojs_message(request.responseText, $.scojs_message.TYPE_ERROR); + } + }); + } + else{ + return false; + } + }); } } $("#table_list").DataTable(config); + + }); </script> -- Gitblit v1.8.0