Commit efe81f3d authored by 涂伟's avatar 涂伟

fix: '新增台账数据提交逻辑优化'

parent 27241fc3
Pipeline #93985 passed with stages
......@@ -241,9 +241,12 @@ const StandingBook = props => {
if (res.msg === 'Ok' && res.data.root) {
console.log(res.data.root);
setKeepTableData(res.data.root);
const maxOrder = res.data.root.reduce((pre, cur) =>
pre.order > cur.order ? pre.order : cur.order,
);
const maxOrder = res.data.root.reduce((pre, cur) => {
if (res.data.root.length === 1) {
return cur.order;
}
return pre.order > cur.order ? pre.order : cur.order;
}, 0);
setMaxLength(maxOrder + 1);
// setMaxLength(res.data.root.length + 1);
let arr = formateArrDataA(res.data.root, 'type');
......
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