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 ? : ''
+ }
>
)
diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js
index c57cb87..1dced9c 100644
--- a/web/client/src/utils/webapi.js
+++ b/web/client/src/utils/webapi.js
@@ -18,13 +18,11 @@ export const ApiTable = {
//项目报表
getReserveItemReport: "reserveItem/report/{type}",
- getFilingReport:'/week_report/reserve',
};
export const RouteTable = {
apiRoot: "/api/root",
fileUpload: "/_upload/new",
cleanUpUploadTrash: "/_upload/cleanup",
- getWeeklyService: '/_service/weekly',
- qnDownload:'/file/qiniu/download',
+ getServiceUrl: '/_service/url'
};
diff --git a/web/config.js b/web/config.js
index 6d9fe0d..205f0ad 100644
--- a/web/config.js
+++ b/web/config.js
@@ -18,6 +18,7 @@ args.option('qnak', 'qiniuAccessKey');
args.option('qnsk', 'qiniuSecretKey');
args.option('qnbkt', 'qiniuBucket');
args.option('qndmn', 'qiniuDomain');
+args.option('pmrs', 'pmReportService');
//基本动作-周报后端服务
args.option('wkys', 'weeklyServices');
@@ -33,7 +34,7 @@ const ANXINCLOUD_QINIU_SK = process.env.ANXINCLOUD_QINIU_SECRETKEY || flags.qnsk
const ANXINCLOUD_QINIU_BUCKET_RESOURCE = process.env.ANXINCLOUD_QINIU_BUCKET_RESOURCE || flags.qnbkt;
const ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE = process.env.ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE || flags.qndmn;
//后端服务
-const ANXINCLOUD_WEEKLY_SERVICES = process.env.ANXINCLOUD_WEEKLY_SERVICES || flags.wkys; //周报统计服务
+const ANXINCLOUD_PM_SERVICES = process.env.ANXINCLOUD_PM_SERVICES || flags.pmrs;
if (
@@ -77,7 +78,7 @@ const product = {
domain: ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE
},
service: {
- weekly: ANXINCLOUD_WEEKLY_SERVICES
+ url: ANXINCLOUD_PM_SERVICES
}
}
}, {
@@ -111,10 +112,10 @@ if (dev) {
staticDirs: product.staticDirs,
mws: product.mws
.concat([
- {
- entry: require('./middlewares/webpack-dev').entry,
- opts: {}
- }
+ {
+ entry: require('./middlewares/webpack-dev').entry,
+ opts: {}
+ }
])
,
logger: product.logger
diff --git a/web/package.json b/web/package.json
index af8f509..a9521a2 100644
--- a/web/package.json
+++ b/web/package.json
@@ -7,7 +7,7 @@
"test": "mocha",
"start-vite": "cross-env NODE_ENV=developmentVite npm run start-params",
"start": "cross-env NODE_ENV=development npm run start-params",
- "start-params": "node server -p 5700 -u http://localhost:4700 --apiHrUrl http://localhost:4700 --qnak 5XrM4wEB9YU6RQwT64sPzzE6cYFKZgssdP5Kj3uu --qnsk w6j2ixR_i-aelc6I7S3HotKIX-ukMzcKmDfH6-M5 --qnbkt pep-process-report --qndmn https://pepsource.anxinyun.cn --wkys http://10.8.30.109:14000",
+ "start-params": "node server -p 5700 -u http://localhost:4700 --apiHrUrl http://localhost:4700 --qnak 5XrM4wEB9YU6RQwT64sPzzE6cYFKZgssdP5Kj3uu --qnsk w6j2ixR_i-aelc6I7S3HotKIX-ukMzcKmDfH6-M5 --qnbkt pep-process-report --qndmn https://pepsource.anxinyun.cn --pmrs http://10.8.30.109:14000",
"deploy": "export NODE_ENV=production&& npm run build && node server",
"build-dev": "cross-env NODE_ENV=development&&webpack --config webpack.config.js",
"build": "cross-env NODE_ENV=production&&webpack --config webpack.config.prod.js"
diff --git a/web/routes/services/index.js b/web/routes/services/index.js
new file mode 100644
index 0000000..4676d26
--- /dev/null
+++ b/web/routes/services/index.js
@@ -0,0 +1,17 @@
+'use strict';
+
+module.exports = {
+ entry: function (app, router, opts) {
+
+ const getServiceUrl = async function (ctx) {
+ const { service } = opts;
+
+ ctx.status = 200;
+ ctx.body = {
+ url: service.url,
+ };
+ };
+
+ router.get('/_service/url', getServiceUrl);
+ }
+};