From 90b3b6329fec3205b845198ca6dc539dcde186c8 Mon Sep 17 00:00:00 2001 From: hongjli <3117313295@qq.com> Date: 星期一, 16 六月 2025 17:12:20 +0800 Subject: [PATCH] 页面调整优化 --- src/app/supply-chain-chat/page.tsx | 57 +++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 37 insertions(+), 20 deletions(-) diff --git a/src/app/supply-chain-chat/page.tsx b/src/app/supply-chain-chat/page.tsx index 5b1a046..c9ee867 100644 --- a/src/app/supply-chain-chat/page.tsx +++ b/src/app/supply-chain-chat/page.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useState, useEffect, useRef, useCallback, useContext, createContext } from 'react'; +import { useState, useEffect, useRef, useCallback, useContext, createContext, Suspense } from 'react'; import Link from 'next/link'; import { useRouter, useSearchParams } from 'next/navigation'; import Image from 'next/image'; @@ -83,7 +83,7 @@ 鎻愪緵鎴愭湰鐩稿叧鏁版嵁锛岃幏鍙栨垚鏈紭鍖栧缓璁拰璐㈠姟褰卞搷璇勪及銆� 绯荤粺灏嗗熀浜庡疄鏃舵暟鎹拰AI绠楁硶锛屼负鎮ㄦ彁渚涗笓涓氱殑鍒嗘瀽鎶ュ憡鍜屽喅绛栧缓璁�俙, - dataDescription: '鏈満鏅暣鍚堜簡OMS銆丒RP銆乄MS绛夊涓郴缁熺殑瀹炴椂鏁版嵁锛岄�氳繃AI绠楁硶杩涜娣卞害鍒嗘瀽銆備互涓嬩负鏂拌兘婧愯涓氱殑妯℃嫙鏁版嵁锛屽疄闄呭簲鐢ㄤ腑灏嗚嚜鍔ㄥ鎺ヤ紒涓氱幇鏈夌郴缁熴��', + dataDescription: '鏈満鏅暣鍚堜簡OMS銆乄MS绛夊涓郴缁熺殑瀹炴椂鏁版嵁锛岄�氳繃AI绠楁硶杩涜娣卞害鍒嗘瀽銆備互涓嬩负鏂拌兘婧愯涓氱殑妯℃嫙鏁版嵁锛屽疄闄呭簲鐢ㄤ腑灏嗚嚜鍔ㄥ鎺ヤ紒涓氱幇鏈夌郴缁熴��', exampleData: ` ### 璁㈠崟闇�姹傛暟鎹� (OMS绯荤粺) @@ -93,15 +93,6 @@ | SO20250201002 | NEV-Motor-B | 200 | 钄氭潵姹借溅 | 2025-02-20 | 涓� | 1,800,000 | | SO20250201003 | NEV-Controller-C | 300 | 鐞嗘兂姹借溅 | 2025-02-25 | 楂� | 3,200,000 | | SO20250201004 | NEV-Charger-D | 150 | 灏忛箯姹借溅 | 2025-03-01 | 涓� | 1,200,000 | - -### 鐢熶骇宸ュ崟鏁版嵁 (ERP绯荤粺) - -| 宸ュ崟鍙� | 浜у搧鍨嬪彿 | 璁″垝鏁伴噺 | 宸插畬鎴愭暟閲� | 鐢熶骇鐘舵�� | 棰勮瀹屾垚鏃堕棿 | 鐢熶骇绾� | -| :--: | :--: | :--: | :--: | :--: | :--: | :--: | -| WO20250201001 | NEV-Battery-A | 600 | 350 | 杩涜涓� | 2025-02-12 | 浜х嚎1 | -| WO20250201002 | NEV-Motor-B | 250 | 180 | 杩涜涓� | 2025-02-18 | 浜х嚎2 | -| WO20250201003 | NEV-Controller-C | 200 | 50 | 璁″垝涓� | 2025-02-22 | 浜х嚎3 | -| WO20250201004 | NEV-Charger-D | 100 | 0 | 寰呮帓浜� | 2025-02-28 | 浜х嚎4 | ### 搴撳瓨鏁版嵁 (WMS绯荤粺) @@ -121,14 +112,23 @@ | 鍦板钩绾� | 鎺у埗鑺墖 | 92% | 99.8% | 涓� | 浣� | | 鐗规潵鐢� | 鍏呯數妯″潡 | 85% | 97.5% | 楂� | 涓� | -### 浜ц兘鏁版嵁 +### 鐢熶骇璁″垝鏁版嵁 -| 鐢熶骇绾� | 鏃ヤ骇鑳� | 褰撳墠鍒╃敤鐜� | 鐡堕宸ュ簭 | 鍙皟閰嶄骇鑳� | 缁存姢璁″垝 | +| 璁″垝鍗旾D | 璁″垝鍗曞彿 | 鏂欏彿 | 璁″垝鏁伴噺 | 璁″垝寮�濮嬫棩鏈� | 璁″垝缁撴潫鏃ユ湡 | | :--: | :--: | :--: | :--: | :--: | :--: | -| 浜х嚎1 | 50鍙� | 85% | 缁勮 | 10鍙� | 2025-02-20 | -| 浜х嚎2 | 30鍙� | 75% | 娴嬭瘯 | 8鍙� | 2025-02-25 | -| 浜х嚎3 | 40鍙� | 60% | 鐒婃帴 | 15鍙� | 2025-03-01 | -| 浜х嚎4 | 25鍙� | 45% | 鍖呰 | 12鍙� | 2025-03-05 | +| PP001 | PLAN20250201001 | TX-001 | 1000.00 | 2025-02-01 | 2025-02-15 | +| PP002 | PLAN20250201002 | TX-002 | 500.00 | 2025-02-05 | 2025-02-20 | +| PP003 | PLAN20250201003 | TX-003 | 750.00 | 2025-02-10 | 2025-02-25 | +| PP004 | PLAN20250201004 | TX-004 | 300.00 | 2025-02-15 | 2025-03-01 | + +### 鐗╂枡涓绘暟鎹� + +| 宸ュ巶浠g爜 | 鏂欏彿 | 鐗╂枡鎻忚堪 | 鐗╂枡鐘舵�� | 鐗╂枡妯″瀷 | 涓撲笟褰掑睘鍥惧彿 | 鐗堟湰 | 榛樿鐢熶骇杞﹂棿 | 鏄惁鍏抽敭鐗╂枡 | 鏄惁鑷埗 | 闆嗘垚鏃ユ湡 | 鐢熸晥鏃ユ湡 | 澶辨晥鏃ユ湡 | +| :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | +| PLANT001 | TX-001 | 鍙橀�熺澹充綋 | Active | 鏍囧噯浠� | 鏈烘 | v1.0 | 杞﹂棿A | 1 | 1 | 2025-01-01 00:00:00 | 2025-01-01 | 2025-12-31 | +| PLANT001 | TX-002 | 鐢垫満瀹氬瓙 | Active | 瀹氬埗浠� | 鐢垫皵 | v2.0 | 杞﹂棿B | 1 | 0 | 2025-01-02 00:00:00 | 2025-01-02 | 2025-12-31 | +| PLANT002 | TX-003 | 鎺у埗鑺墖 | Active | 鏍囧噯浠� | 鐢靛瓙 | v1.5 | 杞﹂棿C | 0 | 0 | 2025-01-03 00:00:00 | 2025-01-03 | 2025-12-31 | +| PLANT002 | TX-004 | 鍏呯數妯″潡 | Active | 瀹氬埗浠� | 鐢垫皵 | v2.5 | 杞﹂棿D | 1 | 1 | 2025-01-04 00:00:00 | 2025-01-04 | 2025-12-31 | ` }; @@ -492,7 +492,8 @@ ); } -export default function SupplyChainChatPage() { +// 鍒涘缓涓�涓嫭绔嬬殑缁勪欢鏉ュ鐞唘seSearchParams +function SupplyChainChatContent() { const router = useRouter(); const searchParams = useSearchParams(); const [apiKey, setApiKey] = useState<string>(''); @@ -1155,12 +1156,12 @@ <div className="flex flex-col items-center justify-center h-[400px] text-center"> <div className="w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4"> <svg xmlns="http://www.w3.org/2000/svg" className="h-8 w-8 text-blue-600" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2-2V7a2 2 0 012-2h2a2 2 0 002-2V3a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 002 2h2a2 2 0 012 2v2a2 2 0 00-2 2h-2a2 2 0 00-2 2v6a2 2 0 01-2 2h-2a2 2 0 01-2-2z" /> + <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2-2V7a2 2 0 012-2h2a2 2 0 002-2h2a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 002 2h2a2 2 0 012 2v2a2 2 0 00-2 2h-2a2 2 0 00-2 2v6a2 2 0 01-2 2h-2a2 2 0 01-2-2z" /> </svg> </div> <h3 className="text-lg font-medium text-gray-900 mb-2">渚涘簲閾惧叏鏅礊瀵�</h3> <p className="text-gray-500 max-w-md"> - 娆㈣繋浣跨敤渚涘簲閾惧叏鏅礊瀵熺郴缁燂紒鎮ㄥ彲浠ュ挩璇㈡彃鍗曞奖鍝嶅垎鏋愩�佺敓浜ц鍒掍紭鍖栥�佷緵搴旈摼椋庨櫓璇勪及绛夐棶棰樸�� + 娆㈣繋浣跨敤渚涘簲閾惧叏鏅礊瀵熺郴缁燂紒鎮ㄥ彲浠ュ挩璇㈢敓浜ц鍒掍笌浜ц兘褰卞搷銆佷緵搴斿崗鍚岃兘鍔涖�佷氦浠樺饱绾﹂闄┿�佹垚鏈笌璐㈠姟褰卞搷銆佷緵搴旈摼鏁版嵁鏌ヨ銆佷緵搴旈摼鐭ヨ瘑鍜ㄨ绛夐棶棰樸�� </p> </div> ) : ( @@ -1410,4 +1411,20 @@ /> </div> ); +} + +// 涓诲鍑虹粍浠讹紝浣跨敤Suspense鍖呰鍘熸湁缁勪欢 +export default function SupplyChainChatPage() { + return ( + <Suspense fallback={ + <div className="min-h-screen bg-gradient-to-b from-gray-50 to-white flex items-center justify-center"> + <div className="text-center"> + <div className="w-8 h-8 border-4 border-blue-600 border-t-transparent rounded-full animate-spin mx-auto mb-4"></div> + <p className="text-gray-600">姝e湪鍔犺浇...</p> + </div> + </div> + }> + <SupplyChainChatContent /> + </Suspense> + ); } \ No newline at end of file -- Gitblit v1.9.3