weather.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900
  1. <template>
  2. <div class="monitor-weather">
  3. <div class="left" :style="{width: isCollapse?'384px':'40px',minWidth: isCollapse?'384px':'40px'}">
  4. <SvgIcon class="collapse" :name="isCollapse ? 'ele-Expand' : 'ele-Fold'" :size="16" @click="changeCollapse" />
  5. <div class="city-weather-data-overview-wrap" v-if="isCollapse">
  6. <section class="title">
  7. <span>城市</span>
  8. <span>风力</span>
  9. <span>日照时长</span>
  10. </section>
  11. <section style="cursor: pointer" :class="currentcityId == item.id ? 'active' : ''" @click="currentcityId = item.id, currentcityName = item.name" v-for="(item, index) in cityList" :key="index">
  12. <span>{{ item.name }}</span>
  13. <span>{{ item.windpower }}</span>
  14. <span>{{ item.sunshineDuration }}</span>
  15. </section>
  16. </div>
  17. </div>
  18. <div class="right">
  19. <el-row :gutter="15" class="home-card-two mb15">
  20. <el-col>
  21. <div class="weather-info">
  22. <section v-if="oneCityInfo.weather">
  23. <span class="temperature">{{ oneCityInfo.Temperature }}℃</span>
  24. <img :src="`/imgs/weather/${oneCityInfo.weather}.svg`" alt="">
  25. <span class="weather">{{ oneCityInfo.weather }}</span>
  26. <span>{{ oneCityInfo.reporttime }}更新</span>
  27. </section>
  28. <section>
  29. <span style="margin-right: 20px;">地点:{{ currentcityName }}</span>
  30. <img src="/@/assets/img/windPowerIcon.svg" alt="">
  31. <span>风力: {{ oneCityInfo.winddirection + oneCityInfo.windpower }}</span>
  32. <img class="sunset-sunrise" src="/@/assets/img/sunset.svg" alt="">
  33. <span class="sunset">日出时间: {{ oneCityInfo.sunrise }}</span>
  34. <span>日落时间: {{ oneCityInfo.sunset }}</span>
  35. </section>
  36. </div>
  37. </el-col>
  38. </el-row>
  39. <el-row :gutter="15" class="home-card-two mb15">
  40. <el-col>
  41. <div class="home-card-item">
  42. <div class="home-card-item-title">
  43. <span>温度 监测图表</span>
  44. <el-select @change="getTemperatureEchartById(currentcityId)" v-model="temperatureType" placeholder="请选择查询范围" size="mini">
  45. <el-option v-for="item in ranges" :key="item.value" :label="item.label" :value="item.value" />
  46. </el-select>
  47. </div>
  48. <div style="height: 100%" ref="homeTemLineRef"></div>
  49. </div>
  50. </el-col>
  51. </el-row>
  52. <el-row :gutter="15" class="home-card-three">
  53. <el-col>
  54. <div class="home-card-item">
  55. <div class="home-card-item-title">
  56. <span>风力 监测图表</span>
  57. <el-select @change="getWindpowerEchartById(currentcityId)" v-model="windpowerType" placeholder="请选择查询范围" size="mini">
  58. <el-option v-for="item in ranges" :key="item.value" :label="item.label" :value="item.value" />
  59. </el-select>
  60. </div>
  61. <div style="height: 100%" ref="homeWindLineRef"></div>
  62. </div>
  63. </el-col>
  64. </el-row>
  65. </div>
  66. </div>
  67. </template>
  68. <script lang="ts">
  69. import { toRefs, reactive, defineComponent, onMounted, ref, watch, nextTick, onActivated } from 'vue';
  70. import * as echarts from 'echarts';
  71. import { useStore } from '/@/store/index';
  72. import api from '/@/api/datahub';
  73. let global: any = {
  74. homeChartOne: null,
  75. homeChartTwo: null,
  76. homeCharThree: null,
  77. dispose: [null, '', undefined]
  78. };
  79. export default defineComponent({
  80. name: 'home',
  81. setup() {
  82. const homeTemLineRef = ref();
  83. const homeWindLineRef = ref();
  84. const isCollapse = ref(true);
  85. const store = useStore();
  86. const state = reactive({
  87. city: '',
  88. cityList: [],
  89. oneCityInfo: {},
  90. temperatureType: 1,
  91. windpowerType: 1,
  92. ranges: [
  93. {
  94. value: 1,
  95. label: "日数据"
  96. },
  97. {
  98. value: 2,
  99. label: "周数据"
  100. },
  101. {
  102. value: 3,
  103. label: "月数据"
  104. },
  105. {
  106. value: 4,
  107. label: "年数据"
  108. }
  109. ],
  110. xAxis: [],
  111. tem: [],
  112. averageTem: [],
  113. foreCastInfoTem: [],
  114. foreCastAvgInfoTem: [],
  115. xAxisWind: [],
  116. foreCastInfoWind: [],
  117. foreCastAvgInfoWind: [],
  118. temWind: [],
  119. averageTemWind: [],
  120. currentcityId: 0,
  121. currentcityName: '',
  122. myCharts: [],
  123. charts: {
  124. theme: '',
  125. bgColor: '',
  126. color: '#303133',
  127. },
  128. });
  129. // 获取左侧数据
  130. const getCityWeatherList = () => {
  131. api.weather.getCityWeatherList().then((res: any) => {
  132. state.cityList = res.Info;
  133. if (!res.Info.length) return;
  134. state.currentcityId = res.Info[0].id;
  135. state.currentcityName = res.Info[0].name;
  136. });
  137. };
  138. // 根据ID获取指定城市的风力图表
  139. const getWindpowerEchartById = (id: number) => {
  140. api.weather.getWindpowerEchartById({ id: id, types: state.windpowerType }).then((res: any) => {
  141. const { AvgInfo, Info, ForeCastInfo, ForeCastAvgInfo} = res;
  142. state.xAxisWind = [];
  143. state.temWind = [];
  144. state.foreCastInfoWind = [];
  145. state.averageTemWind = [];
  146. state.foreCastAvgInfoWind = [];
  147. if (Info && Info.length) {
  148. Info.forEach((i: any) => {
  149. state.xAxisWind.push(i.time);
  150. state.temWind.push(i.value);
  151. // state.foreCastInfoWind.push('-');
  152. })
  153. }
  154. if (AvgInfo && AvgInfo.length) {
  155. AvgInfo.forEach((i: any) => {
  156. state.averageTemWind.push(i.value)
  157. // state.foreCastAvgInfoWind.push('-');
  158. })
  159. }
  160. if([2, 3].indexOf(state.windpowerType) > -1) {
  161. // 周数据、月数据
  162. ForeCastInfo.forEach((i: any) => {
  163. // state.xAxisWind.push(i.time);
  164. // state.temWind.push('-');
  165. state.foreCastInfoWind.push(i.value);
  166. })
  167. ForeCastAvgInfo.forEach((i: any) => {
  168. state.foreCastAvgInfoWind.push(i.value);
  169. })
  170. }
  171. nextTick(() => {
  172. initWindLineChart();
  173. });
  174. });
  175. };
  176. // 根据ID获取指定城市的温度图表
  177. const getTemperatureEchartById = (id: number) => {
  178. api.weather.getTemperatureEchartById({ id: id, types: state.temperatureType }).then((res: any) => {
  179. const { AvgInfo, Info, ForeCastInfo, ForeCastAvgInfo } = res;
  180. state.xAxis = [];
  181. state.tem = [];
  182. state.foreCastInfoTem = [];
  183. state.averageTem = [];
  184. state.foreCastAvgInfoTem = [];
  185. if (Info && Info.length) {
  186. Info.forEach((i: any) => {
  187. state.xAxis.push(i.time);
  188. state.tem.push(i.value);
  189. // state.foreCastInfoTem.push('-');
  190. })
  191. }
  192. if (AvgInfo && AvgInfo.length) {
  193. AvgInfo.forEach((i: any) => {
  194. state.averageTem.push(i.value)
  195. // state.foreCastAvgInfoTem.push('-');
  196. })
  197. }
  198. if([2, 3].indexOf(state.temperatureType) > -1) {
  199. // 周数据、月数据
  200. ForeCastInfo.forEach((i: any) => {
  201. // state.xAxis.push(i.time);
  202. // state.tem.push('-');
  203. state.foreCastInfoTem.push(i.value);
  204. })
  205. ForeCastAvgInfo.forEach((i: any) => {
  206. state.foreCastAvgInfoTem.push(i.value);
  207. })
  208. }
  209. console.log(state.xAxis)
  210. nextTick(() => {
  211. initTemLineChart();
  212. });
  213. });
  214. };
  215. // 获取顶部天气数据
  216. const getWhichCityWeather = (id: number) => {
  217. api.weather.getWhichCityWeather({ id: id }).then((res: any) => {
  218. state.oneCityInfo = res.Info
  219. });
  220. };
  221. // 温度折线图
  222. const initTemLineChart = () => {
  223. if (!global.dispose.some((b: any) => b === global.homeChartOne)) global.homeChartOne.dispose();
  224. global.homeChartOne = <any>echarts.init(homeTemLineRef.value, state.charts.theme);
  225. const option = {
  226. backgroundColor: state.charts.bgColor,
  227. grid: { top: 70, right: 40, bottom: 50, left: 40 },
  228. tooltip: { trigger: 'axis' },
  229. legend: { data: [2, 3].indexOf(state.temperatureType) > -1 ? ['气温(℃)', '平均气温(℃)', '预测气温(℃)', '预测平均气温(℃)'] : ['气温(℃)', '平均气温(℃)'], left: '0' },
  230. xAxis: {
  231. data: state.xAxis
  232. },
  233. yAxis: [
  234. {
  235. type: 'value',
  236. axisLabel: {
  237. formatter: "{value}℃"
  238. },
  239. splitLine: { show: true, lineStyle: { type: 'dashed', color: '#f5f5f5' } },
  240. },
  241. ],
  242. series: [
  243. {
  244. name: '气温(℃)',
  245. type: 'line',
  246. symbolSize: 6,
  247. symbol: 'circle',
  248. smooth: true,
  249. // data: [0, 41.1, 30.4, 65.1, 53.3, 53.3, 53.3, 41.1, 30.4, 65.1, 53.3, 10],
  250. data: state.tem,
  251. lineStyle: { color: '#fe9a8b' },
  252. itemStyle: { color: '#fe9a8b', borderColor: '#fe9a8b' },
  253. areaStyle: {
  254. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  255. { offset: 0, color: '#fe9a8bb3' },
  256. { offset: 1, color: '#fe9a8b03' },
  257. ]),
  258. },
  259. },
  260. {
  261. name: '预测气温(℃)',
  262. type: 'line',
  263. symbolSize: 6,
  264. symbol: 'circle',
  265. smooth: true,
  266. // data: [0, 41.1, 30.4, 65.1, 53.3, 53.3, 53.3, 41.1, 30.4, 65.1, 53.3, 10],
  267. data: state.foreCastInfoTem,
  268. lineStyle: { color: '#2b79ff' },
  269. itemStyle: { color: '#2b79ff', borderColor: '#2b79ff' },
  270. areaStyle: {
  271. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  272. { offset: 0, color: '#2b79ff' },
  273. { offset: 1, color: '#c5e3ed' },
  274. ]),
  275. },
  276. },
  277. {
  278. name: '平均气温(℃)',
  279. type: 'line',
  280. symbolSize: 6,
  281. symbol: 'circle',
  282. smooth: true,
  283. data: state.averageTem,
  284. lineStyle: { color: '#9E87FF' },
  285. itemStyle: { color: '#9E87FF', borderColor: '#9E87FF' },
  286. areaStyle: {
  287. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  288. { offset: 0, color: '#9E87FFb3' },
  289. { offset: 1, color: '#9E87FF03' },
  290. ]),
  291. },
  292. emphasis: {
  293. itemStyle: {
  294. color: {
  295. type: 'radial',
  296. x: 0.5,
  297. y: 0.5,
  298. r: 0.5,
  299. colorStops: [
  300. { offset: 0, color: '#9E87FF' },
  301. { offset: 0.4, color: '#9E87FF' },
  302. { offset: 0.5, color: '#fff' },
  303. { offset: 0.7, color: '#fff' },
  304. { offset: 0.8, color: '#fff' },
  305. { offset: 1, color: '#fff' },
  306. ],
  307. },
  308. borderColor: '#9E87FF',
  309. borderWidth: 2,
  310. },
  311. },
  312. },
  313. {
  314. name: '预测平均气温(℃)',
  315. type: 'line',
  316. symbolSize: 6,
  317. symbol: 'circle',
  318. smooth: true,
  319. data: state.foreCastAvgInfoTem,
  320. lineStyle: { color: '#41b883' },
  321. itemStyle: { color: '#41b883', borderColor: '#41b883' },
  322. areaStyle: {
  323. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  324. { offset: 0, color: '#41b883' },
  325. { offset: 1, color: '#ddf2eaab' },
  326. ]),
  327. },
  328. emphasis: {
  329. itemStyle: {
  330. color: {
  331. type: 'radial',
  332. x: 0.5,
  333. y: 0.5,
  334. r: 0.5,
  335. colorStops: [
  336. { offset: 0, color: '#9E87FF' },
  337. { offset: 0.4, color: '#9E87FF' },
  338. { offset: 0.5, color: '#fff' },
  339. { offset: 0.7, color: '#fff' },
  340. { offset: 0.8, color: '#fff' },
  341. { offset: 1, color: '#fff' },
  342. ],
  343. },
  344. borderColor: '#9E87FF',
  345. borderWidth: 2,
  346. },
  347. },
  348. },
  349. ],
  350. };
  351. (<any>global.homeChartOne).setOption(option);
  352. (<any>state.myCharts).push(global.homeChartOne);
  353. };
  354. // 风力折线图
  355. const initWindLineChart = () => {
  356. if (!global.dispose.some((b: any) => b === global.homeChartTwo)) global.homeChartTwo.dispose();
  357. global.homeChartTwo = <any>echarts.init(homeWindLineRef.value, state.charts.theme);
  358. const option = {
  359. backgroundColor: state.charts.bgColor,
  360. grid: { top: 70, right: 40, bottom: 50, left: 40 },
  361. tooltip: { trigger: 'axis' },
  362. legend: { data: [2, 3].indexOf(state.windpowerType) > -1 ? ['风力(级)', '平均风力(级)', '预测风力(级)', '预测平均风力(级)'] : ['风力(级)', '平均风力(级)'], left: '0' },
  363. xAxis: {
  364. data: state.xAxisWind
  365. },
  366. yAxis: [
  367. {
  368. type: 'value',
  369. axisLabel: {
  370. formatter: "{value}级"
  371. },
  372. splitLine: { show: true, lineStyle: { type: 'dashed', color: '#f5f5f5' } },
  373. },
  374. ],
  375. series: [
  376. {
  377. name: '风力(级)',
  378. type: 'line',
  379. symbolSize: 6,
  380. symbol: 'circle',
  381. smooth: true,
  382. data: state.temWind,
  383. lineStyle: { color: '#fe9a8b' },
  384. itemStyle: { color: '#fe9a8b', borderColor: '#fe9a8b' },
  385. areaStyle: {
  386. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  387. { offset: 0, color: '#fe9a8bb3' },
  388. { offset: 1, color: '#fe9a8b03' },
  389. ]),
  390. },
  391. },
  392. {
  393. name: '预测风力(级)',
  394. type: 'line',
  395. symbolSize: 6,
  396. symbol: 'circle',
  397. smooth: true,
  398. data: state.foreCastInfoWind,
  399. lineStyle: { color: '#2b79ff' },
  400. itemStyle: { color: '#2b79ff', borderColor: '#2b79ff' },
  401. areaStyle: {
  402. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  403. { offset: 0, color: '#2b79ff' },
  404. { offset: 1, color: '#c5e3ed' },
  405. ]),
  406. },
  407. },
  408. {
  409. name: '平均风力(级)',
  410. type: 'line',
  411. symbolSize: 6,
  412. symbol: 'circle',
  413. smooth: true,
  414. data: state.averageTemWind,
  415. lineStyle: { color: '#9E87FF' },
  416. itemStyle: { color: '#9E87FF', borderColor: '#9E87FF' },
  417. areaStyle: {
  418. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  419. { offset: 0, color: '#9E87FFb3' },
  420. { offset: 1, color: '#9E87FF03' },
  421. ]),
  422. },
  423. emphasis: {
  424. itemStyle: {
  425. color: {
  426. type: 'radial',
  427. x: 0.5,
  428. y: 0.5,
  429. r: 0.5,
  430. colorStops: [
  431. { offset: 0, color: '#9E87FF' },
  432. { offset: 0.4, color: '#9E87FF' },
  433. { offset: 0.5, color: '#fff' },
  434. { offset: 0.7, color: '#fff' },
  435. { offset: 0.8, color: '#fff' },
  436. { offset: 1, color: '#fff' },
  437. ],
  438. },
  439. borderColor: '#9E87FF',
  440. borderWidth: 2,
  441. },
  442. },
  443. },
  444. {
  445. name: '预测平均风力(级)',
  446. type: 'line',
  447. symbolSize: 6,
  448. symbol: 'circle',
  449. smooth: true,
  450. data: state.foreCastAvgInfoWind,
  451. lineStyle: { color: '#41b883' },
  452. itemStyle: { color: '#41b883', borderColor: '#41b883' },
  453. areaStyle: {
  454. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  455. { offset: 0, color: '#41b883' },
  456. { offset: 1, color: '#ddf2eaab' },
  457. ]),
  458. },
  459. emphasis: {
  460. itemStyle: {
  461. color: {
  462. type: 'radial',
  463. x: 0.5,
  464. y: 0.5,
  465. r: 0.5,
  466. colorStops: [
  467. { offset: 0, color: '#9E87FF' },
  468. { offset: 0.4, color: '#9E87FF' },
  469. { offset: 0.5, color: '#fff' },
  470. { offset: 0.7, color: '#fff' },
  471. { offset: 0.8, color: '#fff' },
  472. { offset: 1, color: '#fff' },
  473. ],
  474. },
  475. borderColor: '#9E87FF',
  476. borderWidth: 2,
  477. },
  478. },
  479. },
  480. ],
  481. };
  482. (<any>global.homeChartTwo).setOption(option);
  483. (<any>state.myCharts).push(global.homeChartTwo);
  484. };
  485. // 批量设置 echarts resize
  486. const initEchartsResizeFun = () => {
  487. nextTick(() => {
  488. for (let i = 0; i < state.myCharts.length; i++) {
  489. setTimeout(() => {
  490. (<any>state.myCharts[i]).resize();
  491. }, 0);
  492. }
  493. });
  494. };
  495. // 批量设置 echarts resize
  496. const changeCollapse = () => {
  497. isCollapse.value = !isCollapse.value;
  498. initEchartsResizeFun()
  499. };
  500. // 批量设置 echarts resize
  501. const initEchartsResize = () => {
  502. window.addEventListener('resize', initEchartsResizeFun);
  503. };
  504. // 页面加载时
  505. onMounted(() => {
  506. initEchartsResize();
  507. getCityWeatherList();
  508. });
  509. // 由于页面缓存原因,keep-alive
  510. onActivated(() => {
  511. initEchartsResizeFun();
  512. });
  513. // 监听 vuex 中的 tagsview 开启全屏变化,重新 resize 图表,防止不出现/大小不变等
  514. watch(
  515. () => store.state.tagsViewRoutes.isTagsViewCurrenFull,
  516. () => {
  517. initEchartsResizeFun();
  518. }
  519. );
  520. // 监听 vuex 中是否开启深色主题
  521. watch(
  522. () => store.state.themeConfig.themeConfig.isIsDark,
  523. (isIsDark) => {
  524. nextTick(() => {
  525. state.charts.theme = isIsDark ? 'dark' : '';
  526. state.charts.bgColor = isIsDark ? 'transparent' : '';
  527. state.charts.color = isIsDark ? '#dadada' : '#303133';
  528. setTimeout(() => {
  529. initTemLineChart();
  530. }, 500);
  531. setTimeout(() => {
  532. initWindLineChart();
  533. }, 700);
  534. });
  535. },
  536. {
  537. deep: true,
  538. immediate: true,
  539. }
  540. );
  541. watch(
  542. () => state.currentcityId,
  543. () => {
  544. getWhichCityWeather(state.currentcityId);
  545. getTemperatureEchartById(state.currentcityId);
  546. getWindpowerEchartById(state.currentcityId)
  547. }
  548. );
  549. return {
  550. changeCollapse,
  551. isCollapse,
  552. homeTemLineRef,
  553. homeWindLineRef,
  554. getWhichCityWeather,
  555. getCityWeatherList,
  556. getTemperatureEchartById,
  557. getWindpowerEchartById,
  558. ...toRefs(state),
  559. };
  560. },
  561. });
  562. </script>
  563. <style scoped lang="scss">
  564. $homeNavLengh: 8;
  565. .monitor-weather {
  566. overflow: hidden;
  567. display: flex;
  568. background-color: #fff;
  569. padding: 20px;
  570. justify-content: space-between;
  571. .left {
  572. width: 384px;
  573. height: 500px;
  574. margin-right: 20px;
  575. position: relative;
  576. .collapse {
  577. position: absolute;
  578. top: 0;
  579. right: 0;
  580. z-index: 1;
  581. padding: 5px;
  582. width: 36px;
  583. height: 36px;
  584. cursor: pointer;
  585. }
  586. .city-weather-data-overview-wrap {
  587. border: 1px solid #f2f2f2;
  588. section.title {
  589. font-size: 18px;
  590. font-weight: bold;
  591. color: #1a1a1a;
  592. padding-top: 30px;
  593. }
  594. section {
  595. padding: 20px 0;
  596. span {
  597. display: inline-block;
  598. width: 33%;
  599. text-align: center;
  600. }
  601. span:nth-child(2) {
  602. border-left: 1px solid #f2f2f2;
  603. border-right: 1px solid #f2f2f2;
  604. }
  605. }
  606. section:nth-child(2n) {
  607. background-color: #fff;
  608. }
  609. section:nth-child(2n + 1) {
  610. background-color: #f8f8f8;
  611. }
  612. section.active {
  613. background: var(--el-color-primary-light-9);
  614. }
  615. }
  616. }
  617. .right {
  618. flex: 1;
  619. height: 100%;
  620. overflow: hidden;
  621. .weather-info {
  622. padding: 15px 30px 15px 30px;
  623. background: var(--el-color-white);
  624. color: var(--el-text-color-primary);
  625. border: 1px solid var(--next-border-color-light);
  626. section:nth-child(1) {
  627. margin-bottom: 12px;
  628. }
  629. section {
  630. display: flex;
  631. justify-content: flex-start;
  632. align-items: center;
  633. .temperature {
  634. font-size: 50px;
  635. font-weight: bold;
  636. }
  637. img {
  638. margin: 0 10px 0 30px;
  639. }
  640. .weather {
  641. margin-right: 30px;
  642. }
  643. img {
  644. width: 24px;
  645. }
  646. .sunset-sunrise {
  647. margin: 0 8xpx 0 47px;
  648. }
  649. .sunset {
  650. margin-right: 40px;
  651. }
  652. }
  653. }
  654. }
  655. .home-card-two,
  656. .home-card-three {
  657. .home-card-item,
  658. .home-card-top {
  659. width: 100%;
  660. height: 130px;
  661. border-radius: 4px;
  662. transition: all ease 0.3s;
  663. padding: 20px;
  664. overflow: hidden;
  665. background: var(--el-color-white);
  666. color: var(--el-text-color-primary);
  667. border: 1px solid var(--next-border-color-light);
  668. &:hover {
  669. box-shadow: 0 2px 12px var(--next-color-dark-hover);
  670. transition: all ease 0.3s;
  671. }
  672. &-icon {
  673. width: 70px;
  674. height: 70px;
  675. border-radius: 100%;
  676. flex-shrink: 1;
  677. i {
  678. color: var(--el-text-color-placeholder);
  679. }
  680. }
  681. &-title {
  682. font-size: 15px;
  683. font-weight: bold;
  684. height: 30px;
  685. }
  686. }
  687. }
  688. // .home-card-one {
  689. // @for $i from 0 through 3 {
  690. // .home-one-animation#{$i} {
  691. // opacity: 0;
  692. // animation-name: error-num;
  693. // animation-duration: 0.5s;
  694. // animation-fill-mode: forwards;
  695. // animation-delay: calc($i/10) + s;
  696. // }
  697. // }
  698. // }
  699. .home-card-item-title {
  700. display: flex;
  701. justify-content: space-between;
  702. align-items: center;
  703. }
  704. // .home-card-one .home-card-item {
  705. // width: 100%;
  706. // border-radius: 4px;
  707. // transition: all ease 0.3s;
  708. // overflow: hidden;
  709. // background: var(--el-color-white);
  710. // color: var(--el-text-color-primary);
  711. // border: 1px solid var(--next-border-color-light);
  712. // &:hover {
  713. // box-shadow: 0 2px 12px var(--next-color-dark-hover);
  714. // transition: all ease 0.3s;
  715. // }
  716. // .item-header {
  717. // display: flex;
  718. // justify-content: center;
  719. // align-content: center;
  720. // color: #101010;
  721. // padding: 10px 0;
  722. // border-bottom: 1px solid var(--next-border-color-light);
  723. // font-size: 20px;
  724. // font-weight: bold;
  725. // img {
  726. // margin-right: 32px;
  727. // width: 24px;
  728. // height: 24px;;
  729. // margin-top: 3px;
  730. // }
  731. // }
  732. // .item-content {
  733. // padding: 26px;
  734. // p {
  735. // display: flex;
  736. // justify-content: space-between;
  737. // align-content: center;
  738. // span:nth-child(1) {
  739. // // padding-top: 4px;
  740. // line-height: 33px;;
  741. // font-size: 14px;
  742. // }
  743. // span:nth-child(2) {
  744. // color: #101010;
  745. // font-weight: bold;
  746. // font-size: 22px;
  747. // }
  748. // }
  749. // p:nth-child(2) {
  750. // margin-top: 26px;
  751. // }
  752. // }
  753. // }
  754. .home-card-two,
  755. .home-card-three {
  756. .home-card-item {
  757. height: 500px;
  758. }
  759. .home-card-top {
  760. height: 250px;
  761. .box-card {
  762. padding: 15px 20px 20px 20px;
  763. p {
  764. margin-bottom: 10px;
  765. }
  766. &-item {
  767. margin-bottom: 20px;
  768. }
  769. }
  770. }
  771. .home-card-item,
  772. .home-card-top {
  773. width: 100%;
  774. overflow: hidden;
  775. .home-monitor {
  776. height: 100%;
  777. .flex-warp-item {
  778. width: 25%;
  779. height: 111px;
  780. display: flex;
  781. .flex-warp-item-box {
  782. margin: auto;
  783. text-align: center;
  784. color: var(--el-text-color-primary);
  785. display: flex;
  786. border-radius: 5px;
  787. background: var(--next-bg-color);
  788. cursor: pointer;
  789. transition: all 0.3s ease;
  790. &:hover {
  791. background: var(--el-color-primary-light-9);
  792. transition: all 0.3s ease;
  793. }
  794. }
  795. @for $i from 0 through $homeNavLengh {
  796. .home-animation#{$i} {
  797. opacity: 0;
  798. animation-name: error-num;
  799. animation-duration: 0.5s;
  800. animation-fill-mode: forwards;
  801. animation-delay: calc($i/10) + s;
  802. }
  803. }
  804. }
  805. }
  806. }
  807. }
  808. .text-info {
  809. color: #23c6c8;
  810. }
  811. .text-danger {
  812. color: #ed5565;
  813. }
  814. .git-res {
  815. margin-top: 20px;
  816. }
  817. .git-res .el-link {
  818. margin-right: 30px;
  819. }
  820. ul,
  821. li {
  822. padding: 0;
  823. margin: 0;
  824. list-style: none;
  825. }
  826. .product {
  827. margin-top: 50px;
  828. h3 {
  829. margin-bottom: 15px;
  830. }
  831. }
  832. .product li {
  833. margin-bottom: 20px;
  834. float: left;
  835. width: 150px;
  836. }
  837. .box-card.xx {
  838. margin-top: 20px;
  839. }
  840. }
  841. </style>