Archer_cdm 2 years ago
parent
commit
5ecfd8d89c
  1. 23
      README.md
  2. 83
      web/client/src/sections/business/containers/reserveItemsReporting.jsx
  3. 1
      web/client/src/utils/webapi.js
  4. 23
      web/routes/attachment/index.js

23
README.md

@ -1,3 +1,24 @@
# ReportCenter # ReportCenter
项企-报表中心 项企-报表中心
api启动环境变量
//Redis
IOTA_REDIS_SERVER_HOST
IOTA_REDIS_SERVER_PORT
IOTA_REDIS_SERVER_PWD
API_EMIS_URL //企业管理api
//七牛
ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE
ANXINCLOUD_QINIU_BUCKET_RESOURCE
ANXINCLOUD_QINIU_ACCESSKEY
ANXINCLOUD_QINIU_SECRETKEY
//clickHouse
CLICKHOUST_URL
CLICKHOUST_PORT
CLICKHOUST_USER
CLICKHOUST_PASSWORD
CLICKHOUST_PEP_EMIS //clickhouse的emis库名

83
web/client/src/sections/business/containers/reserveItemsReporting.jsx

@ -1,12 +1,76 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Select, Input, Button, RadioGroup, Radio, Tooltip } from '@douyinfe/semi-ui'; import { Select, Input, Button, RadioGroup, Radio, Tooltip, Table } from '@douyinfe/semi-ui';
import { IconSearch } from '@douyinfe/semi-icons'; import { IconSearch } from '@douyinfe/semi-icons';
import '../style.less' import '../style.less'
import moment from 'moment' import moment from 'moment'
const ReserveItemsReporting = (props) => { const ReserveItemsReporting = (props) => {
const columns = [
{
title: '序号',
dataIndex: 'index',
render: (text, record, index) => index + 1
},
{
title: '部门',
dataIndex: 'updateTime',
},
{
title: '销售经理',
dataIndex: 'name',
},
{
title: '项目名称',
dataIndex: 'updateTime',
},
{
title: '客户名称',
dataIndex: 'name',
},
{
title: '项目类型',
dataIndex: 'updateTime',
},
{
title: '项目状态',
dataIndex: 'name',
},
{
title: '项目描述',
dataIndex: 'updateTime',
},
{
title: '初次提交时间',
dataIndex: 'name',
},
{
title: '储备项目周期',
dataIndex: 'updateTime',
},
{
title: '最新更新时间',
dataIndex: 'name',
},
{
title: '最近拜访时间',
dataIndex: 'updateTime',
},
{
title: '拜访间隔周期(天)',
dataIndex: 'name',
},
{
title: '操作',
dataIndex: 'action',
render: (text, record, indexe) => (<Button theme='solid' type='secondary'>导出</Button>)
},
];
const data = [];
const exportAll = () => {
alert(123)
}
return ( return (
<> <>
<div style={{ padding: '0px 12px' }}> <div style={{ padding: '0px 12px' }}>
@ -26,7 +90,7 @@ const ReserveItemsReporting = (props) => {
</div> </div>
</div> </div>
<div style={{ display: 'flex', marginTop: 16, marginBottom: 17 }}> <div style={{ display: 'flex', marginTop: 16, marginBottom: 17 }}>
<div style={{ marginLeft: 12, marginRight: 18 }}> {/* <div style={{ marginLeft: 12, marginRight: 18 }}>
<Input suffix={<IconSearch />} <Input suffix={<IconSearch />}
showClear showClear
placeholder='请输入或选择关键词' placeholder='请输入或选择关键词'
@ -42,16 +106,13 @@ const ReserveItemsReporting = (props) => {
// setArchivesList(res.payload.data.rows) // setArchivesList(res.payload.data.rows)
// } // }
// }) // })
}}>查询</Button> }}>查询</Button> */}
</div> <Button theme='solid' type='secondary' style={{ width: 80, borderRadius: 2, marginLeft: 15 }}
<div style={{ borderBottom: '1px solid #F2F3F5', marginLeft: '-20px', marginBottom: 16 }}></div> onClick={exportAll}>导出全部</Button>
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 22 }}>
<div style={{ display: 'flex', }}>
<div style={{ color: '#646566', fontSize: 14 }}>
当前显示
</div>
</div>
</div> </div>
<div style={{ borderBottom: '1px solid #F2F3F5', marginBottom: 16 }}></div>
<Table columns={columns} dataSource={data} pagination={false} />
</div> </div>
</div> </div>
</> </>

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

@ -25,5 +25,4 @@ export const RouteTable = {
fileUpload: "/_upload/new", fileUpload: "/_upload/new",
cleanUpUploadTrash: "/_upload/cleanup", cleanUpUploadTrash: "/_upload/cleanup",
getWeeklyService: '/_service/weekly', getWeeklyService: '/_service/weekly',
qnDownload:'/file/qiniu/download'
}; };

23
web/routes/attachment/index.js

@ -82,28 +82,6 @@ module.exports = {
} }
} }
} }
let qnDownload = async function (ctx, next) {
try {
const { src, filename } = ctx.query;
const fkey = src.replace(/\.json$/, '.js');
console.log("qnDownload->fkey: ", fkey);
const publicDownloadUrl = await ctx.app.fs.attachment.download(fkey);
if (filename) {
// download
ctx.attachment(filename);
} else {
// display
if (/\.(png)|(jpg)|(jpeg)|(gif)$/g.test(src.toLowerCase())) ctx.type = 'image/png';
}
ctx.status = 200;
ctx.body = request.get(publicDownloadUrl);
} catch (err) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${err}`);
ctx.status = 400;
ctx.body = { name: 'FindError', message: '附件下载失败' };
}
}
let remove = async function (ctx, next) { let remove = async function (ctx, next) {
try { try {
const { token } = ctx.request.query const { token } = ctx.request.query
@ -130,7 +108,6 @@ module.exports = {
router.use(download); router.use(download);
router.get('/api/root', getApiRoot); router.get('/api/root', getApiRoot);
router.post('/file/qiniu/upload', upload); router.post('/file/qiniu/upload', upload);
router.get('/file/qiniu/download', qnDownload);
router.post('/file/qiniu/remove', remove); router.post('/file/qiniu/remove', remove);
} }
}; };

Loading…
Cancel
Save