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