WIP #217 don't know why it seems to work though

This commit is contained in:
Cindy Chang
2024-06-07 11:39:53 +08:00
parent fc99bac449
commit e16304df45
6 changed files with 110 additions and 92 deletions

View File

@@ -0,0 +1,42 @@
import { defineStore } from "pinia";
import moment from 'moment';
export default defineStore('conformanceInputStore', {
state: () => ({
inputDataToSave: {
inputStart: null,
inputEnd: null,
min: null,
max: null,
type: null,
task: null,
},
}),
getters: {
},
actions: {
/**
* Temporarily set conformance input data which is probably fed to backend later.
* @param {object} userInputObj
*/
setConformanceUserInput(userInputObj){
this.inputDataToSave = {...userInputObj};
},
/**
* Set the starting time of time range to be saved later
* @param {string} startStr
*/
setConformanceInputStart(startStr){
console.log('startStr', startStr);
this.inputDataToSave.inputStart = moment(startStr).format('YYYY-MM-DDTHH:mm:ss');
},
/**
* Set the ending time of time range to be saved later
* @param {string} startStr
*/
setConformanceInputEnd(endStr){
console.log('endStr', endStr);
this.inputDataToSave.inputEnd = moment(endStr).format('YYYY-MM-DDTHH:mm:ss');
},
},
})