Browse Source

(+)储备项目周期统计表table,待接口调试

master
周沫沫历险记 2 years ago
parent
commit
ab9cd3d053
  1. 3
      web/client/src/sections/business/actions/index.js
  2. 13
      web/client/src/sections/business/actions/reserve-item.js
  3. 14
      web/client/src/sections/business/actions/service.js
  4. 5
      web/client/src/sections/business/constants/index.js
  5. 2
      web/client/src/sections/business/containers/pmLog.jsx
  6. 55
      web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx
  7. 1
      web/client/src/utils/webapi.js

3
web/client/src/sections/business/actions/index.js

@ -1,5 +1,6 @@
'use strict';
import * as reserveItem from './reserve-item';
export default {
...reserveItem
}

13
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' }
});
}

14
web/client/src/sections/business/actions/service.js

@ -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
})
});
}
}

5
web/client/src/sections/business/constants/index.js

@ -0,0 +1,5 @@
export const RESERVEITEM_TYPE = {
periodicStatistics: 1, //周期统计
depSummary: 2,
lostStatistic: 3
}

2
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;

55
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) => (<Button theme='solid' type='secondary'>导出</Button>)
},
];
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) => {
<div style={{ borderBottom: '1px solid #F2F3F5', marginLeft: '-20px', marginBottom: 16 }}></div>
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 22 }}>
<Table columns={columns} dataSource={data} pagination={false} />
<Spin spinning={isResquesting}>
<Table
columns={columns}
dataSource={reserveItemReport}
// pagination={false}
/>
</Spin>
</div>
</div>
</div>
@ -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
};
}

1
web/client/src/utils/webapi.js

@ -17,6 +17,7 @@ export const ApiTable = {
logout: "logout",
//项目报表
getReserveItemReport: "/reserveItem/report/:type"
};
export const RouteTable = {

Loading…
Cancel
Save