setting-igroup.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. @inject('callApiService', 'App\Services\CallApiService')
  2. @php
  3. $modalClassName = $modalClassName ?? '';
  4. $response = $callApiService->callApi([
  5. 'url' => 'list-type1-page',
  6. 'data' => [
  7. 'QueryVars' => [
  8. 'QueryName' => 'seo-meta/igroup-input',
  9. 'SimpleFilter' => "",
  10. 'IsntPagination' => true,
  11. ],
  12. 'PageVars' => [
  13. 'Limit' => 100000
  14. ]
  15. ],
  16. ]);
  17. $mainMenuList = App\Helpers\Utils::formatIgroupMenuList($response['Page'] ?? [], 'C1');
  18. @endphp
  19. <div class="modal fade modal-cyan {{ $modalClassName }}" id="modal-setting_igroup" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-hidden="true">
  20. <div class="modal-dialog" style="max-width: 1100px !important;">
  21. <div class="modal-content">
  22. <div class="modal-header bg-primary">
  23. <h4 class="modal-title text-white" id="myModalLabel"></h4>
  24. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fas fa-times"></i></button>
  25. </div>
  26. <div class="modal-body">
  27. <div class="row align-items-end">
  28. <div class="col-4" >
  29. <div class="d-flex flex-column">
  30. <label class="m-0">검색조건</label>
  31. <div class="row">
  32. <div class="col-5 pr-1">
  33. <select class="rounded w-100" id="filter-name-select">
  34. @foreach ($moealSetFile['FilterSelectOptions'] ?? [] as $key => $popupOption)
  35. <option value="{{ $popupOption['Value'] }}" data-reverse="{{ $popupOption['Reverse'] ?? '' }}">
  36. {{ $popupOption['Caption'] }}
  37. </option>
  38. @endforeach
  39. </select>
  40. </div>
  41. <div class="col pl-0">
  42. <input class="rounded w-100" type="text" id="filter-value-txt" onkeydown="override_enter_pressed_setting_modal_auto_search(event)">
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="col-7" >
  48. <div class="d-flex flex-column">
  49. <label class="m-0">상태별 검색</label>
  50. <input class="rounded w-100" type="text" id="simple-filter-txt" hidden>
  51. <select class="rounded w-100" id="simple-filter-select" onchange="$('#modal-setting_igroup.show').find('.modal-search').trigger('click')">
  52. @foreach ($moealSetFile['SimpleSelectOptions'] ?? [] as $key => $popupOption)
  53. <option value="{{ $popupOption['Value'] }}">
  54. {{ DataConverter::execute(null, $popupOption['Caption']) ?? $popupOption['Caption'] }}
  55. </option>
  56. @endforeach
  57. </select>
  58. </div>
  59. </div>
  60. <div class="col-1" >
  61. <button type="button" class="btn btn-primary btn-sm icon-search4 modal-search" data-target="setting_igroup" data-class="{{ $modalClassName }}"></button>
  62. </div>
  63. <div class="d-flex w-100 mt-2" id="igroup-card">
  64. <div class="card col mb-0 mr-1 igroup-card-div">
  65. <div class="card-header pl-0 pb-1">
  66. <label class="m-0">1차 카테고리</label>
  67. </div>
  68. <div class="card-body px-0">
  69. <div class="align-items-center d-flex" v-for="igroup in firstCategories">
  70. <input type="radio" name="first_categories" :value="igroup['C1']" class="text-center mr-1" :id="igroup['C1']">
  71. <label class="mb-0" :for="igroup['C1']">
  72. @{{ igroup['C2'] }}
  73. </label>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="card col mb-0 mr-1 igroup-card-div">
  78. <div class="card-header pl-0">
  79. <label class="m-0">2차 카테고리</label>
  80. </div>
  81. <div class="card-body px-0">
  82. <div class="align-items-center d-flex" v-for="igroup in secondCategories">
  83. <input type="radio" name="second_categories" :value="igroup['C1']" class="text-center mr-1" :id="igroup['C1']">
  84. <label class="mb-0" :for="igroup['C1']">
  85. @{{ igroup['C2'] }}
  86. </label>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="card col mb-0 mr-1 igroup-card-div">
  91. <div class="card-header pl-0">
  92. <label class="m-0">3차 카테고리</label>
  93. </div>
  94. <div class="card-body px-0">
  95. <div class="align-items-center d-flex" v-for="igroup in thirdCategories">
  96. <input type="radio" name="third_categories" :value="igroup['C1']" class="text-center mr-1" :id="igroup['C1']">
  97. <label class="mb-0" :for="igroup['C1']">
  98. @{{ igroup['C2'] }}
  99. </label>
  100. </div>
  101. </div>
  102. </div>
  103. <div class="card col mb-0 igroup-card-div">
  104. <div class="card-header pl-0">
  105. <label class="m-0">4차 카테고리</label>
  106. </div>
  107. <div class="card-body px-0">
  108. <div class="align-items-center d-flex" v-for="igroup in fourthCategories">
  109. <input type="radio" name="fourth_categories" :value="igroup['C1']" class="text-center mr-1" :id="igroup['C1']">
  110. <label class="mb-0" :for="igroup['C1']">
  111. @{{ igroup['C2'] }}
  112. </label>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="col-12 my-2 table-responsive" style="height: 400px;">
  118. <table class="table-row">
  119. <thead id="table-head">
  120. </thead>
  121. <tbody id="table-body">
  122. </tbody>
  123. </table>
  124. </div>
  125. <div class="col-6" >
  126. <select class="modal-line-select" data-target="setting_igroup" data-class="{{ $modalClassName }}">
  127. @include('front.outline.moption')
  128. </select>
  129. </div>
  130. <div class="col-6" >
  131. <ul class="pagination pagination-sm" style="float: right;"></ul>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. @once
  139. <script src="/js/modals-controller/a-type/setting.js?{{date('YmdHis')}}"></script>
  140. <script src="/js/modals-controller/a-type/setting-igroup.js?{{date('YmdHis')}}"></script>
  141. <script>
  142. var modalSetting = new Vue({
  143. el: '#modal-setting_igroup',
  144. data: function () {
  145. return {
  146. mainMenuList: @json($mainMenuList),
  147. firstCategories: [],
  148. secondCategories: [],
  149. thirdCategories: [],
  150. fourthCategories: [],
  151. };
  152. },
  153. computed: {
  154. },
  155. mounted() {
  156. this.firstCategories = this.mainMenuList;
  157. const self = this
  158. $(document).on('click', '#modal-setting_igroup #igroup-card input', function() {
  159. if ($(this).prop('checked')) {
  160. const code = formatDateString($(this).val()) + '%'
  161. $('#modal-setting_igroup.show').find('#simple-filter-txt').val(`mx.igroup_code like '${code}'`)
  162. $('#modal-setting_igroup.show').find('.modal-search').trigger('click')
  163. let filter = []
  164. switch ($(this).attr('name')) {
  165. case 'first_categories':
  166. filter = self.mainMenuList.filter(igroup => String(igroup['C1']) === $(this).val())[0]
  167. self.secondCategories = filter['child']
  168. self.thirdCategories = []
  169. self.fourthCategories = []
  170. $('#modal-setting_igroup').find('input[name=second_categories]').prop('checked', false)
  171. break;
  172. case 'second_categories':
  173. filter = self.secondCategories[$(this).val()]
  174. self.thirdCategories = filter['child']
  175. self.fourthCategories = []
  176. $('#modal-setting_igroup').find('input[name=third_categories]').prop('checked', false)
  177. break;
  178. case 'third_categories':
  179. filter = self.thirdCategories[$(this).val()]
  180. self.fourthCategories = filter['child']
  181. $('#modal-setting_igroup').find('input[name=fourth_categories]').prop('checked', false)
  182. break;
  183. }
  184. }
  185. });
  186. },
  187. created() {
  188. },
  189. });
  190. </script>
  191. @endonce