mirror of
https://github.com/keven1024/015.git
synced 2026-06-05 11:59:35 +00:00
feat(front): add FileShareDrawer component for file sharing functionalities and enhance index page layout
This commit is contained in:
45
front/components/Drawer/FileShareDrawer.vue
Normal file
45
front/components/Drawer/FileShareDrawer.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<script setup lang="ts">
|
||||
import { LucideShare, LucideImage, LucideBot, LucideLanguages } from 'lucide-vue-next'
|
||||
import { cx } from 'class-variance-authority'
|
||||
|
||||
const props = defineProps<{
|
||||
hide: () => void
|
||||
}>()
|
||||
const actions = [
|
||||
{
|
||||
label: '分享文件', icon: LucideShare, className: 'bg-green-300', onClick: () => {
|
||||
console.log('复制链接')
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '生成图文', icon: LucideImage, className: 'bg-red-300', onClick: () => {
|
||||
console.log('复制链接')
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '问大模型', icon: LucideBot, className: 'bg-blue-300', onClick: () => {
|
||||
console.log('复制链接')
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '文本翻译', icon: LucideLanguages, className: 'bg-orange-300', onClick: () => {
|
||||
console.log('复制链接')
|
||||
}
|
||||
},
|
||||
]
|
||||
</script>
|
||||
<template>
|
||||
<div class="flex flex-col gap-5 p-5">
|
||||
<div class="flex flex-row gap-5">
|
||||
<div v-for="item in actions" :key="item.label" class="flex flex-col items-center gap-2" @click="()=>{
|
||||
item?.onClick()
|
||||
props?.hide()
|
||||
}">
|
||||
<div :class="cx('size-14 flex justify-center items-center rounded-full', item?.className)">
|
||||
<component :is="item?.icon" />
|
||||
</div>
|
||||
<div class="text-sm">{{ item?.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -40,8 +40,8 @@ onUnmounted(() => {
|
||||
isOverDropZone && '!bg-green-100/50 '
|
||||
)">
|
||||
<template v-if="!!value">
|
||||
<div v-if="!!imageUrl" class="flex size-16">
|
||||
<div class="object-contain mx-auto">
|
||||
<div v-if="!!imageUrl" class="flex max-w-30 max-h-20">
|
||||
<div class="object-contain m-auto h-full">
|
||||
<img :src="imageUrl" class="w-full h-full border border-black/20 rounded" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user