39 lines
859 B
PHP
39 lines
859 B
PHP
|
<?php
|
||
|
|
||
|
namespace app\action;
|
||
|
|
||
|
use Exception;
|
||
|
use libs\listener\Event;
|
||
|
|
||
|
class SetTestScript
|
||
|
{
|
||
|
public function execute($post)
|
||
|
{
|
||
|
// 验证数据
|
||
|
$param = check_valid($post['action'], [
|
||
|
['process_code', 'string', '工序编码']
|
||
|
], $post['param']);
|
||
|
|
||
|
// 计算属性开始位置
|
||
|
$param['class_name'] = get_class($this);
|
||
|
$begin_data = Event::emit('ExtScriptEvent.extScriptBegin', $param);
|
||
|
|
||
|
|
||
|
try {
|
||
|
|
||
|
|
||
|
|
||
|
} catch (Exception $e) {
|
||
|
throw new Exception($e->getMessage(), $e->getCode() ? $e->getCode() : 4001);
|
||
|
}
|
||
|
|
||
|
// 计算属性结束位置
|
||
|
$end_data = Event::emit('ExtScriptEvent.extScriptEnd', $param);
|
||
|
|
||
|
return [
|
||
|
'ext_script' => ['begin_data' => $begin_data, 'end_data' => $end_data],
|
||
|
'rtval' => ''
|
||
|
];
|
||
|
}
|
||
|
}
|