修改crudBUG

This commit is contained in:
liaofei 2023-04-20 11:56:23 +08:00
parent 1dcc97354e
commit 2402d0f796
4 changed files with 5 additions and 4 deletions

View File

@ -94,7 +94,7 @@ class Controller extends Make
$this->value['name'] = $className;
$this->value['path'] = $this->getfolderPath($path);
$this->value['content-php'] = $contentPhp;
$this->value['use-php'] = "use " . $options['usePath'] . "Services;\n";
$this->value['use-php'] = "use " . str_replace('/', '\\', $options['usePath']) . "Services;\n";
$contentStr = str_replace($this->var, $this->value, $contentController);

View File

@ -236,7 +236,7 @@ abstract class Make
$this->value['path'] = $this->getfolderPath($path);
}
if (isset($this->value['use-php']) && !empty($options['usePath'])) {
$this->value['use-php'] = "use " . $options['usePath'] . ";\n";
$this->value['use-php'] = "use " . str_replace('/', '\\', $options['usePath']) . ";\n";
}
$contentStr = str_replace($this->var, $this->value, $content);

View File

@ -88,8 +88,9 @@ class ViewPages extends Make
}
$columnStr[] = ($key == 0 ? $this->tab(2) : '') . "{\n" . $this->tab(3) . "title:\"{$item['name']}\"," . $this->tab(2) . "\n" . $this->tab(3) . "key:\"{$item['field']}\"\n" . $this->tab(2) . "}\n";
}
$this->value['route'] = $route;
$this->value['auth'] = Str::snake($name);
$this->value['componentName'] = $this->value['auth'];
$this->value['route'] = $route;
$this->value['content-vue'] = $columnStr ? "\n" . implode($this->tab(2) . ',', $columnStr) . $this->tab(2) . ',' : '';
$this->value['pathApiJs'] = $options['pathApiJs'] ?? '';
$this->value['nameStudly'] = Str::studly($name);

View File

@ -34,7 +34,7 @@
import { mapState } from 'vuex';
import { {%nameCamel%}SaveApi, {%nameCamel%}DeleteApi, {%nameCamel%}UpdateApi, get{%nameStudly%}CreateApi, get{%nameStudly%}EditApi, get{%nameStudly%}ListApi} from '{%pathApiJs%}';
export default {
name: 'user_group',
name: '{%componentName%}',
data() {
return {
grid: {