Remove dead code and incorrect unused comments
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -99,18 +99,6 @@ export function getTimeLabel(second, fixedNumber = 0) {
|
|||||||
return second + " sec";
|
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 總秒數
|
* @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.
|
* Select an appropriate time format based on the time difference.
|
||||||
* 根據時間差距選擇適合的時間格式
|
* 根據時間差距選擇適合的時間格式
|
||||||
|
|||||||
@@ -43,27 +43,5 @@ export default defineStore('conformanceInputStore', {
|
|||||||
break;
|
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');
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -286,7 +286,6 @@ export default defineStore('filesStore', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* It seems that this function is unused
|
|
||||||
* Remove a Deletion Record,真刪除被 Admin 或被其他帳號刪除的檔案
|
* Remove a Deletion Record,真刪除被 Admin 或被其他帳號刪除的檔案
|
||||||
* @param {number} id 檔案 ID
|
* @param {number} id 檔案 ID
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -223,19 +223,7 @@ export default defineStore('useMapPathStore', {
|
|||||||
nodeToHighlight.data('nodeImageUrl', ImgCapsulesGlow[nodeToHighlight.data('level')]);
|
nodeToHighlight.data('nodeImageUrl', ImgCapsulesGlow[nodeToHighlight.data('level')]);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
highlightClickedPathUnused(clickedActiveTraceIndex: number, clickedPathListIndex: number) {
|
clearAllHighlight() {
|
||||||
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() {
|
|
||||||
this.cytoscape[this.processOrBPMN][this.curveType][this.directionType]?.edges().removeClass('highlight-edge');
|
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().removeClass('highlight-node');
|
||||||
this.cytoscape[this.processOrBPMN][this.curveType][this.directionType]?.nodes().forEach(nodeToReset => {
|
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 =>
|
this.insightWithPath['most_freq_traces'][LIST_INDEX].edges.forEach(edgeToHighlight =>
|
||||||
edgeToHighlight.addClass('highlight-edge'));
|
edgeToHighlight.addClass('highlight-edge'));
|
||||||
},
|
},
|
||||||
async highlightMostFrequentPathUnused() {
|
setIsBPMNOn(isOn: boolean) {
|
||||||
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) {
|
|
||||||
this.isBPMNOn = isOn;
|
this.isBPMNOn = isOn;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -363,7 +363,7 @@
|
|||||||
reallyDeleteData: {
|
reallyDeleteData: {
|
||||||
handler(newValue, oldValue) {
|
handler(newValue, oldValue) {
|
||||||
if(newValue.length !== 0 && oldValue.length === 0){
|
if(newValue.length !== 0 && oldValue.length === 0){
|
||||||
this.showReallyDeldet();
|
this.showReallyDelete();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
immediate: true
|
immediate: true
|
||||||
@@ -506,10 +506,9 @@
|
|||||||
srt = '';
|
srt = '';
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* It seems that this function is unused
|
|
||||||
* 顯示被 Admin 或被其他帳號刪除的檔案
|
* 顯示被 Admin 或被其他帳號刪除的檔案
|
||||||
*/
|
*/
|
||||||
showReallyDeldet(){
|
showReallyDelete(){
|
||||||
let srt = '';
|
let srt = '';
|
||||||
|
|
||||||
if(this.reallyDeleteData.length !== 0) {
|
if(this.reallyDeleteData.length !== 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user