61 lines
1.6 KiB
Vue
61 lines
1.6 KiB
Vue
<template>
|
|
<div class="relative mt-[34px] w-[100%]">
|
|
<KlTabBar v-model="query.source" :data="tabBar" />
|
|
<div class="absolute right-[0px] top-[0px] text-[16px] text-[#999999] font-normal">
|
|
<el-button type="warning" class="mr-4px" @click="handleUpload">上传工具</el-button>
|
|
共<span class="color-[#1A65FF]">{{ result?.total }}</span
|
|
>个筛选结果</div
|
|
>
|
|
<div class="content mt-[10px]">
|
|
<el-row :gutter="20">
|
|
<el-col v-for="(item, index) in result?.list" :key="index" :span="6">
|
|
<CardPicture :item-info="item" />
|
|
</el-col>
|
|
</el-row>
|
|
<el-empty v-if="!result?.list.length" :image="emptyImg"></el-empty>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import KlTabBar from '~/components/kl-tab-bar/v3/index.vue'
|
|
import CardPicture from '~/components/kl-card-picture/index.vue'
|
|
import { ref } from 'vue'
|
|
import type { pageRes, pageReq } from '~/api/upnew/types'
|
|
import emptyImg from '~/assets/images/empty.png'
|
|
import useUserStore from '~/stores/user'
|
|
|
|
const query = defineModel<pageReq>('modelValue', {
|
|
required: true,
|
|
})
|
|
const result = defineModel<pageRes | null>('result', {
|
|
required: true,
|
|
})
|
|
|
|
const tabBar = ref([
|
|
{
|
|
label: '模型推荐',
|
|
value: -1,
|
|
},
|
|
{
|
|
label: '原创模型',
|
|
value: 1,
|
|
},
|
|
{
|
|
label: '转载分享',
|
|
value: 2,
|
|
},
|
|
])
|
|
|
|
const handleUpload = () => {
|
|
// 先判断登录
|
|
const store = useUserStore()
|
|
if (!store.token) {
|
|
return ElMessage.error('请先登录')
|
|
}
|
|
navigateTo('/upnew?drawType=3')
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped></style>
|