MainLayout.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863
  1. <template>
  2. <div class="MainLayout" @click="showWeather = false">
  3. <div class="main-title">{{title}}</div>
  4. <div class="main-left">
  5. <!-- 天气 -->
  6. <div v-show="isHome" class="main-home" @click.stop="showWeather = true">
  7. <div class="weatherBox" v-if="Object.keys(weather).length !== 0">
  8. <div class="box-left">
  9. <i class="qing" v-if="weather.day_weather === '晴'"></i>
  10. <i class="duoyun" v-else-if="weather.day_weather === '多云'"></i>
  11. <i class="yin" v-else-if="weather.day_weather === '阴'"></i>
  12. <i class="xiaoyu" v-else-if="weather.day_weather === '小雨'"></i>
  13. <i class="zyu" v-else-if="weather.day_weather.indexOf('中雨') != -1"></i>
  14. <i class="dyu" v-else-if="weather.day_weather.indexOf('大雨') != -1"></i>
  15. <i class="byu" v-else-if="weather.day_weather.indexOf('暴雨') != -1"></i>
  16. <i class="xxue" v-else-if="weather.day_weather === '小雪'"></i>
  17. <i class="zxue" v-else-if="weather.day_weather.indexOf('中雪') != -1"></i>
  18. <i class="dxue" v-else-if="weather.day_weather.indexOf('大雪') != -1"></i>
  19. <i class="bxue" v-else-if="weather.day_weather.indexOf('暴雪') != -1"></i>
  20. <i class="wu" v-else-if="weather.day_weather === '雾'"></i>
  21. </div>
  22. <div class="box-right">
  23. <p class="fontSize">{{weather.day_weather}}</p>
  24. <p class="fontSize">{{weather.min_degree}}-{{weather.max_degree}}℃</p>
  25. </div>
  26. </div>
  27. <div v-else @click="refresh">抓取天气数据失败,请重试</div>
  28. </div>
  29. <!-- 返回首页 -->
  30. <div v-show="!isHome" class="main-back" @click="back">首页</div>
  31. </div>
  32. <div class="main-right" v-show="isHome">
  33. <i class="maxTem" v-if="alarm.maxTem" @click="openShow(0)"></i>
  34. <i class="minTem" v-if="alarm.minTem" @click="openShow(1)"></i>
  35. <template v-if="Object.keys(weatherInfo).length > 0">
  36. <i class="shan minSize" v-if="weatherInfo[0].type_name.indexOf('电') != -1" @click="openShow(2)"></i>
  37. <i class="wu minSize" v-if="weatherInfo[0].type_name.indexOf('雾') != -1" @click="openShow(2)"></i>
  38. <i class="hanchao minSize" v-if="weatherInfo[0].type_name.indexOf('寒潮') != -1" @click="openShow(2)"></i>
  39. <i class="taifeng minSize" v-if="weatherInfo[0].type_name.indexOf('台风') != -1" @click="openShow(2)"></i>
  40. <i class="dafeng minSize" v-if="weatherInfo[0].type_name.indexOf('大风') != -1" @click="openShow(2)"></i>
  41. <i class="byu minSize" v-if="weatherInfo[0].type_name.indexOf('暴雨') != -1" @click="openShow(2)"></i>
  42. <i class="bxue minSize" v-if="weatherInfo[0].type_name.indexOf('暴雪') != -1" @click="openShow(2)"></i>
  43. </template>
  44. </div>
  45. <div class="time" v-show="isHome">{{currentTime}}</div>
  46. <div class="main-bottom">
  47. <p style="margin: 0">青莲食品</p>
  48. <p style="font-size: 12px; margin: 0; color: #fff; opacity: 0.4">本软件由杭州慧牧提供技术支持</p>
  49. </div>
  50. <div class="content">
  51. <router-view></router-view>
  52. </div>
  53. <transition :name=" isHome ? 'moveL' : 'moveR' ">
  54. <div id="weather" :class="[isHome ? 'weather1' : 'weather2']" v-if="showWeather">
  55. <div class="dayWeather">
  56. <p class="weatherTitle"><strong>{{getFarmName()}}</strong>&emsp;{{weather.location.replace(/,/g, '-')}}&emsp;今日:{{weather.day_weather}}&emsp;{{weather.min_degree}}℃~{{weather.max_degree}}℃&emsp;{{weather.day_wind_direction}}{{weather.day_wind_power}}级</p>
  57. <div class="dayFlex">
  58. <div class="FlexIcon">
  59. <i class="qing maxSize" v-if="weather.day_weather === '晴'"></i>
  60. <i class="duoyun maxSize" v-else-if="weather.day_weather === '多云'"></i>
  61. <i class="yin maxSize" v-else-if="weather.day_weather === '阴'"></i>
  62. <i class="xiaoyu maxSize" v-else-if="weather.day_weather === '小雨'"></i>
  63. <i class="zyu maxSize" v-else-if="weather.day_weather.indexOf('中雨') != -1"></i>
  64. <i class="dyu maxSize" v-else-if="weather.day_weather.indexOf('大雨') != -1"></i>
  65. <i class="byu maxSize" v-else-if="weather.day_weather.indexOf('暴雨') != -1"></i>
  66. <i class="xxue maxSize" v-else-if="weather.day_weather === '小雪'"></i>
  67. <i class="zxue maxSize" v-else-if="weather.day_weather.indexOf('中雪') != -1"></i>
  68. <i class="dxue maxSize" v-else-if="weather.day_weather.indexOf('大雪') != -1"></i>
  69. <i class="bxue maxSize" v-else-if="weather.day_weather.indexOf('暴雪') != -1"></i>
  70. <i class="wu maxSize" v-else-if="weather.day_weather === '雾'"></i>
  71. <span>{{weather.degree}}℃</span>
  72. </div>
  73. <div class="FlexInfo">
  74. <p>空气质量:<span>{{weather.airQuility}}</span></p>
  75. <p>空气湿度:<span>{{weather.humidity}}</span></p>
  76. </div>
  77. <div class="FlexInfo" v-if="Object.keys(weatherInfo).length > 0">
  78. <p @click.stop="openShow(2)">{{weatherInfo[0].type_name}}{{weatherInfo[0].level_name}}预警</p>
  79. </div>
  80. </div>
  81. </div>0
  82. <div class="chart">
  83. <chart-weather :data="weatherList"></chart-weather>
  84. </div>
  85. <div class="weatherGrid">
  86. <div>
  87. <p>今日</p>
  88. <p style="display: inline-block; width: 28px; height: 28px;">
  89. <i class="qing" v-if="weather.day_weather === '晴'"></i>
  90. <i class="duoyun" v-else-if="weather.day_weather === '多云'"></i>
  91. <i class="yin" v-else-if="weather.day_weather === '阴'"></i>
  92. <i class="xiaoyu" v-else-if="weather.day_weather === '小雨'"></i>
  93. <i class="zyu" v-else-if="weather.day_weather.search('中雨') != -1"></i>
  94. <i class="dyu" v-else-if="weather.day_weather.search('大雨') != -1"></i>
  95. <i class="byu" v-else-if="weather.day_weather.search('暴雨') != -1"></i>
  96. <i class="xxue" v-else-if="weather.day_weather === '小雪'"></i>
  97. <i class="zxue" v-else-if="weather.day_weather.search('中雪') != -1"></i>
  98. <i class="dxue" v-else-if="weather.day_weather.search('大雪') != -1"></i>
  99. <i class="bxue" v-else-if="weather.day_weather.search('暴雪') != -1"></i>
  100. <i class="wu" v-else-if="weather.day_weather === '雾'"></i>
  101. </p>
  102. <p>{{weather.day_weather}}</p>
  103. <p>{{weather.min_degree}}℃~{{weather.max_degree}}℃</p>
  104. <p>{{weather.day_wind_direction}}{{weather.day_wind_power}}级</p>
  105. </div>
  106. <div>
  107. <p>{{weather.tomorrow.weather_time}}</p>
  108. <p style="display: inline-block; width: 28px; height: 28px;">
  109. <i class="qing" v-if="weather.tomorrow.day_weather === '晴'"></i>
  110. <i class="duoyun" v-else-if="weather.tomorrow.day_weather === '多云'"></i>
  111. <i class="yin" v-else-if="weather.tomorrow.day_weather === '阴'"></i>
  112. <i class="xiaoyu" v-else-if="weather.tomorrow.day_weather === '小雨'"></i>
  113. <i class="zyu" v-else-if="weather.tomorrow.day_weather.search('中雨') != -1"></i>
  114. <i class="dyu" v-else-if="weather.tomorrow.day_weather.search('大雨') != -1"></i>
  115. <i class="byu" v-else-if="weather.tomorrow.day_weather.search('暴雨') != -1"></i>
  116. <i class="xxue" v-else-if="weather.tomorrow.day_weather === '小雪'"></i>
  117. <i class="zxue" v-else-if="weather.tomorrow.day_weather.search('中雪') != -1"></i>
  118. <i class="dxue" v-else-if="weather.tomorrow.day_weather.search('大雪') != -1"></i>
  119. <i class="bxue" v-else-if="weather.tomorrow.day_weather.search('暴雪') != -1"></i>
  120. <i class="wu" v-else-if="weather.tomorrow.day_weather === '雾'"></i>
  121. </p>
  122. <p>{{weather.tomorrow.day_weather}}</p>
  123. <p>{{weather.tomorrow.min_degree}}℃~{{weather.tomorrow.max_degree}}℃</p>
  124. <p>{{weather.tomorrow.day_wind_direction}}{{weather.tomorrow.day_wind_power}}级</p>
  125. </div>
  126. <div>
  127. <p>{{weather.towTomorrow.weather_time}}</p>
  128. <p style="display: inline-block; width: 28px; height: 28px;">
  129. <i class="qing" v-if="weather.towTomorrow.day_weather === '晴'"></i>
  130. <i class="duoyun" v-else-if="weather.towTomorrow.day_weather === '多云'"></i>
  131. <i class="yin" v-else-if="weather.towTomorrow.day_weather === '阴'"></i>
  132. <i class="xiaoyu" v-else-if="weather.towTomorrow.day_weather === '小雨'"></i>
  133. <i class="zyu" v-else-if="weather.towTomorrow.day_weather.search('中雨') != -1"></i>
  134. <i class="dyu" v-else-if="weather.towTomorrow.day_weather.search('大雨') != -1 "></i>
  135. <i class="byu" v-else-if="weather.towTomorrow.day_weather.search('暴雨') != -1"></i>
  136. <i class="xxue" v-else-if="weather.towTomorrow.day_weather === '小雪'"></i>
  137. <i class="zxue" v-else-if="weather.towTomorrow.day_weather.search('中雪') != -1"></i>
  138. <i class="dxue" v-else-if="weather.towTomorrow.day_weather.search('大雪') != -1 "></i>
  139. <i class="bxue" v-else-if="weather.towTomorrow.day_weather.search('暴雪') != -1 "></i>
  140. <i class="wu" v-else-if="weather.towTomorrow.day_weather === '雾'"></i>
  141. </p>
  142. <p>{{weather.towTomorrow.day_weather}}</p>
  143. <p>{{weather.towTomorrow.min_degree}}℃~{{weather.towTomorrow.max_degree}}℃</p>
  144. <p>{{weather.towTomorrow.day_wind_direction}}{{weather.towTomorrow.day_wind_power}}级</p>
  145. </div>
  146. <div>
  147. <p>{{weather.threeTomorrow.weather_time}}</p>
  148. <p style="display: inline-block; width: 28px; height: 28px;">
  149. <i class="qing" v-if="weather.threeTomorrow.day_weather === '晴'"></i>
  150. <i class="duoyun" v-else-if="weather.threeTomorrow.day_weather === '多云'"></i>
  151. <i class="yin" v-else-if="weather.threeTomorrow.day_weather === '阴'"></i>
  152. <i class="xiaoyu" v-else-if="weather.threeTomorrow.day_weather === '小雨'"></i>
  153. <i class="zyu" v-else-if="weather.threeTomorrow.day_weather.search('中雨') != -1"></i>
  154. <i class="dyu" v-else-if="weather.threeTomorrow.day_weather.search('大雨') != -1 "></i>
  155. <i class="byu" v-else-if="weather.threeTomorrow.day_weather.search('暴雨') != -1"></i>
  156. <i class="xxue" v-else-if="weather.threeTomorrow.day_weather === '小雪'"></i>
  157. <i class="zxue" v-else-if="weather.threeTomorrow.day_weather.search('中雪') != -1 "></i>
  158. <i class="dxue" v-else-if="weather.threeTomorrow.day_weather.search('大雪') != -1"></i>
  159. <i class="bxue" v-else-if="weather.threeTomorrow.day_weather.search('暴雪') != -1"></i>
  160. <i class="wu" v-else-if="weather.threeTomorrow.day_weather === '雾'"></i>
  161. </p>
  162. <p>{{weather.threeTomorrow.day_weather}}</p>
  163. <p>{{weather.threeTomorrow.min_degree}}℃~{{weather.threeTomorrow.max_degree}}℃</p>
  164. <p>{{weather.threeTomorrow.day_wind_direction}}{{weather.threeTomorrow.day_wind_power}}级</p>
  165. </div>
  166. </div>
  167. </div>
  168. </transition>
  169. <div class="farm">
  170. <label>当前牧场:</label>
  171. <el-select @change="onChange" v-model="farmId" size="mini" style="width: 150px;">
  172. <el-option v-for="item in getFarmList" :key="item.id" :label="item.farmName" :value="item.id"></el-option>
  173. </el-select>
  174. </div>
  175. <div class="alarmlist" v-show="alarmType && active!== 2" @mouseover="stopOut" @mouseout="startOut">
  176. <p style="color: #FF0033">{{alarmList[active]}}</p>
  177. <p style="color: #FF0033">{{str}}</p>
  178. </div>
  179. <div class="alarmText" v-show="alarmType && active === 2" @mouseover="stopOut" @mouseout="startOut">
  180. <p style="color: #FF0033">{{alarmInfo}}</p>
  181. <p style="color: #FF0033">{{str}}</p>
  182. </div>
  183. </div>
  184. </template>
  185. <script>
  186. import {getFarmId, getWeather, findUpdate, InfoWeater} from "@/utils/api";
  187. import { mapActions, mapState } from 'vuex';
  188. import { Select } from "element-ui";
  189. import chartWeather from "@/views/Home/chart/chartWeather";
  190. export default {
  191. name: "MainLayout",
  192. components: {
  193. 'el-select': Select,
  194. chartWeather
  195. },
  196. data() {
  197. return {
  198. title: '',
  199. isHome: true,
  200. currentTime: '',
  201. timer4: null,
  202. showWeather: false,
  203. weather: {},
  204. // 天气报警
  205. weatherInfo: {},
  206. xList: [],
  207. isShow: false,
  208. getFarmList: [],
  209. alarm: {
  210. maxTem: false,
  211. minTem: false,
  212. maxTemStr: '',
  213. minTemStr: '',
  214. },
  215. alarmList: ['高温报警', '低温报警', '恶劣天气报警'],
  216. active: 0,
  217. str: '',
  218. alarmType: false,
  219. weatherList: [],
  220. alarmInfo: '',
  221. timer: null
  222. }
  223. },
  224. watch: {
  225. $route(newVal) {
  226. if(newVal) {
  227. this.title = newVal.meta.title;
  228. if (newVal.name === 'Home') {
  229. this.isHome = true;
  230. this.initTime();
  231. } else {
  232. this.isHome = false;
  233. clearInterval(this.timer4);
  234. }
  235. }
  236. },
  237. farmList: {
  238. handler(newVal) {
  239. if(newVal.length > 0) {
  240. this.getFarmList = []
  241. newVal.forEach(item => {
  242. if(item.rowStatus) {
  243. this.getFarmList.push(item)
  244. }
  245. })
  246. }
  247. },
  248. deep: true
  249. }
  250. },
  251. computed: {
  252. ...mapState(['farmList', 'farmId'])
  253. },
  254. methods: {
  255. ...mapActions(['GetFarm', 'setFarmIdAsync']),
  256. initTime() {
  257. var _this = this;
  258. this.timer4 = setInterval(function() {
  259. var date = new Date();
  260. var year = date.getFullYear();
  261. var month = date.getMonth() + 1;
  262. var hour = date.getHours();
  263. var minutes = date.getMinutes() ;
  264. var seconds = date.getSeconds();
  265. var strDate = date.getDate();
  266. if (month >= 1 && month <= 9) {
  267. month = "0" + month;
  268. }
  269. if (strDate >= 0 && strDate <= 9) {
  270. strDate = "0" + strDate;
  271. }
  272. if(hour >=1&& hour <= 9) {
  273. hour = "0" + hour;
  274. }
  275. if(minutes >=1&& minutes <= 9) {
  276. minutes = "0" + minutes;
  277. }
  278. if(seconds >=1&& seconds <= 9) {
  279. seconds = "0" + seconds;
  280. }
  281. _this.currentTime = year + '-' + month + '-' + strDate+" "+hour+":" +minutes+":" +seconds;
  282. }, 1000)
  283. },
  284. back() {
  285. this.$router.push('/')
  286. },
  287. init() {
  288. getFarmId().then(res => {
  289. if(res.code === 10000) {
  290. this.setFarmIdAsync(res.data);
  291. if(this.$route.name === 'Home') {
  292. this.title = this.getFarmName(this.farmId) + '数智驾驶舱'
  293. }
  294. localStorage.setItem('lastFarmId', res.data);
  295. this.refresh()
  296. }
  297. })
  298. },
  299. // 刷新拿到数据
  300. refresh() {
  301. getWeather({}).then(async res => {
  302. if(res.code === 10000) {
  303. this.weather = res.data;
  304. this.weatherInfo = JSON.parse(res.data.alarm)
  305. this.weatherList = [res.data.timeList, res.data.tempList]
  306. let params = {
  307. maxTem: res.data.max_degree,
  308. minTem: res.data.min_degree
  309. }
  310. await InfoWeater(params).then(res => {
  311. if(res.code === 10000) {
  312. this.alarm = res.data;
  313. }
  314. })
  315. }
  316. })
  317. },
  318. // 选择牧场
  319. onChange(val) {
  320. let params = {
  321. id: localStorage.getItem('UserId'),
  322. lastFarmId: val
  323. }
  324. localStorage.setItem('lastFarmId', val)
  325. findUpdate(params).then(res => {
  326. console.log(res)
  327. })
  328. this.setFarmIdAsync(val);
  329. setTimeout(() => {
  330. location.reload();
  331. }, 100)
  332. },
  333. openShow(num) {
  334. this.active = num;
  335. this.alarmType = true;
  336. if(num === 0) {
  337. this.str = this.alarm.maxTemStr;
  338. } else if(num === 1) {
  339. this.str = this.alarm.minTemStr
  340. } else {
  341. this.alarmInfo = this.weatherInfo[0].type_name + this.weatherInfo[0].level_name + '预警';
  342. this.str = this.weatherInfo[0].detail;
  343. }
  344. this.timer = setTimeout(() => {
  345. this.alarmType = false;
  346. }, 5000)
  347. },
  348. getFarmName() {
  349. let str = '';
  350. this.farmList.forEach(item => {
  351. if(item.id === this.farmId) {
  352. str = item.farmName
  353. }
  354. })
  355. return str
  356. },
  357. stopOut() {
  358. clearTimeout(this.timer);
  359. this.timer = null;
  360. },
  361. startOut() {
  362. this.timer = setTimeout(() => {
  363. this.alarmType = false;
  364. }, 5000)
  365. }
  366. },
  367. created() {
  368. this.GetFarm()
  369. },
  370. mounted() {
  371. this.init()
  372. if (this.$route.name === 'Home') {
  373. this.isHome = true;
  374. this.initTime();
  375. console.log(1111);
  376. console.log(this.farmId)
  377. } else {
  378. this.isHome = false;
  379. this.title = this.$route.meta.title;
  380. if(this.timer4) {
  381. clearInterval(this.timer4)
  382. }
  383. }
  384. }
  385. }
  386. </script>
  387. <style scoped>
  388. /deep/.el-input__inner {
  389. background-color: #0F152B !important;
  390. color: white !important;
  391. }
  392. .MainLayout {
  393. width: 100vw;
  394. height: 100vh;
  395. background: url("../assets/u1.jpg") no-repeat;
  396. background-size: 100% 100%;
  397. box-sizing: border-box;
  398. position: relative;
  399. }
  400. .content {
  401. width: 100%;
  402. height: 100%;
  403. background: url('../assets/home.png') no-repeat;
  404. background-size: 100% 100%;
  405. box-sizing: border-box;
  406. padding: 70px 60px;
  407. }
  408. .main-title {
  409. width: 230px;
  410. height: 25px;
  411. line-height: 25px;
  412. position: absolute;
  413. top: 25px;
  414. left: 50.5%;
  415. text-align: center;
  416. transform: translate(-50%, 0);
  417. color: #66FFFF;
  418. font-size: 22px;
  419. font-weight: 600;
  420. cursor: pointer;
  421. }
  422. .main-left {
  423. width: 180px;
  424. height: 40px;
  425. position: absolute;
  426. top: 0;
  427. left: 150px;
  428. }
  429. .main-right {
  430. width: 180px;
  431. height: 40px;
  432. position: absolute;
  433. top: 0;
  434. right: 125px;
  435. }
  436. .main-home {
  437. width: 100%;
  438. height: 100%;
  439. line-height: 40px;
  440. color: white;
  441. }
  442. .main-time {
  443. width: 100%;
  444. height: 100%;
  445. line-height: 50px;
  446. font-size: 16px;
  447. }
  448. .main-bottom {
  449. width: 200px;
  450. height: 50px;
  451. /*background-color: red;*/
  452. position: absolute;
  453. /*line-height: 50px;*/
  454. color: #66FFFF;
  455. font-size: 24px;
  456. font-weight: 600;
  457. left: 51%;
  458. bottom: 20px;
  459. transform: translate(-50% , 0);
  460. }
  461. .main-back {
  462. width: 140px;
  463. height: 30px;
  464. font-size: 14px;
  465. line-height: 30px;
  466. background: url("../assets/Home/u761.svg") no-repeat;
  467. background-size: 100% 100%;
  468. color: white;
  469. cursor: pointer;
  470. }
  471. #weather {
  472. background-color: rgba(0, 0, 0, .8);
  473. position: absolute;
  474. width: 700px;
  475. height: 700px;
  476. top: 0;
  477. }
  478. .weather1 {
  479. left: 0;
  480. }
  481. .weather2 {
  482. right: 0;
  483. }
  484. .moveL-enter-active,
  485. .moveL-leave-active {
  486. transition: all 0.3s linear;
  487. transform: translateX(0%);
  488. }
  489. .moveL-enter,
  490. .moveL-leave {
  491. transform: translateX(-100%);
  492. }
  493. .moveL-leave-to {
  494. transform: translateX(-100%);
  495. }
  496. .moveR-enter-active, .moveR-leave-active {
  497. transition: all 0.3s linear;
  498. transform: translateX(0);
  499. }
  500. .moveR-enter, .moveR-leave {
  501. transform: translateX(100%);
  502. }
  503. .moveR-leave-to{
  504. transform: translateX(100%);
  505. }
  506. .weatherBox {
  507. width: 100%;
  508. height: 100%;
  509. box-sizing: border-box;
  510. padding: 0 20px;
  511. display: flex;
  512. justify-content: center;
  513. align-items: center;
  514. cursor: pointer;
  515. }
  516. .box-left {
  517. width: 35px;
  518. height: 35px;
  519. }
  520. .box-right {
  521. width: 60px;
  522. height: 100%;
  523. margin-left: 20px;
  524. }
  525. .qing {
  526. width: 100%;
  527. height: 100%;
  528. display: inline-block;
  529. background: url("../assets/weather/qingtian.png") no-repeat;
  530. background-size: 100% 100%;
  531. }
  532. .fontSize {
  533. height: 20px;
  534. margin: 0;
  535. line-height: 20px;
  536. text-align: left;
  537. color: #28BCCA;
  538. }
  539. .duoyun {
  540. width: 100%;
  541. height: 100%;
  542. display: inline-block;
  543. background: url("../assets/weather/qingzhuanduoyun.png") no-repeat;
  544. background-size: 100% 100%;
  545. }
  546. .yin {
  547. width: 100%;
  548. height: 100%;
  549. display: inline-block;
  550. background: url("../assets/weather/yintian.png") no-repeat;
  551. background-size: 100% 100%;
  552. }
  553. .xiaoyu {
  554. width: 100%;
  555. height: 100%;
  556. display: inline-block;
  557. background: url("../assets/weather/xiaoyu.png") no-repeat;
  558. background-size: 100% 100%;
  559. }
  560. .zyu {
  561. width: 100%;
  562. height: 100%;
  563. display: inline-block;
  564. background: url("../assets/weather/zhongyu.png") no-repeat;
  565. background-size: 100% 100%;
  566. }
  567. .dyu {
  568. width: 100%;
  569. height: 100%;
  570. display: inline-block;
  571. background: url("../assets/weather/dayu.png") no-repeat;
  572. background-size: 100% 100%;
  573. }
  574. .byu {
  575. width: 100%;
  576. height: 100%;
  577. display: inline-block;
  578. background: url("../assets/weather/baoyu.png") no-repeat;
  579. background-size: 100% 100%;
  580. }
  581. .xxue{
  582. width: 100%;
  583. height: 100%;
  584. display: inline-block;
  585. background: url("../assets/weather/xiaoxue.png") no-repeat;
  586. background-size: 100% 100%;
  587. }
  588. .zxue{
  589. width: 100%;
  590. height: 100%;
  591. display: inline-block;
  592. background: url("../assets/weather/zhongxue.png") no-repeat;
  593. background-size: 100% 100%;
  594. }
  595. .dxue{
  596. width: 100%;
  597. height: 100%;
  598. display: inline-block;
  599. background: url("../assets/weather/daxue.png") no-repeat;
  600. background-size: 100% 100%;
  601. }
  602. .bxue{
  603. width: 100%;
  604. height: 100%;
  605. display: inline-block;
  606. background: url("../assets/weather/baoxue.png") no-repeat;
  607. background-size: 100% 100%;
  608. }
  609. .wu {
  610. width: 100%;
  611. height: 100%;
  612. display: inline-block;
  613. background: url("../assets/weather/wu.png") no-repeat;
  614. background-size: 100% 100%;
  615. }
  616. .time {
  617. position: absolute;
  618. bottom: 35px;
  619. right: 80px;
  620. line-height: 50px;
  621. font-size: 16px;
  622. color: #289882
  623. }
  624. .bio-dialog {
  625. width: 100%;
  626. height: 100%;
  627. position: absolute;
  628. top: 0;
  629. left: 0;
  630. background-color: rgba(0,0,0, .9);
  631. z-index: 999;
  632. }
  633. .dialog-content {
  634. width: 30%;
  635. position: absolute;
  636. top: 50%;
  637. left: 50%;
  638. transform: translate(-50%, -70%);
  639. border: 1px solid #ddd;
  640. box-sizing: border-box;
  641. padding: 20px;
  642. color: #fff;
  643. text-align: center;
  644. }
  645. .div-text {
  646. width: 400px;
  647. height: 60px;
  648. background: url("../assets/101.png") no-repeat;
  649. background-size: 100% 100%;
  650. line-height: 60px;
  651. margin: 20px auto;
  652. font-size: 20px;
  653. color: white;
  654. text-align: center;
  655. border-bottom: 1px solid #53bafd;
  656. cursor: pointer;
  657. }
  658. .div-text:hover {
  659. background-color: white;
  660. color: #53bafd;
  661. cursor: pointer;
  662. }
  663. .farm {
  664. /*width: 200px;*/
  665. height: 40px;
  666. /*background-color: red;*/
  667. position: absolute;
  668. bottom: 40px;
  669. left: 60px;
  670. line-height: 40px;
  671. text-align: left;
  672. color: #fff;
  673. font-size: 16px;
  674. }
  675. .maxTem {
  676. display: inline-block;
  677. width: 24px;
  678. height: 24px;
  679. background: url('../assets/Home/gaowen.png');
  680. background-size: contain;
  681. margin-top: 10px;
  682. cursor: pointer;
  683. }
  684. .minTem {
  685. display: inline-block;
  686. width: 24px;
  687. height: 24px;
  688. background: url('../assets/Home/diwen.png');
  689. background-size: contain;
  690. margin-top: 10px;
  691. cursor: pointer;
  692. }
  693. .shan {
  694. display: inline-block;
  695. width: 24px;
  696. height: 24px;
  697. background: url('../assets/Home/shandian.png');
  698. background-size: contain;
  699. margin-top: 10px;
  700. cursor: pointer;
  701. }
  702. .hanchao {
  703. display: inline-block;
  704. width: 24px;
  705. height: 24px;
  706. background: url('../assets/weather/hanchao.png');
  707. background-size: contain;
  708. margin-top: 10px;
  709. cursor: pointer;
  710. }
  711. .taifeng {
  712. display: inline-block;
  713. width: 24px;
  714. height: 24px;
  715. background: url('../assets/weather/taifeng.png');
  716. background-size: contain;
  717. margin-top: 10px;
  718. cursor: pointer;
  719. }
  720. .dafeng {
  721. display: inline-block;
  722. width: 24px;
  723. height: 24px;
  724. background: url('../assets/weather/dafeng.png');
  725. background-size: contain;
  726. margin-top: 10px;
  727. cursor: pointer;
  728. }
  729. .alarmlist {
  730. width: 200px;
  731. height: 100px;
  732. position: absolute;
  733. bottom: 500px;
  734. right: 100px;
  735. border: 1px solid red;
  736. animation: myfirst 1s;
  737. }
  738. .alarmText {
  739. width: 300px;
  740. height: 200px;
  741. position: absolute;
  742. bottom: 400px;
  743. right: 50px;
  744. border: 1px solid red;
  745. animation: myfirst 1s;
  746. }
  747. @keyframes myfirst {
  748. 0% {
  749. opacity: 0;
  750. }
  751. 100% {
  752. opacity: 1;
  753. }
  754. }
  755. .weatherList {
  756. width: 100%;
  757. height: 200px;
  758. display: grid;
  759. grid-template-columns: repeat(3, 1fr);
  760. grid-template-rows: 1fr;
  761. grid-column-gap: 0;
  762. grid-row-gap: 0;
  763. }
  764. .grid {
  765. width: 100%;
  766. height: 100%;
  767. color: white;
  768. }
  769. .grid-title {
  770. line-height: 50px;
  771. font-size: 24px;
  772. }
  773. .grid-content {
  774. box-sizing: border-box;
  775. line-height: 30px;
  776. font-size: 16px;
  777. text-align: left;
  778. padding-left: 80px;
  779. }
  780. .dayWeather {
  781. color: white;
  782. text-align: left;
  783. }
  784. .weatherTitle {
  785. font-size: 16px;
  786. box-sizing: border-box;
  787. padding-left: 50px;
  788. }
  789. .weatherTitle > strong {
  790. font-size: 24px;
  791. }
  792. .dayFlex {
  793. width: 100%;
  794. display: flex;
  795. align-items: center;
  796. }
  797. .FlexIcon {
  798. width: 200px;
  799. height: 90px;
  800. box-sizing: border-box;
  801. margin-left: 50px;
  802. display: flex;
  803. align-items: center;
  804. }
  805. .FlexIcon > span {
  806. font-size: 36px;
  807. padding-left: 20px;
  808. display: inline-block;
  809. }
  810. .maxSize {
  811. width: 90px;
  812. height: 90px;
  813. }
  814. .FlexInfo {
  815. margin-left: 30px;
  816. font-size: 18px;
  817. cursor: pointer;
  818. }
  819. .chart {
  820. width: 100%;
  821. height: calc(100% - 400px);
  822. }
  823. .weatherGrid {
  824. width: 100%;
  825. box-sizing: border-box;
  826. height: 200px;
  827. display: grid;
  828. grid-template-columns: repeat(4, 1fr);
  829. grid-template-rows: 1fr;
  830. grid-column-gap: 0;
  831. grid-row-gap: 0;
  832. padding: 0 50px;
  833. }
  834. .weatherGrid > div {
  835. width: 100%;
  836. height: 100%;
  837. border: 1px solid #ddd;
  838. color: #fff;
  839. box-sizing: border-box;
  840. padding-top: 10px;
  841. font-size: 18px;
  842. }
  843. .weatherGrid > div:nth-child(2) {
  844. border-left: none;
  845. border-right: none;
  846. }
  847. .weatherGrid > div:nth-child(3) {
  848. border-right: none;
  849. }
  850. .weatherGrid > div > p {
  851. margin-top: 0;
  852. margin-bottom: 10px;
  853. }
  854. .minSize {
  855. width: 24px;
  856. height: 24px;
  857. cursor: pointer;
  858. }
  859. </style>