diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b913841df..897f2e298 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -52,6 +52,7 @@ jobs: with: context: . platforms: linux/amd64 + file: docker/Dockerfile push: true tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest - name: Remote Deployment diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml new file mode 100644 index 000000000..8ba5b5947 --- /dev/null +++ b/.onedev-buildspec.yml @@ -0,0 +1,102 @@ +version: 37 +jobs: + - name: CI for UAT + steps: + - !CheckoutStep + name: checkout code + cloneCredential: !DefaultCredential {} + withLfs: false + withSubmodules: false + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !GenerateChecksumStep + name: generate package checksum + files: package-lock.json yarn.lock + targetFile: checksum + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !SetupCacheStep + name: set up npm cache + key: node_modules_@file:checksum@ + loadKeys: + - node_modules + paths: + - node_modules + uploadStrategy: UPLOAD_IF_NOT_HIT + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !SetBuildVersionStep + name: set build version + buildVersion: "@tag@" + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !CommandStep + name: build & test + runInContainer: true + image: node + interpreter: !DefaultInterpreter + commands: | + npm install + npm run build + useTTY: true + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !BuildImageStep + name: build docker image + dockerfile: ./docker/Dockerfile + output: !RegistryOutput + tags: hrms-git.chin.in.th/bma-hrms/hrms-mgt:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-mgt:latest + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + triggers: + - !TagCreateTrigger + tags: uat-* + branches: main + retryCondition: never + maxRetries: 3 + retryDelay: 30 + timeout: 14400 + - name: CI for PROD + steps: + - !CheckoutStep + name: checkout code + cloneCredential: !DefaultCredential {} + withLfs: false + withSubmodules: false + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !GenerateChecksumStep + name: generate package checksum + files: package-lock.json yarn.lock + targetFile: checksum + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !SetupCacheStep + name: set up npm cache + key: node_modules_@file:checksum@ + loadKeys: + - node_modules + paths: + - node_modules + uploadStrategy: UPLOAD_IF_NOT_HIT + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !SetBuildVersionStep + name: set build version + buildVersion: "@tag@" + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !CommandStep + name: build & test + runInContainer: true + image: node + interpreter: !DefaultInterpreter + commands: | + npm install + npm run build + useTTY: true + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !BuildImageStep + name: build docker image + dockerfile: ./docker/Dockerfile + output: !RegistryOutput + tags: hrms-git.bangkok.go.th/bma-hrms/hrms-mgt:@build_version@ hrms-git.bangkok.go.th/bma-hrms/hrms-mgt:latest + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + triggers: + - !TagCreateTrigger + tags: prod-* + branches: main + retryCondition: never + maxRetries: 3 + retryDelay: 30 + timeout: 14400 diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 6f2553eaf..000000000 --- a/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# docker build . -t docker.frappet.com/demo/fe:latest -FROM node:lts as build-stage -WORKDIR /app -COPY package*.json ./ -RUN npm install -COPY ./ . - -RUN npm run build - -FROM nginx as production-stage - -RUN mkdir /app -COPY --from=build-stage /app/dist /app -COPY nginx.conf /etc/nginx/nginx.conf - -COPY entrypoint.sh /usr/local/bin/entrypoint.sh -RUN chmod u+x /usr/local/bin/entrypoint.sh - - -ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] -CMD ["nginx", "-g", "daemon off;"] diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 000000000..009e2b7a6 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,19 @@ +# docker buildx build --platform=linux/amd64 -f docker/Dockerfile . -t hrms-git.chin.in.th/bma-hrms/hrms-mgt:0.1 + +# Build Stage +FROM node:latest as build-stage +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY ./ . +RUN npm run build + +# Production Stage +FROM nginx:stable-alpine AS production-stage +RUN mkdir /app +COPY --from=build-stage /app/dist /app +COPY docker/nginx.conf /etc/nginx/nginx.conf +COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod u+x /usr/local/bin/entrypoint.sh +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] +CMD ["nginx", "-g", "daemon off;"] diff --git a/entrypoint.sh b/docker/entrypoint.sh similarity index 76% rename from entrypoint.sh rename to docker/entrypoint.sh index 4e86264d7..02a61c45c 100644 --- a/entrypoint.sh +++ b/docker/entrypoint.sh @@ -14,10 +14,6 @@ do sed -i 's|VITE_S3CLUSTER_PUBLIC_URL|'${VITE_S3CLUSTER_PUBLIC_URL}'|g' $file sed -i 's|VITE_API_PUBLISH_URL|'${VITE_API_PUBLISH_URL}'|g' $file sed -i 's|VITE_API_REPORT_URL|'${VITE_API_REPORT_URL}'|g' $file - sed -i 's|VITE_URL_KEYCLOAK|'${VITE_URL_KEYCLOAK}'|g' $file - sed -i 's|VITE_REALM_KEYCLOAK|'${VITE_REALM_KEYCLOAK}'|g' $file - sed -i 's|VITE_CLIENTID_KEYCLOAK|'${VITE_CLIENTID_KEYCLOAK}'|g' $file - sed -i 's|VITE_CLIENTSECRET_KEYCLOAK|'${VITE_CLIENTSECRET_KEYCLOAK}'|g' $file sed -i 's|VITE_MANUAL_URL|'${VITE_MANUAL_URL}'|g' $file sed -i 's|VITE_URL_SSO|'${VITE_URL_SSO}'|g' $file diff --git a/nginx.conf b/docker/nginx.conf similarity index 100% rename from nginx.conf rename to docker/nginx.conf diff --git a/src/modules/01_masterdata/views/indicatorByRole.vue b/src/modules/01_masterdata/views/indicatorByRole.vue index cf8db9931..f141a0ec5 100644 --- a/src/modules/01_masterdata/views/indicatorByRole.vue +++ b/src/modules/01_masterdata/views/indicatorByRole.vue @@ -404,7 +404,6 @@ onMounted(async () => { v-model="formFilter.keyword" ref="filterRef" outlined - debounce="300" placeholder="ค้นหา" @keyup.enter="(formFilter.page = 1), fetchList()" > diff --git a/src/modules/02_organization/components/DialogMovePos.vue b/src/modules/02_organization/components/DialogMovePos.vue index 3c3062858..2a9a3f992 100644 --- a/src/modules/02_organization/components/DialogMovePos.vue +++ b/src/modules/02_organization/components/DialogMovePos.vue @@ -67,6 +67,7 @@ const props = defineProps({ type: Object, required: true, }, + fetchDataTable: Function, }); const title = ref("ย้ายตำแหน่งจากหน่วยงาน/ส่วนราชการปัจจุบัน"); //title Dialog @@ -93,14 +94,6 @@ const isDisable = computed(() => { } else return false; }); -/** - * function รีเช็ด filter - */ -function resetFilter() { - filterTree.value = ""; - filterRef.value.focus(); -} - /** * function เลือกข้อมูลหน่วยงาน */ @@ -157,6 +150,12 @@ function updatePagination(newPagination: NewPagination) { reqMaster.value.page = 1; } +function onSearchData() { + reqMaster.value.page = 1; + reqMaster.value.keyword = filterTable.value; + props.fetchDataTable?.(store.treeId, store.level, false); +} + /** * ดูการเปลี่ยนแปลง modal เมื่อเป็น true */ @@ -165,6 +164,7 @@ watch( () => { reqMaster.value.page = 1; filterTree.value = ""; + filterTable.value = ""; pagination.value.rowsPerPage = reqMaster.value.pageSize; title.value = `ย้ายตำแหน่งจากหน่วยงาน/ส่วนราชการปัจจุบัน ${props.mainTree.orgName}`; @@ -190,7 +190,10 @@ watch( > - + @@ -206,7 +209,13 @@ watch(
- + @@ -214,71 +223,72 @@ watch(
- - - + + + { - posMaster.value = []; const dataMain: PosMaster[] = []; totalPage.value = Math.ceil(res.data.result.total / reqMaster.pageSize); res.data.result.data.forEach((e: PosMaster) => { diff --git a/src/modules/02_organization/components/TableMain.vue b/src/modules/02_organization/components/TableMain.vue index fa12946eb..db853c03e 100644 --- a/src/modules/02_organization/components/TableMain.vue +++ b/src/modules/02_organization/components/TableMain.vue @@ -528,6 +528,10 @@ watch( if (!modalDialogMMove.value) { pagination.value.page = 1; pagination.value.rowsPerPage = reqMaster.value.pageSize; + + if (posMaster.value.length === 0) { + props.fetchDataTable?.(reqMaster.value.id, reqMaster.value.type, false); + } } } ); @@ -616,7 +620,7 @@ watch( @keydown.enter.prevent="props.filterKeyword(reqMaster.keyword)" > @@ -936,6 +940,7 @@ watch( :type="typeMove" :rowId="rowId" :mainTree="props.mainTree ? props.mainTree : []" + :fetchDataTable="props.fetchDataTable" /> diff --git a/src/modules/05_placement/components/probation/DialogOrder.vue b/src/modules/05_placement/components/probation/DialogOrder.vue index 5af556315..d3c0e15e0 100644 --- a/src/modules/05_placement/components/probation/DialogOrder.vue +++ b/src/modules/05_placement/components/probation/DialogOrder.vue @@ -295,7 +295,7 @@ watch( borderless outlined dense - debounce="300" + v-model="filter" placeholder="ค้นหา" style="width: 200px; max-width: auto" diff --git a/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue b/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue index 03fd28b38..6129a8d58 100644 --- a/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue +++ b/src/modules/05_placement/components/probation/FormAppoint/FormAppoint.vue @@ -657,7 +657,7 @@ onMounted(async () => { v-model="filterKeyword" ref="filterRef" outlined - debounce="300" + placeholder="ค้นหา" @keydown.enter.prevent="(pagination.page = 1), getPerson()" > diff --git a/src/modules/05_placement/components/probation/MainProbation.vue b/src/modules/05_placement/components/probation/MainProbation.vue index e0ae168f0..698881c9f 100644 --- a/src/modules/05_placement/components/probation/MainProbation.vue +++ b/src/modules/05_placement/components/probation/MainProbation.vue @@ -701,7 +701,7 @@ onMounted(async () => { v-model="formProbation.keyword" ref="filterRef2" outlined - debounce="300" + placeholder="ค้นหา" @keydown.enter.prevent="filterKeyword2Fn(formProbation.page)" > diff --git a/src/modules/05_placement/views/02_transferMain.vue b/src/modules/05_placement/views/02_transferMain.vue index 62b8824a1..84e854bb5 100644 --- a/src/modules/05_placement/views/02_transferMain.vue +++ b/src/modules/05_placement/views/02_transferMain.vue @@ -233,7 +233,6 @@ const filterAndApply = () => { v-model="filter" ref="filterRef" outlined - debounce="300" placeholder="ค้นหา" @keyup.enter="filterAndApply" > diff --git a/src/modules/07_insignia/components/2_Manage/Tab1.vue b/src/modules/07_insignia/components/2_Manage/Tab1.vue index 02a5a7011..4bec1784b 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab1.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab1.vue @@ -1267,7 +1267,6 @@ onMounted(async () => { borderless outlined dense - debounce="300" placeholder="ค้นหา" v-model="formFilter.searchKeyword" @keydown.enter="(formFilter.page = 1), fecthlistperson()" diff --git a/src/modules/08_registryEmployee/components/DialogAddEmployee.vue b/src/modules/08_registryEmployee/components/DialogAddEmployee.vue index c3b3b0a01..1da8f2be4 100644 --- a/src/modules/08_registryEmployee/components/DialogAddEmployee.vue +++ b/src/modules/08_registryEmployee/components/DialogAddEmployee.vue @@ -322,6 +322,8 @@ watch( lazy-rules emit-value map-options + hide-selected + fill-input hide-bottom-space input-debounce="0" option-label="name" @@ -342,6 +344,8 @@ watch( outlined clearable use-input + hide-selected + fill-input lazy-rules emit-value map-options @@ -449,6 +453,8 @@ watch( dense outlined use-input + hide-selected + fill-input clearable lazy-rules emit-value @@ -471,6 +477,8 @@ watch( dense outlined use-input + hide-selected + fill-input clearable lazy-rules emit-value @@ -515,6 +523,8 @@ watch( dense outlined use-input + hide-selected + fill-input clearable lazy-rules emit-value @@ -537,6 +547,8 @@ watch( dense outlined use-input + hide-selected + fill-input clearable lazy-rules emit-value diff --git a/src/modules/08_registryEmployee/views/Main.vue b/src/modules/08_registryEmployee/views/Main.vue index f2c3cec08..50d5ca07e 100644 --- a/src/modules/08_registryEmployee/views/Main.vue +++ b/src/modules/08_registryEmployee/views/Main.vue @@ -201,7 +201,12 @@ const visibleColumns = ref([ async function fetchList() { showLoader(); await http - .get(config.API.registryNew("-temp"), { params: queryParams }) + .get(config.API.registryNew("-temp"), { + params: { + ...queryParams, + searchKeyword: queryParams.searchKeyword.trim(), + }, + }) .then(async (res) => { rows.value = await res.data.result.data; maxPage.value = Math.ceil(res.data.result.total / queryParams.pageSize); @@ -343,11 +348,10 @@ onMounted(async () => { placeholder="ค้นหา" style="max-width: 200px" class="q-ml-sm" - clearable @keydown.enter.prevent="(queryParams.page = 1), fetchList()" > diff --git a/src/modules/09_leave/components/02_WorkList/ToolBarDate.vue b/src/modules/09_leave/components/02_WorkList/ToolBarDate.vue index f6182a963..35d95580c 100644 --- a/src/modules/09_leave/components/02_WorkList/ToolBarDate.vue +++ b/src/modules/09_leave/components/02_WorkList/ToolBarDate.vue @@ -87,7 +87,6 @@ function filterFn() { outlined v-model="keyword" label="ค้นหา" - debounce="300" @keydown.enter.prevent="filterFn" >