|
@@ -1,88 +1,97 @@
|
|
|
<template>
|
|
|
- <div class="modelBlock">
|
|
|
- <template v-if="permissionFiltering">
|
|
|
- <div class="model-title">
|
|
|
- <div class="model-title-text">设备告警趋势(近一个月)</div>
|
|
|
- </div>
|
|
|
- <div class="model-content">
|
|
|
- <zz-echart :option="clientOptions" class="chart"></zz-echart>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <no-permission v-else tipsText="设备告警趋势"></no-permission>
|
|
|
- </div>
|
|
|
+ <div class="modelBlock">
|
|
|
+ <template v-if="permissionFiltering">
|
|
|
+ <div class="model-title">
|
|
|
+ <div class="model-title-text">设备告警趋势(近一个月)</div>
|
|
|
+ </div>
|
|
|
+ <div class="model-content">
|
|
|
+ <zz-echart
|
|
|
+ :option="clientOptions"
|
|
|
+ class="chart"
|
|
|
+ ></zz-echart>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <no-permission
|
|
|
+ v-else
|
|
|
+ tipsText="设备告警趋势"
|
|
|
+ ></no-permission>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import { discountedWave } from './indexOptionChart';
|
|
|
import permissionComponent from './permissionComponent';
|
|
|
let dataArr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
|
let dataDay = [
|
|
|
- '01-01',
|
|
|
- '01-02',
|
|
|
- '01-03',
|
|
|
- '01-04',
|
|
|
- '01-05',
|
|
|
- '01-06',
|
|
|
- '01-07',
|
|
|
- '01-08',
|
|
|
- '01-09',
|
|
|
- '01-10',
|
|
|
- '01-11',
|
|
|
- '01-12',
|
|
|
- '01-13',
|
|
|
- '01-14',
|
|
|
- '01-15',
|
|
|
- '01-16',
|
|
|
- '01-17',
|
|
|
- '01-18',
|
|
|
- '01-19',
|
|
|
- '01-20',
|
|
|
- '01-21',
|
|
|
- '01-22',
|
|
|
- '01-23',
|
|
|
- '01-24',
|
|
|
- '01-25',
|
|
|
- '01-26',
|
|
|
- '01-27',
|
|
|
- '01-28',
|
|
|
- '01-29',
|
|
|
- '01-30',
|
|
|
- '01-31'
|
|
|
+ '01-01',
|
|
|
+ '01-02',
|
|
|
+ '01-03',
|
|
|
+ '01-04',
|
|
|
+ '01-05',
|
|
|
+ '01-06',
|
|
|
+ '01-07',
|
|
|
+ '01-08',
|
|
|
+ '01-09',
|
|
|
+ '01-10',
|
|
|
+ '01-11',
|
|
|
+ '01-12',
|
|
|
+ '01-13',
|
|
|
+ '01-14',
|
|
|
+ '01-15',
|
|
|
+ '01-16',
|
|
|
+ '01-17',
|
|
|
+ '01-18',
|
|
|
+ '01-19',
|
|
|
+ '01-20',
|
|
|
+ '01-21',
|
|
|
+ '01-22',
|
|
|
+ '01-23',
|
|
|
+ '01-24',
|
|
|
+ '01-25',
|
|
|
+ '01-26',
|
|
|
+ '01-27',
|
|
|
+ '01-28',
|
|
|
+ '01-29',
|
|
|
+ '01-30',
|
|
|
+ '01-31'
|
|
|
];
|
|
|
export default {
|
|
|
- mixins: [permissionComponent],
|
|
|
- data() {
|
|
|
- return {
|
|
|
- defaultModel: {
|
|
|
- permissUrl: '16',
|
|
|
- titleName: '告警管理'
|
|
|
- },
|
|
|
- clientOptions: discountedWave('(次)', dataDay, dataArr),
|
|
|
- mixins_query: {
|
|
|
- communityId: ''
|
|
|
- }
|
|
|
- };
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.getData();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getData() {
|
|
|
- this.$http
|
|
|
- .get('/sc-community/statisticWarnTrend', this.mixins_query)
|
|
|
- .then(({ status, data, msg }) => {
|
|
|
- if (status == 0) {
|
|
|
- let dateTime = [],
|
|
|
- valueArr = [];
|
|
|
- data.map((item) => {
|
|
|
- dateTime.push(item.date);
|
|
|
- valueArr.push(item.data);
|
|
|
- });
|
|
|
- this.clientOptions = discountedWave('(次)', dateTime, valueArr);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {});
|
|
|
- }
|
|
|
+ mixins: [permissionComponent],
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ defaultModel: {
|
|
|
+ permissUrl: '16',
|
|
|
+ titleName: '告警管理'
|
|
|
+ },
|
|
|
+ clientOptions: discountedWave('(次)', dataDay, dataArr),
|
|
|
+ mixins_query: {
|
|
|
+ communityId: ''
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getData () {
|
|
|
+ this.$http
|
|
|
+ //sc-community/statisticWarnTrend
|
|
|
+ .get('/sc-community-web/countDeviceAlarmLast30Days', this.mixins_query)
|
|
|
+ .then(({ status, data, msg }) => {
|
|
|
+ if (status == 0) {
|
|
|
+ let dateTime = [],
|
|
|
+ valueArr = [];
|
|
|
+ data.map((item) => {
|
|
|
+ dateTime.push(item.date);
|
|
|
+ valueArr.push(item.total);
|
|
|
+ // valueArr.push(item.data);
|
|
|
+
|
|
|
+ });
|
|
|
+ this.clientOptions = discountedWave('(次)', dateTime, valueArr);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => { });
|
|
|
}
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|