Commit c9aef493 by chengming

新增导出

parent cd3ab983
......@@ -21,5 +21,4 @@ chrome-user-data
dll
dist
src\util\request.js
package-lock.json
build/config.js
\ No newline at end of file
package-lock.json
\ No newline at end of file
var os = require('os');
// 修改为指向项目根目录的config.js
const config = require('./config');
let IP = config.IP;
const ifaces = os.networkInterfaces();
var head1 = "htt";
var head2 = "p://";
var port1 = ":80";
var port2 = "90";
var body1 = '10.';
var body2 = '10.';
var body3 = '12.';
var body4 = '94';
var os = require('os'), IP = head1 + head2 + body1 + body2 + body3 + body4 + port1 + port2, ifaces = os.networkInterfaces()
out:
for (var i in ifaces) {
for (var j in ifaces[i]) {
......@@ -15,5 +17,20 @@ for (var i in ifaces) {
}
}
};
module.exports = {IP, host: config.host};
\ No newline at end of file
const host = {
prod: {BASE_URL: "https://mg.kmelearning.com",
},
deve: {
BASE_URL: "https://mg.fairyclass.cn",
},
sit: {
BASE_URL: "https://mg.fairyclass.cn/",
},
uat: {
BASE_URL: "https://uat.mg.kmelearning.com",
},
other: {
BASE_URL: "",
},
};
module.exports = {IP, host: host};
\ No newline at end of file
......@@ -3,6 +3,8 @@ import styles from "./style/index.less";
import {
Select,
Form,
Button,
message,
} from "antd";
import { connect } from "react-redux";
import * as actions from "./redux/actions";
......@@ -820,7 +822,15 @@ class homePage extends Component {
});
this.getTgRes();
}
handleDownload = () => {
setTimeout(() => {
this.props.getDownload({}, res => {
if (res.code === "1000") {
message.loading("数据导出中..", 5).then(() => window.open(res.data))
}
});
}, 1000);
};
render() {
const {
dllData,
......@@ -945,10 +955,19 @@ class homePage extends Component {
return (
<div className={styles.background}>
{/* 行为分析 */}
<p className={styles.titles}>
<img src={img4} alt="" />
行为分析
</p>
<div className={styles.titleRow}>
<p className={styles.titles}>
<img src={img4} alt="" />
行为分析
</p>
<Button
type="primary"
onClick={this.handleDownload}
className={styles.downloadBtn}
>
下载Excel
</Button>
</div>
<div className={styles.box}>
{/* 顶部四个栏目 */}
<div className={styles.row1}>
......
......@@ -187,3 +187,17 @@ export function getTgrData(data) {
});
};
}
//导出证书统计数据
export function getDownload(data, callback) {
const url = `${getUrl}/web-manage/manage/api/eventTrack/export`;
return dispatch => {
return request({
url: url,
data: data,
}).then(res => {
if (callback) {
callback(res);
}
});
};
}
\ No newline at end of file
......@@ -22,6 +22,29 @@
font-weight: 500;
color: #1c1f37;
}
// 添加标题行样式
.titleRow {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
// 下载按钮样式
.downloadBtn {
background: #1890ff;
border-color: #1890ff;
border-radius: 4px;
font-size: 14px;
height: 32px;
padding: 0 15px;
&:hover {
background: #40a9ff;
border-color: #40a9ff;
}
}
.box {
:global {
.ant-select-selection--single {
......
......@@ -12,7 +12,6 @@ if (ROUTER_MODE === "hash") {
} else {
pathname = location.pathname;
}
var self = {
companyCode: pathname.split("/")[1],
siteCode: pathname.split("/")[2],
......
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