部门编辑截断数据

This commit is contained in:
禺狨 2023-03-10 10:29:19 +08:00
parent 7234c752df
commit 27e2e1743a

View File

@ -57,7 +57,9 @@ export const DepartmentUpdatePage: React.FC = () => {
const checkArr = (departments: any[], id: number) => { const checkArr = (departments: any[], id: number) => {
const arr = []; const arr = [];
for (let i = 0; i < departments[id].length; i++) { for (let i = 0; i < departments[id].length; i++) {
if (!departments[departments[id][i].id]) { if (departments[id][i].id === Number(params.depId)) {
console.log("截断");
} else if (!departments[departments[id][i].id]) {
arr.push({ arr.push({
label: departments[id][i].name, label: departments[id][i].name,
value: departments[id][i].id, value: departments[id][i].id,