MainLayout.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864
  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. if (newVal.name === 'Home') {
  228. this.isHome = true;
  229. this.initTime();
  230. this.title = this.getFarmName(this.farmId) + '数智驾驶舱'
  231. } else {
  232. this.isHome = false;
  233. this.title = newVal.meta.title;
  234. clearInterval(this.timer4);
  235. }
  236. }
  237. },
  238. farmList: {
  239. handler(newVal) {
  240. if(newVal.length > 0) {
  241. this.getFarmList = []
  242. newVal.forEach(item => {
  243. if(item.rowStatus) {
  244. this.getFarmList.push(item)
  245. }
  246. })
  247. }
  248. },
  249. deep: true
  250. }
  251. },
  252. computed: {
  253. ...mapState(['farmList', 'farmId'])
  254. },
  255. methods: {
  256. ...mapActions(['GetFarm', 'setFarmIdAsync']),
  257. initTime() {
  258. var _this = this;
  259. this.timer4 = setInterval(function() {
  260. var date = new Date();
  261. var year = date.getFullYear();
  262. var month = date.getMonth() + 1;
  263. var hour = date.getHours();
  264. var minutes = date.getMinutes() ;
  265. var seconds = date.getSeconds();
  266. var strDate = date.getDate();
  267. if (month >= 1 && month <= 9) {
  268. month = "0" + month;
  269. }
  270. if (strDate >= 0 && strDate <= 9) {
  271. strDate = "0" + strDate;
  272. }
  273. if(hour >=1&& hour <= 9) {
  274. hour = "0" + hour;
  275. }
  276. if(minutes >=1&& minutes <= 9) {
  277. minutes = "0" + minutes;
  278. }
  279. if(seconds >=1&& seconds <= 9) {
  280. seconds = "0" + seconds;
  281. }
  282. _this.currentTime = year + '-' + month + '-' + strDate+" "+hour+":" +minutes+":" +seconds;
  283. }, 1000)
  284. },
  285. back() {
  286. this.$router.push('/')
  287. },
  288. init() {
  289. getFarmId().then(res => {
  290. if(res.code === 10000) {
  291. this.setFarmIdAsync(res.data);
  292. if(this.$route.name === 'Home') {
  293. this.title = this.getFarmName(this.farmId) + '数智驾驶舱'
  294. }
  295. localStorage.setItem('lastFarmId', res.data);
  296. this.refresh()
  297. }
  298. })
  299. },
  300. // 刷新拿到数据
  301. refresh() {
  302. getWeather({}).then(async res => {
  303. if(res.code === 10000) {
  304. this.weather = res.data;
  305. this.weatherInfo = JSON.parse(res.data.alarm)
  306. this.weatherList = [res.data.timeList, res.data.tempList]
  307. let params = {
  308. maxTem: res.data.max_degree,
  309. minTem: res.data.min_degree
  310. }
  311. await InfoWeater(params).then(res => {
  312. if(res.code === 10000) {
  313. this.alarm = res.data;
  314. }
  315. })
  316. }
  317. })
  318. },
  319. // 选择牧场
  320. onChange(val) {
  321. let params = {
  322. id: localStorage.getItem('UserId'),
  323. lastFarmId: val
  324. }
  325. localStorage.setItem('lastFarmId', val)
  326. findUpdate(params).then(res => {
  327. console.log(res)
  328. })
  329. this.setFarmIdAsync(val);
  330. setTimeout(() => {
  331. location.reload();
  332. }, 100)
  333. },
  334. openShow(num) {
  335. this.active = num;
  336. this.alarmType = true;
  337. if(num === 0) {
  338. this.str = this.alarm.maxTemStr;
  339. } else if(num === 1) {
  340. this.str = this.alarm.minTemStr
  341. } else {
  342. this.alarmInfo = this.weatherInfo[0].type_name + this.weatherInfo[0].level_name + '预警';
  343. this.str = this.weatherInfo[0].detail;
  344. }
  345. this.timer = setTimeout(() => {
  346. this.alarmType = false;
  347. }, 5000)
  348. },
  349. getFarmName() {
  350. let str = '';
  351. this.farmList.forEach(item => {
  352. if(item.id === this.farmId) {
  353. str = item.farmName
  354. }
  355. })
  356. return str
  357. },
  358. stopOut() {
  359. clearTimeout(this.timer);
  360. this.timer = null;
  361. },
  362. startOut() {
  363. this.timer = setTimeout(() => {
  364. this.alarmType = false;
  365. }, 5000)
  366. }
  367. },
  368. created() {
  369. this.GetFarm()
  370. },
  371. mounted() {
  372. this.init()
  373. if (this.$route.name === 'Home') {
  374. this.isHome = true;
  375. this.initTime();
  376. console.log(1111);
  377. console.log(this.farmId)
  378. } else {
  379. this.isHome = false;
  380. this.title = this.$route.meta.title;
  381. if(this.timer4) {
  382. clearInterval(this.timer4)
  383. }
  384. }
  385. }
  386. }
  387. </script>
  388. <style scoped>
  389. /deep/.el-input__inner {
  390. background-color: #0F152B !important;
  391. color: white !important;
  392. }
  393. .MainLayout {
  394. width: 100vw;
  395. height: 100vh;
  396. background: url("../assets/u1.jpg") no-repeat;
  397. background-size: 100% 100%;
  398. box-sizing: border-box;
  399. position: relative;
  400. }
  401. .content {
  402. width: 100%;
  403. height: 100%;
  404. background: url('../assets/home.png') no-repeat;
  405. background-size: 100% 100%;
  406. box-sizing: border-box;
  407. padding: 70px 60px;
  408. }
  409. .main-title {
  410. width: 230px;
  411. height: 25px;
  412. line-height: 25px;
  413. position: absolute;
  414. top: 25px;
  415. left: 50.5%;
  416. text-align: center;
  417. transform: translate(-50%, 0);
  418. color: #66FFFF;
  419. font-size: 22px;
  420. font-weight: 600;
  421. cursor: pointer;
  422. }
  423. .main-left {
  424. width: 180px;
  425. height: 40px;
  426. position: absolute;
  427. top: 0;
  428. left: 150px;
  429. }
  430. .main-right {
  431. width: 180px;
  432. height: 40px;
  433. position: absolute;
  434. top: 0;
  435. right: 125px;
  436. }
  437. .main-home {
  438. width: 100%;
  439. height: 100%;
  440. line-height: 40px;
  441. color: white;
  442. }
  443. .main-time {
  444. width: 100%;
  445. height: 100%;
  446. line-height: 50px;
  447. font-size: 16px;
  448. }
  449. .main-bottom {
  450. width: 200px;
  451. height: 50px;
  452. /*background-color: red;*/
  453. position: absolute;
  454. /*line-height: 50px;*/
  455. color: #66FFFF;
  456. font-size: 24px;
  457. font-weight: 600;
  458. left: 51%;
  459. bottom: 20px;
  460. transform: translate(-50% , 0);
  461. }
  462. .main-back {
  463. width: 140px;
  464. height: 30px;
  465. font-size: 14px;
  466. line-height: 30px;
  467. background: url("../assets/Home/u761.svg") no-repeat;
  468. background-size: 100% 100%;
  469. color: white;
  470. cursor: pointer;
  471. }
  472. #weather {
  473. background-color: rgba(0, 0, 0, .8);
  474. position: absolute;
  475. width: 700px;
  476. height: 700px;
  477. top: 0;
  478. }
  479. .weather1 {
  480. left: 0;
  481. }
  482. .weather2 {
  483. right: 0;
  484. }
  485. .moveL-enter-active,
  486. .moveL-leave-active {
  487. transition: all 0.3s linear;
  488. transform: translateX(0%);
  489. }
  490. .moveL-enter,
  491. .moveL-leave {
  492. transform: translateX(-100%);
  493. }
  494. .moveL-leave-to {
  495. transform: translateX(-100%);
  496. }
  497. .moveR-enter-active, .moveR-leave-active {
  498. transition: all 0.3s linear;
  499. transform: translateX(0);
  500. }
  501. .moveR-enter, .moveR-leave {
  502. transform: translateX(100%);
  503. }
  504. .moveR-leave-to{
  505. transform: translateX(100%);
  506. }
  507. .weatherBox {
  508. width: 100%;
  509. height: 100%;
  510. box-sizing: border-box;
  511. padding: 0 20px;
  512. display: flex;
  513. justify-content: center;
  514. align-items: center;
  515. cursor: pointer;
  516. }
  517. .box-left {
  518. width: 35px;
  519. height: 35px;
  520. }
  521. .box-right {
  522. width: 60px;
  523. height: 100%;
  524. margin-left: 20px;
  525. }
  526. .qing {
  527. width: 100%;
  528. height: 100%;
  529. display: inline-block;
  530. background: url("../assets/weather/qingtian.png") no-repeat;
  531. background-size: 100% 100%;
  532. }
  533. .fontSize {
  534. height: 20px;
  535. margin: 0;
  536. line-height: 20px;
  537. text-align: left;
  538. color: #28BCCA;
  539. }
  540. .duoyun {
  541. width: 100%;
  542. height: 100%;
  543. display: inline-block;
  544. background: url("../assets/weather/qingzhuanduoyun.png") no-repeat;
  545. background-size: 100% 100%;
  546. }
  547. .yin {
  548. width: 100%;
  549. height: 100%;
  550. display: inline-block;
  551. background: url("../assets/weather/yintian.png") no-repeat;
  552. background-size: 100% 100%;
  553. }
  554. .xiaoyu {
  555. width: 100%;
  556. height: 100%;
  557. display: inline-block;
  558. background: url("../assets/weather/xiaoyu.png") no-repeat;
  559. background-size: 100% 100%;
  560. }
  561. .zyu {
  562. width: 100%;
  563. height: 100%;
  564. display: inline-block;
  565. background: url("../assets/weather/zhongyu.png") no-repeat;
  566. background-size: 100% 100%;
  567. }
  568. .dyu {
  569. width: 100%;
  570. height: 100%;
  571. display: inline-block;
  572. background: url("../assets/weather/dayu.png") no-repeat;
  573. background-size: 100% 100%;
  574. }
  575. .byu {
  576. width: 100%;
  577. height: 100%;
  578. display: inline-block;
  579. background: url("../assets/weather/baoyu.png") no-repeat;
  580. background-size: 100% 100%;
  581. }
  582. .xxue{
  583. width: 100%;
  584. height: 100%;
  585. display: inline-block;
  586. background: url("../assets/weather/xiaoxue.png") no-repeat;
  587. background-size: 100% 100%;
  588. }
  589. .zxue{
  590. width: 100%;
  591. height: 100%;
  592. display: inline-block;
  593. background: url("../assets/weather/zhongxue.png") no-repeat;
  594. background-size: 100% 100%;
  595. }
  596. .dxue{
  597. width: 100%;
  598. height: 100%;
  599. display: inline-block;
  600. background: url("../assets/weather/daxue.png") no-repeat;
  601. background-size: 100% 100%;
  602. }
  603. .bxue{
  604. width: 100%;
  605. height: 100%;
  606. display: inline-block;
  607. background: url("../assets/weather/baoxue.png") no-repeat;
  608. background-size: 100% 100%;
  609. }
  610. .wu {
  611. width: 100%;
  612. height: 100%;
  613. display: inline-block;
  614. background: url("../assets/weather/wu.png") no-repeat;
  615. background-size: 100% 100%;
  616. }
  617. .time {
  618. position: absolute;
  619. bottom: 35px;
  620. right: 80px;
  621. line-height: 50px;
  622. font-size: 16px;
  623. color: #289882
  624. }
  625. .bio-dialog {
  626. width: 100%;
  627. height: 100%;
  628. position: absolute;
  629. top: 0;
  630. left: 0;
  631. background-color: rgba(0,0,0, .9);
  632. z-index: 999;
  633. }
  634. .dialog-content {
  635. width: 30%;
  636. position: absolute;
  637. top: 50%;
  638. left: 50%;
  639. transform: translate(-50%, -70%);
  640. border: 1px solid #ddd;
  641. box-sizing: border-box;
  642. padding: 20px;
  643. color: #fff;
  644. text-align: center;
  645. }
  646. .div-text {
  647. width: 400px;
  648. height: 60px;
  649. background: url("../assets/101.png") no-repeat;
  650. background-size: 100% 100%;
  651. line-height: 60px;
  652. margin: 20px auto;
  653. font-size: 20px;
  654. color: white;
  655. text-align: center;
  656. border-bottom: 1px solid #53bafd;
  657. cursor: pointer;
  658. }
  659. .div-text:hover {
  660. background-color: white;
  661. color: #53bafd;
  662. cursor: pointer;
  663. }
  664. .farm {
  665. /*width: 200px;*/
  666. height: 40px;
  667. /*background-color: red;*/
  668. position: absolute;
  669. bottom: 40px;
  670. left: 60px;
  671. line-height: 40px;
  672. text-align: left;
  673. color: #fff;
  674. font-size: 16px;
  675. }
  676. .maxTem {
  677. display: inline-block;
  678. width: 24px;
  679. height: 24px;
  680. background: url('../assets/Home/gaowen.png');
  681. background-size: contain;
  682. margin-top: 10px;
  683. cursor: pointer;
  684. }
  685. .minTem {
  686. display: inline-block;
  687. width: 24px;
  688. height: 24px;
  689. background: url('../assets/Home/diwen.png');
  690. background-size: contain;
  691. margin-top: 10px;
  692. cursor: pointer;
  693. }
  694. .shan {
  695. display: inline-block;
  696. width: 24px;
  697. height: 24px;
  698. background: url('../assets/Home/shandian.png');
  699. background-size: contain;
  700. margin-top: 10px;
  701. cursor: pointer;
  702. }
  703. .hanchao {
  704. display: inline-block;
  705. width: 24px;
  706. height: 24px;
  707. background: url('../assets/weather/hanchao.png');
  708. background-size: contain;
  709. margin-top: 10px;
  710. cursor: pointer;
  711. }
  712. .taifeng {
  713. display: inline-block;
  714. width: 24px;
  715. height: 24px;
  716. background: url('../assets/weather/taifeng.png');
  717. background-size: contain;
  718. margin-top: 10px;
  719. cursor: pointer;
  720. }
  721. .dafeng {
  722. display: inline-block;
  723. width: 24px;
  724. height: 24px;
  725. background: url('../assets/weather/dafeng.png');
  726. background-size: contain;
  727. margin-top: 10px;
  728. cursor: pointer;
  729. }
  730. .alarmlist {
  731. width: 200px;
  732. height: 100px;
  733. position: absolute;
  734. bottom: 500px;
  735. right: 100px;
  736. border: 1px solid red;
  737. animation: myfirst 1s;
  738. }
  739. .alarmText {
  740. width: 300px;
  741. height: 200px;
  742. position: absolute;
  743. bottom: 400px;
  744. right: 50px;
  745. border: 1px solid red;
  746. animation: myfirst 1s;
  747. }
  748. @keyframes myfirst {
  749. 0% {
  750. opacity: 0;
  751. }
  752. 100% {
  753. opacity: 1;
  754. }
  755. }
  756. .weatherList {
  757. width: 100%;
  758. height: 200px;
  759. display: grid;
  760. grid-template-columns: repeat(3, 1fr);
  761. grid-template-rows: 1fr;
  762. grid-column-gap: 0;
  763. grid-row-gap: 0;
  764. }
  765. .grid {
  766. width: 100%;
  767. height: 100%;
  768. color: white;
  769. }
  770. .grid-title {
  771. line-height: 50px;
  772. font-size: 24px;
  773. }
  774. .grid-content {
  775. box-sizing: border-box;
  776. line-height: 30px;
  777. font-size: 16px;
  778. text-align: left;
  779. padding-left: 80px;
  780. }
  781. .dayWeather {
  782. color: white;
  783. text-align: left;
  784. }
  785. .weatherTitle {
  786. font-size: 16px;
  787. box-sizing: border-box;
  788. padding-left: 50px;
  789. }
  790. .weatherTitle > strong {
  791. font-size: 24px;
  792. }
  793. .dayFlex {
  794. width: 100%;
  795. display: flex;
  796. align-items: center;
  797. }
  798. .FlexIcon {
  799. width: 200px;
  800. height: 90px;
  801. box-sizing: border-box;
  802. margin-left: 50px;
  803. display: flex;
  804. align-items: center;
  805. }
  806. .FlexIcon > span {
  807. font-size: 36px;
  808. padding-left: 20px;
  809. display: inline-block;
  810. }
  811. .maxSize {
  812. width: 90px;
  813. height: 90px;
  814. }
  815. .FlexInfo {
  816. margin-left: 30px;
  817. font-size: 18px;
  818. cursor: pointer;
  819. }
  820. .chart {
  821. width: 100%;
  822. height: calc(100% - 400px);
  823. }
  824. .weatherGrid {
  825. width: 100%;
  826. box-sizing: border-box;
  827. height: 200px;
  828. display: grid;
  829. grid-template-columns: repeat(4, 1fr);
  830. grid-template-rows: 1fr;
  831. grid-column-gap: 0;
  832. grid-row-gap: 0;
  833. padding: 0 50px;
  834. }
  835. .weatherGrid > div {
  836. width: 100%;
  837. height: 100%;
  838. border: 1px solid #ddd;
  839. color: #fff;
  840. box-sizing: border-box;
  841. padding-top: 10px;
  842. font-size: 18px;
  843. }
  844. .weatherGrid > div:nth-child(2) {
  845. border-left: none;
  846. border-right: none;
  847. }
  848. .weatherGrid > div:nth-child(3) {
  849. border-right: none;
  850. }
  851. .weatherGrid > div > p {
  852. margin-top: 0;
  853. margin-bottom: 10px;
  854. }
  855. .minSize {
  856. width: 24px;
  857. height: 24px;
  858. cursor: pointer;
  859. }
  860. </style>