diff --git a/application/admin/controller/Dashboard.php b/application/admin/controller/Dashboard.php index e206a7c..ffd2a71 100755 --- a/application/admin/controller/Dashboard.php +++ b/application/admin/controller/Dashboard.php @@ -152,5 +152,28 @@ class Dashboard extends Backend return $this->view->fetch(); } + public function task_complete($ids = null) + { + + $row = (new Task())->get($ids); + if (!$row) { + $this->error(__('No Results were found')); + } + if (false === $this->request->isPost()) { + $this->view->assign('row', $row); + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + + $task = (new Task())->where('id', '=', $ids)->where('status', 1)->find(); + + if (!$task) { + $this->error('任务状态已变更,请刷新后操作'); + } + $task->save(['status' => 3, 'prove_file_path' => $params['prove_file_path']]); + + $this->success(); + } + } diff --git a/application/admin/view/dashboard/task.html b/application/admin/view/dashboard/task.html index 2133620..41816a9 100644 --- a/application/admin/view/dashboard/task.html +++ b/application/admin/view/dashboard/task.html @@ -1,83 +1,114 @@

任务看板

-
-
-
-

每日任务

- {foreach $day as $item} -

{$item->title}

-

{$item->desc}

-
- {/foreach} -
-
-

每周任务

- {foreach $week as $item} -

{$item->title}

-

{$item->desc}

-
- {/foreach} -
-
-

每月任务

- {foreach $month as $item} -

{$item->title}

-

{$item->desc}

-
- {/foreach} + +
+ + +
+

每日任务

+ {foreach $day as $item} +
+
{$item->title}
+
{$item->desc}
+ {/foreach}
+ + +
+

每周任务

+ {foreach $week as $item} +
+
{$item->title}
+
{$item->desc}
+
+ {/foreach} +
+ + +
+

每月任务

+ {foreach $month as $item} +
+
{$item->title}
+
{$item->desc}
+
+ {/foreach} +
+
diff --git a/application/admin/view/dashboard/task_complete.html b/application/admin/view/dashboard/task_complete.html new file mode 100644 index 0000000..7030a3b --- /dev/null +++ b/application/admin/view/dashboard/task_complete.html @@ -0,0 +1,38 @@ +
+ +

任务详情

+
+ +
+ {$row->title|htmlentities} +
+
+
+ +
+ {$row->desc|htmlentities} +
+
+ +
+ +
+
+ +
+ + +
+ +
+
+
+ + +
+ diff --git a/public/assets/js/backend/dashboard.js b/public/assets/js/backend/dashboard.js index ab8409c..532506d 100755 --- a/public/assets/js/backend/dashboard.js +++ b/public/assets/js/backend/dashboard.js @@ -1,4 +1,4 @@ -define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echarts-theme', 'template'], function ($, undefined, Backend, Datatable, Table, Echarts, undefined, Template) { +define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echarts-theme', 'template', 'form'], function ($, undefined, Backend, Datatable, Table, Echarts, undefined, Template, Form) { var Controller = { index: function () { @@ -73,6 +73,36 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echart }, 0); }); + }, + task: function () { + + $(document).on('click','.spec_add_btn', function (event) { + var url = $(this).attr('data-url'); + if(!url) return false; + var msg = $(this).attr('data-title'); + var width = $(this).attr('data-width'); + var height = $(this).attr('data-height'); + var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%']; + var options = { + shadeClose: false, + shade: [0.3, '#393D49'], + area: area, + callback:function(value){ + CallBackFun(value.id, value.name);//在回调函数里可以调用你的业务代码实现前端的各种逻辑和效果 + } + }; + Fast.api.open(url,msg,options); + }); + + }, + task_complete: function () { + Form.api.bindevent($("form[role=form]"), function(data, ret){ + //这里是表单提交处理成功后的回调函数,接收来自php的返回数据 + Fast.api.close(data);//这里是重点 + Toastr.success("成功");//这个可有可无 + }, function(data, ret){ + Toastr.success("失败"); + }); } };