'require|checkData', 'node_id' => 'require|checkNode', 'check_type' => 'require', 'check_content' => 'require', 'must_check' => 'require|in:0,1', ]; /** * 参数描述 * @var string[] */ protected $field = [ 'id' => 'id', 'node_id' => '节点id', 'check_type' => '检查类别', 'check_content' => '检查内容', 'must_check' => '是否必检', ]; /** * @notes 添加场景 * @return SupervisionCheckItemDetailValidate * @author likeadmin * @date 2024/02/26 15:34 */ public function sceneAdd() { return $this->remove('id',true); } /** * @notes 编辑场景 * @return SupervisionCheckItemDetailValidate * @author likeadmin * @date 2024/02/26 15:34 */ public function sceneEdit() {} /** * @notes 删除场景 * @return SupervisionCheckItemDetailValidate * @author likeadmin * @date 2024/02/26 15:34 */ public function sceneDelete() { return $this->only(['id']); } /** * @notes 详情场景 * @return SupervisionCheckItemDetailValidate * @author likeadmin * @date 2024/02/26 15:34 */ public function sceneDetail() { return $this->only(['id']); } public function checkData($value): bool|string { $data = SupervisionCheckItemDetail::where('id',$value)->findOrEmpty(); if($data->isEmpty()){ return '数据不存在'; } return true; } public function checkNode($value): bool|string { $data = SupervisionCheckItem::where('id',$value)->findOrEmpty(); if($data->isEmpty()){ return '检查项节点信息不存在'; } return true; } }