diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysNutritionalVideoMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysNutritionalVideoMapper.xml index a468e8714..59d21ec58 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysNutritionalVideoMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysNutritionalVideoMapper.xml @@ -42,7 +42,11 @@ and snv.show_flag = #{showFlag} - and snv.cate_id = #{cateId} + and snv.cate_id in ( + select id from sys_video_classify where del_flag = 0 + and (id = #{cateId} or id in (select s.id from sys_video_classify s where s.parent_id = #{cateId} and s.del_flag = 0) + or id in (select ss.id from sys_video_classify ss where ss.del_flag = 0 and ss.parent_id in (select a.id from sys_video_classify a where a.parent_id = #{cateId} and a.del_flag = 0 ))) + ) and snv.pay_level = #{payLevel} diff --git a/stdiet-ui/src/views/custom/nutritionalVideo/index.vue b/stdiet-ui/src/views/custom/nutritionalVideo/index.vue index ff84e80bf..dea7f8b97 100644 --- a/stdiet-ui/src/views/custom/nutritionalVideo/index.vue +++ b/stdiet-ui/src/views/custom/nutritionalVideo/index.vue @@ -21,14 +21,22 @@ - + + @@ -257,6 +265,9 @@ import UploadFile from "@/components/FileUpload/UploadFile"; import VideoClassify from "../videoClassify"; import AutoHideMessage from "@/components/AutoHideMessage"; + import Treeselect from "@riophae/vue-treeselect"; + import "@riophae/vue-treeselect/dist/vue-treeselect.css"; + import IconSelect from "@/components/IconSelect"; export default { name: "NutritionalVideo", data() { @@ -320,7 +331,7 @@ }); }, components: { - UploadVideo,UploadFile,VideoClassify,AutoHideMessage + UploadVideo,UploadFile,VideoClassify,AutoHideMessage,Treeselect, IconSelect }, methods: { /** 查询营养视频列表 */ @@ -339,7 +350,10 @@ getAllVideoClassify(){ getAllClassify().then(response => { if(response.code == 200){ - this.classifyList = response.data; + this.classifyList = []; + const classify = { id: 0, cateName: '主分类', children: [] }; + classify.children = this.handleTree(response.data, "id"); + this.classifyList.push(classify); } }); }, @@ -413,6 +427,17 @@ } }); }, + /** 转换菜单数据结构 */ + normalizer(node) { + if (node.children && !node.children.length) { + delete node.children; + } + return { + id: node.id, + label: node.cateName, + children: node.children + }; + }, /** 提交按钮 */ submitForm() { this.$refs["form"].validate(valid => { diff --git a/stdiet-ui/src/views/custom/videoClassify/index.vue b/stdiet-ui/src/views/custom/videoClassify/index.vue index ff4e1e6de..1e45c5c1f 100644 --- a/stdiet-ui/src/views/custom/videoClassify/index.vue +++ b/stdiet-ui/src/views/custom/videoClassify/index.vue @@ -353,7 +353,7 @@ }); } }); - console.log(this.threeLevelClassify.length); + //console.log(this.threeLevelClassify.length); this.classifyOptions.push(classify); }); },