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
21675b4f
Commit
21675b4f
authored
Jul 30, 2024
by
朱超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitee.com/tj-wang-yahui/AMS_HeatSys_Vue_V10
parents
f996c99a
d94ce2d1
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
448 additions
and
135 deletions
+448
-135
HisPatro.png
public/imgs/meun/HisPatro.png
+0
-0
TodayPatro.png
public/imgs/meun/TodayPatro.png
+0
-0
TransferRegControl.vue
src/components/Remote/TransferRegControl.vue
+11
-1
TransferStatusControl.vue
src/components/Remote/TransferStatusControl.vue
+20
-1
index.js
src/router/index.js
+10
-3
HeatUserPage.vue
src/views/HeatUserPage/HeatUserPage.vue
+165
-62
TapPage.vue
src/views/HeatUserPage/TapPage.vue
+159
-46
HisPatrolPage.vue
src/views/PatrolPage/HisPatrolPage.vue
+5
-0
TodayPatrolPage.vue
src/views/PatrolPage/TodayPatrolPage.vue
+0
-0
TransControlPage.vue
src/views/RemotePage/TransControlPage.vue
+78
-22
No files found.
public/imgs/meun/HisPatro.png
0 → 100644
View file @
21675b4f
4.72 KB
public/imgs/meun/TodayPatro.png
0 → 100644
View file @
21675b4f
4.57 KB
src/components/Remote/TransferRegControl.vue
View file @
21675b4f
...
...
@@ -4,3 +4,13 @@
</el-table>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
reactive
,
onMounted
,
onUnmounted
}
from
'vue'
;
import
http
from
'../../api/http'
;
import
store
from
"../../store/index"
;
const
props
=
defineProps
([
'actionValue'
]);
// console.log(props.actionValue);
</
script
>
\ No newline at end of file
src/components/Remote/TransferStatusControl.vue
View file @
21675b4f
...
...
@@ -4,3 +4,22 @@
</el-table>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
reactive
,
onMounted
,
onUnmounted
,
watch
}
from
'vue'
;
import
http
from
'../../api/http'
;
import
store
from
"../../store/index"
;
const
props
=
defineProps
([
'activeRadio'
]);
console
.
log
(
"1actionValue:"
+
props
.
activeRadio
);
//监听修改actionValue状态
watch
(()
=>
props
.
activeRadio
,
(
oldValue
,
newValue
)
=>
{
//console.log("2actionValue:"+props.activeRadio);
initData
();
},{
deep
:
true
});
function
initData
(){
}
initData
();
</
script
>
\ No newline at end of file
src/router/index.js
View file @
21675b4f
...
...
@@ -237,11 +237,18 @@ const routes = [
title
:
'面积统计'
}
},{
path
:
'/T
ransfer
Patrol'
,
path
:
'/T
oday
Patrol'
,
name
:
'PatrolPage'
,
component
:
()
=>
import
(
'@/views/PatrolPage/T
ransfer
PatrolPage.vue'
),
component
:
()
=>
import
(
'@/views/PatrolPage/T
oday
PatrolPage.vue'
),
meta
:
{
title
:
'换热站巡更'
title
:
'今日巡更'
}
},{
path
:
'/HisPatrol'
,
name
:
'HisPatrolPage'
,
component
:
()
=>
import
(
'@/views/PatrolPage/HisPatrolPage.vue'
),
meta
:
{
title
:
'巡更历史'
}
},{
path
:
'/HeatUser'
,
...
...
src/views/HeatUserPage/HeatUserPage.vue
View file @
21675b4f
...
...
@@ -2,8 +2,6 @@
<el-card
class=
"card-contianer"
:body-style=
"
{ 'padding': '0px 0px 0px 0px', 'height': '110px' }">
<div
class=
"div-header"
>
<el-row>
<el-col
:span=
"4"
>
<div
class=
"div-button"
style=
"display: flex;"
>
<div
class=
"div-autoRefresh"
>
<el-switch
v-model=
"isHisData"
class=
"switch-autoRefresh"
active-text=
"历史数据"
...
...
@@ -14,45 +12,41 @@
</div>
</el-col>
<el-col
:span=
"7"
>
<div
class=
"div-dropdown text-center"
>
<
span>
小区名称
:
</span
>
<
el-form-item
label=
"小区名称:"
>
<el-cascader
:options=
"DataInfo.tree"
v-model=
"DataInfo.name"
:props=
"props"
collapse-tags
clearable
:show-all-levels=
"false"
filterable
placeholder=
"请选择"
style=
"min-width: 280px;"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"1
1
"
>
<el-col
:span=
"1
0
"
>
<div
class=
"div-time-picker"
v-show=
"isHisData"
>
<el-form-item
label=
"开始时间:"
style=
"margin-right: 20px;"
>
<el-config-provider
:locale=
"zhCn"
>
<el-date-picker
v-model=
"startTime"
type=
"datetime"
value-format=
"YYYY-MM-DD HH:mm:ss"
placeholder=
"选择开始时间"
@
change=
"changeStartTime"
style=
"min-width: 180px;"
/>
placeholder=
"选择开始时间"
@
change=
"changeStartTime"
:disabled-date=
"disabledDate"
/>
<!-- 日期时间格式 2024-1-1 00:00:00-->
</el-config-provider>
</el-form-item>
<el-form-item
label=
"结束时间:"
>
<el-config-provider
:locale=
"zhCn"
>
<el-date-picker
v-model=
"endTime"
type=
"datetime"
value-format=
"YYYY-MM-DD HH:mm:ss"
placeholder=
"选择结束时间"
@
change=
"changeEndTime"
style=
"min-width: 180px;"
/>
placeholder=
"选择结束时间"
@
change=
"changeEndTime"
:disabled-date=
"disabledDate"
/>
</el-config-provider>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"
2
"
>
<el-col
:span=
"
3
"
>
<div
class=
"div-button"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"15"
>
<el-button
class=
"el-button-button"
type=
"primary"
:span=
"6"
@
click=
"SearchData"
icon=
"Search"
>
搜
索
</el-button>
</el-col>
<el-col
:span=
"3"
>
</el-col>
<el-col
:span=
"3"
>
<el-col
:span=
"18"
>
<el-button
class=
"el-button-button"
type=
"primary"
:span=
"6"
@
click=
"SearchData"
>
搜索
</el-button>
</el-col>
<el-col
:span=
"3"
>
<el-col
:span=
"6"
>
<el-button
class=
"el-button-button"
type=
"primary"
:span=
"6"
@
click=
"ExportDataFile"
>
导出
</el-button>
</el-col>
</el-row>
</div>
...
...
@@ -65,6 +59,7 @@
<el-table
v-show=
"!isHisData"
:data=
"tableInfo.tableData"
:height=
"tableHeight"
v-loading=
"loading"
:cell-style=
"setCellStyle"
border
highlight-current-row
:header-cell-style=
"setHeaderCellStyle"
:header-cell-class-name=
"handleHeadAddClass"
>
<el-table-column
type=
"index"
width=
"50"
fixed
/>
<el-table-column
v-for=
"(item, i) in tableInfo.title.frozenList"
:prop=
"item.field"
:label=
"item.title"
:width=
"item.width"
sortable
fixed
/>
<template
v-for=
"(item, i) in tableInfo.title.otherList"
>
...
...
@@ -76,6 +71,7 @@
<el-table
v-show=
"isHisData"
:data=
"tableInfo.tableData"
:height=
"tableHeight"
v-loading=
"loading"
:cell-style=
"setCellStyle"
border
highlight-current-row
:header-cell-style=
"setHeaderCellStyle"
:header-cell-class-name=
"handleHeadAddClass"
@
sort-change=
"sortMethod"
>
<el-table-column
type=
"index"
width=
"50"
fixed
:index=
"indexMethod"
/>
<el-table-column
v-for=
"(item, i) in tableInfo.title.frozenList"
:prop=
"item.field"
:label=
"item.title"
:width=
"item.width"
fixed
sortable
/>
<
template
v-for=
"(item, i) in tableInfo.title.otherList"
>
...
...
@@ -127,6 +123,7 @@
.div-time-picker {
padding-top: 6px;
margin-left: 30px;
display: flex;
}
...
...
@@ -162,6 +159,8 @@
.el-button-button {
margin-top: 5px;
// margin-right: 5px;
// margin-left: 60px;
width: 80px;
}
...
...
@@ -172,7 +171,7 @@
display: flex;
margin-top: 5px;
border-radius: var(--el-border-radius-base);
padding: 6px
15
px;
padding: 6px
0
px;
font-size: 14px;
height: 20px;
overflow: hidden;
...
...
@@ -191,9 +190,6 @@
}
.div-dropdown {
//display: flex;
padding-top: 7px;
height: 50px;
padding-left: 10px;
...
...
@@ -345,17 +341,23 @@ function twoDigits(value) {
return
value
<
10
?
'0'
+
value
:
value
;
}
//日期范围控制,返回true说明需要被禁用
function
disabledDate
(
thisdate
){
var
startDate
=
new
Date
(
2023
,
7
,
1
);
var
endDate
=
new
Date
();
return
thisdate
>
endDate
||
thisdate
<
startDate
;
}
//数据控制,根据isHisData的值决定数据控制逻辑,false为实时数据,true为历史数据
var
dataUrl
=
isHisData
.
value
?
'/api/tiger/TigerHeatUser/His'
:
'/api/tiger/TigerHeatUser/Real'
;
var
exportUrl
=
isHisData
.
value
?
'/api/tiger/TigerHeatUser/HisExport'
:
'/api/tiger/TigerHeatUser/RealExport'
;
function
initTitle
()
{
tableInfo
.
title
.
frozenList
.
length
=
0
;
pushFrozenList
(
"gatherTime"
,
"采集时间"
,
true
,
180
,
true
)
pushFrozenList
(
"supplyName"
,
"供热站"
,
false
,
1
8
0
,
true
);
pushFrozenList
(
"name"
,
"小区"
,
true
,
1
8
0
,
true
);
pushFrozenList
(
"append"
,
"设备名称"
,
true
,
1
8
0
,
true
);
pushFrozenList
(
"supplyName"
,
"供热站"
,
false
,
1
4
0
,
true
);
pushFrozenList
(
"name"
,
"小区"
,
true
,
1
4
0
,
true
);
pushFrozenList
(
"append"
,
"设备名称"
,
true
,
1
4
0
,
true
);
tableInfo
.
title
.
otherList
.
length
=
0
;
pushOtherList
(
'building'
,
"楼栋"
);
pushOtherList
(
'unit'
,
"单元"
);
...
...
@@ -400,18 +402,20 @@ function init() {
}
else
{
initReal
();
}
getName
();
// setSelect();
}
//数据切换
async
function
changeData
()
{
init
();
getName
();
//
getName();
}
//实时数据初始化
async
function
initReal
()
{
dataUrl
=
'/api/tiger/TigerHeatUser/Real'
;
exportUrl
=
'/api/tiger/TigerHeatUser/RealExport'
tableInfo
.
tableData
.
length
=
0
;
tableInfo
.
realData
.
length
=
0
;
await
getRealData
();
...
...
@@ -420,8 +424,8 @@ async function initReal() {
}
//历史数据初始化
async
function
initHis
()
{
// dataUrl = '/api/tiger/TigerHeatUser/Real';
dataUrl
=
'/api/tiger/TigerHeatUser/His'
;
exportUrl
=
'/api/tiger/TigerHeatUser/HisExport'
;
tableInfo
.
tableData
.
length
=
0
;
tableInfo
.
hisData
.
length
=
0
;
await
getHisData
();
...
...
@@ -464,13 +468,11 @@ async function getName() {
if
(
result
.
status
===
0
)
{
//处理返回数据
var
list
=
[];
//供热站--小区
result
.
data
.
forEach
(
data
=>
{
list
.
push
(
data
.
name
);
list
.
push
(
{
supplyName
:
data
.
supplyName
,
name
:
data
.
name
}
);
})
var
list2
=
[...
new
Set
(
list
)];
setSelect
(
list2
)
}
else
{
// tableInfo.tableData.length = 0;
setSelect
(
list
)
}
})
loading
.
value
=
false
...
...
@@ -487,10 +489,61 @@ async function getHisDataByInfo(name, start, end, startPage, pagesCount, sort) {
setshowData
();
}
else
{
tableInfo
.
tableData
.
length
=
0
;
total
.
value
=
0
;
}
})
loading
.
value
=
false
total
.
value
=
tableInfo
.
tableData
.
length
;
}
function
ExportHisDataByInfo
(
name
,
start
,
end
,
startPage
,
pagesCount
,
sort
){
var
fileName
=
getFileName
(
"热用户历史数据"
);
http
.
post
(
exportUrl
,
{
name
:
name
,
startTime
:
start
,
endTime
:
end
,
start
:
startPage
,
count
:
pagesCount
,
sort
:
sort
}).
then
((
content
)
=>
{
try
{
const
blob
=
new
Blob
([
content
]);
if
(
'download'
in
document
.
createElement
(
'a'
))
{
// 非IE下载
const
elink
=
document
.
createElement
(
'a'
);
elink
.
download
=
fileName
;
elink
.
style
.
display
=
'none'
;
elink
.
href
=
URL
.
createObjectURL
(
blob
);
document
.
body
.
appendChild
(
elink
);
elink
.
click
();
URL
.
revokeObjectURL
(
elink
.
href
);
document
.
body
.
removeChild
(
elink
);
}
else
{
// IE10+下载
navigator
.
msSaveBlob
(
blob
,
fileName
);
}
}
catch
(
error
){
console
.
log
(
error
);
}
});
}
function
ExportRealData
(){
var
fileName
=
getFileName
(
"热用户实时数据"
);
http
.
post
(
exportUrl
).
then
((
content
)
=>
{
try
{
const
blob
=
new
Blob
([
content
]);
if
(
'download'
in
document
.
createElement
(
'a'
))
{
// 非IE下载
const
elink
=
document
.
createElement
(
'a'
);
elink
.
download
=
fileName
;
elink
.
style
.
display
=
'none'
;
elink
.
href
=
URL
.
createObjectURL
(
blob
);
document
.
body
.
appendChild
(
elink
);
elink
.
click
();
URL
.
revokeObjectURL
(
elink
.
href
);
document
.
body
.
removeChild
(
elink
);
}
else
{
// IE10+下载
navigator
.
msSaveBlob
(
blob
,
fileName
);
}
}
catch
(
error
){
console
.
log
(
error
);
}
});
}
function
setshowData
()
{
...
...
@@ -509,14 +562,24 @@ function setShowThisData(data) {
function
setSelect
(
list
)
{
DataInfo
.
tree
.
length
=
0
;
DataInfo
.
name
.
length
=
0
;
// children
var
list2
=
[];
var
tree
=
[];
list
.
forEach
(
area
=>
{
DataInfo
.
tree
.
push
({
value
:
area
,
label
:
area
if
(
list2
.
includes
(
area
.
supplyName
)){
tree
.
forEach
(
supply
=>
{
if
(
supply
.
value
==
area
.
supplyName
){
supply
.
children
.
push
({
value
:
area
.
name
,
label
:
area
.
name
});
}
})
}
else
{
list2
.
push
(
area
.
supplyName
);
tree
.
push
({
value
:
area
.
supplyName
,
label
:
area
.
supplyName
,
children
:[{
value
:
area
.
name
,
label
:
area
.
name
}]});
}
})
DataInfo
.
tree
=
tree
;
if
(
DataInfo
.
tree
.
length
>
0
)
{
DataInfo
.
name
.
push
(
DataInfo
.
tree
[
0
].
value
);
DataInfo
.
name
.
push
(
DataInfo
.
tree
[
0
].
children
[
0
].
value
);
}
}
...
...
@@ -551,6 +614,25 @@ function SearchHisData() {
getHisDataByInfo
(
DataInfo
.
name
,
startTime
.
value
,
endTime
.
value
,
currentPage
.
value
-
1
,
pageSize
.
value
,
DataInfo
.
sort
)
}
//导出数据
function
ExportDataFile
(){
if
(
isHisData
.
value
)
{
ExportHisDataFile
();
}
else
{
ExportRealDataFile
();
}
}
//实时数据导出
function
ExportRealDataFile
()
{
ExportRealData
();
}
//历史数据导出
function
ExportHisDataFile
()
{
ExportHisDataByInfo
(
DataInfo
.
name
,
startTime
.
value
,
endTime
.
value
,
currentPage
.
value
-
1
,
pageSize
.
value
,
DataInfo
.
sort
)
}
//分页
//控制分页
function
changePage
()
{
...
...
@@ -578,11 +660,22 @@ function changeHisPage() {
getHisDataByInfo
(
DataInfo
.
name
,
startTime
.
value
,
endTime
.
value
,
currentPage
.
value
-
1
,
pageSize
.
value
,
DataInfo
.
sort
)
}
function
getFileName
(
name
){
const
now
=
new
Date
();
const
year
=
now
.
getFullYear
();
const
month
=
(
now
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
);
const
day
=
now
.
getDate
().
toString
().
padStart
(
2
,
'0'
);
const
hours
=
now
.
getHours
().
toString
().
padStart
(
2
,
'0'
);
const
minutes
=
now
.
getMinutes
().
toString
().
padStart
(
2
,
'0'
);
const
seconds
=
now
.
getSeconds
().
toString
().
padStart
(
2
,
'0'
);
return
name
+
`_
${
year
}${
month
}${
day
}${
hours
}${
minutes
}${
seconds
}
.xls`
;
}
//表格样式设置
function
setHeaderCellStyle
({
row
,
column
,
rowIndex
,
columnIndex
})
{
let
css_color
;
let
css_color
=
{};
css_color
[
'background-color'
]
=
'#'
+
'b5e6ff'
;
tableInfo
.
title
.
frozenList
.
forEach
(
element
=>
{
if
(
element
.
field
===
column
.
property
)
{
var
backcolor
=
(
element
.
color
==
'FFFFFF'
)
?
'd9f1ff'
:
element
.
color
;
...
...
@@ -595,7 +688,9 @@ function setHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
css_color
=
{
'background-color'
:
'#'
+
backcolor
,
'padding-left'
:
'0px'
,
'padding-right'
:
'0px'
,
'borderColor'
:
'#97d5fd'
,
'color'
:
'#000'
,
'text-align'
:
'center'
,
'vertical-align'
:
'top'
};
}
})
if
(
column
.
type
==
'index'
){
css_color
[
'background-color'
]
=
'#'
+
'b5e6ff'
;
}
return
css_color
;
}
...
...
@@ -615,6 +710,9 @@ function setCellStyle({ row, column, rowIndex, columnIndex }) {
css_color
[
'background-color'
]
=
'#'
+
element
.
backColor
;
}
})
if
(
column
.
type
==
'index'
){
css_color
[
'background-color'
]
=
'#'
+
'b5e6ff'
;
}
return
css_color
;
}
...
...
@@ -625,6 +723,11 @@ function handleHeadAddClass({ column }) {
}
//索引计算
function
indexMethod
(
index
){
return
(
currentPage
.
value
-
1
)
*
pageSize
.
value
+
index
+
1
;
}
//获取排序的方法
function
sortMethod
({
order
,
prop
})
{
// 触发的排序和缓存的排序相同时,取消该字段的排序
...
...
src/views/HeatUserPage/TapPage.vue
View file @
21675b4f
...
...
@@ -2,8 +2,6 @@
<el-card
class=
"card-contianer"
:body-style=
"
{ 'padding': '0px 0px 0px 0px', 'height': '110px' }">
<div
class=
"div-header"
>
<el-row>
<el-col
:span=
"4"
>
<div
class=
"div-button"
style=
"display: flex;"
>
<div
class=
"div-autoRefresh"
>
<el-switch
v-model=
"isHisData"
class=
"switch-autoRefresh"
active-text=
"历史数据"
...
...
@@ -14,46 +12,41 @@
</div>
</el-col>
<el-col
:span=
"7"
>
<div
class=
"div-dropdown text-center"
>
<el-form-item
label=
"小区名称:"
>
<el-cascader
:options=
"DataInfo.tree"
v-model=
"DataInfo.name"
:props=
"props"
collapse-tags
clearable
:show-all-levels=
"false"
filterable
placeholder=
"请选择"
style=
"min-width: 280px;"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"1
1
"
>
<el-col
:span=
"1
0
"
>
<div
class=
"div-time-picker"
v-show=
"isHisData"
>
<el-form-item
label=
"开始时间:"
style=
"margin-right: 20px;"
>
<el-config-provider
:locale=
"zhCn"
>
<el-date-picker
v-model=
"startTime"
type=
"datetime"
value-format=
"YYYY-MM-DD HH:mm:ss"
placeholder=
"选择开始时间"
@
change=
"changeStartTime"
style=
"min-width: 180px;"
/>
placeholder=
"选择开始时间"
@
change=
"changeStartTime"
:disabled-date=
"disabledDate"
/>
<!-- 日期时间格式 2024-1-1 00:00:00-->
</el-config-provider>
</el-form-item>
<el-form-item
label=
"结束时间:"
>
<el-config-provider
:locale=
"zhCn"
>
<el-date-picker
v-model=
"endTime"
type=
"datetime"
value-format=
"YYYY-MM-DD HH:mm:ss"
placeholder=
"选择结束时间"
@
change=
"changeEndTime"
style=
"min-width: 180px;"
/>
placeholder=
"选择结束时间"
@
change=
"changeEndTime"
:disabled-date=
"disabledDate"
/>
</el-config-provider>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"
2
"
>
<el-col
:span=
"
3
"
>
<div
class=
"div-button"
>
<el-row
:gutter=
"10"
>
<el-col
:span=
"15"
>
<el-button
class=
"el-button-button"
type=
"primary"
:span=
"6"
@
click=
"SearchData"
icon=
"Search"
>
搜
索
</el-button>
</el-col>
<el-col
:span=
"3"
>
</el-col>
<el-col
:span=
"3"
>
<el-col
:span=
"18"
>
<el-button
class=
"el-button-button"
type=
"primary"
:span=
"6"
@
click=
"SearchData"
>
搜索
</el-button>
</el-col>
<el-col
:span=
"3"
>
<el-col
:span=
"6"
>
<el-button
class=
"el-button-button"
type=
"primary"
:span=
"6"
@
click=
"ExportDataFile"
>
导出
</el-button>
</el-col>
</el-row>
</div>
...
...
@@ -66,6 +59,7 @@
<el-table
v-show=
"!isHisData"
:data=
"tableInfo.tableData"
:height=
"tableHeight"
v-loading=
"loading"
:cell-style=
"setCellStyle"
border
highlight-current-row
:header-cell-style=
"setHeaderCellStyle"
:header-cell-class-name=
"handleHeadAddClass"
>
<el-table-column
type=
"index"
width=
"50"
fixed
/>
<el-table-column
v-for=
"(item, i) in tableInfo.title.frozenList"
:prop=
"item.field"
:label=
"item.title"
:width=
"item.width"
sortable
fixed
/>
<template
v-for=
"(item, i) in tableInfo.title.otherList"
>
...
...
@@ -77,6 +71,7 @@
<el-table
v-show=
"isHisData"
:data=
"tableInfo.tableData"
:height=
"tableHeight"
v-loading=
"loading"
:cell-style=
"setCellStyle"
border
highlight-current-row
:header-cell-style=
"setHeaderCellStyle"
:header-cell-class-name=
"handleHeadAddClass"
@
sort-change=
"sortMethod"
sortable
>
<el-table-column
type=
"index"
width=
"50"
fixed
:index=
"indexMethod"
/>
<el-table-column
v-for=
"(item, i) in tableInfo.title.frozenList"
:prop=
"item.field"
:label=
"item.title"
:width=
"item.width"
fixed
sortable
/>
<
template
v-for=
"(item, i) in tableInfo.title.otherList"
>
...
...
@@ -128,6 +123,7 @@
.div-time-picker {
padding-top: 6px;
margin-left: 30px;
display: flex;
}
...
...
@@ -163,6 +159,8 @@
.el-button-button {
margin-top: 5px;
// margin-right: 5px;
// margin-left: 60px;
width: 80px;
}
...
...
@@ -173,7 +171,7 @@
display: flex;
margin-top: 5px;
border-radius: var(--el-border-radius-base);
padding: 6px
15
px;
padding: 6px
0
px;
font-size: 14px;
height: 20px;
overflow: hidden;
...
...
@@ -225,18 +223,10 @@
<
script
setup
>
import
{
ref
,
reactive
,
onMounted
,
onUnmounted
,
provide
,
computed
,
handleError
}
from
'vue'
import
DataForm
from
'../../components/DataForm.vue'
;
import
{
useRoute
}
from
'vue-router'
import
http
from
'../../api/http'
import
store
from
"../../store/index"
;
import
zhCn
from
'element-plus/dist/locale/zh-cn.mjs'
import
{
Search
,
ArrowLeft
,
ArrowRight
,
Warning
}
from
'@element-plus/icons-vue'
import
CfgSupply
from
'../../components/CfgSupply.vue'
;
// import { da } from 'element-plus/es/locale';
// import { start } from 'repl';
// import { ca } from 'element-plus/es/locale';
...
...
@@ -327,10 +317,32 @@ var tableInfo = reactive({
const
loading
=
ref
(
false
);
const
value
=
ref
(
true
);
//日期转换字符串
function
formatDate
(
date
)
{
let
year
=
date
.
getFullYear
();
let
month
=
twoDigits
(
date
.
getMonth
()
+
1
);
// 月份是从0开始的
let
day
=
twoDigits
(
date
.
getDate
());
let
hour
=
twoDigits
(
date
.
getHours
());
let
minute
=
twoDigits
(
date
.
getMinutes
());
let
second
=
twoDigits
(
date
.
getSeconds
());
return
`
${
year
}
-
${
month
}
-
${
day
}
${
hour
}
:
${
minute
}
:
${
second
}
`
;
}
function
twoDigits
(
value
)
{
return
value
<
10
?
'0'
+
value
:
value
;
}
//日期范围控制,返回true说明需要被禁用
function
disabledDate
(
thisdate
){
var
startDate
=
new
Date
(
2023
,
7
,
1
);
var
endDate
=
new
Date
();
return
thisdate
>
endDate
||
thisdate
<
startDate
;
}
//数据控制,根据isHisData的值决定数据控制逻辑,false为实时数据,true为历史数据
var
dataUrl
=
isHisData
.
value
?
'/api/tiger/TigerTapData/His'
:
'/api/tiger/TigerTapData/Real'
;
var
exportUrl
=
isHisData
.
value
?
'/api/tiger/TigerTapData/HisExport'
:
'/api/tiger/TigerTapData/RealExport'
;
function
initTitle
()
{
tableInfo
.
title
.
frozenList
.
length
=
0
;
...
...
@@ -385,25 +397,27 @@ function init() {
}
else
{
initReal
();
}
getName
();
}
//数据切换
async
function
changeData
()
{
init
();
getName
();
//
getName();
}
//实时数据初始化
async
function
initReal
()
{
dataUrl
=
'/api/tiger/TigerTapData/Real'
;
exportUrl
=
'/api/tiger/TigerTapData/RealExport'
tableInfo
.
tableData
.
length
=
0
;
tableInfo
.
realData
.
length
=
0
;
await
getRealData
();
}
//历史数据初始化
async
function
initHis
()
{
// dataUrl = '/api/tiger/TigerHeatUser/Real';
dataUrl
=
'/api/tiger/TigerTapData/His'
;
exportUrl
=
'/api/tiger/TigerTapData/HisExport'
;
tableInfo
.
tableData
.
length
=
0
;
tableInfo
.
hisData
.
length
=
0
;
await
getHisData
();
...
...
@@ -447,13 +461,11 @@ async function getName() {
if
(
result
.
status
===
0
)
{
//处理返回数据
var
list
=
[];
//供热站--小区
result
.
data
.
forEach
(
data
=>
{
list
.
push
(
data
.
name
);
list
.
push
(
{
supplyName
:
data
.
supplyName
,
name
:
data
.
name
}
);
})
var
list2
=
[...
new
Set
(
list
)];
setSelect
(
list2
)
}
else
{
// tableInfo.tableData.length = 0;
setSelect
(
list
)
}
})
loading
.
value
=
false
...
...
@@ -472,12 +484,64 @@ async function getHisDataByInfo(name, start, end, startPage, pagesCount, sort) {
// makeFormsData(result.data.realData);
}
else
{
tableInfo
.
tableData
.
length
=
0
;
total
.
value
=
0
;
}
})
loading
.
value
=
false
total
.
value
=
tableInfo
.
tableData
.
length
;
}
function
ExportHisDataByInfo
(
name
,
start
,
end
,
startPage
,
pagesCount
,
sort
){
var
fileName
=
getFileName
(
"阀门历史数据"
);
http
.
post
(
exportUrl
,
{
name
:
name
,
startTime
:
start
,
endTime
:
end
,
start
:
startPage
,
count
:
pagesCount
,
sort
:
sort
}).
then
((
content
)
=>
{
try
{
const
blob
=
new
Blob
([
content
]);
if
(
'download'
in
document
.
createElement
(
'a'
))
{
// 非IE下载
const
elink
=
document
.
createElement
(
'a'
);
elink
.
download
=
fileName
;
elink
.
style
.
display
=
'none'
;
elink
.
href
=
URL
.
createObjectURL
(
blob
);
document
.
body
.
appendChild
(
elink
);
elink
.
click
();
URL
.
revokeObjectURL
(
elink
.
href
);
document
.
body
.
removeChild
(
elink
);
}
else
{
// IE10+下载
navigator
.
msSaveBlob
(
blob
,
fileName
);
}
}
catch
(
error
){
console
.
log
(
error
);
}
});
}
function
ExportRealData
(){
var
fileName
=
getFileName
(
"阀门实时数据"
);
http
.
post
(
exportUrl
).
then
((
content
)
=>
{
try
{
const
blob
=
new
Blob
([
content
]);
if
(
'download'
in
document
.
createElement
(
'a'
))
{
// 非IE下载
const
elink
=
document
.
createElement
(
'a'
);
elink
.
download
=
fileName
;
elink
.
style
.
display
=
'none'
;
elink
.
href
=
URL
.
createObjectURL
(
blob
);
document
.
body
.
appendChild
(
elink
);
elink
.
click
();
URL
.
revokeObjectURL
(
elink
.
href
);
document
.
body
.
removeChild
(
elink
);
}
else
{
// IE10+下载
navigator
.
msSaveBlob
(
blob
,
fileName
);
}
}
catch
(
error
){
console
.
log
(
error
);
}
});
}
function
setshowData
()
{
if
(
isHisData
.
value
)
{
tableInfo
.
tableData
=
tableInfo
.
hisData
;
...
...
@@ -489,19 +553,28 @@ function setshowData() {
function
setShowThisData
(
data
)
{
tableInfo
.
tableData
=
data
;
}
//设置搜索栏可选择项
function
setSelect
(
list
)
{
DataInfo
.
tree
.
length
=
0
;
DataInfo
.
name
.
length
=
0
;
DataInfo
.
name
.
length
=
0
;
// children
var
list2
=
[];
var
tree
=
[];
list
.
forEach
(
area
=>
{
DataInfo
.
tree
.
push
({
value
:
area
,
label
:
area
if
(
list2
.
includes
(
area
.
supplyName
)){
tree
.
forEach
(
supply
=>
{
if
(
supply
.
value
==
area
.
supplyName
){
supply
.
children
.
push
({
value
:
area
.
name
,
label
:
area
.
name
});
}
})
}
else
{
list2
.
push
(
area
.
supplyName
);
tree
.
push
({
value
:
area
.
supplyName
,
label
:
area
.
supplyName
,
children
:[{
value
:
area
.
name
,
label
:
area
.
name
}]});
}
})
if
(
DataInfo
.
tree
.
length
>
0
){
DataInfo
.
name
.
push
(
DataInfo
.
tree
[
0
].
value
);
DataInfo
.
tree
=
tree
;
if
(
DataInfo
.
tree
.
length
>
0
)
{
DataInfo
.
name
.
push
(
DataInfo
.
tree
[
0
].
children
[
0
].
value
);
}
}
...
...
@@ -533,6 +606,25 @@ function SearchHisData() {
getHisDataByInfo
(
DataInfo
.
name
,
startTime
.
value
,
endTime
.
value
,
currentPage
.
value
-
1
,
pageSize
.
value
,
DataInfo
.
sort
)
}
//导出数据
function
ExportDataFile
(){
if
(
isHisData
.
value
)
{
ExportHisDataFile
();
}
else
{
ExportRealDataFile
();
}
}
//实时数据导出
function
ExportRealDataFile
()
{
ExportRealData
();
}
//历史数据导出
function
ExportHisDataFile
()
{
ExportHisDataByInfo
(
DataInfo
.
name
,
startTime
.
value
,
endTime
.
value
,
currentPage
.
value
-
1
,
pageSize
.
value
,
DataInfo
.
sort
)
}
//分页
//控制分页
function
changePage
()
{
...
...
@@ -560,11 +652,23 @@ function changeHisPage() {
getHisDataByInfo
(
DataInfo
.
name
,
startTime
.
value
,
endTime
.
value
,
currentPage
.
value
-
1
,
pageSize
.
value
,
DataInfo
.
sort
)
}
function
getFileName
(
name
){
const
now
=
new
Date
();
const
year
=
now
.
getFullYear
();
const
month
=
(
now
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
);
const
day
=
now
.
getDate
().
toString
().
padStart
(
2
,
'0'
);
const
hours
=
now
.
getHours
().
toString
().
padStart
(
2
,
'0'
);
const
minutes
=
now
.
getMinutes
().
toString
().
padStart
(
2
,
'0'
);
const
seconds
=
now
.
getSeconds
().
toString
().
padStart
(
2
,
'0'
);
return
name
+
`_
${
year
}${
month
}${
day
}${
hours
}${
minutes
}${
seconds
}
.xls`
;
}
//表格样式设置
function
setHeaderCellStyle
({
row
,
column
,
rowIndex
,
columnIndex
})
{
let
css_color
;
let
css_color
=
{};
css_color
[
'background-color'
]
=
'#'
+
'b5e6ff'
;
tableInfo
.
title
.
frozenList
.
forEach
(
element
=>
{
if
(
element
.
field
===
column
.
property
)
{
var
backcolor
=
(
element
.
color
==
'FFFFFF'
)
?
'd9f1ff'
:
element
.
color
;
...
...
@@ -577,7 +681,9 @@ function setHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
css_color
=
{
'background-color'
:
'#'
+
backcolor
,
'padding-left'
:
'0px'
,
'padding-right'
:
'0px'
,
'borderColor'
:
'#97d5fd'
,
'color'
:
'#000'
,
'text-align'
:
'center'
,
'vertical-align'
:
'top'
};
}
})
if
(
column
.
type
==
'index'
){
css_color
[
'background-color'
]
=
'#'
+
'b5e6ff'
;
}
return
css_color
;
}
...
...
@@ -597,6 +703,9 @@ function setCellStyle({ row, column, rowIndex, columnIndex }) {
css_color
[
'background-color'
]
=
'#'
+
element
.
backColor
;
}
})
if
(
column
.
type
==
'index'
){
css_color
[
'background-color'
]
=
'#'
+
'b5e6ff'
;
}
return
css_color
;
}
...
...
@@ -606,6 +715,10 @@ function handleHeadAddClass({ column }) {
}
}
//索引计算
function
indexMethod
(
index
){
return
(
currentPage
.
value
-
1
)
*
pageSize
.
value
+
index
+
1
;
}
//获取排序的方法
function
sortMethod
({
order
,
prop
})
{
...
...
src/views/PatrolPage/HisPatrolPage.vue
0 → 100644
View file @
21675b4f
<
template
>
换热站巡更
</
template
>
src/views/PatrolPage/T
ransfer
PatrolPage.vue
→
src/views/PatrolPage/T
oday
PatrolPage.vue
View file @
21675b4f
File moved
src/views/RemotePage/TransControlPage.vue
View file @
21675b4f
...
...
@@ -2,7 +2,7 @@
<
template
>
<el-card
class=
"card-contianer"
>
<label>
{{
radioTitle
}}
:
</label>
<el-radio-group
v-model=
"
radioList
"
style=
"margin-left: 50px;"
>
<el-radio-group
v-model=
"
activeRadio
"
style=
"margin-left: 50px;"
>
<el-radio
v-for=
"(option, index) in options"
:key=
"index"
...
...
@@ -13,47 +13,47 @@
</el-radio-group>
</el-card>
<el-tabs
:tab-position=
"tabPosition"
style=
"height: 100%"
class=
"demo-tabs"
>
<el-tab-pane
label=
"换热站状态"
>
<TransferStatusControl/>
<el-tab-pane
label=
"换热站状态"
v-if=
"isTransferStatus"
>
<TransferStatusControl
:activeRadio=
"activeRadio"
/>
</el-tab-pane>
<el-tab-pane
label=
"远程寄存器"
>
<el-tab-pane
label=
"远程寄存器"
v-if=
"isTransferRegControl"
>
<TransferRegControl/>
</el-tab-pane>
<el-tab-pane
label=
"节假日参数组"
>
<el-tab-pane
label=
"节假日参数组"
v-if=
"isHolidayControl"
>
<HolidayControl/>
</el-tab-pane>
<el-tab-pane
label=
"夜间参数组"
>
<el-tab-pane
label=
"夜间参数组"
v-if=
"isNightControl"
>
<NightControl/>
</el-tab-pane>
<el-tab-pane
label=
"二次网供水温度"
>
<el-tab-pane
label=
"二次网供水温度"
v-if=
"isSecTempControl"
>
<SecTempControl/>
</el-tab-pane>
<el-tab-pane
label=
"曲线对应"
>
<el-tab-pane
label=
"曲线对应"
v-if=
"isCurveControl"
>
<CurveControl/>
</el-tab-pane>
<el-tab-pane
label=
"气象仪"
>
<el-tab-pane
label=
"气象仪"
v-if=
"isWeatherControl"
>
<WeatherControl/>
</el-tab-pane>
<el-tab-pane
label=
"温度上下限"
>
<el-tab-pane
label=
"温度上下限"
v-if=
"isLimitControl"
>
<LimitControl/>
</el-tab-pane>
<el-tab-pane
label=
"风向控制"
>
<el-tab-pane
label=
"风向控制"
v-if=
"isWinDirectionControl"
>
<WinDirectionControl/>
</el-tab-pane>
<el-tab-pane
label=
"热量"
>
<el-tab-pane
label=
"热量"
v-if=
"isHeatControl"
>
<HeatControl/>
</el-tab-pane>
<el-tab-pane
label=
"室外温度控制"
>
<el-tab-pane
label=
"室外温度控制"
v-if=
"isOutdoorTempControl"
>
<OutdoorTempControl/>
</el-tab-pane>
<el-tab-pane
label=
"循环泵夜间降频"
>
<el-tab-pane
label=
"循环泵夜间降频"
v-if=
"isNightFrequency"
>
<NightFrequency/>
</el-tab-pane>
</el-tabs>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
reactive
,
onMounted
,
onUnmounted
}
from
'vue'
;
import
{
ref
,
reactive
,
onMounted
,
onUnmounted
,
watch
}
from
'vue'
;
import
http
from
'../../api/http'
;
import
store
from
"../../store/index"
;
import
TransferStatusControl
from
'../../components/Remote/TransferStatusControl.vue'
;
...
...
@@ -73,7 +73,19 @@
const
options
=
reactive
([]);
const
enterpriseId
=
ref
(
null
);
const
tabPosition
=
ref
(
'left'
);
const
radioList
=
ref
(
null
);
const
activeRadio
=
ref
(
null
);
const
isTransferStatus
=
ref
(
false
);
const
isTransferRegControl
=
ref
(
false
);
const
isHolidayControl
=
ref
(
false
);
const
isNightControl
=
ref
(
false
);
const
isSecTempControl
=
ref
(
false
);
const
isCurveControl
=
ref
(
false
);
const
isWeatherControl
=
ref
(
false
);
const
isLimitControl
=
ref
(
false
);
const
isWinDirectionControl
=
ref
(
false
);
const
isHeatControl
=
ref
(
false
);
const
isOutdoorTempControl
=
ref
(
false
);
const
isNightFrequency
=
ref
(
false
);
//初始化页面
function
initPage
(){
...
...
@@ -106,20 +118,64 @@
}
}
});
radioList
.
value
=
options
[
0
].
value
;
activeRadio
.
value
=
options
[
0
].
value
;
console
.
log
(
"activeRadio.value:"
+
activeRadio
.
value
);
}
}
//根据权限初始化远程控制页列表
function
initRomateList
(){
let
userInfo
=
store
.
getters
.
getUserInfo
;
if
(
userInfo
.
roleId
>
4
){
http
.
post
(
"/api/module/RemoteModules"
,
''
).
then
((
result
)
=>
{
if
(
result
.
data
!==
null
){
//console.log(result.data);
result
.
data
.
forEach
(
item
=>
{
if
(
item
.
moduleCode
===
"RemoteTransferStatus"
){
isTransferStatus
.
value
=
true
;
}
if
(
item
.
moduleCode
===
"RemoteTransferReg"
){
isTransferRegControl
.
value
=
true
;
}
if
(
item
.
moduleCode
===
"HolidayControl"
){
isHolidayControl
.
value
=
true
;
}
if
(
item
.
moduleCode
===
"NightControl"
){
isNightControl
.
value
=
true
;
}
if
(
item
.
moduleCode
===
"SecTempControl"
){
isSecTempControl
.
value
=
true
;
}
if
(
item
.
moduleCode
===
"CurveControl"
){
isCurveControl
.
value
=
true
;
}
if
(
item
.
moduleCode
===
"WeatherControl"
){
isWeatherControl
.
value
=
true
;
}
if
(
item
.
moduleCode
===
"LimitControl"
){
isLimitControl
.
value
=
true
;
}
if
(
item
.
moduleCode
===
"WinDirectionControl"
){
isWinDirectionControl
.
value
=
true
;
}
if
(
item
.
moduleCode
===
"HeatControl"
){
isHeatControl
.
value
=
true
;
}
if
(
item
.
moduleCode
===
"OutdoorTempControl"
){
isOutdoorTempControl
.
value
=
true
;
}
if
(
item
.
moduleCode
===
"NightFrequency"
){
isNightFrequency
.
value
=
true
;
}
})
}
});
}
initPage
();
// 当选中项变化时,这里会打印新的值
watch
(
activeRadio
,
(
newValue
)
=>
{
// console.log('Selected value changed:', newValue);
});
</
script
>
<
style
lang=
"less"
scoped
>
...
...
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