|
|
|
@ -0,0 +1,571 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<!--左侧部门数据-->
|
|
|
|
|
<el-col :span="6" :xs="24">
|
|
|
|
|
<div class="head-container">
|
|
|
|
|
<el-tag
|
|
|
|
|
v-for="item in dynamicTags"
|
|
|
|
|
:key="item.monitorId"
|
|
|
|
|
closable
|
|
|
|
|
:disable-transitions="false"
|
|
|
|
|
@close="handleClose(item.monitorId)"
|
|
|
|
|
>
|
|
|
|
|
{{ item.label }}
|
|
|
|
|
</el-tag>
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="deptName"
|
|
|
|
|
placeholder="请输入计量设备名称"
|
|
|
|
|
clearable
|
|
|
|
|
size="small"
|
|
|
|
|
prefix-icon="el-icon-search"
|
|
|
|
|
style="margin-bottom: 20px"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="head-container tree">
|
|
|
|
|
<el-tree
|
|
|
|
|
ref="tree"
|
|
|
|
|
:data="deptOptions"
|
|
|
|
|
:props="defaultProps"
|
|
|
|
|
:expand-on-click-node="false"
|
|
|
|
|
:filter-node-method="filterNode"
|
|
|
|
|
node-key="id"
|
|
|
|
|
default-expand-all
|
|
|
|
|
highlight-current
|
|
|
|
|
@node-click="handleNodeClick"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!--右侧用户数据-->
|
|
|
|
|
<el-col :span="18" :xs="24">
|
|
|
|
|
<!--头部搜索条件输入框 -->
|
|
|
|
|
<el-form
|
|
|
|
|
ref="queryForm"
|
|
|
|
|
:model="queryParams"
|
|
|
|
|
:inline="true"
|
|
|
|
|
size="small"
|
|
|
|
|
v-show="showSearch"
|
|
|
|
|
label-width="68px"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="采集时间">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="queryParams.startTime"
|
|
|
|
|
:type="getDatePickerType"
|
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
:placeholder="getDatePickerPlaceholder"
|
|
|
|
|
style="width: 240px"
|
|
|
|
|
@change="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
<span class="mx-2">-</span>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="queryParams.endTime"
|
|
|
|
|
:type="getDatePickerType"
|
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
:placeholder="getDatePickerPlaceholder"
|
|
|
|
|
style="width: 240px"
|
|
|
|
|
@change="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="时间范围" prop="status">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.type"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
clearable
|
|
|
|
|
style="width: 240px"
|
|
|
|
|
@change="handleTimeRangeChange"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in timeRangeOptions"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<!--柱状图 -->
|
|
|
|
|
<el-card style="height: 750px; margin-bottom: 20px">
|
|
|
|
|
<div style="width: 100%; height: 360px" id="card1"></div>
|
|
|
|
|
</el-card>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {getEnergyConsumptionTrendAnalysis} from '@/api/energy/record/statistics'
|
|
|
|
|
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 {treeDat} from "@/api/energy/energy/base/typeRelation";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "EnergyConsumptionTrendAnalysis",
|
|
|
|
|
dicts: ["sys_normal_disable", "sys_user_sex"],
|
|
|
|
|
components: {Treeselect},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
// 选中数组
|
|
|
|
|
ids: [],
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
single: true,
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
multiple: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
showSearch: true,
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
// 用户表格数据
|
|
|
|
|
userList: null,
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 部门树选项
|
|
|
|
|
deptOptions: [],
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
// 部门名称
|
|
|
|
|
deptName: undefined,
|
|
|
|
|
// 默认密码
|
|
|
|
|
initPassword: undefined,
|
|
|
|
|
// 日期范围
|
|
|
|
|
dateRange: [],
|
|
|
|
|
dateRangeone: '',
|
|
|
|
|
dateRangetwo: '',
|
|
|
|
|
// 岗位选项
|
|
|
|
|
postOptions: [],
|
|
|
|
|
// 角色选项
|
|
|
|
|
roleOptions: [],
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
defaultProps: {
|
|
|
|
|
children: "children",
|
|
|
|
|
label: "lable",
|
|
|
|
|
},
|
|
|
|
|
// 用户导入参数
|
|
|
|
|
upload: {
|
|
|
|
|
// 是否显示弹出层(用户导入)
|
|
|
|
|
open: false,
|
|
|
|
|
// 弹出层标题(用户导入)
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否禁用上传
|
|
|
|
|
isUploading: false,
|
|
|
|
|
// 是否更新已经存在的用户数据
|
|
|
|
|
updateSupport: 0,
|
|
|
|
|
// 设置上传的请求头部
|
|
|
|
|
headers: {Authorization: "Bearer " + getToken()},
|
|
|
|
|
// 上传的地址
|
|
|
|
|
url: process.env.VUE_APP_BASE_API + "/system/user/importData",
|
|
|
|
|
},
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
type: 'hour',
|
|
|
|
|
startTime: '',
|
|
|
|
|
endTime: '',
|
|
|
|
|
energyType: 2,
|
|
|
|
|
monitorIds: '',
|
|
|
|
|
},
|
|
|
|
|
// 列信息
|
|
|
|
|
columns: [
|
|
|
|
|
{key: 0, label: `计量设备编号`, visible: true},
|
|
|
|
|
{key: 1, label: `计量设备名称`, visible: true},
|
|
|
|
|
{key: 2, label: `采集时间`, visible: true},
|
|
|
|
|
{key: 3, label: `功率因数`, visible: true},
|
|
|
|
|
{key: 4, label: `仪表值(kW·h)`, visible: true},
|
|
|
|
|
{key: 5, label: `采集方式`, visible: true},
|
|
|
|
|
],
|
|
|
|
|
//采集方式
|
|
|
|
|
dict: [
|
|
|
|
|
{label: "时", value: "hour"},
|
|
|
|
|
{label: "日", value: "day"},
|
|
|
|
|
{label: "月", value: "month"},
|
|
|
|
|
{label: "年", value: "year"},
|
|
|
|
|
],
|
|
|
|
|
//柱状图+折线图
|
|
|
|
|
option: {
|
|
|
|
|
title: {
|
|
|
|
|
text: "环比分析",
|
|
|
|
|
left: "center",
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: "axis",
|
|
|
|
|
formatter: function (params) {
|
|
|
|
|
var relvsl = '';
|
|
|
|
|
for (var i = 0, l = params.length; i < l; i++) {
|
|
|
|
|
relvsl += params[i].marker + ' ' + params[i].seriesName + "(KW-h):" + params[i].data + '<br>'
|
|
|
|
|
}
|
|
|
|
|
return params[0].name + '<br>' + relvsl
|
|
|
|
|
},
|
|
|
|
|
axisPointer: {
|
|
|
|
|
type: "cross",
|
|
|
|
|
crossStyle: {
|
|
|
|
|
color: "#999",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
data: [],
|
|
|
|
|
right: "5%",
|
|
|
|
|
},
|
|
|
|
|
xAxis: [
|
|
|
|
|
{
|
|
|
|
|
type: "category",
|
|
|
|
|
data: [],
|
|
|
|
|
axisPointer: {
|
|
|
|
|
type: "shadow",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
yAxis: [
|
|
|
|
|
{
|
|
|
|
|
type: "value",
|
|
|
|
|
name: "单位:KW-h",
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: true,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
name: "",
|
|
|
|
|
type: "bar",
|
|
|
|
|
tooltip: {
|
|
|
|
|
valueFormatter: function (value) {
|
|
|
|
|
return value;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
data: [],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
optionTwo: {
|
|
|
|
|
title: {
|
|
|
|
|
text: "能耗曲线",
|
|
|
|
|
left: "center",
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: "axis",
|
|
|
|
|
formatter: function (params) {
|
|
|
|
|
var relvsl = '';
|
|
|
|
|
for (var i = 0, l = params.length; i < l; i++) {
|
|
|
|
|
relvsl += params[i].marker + ' ' + params[i].seriesName + "(KW-h):" + params[i].data + '<br>'
|
|
|
|
|
}
|
|
|
|
|
return params[0].name + '<br>' + relvsl
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
data: [],
|
|
|
|
|
right: '5%',
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
left: "3%",
|
|
|
|
|
right: "4%",
|
|
|
|
|
bottom: "3%",
|
|
|
|
|
containLabel: true,
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: "category",
|
|
|
|
|
boundaryGap: false,
|
|
|
|
|
data: [],
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: "value",
|
|
|
|
|
name: "单位:KW-h",
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: true,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: [],
|
|
|
|
|
},
|
|
|
|
|
dynamicTags: [],
|
|
|
|
|
// 时间范围选项
|
|
|
|
|
timeRangeOptions: [
|
|
|
|
|
{label: "时", value: "hour"},
|
|
|
|
|
{label: "日", value: "day"},
|
|
|
|
|
{label: "月", value: "month"},
|
|
|
|
|
{label: "年", value: "year"},
|
|
|
|
|
],
|
|
|
|
|
// 图表配置
|
|
|
|
|
chartOptions: {
|
|
|
|
|
lineChart: {
|
|
|
|
|
title: {text: "能耗曲线", left: "center"},
|
|
|
|
|
tooltip: {trigger: "axis", formatter: this.formatTooltip},
|
|
|
|
|
legend: {data: [], right: '5%'},
|
|
|
|
|
grid: {left: "3%", right: "4%", bottom: "3%", containLabel: true},
|
|
|
|
|
xAxis: {type: "category", boundaryGap: false, data: []},
|
|
|
|
|
yAxis: {type: "value", name: "单位:KW-h", axisLine: {show: true}},
|
|
|
|
|
series: []
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
// 根据名称筛选部门树
|
|
|
|
|
deptName(val) {
|
|
|
|
|
this.$refs.tree.filter(val);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.initDateTime();
|
|
|
|
|
this.getDeptTree();
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.initCharts();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 初始化方法
|
|
|
|
|
initDateTime() {
|
|
|
|
|
const now = new Date();
|
|
|
|
|
const startTime = new Date(now.setHours(0, 0, 0, 0));
|
|
|
|
|
const endTime = new Date(now.setHours(23, 59, 59, 999));
|
|
|
|
|
|
|
|
|
|
this.queryParams.startTime = this.formatDateTime(startTime, this.queryParams.type);
|
|
|
|
|
this.queryParams.endTime = this.formatDateTime(endTime, this.queryParams.type);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
initCharts() {
|
|
|
|
|
const lineChart = echarts.init(document.getElementById("card1"));
|
|
|
|
|
lineChart.setOption(this.chartOptions.lineChart);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 工具方法
|
|
|
|
|
formatDateTime(date, type) {
|
|
|
|
|
const pad = num => String(num).padStart(2, '0');
|
|
|
|
|
const year = date.getFullYear();
|
|
|
|
|
const month = pad(date.getMonth() + 1);
|
|
|
|
|
const day = pad(date.getDate());
|
|
|
|
|
const hours = pad(date.getHours());
|
|
|
|
|
const minutes = pad(date.getMinutes());
|
|
|
|
|
const seconds = pad(date.getSeconds());
|
|
|
|
|
|
|
|
|
|
switch(type) {
|
|
|
|
|
case 'year':
|
|
|
|
|
return `${year}-01-01 00:00:00`;
|
|
|
|
|
case 'month':
|
|
|
|
|
return `${year}-${month}-01 00:00:00`;
|
|
|
|
|
case 'day':
|
|
|
|
|
return `${year}-${month}-${day} 00:00:00`;
|
|
|
|
|
case 'hour':
|
|
|
|
|
default:
|
|
|
|
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 获取结束时间
|
|
|
|
|
getEndDateTime(date, type) {
|
|
|
|
|
const pad = num => String(num).padStart(2, '0');
|
|
|
|
|
const year = date.getFullYear();
|
|
|
|
|
const month = pad(date.getMonth() + 1);
|
|
|
|
|
const day = pad(date.getDate());
|
|
|
|
|
|
|
|
|
|
switch(type) {
|
|
|
|
|
case 'year':
|
|
|
|
|
return `${year}-12-31 23:59:59`;
|
|
|
|
|
case 'month':
|
|
|
|
|
// 获取当月最后一天
|
|
|
|
|
const lastDay = new Date(year, date.getMonth() + 1, 0).getDate();
|
|
|
|
|
return `${year}-${month}-${pad(lastDay)} 23:59:59`;
|
|
|
|
|
case 'day':
|
|
|
|
|
return `${year}-${month}-${day} 23:59:59`;
|
|
|
|
|
case 'hour':
|
|
|
|
|
default:
|
|
|
|
|
return `${year}-${month}-${day} 23:59:59`;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 监听时间范围变化
|
|
|
|
|
handleTimeRangeChange(type) {
|
|
|
|
|
const now = new Date();
|
|
|
|
|
const startTime = new Date(now.setHours(0, 0, 0, 0));
|
|
|
|
|
const endTime = new Date(now.setHours(23, 59, 59, 999));
|
|
|
|
|
|
|
|
|
|
this.queryParams.startTime = this.formatDateTime(startTime, type);
|
|
|
|
|
this.queryParams.endTime = this.getEndDateTime(endTime, type);
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//数组转树形结构
|
|
|
|
|
tranListToTreeData(list) {
|
|
|
|
|
// 最终要产出的树状数据的数组
|
|
|
|
|
const treeList = []
|
|
|
|
|
// 所有项都使用对象存储起来
|
|
|
|
|
const map = {}
|
|
|
|
|
|
|
|
|
|
// 建立一个映射关系:通过id快速找到对应的元素
|
|
|
|
|
list.forEach(item => {
|
|
|
|
|
if (!item.children) {
|
|
|
|
|
item.children = []
|
|
|
|
|
}
|
|
|
|
|
map[item.id] = item
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
list.forEach(item => {
|
|
|
|
|
// 对于每一个元素来说,先找它的上级
|
|
|
|
|
// 如果能找到,说明它有上级,则要把它添加到上级的children中去
|
|
|
|
|
// 如果找不到,说明它没有上级,直接添加到 treeList
|
|
|
|
|
const parent = map[item.pId]
|
|
|
|
|
// 如果存在则表示item不是最顶层的数据
|
|
|
|
|
if (parent) {
|
|
|
|
|
parent.children.push(item)
|
|
|
|
|
} else {
|
|
|
|
|
// 如果不存在 则是顶层数据
|
|
|
|
|
treeList.push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
// 返回出去
|
|
|
|
|
return treeList
|
|
|
|
|
},
|
|
|
|
|
/** 查询部门下拉树结构 */
|
|
|
|
|
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;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 筛选节点
|
|
|
|
|
filterNode(value, data) {
|
|
|
|
|
if (!value) return true;
|
|
|
|
|
return data.lable.indexOf(value) !== -1;
|
|
|
|
|
},
|
|
|
|
|
// 节点单击事件
|
|
|
|
|
handleNodeClick(data) {
|
|
|
|
|
console.log("data", data);
|
|
|
|
|
this.queryParams.monitorId = data.id;
|
|
|
|
|
this.dynamicTags.push({label: data.name, value: data.id});
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
//删除左上头部的tag
|
|
|
|
|
handleClose(item) {
|
|
|
|
|
this.dynamicTags.splice(this.dynamicTags.indexOf(item), 1);
|
|
|
|
|
let querydata = [];
|
|
|
|
|
this.dynamicTags.map((item) => {
|
|
|
|
|
querydata.push(item.value);
|
|
|
|
|
});
|
|
|
|
|
querydata.toString();
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
datetimechangetwo() {
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
userId: undefined,
|
|
|
|
|
monitorId: undefined,
|
|
|
|
|
userName: undefined,
|
|
|
|
|
nickName: undefined,
|
|
|
|
|
password: undefined,
|
|
|
|
|
phonenumber: undefined,
|
|
|
|
|
email: undefined,
|
|
|
|
|
sex: undefined,
|
|
|
|
|
status: "0",
|
|
|
|
|
remark: undefined,
|
|
|
|
|
postIds: [],
|
|
|
|
|
roleIds: [],
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
async handleQuery() {
|
|
|
|
|
const monitorIds = this.dynamicTags.map(tag => tag.value).join(',');
|
|
|
|
|
|
|
|
|
|
// 获取能耗曲线数据
|
|
|
|
|
const response = await getEnergyConsumptionTrendAnalysis({
|
|
|
|
|
type: this.queryParams.type,
|
|
|
|
|
startTime: this.queryParams.startTime,
|
|
|
|
|
endTime: this.queryParams.endTime,
|
|
|
|
|
monitorIds,
|
|
|
|
|
energyType: 2
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 更新能耗曲线图表
|
|
|
|
|
this.updateEnergyChart(response.data);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 更新能耗曲线图表
|
|
|
|
|
updateEnergyChart(data) {
|
|
|
|
|
const {monitorNameList, timeList, monitorInfoMap} = data;
|
|
|
|
|
const seriesData = Object.entries(monitorInfoMap).map(([_, values], index) => ({
|
|
|
|
|
name: monitorNameList[index],
|
|
|
|
|
type: "line",
|
|
|
|
|
stack: "Total",
|
|
|
|
|
data: values
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
const lineChart = echarts.init(document.getElementById("card1"));
|
|
|
|
|
this.chartOptions.lineChart.legend.data = monitorNameList;
|
|
|
|
|
this.chartOptions.lineChart.xAxis.data = timeList;
|
|
|
|
|
this.chartOptions.lineChart.series = seriesData;
|
|
|
|
|
lineChart.setOption(this.chartOptions.lineChart);
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.dateRange = [];
|
|
|
|
|
this.datetimechangetwo = '',
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.queryParams.monitorId = undefined;
|
|
|
|
|
this.$refs.tree.setCurrentKey(null);
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
getDatePickerType() {
|
|
|
|
|
switch(this.queryParams.type) {
|
|
|
|
|
case 'year':
|
|
|
|
|
return 'year';
|
|
|
|
|
case 'month':
|
|
|
|
|
return 'month';
|
|
|
|
|
case 'day':
|
|
|
|
|
return 'date';
|
|
|
|
|
case 'hour':
|
|
|
|
|
default:
|
|
|
|
|
return 'datetime';
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getDatePickerPlaceholder() {
|
|
|
|
|
switch(this.queryParams.type) {
|
|
|
|
|
case 'year':
|
|
|
|
|
return '选择年份';
|
|
|
|
|
case 'month':
|
|
|
|
|
return '选择月份';
|
|
|
|
|
case 'day':
|
|
|
|
|
return '选择日期';
|
|
|
|
|
case 'hour':
|
|
|
|
|
default:
|
|
|
|
|
return '选择日期时间';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.tree {
|
|
|
|
|
width: 220px;
|
|
|
|
|
|
|
|
|
|
::v-deep .el-tree-node {
|
|
|
|
|
white-space: normal; //关键代码!!!!!!!!!
|
|
|
|
|
.el-tree-node__content {
|
|
|
|
|
height: 100%;
|
|
|
|
|
align-items: start;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mx-2 {
|
|
|
|
|
margin: 0 8px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|