| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="状态:"> |
| | | <el-form-item label="小时状态:"> |
| | | <el-select |
| | | v-model="formInline.state" |
| | | v-model="formInline.hourState" |
| | | clearable |
| | | placeholder="选择状态" |
| | | > |
| | |
| | | </el-form> |
| | | </div> |
| | | <div> |
| | | <p>当前设备共{{ tableData.length }}台,在线 {{ onlineData }}台,在线率 <span :class=" onlineRate<90 ?'redClor':'greenClor'">{{ onlineRate }}%</span></p> |
| | | <p>实时在线率:共<span class="greenClor">{{ tableData.length }}</span>台,在线<span class="greenClor">{{ onlineData }}</span>台,在线率 <span :class=" onlineRate<90 ?'redClor':'greenClor'">{{ onlineRate }}%</span></p> |
| | | <div> |
| | | <el-table |
| | | v-loading="loading" |
| | |
| | | label="在线率" |
| | | width="100px" |
| | | align="center" |
| | | /> |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span :class=" scope.row.onlineRate<90 ?'redClor':'greenClor'">{{ scope.row.onlineRate }}%</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="onlineTime" |
| | | label-class-name="itemSpan" |
| | |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="state" |
| | | prop="hourState" |
| | | label-class-name="itemSpan" |
| | | label="状态" |
| | | width="80px" |
| | | label="小时状态" |
| | | width="90px" |
| | | align="center" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if="scope.row.state === '0'" |
| | | v-if="scope.row.hourState === '0'" |
| | | style="color:red;font-size:15px" |
| | | type="text" |
| | | > |
| | |
| | | <script> |
| | | import dayjs from 'dayjs' |
| | | import detailBox from '@/views/onlineRate/detailBox' |
| | | import _ from 'lodash' |
| | | export default { |
| | | components: { |
| | | detailBox |
| | |
| | | return { |
| | | formInline: { |
| | | organizationId: '', |
| | | hourState: '', |
| | | state: '', |
| | | startTime: dayjs().startOf('day').format('YYYY-MM-DD HH:mm'), |
| | | endTime: dayjs().subtract(1, 'hour').format('YYYY-MM-DD HH:mm') |
| | | }, |
| | |
| | | this.formInline.startTime = now.subtract(7, 'day').format('YYYY-MM-DD HH:mm') // 获取前天的零点 |
| | | } else if (newValue === '今天') { |
| | | this.selectTime = [] |
| | | this.formInline.startTime = now.format('YYYY-MM-DD HH:mm') |
| | | console.log('000', dayjs().startOf('day').format('YYYY-MM-DD HH:mm')) |
| | | this.formInline.startTime = dayjs().startOf('day').format('YYYY-MM-DD HH:mm') |
| | | } |
| | | } |
| | | }, |
| | |
| | | handleDetail (row) { |
| | | console.log(row) |
| | | this.handleShow = true |
| | | this.macDate = row |
| | | this.macDate = _.cloneDeep(row) |
| | | this.macDate.startTime = this.formInline.startTime |
| | | this.macDate.endTime = this.formInline.endTime |
| | | }, |
| | | handleSearch () { |
| | | if (this.formInline.organizationId !== '') { |
| | | if (this.time === '今天') { |
| | | this.formInline.startTime = dayjs().startOf('day').format('YYYY-MM-DD HH:mm') |
| | | this.formInline.endTime = dayjs().subtract(1, 'hour').format('YYYY-MM-DD HH:mm') |
| | | } |
| | | this.loading = true |
| | | this.$request({ |
| | | url: '/onlineRate/page', |
| | |
| | | } |
| | | }) |
| | | .then(res => { |
| | | this.tableData = res.data |
| | | this.tableData = res.data || [] |
| | | this.loading = false |
| | | }) |
| | | .catch(err => { |