WIP #217 don't know why it seems to work though
This commit is contained in:
42
src/stores/conformanceInput.js
Normal file
42
src/stores/conformanceInput.js
Normal 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');
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user