1.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>简易规划文档展示</title>
  7. <style>
  8. body {
  9. font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  10. background-color: #f4f7f6;
  11. margin: 0;
  12. padding: 20px;
  13. color: #333;
  14. }
  15. .container {
  16. max-width: 800px;
  17. margin: 0 auto;
  18. background: white;
  19. padding: 30px;
  20. border-radius: 8px;
  21. box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  22. }
  23. h1 {
  24. color: #2c3e50;
  25. border-bottom: 2px solid #3498db;
  26. padding-bottom: 10px;
  27. }
  28. .project-info {
  29. display: flex;
  30. justify-content: space-between;
  31. margin-bottom: 20px;
  32. color: #666;
  33. font-size: 14px;
  34. }
  35. .task-list {
  36. list-style: none;
  37. padding: 0;
  38. }
  39. .task-item {
  40. padding: 15px;
  41. border-bottom: 1px solid #eee;
  42. display: flex;
  43. justify-content: space-between;
  44. align-items: center;
  45. }
  46. .task-item:last-child {
  47. border-bottom: none;
  48. }
  49. .status {
  50. padding: 4px 8px;
  51. border-radius: 4px;
  52. font-size: 12px;
  53. color: white;
  54. }
  55. .status-pending { background-color: #f1c40f; }
  56. .status-progress { background-color: #3498db; }
  57. .status-done { background-color: #2ecc71; }
  58. </style>
  59. </head>
  60. <body>
  61. <div class="container">
  62. <h1 id="project-title">项目规划看板</h1>
  63. <div class="project-info">
  64. <span id="project-date"></span>
  65. <span id="project-author"></span>
  66. </div>
  67. <ul class="task-list" id="task-container">
  68. <!-- 任务会通过JS随机生成 -->
  69. </ul>
  70. </div>
  71. <script>
  72. // 随机数据生成逻辑
  73. const projectNames = ["Q3 市场营销计划", "新版官网重构", "秋季产品发布会", "内部系统升级"];
  74. const authors = ["张三", "李四", "王五", "赵六"];
  75. const tasks = [
  76. { name: "需求调研与竞品分析", status: "done" },
  77. { name: "UI/UX 原型图设计", status: "progress" },
  78. { name: "前端核心组件开发", status: "progress" },
  79. { name: "后端接口联调测试", status: "pending" },
  80. { name: "项目验收与上线部署", status: "pending" }
  81. ];
  82. const statusMap = {
  83. "done": { text: "已完成", class: "status-done" },
  84. "progress": { text: "进行中", class: "status-progress" },
  85. "pending": { text: "待处理", class: "status-pending" }
  86. };
  87. // 渲染随机项目信息
  88. document.getElementById("project-title").innerText = projectNames[Math.floor(Math.random() * projectNames.length)];
  89. document.getElementById("project-date").innerText = "日期: " + new Date().toLocaleDateString();
  90. document.getElementById("project-author").innerText = "负责人: " + authors[Math.floor(Math.random() * authors.length)];
  91. // 渲染随机任务列表
  92. const container = document.getElementById("task-container");
  93. tasks.forEach(task => {
  94. const li = document.createElement("li");
  95. li.className = "task-item";
  96. li.innerHTML = `
  97. <span>${task.name}</span>
  98. <span class="status ${statusMap[task.status].class}">${statusMap[task.status].text}</span>
  99. `;
  100. container.appendChild(li);
  101. });
  102. </script>
  103. </body>
  104. </html>