需要生成环境执行表达式有什么好办法
现实需求
已实现如下
() => {
const env_params = 'a, b'
const env_args = [1, 2]
const condition = 'a === b'
const command = `function(${env_params}){ return ${condition}}`;
return Function(`"use strict";return ${command}`)().apply(null, env_args);
}
如下图 分输条件类型(DeliverType)为xxx时,分输量(m3/h)(不可编辑)
数据是 Condition: "DeliverType=='xxxx'"
DeliverType我要每行求当前行的分输条件,并执行表达式进行判断
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…