Merge branch 'develop' into devTee
This commit is contained in:
commit
d9895233e2
7 changed files with 267 additions and 185 deletions
102
.onedev-buildspec.yml
Normal file
102
.onedev-buildspec.yml
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
version: 37
|
||||
jobs:
|
||||
- name: CI for UAT
|
||||
steps:
|
||||
- !CheckoutStep
|
||||
name: checkout code
|
||||
cloneCredential: !DefaultCredential {}
|
||||
withLfs: false
|
||||
withSubmodules: false
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !GenerateChecksumStep
|
||||
name: generate package checksum
|
||||
files: package-lock.json yarn.lock
|
||||
targetFile: checksum
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !SetupCacheStep
|
||||
name: set up npm cache
|
||||
key: node_modules_@file:checksum@
|
||||
loadKeys:
|
||||
- node_modules
|
||||
paths:
|
||||
- node_modules
|
||||
uploadStrategy: UPLOAD_IF_NOT_HIT
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !SetBuildVersionStep
|
||||
name: set build version
|
||||
buildVersion: '@tag@'
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !CommandStep
|
||||
name: build & test
|
||||
runInContainer: true
|
||||
image: node
|
||||
interpreter: !DefaultInterpreter
|
||||
commands: |
|
||||
npm install
|
||||
npm run build
|
||||
useTTY: true
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !BuildImageStep
|
||||
name: build docker image
|
||||
dockerfile: ./docker/Dockerfile
|
||||
output: !RegistryOutput
|
||||
tags: hrms-git.chin.in.th/bma-hrms/hrms-user:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-user:latest
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
triggers:
|
||||
- !TagCreateTrigger
|
||||
tags: uat-*
|
||||
branches: main
|
||||
retryCondition: never
|
||||
maxRetries: 3
|
||||
retryDelay: 30
|
||||
timeout: 14400
|
||||
- name: CI for PROD
|
||||
steps:
|
||||
- !CheckoutStep
|
||||
name: checkout code
|
||||
cloneCredential: !DefaultCredential {}
|
||||
withLfs: false
|
||||
withSubmodules: false
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !GenerateChecksumStep
|
||||
name: generate package checksum
|
||||
files: package-lock.json yarn.lock
|
||||
targetFile: checksum
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !SetupCacheStep
|
||||
name: set up npm cache
|
||||
key: node_modules_@file:checksum@
|
||||
loadKeys:
|
||||
- node_modules
|
||||
paths:
|
||||
- node_modules
|
||||
uploadStrategy: UPLOAD_IF_NOT_HIT
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !SetBuildVersionStep
|
||||
name: set build version
|
||||
buildVersion: '@tag@'
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !CommandStep
|
||||
name: build & test
|
||||
runInContainer: true
|
||||
image: node
|
||||
interpreter: !DefaultInterpreter
|
||||
commands: |
|
||||
npm install
|
||||
npm run build
|
||||
useTTY: true
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !BuildImageStep
|
||||
name: build docker image
|
||||
dockerfile: ./docker/Dockerfile
|
||||
output: !RegistryOutput
|
||||
tags: hrms-git.bangkok.go.th/bma-hrms/hrms-user:@build_version@ hrms-git.bangkok.go.th/bma-hrms/hrms-user:latest
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
triggers:
|
||||
- !TagCreateTrigger
|
||||
tags: prod-*
|
||||
branches: main
|
||||
retryCondition: never
|
||||
maxRetries: 3
|
||||
retryDelay: 30
|
||||
timeout: 14400
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# docker buildx build --platform=linux/amd64 -f docker/Dockerfile . -t hrms-git.chin.in.th/bma-hrms/hrms-user:0.1
|
||||
|
||||
# Build Stage
|
||||
FROM node:20-alpine as build-stage
|
||||
FROM node:20-alpine AS build-stage
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
|
|
|||
|
|
@ -1,64 +1,60 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { ref, onMounted } from "vue"
|
||||
import { useQuasar } from "quasar"
|
||||
import { useRouter, useRoute } from "vue-router"
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http"
|
||||
import config from "@/app.config"
|
||||
import { useCounterMixin } from "@/stores/mixin"
|
||||
|
||||
import type { QForm } from "quasar";
|
||||
import type { QForm } from "quasar"
|
||||
|
||||
import Workflow from "@/components/Workflow/Main.vue";
|
||||
import Workflow from "@/components/Workflow/Main.vue"
|
||||
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { success, messageError, showLoader, hideLoader, dialogConfirm } = mixin;
|
||||
const $q = useQuasar()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const mixin = useCounterMixin()
|
||||
const { success, messageError, showLoader, hideLoader, dialogConfirm } = mixin
|
||||
|
||||
const id = ref<string>(
|
||||
router.currentRoute.value.name === "addTransfer"
|
||||
? ""
|
||||
: route.params.id.toString()
|
||||
); //id path
|
||||
const id = ref<string>(router.currentRoute.value.name === "addTransfer" ? "" : route.params.id.toString()) //id path
|
||||
|
||||
const files = ref<any>(); //ไฟล์
|
||||
const tranferOrg = ref<string>(""); //ชื่อหน่วยงานที่ขอโอนไป
|
||||
const noteReason = ref<string>(""); //เหตุผล
|
||||
const routeName = router.currentRoute.value.name; //ชื่อ path
|
||||
const files = ref<any>() //ไฟล์
|
||||
const tranferOrg = ref<string>("") //ชื่อหน่วยงานที่ขอโอนไป
|
||||
const noteReason = ref<string>("") //เหตุผล
|
||||
const routeName = router.currentRoute.value.name //ชื่อ path
|
||||
|
||||
/** Dialog Save */
|
||||
async function saveData() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
createTransfer();
|
||||
},
|
||||
"ยืนยันการยื่นข้อมูลการโอน",
|
||||
"ต้องการยื่นข้อมูลการโอนนี้ใช่หรือไม่"
|
||||
);
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
createTransfer()
|
||||
},
|
||||
"ยืนยันการยื่นข้อมูลการโอน",
|
||||
"ต้องการยื่นข้อมูลการโอนนี้ใช่หรือไม่"
|
||||
)
|
||||
}
|
||||
|
||||
/** ฟังก์ชั่นสร้างขอโอน */
|
||||
async function createTransfer() {
|
||||
showLoader();
|
||||
const formData = new FormData();
|
||||
formData.append("Organization", tranferOrg.value);
|
||||
formData.append("Reason", noteReason.value);
|
||||
formData.append("file", files.value);
|
||||
await http
|
||||
.post(config.API.listtransfer(), formData)
|
||||
.then((res) => {
|
||||
router.push(`/transfer/` + res.data.result);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
showLoader()
|
||||
const formData = new FormData()
|
||||
formData.append("Organization", tranferOrg.value)
|
||||
formData.append("Reason", noteReason.value)
|
||||
formData.append("file", files.value)
|
||||
await http
|
||||
.post(config.API.listtransfer(), formData)
|
||||
.then(res => {
|
||||
router.push(`/transfer/` + res.data.result)
|
||||
success($q, "บันทึกข้อมูลสำเร็จ")
|
||||
})
|
||||
.catch(e => {
|
||||
messageError($q, e)
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -66,21 +62,21 @@ async function createTransfer() {
|
|||
* @param id ไอดีของข้อมูล
|
||||
*/
|
||||
async function fecthDataTransfer(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.transferByid(id))
|
||||
.then((res: any) => {
|
||||
let data = res.data.result;
|
||||
tranferOrg.value = data.organization;
|
||||
noteReason.value = data.reason;
|
||||
files.value = data.docs;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
showLoader()
|
||||
await http
|
||||
.get(config.API.transferByid(id))
|
||||
.then((res: any) => {
|
||||
let data = res.data.result
|
||||
tranferOrg.value = data.organization
|
||||
noteReason.value = data.reason
|
||||
files.value = data.docs
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e)
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -88,133 +84,104 @@ async function fecthDataTransfer(id: string) {
|
|||
* @param url URL File
|
||||
*/
|
||||
function fileOpen(url: string) {
|
||||
window.open(url, "_blank");
|
||||
window.open(url, "_blank")
|
||||
}
|
||||
|
||||
/**
|
||||
* เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้
|
||||
*/
|
||||
onMounted(() => {
|
||||
if (route.params.id !== undefined) {
|
||||
fecthDataTransfer(id.value);
|
||||
}
|
||||
});
|
||||
if (route.params.id !== undefined) {
|
||||
fecthDataTransfer(id.value)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="col-12 row justify-center">
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
<div class="toptitle text-white col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
<div v-if="routeName == 'addTransfer'">เพิ่มเรื่องขอโอน</div>
|
||||
<div v-else>รายละเอียดเรื่องขอโอน</div>
|
||||
</div>
|
||||
<q-form
|
||||
class="col-12"
|
||||
greedy
|
||||
@submit.prevent
|
||||
@validation-success="saveData"
|
||||
>
|
||||
<q-card bordered>
|
||||
<q-card-section>
|
||||
<div class="row">
|
||||
<div class="col-12 row q-col-gutter-sm">
|
||||
<q-input
|
||||
:class="
|
||||
routeName != 'addTransfer' ? 'col-12' : 'col-12 inputgreen'
|
||||
"
|
||||
dense
|
||||
outlined
|
||||
v-model="tranferOrg"
|
||||
hide-bottom-space
|
||||
label="หน่วยงานที่ขอโอนไป"
|
||||
:readonly="routeName != 'addTransfer'"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกหน่วยงานที่ขอโอนไป'}`]"
|
||||
/>
|
||||
<div class="col-12 row justify-center">
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
<div class="toptitle text-white col-12 row items-center">
|
||||
<q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm" @click="router.go(-1)" />
|
||||
<div v-if="routeName == 'addTransfer'">เพิ่มเรื่องขอโอน</div>
|
||||
<div v-else>รายละเอียดเรื่องขอโอน</div>
|
||||
</div>
|
||||
<q-form class="col-12" greedy @submit.prevent @validation-success="saveData">
|
||||
<q-card bordered>
|
||||
<q-card-section>
|
||||
<div class="row">
|
||||
<div class="col-12 row q-col-gutter-sm">
|
||||
<q-input
|
||||
:class="routeName != 'addTransfer' ? 'col-12' : 'col-12 inputgreen'"
|
||||
dense
|
||||
outlined
|
||||
v-model="tranferOrg"
|
||||
hide-bottom-space
|
||||
label="หน่วยงานที่ขอโอนไป"
|
||||
:readonly="routeName != 'addTransfer'"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกหน่วยงานที่ขอโอนไป'}`]"
|
||||
/>
|
||||
|
||||
<q-input
|
||||
:class="
|
||||
routeName != 'addTransfer' ? 'col-12' : 'col-12 inputgreen'
|
||||
"
|
||||
dense
|
||||
outlined
|
||||
v-model="noteReason"
|
||||
label="เหตุผล"
|
||||
hide-bottom-space
|
||||
type="textarea"
|
||||
:readonly="routeName != 'addTransfer'"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกเหตุผล'}`]"
|
||||
/>
|
||||
<q-input
|
||||
:class="routeName != 'addTransfer' ? 'col-12' : 'col-12 inputgreen'"
|
||||
dense
|
||||
outlined
|
||||
v-model="noteReason"
|
||||
label="เหตุผล"
|
||||
hide-bottom-space
|
||||
type="textarea"
|
||||
:readonly="routeName != 'addTransfer'"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกเหตุผล'}`]"
|
||||
/>
|
||||
|
||||
<div class="col-12 row" v-if="routeName == 'addTransfer'">
|
||||
<q-file
|
||||
v-model="files"
|
||||
class="col-xs-12 col-sm-12 inputgreen"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
accept=".pdf"
|
||||
:rules="[(val: string) => !!val || 'กรุณาเลือกไฟล์เอกสารเพิ่มเติม']"
|
||||
label="เอกสารเพิ่มเติม"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" /> </template
|
||||
></q-file>
|
||||
</div>
|
||||
<div class="col-12 row" v-if="routeName == 'addTransfer'">
|
||||
<q-file
|
||||
v-model="files"
|
||||
class="col-xs-12 col-sm-12 inputgreen"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
accept=".pdf"
|
||||
:rules="[(val: string) => !!val || 'กรุณาเลือกไฟล์เอกสารเพิ่มเติม']"
|
||||
label="เอกสารเพิ่มเติม"
|
||||
>
|
||||
<template v-slot:prepend> <q-icon name="attach_file" /> </template
|
||||
></q-file>
|
||||
</div>
|
||||
|
||||
<div class="col-12 row" v-if="routeName != 'addTransfer'">
|
||||
<q-card bordered flat class="full-width">
|
||||
<div
|
||||
class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"
|
||||
>
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
เอกสารเพิ่มเติม
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<q-list separator>
|
||||
<q-item v-for="file in files" :key="file.key">
|
||||
<q-item-section>
|
||||
{{ file.fileName }}
|
||||
</q-item-section>
|
||||
<q-item-section avatar>
|
||||
<q-btn
|
||||
color="teal-5"
|
||||
round
|
||||
flat
|
||||
icon="mdi-download"
|
||||
@click="fileOpen(file.pathName)"
|
||||
></q-btn>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-12 row" v-if="routeName != 'addTransfer'">
|
||||
<q-card bordered flat class="full-width">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">เอกสารเพิ่มเติม</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<q-list separator>
|
||||
<q-item v-for="file in files" :key="file.key">
|
||||
<q-item-section>
|
||||
{{ file.fileName }}
|
||||
</q-item-section>
|
||||
<q-item-section avatar>
|
||||
<q-btn color="teal-5" round flat icon="mdi-download" @click="fileOpen(file.pathName)"></q-btn>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
<!-- Workflow -->
|
||||
<div class="col-12" v-if="routeName != 'addTransfer'">
|
||||
<Workflow :id="id" :sys-name="`PLACEMENT_TRANSFER`" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<!-- Workflow -->
|
||||
<div class="col-12" v-if="routeName != 'addTransfer'">
|
||||
<Workflow :id="id" :sys-name="`SYS_TRANSFER_REQ`" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator v-if="routeName == 'addTransfer'" />
|
||||
<q-card-actions align="right" v-if="routeName == 'addTransfer'">
|
||||
<q-btn color="primary" label="ยื่นเรื่องขอโอน" type="onsubmit" />
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-form>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator v-if="routeName == 'addTransfer'" />
|
||||
<q-card-actions align="right" v-if="routeName == 'addTransfer'">
|
||||
<q-btn color="primary" label="ยื่นเรื่องขอโอน" type="onsubmit" />
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ async function getSurveyData() {
|
|||
.then(async (res: any) => {
|
||||
const data = await res.data.result.data;
|
||||
assignId.value = res.data.result.assignId;
|
||||
store.assignId = res.data.result.assignId;
|
||||
if (data !== null) {
|
||||
answer1.value = data.answer1;
|
||||
answer2.value = data.answer2;
|
||||
|
|
|
|||
|
|
@ -5,12 +5,13 @@ import { useRoute, useRouter } from "vue-router";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useProbationReport } from "@/modules/15_probationReport/store";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const store = useProbationReport();
|
||||
|
||||
const { date2Thai, showLoader, hideLoader, messageError } = mixin;
|
||||
const route = useRoute();
|
||||
const assignId = ref<string>("baa3d9f6-9d21-4c58-85f2-114abf8de25c");
|
||||
const status = ref<boolean>(false);
|
||||
|
||||
const $q = useQuasar();
|
||||
|
|
@ -52,7 +53,7 @@ const result_option = reactive([
|
|||
async function getReportScore() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.summaryReportDetail(assignId.value))
|
||||
.get(config.API.summaryReportDetail(store.assignId))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
develop_orientation_score.value = data.develop_orientation_score;
|
||||
|
|
@ -95,8 +96,19 @@ async function getReportScore() {
|
|||
});
|
||||
}
|
||||
|
||||
/** ดึง ข้อมูลแบบสำรวจ */
|
||||
async function getAssignId() {
|
||||
await http.get(config.API.summaryDetail()).then(async (res: any) => {
|
||||
store.assignId = res.data.result.assignId;
|
||||
});
|
||||
}
|
||||
|
||||
/** get ค่า เมื่อโหลดหน้า */
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
if (!store.assignId) {
|
||||
await getAssignId();
|
||||
}
|
||||
|
||||
getReportScore();
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -4,5 +4,6 @@ import type { DataOption } from "@/modules/10_registry/interface/index/Main";
|
|||
|
||||
export const useProbationReport = defineStore("ProbationReportStore", () => {
|
||||
const tabMain = ref<string>("SURVEY");
|
||||
return { tabMain };
|
||||
const assignId = ref<string>("");
|
||||
return { tabMain, assignId };
|
||||
});
|
||||
|
|
|
|||
|
|
@ -22,8 +22,7 @@ import ModulePortfolio from "@/modules/13_portfolio/router";
|
|||
import ModuleDevelop from "@/modules/14_IDP/router";
|
||||
import ModuleProbationReport from "@/modules/15_probationReport/router";
|
||||
|
||||
import { authenticated, tokenParsed } from "@/plugins/auth";
|
||||
import { ro } from "date-fns/locale";
|
||||
import { authenticated, logout } from "@/plugins/auth";
|
||||
// TODO: ใช้หรือไม่?
|
||||
|
||||
const router = createRouter({
|
||||
|
|
@ -96,7 +95,7 @@ router.beforeEach(async (to, from, next) => {
|
|||
if (to.meta.Auth) {
|
||||
const checkAuthen = await authenticated();
|
||||
if (!checkAuthen && to.meta.Auth) {
|
||||
router.push({ name: "loginMain" });
|
||||
logout();
|
||||
}
|
||||
}
|
||||
next();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue