|
|
@ -183,18 +183,27 @@ class FinancialStore {
|
|
|
|
const NotEmptyRows = json.result.filter(ele => ele.groupsLabel !== '' && ele.groupsLabel !== '未知');
|
|
|
|
const NotEmptyRows = json.result.filter(ele => ele.groupsLabel !== '' && ele.groupsLabel !== '未知');
|
|
|
|
const sumNotEmptyRows = sumFun(NotEmptyRows, 'sumNotEmptyRows');
|
|
|
|
const sumNotEmptyRows = sumFun(NotEmptyRows, 'sumNotEmptyRows');
|
|
|
|
|
|
|
|
|
|
|
|
const result = NotEmptyRows.map((row) => ({...row, ...percentRow(row, sumNotEmptyRows)})).map((row) => {
|
|
|
|
const result = NotEmptyRows.map((row) => ({...row, ...percentRow(row, sumNotEmptyRows)})).sort(comm.sortBy('orgz')).reverse().map((row) => {
|
|
|
|
const newData = ['orgz', 'orgzPDays', 'hosts', 'hostsPDays'].reduce(
|
|
|
|
const newData = ['orgz', 'orgzPDays', 'hosts', 'hostsPDays'].reduce(
|
|
|
|
(r, skey) => ({ ...r, [skey]: row[`${skey}Percent`] ? row[skey] + comm.fixToInt(sumEmptyResult[skey] * row[`${skey}Percent`]) : row[skey] }),
|
|
|
|
(r, skey) => ({ ...r, [skey]: row[`${skey}Percent`] ? row[skey] + comm.fixToInt(sumEmptyResult[skey] * row[`${skey}Percent`]) : row[skey] }),
|
|
|
|
row
|
|
|
|
row
|
|
|
|
);
|
|
|
|
);
|
|
|
|
return newData;
|
|
|
|
return newData;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
const sumAfter = sumFun(result, 'sumAfter');
|
|
|
|
|
|
|
|
const diffSum = ['orgz', 'orgzPDays', 'hosts', 'hostsPDays'].reduce((r, skey) => ({ ...r, [skey]: sumResult[skey]-sumAfter[skey]}), {});
|
|
|
|
|
|
|
|
const result0 = ['orgz', 'orgzPDays', 'hosts', 'hostsPDays'].reduce((r, skey) => ({...r, [skey]: (result?.[0]?.[skey] || 0)+(diffSum?.[skey] || 0)}), {});
|
|
|
|
|
|
|
|
result[0] = { ...result[0], ...result0 };
|
|
|
|
|
|
|
|
|
|
|
|
const totalRow = Object.keys(json.resultTotal).length > 1 ? { ...json.resultTotal, groupsKey: `total${mkey}` } : (mkey === 'domestic' ? sumResult : { groupsKey: 'empty'});
|
|
|
|
const totalRow = Object.keys(json.resultTotal).length > 1 ? { ...json.resultTotal, groupsKey: `total${mkey}` } : (mkey === 'domestic' ? sumResult : { groupsKey: 'empty'});
|
|
|
|
const IndividualServiceRow = {orgz: json.resultTotal.IndividualService, groupsKey: `individualService${mkey}`, groupsLabel: '单项服务人数', };
|
|
|
|
const IndividualServiceRow = {orgz: json.resultTotal.IndividualService, groupsKey: `individualService${mkey}`, groupsLabel: '单项服务人数', };
|
|
|
|
|
|
|
|
|
|
|
|
return { sumResult, result, rawData: [].concat([IndividualServiceRow, totalRow], json.result), NoEmptyData: [].concat([IndividualServiceRow, totalRow], result) };
|
|
|
|
return {
|
|
|
|
|
|
|
|
sumResult,
|
|
|
|
|
|
|
|
result,
|
|
|
|
|
|
|
|
rawData: [].concat([IndividualServiceRow, totalRow], json.result.sort(comm.sortBy('orgz')).reverse()),
|
|
|
|
|
|
|
|
NoEmptyData: [].concat([IndividualServiceRow, totalRow], result),
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|