From 05e55761058e2089e81fb93dd4000dc3f42f40b3 Mon Sep 17 00:00:00 2001
From: hongjli <3117313295@qq.com>
Date: 星期四, 05 六月 2025 16:17:12 +0800
Subject: [PATCH] 页面调整优化

---
 src/components/DataPreviewDialog.tsx |  205 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 199 insertions(+), 6 deletions(-)

diff --git a/src/components/DataPreviewDialog.tsx b/src/components/DataPreviewDialog.tsx
index b7bb47d..6ba4d1e 100644
--- a/src/components/DataPreviewDialog.tsx
+++ b/src/components/DataPreviewDialog.tsx
@@ -10,13 +10,175 @@
   isOpen: boolean;
   onClose: () => void;
   markdownContent: string;
+  sceneType?: 'chadan' | 'buliao' | 'panorama';  // 娣诲姞鍦烘櫙绫诲瀷灞炴��
 }
 
 export default function DataPreviewDialog({
   isOpen,
   onClose,
-  markdownContent
+  markdownContent,
+  sceneType
 }: DataPreviewDialogProps) {
+  // 鏍规嵁鍦烘櫙绫诲瀷鑾峰彇瀵瑰簲鐨勬暟鎹潵婧愯鏄�
+  const getDataSourceDescription = () => {
+    if (sceneType === 'chadan') {
+      return (
+        <div className="space-y-6">
+          <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" />
+                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M8 12h8" />
+                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 16V8" />
+                </svg>
+              </div>
+              <h4 className="text-lg font-semibold text-blue-900">ERP鏍稿績鏁版嵁</h4>
+            </div>
+            <div className="ml-11">
+              <p className="text-blue-800">BOM銆侀渶姹傘�侀噰璐鍗曘�佷緵搴斿晢鍒楄〃</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="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4" />
+                </svg>
+              </div>
+              <h4 className="text-lg font-semibold text-blue-900">澶栭儴绯荤粺琛ュ厖</h4>
+            </div>
+            <div className="ml-11">
+              <p className="text-blue-800">鎻掑崟闇�姹傞�氬父鐢盋RM銆丮ES鎴栦汉宸ヨ緭鍏ヨЕ鍙戯紝鍏朵粬绯荤粺锛圥LM/SRM/SCM锛夊彲鑳芥彁渚涜ˉ鍏呮垨婧愬ご鏁版嵁</p>
+            </div>
+          </div>
+        </div>
+      );
+    } else if (sceneType === 'buliao') {
+      return (
+        <div className="space-y-6">
+          <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="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">鏍稿績鏉ユ簮绯荤粺锛歁ES銆丼CADA</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="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">鏍稿績鏉ユ簮绯荤粺锛歁ES銆乄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="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" />
+                </svg>
+              </div>
+              <h4 className="text-lg font-semibold text-blue-900">鍘熸潗鏂欏簱瀛�</h4>
+            </div>
+            <div className="ml-11">
+              <p className="text-blue-800">鏍稿績鏉ユ簮绯荤粺锛欵RP銆乄MS</p>
+            </div>
+          </div>
+        </div>
+      );
+    } else if (sceneType === 'panorama') {
+      return (
+        <div className="space-y-6">
+          <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="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-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">鏍稿績鏉ユ簮绯荤粺锛欵RP锛堜紒涓氳祫婧愯鍒掞級</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="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" />
+                </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-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="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 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="M13 10V3L4 14h7v7l9-11h-7z" />
+                </svg>
+              </div>
+              <h4 className="text-lg font-semibold text-blue-900">浜ц兘鏁版嵁</h4>
+            </div>
+            <div className="ml-11">
+              <p className="text-blue-800">鏍稿績鏉ユ簮绯荤粺锛歁ES锛堝埗閫犳墽琛岀郴缁燂級銆佽澶囩洃鎺х郴缁�</p>
+            </div>
+          </div>
+        </div>
+      );
+    }
+    return null;
+  };
+
   return (
     <Transition appear show={isOpen} as={Fragment}>
       <Dialog as="div" className="relative z-50" onClose={onClose}>
@@ -62,7 +224,7 @@
                   </Dialog.Title>
                   <button
                     onClick={onClose}
-                    className="text-gray-500 hover:text-gray-700 transition-colors duration-300"
+                    className="text-gray-500 hover:text-gray-700 transition-colors duration-300 cursor-pointer"
                   >
                     <svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                       <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
@@ -71,6 +233,23 @@
                 </div>
                 <div className="flex-1 overflow-y-auto p-6">
                   <div className="prose max-w-none">
+                    <div className="mb-6 p-6 bg-gradient-to-br from-blue-50 to-blue-100/50 rounded-lg border border-blue-100">
+                      <h3 className="text-xl font-semibold text-blue-900 mb-4 pb-3 border-b border-blue-200/50 flex items-center gap-2">
+                        <svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6 text-blue-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+                          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 10V3L4 14h7v7l9-11h-7z" />
+                        </svg>
+                        鏁版嵁鏉ユ簮璇存槑
+                      </h3>
+                      {getDataSourceDescription()}
+                      <div className="mt-6 pt-3 border-t border-blue-200/50">
+                        <p className="text-blue-800/90 text-sm flex items-center gap-2">
+                          <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={{
@@ -85,11 +264,25 @@
                         thead: ({ node, ...props }) => (
                           <thead className="bg-gray-50" {...props} />
                         ),
-                        th: ({ node, ...props }) => (
-                          <th className="px-4 py-3 text-left text-sm font-semibold text-gray-700" {...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" {...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} />

--
Gitblit v1.9.3