แก้ไขโครงสร้าง
This commit is contained in:
parent
5465b33de1
commit
a0959017c8
6 changed files with 106 additions and 35 deletions
|
|
@ -1,10 +1,10 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import { reactive, ref } from "vue";
|
||||
|
||||
/** importType*/
|
||||
import type {
|
||||
DataActive,
|
||||
Position,
|
||||
SumPosition,
|
||||
PosMaster,
|
||||
} from "@/modules/02_organizationalNew/interface/response/organizational";
|
||||
|
||||
|
|
@ -19,6 +19,23 @@ export const useOrganizational = defineStore("organizationalStore", () => {
|
|||
const level = ref<number>();
|
||||
const isPublic = ref<boolean>(false);
|
||||
const orgPublishDate = ref<Date | null>(null);
|
||||
const sumPosition = reactive({
|
||||
total: 0,
|
||||
use: 0,
|
||||
vacant: 0,
|
||||
});
|
||||
|
||||
function getSumPosition(data: SumPosition) {
|
||||
sumPosition.total = data.totalPosition;
|
||||
sumPosition.use =
|
||||
typeOrganizational.value == "draft"
|
||||
? data.totalPositionNextUse
|
||||
: data.totalPositionCurrentUse;
|
||||
sumPosition.vacant =
|
||||
typeOrganizational.value == "draft"
|
||||
? data.totalPositionNextVacant
|
||||
: data.totalPositionCurrentVacant;
|
||||
}
|
||||
|
||||
function fetchDataActive(data: DataActive) {
|
||||
activeId.value = data.activeId;
|
||||
|
|
@ -100,5 +117,7 @@ export const useOrganizational = defineStore("organizationalStore", () => {
|
|||
isPublic,
|
||||
orgPublishDate,
|
||||
fetchPosMaster,
|
||||
sumPosition,
|
||||
getSumPosition,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue