From 950b2421c23251e2449df253ed5c4ccfd2914e45 Mon Sep 17 00:00:00 2001 From: keymasroy Date: Wed, 22 Dec 2021 00:47:03 +0900 Subject: [PATCH] =?UTF-8?q?=EC=83=98=ED=94=8C=20=EB=A9=94=EB=89=B4=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sample-menu/code-crud/input-form.vue | 195 ++++++++++++++++++ .../sample-menu/code-crud/master-grid.vue | 121 +++++++++++ .../sample-menu/code-crud/sub-grid.vue | 58 ++++++ front/bo/client/pages/sample/index.vue | 15 -- front/bo/client/pages/samples/code-crud.vue | 81 ++++++++ .../bo/client/services/sample-crud-service.ts | 139 +++++++++++++ 6 files changed, 594 insertions(+), 15 deletions(-) create mode 100644 front/bo/client/components/sample-menu/code-crud/input-form.vue create mode 100644 front/bo/client/components/sample-menu/code-crud/master-grid.vue create mode 100644 front/bo/client/components/sample-menu/code-crud/sub-grid.vue delete mode 100644 front/bo/client/pages/sample/index.vue create mode 100644 front/bo/client/pages/samples/code-crud.vue create mode 100644 front/bo/client/services/sample-crud-service.ts diff --git a/front/bo/client/components/sample-menu/code-crud/input-form.vue b/front/bo/client/components/sample-menu/code-crud/input-form.vue new file mode 100644 index 0000000..cb1ddb5 --- /dev/null +++ b/front/bo/client/components/sample-menu/code-crud/input-form.vue @@ -0,0 +1,195 @@ + + + diff --git a/front/bo/client/components/sample-menu/code-crud/master-grid.vue b/front/bo/client/components/sample-menu/code-crud/master-grid.vue new file mode 100644 index 0000000..f5b57de --- /dev/null +++ b/front/bo/client/components/sample-menu/code-crud/master-grid.vue @@ -0,0 +1,121 @@ + + + diff --git a/front/bo/client/components/sample-menu/code-crud/sub-grid.vue b/front/bo/client/components/sample-menu/code-crud/sub-grid.vue new file mode 100644 index 0000000..8e02de5 --- /dev/null +++ b/front/bo/client/components/sample-menu/code-crud/sub-grid.vue @@ -0,0 +1,58 @@ + + + diff --git a/front/bo/client/pages/sample/index.vue b/front/bo/client/pages/sample/index.vue deleted file mode 100644 index febdb2c..0000000 --- a/front/bo/client/pages/sample/index.vue +++ /dev/null @@ -1,15 +0,0 @@ - - diff --git a/front/bo/client/pages/samples/code-crud.vue b/front/bo/client/pages/samples/code-crud.vue new file mode 100644 index 0000000..7ba79a8 --- /dev/null +++ b/front/bo/client/pages/samples/code-crud.vue @@ -0,0 +1,81 @@ + + + diff --git a/front/bo/client/services/sample-crud-service.ts b/front/bo/client/services/sample-crud-service.ts new file mode 100644 index 0000000..ca8692e --- /dev/null +++ b/front/bo/client/services/sample-crud-service.ts @@ -0,0 +1,139 @@ +import { BaseModel } from '@ustra/data/src/models/base-models' +import { ApiResponse } from '@ustra/data/src/models/api-model' +import { PaginationRequest } from '@ustra/data/src/models/pagination-model' +import { UtraService } from '@ustra/nuxt/src/services/ustra-service' +import { HttpMethod } from '@ustra/core/src/server/http/const' + +/** + * crud sample 모델 + */ +export interface SampleCrudModel extends BaseModel { + /** + * 그룹 코드 + */ + grpCd?: string + + /** + * 상세 코드 + */ + dtlCd?: string + + /** + * 코드 명 + */ + cdNm?: string + + /** + * 코드 상세 + */ + cdDesc?: string + + /** + * 사용 여부 + */ + useYn?: string + + /** + * 비고 + */ + rmk?: string +} + +export class SampleCrudService extends UtraService { + /** + * 코드 그룹 목록 조회 + */ + async getGroups() { + return ( + await this.$ustra.api.call>({ + url: '/api/sample/crud-code/groups', + method: HttpMethod.GET, + }) + ).data.body + } + + /** + * 코드 목록 조회 + * @param pagination 페이징 요청 정보 + * @param grpCd 그룹 코드 + */ + async getCodes(pagination: PaginationRequest, grpCd: string = null) { + const url = this.$ustra.api + .urlBuilder('/api/sample/crud-code') + .add('criteria', { + paginationRequest: pagination, + grpCd, + }) + .build() + + return ( + await this.$ustra.api.call>({ + url, + method: HttpMethod.GET, + }) + ).data + } + + /** + * 코드 상세 정보 조회 + * @param grpCd 그룹 코드 + * @param dtlCd 상세 코드 + */ + async getCode(grpCd: string, dtlCd: string) { + return ( + await this.$ustra.api.call>({ + url: `/api/sample/crud-code/${grpCd}/${dtlCd}`, + method: HttpMethod.GET, + }) + ).data.body + } + + /** + * 코드 추가 + * @param data 입력 데이터 + */ + async add(data: SampleCrudModel) { + return ( + await this.$ustra.api.call>({ + url: '/api/sample/crud-code', + method: HttpMethod.POST, + data, + }) + ).data.body + } + + /** + * 코드 수정 + * @param data 수정 데이터 + */ + async edit(data: SampleCrudModel) { + return ( + await this.$ustra.api.call>({ + url: '/api/sample/crud-code', + method: HttpMethod.PUT, + data, + }) + ).data.body + } + + /** + * 코드 삭제 + * @param grpCd 그룹 코드 + * @param dtlCd 상세 코드 + */ + async remove(grpCd: string, dtlCd: string) { + return ( + await this.$ustra.api.call>({ + url: '/api/sample/crud-code', + method: HttpMethod.DELETE, + data: { + grpCd, + dtlCd, + }, + }) + ).data.body + } +} + +export const sampleCrudService = new SampleCrudService() +export default sampleCrudService