From e7cc216d7d5973c7dcaa396f42b0b9fbde28879c Mon Sep 17 00:00:00 2001 From: zhouxin Date: Thu, 24 Nov 2022 10:13:49 +0800 Subject: [PATCH 1/4] =?UTF-8?q?(-=EF=BC=89=E5=8E=BB=E6=8E=89=E5=BA=9F?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 23 ++++++++++++++++++++++- web/client/src/utils/webapi.js | 1 - web/routes/attachment/index.js | 23 ----------------------- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 5b07b6a..0790a88 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,24 @@ # ReportCenter -项企-报表中心 \ No newline at end of file +项企-报表中心 +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库名 \ No newline at end of file diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 8a33b8d..1a1b3c4 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -25,5 +25,4 @@ export const RouteTable = { fileUpload: "/_upload/new", cleanUpUploadTrash: "/_upload/cleanup", getWeeklyService: '/_service/weekly', - qnDownload:'/file/qiniu/download' }; diff --git a/web/routes/attachment/index.js b/web/routes/attachment/index.js index 8cf9aa8..b289c62 100644 --- a/web/routes/attachment/index.js +++ b/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); } }; From 805d2c585c453051d67caf2246c3241c2f543770 Mon Sep 17 00:00:00 2001 From: Archer_cdm Date: Thu, 24 Nov 2022 10:14:54 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=EF=BC=88*=EF=BC=89=E5=A2=9E=E5=8A=A0name?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=96=87=E4=BB=B6=E5=90=8D=20=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9api=E6=8E=A5=E5=8F=A3=E5=92=8Cweb=E5=8F=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/report/index.js | 3 ++- api/app/lib/models/reserveItemReport.js | 5 +++++ .../sections/business/containers/reserveItemsDepSummary.jsx | 2 +- .../business/containers/reserveItemsLostStatistics.jsx | 2 +- .../business/containers/reserveItemsPeriodicStatistics.jsx | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index 5562e2f..930fd12 100644 --- a/api/app/lib/controllers/report/index.js +++ b/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 diff --git a/api/app/lib/models/reserveItemReport.js b/api/app/lib/models/reserveItemReport.js index 532f1a7..67a9970 100644 --- a/api/app/lib/models/reserveItemReport.js +++ b/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", diff --git a/web/client/src/sections/business/containers/reserveItemsDepSummary.jsx b/web/client/src/sections/business/containers/reserveItemsDepSummary.jsx index bf9a4bc..527a650 100644 --- a/web/client/src/sections/business/containers/reserveItemsDepSummary.jsx +++ b/web/client/src/sections/business/containers/reserveItemsDepSummary.jsx @@ -28,7 +28,7 @@ const ReserveItemsDepSummary = (props) => { }, { title: '名称', - dataIndex: 'path', + dataIndex: 'name', }, { title: '操作', diff --git a/web/client/src/sections/business/containers/reserveItemsLostStatistics.jsx b/web/client/src/sections/business/containers/reserveItemsLostStatistics.jsx index a0aea31..0d7d634 100644 --- a/web/client/src/sections/business/containers/reserveItemsLostStatistics.jsx +++ b/web/client/src/sections/business/containers/reserveItemsLostStatistics.jsx @@ -28,7 +28,7 @@ const ReserveItemsLostStatistics = (props) => { }, { title: '名称', - dataIndex: 'path', + dataIndex: 'name', }, { title: '操作', diff --git a/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx b/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx index bbc9346..63aa7fa 100644 --- a/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx +++ b/web/client/src/sections/business/containers/reserveItemsPeriodicStatistics.jsx @@ -29,7 +29,7 @@ const ReserveItemsPeriodicStatistics = (props) => { }, { title: '名称', - dataIndex: 'path', + dataIndex: 'name', }, { title: '操作', From fd433c289b585b3568b4de7b5a6c6b675fd52bae Mon Sep 17 00:00:00 2001 From: zhouxin Date: Thu, 24 Nov 2022 10:32:27 +0800 Subject: [PATCH 3/4] =?UTF-8?q?(*)=E7=95=A5=E5=BE=AE=E7=BE=8E=E5=8C=96read?= =?UTF-8?q?me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0790a88..27014d0 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,21 @@ # ReportCenter 项企-报表中心 -api启动环境变量 +## api启动环境变量 + +### Redis -//Redis IOTA_REDIS_SERVER_HOST IOTA_REDIS_SERVER_PORT IOTA_REDIS_SERVER_PWD - -API_EMIS_URL //企业管理api - -//七牛 +### 企业管理 +API_EMIS_URL //api +### 七牛 ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE ANXINCLOUD_QINIU_BUCKET_RESOURCE ANXINCLOUD_QINIU_ACCESSKEY ANXINCLOUD_QINIU_SECRETKEY - -//clickHouse +### clickHouse CLICKHOUST_URL CLICKHOUST_PORT CLICKHOUST_USER From 2d1ac55d59cfb222b2cb1bfa92920af3f2ad3f82 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Thu, 24 Nov 2022 10:38:10 +0800 Subject: [PATCH 4/4] =?UTF-8?q?(*)readme=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 27014d0..4d7cc93 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,38 @@ # ReportCenter 项企-报表中心 -## api启动环境变量 + +## api 启动环境变量 ### Redis +``` IOTA_REDIS_SERVER_HOST IOTA_REDIS_SERVER_PORT IOTA_REDIS_SERVER_PWD +``` + ### 企业管理 -API_EMIS_URL //api + +``` +API_EMIS_URL //api +``` + ### 七牛 + +``` ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE ANXINCLOUD_QINIU_BUCKET_RESOURCE ANXINCLOUD_QINIU_ACCESSKEY ANXINCLOUD_QINIU_SECRETKEY -### clickHouse +``` + +### clickHouse + +``` CLICKHOUST_URL CLICKHOUST_PORT CLICKHOUST_USER CLICKHOUST_PASSWORD -CLICKHOUST_PEP_EMIS //clickhouse的emis库名 \ No newline at end of file +CLICKHOUST_PEP_EMIS //clickhouse 的 emis 库名 +```