diff --git a/src/mine-core/src/Abstracts/AbstractMapper.php b/src/mine-core/src/Abstracts/AbstractMapper.php index dee57b7b..36a63777 100644 --- a/src/mine-core/src/Abstracts/AbstractMapper.php +++ b/src/mine-core/src/Abstracts/AbstractMapper.php @@ -34,7 +34,7 @@ abstract class AbstractMapper use MapperTrait; /** - * @var MineModel + * @var class-string|MineModel */ public $model; diff --git a/src/mine-core/src/Traits/MapperTrait.php b/src/mine-core/src/Traits/MapperTrait.php index 7e417db8..5e2ce34a 100644 --- a/src/mine-core/src/Traits/MapperTrait.php +++ b/src/mine-core/src/Traits/MapperTrait.php @@ -310,7 +310,7 @@ public function delete(array $ids): bool $this->model::destroy($ids); $manager = ApplicationContext::getContainer()->get(Manager::class); - $manager->destroy($ids, $this->model::class); + $manager->destroy($ids, $this->model); return true; } diff --git a/src/mine-generator/src/VueIndexGenerator.php b/src/mine-generator/src/VueIndexGenerator.php index a00d50bd..a8ae6535 100644 --- a/src/mine-generator/src/VueIndexGenerator.php +++ b/src/mine-generator/src/VueIndexGenerator.php @@ -112,7 +112,6 @@ public function getShortBusinessName(): string public function getComponentType(int $type): string { return match ($type) { - 1 => "'modal'", 2 => "'drawer'", 3 => "'tag'", default => "'modal'" @@ -221,7 +220,7 @@ protected function getOptions(): string $options['operationColumn'] = false; $options['operationColumnWidth'] = 160; $options['formOption'] = [ - 'viewType' => $this->tablesContract->getComponentType()->value, + 'viewType' => "'{$this->tablesContract->getComponentType()}'", 'width' => 600, ]; if ($this->tablesContract->getComponentType() === ComponentTypeEnum::TAG) { @@ -332,7 +331,7 @@ protected function getColumns(): string $tmp['dict'] = ['data' => $collection, 'translation' => true]; } // 对日期时间处理 - if ($column->view_type == 'date' && $column->options['mode'] == 'date') { + if ($column->view_type === 'date' && $column->options['mode'] === 'date') { unset($tmp['mode']); if (isset($column->options['range']) && $column->options['range']) { $tmp['formType'] = 'range'; @@ -350,7 +349,7 @@ protected function getColumns(): string ]; } // 密码处理 - if ($column->view_type == 'password') { + if ($column->view_type === 'password') { $tmp['type'] = 'password'; } // 允许查看字段的角色(前端还待支持) diff --git a/src/mine-helpers/src/functions.php b/src/mine-helpers/src/functions.php index 13c859b4..7176adb3 100644 --- a/src/mine-helpers/src/functions.php +++ b/src/mine-helpers/src/functions.php @@ -19,7 +19,6 @@ use Mine\Helper\AppVerify; use Mine\Helper\LoginUser; use Mine\MineCollection; -use Mine\MineRequest; use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface;