Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
biz.qingxiao.com
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
wangxuelai
biz.qingxiao.com
Commits
2db46dc5
Commit
2db46dc5
authored
Aug 20, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Plain Diff
''
parents
f11f305f
24361d03
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
266 additions
and
119 deletions
+266
-119
index.html
index.html
+1
-1
indexstaic.js
src/models/indexstaic.js
+28
-3
cc.js
src/pages/index/cc.js
+0
-0
index.js
src/pages/index/index.js
+218
-113
test.js
src/pages/index/test.js
+0
-0
indexstaic.js
src/services/indexstaic.js
+2
-2
index.js
src/utils/index.js
+17
-0
No files found.
index.html
View file @
2db46dc5
<!DOCTYPE html>
<html
lang=
"en"
><head><meta
charset=
"UTF-8"
><title>
轻校
</title><link
rel=
"shortcut icon"
href=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/image/qxlogo4.png"
><meta
content=
"width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0;"
name=
"viewport"
><meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<!-- Polyfills --><!--[if lt IE 10]>
<script src="js/console-polyfill.js"></script>
<![endif]-->
<script
charset=
"utf-8"
src=
"https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"
></script><link
href=
"/dist/index.css?1566285021308"
rel=
"stylesheet"
><script
src=
"/lib/vendor.dll.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/console-polyfill.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es6-shim.min.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-shim.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-sham.min.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/json3.min.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/html5shiv.min.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/polyfill.js?3"
charset=
"utf-8"
></script></head><body><div
id=
"root"
></div><script
src=
"/dist/index.js?1566285021308"
charset=
"utf-8"
></script></body></html>
\ No newline at end of file
<![endif]-->
<script
charset=
"utf-8"
src=
"https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"
></script><link
href=
"/dist/index.css?1566309763096"
rel=
"stylesheet"
><script
src=
"/lib/vendor.dll.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/console-polyfill.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es6-shim.min.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-shim.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-sham.min.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/json3.min.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/html5shiv.min.js?3"
charset=
"utf-8"
></script><script
src=
"https://cdn.img.shangjiadao.cn/qingxiao/biz/js/polyfill.js?3"
charset=
"utf-8"
></script></head><body><div
id=
"root"
></div><script
src=
"/dist/index.js?1566309763096"
charset=
"utf-8"
></script></body></html>
\ No newline at end of file
src/models/indexstaic.js
View file @
2db46dc5
...
...
@@ -3,6 +3,7 @@ import { routerRedux } from 'dva/router';
import
{
message
}
from
'antd'
;
import
{
delay
}
from
'redux-saga'
;
import
co
from
'co'
;
import
moment
from
'moment'
;
import
{
LocalStorage
,
SessionStorage
,
...
...
@@ -57,6 +58,10 @@ export default {
addCourseTimeShow
:
false
,
timeArr
:
[],
addTimeSubmitting
:
false
,
chartStartDate
:
''
,
chartEndDate
:
''
,
start_time
:
''
,
end_time
:
''
,
},
subscriptions
:
{
setup
({
dispatch
,
history
})
{
// eslint-disable-line
...
...
@@ -378,8 +383,12 @@ export default {
type
:
'querychartstatic'
,
payload
:
{
sid
,
days
:
7
,
days
:
30
,
init
:
true
,
start_date
:
moment
().
startOf
(
'week'
).
unix
()
*
1000
,
end_date
:
moment
().
endOf
(
'week'
).
unix
()
*
1000
,
start_time
:
(
moment
().
startOf
(
'week'
)).
format
(
'YYYY-MM-DD'
),
end_time
:
(
moment
().
endOf
(
'week'
)).
format
(
'YYYY-MM-DD'
),
},
});
yield
put
({
...
...
@@ -393,9 +402,23 @@ export default {
});
},
*
querychartstatic
({
payload
},
{
call
,
put
,
select
})
{
const
{
sid
,
days
,
init
}
=
payload
;
const
{
sid
,
days
,
init
,
start_date
,
end_date
,
end_time
,
start_time
,
}
=
payload
;
yield
put
({
type
:
'updateState'
,
payload
:
{
chartStartDate
:
start_date
,
chartEndDate
:
end_date
,
},
});
const
loadmessage
=
message
.
loading
(
'加载中...'
,
0
);
const
clockCharts
=
yield
call
(
indexstaticajax
.
clockCharts
,
{
schoolId
:
sid
,
days
});
const
clockCharts
=
yield
call
(
indexstaticajax
.
clockCharts
,
{
schoolId
:
sid
,
days
,
start_time
,
end_time
,
});
setTimeout
(
loadmessage
);
if
(
clockCharts
.
code
==
200
)
{
yield
put
({
...
...
@@ -405,6 +428,8 @@ export default {
clockCharts
:
clockCharts
.
data
,
clockChartsSuccess
:
true
,
days
,
start_time
,
end_time
,
},
});
}
else
{
...
...
src/pages/index/cc.js
0 → 100644
View file @
2db46dc5
src/pages/index/index.js
View file @
2db46dc5
This diff is collapsed.
Click to expand it.
src/pages/index/test.js
0 → 100644
View file @
2db46dc5
src/services/indexstaic.js
View file @
2db46dc5
...
...
@@ -7,9 +7,9 @@ export function statistical({ schoolId }) {
method
:
'GET'
,
});
}
export
function
clockCharts
({
schoolId
,
days
})
{
export
function
clockCharts
({
schoolId
,
start_time
,
end_time
})
{
return
request
({
url
:
`
${
api
.
indexstaic
.
clockCharts
}
?school_id=
${
schoolId
}
&
days=
${
days
}
`
,
url
:
`
${
api
.
indexstaic
.
clockCharts
}
?school_id=
${
schoolId
}
&
start_time=
${
start_time
}
&end_time=
${
end_time
}
`
,
method
:
'GET'
,
});
}
...
...
src/utils/index.js
View file @
2db46dc5
...
...
@@ -677,6 +677,22 @@ function hasBtnPower(key, value) {
}
return
false
;
}
// 获取天数差
/**
* @return {number}
*/
function
DayCount
(
date1
,
date2
)
{
const
startTime
=
date1
.
replace
(
/-/g
,
'/'
);
const
endTime
=
date2
.
replace
(
/-/g
,
'/'
);
const
newStart
=
new
Date
(
startTime
);
const
newEnd
=
new
Date
(
endTime
);
const
days
=
newEnd
.
getTime
()
-
newStart
.
getTime
();
// eslint-disable-next-line radix
const
day
=
parseInt
(
days
/
(
1000
*
60
*
60
*
24
));
return
(
day
+
1
);
}
export
{
pageIn
,
SessionStorage
,
...
...
@@ -716,4 +732,5 @@ export {
videoorigin
,
getBetweenDays
,
hasBtnPower
,
DayCount
,
};
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