Refactor API requests and update component imports

This commit is contained in:
wangqiao
2025-08-18 14:28:10 +08:00
parent 07b4d3de99
commit 9ae3abeded
91 changed files with 669 additions and 884 deletions

View File

@ -18,7 +18,7 @@
<div class="content mt-10px flex">
<!-- <div class="sider">
<div class="box-border h-100% h-55px w-221px flex items-center rounded-lg bg-[#1A65FF] pl-24px text-white">
<img src="@/assets/images/1.png" alt="" srcset="" />
<img src="~/assets/images/1.png" alt="" srcset="" />
<span class="ml-12px text-16px">全部资源分类</span>
</div>
<div class="side-menu border border-[#EEEEEE] border-solid">
@ -65,10 +65,10 @@
<script lang="ts" setup>
import { reactive, ref, watch } from 'vue'
import KlTabBar from '@/components/kl-tab-bar/index.vue'
// import KlCardDetail from '@/components/kl-card-detail/index.vue'
import { hotTop, hotTag } from '@/api/home/index'
import { ProjectDrawPageRespVO, ProjectDictNodeVO } from '@/api/home/type'
import KlTabBar from '~/components/kl-tab-bar/index.vue'
// import KlCardDetail from '~/components/kl-card-detail/index.vue'
import { hotTop, hotTag } from '~/api/home/index'
import type { ProjectDrawPageRespVO, ProjectDictNodeVO } from '~/api/home/type'
/** 请求参数 */
const query = reactive({
@ -105,7 +105,7 @@
/** 点击卡片 */
const handleCardClick = (item: ProjectDrawPageRespVO) => {
// 跳转到下载详情页 并且是单独开标签
window.open(`/down-drawe-detail?id=${item.id}`, '_blank') // 修改为在新窗口打开
navigateTo(`/down-drawe-detail?id=${item.id}`) // 修改为在新窗口打开
}
const handleClickType = (primary?: ProjectDictNodeVO, secondary?: ProjectDictNodeVO) => {
@ -118,11 +118,11 @@
level.unshift(normal)
}
if (query.type === 1) {
window.open(`/drawe?level=${JSON.stringify(level)}`)
navigateTo(`/drawe?level=${JSON.stringify(level)}`)
} else if (query.type === 2) {
window.open(`/text?level=${JSON.stringify(level)}`)
navigateTo(`/text?level=${JSON.stringify(level)}`)
} else if (query.type === 3) {
window.open(`/model?level=${JSON.stringify(level)}`)
navigateTo(`/model?level=${JSON.stringify(level)}`)
}
}