Commit 2db46dc5 authored by wangxuelai's avatar wangxuelai

''

parents f11f305f 24361d03
<!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
......@@ -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 {
......
This diff is collapsed.
......@@ -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',
});
}
......
......@@ -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,
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment