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

eslint Vue template

上级 c820bd9e
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
: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>
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
<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"
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"/>
<UButton <UButton
:ui="{ rounded: 'rounded-full' }" :ui="{ rounded: 'rounded-full' }"
:icon="isPro ? 'i-heroicons-sparkles-20-solid' : 'i-heroicons-sparkles-20-solid'" :icon="isPro ? 'i-heroicons-sparkles-20-solid' : 'i-heroicons-sparkles-20-solid'"
...@@ -45,9 +46,9 @@ ...@@ -45,9 +46,9 @@
</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"
......
<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>
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
/> />
</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
class="flex overflow-y-auto flex-col gap-1 border-l border-gray-200 dark:border-gray-800 pl-2 ml-5">
<template v-for="item in $searchHistory.reverse()" :key="item.c_id"> <template v-for="item in $searchHistory.reverse()" :key="item.c_id">
<UButton <UButton
class="flex text-gray-400" class="flex text-gray-400"
......
...@@ -6,16 +6,16 @@ ...@@ -6,16 +6,16 @@
<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">
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
/> />
<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' }"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
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'
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<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>
......
<template> <template>
<ILibraryCreate :id="id" ref="refCreate" /> <ILibraryCreate :id="id" ref="refCreate"/>
</template> </template>
<script setup> <script setup>
defineProps({ defineProps({
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
> >
<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"
class="text-primary text-lg"/>
</div> </div>
</UButton> </UButton>
</div> </div>
......
...@@ -2,15 +2,12 @@ ...@@ -2,15 +2,12 @@
<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">
...@@ -13,9 +13,11 @@ ...@@ -13,9 +13,11 @@
<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 }}
</ULink>
<UIcon class="flex-shrink-0" name="i-heroicons-arrow-top-right-on-square"/>
</div> </div>
</div> </div>
</template> </template>
...@@ -40,10 +42,10 @@ ...@@ -40,10 +42,10 @@
<template v-else> <template v-else>
<UCard :ui="cardUI"> <UCard :ui="cardUI">
<div class="flex flex-col gap-1"> <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"/>
<USkeleton class="h-4" /> <USkeleton class="h-4"/>
<USkeleton class="h-4 w-2/3" /> <USkeleton class="h-4 w-2/3"/>
</div> </div>
</UCard> </UCard>
</template> </template>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<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
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
<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
......
<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>
......
<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
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</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>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册