公共品牌新增
This commit is contained in:
parent
a60301fba5
commit
85285d80c1
@ -1,10 +1,3 @@
|
||||
<!--
|
||||
* @Description:
|
||||
* @Author: zenghua.wang
|
||||
* @Date: 2023-06-20 14:29:45
|
||||
* @LastEditors: zenghua.wang
|
||||
* @LastEditTime: 2025-01-24 15:11:22
|
||||
-->
|
||||
<template>
|
||||
<div class="layout-header-placeholder" :style="stylePlaceholder()"></div>
|
||||
<div
|
||||
|
@ -25,12 +25,12 @@ export default [
|
||||
name: 'grid1',
|
||||
meta: { title: '新增网格', icon: '' },
|
||||
},
|
||||
{
|
||||
path: '/sub-government-affairs-service/grid',
|
||||
component: () => import('@/views/resource/grid/index.vue'),
|
||||
name: 'grid2',
|
||||
meta: { title: '网格化地图', icon: '' },
|
||||
},
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/grid',
|
||||
// component: () => import('@/views/resource/grid/index.vue'),
|
||||
// name: 'grid2',
|
||||
// meta: { title: '网格化地图', icon: '' },
|
||||
// },
|
||||
],
|
||||
},
|
||||
...annualplanRouters,
|
||||
|
@ -31,6 +31,7 @@
|
||||
"hls.js": "^1.6.2",
|
||||
"js-base64": "^3.7.6",
|
||||
"lodash": "^4.17.21",
|
||||
"marked": "^15.0.12",
|
||||
"moment": "^2.30.1",
|
||||
"nprogress": "^0.2.0",
|
||||
"path-browserify": "^1.0.1",
|
||||
|
@ -7,6 +7,7 @@
|
||||
*/
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import Layout from '@/layouts/index.vue';
|
||||
import BrandLayout from '@/views/brand/index.vue';
|
||||
import Views from '@/layouts/Views.vue';
|
||||
import userCentre from '@/layouts/userCentre.vue';
|
||||
|
||||
@ -224,43 +225,37 @@ export const constantRoutes = [
|
||||
meta: { title: '公共品牌' },
|
||||
children: [
|
||||
{
|
||||
path: 'apply',
|
||||
component: () => import('@/views/brand/index.vue'),
|
||||
path: '',
|
||||
component: BrandLayout,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: () => import('@/views/brand/components/ApplyList.vue'),
|
||||
path: 'apply',
|
||||
name: 'brandApplyList',
|
||||
component: () => import('@/views/brand/components/ApplyList.vue'),
|
||||
meta: { title: '使用申请' },
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
component: () => import('@/views/brand/components/ApplyDetail.vue'),
|
||||
path: 'apply/:id',
|
||||
name: 'brandApplyDetail',
|
||||
component: () => import('@/views/brand/components/ApplyDetail.vue'),
|
||||
meta: { title: '产品申请' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'auth',
|
||||
component: () => import('@/views/brand/index.vue'),
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: () => import('@/views/brand/components/Auth.vue'),
|
||||
path: 'auth/record',
|
||||
name: 'brandAuth',
|
||||
meta: { title: '授权管理' },
|
||||
component: () => import('@/views/brand/components/Auth.vue'),
|
||||
meta: { title: '授权记录' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'monitor',
|
||||
component: () => import('@/views/brand/index.vue'),
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: () => import('@/views/brand/components/Monitor.vue'),
|
||||
path: 'auth/system',
|
||||
name: 'brandSystem',
|
||||
component: () => import('@/views/brand/components/BrandSystem.vue'),
|
||||
meta: { title: '品牌制度' },
|
||||
},
|
||||
{
|
||||
path: 'monitor',
|
||||
name: 'brandMonitor',
|
||||
component: () => import('@/views/brand/components/Monitor.vue'),
|
||||
meta: { title: '使用监管' },
|
||||
},
|
||||
],
|
||||
|
@ -63,7 +63,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-action">
|
||||
<el-tag :class="statusClass(activeTab)" :type="statusTypeMap[product.status]">{{ product.statusLabel }}</el-tag>
|
||||
<el-tag :class="statusClass(activeStatus)" :type="statusTypeMap[product.status]">{{ product.statusLabel }}</el-tag>
|
||||
<el-button
|
||||
v-if="product.status === 'authorized'"
|
||||
type="primary"
|
||||
@ -204,7 +204,7 @@ const handleCertificate = (product) => {
|
||||
height: 100%;
|
||||
}
|
||||
.product-list {
|
||||
height: 100%;
|
||||
height: calc(100% - 40px);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
|
504
sub-operation-service/src/views/brand/components/BrandSystem.vue
Normal file
504
sub-operation-service/src/views/brand/components/BrandSystem.vue
Normal file
@ -0,0 +1,504 @@
|
||||
<template>
|
||||
<div class="brand-system">
|
||||
<!-- 搜索与筛选 -->
|
||||
<div class="system-header">
|
||||
<el-input v-model="searchQuery" placeholder="搜索制度名称/编号" prefix-icon="el-icon-search" />
|
||||
<el-select v-model="filterType" placeholder="分类筛选">
|
||||
<el-option v-for="type in filterTypes" :key="type.value" :label="type.label" :value="type.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- 制度列表 -->
|
||||
<div class="system-list">
|
||||
<div v-for="(item, index) in filteredList" :key="index" class="system-card" @click="showDetail(item)">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<i class="el-icon-document"></i>
|
||||
{{ item.title }}
|
||||
</div>
|
||||
<div class="card-meta">
|
||||
<span>编号:{{ item.code }}</span>
|
||||
<span>版本:v{{ item.version }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<p>{{ item.desc }}</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<span :class="`status-tag ${item.status === '生效中' ? 'active' : 'inactive'}`">{{ item.status }}</span>
|
||||
<span>生效日期:{{ item.effectiveDate }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 浮层弹窗 -->
|
||||
<transition name="fade">
|
||||
<div v-if="showDialog" class="dialog-mask" @click.self="hideDetail">
|
||||
<div class="dialog-container" :style="{ width: dialogWidth }">
|
||||
<div class="dialog-header">
|
||||
<div class="header-left">
|
||||
<h3>{{ currentDetail.title }}</h3>
|
||||
<div class="dialog-meta">
|
||||
<span>编号:{{ currentDetail.code }}</span>
|
||||
<span>版本:v{{ currentDetail.version }}</span>
|
||||
<span :class="`status-tag ${currentDetail.status === '生效中' ? 'active' : 'inactive'}`">{{ currentDetail.status }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dialog-actions">
|
||||
<el-button icon="el-icon-download" @click.stop="downloadDoc(currentDetail)">下载</el-button>
|
||||
<el-button icon="el-icon-printer" @click.stop="printDoc">打印</el-button>
|
||||
<i class="el-icon-close" @click="hideDetail"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dialog-content">
|
||||
<!-- 使用Markdown-it渲染的HTML内容 -->
|
||||
<div class="doc-preview" v-html="compiledMarkdown"></div>
|
||||
</div>
|
||||
<div class="dialog-footer">
|
||||
<div class="footer-info">
|
||||
<p>制定部门:{{ currentDetail.department }}</p>
|
||||
<p>发布日期:{{ currentDetail.publishDate }}</p>
|
||||
</div>
|
||||
<el-button @click="hideDetail">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { ElMessage, ElButton } from 'element-plus';
|
||||
|
||||
// 筛选类型
|
||||
const filterTypes = [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '管理规范', value: 'management' },
|
||||
{ label: '推广制度', value: 'promotion' },
|
||||
{ label: '评估体系', value: 'evaluation' },
|
||||
];
|
||||
|
||||
// 状态管理
|
||||
const searchQuery = ref('');
|
||||
const filterType = ref('');
|
||||
const showDialog = ref(false);
|
||||
const currentDetail = ref({});
|
||||
const dialogWidth = ref('800px');
|
||||
|
||||
// 增强型数据集
|
||||
const systemList = ref([
|
||||
{
|
||||
title: '品牌管理规范V2.0',
|
||||
code: 'BRM-2023-001',
|
||||
desc: '包含品牌标识、使用规范、VI应用等内容的最新版本',
|
||||
content:
|
||||
'# 品牌管理规范 V2.0\n\n## 第一章 总则\n第一条 本规范适用于集团所有子品牌管理...\n\n## 第二章 标识使用\n第五条 品牌标识不得在以下场景使用:\n1. 非官方宣传材料\n2. 竞品对比文档\n3. 未经审批的第三方平台\n\n## 第三章 数字资产\n第九条 数字资源库包含:\n- 官方LOGO矢量文件\n- 品牌色卡(CMYK/RGB/HEX)\n- 字体库授权文件\n\n## 第四章 附则\n第十二条 本规范自2023年9月1日起生效,原有版本自动废止。',
|
||||
type: 'management',
|
||||
file: 'BRM-2023-001.docx',
|
||||
version: '2.0',
|
||||
effectiveDate: '2023-09-01',
|
||||
status: '生效中',
|
||||
department: '品牌管理中心',
|
||||
publishDate: '2023-08-25',
|
||||
},
|
||||
{
|
||||
title: '品牌推广制度V1.3',
|
||||
code: 'BRP-2023-005',
|
||||
desc: '包含线上线下推广策略、预算分配及效果评估标准',
|
||||
content:
|
||||
'# 品牌推广制度 V1.3\n\n## 第一章 推广策略\n\n### 第五条 渠道配置\n- 数字媒体:占比40%\n- 户外广告:占比25%\n- 活动营销:占比20%\n- 公关传播:占比15%\n\n## 第二章 预算管理\n\n### 第十条 预算审批流程\n市场部提交方案 → 财务部审核 → 副总裁审批 → 执行备案\n\n## 第三章 效果评估\n\n### 第十六条 KPI指标\n| 指标 | 目标值 | 评估周期 |\n|-------|-------|---------|\n| 品牌认知度 | ≥75% | 季度 |\n| 媒体曝光量 | ≥500万次 | 月度 |\n| 转化率 | ≥3.5% | 月度 |',
|
||||
type: 'promotion',
|
||||
file: 'BRP-2023-005.docx',
|
||||
version: '1.3',
|
||||
effectiveDate: '2023-07-15',
|
||||
status: '生效中',
|
||||
department: '市场推广部',
|
||||
publishDate: '2023-07-10',
|
||||
},
|
||||
{
|
||||
title: '品牌评估体系V1.0',
|
||||
code: 'BRA-2023-003',
|
||||
desc: '基于市场反馈和财务数据的品牌价值评估方法与指标',
|
||||
content:
|
||||
'# 品牌评估体系 V1.0\n\n## 一、评估维度\n\n### 1.1 市场维度\n- 市场份额增长率\n- 客户满意度评分\n- 行业影响力指数\n\n### 1.2 财务维度\n- 品牌溢价率\n- ROI计算公式\n- 资产回报率\n\n## 二、评估周期\n\n| 级别 | 评估频率 |\n|------|---------|\n| 核心品牌 | 月度 |\n| 重点品牌 | 双月度 |\n| 新兴品牌 | 季度 |\n## 三、数据采集\n- CRM系统数据\n- 财务报表\n- 第三方调研报告',
|
||||
type: 'evaluation',
|
||||
file: 'BRA-2023-003.docx',
|
||||
version: '1.0',
|
||||
effectiveDate: '2023-06-01',
|
||||
status: '生效中',
|
||||
department: '战略发展部',
|
||||
publishDate: '2023-05-28',
|
||||
},
|
||||
]);
|
||||
|
||||
// 过滤列表
|
||||
const filteredList = computed(() => {
|
||||
return systemList.value.filter((item) => {
|
||||
const matchSearch =
|
||||
item.title.toLowerCase().includes(searchQuery.value.toLowerCase()) ||
|
||||
item.desc.toLowerCase().includes(searchQuery.value.toLowerCase()) ||
|
||||
item.code.toLowerCase().includes(searchQuery.value.toLowerCase());
|
||||
const matchFilter = filterType.value ? item.type === filterType.value : true;
|
||||
return matchSearch && matchFilter;
|
||||
});
|
||||
});
|
||||
|
||||
// 显示详情
|
||||
const showDetail = (item) => {
|
||||
currentDetail.value = item;
|
||||
showDialog.value = true;
|
||||
};
|
||||
|
||||
// 隐藏详情
|
||||
const hideDetail = () => {
|
||||
showDialog.value = false;
|
||||
};
|
||||
|
||||
// 下载文档
|
||||
const downloadDoc = (item) => {
|
||||
ElMessage.success({
|
||||
message: `开始下载 ${item.file} (${item.code})`,
|
||||
duration: 1500,
|
||||
});
|
||||
// 实际开发中可替换为真实的下载逻辑
|
||||
// window.open(`/api/download/${item.id}`);
|
||||
};
|
||||
|
||||
// 打印功能
|
||||
const printDoc = () => {
|
||||
ElMessage.info('准备打印文档...');
|
||||
// 实际开发中可集成打印功能
|
||||
// window.print();
|
||||
};
|
||||
|
||||
// 在setup函数中
|
||||
|
||||
// 恢复 marked 导入
|
||||
import { marked } from 'marked';
|
||||
|
||||
// 恢复 computed 属性
|
||||
const compiledMarkdown = computed(() => {
|
||||
return marked.parse(currentDetail.value.content);
|
||||
});
|
||||
|
||||
// 在 setup 函数中配置 editor
|
||||
const editorConfig = {
|
||||
readOnly: true,
|
||||
placeholder: '暂无内容',
|
||||
showToolbar: false,
|
||||
// 启用 Markdown 解析
|
||||
parseMarkdown: true,
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$color-primary: #25bf82;
|
||||
$color-bg: #f5f7fa;
|
||||
$color-border: #e4e4e4;
|
||||
$color-text: #333;
|
||||
$color-meta: #666;
|
||||
$color-success: #67c23a;
|
||||
$color-danger: #ff4949;
|
||||
|
||||
.brand-system {
|
||||
padding: 20px;
|
||||
background: #fff;
|
||||
border-radius: 16px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.system-header {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
margin-bottom: 24px;
|
||||
.el-input {
|
||||
width: 240px;
|
||||
.el-input__inner {
|
||||
border-radius: 8px;
|
||||
border-color: $color-border;
|
||||
&:focus {
|
||||
border-color: $color-primary;
|
||||
box-shadow: 0 0 0 2px rgba(37, 191, 130, 0.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
.el-select {
|
||||
width: 160px;
|
||||
.el-input__inner {
|
||||
border-radius: 8px;
|
||||
border-color: $color-border;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.system-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
gap: 24px;
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.system-card {
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
border: 1px solid $color-border;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
|
||||
overflow: hidden;
|
||||
&:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.1);
|
||||
.card-header {
|
||||
background-color: lighten($color-primary, 40%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-header {
|
||||
padding: 16px;
|
||||
background-color: $color-bg;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: $color-text;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 8px;
|
||||
.el-icon-document {
|
||||
margin-right: 8px;
|
||||
color: $color-primary;
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
.card-meta {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
font-size: 12px;
|
||||
color: $color-meta;
|
||||
}
|
||||
|
||||
.card-content {
|
||||
padding: 16px;
|
||||
font-size: 14px;
|
||||
color: $color-text;
|
||||
line-height: 1.5;
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
.card-footer {
|
||||
padding: 12px 16px;
|
||||
border-top: 1px solid $color-border;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color: $color-bg;
|
||||
font-size: 12px;
|
||||
color: $color-meta;
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
&.active {
|
||||
background-color: rgba(103, 194, 58, 0.1);
|
||||
color: $color-success;
|
||||
}
|
||||
&.inactive {
|
||||
background-color: rgba(255, 73, 73, 0.1);
|
||||
color: $color-danger;
|
||||
}
|
||||
}
|
||||
|
||||
// 弹窗样式
|
||||
.fade-enter-active,
|
||||
.fade-leave-active {
|
||||
transition: opacity 0.3s;
|
||||
}
|
||||
.fade-enter,
|
||||
.fade-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.dialog-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.dialog-container {
|
||||
background: white;
|
||||
min-width: 500px;
|
||||
max-width: 90vw;
|
||||
border-radius: 12px;
|
||||
overflow: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.dialog-header {
|
||||
padding: 20px;
|
||||
border-bottom: 1px solid $color-border;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
background-color: #f9fbfc;
|
||||
.header-left {
|
||||
h3 {
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: $color-text;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-meta {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
font-size: 14px;
|
||||
color: $color-meta;
|
||||
margin-top: 4px;
|
||||
.status-tag {
|
||||
padding: 3px 8px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
.el-button {
|
||||
padding: 10px;
|
||||
border-radius: 8px;
|
||||
&:hover {
|
||||
background-color: lighten($color-primary, 35%);
|
||||
}
|
||||
}
|
||||
.el-icon-close {
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
margin-left: 12px;
|
||||
&:hover {
|
||||
color: $color-primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-content {
|
||||
padding: 20px;
|
||||
flex: 1;
|
||||
overflow-y: hidden;
|
||||
background-color: #f9fbfc;
|
||||
}
|
||||
|
||||
.doc-preview {
|
||||
white-space: pre-wrap;
|
||||
line-height: 1.5;
|
||||
background: #ffffff;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid $color-border;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
||||
font-family: 'Microsoft Yahei', SimSun, sans-serif;
|
||||
font-size: 15px;
|
||||
color: #333;
|
||||
height: calc(100vh - 300px);
|
||||
overflow: auto;
|
||||
|
||||
/* 恢复 Markdown 元素样式 */
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom: 0.3em;
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
padding-left: 1.5em;
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 0.3em 0;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #f8f8f8;
|
||||
padding: 1em;
|
||||
border-radius: 4px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
code {
|
||||
background-color: #eee;
|
||||
padding: 0.2em 0.4em;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
margin: 1em 0;
|
||||
|
||||
th,
|
||||
td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 0.5em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 新增 WangEditor 样式覆盖 */
|
||||
.w-e-text-container {
|
||||
background-color: #ffffff !important;
|
||||
border-radius: 8px 8px 0 0;
|
||||
padding: 20px;
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.w-e-scroll {
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
padding: 20px;
|
||||
border-top: 1px solid $color-border;
|
||||
background-color: #f9fbfc;
|
||||
.footer-info {
|
||||
margin-bottom: 16px;
|
||||
p {
|
||||
margin: 4px 0;
|
||||
font-size: 14px;
|
||||
color: $color-meta;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -26,12 +26,89 @@
|
||||
{{ tabLabels[activeTab] }}
|
||||
</div>
|
||||
<div class="item-actions">
|
||||
<el-button size="large" class="button" @click="onInspect(p)">抽查</el-button>
|
||||
<el-button size="large" class="button" @click="onInspect(p.id)">抽查</el-button>
|
||||
<el-button size="large" class="button" type="danger" @click="onRevoke(p)">取消授权</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 抽查弹窗 -->
|
||||
<el-dialog v-model="dialogVisible" width="720px" top="20px" modal="false" :before-close="() => (dialogVisible = false)" title="追溯记录">
|
||||
<div v-if="traceData" class="trace-record">
|
||||
<!-- 基本信息 -->
|
||||
<section class="section">
|
||||
<h3>基本信息</h3>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="6">产品名称:</el-col><el-col :span="18">{{ traceData.productName }}</el-col> <el-col :span="6">产品数量:</el-col
|
||||
><el-col :span="18">{{ traceData.quantity }}</el-col> <el-col :span="6">生产经营主体:</el-col
|
||||
><el-col :span="18">{{ traceData.producer }}</el-col> <el-col :span="6">原产地:</el-col
|
||||
><el-col :span="18">{{ traceData.origin }}</el-col> <el-col :span="6">生产日期:</el-col
|
||||
><el-col :span="18">{{ traceData.productionDate }}</el-col> <el-col :span="6">追溯码:</el-col
|
||||
><el-col :span="18">{{ traceData.traceCode }}</el-col> <el-col :span="6">追溯次数:</el-col
|
||||
><el-col :span="18">{{ traceData.traceCount }} 次</el-col>
|
||||
</el-row>
|
||||
</section>
|
||||
|
||||
<!-- 基地信息 -->
|
||||
<section class="section">
|
||||
<h3>基地信息</h3>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="6">基地地址:</el-col><el-col :span="18">{{ traceData.base.address }}</el-col> <el-col :span="6">地理位置:</el-col
|
||||
><el-col :span="18">{{ traceData.base.location }}</el-col> <el-col :span="6">面积:</el-col
|
||||
><el-col :span="18">{{ traceData.base.area }} 亩</el-col> <el-col :span="6">气候条件:</el-col
|
||||
><el-col :span="18">{{ traceData.base.climate }}</el-col> <el-col :span="6">土壤类型:</el-col
|
||||
><el-col :span="18">{{ traceData.base.soil }}</el-col>
|
||||
</el-row>
|
||||
</section>
|
||||
|
||||
<!-- 农事信息 -->
|
||||
<section class="section">
|
||||
<h3>农事信息</h3>
|
||||
<el-table :data="traceData.farmingRecords" stripe border style="width: 100%">
|
||||
<el-table-column prop="date" label="日期" width="120" />
|
||||
<el-table-column prop="operation" label="操作" />
|
||||
<el-table-column prop="operator" label="作业人" width="120" />
|
||||
</el-table>
|
||||
</section>
|
||||
|
||||
<!-- 包装信息 -->
|
||||
<section class="section">
|
||||
<h3>分拣包装</h3>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="6">包装企业:</el-col><el-col :span="18">{{ traceData.packaging.company }}</el-col> <el-col :span="6">包装类型:</el-col
|
||||
><el-col :span="18">{{ traceData.packaging.type }}</el-col> <el-col :span="6">包装人:</el-col
|
||||
><el-col :span="18">{{ traceData.packaging.person }}</el-col> <el-col :span="6">包装时间:</el-col
|
||||
><el-col :span="18">{{ traceData.packaging.time }}</el-col>
|
||||
</el-row>
|
||||
</section>
|
||||
|
||||
<!-- 仓储物流 -->
|
||||
<section class="section">
|
||||
<h3>仓储物流信息</h3>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="6">存储类型:</el-col><el-col :span="18">{{ traceData.logistics.storageType }}</el-col>
|
||||
<el-col :span="6">存储温度:</el-col><el-col :span="18">{{ traceData.logistics.temperature }}</el-col>
|
||||
<el-col :span="6">发货地址:</el-col><el-col :span="18">{{ traceData.logistics.shipFrom }}</el-col> <el-col :span="6">收货地址:</el-col
|
||||
><el-col :span="18">{{ traceData.logistics.shipTo }}</el-col>
|
||||
</el-row>
|
||||
</section>
|
||||
|
||||
<!-- 交易信息 -->
|
||||
<section class="section">
|
||||
<h3>交易信息</h3>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="6">交易时间:</el-col><el-col :span="18">{{ traceData.trade.time }}</el-col> <el-col :span="6">买家:</el-col
|
||||
><el-col :span="18">{{ traceData.trade.buyer }}</el-col>
|
||||
</el-row>
|
||||
</section>
|
||||
|
||||
<!-- 右侧图片 -->
|
||||
<div class="trace-img">
|
||||
<img :src="getAssetsFile(traceData.img)" alt="产品图" />
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -41,6 +118,8 @@ import { getAssetsFile } from '@/utils/index.js';
|
||||
import { getMonitorList } from '@/apis/brand';
|
||||
|
||||
const activeTab = ref('onSale');
|
||||
const dialogVisible = ref(false);
|
||||
const traceData = ref(null);
|
||||
|
||||
const tabLabels = {
|
||||
onSale: '在售中',
|
||||
@ -83,10 +162,52 @@ const products = ref([
|
||||
// 根据当前 Tab 过滤
|
||||
const filteredProducts = computed(() => products.value.filter((p) => p.status === activeTab.value));
|
||||
|
||||
// 操作回调
|
||||
const onInspect = (p) => {
|
||||
console.log('抽查商品', p);
|
||||
};
|
||||
// 点击抽查后,根据 id 单独拉取或赋值 traceData
|
||||
function onInspect(id) {
|
||||
console.log('查看产品:', id);
|
||||
// 这里用硬编码模拟请求,实际中可换成接口调用:getTraceById(id).then(res=> traceData.value = res)
|
||||
const mock = {
|
||||
productName: '无土栽培土豆',
|
||||
quantity: '200KG',
|
||||
producer: '北大荒技术有限公司',
|
||||
origin: '耿马县孟定镇下坝村',
|
||||
productionDate: '2025-1-2',
|
||||
traceCode: '10.5487542154785XSE254.1040201',
|
||||
traceCount: 30,
|
||||
base: {
|
||||
address: '耿马县孟定镇下坝村',
|
||||
location: '东经102° · 北纬24°',
|
||||
area: 12000,
|
||||
climate: '亚热带高原季风型,温和多雨',
|
||||
soil: '红壤',
|
||||
},
|
||||
farmingRecords: [
|
||||
{ date: '2024/1/2', operation: '播种 20250102批土豆种', operator: '张小东' },
|
||||
{ date: '2024/2/2', operation: '施肥 氮肥', operator: '张小东' },
|
||||
{ date: '2024/3/2', operation: '浇水', operator: '张小东' },
|
||||
{ date: '2024/4/2', operation: '采摘', operator: '张小东' },
|
||||
],
|
||||
packaging: {
|
||||
company: '瑞禾农产品包装公司',
|
||||
type: '纸箱',
|
||||
person: '王大福',
|
||||
time: '2025-1-2 14:00:47',
|
||||
},
|
||||
logistics: {
|
||||
storageType: '冷藏',
|
||||
temperature: '2°C',
|
||||
shipFrom: '北京市朝阳区解放路24号',
|
||||
shipTo: '上海市黄浦区南京路36号',
|
||||
},
|
||||
trade: {
|
||||
time: '2025-1-2 14:00:47',
|
||||
buyer: '刘小花',
|
||||
},
|
||||
img: 'images/brand/product6.png',
|
||||
};
|
||||
traceData.value = mock;
|
||||
dialogVisible.value = true;
|
||||
}
|
||||
const onRevoke = (p) => {
|
||||
console.log('取消授权', p);
|
||||
};
|
||||
@ -191,5 +312,31 @@ const statusClass = (tab) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.trace-record {
|
||||
position: relative;
|
||||
padding-right: 160px; /* 给图片预留空间 */
|
||||
}
|
||||
.trace-record .section {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.trace-record h3 {
|
||||
margin-bottom: 8px;
|
||||
font-size: 18px;
|
||||
color: #409eff;
|
||||
border-left: 4px solid #409eff;
|
||||
padding-left: 8px;
|
||||
}
|
||||
.trace-img {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
right: 16px;
|
||||
width: 128px;
|
||||
text-align: center;
|
||||
}
|
||||
.trace-img img {
|
||||
width: 100%;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -3,16 +3,20 @@
|
||||
<el-container class="brand-layout-container">
|
||||
<el-aside class="brand-aside-menu">
|
||||
<!-- 菜单部分 -->
|
||||
<el-menu :default-active="activeMenu" class="aside-menu" @select="handleSelect">
|
||||
<el-menu v-model:open="openMenus" :default-active="activeMenu" class="brand-aside-menu" @select="handleSelect">
|
||||
<el-menu-item index="apply">
|
||||
<img :src="getAssetsFile('images/brand/Apply.png')" class="menu-icon" alt="申请图标" />
|
||||
<span>使用申请</span>
|
||||
</el-menu-item>
|
||||
|
||||
<el-menu-item index="auth">
|
||||
<img :src="getAssetsFile('images/brand/autho.png')" class="menu-icon" alt="" />
|
||||
<span>授权管理</span>
|
||||
</el-menu-item>
|
||||
<el-sub-menu index="auth">
|
||||
<template #title>
|
||||
<img :src="getAssetsFile('images/brand/autho.png')" class="menu-icon" />
|
||||
<span>授权管理</span>
|
||||
</template>
|
||||
<el-menu-item index="auth/record"> 授权记录 </el-menu-item>
|
||||
<el-menu-item index="auth/system"> 品牌制度 </el-menu-item>
|
||||
</el-sub-menu>
|
||||
|
||||
<el-menu-item index="monitor">
|
||||
<img :src="getAssetsFile('images/brand/supervision.png')" class="menu-icon" alt="" />
|
||||
@ -29,23 +33,30 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { ref, computed } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { getAssetsFile } from '@/utils/index.js';
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
// 激活菜单项
|
||||
const openMenus = ref(['auth']);
|
||||
|
||||
const menuMap = {
|
||||
apply: ['brandApplyList'],
|
||||
'auth/record': ['brandAuth'],
|
||||
'auth/system': ['brandSystem'],
|
||||
monitor: ['brandMonitor'],
|
||||
};
|
||||
|
||||
// 获取当前菜单激活项
|
||||
const activeMenu = computed(() => {
|
||||
const path = route.path;
|
||||
if (path.includes('/apply')) return 'apply';
|
||||
if (path.includes('/auth')) return 'auth';
|
||||
if (path.includes('/monitor')) return 'monitor';
|
||||
return '';
|
||||
const matched = Object.entries(menuMap).find(([key, names]) => names.includes(route.name));
|
||||
return matched ? matched[0] : '';
|
||||
});
|
||||
// 菜单切换处理
|
||||
function handleSelect(index) {
|
||||
console.log('object :>> ', index);
|
||||
router.push(`/sub-operation-service/brand/${index}`);
|
||||
}
|
||||
</script>
|
||||
@ -60,39 +71,40 @@ function handleSelect(index) {
|
||||
width: $width-main;
|
||||
margin: auto;
|
||||
.brand-aside-menu {
|
||||
width: 240px;
|
||||
background-color: $color-fff;
|
||||
border-radius: 8px;
|
||||
.aside-menu {
|
||||
border-right: none;
|
||||
background-color: #fff;
|
||||
border-radius: 16px;
|
||||
border-right: 0;
|
||||
:deep(.el-menu-item),
|
||||
:deep(.el-sub-menu__title) {
|
||||
font-size: 18px !important;
|
||||
margin: 8px 12px;
|
||||
span {
|
||||
margin-left: 8px;
|
||||
}
|
||||
.menu-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-sub-menu) {
|
||||
.el-menu-item {
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
margin: 4px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
text-align: left;
|
||||
&:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
.el-icon {
|
||||
color: #666;
|
||||
margin-right: 12px;
|
||||
font-size: 18px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.menu-icon {
|
||||
width: 1.5em;
|
||||
height: 1.5em;
|
||||
margin-right: 8px;
|
||||
vertical-align: -0.15em;
|
||||
}
|
||||
font-size: 16px !important;
|
||||
margin: 4px 12px;
|
||||
line-height: 40px;
|
||||
span {
|
||||
vertical-align: middle;
|
||||
margin-left: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.is-active) {
|
||||
> .el-sub-menu__title,
|
||||
&.el-menu-item {
|
||||
color: #409eff !important;
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
}
|
||||
}
|
||||
.brand-main {
|
||||
width: calc(100% - 240px - 16px);
|
||||
|
@ -4188,6 +4188,11 @@ markdown-table@^1.1.0:
|
||||
resolved "https://registry.npmmirror.com/markdown-table/-/markdown-table-1.1.3.tgz#9fcb69bcfdb8717bfd0398c6ec2d93036ef8de60"
|
||||
integrity sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q==
|
||||
|
||||
marked@^15.0.12:
|
||||
version "15.0.12"
|
||||
resolved "https://registry.npmmirror.com/marked/-/marked-15.0.12.tgz#30722c7346e12d0a2d0207ab9b0c4f0102d86c4e"
|
||||
integrity sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA==
|
||||
|
||||
math-intrinsics@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9"
|
||||
|
Loading…
x
Reference in New Issue
Block a user