|
@@ -154,14 +154,15 @@ function transformArguments(children,curEle,eleMap){
|
|
//认为这个参数是之前公式计算的结果,不再写入元素
|
|
//认为这个参数是之前公式计算的结果,不再写入元素
|
|
isNestEle = true;
|
|
isNestEle = true;
|
|
}else{
|
|
}else{
|
|
|
|
+ let atbkey=arg.tableElementKey.replace('_key',':key')
|
|
if(arg.type == 'Element'){
|
|
if(arg.type == 'Element'){
|
|
- eleMap[arg.tableElementKey] = {
|
|
|
|
|
|
+ eleMap[atbkey] = {
|
|
id: arg.id,
|
|
id: arg.id,
|
|
name: arg.name,
|
|
name: arg.name,
|
|
- tableElementKey: arg.tableElementKey,
|
|
|
|
|
|
+ tableElementKey: atbkey,
|
|
type: "Element",
|
|
type: "Element",
|
|
};
|
|
};
|
|
- fcText += `E[${arg.tableElementKey}]`;
|
|
|
|
|
|
+ fcText += `E[${atbkey}]`;
|
|
}else if(arg.type == 'ParamData'){
|
|
}else if(arg.type == 'ParamData'){
|
|
eleMap[arg.k] = {
|
|
eleMap[arg.k] = {
|
|
id: arg.id,
|
|
id: arg.id,
|
|
@@ -229,7 +230,7 @@ function transformArguments(children,curEle,eleMap){
|
|
fcText += ')';
|
|
fcText += ')';
|
|
|
|
|
|
}
|
|
}
|
|
- //console.log(ele.name)
|
|
|
|
|
|
+ console.log(fcText,'ele.name')
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -237,7 +238,6 @@ function transformArguments(children,curEle,eleMap){
|
|
return fcText;
|
|
return fcText;
|
|
}
|
|
}
|
|
export const formulaArrayToString = (processFormula,resultFormula) => {
|
|
export const formulaArrayToString = (processFormula,resultFormula) => {
|
|
-
|
|
|
|
let text = '';
|
|
let text = '';
|
|
let eleMap = {};//元素字典,为了回显的时候查询信息
|
|
let eleMap = {};//元素字典,为了回显的时候查询信息
|
|
|
|
|
|
@@ -277,11 +277,9 @@ export const formulaArrayToString = (processFormula,resultFormula) => {
|
|
text += item.name;
|
|
text += item.name;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
if(resultFormula[0].children.length){
|
|
if(resultFormula[0].children.length){
|
|
//等号左侧部分
|
|
//等号左侧部分
|
|
let resText = transformArguments(resultFormula[0].children,resultFormula[0],eleMap);
|
|
let resText = transformArguments(resultFormula[0].children,resultFormula[0],eleMap);
|
|
-
|
|
|
|
//等号左侧元素不需要,左侧的公式嵌套右侧所有结果
|
|
//等号左侧元素不需要,左侧的公式嵌套右侧所有结果
|
|
if(text){
|
|
if(text){
|
|
text = resText.replace(`E[${resultFormula[0].tableElementKey}]`,text);
|
|
text = resText.replace(`E[${resultFormula[0].tableElementKey}]`,text);
|
|
@@ -291,7 +289,7 @@ export const formulaArrayToString = (processFormula,resultFormula) => {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- console.log(text);
|
|
|
|
|
|
+ console.log(text,'最终');
|
|
//console.log(eleMap)
|
|
//console.log(eleMap)
|
|
return {text,eleMap};
|
|
return {text,eleMap};
|
|
}
|
|
}
|