| | |
| | | <template> |
| | | <div class="chartCon" @click="toParentPage"> |
| | | <div class="chartCon"> |
| | | <div class="chartItem"> |
| | | <pross-pie-chart id="prossPieChart0" ref="prossPieChart0"></pross-pie-chart> |
| | | </div> |
| | |
| | | </div> |
| | | <div class="chartItem"> |
| | | <pross-pie-chart id="prossPieChart3" ref="prossPieChart3"></pross-pie-chart> |
| | | </div> |
| | | <div class="chartItem"> |
| | | <pross-pie-chart id="prossPieChart4" ref="prossPieChart4"></pross-pie-chart> |
| | | </div> |
| | | <div class="chartItem"> |
| | | <pross-pie-chart id="prossPieChart5" ref="prossPieChart5"></pross-pie-chart> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | |
| | | }, |
| | | methods: { |
| | | toParentPage() { |
| | | window.parent.parent.postMessage({ |
| | | cmd: "syncPage", |
| | | params: { |
| | | pageInfo: { |
| | | label: "电源实时告警", |
| | | name: "powerRealtimeInfo", |
| | | src: "#/powerRealtimeInfo", |
| | | closable: true |
| | | }, |
| | | } |
| | | }, "*"); |
| | | }, |
| | | setData(data) { |
| | | this.$nextTick(() => { |
| | | if (data) { |
| | |
| | | if (res.code == 1) { |
| | | let optionData = [{ |
| | | title: '', |
| | | name: '', |
| | | data: 0, |
| | | unit: '', |
| | | color: '#37a9b3', |
| | | }, { |
| | | title: '', |
| | | name: '', |
| | | data: 0, |
| | | unit: '', |
| | | color: '#f3535f' |
| | | }, { |
| | | title: '', |
| | | name: '', |
| | | data: 0, |
| | | unit: '', |
| | | color: '#ff8b00' |
| | | }, { |
| | | title: '', |
| | | name: '', |
| | | data: 0, |
| | | unit: '', |
| | | color: '#757ffb' |
| | | }, { |
| | | title: '', |
| | | data: 0, |
| | | unit: '', |
| | | color: '#4ba0d9' |
| | | }, { |
| | | title: '', |
| | | data: 0, |
| | | unit: '', |
| | | color: '#7fc57c' |
| | | }] |
| | | },] |
| | | let index = 0; |
| | | let resData = res.data; |
| | | for (let key in resData) { |
| | | optionData[index].title = key; |
| | | optionData[index].name = key; |
| | | if (typeof resData[key] == 'string') { |
| | | optionData[index].data = Number(resData[key].split('%')[0]); |
| | | optionData[index].unit = '%'; |
| | |
| | | this.$refs.prossPieChart1.resize(); |
| | | this.$refs.prossPieChart2.resize(); |
| | | this.$refs.prossPieChart3.resize(); |
| | | this.$refs.prossPieChart4.resize(); |
| | | this.$refs.prossPieChart5.resize(); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | .chartCon .chartItem { |
| | | width: 50%; |
| | | height: 31.333%; |
| | | height: 48%; |
| | | float: left; |
| | | margin-bottom: 2%; |
| | | } |