diff --git a/README.md b/README.md index 4d7cc93..f23f8b2 100644 --- a/README.md +++ b/README.md @@ -36,3 +36,7 @@ CLICKHOUST_USER CLICKHOUST_PASSWORD CLICKHOUST_PEP_EMIS //clickhouse 的 emis 库名 ``` +### 后端服务 +``` +ANXINCLOUD_PM_SERVICES //郑兴写的后端服务地址 +``` \ No newline at end of file diff --git a/web/client/src/sections/business/actions/reserve-item.js b/web/client/src/sections/business/actions/reserve-item.js index 98ec974..6cf0cff 100644 --- a/web/client/src/sections/business/actions/reserve-item.js +++ b/web/client/src/sections/business/actions/reserve-item.js @@ -12,13 +12,14 @@ export function getReserveItemReport(type) { }); } -export function getFilingReport(type) { - return dispatch => basicAction({ - type: 'get', - dispatch: dispatch, - actionType: 'GET_FILING_REPORT', - url: `${ApiTable.getFilingReport}`, - msg: { error: '获取储备项目报备表失败' }, - reducer: { name: 'filingReport' } - }); +export function getFilingReport() { + return dispatch => { + return RouteRequest.get(RouteTable.getServiceUrl) + .then(res => { + return dispatch({ + type: "SERVER_PMREPORT_URL", + payload: res + }) + }); + } } \ No newline at end of file diff --git a/web/client/src/sections/business/containers/reserveItemsReporting.jsx b/web/client/src/sections/business/containers/reserveItemsReporting.jsx index 08552c6..0b0027a 100644 --- a/web/client/src/sections/business/containers/reserveItemsReporting.jsx +++ b/web/client/src/sections/business/containers/reserveItemsReporting.jsx @@ -1,11 +1,14 @@ import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; -import { Select, Input, Button, RadioGroup, Radio, Tooltip, Table } from '@douyinfe/semi-ui'; +import { Select, Input, Button, Banner, Radio, Tooltip, Table } from '@douyinfe/semi-ui'; import { IconSearch } from '@douyinfe/semi-icons'; import '../style.less' import moment from 'moment' const ReserveItemsReporting = (props) => { + const [downloadUrl, setDownloadUrl] = useState(null); + const [warningBanner, setWarningBanner] = useState(null); + const columns = [ { title: '序号', @@ -67,11 +70,18 @@ const ReserveItemsReporting = (props) => { }, ]; const data = []; - const exportAll = () => { const { dispatch, actions } = props; - dispatch(actions.businessManagement.getFilingReport()); + dispatch(actions.businessManagement.getFilingReport()).then(res => { + const { payload } = res; + if (payload && payload.url) { + setDownloadUrl(`${payload.url}/week_report/reserve`); + } else { + setWarningBanner("导出地址有误,导出失败"); + } + }); } + return ( <>
@@ -90,6 +100,13 @@ const ReserveItemsReporting = (props) => {
REPORT FORM OF RESERVE ITEMS
+ { + warningBanner && + ( setWarningBanner(null)} + />)}
{/*
} @@ -108,6 +125,7 @@ const ReserveItemsReporting = (props) => { // } // }) }}>查询 */} +
@@ -115,6 +133,9 @@ const ReserveItemsReporting = (props) => { + { + downloadUrl ?