shish 2 месяцев назад
Родитель
Сommit
fdc9501da1

+ 46 - 16
ghsApp/src/admin/home/workbench.vue

@@ -200,8 +200,22 @@
 			<view class="tabs-wrap">
 				<view class="tabs-list" v-for="(item, index) in tabsData" :key="index">
 					<view @click="goPage(item)">
-						<view class="tabs-img">
-							<image :src="`${constant.hostUrl}/image/${item.img}`" alt mode="widthFix" ></image>
+						<view
+							v-if="item.icon"
+							class="tabs-img tabs-icon-box"
+							:style="{ background: iconBg(item.icon) }"
+						>
+							<image
+								class="tabs-icon-img"
+								:src="iconSrc(item.icon)"
+								mode="aspectFit"
+							></image>
+						</view>
+						<view v-else class="tabs-img">
+							<image
+								:src="tabImgSrc(item)"
+								mode="widthFix"
+							></image>
 						</view>
 						<view class="tabs-name">{{ item.name }}</view>
 					</view>
@@ -289,6 +303,7 @@ import { renewShop,noRemind,needRemind } from "@/api/renew"
 import { getListB,orderFh} from "@/api/order";
 import wexinPay from "@/utils/pay/wxPay";
 import keyboardModule from '@/components/keyboard'
+import { iconSrc, iconBg } from "@/utils/iconSrc";
 export default {
 	name: "workbench",
 	components: { 
@@ -306,18 +321,14 @@ export default {
 				todayData: { income:0.00, order:0, custom:0, expend:0.00 }
 			},
 			tabsData: [
-				{ name: "商城", img: 'ghs/home/shop.png', url: "/admin/home/mall" },
-				{ name: "改价", img: 'ghs/home/gj.png', url: "/admin/changePrice/list" },
-				{ name: "花材", img: 'ghs/home/hcgl.png', url: "/admin/item/list" },
-				{ name: "采购", img: 'ghs/home/icon_caigou.png', url: "/pagesPurchase/order" },
-				{ name: "供货商", img: 'ghs/home/icon_ghs.png', url: "/pagesPurchase/supplier" },
-				{ name: "损耗", img: 'ghs/home/kcyjs.png', url: "/admin/breakage/list" },
-				{ name: "调拨入库", img: 'ghs/home/dbrk.png', url: "/pagesStorehouse/allot/allotPut" },
-				{ name: "调拨出库", img: 'ghs/home/dbck.png', url: "/pagesStorehouse/allot/allotEx" },
-				{name : "结账记录", img : "ghs/home/kcyjs.png", url : "/admin/clear/customList"},
-				{name : "支出", img : "ghs/home/kcyjs.png", url : "/admin/expend/list"},
-				{name : "盘点", img : "/ghs/home/pandian.png", url : "/pagesStorehouse/inventory/list"},
-				{name : "库存预警", img : "/ghs/home/kcyjs.png", url : "/admin/item/list?warning=1"},
+				{ name: "商城码", img: "ghs/home/shop3.png", url: "/admin/home/mall" },
+				{ name: "改价", img: "ghs/home/gj.png", url: "/admin/changePrice/list2" },
+				{ name: "花材", img: "ghs/home/hcgl.png", url: "/admin/item/list2" },
+				{ name: "采购", img: "ghs/home/icon_caigou.png", url: "/pagesPurchase/order" },
+				{ name: "供货商", img: "ghs/home/icon_ghs.png", url: "/pagesPurchase/supplier" },
+				{ name: "报损", img: "ghs/home/kcyjs.png", url: "/admin/breakage/list" },
+				{ name: "调拨入库", img: "ghs/home/dbrk.png", url: "/pagesStorehouse/allot/allotPut" },
+				{ name: "调拨出库", img: "ghs/home/dbck.png", url: "/pagesStorehouse/allot/allotEx" },
 			],
 			skSrc: `${this.$constant.hostUrl}/image/ghs/home/kj2.png`,
 			pfSrc: `${this.$constant.hostUrl}/image/ghs/home/pf.jpg`,
@@ -409,6 +420,12 @@ export default {
 	},
 	methods: {
 		...mapActions(['setUserShopAll']),
+		iconSrc,
+		iconBg,
+		tabImgSrc (item) {
+			const img = item && item.img ? String(item.img).replace(/^\//, '') : '';
+			return img ? `${this.constant.hostUrl}/image/${img}` : '';
+		},
 		directFh(info){
 			orderFh({id:info.id,fhType:0}).then(res=>{
 				if(res.code == 1){
@@ -702,7 +719,7 @@ export default {
 			// #ifdef MP-WEIXIN
 			this.isMini = 1
 			// #endif
-			consoleIndex({isMini:this.isMini,version:2}).then(res => {
+			consoleIndex({isMini:this.isMini,version:3}).then(res => {
 				this.data = res.data;
 				const { menu } = res.data;
 				this.tabsData = menu
@@ -1033,10 +1050,23 @@ export default {
 			width: 100upx;
 			height: 100upx;
 			margin: 0 auto;
-			img {
+			image {
 				height: 100%;
 			}
 		}
+		.tabs-icon-box {
+			border-radius: 18upx;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			box-sizing: border-box;
+			line-height: 0;
+		}
+		.tabs-icon-img {
+			display: block;
+			width: 56upx;
+			height: 56upx;
+		}
 		.tabs-name {
 			color: #444444;
 			margin-top: 10upx;

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
ghsApp/src/static/icons/modify_stock.svg


+ 1 - 1
ghsApp/src/static/icons/purchase.svg

@@ -1 +1 @@
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1779939284134" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="45580" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M594.387 472.503l15.855-15.855c13.33-13.33 34.942-13.33 48.272 0 13.33 13.33 13.33 34.942 0 48.272l-75.425 75.425c-13.33 13.33-34.941 13.33-48.271 0l-72.824-72.824c-13.33-13.33-13.33-34.942 0-48.272 13.33-13.33 34.942-13.33 48.272 0l15.855 15.855v-128.6c0-18.852 15.282-34.134 34.133-34.134 18.851 0 34.133 15.282 34.133 34.133v126zM160.74 213.333h-51.254c-23.564 0-42.667-19.102-42.667-42.666 0-23.564 19.103-42.667 42.667-42.667h84.197c19.406 0 36.368 13.096 41.278 31.871l109.012 416.831c14.73 56.325 65.616 95.614 123.835 95.614h217.598c59.932 0 111.84-41.584 124.916-100.072l47.065-210.516a85.333 85.333 0 0 0 2.056-18.619c0-47.128-38.205-85.333-85.333-85.333H358.167c-23.564 0-42.667-19.102-42.667-42.667 0-23.564 19.103-42.666 42.667-42.666h415.942c94.256 0 170.666 76.41 170.666 170.666 0 12.526-1.378 25.014-4.111 37.237l-47.066 210.516c-21.793 97.48-108.307 166.787-208.193 166.787H467.807c-97.032 0-181.84-65.481-206.392-159.356L160.74 213.333z m262.563 691.443c-33.663 0-60.952-26.349-60.952-58.85 0-32.503 27.29-58.851 60.952-58.851 33.664 0 60.953 26.348 60.953 58.85s-27.29 58.85-60.953 58.85z m287.857 0c-33.663 0-60.952-26.349-60.952-58.85 0-32.503 27.289-58.851 60.952-58.851s60.952 26.348 60.952 58.85-27.289 58.85-60.952 58.85z" fill="#3385FF" p-id="45581"></path></svg>
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1779953176272" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16610" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M423.253333 852.309333m-74.922666 0a74.922667 74.922667 0 1 0 149.845333 0 74.922667 74.922667 0 1 0-149.845333 0Z" fill="#3385FF" p-id="16611"></path><path d="M732.16 852.309333m-74.922667 0a74.922667 74.922667 0 1 0 149.845334 0 74.922667 74.922667 0 1 0-149.845334 0Z" fill="#3385FF" p-id="16612"></path><path d="M803.84 708.266667H370.858667c-45.738667 0-85.504-30.890667-96.597334-75.093334l-103.082666-448.853333c-3.413333-13.141333-15.872-22.869333-30.378667-22.869333H87.04c-18.773333 0-34.133333-15.36-34.133333-34.133334s15.36-34.133333 34.133333-34.133333h53.930667c45.738667 0 85.504 30.890667 96.597333 75.264l102.912 448.682667c3.413333 13.141333 15.872 22.869333 30.378667 22.869333H803.84c13.482667 0 25.6-8.533333 29.866667-21.504l86.698666-301.056c3.754667-11.093333 2.218667-21.504-3.754666-29.866667s-15.36-13.141333-25.6-13.141333H393.898667c-18.773333 0-34.133333-15.36-34.133334-34.133333s15.36-34.133333 34.133334-34.133334H890.88c32.426667 0 61.952 15.189333 81.066667 41.472 18.944 26.453333 23.893333 59.221333 13.482666 89.941334l-86.698666 301.056c-13.994667 42.325333-52.053333 69.632-94.890667 69.632z" fill="#3385FF" p-id="16613"></path></svg>

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
ghsApp/src/static/icons/purchase_record.svg


+ 1 - 1
ghsApp/src/static/icons/stock_in.svg

@@ -1 +1 @@
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1779941704459" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="79035" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M467.2 435.2h89.6v89.6c0 19.2 19.2 38.4 38.4 38.4s32-19.2 32-38.4V435.2h89.6c19.2 0 38.4-12.8 38.4-32s-12.8-38.4-38.4-38.4H633.6V268.8c0-19.2-19.2-38.4-38.4-38.4-19.2 6.4-38.4 19.2-38.4 38.4v89.6H467.2c-19.2 0-38.4 19.2-38.4 38.4 6.4 19.2 19.2 38.4 38.4 38.4z m-166.4 377.6c-44.8 0-83.2 38.4-83.2 83.2 0 51.2 38.4 96 96 96 44.8 0 83.2-38.4 83.2-83.2 0-51.2-38.4-96-96-96z m582.4 0c-44.8 0-83.2 38.4-83.2 83.2 0 51.2 38.4 96 96 96 44.8 0 83.2-38.4 83.2-83.2 0-51.2-44.8-96-96-96z m64-236.8c0 57.6-51.2 108.8-108.8 108.8H307.2c-38.4 0-64-25.6-64-64V166.4c0-76.8-64-134.4-140.8-134.4H25.6C12.8 32 0 44.8 0 57.6v32c0 6.4 6.4 12.8 12.8 12.8h89.6c38.4 0 64 25.6 64 64v524.8c0 32 32 64 64 64h614.4c96 0 179.2-76.8 179.2-172.8V300.8c0-6.4-6.4-19.2-12.8-19.2-32-19.2-64 0-64 25.6" fill="#3385FF" p-id="79036"></path></svg>
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1779953176272" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16610" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M423.253333 852.309333m-74.922666 0a74.922667 74.922667 0 1 0 149.845333 0 74.922667 74.922667 0 1 0-149.845333 0Z" fill="#09a84f" p-id="16611"></path><path d="M732.16 852.309333m-74.922667 0a74.922667 74.922667 0 1 0 149.845334 0 74.922667 74.922667 0 1 0-149.845334 0Z" fill="#09a84f" p-id="16612"></path><path d="M803.84 708.266667H370.858667c-45.738667 0-85.504-30.890667-96.597334-75.093334l-103.082666-448.853333c-3.413333-13.141333-15.872-22.869333-30.378667-22.869333H87.04c-18.773333 0-34.133333-15.36-34.133333-34.133334s15.36-34.133333 34.133333-34.133333h53.930667c45.738667 0 85.504 30.890667 96.597333 75.264l102.912 448.682667c3.413333 13.141333 15.872 22.869333 30.378667 22.869333H803.84c13.482667 0 25.6-8.533333 29.866667-21.504l86.698666-301.056c3.754667-11.093333 2.218667-21.504-3.754666-29.866667s-15.36-13.141333-25.6-13.141333H393.898667c-18.773333 0-34.133333-15.36-34.133334-34.133333s15.36-34.133333 34.133334-34.133334H890.88c32.426667 0 61.952 15.189333 81.066667 41.472 18.944 26.453333 23.893333 59.221333 13.482666 89.941334l-86.698666 301.056c-13.994667 42.325333-52.053333 69.632-94.890667 69.632z" fill="#09a84f" p-id="16613"></path></svg>

+ 1 - 1
ghsApp/src/static/icons/stock_in_record.svg

@@ -1 +1 @@
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1779939373595" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="47082" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M380.859 6.949h262.288c35.883 0 64.546 28.663 64.546 64.552 0 35.882-28.664 64.546-64.546 64.546H380.859c-35.887 0-64.552-28.665-64.552-64.546 0-35.778 29.232-64.552 64.552-64.552z m0 0" p-id="47083" fill="#3385FF"></path><path d="M869.741 112.464H768.739c-14.893 56.876-66.243 97.161-125.262 97.161h-262.4c-60.148 0-110.93-41.415-125.263-97.161H154.82c-35.889 0-64.552 28.663-64.552 64.546v775.495c0 35.888 28.663 64.546 64.552 64.546h714.354c35.887 0 64.551-28.658 64.551-64.546V177.01c0.562-35.883-28.664-64.546-63.984-64.546z m-202.363 717.8c0 28.45-23.063 51.513-51.513 51.513h-207.73c-28.45 0-51.513-23.063-51.513-51.513s23.063-51.513 51.513-51.513h207.729c28.451 0 51.514 23.063 51.514 51.513z m7.565-241.686L533.485 721.982c-12.133 11.196-30.836 11.196-42.976 0l-141.45-133.404c-19.168-18.021-5.589-48.911 21.484-48.911h90.872V384.49c0-30.397-4.207-55.242 28.002-55.242h45.169c32.202 0 27.996 24.871 27.996 55.242v155.177h90.87c27.073 0 40.659 30.862 21.491 48.911z" p-id="47084" fill="#3385FF"></path></svg>
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1779953377976" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="21350" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M65.6 799.2V128.8c0-34.4 28-63.2 63.2-63.2H704c34.4 0 63.2 28 63.2 63.2v283.2h65.6V128.8C832 57.6 774.4 0 703.2 0H128.8C57.6 0 0 57.6 0 128.8v670.4c0 71.2 57.6 128.8 128.8 128.8H408v-65.6H128.8c-34.4 0-63.2-28-63.2-63.2z" fill="#09a84f" p-id="21351"></path><path d="M528 442.4c0-18.4-14.4-32.8-32.8-32.8h-288c-18.4 0-32.8 14.4-32.8 32.8s14.4 32.8 32.8 32.8h288c17.6 0 32.8-14.4 32.8-32.8zM207.2 600.8c-18.4 0-32.8 14.4-32.8 32.8s14.4 32.8 32.8 32.8H344c18.4 0 32.8-14.4 32.8-32.8s-14.4-32.8-32.8-32.8H207.2zM751.2 479.2c-150.4 0-272.8 122.4-272.8 272 0 150.4 122.4 272.8 272.8 272.8S1024 901.6 1024 752c0-150.4-122.4-272.8-272.8-272.8z m0 65.6c113.6 0 206.4 92.8 206.4 206.4 0 113.6-92.8 206.4-206.4 206.4s-206.4-92.8-206.4-206.4c0-113.6 92.8-206.4 206.4-206.4zM656.8 250.4c0-18.4-14.4-32.8-32.8-32.8H207.2c-18.4 0-32.8 14.4-32.8 32.8s14.4 32.8 32.8 32.8H624c18.4 0.8 32.8-14.4 32.8-32.8z" fill="#09a84f" p-id="21352"></path><path d="M861.6 784c0-18.4-14.4-32.8-32.8-32.8h-42.4v-76.8c0-18.4-14.4-32.8-32.8-32.8s-32.8 14.4-32.8 32.8v143.2h108c18.4-0.8 32.8-15.2 32.8-33.6z" fill="#09a84f" p-id="21353"></path></svg>

+ 14 - 0
ghsApp/src/utils/iconSrc.js

@@ -5,6 +5,12 @@ const ICON_ALIASES = {
   'add-custom': 'add_custom'
 }
 
+const ICON_BG_MAP = {
+  breakage: '#EAF6F0'
+}
+
+const DEFAULT_ICON_BG = '#EAF2FF'
+
 export function iconSrc(icon) {
   if (!icon) {
     return ''
@@ -13,6 +19,14 @@ export function iconSrc(icon) {
   return `/static/icons/${name}.svg`
 }
 
+export function iconBg(icon) {
+  if (!icon) {
+    return DEFAULT_ICON_BG
+  }
+  const name = ICON_ALIASES[icon] || icon
+  return ICON_BG_MAP[name] || DEFAULT_ICON_BG
+}
+
 export function iconStyle(size, height) {
   const widthValue = typeof size === 'number' ? `${size}px` : size
   const heightValue = height == null ? widthValue : (typeof height === 'number' ? `${height}px` : height)

Некоторые файлы не были показаны из-за большого количества измененных файлов