Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
海康威视
web-project
Commits
e8f6a530
Commit
e8f6a530
authored
Aug 04, 2024
by
朱超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
环比更新
parent
a1c1918b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
185 additions
and
110 deletions
+185
-110
QOQ.vue
src/views/HandlerPage/QOQ.vue
+185
-110
No files found.
src/views/HandlerPage/QOQ.vue
View file @
e8f6a530
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
<div
<div
class=
"contentBlock"
class=
"contentBlock"
id=
"contentBlock"
id=
"contentBlock"
v-loading=
"loading"
element-loading-background=
"rgba(122, 122, 122, 0.6)"
element-loading-background=
"rgba(122, 122, 122, 0.6)"
>
>
<el-card
class=
"card-contianer"
>
<el-card
class=
"card-contianer"
>
...
@@ -128,7 +129,6 @@
...
@@ -128,7 +129,6 @@
<div
v-show=
"!switchV"
>
<div
v-show=
"!switchV"
>
<el-table
<el-table
:data=
"tableData"
:data=
"tableData"
v-loading=
"tabloading"
:height=
"tableHeight"
:height=
"tableHeight"
style=
"width: 100%"
style=
"width: 100%"
empty-text=
"暂无数据"
empty-text=
"暂无数据"
...
@@ -139,7 +139,7 @@
...
@@ -139,7 +139,7 @@
<el-table-column
prop=
"temperature"
label=
"温度(℃)"
/>
<el-table-column
prop=
"temperature"
label=
"温度(℃)"
/>
<el-table-column
<el-table-column
prop=
"record"
prop=
"record"
label=
"耗气量"
label=
"耗气量
(Nm³)
"
v-if=
"enertyInfo.energyType == '1'"
v-if=
"enertyInfo.energyType == '1'"
/>
/>
<el-table-column
<el-table-column
...
@@ -160,7 +160,10 @@
...
@@ -160,7 +160,10 @@
</el-table>
</el-table>
</div>
</div>
<div
v-show=
"switchV"
id=
"echartsLayerBlock"
>
<div
v-show=
"switchV"
id=
"echartsLayerBlock"
>
<div
class=
"echartsLayer"
id=
"echartsLayer"
></div>
<div
v-show=
"nodata"
>
<div
class=
"echartsLayer"
id=
"echartsLayer"
></div>
</div>
<div
v-show=
"!nodata"
><el-empty
description=
"暂无数据"
/></div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -174,7 +177,7 @@ import { ElMessage } from "element-plus";
...
@@ -174,7 +177,7 @@ import { ElMessage } from "element-plus";
import
{
saveAs
}
from
"file-saver"
;
import
{
saveAs
}
from
"file-saver"
;
import
XLSX
from
"xlsx-js-style"
;
import
XLSX
from
"xlsx-js-style"
;
import
{
postExternalQOQ
,
postWithinQOQ
}
from
"../../api/analysis"
;
import
{
postExternalQOQ
,
postWithinQOQ
}
from
"../../api/analysis"
;
const
loading
=
ref
(
false
);
const
tdType
=
ref
(
1
);
const
tdType
=
ref
(
1
);
const
networkType
=
ref
(
2
);
const
networkType
=
ref
(
2
);
const
enertyInfo
=
reactive
({
const
enertyInfo
=
reactive
({
...
@@ -192,7 +195,7 @@ const enterpriseId = ref();
...
@@ -192,7 +195,7 @@ const enterpriseId = ref();
const
props
=
{
multiple
:
true
,
emitPath
:
false
};
const
props
=
{
multiple
:
true
,
emitPath
:
false
};
const
switchV
=
ref
(
true
);
const
switchV
=
ref
(
true
);
const
echartF
=
ref
(
false
);
const
echartF
=
ref
(
false
);
const
nodata
=
ref
(
fals
e
);
const
nodata
=
ref
(
tru
e
);
let
tableData
=
reactive
([]);
let
tableData
=
reactive
([]);
const
echartTitle
=
reactive
([
"耗水量趋势图"
]);
const
echartTitle
=
reactive
([
"耗水量趋势图"
]);
const
echartData
=
reactive
([]);
const
echartData
=
reactive
([]);
...
@@ -226,52 +229,114 @@ function getEnterprise() {
...
@@ -226,52 +229,114 @@ function getEnterprise() {
}
}
function
transferIdChange
()
{
function
transferIdChange
()
{
//
if (enertyInfo.transferId.length > 10) {
if
(
enertyInfo
.
transferId
.
length
>
10
)
{
//
ElMessage.error("换热机组最多只能选择10个");
ElMessage
.
error
(
"换热机组最多只能选择10个"
);
//
}
}
}
}
function
exportTableToExcel
()
{
function
exportTableToExcel
()
{
const
worksheet
=
XLSX
.
utils
.
json_to_sheet
(
tableData
);
let
exlData
=
[];
const
workbook
=
XLSX
.
utils
.
book_new
();
let
title
=
[];
XLSX
.
utils
.
sheet_add_aoa
(
tableData
.
forEach
((
element
)
=>
{
worksheet
,
let
tableArr
=
{
[[
"换热站机组名称"
,
"时间"
,
"平均温度"
,
enertyTab
.
value
]],
rowId
:
element
.
rowId
,
{
transferName
:
element
.
transferName
,
origin
:
"A1"
,
gatherTime
:
element
.
gatherTime
.
replace
(
"T"
,
" "
),
}
temperature
:
element
.
temperature
,
);
record
:
element
.
record
,
worksheet
[
"!cols"
]
=
[{
wch
:
20
},
{
wch
:
20
},
{
wch
:
20
},
{
wch
:
20
}];
};
// worksheet["!rows"] = [{ hpx: 20 }];
exlData
.
push
(
tableArr
);
});
switch
(
enertyInfo
.
energyType
)
{
case
1
:
title
=
[
"序号"
,
"换热站机组名称"
,
"时间"
,
"温度(℃)"
,
"耗气量(Nm³)"
];
break
;
case
2
:
title
=
[
"序号"
,
"换热站机组名称"
,
"时间"
,
"温度(℃)"
,
"耗水量(T)"
];
break
;
case
3
:
title
=
[
"序号"
,
"换热站机组名称"
,
"时间"
,
"温度(℃)"
,
"耗热量(GJ"
];
break
;
case
4
:
title
=
[
"序号"
,
"换热站机组名称"
,
"时间"
,
"温度(℃)"
,
"耗电量(A)"
];
break
;
}
worksheet
[
"A1"
].
s
=
{
const
ws
=
XLSX
.
utils
.
json_to_sheet
(
exlData
);
fill
:
{
const
workbook
=
XLSX
.
utils
.
book_new
();
fgColor
:
{
rgb
:
"0097d5fd"
},
const
border
=
{
top
:
{
style
:
"thin"
,
},
},
};
bottom
:
{
worksheet
[
"B1"
].
s
=
{
style
:
"thin"
,
fill
:
{
fgColor
:
{
rgb
:
"0097d5fd"
},
},
},
};
left
:
{
worksheet
[
"C1"
].
s
=
{
style
:
"thin"
,
fill
:
{
fgColor
:
{
rgb
:
"0097d5fd"
},
},
},
};
right
:
{
worksheet
[
"D1"
].
s
=
{
style
:
"thin"
,
fill
:
{
fgColor
:
{
rgb
:
"0097d5fd"
},
},
},
};
};
const
range
=
XLSX
.
utils
.
decode_range
(
ws
[
"!ref"
]);
const
cellList
=
Object
.
keys
(
ws
).
filter
((
item
)
=>
item
.
indexOf
(
"!"
)
<
0
);
XLSX
.
utils
.
book_append_sheet
(
workbook
,
worksheet
,
"换热站趋势"
);
for
(
let
row
=
range
.
s
.
r
;
row
<=
range
.
e
.
r
;
row
++
)
{
for
(
let
col
=
range
.
s
.
c
;
col
<=
range
.
e
.
c
;
col
++
)
{
const
cell
=
XLSX
.
utils
.
encode_cell
({
r
:
row
,
c
:
col
});
if
(
cellList
.
indexOf
(
cell
)
<
0
)
{
ws
[
cell
]
=
{
t
:
""
,
v
:
""
,
s
:
{
border
}
};
}
else
{
ws
[
cell
].
s
=
{
border
};
}
}
}
XLSX
.
utils
.
sheet_add_aoa
(
ws
,
[
title
],
{
origin
:
"A1"
,
});
ws
[
"!cols"
]
=
[
{
wch
:
5
},
{
wch
:
20
},
{
wch
:
20
},
{
wch
:
20
},
{
wch
:
20
},
];
// ws["!rows"] = [{ hpx: 20 }];
const
tagList
=
[
"A1"
,
"B1"
,
"C1"
,
"D1"
,
"E1"
];
tagList
.
forEach
((
key
,
index
)
=>
{
ws
[
key
].
s
=
{
fill
:
{
fgColor
:
{
rgb
:
"0097d5fd"
},
},
border
:
{
bottom
:
{
color
:
"#000000"
,
style
:
"thin"
,
},
left
:
{
color
:
"#000000"
,
style
:
"thin"
,
},
right
:
{
color
:
"#000000"
,
style
:
"thin"
,
},
top
:
{
color
:
"#000000"
,
style
:
"thin"
,
},
},
};
});
XLSX
.
utils
.
book_append_sheet
(
workbook
,
ws
,
"用量环比"
);
const
excelBuffer
=
XLSX
.
write
(
workbook
,
{
bookType
:
"xlsx"
,
type
:
"array"
});
const
excelBuffer
=
XLSX
.
write
(
workbook
,
{
bookType
:
"xlsx"
,
type
:
"array"
});
const
dataBlob
=
new
Blob
([
excelBuffer
],
{
const
dataBlob
=
new
Blob
([
excelBuffer
],
{
type
:
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"
,
type
:
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"
,
});
});
const
downloadUrl
=
URL
.
createObjectURL
(
dataBlob
);
const
downloadUrl
=
URL
.
createObjectURL
(
dataBlob
);
saveAs
(
dataBlob
,
"
tableData
.xlsx"
);
saveAs
(
dataBlob
,
"
用量环比
.xlsx"
);
ElMessage
.
success
(
"导出成功!请稍后。。。"
);
ElMessage
.
success
(
"导出成功!请稍后。。。"
);
}
}
...
@@ -350,7 +415,9 @@ function selTypeChange() {
...
@@ -350,7 +415,9 @@ function selTypeChange() {
//换热站机组能耗数据接口(用量环比)
//换热站机组能耗数据接口(用量环比)
function
postExternalQOQFun
()
{
function
postExternalQOQFun
()
{
tabloading
.
value
=
true
;
loading
.
value
=
true
;
echarts
.
dispose
(
document
.
getElementById
(
"echartsLayer"
));
tableData
.
length
=
0
;
switch
(
enertyInfo
.
energyType
)
{
switch
(
enertyInfo
.
energyType
)
{
case
1
:
case
1
:
company
.
value
=
"Nm³"
;
company
.
value
=
"Nm³"
;
...
@@ -382,25 +449,29 @@ function postExternalQOQFun() {
...
@@ -382,25 +449,29 @@ function postExternalQOQFun() {
postExternalQOQ
(
params
).
then
((
res
)
=>
{
postExternalQOQ
(
params
).
then
((
res
)
=>
{
echarts
.
dispose
(
document
.
getElementById
(
"echartsLayer"
));
echarts
.
dispose
(
document
.
getElementById
(
"echartsLayer"
));
if
(
res
.
success
===
true
)
{
if
(
res
.
success
===
true
)
{
if
(
res
.
data
.
hourWater
.
length
>
0
)
{
if
(
res
.
data
.
hourWater
.
length
>
0
)
{
pageInitFun
(
res
);
pageInitFun
(
res
);
tableData
=
res
.
data
.
hourWater
;
}
else
{
nodata
.
value
=
false
;
}
}
}
else
{
}
else
{
ElMessage
.
error
(
res
.
message
);
ElMessage
.
error
(
res
.
message
);
}
}
loading
.
value
=
false
;
});
});
}
else
{
}
else
{
postWithinQOQ
(
params
).
then
((
res
)
=>
{
postWithinQOQ
(
params
).
then
((
res
)
=>
{
echarts
.
dispose
(
document
.
getElementById
(
"echartsLayer"
));
echarts
.
dispose
(
document
.
getElementById
(
"echartsLayer"
));
if
(
res
.
success
===
true
)
{
if
(
res
.
success
===
true
)
{
if
(
res
.
data
.
data
.
length
>
0
)
{
if
(
res
.
data
.
data
.
length
>
0
)
{
pageInitFun
(
res
);
pageInitFun
(
res
);
tableData
=
res
.
data
.
hourWater
;
}
else
{
nodata
.
value
=
false
;
}
}
}
else
{
}
else
{
ElMessage
.
error
(
res
.
message
);
ElMessage
.
error
(
res
.
message
);
}
}
loading
.
value
=
false
;
});
});
}
}
}
}
...
@@ -411,83 +482,86 @@ function clearData() {
...
@@ -411,83 +482,86 @@ function clearData() {
echartDataLegend
.
length
=
0
;
echartDataLegend
.
length
=
0
;
echartDataTime
.
length
=
0
;
echartDataTime
.
length
=
0
;
tableData
.
length
=
0
;
tableData
.
length
=
0
;
tabloading
.
value
=
false
;
}
}
function
pageInitFun
(
res
)
{
function
pageInitFun
(
res
)
{
tableData
.
length
=
0
;
tableData
.
length
=
0
;
res
.
data
.
hourWater
.
forEach
((
element
)
=>
{
//
res.data.hourWater.forEach((element) => {
let
tableArr
=
{
//
let tableArr = {
transferName
:
element
.
transferName
,
//
transferName: element.transferName,
gatherTime
:
element
.
gatherTime
,
// gatherTime: element.gatherTime.replace("T"," ")
,
temperature
:
element
.
temperature
,
//
temperature: element.temperature,
uc
:
parseFloat
(
element
.
uc
).
toFixed
(
2
),
//
uc: parseFloat(element.uc).toFixed(2),
};
//
};
tableData
.
push
(
tableArr
);
//
tableData.push(tableArr);
});
//
});
nodata
.
value
=
tru
e
;
nodata
.
value
=
fals
e
;
tabloading
.
value
=
false
;
tabloading
.
value
=
false
;
echartData
.
length
=
0
;
echartData
.
length
=
0
;
echartSeries
.
length
=
0
;
echartSeries
.
length
=
0
;
echartDataLegend
.
length
=
0
;
echartDataLegend
.
length
=
0
;
echartDataTime
.
length
=
0
;
echartDataTime
.
length
=
0
;
echartData
.
value
=
dataDeal
(
res
.
data
.
hourWater
);
if
(
res
.
data
.
hourWater
.
length
>
0
)
{
echartData
.
value
[
0
].
listInfo
.
forEach
((
element
)
=>
{
tableData
=
res
.
data
.
hourWater
;
if
(
element
.
gatherTime
)
{
nodata
.
value
=
true
;
echartDataTime
.
push
(
element
.
gatherTime
);
echartData
.
value
=
dataDeal
(
res
.
data
.
hourWater
);
}
echartData
.
value
[
0
].
listInfo
.
forEach
((
element
)
=>
{
});
if
(
element
.
gatherTime
)
{
echartData
.
value
.
forEach
((
element
)
=>
{
echartDataTime
.
push
(
element
.
gatherTime
);
let
data1
=
[];
}
let
data2
=
[];
element
.
listInfo
.
forEach
((
item
)
=>
{
data1
.
push
(
item
.
temperature
);
data2
.
push
(
parseFloat
(
item
.
record
).
toFixed
(
2
));
});
});
echartData
.
value
.
forEach
((
element
)
=>
{
let
data1
=
[];
let
data2
=
[];
element
.
listInfo
.
forEach
((
item
)
=>
{
data1
.
push
(
item
.
temperature
);
data2
.
push
(
parseFloat
(
item
.
record
).
toFixed
(
2
));
});
echartSeries
.
push
(
echartSeries
.
push
(
// {
// {
// name: element.transferName + "温度",
// name: element.transferName + "温度",
// type: "line",
// type: "line",
// tooltip: {
// tooltip: {
// valueFormatter: function (value) {
// valueFormatter: function (value) {
// return value + " ℃";
// return value + " ℃";
// },
// },
// },
// },
// data: data1,
// data: data1,
// },
// },
{
{
name
:
element
.
transferName
+
"能耗"
,
name
:
element
.
transferName
+
"能耗"
,
type
:
"bar"
,
type
:
"bar"
,
yAxisIndex
:
1
,
yAxisIndex
:
1
,
tooltip
:
{
tooltip
:
{
valueFormatter
:
function
(
value
)
{
valueFormatter
:
function
(
value
)
{
return
value
;
return
value
;
},
},
},
data
:
data2
,
}
);
});
let
temperatureListArr
=
[];
res
.
data
.
temperatureList
.
forEach
((
element
)
=>
{
temperatureListArr
.
push
(
element
);
});
echartSeries
.
push
({
name
:
"平均温度"
,
type
:
"line"
,
tooltip
:
{
valueFormatter
:
function
(
value
)
{
return
value
+
" ℃"
;
},
},
data
:
data2
,
}
);
});
let
temperatureListArr
=
[];
res
.
data
.
temperatureList
.
forEach
((
element
)
=>
{
temperatureListArr
.
push
(
element
);
});
echartSeries
.
push
({
name
:
"平均温度"
,
type
:
"line"
,
tooltip
:
{
valueFormatter
:
function
(
value
)
{
return
value
+
" ℃"
;
},
},
},
data
:
temperatureListArr
,
data
:
temperatureListArr
,
});
});
echartSeries
.
forEach
((
element
,
index
)
=>
{
echartSeries
.
forEach
((
element
,
index
)
=>
{
echartDataLegend
.
push
(
element
.
name
);
echartDataLegend
.
push
(
element
.
name
);
});
});
echartInit
();
echartInit
();
}
}
}
function
setContentHeight
()
{
function
setContentHeight
()
{
...
@@ -615,13 +689,13 @@ function echartInit() {
...
@@ -615,13 +689,13 @@ function echartInit() {
}
}
function
changeFun
()
{
function
changeFun
()
{
tabloading
.
value
=
false
;
if
(
nodata
.
value
)
{
nodata
.
value
=
true
;
var
divWidth
=
document
.
getElementById
(
"contentBlock"
).
offsetWidth
;
var
divWidth
=
document
.
getElementById
(
"contentBlock"
).
offsetWidth
;
var
divHeight
=
document
.
getElementById
(
"contentBlock"
).
scrollHeight
;
var
divHeight
=
document
.
getElementById
(
"contentBlock"
).
scrollHeight
;
computedWidth
.
value
=
divWidth
+
"px"
;
computedWidth
.
value
=
divWidth
+
"px"
;
computedHeight
.
value
=
divHeight
*
0.75
+
"px"
;
computedHeight
.
value
=
divHeight
*
0.75
+
"px"
;
echartInit
()
;
echartInit
();
}
}
}
onMounted
(()
=>
{
onMounted
(()
=>
{
...
@@ -630,6 +704,7 @@ onMounted(() => {
...
@@ -630,6 +704,7 @@ onMounted(() => {
getSupplys
();
getSupplys
();
postExternalQOQFun
();
postExternalQOQFun
();
changeFun
();
changeFun
();
switchV
.
value
=
true
;
window
.
addEventListener
(
"resize"
,
function
()
{
window
.
addEventListener
(
"resize"
,
function
()
{
location
.
reload
();
location
.
reload
();
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment