Commit 56426015 authored by celaraze's avatar celaraze
Browse files

快照:依赖

Showing with 71 additions and 6 deletions
+71 -6
......@@ -19,7 +19,7 @@ class DeviceRecordBatchCreateUpdateTrackAction extends BatchAction
*
* @return Modal|string
*/
public function render()
public function render(): string|Modal
{
// 实例化表单类并传递自定义参数
$form = DeviceRecordBatchCreateUpdateTrackForm::make()->payload([
......
......@@ -14,11 +14,21 @@ class DeviceRecordBatchDeleteAction extends BatchAction
$this->title = '🔨 ' . admin_trans_label('Batch Delete');
}
/**
* 确认弹窗.
*
* @return string
*/
public function confirm(): string
{
return admin_trans_label('Batch Delete Confirm');
}
/**
* 处理逻辑.
*
* @return \Dcat\Admin\Actions\Response
*/
public function handle(): Response
{
$keys = $this->getKey();
......
......@@ -14,11 +14,21 @@ class PartRecordBatchDeleteAction extends BatchAction
$this->title = '🔨 ' . admin_trans_label('Batch Delete');
}
/**
* 确认弹窗.
*
* @return string
*/
public function confirm(): string
{
return admin_trans_label('Batch Delete Confirm');
}
/**
* 处理逻辑.
*
* @return \Dcat\Admin\Actions\Response
*/
public function handle(): Response
{
$keys = $this->getKey();
......
......@@ -14,11 +14,21 @@ class SoftwareRecordBatchDeleteAction extends BatchAction
$this->title = '🔨 ' . admin_trans_label('Batch Delete');
}
/**
* 确认弹窗.
*
* @return string
*/
public function confirm(): string
{
return admin_trans_label('Batch Delete Confirm');
}
/**
* 处理逻辑.
*
* @return \Dcat\Admin\Actions\Response
*/
public function handle(): Response
{
$keys = $this->getKey();
......
......@@ -14,11 +14,21 @@ class UserBatchDeleteAction extends BatchAction
$this->title = '🔨 ' . admin_trans_label('Batch Delete');
}
/**
* 确认弹窗.
*
* @return string
*/
public function confirm(): string
{
return admin_trans_label('Batch Delete Confirm');
}
/**
* 处理逻辑.
*
* @return \Dcat\Admin\Actions\Response
*/
public function handle(): Response
{
$keys = $this->getKey();
......
......@@ -2,6 +2,13 @@
namespace App\Http\Controllers;
use App\Models\DeviceRecord;
use App\Models\PartRecord;
use App\Models\SoftwareRecord;
use Celaraze\Response;
use Illuminate\Http\JsonResponse;
use JetBrains\PhpStorm\ArrayShape;
class QueryController extends Controller
{
public function __construct()
......@@ -9,5 +16,23 @@ class QueryController extends Controller
$this->middleware('jwt.auth');
}
/**
* 查询资产.
*
* @param $asset_number
* @return JsonResponse|array
*/
#[ArrayShape(['code' => "int", 'message' => "string", "data" => "mixed"])]
public function handle($asset_number): JsonResponse|array
{
$asset = DeviceRecord::where('asset_number', $asset_number)->first();
if (empty($asset)) {
$asset = PartRecord::where('asset_number', $asset_number)->first();
if (empty($asset)) {
$asset = SoftwareRecord::where('asset_number', $asset_number)->first();
}
}
return Response::make(200, '查询成功', $asset);
}
}
......@@ -37,12 +37,12 @@
"tymon/jwt-auth": "^1.0"
},
"require-dev": {
"facade/ignition": "^2.5.7",
"fzaninotto/faker": "^1.9.1",
"laravel/sail": "^1.4",
"mockery/mockery": "^1.3.1",
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3"
"phpunit/phpunit": "^9.3.3"
},
"config": {
"optimize-autoloader": true,
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment