|
|
|
@ -7,6 +7,7 @@ import GroupFormModal from './GroupFormModal.vue'
|
|
|
|
|
import { useModal } from '@/components/Modal' |
|
|
|
|
import { deleteDevicegroup, getDeviceGroupTree } from '@/api/device-manage/group' |
|
|
|
|
import { useMessage } from '@/hooks/web/useMessage' |
|
|
|
|
import { usePermission } from '@/hooks/web/usePermission' |
|
|
|
|
|
|
|
|
|
defineProps<{ selectedGroupId: string | undefined }>() |
|
|
|
|
const emit = defineEmits(['update:selectedGroupId']) |
|
|
|
@ -35,16 +36,19 @@ watch(selectedKeys, (keys, oldKeys) => {
|
|
|
|
|
|
|
|
|
|
emit('update:selectedGroupId', value) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const { hasPermission } = usePermission() |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
|
<div rounded="6px" px="10px" pt="12px" pb="6px" border-box bg-white min-w="360px"> |
|
|
|
|
<div> |
|
|
|
|
<div flex="~ items-center justify-between" h="35px"> |
|
|
|
|
<a-button size="small" @click="openModal()"> |
|
|
|
|
<a-button v-if="hasPermission('device_group_add')" size="small" @click="openModal()"> |
|
|
|
|
<PlusOutlined /> |
|
|
|
|
添加根分组 |
|
|
|
|
</a-button> |
|
|
|
|
<span v-else /> <!-- ghost --> |
|
|
|
|
|
|
|
|
|
<a-button size="small" @click="execute"> |
|
|
|
|
<SyncOutlined /> |
|
|
|
@ -61,9 +65,20 @@ watch(selectedKeys, (keys, oldKeys) => {
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<Space> |
|
|
|
|
<span class="i-ant-design:plus-outlined" title="添加子分组" @click="openModal(true, { parentId: data.id })" /> |
|
|
|
|
<span class="i-ant-design:edit-outlined" title="编辑分组" @click="openModal(true, { id: data.id })" /> |
|
|
|
|
<span |
|
|
|
|
v-if="hasPermission('device_group_add')" |
|
|
|
|
class="i-ant-design:plus-outlined" |
|
|
|
|
title="添加子分组" |
|
|
|
|
@click="openModal(true, { parentId: data.id })" |
|
|
|
|
/> |
|
|
|
|
<span |
|
|
|
|
v-if="hasPermission('device_group_edit')" |
|
|
|
|
class="i-ant-design:edit-outlined" |
|
|
|
|
title="编辑分组" |
|
|
|
|
@click="openModal(true, { id: data.id })" |
|
|
|
|
/> |
|
|
|
|
<Popconfirm |
|
|
|
|
v-if="hasPermission('device_group_delete')" |
|
|
|
|
title="是否要删除数据?" |
|
|
|
|
:class="[data.hasChildren ? 'text-gray-300 cursor-not-allowed' : '']" |
|
|
|
|
:disabled="data.hasChildren" |
|
|
|
|