123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- {!! $grid !!}
- <style>
- p#vtip { display: none; position: absolute; padding: 10px; left: 5px; font-size: 0.8em; background-color: white; border: 1px solid #a6c9e2; -moz-border-radius: 5px; -webkit-border-radius: 5px; z-index: 9999 }
- p#vtip #vtipArrow { position: absolute; top: -10px; left: 5px }
- </style>
- <script>
- $(function () {
- $('.restore_person').unbind('click').click(function() {
- var id = $(this).data('id');
- swal({
- title: "确认还原?",
- type: "warning",
- showCancelButton: true,
- confirmButtonColor: "#DD6B55",
- confirmButtonText: "确认",
- showLoaderOnConfirm: true,
- cancelButtonText: "取消",
- preConfirm: function() {
- return new Promise(function(resolve) {
- $.ajax({
- method: 'post',
- url: '{{admin_base_path()}}/recycle/person/restore/' + id,
- data: {
- _method:'post',
- _token:LA.token,
- },
- success: function (data) {
- $.pjax.reload('#pjax-container');
- resolve(data);
- }
- });
- });
- }
- }).then(function(result) {
- var data = result.value;
- if (typeof data === 'object') {
- if (data.status) {
- swal(data.message, '', 'success');
- } else {
- swal(data.message, '', 'error');
- }
- }
- });
- });
- $('.grid-batch-restore').on('click', function() {
- var id_array=new Array();
- $('input[class="grid-row-checkbox"]:checked').each(function(){
- id_array.push($(this).attr('data-id'));
- });
- var id=id_array.join(',');
- if (id.length==0){
- swal('请勾选需要还原的个人会员!', '', 'error');
- return;
- }
- swal({
- title: "确认还原?",
- type: "warning",
- showCancelButton: true,
- confirmButtonColor: "#DD6B55",
- confirmButtonText: "确认",
- showLoaderOnConfirm: true,
- cancelButtonText: "取消",
- preConfirm: function() {
- return new Promise(function(resolve) {
- $.ajax({
- method: 'post',
- url: '{{admin_base_path()}}/recycle/person/restore/' + id,
- data: {
- _method:'post',
- _token:LA.token,
- },
- success: function (data) {
- $.pjax.reload('#pjax-container');
- resolve(data);
- }
- });
- });
- }
- }).then(function(result) {
- var data = result.value;
- if (typeof data === 'object') {
- if (data.status) {
- swal(data.message, '', 'success');
- } else {
- swal(data.message, '', 'error');
- }
- }
- });
- });
- vtip = function() {
- this.xOffset = -10;
- this.yOffset = 15;
- $(".vtip").unbind().hover(
- function(e) {
- this.t = $(this).attr("title");
- this.title = '';
- this.top = (e.pageY + yOffset);
- this.left = (e.pageX + xOffset);
- $('body').css("cursor","help");
- $('p#vtip').width()>450?$('p#vtip').width(450):'';
- $('body').append( '<p id="vtip">' + this.t + '</p>' );
- $('p#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn(0);
- },
- function() {
- this.title = this.t;
- $('body').css("cursor","");
- $("p#vtip").fadeOut("slow").remove();
- }
- ).mousemove(
- function(e) {
- this.top = (e.pageY + yOffset);
- this.left = (e.pageX + xOffset);
- $("p#vtip").css("top", this.top+"px").css("left", this.left+"px");
- }
- );
- };
- vtip();
- });
- </script>
|