ww664853070 2 years ago
parent
commit
a3cb3684a6
  1. 37
      README.md
  2. 3
      api/app/lib/controllers/report/index.js
  3. 5
      api/app/lib/models/reserveItemReport.js
  4. 2
      web/client/src/sections/business/containers/reserveItemsDepSummary.jsx
  5. 2
      web/client/src/sections/business/containers/reserveItemsLostStatistics.jsx
  6. 2
      web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx
  7. 23
      web/routes/attachment/index.js

37
README.md

@ -1,3 +1,38 @@
# 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 库名
```

3
api/app/lib/controllers/report/index.js

@ -14,7 +14,8 @@ async function getReserveItemReport(ctx, next) {
id: e.id,
date: e.year + '-' + e.month,
path: e.path,
type: e.type
type: e.type,
name: e.name
}
})
ctx.status = 200

5
api/app/lib/models/reserveItemReport.js

@ -31,6 +31,11 @@ module.exports = dc => {
type: DataTypes.STRING,
allowNull: true,
field: "type",
},
name: {
type: DataTypes.STRING,
allowNull: false,
field: "name",
}
}, {
tableName: "reserve_item_report",

2
web/client/src/sections/business/containers/reserveItemsDepSummary.jsx

@ -28,7 +28,7 @@ const ReserveItemsDepSummary = (props) => {
},
{
title: '名称',
dataIndex: 'path',
dataIndex: 'name',
},
{
title: '操作',

2
web/client/src/sections/business/containers/reserveItemsLostStatistics.jsx

@ -28,7 +28,7 @@ const ReserveItemsLostStatistics = (props) => {
},
{
title: '名称',
dataIndex: 'path',
dataIndex: 'name',
},
{
title: '操作',

2
web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx

@ -29,7 +29,7 @@ const ReserveItemsPeriodicStatistics = (props) => {
},
{
title: '名称',
dataIndex: 'path',
dataIndex: 'name',
},
{
title: '操作',

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) {
try {
const { token } = ctx.request.query
@ -130,7 +108,6 @@ module.exports = {
router.use(download);
router.get('/api/root', getApiRoot);
router.post('/file/qiniu/upload', upload);
router.get('/file/qiniu/download', qnDownload);
router.post('/file/qiniu/remove', remove);
}
};

Loading…
Cancel
Save