liaofei 2 лет назад
Родитель
Сommit
2402d0f796

+ 1 - 1
crmeb/crmeb/services/crud/Controller.php

@@ -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);
 

+ 1 - 1
crmeb/crmeb/services/crud/Make.php

@@ -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);

+ 2 - 1
crmeb/crmeb/services/crud/ViewPages.php

@@ -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);

+ 1 - 1
crmeb/crmeb/services/crud/stubs/view/pages/crud/index.stub

@@ -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: {