提交 409a709a 编写于 作者: D DebugIsFalse

Merge branch 'main' of gitcode.com:git_bot/ai-fe

<template>
<UDropdown class="flex flex-grow" :items="actionItems">
<UButton
color="gray"
variant="ghost"
size="2xs"
icon="i-heroicons-ellipsis-horizontal"
/>
</UDropdown>
</template>
<script setup>
const actionItems = [
[
{
label: '添加到收藏',
icon: 'i-heroicons-plus',
click: () => {
handleOpenSelect()
}
},
{
label: '更改合集',
icon: 'i-heroicons-squares-plus',
click: () => {
handleOpenSelect()
}
},
{
label: '从收藏中移除',
icon: 'i-heroicons-x-mark'
},
{
label: '删除主题',
icon: 'i-heroicons-trash'
}
]
]
</script>
......@@ -32,7 +32,7 @@
</div>
<UTextarea
v-model="description"
placeholder="集合描述"
placeholder="合集描述"
/>
</div>
</div>
......
......@@ -3,7 +3,7 @@
<UCard :ui="{ ring: '', divide: 'divide-y divide-gray-100 dark:divide-gray-800' }">
<template #header>
<div class="flex items-center justify-between">
<div class="text-xl">选择集合</div>
<div class="text-xl">选择合集</div>
<UButton
leading-icon="i-heroicons-x-mark-20-solid"
color="gray"
......@@ -15,7 +15,7 @@
<div class="flex flex-col gap-4">
<UButton
leading-icon="i-heroicons-plus-20-solid"
label="创建新集合"
label="创建新合集"
color="gray"
@click="handleOpenCreate"
/>
......
......@@ -43,14 +43,7 @@
@click="handleOpenSelect"
/>
</UTooltip>
<UDropdown class="flex flex-grow" :items="actionItems">
<UButton
color="gray"
variant="ghost"
size="2xs"
icon="i-heroicons-ellipsis-horizontal"
/>
</UDropdown>
<IActionThread />
</div>
</div>
<UDivider />
......@@ -58,32 +51,6 @@
<script setup>
const { $openLibrarySelect } = useLibraryStore()
const textColor = 'text-gray-500 dark:text-gray-400'
const actionItems = [
[
{
label: '添加到收藏',
icon: 'i-heroicons-plus',
click: () => {
handleOpenSelect()
}
},
{
label: '更改集合',
icon: 'i-heroicons-squares-plus',
click: () => {
handleOpenSelect()
}
},
{
label: '从收藏中移除',
icon: 'i-heroicons-x-mark'
},
{
label: '删除主题',
icon: 'i-heroicons-trash'
}
]
]
function handleOpenSelect (id) {
$openLibrarySelect(id)
}
......
......@@ -14,14 +14,20 @@
/>
</div>
<div class="flex gap-2">
<IActionThread />
<UButton
@click="handleOpenSelect"
color="gray" variant="ghost"
leading-icon="i-heroicons-plus-20-solid"
color="gray"
variant="ghost"
leading-icon="i-heroicons-plus-small"
:label="$selectCollectionId.length > 0 ? '已收藏' : '收藏'"
@click="handleOpenSelect"
/>
<UPopover v-model:open="isShareOpen">
<UButton :leading-icon="isOpen ? 'i-heroicons-share-20-solid' : 'i-heroicons-lock-closed-20-solid'" @click="handleSetOpenState">分享</UButton>
<UButton
:leading-icon="isOpen ? 'i-heroicons-share-16-solid' : 'i-heroicons-lock-closed-16-solid'"
label="分享"
@click="handleSetOpenState"
/>
<template #panel>
<div class="flex flex-col p-3 gap-2 min-w-72">
<div>访问权限</div>
......@@ -32,7 +38,7 @@
>
<div class="flex-grow flex flex-col gap-1 text-sm">
<div class="flex items-center gap-1" :class="{ 'text-primary-500': !isOpen }">
<UIcon name="i-heroicons-lock-closed-20-solid" />
<UIcon name="i-heroicons-lock-closed-16-solid" />
<span>私密</span>
</div>
<div class="text-xs text-gray-500">只有作者可以查看</div>
......@@ -76,7 +82,7 @@ const toast = useToast()
const route = useRoute()
const { $isSignIn } = storeToRefs(useUserStore())
const { $selectCollectionId } = storeToRefs(useLibraryStore())
const { $openLibraryCreate, $openLibrarySelect, $setSelectCollectionId } = useLibraryStore()
const { $openLibrarySelect, $setSelectCollectionId } = useLibraryStore()
const { findRecordCollection } = useCollectionRequest()
const props = defineProps({
query: String,
......
......@@ -14,7 +14,7 @@ export default () => {
})
return { data, error }
}
// 集合列表
// 合集列表
const getCollection = async () => {
const { data, error } = await useRequest('/v1/collection/list', {
method: 'get'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册