From e2d1d78bc72459a0ac2e2e337bbca7c8a1e41e17 Mon Sep 17 00:00:00 2001
From: wangrong <wangrong@shsening.com>
Date: 星期二, 29 九月 2026 22:44:02 +0800
Subject: [PATCH] 修改首页加logo等

---
 src/modules/operation/views/wastesale.vue          |    4 
 src/modules/report/views/screen/overview.vue       |   22 +++---
 src/modules/report/views/screen/participation.vue  |    2 
 src/modules/report/views/screen/carbon.vue         |   14 ++--
 public/bak.png                                     |    0 
 .env                                               |    2 
 src/modules/maps/hooks/use-map.ts                  |   46 +++++++++++++++
 src/modules/report/components/screen-map-panel.vue |   45 ++++++++++++--
 src/modules/report/views/screen/map.vue            |   20 +++---
 public/logo.png                                    |    0 
 10 files changed, 115 insertions(+), 40 deletions(-)

diff --git a/.env b/.env
index 367cecc..87a62d9 100644
--- a/.env
+++ b/.env
@@ -1,5 +1,5 @@
 # 搴旂敤鍚嶇О
-VITE_NAME = " WOMP "
+VITE_NAME = " 鏃犲簾鏍″洯 "
 
 # 缃戠粶瓒呮椂璇锋眰鏃堕棿
 VITE_TIMEOUT = 30000
\ No newline at end of file
diff --git a/public/bak.png b/public/bak.png
new file mode 100644
index 0000000..a75c618
--- /dev/null
+++ b/public/bak.png
Binary files differ
diff --git a/public/logo.png b/public/logo.png
index a75c618..b05b6d0 100644
--- a/public/logo.png
+++ b/public/logo.png
Binary files differ
diff --git a/src/modules/maps/hooks/use-map.ts b/src/modules/maps/hooks/use-map.ts
index 5f91ca5..645d2d6 100644
--- a/src/modules/maps/hooks/use-map.ts
+++ b/src/modules/maps/hooks/use-map.ts
@@ -4,6 +4,52 @@
 export const MAP_TK = '51915011aa0997aa2ddd7e38504fa8bc';
 export const MAP_LOAD = { v: '4.0', tk: MAP_TK };
 export const DEFAULT_CENTER: LngLat = [121.280637, 32.125178];
+export const DEFAULT_ZOOM = 16;
+export const MAP_ZOOM_KEY = 'map.zoomlevel';
+export const MAP_COORD_KEY = 'map.coordinates';
+
+function paramText(raw: unknown): string {
+	if (raw == null) return '';
+	if (typeof raw === 'string' || typeof raw === 'number') return String(raw).trim();
+	if (Array.isArray(raw)) return raw.map(e => String(e).trim()).join(',');
+	return '';
+}
+
+export function parseMapZoom(raw: unknown, fallback = DEFAULT_ZOOM) {
+	const n = Number(paramText(raw));
+	return Number.isFinite(n) && n > 0 ? n : fallback;
+}
+
+export function parseMapCenter(raw: unknown, fallback: LngLat = DEFAULT_CENTER): LngLat {
+	const text = paramText(raw);
+	const parts = text.split(/[,锛宂/).map(s => Number(s.trim()));
+	if (parts.length >= 2 && Number.isFinite(parts[0]) && Number.isFinite(parts[1])) {
+		return [parts[0], parts[1]];
+	}
+	return fallback;
+}
+
+/** 浠� base_sys_param 璇诲彇瀛︽牎鍦板浘榛樿瑙嗚锛歮ap.zoomlevel銆乵ap.coordinates锛坙on,lat锛� */
+export async function loadMapView(service: any): Promise<{ center: LngLat; zoom: number }> {
+	const read = async (key: string) => {
+		try {
+			if (service?.base?.sys?.param?.stringbykey) {
+				return await service.base.sys.param.stringbykey({ key });
+			}
+			return await service.request({
+				url: 'admin/base/sys/param/stringbykey',
+				params: { key }
+			});
+		} catch {
+			return '';
+		}
+	};
+	const [zoomRaw, coordRaw] = await Promise.all([read(MAP_ZOOM_KEY), read(MAP_COORD_KEY)]);
+	return {
+		center: parseMapCenter(coordRaw),
+		zoom: parseMapZoom(zoomRaw)
+	};
+}
 
 export function pinIcon(color: string) {
 	const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 0 28 40"><path fill="${color}" stroke="#fff" stroke-width="1.5" d="M14 1C7.4 1 2 6.4 2 13c0 8.8 12 25 12 25s12-16.2 12-25C26 6.4 20.6 1 14 1z"/><circle cx="14" cy="13" r="5" fill="#fff"/></svg>`;
diff --git a/src/modules/operation/views/wastesale.vue b/src/modules/operation/views/wastesale.vue
index 83867a0..08c37d7 100644
--- a/src/modules/operation/views/wastesale.vue
+++ b/src/modules/operation/views/wastesale.vue
@@ -139,7 +139,7 @@
             required: true
         },
         {
-            label: t('閲嶉噺'),
+            label: t('閲嶉噺(kg)'),
             prop: "weight",
             hook: "number",
             component: {
@@ -233,7 +233,7 @@
             sortable: "custom",
             component: { name: "cl-date-text" }
         },
-        { label: t('閲嶉噺'), prop: "weight", minWidth: 140, sortable: "custom" },
+        { label: t('閲嶉噺(kg)'), prop: "weight", minWidth: 140, sortable: "custom" },
         { label: t('鍗曚环'), prop: "unitPrice", minWidth: 140, sortable: "custom" },
         { label: t('鎬讳环'), prop: "totalPrice", minWidth: 140, sortable: "custom" },
         {
diff --git a/src/modules/report/components/screen-map-panel.vue b/src/modules/report/components/screen-map-panel.vue
index b86dd28..4d72cd2 100755
--- a/src/modules/report/components/screen-map-panel.vue
+++ b/src/modules/report/components/screen-map-panel.vue
@@ -11,9 +11,16 @@
 			</div>
 		</div>
 
-		<!-- 鍦板浘涓讳綋 -->
+		<!-- 鍦板浘涓讳綋锛氱瓑鍙傛暟灏辩华鍐嶅垱寤猴紝閬垮厤澶╁湴鍥惧彧鍦ㄥ垵濮嬪寲鏃跺悆 center/zoom -->
 		<div class="map-panel__map">
-			<tdt-map :center="center" :zoom="zoom" :controls="controls" :loadConfig="MAP_LOAD">
+			<tdt-map
+				v-if="viewReady"
+				:center="center"
+				:zoom="zoom"
+				:controls="controls"
+				:loadConfig="MAP_LOAD"
+				@init="onMapInit"
+			>
 				<tdt-marker
 					v-for="item in list"
 					:key="keyOf(item)"
@@ -40,12 +47,15 @@
 
 import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
 import { TdtMap, TdtMarker, type LngLat } from 'vue-tianditu2';
+import { useCool } from '/@/cool';
 import {
 	DEFAULT_CENTER,
+	DEFAULT_ZOOM,
 	MAP_LOAD,
 	SORTER_ICON,
 	VEHICLE_ICON,
 	formatTime,
+	loadMapView,
 	siteIcon,
 	useMapsApi
 } from '../../maps/hooks/use-map';
@@ -97,12 +107,14 @@
 	}
 };
 
+const { service } = useCool();
 const api = useMapsApi();
 
 const layer = ref<LayerKey>('site');
 const list = ref<any[]>([]);
 const center = ref<LngLat>(DEFAULT_CENTER);
-const zoom = ref(12);
+const zoom = ref(DEFAULT_ZOOM);
+const viewReady = ref(false);
 const lastUpdate = ref('');
 
 const controls = ['Zoom', 'Scale'];
@@ -131,14 +143,29 @@
 	return cfg.value.icon(item);
 }
 
+function applyView(map: any) {
+	const [lon, lat] = center.value;
+	if (!map || !Number.isFinite(lon) || !Number.isFinite(lat)) return;
+	const TMap = (window as any).T;
+	const lnglat = TMap?.LngLat ? new TMap.LngLat(lon, lat) : [lon, lat];
+	if (typeof map.centerAndZoom === 'function') {
+		map.centerAndZoom(lnglat, zoom.value);
+	} else {
+		map.panTo?.(lnglat);
+		map.setZoom?.(zoom.value);
+	}
+	map.checkResize?.();
+}
+
+function onMapInit(map: any) {
+	applyView(map);
+	window.setTimeout(() => applyView(map), 200);
+}
+
 async function load() {
 	const res = await cfg.value.load();
 	list.value = Array.isArray(res) ? res : [];
 	lastUpdate.value = formatTime(new Date());
-	if (list.value[0]) {
-		center.value = pos(list.value[0]);
-		zoom.value = 13;
-	}
 }
 
 // 杞﹁締 / 鍒嗘嫞鍛樹负瀹炴椂浣嶇疆锛�30s 杞锛涚珯鐐规槸闈欐�佸彴璐︼紝涓嶈疆璇�
@@ -162,6 +189,10 @@
 });
 
 onMounted(async () => {
+	const view = await loadMapView(service);
+	center.value = view.center;
+	zoom.value = view.zoom;
+	viewReady.value = true;
 	await load();
 	startPolling();
 });
diff --git a/src/modules/report/views/screen/carbon.vue b/src/modules/report/views/screen/carbon.vue
index 3121ae7..ff8e693 100644
--- a/src/modules/report/views/screen/carbon.vue
+++ b/src/modules/report/views/screen/carbon.vue
@@ -1,6 +1,6 @@
 <template>
 	<div class="screen-page">
-		<div class="kpi-grid" style="--kpi-cols: 5">
+		<div class="kpi-grid" style="--kpi-cols: 3">
 			<kpi-card v-for="item in kpis" :key="item.label" v-bind="item" />
 		</div>
 
@@ -57,11 +57,9 @@
 );
 
 const kpis = computed(() => [
-	{ field: 'kpis.totalCarbonTon', label: '绱纰冲噺鎺�', value: data.value.kpis.totalCarbonTon, suffix: '鍚–O鈧俥', fixed: 1 },
-	{ field: 'kpis.periodCarbonTon', label: `${rangeLabel.value}纰冲噺鎺抈, value: data.value.kpis.periodCarbonTon, suffix: '鍚–O鈧俥', fixed: 2 },
-	{ field: 'kpis.totalWeightTon', label: '绱璧勬簮鍥炴敹', value: data.value.kpis.totalWeightTon, suffix: '鍚�', fixed: 1 },
-	{ field: 'kpis.totalParticipants', label: '绱鍙備笌甯堢敓', value: data.value.kpis.totalParticipants, suffix: '浜�', fixed: 0 },
-	{ field: 'kpis.greenActions', label: '绱鐜繚琛屼负', value: data.value.kpis.greenActions, suffix: '娆�', fixed: 0 }
+	{ field: 'kpis.periodWeightTon', label: `${rangeLabel.value}璧勬簮鍥炴敹`, value: data.value.kpis.periodWeightTon, suffix: '鍚�', fixed: 2, hint: '褰撳墠鏃堕棿鑼冨洿' },
+	{ field: 'kpis.newParticipants', label: `${rangeLabel.value}鍙備笌甯堢敓`, value: data.value.kpis.newParticipants, suffix: '浜�', fixed: 0, hint: '鍖洪棿鍐呭嚭鐜拌繃鐨勫幓閲嶇敤鎴�' },
+	{ field: 'kpis.greenActions', label: `${rangeLabel.value}鐜繚琛屼负`, value: data.value.kpis.greenActions, suffix: '娆�', fixed: 0, hint: '鍖洪棿鍐呭凡瀹屾垚璁㈠崟鏁�' }
 ]);
 
 const carbonTrendDemo = computed(() =>
@@ -80,7 +78,7 @@
 		},
 		yAxis: {
 			type: 'value',
-			name: '鍚–O鈧俥',
+			name: 'tCO鈧俥',
 			nameTextStyle: { color: mutedColor.value },
 			splitLine: { lineStyle: { color: splitColor.value, type: 'dashed' } },
 			axisLabel: { color: mutedColor.value },
@@ -111,7 +109,7 @@
 	},
 	yAxis: {
 		type: 'value',
-		name: '鍚–O鈧俥',
+		name: 'tCO鈧俥',
 		nameTextStyle: { color: mutedColor.value },
 		splitLine: { lineStyle: { color: splitColor.value, type: 'dashed' } },
 		axisLabel: { color: mutedColor.value },
diff --git a/src/modules/report/views/screen/map.vue b/src/modules/report/views/screen/map.vue
index 9d6faaa..048768a 100755
--- a/src/modules/report/views/screen/map.vue
+++ b/src/modules/report/views/screen/map.vue
@@ -96,21 +96,21 @@
 const itemMetric = ref<'weight' | 'value' | 'carbon'>('weight');
 
 const mixOptions = [
-	{ label: '閲嶉噺', value: 'weight' },
-	{ label: '浠峰��', value: 'value' },
-	{ label: '鏁伴噺', value: 'count' }
+	{ label: '閲嶉噺(kg)', value: 'weight' },
+	{ label: '浠峰��(鍏�)', value: 'value' },
+	{ label: '璁℃暟(娆�)', value: 'count' }
 ];
 
 const trendOptions = [
-	{ label: '閲嶉噺', value: 'weight' },
-	{ label: '浠峰��', value: 'value' },
-	{ label: '纰冲噺鎺�', value: 'carbon' }
+	{ label: '閲嶉噺(kg)', value: 'weight' },
+	{ label: '浠峰��(鍏�)', value: 'value' },
+	{ label: '纰冲噺鎺�(kgCO鈧俥)', value: 'carbon' }
 ];
 
 const itemOptions = [
-	{ label: '閲嶉噺', value: 'weight' },
-	{ label: '浠峰��', value: 'value' },
-	{ label: '纰冲噺鎺�', value: 'carbon' }
+	{ label: '閲嶉噺(kg)', value: 'weight' },
+	{ label: '浠峰��(鍏�)', value: 'value' },
+	{ label: '纰冲噺鎺�(kgCO鈧俥)', value: 'carbon' }
 ];
 
 const rangeLabel = computed(
@@ -122,7 +122,7 @@
 	{ field: 'kpis.periodWeightTon', label: `${rangeLabel.value}鍥炴敹閲廯, value: data.value.kpis.periodWeightTon, suffix: '鍚�', fixed: 2 },
 	{ field: 'kpis.resourceRate', label: '璧勬簮鍖栫巼', value: data.value.kpis.resourceRate, suffix: '%', fixed: 1 },
 	{ field: 'kpis.periodValue', label: '鍥炴敹浠峰��', value: data.value.kpis.periodValue, suffix: '鍏�', fixed: 0 },
-	{ field: 'kpis.periodCarbonTon', label: '纰冲噺鎺�', value: data.value.kpis.periodCarbonTon, suffix: '鍚–O鈧俥', fixed: 2 },
+	{ field: 'kpis.periodCarbonTon', label: '纰冲噺鎺�(tCO鈧俥)', value: data.value.kpis.periodCarbonTon, suffix: 'tCO鈧俥', fixed: 2 },
 	{ field: 'kpis.totalWeightTon', label: '绱鍥炴敹閲�', value: data.value.kpis.totalWeightTon, suffix: '鍚�', fixed: 1 },
 	{ field: 'kpis.totalParticipants', label: '绱鍙備笌浜烘暟', value: data.value.kpis.totalParticipants, suffix: '浜�', fixed: 0 },
 	{ field: 'kpis.totalPoints', label: '绱纰崇Н鍒�', value: data.value.kpis.totalPoints, suffix: '鍒�', fixed: 0 }
diff --git a/src/modules/report/views/screen/overview.vue b/src/modules/report/views/screen/overview.vue
index 8dba391..e0e4874 100644
--- a/src/modules/report/views/screen/overview.vue
+++ b/src/modules/report/views/screen/overview.vue
@@ -62,15 +62,15 @@
 const trendMetric = ref<'weight' | 'value' | 'carbon'>('weight');
 
 const mixOptions = [
-	{ label: '閲嶉噺', value: 'weight' },
-	{ label: '浠峰��', value: 'value' },
-	{ label: '鏁伴噺', value: 'count' }
+	{ label: '閲嶉噺(kg)', value: 'weight' },
+	{ label: '浠峰��(鍏�)', value: 'value' },
+	{ label: '璁℃暟(娆�)', value: 'count' }
 ];
 
 const trendOptions = [
-	{ label: '閲嶉噺', value: 'weight' },
-	{ label: '浠峰��', value: 'value' },
-	{ label: '纰冲噺鎺�', value: 'carbon' }
+	{ label: '閲嶉噺(kg)', value: 'weight' },
+	{ label: '浠峰��(鍏�)', value: 'value' },
+	{ label: '纰冲噺鎺�(kgCO鈧俥)', value: 'carbon' }
 ];
 
 const rangeLabel = computed(
@@ -78,13 +78,13 @@
 );
 
 const kpis = computed(() => [
-	{ field: 'kpis.periodWeightTon', label: `${rangeLabel.value}鍥炴敹閲廯, value: data.value.kpis.periodWeightTon, suffix: '鍚�', fixed: 2, hint: '褰撳墠鏃堕棿鑼冨洿' },
+	{ field: 'kpis.periodWeightTon', label: `${rangeLabel.value}鍥炴敹閲廯, value: data.value.kpis.periodWeightTon, suffix: 't', fixed: 2, hint: '褰撳墠鏃堕棿鑼冨洿' },
 	{ field: 'kpis.resourceRate', label: '璧勬簮鍖栫巼', value: data.value.kpis.resourceRate, suffix: '%', fixed: 1, hint: '鍙洖鏀剁墿閲嶉噺/鎬婚噸閲忥紝涓嶅惈澶т欢' },
 	{ field: 'kpis.periodValue', label: '鍥炴敹浠峰��', value: data.value.kpis.periodValue, suffix: '鍏�', fixed: 0, hint: '鏃ヨ〃浼扮畻閿�鍞' },
-	{ field: 'kpis.periodCarbonTon', label: '纰冲噺鎺�', value: data.value.kpis.periodCarbonTon, suffix: '鍚–O鈧俥', fixed: 2, hint: '鍒嗙被閲嶉噺 脳 纰冲噺鍥犳暟' },
-	{ field: 'kpis.totalWeightTon', label: '绱鍥炴敹閲�', value: data.value.kpis.totalWeightTon, suffix: '鍚�', fixed: 1, hint: '涓婄嚎浠ユ潵绱' },
-	{ field: 'kpis.totalParticipants', label: '绱鍙備笌浜烘暟', value: data.value.kpis.totalParticipants, suffix: '浜�', fixed: 0, hint: '鍘婚噸鏍″洯鐢ㄦ埛' },
-	{ field: 'kpis.totalPoints', label: '绱纰崇Н鍒�', value: data.value.kpis.totalPoints, suffix: '鍒�', fixed: 0, hint: '璐︽埛浣欓鍚堣' }
+	{ field: 'kpis.periodCarbonTon', label: '纰冲噺鎺�', value: data.value.kpis.periodCarbonTon, suffix: 'tCO鈧俥', fixed: 2, hint: '鍒嗙被閲嶉噺 脳 纰冲噺鍥犳暟' },
+	{ field: 'kpis.totalWeightTon', label: '绱鍥炴敹閲�', value: data.value.kpis.totalWeightTon, suffix: 't', fixed: 1, hint: '涓婄嚎浠ユ潵绱' },
+	{ field: 'kpis.totalPoints', label: '绱纰崇Н鍒�', value: data.value.kpis.totalPoints, suffix: '鍒�', fixed: 0, hint: '璐︽埛浣欓鍚堣' },
+	{ field: 'kpis.totalParticipants', label: '绱鍙備笌浜烘暟', value: data.value.kpis.totalParticipants, suffix: '浜�', fixed: 0, hint: '鍘婚噸鏍″洯鐢ㄦ埛' }
 ]);
 
 const mixOption = computed(() => ({
diff --git a/src/modules/report/views/screen/participation.vue b/src/modules/report/views/screen/participation.vue
index 270153c..d72a047 100644
--- a/src/modules/report/views/screen/participation.vue
+++ b/src/modules/report/views/screen/participation.vue
@@ -96,7 +96,7 @@
 	{ label: '鍥炴敹閲嶉噺', value: 'weight' },
 	{ label: '浜哄潎鍥炴敹閲�', value: 'weightPerCapita' },
 	{ label: '浜哄潎绉垎', value: 'pointPerCapita' },
-	{ label: '纰冲噺鎺�', value: 'carbon' }
+	{ label: '纰冲噺鎺�(kgCO鈧俥)', value: 'carbon' }
 ];
 
 const rangeLabel = computed(

--
Gitblit v1.9.1