企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
加减乘除`add` `sub` `mul` `div` 计算之前判断数字是否存在 避免报错或出现NaN ``` // 数据改变 handleChange(value, key, column, record) { this.record = record; const newData = [...this.dataSource]; let target = newData.filter((item) => key === item.id)[0]; if (target) { target[column] = value; newData.forEach((ele) => { if (!!ele.excludingTax && !!ele.amountTax) { ele.amountTotal = this.add(ele.excludingTax, ele.amountTax); } else { ele.amountTotal = this.add(ele.excludingTax, ele.amountTax); } }); this.dataSource = newData; } }, ```