index.vue 26 KB

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