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
|
# docker buildx build --platform=linux/amd64 -f docker/Dockerfile . -t hrms-git.chin.in.th/bma-hrms/hrms-user:0.1
|
||||||
|
|
||||||
# Build Stage
|
# Build Stage
|
||||||
FROM node:20-alpine as build-stage
|
FROM node:20-alpine AS build-stage
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
|
||||||
|
|
@ -1,64 +1,60 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue"
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar"
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router"
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http"
|
||||||
import config from "@/app.config";
|
import config from "@/app.config"
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
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 $q = useQuasar()
|
||||||
const route = useRoute();
|
const route = useRoute()
|
||||||
const router = useRouter();
|
const router = useRouter()
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin()
|
||||||
const { success, messageError, showLoader, hideLoader, dialogConfirm } = mixin;
|
const { success, messageError, showLoader, hideLoader, dialogConfirm } = mixin
|
||||||
|
|
||||||
const id = ref<string>(
|
const id = ref<string>(router.currentRoute.value.name === "addTransfer" ? "" : route.params.id.toString()) //id path
|
||||||
router.currentRoute.value.name === "addTransfer"
|
|
||||||
? ""
|
|
||||||
: route.params.id.toString()
|
|
||||||
); //id path
|
|
||||||
|
|
||||||
const files = ref<any>(); //ไฟล์
|
const files = ref<any>() //ไฟล์
|
||||||
const tranferOrg = ref<string>(""); //ชื่อหน่วยงานที่ขอโอนไป
|
const tranferOrg = ref<string>("") //ชื่อหน่วยงานที่ขอโอนไป
|
||||||
const noteReason = ref<string>(""); //เหตุผล
|
const noteReason = ref<string>("") //เหตุผล
|
||||||
const routeName = router.currentRoute.value.name; //ชื่อ path
|
const routeName = router.currentRoute.value.name //ชื่อ path
|
||||||
|
|
||||||
/** Dialog Save */
|
/** Dialog Save */
|
||||||
async function saveData() {
|
async function saveData() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
() => {
|
() => {
|
||||||
createTransfer();
|
createTransfer()
|
||||||
},
|
},
|
||||||
"ยืนยันการยื่นข้อมูลการโอน",
|
"ยืนยันการยื่นข้อมูลการโอน",
|
||||||
"ต้องการยื่นข้อมูลการโอนนี้ใช่หรือไม่"
|
"ต้องการยื่นข้อมูลการโอนนี้ใช่หรือไม่"
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ฟังก์ชั่นสร้างขอโอน */
|
/** ฟังก์ชั่นสร้างขอโอน */
|
||||||
async function createTransfer() {
|
async function createTransfer() {
|
||||||
showLoader();
|
showLoader()
|
||||||
const formData = new FormData();
|
const formData = new FormData()
|
||||||
formData.append("Organization", tranferOrg.value);
|
formData.append("Organization", tranferOrg.value)
|
||||||
formData.append("Reason", noteReason.value);
|
formData.append("Reason", noteReason.value)
|
||||||
formData.append("file", files.value);
|
formData.append("file", files.value)
|
||||||
await http
|
await http
|
||||||
.post(config.API.listtransfer(), formData)
|
.post(config.API.listtransfer(), formData)
|
||||||
.then((res) => {
|
.then(res => {
|
||||||
router.push(`/transfer/` + res.data.result);
|
router.push(`/transfer/` + res.data.result)
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ")
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch(e => {
|
||||||
messageError($q, e);
|
messageError($q, e)
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader()
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -66,21 +62,21 @@ async function createTransfer() {
|
||||||
* @param id ไอดีของข้อมูล
|
* @param id ไอดีของข้อมูล
|
||||||
*/
|
*/
|
||||||
async function fecthDataTransfer(id: string) {
|
async function fecthDataTransfer(id: string) {
|
||||||
showLoader();
|
showLoader()
|
||||||
await http
|
await http
|
||||||
.get(config.API.transferByid(id))
|
.get(config.API.transferByid(id))
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
let data = res.data.result;
|
let data = res.data.result
|
||||||
tranferOrg.value = data.organization;
|
tranferOrg.value = data.organization
|
||||||
noteReason.value = data.reason;
|
noteReason.value = data.reason
|
||||||
files.value = data.docs;
|
files.value = data.docs
|
||||||
})
|
})
|
||||||
.catch((e: any) => {
|
.catch((e: any) => {
|
||||||
messageError($q, e);
|
messageError($q, e)
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader()
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -88,133 +84,104 @@ async function fecthDataTransfer(id: string) {
|
||||||
* @param url URL File
|
* @param url URL File
|
||||||
*/
|
*/
|
||||||
function fileOpen(url: string) {
|
function fileOpen(url: string) {
|
||||||
window.open(url, "_blank");
|
window.open(url, "_blank")
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้
|
* เรียกฟังก์ชันทั้งหมดตอนเรียกใช้ไฟล์นี้
|
||||||
*/
|
*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (route.params.id !== undefined) {
|
if (route.params.id !== undefined) {
|
||||||
fecthDataTransfer(id.value);
|
fecthDataTransfer(id.value)
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="col-12 row justify-center">
|
<div class="col-12 row justify-center">
|
||||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||||
<div class="toptitle text-white col-12 row items-center">
|
<div class="toptitle text-white col-12 row items-center">
|
||||||
<q-btn
|
<q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm" @click="router.go(-1)" />
|
||||||
icon="mdi-arrow-left"
|
<div v-if="routeName == 'addTransfer'">เพิ่มเรื่องขอโอน</div>
|
||||||
unelevated
|
<div v-else>รายละเอียดเรื่องขอโอน</div>
|
||||||
round
|
</div>
|
||||||
dense
|
<q-form class="col-12" greedy @submit.prevent @validation-success="saveData">
|
||||||
flat
|
<q-card bordered>
|
||||||
color="primary"
|
<q-card-section>
|
||||||
class="q-mr-sm"
|
<div class="row">
|
||||||
@click="router.go(-1)"
|
<div class="col-12 row q-col-gutter-sm">
|
||||||
/>
|
<q-input
|
||||||
<div v-if="routeName == 'addTransfer'">เพิ่มเรื่องขอโอน</div>
|
:class="routeName != 'addTransfer' ? 'col-12' : 'col-12 inputgreen'"
|
||||||
<div v-else>รายละเอียดเรื่องขอโอน</div>
|
dense
|
||||||
</div>
|
outlined
|
||||||
<q-form
|
v-model="tranferOrg"
|
||||||
class="col-12"
|
hide-bottom-space
|
||||||
greedy
|
label="หน่วยงานที่ขอโอนไป"
|
||||||
@submit.prevent
|
:readonly="routeName != 'addTransfer'"
|
||||||
@validation-success="saveData"
|
:rules="[(val:string) => !!val || `${'กรุณากรอกหน่วยงานที่ขอโอนไป'}`]"
|
||||||
>
|
/>
|
||||||
<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
|
<q-input
|
||||||
:class="
|
:class="routeName != 'addTransfer' ? 'col-12' : 'col-12 inputgreen'"
|
||||||
routeName != 'addTransfer' ? 'col-12' : 'col-12 inputgreen'
|
dense
|
||||||
"
|
outlined
|
||||||
dense
|
v-model="noteReason"
|
||||||
outlined
|
label="เหตุผล"
|
||||||
v-model="noteReason"
|
hide-bottom-space
|
||||||
label="เหตุผล"
|
type="textarea"
|
||||||
hide-bottom-space
|
:readonly="routeName != 'addTransfer'"
|
||||||
type="textarea"
|
:rules="[(val:string) => !!val || `${'กรุณากรอกเหตุผล'}`]"
|
||||||
:readonly="routeName != 'addTransfer'"
|
/>
|
||||||
:rules="[(val:string) => !!val || `${'กรุณากรอกเหตุผล'}`]"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="col-12 row" v-if="routeName == 'addTransfer'">
|
<div class="col-12 row" v-if="routeName == 'addTransfer'">
|
||||||
<q-file
|
<q-file
|
||||||
v-model="files"
|
v-model="files"
|
||||||
class="col-xs-12 col-sm-12 inputgreen"
|
class="col-xs-12 col-sm-12 inputgreen"
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
accept=".pdf"
|
accept=".pdf"
|
||||||
:rules="[(val: string) => !!val || 'กรุณาเลือกไฟล์เอกสารเพิ่มเติม']"
|
:rules="[(val: string) => !!val || 'กรุณาเลือกไฟล์เอกสารเพิ่มเติม']"
|
||||||
label="เอกสารเพิ่มเติม"
|
label="เอกสารเพิ่มเติม"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend> <q-icon name="attach_file" /> </template
|
||||||
<q-icon name="attach_file" /> </template
|
></q-file>
|
||||||
></q-file>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-12 row" v-if="routeName != 'addTransfer'">
|
<div class="col-12 row" v-if="routeName != 'addTransfer'">
|
||||||
<q-card bordered flat class="full-width">
|
<q-card bordered flat class="full-width">
|
||||||
<div
|
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||||
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>
|
||||||
<div class="q-pl-sm text-weight-bold text-dark">
|
<q-separator />
|
||||||
เอกสารเพิ่มเติม
|
<q-list separator>
|
||||||
</div>
|
<q-item v-for="file in files" :key="file.key">
|
||||||
</div>
|
<q-item-section>
|
||||||
<q-separator />
|
{{ file.fileName }}
|
||||||
<q-list separator>
|
</q-item-section>
|
||||||
<q-item v-for="file in files" :key="file.key">
|
<q-item-section avatar>
|
||||||
<q-item-section>
|
<q-btn color="teal-5" round flat icon="mdi-download" @click="fileOpen(file.pathName)"></q-btn>
|
||||||
{{ file.fileName }}
|
</q-item-section>
|
||||||
</q-item-section>
|
</q-item>
|
||||||
<q-item-section avatar>
|
</q-list>
|
||||||
<q-btn
|
</q-card>
|
||||||
color="teal-5"
|
</div>
|
||||||
round
|
|
||||||
flat
|
|
||||||
icon="mdi-download"
|
|
||||||
@click="fileOpen(file.pathName)"
|
|
||||||
></q-btn>
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
</q-card>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Workflow -->
|
<!-- Workflow -->
|
||||||
<div class="col-12" v-if="routeName != 'addTransfer'">
|
<div class="col-12" v-if="routeName != 'addTransfer'">
|
||||||
<Workflow :id="id" :sys-name="`PLACEMENT_TRANSFER`" />
|
<Workflow :id="id" :sys-name="`SYS_TRANSFER_REQ`" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
|
||||||
<q-separator v-if="routeName == 'addTransfer'" />
|
<q-separator v-if="routeName == 'addTransfer'" />
|
||||||
<q-card-actions align="right" v-if="routeName == 'addTransfer'">
|
<q-card-actions align="right" v-if="routeName == 'addTransfer'">
|
||||||
<q-btn color="primary" label="ยื่นเรื่องขอโอน" type="onsubmit" />
|
<q-btn color="primary" label="ยื่นเรื่องขอโอน" type="onsubmit" />
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-form>
|
</q-form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ async function getSurveyData() {
|
||||||
.then(async (res: any) => {
|
.then(async (res: any) => {
|
||||||
const data = await res.data.result.data;
|
const data = await res.data.result.data;
|
||||||
assignId.value = res.data.result.assignId;
|
assignId.value = res.data.result.assignId;
|
||||||
|
store.assignId = res.data.result.assignId;
|
||||||
if (data !== null) {
|
if (data !== null) {
|
||||||
answer1.value = data.answer1;
|
answer1.value = data.answer1;
|
||||||
answer2.value = data.answer2;
|
answer2.value = data.answer2;
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,13 @@ import { useRoute, useRouter } from "vue-router";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { useProbationReport } from "@/modules/15_probationReport/store";
|
||||||
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
const store = useProbationReport();
|
||||||
|
|
||||||
const { date2Thai, showLoader, hideLoader, messageError } = mixin;
|
const { date2Thai, showLoader, hideLoader, messageError } = mixin;
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const assignId = ref<string>("baa3d9f6-9d21-4c58-85f2-114abf8de25c");
|
|
||||||
const status = ref<boolean>(false);
|
const status = ref<boolean>(false);
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
@ -52,7 +53,7 @@ const result_option = reactive([
|
||||||
async function getReportScore() {
|
async function getReportScore() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.summaryReportDetail(assignId.value))
|
.get(config.API.summaryReportDetail(store.assignId))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
develop_orientation_score.value = data.develop_orientation_score;
|
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 ค่า เมื่อโหลดหน้า */
|
/** get ค่า เมื่อโหลดหน้า */
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
|
if (!store.assignId) {
|
||||||
|
await getAssignId();
|
||||||
|
}
|
||||||
|
|
||||||
getReportScore();
|
getReportScore();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,6 @@ import type { DataOption } from "@/modules/10_registry/interface/index/Main";
|
||||||
|
|
||||||
export const useProbationReport = defineStore("ProbationReportStore", () => {
|
export const useProbationReport = defineStore("ProbationReportStore", () => {
|
||||||
const tabMain = ref<string>("SURVEY");
|
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 ModuleDevelop from "@/modules/14_IDP/router";
|
||||||
import ModuleProbationReport from "@/modules/15_probationReport/router";
|
import ModuleProbationReport from "@/modules/15_probationReport/router";
|
||||||
|
|
||||||
import { authenticated, tokenParsed } from "@/plugins/auth";
|
import { authenticated, logout } from "@/plugins/auth";
|
||||||
import { ro } from "date-fns/locale";
|
|
||||||
// TODO: ใช้หรือไม่?
|
// TODO: ใช้หรือไม่?
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
|
|
@ -96,7 +95,7 @@ router.beforeEach(async (to, from, next) => {
|
||||||
if (to.meta.Auth) {
|
if (to.meta.Auth) {
|
||||||
const checkAuthen = await authenticated();
|
const checkAuthen = await authenticated();
|
||||||
if (!checkAuthen && to.meta.Auth) {
|
if (!checkAuthen && to.meta.Auth) {
|
||||||
router.push({ name: "loginMain" });
|
logout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
next();
|
next();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue