* The workflow function support batch operate.

This commit is contained in:
liugang
2019-10-17 15:14:44 +08:00
parent a5316c5667
commit edcb54fbe4

View File

@@ -337,11 +337,16 @@ class router extends baseRouter
$this->loadModuleConfig('workflowaction');
$moduleName = 'flow';
$methodName = $this->methodName;
/*
* 工作流中除了browse、create、edit、view、delete、export外其他的方法都调用operate方法来执行。
* In addition to browse, create, edit, view, delete and export, all methods in the workflow call the operate method to execute.
* 工作流中除了内置方法外的方法如果是批量操作调用batchOperate方法其它操作调用operate方法来执行。
* In addition to the built-in methods in the workflow, if the batch operation calls the batchOperate method, other operations call the operate method to execute.
*/
$methodName = in_array($this->methodName, $this->config->workflowaction->default->actions) ? $this->methodName : 'operate';
if(!in_array($this->methodName, $this->config->workflowaction->default->actions))
{
if($action->type == 'single') $methodName = 'operate';
if($action->type == 'batch') $methodName = 'batchOperate';
}
$this->setFlowURI($moduleName, $methodName);
}
@@ -388,12 +393,13 @@ class router extends baseRouter
$params = array_slice($params, 2); // $params = array(1);
/* Prepend other params. */
if($methodName == 'operate') array_unshift($params, $this->rawMethod); // $params = array('close', 1);
array_unshift($params, $this->rawModule); // $params = array($module, 'close', 1);
array_unshift($params, $methodName); // $params = array('operate', $module, 'close', 1);
array_unshift($params, $moduleName); // $params = array('flow', 'operate', $module, 'close', 1);
if($methodName == 'operate') array_unshift($params, $this->rawMethod); // $params = array('close', 1);
if($methodName == 'batchOperate') array_unshift($params, $this->rawMethod); // $params = array('close', 1);
array_unshift($params, $this->rawModule); // $params = array($module, 'close', 1);
array_unshift($params, $methodName); // $params = array('operate', $module, 'close', 1);
array_unshift($params, $moduleName); // $params = array('flow', 'operate', $module, 'close', 1);
$this->URI = implode($this->config->requestFix, $params); // $this->URI = flow-operate-$module-close-1.html;
$this->URI = implode($this->config->requestFix, $params); // $this->URI = flow-operate-$module-close-1.html;
}
else
{