From 16585194cd58510c34b9925cf3c8248f73ae84a9 Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Wed, 11 Oct 2023 15:46:36 +0800 Subject: [PATCH] fix:风场粒子修改 --- src/views/main/index.vue | 146 +++++++++++++++++++----------------------------- 1 files changed, 58 insertions(+), 88 deletions(-) diff --git a/src/views/main/index.vue b/src/views/main/index.vue index c694ae5..e8bcd35 100644 --- a/src/views/main/index.vue +++ b/src/views/main/index.vue @@ -154,27 +154,27 @@ const lineChartData = { newVisitis: { expectedData: [100, 120, 161, 134, 105, 160, 165], - actualData: [120, 82, 91, 154, 162, 140, 145], + actualData: [120, 82, 91, 154, 162, 140, 145] }, messages: { expectedData: [200, 192, 120, 144, 160, 130, 140], - actualData: [180, 160, 151, 106, 145, 150, 130], + actualData: [180, 160, 151, 106, 145, 150, 130] }, purchases: { expectedData: [80, 100, 121, 104, 105, 90, 100], - actualData: [120, 90, 100, 138, 142, 130, 130], + actualData: [120, 90, 100, 138, 142, 130, 130] }, shoppings: { expectedData: [130, 140, 141, 142, 145, 150, 160], - actualData: [120, 82, 91, 154, 162, 140, 130], - }, + actualData: [120, 82, 91, 154, 162, 140, 130] + } } export default { components: { Map, LineChart, Charts, - ReportForm, + ReportForm // vLineChart }, data() { @@ -196,66 +196,35 @@ jingdu: 0, weidu: 0, options: [], - newRegion: [], + newRegion: [] } }, computed: { changeCity() { return this.$store.state.regionCode - }, + } }, watch: { searchText(newVal, oldVal) { // console.log(oldVal) // console.log(newVal) // defaultData��������������������������� - // this.openeds="['1','2','3']" + this.openeds = [] + let ke = 1 if (newVal !== oldVal) { - // let that = this - const newDefaultData = [ - { - name: '', - devices: [], - }, - ] - let ke = 1 - this.defaultData.forEach((v, k, a) => { - for (let i = 0; i < v.devices.length; i++) { - // console.log(v.devices[i].name) - if (v.devices[i].name.match(newVal)) { - // console.log(v) - // console.log('������') - this.openeds.push((ke++).toString()) - // return value.devices[i].name.match(newVal) - newDefaultData[k].name = this.defaultData[k].name - newDefaultData[k].devices.push(v.devices[i]) - // this.$set(newDefaultData[k], 'name', this.defaultData[k].name) - // this.$set(newDefaultData[k], 'devices', v.devices[i]) - // console.log(newDefaultData) - } else { - // console.log('���������') - // return value.name.match(newVal) + 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) } - // console.log(newDefaultData) } - }) - // const newDevices = this.defaultData.filter(value => { - // const newDevices = this.defaultData.filter(value => { - // for (let i = 0; i < value.devices.length; i++) { - // console.log(value.devices[i].name) - // if (value.devices[i].name.match(newVal)) { - // console.log('������') - // this.openeds.push((ke++).toString()) - // return value.devices[i].name.match(newVal) - // this.newDefaultData.push(value.devices[i].name.match(newVal)) - // } else { - // console.log('���������') - // return value.name.match(newVal) - // } - // } - // }) - // console.log(this.openeds) - this.defaultData = newDefaultData + } + this.defaultData = arr } if (newVal === '') { this.defaultData = this.defaultDataMiddle @@ -269,7 +238,7 @@ // this.newRegion = newVal this.getRegionApi() } - }, + } }, beforeCreate() { // this.$store.state.regionCode = this.$route.params.cName @@ -279,6 +248,7 @@ this.getRegion() }, methods: { + // ��������������������������������� bd09togcj02(bd_lon, bd_lat) { var x_pi = (3.14159265358979324 * 3000.0) / 180.0 @@ -303,39 +273,39 @@ }, // ��������������������� deviceDetail(mac, item, items, indexs) { - this.$message.warning('���������������������������������������') + // this.$message.warning('���������������������������������������') // console.log('������������������������') // console.log(mac) // console.log(item) // console.log(items) // console.log(indexs) - // this.monitorPointInfo = item - // // console.log(this.monitorPointInfo) - // // this.$router.push({ - // // path: '/deviceDetail/index', - // // query: { - // // macName: mac - // // } - // // }) - // // console.log('items') - // // console.log(items) + this.monitorPointInfo = item + // console.log(this.monitorPointInfo) // this.$router.push({ - // name: 'deviceDetail', - // params: { - // monitorPointInfo: item, - // device: items, - // macName: mac, - // indexs: indexs, - // items: [items.latitude, items.longitude], - // }, + // path: '/deviceDetail/index', // query: { - // monitorPointInfo: JSON.stringify(item), - // device: JSON.stringify(items), - // macName: mac, - // indexs: indexs, - // items: [items.latitude, items.longitude], - // }, + // macName: mac + // } // }) + // console.log('items') + // console.log(items) + this.$router.push({ + name: 'deviceDetail', + params: { + monitorPointInfo: item, + device: items, + macName: mac, + indexs: indexs, + items: [items.latitude, items.longitude] + }, + query: { + monitorPointInfo: JSON.stringify(item), + device: JSON.stringify(items), + macName: mac, + indexs: indexs, + items: [items.latitude, items.longitude] + } + }) }, // ������regionCode������������������������������������������������ getRegionApi() { @@ -353,12 +323,12 @@ getData() { this.monitorPointIds = [] this.$request({ - url: '/monitorPoint/queryMonitorPoints', + url: '/monitorPoint/queryMonitorPointsState', method: 'get', params: { organizationId: this.organizationId, - regionCode: this.$store.state.regionCode, - }, + regionCode: this.$store.state.regionCode + } }) .then((res) => { console.log(res, '123') @@ -415,8 +385,8 @@ url: '/organization/getMapPath', method: 'get', params: { - organizationId: this.$store.state.orgId, - }, + organizationId: this.$store.state.orgId + } }) .then((res) => { // console.log('������������getMapPath������') @@ -426,19 +396,19 @@ for (let i = 0; i < data.length; i++) { this.options.push({ value: data[i].provinceCode, - label: data[i].provinceName, + label: data[i].provinceName }) this.options[i].children = [] for (let j = 0; j < data[i].cities.length; j++) { this.options[i].children.push({ value: data[i].cities[j].cityCode, - label: data[i].cities[j].cityName, + label: data[i].cities[j].cityName }) this.options[i].children[j].children = [] for (let k = 0; k < data[i].cities[j].areas.length; k++) { this.options[i].children[j].children.push({ value: data[i].cities[j].areas[k].areaCode, - label: data[i].cities[j].areas[k].areaName, + label: data[i].cities[j].areas[k].areaName }) } } @@ -449,7 +419,7 @@ console.log(err) }) // console.log('������Region������') - }, + } // ������������������ // getMap() { // axios.get('http://47.99.64.149:8080/screen_api_v2/screen/newMap-page?areaCode=130900&accountId=223') @@ -461,7 +431,7 @@ // console.log('������') // }) // } - }, + } } </script> -- Gitblit v1.8.0