From da65acd978c10cf75c91334ee1a768e7d82884f7 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期一, 09 十一月 2026 17:04:56 +0800
Subject: [PATCH] 测试完成
---
src/store/modules/user.js | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index f8dec16..a8483b3 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -2,6 +2,23 @@
import { getConfig, getConfigKey, listConfig } from "@/api/system/config";
import { getToken, setToken, removeToken } from "@/utils/auth";
+/**
+ * sys_user_dept 閲屽悓涓�绉戝/鐥呭尯鍙兘瀛樺湪澶ч噺閲嶅琛岋紙HIS 鍚屾/閲嶅淇濆瓨瀵艰嚧锛夛紝
+ * 鎺ュ彛浼氬師鏍疯繑鍥烇紝杩欓噷鎸夌紪鐮佸幓閲嶏紝閬垮厤涓汉涓績銆佸緟澶勭悊鍗$墖绛夊閲嶅灞曠ず
+ */
+function uniqueByCode(list) {
+ const seen = {};
+ return (list || []).filter((item) => {
+ if (!item) return false;
+ const code =
+ item.districtCode || item.deptCode || item.districtId || item.deptId;
+ const key = String(code === undefined || code === null ? "" : code);
+ if (!key || seen[key]) return false;
+ seen[key] = true;
+ return true;
+ });
+}
+
const user = {
state: {
token: getToken(),
@@ -300,8 +317,8 @@
commit("SET_Id", user.userId);
commit("SET_hisUserId", user.hisUserId);
commit("SET_satisfactionCategories", user.satisfactionCategories);
- commit("SET_leavehospitaldistrictcodes", user.belongWards);
- commit("SET_leaveldeptcodes", user.belongDepts);
+ commit("SET_leavehospitaldistrictcodes", uniqueByCode(user.belongWards));
+ commit("SET_leaveldeptcodes", uniqueByCode(user.belongDepts));
commit("SET_AVATAR", avatar);
// 姝g‘璋冪敤鏂瑰紡锛氶�氳繃 dispatch
dispatch("GetConfig")
--
Gitblit v1.9.3