setting-prompt.blade.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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' => 'master/xai',
  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_prompt" 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_prompt.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_prompt" data-class="{{ $modalClassName }}"></button>
  62. </div>
  63. <div class="col-12 my-2 table-responsive" style="height: 400px;">
  64. <table class="table-row">
  65. <thead id="table-head">
  66. </thead>
  67. <tbody id="table-body">
  68. </tbody>
  69. </table>
  70. </div>
  71. <div class="col-6" >
  72. <select class="modal-line-select" data-target="setting_prompt" data-class="{{ $modalClassName }}">
  73. @include('front.outline.moption')
  74. </select>
  75. </div>
  76. <div class="col-6" >
  77. <ul class="pagination pagination-sm" style="float: right;"></ul>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. @once
  85. <script src="/js/modals-controller/a-type/setting.js?{{date('YmdHis')}}"></script>
  86. <script src="/js/modals-controller/a-type/setting-prompt.js?{{date('YmdHis')}}"></script>
  87. <script>
  88. var modalSetting = new Vue({
  89. el: '#modal-setting_prompt',
  90. data: function () {
  91. return {
  92. mainMenuList: @json($mainMenuList),
  93. firstCategories: [],
  94. secondCategories: [],
  95. thirdCategories: [],
  96. fourthCategories: [],
  97. };
  98. },
  99. computed: {
  100. },
  101. mounted() {
  102. this.firstCategories = this.mainMenuList;
  103. const self = this
  104. $(document).on('click', '#modal-setting_prompt #igroup-card input', function() {
  105. if ($(this).prop('checked')) {
  106. const code = formatDateString($(this).val()) + '%'
  107. $('#modal-setting_prompt.show').find('#simple-filter-txt').val(`mx.prompt_code like '${code}'`)
  108. $('#modal-setting_prompt.show').find('.modal-search').trigger('click')
  109. let filter = []
  110. switch ($(this).attr('name')) {
  111. case 'first_categories':
  112. filter = self.mainMenuList.filter(prompt => String(prompt['C1']) === $(this).val())[0]
  113. self.secondCategories = filter['child']
  114. self.thirdCategories = []
  115. self.fourthCategories = []
  116. $('#modal-setting_prompt').find('input[name=second_categories]').prop('checked', false)
  117. break;
  118. case 'second_categories':
  119. filter = self.secondCategories[$(this).val()]
  120. self.thirdCategories = filter['child']
  121. self.fourthCategories = []
  122. $('#modal-setting_prompt').find('input[name=third_categories]').prop('checked', false)
  123. break;
  124. case 'third_categories':
  125. filter = self.thirdCategories[$(this).val()]
  126. self.fourthCategories = filter['child']
  127. $('#modal-setting_prompt').find('input[name=fourth_categories]').prop('checked', false)
  128. break;
  129. }
  130. }
  131. });
  132. },
  133. created() {
  134. },
  135. });
  136. </script>
  137. @endonce