ทะเบียนประวัติ: เครื่องราชฯ (refactor)
This commit is contained in:
parent
80b78245bb
commit
a946d3b1c9
4 changed files with 114 additions and 175 deletions
|
|
@ -1,8 +1,21 @@
|
|||
import { ref, computed } from "vue";
|
||||
import { defineStore } from "pinia";
|
||||
import type { DataOptionInsignia } from "@/modules/04_registryNew/interface/index/Main";
|
||||
import type { ResponseObject as Insignia } from "@/modules/07_insignia/interface/response/Main";
|
||||
|
||||
export const useInsigniaDataStore = defineStore("insigniaDataStore", () => {
|
||||
const insigniaOption = ref<DataOptionInsignia[]>([]);
|
||||
return { insigniaOption };
|
||||
|
||||
function mapInsigniaOption(resData: any) {
|
||||
insigniaOption.value = [];
|
||||
resData.map((r: Insignia) => {
|
||||
insigniaOption.value.push({
|
||||
id: r.id.toString(),
|
||||
name: r.name.toString() + ` (${r.shortName})`,
|
||||
typeName: r.insigniaTypeName.toString(),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return { insigniaOption, mapInsigniaOption };
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue