优化0918
This commit is contained in:
@ -64,9 +64,9 @@ export function getDeviceList(siteId) {
|
||||
}
|
||||
|
||||
//获取设备点位table
|
||||
export function getDevicePointList({siteId,deviceId,deviceCategory,pageNum,pageSize,dataPointName=''}) {
|
||||
export function getDevicePointList({siteId,deviceId,deviceCategory,pageNum,pageSize,dataPointName='',sortMethod,dataPoint,lower,upper}) {
|
||||
return request({
|
||||
url: `/ems/siteConfig/getDevicePointList?siteId=${siteId}&deviceId=${deviceId}&pageNum=${pageNum}&pageSize=${pageSize}&deviceCategory=${deviceCategory}&dataPointName=${dataPointName}`,
|
||||
url: `/ems/siteConfig/getDevicePointList?siteId=${siteId}&deviceId=${deviceId}&pageNum=${pageNum}&pageSize=${pageSize}&deviceCategory=${deviceCategory}&dataPointName=${dataPointName}&dataPoint=${dataPoint}&lower=${lower}&upper=${upper}&pageNum=${pageNum}&sortMethod=${sortMethod}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
@ -14,9 +14,10 @@ import * as echarts from 'echarts'
|
||||
import resize from '@/mixins/ems/resize'
|
||||
import DateRangeSelect from '@/components/Ems/DateRangeSelect/index.vue'
|
||||
import { getPointData } from '@/api/ems/dzjk'
|
||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
||||
|
||||
export default {
|
||||
mixins: [resize],
|
||||
mixins: [resize,intervalUpdate],
|
||||
components: {DateRangeSelect},
|
||||
data() {
|
||||
return {
|
||||
@ -59,6 +60,7 @@ export default {
|
||||
this.timeRange=[]
|
||||
this.$refs.dateRangeSelect.init(true)
|
||||
this.getGVQXData()
|
||||
this.updateInterval(this.getGVQXData)
|
||||
},
|
||||
initChart() {
|
||||
this.chart = echarts.init(document.querySelector('#activeChart'))
|
||||
|
||||
@ -75,10 +75,11 @@ import ActiveChart from "./ActiveChart.vue";
|
||||
import AlarmTable from "./AlarmTable.vue";
|
||||
import ClInfo from "./ClInfo.vue";
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
import intervalUpdate from "@/mixins/ems/intervalUpdate";
|
||||
export default {
|
||||
name: "DzjkSbjkHome",
|
||||
components: { WeekChart, ActiveChart, AlarmTable, ClInfo },
|
||||
mixins: [getQuerySiteId],
|
||||
mixins: [getQuerySiteId,intervalUpdate],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
@ -153,6 +154,8 @@ export default {
|
||||
Promise.all([this.getBaseInfo(), this.getRunningInfo()]).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
// 一分钟循环一次总累计运行数据
|
||||
this.updateInterval(this.getRunningInfo)
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -106,7 +106,7 @@ export default {
|
||||
'电压单体平均值':'电压平均值',
|
||||
'电压单体最大值':'最高单体电压',
|
||||
'温度单体最小值':'最低单体温度',
|
||||
'温度单体平均值':'温度平均值',
|
||||
'温度单体平均值':'平均单体温度',
|
||||
'温度单体最大值':'最高单体温度',
|
||||
'SOC单体最小值':'最低单体SOC',
|
||||
'SOC单体平均值':'当前SOC',
|
||||
|
||||
@ -32,6 +32,7 @@ export default {
|
||||
},
|
||||
dateRange:[],
|
||||
loading:false,
|
||||
dateRangeInit:true,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -42,9 +43,14 @@ export default {
|
||||
},
|
||||
getData(){
|
||||
const {siteId}=this;
|
||||
const [start='',end='']=(this.dateRange || [])
|
||||
let [start='',end='']=(this.dateRange || [])
|
||||
//接口调用完成之后 设置图表、结束loading
|
||||
this.loading=true;
|
||||
if(this.dateRangeInit){
|
||||
start = ''
|
||||
end = ''
|
||||
this.dateRangeInit=false
|
||||
}
|
||||
getPowerData({siteId,startDate:formatDate(start),endDate:formatDate(end)}).then(response => {
|
||||
this.setOption(response?.data || [])
|
||||
}).finally(()=>{this.loading=false;})
|
||||
|
||||
@ -9,27 +9,37 @@
|
||||
destroy-on-close
|
||||
lock-scroll
|
||||
show-close
|
||||
title="点位列表"
|
||||
title="点位清单"
|
||||
width="800px"
|
||||
>
|
||||
<div style="margin-bottom: 20px">
|
||||
<el-input v-model="pointName" placeholder="请输入点位" clearable style="width: 200px"></el-input>
|
||||
<!-- <el-autocomplete-->
|
||||
<!-- v-model="pointName"-->
|
||||
<!-- placeholder="请输入点位"-->
|
||||
<!-- clearable-->
|
||||
<!-- :fetch-suggestions="querySearchAsync"-->
|
||||
<!-- @select="handleSelect"-->
|
||||
<!-- ></el-autocomplete>-->
|
||||
|
||||
<el-button type="primary" style="margin-left: 20px" @click="pointNameSearch">搜索</el-button>
|
||||
</div>
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="点位名称">
|
||||
<el-input v-model="form.dataPointName" clearable placeholder="请输入点位名称" style="width: 150px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位">
|
||||
<el-input v-model="form.dataPoint" clearable placeholder="请输入点位" style="width: 150px"></el-input>
|
||||
</el-form-item>
|
||||
<br>
|
||||
<el-form-item label="最小值">
|
||||
<el-input v-model="form.lower" clearable placeholder="请输入最小值" style="width: 150px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大值">
|
||||
<el-input v-model="form.upper" clearable placeholder="请输入最大值" style="width: 150px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-left: 20px">
|
||||
<el-button type="primary" @click="search">搜索</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
:data="tableData"
|
||||
class="common-table"
|
||||
max-height="400px"
|
||||
stripe
|
||||
style="width: 100%;">
|
||||
style="width: 100%;"
|
||||
:default-sort = "{prop: 'updateTime', order: 'descending'}"
|
||||
@sort-change="changeSort">
|
||||
<el-table-column
|
||||
label="数据点位"
|
||||
prop="dataPoint">
|
||||
@ -44,7 +54,9 @@
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="更新时间"
|
||||
prop="updateTime">
|
||||
prop="updateTime"
|
||||
sortable="custom"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@ -66,96 +78,113 @@
|
||||
</template>
|
||||
<script>
|
||||
import {getDevicePointList} from "@/api/ems/site";
|
||||
import {pointFuzzyQuery} from "@/api/ems/search";
|
||||
|
||||
export default {
|
||||
watch:{
|
||||
watch: {
|
||||
show(val) {
|
||||
if(!val){
|
||||
this.tableData=[]
|
||||
this.deviceId=''
|
||||
this.deviceName=''
|
||||
this.siteId=''
|
||||
this.pageSize=10
|
||||
this.pageNum=1
|
||||
this.totalSize=0
|
||||
this.pointName=''
|
||||
this.loading =false
|
||||
if (!val) {
|
||||
this.tableData = []
|
||||
this.deviceId = ''
|
||||
this.deviceName = ''
|
||||
this.siteId = ''
|
||||
this.pageSize = 10
|
||||
this.pageNum = 1
|
||||
this.totalSize = 0
|
||||
this.form = {
|
||||
sortMethod: 'desc',//升序不传或者asc、降序desc)
|
||||
dataPointName: '',//点位名称
|
||||
dataPoint: '',//点位名称
|
||||
lower: '',//
|
||||
upper: '',//
|
||||
}
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
show:false,
|
||||
loading:false,
|
||||
pointName:'',//点位名称
|
||||
deviceCategory:'',
|
||||
deviceName:'',
|
||||
deviceId:'',
|
||||
siteId:'',
|
||||
tableData:[],
|
||||
pageSize:10,//分页栏当前每个数据总数
|
||||
pageNum:1,//分页栏当前页数
|
||||
totalSize:0,//table表格数据总数
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
loading: false,
|
||||
form: {
|
||||
sortMethod: 'desc',//升序不传或者asc、降序desc)
|
||||
dataPointName: '',//点位名称
|
||||
dataPoint: '',//点位名称
|
||||
lower: '',//
|
||||
upper: '',//
|
||||
},
|
||||
deviceCategory: '',
|
||||
deviceName: '',
|
||||
deviceId: '',
|
||||
siteId: '',
|
||||
tableData: [],
|
||||
pageSize: 10,//分页栏当前每个数据总数
|
||||
pageNum: 1,//分页栏当前页数
|
||||
totalSize: 0,//table表格数据总数
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
pointNameSearch(){
|
||||
this.pageNum=1
|
||||
methods: {
|
||||
changeSort(c) {
|
||||
console.log('切换排序方式', c)
|
||||
if(c.prop === "updateTime" && c.order){
|
||||
this.form.sortMethod = c.order === 'descending' ? 'desc' : 'asc'
|
||||
this.getData()
|
||||
}
|
||||
},
|
||||
search() {
|
||||
this.pageNum = 1
|
||||
this.getData()
|
||||
},
|
||||
showTable({deviceCategory,siteId,deviceId,deviceName}){
|
||||
this.deviceCategory =deviceCategory
|
||||
this.siteId=siteId
|
||||
this.deviceId=deviceId
|
||||
this.deviceName=deviceName
|
||||
this.show=true
|
||||
showTable({deviceCategory, siteId, deviceId, deviceName}) {
|
||||
this.deviceCategory = deviceCategory
|
||||
this.siteId = siteId
|
||||
this.deviceId = deviceId
|
||||
this.deviceName = deviceName
|
||||
this.show = true
|
||||
this.getData()
|
||||
},
|
||||
getData(){
|
||||
this.loading=true
|
||||
const {siteId,deviceId,deviceCategory,pageNum,pageSize,pointName} =this
|
||||
getDevicePointList({siteId,deviceId,deviceCategory,pageNum,pageSize,dataPointName:pointName}).then(response => {
|
||||
this.tableData=response?.rows || [];
|
||||
getData() {
|
||||
this.loading = true
|
||||
const {
|
||||
siteId,
|
||||
deviceId,
|
||||
deviceCategory,
|
||||
pageNum,
|
||||
pageSize,
|
||||
form: {sortMethod, dataPointName, dataPoint, lower, upper}
|
||||
} = this
|
||||
getDevicePointList({
|
||||
siteId,
|
||||
deviceId,
|
||||
deviceCategory,
|
||||
pageNum,
|
||||
pageSize,
|
||||
sortMethod, dataPointName, dataPoint, lower, upper
|
||||
}).then(response => {
|
||||
this.tableData = response?.rows || [];
|
||||
this.totalSize = response?.total || 0
|
||||
}).finally(() => {this.loading=false})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.$nextTick(()=>{
|
||||
this.$nextTick(() => {
|
||||
this.getData()
|
||||
})
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageNum = val
|
||||
this.$nextTick(()=>{
|
||||
this.$nextTick(() => {
|
||||
this.getData()
|
||||
})
|
||||
},
|
||||
//点位
|
||||
handleSelect(data){
|
||||
this.pointName = data.value
|
||||
},
|
||||
querySearchAsync(query,cb){
|
||||
console.log('查询数据',query)
|
||||
pointFuzzyQuery({
|
||||
siteIds:[this.siteId],
|
||||
categoryName:this.deviceName,
|
||||
pointName:query,
|
||||
}).then(response => {
|
||||
const data = response?.data || []
|
||||
cb(data.map(item => {
|
||||
return {name: item, value: item}
|
||||
}))
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep {
|
||||
.card-title .el-radio{
|
||||
.card-title .el-radio {
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,17 +52,11 @@
|
||||
label="操作"
|
||||
width="260">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button-->
|
||||
<!-- @click="toDetail(scope.row.id)"-->
|
||||
<!-- type="primary"-->
|
||||
<!-- size="mini">-->
|
||||
<!-- 查看详情-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
@click="pointDetail(scope.row)"
|
||||
type="primary"
|
||||
size="mini">
|
||||
点位列表
|
||||
点位清单
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="editDevice(scope.row)"
|
||||
|
||||
Reference in New Issue
Block a user