| | |
| | | <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <!--<a-col :md="5" :sm="5">--> |
| | | <!--<a-form-item label="名称">--> |
| | | <!--<a-input placeholder="输入设备名称查询" :readOnly="readOnly" v-model="queryParam.tierName"></a-input>--> |
| | | <!--</a-form-item>--> |
| | | <!--</a-col>--> |
| | | <a-col :md="5" :sm="5"> |
| | | <a-form-item label="设备"> |
| | | <a-input-search :readOnly="true" v-model="queryParam.equipmentId" @search="deviceSearch" |
| | |
| | | |
| | | <a-col :md="5" :sm="5"> |
| | | <a-form-item label="驱动类型"> |
| | | <!--<j-dict-select-tag placeholder="请选择驱动类型"--> |
| | | <!--:triggerChange="true" dictCode="mdc_driveType"--> |
| | | <!--v-model="queryParam.driveType" allow-clear/>--> |
| | | <a-auto-complete |
| | | v-model="queryParam.driveType" |
| | | :data-source="driveTypeList" |
| | |
| | | </a-col> |
| | | <a-col :md="6" :sm="6" :xs="6"> |
| | | <a-form-item label="时间"> |
| | | <a-range-picker @change="dateParamChange" v-model="dates" format="YYYYMMDD"/> |
| | | <a-range-picker @change="dateParamChange" v-model="dates" format="YYYYMMDD" :allow-clear="false"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col> |
| | | <a-col :md="3" :sm="3" :xs="3"> |
| | | <a-space> |
| | | <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload">重置</a-button> |
| | |
| | | |
| | | export default { |
| | | name: 'ComparativeAnalysisMain', |
| | | // mixins: [JeecgListMixin], |
| | | components: { |
| | | Tooltip, |
| | | ComparativeAnalysisBar, |
| | |
| | | tabChange(val) { |
| | | this.activeKey = val |
| | | }, |
| | | |
| | | dateParamChange(v1, v2) { |
| | | // console.log(v1,v2) |
| | | this.queryParam.startTime = v2[0] |
| | | this.queryParam.endTime = v2[1] |
| | | console.log(v2[0], v2[1]) |
| | | }, |
| | | |
| | | loadAnalysis() { |
| | | getAction(this.url.comparativeAnalysis, this.queryParam).then(res => { |
| | | if (res.success) { |
| | |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | searchQuery() { |
| | | if (this.dates && this.dates.length > 0) { |
| | | this.AnalysisList = [] |
| | | this.AnalysisBarList = [] |
| | | this.AnalysisGauge = [] |
| | | this.AnalysisPie = [] |
| | | if (this.queryParams.typeTree == '1') { |
| | | this.queryParams.parentId = this.queryParamEquip.parentId |
| | | // this.queryParams.equipmentId = this.queryParamEquip.equipmentId |
| | | } else { |
| | | this.queryParams.parentId = this.queryParamEquip.parentId |
| | | // this.queryParams.equipmentId = "" |
| | | } |
| | | this.AnalysisList = [] |
| | | //获取查询条件 |
| | | this.queryParam.parentId = this.queryParams.parentId |
| | | // this.queryParam.equipmentId = this.queryParams.equipmentId |
| | | this.queryParam.typeTree = this.queryParams.typeTree |
| | | getAction(this.url.comparativeAnalysis, this.queryParam).then((res) => { |
| | | if (res.success) { |
| | | this.AnalysisList = res.result |
| | | this.AnalysisBarList = res.result.graphics |
| | | this.AnalysisGauge = res.result.meters |
| | | this.AnalysisPie.push(res.result.pieCharts) |
| | | } else { |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | } else { |
| | | this.$notification.warning({ |
| | | message: '提示', |
| | | description: '请选择时间' |
| | | }) |
| | | } |
| | | |
| | | searchQuery() { |
| | | this.AnalysisList = [] |
| | | this.AnalysisBarList = [] |
| | | this.AnalysisGauge = [] |
| | | this.AnalysisPie = [] |
| | | if (this.queryParams.typeTree == '1') { |
| | | this.queryParams.parentId = this.queryParamEquip.parentId |
| | | // this.queryParams.equipmentId = this.queryParamEquip.equipmentId |
| | | } else { |
| | | this.queryParams.parentId = this.queryParamEquip.parentId |
| | | // this.queryParams.equipmentId = "" |
| | | } |
| | | this.AnalysisList = [] |
| | | //获取查询条件 |
| | | this.queryParam.parentId = this.queryParams.parentId |
| | | // this.queryParam.equipmentId = this.queryParams.equipmentId |
| | | this.queryParam.typeTree = this.queryParams.typeTree |
| | | getAction(this.url.comparativeAnalysis, this.queryParam).then((res) => { |
| | | if (res.success) { |
| | | this.AnalysisList = res.result |
| | | this.AnalysisBarList = res.result.graphics |
| | | this.AnalysisGauge = res.result.meters |
| | | this.AnalysisPie.push(res.result.pieCharts) |
| | | } else { |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | searchReset() { |
| | | this.AnalysisList = [] |
| | | this.AnalysisBarList = [] |
| | |
| | | this.typeEquipment = this.queryParams.equipmentId |
| | | this.queryParams = {} |
| | | this.queryParam = {} |
| | | this.dates = [] |
| | | this.dates = [moment().subtract('days', 7), moment().subtract('days', 0)] |
| | | this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD') |
| | | this.queryParams.startTime = moment(this.dates[0]).format('YYYYMMDD') |
| | | this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD') |
| | | this.queryParams.endTime = moment(this.dates[1]).format('YYYYMMDD') |
| | | this.queryParams.typeTree = this.typeTree |
| | | this.queryParams.parentId = this.typeParent |
| | | if (this.queryParams.parentId != '') { |
| | |
| | | this.AnalysisGauge = res.result.meters |
| | | this.AnalysisPie.push(res.result.pieCharts) |
| | | } else { |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message: '消息', |
| | | description: res.message |
| | |
| | | this.typeEquipment = this.queryParams.equipmentId |
| | | this.queryParams = {} |
| | | this.queryParam = {} |
| | | this.dates = [] |
| | | this.dates = [moment().subtract('days', 7), moment().subtract('days', 0)] |
| | | this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD') |
| | | this.queryParams.startTime = moment(this.dates[0]).format('YYYYMMDD') |
| | | this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD') |
| | | this.queryParams.endTime = moment(this.dates[1]).format('YYYYMMDD') |
| | | this.queryParams.typeTree = this.typeTree |
| | | this.queryParams.parentId = this.typeParent |
| | | if (this.queryParams.parentId != '') { |
| | |
| | | this.AnalysisGauge = res.result.meters |
| | | this.AnalysisPie.push(res.result.pieCharts) |
| | | } else { |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message: '消息', |
| | | description: res.message |
| | |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * 调用接口获取控制系统类型 |
| | | */ |
| | |
| | | this.driveTypeList = res.result.map(item => item.value) |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 联想输入框筛选功能 |
| | | * @param input 输入的内容 |
| | |
| | | option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0 |
| | | ) |
| | | }, |
| | | // onChange(value, dateString) { |
| | | // // console.log('Selected Time: ', value); |
| | | // // console.log('Formatted Selected Time: ', dateString); |
| | | // }, |
| | | // searchReset() { |
| | | // if(this.queryParams.typeTree == "1"){ |
| | | // this.typeTree = this.queryParams.typeTree |
| | | // this.typeParent = this.queryParams.parentId |
| | | // this.typeEquipment = this.queryParams.equipmentId |
| | | // this.queryParams = {} |
| | | // this.queryParam = {} |
| | | // this.dates = [] |
| | | // this.queryParams.typeTree = this.typeTree |
| | | // this.queryParams.parentId = this.typeParent |
| | | // if(this.queryParams.parentId != ""){ |
| | | // this.queryParams.equipmentId = "" |
| | | // }else{ |
| | | // if(this.queryParams.equipmentId == this.queryParamEquip.equipmentId){ |
| | | // this.queryParams.equipmentId = this.typeEquipment |
| | | // }else{ |
| | | // this.queryParams.equipmentId = this.queryParamEquip.equipmentId |
| | | // } |
| | | // |
| | | // } |
| | | // |
| | | // this.ipagination.current = 1 |
| | | // this.ResetloadData(); |
| | | // }else{ |
| | | // this.typeTree = this.queryParams.typeTree |
| | | // this.typeParent = this.queryParams.parentId |
| | | // // this.typeEquipment = this.queryParams.equipmentId |
| | | // this.queryParams = {} |
| | | // this.queryParam = {} |
| | | // this.dates = [] |
| | | // this.queryParams.typeTree = this.typeTree |
| | | // this.queryParams.parentId = this.typeParent |
| | | // // this.queryParams.equipmentId = this.typeEquipment |
| | | // this.ipagination.current = 1 |
| | | // this.ResetloadData(); |
| | | // } |
| | | // |
| | | // }, |
| | | // ResetloadData() { |
| | | // if(!this.url.list){ |
| | | // this.$message.error("请设置url.list属性!") |
| | | // return |
| | | // } |
| | | // var params = {} |
| | | // params.typeTree = this.queryParams.typeTree |
| | | // params.parentId = this.queryParams.parentId |
| | | // params.equipmentId = this.queryParams.equipmentId |
| | | // this.loading = true; |
| | | // getAction(this.url.list, params).then((res) => { |
| | | // if (res.success) { |
| | | // this.dataSource = res.result.records||res.result; |
| | | // }else{ |
| | | // this.$message.warning(res.message) |
| | | // } |
| | | // }).finally(() => { |
| | | // this.loading = false |
| | | // }) |
| | | // }, |
| | | // searchQuery(){ |
| | | // if(this.queryParams.typeTree == "1"){ |
| | | // this.queryParams.parentId = this.queryParamEquip.parentId |
| | | // // this.queryParams.equipmentId = this.queryParamEquip.equipmentId |
| | | // |
| | | // }else{ |
| | | // this.queryParams.parentId = this.queryParamPeople.parentId |
| | | // |
| | | // // this.queryParams.equipmentId = "" |
| | | // } |
| | | // this.dataSource = []; |
| | | // //获取查询条件 |
| | | // let param = {} |
| | | // param.parentId = this.queryParams.parentId; |
| | | // param.equipmentId = this.queryParams.equipmentId; |
| | | // param.startTime = this.queryParam.startTime; |
| | | // param.driveType = this.queryParam.driveType; |
| | | // param.endTime = this.queryParam.endTime; |
| | | // getAction(this.url.list,param).then((res) => { |
| | | // if(res.success){ |
| | | // this.dataSource = res.result.records||res.result; |
| | | // }else{ |
| | | // this.$message.warning(res.message) |
| | | // } |
| | | // }).finally(() => { |
| | | // this.loading = false |
| | | // }) |
| | | // }, |
| | | // loadData() { |
| | | // if(!this.url.list){ |
| | | // this.$message.error("请设置url.list属性!") |
| | | // return |
| | | // } |
| | | // //加载数据 若传入参数1则加载第一页的内容 |
| | | // var params = {} |
| | | // this.loading = true; |
| | | // params.startTime = this.queryParam.startTime; |
| | | // params.endTime = this.queryParam.endTime; |
| | | // params.typeTree = this.queryParams.typeTree |
| | | // getAction(this.url.list, params).then((res) => { |
| | | // if (res.success) { |
| | | // this.dataSource = res.result.records||res.result; |
| | | // }else{ |
| | | // this.$message.warning(res.message) |
| | | // } |
| | | // }).finally(() => { |
| | | // this.loading = false |
| | | // }) |
| | | // }, |
| | | |
| | | deviceSearch() { |
| | | console.log('触发') |
| | | this.$refs.selectDeviceDrawer.visible = true |
| | | this.$refs.selectDeviceDrawer.selectedRowKeys = [] |
| | | this.$refs.selectDeviceDrawer.selectedRows = [] |
| | |
| | | * @param data 已选择的设备 |
| | | */ |
| | | selectOK(data) { |
| | | // let params = {} |
| | | // params.equipmentIdList = [] |
| | | // for (var a = 0; a < data.length; a++) { |
| | | // params.equipmentIdList.push(data[a]) |
| | | // } |
| | | console.log('data=', data) |
| | | this.queryParam.equipmentId = data.join(',') |
| | | console.log('queryParam', this.queryParam.equipmentId) |