| | |
| | | return request({ |
| | | url: '/api/blade-jfpts/alarm/alarm/getChartData', |
| | | method: 'get', |
| | | data: row |
| | | params: { |
| | | ...row, |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | return request({ |
| | | url: '/api/blade-jfpts/alarm/alarm/getChartDataAlarm', |
| | | method: 'get', |
| | | data: row |
| | | params: { |
| | | ...row |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | return request({ |
| | | url: '/api/blade-jfpts/alarm/alarm/getChartDataAlarmBs', |
| | | method: 'get', |
| | | data: row |
| | | params: { |
| | | ...row |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | </avue-crud> |
| | | |
| | | <el-row v-show="switchChartType == 1"> |
| | | <el-button |
| | | v-bind:class="activeClass == 0 ? 'btn-color' : ''" |
| | | size="small" |
| | | @click="getswitchChartdate(0)" |
| | | >本日 |
| | | </el-button> |
| | | <el-button |
| | | v-bind:class="activeClass == 1 ? 'btn-color' : ''" |
| | | size="small" |
| | | @click="getswitchChartdate(1)" |
| | | >本周 |
| | | </el-button> |
| | | <el-button |
| | | v-bind:class="activeClass == 2 ? 'btn-color' : ''" |
| | | size="small" |
| | | @click="getswitchChartdate(2)" |
| | | >本月 |
| | | </el-button> |
| | | <el-button |
| | | v-bind:class="activeClass == 3 ? 'btn-color' : ''" |
| | | size="small" |
| | | @click="getswitchChartdate(3)" |
| | | >全部 |
| | | </el-button> |
| | | <el-button type="success" |
| | | size="small" |
| | | icon="el-icon-s-marketing" |
| | |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | activeClass: 3, |
| | | switchChartType: 0, |
| | | loading: true, |
| | | page: { |
| | |
| | | } else { |
| | | this.switchChartType = 1; |
| | | setTimeout(function () { |
| | | that.getChartData(); |
| | | that.getChartData(null); |
| | | }, 0); |
| | | } |
| | | }, getChartData() { |
| | | }, getChartData(date) { |
| | | var that = this; |
| | | getChartData(null).then(res => { |
| | | getChartData(date).then(res => { |
| | | var data = res.data.data; |
| | | var sum = 0; |
| | | for (let i = 0; i < data.length; i++) { |
| | |
| | | }); |
| | | |
| | | }, |
| | | getswitchChartdate(e){ |
| | | var params = {}; |
| | | var today = new Date(); |
| | | this.activeClass = e; |
| | | if (e == 0) { |
| | | params = { |
| | | beginTime: this.showToDay(today) + " 00:00:00", |
| | | endTime: this.showToDay(today) + " 23:59:59", |
| | | }; |
| | | } |
| | | if (e == 1) { |
| | | params = { |
| | | beginTime: this.showWeekFirstDay(today) + " 00:00:00", |
| | | endTime: this.showToDay(today) + " 23:59:59", |
| | | }; |
| | | } |
| | | if (e == 2) { |
| | | params = { |
| | | beginTime: this.showMonthFirstDay(today) + " 00:00:00", |
| | | endTime: this.showToDay(today) + " 23:59:59", |
| | | }; |
| | | } |
| | | |
| | | if (e == 3){ |
| | | params = null; |
| | | } |
| | | this.getChartData(params); |
| | | }, |
| | | //本日 |
| | | showToDay(Nowdate) { |
| | | var M = Number(Nowdate.getMonth()) + 1; |
| | | if (M < 10) { |
| | | M = "0" + M; |
| | | } |
| | | var day = Nowdate.getDate(); |
| | | if (day < 10) { |
| | | day = "0" + day; |
| | | } |
| | | return Nowdate.getFullYear() + "-" + M + "-" + day; |
| | | }, |
| | | |
| | | //本周第一天 |
| | | showWeekFirstDay(Nowdate) { |
| | | var WeekFirstDay = new Date(Nowdate - (Nowdate.getDay() - 1) * 86400000); |
| | | var M = Number(WeekFirstDay.getMonth()) + 1; |
| | | if (M < 10) { |
| | | M = "0" + M; |
| | | } |
| | | var day = WeekFirstDay.getDate(); |
| | | if (day < 10) { |
| | | day = "0" + day; |
| | | } |
| | | return WeekFirstDay.getFullYear() + "-" + M + "-" + day; |
| | | }, |
| | | |
| | | //本月第一天 |
| | | showMonthFirstDay(Nowdate) { |
| | | var MonthFirstDay = new Date(Nowdate.getFullYear(), Nowdate.getMonth(), 1); |
| | | var M = Number(MonthFirstDay.getMonth()) + 1; |
| | | if (M < 10) { |
| | | M = "0" + M; |
| | | } |
| | | return MonthFirstDay.getFullYear() + "-" + M + "-" + "0" + MonthFirstDay.getDate(); |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | </avue-crud> |
| | | |
| | | <el-row v-show="switchChartType == 1"> |
| | | <el-button |
| | | v-bind:class="activeClass == 0 ? 'btn-color' : ''" |
| | | size="mini" |
| | | @click="getswitchChartdate(0)" |
| | | >本日 |
| | | </el-button> |
| | | <el-button |
| | | v-bind:class="activeClass == 1 ? 'btn-color' : ''" |
| | | size="mini" |
| | | @click="getswitchChartdate(1)" |
| | | >本周 |
| | | </el-button> |
| | | <el-button |
| | | v-bind:class="activeClass == 2 ? 'btn-color' : ''" |
| | | size="mini" |
| | | @click="getswitchChartdate(2)" |
| | | >本月 |
| | | </el-button> |
| | | <el-button |
| | | v-bind:class="activeClass == 3 ? 'btn-color' : ''" |
| | | size="mini" |
| | | @click="getswitchChartdate(3)" |
| | | >全部 |
| | | </el-button> |
| | | <el-button type="success" |
| | | size="small" |
| | | size="mini" |
| | | icon="el-icon-s-marketing" |
| | | @click="switchChart">表 格 |
| | | </el-button> |
| | |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | }, |
| | | |
| | | getswitchChartdate(e){ |
| | | var params = {}; |
| | | var today = new Date(); |
| | | this.activeClass = e; |
| | | if (e == 0) { |
| | | params = { |
| | | beginTime: this.showToDay(today) + " 00:00:00", |
| | | endTime: this.showToDay(today) + " 23:59:59", |
| | | }; |
| | | } |
| | | if (e == 1) { |
| | | params = { |
| | | beginTime: this.showWeekFirstDay(today) + " 00:00:00", |
| | | endTime: this.showToDay(today) + " 23:59:59", |
| | | }; |
| | | } |
| | | if (e == 2) { |
| | | params = { |
| | | beginTime: this.showMonthFirstDay(today) + " 00:00:00", |
| | | endTime: this.showToDay(today) + " 23:59:59", |
| | | }; |
| | | } |
| | | |
| | | if (e == 3){ |
| | | params = null; |
| | | } |
| | | |
| | | this.getData(params); |
| | | this.getDataBs(params); |
| | | |
| | | }, |
| | | |
| | | //本日 |
| | | showToDay(Nowdate) { |
| | | var M = Number(Nowdate.getMonth()) + 1; |
| | |
| | | this.onLoad(this.page, params); |
| | | }, |
| | | getQBdata(e) { |
| | | debugger; |
| | | this.search.releaseTimeRange = ["", ""]; |
| | | this.activeClass = e; |
| | | var params = {}; |
| | |
| | | } else { |
| | | this.switchChartType = 1; |
| | | setTimeout(function () { |
| | | that.getData(); |
| | | that.getDataBs(); |
| | | that.getData(null); |
| | | that.getDataBs(null); |
| | | }, 0); |
| | | } |
| | | }, getData() { |
| | | }, getData(data) { |
| | | var that = this; |
| | | getChartData(null).then(res => { |
| | | getChartData(data).then(res => { |
| | | var data = res.data.data; |
| | | var sum = 0; |
| | | for (let i = 0; i < data.length; i++) { |
| | |
| | | myChart.setOption(option); |
| | | }); |
| | | }, |
| | | getDataBs() { |
| | | getDataBs(data) { |
| | | var that = this; |
| | | getChartDataBs(null).then(res => { |
| | | getChartDataBs(data).then(res => { |
| | | var data = res.data.data; |
| | | var sum = 0; |
| | | for (let i = 0; i < data.length; i++) { |