diff --git a/ruoyi-ui/src/api/benyi/theme.js b/ruoyi-ui/src/api/benyi/theme.js index b8a723077..3d67dd619 100644 --- a/ruoyi-ui/src/api/benyi/theme.js +++ b/ruoyi-ui/src/api/benyi/theme.js @@ -9,6 +9,14 @@ export function listTheme(query) { }) } +// 查询流程下拉树结构 +export function treeselect() { + return request({ + url: '/benyi/theme/treeselect', + method: 'get' + }) +} + // 查询主题整合详细 export function getTheme(id) { return request({ diff --git a/ruoyi-ui/src/views/benyi/dayflowstudy/index.vue b/ruoyi-ui/src/views/benyi/dayflowstudy/index.vue index 3ddbf8ba2..c90fbbd65 100644 --- a/ruoyi-ui/src/views/benyi/dayflowstudy/index.vue +++ b/ruoyi-ui/src/views/benyi/dayflowstudy/index.vue @@ -79,9 +79,11 @@ export default { //标题 title: "一日流程", //导言 - content: "寓教育于生活。以游戏为基本活动。没有爱就没有教育。教师素质决定教育品质。一童一世界,尊重差异,关注个性化发展。孩子喜欢的老师就是好老师,孩子喜欢的幼儿园就是好幼儿园。", + content: + "寓教育于生活。以游戏为基本活动。没有爱就没有教育。教师素质决定教育品质。一童一世界,尊重差异,关注个性化发展。孩子喜欢的老师就是好老师,孩子喜欢的幼儿园就是好幼儿园。", //目的 - note: "《幼儿园(3-6)标准化一日流程》(下称《一日流程》)的基本目的,就是要将国家教育纲领性文件中所主张的幼儿园教育理念完全落地。也就是能够让这些理念在幼儿园保教人员指尖上操作和实现。其纲领性文件包括《幼儿园工作规程》(简称《规程》),《幼儿园教育指导纲要》(简称《纲要》),《3-6岁儿童学习与发展指南》(简称《指南》)。这三部纲领中的教育理念不仅仅是确定《一日流程》全部内容的基本依据,而且也自始至终地指导了《一日流程》内容在一线进行实验的整个过程。因此,在其实质上,《一日流程》本身就是将国家三大教育理念——“寓教于生活”、“以游戏为基本活动”以及“以儿童为本”所支撑的教育过程进行分解和物化。", + note: + "《幼儿园(3-6)标准化一日流程》(下称《一日流程》)的基本目的,就是要将国家教育纲领性文件中所主张的幼儿园教育理念完全落地。也就是能够让这些理念在幼儿园保教人员指尖上操作和实现。其纲领性文件包括《幼儿园工作规程》(简称《规程》),《幼儿园教育指导纲要》(简称《纲要》),《3-6岁儿童学习与发展指南》(简称《指南》)。这三部纲领中的教育理念不仅仅是确定《一日流程》全部内容的基本依据,而且也自始至终地指导了《一日流程》内容在一线进行实验的整个过程。因此,在其实质上,《一日流程》本身就是将国家三大教育理念——“寓教于生活”、“以游戏为基本活动”以及“以儿童为本”所支撑的教育过程进行分解和物化。", // 根据一日流程id查到的名下任务列表 dayflowtaskList: [], // 根据任务查询到名下标准 @@ -212,4 +214,14 @@ export default { .pad-left { padding-left: 15px; } + +// 禁止复制 +div { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} </style> \ No newline at end of file diff --git a/ruoyi-ui/src/views/benyi/themestudy/index.vue b/ruoyi-ui/src/views/benyi/themestudy/index.vue new file mode 100644 index 000000000..d36f67c80 --- /dev/null +++ b/ruoyi-ui/src/views/benyi/themestudy/index.vue @@ -0,0 +1,268 @@ +<template> + <div class="app-container"> + <el-row :gutter="20"> + <el-col :span="4" :xs="24"> + <div class="head-container"> + <el-input + v-model="name" + placeholder="请输入名称" + clearable + size="small" + prefix-icon="el-icon-search" + style="margin-bottom: 20px" + /> + </div> + <div class="head-container"> + <el-tree + :data="treeOptions" + :props="defaultProps" + :expand-on-click-node="false" + :filter-node-method="filterNode" + ref="tree" + default-expand-all + @node-click="handleNodeClick" + /> + </div> + </el-col> + <el-col :span="20" :xs="24"> + <el-card class="box-card"> + <div slot="header" class="clearfix"> + <span class="box-card-title">{{title}}</span> + </div> + <div class="text item" v-show="title1"> + <h3 class="box-card-title">{{title1}}</h3> + <div class="pad-left" v-html="note"></div> + </div> + <div class="text item" v-show="title2"> + <h3 class="box-card-title">{{title2}}</h3> + <div class="pad-left" v-html="communicate"></div> + </div> + <div class="text item" v-show="title3"> + <h3 class="box-card-title">{{title3}}</h3> + + <div class="pad-left"> + <div v-for="(item, index) in activityList" :key="index" class="text item"> + <h3 class="box-card-case mr">活动{{item.sort}} - {{item.name}}</h3> + <h3 class="box-card-info">活动形式:{{fieldFormat(item)}}</h3> + <h3 class="box-card-info">重点领域:{{typeFormat(item)}}</h3> + <h3 class="box-card-info">活动目标</h3> + <div class="text item pad-left" v-html="item.target"></div> + <h3 class="box-card-info">活动材料</h3> + <div class="text item pad-left" v-html="item.data"></div> + <h3 class="box-card-info">活动过程</h3> + <div class="text item pad-left" v-html="item.process"></div> + <h3 class="box-card-info">活动建议</h3> + <div class="text item pad-left" v-html="item.proposal"></div> + <h3 class="box-card-info">活动反思</h3> + <div class="text item pad-left" v-html="item.reflect"></div> + <h3 class="box-card-info" v-show="item.appendix">附录</h3> + <div class="text item pad-left" v-html="item.appendix"></div> + </div> + </div> + </div> + </el-card> + </el-col> + </el-row> + </div> +</template> + +<script> +import { treeselect, getTheme } from "@/api/benyi/theme"; +import { listActivity } from "@/api/benyi/activity"; + +export default { + name: "Detail", + data() { + return { + // 主题整合名称 + name: undefined, + // 主题整合id + id: undefined, + //标题 + title: "主题整合", + title1: "概论", + //家园沟通 + title2: "", + //活动方案 + title3: "", + // 主题整合活动表格数据 + activityList: [], + //家园沟通 + communicate: "", + //活动形式 + typeOptions: [], + //活动领域 + fieldOptions: [], + //目的 + note: + "《幼儿园主题整合课程》,是在《幼儿园工作规程》(以下称《规程》)和《幼儿园教育指导纲要》(以下称《纲要》)中的基本教育理念指导之下,以《3-6岁儿童学习与发展指南》(以下称《指南》)精神为基本指导原则,所编写完成的幼儿园3-6岁活动课程。", + // 树状显示类型 + treeOptions: [], + // 树结构 + defaultProps: { + children: "children", + label: "label" + }, + // 查询参数 + queryParams: { + themeid: undefined + } + }; + }, + watch: { + // 根据名称筛选部门树 + name(val) { + this.$refs.tree.filter(val); + } + }, + created() { + this.getTreeselect(); + this.getDicts("sys_theme_type").then(response => { + this.typeOptions = response.data; + }); + this.getDicts("sys_theme_field").then(response => { + this.fieldOptions = response.data; + }); + }, + methods: { + // 活动领域类型--字典状态字典翻译 + fieldFormat(row) { + //alert(row.scope.split(';').length); + var ilength = row.field.split(";").length; + var names = ""; + for (var i = 0; i < ilength; i++) { + names = + names + + this.selectDictLabel(this.fieldOptions, row.field.split(";")[i]) + + ";"; + } + //this.selectDictLabel(this.scopeOptions, row.xnxq); + return names; + }, + // 活动形式类型--字典状态字典翻译 + typeFormat(row) { + //alert(row.scope.split(';').length); + var ilength = row.type.split(";").length; + var names = ""; + for (var i = 0; i < ilength; i++) { + names = + names + + this.selectDictLabel(this.typeOptions, row.type.split(";")[i]) + + ";"; + } + //this.selectDictLabel(this.scopeOptions, row.xnxq); + return names; + }, + /** 查询部门下拉树结构 */ + getTreeselect() { + treeselect().then(response => { + this.treeOptions = response.data; + }); + }, + // 筛选节点 + filterNode(value, data) { + if (!value) return true; + return data.label.indexOf(value) !== -1; + }, + // 节点单击事件 + handleNodeClick(data) { + this.id = data.id; + console.log(data.id); + if (data.id >= 9999) { + } else { + this.title = data.label; + this.getThemeDetails(); + } + // console.log(this.dayflowtaskList[date.id]) + // this.getStandardList(); + }, + getThemeDetails() { + getTheme(this.id).then(response => { + console.log(response); + if (response.code == "200") { + this.title1 = "主题网络"; + this.title2 = "家园沟通"; + this.title3 = "活动方案"; + this.note = response.data.content; + this.communicate = response.data.communicate; + this.queryParams.themeid = response.data.id; + + listActivity(this.queryParams).then(req => { + console.log(req); + if (req.code == "200") { + this.activityList = req.rows; + } + }); + } + }); + } + } +}; +</script> +<style lang="scss" scoped> +.text { + font-size: 14px; +} + +.item { + margin-bottom: 18px; + line-height: 22px; +} + +.clearfix:before, +.clearfix:after { + display: table; + content: ""; +} +.clearfix:after { + clear: both; +} +.box-card-title { + display: flex; + align-items: center; + font-size: 16px; + &::before { + content: ""; + margin-right: 8px; + width: 4px; + height: 16px; + background: #1890ff; + } + &.mr { + margin: 10px 0; + } +} +.box-card-case { + margin: 0; + font-size: 14px; + font-weight: 700; + display: flex; + align-items: center; + &::before { + content: ""; + margin-right: 8px; + width: 4px; + height: 14px; + background: #2c3e50; + } + &.mr { + margin: 10px 0; + } +} +.box-card-info { + font-size: 14px; + font-weight: 700; +} +.pad-left { + padding-left: 15px; +} +// 禁止复制 +div { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +</style> \ No newline at end of file diff --git a/ruoyi/src/main/java/com/ruoyi/framework/web/domain/TreeSelect.java b/ruoyi/src/main/java/com/ruoyi/framework/web/domain/TreeSelect.java index 2970e7be0..676ffa5a4 100644 --- a/ruoyi/src/main/java/com/ruoyi/framework/web/domain/TreeSelect.java +++ b/ruoyi/src/main/java/com/ruoyi/framework/web/domain/TreeSelect.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.stream.Collectors; import com.fasterxml.jackson.annotation.JsonInclude; import com.ruoyi.project.benyi.domain.ByDayFlowDetail; +import com.ruoyi.project.benyi.domain.ByTheme; import com.ruoyi.project.system.domain.SysDept; import com.ruoyi.project.system.domain.SysMenu; @@ -50,6 +51,14 @@ public class TreeSelect implements Serializable this.children = byDayFlowDetail.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); } + //下拉树构造器 + public TreeSelect(ByTheme bytheme) { + + this.id = bytheme.getId(); + this.label = bytheme.getName(); + this.children = bytheme.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); + } + public Long getId() { return id; diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeController.java index 517f02944..931f55df1 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeController.java @@ -44,6 +44,15 @@ public class ByThemeController extends BaseController { return getDataTable(list); } + /** + * 获取部门下拉树列表 + */ + @GetMapping("/treeselect") + public AjaxResult treeselect(ByTheme byTheme) { + List<ByTheme> byThemeDetails = byThemeService.selectByThemeListTree(byTheme); + return AjaxResult.success(byThemeService.buildThemeTreeSelect(byThemeDetails)); + } + /** * 导出主题整合列表 */ diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByTheme.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByTheme.java index e7a8ff433..a2ff1b87e 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByTheme.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByTheme.java @@ -5,6 +5,9 @@ import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.framework.aspectj.lang.annotation.Excel; import com.ruoyi.framework.web.domain.BaseEntity; +import java.util.ArrayList; +import java.util.List; + /** * 主题整合对象 by_theme * @@ -43,6 +46,12 @@ public class ByTheme extends BaseEntity { @Excel(name = "适用班级") private String classid; + /** 树状父类ID */ + private Long parentId; + + /** 树状子类 */ + private List<ByTheme> children = new ArrayList<ByTheme>(); + /** * 序号 */ @@ -97,6 +106,22 @@ public class ByTheme extends BaseEntity { return sort; } + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public List<ByTheme> getChildren() { + return children; + } + + public void setChildren(List<ByTheme> children) { + this.children = children; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) @@ -107,6 +132,7 @@ public class ByTheme extends BaseEntity { .append("classid", getClassid()) .append("sort", getSort()) .append("createTime", getCreateTime()) + .append("parentid", getParentId()) .toString(); } } diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByThemeMapper.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByThemeMapper.java index 7892c75ed..f79ceda14 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByThemeMapper.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByThemeMapper.java @@ -27,6 +27,14 @@ public interface ByThemeMapper { */ public List<ByTheme> selectByThemeList(ByTheme byTheme); + /** + * 查询一日流程树 + * + * @param byTheme 一日流程 + * @return 一日流程树集合 + */ + public List<ByTheme> selectByThemeListTree(ByTheme byTheme); + /** * 新增主题整合 * diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByThemeService.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByThemeService.java index f8509ee27..abe16dc95 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByThemeService.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByThemeService.java @@ -2,6 +2,7 @@ package com.ruoyi.project.benyi.service; import java.util.List; +import com.ruoyi.framework.web.domain.TreeSelect; import com.ruoyi.project.benyi.domain.ByTheme; /** @@ -27,6 +28,30 @@ public interface IByThemeService { */ public List<ByTheme> selectByThemeList(ByTheme byTheme); + /** + * 查询一日流程列表树 + * + * @param byTheme 一日流程 + * @return 一日流程树集合 + */ + public List<ByTheme> selectByThemeListTree(ByTheme byTheme); + + /** + * 构建前端所需要树结构 + * + * @param byThemes 部门列表 + * @return 树结构列表 + */ + public List<ByTheme> buildThemeDetailTree(List<ByTheme> byThemes); + + /** + * 构建前端所需要下拉树结构 + * + * @param byThemes 部门列表 + * @return 下拉树结构列表 + */ + public List<TreeSelect> buildThemeTreeSelect(List<ByTheme> byThemes); + /** * 新增主题整合 * diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByThemeServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByThemeServiceImpl.java index fa5b42613..4851bc498 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByThemeServiceImpl.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByThemeServiceImpl.java @@ -1,8 +1,13 @@ package com.ruoyi.project.benyi.service.impl; +import java.util.ArrayList; +import java.util.Iterator; import java.util.List; +import java.util.stream.Collectors; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.framework.web.domain.TreeSelect; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.project.benyi.mapper.ByThemeMapper; @@ -42,6 +47,100 @@ public class ByThemeServiceImpl implements IByThemeService { return byThemeMapper.selectByThemeList(byTheme); } + /** + * 查询一日流程列表树 + * + * @param byTheme 一日流程 + * @return 一日流程树集合 + */ + @Override + public List<ByTheme> selectByThemeListTree(ByTheme byTheme) { + return byThemeMapper.selectByThemeListTree(byTheme); + } + + /** + * 构建前端所需要树结构 + * + * @param byThemes 部门列表 + * @return 树结构列表 + */ + @Override + public List<ByTheme> buildThemeDetailTree(List<ByTheme> byThemes) { + //System.out.println("start---"); + List<ByTheme> returnList = new ArrayList<ByTheme>(); + List<Long> tempList = new ArrayList<Long>(); + for (ByTheme item : byThemes) { + tempList.add(item.getId()); + } + for (Iterator<ByTheme> iterator = byThemes.iterator(); iterator.hasNext(); ) { + ByTheme item = (ByTheme) iterator.next(); + //System.out.println("test==="+!tempList.contains(byDayFlowDetail.getParentId())); + // 如果是顶级节点, 遍历该父节点的所有子节点 + if (!tempList.contains(item.getParentId())) { + recursionFn(byThemes, item); + returnList.add(item); + } + } + if (returnList.isEmpty()) { + returnList = byThemes; + } + return returnList; + } + + /** + * 构建前端所需要下拉树结构 + * + * @param byThemes 部门列表 + * @return 下拉树结构列表 + */ + @Override + public List<TreeSelect> buildThemeTreeSelect(List<ByTheme> byThemes) { + List<ByTheme> byThemeTrees = buildThemeDetailTree(byThemes); + return byThemeTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); + } + + /** + * 递归列表 + */ + private void recursionFn(List<ByTheme> list, ByTheme t) { + // 得到子节点列表 + List<ByTheme> childList = getChildList(list, t); + t.setChildren(childList); + for (ByTheme tChild : childList) { + if (hasChild(list, tChild)) { + // 判断是否有子节点 + Iterator<ByTheme> it = childList.iterator(); + while (it.hasNext()) { + ByTheme n = (ByTheme) it.next(); + recursionFn(list, n); + } + } + } + } + + /** + * 得到子节点列表 + */ + private List<ByTheme> getChildList(List<ByTheme> list, ByTheme t) { + List<ByTheme> tlist = new ArrayList<ByTheme>(); + Iterator<ByTheme> it = list.iterator(); + while (it.hasNext()) { + ByTheme n = (ByTheme) it.next(); + if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getId().longValue()) { + //System.out.println("parentid="+n.getParentId().longValue()+"---"+t.getId().longValue()); + tlist.add(n); + } + } + return tlist; + } + + /** + * 判断是否有子节点 + */ + private boolean hasChild(List<ByTheme> list, ByTheme t) { + return getChildList(list, t).size() > 0 ? true : false; + } + /** * 新增主题整合 * diff --git a/ruoyi/src/main/resources/mybatis/benyi/ByThemeMapper.xml b/ruoyi/src/main/resources/mybatis/benyi/ByThemeMapper.xml index afad49b88..6328c1b19 100644 --- a/ruoyi/src/main/resources/mybatis/benyi/ByThemeMapper.xml +++ b/ruoyi/src/main/resources/mybatis/benyi/ByThemeMapper.xml @@ -10,6 +10,7 @@ <result property="content" column="content"/> <result property="communicate" column="communicate"/> <result property="classid" column="classid"/> + <result property="parentId" column="parent_id"/> <result property="sort" column="sort"/> <result property="createTime" column="create_time"/> </resultMap> @@ -18,13 +19,31 @@ select id, name, content, communicate, classid, sort, create_time from by_theme </sql> + <sql id="selectByThemeVoTree"> + select dict_value+9999 id, 0 parent_id,dict_label name,dict_sort sort from sys_dict_data where dict_type='sys_yebjlx' and dict_label !='托班(2-3岁)' + union all + select id, classid+9999, name, sort from by_theme + order by sort + </sql> + + <select id="selectByThemeListTree" parameterType="ByTheme" resultMap="ByThemeResult"> + <include refid="selectByThemeVoTree"/> + <where> + <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if> + <if test="content != null and content != ''">and content = #{content}</if> + <if test="communicate != null and communicate != ''">and communicate = #{communicate}</if> + <if test="classid != null and classid != ''">and classid = #{classid}</if> + <if test="sort != null ">and sort = #{sort}</if> + </where> + </select> + <select id="selectByThemeList" parameterType="ByTheme" resultMap="ByThemeResult"> <include refid="selectByThemeVo"/> <where> <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if> <if test="content != null and content != ''">and content = #{content}</if> <if test="communicate != null and communicate != ''">and communicate = #{communicate}</if> - <if test="classid != null and classid != ''">and classid = #{classid}</if> + <if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if> <if test="sort != null ">and sort = #{sort}</if> </where> </select>