{"remainingRequest":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\jd_cgpt_fvue\\src\\views\\BigScreen\\headline.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\src\\views\\BigScreen\\headline.vue","mtime":1701745912029},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\jd_cgpt_fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport commomAPI from '@/api/bigScreen/common.js'\r\nimport utils from '@/utils'\r\nimport moment from 'moment'\r\nexport default {\r\n name: 'bigScreen',\r\n data() {\r\n return {\r\n menuData: [],\r\n workPlatMenu: [],\r\n showWorkPlat: false,\r\n timenow: '',\r\n daynow: '',\r\n weathernow: '',\r\n activeIndex: '1',\r\n weatherIcon: '',\r\n hournow: '',\r\n workPlatData: [],\r\n menuActived: '',\r\n timer: null,\r\n }\r\n },\r\n mounted() {\r\n this.menuActived = this.$route.name\r\n this.getTimeNow()\r\n this.getWeather()\r\n this.getMenu()\r\n },\r\n methods: {\r\n getWeather() {\r\n let ss = sessionStorage.getItem('weathernow')\r\n if (ss) {\r\n this.getWeatherIcon(JSON.parse(ss))\r\n } else {\r\n commomAPI\r\n .queryWeather()\r\n .then((res) => {\r\n console.log('res', res)\r\n // console.log('获取的数据' + res.data.lives[0].weather)\r\n this.weathernow = res.data.lives[0].weather\r\n this.getWeatherIcon(this.weathernow)\r\n sessionStorage.setItem(\r\n 'weathernow',\r\n JSON.stringify(this.weathernow)\r\n )\r\n })\r\n .catch((err) => {\r\n console.log('err', err)\r\n })\r\n }\r\n },\r\n getMenu() {\r\n this.$store.dispatch('menu/actionFrontMenus').then((data) => {\r\n let bigScreen =\r\n data && data.filter((item) => item.alias === 'bigScreen')\r\n\r\n if (bigScreen[0].children.length !== 0) {\r\n bigScreen[0].children.forEach((item) => {\r\n if (item.alias != 'workPlat') {\r\n this.menuData.push(item)\r\n } else {\r\n this.workPlatMenu.push(item)\r\n }\r\n })\r\n if (this.workPlatMenu.length) this.showWorkPlat = true\r\n }\r\n })\r\n },\r\n // 切换不同大屏菜单\r\n enterMenu(alias) {\r\n if (alias == 'workPlat') {\r\n return\r\n } else {\r\n this.$router.push({\r\n path: '/' + alias,\r\n })\r\n }\r\n },\r\n // 切换工作台\r\n changeNormal(item) {\r\n console.log('我切换了', item)\r\n if (item.alias == 'normal') {\r\n if (\r\n item.children[0].length !== 0 &&\r\n item.children[0].children.length\r\n ) {\r\n this.$router.push({\r\n path: `/platLayout/${item.children[0].children[0].alias}`,\r\n })\r\n } else {\r\n this.$router.push({\r\n path: `/platLayout/${item.children[0].alias}`,\r\n })\r\n }\r\n }\r\n },\r\n // 退出登陆\r\n handleLogout() {\r\n this.$store.dispatch('menu/clearMenus')\r\n this.$store.dispatch('user/clearUser')\r\n this.$store.dispatch('menu/setCopyMenus', []) //菜单\r\n let loginRouthPath =\r\n localStorage.getItem(\r\n this.$store.state.login.currentUser.account +\r\n 'loginRoutePath'\r\n ) || '/login'\r\n this.$store.dispatch('login/logoutAndCleanUp').then(() => {\r\n switch (window.ssoConfig.mode) {\r\n case 'cas':\r\n case 'oauth':\r\n window.sessionStorage.removeItem('currentUser')\r\n window.location.href =\r\n window.ssoConfig.logout +\r\n '?service=' +\r\n window.location.href.split('?')[0]\r\n break\r\n default:\r\n this.$router.push({\r\n path: loginRouthPath,\r\n })\r\n break\r\n }\r\n })\r\n },\r\n // 实时获取\r\n getTimeNow() {\r\n this.daynow = moment().format('YYYY年MM月DD日')\r\n this.timenow = moment().format('hh:mm:ss')\r\n this.timer = setInterval(() => {\r\n this.timenow = moment().format('hh:mm:ss')\r\n }, 1000)\r\n },\r\n clear() {\r\n clearInterval(this.timer)\r\n },\r\n // 工作台二级菜单\r\n handleSelect(key, keyPath) {\r\n console.log(key, keyPath)\r\n },\r\n // 获取天气icon\r\n getWeatherIcon(weather) {\r\n this.hournow = moment().format('hh') // 获取时间 判断半天黑夜\r\n this.weathernow = weather\r\n if (\r\n this.hournow > 6 &&\r\n this.hournow < 19 &&\r\n this.weathernow == '晴'\r\n ) {\r\n this.weatherIcon = require('@/assets/img/weather/qing.png')\r\n } else if (\r\n this.hournow > 6 &&\r\n this.hournow < 19 &&\r\n this.weathernow == '多云'\r\n ) {\r\n this.weatherIcon = require('@/assets/img/weather/duoyun.png')\r\n } else if (this.weathernow == '阴') {\r\n this.weatherIcon = require('@/assets/img/weather/yin.png')\r\n } else if (this.weathernow == '霾') {\r\n this.weatherIcon = require('@/assets/img/weather/yin.png')\r\n } else if (this.weathernow == '雷阵雨') {\r\n this.weatherIcon = require('@/assets/img/weather/leizhenyu.png')\r\n } else if (this.weathernow == '雨') {\r\n this.weatherIcon = require('@/assets/img/weather/xiaoyu.png')\r\n } else if (this.weathernow == '小雨') {\r\n this.weatherIcon = require('@/assets/img/weather/xiaoyu.png')\r\n } else if (this.weathernow == '中雨') {\r\n this.weatherIcon = require('@/assets/img/weather/zhongyu.png')\r\n } else if (this.weathernow == '大雨') {\r\n this.weatherIcon = require('@/assets/img/weather/dayu.png')\r\n } else if (this.weathernow == '暴雨') {\r\n this.weatherIcon = require('@/assets/img/weather/baoyu.png')\r\n } else if (this.weathernow == '大暴雨') {\r\n this.weatherIcon = require('@/assets/img/weather/baoyu.png')\r\n } else if (\r\n this.weathernow == '中雨-大雨' ||\r\n this.weathernow == '小雨-中雨' ||\r\n this.weathernow == '大雨-暴雨' ||\r\n this.weathernow == '暴雨-大暴雨'\r\n ) {\r\n this.weatherIcon = require('@/assets/img/weather/dayu.png')\r\n } else if (this.weathernow.indexOf('风') != -1) {\r\n this.weatherIcon = require('@/assets/img/weather/dafeng.png')\r\n } else if (\r\n this.hournow < 6 &&\r\n this.hournow > 19 &&\r\n this.weathernow == '多云'\r\n ) {\r\n this.weatherIcon = require('@/assets/img/weather/duoyunye.png')\r\n } else if (\r\n this.hournow < 6 &&\r\n this.hournow > 19 &&\r\n this.weathernow == '晴'\r\n ) {\r\n this.weatherIcon = require('@/assets/img/weather/qingye.png')\r\n } else {\r\n this.weatherIcon = require('@/assets/img/weather/yin.png')\r\n }\r\n },\r\n beforeDestroy() {\r\n this.clear()\r\n },\r\n },\r\n}\r\n",null]}