From 021563b5b7a9da43bf365092755fcd46857ab7f7 Mon Sep 17 00:00:00 2001 From: zhaobing Date: Fri, 14 Jul 2023 16:07:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=9C=A8=E5=BB=BA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/data/index.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/api/app/lib/controllers/data/index.js b/api/app/lib/controllers/data/index.js index 3ddb0d82..7efc18da 100644 --- a/api/app/lib/controllers/data/index.js +++ b/api/app/lib/controllers/data/index.js @@ -6,6 +6,7 @@ const request = require('superagent'); async function dataExport(ctx) { try { + let tableAttributesCopy = {} const models = ctx.fs.dc.models; const { userId } = ctx.fs.api const { exp, ids, roadLevel, municipalType, @@ -36,7 +37,7 @@ async function dataExport(ctx) { tableName: 'MunicipalBusiness', }, { - n: '工程一览', + n: '在建项目', k: 'project', tableName: 'Project', }, @@ -87,8 +88,20 @@ async function dataExport(ctx) { const exportData = await models[modalOption.tableName].findAll(findOption) const tableAttributes = models[modalOption.tableName].tableAttributes + //过滤project部门字段 + if (modalOption.tableName === 'Project') { + const { entryName, projectMileage, investment, buildUnit, + constructionControlUnit, designUnit, constructionUnit, qutityUnit, startTime, remark } = tableAttributes + tableAttributesCopy = { + entryName, projectMileage, investment, buildUnit, + constructionControlUnit, designUnit, constructionUnit, qutityUnit, startTime, remark + } + } else { + tableAttributesCopy = tableAttributes + } + let header = [] - for (let k in tableAttributes) { + for (let k in tableAttributesCopy) { let comment = tableAttributes[k].comment if (k != 'id' && comment) { if (comment == '品名' && municipalType == '出租车') {