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
c99940fd
Commit
c99940fd
authored
Jul 30, 2024
by
moonby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
240730
parent
53891155
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
32 deletions
+73
-32
HeatUserPage.vue
src/views/HeatUserPage/HeatUserPage.vue
+37
-16
TapPage.vue
src/views/HeatUserPage/TapPage.vue
+36
-16
No files found.
src/views/HeatUserPage/HeatUserPage.vue
View file @
c99940fd
...
...
@@ -59,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"
>
...
...
@@ -70,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"
>
...
...
@@ -353,9 +355,9 @@ var exportUrl= isHisData.value ? '/api/tiger/TigerHeatUser/HisExport' : '/api/ti
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'
,
"单元"
);
...
...
@@ -466,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
...
...
@@ -489,10 +489,10 @@ 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
;
}
...
...
@@ -562,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
);
}
}
...
...
@@ -664,7 +674,8 @@ function getFileName(name){
//表格样式设置
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
;
...
...
@@ -677,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
;
}
...
...
@@ -697,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
;
}
...
...
@@ -707,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 @
c99940fd
...
...
@@ -59,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"
>
...
...
@@ -70,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"
>
...
...
@@ -459,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
...
...
@@ -484,10 +484,11 @@ 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
){
...
...
@@ -552,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
);
}
}
...
...
@@ -657,7 +667,8 @@ function getFileName(name){
//表格样式设置
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
;
...
...
@@ -670,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
;
}
...
...
@@ -690,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
;
}
...
...
@@ -699,6 +715,10 @@ function handleHeadAddClass({ column }) {
}
}
//索引计算
function
indexMethod
(
index
){
return
(
currentPage
.
value
-
1
)
*
pageSize
.
value
+
index
+
1
;
}
//获取排序的方法
function
sortMethod
({
order
,
prop
})
{
...
...
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