Add JSDoc documentation and file headers to all source files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 18:55:36 +08:00
parent 3b7b6ae859
commit 7fec6cb63f
199 changed files with 2764 additions and 503 deletions

View File

@@ -192,6 +192,18 @@
</section>
</template>
<script setup>
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
// imacat.yang@dsp.im (imacat), 2023/9/23
/**
* @module components/Discover/Conformance/ConformanceResults
* Conformance checking results panel displaying rule
* check outcomes in a data table with status indicators.
*/
import { ref, watch } from 'vue';
import { storeToRefs } from 'pinia';
import { useConformanceStore } from '@/stores/conformance';
@@ -274,8 +286,8 @@ const tooltip = ref({
/**
* set progress bar width
* @param {number} value 百分比數字
* @returns {string} 樣式的寬度設定
* @param {number} value - The percentage value.
* @returns {string} The CSS width style string.
*/
const progressWidth = (value) => {
return `width:${value}%;`
@@ -283,8 +295,8 @@ const progressWidth = (value) => {
/**
* Number to percentage
* @param {number} val 原始數字
* @returns {string} 轉換完成的百分比字串
* @param {number} val - The raw ratio value.
* @returns {string} The formatted percentage string.
*/
const getPercentLabel = (val) => {
if((val * 100).toFixed(1) >= 100) return 100;
@@ -293,7 +305,7 @@ const getPercentLabel = (val) => {
/**
* Convert seconds to days
* @param {number} sec 秒數
* @param {number} sec - The number of seconds.
* @returns {number} day
*/
const convertSecToDay = (sec) => {
@@ -302,7 +314,7 @@ const convertSecToDay = (sec) => {
/**
* Open Issues Modal.
* @param {number} no trace 編號
* @param {number} no - The trace number.
*/
const openMore = async (no) => {
// async await 解決非同步資料延遲傳遞導致未讀取到而出錯的問題
@@ -315,7 +327,7 @@ const openMore = async (no) => {
/**
* Open Loop Modal.
* @param {number} no trace 編號
* @param {number} no - The trace number.
*/
const openLoopMore = async (no) => {
// async await 解決非同步資料延遲傳遞導致未讀取到而出錯的問題
@@ -328,7 +340,7 @@ const openLoopMore = async (no) => {
/**
* set conformance report data
* @param {object} data new watch's value 監聽到後端傳來的報告 data
* @param {object} data - The report data received from the backend.
*/
const setConformanceTempReportData = (newData) => {
const total = getNumberLabel(Object.values(newData.counts).reduce((acc, val) => acc + val, 0));

View File

@@ -122,6 +122,19 @@
</template>
<script setup>
// 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 components/Discover/Conformance/ConformanceSidebar
* Main sidebar for conformance checking with rule
* configuration, activity selection, and submit/reset
* actions.
*/
import { ref, computed, watch, onBeforeUnmount } from 'vue';
import { storeToRefs } from 'pinia';
import { useToast } from 'vue-toast-notification';
@@ -622,14 +635,14 @@ watch(conformanceTempReportData, (newValue) => {
// methods
/**
* get min total seconds
* @param {Number} e 最小值總秒數
* @param {number} e - The minimum total seconds.
*/
function minTotalSeconds(e) {
selectTimeRangeMin.value = e;
}
/**
* get min total seconds
* @param {Number} e 最大值總秒數
* @param {number} e - The maximum total seconds.
*/
function maxTotalSeconds(e) {
selectTimeRangeMax.value = e;
@@ -715,7 +728,7 @@ function isSubmitReset() {
isSubmitTimeCfmCtEteSE.value = { base: {}, rule: {}};
}
/**
* 清空選單的行為
* Clears all form selections and resets the sidebar state.
*/
function reset() {
// Results page Cover Plate(遮罩為 ture)
@@ -733,7 +746,7 @@ function reset() {
isShowBarOpen.value = true;
}
/**
* 設定 Start & End Data 連動資料
* Sets linked Start & End data for activity selection.
* @param {string} start task
* @param {string} end task
* @returns {object}
@@ -758,7 +771,7 @@ function setSubmitShowDataByStartEnd(start, end) {
}
}
/**
* Apply button 發送選項,取得 Check Id.
* Submits the selected options via the Apply button and retrieves the Check ID.
*/
async function submitConformance() {
let dataToSave;
@@ -810,6 +823,9 @@ async function submitConformance() {
$toast.success(i18next.t("Conformance.RuleApplied"));
}
/** Builds the data payload for the 'Have activity' rule.
* @returns {object} The rule data to submit.
*/
function getHaveActivityData() {
const dataToSave = {
type: 'contains-tasks',
@@ -820,6 +836,9 @@ function getHaveActivityData() {
return dataToSave;
}
/** Builds the data payload for the 'Activity sequence' rule.
* @returns {object} The rule data to submit.
*/
function getActivitySequenceData() {
let dataToSave;
switch (selectedActivitySequence.value) {
@@ -843,6 +862,9 @@ function getActivitySequenceData() {
return dataToSave;
}
/** Builds the data payload for sequence sub-rules.
* @returns {object} The rule data to submit.
*/
function getSequenceData() {
let dataToSave;
switch (selectedMode.value) {
@@ -872,6 +894,9 @@ function getSequenceData() {
return dataToSave;
}
/** Builds the data payload for the 'Activity duration' rule.
* @returns {object} The rule data to submit.
*/
function getActivityDurationData() {
const dataToSave = {
type: 'task-duration',
@@ -885,6 +910,9 @@ function getActivityDurationData() {
return dataToSave;
}
/** Builds the data payload for the 'Processing time' rule.
* @returns {object} The rule data to submit.
*/
function getProcessingTimeData() {
let dataToSave;
switch (selectedProcessScope.value) {
@@ -898,6 +926,9 @@ function getProcessingTimeData() {
return dataToSave;
}
/** Builds end-to-end processing time rule data.
* @returns {object} The rule data to submit.
*/
function getEndToEndProcessingTimeData() {
let dataToSave;
switch (selectedActSeqMore.value) {
@@ -952,6 +983,9 @@ function getEndToEndProcessingTimeData() {
return dataToSave;
}
/** Builds partial processing time rule data.
* @returns {object} The rule data to submit.
*/
function getPartialProcessingTimeData() {
let dataToSave;
switch (selectedActSeqFromTo.value) {
@@ -997,6 +1031,9 @@ function getPartialProcessingTimeData() {
return dataToSave;
}
/** Builds the data payload for the 'Waiting time' rule.
* @returns {object} The rule data to submit.
*/
function getWaitingTimeData() {
let dataToSave;
switch (selectedProcessScope.value) {
@@ -1010,6 +1047,9 @@ function getWaitingTimeData() {
return dataToSave;
}
/** Builds end-to-end waiting time rule data.
* @returns {object} The rule data to submit.
*/
function getEndToEndWaitingTimeData() {
let dataToSave;
switch (selectedActSeqMore.value) {
@@ -1064,6 +1104,9 @@ function getEndToEndWaitingTimeData() {
return dataToSave;
}
/** Builds partial waiting time rule data.
* @returns {object} The rule data to submit.
*/
function getPartialWaitingTimeData() {
let dataToSave;
switch (selectedActSeqFromTo.value) {
@@ -1109,6 +1152,9 @@ function getPartialWaitingTimeData() {
return dataToSave;
}
/** Builds the data payload for the 'Cycle time' rule.
* @returns {object} The rule data to submit.
*/
function getCycleTimeData() {
let dataToSave;
switch (selectedActSeqMore.value) {
@@ -1164,7 +1210,7 @@ function getCycleTimeData() {
}
/**
* 設置根據類別的任務選擇邏輯
* Sets up category-based task selection logic.
*/
function setTaskByCategoryOnRadioEmitting() {
emitter.on('actRadioData', (data) => {
@@ -1201,6 +1247,10 @@ function setTaskByCategoryOnRadioEmitting() {
});
}
/**
* Handles start task selection for activity sequence.
* @param {string} task - The selected task.
*/
function handleCfmSeqStart(task) {
if (isStartSelected.value && task !== selectCfmSeqStart.value) {
selectCfmSeqEnd.value = null;
@@ -1208,6 +1258,10 @@ function handleCfmSeqStart(task) {
selectCfmSeqStart.value = task;
}
/**
* Handles end task selection for activity sequence.
* @param {string} task - The selected task.
*/
function handleCfmSeqEnd(task) {
if (isEndSelected.value && task !== selectCfmSeqEnd.value) {
selectCfmSeqStart.value = null;
@@ -1215,64 +1269,109 @@ function handleCfmSeqEnd(task) {
selectCfmSeqEnd.value = task;
}
/**
* Sets a simple task selection on a ref field.
* @param {object} field - The ref to set.
* @param {string} task - The selected task.
*/
function handleSimpleSelection(field, task) {
selectFieldRefs[field].value = task;
}
/**
* Handles start task for end-to-end processing time.
* @param {string} task - The selected task.
*/
function handleCfmPtEteSEStart(task) {
if (isStartSelected.value && task !== selectCfmPtEteSEStart.value) {
selectCfmPtEteSEEnd.value = null;
}
selectCfmPtEteSEStart.value = task;
}
/**
* Handles end task for end-to-end processing time.
* @param {string} task - The selected task.
*/
function handleCfmPtEteSEEnd(task) {
if (isEndSelected.value && task !== selectCfmPtEteSEEnd.value) {
selectCfmPtEteSEStart.value = null;
}
selectCfmPtEteSEEnd.value = task;
}
/**
* Handles start task for partial processing time.
* @param {string} task - The selected task.
*/
function handleCfmPtPSEStart(task) {
if (isStartSelected.value && task !== selectCfmPtPSEStart.value) {
selectCfmPtPSEEnd.value = null;
}
selectCfmPtPSEStart.value = task;
}
/**
* Handles end task for partial processing time.
* @param {string} task - The selected task.
*/
function handleCfmPtPSEEnd(task) {
if (isEndSelected.value && task !== selectCfmPtPSEEnd.value) {
selectCfmPtPSEStart.value = null;
}
selectCfmPtPSEEnd.value = task;
}
/**
* Handles start task for end-to-end waiting time.
* @param {string} task - The selected task.
*/
function handleCfmWtEteSEStart(task) {
if (isStartSelected.value && task !== selectCfmWtEteSEStart.value) {
selectCfmWtEteSEEnd.value = null;
}
selectCfmWtEteSEStart.value = task;
}
/**
* Handles end task for end-to-end waiting time.
* @param {string} task - The selected task.
*/
function handleCfmWtEteSEEnd(task) {
if (isEndSelected.value && task !== selectCfmWtEteSEEnd.value) {
selectCfmWtEteSEStart.value = null;
}
selectCfmWtEteSEEnd.value = task;
}
/**
* Handles start task for partial waiting time.
* @param {string} task - The selected task.
*/
function handleCfmWtPSEStart(task) {
if (isStartSelected.value && task !== selectCfmWtPSEStart.value) {
selectCfmWtPSEEnd.value = null;
}
selectCfmWtPSEStart.value = task;
}
/**
* Handles end task for partial waiting time.
* @param {string} task - The selected task.
*/
function handleCfmWtPSEEnd(task) {
if (isEndSelected.value && task !== selectCfmWtPSEEnd.value) {
selectCfmWtPSEStart.value = null;
}
selectCfmWtPSEEnd.value = task;
}
/**
* Handles start task for end-to-end cycle time.
* @param {string} task - The selected task.
*/
function handleCfmCtEteSEStart(task) {
if (isStartSelected.value && task !== selectCfmCtEteSEStart.value) {
selectCfmCtEteSEEnd.value = null;
}
selectCfmCtEteSEStart.value = task;
}
/**
* Handles end task for end-to-end cycle time.
* @param {string} task - The selected task.
*/
function handleCfmCtEteSEEnd(task) {
if (isEndSelected.value && task !== selectCfmCtEteSEEnd.value) {
selectCfmCtEteSEStart.value = null;
@@ -1280,6 +1379,7 @@ function handleCfmCtEteSEEnd(task) {
selectCfmCtEteSEEnd.value = task;
}
/** Sets task data when the list sequence emits a change. */
function setTaskByCategoryOnListSeqEmitting(){
emitter.on('getListSequence', (data) => {
switch (data.category) {
@@ -1295,15 +1395,21 @@ function setTaskByCategoryOnListSeqEmitting(){
});
}
/** Checks if the 'Have activity' rule has valid selections.
* @returns {boolean} Whether the button should be disabled.
*/
function checkHaveActivity() {
return !(selectConformanceTask.value?.length);
}
/** Checks if the 'Activity duration' rule has valid selections.
* @returns {boolean} Whether the button should be disabled.
*/
function checkActivityDuration() {
return !selectDurationData.value?.length;
}
/**
* 檢查活動序列的邏輯
* @returns {boolean} 是否禁用按鈕
* Checks the activity sequence logic.
* @returns {boolean} Whether the button should be disabled.
*/
function checkActivitySequence() {
switch (selectedActivitySequence.value) {
@@ -1316,15 +1422,18 @@ function checkActivitySequence() {
}
}
/**
* 檢查 Start & End 活動序列
* @param {string} start 活動開始
* @param {string} end 活動結束
* @returns {boolean} 是否禁用按鈕
* Checks the Start & End activity sequence.
* @param {string} start - The start activity.
* @param {string} end - The end activity.
* @returns {boolean} Whether the button should be disabled.
*/
function checkStartAndEndSequence(start, end) {
return !(start && end);
}
/** Checks if the 'Processing time' rule has valid selections.
* @returns {boolean} Whether the button should be disabled.
*/
function checkProcessingTime() {
let disabled = true;
switch (selectedProcessScope.value) {
@@ -1339,6 +1448,9 @@ function checkProcessingTime() {
}
return disabled;
}
/** Checks end-to-end scope selections.
* @returns {boolean} Whether the button should be disabled.
*/
function checkEndToEnd() {
let disabled = true;
switch (selectedActSeqMore.value) {
@@ -1362,6 +1474,9 @@ function checkEndToEnd() {
}
return disabled;
}
/** Checks partial scope selections.
* @returns {boolean} Whether the button should be disabled.
*/
function checkPartial() {
let disabled = true;
switch (selectedActSeqFromTo.value) {

View File

@@ -10,6 +10,16 @@
</div>
</template>
<script setup>
// 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
/**
* @module components/Discover/Conformance/ConformanceSidebar/ActList
* Checkbox-based activity list for conformance checking input.
*/
import { ref, watch } from 'vue';
import { sortNumEngZhtw } from '@/module/sortNumEngZhtw.js';
import emitter from '@/utils/emitter';
@@ -27,9 +37,7 @@ watch(() => props.select, (newValue) => {
actList.value = newValue;
});
/**
* 將選取的 Activities 傳出去
*/
/** Emits the selected activities list via the event bus. */
function actListData() {
emitter.emit('actListData', actList.value);
}

View File

@@ -10,6 +10,18 @@
</div>
</template>
<script setup>
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
// imacat.yang@dsp.im (imacat), 2023/9/23
/**
* @module components/Discover/Conformance/ConformanceSidebar/ActRadio
* Radio-button activity selector for conformance checking
* start/end activity input.
*/
import { ref, computed, watch } from 'vue';
import { useConformanceInputStore } from "@/stores/conformanceInput";
import { sortNumEngZhtw } from '@/module/sortNumEngZhtw.js';
@@ -37,9 +49,7 @@ const inputActivityRadioData = computed(() => ({
task: selectedRadio.value,
}));
/**
* 將選取的 Activity 傳出去
*/
/** Emits the selected activity via event bus and updates the store. */
function actRadioData() {
localSelect.value = null;
emitter.emit('actRadioData', inputActivityRadioData.value);
@@ -47,6 +57,7 @@ function actRadioData() {
conformanceInputStore.setActivityRadioStartEndData(inputActivityRadioData.value.task);
}
/** Sets the global activity radio data state in the conformance input store. */
function setGlobalActivityRadioDataState() {
//this.title: value might be "From" or "To"
conformanceInputStore.setActivityRadioStartEndData(inputActivityRadioData.value.task, props.title);

View File

@@ -42,6 +42,18 @@
</div>
</template>
<script setup>
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
// imacat.yang@dsp.im (imacat), 2023/9/23
/**
* @module components/Discover/Conformance/ConformanceSidebar/ActSeqDrag
* Drag-and-drop activity sequence builder for
* conformance rule configuration.
*/
import { ref, computed } from 'vue';
import { sortNumEngZhtw } from '@/module/sortNumEngZhtw.js';
import emitter from '@/utils/emitter';

View File

@@ -51,6 +51,17 @@
</section>
</template>
<script setup>
// 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
/**
* @module components/Discover/Conformance/ConformanceSidebar/ConformanceRadioGroup
* Radio button groups for conformance rule type, activity
* sequence, mode, and process scope selection.
*/
import { storeToRefs } from 'pinia';
import { useConformanceStore } from '@/stores/conformance';
import emitter from '@/utils/emitter';
@@ -92,9 +103,7 @@ const actSeqFromTo = [
{id: 3, name: 'From & To'},
];
/**
* 切換 Rule Type 的選項時的行為
*/
/** Resets dependent selections when the rule type radio changes. */
function changeRadio() {
selectedActivitySequence.value = 'Start & End';
selectedMode.value = 'Directly follows';
@@ -103,27 +112,19 @@ function changeRadio() {
selectedActSeqFromTo.value = 'From';
emitter.emit('isRadioChange', true); // Radio 切換時,資料要清空
}
/**
* 切換 Activity sequence 的選項時的行為
*/
/** Emits event when the activity sequence radio changes. */
function changeRadioSeq() {
emitter.emit('isRadioSeqChange',true);
}
/**
* 切換 Processing time 的選項時的行為
*/
/** Emits event when the process scope radio changes. */
function changeRadioProcessScope() {
emitter.emit('isRadioProcessScopeChange', true);
}
/**
* 切換 Process Scope 的選項時的行為
*/
/** Emits event when the extended activity sequence radio changes. */
function changeRadioActSeqMore() {
emitter.emit('isRadioActSeqMoreChange', true);
}
/**
* 切換 Activity Sequence 的選項時的行為
*/
/** Emits event when the from/to activity sequence radio changes. */
function changeRadioActSeqFromTo() {
emitter.emit('isRadioActSeqFromToChange', true);
}

View File

@@ -29,6 +29,18 @@
</div>
</template>
<script setup>
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
// imacat.yang@dsp.im (imacat), 2023/9/23
/**
* @module components/Discover/Conformance/ConformanceSidebar/ConformanceSelectResult
* Conformance result list with selectable items and
* scrollable display of check results.
*/
import { reactive, computed } from 'vue';
import { storeToRefs } from 'pinia';
import { useConformanceStore } from '@/stores/conformance';

View File

@@ -98,6 +98,18 @@
</section>
</template>
<script setup>
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
// imacat.yang@dsp.im (imacat), 2023/9/23
/**
* @module components/Discover/Conformance/ConformanceSidebar/ConformanceShowBar
* Horizontal bar chart component displaying conformance
* check result statistics.
*/
import { ref, computed, watch } from 'vue';
import { storeToRefs } from 'pinia';
import { useLoadingStore } from '@/stores/loading';
@@ -239,10 +251,9 @@ watch(() => props.isSubmitShowDataCt, (newValue) => {
});
/**
* 設定 start and end 的 Radio Data
* @param {object} data cfmSeqStart | cfmSeqEnd | cfmPtEteSE | cfmPtPSE | cfmWtEteSE | cfmWtPSE | cfmCtEteSE
* 傳入以上任一後端接到的 Activities 列表 Data。
* @param {string} category 'start' | 'end',傳入 'start' 或 'end'。
* Sets the start and end radio data.
* @param {object} data - Activities list data from the backend (cfmSeqStart, cfmSeqEnd, cfmPtEteSE, etc.).
* @param {string} category - 'start' or 'end'.
* @returns {array}
*/
function setTaskData(data, category) {
@@ -251,11 +262,10 @@ function setTaskData(data, category) {
return newData;
}
/**
* 重新設定連動的 start and end 的 Radio Data
* @param {object} data cfmPtEteSE | cfmPtPSE | cfmWtEteSE | cfmWtPSE | cfmCtEteSE
* 傳入以上任一後端接到的 Activities 列表 Data。
* @param {string} category 'start' | 'end',傳入 'start' 或 'end'。
* @param {string} task 已選擇的 Activity task
* Resets the linked start and end radio data.
* @param {object} data - Activities list data from the backend (cfmPtEteSE, cfmPtPSE, etc.).
* @param {string} category - 'start' or 'end'.
* @param {string} task - The selected activity task.
* @returns {array}
*/
function setStartAndEndData(data, category, taskVal) {
@@ -270,10 +280,10 @@ function setStartAndEndData(data, category, taskVal) {
return newData;
}
/**
* 重新設定 Activity sequence 連動的 start and end 的 Radio Data
* @param {object} data cfmSeqStart | cfmSeqEnd,傳入以上任一後端接到的 Activities 列表 Data。
* @param {string} category 'sources' | 'sinks',傳入 'sources' 或 'sinks'
* @param {string} task 已選擇的 Activity task
* Resets the activity sequence linked start and end radio data.
* @param {object} data - Activities list data from the backend (cfmSeqStart or cfmSeqEnd).
* @param {string} category - 'sources' or 'sinks'.
* @param {string} task - The selected activity task.
* @returns {array}
*/
function setSeqStartAndEndData(data, category, taskVal) {
@@ -283,7 +293,7 @@ function setSeqStartAndEndData(data, category, taskVal) {
}
/**
* select start list's task
* @param {event} e 觸發 input 的詳細事件
* @param {Event} e - The input event.
*/
function selectStart(e) {
taskStart.value = e;
@@ -300,7 +310,7 @@ function selectStart(e) {
}
/**
* select End list's task
* @param {event} e 觸發 input 的詳細事件
* @param {Event} e - The input event.
*/
function selectEnd(e) {
taskEnd.value = e;
@@ -326,8 +336,8 @@ function reset() {
taskEnd.value = null;
}
/**
* Radio 切換時,Start & End Data 連動改變
* @param {boolean} data true | false傳入 true 或 false
* Updates linked Start & End data when radio selection changes.
* @param {boolean} data - Whether data should be restored from submission state.
*/
function setResetData(data) {
if(data) {

View File

@@ -68,6 +68,18 @@
</div>
</template>
<script setup>
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
// imacat.yang@dsp.im (imacat), 2023/9/23
/**
* @module components/Discover/Conformance/ConformanceSidebar/ConformanceTimeRange
* Time range picker for conformance time-based rule
* configuration with calendar inputs.
*/
import { reactive } from 'vue';
import { storeToRefs } from 'pinia';
import { useConformanceStore } from '@/stores/conformance';
@@ -149,22 +161,22 @@ const storeRefs = {
/**
* get min total seconds
* @param {Number} e 最小值總秒數
* @param {number} e - The minimum total seconds.
*/
function minTotalSeconds(e) {
emit('min-total-seconds', e);
}
/**
* get min total seconds
* @param {Number} e 最大值總秒數
* @param {number} e - The maximum total seconds.
*/
function maxTotalSeconds(e) {
emit('max-total-seconds', e);
}
/**
* get Time Range(duration)
* @param {array} data API dataActivity 列表
* @param {string} category 'act' | 'single' | 'double',傳入以上任一值。
* @param {Array} data - Activity list data from the API.
* @param {string} category - 'act', 'single', or 'double'.
* @param {string} task select Radio task or start
* @param {string} taskTwo end
* @returns {object} {min:12, max:345}

View File

@@ -9,5 +9,16 @@
</ul>
</template>
<script setup>
// 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
/**
* @module components/Discover/Conformance/ConformanceSidebar/ResultArrow
* Conformance result display with arrow icons showing activity
* sequences.
*/
defineProps(['data', 'select']);
</script>

View File

@@ -9,6 +9,17 @@
</ul>
</template>
<script setup>
// 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
/**
* @module components/Discover/Conformance/ConformanceSidebar/ResultCheck
* Conformance result display with check-circle icons showing
* matched activities.
*/
import { ref, watch } from 'vue';
import emitter from '@/utils/emitter';

View File

@@ -8,6 +8,17 @@
</ul>
</template>
<script setup>
// 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
/**
* @module components/Discover/Conformance/ConformanceSidebar/ResultDot
* Conformance result display with dot icons showing category
* and task pairs.
*/
import { ref, watch } from 'vue';
import emitter from '@/utils/emitter';

View File

@@ -10,6 +10,18 @@
</div>
</template>
<script setup>
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
// imacat.yang@dsp.im (imacat), 2023/9/23
/**
* @module components/Discover/Conformance/ConformanceSidebar/TimeRangeDuration
* Time range duration picker with min/max duration inputs
* for conformance time-based rules.
*/
import { ref, watch } from 'vue';
import Durationjs from '@/components/durationjs.vue';
@@ -28,9 +40,7 @@ const updateMin = ref(null);
const durationMin = ref(null);
const durationMax = ref(null);
/**
* set props values
*/
/** Deep-copies timeData min/max values to the Vue component boundaries. */
function setTimeValue() {
// 深拷貝原始 timeData 的內容
minVuemin.value = JSON.parse(JSON.stringify(timeData.value.min));
@@ -40,8 +50,8 @@ function setTimeValue() {
}
/**
* get min total seconds
* @param {Number} e 元件傳來的最小值總秒數
* Handles the minimum duration total seconds update.
* @param {number} e - The total seconds from the min duration component.
*/
function minTotalSeconds(e) {
timeRangeMin.value = e;
@@ -50,8 +60,8 @@ function minTotalSeconds(e) {
}
/**
* get min total seconds
* @param {Number} e 元件傳來的最大值總秒數
* Handles the maximum duration total seconds update.
* @param {number} e - The total seconds from the max duration component.
*/
function maxTotalSeconds(e) {
timeRangeMax.value = e;

View File

@@ -62,6 +62,18 @@
</Dialog>
</template>
<script setup>
// The Lucia project.
// Copyright 2023-2026 DSP, inc. All rights reserved.
// Authors:
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
// imacat.yang@dsp.im (imacat), 2023/9/23
/**
* @module components/Discover/Conformance/MoreModal
* Modal dialog showing detailed conformance check
* results with expandable activity sequences.
*/
import { ref, computed, watch, nextTick, useTemplateRef } from 'vue';
import { storeToRefs } from 'pinia';
import { useConformanceStore } from '@/stores/conformance';
@@ -169,8 +181,8 @@ watch(infinite404, (newValue) => {
// methods
/**
* Number to percentage
* @param {number} val 原始數字
* @returns {string} 轉換完成的百分比字串
* @param {number} val - The raw ratio value.
* @returns {string} The formatted percentage string.
*/
function getPercentLabel(val){
if((val * 100).toFixed(1) >= 100) return 100;
@@ -178,8 +190,8 @@ function getPercentLabel(val){
}
/**
* set progress bar width
* @param {number} value 百分比數字
* @returns {string} 樣式的寬度設定
* @param {number} value - The percentage value.
* @returns {string} The CSS width style string.
*/
function progressWidth(value){
return `width:${value}%;`
@@ -201,7 +213,7 @@ async function switchCaseData(id) {
showTraceId.value = id; // 放 getDetail 為了 case table 載入完再切換 showTraceId
}
/**
* trace element nodes 資料彙整
* Assembles the trace element nodes data for Cytoscape rendering.
*/
function setNodesData(){
// 避免每次渲染都重複累加
@@ -224,7 +236,7 @@ function setNodesData(){
};
}
/**
* trace edge line 資料彙整
* Assembles the trace edge line data for Cytoscape rendering.
*/
function setEdgesData(){
processMap.value.edges = [];
@@ -256,7 +268,7 @@ function createCy(){
});
}
/**
* 無限滾動: 載入數據
* Infinite scroll: loads more data.
*/
async function fetchData() {
try {
@@ -270,8 +282,8 @@ async function fetchData() {
}
}
/**
* 無限滾動: 監聽 scroll 有沒有滾到底部
* @param {element} event 監聽時回傳的事件
* Infinite scroll: listens for scroll reaching the bottom.
* @param {Event} event - The scroll event.
*/
function handleScroll(event) {
if(maxItems.value || infiniteData.value.length < 20 || infiniteFinish.value === false) return;