|
|
|
@ -21,7 +21,7 @@
|
|
|
|
|
:filter-node-method="filterNode"
|
|
|
|
|
ref="tree"
|
|
|
|
|
node-key="id"
|
|
|
|
|
default-expand-all
|
|
|
|
|
:default-expanded-keys="[deptOptions[0].id]"
|
|
|
|
|
highlight-current
|
|
|
|
|
@node-click="handleNodeClick"
|
|
|
|
|
/>
|
|
|
|
@ -47,16 +47,20 @@
|
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
></el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item><div>-</div></el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<div>-</div>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item
|
|
|
|
|
><el-date-picker
|
|
|
|
|
>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="dateRangetwo"
|
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
style="width: 240px"
|
|
|
|
|
type="datetime"
|
|
|
|
|
placeholder="选择日期时间"
|
|
|
|
|
></el-date-picker
|
|
|
|
|
></el-form-item>
|
|
|
|
|
>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="时间范围" prop="status">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.dateType"
|
|
|
|
@ -93,10 +97,12 @@
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleQuery"
|
|
|
|
|
>搜索</el-button
|
|
|
|
|
>搜索
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
|
|
|
>重置</el-button
|
|
|
|
|
>重置
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
@ -111,6 +117,16 @@
|
|
|
|
|
</el-card>
|
|
|
|
|
<!-- 新增等功能按钮 -->
|
|
|
|
|
<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-button
|
|
|
|
|
type="warning"
|
|
|
|
@ -119,7 +135,8 @@
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
v-hasPermi="['report:pointDnb:export']"
|
|
|
|
|
>导出</el-button
|
|
|
|
|
>导出
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar
|
|
|
|
@ -134,7 +151,7 @@
|
|
|
|
|
:data="userList"
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="selection" width="50" align="center" />
|
|
|
|
|
<el-table-column type="selection" width="50" align="center"/>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="计量设备编号"
|
|
|
|
|
align="center"
|
|
|
|
@ -202,6 +219,51 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-col>
|
|
|
|
|
</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>-->
|
|
|
|
|
<!-- <!– <el-form-item label="仪表值" prop="instrumentValue">–>-->
|
|
|
|
|
<!-- <!– <el-input v-model="form.instrumentValue" placeholder="请输入仪表值"/>–>-->
|
|
|
|
|
<!-- <!– </el-form-item>–>-->
|
|
|
|
|
<!-- <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>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -211,16 +273,21 @@ import {
|
|
|
|
|
treeDat,
|
|
|
|
|
dnbCountingData,
|
|
|
|
|
listUser2,
|
|
|
|
|
deptTreeSelect,
|
|
|
|
|
} from "@/api/energy/powerUse/WholePointData";
|
|
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
import * as echarts from "echarts";
|
|
|
|
|
deptTreeSelect
|
|
|
|
|
} from '@/api/energy/powerUse/WholePointData'
|
|
|
|
|
import { getToken } from '@/utils/auth'
|
|
|
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
|
import * as echarts from 'echarts'
|
|
|
|
|
import {
|
|
|
|
|
addShuiMeasurement,
|
|
|
|
|
listShuiMeasurement,
|
|
|
|
|
updateShuiMeasurement
|
|
|
|
|
} from '@/api/energy/energy/waterManagement/shuiMeasurement'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "User",
|
|
|
|
|
dicts: ["sys_normal_disable", "sys_user_sex", "public_share_type"],
|
|
|
|
|
name: 'WholePointData',
|
|
|
|
|
dicts: ['sys_normal_disable', 'sys_user_sex', 'public_share_type'],
|
|
|
|
|
components: { Treeselect },
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
@ -239,9 +306,9 @@ export default {
|
|
|
|
|
// 用户表格数据
|
|
|
|
|
userList: null,
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
title: '',
|
|
|
|
|
// 部门树选项
|
|
|
|
|
deptOptions: undefined,
|
|
|
|
|
deptOptions: [{ id: 2 }],
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
// 部门名称
|
|
|
|
@ -250,45 +317,49 @@ export default {
|
|
|
|
|
initPassword: undefined,
|
|
|
|
|
// 日期范围
|
|
|
|
|
dateRange: [],
|
|
|
|
|
dateRangeone: "",
|
|
|
|
|
dateRangetwo: "",
|
|
|
|
|
dateRangeone: '',
|
|
|
|
|
dateRangetwo: '',
|
|
|
|
|
// 岗位选项
|
|
|
|
|
postOptions: [],
|
|
|
|
|
// 角色选项
|
|
|
|
|
roleOptions: [],
|
|
|
|
|
//光伏list
|
|
|
|
|
photovoltaicList: [],
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
defaultProps: {
|
|
|
|
|
children: "children",
|
|
|
|
|
label: "lable",
|
|
|
|
|
children: 'children',
|
|
|
|
|
label: 'lable'
|
|
|
|
|
},
|
|
|
|
|
// 用户导入参数
|
|
|
|
|
upload: {
|
|
|
|
|
// 是否显示弹出层(用户导入)
|
|
|
|
|
open: false,
|
|
|
|
|
// 弹出层标题(用户导入)
|
|
|
|
|
title: "",
|
|
|
|
|
title: '',
|
|
|
|
|
// 是否禁用上传
|
|
|
|
|
isUploading: false,
|
|
|
|
|
// 是否更新已经存在的用户数据
|
|
|
|
|
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: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
dateType: "hour",
|
|
|
|
|
isAsc: "asc",
|
|
|
|
|
monitorSubset: "",
|
|
|
|
|
publicShareType:'',
|
|
|
|
|
dateType: 'hour',
|
|
|
|
|
isAsc: 'asc',
|
|
|
|
|
monitorSubset: '',
|
|
|
|
|
publicShareType: '',
|
|
|
|
|
monitorCode: null,
|
|
|
|
|
instrumentValue: null,
|
|
|
|
|
params: {
|
|
|
|
|
beginCollectTime: "",
|
|
|
|
|
endCollectTime: "",
|
|
|
|
|
},
|
|
|
|
|
beginCollectTime: '',
|
|
|
|
|
endCollectTime: ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 列信息
|
|
|
|
|
columns: [
|
|
|
|
@ -298,265 +369,261 @@ export default {
|
|
|
|
|
{ key: 3, label: `耗量(kW·h)`, visible: true },
|
|
|
|
|
{ key: 4, label: `开始时间`, visible: true },
|
|
|
|
|
{ key: 5, label: `结束时间`, visible: true },
|
|
|
|
|
{ key: 6, label: `仪表值(kW·h)`, visible: true },
|
|
|
|
|
{ key: 6, label: `仪表值(kW·h)`, visible: true }
|
|
|
|
|
],
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
userName: [
|
|
|
|
|
{ required: true, message: "用户名称不能为空", trigger: "blur" },
|
|
|
|
|
{
|
|
|
|
|
min: 2,
|
|
|
|
|
max: 20,
|
|
|
|
|
message: "用户名称长度必须介于 2 和 20 之间",
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
monitorId: [
|
|
|
|
|
{ required: true, message: '计量设备名称不能为空', trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
nickName: [
|
|
|
|
|
{ required: true, message: "用户昵称不能为空", trigger: "blur" },
|
|
|
|
|
expend: [
|
|
|
|
|
{ required: true, message: '耗量不能为空', trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
password: [
|
|
|
|
|
{ required: true, message: "用户密码不能为空", trigger: "blur" },
|
|
|
|
|
{
|
|
|
|
|
min: 5,
|
|
|
|
|
max: 20,
|
|
|
|
|
message: "用户密码长度必须介于 5 和 20 之间",
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
beginTime: [
|
|
|
|
|
{ required: true, message: '开始日期不能为空', trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
email: [
|
|
|
|
|
{
|
|
|
|
|
type: "email",
|
|
|
|
|
message: "请输入正确的邮箱地址",
|
|
|
|
|
trigger: ["blur", "change"],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
phonenumber: [
|
|
|
|
|
{
|
|
|
|
|
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
|
|
|
message: "请输入正确的手机号码",
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
endTime: [
|
|
|
|
|
{ required: true, message: '结束日期不能为空', trigger: 'blur' }
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
baoliudateRangeone: "",
|
|
|
|
|
baoliudateRangetwo: "",
|
|
|
|
|
baoliudateRangeone: '',
|
|
|
|
|
baoliudateRangetwo: '',
|
|
|
|
|
//采集方式
|
|
|
|
|
dict1: [
|
|
|
|
|
{ label: "时", value: "hour" },
|
|
|
|
|
{ label: "天", value: "day" },
|
|
|
|
|
{ label: "月", value: "month" },
|
|
|
|
|
{ label: "年", value: "year" },
|
|
|
|
|
{ label: '时', value: 'hour' },
|
|
|
|
|
{ label: '天', value: 'day' },
|
|
|
|
|
{ label: '月', value: 'month' },
|
|
|
|
|
{ label: '年', value: 'year' }
|
|
|
|
|
],
|
|
|
|
|
//柱状图
|
|
|
|
|
option: {
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: "axis",
|
|
|
|
|
formatter: function (params) {
|
|
|
|
|
trigger: 'axis',
|
|
|
|
|
formatter: function(params) {
|
|
|
|
|
return (
|
|
|
|
|
params[0].name +
|
|
|
|
|
"<br>" +
|
|
|
|
|
'<br>' +
|
|
|
|
|
params[0].marker +
|
|
|
|
|
" " +
|
|
|
|
|
"电耗量(kW·h):" +
|
|
|
|
|
' ' +
|
|
|
|
|
'电耗量(kW·h):' +
|
|
|
|
|
params[0].data
|
|
|
|
|
);
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
axisPointer: {
|
|
|
|
|
type: "cross",
|
|
|
|
|
type: 'cross',
|
|
|
|
|
crossStyle: {
|
|
|
|
|
color: "#999",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
color: '#999'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: "category",
|
|
|
|
|
data: [],
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: []
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: "value",
|
|
|
|
|
axisLine: { show: true },
|
|
|
|
|
type: 'value',
|
|
|
|
|
axisLine: { show: true }
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
tooltip: {
|
|
|
|
|
valueFormatter: function (value) {
|
|
|
|
|
return value;
|
|
|
|
|
},
|
|
|
|
|
valueFormatter: function(value) {
|
|
|
|
|
return value
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data: [],
|
|
|
|
|
type: "bar",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
type: 'bar'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
// 根据名称筛选部门树
|
|
|
|
|
deptName(val) {
|
|
|
|
|
this.$refs.tree.filter(val);
|
|
|
|
|
},
|
|
|
|
|
this.$refs.tree.filter(val)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.dateRangeone = new Date(new Date().setHours(0, 0, 0, 0));
|
|
|
|
|
var d = new Date(this.dateRangeone);
|
|
|
|
|
let m = ("0" + (d.getMonth() + 1)).slice(-2);
|
|
|
|
|
let tian = ("0" + d.getDate()).slice(-2);
|
|
|
|
|
let h = ("0" + d.getHours()).slice(-2);
|
|
|
|
|
let M = ("0" + d.getMinutes()).slice(-2);
|
|
|
|
|
let s = ("0" + d.getSeconds()).slice(-2);
|
|
|
|
|
this.dateRangeone = new Date(new Date().setHours(0, 0, 0, 0))
|
|
|
|
|
var d = new Date(this.dateRangeone)
|
|
|
|
|
let m = ('0' + (d.getMonth() + 1)).slice(-2)
|
|
|
|
|
let tian = ('0' + d.getDate()).slice(-2)
|
|
|
|
|
let h = ('0' + d.getHours()).slice(-2)
|
|
|
|
|
let M = ('0' + d.getMinutes()).slice(-2)
|
|
|
|
|
let s = ('0' + d.getSeconds()).slice(-2)
|
|
|
|
|
|
|
|
|
|
console.log("d", d);
|
|
|
|
|
this.dateRangeone =
|
|
|
|
|
d.getFullYear() + "-" + m + "-" + tian + " " + h + ":" + M + ":" + s;
|
|
|
|
|
this.baoliudateRangeone = this.dateRangeone;
|
|
|
|
|
d.getFullYear() + '-' + m + '-' + tian + ' ' + h + ':' + M + ':' + s
|
|
|
|
|
this.baoliudateRangeone = this.dateRangeone
|
|
|
|
|
this.dateRangetwo = new Date(
|
|
|
|
|
new Date().setHours(0, 0, 0, 0) + 24 * 60 * 60 * 1000 - 1
|
|
|
|
|
);
|
|
|
|
|
var d1 = new Date(this.dateRangetwo);
|
|
|
|
|
let m1 = ("0" + (d1.getMonth() + 1)).slice(-2);
|
|
|
|
|
let tian1 = ("0" + d1.getDate()).slice(-2);
|
|
|
|
|
let h1 = ("0" + d1.getHours()).slice(-2);
|
|
|
|
|
let M1 = ("0" + d1.getMinutes()).slice(-2);
|
|
|
|
|
let s1 = ("0" + d1.getSeconds()).slice(-2);
|
|
|
|
|
console.log("tian1.length", tian1);
|
|
|
|
|
)
|
|
|
|
|
var d1 = new Date(this.dateRangetwo)
|
|
|
|
|
let m1 = ('0' + (d1.getMonth() + 1)).slice(-2)
|
|
|
|
|
let tian1 = ('0' + d1.getDate()).slice(-2)
|
|
|
|
|
let h1 = ('0' + d1.getHours()).slice(-2)
|
|
|
|
|
let M1 = ('0' + d1.getMinutes()).slice(-2)
|
|
|
|
|
let s1 = ('0' + d1.getSeconds()).slice(-2)
|
|
|
|
|
this.dateRangetwo =
|
|
|
|
|
d1.getFullYear() +
|
|
|
|
|
"-" +
|
|
|
|
|
'-' +
|
|
|
|
|
m1 +
|
|
|
|
|
"-" +
|
|
|
|
|
'-' +
|
|
|
|
|
tian1 +
|
|
|
|
|
" " +
|
|
|
|
|
' ' +
|
|
|
|
|
h1 +
|
|
|
|
|
":" +
|
|
|
|
|
':' +
|
|
|
|
|
M1 +
|
|
|
|
|
":" +
|
|
|
|
|
s1;
|
|
|
|
|
':' +
|
|
|
|
|
s1
|
|
|
|
|
//this.dateRangetwo = d1.getFullYear()+ '-'+m1+ '-'+tian1+ ' '+ h1+ ':'+M1+':'+s1;
|
|
|
|
|
this.baoliudateRangetwo = this.dateRangetwo;
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getDeptTree();
|
|
|
|
|
this.baoliudateRangetwo = this.dateRangetwo
|
|
|
|
|
this.getList()
|
|
|
|
|
this.getDeptTree()
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
var chartDom = document.getElementById("card");
|
|
|
|
|
var myChart = echarts.init(chartDom);
|
|
|
|
|
this.option && myChart.setOption(this.option);
|
|
|
|
|
var chartDom = document.getElementById('card')
|
|
|
|
|
var myChart = echarts.init(chartDom)
|
|
|
|
|
this.option && myChart.setOption(this.option)
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/** 查询用户列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.queryParams.params.beginCollectTime = this.dateRangeone;
|
|
|
|
|
this.queryParams.params.endCollectTime = this.dateRangetwo;
|
|
|
|
|
console.log("this.datatimeone", this.queryParams);
|
|
|
|
|
if (this.queryParams.dateType === "hour") {
|
|
|
|
|
this.loading = true
|
|
|
|
|
this.queryParams.params.beginCollectTime = this.dateRangeone
|
|
|
|
|
this.queryParams.params.endCollectTime = this.dateRangetwo
|
|
|
|
|
if (this.queryParams.dateType === 'hour') {
|
|
|
|
|
listUser(this.queryParams).then((response) => {
|
|
|
|
|
this.userList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
this.userList = response.rows
|
|
|
|
|
this.total = response.total
|
|
|
|
|
this.loading = false
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
listUser2(this.queryParams).then((response) => {
|
|
|
|
|
this.userList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
this.userList = response.rows
|
|
|
|
|
this.total = response.total
|
|
|
|
|
this.loading = false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//数组转树形结构
|
|
|
|
|
tranListToTreeData(list) {
|
|
|
|
|
// 最终要产出的树状数据的数组
|
|
|
|
|
const treeList = [];
|
|
|
|
|
const treeList = []
|
|
|
|
|
// 所有项都使用对象存储起来
|
|
|
|
|
const map = {};
|
|
|
|
|
const map = {}
|
|
|
|
|
|
|
|
|
|
// 建立一个映射关系:通过id快速找到对应的元素
|
|
|
|
|
list.forEach((item) => {
|
|
|
|
|
if (!item.children) {
|
|
|
|
|
item.children = [];
|
|
|
|
|
item.children = []
|
|
|
|
|
}
|
|
|
|
|
map[item.id] = item;
|
|
|
|
|
});
|
|
|
|
|
map[item.id] = item
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
list.forEach((item) => {
|
|
|
|
|
// 对于每一个元素来说,先找它的上级
|
|
|
|
|
// 如果能找到,说明它有上级,则要把它添加到上级的children中去
|
|
|
|
|
// 如果找不到,说明它没有上级,直接添加到 treeList
|
|
|
|
|
const parent = map[item.pId];
|
|
|
|
|
const parent = map[item.pId]
|
|
|
|
|
// 如果存在则表示item不是最顶层的数据
|
|
|
|
|
if (parent) {
|
|
|
|
|
parent.children.push(item);
|
|
|
|
|
parent.children.push(item)
|
|
|
|
|
} 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() {
|
|
|
|
|
treeDat().then((response) => {
|
|
|
|
|
response.map((item, index) => {
|
|
|
|
|
item, (item.oid = item.id), (item.lable = item.name);
|
|
|
|
|
});
|
|
|
|
|
this.deptOptions = this.tranListToTreeData(response);
|
|
|
|
|
console.log(this.deptOptions);
|
|
|
|
|
//this.deptOptions = response.data;
|
|
|
|
|
});
|
|
|
|
|
item, (item.oid = item.id), (item.lable = item.name)
|
|
|
|
|
})
|
|
|
|
|
this.deptOptions = this.tranListToTreeData(response)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 筛选节点
|
|
|
|
|
filterNode(value, data) {
|
|
|
|
|
if (!value) return true;
|
|
|
|
|
return data.lable.indexOf(value) !== -1;
|
|
|
|
|
if (!value) return true
|
|
|
|
|
return data.lable.indexOf(value) !== -1
|
|
|
|
|
},
|
|
|
|
|
// 节点单击事件
|
|
|
|
|
handleNodeClick(data) {
|
|
|
|
|
this.queryParams.monitorSubset = data.monitorId;
|
|
|
|
|
this.getList();
|
|
|
|
|
this.dnbCountingData();
|
|
|
|
|
this.queryParams.monitorSubset = data.monitorId
|
|
|
|
|
this.getList()
|
|
|
|
|
this.dnbCountingData()
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
this.open = false
|
|
|
|
|
this.reset()
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
userId: undefined,
|
|
|
|
|
deptId: undefined,
|
|
|
|
|
userName: undefined,
|
|
|
|
|
nickName: undefined,
|
|
|
|
|
password: undefined,
|
|
|
|
|
phonenumber: undefined,
|
|
|
|
|
email: undefined,
|
|
|
|
|
sex: undefined,
|
|
|
|
|
status: "0",
|
|
|
|
|
remark: undefined,
|
|
|
|
|
postIds: [],
|
|
|
|
|
roleIds: [],
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
objid: null,
|
|
|
|
|
monitorId: null,
|
|
|
|
|
instrumentValue: null,
|
|
|
|
|
monitorName: null,
|
|
|
|
|
pMonitorId: null,
|
|
|
|
|
address: null,
|
|
|
|
|
expend: null,
|
|
|
|
|
price: null,
|
|
|
|
|
pointTime: null,
|
|
|
|
|
beginTime: null,
|
|
|
|
|
endTime: null,
|
|
|
|
|
recordTime: null,
|
|
|
|
|
meterValue: null,
|
|
|
|
|
collectType: null
|
|
|
|
|
}
|
|
|
|
|
this.resetForm('form')
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
|
this.getList();
|
|
|
|
|
this.dnbCountingData();
|
|
|
|
|
this.queryParams.pageNum = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
this.dnbCountingData()
|
|
|
|
|
},
|
|
|
|
|
//****柱状图请求 */
|
|
|
|
|
dnbCountingData() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.loading = true
|
|
|
|
|
dnbCountingData({
|
|
|
|
|
beginCollectTime: this.queryParams.params.beginCollectTime,
|
|
|
|
|
endCollectTime: this.queryParams.params.endCollectTime,
|
|
|
|
|
type: this.queryParams.dateType,
|
|
|
|
|
publicShareType: this.queryParams.publicShareType,
|
|
|
|
|
monitorSubset: this.queryParams.monitorSubset,
|
|
|
|
|
energyType: 2,
|
|
|
|
|
energyType: 2
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
this.option.xAxis.data = response.data.dateList;
|
|
|
|
|
this.option.series[0].data = response.data.valueList;
|
|
|
|
|
this.option.xAxis.data = response.data.dateList
|
|
|
|
|
this.option.series[0].data = response.data.valueList
|
|
|
|
|
// this.total = response.total;
|
|
|
|
|
// this.loading = false;
|
|
|
|
|
// var chartDom = document.getElementById('card');
|
|
|
|
@ -578,56 +645,56 @@ export default {
|
|
|
|
|
// ]
|
|
|
|
|
// };
|
|
|
|
|
// this.option = option;
|
|
|
|
|
var chartDom = document.getElementById("card");
|
|
|
|
|
var myChart = echarts.init(chartDom);
|
|
|
|
|
this.option && myChart.setOption(this.option);
|
|
|
|
|
});
|
|
|
|
|
var chartDom = document.getElementById('card')
|
|
|
|
|
var myChart = echarts.init(chartDom)
|
|
|
|
|
this.option && myChart.setOption(this.option)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
// this.dateRange = [];
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.dateRangeone = this.baoliudateRangeone;
|
|
|
|
|
this.dateRangetwo = this.baoliudateRangetwo;
|
|
|
|
|
this.resetForm('queryForm')
|
|
|
|
|
this.dateRangeone = this.baoliudateRangeone
|
|
|
|
|
this.dateRangetwo = this.baoliudateRangetwo
|
|
|
|
|
//this.queryParams.deptId = undefined;
|
|
|
|
|
//this.$refs.tree.setCurrentKey(null);
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getList()
|
|
|
|
|
//this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map((item) => item.userId);
|
|
|
|
|
this.single = selection.length != 1;
|
|
|
|
|
this.multiple = !selection.length;
|
|
|
|
|
this.ids = selection.map((item) => item.userId)
|
|
|
|
|
this.single = selection.length != 1
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
},
|
|
|
|
|
// 更多操作触发
|
|
|
|
|
handleCommand(command, row) {
|
|
|
|
|
switch (command) {
|
|
|
|
|
case "handleResetPwd":
|
|
|
|
|
this.handleResetPwd(row);
|
|
|
|
|
break;
|
|
|
|
|
case "handleAuthRole":
|
|
|
|
|
this.handleAuthRole(row);
|
|
|
|
|
break;
|
|
|
|
|
case 'handleResetPwd':
|
|
|
|
|
this.handleResetPwd(row)
|
|
|
|
|
break
|
|
|
|
|
case 'handleAuthRole':
|
|
|
|
|
this.handleAuthRole(row)
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
let paramsexport = JSON.parse(JSON.stringify(this.queryParams));
|
|
|
|
|
delete paramsexport.pageNum;
|
|
|
|
|
delete paramsexport.pageSize;
|
|
|
|
|
let paramsexport = JSON.parse(JSON.stringify(this.queryParams))
|
|
|
|
|
delete paramsexport.pageNum
|
|
|
|
|
delete paramsexport.pageSize
|
|
|
|
|
this.download(
|
|
|
|
|
"/energy/report/pointDnb/export",
|
|
|
|
|
'/energy/report/pointDnb/export',
|
|
|
|
|
{
|
|
|
|
|
...paramsexport,
|
|
|
|
|
orderByColumn: null,
|
|
|
|
|
orderByColumn: null
|
|
|
|
|
},
|
|
|
|
|
`user_${new Date().getTime()}.xlsx`
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|