系统上线运行问题修改

This commit is contained in:
lSun 2025-09-22 11:14:30 +08:00
parent c06bc5fbbd
commit 79b9349598
5 changed files with 896 additions and 795 deletions

View File

@ -110,6 +110,7 @@ export const constantRoutes = [
component: () =>
import('@/views/publicService/productCenter/index.vue'),
name: 'ProductCenter',
meta: { showSearch: true } // 需要搜索框
},
// 产品中心 ---- 查看详情页面
@ -120,6 +121,7 @@ export const constantRoutes = [
'@/views/publicService/productCenter/product-detail.vue'
),
name: 'ProductDetail',
meta: { showSearch: false } // 不需要搜索框
},
// 产品中心 ---- 查看案例页面
{
@ -129,6 +131,7 @@ export const constantRoutes = [
'@/views/publicService/productCenter/product-case-list.vue'
),
name: 'ProductCaseList',
meta: { showSearch: false } // 不需要搜索框
},
// 公共组件
{
@ -136,6 +139,7 @@ export const constantRoutes = [
component: () =>
import('@/views/publicService/commonCom/index.vue'),
name: 'CommonCom',
meta: { showSearch: true } // 需要搜索框
},
// 宣传物料
{
@ -143,6 +147,7 @@ export const constantRoutes = [
component: () =>
import('@/views/publicService/proMaterials/index.vue'),
name: 'ProMaterials',
meta: { showSearch: true } // 需要搜索框
},
// 文档中心
{
@ -150,6 +155,7 @@ export const constantRoutes = [
component: () =>
import('@/views/publicService/docCenter/index.vue'),
name: 'DocCenter',
meta: { showSearch: true } // 需要搜索框
},
],
},

View File

@ -2,8 +2,8 @@
<div class="header_new">
<div class="header-content">
<div class="header-left">
<!-- <div class="logo-section" @click="handleLogoClick">-->
<div class="logo-section" >
<!-- <div class="logo-section" @click="handleLogoClick">-->
<div class="logo-section">
<img
src="../../../assets/logo/logo.png"
alt="Logo"
@ -21,19 +21,32 @@
@click="handleNavClick(item)"
:class="{ active: activeNav === item.routePath }"
>
<img :src="item.icon" :alt="item.label" class="nav-icon" />
<img :src="item.icon" :alt="item.label" class="nav-icon"/>
<span class="nav-text">{{ item.label }}</span>
</div>
</div>
<div v-if="showRightSection" class="header-right"> </div>
<div v-if="showRightSection" class="header-right">
<div v-if="showSearch" class="search-box">
<input
v-model="internalSearchKeyword"
type="text"
placeholder="输入关键词搜索"
class="search-input"
@keyup.enter="handleSearch"
/>
<button class="search-btn" @click="handleSearch">
<i class="el-icon-search"></i>
</button>
</div>
</div>
<el-dropdown
trigger="hover"
class="avatar-container right-menu-item hover-effect"
>
<div class="avatar-wrapper">
<img :src="avatar" class="user-avatar" />
<img :src="avatar" class="user-avatar"/>
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="handleLogoClick">
@ -49,8 +62,9 @@
</template>
<script>
import { mapGetters } from 'vuex'
import {mapGetters} from 'vuex'
import {getPermissions} from "../../../utils/auth";
export default {
name: 'NavBar',
props: {
@ -129,7 +143,7 @@ export default {
// activeNav: 'ProductCenter', //
userAvatarUrl: this.userAvatar,
internalSearchKeyword: this.searchKeyword,
permissions:getPermissions(),
permissions: getPermissions(),
navItems: [
{
label: '产品中心',
@ -164,6 +178,10 @@ export default {
userAvatar(newVal) {
this.userAvatarUrl = newVal
},
internalSearchKeyword(newVal) {
//
this.$emit('update:searchKeyword', newVal)
}
},
methods: {
handleNavClick(item) {
@ -173,16 +191,17 @@ export default {
})
},
handleSearch() {
// 使internalSearchKeyword
this.$emit('update:searchKeyword', this.internalSearchKeyword)
this.$emit('search', this.internalSearchKeyword)
console.log('执行搜索:', this.internalSearchKeyword)
//
this.$emit('search', this.internalSearchKeyword.trim())
},
//
handleLogoClick() {
if(this.permissions.includes(2) ){
if (this.permissions.includes(2)) {
this.$router.push('/')
}else{
} else {
//
this.$message.error('没有后台权限,请联系管理员')
}
@ -203,7 +222,8 @@ export default {
: '/index'
})
})
.catch(() => {})
.catch(() => {
})
},
},
}

View File

@ -1,11 +1,15 @@
<template>
<div class="platform-container">
<!-- 使用导航栏组件 -->
<NavBar />
<NavBar
@search="handleSearch"
:searchKeyword.sync="searchKeyword"
:showSearch="showSearch"
/>
<div class="main-content-1">
<!-- 主体内容 -->
<router-view />
<router-view :search-keyword="searchKeyword"/>
</div>
</div>
</template>
@ -19,6 +23,29 @@ export default {
components: {
NavBar,
},
data() {
return {
searchKeyword: '' //
}
},
computed: {
//
showSearch() {
//
return this.$route.meta.showSearch !== false
}
},
methods: {
//
handleSearch(keyword) {
console.log('接收到搜索关键词:', keyword)
this.searchKeyword = keyword
//
//
this.$refs.currentView?.search(keyword)
}
}
}
</script>

View File

@ -68,7 +68,6 @@
<div
class="primary-btn"
@click="handleDownload(item)"
>
@ -77,6 +76,7 @@
</div>
</div>
<DialogModel
:dialogConfig="dialogConfig"
@closeDialogOuter="handleCloseDialogOuter"
@ -105,8 +105,6 @@
</div>
</div>
</div>
</template>
@ -124,6 +122,12 @@ export default {
DialogModel,
},
dicts: ['tb_product_type'],
props: {
searchKeyword: {
type: String,
default: ''
}
},
data() {
return {
downloading: false, //
@ -189,37 +193,6 @@ export default {
}, 300);
},
//
// updateFilteredList() {
// let filtered = this.proMaterialsListAll;
//
// //
// if (this.activeTypeValue !== 'all') {
// filtered = filtered.filter(item => item.typeId === Number(this.activeTypeValue));
// }
//
// //
// if (this.selectedTypes.length > 0) {
// filtered = filtered.filter(item =>
// this.selectedTypes.includes(item.fileType.toString())
// );
// }
//
// this.showProMaterialsDuctList = filtered;
// },
//
updateFilteredList() {
this.currentPage = 1;
//
if (this.requestTimeout) {
clearTimeout(this.requestTimeout);
}
this.requestTimeout = setTimeout(() => {
this.getProductCenterListInScreenFun();
}, 300);
},
//
getItemWidth() {
this.itemWidth = (this.$refs.servicesGrid?.clientWidth - 120) / 4
@ -245,7 +218,6 @@ export default {
}
},
//
//
async handleDownload(service) {
//
@ -319,7 +291,6 @@ export default {
}
this.executeGetProductList();
},
//
@ -334,7 +305,9 @@ export default {
pageNum: this.currentPage,
pageSize: this.pageSize,
typeId: this.activeTypeValue !== 'all' ? this.activeTypeValue : undefined,
fileType: fileType
fileType: fileType,
//
name: this.searchKeyword || undefined
};
const res = await getMaterialListAPI(requestParams);
@ -419,9 +392,22 @@ export default {
}, 300);
},
//
filterMaterialsByKeyword(materials, keyword) {
if (!keyword) return materials
const lowerKeyword = keyword.toLowerCase()
return materials.filter(item =>
//
(item.name && item.name.toLowerCase().includes(lowerKeyword)) ||
(item.description && item.description.toLowerCase().includes(lowerKeyword)) ||
(item.version && item.version.toLowerCase().includes(lowerKeyword)) ||
(item.typeName && item.typeName.toLowerCase().includes(lowerKeyword))
)
}
},
//
//
watch: {
activeTypeValue() {
this.currentPage = 1;
@ -433,6 +419,29 @@ export default {
this.getProductCenterListInScreenFun();
}, 300);
},
//
searchKeyword(newVal) {
this.currentPage = 1;
//
if (this.requestTimeout) {
clearTimeout(this.requestTimeout);
}
this.requestTimeout = setTimeout(() => {
this.getProductCenterListInScreenFun();
}, 300);
},
selectedTypes() {
this.currentPage = 1;
//
if (this.requestTimeout) {
clearTimeout(this.requestTimeout);
}
this.requestTimeout = setTimeout(() => {
this.getProductCenterListInScreenFun();
}, 300);
}
},
beforeDestroy() {
if (this.requestTimeout) {

View File

@ -58,6 +58,12 @@ import { getProductCenterListAPI } from '@/api/publicService/productCenter'
export default {
name: 'ProductCenter',
dicts: ['tb_product_type'],
props: {
searchKeyword: {
type: String,
default: ''
}
},
data() {
return {
activeTypeValue: 'all', //
@ -157,19 +163,54 @@ export default {
this.productListAll = res.data
this.showProductList = this.productListAll
},
},
//
watch: {
activeTypeValue(newVal) {
if (newVal === 'all') {
this.showProductList = this.productListAll
} else {
this.showProductList = this.productListAll.filter(
(item) => item.typeId === newVal,
//
filterProductsByKeyword(products, keyword) {
if (!keyword) return products
const lowerKeyword = keyword.toLowerCase()
return products.filter(item =>
//
(item.name && item.name.toLowerCase().includes(lowerKeyword)) ||
(item.description && item.description.toLowerCase().includes(lowerKeyword)) ||
(item.typeName && item.typeName.toLowerCase().includes(lowerKeyword))
)
}
},
//
watch: {
activeTypeValue(newVal) {
let filteredProducts = []
if (newVal === 'all') {
filteredProducts = this.productListAll
} else {
filteredProducts = this.productListAll.filter(
(item) => item.typeId === newVal,
)
}
//
this.showProductList = this.filterProductsByKeyword(filteredProducts, this.searchKeyword)
},
//
searchKeyword(newVal) {
let filteredProducts = []
//
if (this.activeTypeValue === 'all') {
filteredProducts = this.productListAll
} else {
filteredProducts = this.productListAll.filter(
(item) => item.typeId === this.activeTypeValue,
)
}
//
this.showProductList = this.filterProductsByKeyword(filteredProducts, newVal)
}
},
}
</script>
@ -391,8 +432,6 @@ export default {
}
}
}
}
.category-item {