| | |
| | | label-class-name="itemSpan" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.mun }}</span>{{ time }} |
| | | <span v-if="scope.row.mun!=='-'">{{ scope.row.mun }}{{ time }}</span> |
| | | <span v-else>-</span> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | }, |
| | | computed: { |
| | | onlineRate () { |
| | | console.log('///', ((this.macOnlineDetailData.pieChart2) / this.sum)) |
| | | return (this.macOnlineDetailData.pieChart2 / this.sum) * 100 || 0 |
| | | } |
| | | }, |
| | |
| | | this.type = 'hour' |
| | | this.lineType = 'hour' |
| | | } else if (newValue === '分钟') { |
| | | this.lineType = 'hour' |
| | | this.type = 'minute' |
| | | } |
| | | } |
| | |
| | | echarts.dispose(dom) |
| | | var myChart = echarts.init(dom) |
| | | let starTiem = params.data[0] |
| | | console.log('starTiem', dayjs(starTiem).format('YYYY.MM.DD HH:mm:ss')) |
| | | let endTiem = dayjs(starTiem).add(1, 'hour') |
| | | let data = dayjs(starTiem).add(1, 'hour') |
| | | let endTiem = dayjs(data).isAfter(dayjs()) ? dayjs() : data |
| | | console.log('.isAfter(now)', dayjs(endTiem).isAfter(dayjs())) |
| | | this.getLineData(dayjs(starTiem).format('YYYY-MM-DD HH:mm:ss'), dayjs(endTiem).format('YYYY-MM-DD HH:mm:ss'), 'minute') |
| | | myChart.setOption(option, true) |
| | | } |
| | | console.log('this.lineType', this.lineType) |
| | | }) |
| | | }, |
| | | renderBack () { |
| | |
| | | tooltip: { |
| | | trigger: 'item', |
| | | formatter: function (params) { |
| | | console.log(params) |
| | | var value = params.data[0] |
| | | let tip = params.value[1] === 1 ? '在线: ' + value : '离线: ' + value |
| | | return tip |
| | |
| | | height: 20, // 时间滚动条的高度 |
| | | type: 'slider', // type的作用是指定数据缩放的类型,slider表示使用滑动条进行缩放,inside表示使用鼠标滚轮进行缩放。 |
| | | xAxisIndex: 0, // 作用在x轴的下标(因为x轴可以有多个) |
| | | filterMode: 'filter', // 间滚动条的过滤模式,'filter'表示滑动时间条时会直接过滤掉不在时间范围内的数据,'weakFilter'表示滑动时间条时会逐渐过滤掉不在时间范围内的数据。 |
| | | filterMode: 'weakFilter', // 间滚动条的过滤模式,'filter'表示滑动时间条时会直接过滤掉不在时间范围内的数据,'weakFilter'表示滑动时间条时会逐渐过滤掉不在时间范围内的数据。 |
| | | start: 0, // 默认开始位置(百分比) |
| | | end: 100, // 默认结束位置(百分比) |
| | | }, |
| | |
| | | this.sData = data.map((item, index) => { |
| | | return [ this.xData[index], item ] |
| | | }) |
| | | console.log(this.sData) |
| | | this.$nextTick(() => { |
| | | this.renderLine() |
| | | }) |