diff --git a/src/module/timeLabel.js b/src/module/timeLabel.js index eede243..dc58e13 100644 --- a/src/module/timeLabel.js +++ b/src/module/timeLabel.js @@ -99,18 +99,6 @@ export function getTimeLabel(second, fixedNumber = 0) { return second + " sec"; } -/** UNUSED - * Converts seconds into a formatted string with time units. - * 將秒數轉換成帶有時間單位的格式 - * - * @param {number} second - Total seconds - * 總秒數 - * @param {number} fixedNumber - Number of decimal places - * 小數點後幾位 - * @returns {string} - The formatted time string (e.g., 1 day, 6.8 hrs) - * 轉換完的格式(ex: 1 day, 6.8 hrs) - */ - /** * 將秒數轉換成帶有縮寫時間單位的格式 * @param {number} second 總秒數 @@ -204,55 +192,6 @@ export function followTimeLabel(second, max, fixedNumber = 0) { } -/** UNUSED - * 將時間轉換成不同日期單位的格式 - * @param { string } date 日期 - * @param { string } maxX 該 data 最大的日期,格式是 timestamp - * @param { string } minX 該 data 最小的日期,格式是 timestamp - */ -export function getDateLabelByMinMaxDate(date, maxDate, minDate) { - // 將時間字串轉換為時間物件 - // new Date(time) 之後不用 getTime(),因為在JavaScript中, - // 日期物件是以時間戳記(timestamp)的形式存儲的。當創建一個新的日期物件時, - // 它內部會自動轉換時間字串為時間戳記。 - date = new Date(date); - maxDate = new Date(maxDate); - minDate = new Date(minDate); - - // 計算時間差距 - let timeDiff = maxDate - minDate; - - // 計算相差的月份 - let diffMonths = (maxDate.getFullYear() - minDate.getFullYear()) * 12; - diffMonths -= minDate.getMonth(); - diffMonths += maxDate.getMonth(); - - // 計算相差的日期,要取整數才能接續下方的邏輯判斷 `diffDays > 0` - // 秒 * 分鐘 * 小時 = 一天的時間量 - const diffDays = Math.floor(timeDiff / ( 60 * 60 * 24)); - - // 計算相差的小時、分鐘、秒 - const diffHours = Math.floor(timeDiff / (60 * 60)); - const diffMinutes = Math.floor(timeDiff / 60); - - // 顯示結果 - if (diffMonths > 1) { - return moment(date).format('YYYY/MM/DD'); - } - else if (diffDays > 1) { - return moment(date).format('YYYY/MM/DD'); - } - else if (diffHours > 1) { - return moment(date).format('MM/DD hh:00'); - } - else if (diffMinutes > 1) { - return moment(date).format('MM/DD hh:mm'); - } - else { - return moment(date).format('hh:mm:ss'); - } -} - /** * Select an appropriate time format based on the time difference. * 根據時間差距選擇適合的時間格式 diff --git a/src/stores/conformanceInput.js b/src/stores/conformanceInput.js index 3b23e3a..c1cdf0d 100644 --- a/src/stores/conformanceInput.js +++ b/src/stores/conformanceInput.js @@ -43,27 +43,5 @@ export default defineStore('conformanceInputStore', { break; } }, - /** - * UNUSED - * Temporarily set conformance input data which is probably fed to backend later. - * @param {object} userInputObj - */ - setConformanceUserInput(userInputObj){ - this.inputDataToSave = {...userInputObj}; - }, - /** UNUSED - * Set the starting time of time range to be saved later - * @param {string} startStr - */ - setConformanceInputStart(startStr){ - this.inputDataToSave.inputStart = moment(startStr).format('YYYY-MM-DDTHH:mm:ss'); - }, - /** UNUSED - * Set the ending time of time range to be saved later - * @param {string} startStr - */ - setConformanceInputEnd(endStr){ - this.inputDataToSave.inputEnd = moment(endStr).format('YYYY-MM-DDTHH:mm:ss'); - }, }, }) \ No newline at end of file diff --git a/src/stores/files.js b/src/stores/files.js index 20df087..09b8c02 100644 --- a/src/stores/files.js +++ b/src/stores/files.js @@ -286,7 +286,6 @@ export default defineStore('filesStore', { } }, /** - * It seems that this function is unused * Remove a Deletion Record,真刪除被 Admin 或被其他帳號刪除的檔案 * @param {number} id 檔案 ID */ diff --git a/src/stores/mapPathStore.ts b/src/stores/mapPathStore.ts index 915af95..9671f66 100644 --- a/src/stores/mapPathStore.ts +++ b/src/stores/mapPathStore.ts @@ -223,19 +223,7 @@ export default defineStore('useMapPathStore', { nodeToHighlight.data('nodeImageUrl', ImgCapsulesGlow[nodeToHighlight.data('level')]); }); }, - highlightClickedPathUnused(clickedActiveTraceIndex: number, clickedPathListIndex: number) { - this.activeTrace = clickedActiveTraceIndex; - this.activeListIndex = clickedPathListIndex; - this.mapGraphPathToInsight[clickedActiveTraceIndex][clickedPathListIndex].pathByEdge - .forEach(pathToHighlight => { - pathToHighlight.addClass('highlight-edge'); - }); - this.mapGraphPathToInsight[clickedActiveTraceIndex][clickedPathListIndex].pathByNode - .forEach(nodeToHighlight => { - nodeToHighlight.data('nodeImageUrl', ImgCapsulesGlow[nodeToHighlight.data('level')]); - }) - }, - clearAllHighlight() { +clearAllHighlight() { this.cytoscape[this.processOrBPMN][this.curveType][this.directionType]?.edges().removeClass('highlight-edge'); this.cytoscape[this.processOrBPMN][this.curveType][this.directionType]?.nodes().removeClass('highlight-node'); this.cytoscape[this.processOrBPMN][this.curveType][this.directionType]?.nodes().forEach(nodeToReset => { @@ -272,28 +260,7 @@ export default defineStore('useMapPathStore', { this.insightWithPath['most_freq_traces'][LIST_INDEX].edges.forEach(edgeToHighlight => edgeToHighlight.addClass('highlight-edge')); }, - async highlightMostFrequentPathUnused() { - for (let buttonIter = 0; buttonIter < INSIGHTS_FIELDS_AND_LABELS.length; buttonIter++) { - // 有可能遇到兩個以上的most frequent paths,然而我們只取一個path點亮 - if (this.mapGraphPathToInsight[buttonIter]) { - const keyLength = Object.keys(this.mapGraphPathToInsight[buttonIter]).length; - for (let i = 0; i < keyLength; i++) { - if (this.mapGraphPathToInsight[buttonIter][i]?.pathType === 'most_freq_traces') { - await this.mapGraphPathToInsight[buttonIter][i].pathByNode.map(async (nodeToHighlight) => { - await nodeToHighlight.data('nodeImageUrl', ImgCapsulesGlow[nodeToHighlight.data('level')]); - }); - await this.mapGraphPathToInsight[buttonIter][i].pathByEdge.map( - async (edgeToHighlight) => { - await edgeToHighlight.addClass('highlight-edge'); - }); - return; // 之所以要此時就立刻return是因為要避免第二個以上的most freq path也被點亮 - } - break; - } - } - } - }, - setIsBPMNOn(isOn: boolean) { +setIsBPMNOn(isOn: boolean) { this.isBPMNOn = isOn; }, }, diff --git a/src/views/Files/Files.vue b/src/views/Files/Files.vue index 0586e89..4756d57 100644 --- a/src/views/Files/Files.vue +++ b/src/views/Files/Files.vue @@ -363,7 +363,7 @@ reallyDeleteData: { handler(newValue, oldValue) { if(newValue.length !== 0 && oldValue.length === 0){ - this.showReallyDeldet(); + this.showReallyDelete(); } }, immediate: true @@ -506,10 +506,9 @@ srt = ''; }, /** - * It seems that this function is unused * 顯示被 Admin 或被其他帳號刪除的檔案 */ - showReallyDeldet(){ + showReallyDelete(){ let srt = ''; if(this.reallyDeleteData.length !== 0) {