feat(前端): 供应商系统更换品牌图标(用户指定图一)
开发者提供新 logo 图(圆形渐变立体方块)要求替换系统图标。处理: - 原图裁成圆形、去白底,输出 512×512 透明 PNG 入库 src/assets/brand-logo.png; - 新增 BrandLogo 组件(侧边栏 38px / 登录页 64px 共用),替换原绿色渐变方块 + Package 图标; - index.html favicon 改为内联 PNG dataURI(顺带修掉 public/favicon 不会被打进生产 dist 的既有隐患); - 品牌文案(生鲜配送管理系统/副标题)未动;旧 public/favicon.svg|ico 不再引用但未删。 验证:typecheck 通过;webpack dev 编译成功;无头浏览器实测登录页新图标渲染成功 (naturalWidth=512)、无 JS 错误;前端单测 229 通过/4 既有红(menuCatalog、 QuoteVersionManagement.cardLayout、BidInvitations、CustomerOrder,与本次无关)。未部署。
This commit is contained in:
@@ -208,6 +208,8 @@ server-go/server-go
|
||||
.go/
|
||||
*.tar.gz
|
||||
*.png
|
||||
# 应用内品牌/UI 图标属源码资源,需入库(2026-10-22 供应商系统换标)
|
||||
!src/assets/brand-logo.png
|
||||
.log-analysis.txt
|
||||
.tablet-full-logcat.txt
|
||||
.tablet-full-logcat-utf8.txt
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 158 KiB |
@@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
import brandLogo from '../assets/brand-logo.png';
|
||||
|
||||
/**
|
||||
* 供应商系统品牌图标(2026-10-21 用户指定:换成「图一 · 圆形立体方块」)。
|
||||
*
|
||||
* 只换图标,**品牌文案不动**;图片由 webpack asset 模块内联(<1MB 转 dataURL),
|
||||
* 因此 dev / 生产构建都不依赖 `public/` 静态文件。`alt=""` + `aria-hidden`:
|
||||
* 图标属装饰,旁边已有品牌名,读屏不重复播报。
|
||||
*/
|
||||
export const BrandLogo: React.FC<{ className?: string }> = ({
|
||||
className = 'w-full h-full object-contain',
|
||||
}) => <img src={brandLogo} alt="" aria-hidden="true" draggable={false} className={className} />;
|
||||
@@ -2,10 +2,10 @@ import React, { useState, useEffect, useMemo, useCallback, useRef } from 'react'
|
||||
import { Outlet, NavLink, useLocation } from 'react-router-dom';
|
||||
import {
|
||||
PanelLeftOpen,
|
||||
Package,
|
||||
ChevronRight,
|
||||
Menu,
|
||||
} from 'lucide-react';
|
||||
import { BrandLogo } from './BrandLogo';
|
||||
import { useAuth } from '../hooks/useAuth';
|
||||
import { useOperatingBranch } from '../hooks/useOperatingBranch';
|
||||
import { useMenuLayout } from '../hooks/useMenuLayout';
|
||||
@@ -235,8 +235,8 @@ export const Layout: React.FC = () => {
|
||||
>
|
||||
{/* Logo Area */}
|
||||
<div className="h-16 flex items-center gap-3 px-5 border-b shrink-0" style={{ borderColor: 'var(--app-sidebar-border)' }}>
|
||||
<div className="app-logo w-[38px] h-[38px] flex items-center justify-center shrink-0">
|
||||
<Package className="w-[22px] h-[22px] text-white" />
|
||||
<div className="w-[38px] h-[38px] flex items-center justify-center shrink-0">
|
||||
<BrandLogo />
|
||||
</div>
|
||||
<div className="sidebar-hide-collapsed overflow-hidden whitespace-nowrap transition-all duration-250">
|
||||
<span className="app-foreground block text-[15px] font-semibold leading-tight tracking-tight">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import { useNavigate, useSearchParams, useLocation } from 'react-router-dom';
|
||||
import { ChevronDown, Eye, EyeOff, Loader2, Package, X } from 'lucide-react';
|
||||
import { ChevronDown, Eye, EyeOff, Loader2, X } from 'lucide-react';
|
||||
import { BrandLogo } from '../../components/BrandLogo';
|
||||
import { useAuth } from '../../hooks/useAuth';
|
||||
import {
|
||||
loadRecentLoginUsernames,
|
||||
@@ -152,8 +153,8 @@ export const Login: React.FC = () => {
|
||||
<div className="relative z-[1] w-full max-w-md">
|
||||
{/* Logo */}
|
||||
<div className="text-center mb-8">
|
||||
<div className="app-logo inline-flex items-center justify-center w-16 h-16 mb-4">
|
||||
<Package className="w-8 h-8 text-white" />
|
||||
<div className="inline-flex items-center justify-center w-16 h-16 mb-4">
|
||||
<BrandLogo />
|
||||
</div>
|
||||
<h1 className="text-2xl font-semibold tracking-tight text-gray-900 dark:text-white mb-2">
|
||||
{t('login.brandTitle')}
|
||||
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Webpack 把图片当 asset 模块处理(`<1MB` 内联为 dataURL,见 webpack.config.js)。
|
||||
* TS 侧补模块声明,避免 `import logo from '../assets/xxx.png'` 报「找不到模块」。
|
||||
*/
|
||||
declare module '*.png' {
|
||||
const src: string;
|
||||
export default src;
|
||||
}
|
||||
Reference in New Issue
Block a user