32 lines
867 B
TypeScript
32 lines
867 B
TypeScript
import { defineStore } from "pinia";
|
|
import { ref, computed } from "vue";
|
|
export const useProfileDataStore = defineStore("placement", () => {
|
|
return {};
|
|
});
|
|
export const usePlacementDataStore = defineStore("placement", () => {
|
|
interface placement {
|
|
mappingPosition: { columns: String[] };
|
|
}
|
|
const placementData = ref<placement>({
|
|
mappingPosition: { columns: [] },
|
|
});
|
|
const changePlacementColumns = (system: String, val: String[]) => {
|
|
if (system == "mappingPosition")
|
|
placementData.value.mappingPosition.columns = val;
|
|
localStorage.setItem(
|
|
"placement",
|
|
JSON.stringify(placementData.value)
|
|
);
|
|
};
|
|
|
|
if (localStorage.getItem("placement") !== null) {
|
|
placementData.value = JSON.parse(
|
|
localStorage.getItem("placement") || "{}"
|
|
);
|
|
}
|
|
|
|
return {
|
|
placementData,
|
|
changePlacementColumns,
|
|
};
|
|
});
|