Commit 4382338b authored by baixian's avatar baixian

数据中心开发完成

parent c312205f
......@@ -12,11 +12,11 @@
<![endif]-->
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"></script>
<script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/console-polyfill.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es6-shim.min.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-shim.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-sham.min.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/json3.min.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/html5shiv.min.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/polyfill.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/lib/vendor.dll.js?20191012222" charset="utf-8"></script>
<script src="js/console-polyfill.js?20191012222" charset="utf-8"></script><script src="js/es6-shim.min.js?20191012222" charset="utf-8"></script><script src="js/es5-shim.js?20191012222" charset="utf-8"></script><script src="js/es5-sham.min.js?20191012222" charset="utf-8"></script><script src="js/json3.min.js?20191012222" charset="utf-8"></script><script src="js/html5shiv.min.js?20191012222" charset="utf-8"></script><script src="js/polyfill.js?20191012222" charset="utf-8"></script><script src="lib/vendor.dll.js?20191012222" charset="utf-8"></script>
</head>
</head>
<body>
<div id="root"></div>
<script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/dist/main.js?1572591383487" charset="utf-8"></script>
<script src="dist/main.js?1573194144046" charset="utf-8"></script>
</body>
</html>
\ No newline at end of file
......@@ -52,6 +52,25 @@ export default {
end_date: moment().format('YYYY-MM-DD'),
},
teacherListTotal: 0,
classList: [],
classListParams: {
school_id: 0,
page: 1,
perPage: 5,
start_date: moment().format('YYYY-MM-DD'),
end_date: moment().format('YYYY-MM-DD'),
},
classListTotal: 0,
detailVisible: false,
detailList: [],
detailListParams: {
school_id: 0,
page: 1,
perPage: 10,
status: 0,
share_student_id: '',
},
detailListTotal: 0,
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -92,7 +111,6 @@ export default {
const newQueryParams = Object.assign(customerListParams, params, {
school_id: sid,
});
console.log(newQueryParams, 'newQueryParams');
const data = yield call(analyzeAjax.findCustomer, newQueryParams);
if (data.code === 200) {
if (data.data.total != undefined) {
......@@ -115,6 +133,52 @@ export default {
});
}
},
* selectDetailModal({ payload }, { call, put, select }) {
const { params, type } = payload;
const { sid } = yield select(state => state.webapp);
const {
classListParams, studentListParams, teacherListParams, detailListParams, detailListTotal,
} = yield select(state => state.analyzecenter);
let newTotal = detailListTotal;
let typePrams = {};
switch (type) {
case 2:
typePrams = { ...studentListParams };
break;
case 3:
typePrams = { ...teacherListParams };
break;
case 4:
typePrams = { ...classListParams };
break;
default:
typePrams = { };
}
const newQueryParams = Object.assign(typePrams, detailListParams, params, {
school_id: sid,
});
const data = yield call(analyzeAjax.findCustomer, newQueryParams);
if (data.code === 200) {
if (data.data.total != undefined) {
newTotal = data.data.total;
}
yield put({
type: 'updateState',
payload: {
detailList: data.data && data.data.list,
detailListParams: { ...newQueryParams },
detailListTotal: newTotal,
},
});
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data,
},
});
}
},
* selectStudent({ payload }, { call, put, select }) {
const { params } = payload;
const { sid } = yield select(state => state.webapp);
......@@ -175,6 +239,36 @@ export default {
});
}
},
* selectClass({ payload }, { call, put, select }) {
const { params } = payload;
const { sid } = yield select(state => state.webapp);
const { classListParams, classListTotal } = yield select(state => state.analyzecenter);
let newTotal = classListTotal;
const newQueryParams = Object.assign(classListParams, params, {
school_id: sid,
});
const data = yield call(analyzeAjax.findClassContribution, newQueryParams);
if (data.code === 200) {
if (data.data.total != undefined) {
newTotal = data.data.total;
}
yield put({
type: 'updateState',
payload: {
classList: data.data && data.data.list,
classListParams: { ...newQueryParams },
classListTotal: newTotal,
},
});
} else {
yield put({
type: 'webapp/errorrequestresolve',
payload: {
data,
},
});
}
},
* changeCustomerPage({ payload }, { call, put, select }) {
const { params } = payload;
const { customerListParams } = yield select(state => state.analyzecenter);
......@@ -200,34 +294,53 @@ export default {
today: moment(moment().unix() * 1000),
checkedDay: 0,
customerList: [],
customerListParams: {
school_id: 0,
page: 1,
perPage: 5,
start_date: moment().format('YYYY-MM-DD'),
end_date: moment().format('YYYY-MM-DD'),
status: 0,
},
customerListTotal: 0,
studentList: [],
studentListParams: {
school_id: 0,
page: 1,
perPage: 5,
start_date: moment().format('YYYY-MM-DD'),
end_date: moment().format('YYYY-MM-DD'),
},
studentListTotal: 0,
teacherList: [],
teacherListParams: {
school_id: 0,
page: 1,
perPage: 5,
start_date: moment().format('YYYY-MM-DD'),
end_date: moment().format('YYYY-MM-DD'),
},
teacherListTotal: 0,
classList: [],
classListParams: {
school_id: 0,
page: 1,
perPage: 5,
start_date: moment().format('YYYY-MM-DD'),
end_date: moment().format('YYYY-MM-DD'),
},
classListTotal: 0,
detailVisible: false,
detailList: [],
detailListParams: {
school_id: 0,
page: 1,
perPage: 10,
status: 0,
share_student_id: '',
},
detailListTotal: 0,
},
customerListParams: {
school_id: 0,
page: 1,
perPage: 5,
start_date: moment().format('YYYY-MM-DD'),
end_date: moment().format('YYYY-MM-DD'),
status: 0,
},
customerListTotal: 0,
studentList: [],
studentListParams: {
school_id: 0,
page: 1,
perPage: 5,
start_date: moment().format('YYYY-MM-DD'),
end_date: moment().format('YYYY-MM-DD'),
},
studentListTotal: 0,
teacherList: [],
teacherListParams: {
school_id: 0,
page: 1,
perPage: 5,
start_date: moment().format('YYYY-MM-DD'),
end_date: moment().format('YYYY-MM-DD'),
},
teacherListTotal: 0,
});
},
},
......
......@@ -749,6 +749,11 @@ export default {
});
}
if (pathname === '/sjd/datacenter') {
dispatch({
type: 'analyzecenter/pageInit',
payload: {
},
});
dispatch({
type: 'analyzecenter/selectDashboard',
payload: {
......@@ -783,6 +788,15 @@ export default {
},
},
});
dispatch({
type: 'analyzecenter/selectClass',
payload: {
params: {
start_date: moment().format('YYYY-MM-DD'),
end_date: moment().format('YYYY-MM-DD'),
},
},
});
dispatch({
type: 'updateState',
payload: {
......
import { connect } from 'dva';
import React from 'react';
import PropTypes from 'prop-types';
import { message, Row, Col, Input, Select, Modal, Form, InputNumber, Button, Pagination, Table, Avatar } from 'antd';
import { imagify, pageIn } from '../../utils/index';
import pageStyle from './detailModal.less';
const { Option } = Select;
const { TextArea } = Input;
const FormItem = Form.Item;
class detailModalForm extends React.Component {
componentWillMount() {
}
componentDidUpdate() {
}
componentWillUpdate() {
}
componentDidMount() { // 挂载
pageIn('数据中心');
}
componentWillUnmount() { // 卸载
}
close = () => {
const {
close,
} = this.props;
close();
}
changeDetailPage = (page, perPage) => {
const { changeDetailPage } = this.props;
changeDetailPage(
{ page, perPage },
);
}
render() {
const {
visible,
detailListParams,
detailListTotal,
detailList,
} = this.props;
const columns = [
{
title: '头像',
dataIndex: 'avatar',
key: 'avatar',
render: (text) => {
return (
<div className={pageStyle.avatarBox}>
<Avatar src={imagify(text)} />
</div>);
},
},
{
title: '姓名',
dataIndex: 'nickname',
key: 'nickname',
},
{
title: '电话号码',
dataIndex: 'mobile',
key: 'mobile',
},
{
title: '留下线索时间',
dataIndex: 'created_at',
key: 'created_at',
render: (text) => {
return (
<div>{text}</div>
);
},
},
{
title: '贡献学员',
dataIndex: 'share_student',
key: 'share_student',
render: (text, record) => {
return (
<div>{record.share_student.nickname}</div>
);
},
},
];
return (
<Modal
visible={visible}
title="明细"
onCancel={this.close}
maskClosable={false}
zIndex={110}
footer={<div><Button type="primary" onClick={this.close}>关闭</Button></div>}
width={586}
bodyStyle={{ padding: 0 }}
>
<div className={pageStyle.detailBox}>
<Table
size="small"
rowKey="id"
dataSource={detailList}
columns={columns}
pagination={false}
footer={() => (
detailList.length > 0 &&
<div className="tablefooterbox">
<span className="tablefooterstatic">{detailListTotal}条数据</span>
<Pagination
size="small"
pageSize={detailListParams.perPage}
total={Number(detailListTotal)}
onChange={this.changeDetailPage}
/>
</div>
)}
/>
</div>
</Modal>
);
}
}
const detailModal = Form.create()(detailModalForm);
export default detailModal;
.detailBox {
:global {
.ant-table-placeholder {
border-top: none;
}
.ant-table-small {
border: none;
}
.ant-table-thead > tr > th {
border-bottom: none;
font-size: 14px;
font-weight: 600;
}
.ant-table-tbody > tr > td {
border-bottom: none;
}
}
}
This diff is collapsed.
.container {
padding-bottom: 50px;
}
.head {
padding: 20px 28px;
background-color: #fff;
......@@ -58,40 +60,45 @@
}
.footer {
margin-top: 25px;
.commonTableAvatar {
background-color: #fff;
min-height: 383px;
}
.commonTable {
background-color: #fff;
.commonTitle {
font-size:16px;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:600;
line-height: 24px;
padding: 15px 0 15px 10px;
color:rgba(0,0,0,0.85);
border-bottom: 1px solid #E8E8E8;
.line {
width: 3px;
height: 19px;
background-color: #1890FF;
display: inline-block;
vertical-align: -10%;
margin-right: 6px;
}
min-height: 358px;
}
.commonTitle {
font-size:16px;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:600;
line-height: 24px;
padding: 15px 0 15px 10px;
color:rgba(0,0,0,0.85);
border-bottom: 1px solid #E8E8E8;
.line {
width: 3px;
height: 19px;
background-color: #1890FF;
display: inline-block;
vertical-align: -10%;
margin-right: 6px;
}
:global {
.ant-table-placeholder {
border-top: none;
}
.ant-table-small {
border: none;
}
.ant-table-thead > tr > th {
border-bottom: none;
font-size: 14px;
font-weight: 600;
}
.ant-table-tbody > tr > td {
border-bottom: none;
}
}
:global {
.ant-table-placeholder {
border-top: none;
}
.ant-table-small {
border: none;
}
.ant-table-thead > tr > th {
border-bottom: none;
font-size: 14px;
font-weight: 600;
}
.ant-table-tbody > tr > td {
border-bottom: none;
}
}
}
......@@ -100,6 +107,11 @@
display: inline-block;
margin-right: 10px;
}
.sortNum {
font-size:18px;
font-weight:600;
color:rgba(0,0,0,0.65);
}
}
.threadBox {
.detail {
......@@ -108,5 +120,6 @@
color:rgba(24,144,255,1);
display: inline-block;
margin-left: 10px;
cursor: pointer;
}
}
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