Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
WX_h5
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
godwithdh
WX_h5
Commits
dd76d81f
Commit
dd76d81f
authored
Feb 07, 2020
by
godwithdh
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://47.110.145.204:8085/godwithdh/wx_h5
parents
f8e322bc
70cbd5e1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
911 additions
and
7 deletions
+911
-7
apiMap.js
src/libs/apiMap.js
+2
-1
healthApi.js
src/libs/healthApi.js
+3
-0
host.js
src/libs/host.js
+5
-0
util.js
src/libs/util.js
+17
-0
health.js
src/router/health.js
+16
-0
index.js
src/store/index.js
+3
-1
statistics.js
src/store/modules/health/statistics.js
+27
-0
chart.vue
src/view/healthCard/statistics/chart.vue
+523
-0
index.vue
src/view/healthCard/statistics/index.vue
+113
-5
list.vue
src/view/healthCard/statistics/list.vue
+202
-0
No files found.
src/libs/apiMap.js
View file @
dd76d81f
import
healthApi
from
'./healthApi'
;
const
methodMap
=
{
/**
* 产品颜色销售排行TOP50
...
...
@@ -81,4 +82,4 @@ const methodMap = {
getTipProcurementProgress
:{
url
:
"/pbcontracthdr/"
,
method
:
"post"
,
host
:
"default"
},
};
export
default
methodMap
;
export
default
Object
.
assign
(
methodMap
,
healthApi
)
;
src/libs/healthApi.js
0 → 100644
View file @
dd76d81f
module
.
exports
=
{
getStatisticalDetails
:{
url
:
"/healthlog/"
,
method
:
"post"
,
host
:
"health"
},
}
\ No newline at end of file
src/libs/host.js
View file @
dd76d81f
...
...
@@ -27,6 +27,11 @@ function urlFun(name){
*/
// inside:`http://192.168.4.39:5003`,
inside
:
`https://weixin.huansi.net/apiproxy/huansi/ERP`
,
/**
* 健康打卡统计
*/
health
:
`https://weixin.huansi.net/apiproxy/huansi/service/proxy/1225621052093239296`
}
return
url
[
name
]
}
...
...
src/libs/util.js
View file @
dd76d81f
...
...
@@ -7,6 +7,7 @@ var nowMonth = now.getMonth(); //当前月
var
nowYear
=
now
.
getYear
();
//当前年
nowYear
+=
(
nowYear
<
2000
)
?
1900
:
0
;
//
var
y
=
0
;
let
util
=
{
...
...
@@ -489,6 +490,22 @@ util.Colors.prototype.getHslArray= function() {
}
return
HSL
;
};
util
.
scrollToBottom
=
function
(
scrollDom
){
if
(
scrollDom
.
scrollTop
>
y
){
// console.log('向下')
let
offsetHeight
=
scrollDom
.
offsetHeight
;
let
scrollHeight
=
scrollDom
.
scrollHeight
;
let
scrollTop
=
scrollDom
.
scrollTop
;
if
(
scrollHeight
-
offsetHeight
-
scrollTop
<=
0
){
y
=
0
;
return
true
;
}
}
else
if
(
scrollDom
.
scrollTop
<
y
){
// console.log('向上')
}
y
=
scrollDom
.
scrollTop
;
}
// util.pageReturn = function(){
// /*微信自带返回按钮,不刷新,刷新页面start*/
// if (util.isIos()) {
...
...
src/router/health.js
View file @
dd76d81f
...
...
@@ -26,6 +26,22 @@ module.exports = [
meta
:{
title
:
'员工健康'
}
},
{
path
:
'statistics/chart'
,
name
:
'healthCardStatisticsChart'
,
component
:()
=>
import
(
'@/view/healthCard/statistics/chart.vue'
),
meta
:{
title
:
'员工健康'
}
},
{
path
:
'statistics/list/:type'
,
name
:
'healthCardStatisticsList'
,
component
:()
=>
import
(
'@/view/healthCard/statistics/list.vue'
),
meta
:{
title
:
'员工健康'
}
}
]
},
...
...
src/store/index.js
View file @
dd76d81f
...
...
@@ -6,6 +6,7 @@ import searchOrder from './modules/tiip/searchOrder';
import
profitAnalysis
from
'./modules/tiip/profitAnalysis'
;
import
kanban
from
'./modules/tiip/kanban'
;
import
checkProgress
from
'./modules/tiip/checkProgress'
;
import
healthStatistics
from
'./modules/health/statistics'
;
Vue
.
use
(
Vuex
);
...
...
@@ -22,7 +23,8 @@ const store = new Vuex.Store({
searchOrder
,
profitAnalysis
,
kanban
,
checkProgress
checkProgress
,
healthStatistics
}
});
...
...
src/store/modules/health/statistics.js
0 → 100644
View file @
dd76d81f
import
Util
from
'@/libs/util'
;
import
Vue
from
'vue'
;
const
obj
=
{
state
:
{
hdr
:{},
dtl
:{}
},
mutations
:
{
saveHealthStatisticsHdr
(
state
,
data
){
state
.
hdr
=
data
;
},
saveHealthStatisticsDtl
(
state
,
data
){
state
.
dtl
=
data
;
},
},
actions
:
{
saveHealthStatisticsHdr
({
commit
},
data
){
commit
(
'saveHealthStatisticsHdr'
,
data
);
},
saveHealthStatisticsDtl
({
commit
},
data
){
commit
(
'saveHealthStatisticsDtl'
,
data
);
},
}
};
export
default
obj
;
src/view/healthCard/statistics/chart.vue
0 → 100644
View file @
dd76d81f
This diff is collapsed.
Click to expand it.
src/view/healthCard/statistics/index.vue
View file @
dd76d81f
<
style
lang=
"less"
>
@import url('../../../styles/common.less');
#healthCardStatisticsIndex{
background:
#f6f5f9
;
background:
white
;
height:100%;
display: flex;
flex-direction: column;
.items{
// flex-grow:1;
// height:1px;
margin:15px 15px 0 15px;
.HEAD{
border-top-left-radius: 6px;
border-top-right-radius: 6px;
background: #6b9bf7;
height:60px;
display: flex;
align-items: center;
padding:0 10px;
.left{
flex:1;
color:white;
font-size:18px;
font-weight: bold;
}
.right{
flex:1;
text-align: right;
display:flex;
flex-wrap: wrap;
div{
width:100%;
color:white;
}
.month{
font-size:14px;
}
.day{
font-size:18px;
font-weight: bold;
}
}
}
.CONTENT{
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
border:2px solid #6b9bf7;
border-top:0;
padding:10px;
display: flex;
justify-content: center;
align-items: center;
.left,.right,.center{
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
flex:1;
.n{
width:100%;
color:#527cd9;
font-weight: bold;
font-size:20px;
text-align: center;
}
.t{
width:100%;
font-size:14px;
text-align: center;
}
}
}
}
.items:last-child{
margin-bottom:15px;
}
}
</
style
>
<
template
>
<div
id=
"healthCardStatisticsIndex"
>
<div
class=
"items"
v-for=
"(item,index) in list"
:key=
"index"
>
<div
class=
"HEAD"
@
click=
"routerToChart(item)"
>
<div
class=
"left"
>
<span>
{{
item
.
iAllJoin
}}
/
{{
item
.
iAll
}}
</span>
</div>
<div
class=
"right"
>
<div
class=
"day"
>
{{
item
.
iDay
}}
</div>
<div
class=
"month"
>
{{
item
.
sMonth
}}
</div>
</div>
</div>
<div
class=
"CONTENT"
>
<div
class=
"left"
>
<div
class=
"n"
>
{{
item
.
iAll
}}
</div>
<div
class=
"t"
>
应参与人员
</div>
</div>
<div
class=
"center"
>
<div
class=
"n"
>
{{
item
.
iAllJoin
}}
</div>
<div
class=
"t"
>
已参与人员
</div>
</div>
<div
class=
"right"
>
<div
class=
"n"
>
{{
item
.
iAllNotJoin
}}
</div>
<div
class=
"t"
>
未参与人员
</div>
</div>
</div>
</div>
</div>
</
template
>
...
...
@@ -23,7 +115,7 @@ export default {
name
:
'healthCardStatisticsIndex'
,
data
()
{
return
{
list
:[]
}
},
components
:{
...
...
@@ -39,9 +131,25 @@ export default {
},
async
activated
(){
window
.
d
=
this
;
await
this
.
getData
();
},
methods
:{
async
getData
(){
let
res
=
await
this
.
request
(
'getStatisticalDetails'
,{
data
:[
{
key
:
'url'
,
value
:
'statistical_details'
},
{
key
:
'openid'
,
value
:
'3'
}
],
params
:{},
},
'加载中'
,{});
if
(
res
&&
res
.
length
>
0
)
{
this
.
list
=
res
;
}
},
routerToChart
(
item
){
this
.
$store
.
dispatch
(
'saveHealthStatisticsHdr'
,
item
);
this
.
$router
.
push
({
name
:
'healthCardStatisticsChart'
});
}
}
}
</
script
>
\ No newline at end of file
src/view/healthCard/statistics/list.vue
0 → 100644
View file @
dd76d81f
<
style
lang=
"less"
>
@import url('../../../styles/common.less');
#healthCardStatisticsList{
background: #f6f5f9;
height:100%;
display: flex;
flex-direction: column;
.CONTENT{
flex-grow: 1;
height:1px;
display: flex;
flex-direction: column;
.activeTab2{
flex-grow: 1;
height:1px;
background: white;
overflow: auto;
-webkit-overflow-scrolling: touch;
.items{
display: flex;
height:60px;
align-items: center;
margin:10px;
.avatar{
height:50px;
width:50px;
border-radius: 50%;
background: #3a8af7;
display: flex;
justify-content: center;
align-items: center;
color:white;
font-size:22px;
margin-right:10px;
}
.item{
flex:1;
height:60px;
border-bottom:1px solid #f6f6f6;
box-sizing: border-box;
display: flex;
align-items: center;
.name{
font-size:14px;
}
>div{
flex:1;
}
}
}
}
}
.img{
width:100%;
display: flex;
justify-content: center;
img{
width:100%;
height:300px;
}
}
}
</
style
>
<
template
>
<div
id=
"healthCardStatisticsList"
>
<div
class=
"CONTENT"
>
<tab
v-model=
"activeTab"
prevent-default
@
on-before-index-change=
"switchTabItem"
bar-active-color=
"#4572d7"
active-color=
"#4572d7"
default-color=
"#8a8a8a"
>
<tab-item
:selected=
"activeTab == 0"
>
已填写(
{{
list1
.
length
}}
)
</tab-item>
<tab-item
:selected=
"activeTab == 1"
>
未填写(
{{
list2
.
length
}}
)
</tab-item>
</tab>
<div
class=
"activeTab2"
>
<div
class=
"items"
v-for=
"(item,index) in (activeTab == 0 ? list1 : list2)"
:key=
"index"
>
<div
class=
"avatar"
>
<img
src=
""
alt=
""
>
<span>
{{
item
.
sEmploeeName
[
0
]
}}
</span>
</div>
<div
class=
"item"
>
<div
class=
"name"
>
{{
item
.
sEmploeeName
}}
</div>
</div>
</div>
<div
class=
"img"
v-if=
"(activeTab == 0 ? list1 : list2).length
<
=
0
"
>
<img
src=
"@/assets/noData.jpg"
class=
"_img"
alt=
""
>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
import
Util
from
'@/libs/util.js'
;
import
{
mapState
}
from
'vuex'
;
import
{
Tab
,
TabItem
}
from
'vux'
export
default
{
name
:
'healthCardStatisticsList'
,
data
()
{
return
{
activeTab
:
0
,
page1
:
1
,
per_page1
:
20
,
page2
:
1
,
per_page2
:
20
,
list1
:[],
list2
:[]
}
},
components
:{
Tab
,
TabItem
},
computed
:{
...
mapState
({
hdr
:
state
=>
state
.
healthStatistics
.
hdr
})
},
async
mounted
(){
},
async
activated
(){
window
.
d
=
this
;
this
.
activeTab
=
this
.
$route
.
params
.
type
;
this
.
clean
();
await
this
.
getList1
();
await
this
.
getList2
();
},
methods
:{
clean
(){
this
.
page1
=
1
;
this
.
per_page1
=
20
;
this
.
list1
=
[];
this
.
page2
=
1
;
this
.
per_page2
=
20
;
this
.
list2
=
[];
},
switchTabItem
(
index
){
this
.
activeTab
=
index
;
if
(
this
.
activeTab
==
0
){
this
.
getList1
();
}
else
{
this
.
activeTab
==
1
}{
this
.
getList2
();
}
},
async
getList1
(){
if
(
this
.
per_page1
<
20
){
this
.
$vux
.
toast
.
text
(
'已加载全部数据!'
,
'middle'
)
return
false
;
}
let
res
=
await
this
.
request
(
'getStatisticalDetails'
,{
data
:[
{
key
:
'url'
,
value
:
'HealthLog'
},
{
key
:
'dDate'
,
value
:
this
.
hdr
.
dDate
},
{
key
:
'iCompanyId'
,
value
:
'1'
},
{
key
:
'iType'
,
value
:
'1'
}
],
params
:{
page
:
this
.
page1
,
per_page
:
this
.
per_page1
},
},
'加载中'
,{});
if
(
res
&&
res
.
length
>
0
){
this
.
list1
=
this
.
list1
.
concat
(
res
);
this
.
page1
++
;
this
.
per_page1
=
res
.
length
;
}
},
async
getList2
(){
if
(
this
.
per_page2
<
20
){
this
.
$vux
.
toast
.
text
(
'已加载全部数据!'
,
'middle'
)
return
false
;
}
let
res
=
await
this
.
request
(
'getStatisticalDetails'
,{
data
:[
{
key
:
'url'
,
value
:
'HealthLog'
},
{
key
:
'dDate'
,
value
:
this
.
hdr
.
dDate
},
{
key
:
'iCompanyId'
,
value
:
'1'
},
{
key
:
'iType'
,
value
:
'0'
}
],
params
:{
page
:
this
.
page2
,
per_page
:
this
.
per_page2
},
},
'加载中'
,{});
if
(
res
&&
res
.
length
>
0
){
this
.
list2
=
this
.
list2
.
concat
(
res
);
this
.
page2
++
;
this
.
per_page2
=
res
.
length
;
}
},
scrollToBottom
(){
let
scrollDom
=
this
.
$refs
[
'scrollDom'
];
if
(
Util
.
scrollToBottom
(
scrollDom
)){
if
(
this
.
activeTab
==
0
){
this
.
getList1
();
}
else
{
this
.
activeTab
==
1
}{
this
.
getList2
();
}
}
}
}
}
</
script
>
\ 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