吉安感知网项目-前端
shuishen
2026-03-05 d75d83bd2a1f4e13634f84f8a4de1f7457187b2b
feat:部门管理,删除相关处理
1 files modified
13 ■■■■■ changed files
applications/drone-command/src/views/permissionManage/permissionDept/index.vue 13 ●●●●● patch | view | raw | blame | history
applications/drone-command/src/views/permissionManage/permissionDept/index.vue
@@ -68,7 +68,7 @@
                            <el-link @click="handleView(row)">查看</el-link>
                            <el-link v-if="permission.permissionDept_edit" @click="handleEdit(row)">编辑</el-link>
<!--                            <el-link @click="handleAddChild(row)">新增子项</el-link>-->
<!--                            <el-link type="danger" @click="handleDelete(row)">删除</el-link>-->
                            <el-link type="danger"  v-if="permission.permissionDept_remove" @click="handleDelete(row)">删除</el-link>
                            <el-link type="danger" @click="handleShare(row)" v-if="hasSharing">共享</el-link>
                        </template>
                    </el-table-column>
@@ -127,6 +127,10 @@
provide('dictObj', dictObj)
provide('deptTree', deptTree)
function isRootParentId(parentId) {
    return parentId === 0 || parentId === '0' || parentId === null || parentId === undefined || parentId === ''
}
async function getList() {
    loading.value = true
@@ -202,10 +206,11 @@
    ElMessage.success('删除成功')
    selectedIds.value = []
    selectedRows.value = []
    const parentIds = Array.from(new Set(rows.map(item => item.parentId).filter(Boolean)))
    const hasRoot = rows.some(item => !item.parentId)
    const parentIds = Array.from(new Set(rows.map(item => item.parentId).filter(parentId => !isRootParentId(parentId))))
    const hasRoot = rows.some(item => isRootParentId(item.parentId))
    if (hasRoot) {
        getList()
        await getList()
        return
    }
    parentIds.forEach(parentId => refreshChildNodes(parentId))
}