diff --git a/.env.production b/.env.production index e85ca8e..34cdec1 100644 --- a/.env.production +++ b/.env.production @@ -2,4 +2,5 @@ VITE_API_URI_CONFIG=VITE_API_URI_CONFIG VITE_API_PUBLISH_URL=VITE_API_PUBLISH_URL VITE_MANUAL_URL=VITE_MANUAL_URL VITE_URL_SSO=VITE_URL_SSO +VITE_URL_LANDING=VITE_URL_LANDING VITE_API_REPORT_URL=VITE_API_REPORT_URL \ No newline at end of file diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..c4746ff --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,50 @@ +# /.forgejo/workflows/build.yml +name: Build + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+*" + workflow_dispatch: + +env: + REGISTRY: ${{ vars.CONTAINER_REGISTRY }} + REGISTRY_USERNAME: ${{ vars.CONTAINER_REGISTRY_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} + CONTAINER_IMAGE_NAME: ${{ vars.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_IMAGE_OWNER }}/${{ vars.CONTAINER_IMAGE_NAME }} + IMAGE_VERSION: build + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + config-inline: | + [registry."${{ env.REGISTRY }}"] + ca=["/etc/ssl/certs/ca-certificates.crt"] + - name: Tag Version + run: | + if [[ "${{ github.event_name }}" == "push" ]]; then + echo "IMAGE_VERSION=${{ github.ref_name }}" | sed 's/v//g' >> $GITHUB_ENV + else + echo "IMAGE_VERSION=${{ env.IMAGE_VERSION }}-${{ github.run_number }}" >> $GITHUB_ENV + fi + - name: Login in to registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ env.REGISTRY_USERNAME }} + password: ${{ env.REGISTRY_PASSWORD }} + - name: Build and push docker image + uses: docker/build-push-action@v3 + with: + platforms: linux/amd64 + context: . + file: ./docker/Dockerfile + tags: ${{ env.CONTAINER_IMAGE_NAME }}:latest,${{ env.CONTAINER_IMAGE_NAME }}:${{ env.IMAGE_VERSION }} + push: true \ No newline at end of file diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml new file mode 100644 index 0000000..900559d --- /dev/null +++ b/.forgejo/workflows/deploy.yml @@ -0,0 +1,29 @@ +name: Build + +on: + workflow_dispatch: + inputs: + version: + description: "Version to deploy" + type: string + required: false + default: "latest" + +env: + IMAGE_VERSION: build + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Remote Deploy + uses: appleboy/ssh-action@v1.2.1 + with: + host: ${{ vars.SSH_DEPLOY_HOST }} + port: ${{ vars.SSH_DEPLOY_PORT }} + username: ${{ secrets.SSH_DEPLOY_USER }} + password: ${{ secrets.SSH_DEPLOY_PASSWORD }} + script: | + cd ~/repo + ./replace-env.sh APP_USER "${{ inputs.version }}" + ./deploy.sh hrms-user diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index ae50dc4..e41d13f 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -12,6 +12,7 @@ do sed -i 's|VITE_API_PUBLISH_URL|'${VITE_API_PUBLISH_URL}'|g' $file sed -i 's|VITE_MANUAL_URL|'${VITE_MANUAL_URL}'|g' $file sed -i 's|VITE_URL_SSO|'${VITE_URL_SSO}'|g' $file + sed -i 's|VITE_URL_LANDING|'${VITE_URL_LANDING}'|g' $file sed -i 's|VITE_API_REPORT_URL|'${VITE_API_REPORT_URL}'|g' $file diff --git a/package-lock.json b/package-lock.json index 91582e9..c62a2dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,8 +19,10 @@ "@tato30/vue-pdf": "^1.5.1", "@vuepic/vue-datepicker": "^3.6.3", "bma-org-chart": "^0.0.7", + "dom-to-image-more": "^3.6.0", "keycloak-js": "^20.0.2", "moment": "^2.29.4", + "pdf-lib": "^1.17.1", "pinia": "^2.0.29", "quasar": "^2.11.1", "socket.io-client": "^4.7.4", @@ -1143,6 +1145,24 @@ "node": ">= 8" } }, + "node_modules/@pdf-lib/standard-fonts": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@pdf-lib/standard-fonts/-/standard-fonts-1.0.0.tgz", + "integrity": "sha512-hU30BK9IUN/su0Mn9VdlVKsWBS6GyhVfqjwl1FjZN4TxP6cCw0jP2w7V3Hf5uX7M0AZJ16vey9yE0ny7Sa59ZA==", + "license": "MIT", + "dependencies": { + "pako": "^1.0.6" + } + }, + "node_modules/@pdf-lib/upng": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@pdf-lib/upng/-/upng-1.0.1.tgz", + "integrity": "sha512-dQK2FUMQtowVP00mtIksrlZhdFXQZPC+taih1q4CvPZ5vqdxR/LKBaFg0oAfzd1GlHZXXSPdQfzQnt+ViGvEIQ==", + "license": "MIT", + "dependencies": { + "pako": "^1.0.10" + } + }, "node_modules/@quasar/extras": { "version": "1.15.8", "license": "MIT", @@ -3006,6 +3026,12 @@ "node": ">=6.0.0" } }, + "node_modules/dom-to-image-more": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/dom-to-image-more/-/dom-to-image-more-3.6.0.tgz", + "integrity": "sha512-0BB0M9gRRP7znKBNLRAvNyWnkDIzSgMSDcS7WdPDzPnWhW2YJqxUR/dCHiJ2HdCV3K2rVky5Vba8UF31mvrCuQ==", + "license": "MIT" + }, "node_modules/domexception": { "version": "4.0.0", "dev": true, @@ -5871,6 +5897,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "license": "(MIT AND Zlib)" + }, "node_modules/panzoom": { "version": "9.4.3", "resolved": "https://registry.npmjs.org/panzoom/-/panzoom-9.4.3.tgz", @@ -5980,6 +6012,24 @@ "through": "~2.3" } }, + "node_modules/pdf-lib": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/pdf-lib/-/pdf-lib-1.17.1.tgz", + "integrity": "sha512-V/mpyJAoTsN4cnP31vc0wfNA1+p20evqqnap0KLoRUN0Yk/p3wN52DOEsL4oBFcLdb76hlpKPtzJIgo67j/XLw==", + "license": "MIT", + "dependencies": { + "@pdf-lib/standard-fonts": "^1.0.0", + "@pdf-lib/upng": "^1.0.1", + "pako": "^1.0.11", + "tslib": "^1.11.1" + } + }, + "node_modules/pdf-lib/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD" + }, "node_modules/pdfjs-dist": { "version": "3.7.107", "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.7.107.tgz", diff --git a/package.json b/package.json index 68ab9bf..cdf5646 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,10 @@ "@tato30/vue-pdf": "^1.5.1", "@vuepic/vue-datepicker": "^3.6.3", "bma-org-chart": "^0.0.7", + "dom-to-image-more": "^3.6.0", "keycloak-js": "^20.0.2", "moment": "^2.29.4", + "pdf-lib": "^1.17.1", "pinia": "^2.0.29", "quasar": "^2.11.1", "socket.io-client": "^4.7.4", diff --git a/src/api/KPI/api.kpis.ts b/src/api/KPI/api.kpis.ts index 2a3010d..d3cc7c4 100644 --- a/src/api/KPI/api.kpis.ts +++ b/src/api/KPI/api.kpis.ts @@ -73,6 +73,8 @@ export default { developmentReQuestIDP: (id: string) => `${developmentOrg}/profile/development/registry/USER/${id}`, developmentIDP: (id: string) => `${development}/main/registry/USER/${id}`, - kpiReject:(id:string)=>`${kpiEvaluation}/reject-agreement/${id}` + kpiReject:(id:string)=>`${kpiEvaluation}/reject-agreement/${id}`, + + kpiReportList:(id:string)=>`${Kpi}/report/list/${id}` }; diff --git a/src/api/appeal/api.appeal.ts b/src/api/appeal/api.appeal.ts index 0f1348c..daa4886 100644 --- a/src/api/appeal/api.appeal.ts +++ b/src/api/appeal/api.appeal.ts @@ -5,17 +5,9 @@ const profile = `${env.API_URI}/profile/keycloak`; export default { profileBykeycloak: () => `${profile}`, - positionBykeycloak: () => `${env.API_URI}/org/profile/keycloak/position`, + // positionBykeycloak: () => `${env.API_URI}/org/profile/keycloak/position`, - appealMainList: ( - status: string, - type: string, - year: number, - page: number, - pageSize: number, - keyword: string - ) => - `${appeal}/user?status=${status}&type=${type}&year=${year}&page=${page}&pageSize=${pageSize}&keyword=${keyword}`, + appealMainList: () => `${appeal}/user`, appealAdd: () => `${appeal}`, appealByID: (id: string) => `${appeal}/${id}`, diff --git a/src/api/leave/api.leave.ts b/src/api/leave/api.leave.ts index 8c2b537..6101b03 100644 --- a/src/api/leave/api.leave.ts +++ b/src/api/leave/api.leave.ts @@ -6,16 +6,18 @@ const holiday = `${env.API_URI}/metadata/holiday/`; export default { listUser: () => `${retirementResign}/resign/user`, - listUserByType:(type:string) => `${retirementResign}/resign${type}/user`, + listUserByType: (type: string) => `${retirementResign}/resign${type}/user`, listResign: () => `${retirementResign}/resign`, - listResignByType: (type:string) => `${retirementResign}/resign${type}`, + listResignByType: (type: string) => `${retirementResign}/resign${type}`, resingByid: (id: string) => `${retirementResign}/resign/${id}`, - resingByidType: (type:string,id: string) => `${retirementResign}/resign${type}/${id}`, + resingByidType: (type: string, id: string) => + `${retirementResign}/resign${type}/user/${id}`, questionnaireByid: (id: string) => `${retirementResign}/resign/questionnaire/${id}`, listquestionnaire: () => `${retirementResign}/resign/questionnaire`, cancelResign: (id: string) => `${retirementResign}/resign/cancel/${id}`, - cancelResignByType: (type:string,id: string) => `${retirementResign}/resign${type}/cancel/${id}`, + cancelResignByType: (type: string, id: string) => + `${retirementResign}/resign${type}/cancel/${id}`, // คำถาม questionList: () => `${retirementResign}/resign/questionnaire/question`, diff --git a/src/api/org/api.org.ts b/src/api/org/api.org.ts index e7aa0b7..0ab91e2 100644 --- a/src/api/org/api.org.ts +++ b/src/api/org/api.org.ts @@ -6,6 +6,8 @@ const profileOrg = `${env.API_URI}/org/profile`; const report = `${env.API_URI}/org`; const workflow = `${env.API_URI}/org/workflow`; export default { + orgCommandCode: `${metadata}commandCode`, + profilePosition: () => `${org}/profile/keycloak/position`, searchCommander: `${org}/profile/search/commander`, @@ -38,12 +40,23 @@ export default { dataUserDuty: `${profileOrg}/duty/user`, dataUserDutyByType: (type: string) => `${org}/profile${type}/duty/user`, - dataUserActpositionByType: (type: string) => `${org}/profile${type}/actposition/user`, - dataUserAssistanceByType: (type: string) => `${org}/profile${type}/assistance/user`, + dataUserActpositionByType: (type: string) => + `${org}/profile${type}/actposition/user`, + dataUserAssistanceByType: (type: string) => + `${org}/profile${type}/assistance/user`, + + //ตำแหน่ง + dataUserPosition: (type: string) => + `${org}/profile${type}/salary/position/user`, + dataUserPositionHistory: (emType: string, id: string) => + `${org}/profile${emType}/salary/position/history/${id}`, dataUserSalary: `${profileOrg}/salary/user`, + dataUserSalaryPosition: `${profileOrg}/salary/position/user`, dataUserSalaryByType: (type: string) => `${org}/profile${type}/salary/user`, dataUserAssessments: `${profileOrg}/assessments/user`, + dataUserPortfolio: `${env.API_URI}/development/portfolio/user`, + dataUserPerformance: `${env.API_URI}/evaluation/performance/user`, dataUserNopaid: `${profileOrg}/nopaid/user`, dataUserNopaidByType: (type: string) => `${org}/profile${type}/nopaid/user`, @@ -51,6 +64,8 @@ export default { dataUserCertificateByType: (emType: string, type: string) => `${org}/profile${emType}/${type}/user`, + dataUserEvaByType: (type: string) => `${org}/profile/${type}/user`, + dataUserOther: `${profileOrg}/other/user`, dataUserOtherByType: (type: string) => `${org}/profile${type}/other/user`, @@ -103,6 +118,9 @@ export default { dataUserSalaryNopaidHistoryByType: (emType: string, id: string) => `${org}/profile${emType}/nopaid/history/${id}`, + salaryTenurePosition: (emType: string) => + `${org}/profile${emType}/salary/tenure/user`, + dataUserCertificateHistory: (type: string, id: string) => `${profileOrg}/${type}/history/${id}`, dataUserCertificateHistoryByType: ( @@ -151,6 +169,10 @@ export default { * workflow */ workflow: `${workflow}/`, + commanderPosexe: (type:string)=>`${workflow}/commander-posexe/${type}`, + commanderOperate: `${workflow}/commander/operate`, keycloakLogSSO: `${org}/keycloak/log/sso`, + + orgAssistance:(id:string)=>`${profileOrg}/assistance/${id}` }; diff --git a/src/app.config.ts b/src/app.config.ts index 56d83a8..31f3f81 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -34,7 +34,7 @@ const API = { ...reports, }; -const path = import.meta.env.VITE_MANUAL_URL ?? "e"; +const path = import.meta.env.VITE_MANUAL_URL ?? ""; /** * ไปหน้าคู่มือ @@ -46,14 +46,14 @@ const generatePopupPath = (routeName: any, type: string) => { if (routeName.includes("organizationChart")) { return `${path}/chapter-1-user${type}-organization-chart`; } - if (routeName.includes("registry")) { + if (routeName.includes("registry") || routeName.includes("request-edit")) { return `${path}/chapter-2-user${type}-registry`; } if (routeName.includes("evaluate")) { return `${path}/chapter-3-user-evaluate`; } - if (routeName.includes("leave")) { + if (routeName.includes("leave") || routeName.includes("addAbsence")) { return `${path}/chapter-${type ? "3" : "4"}-user${type}-leave`; } @@ -79,7 +79,7 @@ const generatePopupPath = (routeName: any, type: string) => { return `${path}/chapter-14-user-service-testing`; } if (routeName.includes("Retire")) { - return `${path}/chapter-${type ? "5" : "11"}-user${type}-retire`; + return `${path}/chapter-${type ? "6" : "12"}-user${type}-retire`; } else { return manualConfig[routeName as keyof typeof manualConfig]; } @@ -93,6 +93,8 @@ const manualConfig = { addPortfolio: `${path}/chapter-5-user-portfolio`, addTransfer: `${path}/chapter-6-user-transfer`, KPIMain: `${path}/chapter-8-user-KPI`, + KPIAdd: `${path}/chapter-8-user-KPI`, + KPIEdit: `${path}/chapter-8-user-KPI`, KPIMainEvaluator: `${path}/chapter-9-user-KPI-evaluator`, }; diff --git a/src/components/PopupDetailInbox.vue b/src/components/PopupDetailInbox.vue index 29e7647..986a733 100644 --- a/src/components/PopupDetailInbox.vue +++ b/src/components/PopupDetailInbox.vue @@ -1,8 +1,18 @@ +
+
วิธีการพัฒนา @@ -473,6 +481,7 @@ watch( >70 การลงมือปฏิบัติ (โดยผู้บังคับบัญชามอบหมาย) + + + + + + + + +
+
@@ -500,6 +524,7 @@ watch( >20 การเรียนรู้จากผู้อื่น (Coach/Mentor/Consulting) + + + + + + +
+
@@ -525,6 +563,7 @@ watch(
10 การฝึกอบรมอื่นๆ + + + + + + +
+
@@ -550,6 +602,7 @@ watch(
+
@@ -577,6 +631,7 @@ watch(
+
@@ -595,6 +651,7 @@ watch(
+
@@ -613,6 +671,7 @@ watch(
+
@@ -644,6 +704,9 @@ watch( :deep(.check_box .q-checkbox) { align-items: start; } +:deep(.list-c .q-item) { + min-height: 30px; +} .other_custom_input { position: absolute; diff --git a/src/modules/08_KPI/components/Tab/Dialog/DialogGovernment.vue b/src/modules/08_KPI/components/Tab/Dialog/DialogGovernment.vue index 50e2f3f..3683b63 100644 --- a/src/modules/08_KPI/components/Tab/Dialog/DialogGovernment.vue +++ b/src/modules/08_KPI/components/Tab/Dialog/DialogGovernment.vue @@ -13,116 +13,49 @@ import DialogHeader from "@/components/DialogHeader.vue"; const $q = useQuasar(); const store = useKpiDataStore(); const mixin = useCounterMixin(); -const { - showLoader, - hideLoader, - messageError, - findPosMasterNoOld, - findOrgNameOld, - date2Thai, -} = mixin; +const { messageError, findOrgNameOldHtml, date2Thai } = mixin; const modal = defineModel("modal", { required: true }); const filterKeyword = ref(""); const rows = ref([]); +const isLoad = ref(false); + const visibleColumns = ref([ - "no", - "name", - "posMasterNoOld", - "positionOld", - "positionLevel", - "organizationPositionOld", - "organization", + "commandName", + "agency", "dateStart", "dateEnd", - "createdAt", - "status", "commandNo", + "document", + "lastUpdateFullName", + "lastUpdatedAt", ]); //หัวตาราง const columns = ref([ { - name: "no", + name: "commandName", align: "left", - label: "ลำดับ", - sortable: false, - field: "no", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "name", - align: "left", - label: "ชื่อ-นามสกุล", + label: "ประเภทคำสั่ง", sortable: true, - field: "name", + field: "commandName", headerStyle: "font-size: 14px", style: "font-size: 14px", - format(val, row) { - return `${row.prefix}${row.firstName} ${row.lastName}`; - }, + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { - name: "posMasterNoOld", + name: "agency", align: "left", - label: "ตำแหน่งเลขที่", + label: "หน่วยงานที่ให้ช่วยราชการ/ส่งตัวกลับ", sortable: true, - field: "posMasterNoOld", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format(val, row) { - return findPosMasterNoOld(row); - }, - }, - { - name: "positionOld", - align: "left", - label: "ตำแหน่งในสายงาน", - sortable: true, - field: "positionOld", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, - { - name: "positionLevel", - align: "left", - label: "ตำแหน่งประเภท", - sortable: true, - field: "positionLevel", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format(val, row) { - let name = ""; - if (row.posTypeNameOld && row.posLevelNameOld) { - name = `${row.posTypeNameOld} (${row.posLevelNameOld})`; - } else if (row.posTypeNameOld) { - name = `${row.posTypeNameOld}`; - } else if (row.posLevelNameOld) { - name = `(${row.posLevelNameOld})`; - } else name = "-"; - return name; - }, - }, - { - name: "organizationPositionOld", - align: "left", - label: "สังกัด", - sortable: true, - field: "organization", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (val, row) => findOrgNameOld(row), - }, - { - name: "organization", - align: "left", - label: "หน่วยงานที่ให้ช่วยราชการ", - sortable: true, - field: "organization", + field: "agency", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "dateStart", @@ -130,9 +63,11 @@ const columns = ref([ label: "วันเริ่มช่วยราชการ", sortable: true, field: "dateStart", + format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", - format: (val) => date2Thai(val), + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "dateEnd", @@ -140,29 +75,11 @@ const columns = ref([ label: "วันสิ้นสุดการช่วยราชการ", sortable: true, field: "dateEnd", + format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", - format: (val) => date2Thai(val), - }, - { - name: "createdAt", - align: "left", - label: "วันที่ดำเนินการ", - sortable: true, - field: "createdAt", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (val) => date2Thai(val), - }, - { - name: "status", - align: "left", - label: "สถานะ", - sortable: true, - field: "status", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (val) => statusText(val), + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "commandNo", @@ -172,31 +89,45 @@ const columns = ref([ field: "commandNo", headerStyle: "font-size: 14px", style: "font-size: 14px", - + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "document", + align: "left", + label: "เอกสารอ้างอิง", + sortable: true, + field: "document", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "lastUpdateFullName", + align: "left", + label: "ผู้ดำเนินการ", + sortable: true, + field: "lastUpdateFullName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "lastUpdatedAt", + align: "left", + label: "วันที่แก้ไข", + sortable: true, + field: "lastUpdatedAt", + format: (v) => date2Thai(v, false, true), + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); -/** เเปลง status เป็น text */ -function statusText(val: string) { - switch (val) { - case "WAITTING": - return "รอดำเนินการ"; - case "PENDING": - return "เลือกตำแหน่งแล้ว"; - case "APPROVE": - return "อนุมัติ"; - case "REJECT": - return "ไม่อนุมัติ"; - case "REPORT": - return "ส่งรายชื่อไปออกคำสั่ง"; - case "DONE": - return "ออกคำสั่งเสร็จแล้ว"; - - default: - return "-"; - } -} - /** ปิด dialog */ function close() { modal.value = false; @@ -204,9 +135,9 @@ function close() { /** ดึงข้อมูล */ function getData() { - showLoader(); + isLoad.value = true; http - .get(config.API.placementKeycloak + `/${store.dataEvaluation.profileId}`) + .get(config.API.orgAssistance(store.dataEvaluation.profileId)) .then((res) => { const data = res.data.result; rows.value = data; @@ -215,14 +146,14 @@ function getData() { messageError($q, e); }) .finally(() => { - hideLoader(); + isLoad.value = false; }); } watch( () => modal.value, (n) => { - if (n == true) { + if (n) { getData(); } } @@ -248,6 +179,8 @@ watch( dense :rows-per-page-options="[10, 25, 50, 100]" :visible-columns="visibleColumns" + :loading="isLoad" + :pagination="{ page: 1, rowsPerPage: 10 }" >