Commit 760f81c761b4628deebdec62260c11dcddea1273

Authored by Min
1 parent 05191c58

1.主页流程排序不对,没有根据iOrder排序

src/components/IndexCenter/IndexCenter.js
... ... @@ -328,6 +328,7 @@ class IndexCenter extends Component {
328 328  
329 329 if (commonUtils.isNotEmptyArr(tableTreeData[0].children)) {
330 330 const { sId: activeTree, data: tableData, columns } = tableTreeData[0].children[0];
  331 + const sortedTableData = tableData.slice().sort((a, b) => (a.iOrder ?? 0) - (b.iOrder ?? 0));
331 332 this.treeId = 'treeId_' + activeTree;
332 333 if (this.curActiveTree) {
333 334 this.activeTree = this.curActiveTree;
... ... @@ -337,7 +338,7 @@ class IndexCenter extends Component {
337 338  
338 339 if (!sNotShowChildFlow) {
339 340 const flowJson = {};
340   - tableData.forEach((item, flowIndex) => {
  341 + sortedTableData.forEach((item, flowIndex) => {
341 342 let sChildFlow = item.sChildFlow;
342 343 if (!sChildFlow) {
343 344 sChildFlow = OtherFlow;
... ... @@ -431,7 +432,7 @@ class IndexCenter extends Component {
431 432 }
432 433 }
433 434 if (!addState.tableData) {
434   - addState.tableData = tableData;
  435 + addState.tableData = sortedTableData;
435 436 addState.columns = columns;
436 437 this.tableTreeScrollTop = 0;
437 438 this.kpiTableScrollTop = 0;
... ...