From cc41bcc9e97a256c90b4b1bfc9227b4d908afa77 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Tue, 20 Jun 2023 17:26:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=B1=BB=E5=9E=8B=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9=206.20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cms/admin/modules/CmsColumnModal.vue | 2 +- .../src/views/taskType/TaskTypeList.vue | 6 +- .../views/taskType/modules/TaskTypeForm.vue | 230 +++++++++--------- .../views/taskType/modules/TaskTypeModal.vue | 174 ++++++++++--- .../controller/TaskTypeController.java | 16 +- .../modules/taskType/entity/TaskType.java | 2 +- .../service/impl/TaskTypeServiceImpl.java | 14 +- 7 files changed, 271 insertions(+), 173 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/cms/admin/modules/CmsColumnModal.vue b/ant-design-vue-jeecg/src/views/cms/admin/modules/CmsColumnModal.vue index d8705ce..aad1041 100644 --- a/ant-design-vue-jeecg/src/views/cms/admin/modules/CmsColumnModal.vue +++ b/ant-design-vue-jeecg/src/views/cms/admin/modules/CmsColumnModal.vue @@ -16,7 +16,7 @@ - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/taskType/modules/TaskTypeModal.vue b/ant-design-vue-jeecg/src/views/taskType/modules/TaskTypeModal.vue index 0f2a79b..e118c1b 100644 --- a/ant-design-vue-jeecg/src/views/taskType/modules/TaskTypeModal.vue +++ b/ant-design-vue-jeecg/src/views/taskType/modules/TaskTypeModal.vue @@ -3,58 +3,158 @@ :title="title" :width="width" :visible="visible" + :confirmLoading="confirmLoading" switchFullscreen @ok="handleOk" - :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @cancel="handleCancel" cancelText="关闭"> - + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/controller/TaskTypeController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/controller/TaskTypeController.java index 39d365a..6207abe 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/controller/TaskTypeController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/controller/TaskTypeController.java @@ -60,14 +60,14 @@ public class TaskTypeController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(taskType, req.getParameterMap()); // 使用 eq 防止模糊查询 - queryWrapper.eq("upper_id", parentId); + queryWrapper.eq("pid", parentId); // queryWrapper.last(" ,sort asc "); Page page = new Page(pageNo, pageSize); IPage pageList = taskTypeService.page(page, queryWrapper); @@ -109,7 +109,7 @@ public class TaskTypeController extends JeecgController queryWrapper = new QueryWrapper<>(); List parentIdList = Arrays.asList(parentIds.split(",")); - queryWrapper.in("upper_id", parentIdList); + queryWrapper.in("pid", parentIdList); List list = taskTypeService.list(queryWrapper); IPage pageList = new Page<>(1, 10, list.size()); pageList.setRecords(list); @@ -191,10 +191,10 @@ public class TaskTypeController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { TaskType cmsColumn = taskTypeService.getById(id); - if (StringUtils.equals(ADMIN_COLUMN_KEY, cmsColumn.getId())) { - throw new JeecgBootException("预留类型不可删除"); - } - int count = taskTypeService.count(new LambdaQueryWrapper().eq(TaskType::getUpperId, cmsColumn.getId())); +// if (StringUtils.equals(ADMIN_COLUMN_KEY, cmsColumn.getId())) { +// throw new JeecgBootException("预留类型不可删除"); +// } + int count = taskTypeService.count(new LambdaQueryWrapper().eq(TaskType::getPid, cmsColumn.getId())); if (count > 0) { throw new JeecgBootException("存在子类型暂不可删除"); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/entity/TaskType.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/entity/TaskType.java index 61a0b8e..3c57a86 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/entity/TaskType.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/entity/TaskType.java @@ -68,7 +68,7 @@ public class TaskType implements Serializable { @Excel(name = "上级类型id", width = 15) @ApiModelProperty(value = "上级类型id") @Dict(dictTable = "task_type", dicText = "type_name",dicCode = "id") - private String upperId; + private String pid; /** * 类型名称 */ diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/service/impl/TaskTypeServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/service/impl/TaskTypeServiceImpl.java index c338096..6e4f90f 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/service/impl/TaskTypeServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/taskType/service/impl/TaskTypeServiceImpl.java @@ -3,9 +3,7 @@ package org.jeecg.modules.taskType.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.jeecg.common.util.oConvertUtils; -import org.jeecg.modules.cms.admin.entity.CmsColumn; import org.jeecg.modules.cms.admin.service.ICmsColumnService; -import org.jeecg.modules.task.entity.Task; import org.jeecg.modules.taskType.entity.TaskType; import org.jeecg.modules.taskType.mapper.TaskTypeMapper; import org.jeecg.modules.taskType.service.ITaskTypeService; @@ -32,7 +30,7 @@ public class TaskTypeServiceImpl extends ServiceImpl i List dataList = baseMapper.selectList(queryWrapper); List mapList = new ArrayList<>(); for (TaskType data : dataList) { - String pidVal = data.getUpperId(); + String pidVal = data.getPid(); //递归查询子节点的根节点 if (pidVal != null && !"0".equals(pidVal)) { TaskType rootVal = this.getTreeRoot(pidVal); @@ -52,11 +50,11 @@ public class TaskTypeServiceImpl extends ServiceImpl i public void addTaskType(TaskType taskType) { //新增时设置hasChild为0 taskType.setHasChild(ICmsColumnService.NOCHILD); - if (oConvertUtils.isEmpty(taskType.getUpperId())) { - taskType.setUpperId(ICmsColumnService.ROOT_PID_VALUE); + if (oConvertUtils.isEmpty(taskType.getPid())) { + taskType.setPid(ICmsColumnService.ROOT_PID_VALUE); } else { //如果当前节点父ID不为空 则设置父节点的hasChildren 为1 - TaskType parent = baseMapper.selectById(taskType.getUpperId()); + TaskType parent = baseMapper.selectById(taskType.getPid()); if (parent != null && !"1".equals(parent.getHasChild())) { parent.setHasChild("1"); baseMapper.updateById(parent); @@ -67,8 +65,8 @@ public class TaskTypeServiceImpl extends ServiceImpl i private TaskType getTreeRoot(String pidVal) { TaskType data = taskTypeMapper.selectById(pidVal); - if (data != null && !"0".equals(data.getUpperId())) { - return this.getTreeRoot(data.getUpperId()); + if (data != null && !"0".equals(data.getPid())) { + return this.getTreeRoot(data.getPid()); } else { return data; }