MCPcopy Create free account
hub / github.com/CoderOpen/waimai / ProjectController

Class ProjectController

app/Admin/Controllers/ChiHe/ProjectController.php:23–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21use Encore\Admin\Layout\Content;
22
23class ProjectController extends AdminController
24{
25 protected $title = '项目管理';
26
27 /**
28 * Make a grid builder.
29 *
30 * @return Grid
31 */
32 protected function grid()
33 {
34 //$localAppId = request()->get('local_app_id', 0);
35 $csrf = csrf_token();
36 $script = <<<EOT
37 $('.grid-row-delete').unbind('click').click(function() {
38 var id = $(this).data('id');
39 var type = $(this).data('type');
40 swal({
41 title: "确认删除",
42 type: "warning",
43 showCancelButton: true,
44 confirmButtonColor: "#DD6B55",
45 confirmButtonText: "确认",
46 showLoaderOnConfirm: true,
47 cancelButtonText: "取消",
48 preConfirm: function() {
49 $.ajax({
50 method: 'post',
51 url: '/admin/series-product/delete/' + id + '?type=' + type,
52 data:{
53 _token:"$csrf"
54 },
55 success: function (data) {
56 $.pjax.reload('#pjax-container');
57 console.log(data);
58 if(data.code == 1){
59 swal(data.msg, '', 'success');
60 }else{
61 swal(data.msg, '', 'error');
62 }
63 }
64 });
65 }
66 });
67 });
68EOT;
69 Admin::script($script);
70
71 $comment = (new Project());
72 $showStatus = Link::showStatus();
73 $grid = new Grid($comment);
74 //$grid = $grid->model()->with('local_app');
75 //$grid->disableFilter();
76 $grid->column('id', 'ID')->sortable();
77 $grid->disableExport(); //禁止导出
78 $grid->disableRowSelector(); //禁止行checkbox选择
79 $grid->disableColumnSelector(); //禁止显示列显示选择器
80 //$grid->disableActions();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected