diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f4165e139..3ea8a995e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,72 +15,72 @@ env: COMPOSE_PATH: /home/frappet/docker/bma-ehr TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0 jobs: - # # act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=test-v1 -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd - # release-test: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # # skip Set up QEMU because it fail on act and container - # # Gen Version try to get version from tag or inut - # - name: Gen Version - # id: gen_ver - # run: | - # if [[ $GITHUB_REF == 'refs/tags/'* ]]; then - # IMAGE_VER='${GITHUB_REF/refs\/tags\//}' - # else - # IMAGE_VER=${{ github.event.inputs.IMAGE_VER }} - # fi - # if [[ $IMAGE_VER == '' ]]; then - # IMAGE_VER='test-vBeta' - # fi - # echo '::set-output name=image_ver::'$IMAGE_VER - # - name: Check Version - # run: | - # echo $GITHUB_REF - # echo ${{ steps.gen_ver.outputs.image_ver }} + # act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=test-v1 -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd + release-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # skip Set up QEMU because it fail on act and container + # Gen Version try to get version from tag or inut + - name: Gen Version + id: gen_ver + run: | + if [[ $GITHUB_REF == 'refs/tags/'* ]]; then + IMAGE_VER='${GITHUB_REF/refs\/tags\//}' + else + IMAGE_VER=${{ github.event.inputs.IMAGE_VER }} + fi + if [[ $IMAGE_VER == '' ]]; then + IMAGE_VER='test-vBeta' + fi + echo '::set-output name=image_ver::'$IMAGE_VER + - name: Check Version + run: | + echo $GITHUB_REF + echo ${{ steps.gen_ver.outputs.image_ver }} - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v2 - # - name: Login in to registry - # uses: docker/login-action@v2 - # with: - # registry: ${{env.REGISTRY}} - # username: ${{secrets.DOCKER_USER}} - # password: ${{secrets.DOCKER_PASS}} - # - name: Build and push docker image - # uses: docker/build-push-action@v3 - # with: - # context: . - # platforms: linux/amd64 - # push: true - # tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest - # - name: Remote Deployment - # uses: appleboy/ssh-action@v0.1.8 - # with: - # host: ${{env.DEPLOY_HOST}} - # username: frappet - # password: ${{ secrets.SSH_PASSWORD }} - # port: 22 - # script: | - # cd "${{env.COMPOSE_PATH}}" - # docker-compose pull - # docker-compose up -d - # echo "${{ steps.gen_ver.outputs.image_ver }}"> success - # - uses: snow-actions/line-notify@v1.1.0 - # if: success() - # with: - # access_token: ${{ env.TOKEN_LINE }} - # message: | - # -Success✅✅✅ - # Image: ${{env.IMAGE_NAME}} - # Version: ${{ github.event.inputs.IMAGE_VER }} - # By: ${{secrets.DOCKER_USER}} - # - uses: snow-actions/line-notify@v1.1.0 - # if: failure() - # with: - # access_token: ${{ env.TOKEN_LINE }} - # message: | - # -Failure❌❌❌ - # Image: ${{env.IMAGE_NAME}} - # Version: ${{ github.event.inputs.IMAGE_VER }} - # By: ${{secrets.DOCKER_USER}} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login in to registry + uses: docker/login-action@v2 + with: + registry: ${{env.REGISTRY}} + username: ${{secrets.DOCKER_USER}} + password: ${{secrets.DOCKER_PASS}} + - name: Build and push docker image + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64 + push: true + tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest + - name: Remote Deployment + uses: appleboy/ssh-action@v0.1.8 + with: + host: ${{env.DEPLOY_HOST}} + username: frappet + password: ${{ secrets.SSH_PASSWORD }} + port: 22 + script: | + cd "${{env.COMPOSE_PATH}}" + docker-compose pull + docker-compose up -d + echo "${{ steps.gen_ver.outputs.image_ver }}"> success + - uses: snow-actions/line-notify@v1.1.0 + if: success() + with: + access_token: ${{ env.TOKEN_LINE }} + message: | + -Success✅✅✅ + Image: ${{env.IMAGE_NAME}} + Version: ${{ github.event.inputs.IMAGE_VER }} + By: ${{secrets.DOCKER_USER}} + - uses: snow-actions/line-notify@v1.1.0 + if: failure() + with: + access_token: ${{ env.TOKEN_LINE }} + message: | + -Failure❌❌❌ + Image: ${{env.IMAGE_NAME}} + Version: ${{ github.event.inputs.IMAGE_VER }} + By: ${{secrets.DOCKER_USER}} diff --git a/src/api/05_placement/api.placement.ts b/src/api/05_placement/api.placement.ts index d655ad806..00a562918 100644 --- a/src/api/05_placement/api.placement.ts +++ b/src/api/05_placement/api.placement.ts @@ -1,12 +1,11 @@ import env from "../index"; -// const placement = `${env.API_PLACEMENT_URI}/placement`; -const placement = `${env.API_URI}/placement`; +const placement = `${env.API_PLACEMENT_URI}/placement`; const orgTree = `${env.API_URI_ORG_TREE}`; export default { MainDetail: (year: number) => `${placement}/exam/${year}`, yearOptions: () => `${placement}/fiscal`, - redirectToPage: (examId: string) => `${placement}/pass/${examId}`, + personalList: (examId: string) => `${placement}/pass/${examId}`, disclaimF: () => `${placement}/pass/disclaim`, deferment: () => `${placement}/pass/deferment`, getStatCard: (examId: string) => `${placement}/pass/stat/${examId}`, diff --git a/src/api/index.ts b/src/api/index.ts index e02e135df..bf56f79fb 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -12,15 +12,16 @@ const config = ref({ API_URI: "https://bma-ehr.frappet.synology.me/api/v1", // API_URI_ORG_SERVICE: "https://localhost:7056/api/v1", //ใช้ชั่วคราว API_URI_ORG_SERVICE: "https://bma-ehr.frappet.synology.me/api/v1", //ใช้ชั่วคราว - API_URI_ORG_EMPLOYEE_SERVICE: "https://localhost:7208/api/v1", //ใช้ชั่วคราว - // API_URI_ORG_EMPLOYEE_SERVICE: "https://bma-ehr.frappet.synology.me/api/v1", //ใช้ชั่วคราว + // API_URI_ORG_EMPLOYEE_SERVICE: "https://localhost:7208/api/v1", //ใช้ชั่วคราว + API_URI_ORG_EMPLOYEE_SERVICE: "https://bma-ehr.frappet.synology.me/api/v1", //ใช้ชั่วคราว // API_URI_PROFILE_SERVICE: "https://localhost:7159/api/v1", API_URI_PROFILE_SERVICE: "https://bma-ehr.frappet.synology.me/api/v1", //ใช้ชั่วคราว // API_CANDIDATE_URI: "https://localhost:7007/api/v1", API_CANDIDATE_URI: "https://bma-ehr.frappet.synology.me/api/v1", // API_REPORT_URI: "https://localhost:7187/api/v1", API_REPORT_URI: "https://bma-ehr.frappet.synology.me/api/v1", - API_PLACEMENT_URI: "https://localhost:7260/api/v1", + // API_PLACEMENT_URI: "https://localhost:7260/api", + API_PLACEMENT_URI: "https://bma-ehr.frappet.synology.me/api/v1", API_URI_ORG_TREE: "https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230712_172702.json", MEET_URI: "meet.frappet.com", diff --git a/src/api/manage/api.positionEmployee.ts b/src/api/manage/api.positionEmployee.ts index 456594378..b919a14d0 100644 --- a/src/api/manage/api.positionEmployee.ts +++ b/src/api/manage/api.positionEmployee.ts @@ -12,6 +12,7 @@ const positionEmployeeLevel = `${env.API_URI}/metadata/position-employee-level/` const positionEmployeeStatus = `${env.API_URI}/metadata/position-employee-status/`; export default { + positionEmployeeStatus: `${positionEmployeeStatus}`, positionEmployee: `${positionEmployee}positionEmployee`, /** * api ตำแหน่ง diff --git a/src/modules/05_placement/components/Main.vue b/src/modules/05_placement/components/Main.vue index a1c513c89..940adfbc4 100644 --- a/src/modules/05_placement/components/Main.vue +++ b/src/modules/05_placement/components/Main.vue @@ -128,14 +128,15 @@ const fetchPlacementData = async (val: number) => { rows.value = []; http .get(config.API.MainDetail(val)) - .then((res) => { + .then(async (res) => { dataPlacement.value = res.data.result; DataStore.DataMainOrig = dataPlacement.value; console.log(DataStore.DataMainOrig); // rows.value = DataStore.DataMainOrig; - DataStore.DataMainOrig.map((e: any) => { - rows.value.push({ + const dataArr: any = []; + await DataStore.DataMainOrig.map((e: any) => { + dataArr.push({ id: e.id, examRound: e.examRound, examOrder: e.examOrder, @@ -149,6 +150,8 @@ const fetchPlacementData = async (val: number) => { }); }); + rows.value = dataArr; + examTypeFilter(); examTimeFilter(); expiredAccountFilter(); @@ -160,6 +163,7 @@ const fetchPlacementData = async (val: number) => { hideLoader(); }); }; + const fetchYearOptions = async () => { http .get(config.API.yearOptions()) @@ -185,7 +189,7 @@ const filterYear = () => { // ดูรายการสอบแข่งขัน หน้าต่อไป const redirectToPage = (examId?: number) => { - router.push(`/placement/pass/${examId}`); + router.push(`/placement/personal-list/${examId}`); }; //-------------------|ค้นหาในตาราง|-----------------// @@ -243,9 +247,10 @@ const searchFilterTable = async () => { examType.value, expiredAccount.value ); - // rows.value = DataStore.DataMainUpdate; - DataStore.DataMainUpdate.map((e: any) => { - rows.value.push({ + + const dataArr: any = []; + await DataStore.DataMainUpdate.map((e: any) => { + dataArr.push({ id: e.id, examRound: e.examRound, examOrder: e.examOrder, @@ -258,6 +263,7 @@ const searchFilterTable = async () => { numberOfCandidates: e.numberOfCandidates, }); }); + rows.value = dataArr; } }; @@ -278,7 +284,7 @@ const expiredAccountFilter = async () => { const paging = ref(true); const pagination = ref({ sortBy: "accountStartDate", - descending: false, + descending: true, page: 1, rowsPerPage: 10, }); diff --git a/src/modules/05_placement/components/pass/Detail.vue b/src/modules/05_placement/components/PersonalList/Detail.vue similarity index 52% rename from src/modules/05_placement/components/pass/Detail.vue rename to src/modules/05_placement/components/PersonalList/Detail.vue index 34ab8931f..d72880f1c 100644 --- a/src/modules/05_placement/components/pass/Detail.vue +++ b/src/modules/05_placement/components/PersonalList/Detail.vue @@ -1,8 +1,8 @@ diff --git a/src/modules/05_placement/components/pass/DialogFooter.vue b/src/modules/05_placement/components/PersonalList/DialogFooter.vue similarity index 100% rename from src/modules/05_placement/components/pass/DialogFooter.vue rename to src/modules/05_placement/components/PersonalList/DialogFooter.vue diff --git a/src/modules/05_placement/components/pass/DialogHeader.vue b/src/modules/05_placement/components/PersonalList/DialogHeader.vue similarity index 100% rename from src/modules/05_placement/components/pass/DialogHeader.vue rename to src/modules/05_placement/components/PersonalList/DialogHeader.vue diff --git a/src/modules/05_placement/components/pass/OrgTree.vue b/src/modules/05_placement/components/PersonalList/OrgTree.vue similarity index 99% rename from src/modules/05_placement/components/pass/OrgTree.vue rename to src/modules/05_placement/components/PersonalList/OrgTree.vue index 7aba3b1ec..8014155d9 100644 --- a/src/modules/05_placement/components/pass/OrgTree.vue +++ b/src/modules/05_placement/components/PersonalList/OrgTree.vue @@ -1,8 +1,8 @@