박정하 박정하 04-28
250428 박정하 필터 수정
@1015cfeca5a2909ee5f23fd6d93658a0da9cccd5
client/views/component/connection/itm/dataFilter.vue
--- client/views/component/connection/itm/dataFilter.vue
+++ client/views/component/connection/itm/dataFilter.vue
@@ -1,241 +1,173 @@
 <template>
   <div v-show="isModalOpen" class="modal-wrapper">
-    <div class="modal-container">
-      <div class="modal-title flex justify-between align-center">
-        <h2>데이터베이스 읽기</h2>
-        <button class="close-btn" @click="closeModal">
-          <svg-icon type="mdi" :width="20" :height="20" :path="closePath"></svg-icon>
-        </button>
+    <div class="modal-container" style="height: auto">
+      <div class="modal-title">
+        <div class="flex justify-between align-center">
+          <h2>데이터 필터</h2>
+          <button class="close-btn" @click="closeModal">
+            <svg-icon type="mdi" :width="20" :height="20" :path="closePath"></svg-icon>
+          </button>
+        </div>
       </div>
-    </div>
-    <div class="modal-content-monthly">
-      <template v-if="currentPage == 1">
+      <div class="modal-content-monthly">
+        <div class="input-container flex">
+          <label class="radio-label">
+            <input type="radio" :name="comId + 'match'" class="custom-radiobox" :value="true" v-model="item.itm.match_type" />
+            <span>AND 연산</span>
+          </label>
+          <label class="radio-label">
+            <input type="radio" :name="comId + 'match'" class="custom-radiobox" :value="false" v-model="item.itm.match_type" />
+            <span>OR 연산</span>
+          </label>
+        </div>
         <div class="table-zone">
           <table class="form-table">
+            <!-- col 꼭 너비 기재해야함! 그래야 100%로 차지함 -->
             <colgroup>
               <col style="width: 25%" />
-              <col style="width: 75%" />
-            </colgroup>
-            <tbody v-if="jobItm.itm != null">
-              <tr>
-                <th>연계정보 타입</th>
-                <td>
-                  <div class="input-container flex">
-                    <label class="radio-label">
-                      <input type="radio" name="radio" :value="false" class="custom-radiobox" @change="successAt = false" v-model="jobItm.itm_option_bool" />
-                      <span>직접입력</span>
-                    </label>
-                    <label class="radio-label">
-                      <input type="radio" name="radio" :value="true" class="custom-radiobox" @change="successAt = false" v-model="jobItm.itm_option_bool" />
-                      <span>불러오기</span>
-                    </label>
-                  </div>
-                </td>
-              </tr>
-              <tr v-show="jobItm.itm_option_bool">
-                <th>연계정보</th>
-                <td>
-                  <input type="text" class="half-input" disabled :value="linkConnectionDB.conectNm +
-                    '(' +
-                    linkConnectionDB.conectIp +
-                    ')'
-                    " v-if="linkConnectionDB.conectNm != null" />
-                  <input type="text" class="half-input" disabled v-else />
-                  <button class="blue-border-btn small-btn" @click="dbConSearchOpen(true)"> 검색 </button>
-                </td>
-              </tr>
-              <tr>
-                <th>DMBS</th>
-                <td>
-                  <select id="databaseType" @change="successAt = false" class="square-select half-input" v-model="inputConnectionDB.databaseType" :disabled="jobItm.itm_option_bool">
-                    <option v-for="(itm, index) in databaseTypeList" :key="index" :value="itm.key"> {{ itm.value }} </option>
-                  </select>
-                </td>
-              </tr>
-              <tr>
-                <th>IP</th>
-                <td>
-                  <input id="conectIp" type="text" @input="successAt = false" class="half-input" v-model="inputConnectionDB.conectIp" placeholder="127.0.0.1" :disabled="jobItm.itm_option_bool" />
-                </td>
-              </tr>
-              <tr>
-                <th>PORT</th>
-                <td>
-                  <input id="conectPort" type="text" @input="successAt = false" class="half-input" v-model="inputConnectionDB.conectPort" :disabled="jobItm.itm_option_bool" />
-                </td>
-              </tr>
-              <tr>
-                <th>DB 명</th>
-                <td>
-                  <input id="databaseNm" type="text" @input="successAt = false" class="half-input" v-model="inputConnectionDB.databaseNm" placeholder="데이터베이스명 OR 스키마명" :disabled="jobItm.itm_option_bool" />
-                </td>
-              </tr>
-              <tr>
-                <th>접속ID</th>
-                <td>
-                  <input type="text" class="half-input" @input="successAt = false" v-model="inputConnectionDB.userId" placeholder="접속 ID" :disabled="jobItm.itm_option_bool" />
-                </td>
-              </tr>
-              <tr>
-                <th>접속PW</th>
-                <td>
-                  <input type="password" class="half-input" @input="successAt = false" v-model="inputConnectionDB.userPassword" placeholder="접속 PW" autocomplete="new-password" :disabled="jobItm.itm_option_bool" />
-                </td>
-              </tr>
-            </tbody>
-          </table>
-        </div>
-        <div class="content-titleZone flex justy justify-between align-center mt20">
-          <p class="box-title">데이터베이스 연결 결과</p>
-          <button class="blue-border-btn small-btn" @click="dataBaseConnectionCheck"> 접속확인 </button>
-        </div>
-        <div class="table-zone">
-          <table class="list-table">
-            <colgroup>
-              <col width="10%" />
-              <col width="10%" />
-              <col width="80%" />
+              <col style="width: 25%" />
+              <col style="width: 25%" />
+              <col style="width: 25%" />
             </colgroup>
             <thead>
               <tr>
-                <th>No</th>
-                <th>접속시간</th>
-                <th>접속결과</th>
+                <th>컬럼</th>
+                <th>연산</th>
+                <th>내용</th>
+                <th>관리</th>
               </tr>
             </thead>
             <tbody>
-              <tr v-for="(itm, indx) in resultMessage" :key="indx">
-                <td>{{ indx + 1 }}</td>
-                <td>{{ itm.time }}</td>
-                <td>{{ itm.message }}</td>
+              <tr v-for="(filter, indx) in item.itm.filterItems" :key="indx">
+                <td>
+                  <select class="full-input" style="width: 100%" @change="dataInsert($event, filter)" v-model="filter.coulmn_nm">
+                    <option v-for="(temp, indxc) in item.front_dataTable.columnDatas" :key="indxc" :value="temp.orginlColumnNm"> {{ temp.displyColumnNm }} </option>
+                  </select>
+                </td>
+                <td>
+                  <select class="full-select" v-model="filter.calc_ty">
+                    <option :value="null">필터를 적용할 연산을 선택하세요.</option>
+                    <option value="1">=</option>
+                    <template v-if="filter.data_ty != 'STRING'">
+                      <option value="2">&lt;</option>
+                      <option value="3">&gt;</option>
+                      <option value="4">&lt;=</option>
+                      <option value="5">&gt;=</option>
+                    </template>
+                    <option value="6">!=</option>
+                    <option value="7" v-if="filter.data_ty == 'STRING'"> 포함 </option>
+                  </select>
+                </td>
+                <td>
+                  <input type="text" class="full-input" v-if="filter.data_ty == 'STRING'" v-model="filter.cmpr_value" placeholder="필터를 적용할 내용을 입력하세요." />
+                  <input type="date" class="full-select" v-else-if="filter.data_ty == 'DATE'" v-model="filter.cmpr_value" />
+                  <input type="datetime-local" class="full-select" v-else-if="filter.data_ty == 'DATETIME'" v-model="filter.cmpr_value" />
+                  <input type="number" class="full-select" v-else v-model="filter.cmpr_value" />
+                </td>
+                <td style="text-align: center">
+                  <button class="green-border-btn small-btn" @click="deleteFilter(indx)"> 삭제 </button>
+                </td>
               </tr>
             </tbody>
           </table>
         </div>
-      </template>
-      <template v-if="currentPage == 2">
-        <div class="flex content-box" style="min-height: 60dvh; flex-wrap: nowrap;">
-          <div class="content-box pd10" style="width: 20%;">
-            <div class="content-titleZone flex justy justify-between align-center" style="height: 45px">
-              <p class="box-title">데이터베이스 정보</p>
-            </div>
-            <div class="content-zone2">
-              <ul class="content-list" v-if="tableList.length > 0">
-                <li class="cursor" v-for="(item, indx) in tableList" :key="indx">
-                  <a @click="getTableData(item)" :class="{
-                    'file-list': true,
-                    selected: selectTable === item,
-                  }">
-                    <div class="flex align-center">
-                      <p> {{ item.tableNmKr != null && item.tableNmKr != "" ? item.tableNmKr : item.tableNm }} </p>
-                    </div>
-                  </a>
-                </li>
-              </ul>
-            </div>
-          </div>
-          <div class="content-box" style="width: 80%;">
-            <div class="flex-column">
-              <div class="content-box pd10" style="height: 50%;">
-                <div class="content-titleZone flex justy justify-between align-center" style="height: 45px">
-                  <p class="box-title">쿼리 작업</p>
-                  <button class="icon-btn" @click="executeQuery" title="실행">
-                    <svg-icon type="mdi" :path="playPath" :color="'#fbbe28'"></svg-icon>
-                  </button>
-                </div>
-                <div class="flex" style="height: calc(100% - 60px)">
-                  <textarea style="resize: none; width: 100%; height: 100%; padding: 10px;" v-model="jobItm.itm.query"></textarea>
-                </div>
-              </div>
-              <div class="content-box pd10" style="height: 50%;">
-                <ul class="tab-nav flex justify-start">
-                  <li @click="showTab('tab1')">
-                    <a href="#tab01" :class="{ activeTab: activeTab === 'tab1' }">작업결과</a>
-                  </li>
-                  <li @click="showTab('tab2')">
-                    <a href="#tab02" :class="{ activeTab: activeTab === 'tab2' }">작업log</a>
-                  </li>
-                </ul>
-                <div v-show="activeTab === 'tab1'" class="content-box" style="height: calc(100% - 45px); padding: 10px;">
-                  <div class="count-zone mb10" v-if="jobItm.dataTable.columnDatas.length > 0">
-                    <p> 총 <span>{{ jobItm.dataTable.totalRows }}</span>건 중 <span>{{ jobItm.dataTable.rowData.length }}</span>건 조회 </p>
-                  </div>
-                  <div style="height: calc(100% - 15px); overflow: auto;">
-                    <table class="list-table" v-if="jobItm.dataTable.columnDatas.length > 0">
-                      <thead>
-                        <tr>
-                          <th v-for="(itm, indx) in jobItm.dataTable.columnDatas" :key="indx" style="min-width: 150px !important">
-                            <label class="check-label">
-                              <span class="mr10">{{ itm.columnNm }}</span>
-                              <input type="checkbox" class="custom-checkbox" v-model="itm.pkAt" />
-                            </label>
-                          </th>
-                        </tr>
-                      </thead>
-                      <tbody v-if="jobItm.dataTable.rowData.length > 0">
-                        <tr v-for="(row, rows) in jobItm.dataTable.rowData" :key="rows">
-                          <td v-for="(itm, indx) in row" :key="indx" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;"> {{ itm }} </td>
-                        </tr>
-                      </tbody>
-                    </table>
-                  </div>
-                </div>
-                <div v-show="activeTab === 'tab2'" class=" content-box" style="height: calc(100% - 45px); padding: 10px;">
-                  <div style="height: calc(100% - 15px); overflow: auto;">
-                    <table class="list-table">
-                      <colgroup>
-                        <col width="10%" />
-                        <col width="60%" />
-                        <col width="20%" />
-                        <col width="10%" />
-                      </colgroup>
-                      <thead>
-                        <tr>
-                          <th>No</th>
-                          <th>접속시간</th>
-                          <th>접속결과</th>
-                          <th>접속내용</th>
-                        </tr>
-                      </thead>
-                      <tbody>
-                        <tr v-for="(itm, indx) in executeMessage" :key="indx">
-                          <td>{{ indx + 1 }}</td>
-                          <td>{{ itm.message }}</td>
-                          <td>{{ itm.time }}</td>
-                          <td>{{ itm.result }}</td>
-                        </tr>
-                      </tbody>
-                    </table>
-                  </div>
-                </div>
-              </div>
-            </div>
-          </div>
-        </div>
-      </template>
+      </div>
+      <div class="modal-end flex justify-end">
+        <button class="gray-btn small-btn" @click="closeModal">닫기</button>
+        <button class="green-btn small-btn" @click="addFiter">필터추가</button>
+      </div>
     </div>
-    <DBConSearch :openPopup="openSearchModal" @modalclose="dbConSearchOpen" @selectItm="selectDbcon" />
   </div>
 </template>
 <script>
-// icon용 svg import
-import SvgIcon from "@jamescoyle/vue-icon";
-import { mdiMagnify, mdiClose } from "@mdi/js";
-
 export default {
-  components: { SvgIcon },
-
+  name: "data-check",
+  props: {
+    openPopup: {
+      type: Boolean,
+      default: false,
+    },
+    item: {
+      type: Object,
+    },
+    saveNodeData: {
+      type: Function,
+    },
+  },
   data() {
     return {
-      // icon용 svg path
-      searchPath: mdiMagnify,
-      closePath: mdiClose,
+      comId:
+        "comId_" +
+        Math.random().toString(36).substring(2, 15) +
+        Math.random().toString(36).substring(2, 15),
+      isModalOpen: this.openPopup,
+      itm: this.item,
+    };
+  },
+  methods: {
+    // 모달 닫기
+    closeModal: function () {
+      this.isModalOpen = false;
+      this.$emit("closePopup", this.item);
+      this.$emit("closePopup2", this.item.id);
+    },
 
-      isModalOpen: true,
+    dataInsert: function (event, filter) {
+      for (var i = 0; i < this.item.front_dataTable.columnDatas.length; i++) {
+        if (
+          this.item.front_dataTable.columnDatas[i].orginlColumnNm ==
+          event.target.value
+        ) {
+          filter.coulmn_nm =
+            this.item.front_dataTable.columnDatas[i].orginlColumnNm;
+          filter.data_ty = this.item.front_dataTable.columnDatas[i].dataTy;
+        }
+      }
+    },
 
-      search: Object.assign({}, this.$getDefaultSerchVO()),
-      searchData: this.$getDefaultSerchItem(null, "string"),
-    }
-  }
-}
+    // 데이터 형반환
+    getDataType: function (index, coulmnNm) {
+      for (var i = 0; i < this.item.front_dataTable.columnDatas.length; i++) {
+        if (
+          this.item.front_dataTable.columnDatas[i].displyColumnNm == coulmnNm
+        ) {
+          return this.item.front_dataTable.columnDatas[i].dataTy;
+        }
+      }
+    },
+
+    // 필터추가
+    addFiter: function () {
+      const item = JSON.parse(
+        JSON.stringify(this.$getDefaultJobGroup().filterItem)
+      );
+
+      if (
+        this.item.front_dataTable.columnDatas == null ||
+        this.item.front_dataTable.columnDatas.length == 0
+      ) {
+        this.$showAlert("경고", "데이터 컬럼이 없습니다.");
+        return;
+      } else {
+        item.coulmn_nm =
+          this.item.front_dataTable.columnDatas[0].orginlColumnNm;
+        item.data_ty = this.item.front_dataTable.columnDatas[0].dataTy;
+        item.calc_ty = 1;
+        item.indx = this.item.itm.filterItems.length + 1;
+        item.cmpr_value = "";
+      }
+
+      this.item.itm.filterItems.push(item);
+    },
+    // 필터 삭제
+    deleteFilter: function (indx) {
+      this.item.itm.filterItems.splice(indx, 1);
+    },
+  },
+  watch: {
+    openPopup: function (v) {
+      this.isModalOpen = v;
+    },
+  },
+};
 </script>
(No newline at end of file)
client/views/component/connection/jobContainer.vue
--- client/views/component/connection/jobContainer.vue
+++ client/views/component/connection/jobContainer.vue
@@ -90,7 +90,7 @@
       type: Number,
       default: 100,
     },
-    dataEdit:{
+    dataEdit: {
       type: Boolean,
       default: false,
     }
@@ -119,26 +119,31 @@
         this.crrentJobGroup.jobItms[indx].front_dataTable =
           this.crrentJobGroup.jobItms[indx - 1].dataTable;
       }
-
       this.popupToggls[indx] = true;
     },
     closePopup: function (indx) {
       this.popupToggls[indx] = false;
-
     },
 
     // 기본 job 데이터
     getDefaultJobGroup: function () {
       var vm = this;
-      this.defaultJobGroup = JSON.parse(
-        JSON.stringify(this.$getDefaultJobGroup().jobGroup)
+      vm.defaultJobGroup = JSON.parse(
+        JSON.stringify(vm.$getDefaultJobGroup().jobGroup)
       );
-      this.defaultJobItm = JSON.parse(
-        JSON.stringify(this.$getDefaultJobGroup().jobItem)
+      vm.defaultJobItm = JSON.parse(
+        JSON.stringify(vm.$getDefaultJobGroup().jobItem)
       );
-      if (this.crrentJobGroup == null) {
-        this.crrentJobGroup = JSON.parse(JSON.stringify(this.defaultJobGroup));
+      if (vm.crrentJobGroup == null) {
+        vm.crrentJobGroup = JSON.parse(JSON.stringify(vm.defaultJobGroup));
       }
+      if (vm.crrentJobGroup.jobItms.length > 0) {
+        vm.popupToggls = [];
+        for (let i = 0; i < vm.crrentJobGroup.jobItms; i++) {
+          vm.popupToggls.push(false);
+        }
+      }
+      console.log("test: ", vm.popupToggls);
     },
 
     // 아이템 선택
@@ -223,12 +228,10 @@
       }
 
       this.popupToggls.push(false);
-
       this.crrentJobGroup.jobItms.push(newItm);
     },
 
     execModel: function () {
-
       let vm = this;
       axios({
         url: "/job/executeJob.json",
@@ -239,7 +242,6 @@
         data: vm.crrentJobGroup,
       })
         .then(function (response) {
-          
           vm.crrentJobGroup.dataTable = response.data.resultData.dataTable;
           vm.$emit('getDataTable', vm.crrentJobGroup.dataTable)
         })
Add a comment
List