Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
W
whp-xl
Project
Project
Details
Activity
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
lizhichao
whp-xl
Commits
004fcae9
Commit
004fcae9
authored
Aug 28, 2021
by
王晓倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据统计列表页
parent
ef3861f2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
145 additions
and
100 deletions
+145
-100
EnterprisesInformation.vue
...m-master/src/views/Enterprises/EnterprisesInformation.vue
+145
-100
No files found.
dcit-hcsystem-hcsystem-master/src/views/Enterprises/EnterprisesInformation.vue
View file @
004fcae9
...
@@ -17,12 +17,11 @@
...
@@ -17,12 +17,11 @@
</el-form>
</el-form>
</el-col>
</el-col>
</el-row>
</el-row>
<el-table
:data=
"tableData.pageData"
stripe
show-summary
border
style=
"width:100%;"
:loading=
"loading"
>
<el-table
:data=
"tableData.pageData"
stripe
show-summary
:summary-method=
"getTotal"
border
style=
"width:100%;"
:loading=
"loading"
>
<el-table-column
prop=
"unitName"
label=
"企业名称"
></el-table-column>
<el-table-column
prop=
"unitName"
label=
"企业名称"
></el-table-column>
<el-table-column
prop=
"unitName"
label=
"危险源"
></el-table-column>
<el-table-column
prop=
"dangerNum"
label=
"危险源数量"
></el-table-column>
<el-table-column
prop=
"legalPerson"
label=
"设备监控"
></el-table-column>
<el-table-column
prop=
"cameraNum"
label=
"设备监控数量"
></el-table-column>
<el-table-column
prop=
"orgCode"
label=
"职业危害场所"
></el-table-column>
<el-table-column
prop=
"troubleNum"
label=
"隐患数量"
></el-table-column>
<el-table-column
prop=
"legalPersonEmail"
label=
"隐患数量"
"
></el-table-column>
</el-table>
</el-table>
<el-pagination
<el-pagination
background
background
...
@@ -42,8 +41,8 @@
...
@@ -42,8 +41,8 @@
:key=
"zjKey"
:key=
"zjKey"
></EnterprisesMgEdit>
></EnterprisesMgEdit>
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Component
,
Vue
,
Provide
}
from
"vue-property-decorator"
;
import
{
Component
,
Vue
,
Provide
}
from
"vue-property-decorator"
;
import
EnterprisesMgEdit
from
"./EnterprisesMgEdit.vue"
;
import
EnterprisesMgEdit
from
"./EnterprisesMgEdit.vue"
;
import
City
from
"@/components/city.vue"
;
import
City
from
"@/components/city.vue"
;
...
@@ -69,7 +68,7 @@
...
@@ -69,7 +68,7 @@
that
.
loading
=
true
;
that
.
loading
=
true
;
METHOD
.
axiosPost
(
METHOD
.
axiosPost
(
that
,
that
,
`/enterpriseInfo/queryEnterpriseInfo
`
,
`/dataStatistics/getDataStatistics
`
,
param
,
param
,
function
(
res
:
any
)
{
function
(
res
:
any
)
{
that
.
loading
=
false
;
that
.
loading
=
false
;
...
@@ -79,6 +78,52 @@
...
@@ -79,6 +78,52 @@
}
}
);
);
}
}
getTotal
(
param
:
any
)
{
const
{
columns
,
data
}
=
param
;
const
sums
:
any
[]
=
[];
columns
.
forEach
((
column
:
any
,
index
:
any
)
=>
{
if
(
index
===
0
)
{
sums
[
index
]
=
'合计'
;
return
;
}
const
values
=
data
.
map
((
item
:
{
[
x
:
string
]:
any
;
})
=>
Number
(
item
[
column
.
property
]));
if
(
column
.
property
===
'dangerNum'
)
{
sums
[
index
]
=
values
.
reduce
((
prev
:
any
,
curr
:
any
)
=>
{
const
value
=
Number
(
curr
);
if
(
!
isNaN
(
value
))
{
return
prev
+
curr
;
}
else
{
return
prev
;
}
},
0
);
sums
[
index
];
}
else
if
(
column
.
property
===
'troubleNum'
)
{
sums
[
index
]
=
values
.
reduce
((
prev
:
any
,
curr
:
any
)
=>
{
const
value
=
Number
(
curr
);
if
(
!
isNaN
(
value
))
{
return
prev
+
curr
;
}
else
{
return
prev
;
}
},
0
);
sums
[
index
];
}
else
if
(
column
.
property
===
'cameraNum'
)
{
sums
[
index
]
=
values
.
reduce
((
prev
:
any
,
curr
:
any
)
=>
{
const
value
=
Number
(
curr
);
if
(
!
isNaN
(
value
))
{
return
prev
+
curr
;
}
else
{
return
prev
;
}
},
0
);
sums
[
index
];
}
else
{
sums
[
index
]
=
'--'
;
}
});
return
sums
;
}
searchFun
()
{
searchFun
()
{
this
.
PAGE
=
{
page
:
1
,
size
:
10
};
this
.
PAGE
=
{
page
:
1
,
size
:
10
};
this
.
getTableData
();
this
.
getTableData
();
...
@@ -167,8 +212,8 @@
...
@@ -167,8 +212,8 @@
this
.
getTableData
();
this
.
getTableData
();
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
@import
"@/utils/public.scss"
;
@import
"@/utils/public.scss"
;
@media
screen
and
(
max-width
:
1350px
)
{
@media
screen
and
(
max-width
:
1350px
)
{
main
>
div
.el-table
{
main
>
div
.el-table
{
...
@@ -181,4 +226,4 @@
...
@@ -181,4 +226,4 @@
font-size
:
14px
;
font-size
:
14px
;
word-break
:
break-all
;
word-break
:
break-all
;
}
}
</
style
>
</
style
>
\ No newline at end of file
\ No newline at end of file
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