From 85285d80c1f3750342a32ae3312fedbf76f9aa79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E9=B8=BF?= Date: Thu, 22 May 2025 10:38:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=85=AC=E5=85=B1=E5=93=81=E7=89=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/layouts/component/Header/index.vue | 7 - .../src/router/modules/resource.js | 12 +- sub-operation-service/package.json | 1 + sub-operation-service/src/router/index.js | 41 +- .../src/views/brand/components/Auth.vue | 4 +- .../views/brand/components/BrandSystem.vue | 504 ++++++++++++++++++ .../src/views/brand/components/Monitor.vue | 157 +++++- .../src/views/brand/index.vue | 92 ++-- sub-operation-service/yarn.lock | 5 + 9 files changed, 740 insertions(+), 83 deletions(-) create mode 100644 sub-operation-service/src/views/brand/components/BrandSystem.vue diff --git a/sub-government-affairs-service/src/layouts/component/Header/index.vue b/sub-government-affairs-service/src/layouts/component/Header/index.vue index 3ad7fdb..3f80024 100644 --- a/sub-government-affairs-service/src/layouts/component/Header/index.vue +++ b/sub-government-affairs-service/src/layouts/component/Header/index.vue @@ -1,10 +1,3 @@ - @@ -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; + } } diff --git a/sub-operation-service/src/views/brand/index.vue b/sub-operation-service/src/views/brand/index.vue index 70ff13e..99fefad 100644 --- a/sub-operation-service/src/views/brand/index.vue +++ b/sub-operation-service/src/views/brand/index.vue @@ -3,16 +3,20 @@ - + 申请图标 使用申请 - - - 授权管理 - + + + 授权记录 + 品牌制度 + @@ -29,23 +33,30 @@ @@ -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); diff --git a/sub-operation-service/yarn.lock b/sub-operation-service/yarn.lock index 19fc669..ff96f07 100644 --- a/sub-operation-service/yarn.lock +++ b/sub-operation-service/yarn.lock @@ -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" From 35554268b9d450cdee8961f2c7635932b890d29e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E9=B8=BF?= Date: Thu, 22 May 2025 13:54:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=BF=90=E8=90=A5=E4=BA=91PC-=E5=85=AC?= =?UTF-8?q?=E5=85=B1=E5=93=81=E7=89=8C=E7=AE=A1=E7=90=86-=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=93=81=E7=89=8C=E5=88=B6=E5=BA=A6=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/resource/grid/AddGrid.vue | 375 ++++++++++++++++++ .../src/views/resource/grid/AddGridMember.vue | 375 ++++++++++++++++++ .../views/resource/grid/GridManagement.vue | 15 + sub-operation-service/src/router/index.js | 1 + .../src/views/brand/index.vue | 2 +- 5 files changed, 767 insertions(+), 1 deletion(-) create mode 100644 sub-government-affairs-service/src/views/resource/grid/AddGrid.vue create mode 100644 sub-government-affairs-service/src/views/resource/grid/AddGridMember.vue create mode 100644 sub-government-affairs-service/src/views/resource/grid/GridManagement.vue diff --git a/sub-government-affairs-service/src/views/resource/grid/AddGrid.vue b/sub-government-affairs-service/src/views/resource/grid/AddGrid.vue new file mode 100644 index 0000000..52dd42d --- /dev/null +++ b/sub-government-affairs-service/src/views/resource/grid/AddGrid.vue @@ -0,0 +1,375 @@ + + diff --git a/sub-government-affairs-service/src/views/resource/grid/AddGridMember.vue b/sub-government-affairs-service/src/views/resource/grid/AddGridMember.vue new file mode 100644 index 0000000..52dd42d --- /dev/null +++ b/sub-government-affairs-service/src/views/resource/grid/AddGridMember.vue @@ -0,0 +1,375 @@ + + diff --git a/sub-government-affairs-service/src/views/resource/grid/GridManagement.vue b/sub-government-affairs-service/src/views/resource/grid/GridManagement.vue new file mode 100644 index 0000000..62d6e21 --- /dev/null +++ b/sub-government-affairs-service/src/views/resource/grid/GridManagement.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/sub-operation-service/src/router/index.js b/sub-operation-service/src/router/index.js index 9280f6e..571aa99 100644 --- a/sub-operation-service/src/router/index.js +++ b/sub-operation-service/src/router/index.js @@ -239,6 +239,7 @@ export const constantRoutes = [ { path: '', component: BrandLayout, + redirect: '/sub-operation-service/brand/apply', children: [ { path: 'apply', diff --git a/sub-operation-service/src/views/brand/index.vue b/sub-operation-service/src/views/brand/index.vue index 99fefad..34fea47 100644 --- a/sub-operation-service/src/views/brand/index.vue +++ b/sub-operation-service/src/views/brand/index.vue @@ -52,11 +52,11 @@ const menuMap = { // 获取当前菜单激活项 const activeMenu = computed(() => { const matched = Object.entries(menuMap).find(([key, names]) => names.includes(route.name)); + console.log(matched[0]); return matched ? matched[0] : ''; }); // 菜单切换处理 function handleSelect(index) { - console.log('object :>> ', index); router.push(`/sub-operation-service/brand/${index}`); }