From dced87f34c98ad98c882fc5d5c40a724c69e05f7 Mon Sep 17 00:00:00 2001 From: Archer_cdm Date: Wed, 23 Nov 2022 15:19:17 +0800 Subject: [PATCH 1/8] =?UTF-8?q?(*)=E4=BB=A3=E7=A0=81=E8=B5=B0=E6=9F=A5?= =?UTF-8?q?=E5=90=8E=E4=BF=AE=E6=94=B9=E8=B7=AF=E7=94=B1=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/report/index.js | 2 +- api/app/lib/routes/report/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index ccf3581..53c9547 100644 --- a/api/app/lib/controllers/report/index.js +++ b/api/app/lib/controllers/report/index.js @@ -2,7 +2,7 @@ // 查询储备项目统计表 async function getReserveItemReport(ctx, next) { - const { type } = ctx.request.query; + const { type } = ctx.params; let rslt = null; try { rslt = await ctx.fs.dc.models.ReserveItemReport.findAll({ diff --git a/api/app/lib/routes/report/index.js b/api/app/lib/routes/report/index.js index 62b9527..0d4e04f 100644 --- a/api/app/lib/routes/report/index.js +++ b/api/app/lib/routes/report/index.js @@ -3,6 +3,6 @@ const report = require('../../controllers/report'); module.exports = function (app, router, opts) { - app.fs.api.logAttr['GET/getReserveItemReport'] = { content: '查询储备项目统计表', visible: false }; - router.get('/getReserveItemReport', report.getReserveItemReport); + app.fs.api.logAttr['GET/reserveItem/report/:type'] = { content: '查询储备项目统计表', visible: false }; + router.get('/reserveItem/report/:type', report.getReserveItemReport); }; \ No newline at end of file From ab9cd3d053292baf42737a050993b4e3cfbcfe9e Mon Sep 17 00:00:00 2001 From: zhouxin Date: Wed, 23 Nov 2022 15:39:15 +0800 Subject: [PATCH 2/8] =?UTF-8?q?(+)=E5=82=A8=E5=A4=87=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=91=A8=E6=9C=9F=E7=BB=9F=E8=AE=A1=E8=A1=A8table=EF=BC=8C?= =?UTF-8?q?=E5=BE=85=E6=8E=A5=E5=8F=A3=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/business/actions/index.js | 3 +- .../sections/business/actions/reserve-item.js | 13 +++++ .../src/sections/business/actions/service.js | 14 ----- .../src/sections/business/constants/index.js | 5 ++ .../sections/business/containers/pmLog.jsx | 2 +- .../reserveItemsPeriodicStatistics.jsx | 55 ++++++++++++------- web/client/src/utils/webapi.js | 3 +- 7 files changed, 57 insertions(+), 38 deletions(-) create mode 100644 web/client/src/sections/business/actions/reserve-item.js delete mode 100644 web/client/src/sections/business/actions/service.js create mode 100644 web/client/src/sections/business/constants/index.js diff --git a/web/client/src/sections/business/actions/index.js b/web/client/src/sections/business/actions/index.js index 970d06c..bc09861 100644 --- a/web/client/src/sections/business/actions/index.js +++ b/web/client/src/sections/business/actions/index.js @@ -1,5 +1,6 @@ 'use strict'; - +import * as reserveItem from './reserve-item'; export default { + ...reserveItem } \ 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 new file mode 100644 index 0000000..33e1828 --- /dev/null +++ b/web/client/src/sections/business/actions/reserve-item.js @@ -0,0 +1,13 @@ +'use strict'; +import { RouteTable, RouteRequest, ApiTable, basicAction } from '$utils' + +export function getReserveItemReport(type) { + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_RESERVEITEM_REPORT', + url: `${ApiTable.getReserveItemReport.replace('{:type}', type)}`, + msg: { error: '获取储备项目统计信息失败' }, + reducer: { name: 'reserveItemReport' } + }); +} diff --git a/web/client/src/sections/business/actions/service.js b/web/client/src/sections/business/actions/service.js deleted file mode 100644 index 6ec0e10..0000000 --- a/web/client/src/sections/business/actions/service.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -import { RouteTable, RouteRequest } from '$utils' - -export function getServiceUrl() { - return dispatch => { - return RouteRequest.get(RouteTable.getWeeklyService) - .then(res => { - return dispatch({ - type: "SERVER_WEEKLY_URL", - payload: res - }) - }); - } -} \ No newline at end of file diff --git a/web/client/src/sections/business/constants/index.js b/web/client/src/sections/business/constants/index.js new file mode 100644 index 0000000..0d9c9c0 --- /dev/null +++ b/web/client/src/sections/business/constants/index.js @@ -0,0 +1,5 @@ +export const RESERVEITEM_TYPE = { + periodicStatistics: 1, //周期统计 + depSummary: 2, + lostStatistic: 3 +} \ No newline at end of file diff --git a/web/client/src/sections/business/containers/pmLog.jsx b/web/client/src/sections/business/containers/pmLog.jsx index e6106a3..214e321 100644 --- a/web/client/src/sections/business/containers/pmLog.jsx +++ b/web/client/src/sections/business/containers/pmLog.jsx @@ -6,7 +6,7 @@ import { SkeletonScreen } from "$components"; import '../style.less' import { Setup } from "$components"; import moment from 'moment' -import { getServiceUrl } from '../actions/service'; +import { getServiceUrl } from '../actions/reserve-item'; const PMLog = (props) => { const { dispatch, actions, history, user, loading, socket } = props; diff --git a/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx b/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx index 7fa70e0..0d70d7d 100644 --- a/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx +++ b/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx @@ -1,11 +1,16 @@ import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; -import { Select, Input, Button, RadioGroup, Radio, Table } from '@douyinfe/semi-ui'; +import { Select, Input, Spin, Button, RadioGroup, Radio, Table } from '@douyinfe/semi-ui'; import { IconSearch } from '@douyinfe/semi-icons'; +import { RESERVEITEM_TYPE } from '../constants' import '../style.less' import moment from 'moment' const ReserveItemsPeriodicStatistics = (props) => { + const { dispatch, actions, isResquesting, reserveItemReport } = props; + useEffect(() => { + dispatch(actions.businessManagement.getReserveItemReport(RESERVEITEM_TYPE["periodicStatistics"])); + }, []) const columns = [ { title: '序号', @@ -26,24 +31,24 @@ const ReserveItemsPeriodicStatistics = (props) => { render: (text, record, indexe) => () }, ]; - const data = [ - { - key: '1', - name: 'Semi Design 设计稿.fig', - updateTime: '2020-02-02 05:13', - avatarBg: 'grey', - }, - { - key: '2', - name: 'Semi Design 分享演示文稿', - updateTime: '2020-01-17 05:31', - }, - { - key: '3', - name: '设计文档', - updateTime: '2020-01-26 11:01', - }, - ]; + // const data = [ + // { + // key: '1', + // name: 'Semi Design 设计稿.fig', + // updateTime: '2020-02-02 05:13', + // avatarBg: 'grey', + // }, + // { + // key: '2', + // name: 'Semi Design 分享演示文稿', + // updateTime: '2020-01-17 05:31', + // }, + // { + // key: '3', + // name: '设计文档', + // updateTime: '2020-01-26 11:01', + // }, + // ]; return ( <> @@ -66,7 +71,13 @@ const ReserveItemsPeriodicStatistics = (props) => {
- + +
+ @@ -76,10 +87,12 @@ const ReserveItemsPeriodicStatistics = (props) => { function mapStateToProps(state) { - const { auth, global } = state; + const { auth, global, reserveItemReport } = state; return { user: auth.user, actions: global.actions, + reserveItemReport: reserveItemReport.data || [], + isResquesting: reserveItemReport.isResquesting }; } diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 05c141e..11dd619 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -17,7 +17,8 @@ export const ApiTable = { logout: "logout", //项目报表 - + getReserveItemReport: "/reserveItem/report/:type" + }; export const RouteTable = { apiRoot: "/api/root", From 6069793553902c33efeeb49f62b2007b48e8b1b8 Mon Sep 17 00:00:00 2001 From: Archer_cdm Date: Wed, 23 Nov 2022 16:08:32 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=EF=BC=88*=EF=BC=89=E5=B0=86=E5=B9=B4?= =?UTF-8?q?=E6=9C=88=E6=8B=BC=E6=8E=A5=E8=BF=94=E5=9B=9E=E7=BB=99=E5=89=8D?= =?UTF-8?q?=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/report/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index 53c9547..5562e2f 100644 --- a/api/app/lib/controllers/report/index.js +++ b/api/app/lib/controllers/report/index.js @@ -9,8 +9,16 @@ async function getReserveItemReport(ctx, next) { order: [['year', 'DESC'], ['month', 'DESC']], where: { type: type } }) + let newReportData = rslt.map(e => { + return { + id: e.id, + date: e.year + '-' + e.month, + path: e.path, + type: e.type + } + }) ctx.status = 200 - ctx.body = rslt + ctx.body = newReportData } catch (error) { ctx.fs.logger.error(`path:${ctx.path},error:${error}`) ctx.status = 400; From dac86147b438f95df9f86bf850b630f9cd8c6978 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Wed, 23 Nov 2022 16:09:29 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=EF=BC=88*=EF=BC=89=E5=82=A8=E5=A4=87?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=91=A8=E6=9C=9F=E7=BB=9F=E8=AE=A1=E8=A1=A8?= =?UTF-8?q?debug=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 20 ++++++----- .../sections/business/actions/reserve-item.js | 2 +- .../reserveItemsPeriodicStatistics.jsx | 36 +++++-------------- web/client/src/utils/webapi.js | 2 +- 4 files changed, 22 insertions(+), 38 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index a1edc07..21c6934 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -15,31 +15,33 @@ "args": [ "-p 4700", // "-f http://localhost:4700", - // 研发 - "-g postgres://postgres:123456@10.8.16.184:5432/ReportCenter", + //南昌研发开始 + // "-g postgres://postgres:123456@10.8.16.184:5432/ReportCenter", + // "--redisHost localhost", + // "--redisPort 6378", + // "--apiEmisUrl http://localhost:4000", + //南昌研发结束 + // 镇江研发开始 + "-g postgres://FashionAdmin:123456@10.8.30.36:5432/data_center", "--redisHost localhost", - "--redisPort 6378", - // "--apiEmisUrl http://10.8.30.112:14000", + "--redisPort 6379", + "--apiEmisUrl http://localhost:14000", + // 镇江研发结束 // 测试 - "--apiEmisUrl http://localhost:4000", "--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5", "--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa", "--qnbkt dev-hr", // "--qndmn http://resources.anxinyun.cn", "--qndmn http://rjkwed13l.hn-bkt.clouddn.com", - // 似乎不能传空 先注释 * 2 // "--clickHouseUser ", // "--clickHousePassword ", - "--clickHousePort 30123", - // 开发 // "--clickHouseUrl http://10.8.30.71", // "--clickHousePepEmis pepca_dev", // "--clickHouseCamworkflow camworkflow", // "--clickHouseHr hr_dev", - // 测试 "--clickHouseUrl http://10.8.16.221", "--clickHousePepEmis pg_pepca", diff --git a/web/client/src/sections/business/actions/reserve-item.js b/web/client/src/sections/business/actions/reserve-item.js index 33e1828..a2b14aa 100644 --- a/web/client/src/sections/business/actions/reserve-item.js +++ b/web/client/src/sections/business/actions/reserve-item.js @@ -6,7 +6,7 @@ export function getReserveItemReport(type) { type: 'get', dispatch: dispatch, actionType: 'GET_RESERVEITEM_REPORT', - url: `${ApiTable.getReserveItemReport.replace('{:type}', type)}`, + url: `${ApiTable.getReserveItemReport.replace('{type}', type)}`, msg: { error: '获取储备项目统计信息失败' }, reducer: { name: 'reserveItemReport' } }); diff --git a/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx b/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx index 0d70d7d..ed27c82 100644 --- a/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx +++ b/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx @@ -4,12 +4,11 @@ import { Select, Input, Spin, Button, RadioGroup, Radio, Table } from '@douyinfe import { IconSearch } from '@douyinfe/semi-icons'; import { RESERVEITEM_TYPE } from '../constants' import '../style.less' -import moment from 'moment' const ReserveItemsPeriodicStatistics = (props) => { - const { dispatch, actions, isResquesting, reserveItemReport } = props; + const { dispatch, actions, isRequesting, reserveItemReport } = props; useEffect(() => { - dispatch(actions.businessManagement.getReserveItemReport(RESERVEITEM_TYPE["periodicStatistics"])); + dispatch(actions.businessManagement.getReserveItemReport(RESERVEITEM_TYPE.periodicStatistics)); }, []) const columns = [ { @@ -19,11 +18,11 @@ const ReserveItemsPeriodicStatistics = (props) => { }, { title: '时间', - dataIndex: 'updateTime', + dataIndex: 'year', }, { title: '名称', - dataIndex: 'name', + dataIndex: 'path', }, { title: '操作', @@ -31,24 +30,6 @@ const ReserveItemsPeriodicStatistics = (props) => { render: (text, record, indexe) => () }, ]; - // const data = [ - // { - // key: '1', - // name: 'Semi Design 设计稿.fig', - // updateTime: '2020-02-02 05:13', - // avatarBg: 'grey', - // }, - // { - // key: '2', - // name: 'Semi Design 分享演示文稿', - // updateTime: '2020-01-17 05:31', - // }, - // { - // key: '3', - // name: '设计文档', - // updateTime: '2020-01-26 11:01', - // }, - // ]; return ( <> @@ -70,12 +51,13 @@ const ReserveItemsPeriodicStatistics = (props) => {
-
- +
+
@@ -92,7 +74,7 @@ function mapStateToProps(state) { user: auth.user, actions: global.actions, reserveItemReport: reserveItemReport.data || [], - isResquesting: reserveItemReport.isResquesting + isRequesting: reserveItemReport.isRequesting }; } diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 11dd619..2521a9b 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -17,7 +17,7 @@ export const ApiTable = { logout: "logout", //项目报表 - getReserveItemReport: "/reserveItem/report/:type" + getReserveItemReport: "/reserveItem/report/{type}" }; export const RouteTable = { From eaea7fbd590cd1a5fde03957fb3f7e5362fb5a08 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Wed, 23 Nov 2022 17:58:36 +0800 Subject: [PATCH 5/8] =?UTF-8?q?(*)=E6=96=87=E4=BB=B6=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=EF=BC=8C=E4=B8=83=E7=89=9B=E8=BF=94=E5=9B=9E400=EF=BC=8C?= =?UTF-8?q?=E5=BE=85=E6=9F=A5=E7=9C=8B=EF=BC=9B=20api=E8=AF=B7=E6=B1=82401?= =?UTF-8?q?=EF=BC=8C=E5=BE=85=E6=8E=92=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/business/actions/reserve-item.js | 6 ++--- .../reserveItemsPeriodicStatistics.jsx | 23 +++++++++++++++---- web/client/src/utils/webapi.js | 7 +++--- web/package.json | 2 +- web/routes/attachment/index.js | 22 ++++++++++++++++++ 5 files changed, 48 insertions(+), 12 deletions(-) diff --git a/web/client/src/sections/business/actions/reserve-item.js b/web/client/src/sections/business/actions/reserve-item.js index a2b14aa..bbe720f 100644 --- a/web/client/src/sections/business/actions/reserve-item.js +++ b/web/client/src/sections/business/actions/reserve-item.js @@ -1,13 +1,13 @@ 'use strict'; -import { RouteTable, RouteRequest, ApiTable, basicAction } from '$utils' +import { RouteTable, RouteRequest, ApiTable, basicAction } from '$utils'; export function getReserveItemReport(type) { return dispatch => basicAction({ type: 'get', dispatch: dispatch, actionType: 'GET_RESERVEITEM_REPORT', - url: `${ApiTable.getReserveItemReport.replace('{type}', type)}`, + url: `${ApiTable.getReserveItemReport.replace('{type}', type)}?token=9c62cd15-967f-42dc-a2fd-f79411dfad55`, msg: { error: '获取储备项目统计信息失败' }, reducer: { name: 'reserveItemReport' } }); -} +} \ No newline at end of file diff --git a/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx b/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx index ed27c82..aa015f8 100644 --- a/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx +++ b/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx @@ -2,14 +2,25 @@ import React, { useEffect, useState } from 'react'; import { connect } from 'react-redux'; import { Select, Input, Spin, Button, RadioGroup, Radio, Table } from '@douyinfe/semi-ui'; import { IconSearch } from '@douyinfe/semi-icons'; -import { RESERVEITEM_TYPE } from '../constants' +import { RouteRequest, RouteTable } from '$utils'; +import { RESERVEITEM_TYPE } from '../constants'; import '../style.less' const ReserveItemsPeriodicStatistics = (props) => { const { dispatch, actions, isRequesting, reserveItemReport } = props; useEffect(() => { dispatch(actions.businessManagement.getReserveItemReport(RESERVEITEM_TYPE.periodicStatistics)); - }, []) + }, []); + + const exportReport = () => { + RouteRequest.get(RouteTable.qnDownload).then(res => { + debugger; + console.log(res); + // setDownloadUrl(`members/export?token=${user.token}&state=${typeChoose}&keywordTarget=${keywordTarget}&keyword=${keyword}&keys=overtimeStatistic,vacateStatistic`) + }) + + } + const columns = [ { title: '序号', @@ -18,7 +29,7 @@ const ReserveItemsPeriodicStatistics = (props) => { }, { title: '时间', - dataIndex: 'year', + dataIndex: 'date', }, { title: '名称', @@ -27,7 +38,7 @@ const ReserveItemsPeriodicStatistics = (props) => { { title: '操作', dataIndex: 'action', - render: (text, record, indexe) => () + render: (text, record, indexe) => () }, ]; @@ -50,7 +61,9 @@ const ReserveItemsPeriodicStatistics = (props) => {
- + {/* { + downloadUrl ?