增加任务执行状态
Signed-off-by: vilson <545522390@qq.com>
This commit is contained in:
parent
903fb7e276
commit
893449ab6c
@ -19,7 +19,7 @@ use think\facade\Hook;
|
||||
*/
|
||||
class Task extends CommonModel
|
||||
{
|
||||
protected $append = ['priText', 'liked', 'stared', 'tags', 'childCount', 'hasUnDone', 'parentDone', 'hasComment', 'hasSource', 'canRead'];
|
||||
protected $append = ['priText','statusText', 'liked', 'stared', 'tags', 'childCount', 'hasUnDone', 'parentDone', 'hasComment', 'hasSource', 'canRead'];
|
||||
|
||||
public function read($code)
|
||||
{
|
||||
@ -112,6 +112,9 @@ class Task extends CommonModel
|
||||
if (isset($data['pri'])) {
|
||||
$type = 'pri';
|
||||
}
|
||||
if (isset($data['status'])) {
|
||||
$type = 'status';
|
||||
}
|
||||
if (isset($data['begin_time'])) {
|
||||
$type = 'setBeginTime';
|
||||
if (!$data['begin_time']) {
|
||||
@ -720,6 +723,14 @@ class Task extends CommonModel
|
||||
$status = [0 => '普通', 1 => '紧急', 2 => '非常紧急'];
|
||||
return $status[$data['pri']];
|
||||
}
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
if (!isset($data['status'])) {
|
||||
$data['status'] = 0;
|
||||
}
|
||||
$status = [0 => '未开始', 1 => '已完成', 2 => '进行中', 3 => '挂起', 4 => '测试中'];
|
||||
return $status[$data['status']];
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签
|
||||
|
@ -118,6 +118,10 @@ class Task
|
||||
$icon = 'user';
|
||||
$remark = '更新任务优先级为 ' . $task['priText'];
|
||||
break;
|
||||
case 'status':
|
||||
$icon = 'deployment-unit';
|
||||
$remark = '修改执行状态为 ' . $task['statusText'];
|
||||
break;
|
||||
case 'removeExecutor':
|
||||
$icon = 'user-delete';
|
||||
$remark = '移除了执行者 ';
|
||||
|
@ -294,7 +294,7 @@ class Task extends BasicApi
|
||||
*/
|
||||
public function edit(Request $request)
|
||||
{
|
||||
$data = $request::only('name,sort,end_time,begin_time,pri,description,work_time');
|
||||
$data = $request::only('name,sort,end_time,begin_time,pri,description,work_time,status');
|
||||
$code = $request::post('taskCode');
|
||||
if (!$code) {
|
||||
$this->error("请选择一个任务");
|
||||
|
Loading…
x
Reference in New Issue
Block a user