巴林闲侠 1 year ago
parent
commit
67cf0d8ce2
  1. 17
      api/app/lib/controllers/data/index.js

17
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 == '出租车') {

Loading…
Cancel
Save