2
0

index.tsx 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. import { createRoot } from 'react-dom/client'
  2. import { getGlobalConfig } from '../utils/utils'
  3. const Home = () => {
  4. return (
  5. <div style={{
  6. minHeight: "100vh",
  7. display: "flex",
  8. flexDirection: "column",
  9. backgroundColor: "#f9fafb"
  10. }}>
  11. {/* 顶部导航 */}
  12. <header style={{
  13. backgroundColor: "#fff",
  14. boxShadow: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
  15. padding: "1rem"
  16. }}>
  17. <div style={{
  18. maxWidth: "1280px",
  19. margin: "0 auto",
  20. display: "flex",
  21. justifyContent: "space-between",
  22. alignItems: "center"
  23. }}>
  24. <div style={{ fontSize: "1.5rem", fontWeight: "bold", color: "#1f2937" }}>
  25. Excel to JSON 转换平台
  26. </div>
  27. <a href="/member/home" style={{
  28. padding: "0.5rem 1rem",
  29. backgroundColor: "#1d4ed8",
  30. color: "#fff",
  31. borderRadius: "0.375rem",
  32. textDecoration: "none",
  33. fontWeight: "500",
  34. boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)"
  35. }}>
  36. 进入用户中心
  37. </a>
  38. </div>
  39. </header>
  40. {/* 主要内容 */}
  41. <main style={{ flexGrow: 1 }}>
  42. {/* 英雄区域 */}
  43. <div style={{
  44. backgroundColor: "#1d4ed8",
  45. padding: "3rem 1rem",
  46. color: "#fff",
  47. textAlign: "center"
  48. }}>
  49. <h1 style={{
  50. fontSize: "2.5rem",
  51. fontWeight: "800",
  52. marginBottom: "1.5rem"
  53. }}>
  54. Excel to JSON 转换平台
  55. </h1>
  56. <p style={{
  57. fontSize: "1.25rem",
  58. maxWidth: "800px",
  59. margin: "0 auto",
  60. color: "#bfdbfe"
  61. }}>
  62. 基于Remix.js + TypeScript构建的管理系统,提供可视化Excel格式配置及标准化JSON数据转换服务。
  63. </p>
  64. <div style={{
  65. marginTop: "2rem",
  66. display: "flex",
  67. justifyContent: "center",
  68. gap: "1rem"
  69. }}>
  70. <a href="/member/home" style={{
  71. padding: "0.75rem 1.5rem",
  72. backgroundColor: "#fff",
  73. color: "#1d4ed8",
  74. borderRadius: "0.375rem",
  75. textDecoration: "none",
  76. fontWeight: "500"
  77. }}>
  78. 开始使用
  79. </a>
  80. <a href="/member/api-playground" style={{
  81. padding: "0.75rem 1.5rem",
  82. backgroundColor: "#1e40af",
  83. color: "#fff",
  84. borderRadius: "0.375rem",
  85. textDecoration: "none",
  86. fontWeight: "500"
  87. }}>
  88. API调试
  89. </a>
  90. </div>
  91. </div>
  92. {/* 核心功能区域 */}
  93. <div style={{
  94. padding: "3rem 1rem",
  95. backgroundColor: "#fff"
  96. }}>
  97. <div style={{
  98. maxWidth: "1280px",
  99. margin: "0 auto"
  100. }}>
  101. <h2 style={{
  102. fontSize: "2rem",
  103. fontWeight: "700",
  104. textAlign: "center",
  105. marginBottom: "2rem",
  106. color: "#1f2937"
  107. }}>
  108. 核心功能
  109. </h2>
  110. <div style={{
  111. display: "grid",
  112. gridTemplateColumns: "repeat(auto-fit, minmax(300px, 1fr))",
  113. gap: "2rem"
  114. }}>
  115. {/* 配置管理 */}
  116. <div style={{
  117. padding: "1.5rem",
  118. borderRadius: "0.5rem",
  119. backgroundColor: "#f9fafb",
  120. border: "1px solid #f3f4f6"
  121. }}>
  122. <h3 style={{
  123. fontSize: "1.25rem",
  124. fontWeight: "700",
  125. textAlign: "center",
  126. marginBottom: "1rem",
  127. color: "#1f2937"
  128. }}>
  129. 配置管理
  130. </h3>
  131. <ul style={{
  132. listStyleType: "none",
  133. padding: 0,
  134. margin: 0,
  135. color: "#4b5563"
  136. }}>
  137. <li style={{ marginBottom: "0.5rem" }}>📁 多格式模板支持 - 可创建多种Excel文件格式模板</li>
  138. <li style={{ marginBottom: "0.5rem" }}>📑 多工作表配置 - 支持为每个模板配置多个工作表参数</li>
  139. <li style={{ marginBottom: "0.5rem" }}>⚙️ 字段映射配置 - 可视化配置Excel列与JSON字段的映射关系</li>
  140. <li style={{ marginBottom: "0.5rem" }}>🛠 验证规则设置 - 配置必填字段、数据校验规则</li>
  141. </ul>
  142. </div>
  143. {/* 数据转换 */}
  144. <div style={{
  145. padding: "1.5rem",
  146. borderRadius: "0.5rem",
  147. backgroundColor: "#f9fafb",
  148. border: "1px solid #f3f4f6"
  149. }}>
  150. <h3 style={{
  151. fontSize: "1.25rem",
  152. fontWeight: "700",
  153. textAlign: "center",
  154. marginBottom: "1rem",
  155. color: "#1f2937"
  156. }}>
  157. 数据转换
  158. </h3>
  159. <ul style={{
  160. listStyleType: "none",
  161. padding: 0,
  162. margin: 0,
  163. color: "#4b5563"
  164. }}>
  165. <li style={{ marginBottom: "0.5rem" }}>⬆️ 多格式文件上传 - 支持xlsx、csv等多种格式文件上传</li>
  166. <li style={{ marginBottom: "0.5rem" }}>👁 实时预览 - 提供表格视图和JSON视图两种数据预览模式</li>
  167. <li style={{ marginBottom: "0.5rem" }}>📥 数据导出 - 支持导出标准化JSON文件</li>
  168. <li style={{ marginBottom: "0.5rem" }}>🔄 批量转换 - 支持同时处理多个Excel文件</li>
  169. </ul>
  170. </div>
  171. {/* API服务 */}
  172. <div style={{
  173. padding: "1.5rem",
  174. borderRadius: "0.5rem",
  175. backgroundColor: "#f9fafb",
  176. border: "1px solid #f3f4f6"
  177. }}>
  178. <h3 style={{
  179. fontSize: "1.25rem",
  180. fontWeight: "700",
  181. textAlign: "center",
  182. marginBottom: "1rem",
  183. color: "#1f2937"
  184. }}>
  185. API服务
  186. </h3>
  187. <ul style={{
  188. listStyleType: "none",
  189. padding: 0,
  190. margin: 0,
  191. color: "#4b5563"
  192. }}>
  193. <li style={{ marginBottom: "0.5rem" }}>🚀 多输入源支持 - 接收文件、URL、Base64等多种输入形式</li>
  194. <li style={{ marginBottom: "0.5rem" }}>⚡ 实时转换 - 提供RESTful API即时转换服务</li>
  195. <li style={{ marginBottom: "0.5rem" }}>🔒 权限验证 - 支持JWT令牌验证访问权限</li>
  196. <li style={{ marginBottom: "0.5rem" }}>📊 数据校验 - 自动验证数据格式和必填字段</li>
  197. </ul>
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202. {/* 快速开始 */}
  203. <div style={{
  204. padding: "3rem 1rem",
  205. backgroundColor: "#f9fafb"
  206. }}>
  207. <div style={{
  208. maxWidth: "1280px",
  209. margin: "0 auto",
  210. textAlign: "center"
  211. }}>
  212. <h2 style={{
  213. fontSize: "2rem",
  214. fontWeight: "700",
  215. marginBottom: "1rem",
  216. color: "#1f2937"
  217. }}>
  218. 快速开始
  219. </h2>
  220. <p style={{
  221. fontSize: "1.25rem",
  222. color: "#6b7280",
  223. marginBottom: "2rem"
  224. }}>
  225. 立即体验Excel to JSON强大的转换功能
  226. </p>
  227. <div style={{
  228. display: "flex",
  229. justifyContent: "center",
  230. gap: "1rem"
  231. }}>
  232. <a href="/member/templates" style={{
  233. padding: "0.75rem 1.5rem",
  234. backgroundColor: "#1d4ed8",
  235. color: "#fff",
  236. borderRadius: "0.375rem",
  237. textDecoration: "none",
  238. fontWeight: "500"
  239. }}>
  240. 浏览模板库
  241. </a>
  242. <a href="/member/template/add" style={{
  243. padding: "0.75rem 1.5rem",
  244. backgroundColor: "#10b981",
  245. color: "#fff",
  246. borderRadius: "0.375rem",
  247. textDecoration: "none",
  248. fontWeight: "500"
  249. }}>
  250. 创建新模板
  251. </a>
  252. </div>
  253. </div>
  254. </div>
  255. </main>
  256. {/* 页脚 */}
  257. <footer style={{
  258. backgroundColor: "#fff",
  259. padding: "2rem 1rem",
  260. borderTop: "1px solid #e5e7eb"
  261. }}>
  262. <div style={{
  263. maxWidth: "1280px",
  264. margin: "0 auto",
  265. display: "flex",
  266. flexDirection: "column",
  267. alignItems: "center"
  268. }}>
  269. <div style={{
  270. display: "flex",
  271. gap: "1.5rem",
  272. marginBottom: "1rem"
  273. }}>
  274. <a href="/member/home" style={{ color: "#9ca3af", textDecoration: "none" }}>
  275. 用户中心
  276. </a>
  277. {/* <a href="/admin" style={{ color: "#9ca3af", textDecoration: "none" }}>
  278. 管理后台
  279. </a> */}
  280. </div>
  281. <p style={{ color: "#9ca3af", fontSize: "0.875rem" }}>
  282. &copy; 2023 Excel to JSON 转换平台. 保留所有权利.
  283. </p>
  284. </div>
  285. </footer>
  286. </div>
  287. );
  288. }
  289. const rootElement = document.getElementById('root')
  290. if (rootElement) {
  291. const root = createRoot(rootElement)
  292. root.render(
  293. <Home />
  294. )
  295. }