فهرست منبع

产品导入修改

moshaorui 5 روز پیش
والد
کامیت
ebe8ef8ec8
1فایلهای تغییر یافته به همراه11 افزوده شده و 6 حذف شده
  1. 11 6
      app/Distributor/Controllers/ImportProductController.php

+ 11 - 6
app/Distributor/Controllers/ImportProductController.php

@@ -41,11 +41,18 @@ class ImportProductController extends AdminDistController
     protected function indexForm()
     {
         return Form::make(new NullRepository(), function (Form $form) {
+            $lang = config('app.locale');//当前语言
+            $letf_block_width = 2;
+            $right_block_width = 10;
+            if ($lang == 'en') {
+                $letf_block_width = 3;
+                $right_block_width = 9;
+            }
             $lang = config('app.locale');//当前语言
             $form->action('/site-album');
             $folderTree = RpcAlbumFolder::siteAlbumFolderAllNodes();
             //显示左边树形菜单
-            $form->block(2, function (Form\BlockForm $form) use ($lang,$folderTree) {
+            $form->block($letf_block_width, function (Form\BlockForm $form) use ($lang,$folderTree) {
                 $type = [
                     'default'  => [
                         'icon' => true,
@@ -69,7 +76,7 @@ class ImportProductController extends AdminDistController
                 }
             });
             //右边相删内容
-            $form->block(10, function (Form\BlockForm $form)  {
+            $form->block($right_block_width, function (Form\BlockForm $form)  {
                 $form->html($this->grid())->width(12);
             });
             //以下JS代码用于点击文件夹时,自动跳转到相应页面
@@ -256,17 +263,15 @@ JS
                 })->unescape();
             }
 
-
-
             if ($show->model()->en_detail && $show->model()->en_detail != '[]') {
                 $show->field('en_detail')->as(function ($images) {
                     $images = json_decode($images);
-                    $html = '';
+                    $html = '<div style="text-align: center">';
                     foreach ($images as $key => $image) {
                         $url = CommonHelper::albumUrl($image);
                         $html .= '<img src="' . $url . '" style="width:300px;margin-bottom:10px">';
                     }
-                    $html .= '';
+                    $html .= '</div>';
                     return $html;
                 })->unescape();
             }