19 lines
723 B
TypeScript
19 lines
723 B
TypeScript
/**
|
|
* collectdata 下载判定(Task 146)。
|
|
*
|
|
* collectdata 后端 history VO 不返回 file 阶段字段;前端下载判定自洽:
|
|
* success=true 且 downloadUrl 非空才可下载(任务成功且有结果文件)。
|
|
*/
|
|
export interface CollectDataItem {
|
|
success?: boolean | null
|
|
downloadUrl?: string | null
|
|
taskStatus?: string | null
|
|
}
|
|
|
|
/** collectdata 可下载判定:success + downloadUrl(任务成功且有结果文件,空白 URL 无效)。 */
|
|
export function canDownloadCollectDataItem(item: CollectDataItem | null | undefined): boolean {
|
|
if (!item) return false
|
|
const url = typeof item.downloadUrl === 'string' ? item.downloadUrl.trim() : ''
|
|
return Boolean(item.success && url)
|
|
}
|