diff --git a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/impl/HwPortalConfigTypeServiceImpl.java b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/impl/HwPortalConfigTypeServiceImpl.java index 5b5fde3..bc2f148 100644 --- a/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/impl/HwPortalConfigTypeServiceImpl.java +++ b/ruoyi-modules/hw-portal/src/main/java/com/ruoyi/portal/service/impl/HwPortalConfigTypeServiceImpl.java @@ -1,8 +1,11 @@ package com.ruoyi.portal.service.impl; +import com.ruoyi.common.core.constant.UserConstants; +import com.ruoyi.common.core.exception.ServiceException; import com.ruoyi.common.core.utils.DateUtils; import com.ruoyi.common.core.utils.SpringUtils; import com.ruoyi.common.core.utils.StringUtils; +import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.portal.domain.HwPortalConfigType; import com.ruoyi.portal.domain.vo.TreeSelect; import com.ruoyi.portal.mapper.HwPortalConfigTypeMapper; @@ -61,7 +64,17 @@ public class HwPortalConfigTypeServiceImpl implements IHwPortalConfigTypeService @Override public int insertHwPortalConfigType(HwPortalConfigType hwPortalConfigType) { + if (hwPortalConfigType.getParentId() == null) { + hwPortalConfigType.setParentId(0L); + hwPortalConfigType.setAncestors("0"); + } else { + HwPortalConfigType info = hwPortalConfigTypeMapper.selectHwPortalConfigTypeByConfigTypeId(hwPortalConfigType.getParentId()); + + hwPortalConfigType.setAncestors(info.getAncestors() + "," + hwPortalConfigType.getParentId()); + } + hwPortalConfigType.setCreateTime(DateUtils.getNowDate()); + hwPortalConfigType.setCreateBy(SecurityUtils.getUsername()); return hwPortalConfigTypeMapper.insertHwPortalConfigType(hwPortalConfigType); } diff --git a/ruoyi-ui/src/views/portal/portalConfig/index.vue b/ruoyi-ui/src/views/portal/portalConfig/index.vue index 4bbf274..a83231b 100644 --- a/ruoyi-ui/src/views/portal/portalConfig/index.vue +++ b/ruoyi-ui/src/views/portal/portalConfig/index.vue @@ -84,9 +84,14 @@ - - - + + + + +