diff --git a/static/vue-app.js b/static/vue-app.js index 41c3a15..5515709 100644 --- a/static/vue-app.js +++ b/static/vue-app.js @@ -389,7 +389,7 @@ const HomeView = { const loadStats = async () => { try { const [inventoryStats, health] = await Promise.all([ - apiRequest('/api/inventory/dashboard').catch(() => null), + apiRequest('/api/dashboard').catch(() => null), apiRequest('/health').catch(() => null) ]); state.stats = { inventory: inventoryStats, health }; @@ -419,8 +419,7 @@ const HomeView = {
-

正在加载任务数据...

-

DEBUG: {{ route.params.taskId }}

+

正在加载数据...

@@ -911,6 +910,11 @@ const MoldInsightView = { loadHistory(); }); + const isFoamMaterial = (material) => { + const foamMaterials = ['AlSi10Mg', 'AlSi12', 'Pure Al Foam', 'AlSi7Mg']; + return foamMaterials.includes(material); + }; + return { state, handleFileChange, @@ -920,7 +924,8 @@ const MoldInsightView = { formatDateTime, formatNumber, toggleFileHistory, - viewResult + viewResult, + isFoamMaterial }; }, template: ` @@ -1181,14 +1186,6 @@ const ResultView = {

分析结果

- -
-

DEBUG: ResultView

-

taskId: {{ route.params.taskId }}

-

loading: {{ state.loading }}

-

task: {{ state.task ? 'exists' : 'null' }}

-

error: {{ state.error }}

-
加载中... @@ -1488,7 +1485,7 @@ const InventoryView = { const loadDashboard = async () => { state.loading = true; try { - state.dashboard = await apiRequest('/api/inventory/dashboard'); + state.dashboard = await apiRequest('/api/dashboard'); } catch (e) { handleApiError(e, '加载仪表盘'); } finally { @@ -1499,7 +1496,7 @@ const InventoryView = { const loadProducts = async () => { state.loading = true; try { - state.products = await apiRequest('/api/inventory/products'); + state.products = await apiRequest('/api/products'); } catch (e) { handleApiError(e, '加载产品'); } finally { @@ -1510,7 +1507,7 @@ const InventoryView = { const loadSuppliers = async () => { state.loading = true; try { - state.suppliers = await apiRequest('/api/inventory/suppliers'); + state.suppliers = await apiRequest('/api/suppliers'); } catch (e) { handleApiError(e, '加载供应商'); } finally { @@ -1521,7 +1518,7 @@ const InventoryView = { const loadCustomers = async () => { state.loading = true; try { - state.customers = await apiRequest('/api/inventory/customers'); + state.customers = await apiRequest('/api/customers'); } catch (e) { handleApiError(e, '加载客户'); } finally { @@ -1532,7 +1529,7 @@ const InventoryView = { const loadInventory = async () => { state.loading = true; try { - state.inventory = await apiRequest('/api/inventory/inventory'); + state.inventory = await apiRequest('/api/inventory'); } catch (e) { handleApiError(e, '加载库存'); } finally { @@ -1543,7 +1540,7 @@ const InventoryView = { const loadMovements = async () => { state.loading = true; try { - state.movements = await apiRequest('/api/inventory/stock-movements'); + state.movements = await apiRequest('/api/stock-movements'); } catch (e) { handleApiError(e, '加载变动记录'); } finally {