From e435f2ebd11633c555a8b49fc54d3c7a4e0ff0ba Mon Sep 17 00:00:00 2001
From: hongjli <3117313295@qq.com>
Date: 星期一, 16 六月 2025 16:59:43 +0800
Subject: [PATCH] 页面调整优化
---
src/components/DataPreviewDialog.tsx | 161 ++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 115 insertions(+), 46 deletions(-)
diff --git a/src/components/DataPreviewDialog.tsx b/src/components/DataPreviewDialog.tsx
index dff187d..a1145df 100644
--- a/src/components/DataPreviewDialog.tsx
+++ b/src/components/DataPreviewDialog.tsx
@@ -10,7 +10,7 @@
isOpen: boolean;
onClose: () => void;
markdownContent: string;
- sceneType?: 'chadan' | 'buliao'; // 娣诲姞鍦烘櫙绫诲瀷灞炴��
+ sceneType?: 'chadan' | 'buliao' | 'panorama'; // 娣诲姞鍦烘櫙绫诲瀷灞炴��
}
export default function DataPreviewDialog({
@@ -62,7 +62,7 @@
<div className="flex items-center gap-3 mb-3">
<div className="h-8 w-8 rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center">
<svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" />
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2M7 7h10" />
</svg>
</div>
<h4 className="text-lg font-semibold text-blue-900">宸ヤ綅淇℃伅</h4>
@@ -79,10 +79,10 @@
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
</svg>
</div>
- <h4 className="text-lg font-semibold text-blue-900">浜х嚎鐜板満搴撳瓨閲�</h4>
+ <h4 className="text-lg font-semibold text-blue-900">鐢熶骇璁″垝鏁版嵁 (production_plan)</h4>
</div>
<div className="ml-11">
- <p className="text-blue-800">鏍稿績鏉ユ簮绯荤粺锛歁ES銆乄MS锛堢嚎杈逛粨锛�</p>
+ <p className="text-blue-800">鏍稿績鏉ユ簮绯荤粺锛歋AP锛堜紒涓氱鐞嗙郴缁燂級</p>
</div>
</div>
@@ -97,6 +97,116 @@
</div>
<div className="ml-11">
<p className="text-blue-800">鏍稿績鏉ユ簮绯荤粺锛欵RP銆乄MS</p>
+ </div>
+ </div>
+
+ <div className="bg-white/50 rounded-lg p-4 backdrop-blur-sm border border-blue-100/50">
+ <div className="flex items-center gap-3 mb-3">
+ <div className="h-8 w-8 rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center">
+ <svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 7v10c0 2 1 3 3 3h10c2 0 3-1 3-3V7c0-2-1-3-3-3H7C5 4 4 5 4 7z" />
+ </svg>
+ </div>
+ <h4 className="text-lg font-semibold text-blue-900">鐗╂枡涓绘暟鎹�</h4>
+ </div>
+ <div className="ml-11">
+ <p className="text-blue-800">鏍稿績鏉ユ簮绯荤粺锛歋AP锛堜紒涓氱鐞嗙郴缁燂級</p>
+ </div>
+ </div>
+ </div>
+ );
+ } else if (sceneType === 'panorama') {
+ return (
+ <div className="flex flex-col h-full">
+ {/* 鍗$墖璇存槑鍖哄潡锛岄《閮ㄥ浐瀹� */}
+ <div className="space-y-4 flex-shrink-0">
+ {/* 璁㈠崟闇�姹傛暟鎹� */}
+ <div className="bg-white/50 rounded-lg p-4 backdrop-blur-sm border border-blue-100/50">
+ <div className="flex items-center gap-3 mb-2">
+ <div className="h-8 w-8 rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center">
+ <svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" />
+ </svg>
+ </div>
+ <h4 className="text-lg font-semibold text-blue-900">璁㈠崟闇�姹傛暟鎹�</h4>
+ </div>
+ <div className="ml-11">
+ <p className="text-blue-800">鏍稿績鏉ユ簮绯荤粺锛歄MS锛堣鍗曠鐞嗙郴缁燂級</p>
+ </div>
+ </div>
+ {/* 搴撳瓨鏁版嵁 */}
+ <div className="bg-white/50 rounded-lg p-4 backdrop-blur-sm border border-blue-100/50">
+ <div className="flex items-center gap-3 mb-2">
+ <div className="h-8 w-8 rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center">
+ <svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 7v10c0 2 1 3 3 3h10c2 0 3-1 3-3V7c0-2-1-3-3-3H7C5 4 4 5 4 7z" />
+ </svg>
+ </div>
+ <h4 className="text-lg font-semibold text-blue-900">搴撳瓨鏁版嵁</h4>
+ </div>
+ <div className="ml-11">
+ <p className="text-blue-800">鏍稿績鏉ユ簮绯荤粺锛歐MS锛堜粨鍌ㄧ鐞嗙郴缁燂級</p>
+ </div>
+ </div>
+ {/* 鐢熶骇璁″垝鏁版嵁 */}
+ <div className="bg-white/50 rounded-lg p-4 backdrop-blur-sm border border-blue-100/50">
+ <div className="flex items-center gap-3 mb-2">
+ <div className="h-8 w-8 rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center">
+ <svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
+ </svg>
+ </div>
+ <h4 className="text-lg font-semibold text-blue-900">鐢熶骇璁″垝鏁版嵁</h4>
+ </div>
+ <div className="ml-11">
+ <p className="text-blue-800">鏍稿績鏉ユ簮绯荤粺锛歋AP锛堜紒涓氱鐞嗙郴缁燂級</p>
+ </div>
+ </div>
+ {/* 鐗╂枡涓绘暟鎹� */}
+ <div className="bg-white/50 rounded-lg p-4 backdrop-blur-sm border border-blue-100/50">
+ <div className="flex items-center gap-3 mb-2">
+ <div className="h-8 w-8 rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center">
+ <svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 7v10c0 2 1 3 3 3h10c2 0 3-1 3-3V7c0-2-1-3-3-3H7C5 4 4 5 4 7z" />
+ </svg>
+ </div>
+ <h4 className="text-lg font-semibold text-blue-900">鐗╂枡涓绘暟鎹�</h4>
+ </div>
+ <div className="ml-11">
+ <p className="text-blue-800">鏍稿績鏉ユ簮绯荤粺锛歋AP锛堜紒涓氱鐞嗙郴缁燂級</p>
+ </div>
+ </div>
+ {/* 渚涘簲鍟嗙哗鏁堟暟鎹� */}
+ <div className="bg-white/50 rounded-lg p-4 backdrop-blur-sm border border-blue-100/50">
+ <div className="flex items-center gap-3 mb-2">
+ <div className="h-8 w-8 rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center">
+ <svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" />
+ </svg>
+ </div>
+ <h4 className="text-lg font-semibold text-blue-900">渚涘簲鍟嗙哗鏁堟暟鎹�</h4>
+ </div>
+ <div className="ml-11">
+ <p className="text-blue-800">鏍稿績鏉ユ簮绯荤粺锛歋RM锛堜緵搴斿晢鍏崇郴绠$悊锛夈�佽川閲忕鐞嗙郴缁�</p>
+ </div>
+ </div>
+ </div>
+ {/* 鏁版嵁鍖哄潡锛岀嫭绔嬫粴鍔紝鏄剧ず鍦ㄤ笅鏂� */}
+ <div className="flex-1 min-h-0 mt-4 overflow-y-auto px-1">
+ <div className="bg-white/90 rounded-lg p-6 shadow border border-gray-100">
+ <ReactMarkdown
+ remarkPlugins={[remarkGfm]}
+ components={{
+ h3: ({node, ...props}) => <h3 className="text-lg font-bold text-gray-800 mt-6 mb-3" {...props} />,
+ table: ({node, ...props}) => <div className="overflow-x-auto my-4"><table className="min-w-full text-gray-800 text-base" {...props} /></div>,
+ thead: ({node, ...props}) => <thead className="bg-gray-50" {...props} />,
+ th: ({node, ...props}) => <th className="px-4 py-3 text-base font-semibold text-gray-800 border-b border-gray-200 text-center whitespace-nowrap" {...props} />,
+ td: ({node, ...props}) => <td className="px-4 py-3 text-base text-gray-800 border-t border-gray-100 text-center" {...props} />,
+ tr: ({node, ...props}) => <tr className="hover:bg-gray-50" {...props} />
+ }}
+ >
+ {markdownContent}
+ </ReactMarkdown>
</div>
</div>
</div>
@@ -172,51 +282,10 @@
<svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5 text-blue-600/80" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
- 娉細浠ヤ笂涓烘ā鎷熸紨绀烘暟鎹紝瀹為檯浣跨敤鏃跺皢鑷姩瀵规帴鐩稿叧涓氬姟绯荤粺
+ 娉細浠ヤ笅涓烘ā鎷熸紨绀烘暟鎹紝瀹為檯浣跨敤鏃跺皢鑷姩瀵规帴鐩稿叧涓氬姟绯荤粺
</p>
</div>
</div>
- <ReactMarkdown
- remarkPlugins={[remarkGfm]}
- components={{
- h3: ({ node, ...props }) => (
- <h3 className="text-lg font-semibold text-gray-800 mt-8 mb-4 pb-2 border-b border-gray-200" {...props} />
- ),
- table: ({ node, ...props }) => (
- <div className="overflow-x-auto my-6 rounded-lg border border-gray-200 shadow-sm">
- <table className="min-w-full divide-y divide-gray-200" {...props} />
- </div>
- ),
- thead: ({ node, ...props }) => (
- <thead className="bg-gray-50" {...props} />
- ),
- th: ({ node, children, ...props }) => {
- // 鏍规嵁琛ㄥご鍐呭鍔ㄦ�佽皟鏁村搴�
- let className = "px-4 py-3 text-center text-sm font-semibold text-gray-700";
-
- if (typeof children === 'string') {
- // 鏍规嵁琛ㄥご鍐呭璁剧疆鍚堥�傜殑瀹藉害绫�
- if (children === '宸ヤ綅' || children === '鏁伴噺' || children === '搴撲綅') {
- className += " w-[15%]";
- } else if (children === '鍘熸潗鏂�' || children === '鍘熸潗鏂欓渶姹�' || children === '浜х嚎鍚�') {
- className += " w-[20%]";
- } else if (children === '鍘熸潗鏂欐秷鑰楅�熺巼' || children === '鐢熶骇鐨勪骇鍝�') {
- className += " w-[25%]";
- }
- }
-
- return <th className={className} {...props}>{children}</th>;
- },
- td: ({ node, ...props }) => (
- <td className="px-4 py-3 text-sm text-gray-600 border-t border-gray-200 text-center whitespace-nowrap" {...props} />
- ),
- tr: ({ node, ...props }) => (
- <tr className="hover:bg-gray-50 transition-colors duration-150" {...props} />
- )
- }}
- >
- {markdownContent}
- </ReactMarkdown>
</div>
</div>
</Dialog.Panel>
--
Gitblit v1.9.3