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/package-lock.json b/package-lock.json index fae6f10eb..9db532de2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7738,7 +7738,7 @@ }, "node_modules/vue": { "version": "3.2.47", - "resolved": "https://npm.joolsoft.com/vue/-/vue-3.2.47.tgz", + // "resolved": "https://npm.joolsoft.com/vue/-/vue-3.2.47.tgz", "integrity": "sha512-60188y/9Dc9WVrAZeUVSDxRQOZ+z+y5nO2ts9jWXSTkMvayiWxCWOWtBQoYjLeccfXkiiPZWAHcV+WTPhkqJHQ==", "dependencies": { "@vue/compiler-dom": "3.2.47", diff --git a/package.json b/package.json index c333abd98..86d69369e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "dev": "vite", - "build": "run-p type-check build-only", + "build": "run-p build-only", "preview": "vite preview", "test:unit": "vitest --environment jsdom --root src/", "test:e2e": "start-server-and-test preview :4173 'cypress run --e2e'", diff --git a/src/api/02_organizational/api.treelist.ts b/src/api/02_organizational/api.treelist.ts index 40285ee7a..afb16eee1 100644 --- a/src/api/02_organizational/api.treelist.ts +++ b/src/api/02_organizational/api.treelist.ts @@ -10,6 +10,7 @@ import env from "../index"; const organizationPath = `${env.API_URI_ORG_SERVICE}/Organization/`; const postionMasterPath = `${env.API_URI_ORG_SERVICE}/PositionMaster`; const organizationPosition = `${env.API_URI_ORG_SERVICE}/OrganizationPosition/`; +const organizationEmployeePosition = `${env.API_URI_ORG_EMPLOYEE_SERVICE}/organization-employee/`; const report = `${env.API_URI}/report/organization/`; @@ -83,8 +84,7 @@ export default { getPositionNumberIdByOcId: (OcId: string) => `${postionMasterPath}/position-number/Oc/${OcId}`, - - /** - * api ประวัติการ publish - */ + organizationEmployeePosition: `${organizationEmployeePosition}`, + organizationEmployeePositionId: (id: string) => + `${organizationEmployeePosition}${id}`, }; diff --git a/src/api/05_placement/api.placement.ts b/src/api/05_placement/api.placement.ts index bd9f76127..5c51c3b35 100644 --- a/src/api/05_placement/api.placement.ts +++ b/src/api/05_placement/api.placement.ts @@ -1,6 +1,49 @@ -/** - * api บรรจุ แต่งตั้ง ย้าย โอน - */ import env from "../index"; +const placement = `${env.API_PLACEMENT_URI}/placement`; +const orgTree = `${env.API_URI_ORG_TREE}`; -export default {}; +export default { + MainDetail: (year: number) => `${placement}/exam/${year}`, + yearOptions: () => `${placement}/fiscal`, + personalList: (examId: string) => `${placement}/pass/${examId}`, + disclaimF: () => `${placement}/pass/disclaim`, + deferment: () => `${placement}/pass/deferment`, + getStatCard: (examId: string) => `${placement}/pass/stat/${examId}`, + getDatapersonal: (id: string) => `${placement}/personal/${id}`, + putProperty: (id: string) => `${placement}/property/${id}`, + orgTree: orgTree, + placementPass: () => `${placement}/pass`, + placementDefermentInfo: (id: string) => `${placement}/pass/deferment/${id}`, + placementDisclaimInfo: (id: string) => `${placement}/pass/disclaim/${id}`, + + //personal + placementPersonalId: (personalId: string) => + `${placement}/personal/${personalId}`, + + //personal + placementPropertyId: (personalId: string) => + `${placement}/property/${personalId}`, + + //information + placementInformationId: (personalId: string) => + `${placement}/information/${personalId}`, + + //address + placementAddressId: (personalId: string) => + `${placement}/address/${personalId}`, + + //family + placementFamilyId: (personalId: string) => + `${placement}/family/${personalId}`, + + //certificate + placementCertId: (personalId: string) => + `${placement}/certificate/${personalId}`, + placementCertDetailId: (personalId: string, certificateId: string) => + `${placement}/certificate/${personalId}/${certificateId}`, + + //education + placementEducationId: (id: string) => `${placement}/education/${id}`, + // position + placementPosition: () => `${placement}/position/use`, +}; diff --git a/src/api/index.ts b/src/api/index.ts index 3c47b1430..bf56f79fb 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -8,16 +8,22 @@ const env = ref(process.env.NODE_ENV || "development"); const config = ref({ development: { - // API_URI: "https://localhost:7006/api/v1", + // API_URI: "https://localhost:7260/api", 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_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", + 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", }, test: { @@ -30,9 +36,12 @@ const config = ref({ // API_URI: "https://localhost:5010", API_URI: `${window.location.protocol}//${window.location.host}/api/v1`, API_URI_ORG_SERVICE: `${window.location.protocol}//${window.location.host}/api/v1`, //ใช้ชั่วคราว + API_URI_ORG_EMPLOYEE_SERVICE: `${window.location.protocol}//${window.location.host}/api/v1`, //ใช้ชั่วคราว API_URI_PROFILE_SERVICE: `${window.location.protocol}//${window.location.host}/api/v1`, API_CANDIDATE_URI: `${window.location.protocol}//${window.location.host}/api/v1`, API_REPORT_URI: `${window.location.protocol}//${window.location.host}/api/v1`, + API_URI_ORG_TREE: + "https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230707_115124.json", MEET_URI: "meet.frappet.com", }, }); @@ -45,10 +54,17 @@ const API_REPORT_URI = ref(config.value[env.value].API_REPORT_URI); const API_URI_ORG_SERVICE = ref( config.value[env.value].API_URI_ORG_SERVICE ); +const API_URI_ORG_EMPLOYEE_SERVICE = ref( + config.value[env.value].API_URI_ORG_EMPLOYEE_SERVICE +); const MEET_URI = ref(config.value[env.value].MEET_URI); const API_URI_PROFILE_SERVICE = ref( config.value[env.value].API_URI_PROFILE_SERVICE ); +const API_PLACEMENT_URI = ref( + config.value[env.value].API_PLACEMENT_URI +); +const API_URI_ORG_TREE = ref(config.value[env.value].API_URI_ORG_TREE); export default { env: env.value, @@ -57,6 +73,9 @@ export default { API_CANDIDATE_URI: API_CANDIDATE_URI.value, API_REPORT_URI: API_REPORT_URI.value, API_URI_ORG_SERVICE: API_URI_ORG_SERVICE.value, + API_URI_ORG_EMPLOYEE_SERVICE: API_URI_ORG_EMPLOYEE_SERVICE.value, API_URI_PROFILE_SERVICE: API_URI_PROFILE_SERVICE.value, + API_PLACEMENT_URI: API_PLACEMENT_URI.value, + API_URI_ORG_TREE: API_URI_ORG_TREE.value, MEET_URI: MEET_URI.value, }; diff --git a/src/api/manage/api.organization.ts b/src/api/manage/api.organization.ts index 064a3d5e5..1138be215 100644 --- a/src/api/manage/api.organization.ts +++ b/src/api/manage/api.organization.ts @@ -3,6 +3,7 @@ * เมนูย่อย: ข้อมูลโครงสร้างหน่วยงาน */ import env from "../index"; +const organizationMain = `${env.API_URI}/metadata/main/`; const organization = `${env.API_URI}/metadata/organization/`; const organizationOrganization = `${env.API_URI}/metadata/organization-organization/`; const organizationShortName = `${env.API_URI}/metadata/organization-shortname/`; @@ -21,6 +22,7 @@ export default { /** * api จำนวนข้อมูลใน ระบบจัดการข้อมูลหลัก tab ย่อยแต่ละ tab */ + organizationMain: `${organizationMain}organization`, organization, countDashbordSubHistory: (type: number) => `${dashbord}${type}`, countDashbordHistory: `${dashbord}`, diff --git a/src/api/manage/api.positionEmployee.ts b/src/api/manage/api.positionEmployee.ts index abd2be21b..b919a14d0 100644 --- a/src/api/manage/api.positionEmployee.ts +++ b/src/api/manage/api.positionEmployee.ts @@ -3,6 +3,7 @@ * เมนูย่อย: ข้อมูลตำแหน่งของลูกจ้างกรุงเทพมหานคร */ import env from "../index"; +const positionEmployee = `${env.API_URI}/metadata/main/`; const positionEmployeePosition = `${env.API_URI}/metadata/position-employee-position/`; const positionEmployeePositionSide = `${env.API_URI}/metadata/position-employee-position-side/`; const positionEmployeeGroup = `${env.API_URI}/metadata/position-employee-group/`; @@ -11,6 +12,8 @@ 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/interface/request/main/main.ts b/src/interface/request/main/main.ts index 4a463859c..3552d4a07 100644 --- a/src/interface/request/main/main.ts +++ b/src/interface/request/main/main.ts @@ -88,11 +88,16 @@ const menuList = readonly([ }, { key: 3.5, + label: "ผังโครงสร้างลูกจ้าง", + path: "organizationalEmployee", + }, + { + key: 3.6, label: "จัดการบัญชี 2", path: "manageReport2", }, { - key: 3.6, + key: 3.7, label: "รายงานบัญชี", path: "organizationalReport", }, diff --git a/src/modules/01_metadata/components/positionEmployee/Group.vue b/src/modules/01_metadata/components/positionEmployee/Group.vue index 00c538863..7d8f70425 100644 --- a/src/modules/01_metadata/components/positionEmployee/Group.vue +++ b/src/modules/01_metadata/components/positionEmployee/Group.vue @@ -437,7 +437,7 @@ const fetchHistory = async () => { .catch((e) => { messageError($q, e); }) - .finally(async () => { + .finally(() => { hideLoader(); }); }; diff --git a/src/modules/02_organizational/router.ts b/src/modules/02_organizational/router.ts index 01e908726..cec042ef6 100644 --- a/src/modules/02_organizational/router.ts +++ b/src/modules/02_organizational/router.ts @@ -9,6 +9,8 @@ const MainStructChart = () => const MainOrgChart = () => import("@/modules/02_organizational/views/MainOrgChart.vue"); const MainTree = () => import("@/modules/02_organizational/views/MainTree.vue"); +const MainTreeEmployee = () => + import("@/modules/02_organizational/views/MainTreeEmployee.vue"); const MainReport = () => import("@/modules/02_organizational/views/MainReport.vue"); const ManageReport2 = () => @@ -60,6 +62,16 @@ export default [ Role: "organization", }, }, + { + path: "/organizational/employee", + name: "organizationalEmployee", + component: MainTreeEmployee, + meta: { + Auth: true, + Key: [9], + Role: "organization", + }, + }, { path: "/organizational/manage/report", name: "manageReport2", diff --git a/src/modules/02_organizational/views/MainTree.vue b/src/modules/02_organizational/views/MainTree.vue index c212bb6e0..9d5441556 100644 --- a/src/modules/02_organizational/views/MainTree.vue +++ b/src/modules/02_organizational/views/MainTree.vue @@ -2,102 +2,78 @@