57 lines
1.6 KiB
TypeScript
57 lines
1.6 KiB
TypeScript
// The Lucia project.
|
|
// Copyright 2023-2026 DSP, inc. All rights reserved.
|
|
// Authors:
|
|
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
|
|
// imacat.yang@dsp.im (imacat), 2023/9/23
|
|
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
|
|
/**
|
|
* @module stores/conformanceInput Temporary storage for user input
|
|
* during conformance rule configuration. Unlike stores/conformance
|
|
* which handles API integration, this store focuses on caching
|
|
* user selections before submission.
|
|
*/
|
|
|
|
import { defineStore } from "pinia";
|
|
|
|
/**
|
|
* Pinia store for caching user input during conformance rule editing.
|
|
*/
|
|
export const useConformanceInputStore = defineStore("conformanceInputStore", {
|
|
state: () => ({
|
|
inputDataToSave: {
|
|
inputStart: null,
|
|
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;
|
|
}
|
|
},
|
|
},
|
|
});
|