Convert all store files from JavaScript to TypeScript

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 14:47:57 +08:00
parent 90048d0505
commit a619be7881
65 changed files with 2031 additions and 5066 deletions

View File

@@ -0,0 +1,47 @@
import { defineStore } from "pinia";
import moment from 'moment';
/**
* stores/conformanceInput.js 與 stores/conformance.js 的差別在於
* 本store側重在暫存使用者的輸入
* 而後者則側重在 API 的串接之所需
*/
export const useConformanceInputStore = defineStore('conformanceInputStore', {
state: () => ({
inputDataToSave: {
inputStart: null, // 有待釐清start 是活動的開始,還是時間的開始?
inputEnd: null,
min: null,
max: null,
type: null,
task: null,
},
activityRadioData: {
category: null,
task: ['', ''],
},
}),
getters: {
},
actions: {
/**
* Sets the activity radio global state for either the start ('From') or end ('To') of a task.
* We arrange in this way because backend needs us to communicate in this way.
* @param {object} actRadioData
* @param {string} fromToStr 'From' or 'To'
*/
setActivityRadioStartEndData(actRadioData, fromToStr){
switch(fromToStr) {
case 'From':
this.activityRadioData.task[0] = actRadioData;
break;
case 'To':
this.activityRadioData.task[this.activityRadioData.task.length - 1] = actRadioData;
break;
default:
break;
}
},
},
})