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