Prechádzať zdrojové kódy

fix: 气象预警图标

刘秀芳 1 týždeň pred
rodič
commit
dc47e5eea2

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 0
src/assets/images/home/多云.svg


+ 10 - 0
src/assets/images/home/大到暴雨.svg

@@ -0,0 +1,10 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M0 10.5C0 10.2239 0.223858 10 0.5 10C0.776142 10 1 10.2239 1 10.5V12.5C1 12.7761 0.776142 13 0.5 13C0.223858 13 0 12.7761 0 12.5V10.5Z" fill="#FEC13E"/>
+<path d="M2.29289 13.7071C2.10536 13.5196 2 13.2652 2 13C2 12.5 2.55542 11.605 3 11C3.44458 11.605 4 12.5 4 13C4 13.2652 3.89464 13.5196 3.70711 13.7071C3.51957 13.8946 3.26522 14 3 14C2.73478 14 2.48043 13.8946 2.29289 13.7071Z" fill="#FEC13E"/>
+<path d="M7.29289 15.7071C7.10536 15.5196 7 15.2652 7 15C7 14.5 7.55542 13.605 8 13C8.44458 13.605 9 14.5 9 15C9 15.2652 8.89464 15.5196 8.70711 15.7071C8.51957 15.8946 8.26522 16 8 16C7.73478 16 7.48043 15.8946 7.29289 15.7071Z" fill="#FEC13E"/>
+<path d="M12 13C12 13.2652 12.1054 13.5196 12.2929 13.7071C12.4804 13.8946 12.7348 14 13 14C13.2652 14 13.5196 13.8946 13.7071 13.7071C13.8946 13.5196 14 13.2652 14 13C14 12.5 13.4446 11.605 13 11C12.5554 11.605 12 12.5 12 13Z" fill="#FEC13E"/>
+<path d="M5.5 12C5.22386 12 5 12.2239 5 12.5V14.5C5 14.7761 5.22386 15 5.5 15C5.77614 15 6 14.7761 6 14.5V12.5C6 12.2239 5.77614 12 5.5 12Z" fill="#FEC13E"/>
+<path d="M15 10.5C15 10.2239 15.2239 10 15.5 10C15.7761 10 16 10.2239 16 10.5V12.5C16 12.7761 15.7761 13 15.5 13C15.2239 13 15 12.7761 15 12.5V10.5Z" fill="#FEC13E"/>
+<path d="M10.5 12C10.2239 12 10 12.2239 10 12.5V14.5C10 14.7761 10.2239 15 10.5 15C10.7761 15 11 14.7761 11 14.5V12.5C11 12.2239 10.7761 12 10.5 12Z" fill="#FEC13E"/>
+<path d="M11.7274 8.21748C10.8102 9.3074 9.43597 10 7.89998 10C6.3941 10 5.04371 9.33429 4.12704 8.2811C3.77907 8.42226 3.39862 8.5 3 8.5C1.34315 8.5 0 7.15685 0 5.5C0 3.84315 1.34315 2.5 3 2.5C3.18474 2.5 3.36559 2.5167 3.5411 2.54867C4.39849 1.02737 6.02926 0 7.89998 0C9.78634 0 11.4287 1.04461 12.2802 2.58691C12.5108 2.53012 12.7519 2.5 13 2.5C14.6569 2.5 16 3.84315 16 5.5C16 7.15685 14.6569 8.5 13 8.5C12.545 8.5 12.1137 8.39872 11.7274 8.21748Z" fill="#FEC13E"/>
+</svg>

+ 15 - 4
src/views/home/components/weatherChart.vue

@@ -189,7 +189,15 @@ let weekday = [];
 let datelist = [];
 let weatherDaylist = [];
 let weatherNightlist = [];
-let weatherImgDaylist = [];
+let weatherImgDaylist = ref([
+    "多云",
+    "大到暴雨",
+    "多云",
+    "多云",
+    "多云",
+    "多云",
+    "多云"
+]);
 let weatherImgNightlist = [];
 let windDirectlist = [];
 let windPowerlist = [];
@@ -207,7 +215,7 @@ demoData.forEach((item) => {
     datelist.push(item.rq);
     weatherDaylist.push(item.weatherTqDay);
     weatherNightlist.push(item.weatherTqNight);
-    weatherImgDaylist.push(item.weatherImgDay);
+    // weatherImgDaylist.push(item.weatherImgDay);
     weatherImgNightlist.push(item.weatherImgNight);
     windDirectlist.push(item.windDirectDay);
     windPowerlist.push(item.windPowerDay);
@@ -216,11 +224,12 @@ demoData.forEach((item) => {
 });
 maxWD = Math.max(...weatherZgwdlist) + 30;
 minWD = Math.min(...weatherZdwdlist) - 30;
-let weatherImgDaylistStyle = weatherImgDaylist.map((item) => {
+let weatherImgDaylistStyle = weatherImgDaylist.value.map((item) => {
     let dateUrl = item;
     return {
         backgroundColor: {
-            image: require("@/assets/images/home/qi-100.svg"),
+            // image: "@/assets/images/home/多云.png",
+            image: require(`@/assets/images/home/${item}.svg`)
         },
         height: 20,
         width: 20,
@@ -479,6 +488,8 @@ onMounted(() => {
 // );
 
 const initChart = (weatherData) => {
+    // weatherImgDaylist.value = weatherData.map(item => item.textDay)
+    // console.log('weatherImgDaylist', weatherImgDaylist.value);
     myChart.value = echarts.init(chartDom.value);
     options.xAxis[0].data = weatherData.map(item => dateFormat(item.fxDate))
     options.xAxis[1].data = weatherData.map(item => dateFormat(item.fxDate))

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov