Commit 8dbe4a80 by chenjinjing

no message

parent 731d78d0
......@@ -17,24 +17,59 @@ const createBizAndDataConfigMap = {
{ type:"键值数据", dataName:"模拟数据块", title:"教师学段人数", unit:"个", total:true, percent:false},
{ type:"键值数据", dataName:"模拟数据块2", title:"教师学段人数2", unit:"个", total:true, percent:false},
{ type:"柱状数据", dataName:"模拟数据块3", title:"教师学段人数", unit:"个", total:true, percent:false,subTitle:"111"},
{ type:"键值数据", dataName:"模拟数据块4", title:"教师学段人数", unit:"个", total:true, percent:false}
{ type:"列表数据", dataName:"模拟数据块4", title:"教师学段人数", unit:"个", total:true, percent:false}
]
},
"page2": {
sheetName:"页面2",
apiList:[
{}
{ type:"列表数据", dataName:"模拟数据块", title:"教师学段人数", unit:"个", total:true, percent:false},
{ type:"键值数据", dataName:"模拟数据块2", title:"教师学段人数2", unit:"个", total:true, percent:false},
{ type:"柱状数据", dataName:"模拟数据块3", title:"教师学段人数", unit:"个", total:true, percent:false,subTitle:"111"},
{ type:"键值数据", dataName:"模拟数据块4", title:"教师学段人数", unit:"个", total:true, percent:false}
]
},
"page3": {
sheetName:"页面3",
apiList:[
{}
{ type:"列表数据", dataName:"模拟数据块", title:"教师学段人数", unit:"个", total:true, percent:false},
{ type:"键值数据", dataName:"模拟数据块2", title:"教师学段人数2", unit:"个", total:true, percent:false},
{ type:"柱状数据", dataName:"模拟数据块3", title:"教师学段人数", unit:"个", total:true, percent:false,subTitle:"111"},
{ type:"键值数据", dataName:"模拟数据块4", title:"教师学段人数", unit:"个", total:true, percent:false}
]
},
"page4": {
sheetName:"页面4",
apiList:[
{ type:"列表数据", dataName:"模拟数据块", title:"教师学段人数", unit:"个", total:true, percent:false},
{ type:"键值数据", dataName:"模拟数据块2", title:"教师学段人数2", unit:"个", total:true, percent:false},
{ type:"柱状数据", dataName:"模拟数据块3", title:"教师学段人数", unit:"个", total:true, percent:false,subTitle:"111"},
{ type:"键值数据", dataName:"模拟数据块4", title:"教师学段人数", unit:"个", total:true, percent:false}
]
},
"page5": {
sheetName:"页面5",
apiList:[
{ type:"列表数据", dataName:"模拟数据块", title:"教师学段人数", unit:"个", total:true, percent:false},
{ type:"键值数据", dataName:"模拟数据块2", title:"教师学段人数2", unit:"个", total:true, percent:false},
{ type:"柱状数据", dataName:"模拟数据块3", title:"教师学段人数", unit:"个", total:true, percent:false,subTitle:"111"},
{ type:"键值数据", dataName:"模拟数据块4", title:"教师学段人数", unit:"个", total:true, percent:false}
]
},
"page6": {
sheetName:"页面6",
apiList:[
{ type:"列表数据", dataName:"模拟数据块", title:"教师学段人数", unit:"个", total:true, percent:false},
{ type:"键值数据", dataName:"模拟数据块2", title:"教师学段人数2", unit:"个", total:true, percent:false},
{ type:"柱状数据", dataName:"模拟数据块3", title:"教师学段人数", unit:"个", total:true, percent:false,subTitle:"111"},
{ type:"键值数据", dataName:"模拟数据块4", title:"教师学段人数", unit:"个", total:true, percent:false}
]
}
};
//创建data层
function createData() {
let str = `
......@@ -110,7 +145,7 @@ function getBizStr(apiList, sheetName) {
let excelData:any = get${sheetName}();
`;
apiList.forEach((info, index) => {
let {dataName, unit, total, percent, type} = info;
let {dataName, unit, total, percent, type,titleList,titleValueObj} = info;
const apiName = `api${index+1}`;
let subStr = `
......@@ -119,7 +154,7 @@ function getBizStr(apiList, sheetName) {
switch(type) {
case "键值数据": subStr += `getKeyValue("${dataName}", excelData.${dataName},'${unit}', ${total}, ${percent} )`; break;
case "柱状数据": subStr += `getChartData(excelData.${dataName}, '${unit}', ${percent} )`; break;
case "列表数据": subStr += `getKeyValue("${dataName}")`; break;
case "列表数据": subStr += `getListData("${dataName}",excelData.${dataName},${titleList},${titleValueObj})`; break;
};
str+=
......@@ -142,7 +177,7 @@ function createRouter() {
let routergetName="";
let routerpostName="";
apiList.forEach(apiInfo => {
createBizAndDataConfigMap.forEach(apiInfo => {
importName+=`
import * as ${apiInfo.name}Biz from '../biz/${apiInfo.name}';
`
......@@ -177,10 +212,9 @@ function createRouter() {
createData();
//createRouter();
createBiz();
createRouter();
//创建 biz层
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment