updated: function (operate) { if (operate.type === 'addRC') { window.sessionStorage.setItem('operate', 'addRC'); let perm = JSON.parse(window.sessionStorage.getItem('perm')); let ctrlValue = operate.ctrlValue; let row = ctrlValue.index; let len = ctrlValue.len; for (let i in perm) { for (let j in perm[i]) { if (perm[i][j].row_focus >= row) { for (let k = 1; k <= len; k++) { let temp = JSON.parse(JSON.stringify(perm[i][j])); temp.row_focus = temp.row_focus + k; temp.row[0] = temp.row[0] + k; temp.row[1] = temp.row[1] + k; perm[i].push(temp); } } } } window.sessionStorage.setItem('perm', JSON.stringify(perm)); } if (operate.type === 'delRC') { let perm = JSON.parse(window.sessionStorage.getItem('perm_data')); let ctrlValue = operate.ctrlValue; let row = ctrlValue.index; let len = ctrlValue.len; for (let i in perm) { for (let j in perm[i]) { if (perm[i][j].row_focus === row) { perm[i].splice(j, 1); } if (perm[i][j].row_focus > row) { perm[i][j].row_focus = perm[i][j].row_focus - len; perm[i][j].row[0] = perm[i][j].row[0] - len; perm[i][j].row[1] = perm[i][j].row[1] - len; } } } window.sessionStorage.setItem('perm_data', JSON.stringify(perm)); } },