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

eslint Vue template

上级 c820bd9e
<template> <template>
<UTooltip :text="color.value" class="capitalize" :open-delay="500"> <UTooltip :text="color.value" class="capitalize" :open-delay="500">
<UButton <UButton
color="white" color="white"
square square
:ui="{ :ui="{
color: { color: {
white: { white: {
solid: 'ring-0 bg-gray-100 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-800', solid: 'ring-0 bg-gray-100 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-800',
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
} }
} }
}" }"
:variant="color.value === selected.value ? 'solid' : 'ghost'" :variant="color.value === selected.value ? 'solid' : 'ghost'"
@click.stop.prevent="$emit('select')" @click.stop.prevent="$emit('select')"
> >
<span class="inline-block w-3 h-3 rounded-full" :style="{ backgroundColor: color.hex }" /> <span class="inline-block w-3 h-3 rounded-full" :style="{ backgroundColor: color.hex }"/>
</UButton> </UButton>
</UTooltip> </UTooltip>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
......
<template> <template>
<div class="max-w-screen-md w-full flex flex-col space-y-4 p-6"> <div class="max-w-screen-md w-full flex flex-col space-y-4 p-6">
<UCard <UCard
class="transition-[box-shadow] hover:ring-2 has-[textarea:focus]:ring-2 has-[textarea:focus]:ring-primary-500 dark:has-[textarea:focus]:ring-primary-400" class="transition-[box-shadow] hover:ring-2 has-[textarea:focus]:ring-2 has-[textarea:focus]:ring-primary-500 dark:has-[textarea:focus]:ring-primary-400"
:ui="cardUI" :ui="cardUI"
> >
<UTextarea <UTextarea
v-model="query" v-model="query"
name="createInput" name="createInput"
autoresize autoresize
placeholder="输入搜索内容..." placeholder="输入搜索内容..."
:rows="5" :rows="5"
variant="none" variant="none"
:padded="false" :padded="false"
maxlength="2000" maxlength="2000"
/> />
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<UTooltip class="relative" :text="isPro ? '已开启专家搜索' : '已关闭专家搜索'" :shortcuts="[metaSymbol, 'O']"> <UTooltip class="relative" :text="isPro ? '已开启专家搜索' : '已关闭专家搜索'" :shortcuts="[metaSymbol, 'O']">
<div v-show="!isPro" class="absolute w-7 h-0.5 rotate-45 top-3.5 left-1 bg-gray-700 dark:bg-gray-200 hover:bg-gray-900 dark:hover:bg-white rounded"/> <div v-show="!isPro"
<UButton class="absolute w-7 h-0.5 rotate-45 top-3.5 left-1 bg-gray-700 dark:bg-gray-200 hover:bg-gray-900 dark:hover:bg-white rounded"/>
:ui="{ rounded: 'rounded-full' }" <UButton
:icon="isPro ? 'i-heroicons-sparkles-20-solid' : 'i-heroicons-sparkles-20-solid'" :ui="{ rounded: 'rounded-full' }"
color="gray" :icon="isPro ? 'i-heroicons-sparkles-20-solid' : 'i-heroicons-sparkles-20-solid'"
variant="ghost" color="gray"
@click="handleTogglePro" variant="ghost"
/> @click="handleTogglePro"
</UTooltip> />
<USelectMenu </UTooltip>
v-model="selectedRepo" <USelectMenu
:ui-menu="menuUI" v-model="selectedRepo"
:options="$repos" :ui-menu="menuUI"
placeholder="选择 GitHub 项目" :options="$repos"
value-attribute="label" placeholder="选择 GitHub 项目"
option-attribute="label" value-attribute="label"
> option-attribute="label"
<UTooltip v-if="!selectedRepo" :text="isPro ? '选择 GitHub 项目' : '选择 GitHub 项目(需开启专家搜索)'"> >
<UButton <UTooltip v-if="!selectedRepo" :text="isPro ? '选择 GitHub 项目' : '选择 GitHub 项目(需开启专家搜索)'">
:ui="{ rounded: 'rounded-full' }" <UButton
icon="i-simple-icons-github" :ui="{ rounded: 'rounded-full' }"
color="gray" icon="i-simple-icons-github"
variant="ghost" color="gray"
:disabled="!isPro" variant="ghost"
/> :disabled="!isPro"
</UTooltip> />
</UTooltip>
<UButton v-else color="gray" variant="ghost" :class="{ 'group': selectedRepo }"> <UButton v-else color="gray" variant="ghost" :class="{ 'group': selectedRepo }">
<UIcon name="i-simple-icons-github" /> <UIcon name="i-simple-icons-github"/>
<span>{{ selectedRepo }}</span> <span>{{ selectedRepo }}</span>
<UIcon name="i-heroicons-chevron-down-20-solid" class="text-xl flex group-hover:hidden" /> <UIcon name="i-heroicons-chevron-down-20-solid" class="text-xl flex group-hover:hidden"/>
<UButton <UButton
v-if="selectedRepo" v-if="selectedRepo"
class="hidden group-hover:flex" class="hidden group-hover:flex"
icon="i-heroicons-x-mark-20-solid" icon="i-heroicons-x-mark-20-solid"
:padded="false" :padded="false"
color="gray" color="gray"
variant="link" variant="link"
@click.stop.prevent="handleClearRepo" @click.stop.prevent="handleClearRepo"
/> />
</UButton> </UButton>
</USelectMenu> </USelectMenu>
</div> </div>
<UTooltip text="搜索" :shortcuts="[metaSymbol, '↵']"> <UTooltip text="搜索" :shortcuts="[metaSymbol, '↵']">
<UButton <UButton
:ui="{ rounded: 'rounded-full' }" :ui="{ rounded: 'rounded-full' }"
icon="i-heroicons-chevron-right-20-solid" icon="i-heroicons-chevron-right-20-solid"
:loading="loading" :loading="loading"
:disabled="query === ''" :disabled="query === ''"
size="md" size="md"
@click="handleSearch" @click="handleSearch"
/> />
</UTooltip> </UTooltip>
</div> </div>
</UCard> </UCard>
</div> </div>
</template> </template>
<script setup> <script setup>
const { $repos } = storeToRefs(useReposStore()) const { $repos } = storeToRefs(useReposStore())
......
<template> <template>
<div class="flex flex-col justify-center h-72 items-center text-gray-300" :class="{ 'h-36': size === 'xs' }"> <div class="flex flex-col justify-center h-72 items-center text-gray-300" :class="{ 'h-36': size === 'xs' }">
<UIcon name="i-heroicons-inbox" class="text-6xl" /> <UIcon name="i-heroicons-inbox" class="text-6xl"/>
<div>暂无数据</div> <div>暂无数据</div>
</div> </div>
</template> </template>
<script setup> <script setup>
defineProps({ defineProps({
......
<template> <template>
<div class="grid min-h-full place-items-center px-6 py-24 sm:py-32 lg:px-8"> <div class="grid min-h-full place-items-center px-6 py-24 sm:py-32 lg:px-8">
<div class="text-center"> <div class="text-center">
<p class="text-base font-semibold text-red-600">{{ code }}</p> <p class="text-base font-semibold text-red-600">{{ code }}</p>
<h1 class="mt-4 text-3xl font-bold tracking-tight sm:text-5xl">{{ errorTitle }}</h1> <h1 class="mt-4 text-3xl font-bold tracking-tight sm:text-5xl">{{ errorTitle }}</h1>
<p class="mt-6 text-base leading-7">{{ errorDescription }}</p> <p class="mt-6 text-base leading-7">{{ errorDescription }}</p>
<div class="mt-10 flex items-center justify-center gap-x-6"> <div class="mt-10 flex items-center justify-center gap-x-6">
<UButton to="/" size="lg">返回首页</UButton> <UButton to="/" size="lg">返回首页</UButton>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
const props = defineProps({ const props = defineProps({
......
<template> <template>
<div class="flex flex-col overflow-hidden group"> <div class="flex flex-col overflow-hidden group">
<div class="flex justify-between"> <div class="flex justify-between">
<UButton <UButton
class="flex-grow cursor-default hover:bg-transparent dark:hover:bg-transparent" class="flex-grow cursor-default hover:bg-transparent dark:hover:bg-transparent"
leading-icon="i-heroicons-queue-list" leading-icon="i-heroicons-queue-list"
color="gray" color="gray"
variant="ghost" variant="ghost"
size="md" size="md"
label="浏览记录" label="浏览记录"
/> />
<UButton <UButton
class="hidden group-hover:flex" class="hidden group-hover:flex"
label="清空" label="清空"
size="md" size="md"
variant="link" variant="link"
@click="handleClear" @click="handleClear"
/> />
</div> </div>
<ClientOnly> <ClientOnly>
<div v-auto-animate class="flex overflow-y-auto flex-col gap-1 border-l border-gray-200 dark:border-gray-800 pl-2 ml-5"> <div v-auto-animate
<template v-for="item in $searchHistory.reverse()" :key="item.c_id"> class="flex overflow-y-auto flex-col gap-1 border-l border-gray-200 dark:border-gray-800 pl-2 ml-5">
<UButton <template v-for="item in $searchHistory.reverse()" :key="item.c_id">
class="flex text-gray-400" <UButton
color="gray" class="flex text-gray-400"
variant="ghost" color="gray"
size="xs" variant="ghost"
long size="xs"
:to="`/search/${item.c_id}`" long
> :to="`/search/${item.c_id}`"
<div class="flex-grow truncate" :title="item.title">{{ item.title }}</div> >
</UButton> <div class="flex-grow truncate" :title="item.title">{{ item.title }}</div>
</template> </UButton>
</div> </template>
</ClientOnly> </div>
</div> </ClientOnly>
</div>
</template> </template>
<script setup> <script setup>
const { $searchHistory } = storeToRefs(useSearchStore()) const { $searchHistory } = storeToRefs(useSearchStore())
......
<template> <template>
<div class="flex flex-col w-full"> <div class="flex flex-col w-full">
<ClientOnly> <ClientOnly>
<template v-if="$isSignIn"> <template v-if="$isSignIn">
<div class="flex flex-grow justify-between items-center p-4"> <div class="flex flex-grow justify-between items-center p-4">
<UDropdown class="flex flex-grow" :items="items"> <UDropdown class="flex flex-grow" :items="items">
<UButton class="flex flex-grow" color="gray" variant="ghost"> <UButton class="flex flex-grow" color="gray" variant="ghost">
<div class="flex flex-grow items-center gap-2"> <div class="flex flex-grow items-center gap-2">
<UAvatar :src="$info.avatar_url" /> <UAvatar :src="$info.avatar_url"/>
<div>{{ $info.nickname }}</div> <div>{{ $info.nickname }}</div>
<UBadge v-if="$info.pro" size="xs" color="yellow" variant="soft" label="PRO" /> <UBadge v-if="$info.pro" size="xs" color="yellow" variant="soft" label="PRO"/>
<UBadge v-else size="xs" color="gray" variant="soft" label="FREE" /> <UBadge v-else size="xs" color="gray" variant="soft" label="FREE"/>
</div> </div>
<UIcon name="i-heroicons-chevron-down-20-solid" class="text-lg" /> <UIcon name="i-heroicons-chevron-down-20-solid" class="text-lg"/>
</UButton> </UButton>
</UDropdown> </UDropdown>
</div> </div>
<UDivider /> <UDivider/>
</template> </template>
</ClientOnly> </ClientOnly>
<div class="flex justify-between gap-2 p-4"> <div class="flex justify-between gap-2 p-4">
<UButton <UButton
color="gray" color="gray"
variant="ghost" variant="ghost"
label="问题反馈" label="问题反馈"
/> />
<ClientOnly> <ClientOnly>
<div class="flex"> <div class="flex">
<ColorPicker /> <ColorPicker/>
<USelectMenu <USelectMenu
v-model="colorMode.preference" v-model="colorMode.preference"
:ui-menu="{ width: 'w-32' }" :ui-menu="{ width: 'w-32' }"
:options="themeItems" :options="themeItems"
value-attribute="value" value-attribute="value"
> >
<UButton <UButton
color="gray" color="gray"
variant="ghost" variant="ghost"
square square
:icon="colorMode.value === 'dark' ? 'i-heroicons-moon-16-solid' : 'i-heroicons-sun-16-solid'" :icon="colorMode.value === 'dark' ? 'i-heroicons-moon-16-solid' : 'i-heroicons-sun-16-solid'"
aria-label="Theme" aria-label="Theme"
/> />
</USelectMenu> </USelectMenu>
<USelectMenu <USelectMenu
v-if="false" v-if="false"
:ui-menu="{ width: 'w-32' }" :ui-menu="{ width: 'w-32' }"
:model-value="$lang" :model-value="$lang"
:options="$langOptions" :options="$langOptions"
value-attribute="value" value-attribute="value"
> >
<UButton <UButton
icon="i-heroicons-language-16-solid" icon="i-heroicons-language-16-solid"
color="gray" color="gray"
variant="ghost" variant="ghost"
/> />
</USelectMenu> </USelectMenu>
</div> </div>
</ClientOnly> </ClientOnly>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
const { $signOut } = useUserStore() const { $signOut } = useUserStore()
......
<template> <template>
<UDropdown class="flex flex-grow" :items="actionItems"> <UDropdown class="flex flex-grow" :items="actionItems">
<UButton <UButton
color="gray" color="gray"
variant="ghost" variant="ghost"
square square
icon="i-heroicons-ellipsis-horizontal" icon="i-heroicons-ellipsis-horizontal"
/> />
</UDropdown> </UDropdown>
<ILibraryEdit :id="id" ref="refEdit" /> <ILibraryEdit :id="id" ref="refEdit"/>
</template> </template>
<script setup> <script setup>
import { IConfirm } from '#components' import { IConfirm } from '#components'
......
<template> <template>
<ULink :to="`/library/${item.id}`"> <ULink :to="`/library/${item.id}`">
<UCard :ui="cardUI"> <UCard :ui="cardUI">
<div class="flex flex-col gap-1"> <div class="flex flex-col gap-1">
<div>{{ item.name }}</div> <div>{{ item.name }}</div>
<div class="flex"> <div class="flex">
<div class="flex items-center text-gray-500 text-sm gap-0.5"> <div class="flex items-center text-gray-500 text-sm gap-0.5">
<UIcon name="i-heroicons-square-3-stack-3d" /> <UIcon name="i-heroicons-square-3-stack-3d"/>
<span>{{ item.record_count }}</span> <span>{{ item.record_count }}</span>
</div> </div>
</div> </div>
</div> </div>
</UCard> </UCard>
</ULink> </ULink>
</template> </template>
<script setup> <script setup>
defineProps({ defineProps({
......
<template> <template>
<ILibraryCreate :id="id" ref="refCreate" /> <ILibraryCreate :id="id" ref="refCreate"/>
</template> </template>
<script setup> <script setup>
defineProps({ defineProps({
......
<template> <template>
<UModal v-model="$isLibrarySelectOpen" :ui="{ width: 'w-96 sm:max-w-screen-md' }"> <UModal v-model="$isLibrarySelectOpen" :ui="{ width: 'w-96 sm:max-w-screen-md' }">
<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"
variant="ghost" variant="ghost"
@click="handleClose" @click="handleClose"
/> />
</div> </div>
</template> </template>
<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"
/> />
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<UButton <UButton
v-for="item in $collection" v-for="item in $collection"
:key="item.id" :key="item.id"
color="white" color="white"
size="md" size="md"
class="flex" class="flex"
@click="handleSelected(item.id)" @click="handleSelected(item.id)"
> >
<div class="flex flex-grow justify-between items-center"> <div class="flex flex-grow justify-between items-center">
<div>{{ item.name }}</div> <div>{{ item.name }}</div>
<UIcon v-if="selected.includes(item.id)" name="i-heroicons-check-circle-20-solid" class="text-primary text-lg" /> <UIcon v-if="selected.includes(item.id)" name="i-heroicons-check-circle-20-solid"
</div> class="text-primary text-lg"/>
</UButton> </div>
</div> </UButton>
</div> </div>
<template #footer> </div>
<div class="flex justify-end"> <template #footer>
<UButton <div class="flex justify-end">
size="md" <UButton
label="保存" size="md"
:loading="loading" label="保存"
@click="handleSave" :loading="loading"
/> @click="handleSave"
</div> />
</template> </div>
</UCard> </template>
</UModal> </UCard>
</UModal>
</template> </template>
<script setup> <script setup>
const { $isLibrarySelectOpen, $selectCollectionId, $selectThreadId, $collection } = storeToRefs(useLibraryStore()) const { $isLibrarySelectOpen, $selectCollectionId, $selectThreadId, $collection } = storeToRefs(useLibraryStore())
......
<template> <template>
<div class="flex flex-col lg:flex-row gap-6 space-x-0 lg:space-x-6"> <div class="flex flex-col lg:flex-row gap-6 space-x-0 lg:space-x-6">
<div class="flex flex-grow flex-col gap-6"> <div class="flex flex-grow flex-col gap-6">
<div class="grid"> <div class="grid">
<slot name="title" /> <slot name="title"/>
</div> </div>
<slot /> <slot/>
</div> </div>
<div v-if="$slots.extra" class="flex flex-col w-full lg:w-64 flex-shrink-0 gap-6"> <div v-if="$slots.extra" class="flex flex-col w-full lg:w-64 flex-shrink-0 gap-6">
<slot name="extra" /> <slot name="extra"/>
</div> </div>
</div> </div>
</template> </template>
<script setup>
</script>
\ No newline at end of file
<template> <template>
<div class="flex flex-col gap-4 sticky top-16"> <div class="flex flex-col gap-4 sticky top-16">
<div class="text-xl flex items-center space-x-1"> <div class="text-xl flex items-center space-x-1">
<UIcon name="i-heroicons-square-3-stack-3d-20-solid" /> <UIcon name="i-heroicons-square-3-stack-3d-20-solid"/>
<span>补充信息</span> <span>补充信息</span>
</div> </div>
<template v-for="(item, index) in data" :key="index"> <template v-for="(item, index) in data" :key="index">
<template v-if="item.ready"> <template v-if="item.ready">
<template v-if="item.type === 'search_relate_repo'"> <template v-if="item.type === 'search_relate_repo'">
<template v-if="item.data.length"> <template v-if="item.data.length">
<template v-for="(chart, cIndex) in item.data" :key="cIndex"> <template v-for="(chart, cIndex) in item.data" :key="cIndex">
<UCard :ui="cardUI"> <UCard :ui="cardUI">
<template v-if="chart.info"> <template v-if="chart.info">
<div class="flex mb-2"> <div class="flex mb-2">
<div class="flex items-center gap-1 text-sm overflow-hidden"> <div class="flex items-center gap-1 text-sm overflow-hidden">
<UIcon class="flex-shrink-0" name="i-simple-icons-github" /> <UIcon class="flex-shrink-0" name="i-simple-icons-github"/>
<ULink class="flex-grow truncate underline" :to="chart.info.url" target="_blank" :title="chart.info.description">{{ chart.info.name }}</ULink> <ULink class="flex-grow truncate underline" :to="chart.info.url" target="_blank"
<UIcon class="flex-shrink-0" name="i-heroicons-arrow-top-right-on-square" /> :title="chart.info.description">{{ chart.info.name }}
</div> </ULink>
</div> <UIcon class="flex-shrink-0" name="i-heroicons-arrow-top-right-on-square"/>
</template> </div>
<ProseChart </div>
type="line" </template>
:labels="chart.labels" <ProseChart
:data="chart.data" type="line"
:info="chart.info" :labels="chart.labels"
simple :data="chart.data"
/> :info="chart.info"
<div class="text-xs text-center text-gray-500 dark:text-gray-400 mt-2">{{ item.title }}</div> simple
</UCard> />
</template> <div class="text-xs text-center text-gray-500 dark:text-gray-400 mt-2">{{ item.title }}</div>
</template> </UCard>
<template v-else> </template>
<UCard :ui="cardUI"> </template>
<IEmpty size="xs"/> <template v-else>
</UCard> <UCard :ui="cardUI">
</template> <IEmpty size="xs"/>
</template> </UCard>
</template> </template>
<template v-else> </template>
<UCard :ui="cardUI"> </template>
<div class="flex flex-col gap-1"> <template v-else>
<USkeleton class="h-4" /> <UCard :ui="cardUI">
<USkeleton class="h-4 w-2/3" /> <div class="flex flex-col gap-1">
<USkeleton class="h-4" /> <USkeleton class="h-4"/>
<USkeleton class="h-4 w-2/3" /> <USkeleton class="h-4 w-2/3"/>
</div> <USkeleton class="h-4"/>
</UCard> <USkeleton class="h-4 w-2/3"/>
</template> </div>
</template> </UCard>
</div> </template>
</template>
</div>
</template> </template>
<script setup> <script setup>
defineProps({ defineProps({
......
<template> <template>
<UCard :ui="{ body: { padding: 'p-4 sm:p-4' } }"> <UCard :ui="{ body: { padding: 'p-4 sm:p-4' } }">
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<div class="flex items-center gap-2 text-lg"> <div class="flex items-center gap-2 text-lg">
<UIcon name="i-heroicons-sparkles-20-solid" /> <UIcon name="i-heroicons-sparkles-20-solid"/>
搜索过程 搜索过程
</div> </div>
<UButton <UButton
size="md" size="md"
color="gray" color="gray"
variant="ghost" variant="ghost"
:icon="openCollapse ? 'i-heroicons-chevron-up-20-solid' : 'i-heroicons-chevron-down-20-solid'" :icon="openCollapse ? 'i-heroicons-chevron-up-20-solid' : 'i-heroicons-chevron-down-20-solid'"
:ui="{ rounded: 'rounded-full' }" :ui="{ rounded: 'rounded-full' }"
@click="handleToggleCollapse" @click="handleToggleCollapse"
/> />
</div> </div>
<ICollapse :open="openCollapse" class="mt-2"> <ICollapse :open="openCollapse" class="mt-2">
<div v-auto-animate class="flex flex-col gap-2 w-full text-gray-500 dark:text-gray-400"> <div v-auto-animate class="flex flex-col gap-2 w-full text-gray-500 dark:text-gray-400">
<template v-if="status !== 'finish' && !actions.length"> <template v-if="status !== 'finish' && !actions.length">
<USkeleton class="h-4" /> <USkeleton class="h-4"/>
<USkeleton class="h-4 w-2/3" /> <USkeleton class="h-4 w-2/3"/>
</template> </template>
<template v-for="(action, index) in actions" :key="action.action"> <template v-for="(action, index) in actions" :key="action.action">
<ISearchProcessAction <ISearchProcessAction
:action="action" :action="action"
:last="actions.length === index + 1" :last="actions.length === index + 1"
:status="status" :status="status"
/> />
</template> </template>
</div> </div>
</ICollapse> </ICollapse>
</UCard> </UCard>
</template> </template>
<script setup> <script setup>
const props = defineProps({ const props = defineProps({
......
<template> <template>
<div class="text-base flex items-center gap-1"> <div class="text-base flex items-center gap-1">
<UIcon :name="item.icon" /> <UIcon :name="item.icon"/>
{{ item.name }} {{ item.name }}
</div> </div>
<template v-if="['rephrase_question', 'tool_select'].includes((action.action))"> <template v-if="['rephrase_question', 'tool_select'].includes((action.action))">
<div class="pl-5"> <div class="pl-5">
<IMdMdc :content="action.output" size="sm" /> <IMdMdc :content="action.output" size="sm"/>
</div> </div>
</template> </template>
<template v-else-if="['search_file', 'search_web'].includes(action.action)"> <template v-else-if="['search_file', 'search_web'].includes(action.action)">
<div class="text-xs pl-5">找到 {{ action.output.length }} 条来源</div> <div class="text-xs pl-5">找到 {{ action.output.length }} 条来源</div>
</template> </template>
<template v-if="last && status !== 'finish'"> <template v-if="last && status !== 'finish'">
<USkeleton class="h-4" /> <USkeleton class="h-4"/>
<USkeleton class="h-4 w-2/3" /> <USkeleton class="h-4 w-2/3"/>
</template> </template>
</template> </template>
<script setup> <script setup>
const props = defineProps({ const props = defineProps({
......
<template> <template>
<div class="grid grid-cols-1"> <div class="grid grid-cols-1">
<article class="prose dark:prose-invert max-w-none" v-html="mdHtml"/> <article class="prose dark:prose-invert max-w-none" v-html="mdHtml"/>
</div> </div>
</template> </template>
<script setup> <script setup>
import MarkdownIt from 'markdown-it' import MarkdownIt from 'markdown-it'
......
<template> <template>
<div class="w-full relative" style="aspect-ratio: 2/1"> <div class="w-full relative" style="aspect-ratio: 2/1">
<canvas ref="refChart" :aria-label="title"/> <canvas ref="refChart" :aria-label="title"/>
</div> </div>
</template> </template>
<script setup> <script setup>
import { Chart } from 'chart.js/auto'; import { Chart } from 'chart.js/auto';
......
<template> <template>
<div class="flex min-h-screen"> <div class="flex min-h-screen">
<div class="fixed top-0 w-64 hidden md:flex flex-col h-screen"> <div class="fixed top-0 w-64 hidden md:flex flex-col h-screen">
<IAside /> <IAside/>
</div> </div>
<div class="w-full ml-0 md:ml-64 bg-white dark:bg-black flex flex-grow"> <div class="w-full ml-0 md:ml-64 bg-white dark:bg-black flex flex-grow">
<slot /> <slot/>
</div> </div>
</div> </div>
<ILibraryCreate /> <ILibraryCreate/>
<ILibrarySelect @success="handleCollectSuccess" /> <ILibrarySelect @success="handleCollectSuccess"/>
</template> </template>
<script setup> <script setup>
const selectCollectData = ref(null) const selectCollectData = ref(null)
......
<template> <template>
<div class="flex flex-col items-center justify-center w-full h-full"> <div class="flex flex-col items-center justify-center w-full h-full">
<ILogo /> <ILogo/>
<div class="mt-2">开源搜索,直达结果</div> <div class="mt-2">开源搜索,直达结果</div>
<ICreate ref="refCreate" /> <ICreate ref="refCreate"/>
<div class="max-w-screen-md w-full p-6 grid grid-cols-1 lg:grid-cols-2 gap-4"> <div class="max-w-screen-md w-full p-6 grid grid-cols-1 lg:grid-cols-2 gap-4">
<template v-for="(item, index) in recommendQuestions" :key="index"> <template v-for="(item, index) in recommendQuestions" :key="index">
<UButton <UButton
class="flex justify-between" class="flex justify-between"
color="gray" color="gray"
variant="soft" variant="soft"
size="md" size="md"
:trailing-icon="item.c_id ? 'i-heroicons-chevron-right-20-solid' : 'i-heroicons-plus-20-solid'" :trailing-icon="item.c_id ? 'i-heroicons-chevron-right-20-solid' : 'i-heroicons-plus-20-solid'"
:label="item.title" :label="item.title"
:to="item.c_id ? `/search/${item.c_id}` : ''" :to="item.c_id ? `/search/${item.c_id}` : ''"
@click="handleSearch(item)" @click="handleSearch(item)"
/> />
</template> </template>
</div> </div>
</div> </div>
<IMenuSider fixed /> <IMenuSider fixed/>
</template> </template>
<script setup> <script setup>
const recommendQuestions = [ const recommendQuestions = [
......
<template> <template>
<div class="w-full p-6"> <div class="w-full p-6">
<IMdMdc :content="lineChart"/> <IMdMdc :content="lineChart"/>
<UDivider /> <UDivider/>
<IMdMdc :content="tableChart"/> <IMdMdc :content="tableChart"/>
</div> </div>
</template> </template>
<script setup> <script setup>
const lineChart = ` const lineChart = `
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册