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",