提交 e53943f7 编写于 作者: View Design's avatar View Design

222

上级 5c8e8b81
......@@ -9,6 +9,10 @@
<ILibraryEdit :id="id" ref="refEdit" />
</template>
<script setup>
import { IConfirm } from '#components'
const { deleteCollection } = useCollectionRequest()
const emit = defineEmits(['delete'])
const modal = useModal()
const props = defineProps({
id: {
type: [String, Number],
......@@ -26,7 +30,10 @@ const actionItems = [
},
{
label: '删除合集',
icon: 'i-heroicons-trash'
icon: 'i-heroicons-trash',
click: () => {
handleOpenDelete()
}
}
]
]
......@@ -34,4 +41,18 @@ const refEdit = ref(null)
function handleOpen () {
refEdit.value.open()
}
function handleOpenDelete () {
modal.open(IConfirm, {
title: '删除确认',
description: '确定要删除该合集吗?',
async onSuccess() {
modal.close()
await deleteCollection(props.id)
emit('delete')
},
onCancel () {
modal.close()
}
})
}
</script>
......@@ -9,7 +9,7 @@
</UDropdown>
</template>
<script setup>
import { IConfirm } from '#components';
import { IConfirm } from '#components'
const { $openLibrarySelect, $getCollection } = useLibraryStore()
const { deleteCollectionRecord, deleteThread } = useCollectionRequest()
const Layout = inject('Layout')
......
......@@ -23,7 +23,7 @@
</div>
<div class="flex flex-grow justify-end items-center gap-4">
<div class="flex">
<IActionCollect :id="collectId" />
<IActionCollect :id="collectId" v-if="collect" />
</div>
<div class="flex">
<UInput
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册