commit badb676529a974a890771ce032cfc114c49a9d08 Author: waruneeauy Date: Wed May 29 17:58:57 2024 +0700 start commit for admin system diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..112b6b3d --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +VITE_REALM_KEYCLOAK: "realms-name" +VITE_CLIENTID_KEYCLOAK: "client-id" +VITE_URL_KEYCLOAK: "https://id.your-domain.com/" \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e1f03e1c --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +coverage +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +package-lock.json \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..6f2553ea --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# 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/README.md b/README.md new file mode 100644 index 00000000..89550bec --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Human Resource Information System (HRIS) + +## Install & Run Project + +> npm install +> npm run dev +> npm run build diff --git a/cypress.config.ts b/cypress.config.ts new file mode 100644 index 00000000..0f66080f --- /dev/null +++ b/cypress.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from 'cypress' + +export default defineConfig({ + e2e: { + specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}', + baseUrl: 'http://localhost:4173' + } +}) diff --git a/cypress/e2e/example.cy.ts b/cypress/e2e/example.cy.ts new file mode 100644 index 00000000..7a8c909f --- /dev/null +++ b/cypress/e2e/example.cy.ts @@ -0,0 +1,8 @@ +// https://docs.cypress.io/api/introduction/api.html + +describe('My First Test', () => { + it('visits the app root url', () => { + cy.visit('/') + cy.contains('h1', 'You did it!') + }) +}) diff --git a/cypress/e2e/tsconfig.json b/cypress/e2e/tsconfig.json new file mode 100644 index 00000000..be213aef --- /dev/null +++ b/cypress/e2e/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@vue/tsconfig/tsconfig.web.json", + "include": ["./**/*", "../support/**/*"], + "compilerOptions": { + "isolatedModules": false, + "target": "es5", + "lib": ["es5", "dom"], + "types": ["cypress"] + } +} diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json new file mode 100644 index 00000000..02e42543 --- /dev/null +++ b/cypress/fixtures/example.json @@ -0,0 +1,5 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io", + "body": "Fixtures are a great way to mock data for responses to routes" +} diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts new file mode 100644 index 00000000..9b7bb8e2 --- /dev/null +++ b/cypress/support/commands.ts @@ -0,0 +1,39 @@ +/// +// *********************************************** +// This example commands.ts shows you how to +// create various custom commands and overwrite +// existing commands. +// +// For more comprehensive examples of custom +// commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** +// +// +// -- This is a parent command -- +// Cypress.Commands.add('login', (email, password) => { ... }) +// +// +// -- This is a child command -- +// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) +// +// +// -- This is a dual command -- +// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) +// +// +// -- This will overwrite an existing command -- +// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) +// +// declare global { +// namespace Cypress { +// interface Chainable { +// login(email: string, password: string): Chainable +// drag(subject: string, options?: Partial): Chainable +// dismiss(subject: string, options?: Partial): Chainable +// visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable +// } +// } +// } + +export {} diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts new file mode 100644 index 00000000..d68db96d --- /dev/null +++ b/cypress/support/e2e.ts @@ -0,0 +1,20 @@ +// *********************************************************** +// This example support/index.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands' + +// Alternatively you can use CommonJS syntax: +// require('./commands') diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 00000000..2a468c6b --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +ROOT_DIR=/app + +# Replace env vars in JavaScript files +echo "Replacing env constants in JS" +for file in $ROOT_DIR/assets/app.*.js* $ROOT_DIR/js/app.*.js* $ROOT_DIR/index.html $ROOT_DIR/precache-manifest*.js $ROOT_DIR/assets/index*.js* $ROOT_DIR/assets/*.js*; +do + echo "Processing $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_URL_KEYCLOAK|'${VITE_URL_KEYCLOAK}'|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 + +done + +echo "Starting Nginx" +nginx -g 'daemon off;' + diff --git a/env.d.ts b/env.d.ts new file mode 100644 index 00000000..33cd2182 --- /dev/null +++ b/env.d.ts @@ -0,0 +1,2 @@ +/// +declare module 'quasar-ui-q-draggable-table'; \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 00000000..0e3d5d42 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + ระบบบริหารทรัพยากรบุคคล + + +
+ + + diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 00000000..6f61d6c7 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,30 @@ +user nginx; +worker_processes 1; +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; +events { + worker_connections 1024; +} +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + access_log /var/log/nginx/access.log main; + sendfile on; + keepalive_timeout 65; + server { + listen 80; + server_name localhost; + location / { + root /app; + index index.html; + try_files $uri $uri/ /index.html; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..8458556f --- /dev/null +++ b/package.json @@ -0,0 +1,68 @@ +{ + "name": "hris-admin", + "version": "0.0.0", + "private": true, + "scripts": { + "dev": "vite", + "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'", + "test:e2e:dev": "start-server-and-test 'vite dev --port 4173' :4173 'cypress open --e2e'", + "build-only": "vite build", + "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false", + "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" + }, + "dependencies": { + "@fullcalendar/core": "^6.0.1", + "@fullcalendar/daygrid": "^6.0.1", + "@fullcalendar/interaction": "^6.0.2", + "@fullcalendar/list": "^6.0.2", + "@fullcalendar/react": "^6.0.1", + "@fullcalendar/timegrid": "^6.0.2", + "@fullcalendar/vue3": "^6.0.1", + "@quasar/extras": "^1.15.8", + "@tato30/vue-pdf": "^1.5.1", + "@vuepic/vue-datepicker": "^3.6.3", + "axios": "^1.6.7", + "bma-org-chart": "^0.0.8", + "keycloak-js": "^20.0.2", + "moment": "^2.29.4", + "pinia": "^2.0.29", + "quasar": "^2.11.1", + "socket.io-client": "^4.7.4", + "structure-chart": "^0.0.9", + "vue": "^3.4.15", + "vue-currency-input": "^3.0.5", + "vue-router": "^4.1.6", + "vue3-datepicker": "^0.3.4" + }, + "devDependencies": { + "@quasar/vite-plugin": "^1.3.0", + "@rushstack/eslint-patch": "^1.1.4", + "@types/jsdom": "^20.0.1", + "@types/node": "^18.11.12", + "@vitejs/plugin-vue": "^4.0.0", + "@vitejs/plugin-vue-jsx": "^3.0.0", + "@vue/eslint-config-prettier": "^7.0.0", + "@vue/eslint-config-typescript": "^11.0.0", + "@vue/test-utils": "^2.2.6", + "@vue/tsconfig": "^0.1.3", + "cypress": "^12.0.2", + "eslint": "^8.22.0", + "eslint-plugin-cypress": "^2.12.1", + "eslint-plugin-vue": "^9.3.0", + "jsdom": "^20.0.3", + "node-sass": "^9.0.0", + "npm-run-all": "^4.1.5", + "prettier": "^2.7.1", + "quasar-ui-q-draggable-table": "^1.0.1", + "sass": "^1.69.4", + "start-server-and-test": "^1.15.2", + "typescript": "~4.7.4", + "vite": "^4.0.0", + "vitest": "^0.25.6", + "vue-table-to-excel": "^1.0.6", + "vue-tsc": "^1.0.12" + } +} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 00000000..4420a4d4 Binary files /dev/null and b/public/favicon.ico differ diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 00000000..4295c365 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/src/api/00_dashboard/api.message.ts b/src/api/00_dashboard/api.message.ts new file mode 100644 index 00000000..8fe705b9 --- /dev/null +++ b/src/api/00_dashboard/api.message.ts @@ -0,0 +1,16 @@ +/** + * API Structure + Org Chart + */ +import env from "../index"; + +const message = `${env.API_URI}/message`; +const reply = `${env.API_URI}/placement/noti`; + +export default { + msgNotificate: `${message}/my-notifications`, + msgInbox: `${message}/my-inboxes`, + msgId: (id: string) => `${message}/my-notifications/${id}`, + msgNoread: () => `${message}/my-notifications/noread`, + msgInboxDelete: (id: string) => `${message}/my-inboxes/${id}`, + replyMessage: (id: string) => `${reply}/${id}`, +}; diff --git a/src/api/02_organizational/api.chart.ts b/src/api/02_organizational/api.chart.ts new file mode 100644 index 00000000..06757a17 --- /dev/null +++ b/src/api/02_organizational/api.chart.ts @@ -0,0 +1,14 @@ +/** + * API Structure + Org Chart + */ +import env from "../index" + +const treeRoot = `${env.API_URI}/Organization/treeroot` +const structChart = `${env.API_URI}/Organization/struct-chart/` +const orgChart = `${env.API_URI}/Organization/org-chart/` + +export default { + chartGetTreeRoot: `${treeRoot}`, + chartGetStructure: (id: string) => `${structChart}${id}`, + chartGetOrg: (id: string) => `${orgChart}${id}` +} diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts new file mode 100644 index 00000000..59f15364 --- /dev/null +++ b/src/api/02_organizational/api.organization.ts @@ -0,0 +1,92 @@ +import env from "../index"; + +const organization = `${env.API_URI}/org`; +const orgPos = `${env.API_URI}/org/pos`; +const orgProfile = `${env.API_URI}/org/profile`; +const orgEmployeePos = `${env.API_URI}/org/employee/pos`; + +export default { + /** โครงสร้างอัตรากำลัง*/ + activeOrganization: `${organization}/active`, + orgByid: (id: string) => `${organization}/${id}`, + createOrganization: `${organization}/draft`, + createOrgLevel: (type: string) => `${organization}/${type}`, + orgLevelByid: (type: string, id: string) => `${organization}/${type}/${id}`, + + orgSetDateTime: (id: string) => `${organization}/set/publish/${id}`, + organizationHistoryNew: `${organization}/history`, + organizationHistoryPostNew: `${organization}/history/publish`, + + /** position*/ + orgPosPosition: `${orgPos}/position`, + orgPosPositionById: (id: string) => `${orgPos}/position/${id}`, + orgPosPositionExecutive : () => `${orgPos}/position/executive`, + orgPosExecutive: `${orgPos}/executive`, + orgPosType: `${orgPos}/type`, + orgPosTypeId: (id: string) => `${orgPos}/type/${id}`, + orgPosLevel: `${orgPos}/level`, + orgPosMaster: `${orgPos}/master`, + orgPosMasterById: (id: string) => `${orgPos}/master/${id}`, + orgPosMasterList: `${orgPos}/master/list`, + orgPosSort: `${orgPos}/sort`, + orgPosMove: `${orgPos}/move`, + organizationShortName: `${organization}/sort`, + organizationPublishGet: `${organization}/get/publish`, + orgPosDNA: `${orgPos}/dna`, //สืบทอดตำแหน่ง + + orgPosExecutiveById: (id: string) => `${orgPos}/executive/${id}`, + orgPosHistory: (id: string) => `${orgPos}/history/${id}`, + + orgSalaryPosition: `${orgPos}/position?keyword=&type=ALL`, + + /**ครองตำแหน่ง */ + orgSearchProfile: `${orgProfile}/search`, + orgProfile: `${orgPos}/profile`, + orgDeleteProfile: (id: string) => `${orgPos}/profile/delete/${id}`, + orgSummary: `${orgPos}/summary`, + + /** report*/ + orgReport: (report: string) => `${organization}/report/${report}`, + + /** struct-chart*/ + orgStructChart: (id: string, type: string) => + `${organization}/struct-chart/${id}/${type}`, + + // ค้นหาคนตามเงื่อนไข + orgSearchPersonal: () => `${organization}/profile/search-personal`, + + /** บรรจุแต่งตั้ง*/ + orgPosPlacement: `${orgPos}/placement/search`, + orgPosPlacemenTemp: `${orgPos}/placementemp/search`, + orgPosFind: `${organization}/find/node`, + orgProfileProbation: `${organization}/profile/probation`, + + activeOrganizationRoot: `${organization}/active/root`, + activeOrganizationRootById: (id: string) => + `${organization}/active/root/${id}`, + + /** ข้อมูลตำแหน่งลูกจ้างประจำ*/ + orgEmployeePos: `${orgEmployeePos}/position`, + orgEmployeePosById: (id: string) => `${orgEmployeePos}/position/${id}`, + orgEmployeeType: `${orgEmployeePos}/type`, + orgEmployeeTypeById: (id: string) => `${orgEmployeePos}/type/${id}`, + orgEmployeelevel: `${orgEmployeePos}/level`, + orgEmployeelevelById: (id: string) => `${orgEmployeePos}/level/${id}`, + + /** อัตรากำลังลูกจ้างประจำ*/ + orgSummaryEmp: `${orgEmployeePos}/summary`, + orgReportEmp: (report: string) => `${orgEmployeePos}/report/${report}`, + orgDeleteProfileEmp: (id: string) => `${orgEmployeePos}/profile/delete/${id}`, + orgPosMasterByIdEmp: (id: string) => `${orgEmployeePos}/master/${id}`, + orgPosMasterListEmp: `${orgEmployeePos}/master/list`, + orgPosMasterEmp: `${orgEmployeePos}/master`, + orgPosSortEmp: `${orgEmployeePos}/sort`, + orgPosPositionEmpById: (id: string) => `${orgEmployeePos}/position/${id}`, + orgPosMoveEmp: `${orgEmployeePos}/move`, + orgProfileEmp: `${orgEmployeePos}/profile`, + orgSearchProfileEmp: `${orgProfile}-employee/search`, + + orgProfileById:(id:string,type:string)=>`${orgProfile}${type}/${id}`, + + orgDeceasedProfile:`${orgPos}/profile/search` +}; diff --git a/src/api/02_organizational/api.treelist.ts b/src/api/02_organizational/api.treelist.ts new file mode 100644 index 00000000..063b8af0 --- /dev/null +++ b/src/api/02_organizational/api.treelist.ts @@ -0,0 +1,94 @@ +/** + * api ระบบจัดการ Tree + * + */ +import env from "../index"; +//Dropdown เพิ่มโครงร้างหน่วยงาน +// const organizationAgency = `${env.API_URI_ORG_SERVICE}/organization-agency/`; +// const organizationGovernmentAgency = `${env.API_URI_ORG_SERVICE}/organization-government-agency/`; +// const organizationPath = `${env.API_URI}/Organization/tree`; +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 organizationEmployee = `${env.API_URI_ORG_EMPLOYEE_SERVICE}/organization-employee/`; + +const report = `${env.API_URI}/report/organization/`; + +export default { + getOCType: `${report}oc-type`, + getReportAccount1: (id: string) => `${report}account1/${id}`, + getReportAccount2: (id: string) => `${report}account2/${id}`, + getReportAccount3: (id: string) => `${report}account3/${id}`, + + /**api หน่วยงานต้นสังกัด/ส่วนราชการต้นสังกัด + * @param organizationType หน่วยงาน หรือ ส่วนราชการ + * @returns organizationId and organizationName + */ + listOrganizationAgency: (organizationType: string) => + `${organizationPath}type/${organizationType}`, + listOrganizationHistoryAgency: (organizationType: string) => + `${organizationPath}history/type/${organizationType}`, + + /**api Tree + * + */ + // treeList: `${organizationPath}`, + getTreeRoot: `${organizationPath}treeroot`, + getDraftTreeRoot: `${organizationPath}history/treeroot`, + getTreeHistory: `${organizationPath}publish-history`, + + getPublishFileHistory: `${organizationPath}publish-file`, + + getTreeNode: (organizationId: string, keyId: string) => + `${organizationPath}tree?organizationId=${organizationId}&keyId=${keyId}`, + getDraftTreeNode: (organizationId: string, keyId: string) => + `${organizationPath}history/tree?organizationId=${organizationId}&keyId=${keyId}`, + addTreeDraft: `${organizationPosition}history`, + editTreeOrgDraft: (organizationId: string) => + `${organizationPath}history/${organizationId}`, + getOrgDraft: (organizationId: string) => + `${organizationPath}history/${organizationId}`, + // /api/v1/Organization/history?organizationPositionId=65ab2ddc-b9d2-4422-83d4-b90dd8191b6f + delTreeOrgDraft: (organizationId: string) => + `${organizationPath}history?organizationPositionId=${organizationId}`, + getPostionMasterDraft: (showAll: boolean) => + `${postionMasterPath}/history?showall=${showAll}`, + getPostionMaster: (showAll: boolean) => + `${postionMasterPath}?showall=${showAll}`, + editTreePositionDraft: (organizationPositionId: string) => + `${organizationPosition}history?organizationPositionId=${organizationPositionId}`, + // /api/v1/OrganizationPosition/history?organizationPositionId=15ec8c2b-796f-4fad-b731-667a232e723e + delTreePositionDraft: (organizationPositionId: string) => + `${organizationPosition}history/${organizationPositionId}`, + + //PUT /api/v1/OrganizationPosition/history/publish + publishOrgPoDraft: `${organizationPosition}history/publish`, + //PUT /api/v1/OrganizationPosition/history/sync + delTreeOrgPoDraft: `${organizationPosition}history/sync`, + isOrgPohasDraft: `${organizationPosition}history/has-draft`, + isOrghasDraft: `${organizationPath}history/has-draft`, + + /** + * api จัดการตำแหน่ง + */ + getPositionMaster: `${postionMasterPath}/history`, + getPositionMasterId: (id: string) => `${postionMasterPath}/history/${id}`, + getPositionMasterPublish: `${postionMasterPath}/history/publish`, + getPositionMasterSync: `${postionMasterPath}/history/sync`, + getPositionMasterHistoryId: (id: string) => + `${postionMasterPath}/history/publish/${id}`, + + getPositionMasterPositionNumber: `${postionMasterPath}/position-number`, + getPositionMasterPositionNumberId: (id: string) => + `${postionMasterPath}/position-number/${id}`, + getPositionNumberIdByOcId: (OcId: string) => + `${postionMasterPath}/position-number/Oc/${OcId}`, + + organizationEmployee: `${organizationEmployee}`, + organizationEmployeeId: (id: string) => `${organizationEmployee}${id}`, + + organizationEmployeePositionId: (profileId: string) => + `${organizationEmployee}position/${profileId}`, + organizationEmployeeSendOrder: `${organizationEmployee}report`, + +}; diff --git a/src/api/file/api.file.ts b/src/api/file/api.file.ts new file mode 100644 index 00000000..313474d5 --- /dev/null +++ b/src/api/file/api.file.ts @@ -0,0 +1,23 @@ +import env from "../index"; +const url = `${env.API_URI}/salary`; + +export default { + subFile: (name: string, group: string, id: string, subId: string) => + `${url}/sub-file/${name}/${group}/${id}/${subId}`, + + subFileByFileName: ( + name: string, + group: string, + id: string, + subId: string, + fileName: string + ) => `${url}/sub-file/${name}/${group}/${id}/${subId}/${fileName}`, + + file: (name: string, group: string, id: string) => + `${url}/file/${name}/${group}/${id}`, + + fileByPath: (name: string) => + `${url}/file/${name}`, + fileByFile: (name: string, group: string, id: string, fileName: string) => + `${url}/file/${name}/${group}/${id}/${fileName}`, +}; diff --git a/src/api/index.ts b/src/api/index.ts new file mode 100644 index 00000000..c0280387 --- /dev/null +++ b/src/api/index.ts @@ -0,0 +1,70 @@ +/**config api */ +import { ref } from "vue"; + +const env = ref(process.env.NODE_ENV || "development"); +export const apiUrlConfigPublish = import.meta.env.VITE_API_PUBLISH_URL; +export const apiUrlConfigReport = import.meta.env.VITE_API_REPORT_URL; +// if (process.env.VUE_APP_TEST) { +// env = "test"; +// } + +const config = ref({ + development: { + API_URI: "https://bma-ehr.frappet.synology.me/api/v1", + API_URI_ORG_SERVICE: "https://bma-ehr.frappet.synology.me/api/v1", //ใช้ชั่วคราว + API_URI_ORG_EMPLOYEE_SERVICE: "https://bma-ehr.frappet.synology.me/api/v1", //ใช้ชั่วคราว + API_URI_PROFILE_SERVICE: "https://bma-ehr.frappet.synology.me/api/v1", //ใช้ชั่วคราว + API_REPORT_URI: "https://bma-ehr.frappet.synology.me/api/v1", + MEET_URI: "meet.frappet.com", + API_REPORT2_URI: "https://bma-ehr.frappet.synology.me/api/v2", + API_REPORT_TEMPLATE_URI: + "https://report-server.frappet.synology.me/api/v1/report-template", + }, + test: { + API_URI: "http://localhost:5010/api/v1", + API_CANDIDATE_URI: "https://localhost:7007/api/v1", + API_REPORT_URI: "https://localhost:7007/api/v1", + MEET_URI: "meet.frappet.com", + }, + production: { + // 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_REPORT_URI: `${window.location.protocol}//${window.location.host}/api/v1`, + MEET_URI: "meet.frappet.com", + API_REPORT2_URI: `${window.location.protocol}//${window.location.host}/api/v2`, + API_REPORT_TEMPLATE_URI: apiUrlConfigReport, + }, +}); + +const API_URI = ref(config.value[env.value].API_URI); +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_REPORT2_URI = ref(config.value[env.value].API_REPORT2_URI); +const API_REPORT_TEMPLATE_URI = ref( + config.value[env.value].API_REPORT_TEMPLATE_URI +); + +export default { + env: env.value, + config: config.value, + API_URI: API_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, + MEET_URI: MEET_URI.value, + API_REPORT2_URI: API_REPORT2_URI.value, + API_REPORT_TEMPLATE_URI: API_REPORT_TEMPLATE_URI.value, +}; diff --git a/src/api/manage/api.holiday.ts b/src/api/manage/api.holiday.ts new file mode 100644 index 00000000..42ebf224 --- /dev/null +++ b/src/api/manage/api.holiday.ts @@ -0,0 +1,23 @@ +/** + * api ระบบจัดการข้อมูลหลัก + * เมนูย่อย: ปฏิทินวันหยุด + */ +import env from "../index"; +const holiday = `${env.API_URI}/metadata/holiday/`; + +export default { + /** + * api ชั้นเครื่องราชฯ + */ + listHolidayHistoryAdd: (category: string) => + `${holiday}range/add/${category}`, + listHolidayHistoryEdit: (category: string) => + `${holiday}range/edit/${category}`, + listHolidayHistoryDelete: (category: string) => + `${holiday}range/delete/${category}`, + listHolidayHistoryYear: (year: number) => `${holiday}${year}`, + listHolidayHistoryYearMonth: (year: number, month: number) => + `${holiday}${year}/${month}`, + listHolidayCopy: `${holiday}copy`, + summaryHolidayHistoryYear: (year: number) => `${holiday}summary/${year}`, +}; diff --git a/src/api/manage/api.insignia.ts b/src/api/manage/api.insignia.ts new file mode 100644 index 00000000..943b2d79 --- /dev/null +++ b/src/api/manage/api.insignia.ts @@ -0,0 +1,48 @@ +/** + * api ระบบจัดการข้อมูลหลัก + * เมนูย่อย: ข้อมูลเครื่องราชอิสริยาภรณ์ + */ +import env from "../index"; +const insignia = `${env.API_URI}/metadata/insignia/`; +const insigniaType = `${env.API_URI}/metadata/insignia-type/`; +const insigniaOrg = `${env.API_URI}/org/insignia/insignia/`; +const insigniaTypeOrg = `${env.API_URI}/org/insignia/insignia-type/`; + +export default { + /** + * api ชั้นเครื่องราชฯ + */ + insignia, + listInsigniaHistory: `${insignia}history`, + listInsigniaHistoryId: (id: string) => `${insignia}history/${id}`, + listInsigniaPublished: `${insignia}history/published`, + listInsigniaPublishedHistory: `${insignia}history/published-history`, + + /** + * api ประเภท + */ + insigniaType, + listInsigniaTypeHistory: `${insigniaType}history`, + listInsigniaTypeHistoryId: (id: string) => `${insigniaType}history/${id}`, + listInsigniaTypePublished: `${insigniaType}history/published`, + listInsigniaTypePublishedHistory: `${insigniaType}history/published-history`, + + /** + * api เหรียญตรา + */ + // listInsigniaHistory: `${insignia}history`, + // listInsigniaHistoryId: (id: string) => `${insignia}history/${id}`, + // listInsigniaPublished: `${insignia}history/published`, + // listInsigniaPublishedHistory: `${insignia}history/published-history`, + insigniaTypeNew: `${insigniaType}draft`, + insigniaTypeNewId: (id: string) => `${insigniaType}${id}`, + insigniaNewId: (id: string) => `${insignia}${id}`, + insigniaSort: (id: string) => `${insignia}sort/${id}`, + + insigniaOrg, + insigniaTypeOrg, + insigniaTypeNewOrg: `${insigniaOrg}`, + insigniaTypeNewIdOrg: (id: string) => `${insigniaTypeOrg}${id}`, + insigniaNewIdOrg: (id: string) => `${insigniaOrg}${id}`, + insigniaSortOrg: (id: string) => `${insigniaOrg}sort/${id}`, +}; diff --git a/src/api/manage/api.organization.ts b/src/api/manage/api.organization.ts new file mode 100644 index 00000000..1138be21 --- /dev/null +++ b/src/api/manage/api.organization.ts @@ -0,0 +1,133 @@ +/** + * api ระบบจัดการข้อมูลหลัก + * เมนูย่อย: ข้อมูลโครงสร้างหน่วยงาน + */ +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/`; +const organizationCode = `${env.API_URI_ORG_SERVICE}/PositionMaster/`; +const organizationType = `${env.API_URI}/metadata/organization-type/`; +const organizationLevel = `${env.API_URI}/metadata/organization-level/`; +const organizationStatus = `${env.API_URI}/metadata/organization-status/`; +const organizationAgency = `${env.API_URI}/metadata/organization-agency/`; +const organizationGovernmentAgency = `${env.API_URI}/metadata/organization-government-agency/`; +const organizationTelExternal = `${env.API_URI}/metadata/organization-tel-external/`; +const organizationTelInternal = `${env.API_URI}/metadata/organization-tel-internal/`; +const organizationFax = `${env.API_URI}/metadata/organization-fax/`; +const dashbord = `${env.API_URI}/metadata/dashbord/`; + +export default { + /** + * api จำนวนข้อมูลใน ระบบจัดการข้อมูลหลัก tab ย่อยแต่ละ tab + */ + organizationMain: `${organizationMain}organization`, + organization, + countDashbordSubHistory: (type: number) => `${dashbord}${type}`, + countDashbordHistory: `${dashbord}`, + + /** + * api หน่วยงาน + */ + organizationOrganization, + listOrganizationOrganizationHistory: `${organizationOrganization}history`, + listOrganizationOrganizationHistoryId: (id: string) => + `${organizationOrganization}history/${id}`, + listOrganizationOrganizationPublished: `${organizationOrganization}history/published`, + listOrganizationOrganizationPublishedHistory: `${organizationOrganization}history/published-history`, + + /** + * api ชื่อย่อหน่วยงาน + */ + organizationShortName, + listOrganizationShortNameHistory: `${organizationShortName}history`, + listOrganizationShortNameHistoryId: (id: string) => + `${organizationShortName}history/${id}`, + listOrganizationShortNamePublished: `${organizationShortName}history/published`, + listOrganizationShortNamePublishedHistory: `${organizationShortName}history/published-history`, + organizationCode: `${organizationCode}organization-code`, + organizationGovernmentCode: (id: string) => + `${organizationCode}government/${id}`, + organizationAgencyCode: (id: string) => `${organizationCode}agency/${id}`, + + /** + * api ประเภท + */ + organizationType, + listOrganizationTypeHistory: `${organizationType}history`, + listOrganizationTypeHistoryId: (id: string) => + `${organizationType}history/${id}`, + listOrganizationTypePublished: `${organizationType}history/published`, + listOrganizationTypePublishedHistory: `${organizationType}history/published-history`, + + /** + * api ระดับ + */ + organizationLevel, + listOrganizationLevelHistory: `${organizationLevel}history`, + listOrganizationLevelHistoryId: (id: string) => + `${organizationLevel}history/${id}`, + listOrganizationLevelPublished: `${organizationLevel}history/published`, + listOrganizationLevelPublishedHistory: `${organizationLevel}history/published-history`, + + /** + * api สถานะ + */ + organizationStatus, + listOrganizationStatusHistory: `${organizationStatus}history`, + listOrganizationStatusHistoryId: (id: string) => + `${organizationStatus}history/${id}`, + listOrganizationStatusPublished: `${organizationStatus}history/published`, + listOrganizationStatusPublishedHistory: `${organizationStatus}history/published-history`, + + /** + * api หน่วยงานต้นสังกัด + */ + organizationAgency, + listOrganizationAgencyHistory: `${organizationAgency}history`, + listOrganizationAgencyHistoryId: (id: string) => + `${organizationAgency}history/${id}`, + listOrganizationAgencyPublished: `${organizationAgency}history/published`, + listOrganizationAgencyPublishedHistory: `${organizationAgency}history/published-history`, + + /** + * api ส่วนราชการต้นสังกัด + */ + organizationGovernmentAgency, + listOrganizationGovernmentAgencyHistory: `${organizationGovernmentAgency}history`, + listOrganizationGovernmentAgencyHistoryId: (id: string) => + `${organizationGovernmentAgency}history/${id}`, + listOrganizationGovernmentAgencyPublished: `${organizationGovernmentAgency}history/published`, + listOrganizationGovernmentAgencyPublishedHistory: `${organizationGovernmentAgency}history/published-history`, + + /** + * api เบอร์ติดต่อภายนอก + */ + organizationTelExternal, + listOrganizationTelExternalHistory: `${organizationTelExternal}history`, + listOrganizationTelExternalHistoryId: (id: string) => + `${organizationTelExternal}history/${id}`, + listOrganizationTelExternalPublished: `${organizationTelExternal}history/published`, + listOrganizationTelExternalPublishedHistory: `${organizationTelExternal}history/published-history`, + + /** + * api เบอร์ติดต่อภายใน + */ + organizationTelInternal, + listOrganizationTelInternalHistory: `${organizationTelInternal}history`, + listOrganizationTelInternalHistoryId: (id: string) => + `${organizationTelInternal}history/${id}`, + listOrganizationTelInternalPublished: `${organizationTelInternal}history/published`, + listOrganizationTelInternalPublishedHistory: `${organizationTelInternal}history/published-history`, + + /** + * api เบอร์โทรสาร + */ + organizationFax, + listOrganizationFaxHistory: `${organizationFax}history`, + listOrganizationFaxHistoryId: (id: string) => + `${organizationFax}history/${id}`, + listOrganizationFaxPublished: `${organizationFax}history/published`, + listOrganizationFaxPublishedHistory: `${organizationFax}history/published-history`, +}; diff --git a/src/api/manage/api.person.ts b/src/api/manage/api.person.ts new file mode 100644 index 00000000..06059c2a --- /dev/null +++ b/src/api/manage/api.person.ts @@ -0,0 +1,140 @@ +/** + * api ระบบจัดการข้อมูลหลัก + * เมนูย่อย: ข้อมูลเกี่ยวกับบุคคล + */ +import env from "../index"; +const person = `${env.API_URI}/metadata/main/`; +const province = `${env.API_URI}/metadata/province/`; +const district = `${env.API_URI}/metadata/district/`; +const subDistrict = `${env.API_URI}/metadata/sub-district/`; +const prefix = `${env.API_URI}/metadata/prefix/`; +const bloodGroup = `${env.API_URI}/metadata/blood-group/`; +const educationLevel = `${env.API_URI}/metadata/education-level/`; +const gender = `${env.API_URI}/metadata/gender/`; +const relationship = `${env.API_URI}/metadata/relationship/`; +const religion = `${env.API_URI}/metadata/religion/`; + +const orgRelationship = `${env.API_URI}/org/metadata/relationship/`; +const orgPrefix = `${env.API_URI}/org/metadata/prefix/`; +const orgRank = `${env.API_URI}/org/metadata/rank/`; +const orgBloodGroup = `${env.API_URI}/org/metadata/bloodGroup/`; +const orgGender = `${env.API_URI}/org/metadata/gender/`; +const orgReligion = `${env.API_URI}/org/metadata/religion/`; +const orgEducationLevel = `${env.API_URI}/org/metadata/educationLevel/`; + +const orgProvince = `${env.API_URI}/org/metadata/province`; +const orgDistrict = `${env.API_URI}/org/metadata/district`; +const orgSubDistrict = `${env.API_URI}/org/metadata/subDistrict`; + +export default { + person: `${person}person`, + + /** + * api จังหวัด + */ + province, + listProvinceHistory: `${province}history`, + listProvinceHistoryId: (id: string) => `${province}history/${id}`, + listProvincePublished: `${province}history/published`, + listProvincePublishedHistory: `${province}history/published-history`, + + /** + * api เขต + */ + listDistrict: (id: string) => `${district}${id}`, + listDistrictHistory: `${district}history`, + listDistrictHistoryId: (id: string | string[]) => `${district}history/${id}`, + listDistrictPublishedId: (id: string) => `${district}history/published/${id}`, + listDistrictPublishedHistory: (id: string | string[]) => + `${district}history/published-history/${id}`, + + /** + * api แขวง + */ + listSubDistrict: (id: string) => `${subDistrict}${id}`, + listSubDistrictHistory: `${subDistrict}history`, + listSubDistrictHistoryProvinceId: ( + provinceId: string | string[], + district: string | string[] + ) => `${subDistrict}history/${provinceId}/${district}`, + listSubDistrictHistoryId: (id: string | string[]) => + `${subDistrict}history/${id}`, + listSubDistrictPublishedId: (id: string) => + `${subDistrict}history/published/${id}`, + listSubDistrictPublishedHistory: (id: string | string[]) => + `${subDistrict}history/published-history/${id}`, + + /** + * api คำนำหน้าชื่อ + */ + prefix, + listPrefixHistory: `${prefix}history`, + listPrefixHistoryId: (id: string) => `${prefix}history/${id}`, + listPrefixPublished: `${prefix}history/published`, + listPrefixPublishedHistory: `${prefix}history/published-history`, + + /** + * api เพศ + */ + gender, + listGenderHistory: `${gender}history`, + listGenderHistoryId: (id: string) => `${gender}history/${id}`, + listGenderPublished: `${gender}history/published`, + listGenderPublishedHistory: `${gender}history/published-history`, + + /** + * api สถานภาพ + */ + relationship, + listRelationshipHistory: `${relationship}history`, + listRelationshipHistoryId: (id: string) => `${relationship}history/${id}`, + listRelationshipPublished: `${relationship}history/published`, + listRelationshipPublishedHistory: `${relationship}history/published-history`, + + /** + * api กลุ่มเลือด + */ + bloodGroup, + listBloodGroupHistory: `${bloodGroup}history`, + listBloodGroupHistoryId: (id: string) => `${bloodGroup}history/${id}`, + listBloodGroupPublished: `${bloodGroup}history/published`, + listBloodGroupPublishedHistory: `${bloodGroup}history/published-history`, + + /** + * api ศาสนา + */ + religion, + listReligionHistory: `${religion}history`, + listReligionHistoryId: (id: string) => `${religion}history/${id}`, + listReligionPublished: `${religion}history/published`, + listReligionPublishedHistory: `${religion}history/published-history`, + + /** + * api ระดับการศึกษา + */ + educationLevel, + listEducationLevelHistory: `${educationLevel}history`, + listEducationLevelHistoryId: (id: string) => `${educationLevel}history/${id}`, + listEducationLevelPublished: `${educationLevel}history/published`, + listEducationLevelPublishedHistory: `${educationLevel}history/published-history`, + + // API ใหม่ + orgRelationship, + orgRelationshipId: (id: string) => `${orgRelationship}${id}`, + orgPrefix, + orgPrefixId: (id: string) => `${orgPrefix}${id}`, + orgRank, + orgRankId: (id: string) => `${orgRank}${id}`, + orgBloodGroup, + orgBloodGroupId: (id: string) => `${orgBloodGroup}${id}`, + orgGender, + orgGenderId: (id: string) => `${orgGender}${id}`, + orgReligion, + orgReligionId: (id: string) => `${orgReligion}${id}`, + orgEducationLevel, + orgEducationLevelId: (id: string) => `${orgEducationLevel}${id}`, + + orgProvince, + orgDistrict, + orgSubDistrict, +}; diff --git a/src/api/manage/api.position.ts b/src/api/manage/api.position.ts new file mode 100644 index 00000000..f8e56110 --- /dev/null +++ b/src/api/manage/api.position.ts @@ -0,0 +1,105 @@ +/** + * api ระบบจัดการข้อมูลหลัก + * เมนูย่อย: ข้อมูลตำแหน่งของข้าราชการกรุงเทพมหานคร + */ +import env from "../index"; +const position = `${env.API_URI}/metadata/main/`; +const positionExecutiveSide = `${env.API_URI}/metadata/position-executive-side/`; +const positionLevel = `${env.API_URI}/metadata/position-level/`; +const positionPath = `${env.API_URI}/metadata/position-path/`; +const positionSide = `${env.API_URI}/metadata/position-path-side/`; +const positionType = `${env.API_URI}/metadata/position-type/`; +const positionStatus = `${env.API_URI}/metadata/position-status/`; +const positionLine = `${env.API_URI}/metadata/position-line/`; +const positionExecutive = `${env.API_URI}/metadata/position-executive/`; + +const orgPosType = `${env.API_URI}/org/pos/type/`; +const orgPosLevel = `${env.API_URI}/org/pos/level/`; +export default { + position: `${position}position`, + /** + * api ด้านทางการบริหาร + */ + positionExecutiveSide, + listPositionExecutiveSideHistory: `${positionExecutiveSide}history`, + listPositionExecutiveSideHistoryId: (id: string) => + `${positionExecutiveSide}history/${id}`, + listPositionExecutiveSidePublished: `${positionExecutiveSide}history/published`, + listPositionExecutiveSidePublishedHistory: `${positionExecutiveSide}history/published-history`, + + /** + * api ตำแหน่งในสายงาน + */ + // listPositionHistory: `${position}history`, + // listPositionHistoryId: (id: string) => `${position}history/${id}`, + // listPositionPublished: `${position}history/published`, + + /** + * api ระดับตำแหน่ง + */ + positionLevel, + listPositionLevelHistory: `${positionLevel}history`, + listPositionLevelHistoryId: (id: string) => `${positionLevel}history/${id}`, + listPositionLevelPublished: `${positionLevel}history/published`, + listPositionLevelPublishedHistory: `${positionLevel}history/published-history`, + + /** + * api ตำแหน่งในสายงาน + */ + positionPath, + listPositionPathHistory: `${positionPath}history`, + listPositionPathHistoryId: (id: string) => `${positionPath}history/${id}`, + listPositionPathPublished: `${positionPath}history/published`, + listPositionPathPublishedHistory: `${positionPath}history/published-history`, + + /** + * api ด้าน/สาขา + */ + positionSide, + listPositionSideHistory: `${positionSide}history`, + listPositionSideHistoryId: (id: string) => `${positionSide}history/${id}`, + listPositionSidePublished: `${positionSide}history/published`, + listPositionSidePublishedHistory: `${positionSide}history/published-history`, + + /** + * api ประเภทตำแหน่ง + */ + positionType, + listPositionTypeHistory: `${positionType}history`, + listPositionTypeHistoryId: (id: string) => `${positionType}history/${id}`, + listPositionTypePublished: `${positionType}history/published`, + listPositionTypePublishedHistory: `${positionType}history/published-history`, + + /** + * api สถานะของตำแหน่ง + */ + positionStatus, + listPositionStatusHistory: `${positionStatus}history`, + listPositionStatusHistoryId: (id: string) => `${positionStatus}history/${id}`, + listPositionStatusPublished: `${positionStatus}history/published`, + listPositionStatusPublishedHistory: `${positionStatus}history/published-history`, + + /** + * api สายงานของตำแหน่ง + */ + positionLine, + listPositionLineHistory: `${positionLine}history`, + listPositionLineHistoryId: (id: string) => `${positionLine}history/${id}`, + listPositionLinePublished: `${positionLine}history/published`, + listPositionLinePublishedHistory: `${positionLine}history/published-history`, + + /** + * api ตำแหน่งทางการบริหาร + */ + positionExecutive, + listPositionExecutiveHistory: `${positionExecutive}history`, + listPositionExecutiveHistoryId: (id: string) => + `${positionExecutive}history/${id}`, + listPositionExecutivePublished: `${positionExecutive}history/published`, + listPositionExecutivePublishedHistory: `${positionExecutive}history/published-history`, + + orgPosType, + orgPosTypeId: (id: string) => `${orgPosType}${id}`, + orgPosLevel, + orgPosLevelId: (id: string) => `${orgPosLevel}${id}`, +}; diff --git a/src/api/manage/api.positionEmployee.ts b/src/api/manage/api.positionEmployee.ts new file mode 100644 index 00000000..b919a14d --- /dev/null +++ b/src/api/manage/api.positionEmployee.ts @@ -0,0 +1,75 @@ +/** + * api ระบบจัดการข้อมูลหลัก + * เมนูย่อย: ข้อมูลตำแหน่งของลูกจ้างกรุงเทพมหานคร + */ +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/`; +const positionEmployeeLine = `${env.API_URI}/metadata/position-employee-line/`; +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 ตำแหน่ง + */ + positionEmployeePosition, + listPositionEmployeePositionHistory: `${positionEmployeePosition}history`, + listPositionEmployeePositionHistoryId: (id: string) => + `${positionEmployeePosition}history/${id}`, + listPositionEmployeePositionPublished: `${positionEmployeePosition}history/published`, + listPositionEmployeePositionPublishedHistory: `${positionEmployeePosition}history/published-history`, + + /** + * api ด้านของตำแหน่ง + */ + positionEmployeePositionSide, + listPositionEmployeePositionSideHistory: `${positionEmployeePositionSide}history`, + listPositionEmployeePositionSideHistoryId: (id: string) => + `${positionEmployeePositionSide}history/${id}`, + listPositionEmployeePositionSidePublished: `${positionEmployeePositionSide}history/published`, + listPositionEmployeePositionSidePublishedHistory: `${positionEmployeePositionSide}history/published-history`, + + /** + * api กลุ่มงาน + */ + positionEmployeeGroup, + listPositionEmployeeGroupHistory: `${positionEmployeeGroup}history`, + listPositionEmployeeGroupHistoryId: (id: string) => + `${positionEmployeeGroup}history/${id}`, + listPositionEmployeeGroupPublished: `${positionEmployeeGroup}history/published`, + listPositionEmployeeGroupPublishedHistory: `${positionEmployeeGroup}history/published-history`, + + /** + * api สายงาน + */ + positionEmployeeLine, + listPositionEmployeeLineHistory: `${positionEmployeeLine}history`, + listPositionEmployeeLineHistoryId: (id: string) => + `${positionEmployeeLine}history/${id}`, + listPositionEmployeeLinePublished: `${positionEmployeeLine}history/published`, + listPositionEmployeeLinePublishedHistory: `${positionEmployeeLine}history/published-history`, + + /** + * api ระดับชั้นงาน + */ + positionEmployeeLevel, + listPositionEmployeeLevelHistory: `${positionEmployeeLevel}history`, + listPositionEmployeeLevelHistoryId: (id: string) => + `${positionEmployeeLevel}history/${id}`, + listPositionEmployeeLevelPublished: `${positionEmployeeLevel}history/published`, + listPositionEmployeeLevelPublishedHistory: `${positionEmployeeLevel}history/published-history`, + + /** + * api สถานะของตำแหน่ง + */ + listPositionEmployeeStatusHistory: `${positionEmployeeStatus}history`, + listPositionEmployeeStatusHistoryId: (id: string) => + `${positionEmployeeStatus}history/${id}`, + listPositionEmployeeStatusPublished: `${positionEmployeeStatus}history/published`, + listPositionEmployeeStatusPublishedHistory: `${positionEmployeeStatus}history/published-history`, +}; diff --git a/src/api/registry/api.profile.ts b/src/api/registry/api.profile.ts new file mode 100644 index 00000000..75343c49 --- /dev/null +++ b/src/api/registry/api.profile.ts @@ -0,0 +1,219 @@ +/** + * api สรรหา - สอบแข่งขัน + */ +import env from "../index"; +const profile = `${env.API_URI_PROFILE_SERVICE}/profile/`; +const report = `${env.API_REPORT_URI}/report/profile/`; + +const organizationRoot = `${env.API_URI}/profile/organization/list/root`; +const registryNew = `${env.API_URI}/org/profile/`; +export default { + /** + * api สังกัด ทะเบียนประวัติเงินเดือน + */ + organizationRoot, + profileUser: `${profile}user`, + profileValidateId: (profileId: string) => `${profile}validate/${profileId}`, + profilePaperDownloadId: (id: string) => `${profile}paper/download/${id}`, + profilePaperId: (id: string) => `${profile}paper/${id}`, + + profileMultiId: (id: string) => `${profile}multi-paper/${id}`, + profileMultiOId: (id: string) => `${profile}multi-paper-other/${id}`, + profileMultiKId: (id: string) => `${profile}multi-paper-kk1/${id}`, + + profileHistoryselfId: (profileId: string) => + `${profile}/historyself${profileId}`, + + profileOrganiNameId: (id: string) => `${profile}organization/name/${id}`, + profileOrganiId: (id: string) => `${profile}organization/${id}`, + profileOrganiSelectId: (id: string) => `${profile}organization/select/${id}`, + profileOrganiRootId: (id: string) => `${profile}organization/root/${id}`, + + profileLeaveOrganiId: (id: string) => `${profile}leave/organization/${id}`, + + profileSearchNewOcId: (id: string) => `${profile}search/new/oc/${id}`, + profileSearchNewOcIdType: (id: string, type: string) => + `${profile}search/new/oc/${id}/${type}`, + profileSearchId: (id: string) => `${profile}search/${id}`, + profileSearchOcId: (id: string) => `${profile}search/oc/${id}`, + profileSearchNewOcLeaveId: (id: string) => + `${profile}search/new/oc/leave/${id}`, + profileSearchNewOcLeaveIdType: (id: string, type: string) => + `${profile}search/new/oc/leave/${id}/${type}`, + profileSearchOcLeaveId: (id: string) => `${profile}search/oc/leave/${id}`, + profileSearchNewEmOcId: (id: string) => + `${profile}search/new-employee/oc/${id}`, + profileSearchNewEmOcLeaveId: (id: string) => + `${profile}search/new-employee/oc/leave/${id}`, + profileSearchPersonal: () => `${profile}search-personal`, + profileEmployeeTempId: (id: string) => `${profile}employee/temp/${id}`, + + profileCoupleId: (profileId: string) => `${profile}couple/${profileId}`, + + profileFatherId: (profileId: string) => `${profile}father/${profileId}`, + + profileMotherId: (profileId: string) => `${profile}mother/${profileId}`, + + profileAdsId: (profileId: string) => `${profile}address/current/${profileId}`, + profileAdsCurAdrsId: (profileId: string) => + `${profile}address/currentAdrs/${profileId}`, + profileAdsRegisId: (profileId: string) => + `${profile}address/registration/${profileId}`, + + profileInsignId: (profileId: string) => `${profile}insignia/${profileId}`, + profileInsignHisId: (profileId: string) => + `${profile}insignia/history/${profileId}`, + profileInsignInsignId: (profileId: string) => + `${profile}insignia/insigniadiocesan/${profileId}`, + profileInsignToolList: `${profile}insignia/tool/list`, + + profileChildId: (profileId: string) => `${profile}children/${profileId}`, + + profileAssessmentId: (profileId: string) => + `${profile}assessment/${profileId}`, + profileAssessmentHisId: (profileId: string) => + `${profile}assessment/history/${profileId}`, + + profileHonorId: (profileId: string) => `${profile}honor/${profileId}`, + profileHonorHisId: (profileId: string) => + `${profile}honor/history/${profileId}`, + + profileCertId: (profileId: string) => `${profile}certificate/${profileId}`, + profileCertHisId: (profileId: string) => + `${profile}certificate/history/${profileId}`, + + profileAbiliId: (profileId: string) => `${profile}ability/${profileId}`, + profileAbiliHisId: (profileId: string) => + `${profile}ability/history/${profileId}`, + + profileDutyId: (profileId: string) => `${profile}duty/${profileId}`, + profileDutyHisId: (profileId: string) => + `${profile}duty/history/${profileId}`, + + profileOtherId: (profileId: string) => `${profile}other/${profileId}`, + profileOtherHisId: (profileId: string) => + `${profile}other/history/${profileId}`, + + profileNopaidId: (profileId: string) => `${profile}nopaid/${profileId}`, + profileNopaidHisId: (profileId: string) => + `${profile}nopaid/history/${profileId}`, + + profileAvaId: (profileId: string) => `${profile}avatar/${profileId}`, + profileAvaCurId: (profileId: string) => + `${profile}avatar/current/${profileId}`, + + profileEduId: (profileId: string) => `${profile}education/${profileId}`, + profileEduHisId: (profileId: string) => + `${profile}education/history/${profileId}`, + + profileSwapEducation: `${profile}swap_education`, + + profileTrainId: (profileId: string) => `${profile}training/${profileId}`, + profileTrainHisId: (profileId: string) => + `${profile}training/history/${profileId}`, + + profileDisId: (profileId: string) => `${profile}discipline/${profileId}`, + profileDisHisId: (profileId: string) => + `${profile}discipline/history/${profileId}`, + + profileSwapDiscipline: `${profile}swap_discipline`, + + profileLeaveId: (leaveId: string) => `${profile}leave/${leaveId}`, + profileLeaveHisId: (profileId: string) => + `${profile}leave/history/${profileId}`, + profileLeaveTotalId: (profileId: string) => + `${profile}leave/total/${profileId}`, + + profileSalaryId: (profileId: string) => `${profile}salary/${profileId}`, + profileSalaryHisId: (profileId: string) => + `${profile}salary/history/${profileId}`, + profileSalarySwapId: (id: string, direction: string) => + `${profile}salary/swap/${id}/${direction}`, + profileSalaryCopyId: (profileId: string) => + `${profile}salary-copy/${profileId}`, + + // ************************************ + profileSalaryEmployeeId: (profileId: string) => + `${profile}salary/employee/${profileId}`, + profileSalaryEmployeeHisId: (profileId: string) => + `${profile}salary/employee/history/${profileId}`, + // ************************************ + + profileInforId: (profileId: string) => `${profile}information/${profileId}`, + profileInforHisId: (profileId: string) => + `${profile}information/history/${profileId}`, + + profileGovId: (profileId: string) => `${profile}government/${profileId}`, + profileGovHisId: (profileId: string) => + `${profile}government/history/${profileId}`, + + profileCalGovId: (profileId: string) => `${profile}cal/gov/${profileId}`, + + profileFamiId: (profileId: string) => `${profile}family/${profileId}`, + profileFamiHisId: (profileId: string) => + `${profile}family/history/${profileId}`, + + profileAdrsId: (profileId: string) => `${profile}address/${profileId}`, + profileAdrsHisId: (profileId: string) => + `${profile}address/history/${profileId}`, + searchProfileByOcId: (OcId: string, type: string) => + `${profile}search/new/oc/${OcId}/${type}`, + searchProfileTemp: (type: string) => `${profile}search/new/oc/${type}`, + + profileAvatarId: (profileId: string) => `${profile}avatar/${profileId}`, + profileAvatarHistoryId: (profileId: string) => + `${profile}avatar/history/${profileId}`, + + profileCheckId: (profileId: string) => `${profile}check/${profileId}`, + + profileOrganizRoot: `${profile}organization/root`, + + profileCalRetire: `${profile}cal/retire`, + profilePositionNumber: `${profile}position-number`, + organizationName: (ocId: string) => `${profile}organization/${ocId}`, + profileDeactive: (profileId: string) => `${profile}deactive/${profileId}`, + profileReactive: (profileId: string) => `${profile}reactive/${profileId}`, + + profileReportId: (profileId: string) => `${report}kk1/${profileId}`, + profileKp7ShortId: (profileId: string) => `${report}kp7-short/${profileId}`, + + profileChangeNameId: (profileId: string) => + `${profile}changeName/${profileId}`, + profileChangeNameHisId: (profileId: string) => + `${profile}changeName/history/${profileId}`, + + profileCitizenId: (citizenId: string) => `${profile}citizenId/${citizenId}`, + profileEmployeeIn: `${profile}information/employee`, + + profileHistory: (type: string) => `${profile}search/history/oc/${type}`, + + //ระบบ ลูกจ้างชั่คราว + employmentId: (profileId: string) => `${profile}employment/${profileId}`, + employmentHistoryId: (employmentId: string) => + `${profile}employment/history/${employmentId}`, + + searchPersonal: () => `${profile}search-personal`, + + //สร้างข้อมูลราชการ + createProfileOfficer: () => `${profile}information/officer`, + + // verify + profileVerified: (profileId: string) => `${profile}verified/${profileId}`, + profileVerifiedUnlock: (profileId: string) => + `${profile}not-verified/${profileId}`, + profileSendVerified: (profileId: string) => + `${profile}send-verified/${profileId}`, + listVerified: () => `${profile}list-verified`, + registryNew, + registryNewId: (id: string) => `${registryNew}${id}`, + profileNewCitizenId: (citizenId: string) => + `${registryNew}citizenId/${citizenId}`, + + /**ปรับรายการเงินเดือนขึ้น-ลง*/ + salarySwap: (dierction: string, id: string) => + `${profile}salary/swap/${dierction}/${id}`, + listProfileNew:(id:string,page:number,pageSize:number)=>`${profile}search/new-page/oc/${id}/officer?page=${page}&pageSize=${pageSize}`, + + + orgProfileAvatar:`${registryNew}avatar` +}; diff --git a/src/api/registry/api.registry.ts b/src/api/registry/api.registry.ts new file mode 100644 index 00000000..ad88412d --- /dev/null +++ b/src/api/registry/api.registry.ts @@ -0,0 +1,180 @@ +import env from "../index"; + +const registryNew = `${env.API_URI}/org/profile`; +const metadata = `${env.API_URI}/org/metadata/`; + +export default { + registryNew: (type: string) => `${registryNew}${type}`, + registryNewByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/${profileId}`, + + // metadata + profileNewMetaMain: `${metadata}main/person`, + profileNewProvince: `${metadata}province`, + profileNewDistrictByPId: (id: string) => `${metadata}province/${id}`, + profileNewSubDistrictByDId: (id: string) => `${metadata}district/${id}`, + + // ประวัติส่วนตัว + profileNewProfileById: (dataId: string, type: string) => + `${registryNew}${type}/${dataId}`, + profileNewProfileHisById: (dataId: string, type: string) => + `${registryNew}${type}/history/${dataId}`, + + // ข้อมูลที่อยู่ + profileNewAddressByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/address/${profileId}`, + profileNewAddressById: (dataId: string, type: string) => + `${registryNew}${type}/address/${dataId}`, + profileNewAddressHisById: (dataId: string, type: string) => + `${registryNew}${type}/address/history/${dataId}`, + + // บันทึกวันที่ไม่ได้รับเงินเดือนฯ + profileNewNoPaid: (type: string) => `${registryNew}${type}/nopaid`, + profileNewNoPaidByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/nopaid/${profileId}`, + profileNewNoPaidById: (dataId: string, type: string) => + `${registryNew}${type}/nopaid/${dataId}`, + profileNewNoPaidHisById: (dataId: string, type: string) => + `${registryNew}${type}/nopaid/history/${dataId}`, + + // เครื่องราชฯ + profileNewInsign: (type: string) => `${registryNew}${type}/insignia`, + profileNewInsignByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/insignia/${profileId}`, + profileNewInsignById: (dataId: string, type: string) => + `${registryNew}${type}/insignia/${dataId}`, + profileNewInsignHisById: (dataId: string, type: string) => + `${registryNew}${type}/insignia/history/${dataId}`, + + // ประกาศเกียรติคุณ + profileNewHonor: (type: string) => `${registryNew}${type}/honor`, + profileNewHonorByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/honor/${profileId}`, + profileNewHonorById: (dataId: string, type: string) => + `${registryNew}${type}/honor/${dataId}`, + profileNewHonorHisById: (dataId: string, type: string) => + `${registryNew}${type}/honor/history/${dataId}`, + + // ผลการประเมินการปฏิบัติราชการ + profileNewAssessments: (type: string) => `${registryNew}${type}/assessments`, + profileNewAssessmentsByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/assessments/${profileId}`, + profileNewAssessmentsById: (dataId: string, type: string) => + `${registryNew}${type}/assessments/${dataId}`, + profileNewAssessmentsHisById: (dataId: string, type: string) => + `${registryNew}${type}/assessments/history/${dataId}`, + + // การฝึกอบรม + profileNewTraining: (type: string) => `${registryNew}${type}/training`, + profileNewTrainingByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/training/${profileId}`, + profileNewTrainingByTrainingId: (trainingId: string, type: string) => + `${registryNew}${type}/training/${trainingId}`, + profileNewTrainingHisByTrainingId: (trainingId: string, type: string) => + `${registryNew}${type}/training/history/${trainingId}`, + + // ประวัติการศึกษา + profileNewEducation: (type: string) => `${registryNew}${type}/educations`, + profileNewEducationByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/educations/${profileId}`, + profileNewEducationByEducationId: (educationId: string, type: string) => + `${registryNew}${type}/educations/${educationId}`, + profileNewEducationHisByEducationId: (educationsId: string, type: string) => + `${registryNew}${type}/educations/history/${educationsId}`, + + // ความสามารถพิเศษ + profileNewAbility: (type: string) => `${registryNew}${type}/ability`, + profileNewAbilityByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/ability/${profileId}`, + profileNewAbilityByAbilityId: (abilityId: string, type: string) => + `${registryNew}${type}/ability/${abilityId}`, + profileNewAbilityHisByAbilityId: (abilityId: string, type: string) => + `${registryNew}${type}/ability/history/${abilityId}`, + + // ใบอนุญาตประกอบวิชาชีพ + profileNewCertificate: (type: string) => `${registryNew}${type}/certificate`, + profileNewCertificateByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/certificate/${profileId}`, + profileNewCertificateByCertificateId: (certificateId: string, type: string) => + `${registryNew}${type}/certificate/${certificateId}`, + profileNewCertificateHisByCertificateId: ( + certificateId: string, + type: string + ) => `${registryNew}${type}/certificate/history/${certificateId}`, + + // ข้อมูลอื่นๆ + profileNewOther: (type: string) => `${registryNew}${type}/other`, + profileNewOtherByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/other/${profileId}`, + profileNewOtherById: (dataId: string, type: string) => + `${registryNew}${type}/other/${dataId}`, + profileNewOtherHisById: (dataId: string, type: string) => + `${registryNew}${type}/other/history/${dataId}`, + + // ข้อมูลครอบครัว + profileNewFamily: (type: string) => `${registryNew}${type}/family`, + profileNewFamilyByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/family/${profileId}`, + profileNewFamilyByFamilyId: (familyId: string, type: string) => + `${registryNew}${type}/family/${familyId}`, + profileNewFamilyHisByFamilyId: (familyId: string, type: string) => + `${registryNew}${type}/family/history/${familyId}`, + + // วินัย + profileNewDiscipline: (type: string) => `${registryNew}${type}/discipline`, + profileNewDisciplineByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/discipline/${profileId}`, + profileNewDisciplineByDisciplineId: (disciplineId: string, type: string) => + `${registryNew}${type}/discipline/${disciplineId}`, + profileNewDisciplineHisByDisciplineId: (disciplineId: string, type: string) => + `${registryNew}${type}/discipline/history/${disciplineId}`, + + // ปฏิบัติราชการพิเศษ + profileNewDuty: (type: string) => `${registryNew}${type}/duty`, + profileNewDutyByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/duty/${profileId}`, + profileNewDutyByDutyId: (dutyId: string, type: string) => + `${registryNew}${type}/duty/${dutyId}`, + profileNewDutyHisByDutyId: (dutyId: string, type: string) => + `${registryNew}${type}/duty/history/${dutyId}`, + + //ข้อมูลราชการ + profileNewGovernment: (type: string) => `${registryNew}${type}/government`, + profileNewGovernmentById: (id: string, type: string) => + `${registryNew}${type}/government/${id}`, + profileNewGovernmentHistory: (id: string, type: string) => + `${registryNew}${type}/government/history/${id}`, + + //การลา + profileNewLeave: (type: string) => `${registryNew}${type}/leave`, + profileNewLeaveById: (id: string, type: string) => + `${registryNew}${type}/leave/${id}`, + profileNewLeaveHistory: (id: string, type: string) => + `${registryNew}${type}/leave/history/${id}`, + profileCheckDate: () => `${env.API_URI}/leave/user/check`, + profileNewLeaveType: () => `${env.API_URI}/leave/type`, + + /** ตำแหน่งเงินเดือน*/ + profileSalaryNew: (type: string) => `${registryNew}${type}/salary`, + profileListSalaryNew: (id: string, type: string) => + `${registryNew}${type}/salary/${id}`, + profileListSalaryHistoryNew: (profileId: string, type: string) => + `${registryNew}${type}/salary/history/${profileId}`, + profileSalarySwapNew: (type: string, id: string, type2: string) => + `${registryNew}${type2}/salary/swap/${type}/${id}`, + + // ประวัติการเปลี่ยนชื่อ-นามสกุล + profileNewChangeName: (type: string) => `${registryNew}${type}/changeName`, + profileNewChangeNameByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/changeName/${profileId}`, + profileNewChangeNameByChangeNameId: (changeNameId: string, type: string) => + `${registryNew}${type}/changeName/${changeNameId}`, + profileNewChangeNameHisByChangeNameId: (changeNameId: string, type: string) => + `${registryNew}${type}/changeName/history/${changeNameId}`, + + //ข้อมูลครอบครับ + profileFamily: (empType: string, type: string) => + `${registryNew}${empType}/family/${type}`, + profileFamilyHistory: (id: string, empType: string, type: string) => + `${registryNew}${empType}/family/${type}/history/${id}`, +}; diff --git a/src/api/reports/api.report.ts b/src/api/reports/api.report.ts new file mode 100644 index 00000000..5508f22b --- /dev/null +++ b/src/api/reports/api.report.ts @@ -0,0 +1,49 @@ +/** + * api รายงานทั้งหมด + */ +import env from "../index"; +const reportOrder = `${env.API_REPORT2_URI}/report/order`; +const reportRetire = `${env.API_REPORT2_URI}/report/retire`; +const reportProbation = `${env.API_REPORT2_URI}/report/probation`; +const reportResign = `${env.API_REPORT2_URI}/report/resign/33`; +const reportTransfer = `${env.API_REPORT2_URI}/report/transfer`; +const reportDeceased = `${env.API_REPORT2_URI}/report/deceased`; +const reportTemplate = `${env.API_REPORT_TEMPLATE_URI}`; + +export default { + reportOrderCover: (fileType: string, id: string, commandCode: string) => + `${reportOrder}/${commandCode}/cover/${fileType}/${id}`, + reportOrderAttachment: (fileType: string, id: string, commandCode: string) => + `${reportOrder}/${commandCode}/attachment/${fileType}/${id}`, + reportRetireList: (fileType: string, id: string) => + `${reportRetire}/${fileType}/${id}`, + reportResignList: (fileType: string, id: string) => + `${reportResign}/${fileType}/${id}`, + + fileCover: (format: string, fileType: string, id: string) => + `${reportOrder}/${format}/cover/${fileType}/${id}`, + fileAttachment: (format: string, fileType: string, id: string) => + `${reportOrder}/${format}/attachment/${fileType}/${id}`, + + //ระบบทดลองงาน + reportAssign: (type: string, id: string) => + `${reportProbation}/13/${type}/${id}`, + reportEvaluateRecord1: (type: string, id: string) => + `${reportProbation}/14/${type}/${id}`, + // reportEvaluateRecord2:(type:string, id:string) => `${reportProbation}/15/${type}/${id}`, + reportEvaluate: (type: string, id: string) => + `${reportProbation}/16/${type}/${id}`, + reportEvaluateChairman: (type: string, id: string) => + `${reportProbation}/17/${type}/${id}`, + reportEvaluateResult: (type: string, id: string) => + `${reportProbation}/19/${type}/${id}`, + // reportSurvey:(type:string, id:string) => `${reportProbation}/19/${type}/${id}`, + + //filetransfer + reportTransferFile: (no: number, type: string, id: string) => + `${reportTransfer}/${no}/${type}/${id}`, + + DeceasedReport: (type: string, id: string) => + `${reportDeceased}/36/${type}/${id}`, + reportTemplate, +}; diff --git a/src/app.config.ts b/src/app.config.ts new file mode 100644 index 00000000..e77dc80e --- /dev/null +++ b/src/app.config.ts @@ -0,0 +1,70 @@ +/**ใช้รวมไฟล์ย่อยๆ ของ api แต่ละไฟล์ */ + +/** API Metadata */ +import manageOrganization from "./api/manage/api.organization"; +import managePerson from "./api/manage/api.person"; +import managePosition from "./api/manage/api.position"; +import managePositionEmployee from "./api/manage/api.positionEmployee"; +import manageInsignia from "./api/manage/api.insignia"; +import manageHoliday from "./api/manage/api.holiday"; + +/** API Tree List */ +import organizationTreeList from "./api/02_organizational/api.treelist"; + +/** API Structure & Org Chart */ +import organizationChart from "./api/02_organizational/api.chart"; + +/** API Profile List */ +import profile from "./api/registry/api.profile"; +import registry from "./api/registry/api.registry"; + +/** API dashboard */ +import message from "./api/00_dashboard/api.message"; + +/** API reports */ +import reports from "./api/reports/api.report"; + +/** API โครงสร้างอัตรากำลัง*/ +import organization from "./api/02_organizational/api.organization"; + +import file from "./api/file/api.file"; + +// environment variables +export const compettitivePanel = import.meta.env.VITE_COMPETITIVE_EXAM_PANEL; +export const qualifyDisableExamPanel = import.meta.env + .VITE_QUALIFY_DISABLE_EMAM_PANEL; +export const qualifyExamPanel = import.meta.env.VITE_QUALIFY_EXAM_PANEL; + +const API = { + //Metadata + ...manageOrganization, + ...managePerson, + ...managePosition, + ...managePositionEmployee, + ...manageInsignia, + ...manageHoliday, + + // โครงสร้างอัตรากำลัง + ...organization, + + //Tree List + ...organizationTreeList, + ...organizationChart, + + //profile + ...profile, + ...registry, + + //dashboard + ...message, + + //reports + ...reports, + + /*file*/ + ...file, +}; + +export default { + API: API, +}; diff --git a/src/assets/05_modules.pdf b/src/assets/05_modules.pdf new file mode 100644 index 00000000..74cddeb3 Binary files /dev/null and b/src/assets/05_modules.pdf differ diff --git a/src/assets/avatar_user.jpg b/src/assets/avatar_user.jpg new file mode 100644 index 00000000..bcf5bdb6 Binary files /dev/null and b/src/assets/avatar_user.jpg differ diff --git a/src/assets/base.css b/src/assets/base.css new file mode 100644 index 00000000..e69de29b diff --git a/src/assets/logo.png b/src/assets/logo.png new file mode 100644 index 00000000..3cdb6417 Binary files /dev/null and b/src/assets/logo.png differ diff --git a/src/assets/logo.svg b/src/assets/logo.svg new file mode 100644 index 00000000..bc826fed --- /dev/null +++ b/src/assets/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/main.css b/src/assets/main.css new file mode 100644 index 00000000..10a9330c --- /dev/null +++ b/src/assets/main.css @@ -0,0 +1,35 @@ +/* @import './base.css'; */ + +/* #app { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + + font-weight: normal; +} + +a, +.green { + text-decoration: none; + color: hsla(160, 100%, 37%, 1); + transition: 0.4s; +} + +@media (hover: hover) { + a:hover { + background-color: hsla(160, 100%, 37%, 0.2); + } +} + +@media (min-width: 1024px) { + body { + display: flex; + place-items: center; + } + + #app { + display: grid; + grid-template-columns: 1fr 1fr; + padding: 0 2rem; + } +} */ diff --git a/src/components/CardProfile.vue b/src/components/CardProfile.vue new file mode 100644 index 00000000..af2afff7 --- /dev/null +++ b/src/components/CardProfile.vue @@ -0,0 +1,170 @@ + + + + + diff --git a/src/components/CurruncyInput.vue b/src/components/CurruncyInput.vue new file mode 100644 index 00000000..9386d093 --- /dev/null +++ b/src/components/CurruncyInput.vue @@ -0,0 +1,60 @@ + + + diff --git a/src/components/CustomDialog.vue b/src/components/CustomDialog.vue new file mode 100644 index 00000000..7db46419 --- /dev/null +++ b/src/components/CustomDialog.vue @@ -0,0 +1,90 @@ + + + diff --git a/src/components/DialogAddEmployee.vue b/src/components/DialogAddEmployee.vue new file mode 100644 index 00000000..84186868 --- /dev/null +++ b/src/components/DialogAddEmployee.vue @@ -0,0 +1,670 @@ + + + + + diff --git a/src/components/DialogHeader.vue b/src/components/DialogHeader.vue new file mode 100644 index 00000000..77d936c9 --- /dev/null +++ b/src/components/DialogHeader.vue @@ -0,0 +1,29 @@ + + diff --git a/src/components/Dialogs/AddPersonal.vue b/src/components/Dialogs/AddPersonal.vue new file mode 100644 index 00000000..1613ddf0 --- /dev/null +++ b/src/components/Dialogs/AddPersonal.vue @@ -0,0 +1,334 @@ + + + diff --git a/src/components/Dialogs/DialogOrgSelect.vue b/src/components/Dialogs/DialogOrgSelect.vue new file mode 100644 index 00000000..a819c439 --- /dev/null +++ b/src/components/Dialogs/DialogOrgSelect.vue @@ -0,0 +1,901 @@ + + + diff --git a/src/components/Dialogs/DialogOrgSelectEmployee.vue b/src/components/Dialogs/DialogOrgSelectEmployee.vue new file mode 100644 index 00000000..b4f942fd --- /dev/null +++ b/src/components/Dialogs/DialogOrgSelectEmployee.vue @@ -0,0 +1,880 @@ + + + diff --git a/src/components/Dialogs/DialogOrgSelectOneStep.vue b/src/components/Dialogs/DialogOrgSelectOneStep.vue new file mode 100644 index 00000000..1f471b32 --- /dev/null +++ b/src/components/Dialogs/DialogOrgSelectOneStep.vue @@ -0,0 +1,577 @@ + + + diff --git a/src/components/Dialogs/Information.vue b/src/components/Dialogs/Information.vue new file mode 100644 index 00000000..28373e80 --- /dev/null +++ b/src/components/Dialogs/Information.vue @@ -0,0 +1,39 @@ + + + \ No newline at end of file diff --git a/src/components/Dialogs/PopupPersonal.vue b/src/components/Dialogs/PopupPersonal.vue new file mode 100644 index 00000000..554cfc7b --- /dev/null +++ b/src/components/Dialogs/PopupPersonal.vue @@ -0,0 +1,406 @@ + + + + + diff --git a/src/components/Dialogs/PopupPersonalNew.vue b/src/components/Dialogs/PopupPersonalNew.vue new file mode 100644 index 00000000..70a35f1b --- /dev/null +++ b/src/components/Dialogs/PopupPersonalNew.vue @@ -0,0 +1,420 @@ + + + + + diff --git a/src/components/Dialogs/PopupReason.vue b/src/components/Dialogs/PopupReason.vue new file mode 100644 index 00000000..d151fe55 --- /dev/null +++ b/src/components/Dialogs/PopupReason.vue @@ -0,0 +1,96 @@ + + + diff --git a/src/components/Dialogs/PopupReplyInbox.vue b/src/components/Dialogs/PopupReplyInbox.vue new file mode 100644 index 00000000..1eed8b25 --- /dev/null +++ b/src/components/Dialogs/PopupReplyInbox.vue @@ -0,0 +1,111 @@ + + + diff --git a/src/components/DropDownNoResultMsg.vue b/src/components/DropDownNoResultMsg.vue new file mode 100644 index 00000000..ef9fbc5f --- /dev/null +++ b/src/components/DropDownNoResultMsg.vue @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/src/components/FullLoader.vue b/src/components/FullLoader.vue new file mode 100644 index 00000000..0457e3ed --- /dev/null +++ b/src/components/FullLoader.vue @@ -0,0 +1,24 @@ + + + + + + diff --git a/src/components/PopupCheckFeatures.vue b/src/components/PopupCheckFeatures.vue new file mode 100644 index 00000000..d936249b --- /dev/null +++ b/src/components/PopupCheckFeatures.vue @@ -0,0 +1,213 @@ + + + diff --git a/src/components/Selector.vue b/src/components/Selector.vue new file mode 100644 index 00000000..351fad7a --- /dev/null +++ b/src/components/Selector.vue @@ -0,0 +1,19 @@ + + diff --git a/src/components/Table.vue b/src/components/Table.vue new file mode 100644 index 00000000..1c1fbdca --- /dev/null +++ b/src/components/Table.vue @@ -0,0 +1,90 @@ + + + + diff --git a/src/components/TableHistory.vue b/src/components/TableHistory.vue new file mode 100644 index 00000000..b1f91f90 --- /dev/null +++ b/src/components/TableHistory.vue @@ -0,0 +1,227 @@ + + + diff --git a/src/components/TableView.vue b/src/components/TableView.vue new file mode 100644 index 00000000..5db35ea6 --- /dev/null +++ b/src/components/TableView.vue @@ -0,0 +1,570 @@ + + + diff --git a/src/components/TableView1.vue b/src/components/TableView1.vue new file mode 100644 index 00000000..d8b43c61 --- /dev/null +++ b/src/components/TableView1.vue @@ -0,0 +1,412 @@ + + + diff --git a/src/components/ViewPDF.vue b/src/components/ViewPDF.vue new file mode 100644 index 00000000..e69de29b diff --git a/src/components/__tests__/HelloWorld.spec.ts b/src/components/__tests__/HelloWorld.spec.ts new file mode 100644 index 00000000..ccc7c3b7 --- /dev/null +++ b/src/components/__tests__/HelloWorld.spec.ts @@ -0,0 +1,11 @@ +import { describe, it, expect } from "vitest"; + +import { mount } from "@vue/test-utils"; +// import HelloWorld from '../HelloWorld.vue' + +describe("HelloWorld", () => { + it("renders properly", () => { + // const wrapper = mount(HelloWorld, { props: { msg: 'Hello Vitest' } }) + // expect(wrapper.text()).toContain('Hello Vitest') + }); +}); diff --git a/src/components/icons/IconCommunity.vue b/src/components/icons/IconCommunity.vue new file mode 100644 index 00000000..2dc8b055 --- /dev/null +++ b/src/components/icons/IconCommunity.vue @@ -0,0 +1,7 @@ + diff --git a/src/components/icons/IconDocumentation.vue b/src/components/icons/IconDocumentation.vue new file mode 100644 index 00000000..6d4791cf --- /dev/null +++ b/src/components/icons/IconDocumentation.vue @@ -0,0 +1,7 @@ + diff --git a/src/components/icons/IconEcosystem.vue b/src/components/icons/IconEcosystem.vue new file mode 100644 index 00000000..c3a4f078 --- /dev/null +++ b/src/components/icons/IconEcosystem.vue @@ -0,0 +1,7 @@ + diff --git a/src/components/icons/IconSupport.vue b/src/components/icons/IconSupport.vue new file mode 100644 index 00000000..7452834d --- /dev/null +++ b/src/components/icons/IconSupport.vue @@ -0,0 +1,7 @@ + diff --git a/src/components/icons/IconTooling.vue b/src/components/icons/IconTooling.vue new file mode 100644 index 00000000..660598d7 --- /dev/null +++ b/src/components/icons/IconTooling.vue @@ -0,0 +1,19 @@ + + diff --git a/src/components/information/Address.vue b/src/components/information/Address.vue new file mode 100644 index 00000000..7db4b841 --- /dev/null +++ b/src/components/information/Address.vue @@ -0,0 +1,873 @@ + + diff --git a/src/components/information/Assessment.vue b/src/components/information/Assessment.vue new file mode 100644 index 00000000..44cb4f5f --- /dev/null +++ b/src/components/information/Assessment.vue @@ -0,0 +1,980 @@ + + + + diff --git a/src/components/information/Certicate.vue b/src/components/information/Certicate.vue new file mode 100644 index 00000000..5151d590 --- /dev/null +++ b/src/components/information/Certicate.vue @@ -0,0 +1,827 @@ + + + + diff --git a/src/components/information/Coin.vue b/src/components/information/Coin.vue new file mode 100644 index 00000000..0e3ea770 --- /dev/null +++ b/src/components/information/Coin.vue @@ -0,0 +1,838 @@ + + + + diff --git a/src/components/information/DialogFooter.vue b/src/components/information/DialogFooter.vue new file mode 100644 index 00000000..c7b6623b --- /dev/null +++ b/src/components/information/DialogFooter.vue @@ -0,0 +1,135 @@ + + diff --git a/src/components/information/DialogHeader.vue b/src/components/information/DialogHeader.vue new file mode 100644 index 00000000..8aa03351 --- /dev/null +++ b/src/components/information/DialogHeader.vue @@ -0,0 +1,27 @@ + + diff --git a/src/components/information/DialogHistory.vue b/src/components/information/DialogHistory.vue new file mode 100644 index 00000000..7c08e304 --- /dev/null +++ b/src/components/information/DialogHistory.vue @@ -0,0 +1,45 @@ + + diff --git a/src/components/information/Discipline.vue b/src/components/information/Discipline.vue new file mode 100644 index 00000000..186b8534 --- /dev/null +++ b/src/components/information/Discipline.vue @@ -0,0 +1,941 @@ + + + + diff --git a/src/components/information/Document.vue b/src/components/information/Document.vue new file mode 100644 index 00000000..8e5ca167 --- /dev/null +++ b/src/components/information/Document.vue @@ -0,0 +1,269 @@ + + diff --git a/src/components/information/Education.vue b/src/components/information/Education.vue new file mode 100644 index 00000000..a666ae93 --- /dev/null +++ b/src/components/information/Education.vue @@ -0,0 +1,1561 @@ + + + + diff --git a/src/components/information/Family.vue b/src/components/information/Family.vue new file mode 100644 index 00000000..8d0d41d2 --- /dev/null +++ b/src/components/information/Family.vue @@ -0,0 +1,1511 @@ + + diff --git a/src/components/information/Government.vue b/src/components/information/Government.vue new file mode 100644 index 00000000..0deed611 --- /dev/null +++ b/src/components/information/Government.vue @@ -0,0 +1,761 @@ + + diff --git a/src/components/information/Image.vue b/src/components/information/Image.vue new file mode 100644 index 00000000..b120f8fa --- /dev/null +++ b/src/components/information/Image.vue @@ -0,0 +1,453 @@ + + + diff --git a/src/components/information/Information.vue b/src/components/information/Information.vue new file mode 100644 index 00000000..2e466f97 --- /dev/null +++ b/src/components/information/Information.vue @@ -0,0 +1,1141 @@ + + diff --git a/src/components/information/Insignia.vue b/src/components/information/Insignia.vue new file mode 100644 index 00000000..9454a4cc --- /dev/null +++ b/src/components/information/Insignia.vue @@ -0,0 +1,1339 @@ + + + + diff --git a/src/components/information/Leave.vue b/src/components/information/Leave.vue new file mode 100644 index 00000000..1e3c635e --- /dev/null +++ b/src/components/information/Leave.vue @@ -0,0 +1,1266 @@ + + + + diff --git a/src/components/information/OldName.vue b/src/components/information/OldName.vue new file mode 100644 index 00000000..c19edc7c --- /dev/null +++ b/src/components/information/OldName.vue @@ -0,0 +1,973 @@ + + + + diff --git a/src/components/information/Other.vue b/src/components/information/Other.vue new file mode 100644 index 00000000..d7886ebb --- /dev/null +++ b/src/components/information/Other.vue @@ -0,0 +1,619 @@ + + + diff --git a/src/components/information/Record.vue b/src/components/information/Record.vue new file mode 100644 index 00000000..62f9e5cd --- /dev/null +++ b/src/components/information/Record.vue @@ -0,0 +1,824 @@ + + + + diff --git a/src/components/information/Salary.vue b/src/components/information/Salary.vue new file mode 100644 index 00000000..ad80a318 --- /dev/null +++ b/src/components/information/Salary.vue @@ -0,0 +1,2078 @@ + + + + diff --git a/src/components/information/SalaryEmployee.vue b/src/components/information/SalaryEmployee.vue new file mode 100644 index 00000000..5de63a46 --- /dev/null +++ b/src/components/information/SalaryEmployee.vue @@ -0,0 +1,2009 @@ + + + + diff --git a/src/components/information/SalaryEmployeeTemp.vue b/src/components/information/SalaryEmployeeTemp.vue new file mode 100644 index 00000000..267763b1 --- /dev/null +++ b/src/components/information/SalaryEmployeeTemp.vue @@ -0,0 +1,2039 @@ + + + + diff --git a/src/components/information/Table.vue b/src/components/information/Table.vue new file mode 100644 index 00000000..387fc906 --- /dev/null +++ b/src/components/information/Table.vue @@ -0,0 +1,215 @@ + + + diff --git a/src/components/information/TableProfile.vue b/src/components/information/TableProfile.vue new file mode 100644 index 00000000..fb6d15b0 --- /dev/null +++ b/src/components/information/TableProfile.vue @@ -0,0 +1,692 @@ + + + diff --git a/src/components/information/Talent.vue b/src/components/information/Talent.vue new file mode 100644 index 00000000..607eee42 --- /dev/null +++ b/src/components/information/Talent.vue @@ -0,0 +1,683 @@ + + + diff --git a/src/components/information/Train.vue b/src/components/information/Train.vue new file mode 100644 index 00000000..2ecb391a --- /dev/null +++ b/src/components/information/Train.vue @@ -0,0 +1,1128 @@ + + + + diff --git a/src/components/information/Work.vue b/src/components/information/Work.vue new file mode 100644 index 00000000..cfec85ef --- /dev/null +++ b/src/components/information/Work.vue @@ -0,0 +1,907 @@ + + + + diff --git a/src/components/information/interface/index/Main.ts b/src/components/information/interface/index/Main.ts new file mode 100644 index 00000000..25c5cfe8 --- /dev/null +++ b/src/components/information/interface/index/Main.ts @@ -0,0 +1,84 @@ +import type { zipCodeOption } from "@/components/information/interface/index/profileType"; +interface Pagination { + rowsPerPage: number; +} + +interface DataOption { + id: string; + name: string; + disable?: boolean; +} + +interface DataOptionLeave { + id: string; + name: string; + totalLeave: number; +} + +interface DataOptionInsignia { + id: string; + name: string; + typeName: string; +} + +interface treeTab { + id: string; + label: string; + children: treeTab[]; +} + +interface InformationOps { + prefixOps: DataOption[]; + prefixOldOps: DataOption[]; + genderOps: DataOption[]; + bloodOps: DataOption[]; + statusOps: DataOption[]; + religionOps: DataOption[]; + employeeClassOps: DataOption[]; + employeeTypeOps: DataOption[]; +} + +interface OldNameOps { + prefixOps: DataOption[]; + statusOps: DataOption[]; +} + +interface AddressOps { + provinceOps: DataOption[]; + districtOps: DataOption[]; + districtCOps: DataOption[]; + subdistrictOps: zipCodeOption[]; + subdistrictCOps: zipCodeOption[]; +} + +interface FamilyOps { + prefixOps: DataOption[]; +} + +interface EduOps { + levelOptions: DataOption[]; + positionPathOptions: DataOption[]; +} + +interface InsigniaOps { + insigniaOptions: DataOptionInsignia[]; +} + +interface DisciplineOps { + levelOptions: DataOption[]; +} + +export type { + Pagination, + DataOption, + DataOptionInsignia, + treeTab, + InformationOps, + OldNameOps, + AddressOps, + FamilyOps, + EduOps, + InsigniaOps, + DisciplineOps, + DataOptionLeave, +}; diff --git a/src/components/information/interface/index/profileType.ts b/src/components/information/interface/index/profileType.ts new file mode 100644 index 00000000..a3e94f83 --- /dev/null +++ b/src/components/information/interface/index/profileType.ts @@ -0,0 +1,210 @@ +//interface class array object {name string ,id number} + +import type { childrenFamily } from "@/modules/04_registry/interface/response/Family"; +interface ChangeActive { + name: string; + id: number; +} + +//ข้อมูลส่วนตัว +interface Information { + cardid: string | null; + prefix: string | null; + age: string | null; + prefixId: string | null; + firstname: string | null; + lastname: string | null; + birthDate: Date | null; + genderId: string | null; + bloodId: string | null; + nationality: string | null; + ethnicity: string | null; + statusId: string | null; + religionId: string | null; + tel: string | null; + employeeType: string | null; + employeeClass: string | null; + profileType: string | null; +} + +interface Family { + prefixC: string | null; // couple + prefixIdC: string | null; + firstnameC: string | null; + lastnameC: string | null; + lastnameCOld: string | null; + occupationC: string | null; + citizenIdC: string | null; + liveC: string | null; + prefixM: string | null; // male + prefixIdM: string | null; + firstnameM: string | null; + lastnameM: string | null; + occupationM: string | null; + citizenIdM: string | null; + liveM: string | null; + prefixF: string | null; // female + prefixIdF: string | null; + firstnameF: string | null; + lastnameF: string | null; + occupationF: string | null; + citizenIdF: string | null; + liveF: string | null; + same: string | null; + childrens: childrenFamily[]; +} + +interface Address { + address: string | null; + provinceId: string | null; + districtId: string | null; + subdistrictId: string | null; + addressC: string | null; + provinceIdC: string | null; + districtIdC: string | null; + subdistrictIdC: string | null; + same: string | null; + codec: string | null; + codep: string | null; +} + +interface Goverment { + ocId: string | null; + positionId: string | null; + positionPathSide: string | null; + positionLine: string | null; + positionType: string | null; + positionLevel: string | null; + numberId: string | null; + positionExecutive: string | null; + positionExecutiveSide: string | null; + containDate: Date; + workDate: Date; + retireDate: string | null; + absent: number | null; + age: number | null; + ageAll: string | null; + reasonSameDate: string | null; +} + +interface DataOption { + id: string; + name: string; + zipCode?: string; +} + +interface zipCodeOption { + id: string; + name: string; + zipCode: string; +} + +const defaultGoverment: Goverment = { + ocId: null, + positionId: null, + positionPathSide: null, + positionLine: null, + positionType: null, + positionLevel: null, + numberId: null, + positionExecutive: null, + positionExecutiveSide: null, + containDate: new Date(), + workDate: new Date(), + retireDate: null, + absent: 0, + age: 0, + ageAll: null, + reasonSameDate: null, +}; + +const defaultAddress: Address = { + address: null, + provinceId: null, + districtId: null, + subdistrictId: null, + addressC: null, + provinceIdC: null, + districtIdC: null, + subdistrictIdC: null, + codec: null, + codep: null, + same: "0", +}; + +const defaultInformation: Information = { + cardid: null, + age: null, + prefix: null, + prefixId: null, + firstname: null, + lastname: null, + birthDate: null, + genderId: null, + bloodId: null, + nationality: null, + ethnicity: null, + statusId: null, + religionId: null, + tel: null, + employeeType: null, + employeeClass: null, + profileType: null, +}; + +const defaultTempInformation: any = { + employeeMoneyIncrease: null, + employeeMoneyAllowance: null, + employeeMoneyEmployee: null, + employeeMoneyEmployer: null, + positionEmployeeGroupId: null, + positionEmployeePositionId: null, + positionEmployeeLineId: null, + employeeTypeIndividual: null, + employeeOc: null, + employeeWage: null, +}; + +const defaultFamily: Family = { + prefixC: null, + prefixIdC: null, + firstnameC: null, + lastnameC: null, + lastnameCOld: null, + occupationC: null, + citizenIdC: null, + liveC: "1", + prefixM: null, + prefixIdM: null, + firstnameM: null, + lastnameM: null, + occupationM: null, + citizenIdM: null, + liveM: "1", + prefixF: null, + prefixIdF: null, + firstnameF: null, + lastnameF: null, + occupationF: null, + citizenIdF: null, + liveF: "1", + same: "0", + childrens: [], +}; + +export { + defaultInformation, + defaultFamily, + defaultAddress, + defaultGoverment, + defaultTempInformation, +}; +export type { + ChangeActive, + Information, + Family, + Address, + Goverment, + DataOption, + zipCodeOption, +}; diff --git a/src/components/information/interface/profileType.ts b/src/components/information/interface/profileType.ts new file mode 100644 index 00000000..ab3b28b2 --- /dev/null +++ b/src/components/information/interface/profileType.ts @@ -0,0 +1,187 @@ +//interface class array object {name string ,id number} + +import type { childrenFamily } from "@/modules/04_registry/interface/response/Family"; +interface ChangeActive { + name: string; + id: number; +} + +//ข้อมูลส่วนตัว +interface Information { + cardid: string | null; + prefix: string | null; + age: string | null; + prefixId: string | null; + firstname: string | null; + lastname: string | null; + birthDate: Date | null; + genderId: string | null; + bloodId: string | null; + nationality: string | null; + ethnicity: string | null; + statusId: string | null; + religionId: string | null; + tel: string | null; + employeeType: string | null; + employeeClass: string | null; + profileType: string | null; +} + +interface Family { + prefixC: string | null; // couple + prefixIdC: string | null; + firstnameC: string | null; + lastnameC: string | null; + lastnameCOld: string | null; + occupationC: string | null; + citizenIdC: string | null; + liveC: string | null; + prefixM: string | null; // male + prefixIdM: string | null; + firstnameM: string | null; + lastnameM: string | null; + occupationM: string | null; + citizenIdM: string | null; + liveM: string | null; + prefixF: string | null; // female + prefixIdF: string | null; + firstnameF: string | null; + lastnameF: string | null; + occupationF: string | null; + citizenIdF: string | null; + liveF: string | null; + same: string | null; + childrens: childrenFamily[]; +} + +interface Address { + address: string | null; + provinceId: string | null; + districtId: string | null; + subdistrictId: string | null; + addressC: string | null; + provinceIdC: string | null; + districtIdC: string | null; + subdistrictIdC: string | null; + same: string | null; +} + +interface Goverment { + ocId: string | null; + positionId: string | null; + positionPathSide: string | null; + positionLine: string | null; + positionType: string | null; + positionLevel: string | null; + numberId: string | null; + positionExecutive: string | null; + positionExecutiveSide: string | null; + containDate: Date; + workDate: Date; + retireDate: string | null; + absent: number | null; + age: number | null; + ageAll: string | null; + reasonSameDate: string | null; +} + +interface DataOption { + id: string; + name: string; + zipCode?: string; +} + +interface zipCodeOption { + id: string; + name: string; + zipCode: string; +} + +const defaultGoverment: Goverment = { + ocId: null, + positionId: null, + positionPathSide: null, + positionLine: null, + positionType: null, + positionLevel: null, + numberId: null, + positionExecutive: null, + positionExecutiveSide: null, + containDate: new Date(), + workDate: new Date(), + retireDate: null, + absent: 0, + age: 0, + ageAll: null, + reasonSameDate: null, +}; + +const defaultAddress: Address = { + address: null, + provinceId: null, + districtId: null, + subdistrictId: null, + addressC: null, + provinceIdC: null, + districtIdC: null, + subdistrictIdC: null, + same: "0", +}; + +const defaultInformation: Information = { + cardid: null, + age: null, + prefix: null, + prefixId: null, + firstname: null, + lastname: null, + birthDate: null, + genderId: null, + bloodId: null, + nationality: null, + ethnicity: null, + statusId: null, + religionId: null, + tel: null, + employeeType: null, + employeeClass: null, + profileType: null, +}; + +const defaultFamily: Family = { + prefixC: null, + prefixIdC: null, + firstnameC: null, + lastnameC: null, + lastnameCOld: null, + occupationC: null, + citizenIdC: null, + liveC: "1", + prefixM: null, + prefixIdM: null, + firstnameM: null, + lastnameM: null, + occupationM: null, + citizenIdM: null, + liveM: "1", + prefixF: null, + prefixIdF: null, + firstnameF: null, + lastnameF: null, + occupationF: null, + citizenIdF: null, + liveF: "1", + same: "0", + childrens: [], +}; + +export { defaultInformation, defaultFamily, defaultAddress, defaultGoverment }; +export type { + ChangeActive, + Information, + Family, + Address, + Goverment, + DataOption, + zipCodeOption, +}; diff --git a/src/components/information/interface/request/Address.ts b/src/components/information/interface/request/Address.ts new file mode 100644 index 00000000..f8cff775 --- /dev/null +++ b/src/components/information/interface/request/Address.ts @@ -0,0 +1,55 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + currentAddress: String | null; + currentDistrictId: String | null; + currentProvinceId: String | null; + currentSubDistrictId: String | null; + currentZipCode: String | null; + registrationAddress: String | null; + registrationDistrictId: String | null; + registrationProvinceId: String | null; + registrationSame: Boolean | null; + registrationSubDistrictId: String | null; + registrationZipCode: String | null; +} + +interface RequestItemsHistoryObject { + currentAddress: String | null; + currentDistrict: String | null; + currentProvince: String | null; + currentSubDistrict: String | null; + currentZipCode: String | null; + registrationAddress: String | null; + registrationDistrict: String | null; + registrationProvince: String | null; + registrationSame: Boolean | null; + registrationSubDistrict: String | null; + registrationZipCode: String | null; + createdFullName: String | null; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { + RequestItemsObject, + Columns, + DataProps, + RequestItemsHistoryObject, +}; diff --git a/src/components/information/interface/request/Assessment.ts b/src/components/information/interface/request/Assessment.ts new file mode 100644 index 00000000..58bcb2a5 --- /dev/null +++ b/src/components/information/interface/request/Assessment.ts @@ -0,0 +1,34 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + point1Total: number; + point1: number; + point2Total: number; + point2: number; + pointSumTotal: number; + pointSum: number; + name: string; + date: Date; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/components/information/interface/request/Certificate.ts b/src/components/information/interface/request/Certificate.ts new file mode 100644 index 00000000..a1df312c --- /dev/null +++ b/src/components/information/interface/request/Certificate.ts @@ -0,0 +1,31 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + certificateNo: string; + issuer: string; + issueDate: Date; + expireDate: Date; + certificateType: string; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/components/information/interface/request/Coin.ts b/src/components/information/interface/request/Coin.ts new file mode 100644 index 00000000..58333864 --- /dev/null +++ b/src/components/information/interface/request/Coin.ts @@ -0,0 +1,31 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + issuer: string; + detail: string; + issueDate: Date; + refCommandNo: string; + refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/components/information/interface/request/Discipline.ts b/src/components/information/interface/request/Discipline.ts new file mode 100644 index 00000000..0cc0906c --- /dev/null +++ b/src/components/information/interface/request/Discipline.ts @@ -0,0 +1,32 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + level: string; + detail: string; + unStigma: string; + refCommandNo: string; + refCommandDate: Date | null; + date: Date; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/components/information/interface/request/Document.ts b/src/components/information/interface/request/Document.ts new file mode 100644 index 00000000..9e1c2185 --- /dev/null +++ b/src/components/information/interface/request/Document.ts @@ -0,0 +1,19 @@ +//ข้อมูล +interface RequestItemsObject { + name: String; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns }; diff --git a/src/components/information/interface/request/Education.ts b/src/components/information/interface/request/Education.ts new file mode 100644 index 00000000..28624d8d --- /dev/null +++ b/src/components/information/interface/request/Education.ts @@ -0,0 +1,45 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + level: string; + levelId: string; + positionPath: string; + isEducation: boolean; + institute: string; + degree: string; + field: string; + gpa: string; + country: string; + duration: string; + durationYear: number; + other: string; + fundName: string; + isDate: string | null; + finishDate: Date; + startDate: number; + endDate: number; + startDate2: Date; + endDate2: Date; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/components/information/interface/request/Family.ts b/src/components/information/interface/request/Family.ts new file mode 100644 index 00000000..334f2e81 --- /dev/null +++ b/src/components/information/interface/request/Family.ts @@ -0,0 +1,29 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + date: Date; + status: string; + level: string; + refNo: string; + refDate: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/components/information/interface/request/Government.ts b/src/components/information/interface/request/Government.ts new file mode 100644 index 00000000..3ef47a21 --- /dev/null +++ b/src/components/information/interface/request/Government.ts @@ -0,0 +1,55 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + date: Date; + status: string; + level: string; + refNo: string; + refDate: Date; +} + +interface RequestItemsHistoryObject { + oc: string | null; + position: string | null; + positionPathSide: string | null; + posNo: string | null; + positionLine: string | null; + positionType: string | null; + positionLevel: string | null; + positionExecutive: string | null; + positionExecutiveSide: string | null; + dateAppoint: Date; + dateStart: Date; + retireDate: string | null; + govAge: string | null; + govAgeAbsent: string | null; + govAgePlus: string | null; + reasonSameDate: string | null; + createdFullName: string | null; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { + RequestItemsObject, + Columns, + DataProps, + RequestItemsHistoryObject, +}; diff --git a/src/components/information/interface/request/Information.ts b/src/components/information/interface/request/Information.ts new file mode 100644 index 00000000..39aac062 --- /dev/null +++ b/src/components/information/interface/request/Information.ts @@ -0,0 +1,59 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + birthDate: Date | null; + bloodGroupId: string | null; + citizenId: string | null; + firstName: string | null; + genderId: string | null; + lastName: string | null; + nationality: string | null; + prefixId: string | null; + race: string | null; + relationshipId: string | null; + religionId: string | null; + telephoneNumber: string | null; + employeeType: string | null; + employeeClass: string | null; +} + +interface RequestItemsHistoryObject { + citizenId: string | null; + prefix: string | null; + firstName: string | null; + lastName: string | null; + birthDate: Date; + gender: string | null; + relationship: string | null; + bloodGroup: string | null; + nationality: string | null; + race: string | null; + religion: string | null; + telephoneNumber: string | null; + createdFullName: string | null; + createdAt: Date; + employeeType: string | null; + employeeClass: string | null; +} + +//columns +interface Columns { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; +} + +export type { + RequestItemsObject, + Columns, + DataProps, + RequestItemsHistoryObject, +}; diff --git a/src/components/information/interface/request/Insignia.ts b/src/components/information/interface/request/Insignia.ts new file mode 100644 index 00000000..f017b879 --- /dev/null +++ b/src/components/information/interface/request/Insignia.ts @@ -0,0 +1,40 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + insigniaType: string; + insignia: string; + insigniaId: string; + year: number; + no: string; + issue: string; + volumeNo: string; + volume: string; + section: string; + page: string; + receiveDate: Date; + dateAnnounce: Date; + refCommandNo: string; + refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/components/information/interface/request/Leave.ts b/src/components/information/interface/request/Leave.ts new file mode 100644 index 00000000..9693d517 --- /dev/null +++ b/src/components/information/interface/request/Leave.ts @@ -0,0 +1,42 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + typeLeave: string; + dateStartLeave: Date; + dateEndLeave: Date; + numLeave: number; + sumLeave: number; + totalLeave: number; + status: string; + reason: string; + typeLeaveId: string; +} + +//ข้อมูล +interface RequestItemsTotalObject { + typeLeaveId: string; + typeLeave: string; + totalLeave: number; + limitLeave: string; + remainLeave: string; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps, RequestItemsTotalObject }; diff --git a/src/components/information/interface/request/Main.ts b/src/components/information/interface/request/Main.ts new file mode 100644 index 00000000..9cf5c79b --- /dev/null +++ b/src/components/information/interface/request/Main.ts @@ -0,0 +1,49 @@ +//ข้อมูล +interface RequestItemsObject { + id: number; + fullname: String; + fullnameOld: String; + avatar: String; + citizenId: String; + oc: String; + position: String; + positionPathSide: String; + numberPosition: String | null; + positionLine: String; + positionType: String; + govAge: number; + positionLevel: String; + positionExecutive: String | null; + positionExecutiveSide: String | null; + refSalary: String; + positionEmployeePosition: String | null; + positionEmployeePositionSide: String | null; + positionEmployeeLevel: String | null; + positionEmployeeGroup: String | null; + dateAppoint: Date | string | null; + dateStart: Date | string | null; + createdAt: Date | string | null; + salaryDate: Date | string | null; + leaveReason: String; + age: String; + amount: String; + insignia: String; + insigniaLast: String; + isLeave: String; + leaveDateOrder: Date | string | null; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns }; diff --git a/src/components/information/interface/request/OldName.ts b/src/components/information/interface/request/OldName.ts new file mode 100644 index 00000000..0fde7fa4 --- /dev/null +++ b/src/components/information/interface/request/OldName.ts @@ -0,0 +1,32 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + prefix: string; + prefixId: string; + firstName: string; + lastName: string; + status: string; + file: string | null; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/components/information/interface/request/Other.ts b/src/components/information/interface/request/Other.ts new file mode 100644 index 00000000..90339caa --- /dev/null +++ b/src/components/information/interface/request/Other.ts @@ -0,0 +1,28 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + date: Date; + detail: string; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/components/information/interface/request/Record.ts b/src/components/information/interface/request/Record.ts new file mode 100644 index 00000000..b40baaf4 --- /dev/null +++ b/src/components/information/interface/request/Record.ts @@ -0,0 +1,31 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + date: Date; + detail: string; + reference: string; + refCommandNo: string; + refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/components/information/interface/request/Salary.ts b/src/components/information/interface/request/Salary.ts new file mode 100644 index 00000000..2f397780 --- /dev/null +++ b/src/components/information/interface/request/Salary.ts @@ -0,0 +1,90 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +interface DataPropsEmployee { + row: RequestItemsEmployee; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + date: Date; + amount: number; + positionSalaryAmount: number; + mouthSalaryAmount: number; + oc: string; + ocId: string; + position: string; + positionId: string; + posNo: string; + posNoId: string; + positionLine: string; + positionLineId: string; + positionPathSide: string; + positionPathSideId: string; + positionType: string; + positionTypeId: string; + positionLevel: string; + positionLevelId: string; + positionExecutive: string; + positionExecutiveId: string; + positionExecutiveSide: string; + positionExecutiveSideId: string; + salaryClass: string; + salaryRef: string; + refCommandNo: string; + // refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +interface RequestItemsEmployee { + amount: number; + createdAt: Date; + createdFullName: string; + date: Date; + id: string; + mouthSalaryAmount: number; + oc: string | null; + ocId: string; + posNo: string | null; + posNoId: string | null; + posNoEmployee: string | null; + positionEmployeeGroup: string | null; + positionEmployeeGroupId: string | null; + positionEmployeeLevel: string | null; + positionEmployeeLevelId: string | null; + positionEmployeePosition: string | null; + positionEmployeePositionId: string | null; + positionEmployeePositionSide: string | null; + positionEmployeePositionSideId: string | null; + positionSalaryAmount: number; + salaryClass: string | null; + salaryRef: string | null; + refCommandNo: string; + // refCommandDate: Date | null; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { + RequestItemsObject, + Columns, + DataProps, + RequestItemsEmployee, + DataPropsEmployee, +}; diff --git a/src/components/information/interface/request/Talent.ts b/src/components/information/interface/request/Talent.ts new file mode 100644 index 00000000..b6634154 --- /dev/null +++ b/src/components/information/interface/request/Talent.ts @@ -0,0 +1,30 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + field: string; + detail: string; + remark: string; + reference: string; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/components/information/interface/request/Train.ts b/src/components/information/interface/request/Train.ts new file mode 100644 index 00000000..6f095657 --- /dev/null +++ b/src/components/information/interface/request/Train.ts @@ -0,0 +1,36 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + name: string; + topic: string; + yearly: number; + place: string; + duration: string; + department: string; + numberOrder: string; + dateOrder: Date; + startDate: Date; + endDate: Date; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/components/information/interface/request/Work.ts b/src/components/information/interface/request/Work.ts new file mode 100644 index 00000000..58d2730c --- /dev/null +++ b/src/components/information/interface/request/Work.ts @@ -0,0 +1,32 @@ +interface DataProps { + row: RequestItemsObject; + rowIndex: number; +} + +//ข้อมูล +interface RequestItemsObject { + id: string; + dateStart: Date; + dateEnd: Date; + detail: string; + reference: string; + refCommandNo: string; + refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { RequestItemsObject, Columns, DataProps }; diff --git a/src/components/information/interface/response/Address.ts b/src/components/information/interface/response/Address.ts new file mode 100644 index 00000000..8769bd1b --- /dev/null +++ b/src/components/information/interface/response/Address.ts @@ -0,0 +1,34 @@ +//ข้อมูล +interface ResponseObject { + currentAddress: string | null; + currentDistrictId: string | null; + currentProvinceId: string | null; + currentSubDistrictId: string | null; + currentZipCode: string | null; + registrationAddress: string | null; + registrationDistrictId: string | null; + registrationProvinceId: string | null; + registrationSame: Boolean | null; + registrationSubDistrictId: string | null; + registrationZipCode: string | null; + createdFullName: string | null; + createdAt: Date; +} + +interface ResponseHistory { + currentAddress: string | null; + currentDistrictId: string | null; + currentProvinceId: string | null; + currentSubDistrictId: string | null; + currentZipCode: string | null; + registrationAddress: string | null; + registrationDistrictId: string | null; + registrationProvinceId: string | null; + registrationSame: string | null; + registrationSubDistrictId: string | null; + registrationZipCode: string | null; + createdFullName: string | null; + createdAt: Date; +} + +export type { ResponseObject, ResponseHistory }; diff --git a/src/components/information/interface/response/Assessment.ts b/src/components/information/interface/response/Assessment.ts new file mode 100644 index 00000000..af1f8598 --- /dev/null +++ b/src/components/information/interface/response/Assessment.ts @@ -0,0 +1,16 @@ +//ข้อมูล +interface ResponseObject { + id: string; + point1Total: number; + point1: number; + point2Total: number; + point2: number; + pointSumTotal: number; + pointSum: number; + name: string; + date: Date; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Certificate.ts b/src/components/information/interface/response/Certificate.ts new file mode 100644 index 00000000..32756682 --- /dev/null +++ b/src/components/information/interface/response/Certificate.ts @@ -0,0 +1,13 @@ +//ข้อมูล +interface ResponseObject { + id: string; + certificateNo: string; + issuer: string; + issueDate: Date; + expireDate: Date; + certificateType: string; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Coin.ts b/src/components/information/interface/response/Coin.ts new file mode 100644 index 00000000..578dcbb5 --- /dev/null +++ b/src/components/information/interface/response/Coin.ts @@ -0,0 +1,13 @@ +//ข้อมูล +interface ResponseObject { + id: string; + issuer: string; + detail: string; + issueDate: Date; + refCommandNo: string; + refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Discipline.ts b/src/components/information/interface/response/Discipline.ts new file mode 100644 index 00000000..bb6ca426 --- /dev/null +++ b/src/components/information/interface/response/Discipline.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseObject { + id: string; + level: string; + detail: string; + unStigma: string; + refCommandNo: string; + refCommandDate: Date; + date: Date; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Document.ts b/src/components/information/interface/response/Document.ts new file mode 100644 index 00000000..4365fe38 --- /dev/null +++ b/src/components/information/interface/response/Document.ts @@ -0,0 +1,6 @@ +//ข้อมูล +interface ResponseObject { + name: String; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Education.ts b/src/components/information/interface/response/Education.ts new file mode 100644 index 00000000..86bda975 --- /dev/null +++ b/src/components/information/interface/response/Education.ts @@ -0,0 +1,27 @@ +//ข้อมูล +interface ResponseObject { + id: string; + educationLevel: string; + educationLevelId: string; + positionPath: string; + isEducation: boolean; + institute: string; + degree: string; + field: string; + gpa: string; + country: string; + duration: string; + durationYear: number; + other: string; + fundName: string; + isDate: string | null; + finishDate: Date; + startDate: number; + endDate: number; + startDate2: Date; + endDate2: Date; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Family.ts b/src/components/information/interface/response/Family.ts new file mode 100644 index 00000000..04dc4b36 --- /dev/null +++ b/src/components/information/interface/response/Family.ts @@ -0,0 +1,64 @@ +//ข้อมูล +interface ResponseObject { + couple: Boolean | null; + couplePrefixId: string | null; + coupleFirstName: string | null; + coupleLastName: string | null; + coupleLastNameOld: string | null; + coupleCareer: string | null; + coupleLive: Boolean | null; + coupleCitizenId: string | null; + fatherPrefixId: string | null; + fatherFirstName: string | null; + fatherLastName: string | null; + fatherCareer: string | null; + fatherLive: Boolean | null; + fatherCitizenId: string | null; + motherPrefixId: string | null; + motherFirstName: string | null; + motherLastName: string | null; + motherCareer: string | null; + motherLive: Boolean | null; + motherCitizenId: string | null; + createdFullName: string | null; + createdAt: Date; + childrens: childrenFamily[]; +} + +interface ResponseHistory { + couple: string | null; + couplePrefixId: string | null; + coupleFirstName: string | null; + coupleLastName: string | null; + coupleLastNameOld: string | null; + coupleCareer: string | null; + coupleLive: string | null; + coupleCitizenId: string | null; + fatherPrefixId: string | null; + fatherFirstName: string | null; + fatherLastName: string | null; + fatherCareer: string | null; + fatherLive: string | null; + fatherCitizenId: string | null; + motherPrefixId: string | null; + motherFirstName: string | null; + motherLastName: string | null; + motherCareer: string | null; + motherLive: string | null; + motherCitizenId: string | null; + createdFullName: string | null; + createdAt: Date; + childrens: childrenFamily[]; +} + +interface childrenFamily { + id: string; + childrenPrefixId: string | null; + childrenFirstName: string | null; + childrenLastName: string | null; + childrenCareer: string | null; + childrenLive: string | null; + childrenCitizenId: string | null; +} + +export type { ResponseObject, childrenFamily, ResponseHistory }; diff --git a/src/components/information/interface/response/Government.ts b/src/components/information/interface/response/Government.ts new file mode 100644 index 00000000..82c7c997 --- /dev/null +++ b/src/components/information/interface/response/Government.ts @@ -0,0 +1,35 @@ +//ข้อมูล +interface ResponseObject { + oc: string | null; + positionExecutive: string | null; + positionExecutiveSide: string | null; + dateAppoint: Date | string; + dateStart: Date | string; + govAge: string | null; + govAgeAbsent: number | null; + govAgePlus: number | null; + positionLevel: string | null; + posNo: string | null; + position: string | null; + positionPathSide: string | null; + retireDate: string | null; + positionType: string | null; + positionLine: string | null; + createdFullName: string | null; + createdAt: Date; + reasonSameDate: string | null; +} + +interface Goverment { + oc: string; + posNo: string; + position: string; + positionPathSide: string; + positionLine: string; + positionType: string; + positionLevel: string; + positionExecutive: string; + positionExecutiveSide: string; +} + +export type { ResponseObject, Goverment }; diff --git a/src/components/information/interface/response/Information.ts b/src/components/information/interface/response/Information.ts new file mode 100644 index 00000000..65e4e7e8 --- /dev/null +++ b/src/components/information/interface/response/Information.ts @@ -0,0 +1,34 @@ +//ข้อมูล +interface ResponseObject { + changeName: boolean | null; + birthDate: Date; + bloodGroupId: string | null; + citizenId: string | null; + firstName: string | null; + genderId: string | null; + lastName: string | null; + nationality: string | null; + prefixId: string | null; + race: string | null; + relationshipId: string | null; + religionId: string | null; + telephoneNumber: string | null; + createdFullName: string | null; + createdAt: Date; + age: string | null; + employeeType: string | null; + employeeClass: string | null; + profileType: string | null; +} + +interface PersonalImformation { + prefix: string; + citizenId: string; + firstName: string; + lastName: string; + birthDate: string | null; + age: any; + gender: string; +} + +export type { ResponseObject, PersonalImformation }; diff --git a/src/components/information/interface/response/Insignia.ts b/src/components/information/interface/response/Insignia.ts new file mode 100644 index 00000000..4d26152a --- /dev/null +++ b/src/components/information/interface/response/Insignia.ts @@ -0,0 +1,22 @@ +//ข้อมูล +interface ResponseObject { + id: string; + insigniaType: string; + insignia: string; + insigniaId: string; + year: number; + no: string; + issue: string; + volumeNo: string; + volume: string; + section: string; + page: string; + receiveDate: Date; + dateAnnounce: Date; + refCommandNo: string; + refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Leave.ts b/src/components/information/interface/response/Leave.ts new file mode 100644 index 00000000..f5eb18b1 --- /dev/null +++ b/src/components/information/interface/response/Leave.ts @@ -0,0 +1,22 @@ +//ข้อมูล +interface ResponseObject { + id: string; + typeLeave: string; + dateStartLeave: Date; + dateEndLeave: Date; + numLeave: number; + sumLeave: number; + totalLeave: number; + status: string; + reason: string; + typeLeaveId: string; +} +interface ResponseTotalObject { + typeLeaveId: string; + typeLeave: string; + totalLeave: number; + limitLeave: string; + remainLeave: string; +} + +export type { ResponseObject, ResponseTotalObject }; diff --git a/src/components/information/interface/response/Main.ts b/src/components/information/interface/response/Main.ts new file mode 100644 index 00000000..28d37248 --- /dev/null +++ b/src/components/information/interface/response/Main.ts @@ -0,0 +1,37 @@ +//ข้อมูล +interface ResponseObject { + id: number; + fullname: String; + fullnameOld: String; + avatar: String; + citizenId: String; + oc: String; + position: String; + positionPathSide: String; + posNo: String | null; + posNoEmployee: String | null; + positionLine: String; + positionType: String; + govAge: number; + positionLevel: String; + positionExecutive: String | null; + positionExecutiveSide: String | null; + refSalary: String; + positionEmployeePosition: String | null; + positionEmployeePositionSide: String | null; + positionEmployeeLevel: String | null; + positionEmployeeGroup: String | null; + dateAppoint: Date | null; + dateStart: Date | null; + createdAt: Date | null; + salaryDate: Date | null; + leaveReason: string; + age: String; + amount: String; + insignia: String; + insigniaLast: String; + isLeave: boolean; + leaveDateOrder: Date | null; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/OldName.ts b/src/components/information/interface/response/OldName.ts new file mode 100644 index 00000000..f908976a --- /dev/null +++ b/src/components/information/interface/response/OldName.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseObject { + id: string; + prefix: string; + prefixId: string; + firstName: string; + lastName: string; + status: string; + file: string | null; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Other.ts b/src/components/information/interface/response/Other.ts new file mode 100644 index 00000000..7bce7e10 --- /dev/null +++ b/src/components/information/interface/response/Other.ts @@ -0,0 +1,10 @@ +//ข้อมูล +interface ResponseObject { + id: string; + date: Date; + detail: string; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Record.ts b/src/components/information/interface/response/Record.ts new file mode 100644 index 00000000..2ed425be --- /dev/null +++ b/src/components/information/interface/response/Record.ts @@ -0,0 +1,13 @@ +//ข้อมูล +interface ResponseObject { + id: string; + date: Date; + detail: string; + reference: string; + refCommandNo: string; + refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Salary.ts b/src/components/information/interface/response/Salary.ts new file mode 100644 index 00000000..dbf25508 --- /dev/null +++ b/src/components/information/interface/response/Salary.ts @@ -0,0 +1,61 @@ +//ข้อมูล +interface ResponseObject { + id: string; + date: Date; + amount: number; + positionSalaryAmount: number; + mouthSalaryAmount: number; + oc: string; + ocId: string; + position: string; + positionId: string; + posNo: string; + posNoId: string; + positionLine: string; + positionLineId: string; + positionPathSide: string; + positionPathSideId: string; + positionType: string; + positionTypeId: string; + positionLevel: string; + positionLevelId: string; + positionExecutive: string; + positionExecutiveId: string; + positionExecutiveSide: string; + positionExecutiveSideId: string; + salaryClass: string; + salaryRef: string; + refCommandNo: string; + // refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +interface ResponseObjectEmployee { + amount: number; + createdAt: Date; + createdFullName: string; + date: Date; + id: string; + mouthSalaryAmount: number; + oc: string | null; + ocId: string; + posNo: string | null; + posNoId: string | null; + posNoEmployee: string | null; + positionEmployeeGroup: string | null; + positionEmployeeGroupId: string | null; + positionEmployeeLevel: string | null; + positionEmployeeLevelId: string | null; + positionEmployeePosition: string | null; + positionEmployeePositionId: string | null; + positionEmployeePositionSide: string | null; + positionEmployeePositionSideId: string | null; + positionSalaryAmount: number; + salaryClass: string | null; + salaryRef: string | null; + refCommandNo: string; + // refCommandDate: Date | null; +} + +export type { ResponseObject, ResponseObjectEmployee }; diff --git a/src/components/information/interface/response/Talent.ts b/src/components/information/interface/response/Talent.ts new file mode 100644 index 00000000..35bddad2 --- /dev/null +++ b/src/components/information/interface/response/Talent.ts @@ -0,0 +1,12 @@ +//ข้อมูล +interface ResponseObject { + id: string; + field: string; + detail: string; + remark: string; + reference: string; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Train.ts b/src/components/information/interface/response/Train.ts new file mode 100644 index 00000000..6cd0ebda --- /dev/null +++ b/src/components/information/interface/response/Train.ts @@ -0,0 +1,18 @@ +//ข้อมูล +interface ResponseObject { + id: string; + name: string; + topic: string; + yearly: number; + place: string; + duration: string; + department: string; + numberOrder: string; + dateOrder: Date; + startDate: Date; + endDate: Date; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/Work.ts b/src/components/information/interface/response/Work.ts new file mode 100644 index 00000000..fb269cf1 --- /dev/null +++ b/src/components/information/interface/response/Work.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseObject { + id: string; + dateStart: Date; + dateEnd: Date; + detail: string; + reference: string; + refCommandNo: string; + refCommandDate: Date | null; + createdFullName: string; + createdAt: Date; +} + +export type { ResponseObject }; diff --git a/src/components/information/interface/response/avatar.ts b/src/components/information/interface/response/avatar.ts new file mode 100644 index 00000000..6c52650e --- /dev/null +++ b/src/components/information/interface/response/avatar.ts @@ -0,0 +1,7 @@ +interface Avatar { + avatar: string; + fullname: string; + position: string; +} + +export type { Avatar }; diff --git a/src/components/information/interface/store/main.ts b/src/components/information/interface/store/main.ts new file mode 100644 index 00000000..6d0452d0 --- /dev/null +++ b/src/components/information/interface/store/main.ts @@ -0,0 +1,30 @@ +interface Profile { + main: { columns: String[] }; + education: { columns: String[] }; + oldName: { columns: String[] }; + certicate: { columns: String[] }; + train: { columns: String[] }; + insignia: { columns: String[] }; + coined: { columns: String[] }; + assessment: { columns: String[] }; + salary: { columns: String[] }; + discipline: { columns: String[] }; + leave: { columns: String[] }; + talent: { columns: String[] }; + work: { columns: String[] }; + record: { columns: String[] }; + other: { columns: String[] }; + document: { columns: String[] }; +} + +interface DataOption { + id: string; + name: string; + zipCode?: string; +} + +interface Pagination { + rowsPerPage: number; +} + +export type { Profile, DataOption, Pagination }; diff --git a/src/components/information/store/store.ts b/src/components/information/store/store.ts new file mode 100644 index 00000000..7c30f249 --- /dev/null +++ b/src/components/information/store/store.ts @@ -0,0 +1,70 @@ +import { ref } from "vue"; +import { defineStore } from "pinia"; +import type { Profile } from "@/components/information/interface/store/main"; + +export const useComponentProfileDataStore = defineStore( + "componentProfile", + () => { + const profile = "profile"; + const birthDate = ref(new Date()); + const retireText = ref(null); + const profileData = ref({ + main: { columns: [] }, + education: { columns: [] }, + oldName: { columns: [] }, + certicate: { columns: [] }, + train: { columns: [] }, + insignia: { columns: [] }, + coined: { columns: [] }, + assessment: { columns: [] }, + salary: { columns: [] }, + discipline: { columns: [] }, + leave: { columns: [] }, + talent: { columns: [] }, + work: { columns: [] }, + record: { columns: [] }, + other: { columns: [] }, + document: { columns: [] }, + }); + + const changeRetireText = (val: string | null) => { + retireText.value = val; + }; + const changeBirth = (val: Date) => { + birthDate.value = val; + }; + + const changeProfileColumns = (system: String, val: String[]) => { + if (system == "main") profileData.value.main.columns = val; + if (system == "education") profileData.value.education.columns = val; + if (system == "oldName") profileData.value.oldName.columns = val; + if (system == "certicate") profileData.value.certicate.columns = val; + if (system == "train") profileData.value.train.columns = val; + if (system == "insignia") profileData.value.insignia.columns = val; + if (system == "coined") profileData.value.coined.columns = val; + if (system == "assessment") profileData.value.assessment.columns = val; + if (system == "salary") profileData.value.salary.columns = val; + if (system == "discipline") profileData.value.discipline.columns = val; + if (system == "leave") profileData.value.leave.columns = val; + if (system == "talent") profileData.value.talent.columns = val; + if (system == "work") profileData.value.work.columns = val; + if (system == "record") profileData.value.record.columns = val; + if (system == "other") profileData.value.other.columns = val; + if (system == "document") profileData.value.document.columns = val; + localStorage.setItem(profile, JSON.stringify(profileData.value)); + }; + + if (localStorage.getItem(profile) !== null) { + profileData.value = JSON.parse(localStorage.getItem(profile) || "{}"); + } + + return { + profileData, + changeProfileColumns, + birthDate, + changeBirth, + retireText, + changeRetireText, + }; + } +); diff --git a/src/components/information/top.vue b/src/components/information/top.vue new file mode 100644 index 00000000..416a8f04 --- /dev/null +++ b/src/components/information/top.vue @@ -0,0 +1,199 @@ + + + diff --git a/src/interface/main.ts b/src/interface/main.ts new file mode 100644 index 00000000..21a88d9d --- /dev/null +++ b/src/interface/main.ts @@ -0,0 +1,14 @@ +interface DataOption { + id: string; + label: string; +} +interface FormProfile { + id: string; + avatar: string; + fullName: string; + position: string; + positionLevel: string; + organization: string; +} + +export type { DataOption, FormProfile }; diff --git a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts new file mode 100644 index 00000000..1cbf248d --- /dev/null +++ b/src/interface/request/main/main.ts @@ -0,0 +1,255 @@ +import { readonly } from "vue"; +interface ScrollType { + position: number; + direction: string; + directionChanged: boolean; + inflectionPoint: number; + delta: number; +} + +interface tabType { + key: number; + label: string; + tag: string; +} +interface childrenType { + key: number; + label: string; + path?: string; +} + +interface menuType { + key: number; + icon: string; + activeIcon: string; + label: string; + path: string; + children?: childrenType[]; +} + +interface notiType { + id: string; + sender: string; + body: string; + timereceive: string; + isOpen: boolean; +} + +interface optionType { + icon: string; + label: string; + value: string; + color: string; +} + +const menuList = readonly([ + { + key: 1, + icon: "mdi-home-variant-outline", + activeIcon: "mdi-home-variant", + label: "หน้าแรก", + path: "dashboard", + role: "dashboard", + }, + { + key: 2, + icon: "o_person", + activeIcon: "person", + label: "ข้อมูลหลัก", + path: "metadata", + role: "metadata", + children: [ + { + key: 2.0, + label: "ข้อมูลเกี่ยวกับบุคคล", + path: "masterPersonal", + }, + { + key: 2.0, + label: "ข้อมูลตำแหน่งข้าราชการ ฯ", + path: "masterPosition", + }, + { + key: 2.0, + label: "ข้อมูลตำแหน่งลูกจ้างประจำ", + path: "masterPositionEmployee", + }, + { + key: 2.0, + label: "ข้อมูลปฏิทินวันหยุด", + path: "masterCalendarWork", + }, + { + key: 2.0, + label: "ข้อมูลเครื่องราชอิสริยาภรณ์", + path: "masterInsignia", + }, + ], + }, + { + key: 2, + icon: "mdi-account-badge", + activeIcon: "groups", + label: "จัดการผู้ใช้งานและสิทธิ์", + role: "user_role", + children: [ + { + key: 2.0, + label: "จัดการผู้ใช้งาน", + path: "manageUsers", + }, + { + key: 2.0, + label: "จัดการบทบาท (Roles)", + path: "manageRoles", + }, + { + key: 2.0, + label: "จัดการสิทธิ์ (Permissions)", + path: "managePermission", + }, + ], + }, + { + key: 4, + icon: "history", + activeIcon: "groups", + label: "ประวัติกิจกรรม (Logs)", + role: "user_role", + path: "viewLogs", + }, +]); + +const tabList = readonly([ + { + key: 1, + label: "ข้อมูลทั่วไป", + tag: "information", + }, + { + key: 19, + label: "ประวัติการเปลี่ยนชื่อ", + tag: "oldName", + }, + { + key: 16, + label: "ข้อมูลราชการ", + tag: "government", + }, + { + key: 17, + label: "ข้อมูลที่อยู่", + tag: "address", + }, + { + key: 18, + label: "ข้อมูลครอบครัว", + tag: "family", + }, + { + key: 15, + label: "ใบอนุญาตประกอบวิชาชีพ", + tag: "certicate", + }, + { + key: 2, + label: "ประวัติการศึกษา", + tag: "education", + }, + { + key: 3, + label: "การฝึกอบรม/ดูงาน", + tag: "training", + }, + { + key: 4, + label: "เครื่องราชอิสริยาภรณ์", + tag: "insignia", + }, + { + key: 5, + label: "ประกาศเกียรติคุณ", + tag: "coined", + }, + { + key: 6, + label: "ผลการประเมินปฏิบัติราชการ", + tag: "assessment", + }, + { + key: 7, + label: "ตำแหน่ง/เงินเดือน/ค่าจ้าง", + tag: "position", + }, + { + key: 8, + label: "วินัย", + tag: "rule", + }, + { + key: 9, + label: "การลา", + tag: "leave", + }, + { + key: 10, + label: "ความสามารถพิเศษ", + tag: "talent", + }, + { + key: 11, + label: "ปฎิบัติราชการพิเศษ", + tag: "work", + }, + { + key: 12, + label: "บันทึกวันที่ไม่ได้รับเงินเดือนฯ", + tag: "record", + }, + { + key: 13, + label: "อื่นๆ", + tag: "other", + }, + { + key: 14, + label: "เอกสารหลักฐาน", + tag: "document", + }, +]); + +const tabListPlacement = readonly([ + { + key: 1, + label: "ข้อมูลทั่วไป", + tag: "information", + }, + { + key: 2, + label: "ใบอนุญาตประกอบอาชีพ", + tag: "certicate", + }, + { + key: 3, + label: "ประวัติการศึกษา", + tag: "education", + }, + { + key: 4, + label: "ผลการสอบ", + tag: "examresult", + }, + { + key: 5, + label: "การคัดกรองคุณสมบัติ", + tag: "qualification", + }, + { + key: 6, + label: "เอกสารหลักฐาน", + tag: "document", + }, +]); + +export { menuList, tabList, tabListPlacement }; +export type { ScrollType, tabType, menuType, notiType, optionType }; diff --git a/src/interface/request/main/main.ts.rej b/src/interface/request/main/main.ts.rej new file mode 100644 index 00000000..d7a8871c --- /dev/null +++ b/src/interface/request/main/main.ts.rej @@ -0,0 +1,134 @@ +diff a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts (rejected hunks) +@@ -374,104 +374,34 @@ + }, + ], + }, +- // { +- // key: 8, +- // icon: "mdi-medal-outline", +- // activeIcon: "mdi-medal", +- // label: "เครื่องราชฯ", +- // path: "insignia", +- // role: "insignia", +- // children: [ +- // { +- // key: 8.1, +- // label: "เครื่องราชฯ", +- // path: "", +- // role: "insignia", +- // children: [ +- // { +- // label: "รอบการเสนอขอ", +- // path: "insigniaProposals", +- // role: "insignia", +- // }, +- // { +- // label: "จัดการคำขอ", +- // path: "insigniaManage", +- // role: "insignia", +- // }, +- // { +- // label: "บันทึกผลการได้รับพระราช...", +- // path: "insigniaRecord", +- // role: "insignia", +- // }, +- // { +- // label: "บันทึกผลการจ่ายใบกำกับ", +- // path: "VatInsignia", +- // role: "insignia", +- // }, +- +- // { +- // label: "จัดสรรเครื่องราชฯ", +- // path: "insigniaAllocate", +- // role: "insignia", +- // }, +- // { +- // label: "รายงาน", +- // path: "insigniaReport", +- // role: "insignia", +- // }, +- // ], +- // }, +- // { +- // key: 8.2, +- // label: "เหรียญจักรพรรดิมาลา", +- // path: "", +- // role: "coin", +- // children: [ +- // { +- // label: "รอบการเสนอขอ", +- // path: "coinProposals", +- // role: "coin", +- // }, +- // { +- // label: "จัดการคำขอ", +- // path: "coinManage", +- // role: "coin", +- // }, +- // { +- // label: "บันทึกผลการได้รับพระราชทานเหรียญจักรพรรดิมาลา", +- // path: "coinReceive", +- // role: "coin", +- // }, +- // { +- // label: "บันทึกผลการจ่ายใบกำกับ", +- // path: "coinPayment", +- // role: "coin", +- // }, +- // { +- // label: +- // "รายชื่อที่ยื่นคำร้องขอแก้ไขข้อมูลการขอพระราชทานเหรียญจักรพรรดิมาลา", +- // path: "coinRequest", +- // role: "coin", +- // }, +- // // { +- // // label: "ประวัติการยื่นขอ", +- // // path: "coinHistory", +- // // role: "coin", +- // // }, +- // { +- // label: "จัดสรรเหรียญตรา", +- // path: "coinAllocate", +- // role: "coin", +- // }, +- // { +- // label: "รายงาน", +- // path: "coinReport", +- // role: "coin", +- // }, +- // ], +- // }, +- // ], +- // }, ++ { ++ key: 9, ++ icon: "mdi-calendar", ++ activeIcon: "mdi-calendar", ++ label: "การลา", ++ path: "leave", ++ role: "coin", ++ children: [ ++ { ++ key: 9.1, ++ label: "รายการลงเวลาปฏิบัติงาน", ++ path: "/work-list", ++ role: "coin", ++ }, ++ { ++ key: 9.2, ++ label: "รายการลา", ++ path: "/leave", ++ role: "coin", ++ }, ++ { ++ key: 9.3, ++ label: "รายงานสถิติ", ++ path: "/statistics-report", ++ role: "coin", ++ }, ++ ], ++ }, + ]); + + const tabList = readonly([ diff --git a/src/interface/request/manage/prefix.ts b/src/interface/request/manage/prefix.ts new file mode 100644 index 00000000..b73cdfbc --- /dev/null +++ b/src/interface/request/manage/prefix.ts @@ -0,0 +1,46 @@ +//response api เกี่ยวกับ status code กับ error +interface RequestHistoryObject { + message: String; + result: ResultHistoryObject; + status: number; +} + +//rusult แนบ id version mongo +interface ResultHistoryObject { + id: String; + items: RequestPrefixHistoryObject; + version: String; +} + +//ข้อมูล คำนำหน้าชื่อ +interface RequestPrefixHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +//columns +interface PrefixColumns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { + RequestHistoryObject, + ResultHistoryObject, + RequestPrefixHistoryObject, + PrefixColumns, +}; diff --git a/src/interface/request/orgSelect/org.ts b/src/interface/request/orgSelect/org.ts new file mode 100644 index 00000000..7a1a609e --- /dev/null +++ b/src/interface/request/orgSelect/org.ts @@ -0,0 +1,163 @@ +interface OrgTree { + orgTreeId: string; + orgRootId: string; + orgLevel: number; + orgTreeName: string; + orgTreeShortName: string; + orgTreeCode: string; + orgCode: string; + orgTreeRank: string; + orgTreeOrder: number | null; + orgRootCode: string; + orgTreePhoneEx: string; + orgTreePhoneIn: string; + orgTreeFax: string; + orgRevisionId: string; + children: OrgTree[]; +} + +interface DataTree { + orgTreeId: string; + orgRootId?: string; + orgLevel: number; + orgName: string; + orgTreeName: string; + orgTreeShortName: string; + orgTreeCode: string; + orgCode: string; + orgTreeRank: string; + orgTreeOrder: number; + orgRootCode?: string; + orgTreePhoneEx: string; + orgTreePhoneIn: string; + orgTreeFax: string; + orgRevisionId: string; + orgRootName: string; + totalPosition: number; + totalPositionCurrentUse: number; + totalPositionCurrentVacant: number; + totalPositionNextUse: number; + totalPositionNextVacant: number; + totalRootPosition: number; + totalRootPositionCurrentUse: number; + totalRootPositionCurrentVacant: number; + totalRootPositionNextUse: number; + totalRootPositionNextVacant: number; + + children?: DataTree[]; +} + +interface PositionMain { + fullNameCurrentHolder: string | null; + fullNameNextHolder: string | null; + id: string; + isPosition: boolean; + isSit: boolean; + orgRootId: string; + orgShortname: string; + posMasterNo: number; + posMasterNoPrefix: string; + posMasterNoSuffix: string; + posExecutiveId: string; + posExecutiveName: string; + posLevelId: string; + posLevelName: string; + posTypeId: string; + posTypeName: string; + positionArea: string; + positionExecutiveField: string; + positionField: string; + positionIsSelected: boolean; + positionName: string; + positions: Positions[]; + node: number; + nodeId: string; +} + +interface PositionNo { + fullNameCurrentHolder: string | null; + fullNameNextHolder: string | null; + id: string; + isPosition: boolean; + isSit: boolean; + orgRootId: string; + orgShortname: string; + posMasterNo: number; + posMasterNoPrefix: string; + posMasterNoSuffix: string; + positions: Positions[]; +} + +interface Positions { + id: string; + posExecutiveId: string; + posExecutiveName: string; + posLevelId: string; + posLevelName: string; + posTypeId: string; + posTypeName: string; + positionArea: string; + positionExecutiveField: string; + positionField: string; + positionIsSelected: boolean; + positionName: string; +} + +interface DataPositionNo { + id: string; + isPosition: boolean; + posMasterNo: string; + positionName: string; + posTypeName: string; + posLevelName: string; + positionIsSelected: string | null; + isSit: boolean; + positions: Positions[]; +} + +interface FormActive { + activeId: string; + activeName: string; + draftId: string; + draftName: string; + orgPublishDate: Date | null; + isPublic: boolean; +} + +interface TreeMain { + children: TreeMain[]; // ปรับเป็นชนิดข้อมูลที่ถูกต้องตามโครงสร้างของ children ถ้าเป็นไปได้ + orgCode: string; + orgLevel: number; + orgName: string; + orgRevisionId: string; + orgRootName: string; + orgTreeCode: string; + orgTreeFax: string; + orgTreeId: string; + orgTreeName: string; + orgTreeOrder: number; + orgTreePhoneEx: string; + orgTreePhoneIn: string; + orgTreeRank: string; + orgTreeShortName: string; + totalPosition: number; + totalPositionCurrentUse: number; + totalPositionCurrentVacant: number; + totalPositionNextUse: number; + totalPositionNextVacant: number; + totalRootPosition: number; + totalRootPositionCurrentUse: number; + totalRootPositionCurrentVacant: number; + totalRootPositionNextUse: number; + totalRootPositionNextVacant: number; + } +export type { + OrgTree, + DataTree, + PositionMain, + PositionNo, + Positions, + DataPositionNo, + FormActive, + TreeMain, +}; diff --git a/src/interface/response/dashboard/dashboard.ts b/src/interface/response/dashboard/dashboard.ts new file mode 100644 index 00000000..dad38b36 --- /dev/null +++ b/src/interface/response/dashboard/dashboard.ts @@ -0,0 +1,32 @@ +interface attachments { + name: string; + url: string; +} +interface ResponseInbox { + body: string; + createdFullName: string; + createdUserId: string; + id: string; + isOpen: boolean; + lastUpdateFullName: string; + lastUpdateUserId: string; + lastUpdatedAt: Date; + openDate: Date | null; + payload: { attachments: attachments[] }; + receiveDate: Date; + receiverUserId: string; + subject: string; +} + +interface DataInbox { + no: string; + sender: string; + subject: string; + timereceive: Date; + body: string; + payload: { attachments: attachments[] }; + ratingModel: number; + isOpen: boolean; +} + +export type { ResponseInbox, DataInbox }; diff --git a/src/interface/response/listPerson.ts b/src/interface/response/listPerson.ts new file mode 100644 index 00000000..1f7f4b14 --- /dev/null +++ b/src/interface/response/listPerson.ts @@ -0,0 +1,16 @@ +interface ResponsePreson { + personId: string; //id อ้างอิง profile + idcard: string; //เลขประจำตัวประชาชน + prefix: string; //คำนำหน้า + firstName: string; //ชื่อ + lastName: string; //นามสกุล + posNo: string; //เลขที่ตำแหน่ง + position: string; //ตำแหน่ง + positionLevel: string; //ระดับ + salaries: number; //เงินเดือน + organization: string; //สังกัด + email: string; //อีเมล + phone: string; //เบอร์โทรศัพท์ +} + +export type { ResponsePreson }; diff --git a/src/interface/response/manage/prefix.ts b/src/interface/response/manage/prefix.ts new file mode 100644 index 00000000..a4a8f99a --- /dev/null +++ b/src/interface/response/manage/prefix.ts @@ -0,0 +1,14 @@ +//ข้อมูล คำนำหน้าชื่อ +interface ResponsePrefixHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponsePrefixHistoryObject }; diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 00000000..79578a04 --- /dev/null +++ b/src/main.ts @@ -0,0 +1,84 @@ +import { createApp, defineAsyncComponent } from "vue"; +import App from "./App.vue"; +import router from "./router"; +import { Dialog, Notify, Quasar, Loading } from "quasar"; +import "./quasar-user-options"; + +import qDraggableTable from 'quasar-ui-q-draggable-table'; +import 'quasar-ui-q-draggable-table/dist/index.css'; + +import "quasar/src/css/index.sass"; +import th from "quasar/lang/th"; + +import "@vuepic/vue-datepicker/dist/main.css"; +import http from "./plugins/http"; +import { createPinia } from "pinia"; +// organization +// position +// positionEmployee +//calendar +// insignia + +// import './assets/main.css' + +// Import GlobalFilters +import filters from "./plugins/filters"; + +const app = createApp(App); +const pinia = createPinia(); + +// เพิ่ม Global Filters ลงใน App +app.config.globalProperties.$filters = filters; + +app.use(router); +app.use(pinia); +app.use(qDraggableTable); + +app.use( + Quasar, + { + plugins: { + Notify, + Dialog, + Loading, + }, // import Quasar plugins and add here + config: { + notify: { + /* look at QuasarConfOptions from the API card */ + }, + loading: { + /* look at QuasarConfOptions from the API card */ + }, + }, + lang: th, + } + // quasarUserOptions // build ไม่ผ่านหลัง install code org&structure chart เลยต้องคอมเม้นไว้ก่อน เทสแล้วยังรันได้หลังคอมเม้น +); + +//** Global Components */ +app.component( + "data-table", + defineAsyncComponent(() => import("@/components/TableView.vue")) +); +app.component( + "datepicker", + defineAsyncComponent(() => import("@vuepic/vue-datepicker")) +); +app.component( + "full-loader", + defineAsyncComponent(() => import("@/components/FullLoader.vue")) +); + +app.component( + "selector", + defineAsyncComponent(() => import("@/components/Selector.vue")) +); + +app.component( + "d-table", + defineAsyncComponent(() => import("@/components/Table.vue")) +); + +app.config.globalProperties.$http = http; + +app.mount("#app"); diff --git a/src/modules/01_metadata/components/Indicators/Assignment/DetailView.vue b/src/modules/01_metadata/components/Indicators/Assignment/DetailView.vue new file mode 100644 index 00000000..7e119844 --- /dev/null +++ b/src/modules/01_metadata/components/Indicators/Assignment/DetailView.vue @@ -0,0 +1,365 @@ + + + + diff --git a/src/modules/01_metadata/components/Indicators/DialogHistory.vue b/src/modules/01_metadata/components/Indicators/DialogHistory.vue new file mode 100644 index 00000000..5d41a408 --- /dev/null +++ b/src/modules/01_metadata/components/Indicators/DialogHistory.vue @@ -0,0 +1,79 @@ + + diff --git a/src/modules/01_metadata/components/Indicators/indicatorByPlan/DetailView.vue b/src/modules/01_metadata/components/Indicators/indicatorByPlan/DetailView.vue new file mode 100644 index 00000000..311516ab --- /dev/null +++ b/src/modules/01_metadata/components/Indicators/indicatorByPlan/DetailView.vue @@ -0,0 +1,31 @@ + + + + diff --git a/src/modules/01_metadata/components/Indicators/indicatorByPlan/IndicatorByPlan.vue b/src/modules/01_metadata/components/Indicators/indicatorByPlan/IndicatorByPlan.vue new file mode 100644 index 00000000..9011c5da --- /dev/null +++ b/src/modules/01_metadata/components/Indicators/indicatorByPlan/IndicatorByPlan.vue @@ -0,0 +1,678 @@ + + + + + diff --git a/src/modules/01_metadata/components/Indicators/indicatorByRole/DetailView.vue b/src/modules/01_metadata/components/Indicators/indicatorByRole/DetailView.vue new file mode 100644 index 00000000..96b0e1fd --- /dev/null +++ b/src/modules/01_metadata/components/Indicators/indicatorByRole/DetailView.vue @@ -0,0 +1,640 @@ + + + + diff --git a/src/modules/01_metadata/components/calendar/Calendar.vue b/src/modules/01_metadata/components/calendar/Calendar.vue new file mode 100644 index 00000000..a00ee70b --- /dev/null +++ b/src/modules/01_metadata/components/calendar/Calendar.vue @@ -0,0 +1,855 @@ + + + + + + diff --git a/src/modules/01_metadata/components/calendar/CalendarList.vue b/src/modules/01_metadata/components/calendar/CalendarList.vue new file mode 100644 index 00000000..616e5877 --- /dev/null +++ b/src/modules/01_metadata/components/calendar/CalendarList.vue @@ -0,0 +1,651 @@ + + + + + diff --git a/src/modules/01_metadata/components/calendar/calendarMain.vue b/src/modules/01_metadata/components/calendar/calendarMain.vue new file mode 100644 index 00000000..c545331f --- /dev/null +++ b/src/modules/01_metadata/components/calendar/calendarMain.vue @@ -0,0 +1,589 @@ + + + + + + diff --git a/src/modules/01_metadata/components/competency/01ListCompetency.vue b/src/modules/01_metadata/components/competency/01ListCompetency.vue new file mode 100644 index 00000000..da5098b3 --- /dev/null +++ b/src/modules/01_metadata/components/competency/01ListCompetency.vue @@ -0,0 +1,271 @@ + + + diff --git a/src/modules/01_metadata/components/competency/02ListLinkPosition.vue b/src/modules/01_metadata/components/competency/02ListLinkPosition.vue new file mode 100644 index 00000000..86d8a93b --- /dev/null +++ b/src/modules/01_metadata/components/competency/02ListLinkPosition.vue @@ -0,0 +1,354 @@ + + + diff --git a/src/modules/01_metadata/components/competency/03ListLinkGroup.vue b/src/modules/01_metadata/components/competency/03ListLinkGroup.vue new file mode 100644 index 00000000..7fda160a --- /dev/null +++ b/src/modules/01_metadata/components/competency/03ListLinkGroup.vue @@ -0,0 +1,588 @@ + + + diff --git a/src/modules/01_metadata/components/competency/04ListCriteria.vue b/src/modules/01_metadata/components/competency/04ListCriteria.vue new file mode 100644 index 00000000..b4cca12a --- /dev/null +++ b/src/modules/01_metadata/components/competency/04ListCriteria.vue @@ -0,0 +1,153 @@ + + + diff --git a/src/modules/01_metadata/components/competency/05ListDetail.vue b/src/modules/01_metadata/components/competency/05ListDetail.vue new file mode 100644 index 00000000..5252f11a --- /dev/null +++ b/src/modules/01_metadata/components/competency/05ListDetail.vue @@ -0,0 +1,328 @@ + + + + + diff --git a/src/modules/01_metadata/components/competency/AddPage.vue b/src/modules/01_metadata/components/competency/AddPage.vue new file mode 100644 index 00000000..7ee5d82c --- /dev/null +++ b/src/modules/01_metadata/components/competency/AddPage.vue @@ -0,0 +1,121 @@ + + + diff --git a/src/modules/01_metadata/components/competency/Forms/01_FormMain.vue b/src/modules/01_metadata/components/competency/Forms/01_FormMain.vue new file mode 100644 index 00000000..d8605fd7 --- /dev/null +++ b/src/modules/01_metadata/components/competency/Forms/01_FormMain.vue @@ -0,0 +1,205 @@ + + + + + diff --git a/src/modules/01_metadata/components/competency/Forms/02_FormGroup.vue b/src/modules/01_metadata/components/competency/Forms/02_FormGroup.vue new file mode 100644 index 00000000..9b778abc --- /dev/null +++ b/src/modules/01_metadata/components/competency/Forms/02_FormGroup.vue @@ -0,0 +1,204 @@ + + + diff --git a/src/modules/01_metadata/components/competency/Forms/03_FormExecutive.vue b/src/modules/01_metadata/components/competency/Forms/03_FormExecutive.vue new file mode 100644 index 00000000..3d0b872b --- /dev/null +++ b/src/modules/01_metadata/components/competency/Forms/03_FormExecutive.vue @@ -0,0 +1,321 @@ + + + + + diff --git a/src/modules/01_metadata/components/competency/Forms/04_FormExecutivePosition.vue b/src/modules/01_metadata/components/competency/Forms/04_FormExecutivePosition.vue new file mode 100644 index 00000000..3aee7035 --- /dev/null +++ b/src/modules/01_metadata/components/competency/Forms/04_FormExecutivePosition.vue @@ -0,0 +1,319 @@ + + + diff --git a/src/modules/01_metadata/components/competency/Forms/05_FormExecutiveLevel.vue b/src/modules/01_metadata/components/competency/Forms/05_FormExecutiveLevel.vue new file mode 100644 index 00000000..f520427c --- /dev/null +++ b/src/modules/01_metadata/components/competency/Forms/05_FormExecutiveLevel.vue @@ -0,0 +1,261 @@ + + + diff --git a/src/modules/01_metadata/components/competency/Forms/Main.vue b/src/modules/01_metadata/components/competency/Forms/Main.vue new file mode 100644 index 00000000..55bc0d42 --- /dev/null +++ b/src/modules/01_metadata/components/competency/Forms/Main.vue @@ -0,0 +1,295 @@ +div + + + + + diff --git a/src/modules/01_metadata/components/insignia/InsigniaDetail.vue b/src/modules/01_metadata/components/insignia/InsigniaDetail.vue new file mode 100644 index 00000000..596e4587 --- /dev/null +++ b/src/modules/01_metadata/components/insignia/InsigniaDetail.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/src/modules/01_metadata/components/insignia/InsigniaList.vue b/src/modules/01_metadata/components/insignia/InsigniaList.vue new file mode 100644 index 00000000..d4e8900f --- /dev/null +++ b/src/modules/01_metadata/components/insignia/InsigniaList.vue @@ -0,0 +1,571 @@ + + + + + diff --git a/src/modules/01_metadata/components/insignia/InsigniaType.vue b/src/modules/01_metadata/components/insignia/InsigniaType.vue new file mode 100644 index 00000000..9db412fe --- /dev/null +++ b/src/modules/01_metadata/components/insignia/InsigniaType.vue @@ -0,0 +1,442 @@ + + + + + diff --git a/src/modules/01_metadata/components/insignia/TableDraggable.vue b/src/modules/01_metadata/components/insignia/TableDraggable.vue new file mode 100644 index 00000000..1a16aef1 --- /dev/null +++ b/src/modules/01_metadata/components/insignia/TableDraggable.vue @@ -0,0 +1,163 @@ + + + diff --git a/src/modules/01_metadata/components/personal/01ListPrefix.vue b/src/modules/01_metadata/components/personal/01ListPrefix.vue new file mode 100644 index 00000000..964a5db6 --- /dev/null +++ b/src/modules/01_metadata/components/personal/01ListPrefix.vue @@ -0,0 +1,257 @@ + + + diff --git a/src/modules/01_metadata/components/personal/02ListRank.vue b/src/modules/01_metadata/components/personal/02ListRank.vue new file mode 100644 index 00000000..914f9436 --- /dev/null +++ b/src/modules/01_metadata/components/personal/02ListRank.vue @@ -0,0 +1,263 @@ + + + diff --git a/src/modules/01_metadata/components/personal/03ListBloodGroup.vue b/src/modules/01_metadata/components/personal/03ListBloodGroup.vue new file mode 100644 index 00000000..c5ff7e88 --- /dev/null +++ b/src/modules/01_metadata/components/personal/03ListBloodGroup.vue @@ -0,0 +1,263 @@ + + + diff --git a/src/modules/01_metadata/components/personal/04ListGender.vue b/src/modules/01_metadata/components/personal/04ListGender.vue new file mode 100644 index 00000000..a9d223a9 --- /dev/null +++ b/src/modules/01_metadata/components/personal/04ListGender.vue @@ -0,0 +1,263 @@ + + + diff --git a/src/modules/01_metadata/components/personal/05ListReligion.vue b/src/modules/01_metadata/components/personal/05ListReligion.vue new file mode 100644 index 00000000..139422ad --- /dev/null +++ b/src/modules/01_metadata/components/personal/05ListReligion.vue @@ -0,0 +1,263 @@ + + + diff --git a/src/modules/01_metadata/components/personal/06ListRelationship.vue b/src/modules/01_metadata/components/personal/06ListRelationship.vue new file mode 100644 index 00000000..a3eaada8 --- /dev/null +++ b/src/modules/01_metadata/components/personal/06ListRelationship.vue @@ -0,0 +1,291 @@ + + + diff --git a/src/modules/01_metadata/components/personal/07ListEducationLevel.vue b/src/modules/01_metadata/components/personal/07ListEducationLevel.vue new file mode 100644 index 00000000..15e6e041 --- /dev/null +++ b/src/modules/01_metadata/components/personal/07ListEducationLevel.vue @@ -0,0 +1,279 @@ + + + diff --git a/src/modules/01_metadata/components/personal/08ListProvince.vue b/src/modules/01_metadata/components/personal/08ListProvince.vue new file mode 100644 index 00000000..030922b0 --- /dev/null +++ b/src/modules/01_metadata/components/personal/08ListProvince.vue @@ -0,0 +1,271 @@ + + + diff --git a/src/modules/01_metadata/components/personal/DialogForm.vue b/src/modules/01_metadata/components/personal/DialogForm.vue new file mode 100644 index 00000000..b76e2e48 --- /dev/null +++ b/src/modules/01_metadata/components/personal/DialogForm.vue @@ -0,0 +1,148 @@ + + + diff --git a/src/modules/01_metadata/components/personal/province/01_District.vue b/src/modules/01_metadata/components/personal/province/01_District.vue new file mode 100644 index 00000000..7a4b8347 --- /dev/null +++ b/src/modules/01_metadata/components/personal/province/01_District.vue @@ -0,0 +1,313 @@ + + + diff --git a/src/modules/01_metadata/components/personal/province/02_SubDistrict.vue b/src/modules/01_metadata/components/personal/province/02_SubDistrict.vue new file mode 100644 index 00000000..9cb668e6 --- /dev/null +++ b/src/modules/01_metadata/components/personal/province/02_SubDistrict.vue @@ -0,0 +1,324 @@ + + + diff --git a/src/modules/01_metadata/components/position-employee/01ListPosition.vue b/src/modules/01_metadata/components/position-employee/01ListPosition.vue new file mode 100644 index 00000000..1613b784 --- /dev/null +++ b/src/modules/01_metadata/components/position-employee/01ListPosition.vue @@ -0,0 +1,482 @@ + + diff --git a/src/modules/01_metadata/components/position-employee/02ListType.vue b/src/modules/01_metadata/components/position-employee/02ListType.vue new file mode 100644 index 00000000..27985d67 --- /dev/null +++ b/src/modules/01_metadata/components/position-employee/02ListType.vue @@ -0,0 +1,373 @@ + + + + + diff --git a/src/modules/01_metadata/components/position-employee/03ListLevel.vue b/src/modules/01_metadata/components/position-employee/03ListLevel.vue new file mode 100644 index 00000000..873633bc --- /dev/null +++ b/src/modules/01_metadata/components/position-employee/03ListLevel.vue @@ -0,0 +1,408 @@ + + + + + diff --git a/src/modules/01_metadata/components/position/01ListPosition.vue b/src/modules/01_metadata/components/position/01ListPosition.vue new file mode 100644 index 00000000..f588a116 --- /dev/null +++ b/src/modules/01_metadata/components/position/01ListPosition.vue @@ -0,0 +1,447 @@ + + diff --git a/src/modules/01_metadata/components/position/02ListType.vue b/src/modules/01_metadata/components/position/02ListType.vue new file mode 100644 index 00000000..221a2a46 --- /dev/null +++ b/src/modules/01_metadata/components/position/02ListType.vue @@ -0,0 +1,430 @@ + + + + + diff --git a/src/modules/01_metadata/components/position/03ListLevel.vue b/src/modules/01_metadata/components/position/03ListLevel.vue new file mode 100644 index 00000000..d08dd00a --- /dev/null +++ b/src/modules/01_metadata/components/position/03ListLevel.vue @@ -0,0 +1,30 @@ + + + + + diff --git a/src/modules/01_metadata/components/position/04ListExecutive.vue b/src/modules/01_metadata/components/position/04ListExecutive.vue new file mode 100644 index 00000000..7d7907e8 --- /dev/null +++ b/src/modules/01_metadata/components/position/04ListExecutive.vue @@ -0,0 +1,242 @@ + + + diff --git a/src/modules/01_metadata/components/position/05ListLevelDetail.vue b/src/modules/01_metadata/components/position/05ListLevelDetail.vue new file mode 100644 index 00000000..6ccea0c5 --- /dev/null +++ b/src/modules/01_metadata/components/position/05ListLevelDetail.vue @@ -0,0 +1,543 @@ + + + + + diff --git a/src/modules/01_metadata/components/position/DialogAddExecutive.vue b/src/modules/01_metadata/components/position/DialogAddExecutive.vue new file mode 100644 index 00000000..6b9d4a52 --- /dev/null +++ b/src/modules/01_metadata/components/position/DialogAddExecutive.vue @@ -0,0 +1,214 @@ + + + diff --git a/src/modules/01_metadata/components/position/DialogAddPosition.vue b/src/modules/01_metadata/components/position/DialogAddPosition.vue new file mode 100644 index 00000000..22522a79 --- /dev/null +++ b/src/modules/01_metadata/components/position/DialogAddPosition.vue @@ -0,0 +1,404 @@ + + + diff --git a/src/modules/01_metadata/interface/index/Calendar.ts b/src/modules/01_metadata/interface/index/Calendar.ts new file mode 100644 index 00000000..1435a903 --- /dev/null +++ b/src/modules/01_metadata/interface/index/Calendar.ts @@ -0,0 +1,68 @@ +interface DataSumCalendarObject { + id: number; + monthFull: String; + count: number; + color: String; +} +interface DataDateMonthObject { + month: number; + year: number; +} +interface DataDateAddObject { + year: number; + holidayDate: Date | string; + name: string; + isSpecial: boolean; +} + +//ข้อมูล +interface RequestItemsObject { + createdAt?: Date; + createdFullName: string; + createdUserId: string; + holidayDate: Date | string; + id: string; + isSpecial: boolean; + lastUpdateFullName: string; + lastUpdateUserId: string; + lastUpdatedAt?: Date; + name: string; + originalDate: Date; +} + +interface DataDateRowObject { + holidayDate: Date; + name: string; + isSpecial: boolean; + id: string; +} + +interface DataDateAddObject { + year: number; + holidayDate: Date | string; + name: string; + isSpecial: boolean; +} + +interface DataDateListsObject { + id: string; + dateRange: [Date, Date]; + dataRangeRow: DataDateRowObject[]; + detail: string; + isSpecial: boolean; +} + +interface TabsObject { + label: string; + value: string; +} + +export type { + DataSumCalendarObject, + DataDateMonthObject, + DataDateAddObject, + RequestItemsObject, + DataDateRowObject, + DataDateListsObject, + TabsObject, +}; diff --git a/src/modules/01_metadata/interface/index/Main.ts b/src/modules/01_metadata/interface/index/Main.ts new file mode 100644 index 00000000..0d239214 --- /dev/null +++ b/src/modules/01_metadata/interface/index/Main.ts @@ -0,0 +1,37 @@ +interface Pagination { + rowsPerPage: number; +} + +interface DataOption { + id: string; + name: string; +} +interface NewPagination { + descending: boolean; + page: number; + rowsPerPage: number; + sortBy: string; +} +interface ItemsMenu { + label: string; + value: string; + icon: string; + color: string; +} + +interface DataAssignment { + createdAt: string; + id: string; + including: string; + includingName: string; + period: string; + year: string; +} + +export type { + Pagination, + DataOption, + NewPagination, + ItemsMenu, + DataAssignment, +}; diff --git a/src/modules/01_metadata/interface/index/positionEmployee.ts b/src/modules/01_metadata/interface/index/positionEmployee.ts new file mode 100644 index 00000000..b23a01a7 --- /dev/null +++ b/src/modules/01_metadata/interface/index/positionEmployee.ts @@ -0,0 +1,28 @@ +interface ObjectGroupRef { + posTypeName: object | null; + posTypeShortName: object | null; + posTypeRank: object | null; + [key: string]: any; +} + +interface ObjectLevelRef { + posLevelName: object | null; + posLevelAuthority: object | null; + + [key: string]: any; +} + +interface ObjectPosRef { + posName: object | null; + posTypeName: object | null; + posLevelName: object | null; + + [key: string]: any; +} + +interface FormQuery { + type: string; + keyword: string; +} + +export type { ObjectGroupRef, ObjectLevelRef, ObjectPosRef, FormQuery }; diff --git a/src/modules/01_metadata/interface/request/Main.ts b/src/modules/01_metadata/interface/request/Main.ts new file mode 100644 index 00000000..61316352 --- /dev/null +++ b/src/modules/01_metadata/interface/request/Main.ts @@ -0,0 +1,75 @@ +interface DataSumCalendarObject { + id: number; + monthFull: String; + count: number; + color: String; +} + +interface DataListsObject { + id: number; + count: number; + name: string; +} + +interface FormListMainByRole { + page: number; + pageSize: number; + position: string; + round: string; + keyword: string; + year: number | null; +} +interface FormDataRole { + position: string; + year: number | null | string; + round: string; + org: string; + including: string; + includingName: string; + target: string; + unit: string; + weight: string; + meaning: string; + formula: string; + documentInfoEvidence: string; + node: number | null; + nodeId: string | null; + orgRevisionId: string | null; + date?: [null, null]; +} + +interface FormCompetency { + competencyType: string; + competencyName: string; + definition: string; + level_1: any; + level_2: string; + level_3: string; + level_4: string; + level_5: string; + evaluation: string; +} + +interface FormQueryCapacity { + page: number; + pageSize: number; + keyword: string; +} + +interface FormFilterAssignment { + keyword: string; + period: string; + year: number | string | null; + pageSize: number; + page: number; +} + +export type { + DataSumCalendarObject, + DataListsObject, + FormListMainByRole, + FormDataRole, + FormCompetency, + FormQueryCapacity, + FormFilterAssignment, +}; diff --git a/src/modules/01_metadata/interface/request/insignia/Badge.ts b/src/modules/01_metadata/interface/request/insignia/Badge.ts new file mode 100644 index 00000000..2c7ee1f8 --- /dev/null +++ b/src/modules/01_metadata/interface/request/insignia/Badge.ts @@ -0,0 +1,39 @@ +//ข้อมูลประวัติแก้ไข +interface RequestItemsPublishHistoryObject { + id: string; + items: RequestItemsHistoryObject[]; + publishedDate: string; +} + +//ข้อมูล +interface RequestItemsHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: string; + shortName: String; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { + RequestItemsHistoryObject, + RequestItemsPublishHistoryObject, + Columns, +}; diff --git a/src/modules/01_metadata/interface/request/insignia/Insignia.ts b/src/modules/01_metadata/interface/request/insignia/Insignia.ts new file mode 100644 index 00000000..f334e28b --- /dev/null +++ b/src/modules/01_metadata/interface/request/insignia/Insignia.ts @@ -0,0 +1,42 @@ +//ข้อมูลประวัติแก้ไข +interface RequestItemsPublishHistoryObject { + id: string; + items: RequestItemsHistoryObject[]; + publishedDate: string; +} + +//ข้อมูล +interface RequestItemsHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + level: number; + name: string; + shortName: String; + insigniaType?: any; + note: string; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { + RequestItemsHistoryObject, + RequestItemsPublishHistoryObject, + Columns, +}; diff --git a/src/modules/01_metadata/interface/request/insignia/InsigniaType.ts b/src/modules/01_metadata/interface/request/insignia/InsigniaType.ts new file mode 100644 index 00000000..6cb8bc59 --- /dev/null +++ b/src/modules/01_metadata/interface/request/insignia/InsigniaType.ts @@ -0,0 +1,38 @@ +//ข้อมูลประวัติแก้ไข +interface RequestItemsPublishHistoryObject { + id: string; + items: RequestItemsHistoryObject[]; + publishedDate: string; +} + +//ข้อมูล +interface RequestItemsHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: string; +} + +//columns +interface Columns { + [index: number]: { + name: String; + align: String; + label: String; + sortable: Boolean; + field: String; + headerStyle: String; + style: String; + }; +} + +export type { + RequestItemsHistoryObject, + RequestItemsPublishHistoryObject, + Columns, +}; diff --git a/src/modules/01_metadata/interface/request/position/index.ts b/src/modules/01_metadata/interface/request/position/index.ts new file mode 100644 index 00000000..098952d8 --- /dev/null +++ b/src/modules/01_metadata/interface/request/position/index.ts @@ -0,0 +1,122 @@ +interface Pagination { + rowsPerPage: number; +} + +interface DataOption { + id: string; + name: string; +} + +interface FormPositionSelectDialog { + positionId: string; + positionName: string; + positionField: string; + positionType: string; + positionLevel: string; + positionExecutive: string | null; + positionExecutiveField: string; + positionArea: string; +} + +interface FormPositionEmployeeSelectDialog { + positionId: string; + positionName: string; + positionType: string; + positionLevel: string; +} + +interface FormPositionSelectRef { + positionName: object | null; + positionField: object | null; + positionType: object | null; + positionLevel: object | null; + positionExecutive: object | null; + positionExecutiveField: object | null; + positionArea: object | null; + [key: string]: any; +} +interface FormPositionEmployeeSelectRef { + positionName: object | null; + positionType: object | null; + positionLevel: object | null; + [key: string]: any; +} +interface FormExecutiveRef { + posExecutiveName: object | null; + posExecutivePriority: object | null; + + [key: string]: any; +} + +interface OptionType { + id: string; + posTypeName: string; +} + +interface OptionLevel { + id: string; + posLevelName: string; +} + +interface OptionExecutive { + id: string; + posExecutiveName: string; +} + +interface FormPositionSelect { + positionId: string; + posTypeId: string; + positionName: string; + positionField: string; + positionType: string; + positionLevel: string; + positionExecutive: string; + positionExecutiveField: string; + positionArea: string; + isSpecial: boolean; +} +interface ListMenu { + label: string; + icon: string; + type: string; + color: string; +} + +interface RowDetailPositions { + id: string; + positionId: string; + positionName: string; + positionField: string; + positionType: string; + positionLevel: string; + positionExecutive: string; + positionExecutiveField: string; + positionArea: string; + posTypeId: string; + posLevelId: string; + posExecutiveId: string; + isSpecial: boolean; +} + +interface RowListForm { + id: string; + posExecutiveName: string; + posExecutivePriority: number | null; +} + +export type { + Pagination, + DataOption, + FormPositionSelect, + FormPositionSelectRef, + OptionType, + OptionLevel, + OptionExecutive, + ListMenu, + RowDetailPositions, + RowListForm, + FormPositionSelectDialog, + FormExecutiveRef, + FormPositionEmployeeSelectDialog, + FormPositionEmployeeSelectRef, +}; diff --git a/src/modules/01_metadata/interface/request/positionEmployee.ts b/src/modules/01_metadata/interface/request/positionEmployee.ts new file mode 100644 index 00000000..4212b731 --- /dev/null +++ b/src/modules/01_metadata/interface/request/positionEmployee.ts @@ -0,0 +1,13 @@ +interface FrmDataGroup { + posTypeName: string; + posTypeShortName: string; + posTypeRank: number | null; +} + +interface FormDataLevel { + posLevelName: number | null; + posTypeName: string | null; + posLevelAuthority: string; +} + +export type { FrmDataGroup, FormDataLevel }; diff --git a/src/modules/01_metadata/interface/response/Main.ts b/src/modules/01_metadata/interface/response/Main.ts new file mode 100644 index 00000000..56a44e96 --- /dev/null +++ b/src/modules/01_metadata/interface/response/Main.ts @@ -0,0 +1,61 @@ +interface ResRound { + createdAt: Date; + createdFullName: string; + createdUserId: Date; + durationKPI: string; + endDate: Date; + id: Date; + lastUpdateFullName: string; + lastUpdateUserId: Date; + lastUpdatedAt: Date; + startDate: Date; +} + +interface ResDataCapacity { + description: string; + id: string; + name: string; + type: string; + capacityDetails: capacityDetails; +} + +interface capacityDetails { + capacityId: string; + description: string; + id: string; + level: string; +} + +interface ResEvaluator { + createdAt: string; + createdFullName: string; + createdUserId: string; + id: string; + kpiUserEvaluationId: string; + lastUpdateFullName: string; + lastUpdateUserId: string; + lastUpdatedAt: string; + reason: string; + topic: string; + type: string; +} + +interface ResAssignment { + data: { + result: { + data: [ + { + createdAt: string; + id: string; + including: string; + includingName: string; + period: string; + year: string; + } + ]; + total: number; + }; + }; +} + +export type { ResRound, ResDataCapacity, ResEvaluator, ResAssignment }; diff --git a/src/modules/01_metadata/interface/response/Strategic.ts b/src/modules/01_metadata/interface/response/Strategic.ts new file mode 100644 index 00000000..f2aa563c --- /dev/null +++ b/src/modules/01_metadata/interface/response/Strategic.ts @@ -0,0 +1,8 @@ +interface DataStrategic { + id: string; + name: string; + level: number; + children: DataStrategic; +} + +export type { DataStrategic }; diff --git a/src/modules/01_metadata/interface/response/insignia/Insignia.ts b/src/modules/01_metadata/interface/response/insignia/Insignia.ts new file mode 100644 index 00000000..b95bf82e --- /dev/null +++ b/src/modules/01_metadata/interface/response/insignia/Insignia.ts @@ -0,0 +1,34 @@ +interface DataResponse { + createdAt: Date; + id: string; + isActive: boolean; + lastUpdateFullName: String; + lastUpdatedAt: Date; + name: string; + level: Number; +} + +interface DataRow { + createdAt: string | null; + id: string; + isActive: boolean; + lastUpdateFullName: String; + lastUpdatedAt: string | null; + name: string; +} + +interface DetailResponse extends DataResponse { + note: string; + shortName: string; + insigniaType: string; + insigniaTypeId: string; + level: number; +} + +interface DetailRow + extends Omit { + createdAt: string | null; + lastUpdatedAt: string | null; +} + +export type { DataResponse, DataRow, DetailResponse, DetailRow }; diff --git a/src/modules/01_metadata/interface/response/insignia/InsigniaType.ts b/src/modules/01_metadata/interface/response/insignia/InsigniaType.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/insignia/InsigniaType.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/organization/Agency.ts b/src/modules/01_metadata/interface/response/organization/Agency.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/organization/Agency.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/organization/Fax.ts b/src/modules/01_metadata/interface/response/organization/Fax.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/organization/Fax.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/organization/GovernmentAgency.ts b/src/modules/01_metadata/interface/response/organization/GovernmentAgency.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/organization/GovernmentAgency.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/organization/Level.ts b/src/modules/01_metadata/interface/response/organization/Level.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/organization/Level.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/organization/Organization.ts b/src/modules/01_metadata/interface/response/organization/Organization.ts new file mode 100644 index 00000000..ed77a8ab --- /dev/null +++ b/src/modules/01_metadata/interface/response/organization/Organization.ts @@ -0,0 +1,15 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; + note: string; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/organization/ShortName.ts b/src/modules/01_metadata/interface/response/organization/ShortName.ts new file mode 100644 index 00000000..89e6f98b --- /dev/null +++ b/src/modules/01_metadata/interface/response/organization/ShortName.ts @@ -0,0 +1,17 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + agencyCode: String; + governmentCode: String; + name: String; + note: string; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/organization/Status.ts b/src/modules/01_metadata/interface/response/organization/Status.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/organization/Status.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/organization/TelExternal.ts b/src/modules/01_metadata/interface/response/organization/TelExternal.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/organization/TelExternal.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/organization/TelInternal.ts b/src/modules/01_metadata/interface/response/organization/TelInternal.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/organization/TelInternal.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/organization/Type.ts b/src/modules/01_metadata/interface/response/organization/Type.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/organization/Type.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/person/Blood.ts b/src/modules/01_metadata/interface/response/person/Blood.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/person/Blood.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/person/District.ts b/src/modules/01_metadata/interface/response/person/District.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/person/District.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/person/Education.ts b/src/modules/01_metadata/interface/response/person/Education.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/person/Education.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/person/Gender.ts b/src/modules/01_metadata/interface/response/person/Gender.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/person/Gender.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/person/Prefix.ts b/src/modules/01_metadata/interface/response/person/Prefix.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/person/Prefix.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/person/Province.ts b/src/modules/01_metadata/interface/response/person/Province.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/person/Province.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/person/Relationship.ts b/src/modules/01_metadata/interface/response/person/Relationship.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/person/Relationship.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/person/Religion.ts b/src/modules/01_metadata/interface/response/person/Religion.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/person/Religion.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/person/SubDistrict.ts b/src/modules/01_metadata/interface/response/person/SubDistrict.ts new file mode 100644 index 00000000..ca293df0 --- /dev/null +++ b/src/modules/01_metadata/interface/response/person/SubDistrict.ts @@ -0,0 +1,15 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; + zipCode: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/personal/personal.ts b/src/modules/01_metadata/interface/response/personal/personal.ts new file mode 100644 index 00000000..9a470b3d --- /dev/null +++ b/src/modules/01_metadata/interface/response/personal/personal.ts @@ -0,0 +1,52 @@ +interface DataResponse { + createdAt: Date; + id: string; + lastUpdateFullName: String; + lastUpdatedAt: Date; + prefix?: string; + rank?: number; + bloodgroup?: string; + gender?: string; + religion?: string; + relationship?: string; + name?: string; +} + +interface DataRow { + createdAt: string | null; + id: string; + lastUpdateFullName: String; + lastUpdatedAt: string | null; + prefix?: string; + rank?: number; + bloodgroup?: string; + gender?: string; + religion?: string; + relationship?: string; + name?: string; +} + +interface FormDistrict { + id: string; + createdAt: string; + createdUserId: string; + lastUpdatedAt: string; + lastUpdateUserId: string; + createdFullName: string; + lastUpdateFullName: string; + name: string; + provinceId: string; +} + +interface FormSubDistrict { + id: string; + createdAt: string; + createdUserId: string; + lastUpdatedAt: string; + lastUpdateUserId: string; + createdFullName: string; + lastUpdateFullName: string; + name: string; + provinceId: string; +} +export type { DataResponse, DataRow,FormDistrict,FormSubDistrict }; diff --git a/src/modules/01_metadata/interface/response/position/Executive.ts b/src/modules/01_metadata/interface/response/position/Executive.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/position/Executive.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/position/ExecutiveSide.ts b/src/modules/01_metadata/interface/response/position/ExecutiveSide.ts new file mode 100644 index 00000000..ed77a8ab --- /dev/null +++ b/src/modules/01_metadata/interface/response/position/ExecutiveSide.ts @@ -0,0 +1,15 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; + note: string; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/position/Level.ts b/src/modules/01_metadata/interface/response/position/Level.ts new file mode 100644 index 00000000..caae2102 --- /dev/null +++ b/src/modules/01_metadata/interface/response/position/Level.ts @@ -0,0 +1,16 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + level: number; + name: String; + shortName: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/position/Line.ts b/src/modules/01_metadata/interface/response/position/Line.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/position/Line.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/position/ListType.ts b/src/modules/01_metadata/interface/response/position/ListType.ts new file mode 100644 index 00000000..e40d8d24 --- /dev/null +++ b/src/modules/01_metadata/interface/response/position/ListType.ts @@ -0,0 +1,30 @@ +interface DataResponse { + createdAt: Date; + id: string; + lastUpdateFullName: String; + lastUpdatedAt: Date; + posTypes?: { + id: string; + posTypeName: string; + posTypeRank: number; + }; + posTypeName?: string; + posLevelName?: string; + posLevelRank?: number; + posLevelAuthority?: string; +} + +interface DataRow { + createdAt: string | null; + id: string; + lastUpdateFullName: String; + lastUpdatedAt: string | null; + posTypeName?: string; + posTypeRank?: number; + posTypeId?: string; + posLevelName?: string; + posLevelRank?: number; + posLevelAuthority?: string; +} + +export type { DataResponse, DataRow }; diff --git a/src/modules/01_metadata/interface/response/position/Path.ts b/src/modules/01_metadata/interface/response/position/Path.ts new file mode 100644 index 00000000..ed77a8ab --- /dev/null +++ b/src/modules/01_metadata/interface/response/position/Path.ts @@ -0,0 +1,15 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; + note: string; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/position/PathSide.ts b/src/modules/01_metadata/interface/response/position/PathSide.ts new file mode 100644 index 00000000..ed77a8ab --- /dev/null +++ b/src/modules/01_metadata/interface/response/position/PathSide.ts @@ -0,0 +1,15 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; + note: string; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/position/Status.ts b/src/modules/01_metadata/interface/response/position/Status.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/position/Status.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/position/Type.ts b/src/modules/01_metadata/interface/response/position/Type.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/position/Type.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/positionEmployee/Group.ts b/src/modules/01_metadata/interface/response/positionEmployee/Group.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/positionEmployee/Group.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/positionEmployee/Level.ts b/src/modules/01_metadata/interface/response/positionEmployee/Level.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/positionEmployee/Level.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/positionEmployee/Line.ts b/src/modules/01_metadata/interface/response/positionEmployee/Line.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/positionEmployee/Line.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/positionEmployee/Main.ts b/src/modules/01_metadata/interface/response/positionEmployee/Main.ts new file mode 100644 index 00000000..64ed9d67 --- /dev/null +++ b/src/modules/01_metadata/interface/response/positionEmployee/Main.ts @@ -0,0 +1,26 @@ +interface ResGroup { + id: string; + posLevels: ResLevel[]; + posTypeName: string; + posTypeRank: number; + posTypeShortName: string; +} + +interface ResLevel { + id: string; + posLevelName: number; + posTypeName: string; + posTypeId: string; + posLevelAuthority: string; +} + +interface ResPossition { + id: string; + posDictName: string; + posLevelId: string; + posLevelName: number; + posTypeId: string; + posTypeName: string; +} + +export type { ResGroup, ResLevel, ResPossition }; diff --git a/src/modules/01_metadata/interface/response/positionEmployee/Position.ts b/src/modules/01_metadata/interface/response/positionEmployee/Position.ts new file mode 100644 index 00000000..ed77a8ab --- /dev/null +++ b/src/modules/01_metadata/interface/response/positionEmployee/Position.ts @@ -0,0 +1,15 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; + note: string; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/positionEmployee/PositionSide.ts b/src/modules/01_metadata/interface/response/positionEmployee/PositionSide.ts new file mode 100644 index 00000000..ed77a8ab --- /dev/null +++ b/src/modules/01_metadata/interface/response/positionEmployee/PositionSide.ts @@ -0,0 +1,15 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; + note: string; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/interface/response/positionEmployee/Status.ts b/src/modules/01_metadata/interface/response/positionEmployee/Status.ts new file mode 100644 index 00000000..a6fa6a97 --- /dev/null +++ b/src/modules/01_metadata/interface/response/positionEmployee/Status.ts @@ -0,0 +1,14 @@ +//ข้อมูล +interface ResponseHistoryObject { + createdAt?: Date; + createdFullName: String; + createdUserId: String; + id: String; + isActive: Boolean; + lastUpdateFullName: String; + lastUpdateUserId: String; + lastUpdatedAt?: Date; + name: String; +} + +export type { ResponseHistoryObject }; diff --git a/src/modules/01_metadata/router.ts b/src/modules/01_metadata/router.ts new file mode 100644 index 00000000..dfee7ebb --- /dev/null +++ b/src/modules/01_metadata/router.ts @@ -0,0 +1,269 @@ +const calendarWorkPage = () => + import("@/modules/01_metadata/views/calendar.vue"); +const masterInsignia = () => import("@/modules/01_metadata/views/insignia.vue"); +const detailInsignia = () => + import("@/modules/01_metadata/components/insignia/InsigniaDetail.vue"); +const personalPage = () => import("@/modules/01_metadata/views/personal.vue"); +const personalDistrict = () => + import("@/modules/01_metadata/components/personal/province/01_District.vue"); +const personalSubDistrict = () => + import( + "@/modules/01_metadata/components/personal/province/02_SubDistrict.vue" + ); +const positionPage = () => import("@/modules/01_metadata/views/position.vue"); +const positionLevelPage = () => + import("@/modules/01_metadata/components/position/03ListLevel.vue"); +const positionEmployeePage = () => + import("@/modules/01_metadata/views/positionEmployee.vue"); +const positionEmployeeLevelPage = () => + import("@/modules/01_metadata/components/position-employee/03ListLevel.vue"); + +const IndicatorByPlan = () => + import("@/modules/01_metadata/views/indicatorByPlan.vue"); +const IndicatorByPlanDetail = () => + import( + "@/modules/01_metadata/components/Indicators/indicatorByPlan/DetailView.vue" + ); +const IndicatorByRole = () => + import("@/modules/01_metadata/views/indicatorByRole.vue"); +const IndicatorByRoleDetail = () => + import( + "@/modules/01_metadata/components/Indicators/indicatorByRole/DetailView.vue" + ); +const competencyPage = () => + import("@/modules/01_metadata/views/competency.vue"); +const competencyAddPage = () => + import("@/modules/01_metadata/components/competency/AddPage.vue"); +const StrategicView = () => import("@/modules/01_metadata/views/Strategic.vue"); +const AssignmentView = () => + import("@/modules/01_metadata/views/Assignment.vue"); +const AssignmentDetailView = () => + import( + "@/modules/01_metadata/components/Indicators/Assignment/DetailView.vue" + ); + +export default [ + { + path: "/master-data/calendar", + name: "masterCalendarWork", + component: calendarWorkPage, + meta: { + Auth: true, + Key: [7], + Role: "metadata", + }, + }, + { + path: "/master-data/insignia", + name: "masterInsignia", + component: masterInsignia, + meta: { + Auth: true, + Key: [7], + Role: "metadata", + }, + }, + { + path: "/master-data/insignia/detail/:id", + name: "masterInsigniadetail", + component: detailInsignia, + meta: { + Auth: true, + Key: [7], + Role: "metadata", + }, + }, + { + path: "/master-data/personal", + name: "masterPersonal", + component: personalPage, + meta: { + Auth: true, + Key: [7], + Role: "metadata", + }, + }, + { + path: "/master-data/personal/district/:id", + name: "masterPersonalDistrict", + component: personalDistrict, + meta: { + Auth: true, + Key: [7], + Role: "metadata", + }, + }, + { + path: "/master-data/personal/sub-district/:provinceId/:id", + name: "masterPersonalSubDistrict", + component: personalSubDistrict, + meta: { + Auth: true, + Key: [7], + Role: "metadata", + }, + }, + { + path: "/master-data/position", + name: "masterPosition", + component: positionPage, + meta: { + Auth: true, + Key: [7], + Role: "metadata", + }, + }, + { + path: "/master-data/position/level/:id", + name: "masterPositionLevel", + component: positionLevelPage, + meta: { + Auth: true, + Key: [9], + Role: "metadata", + }, + }, + { + path: "/master-data/position-employee", + name: "masterPositionEmployee", + component: positionEmployeePage, + meta: { + Auth: true, + Key: [8], + Role: "metadata", + }, + }, + { + path: "/master-data/position-employee/level/:id", + name: "masterPositionEmployeeLevel", + component: positionEmployeeLevelPage, + meta: { + Auth: true, + Key: [9], + Role: "metadata", + }, + }, + + { + path: "/KPI-indicator-plan", + name: "KPIIndicatorByPlan", + component: IndicatorByPlan, + meta: { + Auth: true, + Key: [1.1], + Role: "evaluateKPI", + }, + }, + + { + path: "/KPI-indicator-plan/add", + name: "KPIIndicatorByPlan/Add", + component: IndicatorByPlanDetail, + meta: { + Auth: true, + Key: [1.1], + Role: "evaluateKPI", + }, + }, + { + path: "/KPI-indicator-plan/:id", + name: "KPIIndicatorByPlanByid", + component: IndicatorByPlanDetail, + meta: { + Auth: true, + Key: [1.1], + Role: "evaluateKPI", + }, + }, + { + path: "/KPI-indicator-role", + name: "KPIIndicatorByRole", + component: IndicatorByRole, + meta: { + Auth: true, + Key: [1.1], + Role: "evaluateKPI", + }, + }, + { + path: "/KPI-indicator-role/add", + name: "KPIIndicatorByRoleAdd", + component: IndicatorByRoleDetail, + meta: { + Auth: true, + Key: [1.1], + Role: "evaluateKPI", + }, + }, + { + path: "/KPI-indicator-role/:id", + name: "KPIIndicatorByRoleByid", + component: IndicatorByRoleDetail, + meta: { + Auth: true, + Key: [1.1], + Role: "evaluateKPI", + }, + }, + { + path: "/KPI-competency", + name: "KPICompetency", + component: competencyPage, + meta: { + Auth: true, + Key: [1.1], + Role: "evaluateKPI", + }, + }, + { + path: "/KPI-competency/add", + name: "KPICompetencyAdd", + component: competencyAddPage, + meta: { + Auth: true, + Key: [1.1], + Role: "evaluateKPI", + }, + }, + { + path: "/KPI-competency/:id", + name: "KPICompetencyByid", + component: competencyAddPage, + meta: { + Auth: true, + Key: [1.1], + Role: "evaluateKPI", + }, + }, + + { + path: "/strategic", + name: "strategic", + component: StrategicView, + meta: { + Auth: true, + Key: [1.6], + Role: "development", + }, + }, + { + path: "/assignment", + name: "KPIAssignment", + component: AssignmentView, + meta: { + Auth: true, + Key: [1.6], + Role: "development", + }, + }, + { + path: "/assignment/:id", + name: "KPIAssignmentById", + component: AssignmentDetailView, + meta: { + Auth: true, + Key: [1.1], + Role: "evaluateKPI", + }, + }, +]; diff --git a/src/modules/01_metadata/store.ts b/src/modules/01_metadata/store.ts new file mode 100644 index 00000000..e69de29b diff --git a/src/modules/01_metadata/stores/InsigniaStore.ts b/src/modules/01_metadata/stores/InsigniaStore.ts new file mode 100644 index 00000000..dbcfb026 --- /dev/null +++ b/src/modules/01_metadata/stores/InsigniaStore.ts @@ -0,0 +1,31 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; +import type { + DataResponse, + DataRow, +} from "../interface/response/insignia/Insignia"; +import { useCounterMixin } from "@/stores/mixin"; + +const { date2Thai } = useCounterMixin(); + +export const useInsigniaDataStore = defineStore("insigniaData", () => { + const row = ref([]); + function fetchData(data: DataResponse[], insigniaType?: string) { + // data.forEach((row, index) => { + // row.level = index + 1; + // }); + const list = data.map((e) => ({ + ...e, + insigniaType: insigniaType, + createdAt: e.createdAt ? date2Thai(e.createdAt) : "", + lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "", + })); + list; + row.value = list; + } + + return { + fetchData, + row, + }; +}); diff --git a/src/modules/01_metadata/stores/KPIStore.ts b/src/modules/01_metadata/stores/KPIStore.ts new file mode 100644 index 00000000..18533052 --- /dev/null +++ b/src/modules/01_metadata/stores/KPIStore.ts @@ -0,0 +1,194 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; +import type { DataOption } from "@/modules/14_KPI/interface/index/Main"; + +// store +export const useKPIDataStore = defineStore("KPIDataStore", () => { + const competencyTypeVal = ref("HEAD"); + + const tabMain = ref("1"); + const dataProfile = ref(); + const dataEvaluation = ref({ + plannedPoint: 0, + rolePoint: 0, + specialPoint: 0, + capacityPoint: 0, + }); + + const competencyType = ref([ + { + id: "HEAD", + name: "สมรรถนะหลัก", + }, + { + id: "GROUP", + name: "สมรรถนะประจำกลุ่มงาน", + }, + { + id: "EXECUTIVE", + name: "สมรรถนะประจำผู้บริหารกรุงเทพมหานคร", + }, + { + id: "DIRECTOR", + name: "สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ.เขต ผช.ผอ.เขต และหัวหน้าฝ่ายในสังกัด สนง.เขต", + }, + { + id: "INSPECTOR", + name: "สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ", + }, + ]); + + function convertStatus(val: string) { + switch (val) { + case "PENDING": + return "รอดำเนินการ"; + case "INPROGRESS": + return "กําลังดำเนินการ"; + case "DONE": + return "ประเมินเสร็จสิ้น"; + default: + break; + } + } + + function convertResults(val: string) { + switch (val) { + case "PENDING": + return "รอดำเนินการ"; + case "PASSED": + return "ผ่านการประเมิน"; + case "NOTPASSED": + return "ไม่ผ่านการประเมิน"; + default: + break; + } + } + + const ratingColors = ref([ + "light-blue-3", + "light-blue-6", + "blue", + "blue-9", + "blue-10", + ]); + + function checkCompetency() { + const position = dataProfile.value.position; + const posTypeName = dataProfile.value.posTypeName; + const posLevelName = dataProfile.value.posLevelName; + + if ( + position == "ผู้ตรวจราชการกรุงเทพมหานคร" || + position == "ผู้ตรวจราชการ" + ) { + competencyType.value = competencyType.value.filter( + (x: DataOption) => x.id == "HEAD" || x.id == "INSPECTOR" + ); + } else if (position == "ผู้อำนวยการเขต") { + competencyType.value = competencyType.value.filter( + (x: DataOption) => x.id == "HEAD" || x.id == "DIRECTOR" + ); + } else { + switch (posTypeName + " " + posLevelName) { + // case "ทั่วไป ปฏิบัติงาน": + // case "ทั่วไป ชำนาญงาน": + // case "ทั่วไป อาวุโส": + // case "วิชาการ ปฏิบัติการ": + // case "วิชาการ ชำนาญการ": + // case "วิชาการ ชำนาญการพิเศษ": + // case "วิชาการ เชี่ยวชาญ": + // case "วิชาการ ทรงคุณวุฒิ": + // competencyType.value = competencyType.value.filter( + // (x: DataOptions) => x.id == "HEAD" || x.id == "GROUP" + // ); + // break; + case "อำนวยการ ต้น": + case "อำนวยการ สูง": + case "บริหาร ต้น": + case "บริหาร สูง": + competencyType.value = competencyType.value.filter( + (x: DataOption) => x.id == "HEAD" || x.id == "EXECUTIVE" + ); + break; + default: + competencyType.value = competencyType.value.filter( + (x: DataOption) => x.id == "HEAD" || x.id == "GROUP" + ); + break; + } + } + } + + const defaultCompetencyCoreLevel = ref(); + const defaultCompetencyGroupLevel = ref(null); + function checkCompetencyDefaultCompetencyLevel() { + const posTypeName = dataProfile.value.posTypeName; + const posLevelName = dataProfile.value.posLevelName; + + switch (posTypeName + " " + posLevelName) { + case "บริหาร สูง": + defaultCompetencyCoreLevel.value = 5; + break; + case "บริหาร ต้น": + defaultCompetencyCoreLevel.value = 4; + break; + case "อำนวยการ สูง": + defaultCompetencyCoreLevel.value = 4; + break; + case "อำนวยการ ต้น": + defaultCompetencyCoreLevel.value = 3; + break; + case "วิชาการ ทรงคุณวุฒิ": + defaultCompetencyCoreLevel.value = 5; + defaultCompetencyGroupLevel.value = 5; + break; + case "วิชาการ เชี่ยวชาญ": + defaultCompetencyCoreLevel.value = 4; + defaultCompetencyGroupLevel.value = 4; + break; + case "วิชาการ ชำนาญการพิเศษ": + defaultCompetencyCoreLevel.value = 3; + defaultCompetencyGroupLevel.value = 4; + break; + case "วิชาการ ชำนาญการ": + defaultCompetencyCoreLevel.value = 2; + defaultCompetencyGroupLevel.value = 3; + break; + case "วิชาการ ปฏิบัติการ": + defaultCompetencyCoreLevel.value = 1; + defaultCompetencyGroupLevel.value = 2; + break; + case "ทั่วไป ทักษะพิเศษ": + defaultCompetencyCoreLevel.value = 4; + defaultCompetencyGroupLevel.value = 4; + break; + case "ทั่วไป อาวุโส": + defaultCompetencyCoreLevel.value = 3; + defaultCompetencyGroupLevel.value = 3; + break; + case "ทั่วไป ชำนาญงาน": + defaultCompetencyCoreLevel.value = 2; + defaultCompetencyGroupLevel.value = 2; + break; + case "ทั่วไป ปฏิบัติงาน": + defaultCompetencyCoreLevel.value = 1; + defaultCompetencyGroupLevel.value = 1; + break; + default: + break; + } + } + + return { + competencyTypeVal, + competencyType, + convertStatus, + convertResults, + tabMain, + dataProfile, + dataEvaluation, + ratingColors, + checkCompetency, + checkCompetencyDefaultCompetencyLevel, + }; +}); diff --git a/src/modules/01_metadata/stores/calendarStore.ts b/src/modules/01_metadata/stores/calendarStore.ts new file mode 100644 index 00000000..e69de29b diff --git a/src/modules/01_metadata/stores/main.ts b/src/modules/01_metadata/stores/main.ts new file mode 100644 index 00000000..b0d36f09 --- /dev/null +++ b/src/modules/01_metadata/stores/main.ts @@ -0,0 +1,30 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; +import type { DataOption } from "@/interface/main"; + +export const useMainOptionDataStore = defineStore("MainOptionData", () => { + const posLevelAuthorityOption = ref([ + { + id: "HEAD", + label: "หัวหน้าหน่วยงาน", + }, + { + id: "DEPUTY", + label: "ปลัด", + }, + { + id: "GOVERNOR", + label: "ผู้ว่าฯ", + }, + ]); + + function posLevelAuthorityConvert(val: string) { + return posLevelAuthorityOption.value.find((x: DataOption) => x.id === val) + ?.label; + } + + return { + posLevelAuthorityOption, + posLevelAuthorityConvert, + }; +}); diff --git a/src/modules/01_metadata/stores/personalStore.ts b/src/modules/01_metadata/stores/personalStore.ts new file mode 100644 index 00000000..64388dca --- /dev/null +++ b/src/modules/01_metadata/stores/personalStore.ts @@ -0,0 +1,28 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; +import type { + DataResponse, + DataRow, +} from "../interface/response/personal/personal"; +import { useCounterMixin } from "@/stores/mixin"; + +const { date2Thai } = useCounterMixin(); + +export const usePersonalDataStore = defineStore("PersonalData", () => { + const row = ref([]); + const currentTab = ref("list_prefix"); + + function save(data: DataResponse[]) { + const list = data.map((e) => ({ + ...e, + createdAt: e.createdAt ? date2Thai(e.createdAt) : "", + lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "", + })); + row.value = list; + } + return { + save, + row, + currentTab + }; +}); diff --git a/src/modules/01_metadata/stores/positionEmployeeStore.ts b/src/modules/01_metadata/stores/positionEmployeeStore.ts new file mode 100644 index 00000000..26ff56fb --- /dev/null +++ b/src/modules/01_metadata/stores/positionEmployeeStore.ts @@ -0,0 +1,25 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; + +import type { + DataResponse, + DataRow, +} from "../interface/response/position/ListType"; +import type { ResGroup } from "@/modules/01_metadata/interface/response/positionEmployee/Main"; + +import { useCounterMixin } from "@/stores/mixin"; +import { useMainOptionDataStore } from "@/modules/01_metadata/stores/main"; +const storeOption = useMainOptionDataStore(); + +const { date2Thai } = useCounterMixin(); + +export const usePositionEmployeeDataStore = defineStore( + "positionEmployeeStore", + () => { + const pathLocation = ref("list_position"); + + return { + pathLocation, + }; + } +); diff --git a/src/modules/01_metadata/stores/positionListStore.ts b/src/modules/01_metadata/stores/positionListStore.ts new file mode 100644 index 00000000..8827f2d3 --- /dev/null +++ b/src/modules/01_metadata/stores/positionListStore.ts @@ -0,0 +1,37 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; +import type { + DataResponse, + DataRow, +} from "../interface/response/position/ListType"; +import { useMainOptionDataStore } from "@/modules/01_metadata/stores/main"; +import { useCounterMixin } from "@/stores/mixin"; +const storeOption = useMainOptionDataStore(); + +const { date2Thai } = useCounterMixin(); + +export const usePositionDataStore = defineStore("PositionData", () => { + const pathLocation = ref("list_position"); + const row = ref([]); + function save(data: DataResponse[]) { + const list = data.map((e) => ({ + ...e, + posTypes: undefined, + posTypeId: e.posTypes?.id, + posTypeName: e.posTypes?.posTypeName, + posTypeRank: e.posTypes?.posTypeRank, + createdAt: e.createdAt ? date2Thai(e.createdAt) : "", + lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "", + posLevelAuthority: e.posLevelAuthority + ? storeOption.posLevelAuthorityConvert(e.posLevelAuthority) + : "-", + })) satisfies DataRow[]; + row.value = list; + } + + return { + save, + row, + pathLocation, + }; +}); diff --git a/src/modules/01_metadata/stores/positionTypeStore.ts b/src/modules/01_metadata/stores/positionTypeStore.ts new file mode 100644 index 00000000..255aa3a3 --- /dev/null +++ b/src/modules/01_metadata/stores/positionTypeStore.ts @@ -0,0 +1,28 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; +import type { + DataResponse, + DataRow, +} from "../interface/response/position/ListType"; +import { useCounterMixin } from "@/stores/mixin"; + +const { date2Thai } = useCounterMixin(); + +export const usePositionTypeDataStore = defineStore("PositionTypeData", () => { + const row = ref([]); + + function save(data: DataResponse[]) { + const list = data.map((e) => ({ + ...e, + posTypes: undefined, + posTypeId: e.posTypes?.id, + createdAt: e.createdAt ? date2Thai(e.createdAt) : "", + lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "", + })) satisfies DataRow[]; + row.value = list; + } + return { + save, + row, + }; +}); diff --git a/src/modules/01_metadata/views/Assignment.vue b/src/modules/01_metadata/views/Assignment.vue new file mode 100644 index 00000000..1d766656 --- /dev/null +++ b/src/modules/01_metadata/views/Assignment.vue @@ -0,0 +1,315 @@ + + + + + diff --git a/src/modules/01_metadata/views/Strategic.vue b/src/modules/01_metadata/views/Strategic.vue new file mode 100644 index 00000000..b1027b9e --- /dev/null +++ b/src/modules/01_metadata/views/Strategic.vue @@ -0,0 +1,375 @@ + + + + diff --git a/src/modules/01_metadata/views/calendar.vue b/src/modules/01_metadata/views/calendar.vue new file mode 100644 index 00000000..bb7f05b6 --- /dev/null +++ b/src/modules/01_metadata/views/calendar.vue @@ -0,0 +1,108 @@ + + + + diff --git a/src/modules/01_metadata/views/competency.vue b/src/modules/01_metadata/views/competency.vue new file mode 100644 index 00000000..30a63f16 --- /dev/null +++ b/src/modules/01_metadata/views/competency.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/src/modules/01_metadata/views/indicatorByPlan.vue b/src/modules/01_metadata/views/indicatorByPlan.vue new file mode 100644 index 00000000..1c812e17 --- /dev/null +++ b/src/modules/01_metadata/views/indicatorByPlan.vue @@ -0,0 +1,508 @@ + + + + + diff --git a/src/modules/01_metadata/views/indicatorByRole.vue b/src/modules/01_metadata/views/indicatorByRole.vue new file mode 100644 index 00000000..047b6d46 --- /dev/null +++ b/src/modules/01_metadata/views/indicatorByRole.vue @@ -0,0 +1,526 @@ + + + + + diff --git a/src/modules/01_metadata/views/insignia.vue b/src/modules/01_metadata/views/insignia.vue new file mode 100644 index 00000000..610b37e3 --- /dev/null +++ b/src/modules/01_metadata/views/insignia.vue @@ -0,0 +1,12 @@ + + + + diff --git a/src/modules/01_metadata/views/personal.vue b/src/modules/01_metadata/views/personal.vue new file mode 100644 index 00000000..4f0a39e7 --- /dev/null +++ b/src/modules/01_metadata/views/personal.vue @@ -0,0 +1,89 @@ + + + + + diff --git a/src/modules/01_metadata/views/position.vue b/src/modules/01_metadata/views/position.vue new file mode 100644 index 00000000..e0854e0e --- /dev/null +++ b/src/modules/01_metadata/views/position.vue @@ -0,0 +1,64 @@ +div + + + + + diff --git a/src/modules/01_metadata/views/positionEmployee.vue b/src/modules/01_metadata/views/positionEmployee.vue new file mode 100644 index 00000000..827697eb --- /dev/null +++ b/src/modules/01_metadata/views/positionEmployee.vue @@ -0,0 +1,62 @@ +div + + + + + diff --git a/src/modules/02_users/components/index.vue b/src/modules/02_users/components/index.vue new file mode 100644 index 00000000..e69de29b diff --git a/src/modules/02_users/interface/index/Main.ts b/src/modules/02_users/interface/index/Main.ts new file mode 100644 index 00000000..1aeb5a4b --- /dev/null +++ b/src/modules/02_users/interface/index/Main.ts @@ -0,0 +1,5 @@ +interface Pagination { + rowsPerPage: number; +} + +export type { Pagination }; diff --git a/src/modules/02_users/interface/request/Main.ts b/src/modules/02_users/interface/request/Main.ts new file mode 100644 index 00000000..02867600 --- /dev/null +++ b/src/modules/02_users/interface/request/Main.ts @@ -0,0 +1,7 @@ +interface DataListsObject { + id: number; + count: number; + name: string; +} + +export type { DataListsObject }; diff --git a/src/modules/02_users/interface/response/Main.ts b/src/modules/02_users/interface/response/Main.ts new file mode 100644 index 00000000..da7e9293 --- /dev/null +++ b/src/modules/02_users/interface/response/Main.ts @@ -0,0 +1,14 @@ +interface ResRound { + createdAt: Date; + createdFullName: string; + createdUserId: Date; + durationKPI: string; + endDate: Date; + id: Date; + lastUpdateFullName: string; + lastUpdateUserId: Date; + lastUpdatedAt: Date; + startDate: Date; +} + +export type { ResRound }; diff --git a/src/modules/02_users/router.ts b/src/modules/02_users/router.ts new file mode 100644 index 00000000..0fd9f8be --- /dev/null +++ b/src/modules/02_users/router.ts @@ -0,0 +1,18 @@ +const ListsPage = () => import("@/modules/02_users/views/lists.vue"); + +export default [ + { + path: "/users", + name: "manageUsers", + component: ListsPage, + meta: { + Auth: true, + Key: [7], + Role: "user_role", + }, + }, + { + path: "/users/:id", + name: "masterInsignia", + }, +]; diff --git a/src/modules/02_users/stores/main.ts b/src/modules/02_users/stores/main.ts new file mode 100644 index 00000000..b96ea3e0 --- /dev/null +++ b/src/modules/02_users/stores/main.ts @@ -0,0 +1,5 @@ +import { defineStore } from "pinia"; + +export const useDataStore = defineStore("storeData", () => { + return {}; +}); diff --git a/src/modules/02_users/views/lists.vue b/src/modules/02_users/views/lists.vue new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/src/modules/02_users/views/lists.vue @@ -0,0 +1 @@ + diff --git a/src/modules/03_logs/components/index.vue b/src/modules/03_logs/components/index.vue new file mode 100644 index 00000000..e69de29b diff --git a/src/modules/03_logs/interface/index/Main.ts b/src/modules/03_logs/interface/index/Main.ts new file mode 100644 index 00000000..1aeb5a4b --- /dev/null +++ b/src/modules/03_logs/interface/index/Main.ts @@ -0,0 +1,5 @@ +interface Pagination { + rowsPerPage: number; +} + +export type { Pagination }; diff --git a/src/modules/03_logs/interface/request/Main.ts b/src/modules/03_logs/interface/request/Main.ts new file mode 100644 index 00000000..02867600 --- /dev/null +++ b/src/modules/03_logs/interface/request/Main.ts @@ -0,0 +1,7 @@ +interface DataListsObject { + id: number; + count: number; + name: string; +} + +export type { DataListsObject }; diff --git a/src/modules/03_logs/interface/response/Main.ts b/src/modules/03_logs/interface/response/Main.ts new file mode 100644 index 00000000..da7e9293 --- /dev/null +++ b/src/modules/03_logs/interface/response/Main.ts @@ -0,0 +1,14 @@ +interface ResRound { + createdAt: Date; + createdFullName: string; + createdUserId: Date; + durationKPI: string; + endDate: Date; + id: Date; + lastUpdateFullName: string; + lastUpdateUserId: Date; + lastUpdatedAt: Date; + startDate: Date; +} + +export type { ResRound }; diff --git a/src/modules/03_logs/router.ts b/src/modules/03_logs/router.ts new file mode 100644 index 00000000..18d9b7da --- /dev/null +++ b/src/modules/03_logs/router.ts @@ -0,0 +1,18 @@ +const ListsPage = () => import("@/modules/03_logs/views/lists.vue"); + +export default [ + { + path: "/users", + name: "manageUsers", + component: ListsPage, + meta: { + Auth: true, + Key: [7], + Role: "user_role", + }, + }, + { + path: "/users/:id", + name: "masterInsignia", + }, +]; diff --git a/src/modules/03_logs/stores/main.ts b/src/modules/03_logs/stores/main.ts new file mode 100644 index 00000000..b96ea3e0 --- /dev/null +++ b/src/modules/03_logs/stores/main.ts @@ -0,0 +1,5 @@ +import { defineStore } from "pinia"; + +export const useDataStore = defineStore("storeData", () => { + return {}; +}); diff --git a/src/modules/03_logs/views/lists.vue b/src/modules/03_logs/views/lists.vue new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/src/modules/03_logs/views/lists.vue @@ -0,0 +1 @@ + diff --git a/src/plugins/axios.ts b/src/plugins/axios.ts new file mode 100644 index 00000000..79bba4e1 --- /dev/null +++ b/src/plugins/axios.ts @@ -0,0 +1,25 @@ +import axios from "axios" +import config from "process" +// import { dotnetPath } from "../path/axiosPath"; +// import { getToken } from "@baloise/vue-keycloak"; +import keycloak from "../plugins/keycloak" + +const axiosInstance = axios.create({ + withCredentials: false, +}) + +// axiosInstance.defaults.baseURL = dotnetPath; +axiosInstance.interceptors.request.use( + async (config) => { + const token = await keycloak.token + config.headers = { + Authorization: `Bearer ${token}`, + } + return config + }, + (error) => { + Promise.reject(error) + } +) + +export default axiosInstance diff --git a/src/plugins/filters.ts b/src/plugins/filters.ts new file mode 100644 index 00000000..d5f1d75f --- /dev/null +++ b/src/plugins/filters.ts @@ -0,0 +1,22 @@ +/** + * GLOABL Filters + * - ไฟล์นี้จะไว้เก็บฟังก์ชันง่าย ๆ พวก Helper Functions ทั้งหลาย + */ + + +const filters = { + + /** + * ฟังก์ชัน compactNumber ใช้แปลงตัวเลขยาว ๆ ให้กลายเป็นเลขสั้น ๆ แบบที่พวก Social Media ชอบใช้กัน เช่น 1,000 แปลงเป็น 1K หรือ 1,000,000 แปลงเป็น 1M + * วิธีใช้ : {{ $filters.compactNumber(value) }} + * + * @param val รับค่าพารามิเตอร์เป็นตัวแปรชนิดตัวเลข + * @returns คืนค่าเป็นตัวเลขที่แปลงค่าแล้ว + */ + compactNumber (val: number) { + const formatter = Intl.NumberFormat('en', { notation: 'compact'}) + return formatter.format(val) + } +} + +export default filters; \ No newline at end of file diff --git a/src/plugins/genreport.ts b/src/plugins/genreport.ts new file mode 100644 index 00000000..0673a76a --- /dev/null +++ b/src/plugins/genreport.ts @@ -0,0 +1,59 @@ +import axios from "axios"; +import config from "@/app.config"; + +import { useQuasar } from "quasar"; +import { useCounterMixin } from "@/stores/mixin"; + +const $q = useQuasar(); + +const mixin = useCounterMixin(); +const { showLoader, hideLoader, messageError } = mixin; + +async function genReport(data: any, fileName: string, type: string = "docx") { + showLoader(); + await axios + .post(`${config.API.reportTemplate}/docx`, data, { + headers: + type == "docx" + ? { + accept: + "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + "content-Type": "application/json", + } + : { + accept: "application/pdf", + "content-Type": "application/json", + }, + responseType: "arraybuffer", + }) + .then((res) => { + const data = res.data; + if (data) { + // สร้าง Blob จาก array buffer + const blob = new Blob([data], { + type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + }); + + // สร้าง URL สำหรับไฟล์ Blob + const url = URL.createObjectURL(blob); + + // สร้างลิงก์เพื่อดาวน์โหลดไฟล์ + const link = document.createElement("a"); + link.href = url; + link.download = `${fileName}.${type === "docx" ? "docx" : "pdf"}`; // กำหนดชื่อไฟล์ที่จะดาวน์โหลด + document.body.appendChild(link); + link.click(); + + // ลบ URL ที่สร้างขึ้นหลังจากใช้งาน + URL.revokeObjectURL(url); + } + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); +} + +export default genReport; diff --git a/src/plugins/genreportxlsx.ts b/src/plugins/genreportxlsx.ts new file mode 100644 index 00000000..7b94e73d --- /dev/null +++ b/src/plugins/genreportxlsx.ts @@ -0,0 +1,62 @@ +import axios from "axios"; +import config from "@/app.config"; + +import { useQuasar } from "quasar"; +import { useCounterMixin } from "@/stores/mixin"; + +const $q = useQuasar(); + +const mixin = useCounterMixin(); +const { showLoader, hideLoader, messageError } = mixin; + +async function genReportXLSX( + data: any, + fileName: string, + type: string = "xlsx" +) { + showLoader(); + await axios + .post(`${config.API.reportTemplate}/xlsx`, data, { + headers: + type == "xlsx" + ? { + accept: + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "content-Type": "application/json", + } + : { + accept: "application/pdf", + "content-Type": "application/json", + }, + + responseType: "blob", + }) + .then((res) => { + const data = res.data; + if (data) { + // สร้าง Blob จาก array buffer + const blob = new Blob([data]); + + // สร้าง URL สำหรับไฟล์ Blob + const url = URL.createObjectURL(blob); + + // สร้างลิงก์เพื่อดาวน์โหลดไฟล์ + const link = document.createElement("a"); + link.href = url; + link.download = `${fileName}.${type}`; // กำหนดชื่อไฟล์ที่จะดาวน์โหลด + document.body.appendChild(link); + link.click(); + + // ลบ URL ที่สร้างขึ้นหลังจากใช้งาน + URL.revokeObjectURL(url); + } + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); +} + +export default genReportXLSX; diff --git a/src/plugins/http.ts b/src/plugins/http.ts new file mode 100644 index 00000000..494c9aa3 --- /dev/null +++ b/src/plugins/http.ts @@ -0,0 +1,45 @@ +import Axios, { type AxiosRequestConfig, type AxiosResponse } from "axios"; +import keycloak from "./keycloak"; + +const http = Axios.create({ + timeout: 1000000000, // เพิ่มค่า timeout + headers: { + "X-Requested-With": "XMLHttpRequest", + }, +}); + +http.interceptors.request.use( + async function (config: AxiosRequestConfig) { + await keycloak.updateToken(1); + config.headers = config.headers ?? {}; + const token = keycloak.token; + // const token = localStorage.getItem("access_token") + // const token = + // "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICIxU2VKV2dVRFVlNXZwNS13Q1ZHaG9lT2l4bDJTTkdKemthLU5ZN211NXZJIn0.eyJleHAiOjE2NzI0MTI1NDksImlhdCI6MTY3MjM3NjU0OSwiYXV0aF90aW1lIjoxNjcyMzc2NTQ5LCJqdGkiOiI1MTVhY2IwNC1jODQ3LTQzM2YtYjUxOC03ODUzMzJhY2ZjNWYiLCJpc3MiOiJodHRwczovL2tleWNsb2FrLmZyYXBwZXQuc3lub2xvZ3kubWUvYXV0aC9yZWFsbXMvYm1hLWVociIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJlZmM5YjRlMC1mZGU2LTQ1NDQtYmU1OS1lMTA0MjEwMjUzZjAiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJibWEtZWhyIiwibm9uY2UiOiI3NjMyMGI3ZS0xZTMxLTQ5ODYtYWIzOC1iOTUyYjFlODY3OGYiLCJzZXNzaW9uX3N0YXRlIjoiMDZlNTBkZjktNzAyNi00ZGIwLTkxMjgtMWY3Y2FiYTRkNDEyIiwiYWNyIjoiMSIsImFsbG93ZWQtb3JpZ2lucyI6WyJodHRwczovL2xvY2FsaG9zdDo3MDA2Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJkZWZhdWx0LXJvbGVzLWJtYS1laHIiLCJvZmZsaW5lX2FjY2VzcyIsImFkbWluIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6Im9wZW5pZCBlbWFpbCBwcm9maWxlIiwic2lkIjoiMDZlNTBkZjktNzAyNi00ZGIwLTkxMjgtMWY3Y2FiYTRkNDEyIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsInJvbGUiOlsiZGVmYXVsdC1yb2xlcy1ibWEtZWhyIiwib2ZmbGluZV9hY2Nlc3MiLCJhZG1pbiIsInVtYV9hdXRob3JpemF0aW9uIl0sIm5hbWUiOiJTeXN0ZW0gQWRtaW5pc3RyYXRvciIsInByZWZlcnJlZF91c2VybmFtZSI6ImFkbWluIiwiZ2l2ZW5fbmFtZSI6IlN5c3RlbSIsImZhbWlseV9uYW1lIjoiQWRtaW5pc3RyYXRvciIsImVtYWlsIjoiYWRtaW5AbG9jYWxob3N0In0.xmfJ3pzI-jLYsaiFXyjTW7gfAEpvUmMVsp9BsB1CfRCVOKiGBbuZhnQY8W-1SWVAx1NjJ55L-zMHPK6hk1dRPLbEse3DlIBZw04W9j8m-Wz3eqdHf_UCjmrXb8qAwkeq0Iaxq9mVfJJeQWeKhFBi-Ff8ek4hCXTYDICXS8ny_BaC5WkyrefHQ2xBqQjwRyoxsg4IoVMjXYNb8L9A-4BNlRfs928SqgFYCRlF5h6zw_rC0XoLrGTmqeacBdpey-r3j2g_lTqWy8mQg2T9s65IDqW3kFPOsr0SVO88sjlFbN9Et0L57RmiqORk_RwzbWg-_Yb6dOuolXsnjBOhOoTzkA"; + if (token) config.headers.Authorization = `Bearer ${token}`; + return config; + }, + function (error: any) { + return Promise.reject(error); + } +); + +http.interceptors.response.use( + function (response: AxiosResponse) { + return response; + }, + function (error: any) { + if (typeof error !== undefined) { + // eslint-disable-next-line no-prototype-builtins + if (error.hasOwnProperty("response")) { + if (error.response.status === 401 || error.response.status === 403) { + // Store.commit("SET_ERROR_MESSAGE", error.response.data.message); + // Store.commit("REMOVE_ACCESS_TOKEN") + } + } + } + return Promise.reject(error); + } +); + +export default http; diff --git a/src/plugins/keycloak.ts b/src/plugins/keycloak.ts new file mode 100644 index 00000000..fe636392 --- /dev/null +++ b/src/plugins/keycloak.ts @@ -0,0 +1,17 @@ +/** + * front connect to keycloak + */ +import Keycloak from "keycloak-js"; + +const initOptions = { + realm: import.meta.env.VITE_REALM_KEYCLOAK, + clientId: import.meta.env.VITE_CLIENTID_KEYCLOAK, + url: import.meta.env.VITE_URL_KEYCLOAK, +}; //option keycloak ที่จะ connect + +const keycloak = Keycloak(initOptions); + +keycloak.onAuthSuccess = () => {}; //เพิ่มlogin สำเร็จจะมาทำฟังก์ชันนี้ + +await keycloak.init({ onLoad: "check-sso", checkLoginIframe: false }); //ทำการ connect keycloak +export default keycloak; diff --git a/src/quasar-user-options.ts b/src/quasar-user-options.ts new file mode 100644 index 00000000..671a183b --- /dev/null +++ b/src/quasar-user-options.ts @@ -0,0 +1,11 @@ +// import "./styles/quasar.scss" +import "@quasar/extras/material-icons/material-icons.css" +import "@quasar/extras/material-icons-outlined/material-icons-outlined.css" +import "@quasar/extras/fontawesome-v5/fontawesome-v5.css" +import "@quasar/extras/mdi-v4/mdi-v4.css" + +// To be used on app.use(Quasar, { ... }) +export default { + config: {}, + plugins: {}, +} diff --git a/src/router/index.ts b/src/router/index.ts new file mode 100644 index 00000000..257dc09d --- /dev/null +++ b/src/router/index.ts @@ -0,0 +1,83 @@ +import { createRouter, createWebHistory } from "vue-router"; + +const MainLayout = () => import("@/views/MainLayout.vue"); +const Dashboard = () => import("@/views/Dashboard.vue"); +const Error404NotFound = () => import("@/views/Error404NotFound.vue"); + +import ModuleMetadata from "@/modules/01_metadata/router"; + +// TODO: ใช้หรือไม่? +import keycloak from "@/plugins/keycloak"; + +const router = createRouter({ + history: createWebHistory(import.meta.env.BASE_URL), + routes: [ + { + path: "/", + name: "home", + component: MainLayout, + children: [ + { + path: "/", + name: "dashboard", + component: Dashboard, + meta: { + Auth: true, + Key: [7], + Role: "dashboard", + }, + }, + ...ModuleMetadata, + ], + }, + /** + * 404 Not Found + * ref: https://router.vuejs.org/guide/essentials/dynamic-matching.html#catch-all-404-not-found-route + */ + { + // path: "/:catchAll(.*)*", // TODO: ใช้ pathMatch แทนตามในเอกสารแนะนำ คงไว้เผื่อจำเป็น + path: "/:pathMatch(.*)*", + component: Error404NotFound, + }, + ], + + scrollBehavior(to, from, savedPosition) { + if (savedPosition) { + return savedPosition; + } else if (to.hash) { + return { + el: to.hash, + behavior: "smooth", + }; + } + }, +}); + +router.beforeEach((to, from, next) => { + if (to.meta.Auth) { + if (!keycloak.authenticated) { + keycloak.login({ + redirectUri: `${window.location.protocol}//${window.location.host}${to.path}`, + locale: "th", + }); + } else { + // keycloak.updateToken(60); + const role = keycloak.tokenParsed?.role; + + // ถ้าเป็นคนกรอกข้อมูล + if (role.includes("keyregistry") && to.meta.Role != "registry") { + next({ path: "/registry" }); + } else if (role.includes(to.meta.Role)) { + next(); + } else { + next({ path: "" }); + // next(); + } + } + } else { + next(); + } + // next(); +}); + +export default router; diff --git a/src/router/loader.ts b/src/router/loader.ts new file mode 100644 index 00000000..1001e327 --- /dev/null +++ b/src/router/loader.ts @@ -0,0 +1,12 @@ +/** +***** DEPRECATED - Must be delete later ***** +*/ + +/**โหลดหน้าแบบ async/await + * @param view "ชี่อไฟล์".vue + * @param folder "folderในsrc" [Ex. /src/"folder"] default=views เมื่อไม่ส่งค่า + */ +export function load(view: string, folder: string = "views") { + // console.log(`@/${folder}/${view}.vue`); + return async () => await import(`@/${folder}/${view}.vue`); +} diff --git a/src/stores/data.ts b/src/stores/data.ts new file mode 100644 index 00000000..74c39074 --- /dev/null +++ b/src/stores/data.ts @@ -0,0 +1,102 @@ +import { ref, computed } from "vue"; +import { defineStore } from "pinia"; + +export const useDataStore = defineStore("data", () => { + // ref() คือการประกาศ state เหมือน vuex + const count = ref(0); + const loader = ref(false); + + const expandedReport2 = ref([]); + const selectedReport2 = ref(""); + const expandedRegister = ref([]); + const selectedRegister = ref(""); + // computed() คือการประกาศ getters เหมือน vuex + const doubleCount = computed(() => count.value * 2); + // function() คือการประกาศ actions เหมือน vuex + const increment = () => { + count.value++; + }; + // tabData เป็น paramert ใช้เปรียนเทียบ tab ให้ active + const tabData = ref(""); + /** + * active tab หน้า รายละเอียดทะเบียนประวัติ + * @param val string เป็นชื่อของ ตัวนั้นๆ + */ + const changeTab = (val: string) => { + tabData.value = val; + }; + + /** + * active tab หน้า รายละเอียดทะเบียนประวัติ + * @param val boolean false = close , true = open + */ + const loaderPage = (val: boolean) => { + loader.value = val; + }; + + /** + * เปิด tree จัดการบัญชี2 + * @param val string เป็นชื่อของ ตัวนั้นๆ + */ + const changeTreeReport2 = (e: string[], s: string) => { + expandedReport2.value = e; + selectedReport2.value = s; + }; + + /** + * เปิด tree ทะเบียนประวัติ + * @param val string เป็นชื่อของ ตัวนั้นๆ + */ + const changeTreeRegister = (e: string[], s: string) => { + expandedRegister.value = e; + selectedRegister.value = s; + }; + + return { + count, + doubleCount, + increment, + tabData, + changeTab, + loader, + loaderPage, + expandedReport2, + selectedReport2, + changeTreeReport2, + expandedRegister, + selectedRegister, + changeTreeRegister, + }; +}); + +// การเขียนแบบ composition api +// ตัวอย่างการใช้งาน use...Store() ตามชื่อที่ตั้ง + +// import { useDataStore } from '@/stores/data' + +//storeToRefs ใช้กรณีที่เราจะแปลงค่าเป็น state ใน หน้านั้น + +// import { storeToRefs } from 'pinia' + +// export default { +// setup() { +// const store = useDataStore() + +// *********************************** +// พยายามไม่ให้ ชื่อ เหมือนกับ props ** ตัวอย่างปกติ +// const { count, doubleCount, increment } = store +// *********************************** + +// ตัวอย่าง แปลงค่า store เป็น state หรือ ref +// const { name, doubleCount } = storeToRefs(store) +// ถ้าเป็น function เรียกแยกอีกทีก็ได้ +// const { increment } = store +// *********************************** + +//return { +// count, +// doubleCount, +// increment +// } +// }, +// } diff --git a/src/stores/mixin.ts b/src/stores/mixin.ts new file mode 100644 index 00000000..babac88e --- /dev/null +++ b/src/stores/mixin.ts @@ -0,0 +1,1079 @@ +import { defineStore } from "pinia"; +import "moment/dist/locale/th"; +import moment from "moment"; +import CustomComponent from "@/components/CustomDialog.vue"; +import { Loading, QSpinnerCube } from "quasar"; + +moment.locale("th"); + +export const useCounterMixin = defineStore("mixin", () => { + /** + * ฟังก์ชันกลาง + */ + + const calAge = ( + srcDate: Date, + birthCal: Date = new Date(), + eng: boolean = false + ) => { + const year = eng ? "years" : "ปี"; + const month = eng ? "months" : "เดือน"; + const day = eng ? "days" : "วัน"; + + if (srcDate == null) { + return `0 ${year} 0 ${month} 0 ${day}`; + } + + const toDay = birthCal; + const birth = new Date(srcDate); + + const yearNow = toDay.getFullYear(); + const monthNow = toDay.getMonth(); + const dateNow = toDay.getDate(); + + const yearDob = birth.getFullYear(); + const monthDob = birth.getMonth(); + const dateDob = birth.getDate(); + + const lastYear = 12; + const subtractDate: Object = moment().subtract(1, "months").endOf("month"); + + const lastMonths = new Date(subtractDate.toString()).getDate(); + + let yearAge = yearNow - yearDob; + let monthAge = 0; + let dateAge = 0; + + if (monthNow >= monthDob) { + monthAge = monthNow - monthDob; + } else { + yearAge--; + monthAge = lastYear + monthNow - monthDob; + } + + if (dateNow >= dateDob) { + dateAge = dateNow - dateDob; + } else { + monthAge--; + dateAge = lastMonths + dateNow - dateDob; + + if (monthAge < 0) { + monthAge = 11; + yearAge--; + } + } + + const age = { + years: yearAge, + months: monthAge, + days: dateAge, + }; + + return `${yearAge} ${year} ${monthAge} ${month} ${dateAge} ${day}`; + }; + + function date2Thai( + srcDate: Date | null, + isFullMonth: boolean = false, + isTime: boolean = false + ) { + if (srcDate == null || !moment(srcDate).isValid()) return ""; + + const dateMoment = moment(srcDate); + const day = dateMoment.format("DD"); + const month = dateMoment.format(isFullMonth ? "MMMM" : "MMM"); + const year = +dateMoment.format("YYYY") + 543; + return `${day} ${month} ${year}${ + isTime ? dateMoment.format(" HH:mm น.") : "" + }`; + } + + function dateMonth2Thai(srcDate: Date, isFullMonth = false, isTime = false) { + if (!srcDate) return srcDate; + const date = new Date(srcDate); + const isValidDate = Boolean(+date); + if (!isValidDate) return srcDate; + if (isValidDate && date.getFullYear() < 1000) return srcDate; + const fullMonthThai = [ + "มกราคม", + "กุมภาพันธ์", + "มีนาคม", + "เมษายน", + "พฤษภาคม", + "มิถุนายน", + "กรกฎาคม", + "สิงหาคม", + "กันยายน", + "ตุลาคม", + "พฤศจิกายน", + "ธันวาคม", + ]; + const abbrMonthThai = [ + "ม.ค.", + "ก.พ.", + "มี.ค.", + "เม.ย.", + "พ.ค.", + "มิ.ย.", + "ก.ค.", + "ส.ค.", + "ก.ย.", + "ต.ค.", + "พ.ย.", + "ธ.ค.", + ]; + let dstYear = 0; + if (date.getFullYear() > 2500) { + dstYear = date.getFullYear(); + } else { + dstYear = date.getFullYear() + 543; + } + let dstMonth = ""; + if (isFullMonth) { + dstMonth = fullMonthThai[date.getMonth()]; + } else { + dstMonth = abbrMonthThai[date.getMonth()]; + } + let dstTime = ""; + if (isTime) { + const H = date.getHours().toString().padStart(2, "0"); + const M = date.getMinutes().toString().padStart(2, "0"); + // const S = date.getSeconds().toString().length === 1 ? "0" + date.getSeconds() : date.getSeconds() + // dstTime = " " + H + ":" + M + ":" + S + " น." + dstTime = " " + H + ":" + M + " น."; + } + return date.getDate().toString().padStart(2, "0") + " " + dstMonth; + } + + const calAgeYear = (srcDate: Date, birthCal: Date = new Date()) => { + const toDay = birthCal; + const birth = new Date(srcDate); + + const yearNow = toDay.getFullYear(); + const monthNow = toDay.getMonth(); + const dateNow = toDay.getDate(); + + const yearDob = birth.getFullYear(); + const monthDob = birth.getMonth(); + const dateDob = birth.getDate(); + + const lastYear = 12; + const subtractDate: Object = moment().subtract(1, "months").endOf("month"); + + const lastMonths = new Date(subtractDate.toString()).getDate(); + + let yearAge = yearNow - yearDob; + let monthAge = 0; + let dateAge = 0; + + if (monthNow >= monthDob) { + monthAge = monthNow - monthDob; + } else { + yearAge--; + monthAge = lastYear + monthNow - monthDob; + } + + if (dateNow >= dateDob) { + dateAge = dateNow - dateDob; + } else { + monthAge--; + dateAge = lastMonths + dateNow - dateDob; + + if (monthAge < 0) { + monthAge = 11; + yearAge--; + } + } + return yearAge; + }; + + function monthYear2Thai(month: number, year: number, isFullMonth = false) { + const date = new Date(`${year}-${month + 1}-1`); + const fullMonthThai = [ + "มกราคม", + "กุมภาพันธ์", + "มีนาคม", + "เมษายน", + "พฤษภาคม", + "มิถุนายน", + "กรกฎาคม", + "สิงหาคม", + "กันยายน", + "ตุลาคม", + "พฤศจิกายน", + "ธันวาคม", + ]; + const abbrMonthThai = [ + "ม.ค.", + "ก.พ.", + "มี.ค.", + "เม.ย.", + "พ.ค.", + "มิ.ย.", + "ก.ค.", + "ส.ค.", + "ก.ย.", + "ต.ค.", + "พ.ย.", + "ธ.ค.", + ]; + let dstYear = 0; + if (date.getFullYear() > 2500) { + dstYear = date.getFullYear(); + } else { + dstYear = date.getFullYear() + 543; + } + let dstMonth = ""; + if (isFullMonth) { + dstMonth = fullMonthThai[date.getMonth()]; + } else { + dstMonth = abbrMonthThai[date.getMonth()]; + } + return dstMonth + " " + dstYear; + } + + function dateToISO(date: Date) { + if (date != null) { + const srcDate = new Date(date); + + return ( + srcDate.getFullYear() + + "-" + + appendLeadingZeroes(srcDate.getMonth() + 1) + + "-" + + appendLeadingZeroes(srcDate.getDate()) + ); + } else { + return ""; + } + } + + const convertDate = (date: string) => { + if (date != null && date.length == 10) { + const srcDate = date.toString().split("/"); + const dateVal = + Number(srcDate[2]) - 543 + "-" + srcDate[1] + "-" + srcDate[0]; + const check = moment(dateVal).isValid(); + + if (check) { + return { + isValid: check, + value: dateVal, + }; + } else { + return { + isValid: check, + value: "", + }; + } + } else { + return { + isValid: false, + value: "", + }; + } + }; + + const convertDateDisplay = (dateVal: Date) => { + const date = new Date(dateVal); + let dstYear = date.getFullYear() + 543; + let dstMonth = date.getMonth() + 1; + return ( + date.getDate().toString().padStart(2, "0") + + "/" + + dstMonth.toString().padStart(2, "0") + + "/" + + dstYear + ); + }; + + function appendLeadingZeroes(n: number) { + if (n <= 9) return "0" + n; + return n; + } + + function textToPhone(n: string) { + const p = n.substr(0, 3) + "-" + n.substr(3, 3) + "-" + n.substr(6, 4); + return p; + } + + function textToFax(n: string) { + const p = n.substr(0, 2) + "-" + n.substr(2, 3) + "-" + n.substr(5, 4); + return p; + } + + const success = (q: any, val: string) => { + // useQuasar ไม่สามารถใช้นอกไฟล์ .vue + if (val !== "") { + return q.notify({ + message: val, + color: "primary", + icon: "mdi-information", + position: "bottom-right", + multiLine: true, + timeout: 1000, + badgeColor: "positive", + classes: "my-notif-class", + }); + } + }; + + function notify(q: any, val: string) { + if (val !== "") { + q.notify({ + color: "teal-10", + message: val, + icon: "mdi-information", + position: "bottom-right", + multiLine: true, + timeout: 7000, + actions: [{ label: "ปิด", color: "white", handler: () => {} }], + }); + } + } + function notifyError(q: any, val: string) { + if (val !== "") { + q.notify({ + color: "negative", + message: val, + icon: "mdi-alert-circle", + position: "top", + multiLine: true, + timeout: 12000, + actions: [{ label: "ปิด", color: "white", handler: () => {} }], + }); + } + } + + const messageError = (q: any, e: any = "") => { + // q.dialog.hide(); + if (e.response !== undefined) { + if (e.response.data.status !== undefined) { + if (e.response.data.status == 401) { + //invalid_token + q.dialog({ + component: CustomComponent, + componentProps: { + title: `พบข้อผิดพลาด`, + message: `ล็อกอินหมดอายุ กรุณาล็อกอินใหม่อีกครั้ง`, + icon: "warning", + color: "red", + onlycancel: true, + }, + }); + } else if (e.response.data.status == 400 && e.response.data.title) { + //validation errors + q.dialog({ + component: CustomComponent, + componentProps: { + title: `พบข้อผิดพลาด`, + message: `${e.response.data.title}`, + icon: "warning", + color: "red", + onlycancel: true, + }, + }); + } else { + const message = e.response.data.result ?? e.response.data.message; + q.dialog({ + component: CustomComponent, + componentProps: { + title: `พบข้อผิดพลาด`, + message: `${message}`, + icon: "warning", + color: "red", + onlycancel: true, + }, + }); + } + } else { + if (e.response.status == 401) { + //invalid_token + q.dialog({ + component: CustomComponent, + componentProps: { + title: `พบข้อผิดพลาด`, + message: `ล็อกอินหมดอายุ กรุณาล็อกอินใหม่อีกครั้ง`, + icon: "warning", + color: "red", + onlycancel: true, + }, + }); + } else if (e.response.data.successful === false) { + q.dialog({ + component: CustomComponent, + componentProps: { + title: `พบข้อผิดพลาด`, + message: e.response.data.message, + icon: "warning", + color: "red", + onlycancel: true, + }, + }); + } else { + console.log("errror===>", e); + + q.dialog({ + component: CustomComponent, + componentProps: { + title: `พบข้อผิดพลาด`, + message: `ข้อมูลผิดพลาดทำให้เกิดการไม่ตอบสนองต่อการเรียกใช้งานดูเว็บไซต์`, + icon: "warning", + color: "red", + onlycancel: true, + }, + }); + } + } + } else { + console.log("errror===>", e); + + q.dialog({ + component: CustomComponent, + componentProps: { + title: `พบข้อผิดพลาด`, + message: `ข้อมูลผิดพลาดทำให้เกิดการไม่ตอบสนองต่อการเรียกใช้งานดูเว็บไซต์`, + icon: "warning", + color: "red", + onlycancel: true, + }, + }); + } + }; + + const fails = (q: any, val: string) => { + // useQuasar ไม่สามารถใช้นอกไฟล์ .vue + if (val !== "") { + return q.notify({ + message: val, + color: "red", + icon: "mdi-information", + position: "bottom-right", + multiLine: true, + timeout: 1000, + badgeColor: "positive", + classes: "my-notif-class", + }); + } + }; + + const dialogMessage = ( + // ไม่เอาใส่ undefined + q: any, + title: string | undefined, + message: string | undefined, + icon: string | undefined, + textOk: string | undefined, + color: string | undefined, + ok?: Function | undefined, + cancel?: Function | undefined, + onlycancel: Boolean = false + ) => { + q.dialog({ + component: CustomComponent, + componentProps: { + title: title, + message: message, + icon: icon, + color: color, + textOk: textOk, + onlycancel: onlycancel, + }, + }) + .onOk(() => { + if (ok != undefined) ok(); + }) + .onCancel(() => { + if (cancel != undefined) cancel(); + }); + }; + + //*** Dialog ***// + const dialogConfirm = ( + q: any, + ok?: Function, + title?: string, // ถ้ามี cancel action ใส่เป็น null + desc?: string, // ถ้ามี cancel action ใส่เป็น null + cancel?: Function + ) => { + q.dialog({ + component: CustomComponent, + componentProps: { + title: title && title != null ? title : "ยืนยันการบันทึก", + message: + desc && desc != null + ? desc + : "ต้องการยืนยันการบันทึกข้อมูลนี้ใช่หรือไม่?", + icon: "info", + color: "public", + textOk: "ตกลง", + onlycancel: false, + }, + }) + .onOk(() => { + if (ok) ok(); + }) + .onCancel(() => { + if (cancel) cancel(); + }); + }; + + const dialogRemove = ( + q: any, + ok?: Function, + title?: string, // ถ้ามี cancel action ใส่เป็น null + desc?: string, // ถ้ามี cancel action ใส่เป็น null + cancel?: Function + ) => { + q.dialog({ + component: CustomComponent, + componentProps: { + title: title && title != null ? title : "ยืนยันการลบข้อมูล", + message: + desc && desc != null + ? desc + : "ต้องการยืนยันการลบข้อมูลนี้ใช่หรือไม่?", + icon: "delete", + color: "red", + textOk: "ตกลง", + onlycancel: false, + }, + }) + .onOk(() => { + if (ok) ok(); + }) + .onCancel(() => { + if (cancel) cancel(); + }); + }; + + const dialogMessageNotify = ( + q: any, + desc?: string, // ถ้ามี cancel action ใส่เป็น null + cancel?: Function + ) => { + q.dialog({ + component: CustomComponent, + componentProps: { + title: "ข้อความแจ้งเตือน", + message: desc && desc != null ? desc : "กรุณากรอกข้อมูลให้ครบ", + icon: "warning", + color: "orange", + textOk: "ตกลง", + onlycancel: true, + }, + }).onCancel(() => { + if (cancel) cancel(); + }); + }; + //*** END Dialog ***// + + const showLoader = () => { + Loading.show({ + spinner: QSpinnerCube, + spinnerSize: 140, + spinnerColor: "primary", + backgroundColor: "white", + }); + }; + + const hideLoader = () => { + Loading.hide(); + }; + + function modalDelete( + q: any, + title: string, + message: string, + ok: Function, + cancel?: Function + ) { + q.dialog({ + title: `${title}`, + message: `${message}`, + cancel: { + flat: true, + color: "grey-14", + }, + ok: { + color: "red-6", + }, + focus: "none", + persistent: true, + html: true, + }) + .onOk(() => { + ok(); + }) + .onCancel(() => { + if (cancel != undefined) cancel(); + }) + .onDismiss(() => {}); + } + + function modalConfirm( + q: any, + title: string, + message: string, + ok: Function, + cancel?: Function + ) { + q.dialog({ + title: `${title}`, + message: `${message}`, + cancel: { + flat: true, + color: "grey", + }, + ok: { + color: "primary", + }, + focus: "none", + persistent: true, + html: true, + }) + .onOk(() => { + ok(); + }) + .onCancel(() => { + if (cancel != undefined) cancel(); + }) + .onDismiss(() => {}); + } + + function modalWarning(q: any, title: string, message: string, ok?: Function) { + // q.dialog({ + // title: `${title}`, + // message: `${message}`, + // ok: { + // push: true, + // color: "primary", + // }, + // focus: "none", + // persistent: true, + // html: true, + // }) + // .onOk(() => { + // if (ok != undefined) ok(); + // }) + // .onCancel(() => {}) + // .onDismiss(() => {}); + + q.dialog({ + component: CustomComponent, + componentProps: { + title: title, + message: message, + icon: "warning", + color: "warning", + onlycancel: true, + }, + }); + } + + function modalError(q: any, title: string, message: string, ok?: Function) { + // q.dialog({ + // title: `${title}`, + // message: `${message}`, + // ok: { + // push: true, + // color: "primary", + // }, + // focus: "none", + // persistent: true, + // html: true, + // }) + // .onOk(() => { + // if (ok != undefined) ok(); + // }) + // .onCancel(() => {}) + // .onDismiss(() => {}); + + q.dialog({ + component: CustomComponent, + componentProps: { + title: title, + message: message, + icon: "warning", + color: "red", + onlycancel: true, + }, + }); + } + + const dateText = (val: Date) => { + if (val != null) { + return date2Thai(val); + } else { + return "-"; + } + }; + + /** + * แปลงช่วงวันที่ถ้า2ค่าเป็นวันเดียวกันจะโชววันเดียวแต่ถ้าไม่เท่ากันจะแสดงเป็นช่วง + * @param val ช่วงวันที่ + */ + const dateThaiRange = (val: [Date, Date]) => { + if (val === null) { + return ""; + } else if (date2Thai(val[0]) === date2Thai(val[1])) { + return `${date2Thai(val[0])}`; + } else { + return `${date2Thai(val[0])} - ${date2Thai(val[1])}`; + } + }; + + const weekThai = (val: Number) => { + switch (val) { + case 0: + return "วันอาทิตย์"; + case 1: + return "วันจันทร์"; + case 2: + return "วันอังคาร"; + case 3: + return "วันพุธ"; + case 4: + return "วันพฤหัสบดี"; + case 5: + return "วันศุกร์"; + case 6: + return "วันเสาร์"; + default: + return "-"; + } + }; + + const genColor15 = (val: number) => { + val = val % 15; + switch (val) { + case 1: + return "pink"; + case 2: + return "purple"; + case 3: + return "deep-purple"; + case 4: + return "indigo"; + case 5: + return "blue"; + case 6: + return "light-blue"; + case 7: + return "cyan"; + case 8: + return "teal"; + case 9: + return "green"; + case 10: + return "light-green"; + case 11: + return "amber"; + case 12: + return "orange"; + case 13: + return "deep-orange"; + case 14: + return "brown"; + case 0: + return "blue-grey"; + default: + return ""; + } + }; + + const typeCategoryExam = (val: string) => { + switch (val) { + case "hygiene": + return "สำนักอนามัย"; + case "physician": + return "สำนักการแพทย์"; + case "city": + return "สำนักผังเมือง"; + case "culture": + return "สำนักวัฒนธรรม กีฬา และการท่องเที่ยว"; + default: + return "-"; + } + }; + + const typeRetire = (val: string) => { + switch (val) { + case "retire": + return "เกษียณอายุราชการ"; + case "resign": + return "ลาออก"; + case "transfer": + return "ให้โอน"; + case "death": + return "ถึงแก่กรรม"; + case "layoff": + return "ให้ออก"; + case "discharge": + return "ปลดออก"; + case "dismiss": + return "ไล่ออก"; + case "other": + return "อื่นๆ"; + default: + return "-"; + } + }; + + const typeChangeName = (val: string) => { + switch (val) { + case "prefix": + return "เปลี่ยนคำนำหน้าชื่อ"; + case "firstName": + return "เปลี่ยนชื่อ"; + case "lastName": + return "เปลี่ยนนามสกุล"; + case "all": + return "เปลี่ยนคำนำหน้าชื่อ, ชื่อ-นามสกุล"; + case "firstNameLastName": + return "เปลี่ยนชื่อ-นามสกุล"; + case "prefixAndlastName": + return "เปลี่ยนคำนำหน้าชื่อ และนามสกุล"; + default: + return "-"; + } + }; + + const statusLeave = (val: string) => { + switch (val) { + case "waitting": + return "รออนุมัติ"; + case "reject": + return "ไม่ผ่านการอนุมัติ"; + case "approve": + return "ผ่านการอนุมัติ"; + case "cancel": + return "ยกเลิก"; + default: + return "-"; + } + }; + + /** + * ฟังก์ชั่นคำนวนจำนวน ปี เดือน วัน + * @param startDate วันเริ่มต้น format MM-DD-YYYY" + * @param endDate วันสิ้นสุด format MM-DD-YYYY" + * @returns ผลการคำนวน ปี เดือน วัน ในรูปแบบ 1 ปี 10 เดือน 5 วัน + */ + function calculateDurationYmd(startDate: any, endDate: any) { + if (startDate && endDate) { + const start = new Date(startDate); + const end = new Date(endDate); + + //Get the Timestamp + const date1_time_stamp = start.getTime(); + const date2_time_stamp = end.getTime(); + + let calc; + + //Check which timestamp is greater + if (date1_time_stamp > date2_time_stamp) { + calc = new Date(date1_time_stamp - date2_time_stamp); + } else { + calc = new Date(date2_time_stamp - date1_time_stamp); + } + + //retrieve the date, month and year + const calcFormatTmp = + calc.getDate() + "-" + (calc.getMonth() + 1) + "-" + calc.getFullYear(); + //Convert to an array and store + const calcFormat = calcFormatTmp.split("-"); + //Subtract each member of our array from the default date + const days_passed = Number(Math.abs(Number(calcFormat[0]))); + const months_passed = Number(Math.abs(Number(calcFormat[1])) - 1); + const years_passed = Number(Math.abs(Number(calcFormat[2])) - 1970); + + //Set up custom text + const yrsTxt = "ปี"; + const mnthsTxt = "เดือน"; + const daysTxt = "วัน"; + + //display result with custom text + const result = + (years_passed > 0 && (months_passed > 0 || days_passed > 0) + ? years_passed + " " + yrsTxt + ", " + : "") + + (years_passed > 0 && months_passed == 0 && days_passed == 0 + ? years_passed + " " + yrsTxt + " " + : "") + + (months_passed > 0 && days_passed > 0 + ? months_passed + " " + mnthsTxt + ", " + : "") + + (months_passed > 0 && days_passed == 0 + ? months_passed + " " + mnthsTxt + " " + : "") + + (days_passed > 0 ? days_passed + " " + daysTxt : ""); + + return result.trim(); + } + + return ""; + } + + function diffDay(startDate: any, endDate: any) { + var d1 = moment(startDate); + var d2 = moment(endDate); + const daydiff = Math.ceil(moment.duration(d2.diff(d1)).asDays()); + return daydiff; + } + + function findOrgName(obj: any) { + if (obj) { + let name = + obj.child4 != null && obj.child3 != null + ? obj.child4 + "/" + : obj.child4 != null + ? obj.child4 + : ""; + + name += + obj.child3 != null && obj.child2 != null + ? obj.child3 + "/" + : obj.child3 !== null + ? obj.child3 + : ""; + + name += + obj.child2 != null && obj.child1 != null + ? obj.child2 + "/" + : obj.child2 != null + ? obj.child2 + : ""; + + name += + obj.child1 != null && obj.root != null + ? obj.child1 + "/" + : obj.child1 != null + ? obj.child1 + : ""; + name += obj.root != null ? obj.root : ""; + return name == "" ? "-" : name; + } else { + return ""; + } + } + + function findOrgNameOld(obj: any) { + if (obj) { + let name = + obj.child4Old != null && obj.child3Old != null + ? obj.child4Old + "/" + : obj.child4Old != null + ? obj.child4Old + : ""; + + name += + obj.child3Old != null && obj.child2Old != null + ? obj.child3Old + "/" + : obj.child3Old !== null + ? obj.child3Old + : ""; + + name += + obj.child2Old != null && obj.child1Old != null + ? obj.child2Old + "/" + : obj.child2Old != null + ? obj.child2Old + : ""; + + name += + obj.child1Old != null && obj.rootOld != null + ? obj.child1Old + "/" + : obj.child1Old != null + ? obj.child1Old + : ""; + name += obj.rootOld != null ? obj.rootOld : ""; + return name == "" ? "-" : name; + } else { + return ""; + } + } + + function findPosMasterNo(obj: any) { + if (obj) { + let shortName = + (obj.child4ShortName != null + ? obj.child4ShortName + : obj.child3ShortName != null + ? obj.child3ShortName + : obj.child2ShortName != null + ? obj.child2ShortName + : obj.child1ShortName != null + ? obj.child1ShortName + : obj.rootShortName != null + ? obj.rootShortName + : "") + (obj.posMasterNo != null ? obj.posMasterNo : ""); + return shortName == "" ? "-" : shortName; + } else { + return ""; + } + } + + function findPosMasterNoOld(obj: any) { + if (obj) { + let shortName = + (obj.child4ShortNameOld != null + ? obj.child4ShortNameOld + : obj.child3ShortNameOld != null + ? obj.child3ShortNameOld + : obj.child2ShortNameOld != null + ? obj.child2ShortNameOld + : obj.child1ShortNameOld != null + ? obj.child1ShortNameOld + : obj.rootShortNameOld != null + ? obj.rootShortNameOld + : "") + (obj.posMasterNoOld != null ? obj.posMasterNoOld : ""); + return shortName == "" ? "-" : shortName; + } else { + return ""; + } + } + + return { + calAge, + date2Thai, + dateToISO, + notify, + notifyError, + calAgeYear, + dateText, + monthYear2Thai, + dateMonth2Thai, + success, + weekThai, + genColor15, + typeCategoryExam, + textToPhone, + textToFax, + dateThaiRange, + modalDelete, + modalConfirm, + modalError, + dialogMessage, + messageError, + showLoader, + hideLoader, + typeRetire, + typeChangeName, + statusLeave, + modalWarning, + calculateDurationYmd, + // common dialog + dialogConfirm, + dialogRemove, + dialogMessageNotify, + fails, + convertDate, + convertDateDisplay, + diffDay, + findOrgName, + findOrgNameOld, + findPosMasterNo, + findPosMasterNoOld, + }; +}); diff --git a/src/stores/roleUser.ts b/src/stores/roleUser.ts new file mode 100644 index 00000000..802a7051 --- /dev/null +++ b/src/stores/roleUser.ts @@ -0,0 +1,40 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; + +export const useroleUserDataStore = defineStore("roleusers", () => { + const insignia1Role = ref(false) + const insignia2Role = ref(false) + const caregiverRole = ref(false) + const chairmanRole = ref(false) + const commanderRole = ref(false) + const admin2Role = ref(false) + const adminRole = ref(false) + const oligarchRole = ref(false) + + + + + const fetchroleUser = async (keycloak: any) => { + if (keycloak != null) { + insignia1Role.value = await keycloak.includes("insignia1"); + insignia2Role.value = await keycloak.includes("insignia2"); + caregiverRole.value = await keycloak.includes("caregiver"); + chairmanRole.value = await keycloak.includes("chairman"); + commanderRole.value = await keycloak.includes("commander"); + admin2Role.value = await keycloak.includes("admin2"); + adminRole.value = await keycloak.includes("admin"); + oligarchRole.value = await keycloak.includes("oligarch"); + } + } + + return { + fetchroleUser, + insignia1Role, + insignia2Role, + caregiverRole, + chairmanRole, + commanderRole, + admin2Role, + adminRole, + }; +}); \ No newline at end of file diff --git a/src/style/quasar-variables.sass b/src/style/quasar-variables.sass new file mode 100644 index 00000000..6ba90184 --- /dev/null +++ b/src/style/quasar-variables.sass @@ -0,0 +1,176 @@ +// FILE (create it): src/quasar-variables.sass + +$primary: #02A998 +$secondary: #016987 +$accent: #9C27B0 + +// $dark: #1D1D1D +$dark: #35473C + +$positive: #21BA45 +$negative: #C10015 +$info: #31CCEC +$warning: #F2C037 + +$add: #00aa86 +.text-add + color: $add !important +.bg-add + background: $add !important + +$edit: #019fc4 +.text-edit + color: $edit !important +.bg-edit + background: $edit !important + +$public: #016987 +.text-public + color: $public !important +.bg-public + background: $public !important + +$save: #4154b3 +.text-save + color: $save !important +.bg-save + background: $save !important + +$nativetab: #c8d3db +.text-nativetab + color: $nativetab !important +.bg-nativetab + background: $nativetab !important + +$activetab: #4a5568 +.text-activetab + color: $activetab !important +.bg-activetab + background: $activetab !important + +.inputgreen .q-field__prefix, +.inputgreen .q-field__suffix, +.inputgreen .q-field__input, +.inputgreen .q-field__native + + color: rgb(6, 136, 77) + +@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@100;200;300;400;500;600;700;800;900&display=swap') + +$noto-thai: 'Noto Sans Thai', sans-serif + +#azay-app, +div + font-family: $noto-thai !important + text-rendering: optimizeLegibility + -webkit-font-smoothing: antialiased + -moz-osx-font-smoothing: grayscale + +$separator-color: #EDEDED !default + +.bg-teal-1 + background: #e0f2f1a6 !important + +.table_ellipsis + max-width: 200px + white-space: nowrap + overflow: hidden + text-overflow: ellipsis + +.table_ellipsis:hover + word-wrap: break-word + overflow: visible + white-space: normal + +.table_ellipsis2 + max-width: 25vw + white-space: nowrap + overflow: hidden + text-overflow: ellipsis + +.table_ellipsis2:hover + word-wrap: break-word + overflow: visible + white-space: normal + transition: width 2s + +$muti-tab: #87d4cc +.text-muti-tab + color: $muti-tab !important +.bg-muti-tab + background: $muti-tab !important + +/* editor */ + +.q-editor + font-size: 1rem + line-height: 1.5rem + font-weight: 400 + +.q-editor h1, .q-menu h1 + font-size: 1.5rem + line-height: 2rem + font-weight: 400 + margin-block-start: 0em + margin-block-end: 0em + +.q-editor h2, .q-menu h2 + font-size: 1.25rem + line-height: 1.5rem + font-weight: 400 + margin-block-start: 0em + margin-block-end: 0em + +.q-editor h3, .q-menu h3 + font-size: 1.1rem + line-height: 1.5rem + font-weight: 400 + margin-block-start: 0em + margin-block-end: 0em + +.q-editor p, .q-menu p + margin: 0 + +/* q-tree */ + +.q-tree + color: #c8d3db + +.q_field_p_none .q-field__control-container + padding-top: 0 !important + +.input-alert .q-field--outlined .q-field__control + border: 1px solid red !important + background-color: rgb(255, 216, 216) + +.input-alert .q-field--outlined input + color: #f00 !important + +.input-alert i.text-primary + color: #f00 !important + +/* registry common style */ +.toggle-borderd + border: 1px solid #ecebeb + +h3.resigtry-tab-title + font-size: 1.2rem + font-weight: 600 + margin: 0 0 + padding: 0 0 + +.q-dialog .q-layout__section--marginal + background-color: #fff + color: #000 + +.q-card.noscrool + overflow: hidden + +.q-card__actions + padding: 4px + +.select_ellipsis .q-field__native > span + white-space: nowrap + overflow: hidden + text-overflow: ellipsis + width: 200px diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue new file mode 100644 index 00000000..09bb224d --- /dev/null +++ b/src/views/Dashboard.vue @@ -0,0 +1,398 @@ + + + + + + diff --git a/src/views/Error404NotFound.vue b/src/views/Error404NotFound.vue new file mode 100644 index 00000000..e521ddd2 --- /dev/null +++ b/src/views/Error404NotFound.vue @@ -0,0 +1,27 @@ + + + diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue new file mode 100644 index 00000000..45bfa957 --- /dev/null +++ b/src/views/MainLayout.vue @@ -0,0 +1,1275 @@ + + + + + + diff --git a/tsconfig.app.json b/tsconfig.app.json new file mode 100644 index 00000000..a4299392 --- /dev/null +++ b/tsconfig.app.json @@ -0,0 +1,13 @@ +{ + "extends": "@vue/tsconfig/tsconfig.web.json", + "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/*"], + "compilerOptions": { + "composite": true, + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + }, + "lib": ["dom", "es2015", "es2018", "es2018.promise"] + } +} diff --git a/tsconfig.config.json b/tsconfig.config.json new file mode 100644 index 00000000..424084aa --- /dev/null +++ b/tsconfig.config.json @@ -0,0 +1,8 @@ +{ + "extends": "@vue/tsconfig/tsconfig.node.json", + "include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"], + "compilerOptions": { + "composite": true, + "types": ["node"] + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..3a8d5e26 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,27 @@ +{ + "files": [], + "references": [ + { + "path": "./tsconfig.config.json" + }, + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.vitest.json" + } + ], + + "compilerOptions": { + "typeRoots": ["./typings", "./node_modules/@types"], + "types": ["quasar-ui-q-draggable-table"], + /* other configs */ + "paths": { + "@/*": [ + "./*", + // r + ] + }, + /* other configs */ + } +} diff --git a/tsconfig.vitest.json b/tsconfig.vitest.json new file mode 100644 index 00000000..d080d611 --- /dev/null +++ b/tsconfig.vitest.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.app.json", + "exclude": [], + "compilerOptions": { + "composite": true, + "lib": [], + "types": ["node", "jsdom"] + } +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 00000000..4ca2354a --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,30 @@ +import { fileURLToPath, URL } from "node:url"; + +import { defineConfig } from "vite"; +import vue from "@vitejs/plugin-vue"; +import vueJsx from "@vitejs/plugin-vue-jsx"; +import { quasar, transformAssetUrls } from "@quasar/vite-plugin"; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [ + vue({ + template: { transformAssetUrls }, + }), + quasar({ + sassVariables: "src/style/quasar-variables.sass", + }), + vueJsx(), + ], + resolve: { + alias: { + "@": fileURLToPath(new URL("./src", import.meta.url)), + }, + }, + build: { + target: "esnext", + }, + server: { + port: 3005, + }, +});