Process.php
1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
namespace app\admin\controller\fastflow\flow;
use app\common\controller\Backend;
use fastflow\api;
/**
* 流程监控
*
* @icon fa fa-tv
*/
class Process extends Backend
{
/**
* Process模型对象
* @var \app\admin\model\fastflow\flow\Process
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\fastflow\flow\Process;
$this->view->assign([
'statisticDataList' => $this->model->getStatisticData(),
"statusList" => $this->model->getStatusList(),
"totalData" => $this->model->getTotalData(),
'recentLog' => $this->model->getRecentThreadLog(),
'recentCount' => $this->model->getRecentCount(),
]);
$this->assignconfig('chartData', $this->model->getChartData());
}
/**
* 编辑
*/
public function edit($ids = null)
{
if ($this->request->isPost()) {
return ['code' => 0, 'msg' => '不允许直接对该表进行编辑'];
}
return $this->view->fetch();
}
/**
* 添加
*/
public function add()
{
if ($this->request->isPost()) {
return ['code' => 0, 'msg' => '不允许直接添加'];
}
return $this->view->fetch();
}
/**
* 删除
*/
public function del($ids = "")
{
return ['code' => 0, 'msg' => '不允许删除'];
}
/**
*强制终止
*/
public function termination($ids = "")
{
$process = $this->model->find($ids);
if (!$process) {
return ['code' => 0, 'msg' => '参数错误'];
}
if ((new api())->terminateProcess($ids)) {
return ['code' => 1, 'msg' => '操作成功'];
}
}
}