update - 能源整点数据

yangwl
yinq 5 months ago
parent f94fd5708d
commit 85e9bec4f8

@ -21,7 +21,7 @@
:filter-node-method="filterNode" :filter-node-method="filterNode"
ref="tree" ref="tree"
node-key="id" node-key="id"
default-expand-all :default-expanded-keys="[deptOptions[0].id]"
highlight-current highlight-current
@node-click="handleNodeClick" @node-click="handleNodeClick"
/> />
@ -47,16 +47,20 @@
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item><div>-</div></el-form-item> <el-form-item>
<div>-</div>
</el-form-item>
<el-form-item <el-form-item
><el-date-picker >
<el-date-picker
v-model="dateRangetwo" v-model="dateRangetwo"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
style="width: 240px" style="width: 240px"
type="datetime" type="datetime"
placeholder="选择日期时间" placeholder="选择日期时间"
></el-date-picker ></el-date-picker
></el-form-item> >
</el-form-item>
<el-form-item label="时间范围" prop="status"> <el-form-item label="时间范围" prop="status">
<el-select <el-select
v-model="queryParams.dateType" v-model="queryParams.dateType"
@ -93,10 +97,12 @@
icon="el-icon-search" icon="el-icon-search"
size="mini" size="mini"
@click="handleQuery" @click="handleQuery"
>搜索</el-button >搜索
</el-button
> >
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button >重置
</el-button
> >
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -111,6 +117,16 @@
</el-card> </el-card>
<!-- 新增等功能按钮 --> <!-- 新增等功能按钮 -->
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- >光伏用量-->
<!-- </el-button>-->
<!-- </el-col>-->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
@ -119,7 +135,8 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['report:pointDnb:export']" v-hasPermi="['report:pointDnb:export']"
>导出</el-button >导出
</el-button
> >
</el-col> </el-col>
<right-toolbar <right-toolbar
@ -134,7 +151,7 @@
:data="userList" :data="userList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="50" align="center" /> <el-table-column type="selection" width="50" align="center"/>
<el-table-column <el-table-column
label="计量设备编号" label="计量设备编号"
align="center" align="center"
@ -202,6 +219,51 @@
/> />
</el-col> </el-col>
</el-row> </el-row>
<!-- 添加光伏整点数据对话框 -->
<!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>-->
<!-- <el-form ref="form" :model="form" :rules="rules" label-width="120px">-->
<!-- <el-form-item label="光伏设备名称" prop="monitorId">-->
<!-- <el-select v-model="form.monitorId" placeholder="请选择光伏设备名称">-->
<!-- <el-option-->
<!-- v-for="item in photovoltaicList"-->
<!-- :key="item.monitorId"-->
<!-- :label="item.monitorName"-->
<!-- :value="item.monitorId"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="耗量" prop="expend">-->
<!-- <el-input v-model="form.expend" placeholder="请输入耗量"/>-->
<!-- </el-form-item>-->
<!-- &lt;!&ndash; <el-form-item label="仪表值" prop="instrumentValue">&ndash;&gt;-->
<!-- &lt;!&ndash; <el-input v-model="form.instrumentValue" placeholder="请输入仪表值"/>&ndash;&gt;-->
<!-- &lt;!&ndash; </el-form-item>&ndash;&gt;-->
<!-- <el-form-item label="开始日期" prop="beginTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.beginTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择开始日期"-->
<!-- >-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="结束日期" prop="endTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.endTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择结束日期"-->
<!-- >-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="submitForm"> </el-button>-->
<!-- <el-button @click="cancel"> </el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
</div> </div>
</template> </template>
@ -211,16 +273,21 @@ import {
treeDat, treeDat,
dnbCountingData, dnbCountingData,
listUser2, listUser2,
deptTreeSelect, deptTreeSelect
} from "@/api/energy/powerUse/WholePointData"; } from '@/api/energy/powerUse/WholePointData'
import { getToken } from "@/utils/auth"; import { getToken } from '@/utils/auth'
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from '@riophae/vue-treeselect'
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import * as echarts from "echarts"; import * as echarts from 'echarts'
import {
addShuiMeasurement,
listShuiMeasurement,
updateShuiMeasurement
} from '@/api/energy/energy/waterManagement/shuiMeasurement'
export default { export default {
name: "User", name: 'WholePointData',
dicts: ["sys_normal_disable", "sys_user_sex", "public_share_type"], dicts: ['sys_normal_disable', 'sys_user_sex', 'public_share_type'],
components: { Treeselect }, components: { Treeselect },
data() { data() {
return { return {
@ -239,9 +306,9 @@ export default {
// //
userList: null, userList: null,
// //
title: "", title: '',
// //
deptOptions: undefined, deptOptions: [{ id: 2 }],
// //
open: false, open: false,
// //
@ -250,45 +317,49 @@ export default {
initPassword: undefined, initPassword: undefined,
// //
dateRange: [], dateRange: [],
dateRangeone: "", dateRangeone: '',
dateRangetwo: "", dateRangetwo: '',
// //
postOptions: [], postOptions: [],
// //
roleOptions: [], roleOptions: [],
//list
photovoltaicList: [],
// //
form: {}, form: {},
defaultProps: { defaultProps: {
children: "children", children: 'children',
label: "lable", label: 'lable'
}, },
// //
upload: { upload: {
// //
open: false, open: false,
// //
title: "", title: '',
// //
isUploading: false, isUploading: false,
// //
updateSupport: 0, updateSupport: 0,
// //
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: 'Bearer ' + getToken() },
// //
url: process.env.VUE_APP_BASE_API + "/system/user/importData", url: process.env.VUE_APP_BASE_API + '/system/user/importData'
}, },
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
dateType: "hour", dateType: 'hour',
isAsc: "asc", isAsc: 'asc',
monitorSubset: "", monitorSubset: '',
publicShareType:'', publicShareType: '',
monitorCode: null,
instrumentValue: null,
params: { params: {
beginCollectTime: "", beginCollectTime: '',
endCollectTime: "", endCollectTime: ''
}, }
}, },
// //
columns: [ columns: [
@ -298,265 +369,261 @@ export default {
{ key: 3, label: `耗量(kW·h)`, visible: true }, { key: 3, label: `耗量(kW·h)`, visible: true },
{ key: 4, label: `开始时间`, visible: true }, { key: 4, label: `开始时间`, visible: true },
{ key: 5, label: `结束时间`, visible: true }, { key: 5, label: `结束时间`, visible: true },
{ key: 6, label: `仪表值(kW·h)`, visible: true }, { key: 6, label: `仪表值(kW·h)`, visible: true }
], ],
// //
rules: { rules: {
userName: [ monitorId: [
{ required: true, message: "用户名称不能为空", trigger: "blur" }, { required: true, message: '计量设备名称不能为空', trigger: 'blur' }
{
min: 2,
max: 20,
message: "用户名称长度必须介于 2 和 20 之间",
trigger: "blur",
},
], ],
nickName: [ expend: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" }, { required: true, message: '耗量不能为空', trigger: 'blur' }
], ],
password: [ beginTime: [
{ required: true, message: "用户密码不能为空", trigger: "blur" }, { required: true, message: '开始日期不能为空', trigger: 'blur' }
{
min: 5,
max: 20,
message: "用户密码长度必须介于 5 和 20 之间",
trigger: "blur",
},
], ],
email: [ endTime: [
{ { required: true, message: '结束日期不能为空', trigger: 'blur' }
type: "email",
message: "请输入正确的邮箱地址",
trigger: ["blur", "change"],
},
],
phonenumber: [
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur",
},
], ],
}, },
baoliudateRangeone: "", baoliudateRangeone: '',
baoliudateRangetwo: "", baoliudateRangetwo: '',
// //
dict1: [ dict1: [
{ label: "时", value: "hour" }, { label: '时', value: 'hour' },
{ label: "天", value: "day" }, { label: '天', value: 'day' },
{ label: "月", value: "month" }, { label: '月', value: 'month' },
{ label: "年", value: "year" }, { label: '年', value: 'year' }
], ],
// //
option: { option: {
tooltip: { tooltip: {
trigger: "axis", trigger: 'axis',
formatter: function (params) { formatter: function(params) {
return ( return (
params[0].name + params[0].name +
"<br>" + '<br>' +
params[0].marker + params[0].marker +
" " + ' ' +
"电耗量(kW·h):" + '电耗量(kW·h):' +
params[0].data params[0].data
); )
}, },
axisPointer: { axisPointer: {
type: "cross", type: 'cross',
crossStyle: { crossStyle: {
color: "#999", color: '#999'
}, }
}, }
}, },
xAxis: { xAxis: {
type: "category", type: 'category',
data: [], data: []
}, },
yAxis: { yAxis: {
type: "value", type: 'value',
axisLine: { show: true }, axisLine: { show: true }
}, },
series: [ series: [
{ {
tooltip: { tooltip: {
valueFormatter: function (value) { valueFormatter: function(value) {
return value; return value
}, }
}, },
data: [], data: [],
type: "bar", type: 'bar'
}, }
], ]
}, }
}; }
}, },
watch: { watch: {
// //
deptName(val) { deptName(val) {
this.$refs.tree.filter(val); this.$refs.tree.filter(val)
}, }
}, },
created() { created() {
this.dateRangeone = new Date(new Date().setHours(0, 0, 0, 0)); this.dateRangeone = new Date(new Date().setHours(0, 0, 0, 0))
var d = new Date(this.dateRangeone); var d = new Date(this.dateRangeone)
let m = ("0" + (d.getMonth() + 1)).slice(-2); let m = ('0' + (d.getMonth() + 1)).slice(-2)
let tian = ("0" + d.getDate()).slice(-2); let tian = ('0' + d.getDate()).slice(-2)
let h = ("0" + d.getHours()).slice(-2); let h = ('0' + d.getHours()).slice(-2)
let M = ("0" + d.getMinutes()).slice(-2); let M = ('0' + d.getMinutes()).slice(-2)
let s = ("0" + d.getSeconds()).slice(-2); let s = ('0' + d.getSeconds()).slice(-2)
console.log("d", d);
this.dateRangeone = this.dateRangeone =
d.getFullYear() + "-" + m + "-" + tian + " " + h + ":" + M + ":" + s; d.getFullYear() + '-' + m + '-' + tian + ' ' + h + ':' + M + ':' + s
this.baoliudateRangeone = this.dateRangeone; this.baoliudateRangeone = this.dateRangeone
this.dateRangetwo = new Date( this.dateRangetwo = new Date(
new Date().setHours(0, 0, 0, 0) + 24 * 60 * 60 * 1000 - 1 new Date().setHours(0, 0, 0, 0) + 24 * 60 * 60 * 1000 - 1
); )
var d1 = new Date(this.dateRangetwo); var d1 = new Date(this.dateRangetwo)
let m1 = ("0" + (d1.getMonth() + 1)).slice(-2); let m1 = ('0' + (d1.getMonth() + 1)).slice(-2)
let tian1 = ("0" + d1.getDate()).slice(-2); let tian1 = ('0' + d1.getDate()).slice(-2)
let h1 = ("0" + d1.getHours()).slice(-2); let h1 = ('0' + d1.getHours()).slice(-2)
let M1 = ("0" + d1.getMinutes()).slice(-2); let M1 = ('0' + d1.getMinutes()).slice(-2)
let s1 = ("0" + d1.getSeconds()).slice(-2); let s1 = ('0' + d1.getSeconds()).slice(-2)
console.log("tian1.length", tian1);
this.dateRangetwo = this.dateRangetwo =
d1.getFullYear() + d1.getFullYear() +
"-" + '-' +
m1 + m1 +
"-" + '-' +
tian1 + tian1 +
" " + ' ' +
h1 + h1 +
":" + ':' +
M1 + M1 +
":" + ':' +
s1; s1
//this.dateRangetwo = d1.getFullYear()+ '-'+m1+ '-'+tian1+ ' '+ h1+ ':'+M1+':'+s1; //this.dateRangetwo = d1.getFullYear()+ '-'+m1+ '-'+tian1+ ' '+ h1+ ':'+M1+':'+s1;
this.baoliudateRangetwo = this.dateRangetwo; this.baoliudateRangetwo = this.dateRangetwo
this.getList(); this.getList()
this.getDeptTree(); this.getDeptTree()
}, },
mounted() { mounted() {
var chartDom = document.getElementById("card"); var chartDom = document.getElementById('card')
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom)
this.option && myChart.setOption(this.option); this.option && myChart.setOption(this.option)
}, },
methods: { methods: {
/** 查询用户列表 */ /** 查询用户列表 */
getList() { getList() {
this.loading = true; this.loading = true
this.queryParams.params.beginCollectTime = this.dateRangeone; this.queryParams.params.beginCollectTime = this.dateRangeone
this.queryParams.params.endCollectTime = this.dateRangetwo; this.queryParams.params.endCollectTime = this.dateRangetwo
console.log("this.datatimeone", this.queryParams); if (this.queryParams.dateType === 'hour') {
if (this.queryParams.dateType === "hour") {
listUser(this.queryParams).then((response) => { listUser(this.queryParams).then((response) => {
this.userList = response.rows; this.userList = response.rows
this.total = response.total; this.total = response.total
this.loading = false; this.loading = false
}); })
} else { } else {
listUser2(this.queryParams).then((response) => { listUser2(this.queryParams).then((response) => {
this.userList = response.rows; this.userList = response.rows
this.total = response.total; this.total = response.total
this.loading = false; this.loading = false
}); })
} }
}, },
// //
tranListToTreeData(list) { tranListToTreeData(list) {
// //
const treeList = []; const treeList = []
// 使 // 使
const map = {}; const map = {}
// id // id
list.forEach((item) => { list.forEach((item) => {
if (!item.children) { if (!item.children) {
item.children = []; item.children = []
} }
map[item.id] = item; map[item.id] = item
}); })
list.forEach((item) => { list.forEach((item) => {
// //
// children // children
// treeList // treeList
const parent = map[item.pId]; const parent = map[item.pId]
// item // item
if (parent) { if (parent) {
parent.children.push(item); parent.children.push(item)
} else { } else {
// //
treeList.push(item); treeList.push(item)
} }
}); })
// //
return treeList; return treeList
},
/** 添加光伏整点数据 */
// submitForm: function() {
// this.$refs["form"].validate((valid) => {
// if (valid) {
// addReportPointDnb(this.form).then((response) => {
// this.$modal.msgSuccess('')
// this.open = false
// this.getList()
// })
// }
// });
// },
/** 新增按钮操作 */
handleAdd() {
this.reset()
listShuiMeasurement({publicShareType: 4}).then((response) => {
this.photovoltaicList = response.data
})
this.open = true
this.title = '添加光伏发电数据'
}, },
/** 真查询部门下拉树结构 */ /** 真查询部门下拉树结构 */
getDeptTree() { getDeptTree() {
treeDat().then((response) => { treeDat().then((response) => {
response.map((item, index) => { response.map((item, index) => {
item, (item.oid = item.id), (item.lable = item.name); item, (item.oid = item.id), (item.lable = item.name)
}); })
this.deptOptions = this.tranListToTreeData(response); this.deptOptions = this.tranListToTreeData(response)
console.log(this.deptOptions); })
//this.deptOptions = response.data;
});
}, },
// //
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true
return data.lable.indexOf(value) !== -1; return data.lable.indexOf(value) !== -1
}, },
// //
handleNodeClick(data) { handleNodeClick(data) {
this.queryParams.monitorSubset = data.monitorId; this.queryParams.monitorSubset = data.monitorId
this.getList(); this.getList()
this.dnbCountingData(); this.dnbCountingData()
}, },
// //
cancel() { cancel() {
this.open = false; this.open = false
this.reset(); this.reset()
}, },
// //
reset() { reset() {
this.form = { this.form = {
userId: undefined, objid: null,
deptId: undefined, monitorId: null,
userName: undefined, instrumentValue: null,
nickName: undefined, monitorName: null,
password: undefined, pMonitorId: null,
phonenumber: undefined, address: null,
email: undefined, expend: null,
sex: undefined, price: null,
status: "0", pointTime: null,
remark: undefined, beginTime: null,
postIds: [], endTime: null,
roleIds: [], recordTime: null,
}; meterValue: null,
this.resetForm("form"); collectType: null
}
this.resetForm('form')
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1
this.getList(); this.getList()
this.dnbCountingData(); this.dnbCountingData()
}, },
//**** */ //**** */
dnbCountingData() { dnbCountingData() {
this.loading = true; this.loading = true
dnbCountingData({ dnbCountingData({
beginCollectTime: this.queryParams.params.beginCollectTime, beginCollectTime: this.queryParams.params.beginCollectTime,
endCollectTime: this.queryParams.params.endCollectTime, endCollectTime: this.queryParams.params.endCollectTime,
type: this.queryParams.dateType, type: this.queryParams.dateType,
publicShareType: this.queryParams.publicShareType, publicShareType: this.queryParams.publicShareType,
monitorSubset: this.queryParams.monitorSubset, monitorSubset: this.queryParams.monitorSubset,
energyType: 2, energyType: 2
}).then((response) => { }).then((response) => {
this.option.xAxis.data = response.data.dateList; this.option.xAxis.data = response.data.dateList
this.option.series[0].data = response.data.valueList; this.option.series[0].data = response.data.valueList
// this.total = response.total; // this.total = response.total;
// this.loading = false; // this.loading = false;
// var chartDom = document.getElementById('card'); // var chartDom = document.getElementById('card');
@ -578,56 +645,56 @@ export default {
// ] // ]
// }; // };
// this.option = option; // this.option = option;
var chartDom = document.getElementById("card"); var chartDom = document.getElementById('card')
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom)
this.option && myChart.setOption(this.option); this.option && myChart.setOption(this.option)
}); })
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
// this.dateRange = []; // this.dateRange = [];
this.resetForm("queryForm"); this.resetForm('queryForm')
this.dateRangeone = this.baoliudateRangeone; this.dateRangeone = this.baoliudateRangeone
this.dateRangetwo = this.baoliudateRangetwo; this.dateRangetwo = this.baoliudateRangetwo
//this.queryParams.deptId = undefined; //this.queryParams.deptId = undefined;
//this.$refs.tree.setCurrentKey(null); //this.$refs.tree.setCurrentKey(null);
this.getList(); this.getList()
//this.handleQuery(); //this.handleQuery();
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map((item) => item.userId); this.ids = selection.map((item) => item.userId)
this.single = selection.length != 1; this.single = selection.length != 1
this.multiple = !selection.length; this.multiple = !selection.length
}, },
// //
handleCommand(command, row) { handleCommand(command, row) {
switch (command) { switch (command) {
case "handleResetPwd": case 'handleResetPwd':
this.handleResetPwd(row); this.handleResetPwd(row)
break; break
case "handleAuthRole": case 'handleAuthRole':
this.handleAuthRole(row); this.handleAuthRole(row)
break; break
default: default:
break; break
} }
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
let paramsexport = JSON.parse(JSON.stringify(this.queryParams)); let paramsexport = JSON.parse(JSON.stringify(this.queryParams))
delete paramsexport.pageNum; delete paramsexport.pageNum
delete paramsexport.pageSize; delete paramsexport.pageSize
this.download( this.download(
"/energy/report/pointDnb/export", '/energy/report/pointDnb/export',
{ {
...paramsexport, ...paramsexport,
orderByColumn: null, orderByColumn: null
}, },
`user_${new Date().getTime()}.xlsx` `user_${new Date().getTime()}.xlsx`
); )
}, }
}, }
}; }
</script> </script>

Loading…
Cancel
Save