maomaobj commited on
Commit
67bc3c7
·
verified ·
1 Parent(s): cffbae8

各区域库存分布的界面有错误,无限延长了。请修正错误。 - Follow Up Deployment

Browse files
Files changed (1) hide show
  1. index.html +393 -346
index.html CHANGED
@@ -3,421 +3,468 @@
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.tailwindcss.com"></script>
8
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
9
- <script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
10
  <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
11
  <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
 
12
  <style>
13
  .map-container {
14
- background-image: linear-gradient(to bottom, #f0f9ff, #e0f2fe);
 
 
15
  position: relative;
16
- border-radius: 12px;
17
  overflow: hidden;
18
  }
19
-
20
- .flow-line {
21
  position: absolute;
22
- background: linear-gradient(to right, #3b82f6, #10b981);
23
- height: 3px;
24
- transform-origin: left center;
25
- animation: flow 3s infinite ease-in-out;
26
- box-shadow: 0 0 10px rgba(59, 130, 246, 0.7);
27
- }
28
-
29
- @keyframes flow {
30
- 0% { opacity: 0.3; }
31
- 50% { opacity: 1; }
32
- 100% { opacity: 0.3; }
33
  }
34
-
35
- .city-dot {
36
  position: absolute;
37
  width: 12px;
38
  height: 12px;
39
  border-radius: 50%;
40
- background-color: #3b82f6;
41
- box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
42
  }
43
-
44
- .info-popup {
45
- position: absolute;
46
- background-color: white;
47
- border-radius: 8px;
48
- padding: 12px;
49
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
50
- z-index: 10;
51
- min-width: 150px;
52
  }
53
-
54
  .chart-container {
55
- background-color: white;
56
- border-radius: 12px;
57
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
58
- }
59
-
60
- .select-container {
61
- background-color: white;
62
- border-radius: 8px;
63
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
64
- }
65
-
66
- .dropdown {
67
- position: relative;
68
- display: inline-block;
69
- width: 100%;
70
  }
71
-
72
- .dropdown-content {
73
- display: none;
74
- position: absolute;
75
- background-color: white;
76
- width: 100%;
77
- box-shadow: 0 8px 16px rgba(0,0,0,0.1);
78
- z-index: 1;
79
- border-radius: 8px;
80
  max-height: 300px;
81
  overflow-y: auto;
82
  }
83
-
84
- .dropdown:hover .dropdown-content {
85
- display: block;
86
- }
87
-
88
- .multi-select-item {
89
- padding: 8px 12px;
90
- cursor: pointer;
91
  }
92
-
93
- .multi-select-item:hover {
94
- background-color: #f0f9ff;
95
- }
96
-
97
- .multi-select-item.selected {
98
- background-color: #3b82f6;
99
- color: white;
100
- }
101
-
102
- #sankey-chart, #bar-chart, #line-chart {
103
- width: 100%;
104
- height: 100%;
105
  }
106
  </style>
107
  </head>
108
- <body class="bg-gray-50 font-sans">
109
  <div class="container mx-auto px-4 py-6">
110
- <header class="mb-6">
111
- <h1 class="text-2xl font-bold text-gray-800">农产品供应链智能分析</h1>
112
- <p class="text-gray-600">烟台苹果流通数据分析</p>
113
- </header>
114
-
115
- <div class="grid grid-cols-1 lg:grid-cols-12 gap-6">
116
- <!-- 左侧控制面板 -->
117
- <div class="lg:col-span-3 space-y-4">
118
- <div class="select-container p-4">
119
- <h3 class="font-medium text-gray-700 mb-2">产区选择</h3>
120
- <div class="dropdown">
121
- <button class="w-full px-4 py-2 text-left border border-gray-200 rounded-lg bg-white flex justify-between items-center">
122
- <span>烟台市</span>
123
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-400" viewBox="0 0 20 20" fill="currentColor">
124
- <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
125
- </svg>
126
- </button>
127
- <div class="dropdown-content mt-1">
128
- <div class="p-2 hover:bg-blue-50 cursor-pointer">烟台市</div>
129
- <div class="p-2 hover:bg-blue-50 cursor-pointer">威海市</div>
130
- <div class="p-2 hover:bg-blue-50 cursor-pointer">青岛市</div>
131
- </div>
 
 
 
 
 
 
132
  </div>
133
  </div>
134
-
135
- <div class="select-container p-4">
136
- <h3 class="font-medium text-gray-700 mb-2">销区选择</h3>
137
- <div class="dropdown">
138
- <button class="w-full px-4 py-2 text-left border border-gray-200 rounded-lg bg-white flex justify-between items-center">
139
- <span>已选择 4 个城市</span>
140
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-400" viewBox="0 0 20 20" fill="currentColor">
141
- <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
142
- </svg>
143
- </button>
144
- <div class="dropdown-content mt-1 p-2">
145
- <div class="multi-select-item selected">北京市</div>
146
- <div class="multi-select-item selected">上海市</div>
147
- <div class="multi-select-item selected">广州市</div>
148
- <div class="multi-select-item selected">成都市</div>
149
- <div class="multi-select-item">深圳市</div>
150
- <div class="multi-select-item">杭州市</div>
151
- <div class="multi-select-item">武汉市</div>
152
- <div class="multi-select-item">南京市</div>
153
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  </div>
155
  </div>
156
-
157
- <div class="select-container p-4">
158
- <h3 class="font-medium text-gray-700 mb-2">时间范围</h3>
159
- <input type="text" id="date-range" class="w-full px-4 py-2 border border-gray-200 rounded-lg bg-white" placeholder="选择日期范围" readonly>
160
  </div>
161
-
162
- <div class="select-container p-4">
163
- <h3 class="font-medium text-gray-700 mb-2">数据概览</h3>
164
- <div class="space-y-3">
165
- <div class="flex justify-between items-center">
166
- <span class="text-gray-600">总流通量</span>
167
- <span class="font-medium">12.8 万吨</span>
 
 
 
 
 
 
 
 
 
 
168
  </div>
169
- <div class="flex justify-between items-center">
170
- <span class="text-gray-600">平均价格</span>
171
- <span class="font-medium">¥6.5/公斤</span>
172
  </div>
173
- <div class="flex justify-between items-center">
174
- <span class="text-gray-600">流通效率</span>
175
- <span class="font-medium">92.4%</span>
176
  </div>
177
  </div>
178
  </div>
 
 
 
 
179
  </div>
180
-
181
- <!-- 中间地图区域 -->
182
- <div class="lg:col-span-6">
183
- <div class="map-container h-full p-4">
184
- <div class="relative h-full w-full" id="china-map">
185
- <!-- 这里放置中国地图和流动线条 -->
186
- <div class="city-dot" style="top: 30%; left: 40%;" data-city="烟台"></div>
187
- <div class="city-dot" style="top: 25%; left: 50%;" data-city="北京"></div>
188
- <div class="city-dot" style="top: 40%; left: 60%;" data-city="上海"></div>
189
- <div class="city-dot" style="top: 60%; left: 55%;" data-city="广州"></div>
190
- <div class="city-dot" style="top: 50%; left: 40%;" data-city="成都"></div>
191
-
192
- <div class="flow-line" style="width: 150px; top: 32%; left: 42%; transform: rotate(15deg);"></div>
193
- <div class="flow-line" style="width: 200px; top: 35%; left: 42%; transform: rotate(25deg);"></div>
194
- <div class="flow-line" style="width: 180px; top: 40%; left: 42%; transform: rotate(35deg);"></div>
195
- <div class="flow-line" style="width: 220px; top: 45%; left: 42%; transform: rotate(45deg);"></div>
196
-
197
- <div class="info-popup" style="top: 42%; left: 62%;">
198
- <div class="font-medium text-gray-800">上海市</div>
199
- <div class="text-blue-600">流入总量: 2.5万吨</div>
200
- <div class="text-sm text-gray-500">同比增长: +12.3%</div>
201
- </div>
202
- </div>
203
  </div>
204
  </div>
205
-
206
- <!-- 右侧数据可视化 -->
207
- <div class="lg:col-span-3 space-y-4">
208
- <div class="chart-container p-4 h-64">
209
- <h3 class="font-medium text-gray-700 mb-2">烟台苹果-主要流向分析</h3>
210
- <div id="sankey-chart"></div>
 
 
 
 
 
 
211
  </div>
212
-
213
- <div class="chart-container p-4 h-64">
214
- <h3 class="font-medium text-gray-700 mb-2">TOP 10 销往城市</h3>
215
- <div id="bar-chart"></div>
216
  </div>
217
-
218
- <div class="chart-container p-4 h-64">
219
- <h3 class="font-medium text-gray-700 mb-2">价格关联性分析</h3>
220
- <div id="line-chart"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  </div>
222
  </div>
223
  </div>
224
  </div>
225
 
226
  <script>
227
- // 初始化日期选择器
228
- flatpickr("#date-range", {
229
- mode: "range",
230
- defaultDate: ["2024-01-01", "2024-12-31"],
231
- locale: "zh"
 
232
  });
233
-
234
- // 多选功能
235
- document.querySelectorAll('.multi-select-item').forEach(item => {
236
- item.addEventListener('click', function() {
237
- this.classList.toggle('selected');
238
- updateSelectedCount();
239
- });
240
- });
241
-
242
- function updateSelectedCount() {
243
- const selectedCount = document.querySelectorAll('.multi-select-item.selected').length;
244
- document.querySelector('.dropdown button span').textContent = `已选择 ${selectedCount} 个城市`;
245
- }
246
-
247
- // 初始化图表
248
- document.addEventListener('DOMContentLoaded', function() {
249
- // Sankey
250
- const sankeyChart = echarts.init(document.getElementById('sankey-chart'));
251
- const sankeyOption = {
252
- series: [{
253
- type: 'sankey',
254
- layout: 'none',
255
- data: [
256
- {name: '烟台市'},
257
- {name: '北京市'},
258
- {name: '上海市'},
259
- {name: '广州市'},
260
- {name: '成都市'}
261
  ],
262
- links: [
263
- {source: '烟台市', target: '北京市', value: 4.2},
264
- {source: '烟台市', target: '上海市', value: 2.5},
265
- {source: '烟台市', target: '广州市', value: 3.1},
266
- {source: '烟台市', target: '成都市', value: 1.8}
 
 
267
  ],
268
- label: {
269
- color: '#4b5563'
270
- },
271
- itemStyle: {
272
- color: '#3b82f6'
273
- },
274
- lineStyle: {
275
- color: 'source',
276
- opacity: 0.6
277
- }
278
  }]
279
- };
280
- sankeyChart.setOption(sankeyOption);
281
-
282
- // 柱状图
283
- const barChart = echarts.init(document.getElementById('bar-chart'));
284
- const barOption = {
285
- tooltip: {
286
- trigger: 'axis',
287
- axisPointer: {
288
- type: 'shadow'
289
- }
290
- },
291
- grid: {
292
- left: '3%',
293
- right: '4%',
294
- bottom: '3%',
295
- containLabel: true
296
- },
297
- xAxis: {
298
- type: 'value',
299
- axisLine: {
300
- lineStyle: {
301
- color: '#9ca3af'
302
- }
303
  },
304
- axisLabel: {
305
- color: '#6b7280'
306
- }
307
- },
308
- yAxis: {
309
- type: 'category',
310
- data: ['北京市', '上海市', '广州市', '成都市', '深圳市', '杭州市', '武汉市', '南京市', '重庆市', '天津市'],
311
- axisLine: {
312
- lineStyle: {
313
- color: '#9ca3af'
314
- }
315
- },
316
- axisLabel: {
317
- color: '#6b7280'
318
- }
319
- },
320
- series: [{
321
- name: '流通量(万吨)',
322
- type: 'bar',
323
- data: [4.2, 2.5, 3.1, 1.8, 1.2, 0.9, 0.7, 0.6, 0.5, 0.4],
324
- itemStyle: {
325
- color: function(params) {
326
- const colorList = ['#3b82f6', '#60a5fa', '#93c5fd', '#bfdbfe'];
327
- return colorList[params.dataIndex % colorList.length];
328
  }
329
  }
330
- }]
331
- };
332
- barChart.setOption(barOption);
333
-
334
- // 折线图
335
- const lineChart = echarts.init(document.getElementById('line-chart'));
336
- const lineOption = {
337
- tooltip: {
338
- trigger: 'axis'
339
- },
340
- legend: {
341
- data: ['烟台市(产地)', '北京市', '上海市'],
342
- textStyle: {
343
- color: '#4b5563'
344
- }
345
- },
346
- grid: {
347
- left: '3%',
348
- right: '4%',
349
- bottom: '3%',
350
- containLabel: true
351
  },
352
- xAxis: {
353
- type: 'category',
354
- boundaryGap: false,
355
- data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
356
- axisLine: {
357
- lineStyle: {
358
- color: '#9ca3af'
 
 
 
 
359
  }
360
  },
361
- axisLabel: {
362
- color: '#6b7280'
363
- }
364
- },
365
- yAxis: {
366
- type: 'value',
367
- axisLine: {
368
- lineStyle: {
369
- color: '#9ca3af'
370
  }
371
- },
372
- axisLabel: {
373
- color: '#6b7280',
374
- formatter: '{value} ¥'
375
  }
376
- },
377
- series: [
 
 
 
 
 
 
 
 
 
378
  {
379
- name: '烟台市(产地)',
380
- type: 'line',
381
- data: [5.2, 5.5, 5.8, 6.2, 6.5, 6.3, 6.0, 5.8, 5.5, 5.2, 5.0, 4.8],
382
- itemStyle: {
383
- color: '#3b82f6'
384
- },
385
- lineStyle: {
386
- width: 3
387
- }
388
  },
389
  {
390
- name: '北京市',
391
- type: 'line',
392
- data: [6.5, 6.8, 7.0, 7.2, 7.5, 7.3, 7.0, 6.8, 6.5, 6.2, 6.0, 5.8],
393
- itemStyle: {
394
- color: '#10b981'
395
- },
396
- lineStyle: {
397
- width: 3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
398
  }
399
  },
400
- {
401
- name: '上海市',
402
- type: 'line',
403
- data: [6.8, 7.0, 7.2, 7.5, 7.8, 7.5, 7.2, 7.0, 6.8, 6.5, 6.2, 6.0],
404
- itemStyle: {
405
- color: '#f59e0b'
406
  },
407
- lineStyle: {
408
- width: 3
 
409
  }
410
  }
411
- ]
412
- };
413
- lineChart.setOption(lineOption);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
414
 
415
- // 响应式调整图表大小
416
- window.addEventListener('resize', function() {
417
- sankeyChart.resize();
418
- barChart.resize();
419
- lineChart.resize();
 
 
 
 
 
 
 
420
  });
 
 
 
 
 
 
421
  });
422
  </script>
423
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=maomaobj/apple2" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
 
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.tailwindcss.com"></script>
 
 
8
  <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
9
  <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
10
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
11
  <style>
12
  .map-container {
13
+ height: 400px;
14
+ background-color: #f8fafc;
15
+ border-radius: 0.5rem;
16
  position: relative;
 
17
  overflow: hidden;
18
  }
19
+ .map-tooltip {
 
20
  position: absolute;
21
+ background: white;
22
+ padding: 8px 12px;
23
+ border-radius: 4px;
24
+ box-shadow: 0 2px 8px rgba(0,0,0,0.15);
25
+ font-size: 12px;
26
+ z-index: 10;
27
+ pointer-events: none;
28
+ opacity: 0;
29
+ transition: opacity 0.3s;
 
 
30
  }
31
+ .risk-dot {
 
32
  position: absolute;
33
  width: 12px;
34
  height: 12px;
35
  border-radius: 50%;
36
+ transform: translate(-6px, -6px);
37
+ cursor: pointer;
38
  }
39
+ .risk-dot:hover {
40
+ transform: translate(-6px, -6px) scale(1.5);
 
 
 
 
 
 
 
41
  }
 
42
  .chart-container {
43
+ min-height: 300px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
45
+ .table-container {
 
 
 
 
 
 
 
 
46
  max-height: 300px;
47
  overflow-y: auto;
48
  }
49
+ .table-container::-webkit-scrollbar {
50
+ width: 6px;
51
+ height: 6px;
 
 
 
 
 
52
  }
53
+ .table-container::-webkit-scrollbar-thumb {
54
+ background-color: rgba(0,0,0,0.2);
55
+ border-radius: 3px;
 
 
 
 
 
 
 
 
 
 
56
  }
57
  </style>
58
  </head>
59
+ <body class="bg-gray-50 text-gray-800 font-sans">
60
  <div class="container mx-auto px-4 py-6">
61
+ <!-- 顶部标题和导航 -->
62
+ <div class="flex justify-between items-center mb-6">
63
+ <div>
64
+ <h1 class="text-2xl font-bold">苹果冷链库存分析与风险管理</h1>
65
+ <p class="text-gray-600">山东省冷链仓储实时监控与分析</p>
66
+ </div>
67
+ <div class="flex items-center space-x-4">
68
+ <div class="flex items-center">
69
+ <i class="fas fa-calendar-alt mr-2 text-gray-500"></i>
70
+ <span id="current-date" class="text-sm">2023年11月15日</span>
71
+ </div>
72
+ <button class="px-3 py-1 bg-blue-100 text-blue-600 rounded-md text-sm hover:bg-blue-200 transition">
73
+ <i class="fas fa-sync-alt mr-1"></i>刷新数据
74
+ </button>
75
+ </div>
76
+ </div>
77
+
78
+ <!-- KPI卡片 -->
79
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
80
+ <!-- 当前总库存量 -->
81
+ <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100">
82
+ <div class="flex justify-between items-start">
83
+ <div>
84
+ <p class="text-sm text-gray-500">当前总库存量</p>
85
+ <h2 class="text-2xl font-bold mt-1">12.8 万吨</h2>
86
+ </div>
87
+ <div class="bg-green-50 text-green-600 px-2 py-1 rounded-full text-xs flex items-center">
88
+ <i class="fas fa-arrow-up mr-1"></i>同比+5.2%
89
  </div>
90
  </div>
91
+ <div class="mt-3 h-2 bg-gray-100 rounded-full overflow-hidden">
92
+ <div class="h-full bg-blue-500 rounded-full" style="width: 78%"></div>
93
+ </div>
94
+ <p class="text-xs text-gray-500 mt-1">库容利用率 78%</p>
95
+ </div>
96
+
97
+ <!-- 平均库龄 -->
98
+ <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100">
99
+ <div class="flex justify-between items-start">
100
+ <div>
101
+ <p class="text-sm text-gray-500">平均库龄</p>
102
+ <h2 class="text-2xl font-bold mt-1">85 天</h2>
103
+ </div>
104
+ <div class="bg-yellow-50 text-yellow-600 px-2 py-1 rounded-full text-xs flex items-center">
105
+ <i class="fas fa-arrow-up mr-1"></i>同比+12天
106
+ </div>
107
+ </div>
108
+ <div class="mt-3 flex justify-between text-xs text-gray-500">
109
+ <span>0天</span>
110
+ <span>180���</span>
111
+ </div>
112
+ <div class="mt-1 h-2 bg-gray-100 rounded-full overflow-hidden">
113
+ <div class="h-full bg-purple-500 rounded-full" style="width: 47%"></div>
114
+ </div>
115
+ </div>
116
+
117
+ <!-- 月度周转率 -->
118
+ <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100">
119
+ <div class="flex justify-between items-start">
120
+ <div>
121
+ <p class="text-sm text-gray-500">月度周转率</p>
122
+ <h2 class="text-2xl font-bold mt-1">1.2 次/月</h2>
123
+ </div>
124
+ <div class="bg-red-50 text-red-600 px-2 py-1 rounded-full text-xs flex items-center">
125
+ <i class="fas fa-arrow-down mr-1"></i>同比-0.3次
126
+ </div>
127
+ </div>
128
+ <div class="mt-3 flex items-center">
129
+ <div class="w-4 h-4 bg-blue-500 rounded-full mr-2"></div>
130
+ <p class="text-xs text-gray-500">行业平均 1.5次/月</p>
131
+ </div>
132
+ </div>
133
+
134
+ <!-- 高风险库存占比 -->
135
+ <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100">
136
+ <div class="flex justify-between items-start">
137
+ <div>
138
+ <p class="text-sm text-gray-500">高风险库存占比</p>
139
+ <h2 class="text-2xl font-bold mt-1">15%</h2>
140
+ </div>
141
+ <div class="bg-red-50 text-red-600 px-2 py-1 rounded-full text-xs flex items-center">
142
+ <i class="fas fa-exclamation-triangle mr-1"></i>需关注
143
  </div>
144
  </div>
145
+ <div class="mt-3 relative h-4">
146
+ <div class="absolute top-0 left-0 h-full w-full bg-gray-100 rounded-full"></div>
147
+ <div class="absolute top-0 left-0 h-full bg-gradient-to-r from-green-400 via-yellow-400 to-red-500 rounded-full" style="width: 100%"></div>
148
+ <div class="absolute top-0 h-full w-0.5 bg-gray-800" style="left: 15%"></div>
149
  </div>
150
+ <div class="mt-1 flex justify-between text-xs text-gray-500">
151
+ <span>0%</span>
152
+ <span>100%</span>
153
+ </div>
154
+ </div>
155
+ </div>
156
+
157
+ <!-- 主要图表区域 -->
158
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6">
159
+ <!-- 地图 -->
160
+ <div class="lg:col-span-2 bg-white p-4 rounded-lg shadow-sm border border-gray-100">
161
+ <div class="flex justify-between items-center mb-4">
162
+ <h3 class="font-semibold">山东省冷链仓储分布与风险等级</h3>
163
+ <div class="flex items-center space-x-2">
164
+ <div class="flex items-center">
165
+ <div class="w-3 h-3 bg-green-500 rounded-full mr-1"></div>
166
+ <span class="text-xs">低风险</span>
167
  </div>
168
+ <div class="flex items-center">
169
+ <div class="w-3 h-3 bg-yellow-500 rounded-full mr-1"></div>
170
+ <span class="text-xs">中风险</span>
171
  </div>
172
+ <div class="flex items-center">
173
+ <div class="w-3 h-3 bg-red-500 rounded-full mr-1"></div>
174
+ <span class="text-xs">高风险</span>
175
  </div>
176
  </div>
177
  </div>
178
+ <div class="map-container" id="shandong-map">
179
+ <div class="map-tooltip" id="map-tooltip"></div>
180
+ <!-- 这里会通过JS添加风险点 -->
181
+ </div>
182
  </div>
183
+
184
+ <!-- 区域库存分布 -->
185
+ <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100">
186
+ <div class="flex justify-between items-center mb-4">
187
+ <h3 class="font-semibold">各区域库存分布</h3>
188
+ <select class="text-xs border border-gray-200 rounded px-2 py-1 bg-white">
189
+ <option>按库存量</option>
190
+ <option>按库龄</option>
191
+ <option>按风险等级</option>
192
+ </select>
193
+ </div>
194
+ <div class="chart-container" style="height: 300px;">
195
+ <canvas id="region-distribution-chart"></canvas>
 
 
 
 
 
 
 
 
 
 
196
  </div>
197
  </div>
198
+ </div>
199
+
200
+ <!-- 底部图表区域 -->
201
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
202
+ <!-- 库存量与周转率趋势 -->
203
+ <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100">
204
+ <div class="flex justify-between items-center mb-4">
205
+ <h3 class="font-semibold">库存量与周转率趋势 (过去12个月)</h3>
206
+ <div class="flex space-x-2">
207
+ <button class="px-2 py-1 bg-blue-50 text-blue-600 rounded text-xs">库存量</button>
208
+ <button class="px-2 py-1 bg-gray-100 text-gray-600 rounded text-xs">周转率</button>
209
+ </div>
210
  </div>
211
+ <div class="chart-container">
212
+ <canvas id="inventory-trend-chart"></canvas>
 
 
213
  </div>
214
+ </div>
215
+
216
+ <!-- 高风险库存预警列表 -->
217
+ <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100">
218
+ <div class="flex justify-between items-center mb-4">
219
+ <h3 class="font-semibold">高风险库存预警列表</h3>
220
+ <button class="text-xs text-blue-600 hover:text-blue-800 flex items-center">
221
+ <i class="fas fa-download mr-1"></i>导出报告
222
+ </button>
223
+ </div>
224
+ <div class="table-container">
225
+ <table class="min-w-full divide-y divide-gray-200">
226
+ <thead class="bg-gray-50">
227
+ <tr>
228
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">冷库名称</th>
229
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">批次号</th>
230
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">品种等级</th>
231
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">库龄(天)</th>
232
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">建议操作</th>
233
+ </tr>
234
+ </thead>
235
+ <tbody class="bg-white divide-y divide-gray-200">
236
+ <tr class="hover:bg-gray-50">
237
+ <td class="px-4 py-3 whitespace-nowrap text-sm">烟台福山冷库</td>
238
+ <td class="px-4 py-3 whitespace-nowrap text-sm">APL-2023-0456</td>
239
+ <td class="px-4 py-3 whitespace-nowrap text-sm">特级富士</td>
240
+ <td class="px-4 py-3 whitespace-nowrap text-sm text-red-600 font-medium">156</td>
241
+ <td class="px-4 py-3 whitespace-nowrap text-sm">
242
+ <span class="px-2 py-1 bg-red-100 text-red-800 rounded-full text-xs">紧急出库</span>
243
+ </td>
244
+ </tr>
245
+ <tr class="hover:bg-gray-50">
246
+ <td class="px-4 py-3 whitespace-nowrap text-sm">青岛保税冷库</td>
247
+ <td class="px-4 py-3 whitespace-nowrap text-sm">APL-2023-0789</td>
248
+ <td class="px-4 py-3 whitespace-nowrap text-sm">一级红富士</td>
249
+ <td class="px-4 py-3 whitespace-nowrap text-sm text-red-600 font-medium">142</td>
250
+ <td class="px-4 py-3 whitespace-nowrap text-sm">
251
+ <span class="px-2 py-1 bg-red-100 text-red-800 rounded-full text-xs">紧急出库</span>
252
+ </td>
253
+ </tr>
254
+ <tr class="hover:bg-gray-50">
255
+ <td class="px-4 py-3 whitespace-nowrap text-sm">威海荣成冷库</td>
256
+ <td class="px-4 py-3 whitespace-nowrap text-sm">APL-2023-0321</td>
257
+ <td class="px-4 py-3 whitespace-nowrap text-sm">二级国光</td>
258
+ <td class="px-4 py-3 whitespace-nowrap text-sm text-yellow-600 font-medium">128</td>
259
+ <td class="px-4 py-3 whitespace-nowrap text-sm">
260
+ <span class="px-2 py-1 bg-yellow-100 text-yellow-800 rounded-full text-xs">优先销售</span>
261
+ </td>
262
+ </tr>
263
+ <tr class="hover:bg-gray-50">
264
+ <td class="px-4 py-3 whitespace-nowrap text-sm">临沂兰山冷库</td>
265
+ <td class="px-4 py-3 whitespace-nowrap text-sm">APL-2023-0678</td>
266
+ <td class="px-4 py-3 whitespace-nowrap text-sm">一级嘎啦</td>
267
+ <td class="px-4 py-3 whitespace-nowrap text-sm text-yellow-600 font-medium">118</td>
268
+ <td class="px-4 py-3 whitespace-nowrap text-sm">
269
+ <span class="px-2 py-1 bg-yellow-100 text-yellow-800 rounded-full text-xs">优先销售</span>
270
+ </td>
271
+ </tr>
272
+ <tr class="hover:bg-gray-50">
273
+ <td class="px-4 py-3 whitespace-nowrap text-sm">潍坊寒亭冷库</td>
274
+ <td class="px-4 py-3 whitespace-nowrap text-sm">APL-2023-0123</td>
275
+ <td class="px-4 py-3 whitespace-nowrap text-sm">特级富士</td>
276
+ <td class="px-4 py-3 whitespace-nowrap text-sm text-red-600 font-medium">165</td>
277
+ <td class="px-4 py-3 whitespace-nowrap text-sm">
278
+ <span class="px-2 py-1 bg-red-100 text-red-800 rounded-full text-xs">紧急出库</span>
279
+ </td>
280
+ </tr>
281
+ </tbody>
282
+ </table>
283
  </div>
284
  </div>
285
  </div>
286
  </div>
287
 
288
  <script>
289
+ // 设置当前日期
290
+ document.getElementById('current-date').textContent = new Date().toLocaleDateString('zh-CN', {
291
+ year: 'numeric',
292
+ month: 'long',
293
+ day: 'numeric',
294
+ weekday: 'long'
295
  });
296
+
297
+ // 区域库存分布图表
298
+ const regionCtx = document.getElementById('region-distribution-chart').getContext('2d');
299
+ const regionChart = new Chart(regionCtx, {
300
+ type: 'bar',
301
+ data: {
302
+ labels: ['烟台', '青岛', '威海', '临沂', '潍坊'],
303
+ datasets: [{
304
+ label: '库存量 (万吨)',
305
+ data: [4.8, 3.5, 2.1, 1.6, 1.2],
306
+ backgroundColor: [
307
+ 'rgba(75, 192, 192, 0.7)',
308
+ 'rgba(54, 162, 235, 0.7)',
309
+ 'rgba(153, 102, 255, 0.7)',
310
+ 'rgba(255, 159, 64, 0.7)',
311
+ 'rgba(255, 99, 132, 0.7)',
312
+ 'rgba(201, 203, 207, 0.7)',
 
 
 
 
 
 
 
 
 
 
 
313
  ],
314
+ borderColor: [
315
+ 'rgba(75, 192, 192, 1)',
316
+ 'rgba(54, 162, 235, 1)',
317
+ 'rgba(153, 102, 255, 1)',
318
+ 'rgba(255, 159, 64, 1)',
319
+ 'rgba(255, 99, 132, 1)',
320
+ 'rgba(201, 203, 207, 1)',
321
  ],
322
+ borderWidth: 1
 
 
 
 
 
 
 
 
 
323
  }]
324
+ },
325
+ options: {
326
+ indexAxis: 'y',
327
+ responsive: true,
328
+ maintainAspectRatio: true,
329
+ aspectRatio: 1.5,
330
+ plugins: {
331
+ legend: {
332
+ display: false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
  },
334
+ tooltip: {
335
+ callbacks: {
336
+ label: function(context) {
337
+ return context.parsed.x.toFixed(1) + '万吨 (' +
338
+ Math.round(context.parsed.x / 12.8 * 100) + '%)';
339
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  }
341
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  },
343
+ scales: {
344
+ x: {
345
+ beginAtZero: true,
346
+ grid: {
347
+ display: true,
348
+ color: 'rgba(0, 0, 0, 0.05)'
349
+ },
350
+ ticks: {
351
+ callback: function(value) {
352
+ return value + '万吨';
353
+ }
354
  }
355
  },
356
+ y: {
357
+ grid: {
358
+ display: true,
359
+ color: 'rgba(0, 0, 0, 0.05)'
 
 
 
 
 
360
  }
 
 
 
 
361
  }
362
+ }
363
+ }
364
+ });
365
+
366
+ // 库存量与周转率趋势图表
367
+ const trendCtx = document.getElementById('inventory-trend-chart').getContext('2d');
368
+ const trendChart = new Chart(trendCtx, {
369
+ type: 'line',
370
+ data: {
371
+ labels: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
372
+ datasets: [
373
  {
374
+ label: '库存量 (万吨)',
375
+ data: [8.2, 9.5, 10.1, 11.3, 12.0, 12.5, 13.2, 12.8, 11.5, 10.8, 12.8, 13.5],
376
+ borderColor: 'rgba(54, 162, 235, 1)',
377
+ backgroundColor: 'rgba(54, 162, 235, 0.1)',
378
+ borderWidth: 2,
379
+ tension: 0.3,
380
+ yAxisID: 'y'
 
 
381
  },
382
  {
383
+ label: '周转率 (次/月)',
384
+ data: [1.5, 1.4, 1.3, 1.2, 1.1, 1.0, 1.2, 1.3, 1.4, 1.3, 1.2, 1.1],
385
+ borderColor: 'rgba(255, 159, 64, 1)',
386
+ backgroundColor: 'rgba(255, 159, 64, 0.1)',
387
+ borderWidth: 2,
388
+ tension: 0.3,
389
+ yAxisID: 'y1'
390
+ }
391
+ ]
392
+ },
393
+ options: {
394
+ responsive: true,
395
+ maintainAspectRatio: false,
396
+ plugins: {
397
+ legend: {
398
+ position: 'top',
399
+ }
400
+ },
401
+ scales: {
402
+ y: {
403
+ type: 'linear',
404
+ display: true,
405
+ position: 'left',
406
+ title: {
407
+ display: true,
408
+ text: '库存量 (万吨)'
409
  }
410
  },
411
+ y1: {
412
+ type: 'linear',
413
+ display: true,
414
+ position: 'right',
415
+ grid: {
416
+ drawOnChartArea: false,
417
  },
418
+ title: {
419
+ display: true,
420
+ text: '周转率 (次/月)'
421
  }
422
  }
423
+ }
424
+ }
425
+ });
426
+
427
+ // 山东省地图模拟
428
+ const mapContainer = document.getElementById('shandong-map');
429
+ const tooltip = document.getElementById('map-tooltip');
430
+
431
+ // 模拟冷库位置数据
432
+ const coldStorages = [
433
+ { name: "烟台福山冷库", x: 30, y: 80, risk: "high", inventory: "4.2万吨", age: "156天" },
434
+ { name: "青岛保税冷库", x: 20, y: 40, risk: "high", inventory: "3.1万吨", age: "142天" },
435
+ { name: "威海荣成冷库", x: 60, y: 90, risk: "medium", inventory: "1.8万吨", age: "128天" },
436
+ { name: "临沂兰山冷库", x: 40, y: 20, risk: "medium", inventory: "1.2万吨", age: "118天" },
437
+ { name: "潍坊寒亭冷库", x: 50, y: 50, risk: "high", inventory: "0.9万吨", age: "165天" },
438
+ { name: "济南历城冷库", x: 35, y: 30, risk: "low", inventory: "0.7万吨", age: "65天" },
439
+ { name: "日照岚山冷库", x: 25, y: 15, risk: "low", inventory: "0.5万吨", age: "45天" }
440
+ ];
441
+
442
+ // 添加风险点到地图
443
+ coldStorages.forEach(storage => {
444
+ const dot = document.createElement('div');
445
+ dot.className = `risk-dot ${storage.risk === 'high' ? 'bg-red-500' : storage.risk === 'medium' ? 'bg-yellow-500' : 'bg-green-500'}`;
446
+ dot.style.left = `${storage.x}%`;
447
+ dot.style.top = `${storage.y}%`;
448
 
449
+ dot.addEventListener('mouseenter', () => {
450
+ tooltip.innerHTML = `
451
+ <div class="font-semibold">${storage.name}</div>
452
+ <div class="text-xs mt-1">库存: ${storage.inventory}</div>
453
+ <div class="text-xs">库龄: ${storage.age}</div>
454
+ <div class="text-xs mt-1 ${storage.risk === 'high' ? 'text-red-600' : storage.risk === 'medium' ? 'text-yellow-600' : 'text-green-600'}">
455
+ ${storage.risk === 'high' ? '高风险' : storage.risk === 'medium' ? '中风险' : '低风险'}
456
+ </div>
457
+ `;
458
+ tooltip.style.left = `${storage.x + 2}%`;
459
+ tooltip.style.top = `${storage.y + 2}%`;
460
+ tooltip.style.opacity = '1';
461
  });
462
+
463
+ dot.addEventListener('mouseleave', () => {
464
+ tooltip.style.opacity = '0';
465
+ });
466
+
467
+ mapContainer.appendChild(dot);
468
  });
469
  </script>
470
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=maomaobj/apple2" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>