From 72ceaa81f556c6519c97b2391871ba84729a9a6c Mon Sep 17 00:00:00 2001
From: wangrong <wangrong@shsening.com>
Date: 星期六, 10 十月 2026 10:10:53 +0800
Subject: [PATCH] 大部分页面增加按单位部门筛选的功能

---
 src/modules/basicdata/views/sorter.vue        |   28 +++++
 src/modules/report/views/dailysite.vue        |   24 ++++
 src/modules/base/locales/en.json              |    2 
 src/modules/push/views/siteweight.vue         |   26 +++++
 src/modules/push/views/vehiclegps.vue         |   26 +++++
 src/modules/base/locales/zh-tw.json           |    2 
 src/modules/basicdata/views/iot.vue           |   30 +++++
 src/modules/base/pages/login/en.json          |    2 
 src/modules/base/locales/zh-cn.json           |    2 
 src/modules/report/locales/zh-cn.json         |   30 +++---
 src/modules/report/views/dailydepartment.vue  |   22 ++++
 src/modules/report/views/dailyvehicle.vue     |   28 +++++
 src/modules/base/components/dept/select.vue   |    9 +
 src/modules/push/views/compressionweight.vue  |   14 ++
 src/modules/report/views/dailysorter.vue      |   26 +++++
 src/modules/report/views/screen/operation.vue |    2 
 16 files changed, 243 insertions(+), 30 deletions(-)

diff --git a/src/modules/base/components/dept/select.vue b/src/modules/base/components/dept/select.vue
index b1a02ba..4114362 100644
--- a/src/modules/base/components/dept/select.vue
+++ b/src/modules/base/components/dept/select.vue
@@ -12,6 +12,8 @@
 			:multiple="multiple"
 			:check-strictly="checkStrictly"
 			:show-checkbox="multiple"
+			:placeholder="placeholder"
+			:clearable="clearable"
 			default-expand-all
 			@change="onChange"
 			@check="onCheckChange"
@@ -35,7 +37,12 @@
 	checkStrictly: {
 		type: Boolean,
 		default: true
-	}
+	},
+	placeholder: {
+		type: String,
+		default: '璇烽�夋嫨鍗曚綅'
+	},
+	clearable: Boolean
 });
 
 const emit = defineEmits(['update:modelValue', 'change']);
diff --git a/src/modules/base/locales/en.json b/src/modules/base/locales/en.json
index 4f6b9d8..dbbaf28 100644
--- a/src/modules/base/locales/en.json
+++ b/src/modules/base/locales/en.json
@@ -102,6 +102,8 @@
   "閿�": "Key",
   "閫夋嫨閮ㄩ棬": "Select Department",
   "璇烽�夋嫨閮ㄩ棬": "Please Select Department",
+  "鎸夊崟浣嶇瓫閫�": "Filter by Unit",
+  "璇烽�夋嫨鍗曚綅": "Please Select Unit",
   "杞Щ鍒版柊閮ㄩ棬锛屾槸鍚︾户缁紵": "Transfer to a new department. Continue?",
   "杞Щ鎴愬姛": "Transfer Successful",
   "缁勭粐鏋舵瀯": "Organization Structure",
diff --git a/src/modules/base/locales/zh-cn.json b/src/modules/base/locales/zh-cn.json
index 8187cca..40b0b06 100644
--- a/src/modules/base/locales/zh-cn.json
+++ b/src/modules/base/locales/zh-cn.json
@@ -61,6 +61,8 @@
   "閮ㄩ棬杞Щ": "閮ㄩ棬杞Щ",
   "閫夋嫨閮ㄩ棬": "閫夋嫨閮ㄩ棬",
   "璇烽�夋嫨閮ㄩ棬": "璇烽�夋嫨閮ㄩ棬",
+  "鎸夊崟浣嶇瓫閫�": "鎸夊崟浣嶇瓫閫�",
+  "璇烽�夋嫨鍗曚綅": "璇烽�夋嫨鍗曚綅",
   "杞Щ鍒版柊閮ㄩ棬锛屾槸鍚︾户缁紵": "杞Щ鍒版柊閮ㄩ棬锛屾槸鍚︾户缁紵",
   "杞Щ鎴愬姛": "杞Щ鎴愬姛",
   "缁勭粐鏋舵瀯": "缁勭粐鏋舵瀯",
diff --git a/src/modules/base/locales/zh-tw.json b/src/modules/base/locales/zh-tw.json
index ccbf022..120332c 100644
--- a/src/modules/base/locales/zh-tw.json
+++ b/src/modules/base/locales/zh-tw.json
@@ -122,6 +122,8 @@
   "鐧诲綍": "鐧婚寗",
   "閫夋嫨閮ㄩ棬": "閬告搰閮ㄩ杸",
   "璇烽�夋嫨閮ㄩ棬": "璜嬮伕鎿囬儴闁�",
+  "鎸夊崟浣嶇瓫閫�": "鎸夊柈浣嶇閬�",
+  "璇烽�夋嫨鍗曚綅": "璜嬮伕鎿囧柈浣�",
   "杞Щ鍒版柊閮ㄩ棬锛屾槸鍚︾户缁紵": "杞夌Щ鍒版柊閮ㄩ杸锛屾槸鍚︾辜绾岋紵",
   "杞Щ鎴愬姛": "杞夌Щ鎴愬姛",
   "缁勭粐鏋舵瀯": "绲勭箶鏋舵",
diff --git a/src/modules/base/pages/login/en.json b/src/modules/base/pages/login/en.json
index 4f6b9d8..dbbaf28 100644
--- a/src/modules/base/pages/login/en.json
+++ b/src/modules/base/pages/login/en.json
@@ -102,6 +102,8 @@
   "閿�": "Key",
   "閫夋嫨閮ㄩ棬": "Select Department",
   "璇烽�夋嫨閮ㄩ棬": "Please Select Department",
+  "鎸夊崟浣嶇瓫閫�": "Filter by Unit",
+  "璇烽�夋嫨鍗曚綅": "Please Select Unit",
   "杞Щ鍒版柊閮ㄩ棬锛屾槸鍚︾户缁紵": "Transfer to a new department. Continue?",
   "杞Щ鎴愬姛": "Transfer Successful",
   "缁勭粐鏋舵瀯": "Organization Structure",
diff --git a/src/modules/basicdata/views/iot.vue b/src/modules/basicdata/views/iot.vue
index 965c9f1..a044aa5 100644
--- a/src/modules/basicdata/views/iot.vue
+++ b/src/modules/basicdata/views/iot.vue
@@ -278,8 +278,34 @@
 	],
 });
 
-// cl-search
-const Search = useSearch();
+// cl-search锛氬綊灞炲崟浣嶆敼涓洪儴闂ㄦ爲
+function deptSearch({ exposed }: { exposed: any }) {
+	const items = exposed.config?.items as { prop?: string }[] | undefined;
+	if (!items) return;
+	for (let i = items.length - 1; i >= 0; i--) {
+		if (items[i].prop === "departmentId" || items[i].prop === "departmentName") {
+			items.splice(i, 1);
+		}
+	}
+	items.unshift({
+		label: t("鎸夊崟浣嶇瓫閫�"),
+		prop: "departmentId",
+		component: {
+			name: "cl-dept-select",
+			props: {
+				placeholder: t("璇烽�夋嫨鍗曚綅"),
+				checkStrictly: true,
+				immediate: true,
+				clearable: true,
+			},
+			style: { width: "180px" },
+		},
+	});
+}
+
+const Search = useSearch({
+	plugins: [deptSearch],
+});
 
 // cl-crud
 const Crud = useCrud(
diff --git a/src/modules/basicdata/views/sorter.vue b/src/modules/basicdata/views/sorter.vue
index 872fe81..54e1233 100644
--- a/src/modules/basicdata/views/sorter.vue
+++ b/src/modules/basicdata/views/sorter.vue
@@ -258,8 +258,32 @@
 	],
 });
 
-// cl-search
-const Search = useSearch();
+// cl-search锛氭墍灞炲崟浣嶆敼涓洪儴闂ㄦ爲锛屽幓鎺夊師鏉ョ殑鏂囨湰妗�
+function deptSearch({ exposed }: { exposed: any }) {
+	const items = exposed.config?.items as { prop?: string }[] | undefined;
+	if (!items) return;
+	for (let i = items.length - 1; i >= 0; i--) {
+		if (items[i].prop === "departmentId") items.splice(i, 1);
+	}
+	items.unshift({
+		label: t("鎸夊崟浣嶇瓫閫�"),
+		prop: "departmentId",
+		component: {
+			name: "cl-dept-select",
+			props: {
+				placeholder: t("璇烽�夋嫨鍗曚綅"),
+				checkStrictly: true,
+				immediate: true,
+				clearable: true,
+			},
+			style: { width: "180px" },
+		},
+	});
+}
+
+const Search = useSearch({
+	plugins: [deptSearch],
+});
 
 // cl-crud
 const Crud = useCrud(
diff --git a/src/modules/push/views/compressionweight.vue b/src/modules/push/views/compressionweight.vue
index ebba0dd..a13c246 100644
--- a/src/modules/push/views/compressionweight.vue
+++ b/src/modules/push/views/compressionweight.vue
@@ -197,6 +197,20 @@
 const Search = useSearch({
 	items: [
 		{
+			label: t("鎸夊崟浣嶇瓫閫�"),
+			prop: "departmentId",
+			component: {
+				name: "cl-dept-select",
+				props: {
+					placeholder: t("璇烽�夋嫨鍗曚綅"),
+					checkStrictly: true,
+					immediate: true,
+					clearable: true,
+				},
+				style: { width: "180px" },
+			},
+		},
+		{
 			label: "绔欑偣绫诲瀷",
 			prop: "siteType",
 			value: "鍘嬬缉绔�",
diff --git a/src/modules/push/views/siteweight.vue b/src/modules/push/views/siteweight.vue
index e8c5024..5853772 100644
--- a/src/modules/push/views/siteweight.vue
+++ b/src/modules/push/views/siteweight.vue
@@ -186,8 +186,32 @@
 	],
 });
 
+function deptSearch({ exposed }: { exposed: any }) {
+	const items = exposed.config?.items as { prop?: string }[] | undefined;
+	if (!items) return;
+	for (let i = items.length - 1; i >= 0; i--) {
+		if (items[i].prop === "departmentId") items.splice(i, 1);
+	}
+	items.unshift({
+		label: t("鎸夊崟浣嶇瓫閫�"),
+		prop: "departmentId",
+		component: {
+			name: "cl-dept-select",
+			props: {
+				placeholder: t("璇烽�夋嫨鍗曚綅"),
+				checkStrictly: true,
+				immediate: true,
+				clearable: true,
+			},
+			style: { width: "180px" },
+		},
+	});
+}
+
 // cl-search
-const Search = useSearch();
+const Search = useSearch({
+	plugins: [deptSearch],
+});
 
 // cl-crud
 const Crud = useCrud(
diff --git a/src/modules/push/views/vehiclegps.vue b/src/modules/push/views/vehiclegps.vue
index eee4a55..c2ec412 100644
--- a/src/modules/push/views/vehiclegps.vue
+++ b/src/modules/push/views/vehiclegps.vue
@@ -201,8 +201,32 @@
     ]
 });
 
+function deptSearch({ exposed }: { exposed: any }) {
+	const items = exposed.config?.items as { prop?: string }[] | undefined;
+	if (!items) return;
+	for (let i = items.length - 1; i >= 0; i--) {
+		if (items[i].prop === "departmentId") items.splice(i, 1);
+	}
+	items.unshift({
+		label: t("鎸夊崟浣嶇瓫閫�"),
+		prop: "departmentId",
+		component: {
+			name: "cl-dept-select",
+			props: {
+				placeholder: t("璇烽�夋嫨鍗曚綅"),
+				checkStrictly: true,
+				immediate: true,
+				clearable: true,
+			},
+			style: { width: "180px" },
+		},
+	});
+}
+
 // cl-search
-const Search = useSearch();
+const Search = useSearch({
+	plugins: [deptSearch],
+});
 
 // cl-crud
 const Crud = useCrud(
diff --git a/src/modules/report/locales/zh-cn.json b/src/modules/report/locales/zh-cn.json
index 8922103..f8b343c 100644
--- a/src/modules/report/locales/zh-cn.json
+++ b/src/modules/report/locales/zh-cn.json
@@ -17,23 +17,23 @@
 "绔欑偣鍚嶇О":"绔欑偣鍚嶇О",
 "鎵�灞為儴闂�":"鎵�灞為儴闂�",
 "鎬婚噸閲�":"鎬婚噸閲�",
-"sw60閲嶉噺":"sw60閲嶉噺",
-"sw61閲嶉噺":"sw61閲嶉噺",
-"sw62閲嶉噺":"sw62閲嶉噺",
-"sw63閲嶉噺":"sw63閲嶉噺",
-"sw64閲嶉噺":"sw64閲嶉噺",
+"sw60閲嶉噺":"鏈夊鍨冨溇閲嶉噺",
+"sw61閲嶉噺":"婀垮瀮鍦鹃噸閲�",
+"sw62閲嶉噺":"鍙洖鏀剁墿閲嶉噺",
+"sw63閲嶉噺":"澶т欢鍨冨溇閲嶉噺",
+"sw64閲嶉噺":"骞插瀮鍦鹃噸閲�",
 "鎬荤О閲嶆鏁�":"鎬荤О閲嶆鏁�",
-"sw60娆℃暟":"sw60娆℃暟",
-"sw61娆℃暟":"sw61娆℃暟",
-"sw62娆℃暟":"sw62娆℃暟",
-"sw63娆℃暟":"sw63娆℃暟",
-"sw64娆℃暟":"sw64娆℃暟",
+"sw60娆℃暟":"鏈夊鍨冨溇娆℃暟",
+"sw61娆℃暟":"婀垮瀮鍦炬鏁�",
+"sw62娆℃暟":"鍙洖鏀剁墿娆℃暟",
+"sw63娆℃暟":"澶т欢鍨冨溇娆℃暟",
+"sw64娆℃暟":"骞插瀮鍦炬鏁�",
 "鎬荤⒊鎺掗噺":"鎬荤⒊鎺掗噺(kgCO鈧俥/kg)",
-"sw60纰虫帓閲�":"sw60纰虫帓閲�",
-"sw61纰虫帓閲�":"sw61纰虫帓閲�",
-"sw62纰虫帓閲�":"sw62纰虫帓閲�",
-"sw63纰虫帓閲�":"sw63纰虫帓閲�",
-"sw64纰虫帓閲�":"sw64纰虫帓閲�",
+"sw60纰虫帓閲�":"鏈夊鍨冨溇纰虫帓閲�",
+"sw61纰虫帓閲�":"婀垮瀮鍦剧⒊鎺掗噺",
+"sw62纰虫帓閲�":"鍙洖鏀剁墿纰虫帓閲�",
+"sw63纰虫帓閲�":"澶т欢鍨冨溇纰虫帓閲�",
+"sw64纰虫帓閲�":"骞插瀮鍦剧⒊鎺掗噺",
 "sw62浼扮畻閿�鍞":"sw62浼扮畻閿�鍞",
 "INIT":"INIT",
 "RUNNING":"RUNNING",
diff --git a/src/modules/report/views/dailydepartment.vue b/src/modules/report/views/dailydepartment.vue
index 77a879a..e42de03 100644
--- a/src/modules/report/views/dailydepartment.vue
+++ b/src/modules/report/views/dailydepartment.vue
@@ -509,8 +509,26 @@
 // cl-search
 function hideDateSearch({ exposed }: { exposed: any }) {
 	const items = exposed.config?.items as { prop?: string }[] | undefined;
-	const index = items?.findIndex(e => e.prop === "date") ?? -1;
-	if (index >= 0) items?.splice(index, 1);
+	if (!items) return;
+	for (let i = items.length - 1; i >= 0; i--) {
+		if (items[i].prop === "date" || items[i].prop === "departmentId" || items[i].prop === "keyWord") {
+			items.splice(i, 1);
+		}
+	}
+	items.unshift({
+		label: t("鎸夊崟浣嶇瓫閫�"),
+		prop: "departmentId",
+		component: {
+			name: "cl-dept-select",
+			props: {
+				placeholder: t("璇烽�夋嫨鍗曚綅"),
+				checkStrictly: true,
+				immediate: true,
+				clearable: true,
+			},
+			style: { width: "180px" },
+		},
+	});
 }
 
 const Search = useSearch({
diff --git a/src/modules/report/views/dailysite.vue b/src/modules/report/views/dailysite.vue
index 424856a..6073e61 100644
--- a/src/modules/report/views/dailysite.vue
+++ b/src/modules/report/views/dailysite.vue
@@ -517,8 +517,30 @@
 	if (index >= 0) items?.splice(index, 1);
 }
 
+function deptSearch({ exposed }: { exposed: any }) {
+	const items = exposed.config?.items as { prop?: string; component?: any }[] | undefined;
+	if (!items) return;
+	for (let i = items.length - 1; i >= 0; i--) {
+		if (items[i].prop === "departmentId") items.splice(i, 1);
+	}
+	items.unshift({
+		label: t("鎸夊崟浣嶇瓫閫�"),
+		prop: "departmentId",
+		component: {
+			name: "cl-dept-select",
+			props: {
+				placeholder: t("璇烽�夋嫨鍗曚綅"),
+				checkStrictly: true,
+				immediate: true,
+				clearable: true,
+			},
+			style: { width: "180px" },
+		},
+	});
+}
+
 const Search = useSearch({
-	plugins: [hideDateSearch]
+	plugins: [hideDateSearch, deptSearch]
 });
 
 // cl-crud
diff --git a/src/modules/report/views/dailysorter.vue b/src/modules/report/views/dailysorter.vue
index 0ba0d23..dbad015 100644
--- a/src/modules/report/views/dailysorter.vue
+++ b/src/modules/report/views/dailysorter.vue
@@ -170,8 +170,32 @@
 	]
 });
 
+function deptSearch({ exposed }: { exposed: any }) {
+	const items = exposed.config?.items as { prop?: string }[] | undefined;
+	if (!items) return;
+	for (let i = items.length - 1; i >= 0; i--) {
+		if (items[i].prop === "departmentId") items.splice(i, 1);
+	}
+	items.unshift({
+		label: t("鎸夊崟浣嶇瓫閫�"),
+		prop: "departmentId",
+		component: {
+			name: "cl-dept-select",
+			props: {
+				placeholder: t("璇烽�夋嫨鍗曚綅"),
+				checkStrictly: true,
+				immediate: true,
+				clearable: true,
+			},
+			style: { width: "180px" },
+		},
+	});
+}
+
 // cl-search
-const Search = useSearch();
+const Search = useSearch({
+	plugins: [deptSearch],
+});
 
 // cl-crud
 const Crud = useCrud(
diff --git a/src/modules/report/views/dailyvehicle.vue b/src/modules/report/views/dailyvehicle.vue
index fe6c49e..23fa3c9 100644
--- a/src/modules/report/views/dailyvehicle.vue
+++ b/src/modules/report/views/dailyvehicle.vue
@@ -208,7 +208,7 @@
 			sortable: "custom"
 		},
 		{ label: t('骞冲潎琛岄┒杞﹂��'), prop: "avgSpeed", minWidth: 140, sortable: "custom" },
-		{
+		/*{
 			label: t('瓒呴�熷憡璀︽鏁�'),
 			prop: "overspeedCount",
 			minWidth: 140,
@@ -243,7 +243,7 @@
 			prop: "offHoursMoveCount",
 			minWidth: 140,
 			sortable: "custom"
-		},
+		},*/
 		{
 			label: t('鍒涘缓鏃堕棿'),
 			prop: "createTime",
@@ -271,8 +271,30 @@
 	if (index >= 0) items?.splice(index, 1);
 }
 
+function deptSearch({ exposed }: { exposed: any }) {
+	const items = exposed.config?.items as { prop?: string }[] | undefined;
+	if (!items) return;
+	for (let i = items.length - 1; i >= 0; i--) {
+		if (items[i].prop === "departmentId") items.splice(i, 1);
+	}
+	items.unshift({
+		label: t("鎸夊崟浣嶇瓫閫�"),
+		prop: "departmentId",
+		component: {
+			name: "cl-dept-select",
+			props: {
+				placeholder: t("璇烽�夋嫨鍗曚綅"),
+				checkStrictly: true,
+				immediate: true,
+				clearable: true,
+			},
+			style: { width: "180px" },
+		},
+	});
+}
+
 const Search = useSearch({
-	plugins: [hideDateSearch]
+	plugins: [hideDateSearch, deptSearch]
 });
 
 // cl-crud
diff --git a/src/modules/report/views/screen/operation.vue b/src/modules/report/views/screen/operation.vue
index dc5a267..ac0746a 100644
--- a/src/modules/report/views/screen/operation.vue
+++ b/src/modules/report/views/screen/operation.vue
@@ -73,7 +73,7 @@
 							<div class="table__head">
 								<span>杞︾墝</span>
 								<span>閲岀▼km</span>
-								<span>鎬犻�熷垎</span>
+								<span>琛岄┒鏃堕暱</span>
 								<span>瓒呴��</span>
 								<span>鐘舵��</span>
 							</div>

--
Gitblit v1.9.1