diff --git a/src/main/java/com/budwk/app/sys/services/impl/SysDataUnitPullServiceImpl.java b/src/main/java/com/budwk/app/sys/services/impl/SysDataUnitPullServiceImpl.java index 34e6f53..3da6c4f 100644 --- a/src/main/java/com/budwk/app/sys/services/impl/SysDataUnitPullServiceImpl.java +++ b/src/main/java/com/budwk/app/sys/services/impl/SysDataUnitPullServiceImpl.java @@ -1,5 +1,7 @@ package com.budwk.app.sys.services.impl; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.ListUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONObject; import com.budwk.app.base.config.DataCenterProperties; @@ -13,6 +15,7 @@ import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.dao.Dao; import org.nutz.dao.Cnd; import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; import org.nutz.ioc.aop.Aop; import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; @@ -38,6 +41,7 @@ import java.util.stream.Collectors; public class SysDataUnitPullServiceImpl extends BaseServiceImpl implements SysDataUnitPullService { private static final String DMP_UNIT_KEY = "unit"; + private static final int BATCH_SIZE = 500; @Inject private DataCenterProperties dataCenterProperties; @@ -59,14 +63,21 @@ public class SysDataUnitPullServiceImpl extends BaseServiceImpl implem @Override @Aop(TransAop.READ_COMMITTED) public void updateUnits(List unitIds) { - Sys_unit root = DataCenterUtil.findRootUnit(query(Cnd.NEW())); + List localUnits = query(Cnd.NEW()); + Sys_unit root = DataCenterUtil.findRootUnit(localUnits); + Map unitMap = localUnits.stream() + .collect(Collectors.toMap(Sys_unit::getId, unit -> unit)); + Set existingUnitIds = new HashSet<>(unitMap.keySet()); + Map changedUnits = new LinkedHashMap<>(); + List pathUpdates = new ArrayList<>(); List rawDataList = distinctDmpUnits(DataCenterUtil.pullData(getDmpUnitUrl())); if (rawDataList.isEmpty()) { - throw new BaseException("当前未获取到单位数据,中止本次同步"); + log.warn("当前未获取到有效单位数据,跳过本次机构同步"); + return; } if (StrUtil.isBlank(root.getPath())) { - root.setPath(getUnitPath("")); - dao().updateIgnoreNull(root); + root.setPath(getUnitPath("", unitMap)); + changedUnits.put(root.getId(), root); } Set parentCodes = rawDataList.stream() .map(raw -> getNormalizedParentCode(raw, root.getId())) @@ -75,7 +86,32 @@ public class SysDataUnitPullServiceImpl extends BaseServiceImpl implem rawDataList.stream() .sorted(Comparator.comparingInt(this::getUnitLevel)) - .forEach(raw -> saveOrUpdateUnit(raw, parentCodes, root)); + .forEach(raw -> { + try { + prepareUnit(raw, parentCodes, root, unitMap, changedUnits, pathUpdates); + } catch (Exception e) { + log.warn("单位同步失败,跳过当前机构,单位编码: {},上级编码: {},原因: {}", raw.getStr("DWDM"), raw.getStr("LSDWDM"), e.getMessage()); + } + }); + + List insertUnits = new ArrayList<>(); + List updateUnits = new ArrayList<>(); + for (Sys_unit unit : changedUnits.values()) { + if (existingUnitIds.contains(unit.getId())) { + updateUnits.add(unit); + } else { + insertUnits.add(unit); + } + } + for (List batch : ListUtil.split(insertUnits, BATCH_SIZE)) { + dao().fastInsert(batch); + } + for (List batch : ListUtil.split(updateUnits, BATCH_SIZE)) { + dao().updateIgnoreNull(batch); + } + for (List batch : ListUtil.split(pathUpdates, BATCH_SIZE)) { + dao().execute(batch.toArray(new Sql[0])); + } dao().execute(Sqls.create("update sys_unit u left join (select parentId, count(*) as childCount from sys_unit where parentId is not null and id<>parentId group by parentId) children on children.parentId=u.id set u.hasChildren=(children.childCount is not null)")); @@ -100,23 +136,30 @@ public class SysDataUnitPullServiceImpl extends BaseServiceImpl implem private List distinctDmpUnits(List rawDataList) { Map unitMap = new LinkedHashMap<>(); for (JSONObject raw : rawDataList) { - String unitCode = raw.getStr("DWDM"); - if (StrUtil.isBlank(unitCode)) { - throw new BaseException("单位接口存在缺少 DWDM 的记录"); + try { + String unitCode = raw.getStr("DWDM"); + if (StrUtil.isBlank(unitCode)) { + log.warn("单位接口记录缺少 DWDM,跳过当前机构,ROW_ID: {}", raw.get("ROW_ID")); + continue; + } + if (raw.getInt("DWCC") == null || raw.getInt("DWCC") < 1) { + log.warn("单位{}的 DWCC 无效,跳过当前机构,DWCC: {}", unitCode, raw.get("DWCC")); + continue; + } + unitMap.putIfAbsent(unitCode, raw); + } catch (Exception e) { + log.warn("单位接口记录解析失败,跳过当前机构,单位编码: {},原因: {}", raw == null ? null : raw.get("DWDM"), e.getMessage()); } - if (raw.getInt("DWCC") == null || raw.getInt("DWCC") < 1) { - throw new BaseException("单位{}的 DWCC 无效", unitCode); - } - unitMap.putIfAbsent(unitCode, raw); } return new ArrayList<>(unitMap.values()); } /** - * 保存或更新单位。 + * 在内存中整理待新增、更新的单位及关联人员路径变更。 * DWDM 对应系统单位 id/unitcode,DWMC 对应名称,LSDWDM 对应父级单位号,DWCC 对应信息中心原始单位层级。 */ - private void saveOrUpdateUnit(JSONObject raw, Set parentCodes, Sys_unit root) { + private void prepareUnit(JSONObject raw, Set parentCodes, Sys_unit root, + Map unitMap, Map changedUnits, List pathUpdates) { String unitCode = raw.getStr("DWDM"); if (StrUtil.isBlank(unitCode)) { return; @@ -125,35 +168,38 @@ public class SysDataUnitPullServiceImpl extends BaseServiceImpl implem if (root.getId().equals(unitCode)) { throw new BaseException("接口单位{}与本地顶级机构编号冲突,中止同步", unitCode); } - String parentId = getParentId(unitCode, getNormalizedParentCode(raw, root.getId()), root.getId()); - Sys_unit unit = fetch(unitCode); - if (unit == null) { - unit = new Sys_unit(); + String parentId = getParentId(unitCode, getNormalizedParentCode(raw, root.getId()), root.getId(), unitMap); + Sys_unit existing = unitMap.get(unitCode); + Sys_unit unit = existing == null ? new Sys_unit() : BeanUtil.copyProperties(existing, Sys_unit.class); + setUnitValue(unit, raw, parentId, parentCodes); + if (existing == null) { unit.setId(unitCode); unit.setUnitcode(unitCode); - unit.setPath(getUnitPath(parentId)); - setUnitValue(unit, raw, parentId, parentCodes); - dao().fastInsert(unit); + unit.setPath(getUnitPath(parentId, unitMap)); } else { - if (!parentId.equals(unit.getParentId()) || StrUtil.isBlank(unit.getPath())) { - String oldPath = unit.getPath(); - String newPath = getUnitPath(parentId); + if (!parentId.equals(existing.getParentId()) || StrUtil.isBlank(existing.getPath())) { + String oldPath = existing.getPath(); + String newPath = getUnitPath(parentId, unitMap); if (StrUtil.isNotBlank(oldPath)) { if (newPath.startsWith(oldPath)) { throw new BaseException("单位{}不能移动到自身的下级单位", unitCode); } - dao().execute(Sqls.create("update sys_unit set path=concat(@newPath, substring(path, @start)) where path like @prefix") + pathUpdates.add(Sqls.create("update sys_user set unitPath=concat(@newPath, substring(unitPath, @start)) where unitPath like @prefix") .setParam("newPath", newPath).setParam("start", oldPath.length() + 1).setParam("prefix", oldPath + "%")); - dao().execute(Sqls.create("update sys_user set unitPath=concat(@newPath, substring(unitPath, @start)) where unitPath like @prefix") - .setParam("newPath", newPath).setParam("start", oldPath.length() + 1).setParam("prefix", oldPath + "%")); - dao().execute(Sqls.create("update sys_user_source set unitPath=concat(@newPath, substring(unitPath, @start)) where unitPath like @prefix") + pathUpdates.add(Sqls.create("update sys_user_source set unitPath=concat(@newPath, substring(unitPath, @start)) where unitPath like @prefix") .setParam("newPath", newPath).setParam("start", oldPath.length() + 1).setParam("prefix", oldPath + "%")); + for (Sys_unit child : unitMap.values()) { + if (StrUtil.isNotBlank(child.getPath()) && child.getPath().startsWith(oldPath)) { + child.setPath(newPath + child.getPath().substring(oldPath.length())); + changedUnits.put(child.getId(), child); + } + } } unit.setPath(newPath); } - setUnitValue(unit, raw, parentId, parentCodes); - dao().updateIgnoreNull(unit); } + unitMap.put(unitCode, unit); + changedUnits.put(unitCode, unit); } /** @@ -182,9 +228,9 @@ public class SysDataUnitPullServiceImpl extends BaseServiceImpl implem * 计算父级单位号。 * 异常父级仅允许沿用本地已修正的关系,并确认父级链最终到达顶级机构。 */ - private String getParentId(String unitCode, String parentCode, String rootId) { - if (StrUtil.isBlank(parentCode) || unitCode.equals(parentCode) || fetch(parentCode) == null) { - Sys_unit existing = fetch(unitCode); + private String getParentId(String unitCode, String parentCode, String rootId, Map unitMap) { + if (StrUtil.isBlank(parentCode) || unitCode.equals(parentCode) || !unitMap.containsKey(parentCode)) { + Sys_unit existing = unitMap.get(unitCode); parentCode = existing == null ? null : existing.getParentId(); } String ancestorId = parentCode; @@ -194,7 +240,7 @@ public class SysDataUnitPullServiceImpl extends BaseServiceImpl implem if (StrUtil.isBlank(ancestorId) || !visited.add(ancestorId)) { throw new BaseException("单位{}的上级机构无效或存在循环,无法确定归属", unitCode); } - Sys_unit ancestor = fetch(ancestorId); + Sys_unit ancestor = unitMap.get(ancestorId); if (ancestor == null) { throw new BaseException("单位{}的上级机构{}不存在", unitCode, ancestorId); } @@ -207,16 +253,26 @@ public class SysDataUnitPullServiceImpl extends BaseServiceImpl implem * 根据父级 path 生成当前单位 path。 * 父级为空时生成根节点 path,父级存在时在父级 path 下生成子节点 path。 */ - private String getUnitPath(String parentId) { + private String getUnitPath(String parentId, Map unitMap) { String parentPath = ""; if (StrUtil.isNotBlank(parentId)) { - Sys_unit parentUnit = fetch(parentId); + Sys_unit parentUnit = unitMap.get(parentId); if (parentUnit == null || StrUtil.isBlank(parentUnit.getPath())) { throw new BaseException("父机构{}不存在或路径为空", parentId); } parentPath = parentUnit.getPath(); } - return getSubPath("sys_unit", "path", parentPath); + int maxIndex = 0; + for (Sys_unit unit : unitMap.values()) { + String path = unit.getPath(); + if (StrUtil.isNotBlank(path) && path.startsWith(parentPath) && path.length() == parentPath.length() + 4) { + maxIndex = Math.max(maxIndex, Integer.parseInt(path.substring(parentPath.length()))); + } + } + if (maxIndex >= 9999) { + throw new BaseException("父机构{}的子级路径编码已用尽", parentId); + } + return parentPath + StrUtil.padPre(String.valueOf(maxIndex + 1), 4, '0'); } /** diff --git a/src/main/java/com/budwk/app/sys/services/impl/SysDataUserIncrUpdateServiceImpl.java b/src/main/java/com/budwk/app/sys/services/impl/SysDataUserIncrUpdateServiceImpl.java index 3f7b1c4..089fba6 100644 --- a/src/main/java/com/budwk/app/sys/services/impl/SysDataUserIncrUpdateServiceImpl.java +++ b/src/main/java/com/budwk/app/sys/services/impl/SysDataUserIncrUpdateServiceImpl.java @@ -5,7 +5,6 @@ import cn.hutool.core.collection.ListUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import com.budwk.app.base.constant.RoleConstant; -import com.budwk.app.base.exception.BaseException; import com.budwk.app.base.event.role.RoleEventMsg; import com.budwk.app.base.event.role.RoleEventPublisher; import com.budwk.app.base.utils.ConditionGroupUtil; @@ -19,6 +18,7 @@ import com.budwk.app.sys.utils.DataCenterUtil; import com.budwk.app.zhgh.democratic.proposal.models.ProposalConfig; import com.budwk.app.zhgh.staffmanage.member.constant.MemberChangeOrigin; import com.budwk.app.zhgh.staffmanage.member.constant.MemberChangeType; +import lombok.extern.slf4j.Slf4j; import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.dao.Cnd; import org.nutz.dao.Dao; @@ -35,6 +35,7 @@ import java.util.ArrayList; * 增量更新系统用户数据 */ @IocBean +@Slf4j public class SysDataUserIncrUpdateServiceImpl implements SysDataUserUpdateService { @Inject @@ -66,38 +67,59 @@ public class SysDataUserIncrUpdateServiceImpl implements SysDataUserUpdateServic var unitMap = sysUnits.stream().collect(java.util.stream.Collectors.toMap(Sys_unit::getId, v -> v)); List insertUnits = new ArrayList<>(); Sys_unit root = null; - for (Sys_user_source source : userSources) { + int nextUnitPathIndex = 0; + for (var iterator = userSources.iterator(); iterator.hasNext();) { + Sys_user_source source = iterator.next(); if (StrUtil.isBlank(source.getUnitId())) { - throw new BaseException("人员{}缺少所属机构编号", source.getLoginname()); + log.warn("人员{}缺少所属机构编号,跳过当前人员增量更新", source.getLoginname()); + iterator.remove(); + continue; } Sys_unit unit = unitMap.get(source.getUnitId()); if (unit == null) { if (StrUtil.isBlank(source.getUnitName())) { - throw new BaseException("人员{}所属机构{}缺少名称,无法补建", source.getLoginname(), source.getUnitId()); + log.warn("人员{}所属机构{}缺少名称,无法补建,跳过当前人员增量更新", source.getLoginname(), source.getUnitId()); + iterator.remove(); + continue; } if (root == null) { root = DataCenterUtil.findRootUnit(sysUnits); if (StrUtil.isBlank(root.getPath())) { root.setPath(sysUnitService.getSubPath("sys_unit", "path", "")); - dao.updateIgnoreNull(root); } + String nextUnitPath = sysUnitService.getSubPath("sys_unit", "path", root.getPath()); + nextUnitPathIndex = Integer.parseInt(nextUnitPath.substring(root.getPath().length())); } unit = new Sys_unit(); + unit.setId(source.getUnitId()); unit.setUnitcode(source.getUnitId()); unit.setName(source.getUnitName()); unit.setUnitLevel(2); unit.setUnitTypeCode(1); - sysUnitService.save(unit, root.getId()); + unit.setParentId(root.getId()); + unit.setPath(root.getPath() + StrUtil.padPre(String.valueOf(nextUnitPathIndex++), 4, '0')); unitMap.put(unit.getId(), unit); insertUnits.add(unit); } if (StrUtil.isBlank(unit.getPath())) { - throw new BaseException("人员{}所属机构{}的路径为空", source.getLoginname(), unit.getId()); + log.warn("人员{}所属机构{}的路径为空,跳过当前人员增量更新", source.getLoginname(), unit.getId()); + iterator.remove(); + continue; } source.setUnitName(unit.getName()); source.setUnitPath(unit.getPath()); } + if (!insertUnits.isEmpty()) { + dao.fastInsert(insertUnits); + root.setHasChildren(true); + dao.updateIgnoreNull(root); + } + + if (userSources.isEmpty() && insertUnits.isEmpty()) { + return "本次没有新增人员或单位。"; + } + //加入到系统用户表 List sysUsers = BeanUtil.copyToList(userSources, Sys_user.class); for (Sys_user sysUser : sysUsers) { @@ -143,8 +165,12 @@ public class SysDataUserIncrUpdateServiceImpl implements SysDataUserUpdateServic // 6.1 更新提案的校领导角色,发送订阅 ProposalConfig config = dao.fetch(ProposalConfig.class, Cnd.where("delFlag", "=", false).desc("updatedAt")); - for (String unitId : config.getSchoolLeaderUnitIds()) { - RoleEventPublisher.broadcast(new RoleEventMsg(unitId, RoleConstant.PROPOSAL_BRANCH_SCHOOL_LEADER.name(), RoleEventMsg.RENEW_ROLE)); + if (config == null || config.getSchoolLeaderUnitIds() == null || config.getSchoolLeaderUnitIds().isEmpty()) { + log.warn("未配置提案校领导单位,跳过校领导角色刷新,继续完成人员增量更新"); + } else { + for (String unitId : config.getSchoolLeaderUnitIds()) { + RoleEventPublisher.broadcast(new RoleEventMsg(unitId, RoleConstant.PROPOSAL_BRANCH_SCHOOL_LEADER.name(), RoleEventMsg.RENEW_ROLE)); + } } if (sysUsers.isEmpty() && insertUnits.isEmpty()) { diff --git a/src/main/java/com/budwk/app/sys/services/impl/SysDataUserPullServiceImpl.java b/src/main/java/com/budwk/app/sys/services/impl/SysDataUserPullServiceImpl.java index 7f409dd..6ddd641 100644 --- a/src/main/java/com/budwk/app/sys/services/impl/SysDataUserPullServiceImpl.java +++ b/src/main/java/com/budwk/app/sys/services/impl/SysDataUserPullServiceImpl.java @@ -147,21 +147,31 @@ public class SysDataUserPullServiceImpl extends BaseServiceImpl for (String sourceUnitId : sourceUnitIds) { Sys_unit unit = unitMap.get(sourceUnitId); if (unit == null) { - throw new BaseException("人员单位号{}在机构同步后仍不存在,中止本次同步", sourceUnitId); + log.warn("人员单位号{}在机构同步后仍不存在,跳过单位归属处理,保留原单位号入库", sourceUnitId); + continue; } Set visited = new HashSet<>(); while (!rootId.equals(unit.getId()) && !Integer.valueOf(2).equals(unit.getUnitLevel())) { if (!visited.add(unit.getId())) { - throw new BaseException("人员单位{}存在循环父级", sourceUnitId); + log.warn("人员单位{}存在循环父级,跳过单位归属处理,保留原单位号入库", sourceUnitId); + tertiaryUnitIds.remove(sourceUnitId); + unit = null; + break; } if (Integer.valueOf(3).equals(unit.getUnitLevel())) { tertiaryUnitIds.put(sourceUnitId, unit.getId()); } unit = unitMap.get(unit.getParentId()); if (unit == null || rootId.equals(unit.getId())) { - throw new BaseException("人员单位{}缺少有效的二级上级机构", sourceUnitId); + log.warn("人员单位{}缺少有效的二级上级机构,跳过单位归属处理,保留原单位号入库", sourceUnitId); + tertiaryUnitIds.remove(sourceUnitId); + unit = null; + break; } } + if (unit == null) { + continue; + } if (!sourceUnitId.equals(unit.getId())) { tertiaryParentUnitIds.put(sourceUnitId, unit.getId()); } @@ -212,17 +222,19 @@ public class SysDataUserPullServiceImpl extends BaseServiceImpl } String sourceUnitId = raw.getStr("SZDWDM"); if (StrUtil.isBlank(sourceUnitId)) { - throw new BaseException("人员{}缺少所属机构编号 SZDWDM", sysUser.getLoginname()); + log.warn("人员{}缺少所属机构编号 SZDWDM,跳过单位信息补充,保留原数据入库", sysUser.getLoginname()); } String parentUnitId = tertiaryParentUnitIds.get(sourceUnitId); sysUser.setUnitId(StrUtil.blankToDefault(parentUnitId, sourceUnitId)); sysUser.setThreeUnitId(tertiaryUnitIds.get(sourceUnitId)); Sys_unit unit = resolvedUnitMap.get(sysUser.getUnitId()); - if (unit == null || StrUtil.isBlank(unit.getPath())) { - throw new BaseException("人员{}所属机构不存在或路径为空", sysUser.getLoginname()); + if (unit != null) { + sysUser.setUnitName(unit.getName()); + sysUser.setUnitPath(unit.getPath()); + if (StrUtil.isBlank(unit.getPath())) { + log.warn("人员{}所属单位{}路径为空,保留当前单位信息继续入库", sysUser.getLoginname(), unit.getId()); + } } - sysUser.setUnitName(unit.getName()); - sysUser.setUnitPath(unit.getPath()); // 设置拉取时间 sysUser.setPullTime(nowDate); diff --git a/src/main/java/com/budwk/app/sys/utils/DataCenterUtil.java b/src/main/java/com/budwk/app/sys/utils/DataCenterUtil.java index edfbd59..92ba469 100644 --- a/src/main/java/com/budwk/app/sys/utils/DataCenterUtil.java +++ b/src/main/java/com/budwk/app/sys/utils/DataCenterUtil.java @@ -27,8 +27,10 @@ import java.util.Map; public class DataCenterUtil { public static Sys_unit findRootUnit(List units) { + boolean hasZeroUnit = units.stream().anyMatch(unit -> "0".equals(unit.getId())); List roots = units.stream().filter(unit -> StrUtil.isBlank(unit.getParentId()) + || ("0".equals(unit.getParentId()) && !hasZeroUnit) || (unit.getId().equals(unit.getParentId()) && (unit.getUnitLevel() == null || unit.getUnitLevel() <= 1))).toList(); if (roots.size() != 1) { diff --git a/src/main/resources/views/platform/sys/data/user/update.html b/src/main/resources/views/platform/sys/data/user/update.html index c956f33..825483c 100644 --- a/src/main/resources/views/platform/sys/data/user/update.html +++ b/src/main/resources/views/platform/sys/data/user/update.html @@ -48,8 +48,8 @@ layout("/layouts/platform.html"){ - 更新【单位】数据 - 更新【人员】数据 + 更新【单位】数据 + 更新【人员】数据 @@ -147,6 +147,7 @@ layout("/layouts/platform.html"){ } }, updateLoading: false, + unitUpdateLoading: false, unitOptions: [], changeTypeData: [], enableAdvancedConditions: false, @@ -174,12 +175,22 @@ layout("/layouts/platform.html"){ methods: { // 更新单位数据 updateUnits() { + if (this.unitUpdateLoading || this.updateLoading) return this.$confirm("确定要更新单位数据吗?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" }).then(() => { - this.$axios.post("/platform/sys/data/user/update/updateUnits") + if (this.unitUpdateLoading || this.updateLoading) return + this.$set(this, "unitUpdateLoading", true) + const loading = this.$loading({ + fullscreen: true, + lock: true, + text: "正在更新单位数据,请稍候", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.5)" + }) + return this.$axios.post("/platform/sys/data/user/update/updateUnits") .then((resp) => { if (resp.code === 0) { this.$message.success("更新成功") @@ -187,7 +198,11 @@ layout("/layouts/platform.html"){ this.$message.error(resp.msg) } }) - }) + .finally(() => { + loading.close() + this.$set(this, "unitUpdateLoading", false) + }) + }).catch(() => {}) }, // 更新码表数据 @@ -226,6 +241,7 @@ layout("/layouts/platform.html"){ return null }, openUpdate() { + if (this.unitUpdateLoading || this.updateLoading) return this.updateDialog = true this.updateLoading = false this.$nextTick(() => { @@ -250,7 +266,7 @@ layout("/layouts/platform.html"){ }, execUpdate() { // 人员更新未结束时不再打开确认框或提交重复请求。 - if (this.updateLoading) return + if (this.unitUpdateLoading || this.updateLoading) return if (!this.updateFromData.pullTime) { this.$message.warning("请选择数据源时间") return @@ -271,7 +287,7 @@ layout("/layouts/platform.html"){ type: "warning" }) .then(() => { - if (this.updateLoading) return + if (this.unitUpdateLoading || this.updateLoading) return this.$set(this, "updateLoading", true) // 遮罩覆盖人员更新弹窗及页面,明确提示处理中并阻止重复操作。 const loading = this.$loading({