From 124de2926e6cea94e1d818a9af1b1c8cb4f3c0ba Mon Sep 17 00:00:00 2001 From: liuzhu Date: Tue, 3 Mar 2026 15:05:20 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/material/materialInfo.ts | 15 +++++++++------ src/types/components.d.ts | 20 +++++++++++++++++++- src/views/material/MaterialInfoAddModal.vue | 6 +++--- src/views/material/index.vue | 3 +-- src/views/system/user/UserAddDrawer.vue | 2 +- src/views/system/user/index.vue | 5 +++-- 6 files changed, 36 insertions(+), 15 deletions(-) diff --git a/src/apis/material/materialInfo.ts b/src/apis/material/materialInfo.ts index 5c170cd..db2f4a1 100644 --- a/src/apis/material/materialInfo.ts +++ b/src/apis/material/materialInfo.ts @@ -1,12 +1,12 @@ import http from '@/utils/http' -const BASE_URL = '/admin/meterialInfo' +const BASE_URL = '/admin/materialInfo' -export interface MeterialInfoResp { +export interface MaterialInfoResp { materialName: string encoding: string unitWeight: string - maxWeight: string + materialSpec: string photoUrl: string createUser: string createTime: string @@ -23,12 +23,15 @@ export interface MaterialInfoPageQuery extends MaterialInfoQuery, PageQuery {} /** @desc 查询物料信息列表 */ export function listMaterialInfo(query: MaterialInfoPageQuery) { - return http.get>(`${BASE_URL}`, query) + return http.get>(`${BASE_URL}`, query) +} + +interface MaterialInfoDetailResp { } /** @desc 查询物料信息详情 */ export function getMaterialInfo(id: string) { - return http.get(`${BASE_URL}/${id}`) + return http.get(`${BASE_URL}/${id}`) } /** @desc 新增物料信息 */ @@ -47,6 +50,6 @@ export function deleteMaterialInfo(id: string) { } /** @desc 导出物料信息 */ -export function exportMaterialInfo(query: MeterialInfoQuery) { +export function exportMaterialInfo(query: MaterialInfoQuery) { return http.download(`${BASE_URL}/export`, query) } diff --git a/src/types/components.d.ts b/src/types/components.d.ts index d40c7fa..9dfdc0b 100644 --- a/src/types/components.d.ts +++ b/src/types/components.d.ts @@ -13,7 +13,9 @@ declare module 'vue' { ABreadcrumb: typeof import('@arco-design/web-vue')['Breadcrumb'] ABreadcrumbItem: typeof import('@arco-design/web-vue')['BreadcrumbItem'] AButton: typeof import('@arco-design/web-vue')['Button'] + ACard: typeof import('@arco-design/web-vue')['Card'] ACheckbox: typeof import('@arco-design/web-vue')['Checkbox'] + ACheckboxGroup: typeof import('@arco-design/web-vue')['CheckboxGroup'] ACol: typeof import('@arco-design/web-vue')['Col'] AConfigProvider: typeof import('@arco-design/web-vue')['ConfigProvider'] ADescriptions: typeof import('@arco-design/web-vue')['Descriptions'] @@ -25,10 +27,13 @@ declare module 'vue' { AEmpty: typeof import('@arco-design/web-vue')['Empty'] AForm: typeof import('@arco-design/web-vue')['Form'] AFormItem: typeof import('@arco-design/web-vue')['FormItem'] + AGrid: typeof import('@arco-design/web-vue')['Grid'] + AGridItem: typeof import('@arco-design/web-vue')['GridItem'] AIcon: typeof import('@arco-design/web-vue')['Icon'] AImage: typeof import('@arco-design/web-vue')['Image'] AInput: typeof import('@arco-design/web-vue')['Input'] - AInputPassword: typeof import('@arco-design/web-vue')['InputPassword'] + AInputNumber: typeof import('@arco-design/web-vue')['InputNumber'] + AInputSearch: typeof import('@arco-design/web-vue')['InputSearch'] ALayout: typeof import('@arco-design/web-vue')['Layout'] ALayoutHeader: typeof import('@arco-design/web-vue')['LayoutHeader'] ALayoutSider: typeof import('@arco-design/web-vue')['LayoutSider'] @@ -36,17 +41,30 @@ declare module 'vue' { AMenu: typeof import('@arco-design/web-vue')['Menu'] AMenuItem: typeof import('@arco-design/web-vue')['MenuItem'] AModal: typeof import('@arco-design/web-vue')['Modal'] + AOverflowList: typeof import('@arco-design/web-vue')['OverflowList'] APopover: typeof import('@arco-design/web-vue')['Popover'] + AProgress: typeof import('@arco-design/web-vue')['Progress'] + ARadio: typeof import('@arco-design/web-vue')['Radio'] + ARadioGroup: typeof import('@arco-design/web-vue')['RadioGroup'] + ARangePicker: typeof import('@arco-design/web-vue')['RangePicker'] ARow: typeof import('@arco-design/web-vue')['Row'] AScrollbar: typeof import('@arco-design/web-vue')['Scrollbar'] ASelect: typeof import('@arco-design/web-vue')['Select'] ASpace: typeof import('@arco-design/web-vue')['Space'] + AStatistic: typeof import('@arco-design/web-vue')['Statistic'] ASubMenu: typeof import('@arco-design/web-vue')['SubMenu'] ASwitch: typeof import('@arco-design/web-vue')['Switch'] ATable: typeof import('@arco-design/web-vue')['Table'] ATabPane: typeof import('@arco-design/web-vue')['TabPane'] ATabs: typeof import('@arco-design/web-vue')['Tabs'] + ATag: typeof import('@arco-design/web-vue')['Tag'] + ATextarea: typeof import('@arco-design/web-vue')['Textarea'] ATooltip: typeof import('@arco-design/web-vue')['Tooltip'] + ATree: typeof import('@arco-design/web-vue')['Tree'] + ATreeSelect: typeof import('@arco-design/web-vue')['TreeSelect'] + ATrigger: typeof import('@arco-design/web-vue')['Trigger'] + ATypographyParagraph: typeof import('@arco-design/web-vue')['TypographyParagraph'] + AUpload: typeof import('@arco-design/web-vue')['Upload'] Avatar: typeof import('./../components/Avatar/index.vue')['default'] AWatermark: typeof import('@arco-design/web-vue')['Watermark'] Breadcrumb: typeof import('./../components/Breadcrumb/index.vue')['default'] diff --git a/src/views/material/MaterialInfoAddModal.vue b/src/views/material/MaterialInfoAddModal.vue index bc3dc54..cdecab4 100644 --- a/src/views/material/MaterialInfoAddModal.vue +++ b/src/views/material/MaterialInfoAddModal.vue @@ -58,9 +58,9 @@ const columns: ColumnItem[] = reactive([ span: 24, }, { - label: '物料单次可称量最大重量(kg)', - field: 'maxWeight', - type: 'input-number', + label: '物料规格', + field: 'materialSpec', + type: 'input', span: 24, }, { diff --git a/src/views/material/index.vue b/src/views/material/index.vue index e7cdc7c..faee7b2 100644 --- a/src/views/material/index.vue +++ b/src/views/material/index.vue @@ -90,8 +90,7 @@ const columns = ref([ { title: '物料名称', dataIndex: 'materialName', slotName: 'materialName' }, { title: '物料编码', dataIndex: 'encoding', slotName: 'encoding' }, { title: '物料单位重量(g)', dataIndex: 'unitWeight', slotName: 'unitWeight' }, - { title: '物料单次可称量最大重量(kg)', dataIndex: 'maxWeight', slotName: 'maxWeight' }, - // 可给photoUrl列添加宽度,优化显示 + { title: '物料规格', dataIndex: 'materialSpec', slotName: 'materialSpec' }, { title: '物料照片', dataIndex: 'photoUrl', slotName: 'photoUrl', width: 120, align: 'center' }, { title: '创建人', dataIndex: 'createUserString', slotName: 'createUser' }, { title: '创建时间', dataIndex: 'createTime', slotName: 'createTime' }, diff --git a/src/views/system/user/UserAddDrawer.vue b/src/views/system/user/UserAddDrawer.vue index c77e785..ce4bc40 100644 --- a/src/views/system/user/UserAddDrawer.vue +++ b/src/views/system/user/UserAddDrawer.vue @@ -13,7 +13,7 @@ @@ -66,10 +67,10 @@ const handleStart = () => { height: 100%; min-height: 100vh; display: flex; - justify-content: center; + justify-content: flex-start; // 整体靠左,由子元素 margin 控制位置 align-items: center; background: #f5f7fa; - padding: 10px; // 减小内边距 + padding: 10px; box-sizing: border-box; .guide-content.full-height { @@ -79,10 +80,13 @@ const handleStart = () => { margin: 0; display: flex; flex-direction: column; + align-items: flex-start; // 【关键】让子元素(标题和卡片)从左侧开始排列,而不是拉伸 .page-title { - text-align: center; - font-size: 42px; // 稍微减小字体 + // 【修改】让标题宽度适应内容,以便通过 margin 控制其整体位置 + width: fit-content; + text-align: center; // 文字本身在标题块内居中 + font-size: 42px; font-weight: 800; color: #1e293b; margin-bottom: 15px; @@ -92,13 +96,17 @@ const handleStart = () => { flex-shrink: 0; padding: 0 10px; + // 【关键修改】应用与卡片相同的左侧偏移,确保标题在卡片正上方 + margin-left: 30%; // 必须与 .guide-card 的 margin-left 一致 + margin-right: auto; + &::after { content: ''; display: block; - width: 80px; // 减小下划线宽度 + width: 80px; height: 4px; background: linear-gradient(90deg, #165dff, #6aa1ff); - margin: 10px auto 0; + margin: 10px auto 0; // 下划线在标题块内居中 border-radius: 2px; } } @@ -108,22 +116,23 @@ const handleStart = () => { .guide-card { display: flex; align-items: center; - justify-content: center; - gap: 40px; // 减小间距 + gap: 40px; background: white; - border-radius: 30px; // 减小圆角 + border-radius: 30px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); - padding: 20px 30px; // 减小内边距 + padding: 20px 30px; flex-wrap: wrap; border: 1px solid rgba(0, 0, 0, 0.05); - min-height: 400px; // 减小最小高度 + min-height: 400px; width: auto; - max-width: 90vw; // 使用视口宽度的90%,确保有边距 - margin: 0 auto; + max-width: 90vw; + + // 【核心修改】设置左边距实现左偏移 + margin-left: 10%; // 与标题保持一致 + margin-right: auto; &.centered { - margin-left: auto; - margin-right: auto; + // 移除原本的居中逻辑 } .image-wrapper { @@ -131,16 +140,16 @@ const handleStart = () => { display: flex; justify-content: center; align-items: center; - min-width: 300px; // 减小最小宽度 - max-width: 600px; // 减小最大宽度 + min-width: 300px; + max-width: 600px; height: 100%; .guide-image.enlarged { max-width: 100%; width: auto; height: auto; - max-height: 50vh; // 减小最大高度 - min-height: 250px; // 减小最小高度 + max-height: 50vh; + min-height: 250px; object-fit: contain; border-radius: 16px; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.08)); @@ -159,13 +168,13 @@ const handleStart = () => { align-items: center; justify-content: center; gap: 12px; - min-width: 180px; // 减小最小宽度 + min-width: 180px; .button-hint { - font-size: 14px; // 减小字体 + font-size: 14px; color: #475569; background: #f1f5f9; - padding: 6px 18px; // 减小内边距 + padding: 6px 18px; border-radius: 24px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02); @@ -180,9 +189,9 @@ const handleStart = () => { } .start-button.enlarged { - min-width: 160px; // 减小按钮宽度 - height: 56px; // 减小按钮高度 - font-size: 22px; // 减小字体 + min-width: 160px; + height: 56px; + font-size: 22px; border-radius: 40px; box-shadow: 0 10px 20px rgba(22, 93, 255, 0.2); transition: all 0.3s ease; @@ -209,12 +218,11 @@ const handleStart = () => { // 针对不同屏幕尺寸的精细调整 @media (min-width: 1920px) { .guide-card { - max-width: 1600px; // 超大屏幕限制最大宽度 + max-width: 1600px; padding: 30px 50px; - - .image-wrapper { - max-width: 800px; - } + } + .guide-content.full-height .page-title { + // 大屏幕保持同步 } } @@ -222,15 +230,7 @@ const handleStart = () => { .guide-card { gap: 30px; padding: 20px 25px; - - .image-wrapper { - min-width: 280px; - max-width: 500px; - - .guide-image.enlarged { - max-height: 45vh; - } - } + // 如果需要,可以在这里微调 margin-left,记得同时微调 title } } @@ -242,43 +242,26 @@ const handleStart = () => { .guide-card { gap: 25px; padding: 15px 20px; - max-width: 95vw; // 在小屏幕上使用更宽的百分比 - - .image-wrapper { - min-width: 250px; - max-width: 450px; - - .guide-image.enlarged { - max-height: 40vh; - min-height: 200px; - } - } - - .button-wrapper { - min-width: 160px; - - .button-hint { - font-size: 13px; - padding: 5px 15px; - } - - .start-button.enlarged { - min-width: 150px; - height: 50px; - font-size: 20px; - } - } + max-width: 95vw; + // 平板端如果需要调整偏移,请同时调整下方 title 的 margin } } @media (max-width: 768px) { .guide-section.full-background { padding: 5px; + justify-content: center; // 移动端恢复整体居中 .guide-content.full-height { + align-items: center; // 移动端子元素也居中 + .page-title { font-size: 28px; margin-bottom: 10px; + // 【重要】移动端重置 margin,恢复自动居中 + margin-left: auto; + margin-right: auto; + width: fit-content; // 保持适应内容 &::after { width: 60px; @@ -294,7 +277,11 @@ const handleStart = () => { padding: 20px 15px; gap: 20px; min-height: auto; - max-width: 98vw; // 移动端几乎占满宽度 + max-width: 98vw; + + // 【重要】移动端强制居中 + margin-left: auto; + margin-right: auto; .image-wrapper { min-width: auto; @@ -334,14 +321,12 @@ const handleStart = () => { .guide-section.full-background { .guide-card { @media (min-width: 1025px) { - margin-left: 5%; // 在有侧边栏时左移 - margin-right: auto; + // 如果有侧边栏,确保标题和卡片偏移量依然一致 } } } } -// 确保父容器占满且无滚动问题 html, body { margin: 0; padding: 0; @@ -359,22 +344,22 @@ html, body { overflow-y: auto; } -// 针对100%缩放比例的特殊处理 +// 针对特定分辨率的微调(可选) @media screen and (min-width: 1280px) and (max-width: 1366px) { .guide-card { - max-width: 85vw; // 在常见笔记本屏幕上使用85%宽度 + max-width: 85vw; } } @media screen and (min-width: 1367px) and (max-width: 1440px) { .guide-card { - max-width: 80vw; // 在1440p屏幕上使用80%宽度 + max-width: 80vw; } } @media screen and (min-width: 1441px) and (max-width: 1680px) { .guide-card { - max-width: 75vw; // 在更大屏幕上使用75%宽度 + max-width: 75vw; } } diff --git a/src/views/material/MaterialInfoImportDrawer.vue b/src/views/material/MaterialInfoImportDrawer.vue new file mode 100644 index 0000000..fdfbcab --- /dev/null +++ b/src/views/material/MaterialInfoImportDrawer.vue @@ -0,0 +1,201 @@ + + + + + diff --git a/src/views/material/index.vue b/src/views/material/index.vue index faee7b2..028b77f 100644 --- a/src/views/material/index.vue +++ b/src/views/material/index.vue @@ -25,6 +25,10 @@ + + + + @@ -60,11 +64,13 @@ + From 7058245cdf4ad547958b51d5a62ad91dc5c571b7 Mon Sep 17 00:00:00 2001 From: liuzhu Date: Thu, 5 Mar 2026 14:48:32 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=89=A9=E6=96=99=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=AF=BC=E5=85=A5=E7=85=A7=E7=89=87=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/material/materialInfo.ts | 5 ++ src/views/material/PhotosImport.vue | 134 ++++++++++++++++++++++++++++ src/views/material/index.vue | 12 ++- src/views/system/user/index.vue | 7 +- 4 files changed, 151 insertions(+), 7 deletions(-) create mode 100644 src/views/material/PhotosImport.vue diff --git a/src/apis/material/materialInfo.ts b/src/apis/material/materialInfo.ts index c8efedd..21f5109 100644 --- a/src/apis/material/materialInfo.ts +++ b/src/apis/material/materialInfo.ts @@ -77,3 +77,8 @@ export function parseImportMaterial(data: FormData) { export function importMaterial(data: any) { return http.post(`${BASE_URL}/import`, data) } + +/** @desc 解析物料信息导入数据 */ +export function uploadMaterialPhotos(data: FormData) { + return http.post(`${BASE_URL}/import/uploadMaterialPhotos`, data) +} diff --git a/src/views/material/PhotosImport.vue b/src/views/material/PhotosImport.vue new file mode 100644 index 0000000..3d89809 --- /dev/null +++ b/src/views/material/PhotosImport.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/src/views/material/index.vue b/src/views/material/index.vue index 028b77f..28393ee 100644 --- a/src/views/material/index.vue +++ b/src/views/material/index.vue @@ -33,8 +33,11 @@ + + + + -