| | |
| | | <template> |
| | | <div class="dashboard-container" style="height: 100%"> |
| | | <div |
| | | class="dashboard-container" |
| | | style="height: 100%" |
| | | > |
| | | <el-container style="height: 100%; border: 1px solid #eee"> |
| | | <el-aside |
| | | v-if="this.$store.state.aside" |
| | | v-if="$store.state.aside" |
| | | width="260px" |
| | | style="background-color: rgb(238, 241, 246)" |
| | | > |
| | |
| | | prefix-icon="el-icon-search" |
| | | /> |
| | | </div> |
| | | <el-menu :default-openeds="openeds" class="elwidth"> |
| | | <el-menu |
| | | :default-openeds="openeds" |
| | | class="elwidth" |
| | | > |
| | | <el-submenu |
| | | v-for="(item, index) in defaultData" |
| | | :key="index" |
| | |
| | | 'circle-3': item.state == 3, |
| | | 'circle-4': item.state == 4, |
| | | 'circle-5': item.state == 5, |
| | | 'circle-6': item.state == 6, |
| | | 'circle-6': item.state >= 6, |
| | | }" |
| | | /> |
| | | |
| | |
| | | 'circle-3': items.state == 3, |
| | | 'circle-4': items.state == 4, |
| | | 'circle-5': items.state == 5, |
| | | 'circle-6': items.state == 6, |
| | | 'circle-6': items.state >= 6, |
| | | }" |
| | | /> |
| | | <span>{{ items.name }}</span> |
| | |
| | | <el-container> |
| | | <!-- <Map :mpid="monitorPointId" :rc="regionCode" /> --> |
| | | <compoment |
| | | :is="this.$store.state.type" |
| | | :is="$store.state.type" |
| | | v-if="weidu && jingdu" |
| | | ref="child" |
| | | :weidu="weidu" |
| | |
| | | <script> |
| | | // import Cookies from 'js-cookie' |
| | | import '@/assets/icon/iconfont.css' |
| | | import _ from 'lodash' |
| | | // import $ from 'jquery' |
| | | import Map from '@/components/Wind/Map.vue' |
| | | import LineChart from '@/components/Echarts/LineChart' |
| | |
| | | ReportForm |
| | | // vLineChart |
| | | }, |
| | | data() { |
| | | data () { |
| | | return { |
| | | openeds: [], |
| | | searchText: '', |
| | |
| | | } |
| | | }, |
| | | computed: { |
| | | changeCity() { |
| | | changeCity () { |
| | | return this.$store.state.regionCode |
| | | } |
| | | }, |
| | | watch: { |
| | | searchText(newVal, oldVal) { |
| | | // console.log(oldVal) |
| | | searchText (newVal, oldVal) { |
| | | console.log(typeof (newVal)) |
| | | // console.log(newVal) |
| | | // defaultData是站点名,包含设备 |
| | | const copyData = _.cloneDeep(this.defaultDataMiddle) |
| | | this.defaultData = copyData |
| | | this.openeds = [] |
| | | const arr = [] |
| | | let ke = 1 |
| | | const jList = [] |
| | | if (newVal === '') { |
| | | this.defaultData = copyData |
| | | this.openeds = [] |
| | | return |
| | | } |
| | | if (newVal !== oldVal) { |
| | | var arr = [] |
| | | for (var i = 0; i < this.defaultData.length; i++) { |
| | | this.openeds.push((ke++).toString()) |
| | | for (var j = 0; j < this.defaultData[i].devices.length; j++) { |
| | | if (this.defaultData[i].devices[j].name.indexOf(newVal) >= 0) { |
| | | let a = [] |
| | | a = this.defaultData[i] |
| | | a.devices = [this.defaultData[i].devices[j]] |
| | | arr.push(a) |
| | | if (this.defaultData[i].devices[j].name.indexOf(newVal.toUpperCase()) >= 0) { |
| | | this.openeds.push((ke++).toString()) |
| | | jList.push(this.defaultData[i].devices[j]) |
| | | } |
| | | } |
| | | |
| | | console.log(arr) |
| | | } |
| | | this.defaultData = arr |
| | | } |
| | | if (newVal === '') { |
| | | this.defaultData = this.defaultDataMiddle |
| | | this.openeds = [] |
| | | this.defaultData = jList |
| | | console.log(this.defaultData) |
| | | } |
| | | }, |
| | | changeCity(newVal, oldVal) { |
| | | changeCity (newVal, oldVal) { |
| | | // console.log(newVal) |
| | | if (newVal !== oldVal) { |
| | | // this.$store.state.regionCode = newVal |
| | |
| | | } |
| | | } |
| | | }, |
| | | beforeCreate() { |
| | | beforeCreate () { |
| | | // this.$store.state.regionCode = this.$route.params.cName |
| | | }, |
| | | created() { |
| | | created () { |
| | | this.getData() |
| | | this.getRegion() |
| | | }, |
| | | methods: { |
| | | |
| | | // 百度经纬度转高德经纬度 |
| | | bd09togcj02(bd_lon, bd_lat) { |
| | | bd09togcj02 (bd_lon, bd_lat) { |
| | | var x_pi = (3.14159265358979324 * 3000.0) / 180.0 |
| | | var x = bd_lon - 0.0065 |
| | | var y = bd_lat - 0.006 |
| | |
| | | return [gg_lat, gg_lng] |
| | | }, |
| | | // 父组件点击站点列表子组件跳转地图方法 |
| | | jump(items) { |
| | | jump (items) { |
| | | console.log(items) |
| | | this.jumpData = [] |
| | | // const newLL = this.bd09togcj02(items.longitude, items.latitude) |
| | |
| | | this.$refs.child.jumpMap(this.jumpData) |
| | | }, |
| | | // 跳转设备详情页 |
| | | deviceDetail(mac, item, items, indexs) { |
| | | deviceDetail (mac, item, items, indexs) { |
| | | // this.$message.warning('该功能优化中,暂不支持开放') |
| | | // console.log('这是传输过去的值') |
| | | // console.log(mac) |
| | |
| | | }) |
| | | }, |
| | | // 改变regionCode触发子组件重新请求五分钟接口功能 |
| | | getRegionApi() { |
| | | getRegionApi () { |
| | | // console.log('执行getRegionApi') |
| | | // console.log(this.newRegion[this.newRegion.length - 1]) |
| | | this.$store.state.regionCode = this.newRegion[this.newRegion.length - 1] |
| | |
| | | console.log(this.jingdu, '经度') |
| | | }, |
| | | // 请求左侧设备数据 |
| | | getData() { |
| | | getData () { |
| | | this.monitorPointIds = [] |
| | | this.$request({ |
| | | url: '/monitorPoint/queryMonitorPointsState', |
| | |
| | | this.defaultData = [] |
| | | }) |
| | | }, |
| | | getRegion() { |
| | | getRegion () { |
| | | this.$request({ |
| | | url: '/organization/getMapPath', |
| | | method: 'get', |