Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
- build vue template index.vue columns viewType field
- mapperTrait delete php syntax
  • Loading branch information
zds-s committed Jan 24, 2024
1 parent 535c0b1 commit 1d62979
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/mine-core/src/Abstracts/AbstractMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class AbstractMapper
use MapperTrait;

/**
* @var MineModel
* @var class-string|MineModel
*/
public $model;

Expand Down
2 changes: 1 addition & 1 deletion src/mine-core/src/Traits/MapperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
7 changes: 3 additions & 4 deletions src/mine-generator/src/VueIndexGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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';
Expand All @@ -350,7 +349,7 @@ protected function getColumns(): string
];
}
// 密码处理
if ($column->view_type == 'password') {
if ($column->view_type === 'password') {
$tmp['type'] = 'password';
}
// 允许查看字段的角色(前端还待支持)
Expand Down

0 comments on commit 1d62979

Please sign in to comment.