18 changed files with 228 additions and 215 deletions
@ -1,109 +0,0 @@ |
|||||
<template> |
|
||||
<!-- Banner --> |
|
||||
<Banner :layout="layout" /> |
|
||||
|
|
||||
<div class="container md:w-screen-xl m-auto"> |
|
||||
<div class="flex flex-col" v-if="company"> |
|
||||
<Breadcrumb :data="form" :title="`插件详情`" /> |
|
||||
<div :class="company" class="page-main w-full bg-white rounded-lg"> |
|
||||
<div class="p-4 leading-7"> |
|
||||
<div class="goods-info flex"> |
|
||||
<el-avatar :src="company.companyLogo" size="large" /> |
|
||||
<div class="flex flex-col ml-2"> |
|
||||
<div class="text-lg">{{ company.tenantName }}</div> |
|
||||
<div class="text-gray-400">{{ company.comments }}</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
|
|
||||
<!-- 空白页 --> |
|
||||
<div class="mt-[60px]" v-if="!company"> |
|
||||
<el-empty description="404 页面不存在"></el-empty> |
|
||||
</div> |
|
||||
|
|
||||
</template> |
|
||||
<script setup lang="ts"> |
|
||||
import { Search } from '@element-plus/icons-vue' |
|
||||
import type {ApiResult, PageResult} from "~/api"; |
|
||||
import {useServerRequest} from "~/composables/useServerRequest"; |
|
||||
import {useWebsite} from "~/composables/configState"; |
|
||||
import type {Navigation} from "~/api/cms/navigation/model"; |
|
||||
import {getIdByParam, getPath} from "~/utils/common"; |
|
||||
import type {Company, CompanyParam} from "~/api/system/company/model"; |
|
||||
import type {Tenant} from "~/api/system/tenant/model"; |
|
||||
import {navigateTo} from "#imports"; |
|
||||
import type {Website} from "~/api/cms/website/model"; |
|
||||
import PageContainer from "~/components/PageContainer.vue"; |
|
||||
import Breadcrumb from "~/components/Breadcrumb.vue"; |
|
||||
|
|
||||
const route = useRoute(); |
|
||||
|
|
||||
// 页面信息 |
|
||||
const runtimeConfig = useRuntimeConfig(); |
|
||||
const list = ref<Company[]>([]); |
|
||||
const activeName = ref('web'); |
|
||||
const page = ref<number>(1); |
|
||||
const resultText = ref(''); |
|
||||
const layout = ref<any>(); |
|
||||
|
|
||||
// 获取状态 |
|
||||
const form = ref<Navigation>(); |
|
||||
const website = useWebsite(); |
|
||||
const company = ref<Company>() |
|
||||
|
|
||||
// 搜索表单 |
|
||||
const where = reactive<CompanyParam>({ |
|
||||
keywords: '' |
|
||||
}); |
|
||||
|
|
||||
const navTo = (item: Company) => { |
|
||||
navigateTo(`/market/${item.companyId}`) |
|
||||
} |
|
||||
|
|
||||
// 请求数据 |
|
||||
const reload = async () => { |
|
||||
|
|
||||
const { data: nav } = await useServerRequest<ApiResult<Navigation>>('/cms/cms-navigation/getNavigationByPath',{query: {path: getPath()}}) |
|
||||
if(nav.value?.data){ |
|
||||
form.value = nav.value?.data; |
|
||||
} |
|
||||
// 页面布局 |
|
||||
if(form.value?.layout){ |
|
||||
layout.value = JSON.parse(form.value?.layout) |
|
||||
} |
|
||||
useHead({ |
|
||||
title: `搜索结果 - ${website.value.websiteName}`, |
|
||||
bodyAttrs: { |
|
||||
class: "page-container", |
|
||||
} |
|
||||
}); |
|
||||
await handleClick() |
|
||||
} |
|
||||
|
|
||||
// 搜索结果 |
|
||||
const handleClick = async () => { |
|
||||
if(activeName.value == 'web'){ |
|
||||
const {data: response} = await useServerRequest<ApiResult<Company>>(`/system/company/profileAll/${getIdByParam()}`,{baseURL: runtimeConfig.public.apiServer}) |
|
||||
if(response.value?.data){ |
|
||||
if (response.value.data) { |
|
||||
company.value = response.value.data |
|
||||
} |
|
||||
if(!response.value){ |
|
||||
resultText.value = '暂无相关结果' |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
watch( |
|
||||
() => route, |
|
||||
() => { |
|
||||
reload(); |
|
||||
}, |
|
||||
{ immediate: true } |
|
||||
); |
|
||||
|
|
||||
</script> |
|
@ -0,0 +1,113 @@ |
|||||
|
<template> |
||||
|
<div class="banner m-auto relative sm:flex"> |
||||
|
<svg viewBox="0 0 1440 181" fill="none" xmlns="http://www.w3.org/2000/svg" |
||||
|
class="pointer-events-none absolute w-full top-[-2px] transition-all text-green-5 flex-shrink-0 opacity-100 duration-[400ms] opacity-80 -z-10"> |
||||
|
<mask id="path-1-inside-1_414_5526" fill="white"> |
||||
|
<path d="M0 0H1440V181H0V0Z"></path> |
||||
|
</mask> |
||||
|
<path d="M0 0H1440V181H0V0Z" fill="url(#paint0_linear_414_5526)" fill-opacity="0.22"></path> |
||||
|
<path d="M0 2H1440V-2H0V2Z" fill="url(#paint1_linear_414_5526)" mask="url(#path-1-inside-1_414_5526)"></path> |
||||
|
<defs> |
||||
|
<linearGradient id="paint0_linear_414_5526" x1="720" y1="0" x2="720" y2="181" gradientUnits="userSpaceOnUse"> |
||||
|
<stop stop-color="currentColor"></stop> |
||||
|
<stop offset="1" stop-color="currentColor" stop-opacity="0"></stop> |
||||
|
</linearGradient> |
||||
|
<linearGradient id="paint1_linear_414_5526" x1="0" y1="90.5" x2="1440" y2="90.5" gradientUnits="userSpaceOnUse"> |
||||
|
<stop stop-color="currentColor" stop-opacity="0"></stop> |
||||
|
<stop offset="0.395" stop-color="currentColor"></stop> |
||||
|
<stop offset="1" stop-color="currentColor" stop-opacity="0"></stop> |
||||
|
</linearGradient> |
||||
|
</defs> |
||||
|
</svg> |
||||
|
<div class="md:w-screen-xl m-auto md:p-0 px-4"> |
||||
|
<div class="py-8 sm:py-16" _path="/templates" _dir="" _draft="false" _partial="false" _locale="" |
||||
|
_id="content:4.templates.yml" _type="yaml" _source="content" _file="4.templates.yml" _stem="4.templates" |
||||
|
_extension="yml"> |
||||
|
<div v-if="layout"> |
||||
|
<div class="banner w-full"> |
||||
|
<h1 |
||||
|
class="text-3xl font-bold tracking-tight text-gray-900 dark:text-white sm:text-4xl lg:text-5xl"> |
||||
|
<span v-if="layout.title">{{ layout.title }}</span> |
||||
|
<span v-if="layout.name">{{ layout.name }}</span> |
||||
|
</h1> |
||||
|
|
||||
|
<div class="mt-4 text-lg text-gray-500 dark:text-gray-400 gap-8 sm:gap-y-16 grid lg:grid-cols-2 lg:items-center"> |
||||
|
{{ layout.description }} |
||||
|
</div> |
||||
|
<div class="flex justify-between w-full items-center mt-4"> |
||||
|
<el-space> |
||||
|
<div class="w-[500px] pr-10"> |
||||
|
<el-input |
||||
|
v-model="where.keywords" |
||||
|
placeholder="搜索" |
||||
|
:prefix-icon="Search" |
||||
|
@keydown.enter="handleClick" |
||||
|
> |
||||
|
<template #append> |
||||
|
<el-button size="large" type="primary" @click="handleClick">搜索</el-button> |
||||
|
</template> |
||||
|
</el-input> |
||||
|
</div> |
||||
|
</el-space> |
||||
|
<el-space> |
||||
|
<el-button size="large">我的收藏</el-button> |
||||
|
<el-button size="large">热门推荐</el-button> |
||||
|
</el-space> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import { Search } from '@element-plus/icons-vue' |
||||
|
import {useConfigInfo} from "~/composables/configState"; |
||||
|
import {openSpmUrl} from "~/utils/common"; |
||||
|
import type {CompanyParam} from "~/api/system/company/model"; |
||||
|
|
||||
|
const token = useToken(); |
||||
|
const sysDomain = useSysDomain(); |
||||
|
|
||||
|
withDefaults( |
||||
|
defineProps<{ |
||||
|
layout?: any; |
||||
|
title?: string; |
||||
|
desc?: string; |
||||
|
buyUrl?: string; |
||||
|
}>(), |
||||
|
{ |
||||
|
title: 'Templates', |
||||
|
desc: 'Explore community templates to get up and running in a few seconds.', |
||||
|
demoUrl: '/product/website', |
||||
|
buyUrl: 'https://github.com/websoft9/ansible-templates' |
||||
|
} |
||||
|
); |
||||
|
|
||||
|
// 搜索表单 |
||||
|
const where = reactive<CompanyParam>({ |
||||
|
keywords: '' |
||||
|
}); |
||||
|
|
||||
|
const config = useConfigInfo(); |
||||
|
// 搜索结果 |
||||
|
const handleClick = async () => { |
||||
|
if (where.keywords == '') { |
||||
|
return false; |
||||
|
} |
||||
|
if(activeName.value == 'web'){ |
||||
|
const {data: response} = await useServerRequest<ApiResult<PageResult<Website>>>('/cms/cms-website/page',{baseURL: runtimeConfig.public.apiServer, params: { |
||||
|
page: page.value, keywords: where.keywords |
||||
|
}}) |
||||
|
if(response.value?.data){ |
||||
|
if (response.value?.data.list) { |
||||
|
websites.value = response.value?.data.list; |
||||
|
} |
||||
|
if(response.value.data.count == 0){ |
||||
|
resultText.value = '暂无相关结果' |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
Loading…
Reference in new issue