| | |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :md="6" :sm="6"> |
| | | <a-col :md="7" :sm="7"> |
| | | <a-form-item label="时间"> |
| | | <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD" |
| | | v-model="dates"/> |
| | | v-model="dates" :allowClear="false"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="17" :sm="17" :xs="17"> |
| | | <a-form-item label="时间段"> |
| | | <a-space> |
| | | <a-time-picker :default-value="moment('00:00', 'HH:mm')" format="HH:mm" @change="onChangeStart"/> |
| | | <a-time-picker :default-value="moment('00:00', 'HH:mm')" format="HH:mm" @change="onChangeStart" :allowClear="false"/> |
| | | 至 |
| | | <a-time-picker :default-value="moment('08:00', 'HH:mm')" format="HH:mm" @change="onChangeEnd"/> |
| | | <a-time-picker :default-value="moment('08:00', 'HH:mm')" format="HH:mm" @change="onChangeEnd" :allowClear="false"/> |
| | | <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
| | | </a-space> |
| | | </a-form-item> |
| | |
| | | this.dates = [v1[0], v1[1]] |
| | | }, |
| | | searchQuery() { |
| | | // 因触底刷新会修改参数时间值,故在此用时间选择器的时间值对参数时间值再次赋值,若不这样做则参数时间值则会与时间选择器上的时间值不一致 |
| | | this.queryParam.startDate = moment(this.dates[0]).format('YYYYMMDD') |
| | | this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD') |
| | | if (this.queryParam.startTime && this.queryParam.endTime && this.dates[0] && this.dates[1]) { |
| | | if (this.queryParam.typeTree == '1') { |
| | | this.queryParam.parentId = this.queryParamEquip.parentId |
| | | this.queryParam.equipmentId = this.queryParamEquip.equipmentId |
| | | } else { |
| | | this.queryParam.parentId = this.queryParamPeople.parentId |
| | | this.queryParam.equipmentId = '' |
| | | } |
| | | this.requestAlldataSize = moment.duration(moment(this.queryParam.endDate) - moment(this.queryParam.startDate), 'millisecond').asDays() + 1 |
| | | this.loadData1() |
| | | } else { |
| | | this.$notification.warning({ |
| | | message: '提示', |
| | | description: '请选择时间或时间段' |
| | | }) |
| | | } |
| | | |
| | | // this.onClearSelected() |
| | | if (this.queryParam.typeTree == '1') { |
| | | this.queryParam.parentId = this.queryParamEquip.parentId |
| | | this.queryParam.equipmentId = this.queryParamEquip.equipmentId |
| | | } else { |
| | | this.queryParam.parentId = this.queryParamPeople.parentId |
| | | this.queryParam.equipmentId = '' |
| | | } |
| | | this.requestAlldataSize = moment.duration(moment(this.queryParam.endDate) - moment(this.queryParam.startDate), 'millisecond').asDays() + 1 |
| | | this.loadData1() |
| | | }, |
| | | // searchReset() { |
| | | // this.typeTree = this.queryParam.typeTree |
| | | // this.typeParent = this.queryParam.parentId |
| | | // this.typeEquipment = this.queryParam.equipmentId |
| | | // this.queryParam = {} |
| | | // this.dates = [] |
| | | // this.queryParam.typeTree = this.typeTree |
| | | // this.queryParam.parentId = this.typeParent |
| | | // this.queryParam.equipmentId = this.typeEquipment |
| | | // // this.ipagination.current = 1 |
| | | // this.loadData1(); |
| | | // // this.queryParam = {} |
| | | // // this.dates = [] |
| | | // // this.loadData() |
| | | // // this.onClearSelected() |
| | | // }, |
| | | // loadData1() { |
| | | // let that = this |
| | | // that.columns=[ |
| | | // { |
| | | // title: '设备编号', |
| | | // align: 'center', |
| | | // dataIndex: 'equipmentId', |
| | | // width:'150px' |
| | | // }, |
| | | // { |
| | | // title: '设备名称', |
| | | // align: 'center', |
| | | // dataIndex: 'equipmentName', |
| | | // width:'150px' |
| | | // }, |
| | | // ] |
| | | // that.tableHeads = [] |
| | | // that.dataList = [] |
| | | // getAction(this.url.efficiencyList, that.queryParam).then(res => { |
| | | // var tmp = {} |
| | | // console.log(res) |
| | | // if (res.success) |
| | | // |
| | | // that.dataSource = res.result.mdcEfficiencyList |
| | | // for(var k = 0;k<that.dataSource[0].dataList.length;k++){ |
| | | // that.columns.push( |
| | | // { |
| | | // title:that.dataSource[0].dataList.theDate, |
| | | // align: 'center', |
| | | // width:'120px', |
| | | // // dataIndex:'utilizationRate', |
| | | // } |
| | | // ) |
| | | // } |
| | | // for(var i = 0;i<that.dataSource.length;i++){ |
| | | // for (var j = 0; j < that.dataSource[i].dataList.length;j++){ |
| | | // // that.columns.push( |
| | | // // { |
| | | // // title:that.dataSource[0].dataList[j].theDate, |
| | | // // align: 'center', |
| | | // // width:'120px', |
| | | // // dataIndex:'utilizationRate', |
| | | // // } |
| | | // // ) |
| | | // } |
| | | // |
| | | // } |
| | | // console.log(that.columns) |
| | | // console.log(that.dataSource) |
| | | // // this.initDeviceType(this.dataList) |
| | | // this.draw() |
| | | // } |
| | | // } |
| | | loadData1() { |
| | | this.loading = true |
| | | this.tableHeads = [] |