浏览代码

Merge branch 'master' of http://git.daboryhost.com:10880/youhk/youhk_test_repository

hokky 1 月之前
父节点
当前提交
f1c2452d41
共有 4 个文件被更改,包括 41 次插入8 次删除
  1. 1 0
      config/view.php
  2. 6 0
      public/js/api/core.js
  3. 34 7
      resources/views/front/dabory/erp/list-type/setup-type1.blade.php
  4. 0 1
      routes/web.php

+ 1 - 0
config/view.php

@@ -16,6 +16,7 @@ return [
     'paths' => [
         resource_path('views'),
         daboryPath('themes/' . env('DBR_THEME') . '/pro/resources'),
+        daboryPath('themes/' . env('DBR_THEME') . '/erp/resources'),
         daboryPath('themes/' . env('DBR_THEME')),
         daboryPath('themes'),
 //        public_path('themes'),

+ 6 - 0
public/js/api/core.js

@@ -171,6 +171,12 @@ function get_blades_html(path_to_blade, data, callback,
             // if ( ! isEmpty( $(id).html() ) ) return;
             // console.log(html)
             callback(html)
+        },
+        error: function(error) {
+            console.log(error.responseJSON)
+            iziToast.error({
+                title: 'Error', message: '실패했습니다.',
+            });
         }
     });
 }

+ 34 - 7
resources/views/front/dabory/erp/list-type/setup-type1.blade.php

@@ -253,15 +253,38 @@
             })
         }
 
-        function converter_setup_data(popup_option) {
-            popup_option['BladeRoute'] = `front.dabory.erp.${popup_option['Component']}`;
+        function converter_setup_data(popup_option, setup_pick) {
+            var theme = "{{ env('DBR_THEME') }}";
+            const dabory_path = "{{ daboryPath('themes/' . env('DBR_THEME')) . '/erp/resources'}}";
+            // var blade_path = 'themes.'+theme;
+            // console.log('blade_path',blade_path);
+
+            // view('themes.erponly.popup-setup.form-a.theme-setup-example-form');
+            // console.log('blade_path : ', blade_path);
+            if(setup_pick == 'theme-setup-pick'){
+                popup_option['BladeRoute'] = `themes.${theme}.${popup_option['Component']}`;
+            }else{
+                popup_option['BladeRoute'] = `front.dabory.erp.${popup_option['Component']}`;
+            }
+            console.log('popup_option : ', popup_option);
+            // popup_option['BladeRoute'] = `front.dabory.erp.${popup_option['Component']}`;
+            // popup_option['BladeRoute'] = `${popup_option['Component']}`;
             popup_option['ModalClassName'] = paramCase(popup_option['Component']);
             return popup_option;
         }
 
         async function show_select_popup(id, c1) {
-            const setup_pick = setupType1.DisplayVars.IsThemeSetup ? 'theme-setup-pick' : 'setup-pick'
-            const theme_dir = setup_pick === 'theme-setup-pick' ? "{{ env('DBR_THEME') }}/erp" : '';
+            let setup_pick;
+            if(setupType1.DisplayVars.IsThemeSetup){
+                setup_pick = 'theme-setup-pick';
+                var theme = "{{ env('DBR_THEME') }}";
+                var theme_dir = setup_pick === 'theme-setup-pick' ? `${theme}/erp` : '';
+            }else{
+                setup_pick = 'setup-pick';
+            }
+            // const setup_pick = setupType1.DisplayVars.IsThemeSetup ? 'theme-setup-pick' : 'setup-pick'
+            // const theme = "{{ env('DBR_THEME') }}";
+            // const theme_dir = setup_pick === 'theme-setup-pick' ? `${theme}/erp` : '';
 
             if ($('.setupType1-table').find('#c1-tag').prop('disabled')) return;
             $('.setupType1-table').find(`input[name='bd-cursor-state']`).prop('disabled', true)
@@ -270,8 +293,10 @@
             // let response = await get_api_data('setup-pick', {
             //     Page: [ { Id: Number(id) } ]
             // })
-
-            let response = await get_api_data(setup_pick, { Page: [{ Id: Number(id) }] });
+            console.log('setup_pick : ', setup_pick);
+            let response = await get_api_data(setup_pick, {
+                Page: [ { Id: Number(id) } ]
+            });
 
             console.log(response);
 
@@ -279,13 +304,15 @@
             let setup_json = setup.SetupJson ? JSON.parse(setup.SetupJson) : {}
             const brand_code = setup.BrandCode
             const parameter_type = camelCase(setup['Parameter'].split('/')[3])
+            console.log('setup : ', setup);
+            // return;
 
             setup = converter_setup_data({
                 Caption: setup['SetupName'],
                 Component: setup['Component'],
                 ParameterDir: setup['Parameter'],
                 ParameterType: parameter_type,
-            })
+            }, setup_pick)
 
             // response = await get_para_data(setup['ParameterType'], setup['ParameterDir'], getParameterByName('bpa'))
             response = await get_para_data(setup['ParameterType'], setup['ParameterDir'], getParameterByName('bpa'), theme_dir)

+ 0 - 1
routes/web.php

@@ -382,7 +382,6 @@ Route::middleware('check.gate.token')->group(function () {
 
 
     Route::post('/brand-image-file-list', function (Request $request) {
-        $theme = env('DBR_THEME');
         $filePath = daboryPath("themes/" . env('DBR_THEME') . "/pro/resources/assets/brand-images");
         $files = \File::allFiles($filePath);