resourceStatistics.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  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. <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
  8. <style>
  9. body {
  10. font-family: 'Arial', sans-serif;
  11. margin: 0;
  12. padding: 20px;
  13. background-color: #f5f5f5;
  14. color: #333;
  15. }
  16. .container {
  17. max-width: 1200px;
  18. margin: 0 auto;
  19. background-color: white;
  20. padding: 30px;
  21. border-radius: 10px;
  22. box-shadow: 0 0 10px rgba(0,0,0,0.1);
  23. }
  24. h1, h2, h3 {
  25. color: #2c3e50;
  26. border-bottom: 2px solid #3498db;
  27. padding-bottom: 10px;
  28. margin-bottom: 20px;
  29. }
  30. .chart-container {
  31. margin-bottom: 40px;
  32. padding: 20px;
  33. background-color: #f9f9f9;
  34. border-radius: 8px;
  35. box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  36. }
  37. .row {
  38. display: flex;
  39. flex-wrap: wrap;
  40. gap: 20px;
  41. margin-bottom: 30px;
  42. }
  43. .col {
  44. flex: 1;
  45. min-width: 300px;
  46. }
  47. .summary-box {
  48. background-color: #ecf0f1;
  49. padding: 15px;
  50. border-radius: 8px;
  51. margin-bottom: 20px;
  52. text-align: center;
  53. }
  54. .summary-box h3 {
  55. margin: 0 0 10px 0;
  56. color: #2c3e50;
  57. }
  58. .summary-box p {
  59. margin: 0;
  60. font-size: 24px;
  61. font-weight: bold;
  62. color: #3498db;
  63. }
  64. .filters {
  65. margin-bottom: 20px;
  66. padding: 15px;
  67. background-color: #f1f8ff;
  68. border-radius: 8px;
  69. }
  70. .filters label {
  71. margin-right: 15px;
  72. font-weight: bold;
  73. }
  74. .filters select {
  75. padding: 5px;
  76. border: 1px solid #ddd;
  77. border-radius: 4px;
  78. }
  79. footer {
  80. text-align: center;
  81. margin-top: 40px;
  82. color: #7f8c8d;
  83. font-size: 14px;
  84. }
  85. .storage-info {
  86. background-color: #e8f4fc;
  87. padding: 15px;
  88. border-radius: 8px;
  89. margin-bottom: 20px;
  90. }
  91. .storage-info h3 {
  92. margin: 0 0 10px 0;
  93. color: #2980b9;
  94. }
  95. .storage-info p {
  96. margin: 0;
  97. font-size: 18px;
  98. }
  99. </style>
  100. </head>
  101. <body>
  102. <div class="container">
  103. <h1>资源库统计分析</h1>
  104. <!-- 摘要信息 -->
  105. <div class="row">
  106. <div class="col summary-box">
  107. <h3>总资源数</h3>
  108. <p id="total-resources">1,247</p>
  109. </div>
  110. <div class="col summary-box">
  111. <h3>总存储空间</h3>
  112. <p id="total-storage">4.2 TB</p>
  113. </div>
  114. <div class="col summary-box">
  115. <h3>总观看人数</h3>
  116. <p id="total-views">89,532</p>
  117. </div>
  118. <div class="col summary-box">
  119. <h3>总收藏人数</h3>
  120. <p id="total-favorites">15,678</p>
  121. </div>
  122. </div>
  123. <!-- 存储空间信息 -->
  124. <div class="storage-info">
  125. <h3>资源库存储空间使用情况</h3>
  126. <p>当前资源库总容量:10 TB | 已使用:4.2 TB | 使用率:42%</p>
  127. </div>
  128. <!-- 筛选器 -->
  129. <div class="filters">
  130. <label for="department-filter">筛选单位:</label>
  131. <select id="department-filter">
  132. <option value="all">全部单位</option>
  133. <option value="aviation">航空学院</option>
  134. <option value="military">军事管理系</option>
  135. <option value="politics">政治工作部</option>
  136. <option value="maintenance">地面维修中心</option>
  137. <option value="other">其他部门</option>
  138. </select>
  139. <label for="time-filter">时间范围:</label>
  140. <select id="time-filter">
  141. <option value="all">全部时间</option>
  142. <option value="30">最近30天</option>
  143. <option value="90">最近90天</option>
  144. <option value="180">最近180天</option>
  145. <option value="365">最近1年</option>
  146. </select>
  147. </div>
  148. <!-- 资源类型分布 -->
  149. <div class="chart-container">
  150. <h2>资源类型分布</h2>
  151. <div class="row">
  152. <div class="col">
  153. <canvas id="typeChart"></canvas>
  154. </div>
  155. <div class="col">
  156. <canvas id="departmentChart"></canvas>
  157. </div>
  158. </div>
  159. </div>
  160. <!-- 资源可见性与热度 -->
  161. <div class="chart-container">
  162. <h2>资源可见性与热度</h2>
  163. <div class="row">
  164. <div class="col">
  165. <canvas id="visibilityChart"></canvas>
  166. </div>
  167. <div class="col">
  168. <canvas id="hotnessChart"></canvas>
  169. </div>
  170. </div>
  171. </div>
  172. <!-- 文件格式分布 -->
  173. <div class="chart-container">
  174. <h2>文件格式分布</h2>
  175. <div class="row">
  176. <div class="col">
  177. <canvas id="formatChart"></canvas>
  178. </div>
  179. <div class="col">
  180. <canvas id="storageChart"></canvas>
  181. </div>
  182. </div>
  183. </div>
  184. <!-- 资源使用情况分析 -->
  185. <div class="chart-container">
  186. <h2>资源使用情况分析</h2>
  187. <div class="row">
  188. <div class="col">
  189. <canvas id="viewsChart"></canvas>
  190. </div>
  191. <div class="col">
  192. <canvas id="engagementChart"></canvas>
  193. </div>
  194. </div>
  195. </div>
  196. <!-- 时间趋势分析 -->
  197. <div class="chart-container">
  198. <h2>上传与访问时间趋势</h2>
  199. <canvas id="trendChart"></canvas>
  200. </div>
  201. <footer>
  202. <p>数据更新时间: 2025年8月18日 | 资源库统计分析系统</p>
  203. </footer>
  204. </div>
  205. <script>
  206. // 模拟数据 - 包含文件数量和存储空间数据
  207. const mockData = {
  208. // 资源类型数据
  209. types: ['航空教学', '部队管理', '政治工作', '地面维修', '其他'],
  210. typeCounts: [345, 278, 192, 231, 201],
  211. typeStorage: [1.2, 0.8, 0.6, 0.9, 0.7], // TB
  212. // 院系数据
  213. departments: ['航空学院', '军事管理系', '政治工作部', '地面维修中心', '其他部门'],
  214. departmentCounts: [412, 289, 176, 223, 147],
  215. departmentStorage: [1.5, 0.9, 0.5, 0.8, 0.5], // TB
  216. // 可见性数据
  217. visibility: ['公开', '非公开'],
  218. visibilityCounts: [987, 260],
  219. // 热度数据
  220. hotness: ['热门', '非热门'],
  221. hotnessCounts: [312, 935],
  222. recommended: ['已推荐', '未推荐'],
  223. recommendedCounts: [187, 1060],
  224. // 文件格式数据 - 包含文件数量和平均文件大小
  225. formats: ['mp4', 'pdf', 'docx', 'pptx', 'xlsx', 'jpg', 'avi', 'wmv', 'mkv', 'other'],
  226. formatCounts: [320, 312, 135, 189, 98, 167, 56, 67, 41, 163],
  227. formatStorage: [2.1, 0.3, 0.15, 0.25, 0.1, 0.08, 0.4, 0.3, 0.2, 0.12], // TB
  228. formatAvgSize: ['6.6GB', '960MB', '1.1MB', '1.3MB', '1.0MB', '500KB', '7.1GB', '4.5GB', '4.9GB', '750KB'],
  229. // 用户参与度数据
  230. engagement: ['观看', '收藏', '分享'],
  231. engagementCounts: [89532, 15678, 7892],
  232. // 时间趋势数据
  233. trendLabels: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月'],
  234. uploadTrend: [120, 95, 140, 110, 135, 150, 130, 80],
  235. viewTrend: [8500, 7200, 9800, 9200, 10500, 11200, 10800, 12300]
  236. };
  237. // 资源类型分布图
  238. new Chart(document.getElementById('typeChart'), {
  239. type: 'pie',
  240. data: {
  241. labels: mockData.types,
  242. datasets: [{
  243. data: mockData.typeCounts,
  244. backgroundColor: [
  245. '#3498db', '#e74c3c', '#2ecc71', '#f39c12', '#9b59b6'
  246. ],
  247. borderWidth: 2
  248. }]
  249. },
  250. options: {
  251. responsive: true,
  252. plugins: {
  253. title: {
  254. display: true,
  255. text: '按资源类型分类 (数量)'
  256. },
  257. legend: {
  258. position: 'bottom'
  259. }
  260. }
  261. }
  262. });
  263. // 院系分布图
  264. new Chart(document.getElementById('departmentChart'), {
  265. type: 'doughnut',
  266. data: {
  267. labels: mockData.departments,
  268. datasets: [{
  269. data: mockData.departmentCounts,
  270. backgroundColor: [
  271. '#1abc9c', '#3498db', '#8e44ad', '#e67e22', '#e74c3c'
  272. ],
  273. borderWidth: 2
  274. }]
  275. },
  276. options: {
  277. responsive: true,
  278. plugins: {
  279. title: {
  280. display: true,
  281. text: '按单位分布 (数量)'
  282. },
  283. legend: {
  284. position: 'bottom'
  285. }
  286. }
  287. }
  288. });
  289. // 可见性分析
  290. new Chart(document.getElementById('visibilityChart'), {
  291. type: 'bar',
  292. data: {
  293. labels: mockData.visibility,
  294. datasets: [{
  295. label: '资源数量',
  296. data: mockData.visibilityCounts,
  297. backgroundColor: [
  298. 'rgba(46, 204, 113, 0.8)',
  299. 'rgba(231, 76, 60, 0.8)'
  300. ],
  301. borderColor: [
  302. '#2ecc71', '#e74c3c'
  303. ],
  304. borderWidth: 1
  305. }]
  306. },
  307. options: {
  308. responsive: true,
  309. scales: {
  310. y: {
  311. beginAtZero: true,
  312. title: {
  313. display: true,
  314. text: '资源数量'
  315. }
  316. }
  317. },
  318. plugins: {
  319. title: {
  320. display: true,
  321. text: '资源公开情况'
  322. }
  323. }
  324. }
  325. });
  326. // 热度分析
  327. new Chart(document.getElementById('hotnessChart'), {
  328. type: 'polarArea',
  329. data: {
  330. labels: ['热门资源', '推荐资源', '热门且推荐'],
  331. datasets: [{
  332. label: '资源数量',
  333. data: [312, 187, 89],
  334. backgroundColor: [
  335. 'rgba(231, 76, 60, 0.7)',
  336. 'rgba(52, 152, 219, 0.7)',
  337. 'rgba(155, 89, 182, 0.7)'
  338. ],
  339. borderColor: [
  340. 'rgba(231, 76, 60, 1)',
  341. 'rgba(52, 152, 219, 1)',
  342. 'rgba(155, 89, 182, 1)'
  343. ],
  344. borderWidth: 1
  345. }]
  346. },
  347. options: {
  348. responsive: true,
  349. plugins: {
  350. title: {
  351. display: true,
  352. text: '资源热度分析'
  353. }
  354. }
  355. }
  356. });
  357. // 文件数量分布 - 水平条形图
  358. new Chart(document.getElementById('formatChart'), {
  359. type: 'bar',
  360. data: {
  361. labels: mockData.formats,
  362. datasets: [{
  363. label: '文件数量',
  364. data: mockData.formatCounts,
  365. backgroundColor: 'rgba(52, 73, 94, 0.7)',
  366. borderColor: 'rgba(52, 73, 94, 1)',
  367. borderWidth: 1
  368. }]
  369. },
  370. options: {
  371. indexAxis: 'y',
  372. responsive: true,
  373. scales: {
  374. x: {
  375. beginAtZero: true,
  376. title: {
  377. display: true,
  378. text: '文件数量'
  379. }
  380. }
  381. },
  382. plugins: {
  383. title: {
  384. display: true,
  385. text: '不同文件格式的数量分布'
  386. }
  387. }
  388. }
  389. });
  390. // 存储空间占用分布 - 饼图
  391. new Chart(document.getElementById('storageChart'), {
  392. type: 'pie',
  393. data: {
  394. labels: mockData.formats,
  395. datasets: [{
  396. label: '存储空间 (TB)',
  397. data: mockData.formatStorage,
  398. backgroundColor: [
  399. '#e74c3c', '#3498db', '#2ecc71', '#f39c12',
  400. '#9b59b6', '#1abc9c', '#34495e', '#d35400',
  401. '#8e44ad', '#7f8c8d'
  402. ],
  403. borderWidth: 2
  404. }]
  405. },
  406. options: {
  407. responsive: true,
  408. plugins: {
  409. title: {
  410. display: true,
  411. text: '不同文件格式的存储空间占用'
  412. },
  413. tooltip: {
  414. callbacks: {
  415. label: function(context) {
  416. const label = context.label || '';
  417. const value = context.parsed;
  418. const count = mockData.formatCounts[context.dataIndex];
  419. const avgSize = mockData.formatAvgSize[context.dataIndex];
  420. return [
  421. `${label}: ${value} TB`,
  422. `文件数量: ${count}`,
  423. `平均大小: ${avgSize}`
  424. ];
  425. }
  426. }
  427. }
  428. }
  429. }
  430. });
  431. // 观看情况分析
  432. new Chart(document.getElementById('viewsChart'), {
  433. type: 'bar',
  434. data: {
  435. labels: mockData.types,
  436. datasets: [{
  437. label: '平均观看人数',
  438. data: [1250, 890, 620, 980, 450],
  439. backgroundColor: 'rgba(41, 128, 185, 0.7)',
  440. borderColor: 'rgba(41, 128, 185, 1)',
  441. borderWidth: 1
  442. }]
  443. },
  444. options: {
  445. responsive: true,
  446. scales: {
  447. y: {
  448. beginAtZero: true,
  449. title: {
  450. display: true,
  451. text: '平均观看人数'
  452. }
  453. }
  454. },
  455. plugins: {
  456. title: {
  457. display: true,
  458. text: '各类资源平均观看人数'
  459. }
  460. }
  461. }
  462. });
  463. // 用户参与度分析
  464. new Chart(document.getElementById('engagementChart'), {
  465. type: 'bar',
  466. data: {
  467. labels: ['观看人数', '收藏人数', '分享次数'],
  468. datasets: [{
  469. label: '用户参与度',
  470. data: mockData.engagementCounts,
  471. backgroundColor: 'rgba(155, 89, 182, 0.7)',
  472. borderColor: 'rgba(155, 89, 182, 1)',
  473. borderWidth: 1
  474. }]
  475. },
  476. options: {
  477. responsive: true,
  478. scales: {
  479. y: {
  480. beginAtZero: true,
  481. title: {
  482. display: true,
  483. text: '数量'
  484. }
  485. }
  486. },
  487. plugins: {
  488. title: {
  489. display: true,
  490. text: '资源使用情况统计'
  491. }
  492. }
  493. }
  494. });
  495. // 时间趋势分析
  496. new Chart(document.getElementById('trendChart'), {
  497. type: 'line',
  498. data: {
  499. labels: mockData.trendLabels,
  500. datasets: [
  501. {
  502. label: '资源上传数量',
  503. data: mockData.uploadTrend,
  504. borderColor: '#3498db',
  505. backgroundColor: 'rgba(52, 152, 219, 0.1)',
  506. fill: true,
  507. tension: 0.4
  508. },
  509. {
  510. label: '资源观看人数',
  511. data: mockData.viewTrend,
  512. borderColor: '#e74c3c',
  513. backgroundColor: 'rgba(231, 76, 60, 0.1)',
  514. fill: true,
  515. tension: 0.4
  516. }
  517. ]
  518. },
  519. options: {
  520. responsive: true,
  521. interaction: {
  522. mode: 'index',
  523. intersect: false
  524. },
  525. scales: {
  526. y: {
  527. beginAtZero: true,
  528. title: {
  529. display: true,
  530. text: '数量'
  531. }
  532. }
  533. },
  534. plugins: {
  535. title: {
  536. display: true,
  537. text: '资源上传与访问趋势 (2025年)'
  538. }
  539. }
  540. }
  541. });
  542. // 筛选器交互功能
  543. document.getElementById('department-filter').addEventListener('change', function() {
  544. console.log('筛选院系:', this.value);
  545. });
  546. document.getElementById('time-filter').addEventListener('change', function() {
  547. console.log('时间范围:', this.value);
  548. });
  549. </script>
  550. </body>
  551. </html>