fix(query-tool): export all selected CIDs instead of single, fix hold detail float precision
Export was sending only one container_id while the detail table loaded data for all selected CIDs (including subtree), causing "查無資料" errors. Now sends container_ids array and uses batch service functions. Also rounds hold detail age KPI cards to 1 decimal place. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,8 @@ function formatAge(value) {
|
||||
if (value === null || value === undefined || value === '-') {
|
||||
return '-';
|
||||
}
|
||||
return `${value}天`;
|
||||
const num = Number(value);
|
||||
return `${Number.isFinite(num) ? num.toFixed(1) : value}天`;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -378,9 +378,9 @@ export function useLotDetail(initial = {}) {
|
||||
async function exportSubTab(tab) {
|
||||
const normalized = normalizeSubTab(tab);
|
||||
const exportType = EXPORT_TYPE_MAP[normalized];
|
||||
const containerId = selectedContainerId.value;
|
||||
const cids = getActiveCids();
|
||||
|
||||
if (!exportType || !containerId) {
|
||||
if (!exportType || cids.length === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ export function useLotDetail(initial = {}) {
|
||||
|
||||
try {
|
||||
const params = {
|
||||
container_id: containerId,
|
||||
container_ids: cids,
|
||||
};
|
||||
|
||||
if (normalized === 'jobs') {
|
||||
|
||||
Reference in New Issue
Block a user