docs: Update all files JSDoc.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 將數字轉換成簡寫的形式,設定 dhms 的數值
|
||||
* @param {number} totalSeconds
|
||||
* @param {number} totalSeconds 總秒數
|
||||
* @returns {string}
|
||||
*/
|
||||
export default function abbreviateNumber(totalSeconds) {
|
||||
|
||||
@@ -16,7 +16,7 @@ const customClass = {
|
||||
};
|
||||
/**
|
||||
* Map Saved
|
||||
* @param { function } addFilterId
|
||||
* @param { function } addFilterId 後端 API
|
||||
*/
|
||||
export async function saveFilter(addFilterId) {
|
||||
let fileName = '';
|
||||
@@ -55,7 +55,7 @@ export async function saveFilter(addFilterId) {
|
||||
}
|
||||
/**
|
||||
* Saved Success
|
||||
* @param { string } value
|
||||
* @param { string } value File's name
|
||||
*/
|
||||
export async function savedSuccessfully(value) {
|
||||
value = value ? value : '';
|
||||
@@ -71,10 +71,10 @@ export async function savedSuccessfully(value) {
|
||||
};
|
||||
/**
|
||||
* leave Map page
|
||||
* @param { function } next
|
||||
* @param { function } addFilterId
|
||||
* @param { string } toPath
|
||||
* @param { function } logOut
|
||||
* @param { function } next 執行完函式後的步驟
|
||||
* @param { function } addFilterId 後端 API
|
||||
* @param { string } toPath route path
|
||||
* @param { function } logOut 登出函式
|
||||
*/
|
||||
export async function leaveFilter(next, addFilterId, toPath, logOut) {
|
||||
const allMapDataStore = AllMapDataStore();
|
||||
@@ -108,7 +108,7 @@ export async function leaveFilter(next, addFilterId, toPath, logOut) {
|
||||
};
|
||||
/**
|
||||
* Conformance Saved
|
||||
* @param { function } addConformanceCreateCheckId
|
||||
* @param { function } addConformanceCreateCheckId 後端 API
|
||||
*/
|
||||
export async function saveConformance(addConformanceCreateCheckId) {
|
||||
let fileName = '';
|
||||
@@ -147,10 +147,10 @@ export async function saveConformance(addConformanceCreateCheckId) {
|
||||
}
|
||||
/**
|
||||
* leave Conformance page
|
||||
* @param { function } next
|
||||
* @param { function } addConformanceCreateCheckId
|
||||
* @param { string } toPath
|
||||
* @param { function } logOut
|
||||
* @param { function } next 執行完函式後的步驟
|
||||
* @param { function } addConformanceCreateCheckId 後端 API
|
||||
* @param { string } toPath route path
|
||||
* @param { function } logOut 登出函式
|
||||
*/
|
||||
export async function leaveConformance(next, addConformanceCreateCheckId, toPath, logOut) {
|
||||
const conformanceStore = ConformanceStore();
|
||||
@@ -184,8 +184,8 @@ export async function leaveConformance(next, addConformanceCreateCheckId, toPath
|
||||
};
|
||||
/**
|
||||
* Upload failde First
|
||||
* @param { string } failureType
|
||||
* @param { string } failureMsg
|
||||
* @param { string } failureType 後端檔案錯誤類型
|
||||
* @param { string } failureMsg 後端檔案錯誤訊息
|
||||
*/
|
||||
export async function uploadFailedFirst(failureType, failureMsg, failureLoc) {
|
||||
// msg: 'not in UTF-8' | 'insufficient columns' | 'the csv file is empty' | 'the filename does not ends with .csv' | 'not a CSV file'
|
||||
@@ -224,7 +224,7 @@ export async function uploadFailedFirst(failureType, failureMsg, failureLoc) {
|
||||
};
|
||||
/**
|
||||
* Upload failde Second
|
||||
* @param { array } detail
|
||||
* @param { array } detail 後端回傳的失敗訊息
|
||||
*/
|
||||
export async function uploadFailedSecond(detail) {
|
||||
let srt = '';
|
||||
@@ -284,7 +284,7 @@ export async function uploadFailedSecond(detail) {
|
||||
};
|
||||
/**
|
||||
* Upload Success
|
||||
* @param { string } value
|
||||
* @param { string } value File's name
|
||||
*/
|
||||
export async function uploadSuccess() {
|
||||
await Swal.fire({
|
||||
@@ -298,7 +298,7 @@ export async function uploadSuccess() {
|
||||
};
|
||||
/**
|
||||
* Confirm whether to upload the file
|
||||
* @param { object } fetchData
|
||||
* @param { object } fetchData 後端 API POST data
|
||||
*/
|
||||
export async function uploadConfirm(fetchData) {
|
||||
const filesStore = FilesStore();
|
||||
@@ -333,10 +333,10 @@ export async function uploadloader() {
|
||||
};
|
||||
/**
|
||||
* Rename Modal
|
||||
* @param { function } rename
|
||||
* @param { string } type
|
||||
* @param { number } id
|
||||
* @param { string } baseName
|
||||
* @param { function } rename 後端 API
|
||||
* @param { string } type File 檔案類型
|
||||
* @param { number } id File ID
|
||||
* @param { string } baseName 改名前的檔名
|
||||
*/
|
||||
export async function renameModal(rename, type, id, baseName) {
|
||||
let fileName = baseName;
|
||||
@@ -379,8 +379,8 @@ export async function renameModal(rename, type, id, baseName) {
|
||||
/**
|
||||
* Delete File
|
||||
* @param { string } files 有關連的檔案
|
||||
* @param { string } type
|
||||
* @param { number } id
|
||||
* @param { string } type File 檔案類型
|
||||
* @param { number } id File ID
|
||||
* @param { string } name 原本的檔案
|
||||
*/
|
||||
export async function deleteFileModal(files, type, id, name) {
|
||||
|
||||
@@ -12,8 +12,8 @@ const delay = (s = 0) => new Promise((resolve, reject) => setTimeout(resolve, s
|
||||
|
||||
/**
|
||||
* API catch error function
|
||||
* @param {object} Error
|
||||
* @param {string} toastMessage
|
||||
* @param {object} Error 後端 ERROR
|
||||
* @param {string} toastMessage Toast 的提示文字
|
||||
* @returns {string} Error HTTP Status
|
||||
*/
|
||||
export default async function apiError(error, toastMessage) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { getTimeLabel } from '@/module/timeLabel.js'; // 時間格式轉換器
|
||||
cytoscape.use( dagre );
|
||||
|
||||
/**
|
||||
* @param {object} mapData processMapData | bpmnData
|
||||
* @param {object} mapData processMapData | bpmnData,可選以上任一。
|
||||
* mapData:{
|
||||
* startId: 0,
|
||||
* endId: 1,
|
||||
|
||||
@@ -18,7 +18,7 @@ cytoscape.use( dagre );
|
||||
* width: number
|
||||
* }
|
||||
* @param {array} edges it's similar to nodes
|
||||
* @param {string} graphId
|
||||
* @param {string} graphId graph Id
|
||||
*/
|
||||
export default function cytoscapeMapTrace(nodes, edges, graphId) {
|
||||
// create Cytoscape
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 將數字轉換成帶有逗號格式(ex: 1000 -> 1,000)
|
||||
* 也可以改用原生 JS 方法 `.toLocaleString('en-US')`
|
||||
* @param {number} num
|
||||
* @param {number} num 數字
|
||||
* @returns
|
||||
*/
|
||||
export default function numberLabel(num) {
|
||||
|
||||
@@ -153,8 +153,8 @@ export function getXIndex(data, xValue) {
|
||||
return closestIndex;
|
||||
};
|
||||
/**
|
||||
*
|
||||
* @param {number} seconds
|
||||
* 有 dhms 表達的時間單位
|
||||
* @param {number} seconds 總秒數
|
||||
* @returns {string}
|
||||
*/
|
||||
export function formatTime(seconds) {
|
||||
@@ -180,8 +180,8 @@ export function formatTime(seconds) {
|
||||
} else return null;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {array} times
|
||||
* 只顯示最大的兩個單位
|
||||
* @param {array} times 時間
|
||||
* @returns {array}
|
||||
*/
|
||||
export function formatMaxTwo(times) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 數量單位轉換,輸出 k m b t 數值。
|
||||
* @param {number} number
|
||||
* @param {number} number 總秒數
|
||||
* @returns {string}
|
||||
*/
|
||||
export default function shortScaleNumber(number) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 數字、英文、中文,排序
|
||||
* @param {array} data
|
||||
* @param {array} data List
|
||||
* @returns
|
||||
*/
|
||||
export function sortNumEngZhtw(data) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import moment from 'moment';
|
||||
|
||||
/**
|
||||
* 將秒數轉換成帶有時間單位的格式
|
||||
* @param {number} second
|
||||
* @param {number} second 總秒數
|
||||
* @param {number} fixedNumber 小數點後幾位
|
||||
* @returns {string} 轉換完的格式(ex: 1 day, 6.8 hrs)
|
||||
*/
|
||||
@@ -30,7 +30,7 @@ export function getTimeLabel(second, fixedNumber = 0) {
|
||||
}
|
||||
/**
|
||||
* 將秒數轉換成帶有縮寫時間單位的格式
|
||||
* @param {number} second
|
||||
* @param {number} second 總秒數
|
||||
* @param {number} fixedNumber 小數點後幾位
|
||||
* @returns {string} 轉換完的格式(ex: 1 d, 6.8 h)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user