| | |
| | | <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> |
| | |
| | | |
| | | 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 |
| | |
| | | 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)) |
| | | } |