This commit is contained in:
木瓜一块八 2025-08-15 13:38:27 +08:00
parent 7d80025171
commit a21262bced
6 changed files with 142 additions and 122 deletions

View File

@ -301,89 +301,7 @@ export const asyncRoutes = [
// name: 'productHome', // name: 'productHome',
// meta: {title: "概览", fullPath: "/productHome", noCache: true} // meta: {title: "概览", fullPath: "/productHome", noCache: true}
// }, // },
{
hidden: true,
path: "/approveMangement",
component:Layout,
name: "approveMangement",
redirect: "/approveMangement/index",
meta: { fullPath: "/approveMangement", title: "审核管理", noCache: true, icon: 'el-icon-s-home' },
children: [
{
path: "pendingPro",
component: () => import("@/views/customer/approveMangement/pendingPro.vue"),
name: "pendingPro",
meta: { title: "待审清单", fullPath: "/approveMangement/index" },
},
{
path: "approvedPro",
component: () => import("@/views/customer/approveMangement/approvedPro.vue"),
name: "approvedPro",
meta: { title: "已审清单", fullPath: "/approveMangement/approvedPro" },
},
]
},
{
hidden: true,
path: "/productMangement",
component:Layout,
name: "productMangement",
redirect: "/productMangement/index",
meta: { fullPath: "/productMangement", title: "商品管理", noCache: true, icon: 'el-icon-s-home' },
children: [
{
path: "index",
component: () => import("@/views/customer/productMangement/productList/index.vue"),
name: "productList",
meta: { title: "商品发布清单", fullPath: "/productMangement/index" },
},
{
path: "rejectedPro",
component: () => import("@/views/customer/productMangement/rejectedPro/index.vue"),
name: "rejectedPro",
meta: { title: "商品未通过清单", fullPath: "/productMangement/index" },
},
]
},
{
hidden: true,
path: "/menuMangement",
component:Layout,
name: "menuMangement",
redirect: "/menuMangement/index",
meta: { fullPath: "/menuMangement", title: "菜单管理", noCache: true, icon: 'el-icon-s-home' },
children: [
{
path: "index",
component: () => import("@/views/operation/menuMangement/index.vue"),
name: "menuMangement",
meta: { title: "菜单管理", fullPath: "/menuMangement/index" },
},
]
},
{
hidden: true,
path: "/demandMangement",
component:Layout,
name: "demandMangement",
redirect: "/demandMangement/index",
meta: { fullPath: "/demandMangement", title: "需求管理", noCache: true, icon: 'el-icon-s-home' },
children: [
{
path: "index",
component: () => import("@/views/customer/demand/demandList.vue"),
name: "demandList",
meta: { title: "需求发布清单", fullPath: "/demandMangement/index" },
},
{
path: "rejectDemand",
component: () => import("@/views/customer/demand/rejectDemand.vue"),
name: "rejectDemand",
meta: { title: "需求未通过清单", fullPath: "/demandMangement/rejectDemand" },
},
]
},
{ {
path: getHomePath() == '/ncmatchHome/index' ? "/ncmatchHome" : "/homePage", path: getHomePath() == '/ncmatchHome/index' ? "/ncmatchHome" : "/homePage",
@ -936,7 +854,90 @@ export const asyncRoutes = [
name: "ProductIndex", name: "ProductIndex",
meta: { title: "产品最新页", fullPath: "/product/productHome/productIndex", noCache: true }, meta: { title: "产品最新页", fullPath: "/product/productHome/productIndex", noCache: true },
},], },],
}, { },
{
path: "/approveMangement",
component:Layout,
name: "approveMangement",
redirect: "/approveMangement/index",
meta: { fullPath: "/approveMangement", title: "审核管理", noCache: true, icon: 'el-icon-s-home' },
children: [
{
path: "pendingPro",
component: () => import("@/views/customer/approveMangement/pendingPro.vue"),
name: "pendingPro",
meta: { title: "待审清单", fullPath: "/approveMangement/index" },
},
{
path: "approvedPro",
component: () => import("@/views/customer/approveMangement/approvedPro.vue"),
name: "approvedPro",
meta: { title: "已审清单", fullPath: "/approveMangement/approvedPro" },
},
]
},
{
path: "/productMangement",
component:Layout,
name: "productMangement",
redirect: "/productMangement/index",
meta: { fullPath: "/productMangement", title: "商品管理", noCache: true, icon: 'el-icon-s-home' },
children: [
{
path: "index",
component: () => import("@/views/customer/productMangement/productList/index.vue"),
name: "productList",
meta: { title: "商品发布清单", fullPath: "/productMangement/index" },
},
{
path: "rejectedPro",
component: () => import("@/views/customer/productMangement/rejectedPro/index.vue"),
name: "rejectedPro",
meta: { title: "商品未通过清单", fullPath: "/productMangement/index" },
},
]
},
{
hidden: true,
path: "/menuMangement",
component:Layout,
name: "menuMangement",
redirect: "/menuMangement/index",
meta: { fullPath: "/menuMangement", title: "菜单管理", noCache: true, icon: 'el-icon-s-home' },
children: [
{
path: "index",
component: () => import("@/views/operation/menuMangement/index.vue"),
name: "menuMangement",
meta: { title: "菜单管理", fullPath: "/menuMangement/index" },
},
]
},
{
path: "/demandMangement",
component:Layout,
name: "demandMangement",
redirect: "/demandMangement/index",
meta: { fullPath: "/demandMangement", title: "需求管理", noCache: true, icon: 'el-icon-s-home' },
children: [
{
path: "index",
component: () => import("@/views/customer/demand/demandList.vue"),
name: "demandList",
meta: { title: "需求发布清单", fullPath: "/demandMangement/index" },
},
{
path: "rejectDemand",
component: () => import("@/views/customer/demand/rejectDemand.vue"),
name: "rejectDemand",
meta: { title: "需求未通过清单", fullPath: "/demandMangement/rejectDemand" },
},
]
},
{
path: "/sales", component: Layout, path: "/sales", component: Layout,
meta: { meta: {

View File

@ -14,7 +14,8 @@ export default {
return { return {
role:{ role:{
role_type:'customer', role_type:'customer',
audit_status:'pending' audit_status:'pending',
type:'app'
} }
} }
}, },

View File

@ -22,7 +22,7 @@
</div> </div>
<div class="table-box"> <div class="table-box">
<div style="margin-bottom: 10px;"> <div style="margin-bottom: 10px;">
<el-radio-group v-if="role.role_type == 'customer'" v-model="searchData.radioType" class="radio-group" <el-radio-group v-if="role.type == 'app'" v-model="searchData.radioType" class="radio-group"
size="mini" @change="handleRadioChange"> size="mini" @change="handleRadioChange">
<el-radio-button v-for="item in radioOptions" :key="item.value" :label="item.value"> <el-radio-button v-for="item in radioOptions" :key="item.value" :label="item.value">
{{ item.label }} {{ item.label }}
@ -32,24 +32,24 @@
<i class="el-icon-plus"></i> 添加{{ searchData.radioType === '1' || searchData.radioType === '3' ? <i class="el-icon-plus"></i> 添加{{ searchData.radioType === '1' || searchData.radioType === '3' ?
'需求' : '商品' }} '需求' : '商品' }}
</el-button> --> </el-button> -->
<!-- <el-button style="margin-left: 10px;" size="mini" @click="exportData"> <!-- <el-button style="margin-left: 10px;" size="mini" @click="exportAllData">
<i class="el-icon-upload2"></i> 导出 <i class="el-icon-upload2"></i> 全部导出
</el-button> --> </el-button> -->
</div> </div>
<el-table border height="calc(100vh - 210px)" v-loading="loading" :data="tableData" <el-table size="mini" border height="calc(100vh - 210px)" v-loading="loading" :data="tableData"
style="width: 100%;border:1px solid #ccc;" element-loading-text="加载中..." style="width: 100%;border:1px solid #ccc;" element-loading-text="加载中..."
element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)"> element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)">
<el-table-column prop="date" label="商品图片" width="180"> <el-table-column prop="date" label="图片" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-image v-if="scope.row.img" :src="scope.row.img || 'https://www.kaiyuancloud.cn/idfile?path=logo_ncmatch.png'"
<el-image :src="scope.row.img || 'https://www.kaiyuancloud.cn/idfile?path=logo_ncmatch.png'"
style="width: 80px; height: 60px;border: 1px solid #ccc;border-radius: 6px;" style="width: 80px; height: 60px;border: 1px solid #ccc;border-radius: 6px;"
:preview-src-list="[scope.row.img || 'https://www.kaiyuancloud.cn/idfile?path=logo_ncmatch.png']" :preview-src-list="[scope.row.img || 'https://www.kaiyuancloud.cn/idfile?path=logo_ncmatch.png']"
fit="cover" :initial-index="0" preview-teleported :z-index="3000"> fit="cover" :initial-index="0" preview-teleported :z-index="3000">
</el-image> </el-image>
<span v-else>/</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="product_name" show-overflow-tooltip label="商品名称" min-width="180"> <el-table-column prop="product_name" show-overflow-tooltip label="名称" min-width="180">
</el-table-column> </el-table-column>
<el-table-column prop="product_category" show-overflow-tooltip label="所属类别" min-width="180"> <el-table-column prop="product_category" show-overflow-tooltip label="所属类别" min-width="180">
</el-table-column> </el-table-column>
@ -82,7 +82,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="create_at" show-overflow-tooltip label="创建时间" min-width="180"> <el-table-column prop="create_at" show-overflow-tooltip label="创建时间" min-width="180">
</el-table-column> </el-table-column>
<el-table-column fixed="right" min-width="240" label="操作"> <el-table-column fixed="right" min-width="260" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="openDetail(scope.row, 1)">查看</el-button> <el-button type="text" size="small" @click="openDetail(scope.row, 1)">查看</el-button>
<el-button @click="editProduct(scope.row)" type="text" style="color: #409EFF;" <el-button @click="editProduct(scope.row)" type="text" style="color: #409EFF;"
@ -92,11 +92,11 @@
<!-- <el-button type="text" style="color: #E6A23C;" size="small">导出</el-button> --> <!-- <el-button type="text" style="color: #E6A23C;" size="small">导出</el-button> -->
<el-button <el-button
:disabled="scope.row.audit_status === 'approved' && scope.row.listing_status === 'listing'" :disabled="scope.row.audit_status=='rejected'||scope.row.audit_status === 'approved' && scope.row.listing_status === 'listing'"
@click="grounding(scope.row, 'listing')" type="text" style="color: #67C23A;" @click="grounding(scope.row, 'listing')" type="text" style="color: #67C23A;"
size="small">上架</el-button> size="small">上架</el-button>
<el-button <el-button
:disabled="scope.row.audit_status === 'approved' && scope.row.listing_status === 'delisting'" :disabled="scope.row.audit_status=='rejected'||scope.row.audit_status === 'approved' && scope.row.listing_status === 'delisting'"
@click="grounding(scope.row, 'delisting')" type="text" size="small">下架</el-button> @click="grounding(scope.row, 'delisting')" type="text" size="small">下架</el-button>
<el-button type="text" size="small" @click="exportData(scope.row)">导出</el-button> <el-button type="text" size="small" @click="exportData(scope.row)">导出</el-button>
<el-popconfirm v-if="role.role_type == 'customer'" title="确定删除该条目吗?" <el-popconfirm v-if="role.role_type == 'customer'" title="确定删除该条目吗?"
@ -281,6 +281,9 @@ export default {
} }
}, },
methods: { methods: {
exportAllData(){
console.log("全部导出");
},
deleteProduct(row) { deleteProduct(row) {
console.log(row); console.log(row);
let ploay = { let ploay = {

View File

@ -31,7 +31,7 @@
<div class="user-area"> <div class="user-area">
<a @click="$router.push('/product/productHome')" v-if="loginState" class="login-btn">控制台</a> <a @click="goB" v-if="loginState" class="login-btn">控制台</a>
<a @click="$router.push({ <a @click="$router.push({
path:'/login', path:'/login',
query:{ query:{
@ -306,6 +306,13 @@ export default Vue.extend({
// }, // },
methods: { methods: {
goB() {
if (sessionStorage.getItem('jueseNew').includes('客户')) {
this.$router.push('/product/productHome')
} else if (sessionStorage.getItem('jueseNew').includes('运营')) {
this.$router.push('/operation/supplierManagement')
}
},
init() { init() {
// let params = { // let params = {
// url_link: this.GetQueryString(window.location.href) // url_link: this.GetQueryString(window.location.href)

View File

@ -10,8 +10,7 @@
<span class="category-name">{{ category.first_level_name }}</span> <span class="category-name">{{ category.first_level_name }}</span>
<span style="display: flex;margin-left: 0px;padding-left: 0px;">|</span> <span style="display: flex;margin-left: 0px;padding-left: 0px;">|</span>
<div class="menu-item"> <div class="menu-item">
<span v-for="(secondary, index) in category.secondaryClassification" <span v-for="(secondary, index) in category.secondaryClassification" :key="secondary.id">
:key="secondary.id">
{{ secondary.second_level_name }}{{ index < category.secondaryClassification.length - 1 ? ' / ' {{ secondary.second_level_name }}{{ index < category.secondaryClassification.length - 1 ? ' / '
: '' }} </span> : '' }} </span>
</div> </div>
@ -19,13 +18,14 @@
</ul> </ul>
<transition name="slide-fade"> <transition name="slide-fade">
<!-- v-if="currentCategory" --> <!-- v-if="currentCategory" -->
<div v-loading="loading" element-loading-text="加载中..." element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)" class="rightBox" v-if="currentCategory" @mouseenter="keepProductList" @mouseleave="hideProductList"> <div v-loading="loading" element-loading-text="加载中..." element-loading-spinner="el-icon-loading"
element-loading-background="rgba(255, 255, 255, 0.8)" class="rightBox" v-if="currentCategory"
@mouseenter="keepProductList" @mouseleave="hideProductList">
<div class="rightBox-content"> <div class="rightBox-content">
<!-- 二级菜单标题 --> <!-- 二级菜单标题 -->
<div class="secondary-menu"> <div class="secondary-menu">
<div v-for="secondary in currentCategory.secondaryClassification" <div v-for="secondary in currentCategory.secondaryClassification" :key="secondary.id"
:key="secondary.id" class="secondary-item" class="secondary-item" :class="{ active: selectedSecondary === secondary }"
:class="{ active: selectedSecondary === secondary }"
@mouseenter="selectSecondary(secondary)"> @mouseenter="selectSecondary(secondary)">
{{ secondary.second_level_name }} {{ secondary.second_level_name }}
</div> </div>
@ -47,14 +47,15 @@
<!-- 如果有四级菜单product_list直接显示所有四级菜单项 --> <!-- 如果有四级菜单product_list直接显示所有四级菜单项 -->
<div v-if="third.product_list && third.product_list.length > 0" <div v-if="third.product_list && third.product_list.length > 0"
class="product-grid"> class="product-grid">
<div v-for="(product, index) in third.product_list" <div @click="openTalk" v-for="(product, index) in third.product_list"
:key="product.id" class="product-tag"> :key="product.id"
class="product-tag">
{{ product.first_level_name }} {{ product.first_level_name }}
</div> </div>
</div> </div>
<!-- 如果没有四级菜单将三级菜单项视为四级菜单项显示 --> <!-- 如果没有四级菜单将三级菜单项视为四级菜单项显示 -->
<div v-else class="product-grid"> <div v-else class="product-grid">
<div class="product-tag "> <div @click="openTalk" class="product-tag ">
{{ third.third_level_name }} {{ third.third_level_name }}
</div> </div>
</div> </div>
@ -81,8 +82,8 @@
<!-- 默认显示所有二级菜单项 --> <!-- 默认显示所有二级菜单项 -->
<div v-else class="jd-style-menu"> <div v-else class="jd-style-menu">
<div v-for="secondary in currentCategory.secondaryClassification" <div v-for="secondary in currentCategory.secondaryClassification" :key="secondary.id"
:key="secondary.id" class="category-section"> class="category-section">
<div class="section-header"> <div class="section-header">
<span class="section-title">{{ secondary.second_level_name }}</span> <span class="section-title">{{ secondary.second_level_name }}</span>
<span class="section-arrow">></span> <span class="section-arrow">></span>
@ -100,19 +101,24 @@
</div> </div>
</div> </div>
</transition> </transition>
<Talk></Talk>
</aside> </aside>
</template> </template>
<script> <script>
import { reqNcMatchMenu } from '@/api/ncmatch'; import { reqNcMatchMenu } from '@/api/ncmatch';
import { buildDynamicStructure } from './buildNcmatchTree'; import { buildDynamicStructure } from './buildNcmatchTree';
import Talk from '@/views/homePage/dialog/talk/index.vue';
export default { export default {
name: 'menuAside', name: 'menuAside',
components: {
Talk
},
data() { data() {
return { return {
currentCategory: null, currentCategory: null,
selectedSecondary: null, selectedSecondary: null,
hideTimer: null, hideTimer: null,
categories: [ ], categories: [],
loading: false, loading: false,
} }
}, },
@ -120,14 +126,18 @@ export default {
this.getCategories(); this.getCategories();
}, },
methods: { methods: {
async openTalk() {
await this.hideProductList('quick')
this.$store.commit('setShowTalk', true);
},
getCategories() { getCategories() {
this.loading = true; this.loading = true;
reqNcMatchMenu({ url_link: window.location.href }).then(res => { reqNcMatchMenu({ url_link: window.location.href }).then(res => {
this.loading = false; this.loading = false;
if (res.status) { if (res.status) {
this.categories = buildDynamicStructure(res.data) this.categories = buildDynamicStructure(res.data)
console.log("测试",this.categories); console.log("测试", this.categories);
// this.categories = res.data.map(item => { // this.categories = res.data.map(item => {
// return { // return {
// name: item.name, // name: item.name,
@ -163,7 +173,13 @@ export default {
this.hideTimer = null; this.hideTimer = null;
} }
}, },
hideProductList() { hideProductList(type) {
if (type === 'quick') {
this.currentCategory = null;
this.selectedSecondary = null;
this.hideTimer = null;
return
}
// rightBox // rightBox
this.hideTimer = setTimeout(() => { this.hideTimer = setTimeout(() => {
this.currentCategory = null; this.currentCategory = null;
@ -258,14 +274,13 @@ export default {
position: absolute; position: absolute;
left: 100%; left: 100%;
top: 0; top: 0;
border: 1px solid red;
width: 1000px; width: 1000px;
background: white; background: white;
border-radius: 8px; border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
z-index: 9999; z-index: 9999;
padding: 25px; padding: 25px;
// height: 500px; min-height: 350px;
margin-left: 10px; margin-left: 10px;
overflow: visible; overflow: visible;
white-space: nowrap; white-space: nowrap;
@ -316,20 +331,17 @@ export default {
height: 100%; height: 100%;
max-height: calc(100vh - 280px); max-height: calc(100vh - 280px);
overflow-y: auto; overflow-y: auto;
border: 5px solid red;
.jd-style-menu { .jd-style-menu {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 20px; gap: 20px;
border: 1px solid red;
.category-section { .category-section {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
border: 1px solid blue;
.section-header { .section-header {
display: flex; display: flex;
@ -340,8 +352,6 @@ export default {
font-size: 12px; font-size: 12px;
font-weight: 600; font-weight: 600;
color: #333; color: #333;
border: 1px solid red;
;
margin-right: 8px; margin-right: 8px;
} }
@ -361,9 +371,7 @@ export default {
align-items: center; align-items: center;
.product-tag { .product-tag {
border: 1px solid red;
height: fit-content !important; height: fit-content !important;
background: #f8f9fa;
font-size: 12px; font-size: 12px;
color: #666; color: #666;
cursor: pointer; cursor: pointer;

View File

@ -1,6 +1,6 @@
export function getHomePath() { export function getHomePath() {
let homePath= "/homePage/index" // let homePath= "/homePage/index"
// let homePath= "/ncmatchHome/index" let homePath= "/ncmatchHome/index"
// 业主机构信息 // 业主机构信息
let url_link = window.location.href || ''; let url_link = window.location.href || '';