视频分类修改
This commit is contained in:
parent
ffe1c18202
commit
6a7c6a72ac
@ -3,14 +3,7 @@ package com.stdiet.web.controller.custom;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.stdiet.common.annotation.Log;
|
import com.stdiet.common.annotation.Log;
|
||||||
import com.stdiet.common.core.controller.BaseController;
|
import com.stdiet.common.core.controller.BaseController;
|
||||||
import com.stdiet.common.core.domain.AjaxResult;
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
@ -40,7 +33,8 @@ public class SysVideoClassifyController extends BaseController
|
|||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(SysVideoClassify sysVideoClassify)
|
public TableDataInfo list(SysVideoClassify sysVideoClassify)
|
||||||
{
|
{
|
||||||
startPage();
|
//startPage();
|
||||||
|
//sysVideoClassify.setParentId(0L);
|
||||||
List<SysVideoClassify> list = sysVideoClassifyService.selectSysVideoClassifyList(sysVideoClassify);
|
List<SysVideoClassify> list = sysVideoClassifyService.selectSysVideoClassifyList(sysVideoClassify);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
@ -105,9 +99,9 @@ public class SysVideoClassifyController extends BaseController
|
|||||||
* 查询视频分类列表
|
* 查询视频分类列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getAllClassify")
|
@GetMapping("/getAllClassify")
|
||||||
public AjaxResult getAllClassify()
|
public AjaxResult getAllClassify(SysVideoClassify sysVideoClassify)
|
||||||
{
|
{
|
||||||
List<SysVideoClassify> list = sysVideoClassifyService.getAllClassify();
|
List<SysVideoClassify> list = sysVideoClassifyService.getAllClassify(sysVideoClassify);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package com.stdiet.web.controller.custom;
|
||||||
|
|
||||||
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
|
import com.stdiet.custom.domain.SysVideoClassify;
|
||||||
|
import com.stdiet.custom.dto.response.VideoClassifyResponse;
|
||||||
|
import com.stdiet.custom.service.ISysVideoClassifyService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/web/video")
|
||||||
|
public class VideoWebInterfaceController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysVideoClassifyService sysVideoClassifyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询视频分类目录列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/getAllClassify")
|
||||||
|
public AjaxResult getClassifyAndVideo(SysVideoClassify sysVideoClassify)
|
||||||
|
{
|
||||||
|
List<SysVideoClassify> list = sysVideoClassifyService.getAllClassifyAndVideo(0L);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
}
|
@ -714,7 +714,9 @@ public class WechatAppletController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/getVideoClassify")
|
@GetMapping("/getVideoClassify")
|
||||||
public AjaxResult getVideoClassify(@RequestParam("openid")String openid) {
|
public AjaxResult getVideoClassify(@RequestParam("openid")String openid) {
|
||||||
List<SysVideoClassify> list = sysVideoClassifyService.selectSysVideoClassifyList(new SysVideoClassify());
|
SysVideoClassify param = new SysVideoClassify();
|
||||||
|
param.setParentId(0L);
|
||||||
|
List<SysVideoClassify> list = sysVideoClassifyService.getAllClassify(param);
|
||||||
List<List<Map<String,Object>>> result = new ArrayList<>();
|
List<List<Map<String,Object>>> result = new ArrayList<>();
|
||||||
int groupCount = 3;
|
int groupCount = 3;
|
||||||
SysVideoClassify all = new SysVideoClassify();
|
SysVideoClassify all = new SysVideoClassify();
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
package com.stdiet.custom.domain;
|
package com.stdiet.custom.domain;
|
||||||
|
|
||||||
|
import com.stdiet.custom.dto.response.VideoClassifyTwoResponse;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import com.stdiet.common.annotation.Excel;
|
import com.stdiet.common.annotation.Excel;
|
||||||
import com.stdiet.common.core.domain.BaseEntity;
|
import com.stdiet.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 视频分类对象 sys_video_classify
|
* 视频分类对象 sys_video_classify
|
||||||
*
|
*
|
||||||
@ -24,10 +26,20 @@ public class SysVideoClassify extends BaseEntity
|
|||||||
@Excel(name = "分类名称")
|
@Excel(name = "分类名称")
|
||||||
private String cateName;
|
private String cateName;
|
||||||
|
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
private Integer orderNum;
|
||||||
|
|
||||||
/** 类型标识,0全部可看 1客户可看 2额外付费观看 */
|
/** 类型标识,0全部可看 1客户可看 2额外付费观看 */
|
||||||
@Excel(name = "类型标识,0全部可看 1客户可看 2额外付费观看")
|
@Excel(name = "类型标识,0全部可看 1客户可看 2额外付费观看")
|
||||||
private Integer payFlag;
|
private Integer payFlag;
|
||||||
|
|
||||||
/** 删除标识 0未删除 1已删除 */
|
/** 删除标识 0未删除 1已删除 */
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
|
//子分类
|
||||||
|
private List<SysVideoClassify> childrenClassify;
|
||||||
|
|
||||||
|
//子视频
|
||||||
|
private List<Map<String, Object>> childrenVideo;
|
||||||
}
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.stdiet.custom.dto.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class VideoClassifyResponse implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
//目录分类ID
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
//目录分类名称
|
||||||
|
private String cateName;
|
||||||
|
|
||||||
|
//子分类
|
||||||
|
private List<VideoClassifyTwoResponse> childrenClassify;
|
||||||
|
|
||||||
|
//子视频
|
||||||
|
private List<Map<String, Object>> childrenVideo;
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCateName() {
|
||||||
|
return cateName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCateName(String cateName) {
|
||||||
|
this.cateName = cateName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<VideoClassifyTwoResponse> getChildrenClassify() {
|
||||||
|
return childrenClassify;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildrenClassify(List<VideoClassifyTwoResponse> childrenClassify) {
|
||||||
|
this.childrenClassify = childrenClassify;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Map<String, Object>> getChildrenVideo() {
|
||||||
|
return childrenVideo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildrenVideo(List<Map<String, Object>> childrenVideo) {
|
||||||
|
this.childrenVideo = childrenVideo;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
package com.stdiet.custom.dto.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class VideoClassifyThreeResponse implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
//目录分类ID
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
//目录分类名称
|
||||||
|
private String cateName;
|
||||||
|
|
||||||
|
//子视频
|
||||||
|
private List<Map<String, Object>> childrenVideo;
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCateName() {
|
||||||
|
return cateName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCateName(String cateName) {
|
||||||
|
this.cateName = cateName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Map<String, Object>> getChildrenVideo() {
|
||||||
|
return childrenVideo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildrenVideo(List<Map<String, Object>> childrenVideo) {
|
||||||
|
this.childrenVideo = childrenVideo;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package com.stdiet.custom.dto.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class VideoClassifyTwoResponse implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
//目录分类ID
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
//目录分类名称
|
||||||
|
private String cateName;
|
||||||
|
|
||||||
|
//子分类
|
||||||
|
private List<VideoClassifyThreeResponse> childrenClassify;
|
||||||
|
|
||||||
|
//子视频
|
||||||
|
private List<Map<String, Object>> childrenVideo;
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCateName() {
|
||||||
|
return cateName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCateName(String cateName) {
|
||||||
|
this.cateName = cateName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<VideoClassifyThreeResponse> getChildrenClassify() {
|
||||||
|
return childrenClassify;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildrenClassify(List<VideoClassifyThreeResponse> childrenClassify) {
|
||||||
|
this.childrenClassify = childrenClassify;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Map<String, Object>> getChildrenVideo() {
|
||||||
|
return childrenVideo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildrenVideo(List<Map<String, Object>> childrenVideo) {
|
||||||
|
this.childrenVideo = childrenVideo;
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,7 @@ package com.stdiet.custom.mapper;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.stdiet.custom.domain.SysVideoClassify;
|
import com.stdiet.custom.domain.SysVideoClassify;
|
||||||
|
import com.stdiet.custom.dto.response.VideoClassifyResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 视频分类Mapper接口
|
* 视频分类Mapper接口
|
||||||
@ -63,5 +64,12 @@ public interface SysVideoClassifyMapper
|
|||||||
* 获取所有类别
|
* 获取所有类别
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<SysVideoClassify> getAllClassify();
|
public List<SysVideoClassify> getAllClassify(SysVideoClassify sysVideoClassify);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据父级ID获取下面子分类以及视频
|
||||||
|
* @param parentId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<SysVideoClassify> getOneAllClassifyAndVideo(Long parentId);
|
||||||
}
|
}
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.stdiet.custom.domain.SysNutritionalVideo;
|
import com.stdiet.custom.domain.SysNutritionalVideo;
|
||||||
|
import com.stdiet.custom.domain.SysVideoClassify;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2,6 +2,7 @@ package com.stdiet.custom.service;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.stdiet.custom.domain.SysVideoClassify;
|
import com.stdiet.custom.domain.SysVideoClassify;
|
||||||
|
import com.stdiet.custom.dto.response.VideoClassifyResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 视频分类Service接口
|
* 视频分类Service接口
|
||||||
@ -63,5 +64,12 @@ public interface ISysVideoClassifyService
|
|||||||
* 获取所有类别
|
* 获取所有类别
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<SysVideoClassify> getAllClassify();
|
public List<SysVideoClassify> getAllClassify(SysVideoClassify sysVideoClassify);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按分类层级分类,返回视频目录列表
|
||||||
|
*
|
||||||
|
* @return 视频分类集合
|
||||||
|
*/
|
||||||
|
public List<SysVideoClassify> getAllClassifyAndVideo(Long parentId);
|
||||||
}
|
}
|
@ -378,7 +378,7 @@ public class SysOrderServiceImpl implements ISysOrderService {
|
|||||||
LocalDate newStartTime = null;
|
LocalDate newStartTime = null;
|
||||||
//判断是否提成单,拆分单中的副单,体验单,定金单
|
//判断是否提成单,拆分单中的副单,体验单,定金单
|
||||||
if(sysOrder.getStartTime() == null || sysOrder.getAfterSaleCommissOrder().intValue() == 1 || sysOrder.getMainOrderId().intValue() != 0 ||
|
if(sysOrder.getStartTime() == null || sysOrder.getAfterSaleCommissOrder().intValue() == 1 || sysOrder.getMainOrderId().intValue() != 0 ||
|
||||||
"2".equals(sysOrder.getOrderType()) || "1".equals(sysOrder.getOrderMoneyType())){
|
"2".equals(sysOrder.getOrderType()) || !isNeedByOrderMoneyType(sysOrder)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//判断前一个订单的结束时间是否大于第二个订单的
|
//判断前一个订单的结束时间是否大于第二个订单的
|
||||||
@ -404,6 +404,21 @@ public class SysOrderServiceImpl implements ISysOrderService {
|
|||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//定金单或尾款单是否需要生成食谱计划,2021-01-12修改为6月11日之后成交的订单只生成定金单计划
|
||||||
|
private boolean isNeedByOrderMoneyType(SysOrder sysOrder){
|
||||||
|
if("0".equals(sysOrder.getOrderMoneyType())){
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
//成交时间
|
||||||
|
LocalDate orderDate = DateUtils.dateToLocalDate(sysOrder.getOrderTime());
|
||||||
|
if(ChronoUnit.DAYS.between(SysRecipesPlanServiceImpl.newVersionPlanStartDate, orderDate) >= 0){
|
||||||
|
return "1".equals(sysOrder.getOrderMoneyType());
|
||||||
|
}else{
|
||||||
|
return "2".equals(sysOrder.getOrderMoneyType());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 给对象SysOrder对象设置服务到期时间
|
* 给对象SysOrder对象设置服务到期时间
|
||||||
*
|
*
|
||||||
|
@ -44,6 +44,9 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SysRecipesMapper sysRecipesMapper;
|
private SysRecipesMapper sysRecipesMapper;
|
||||||
|
|
||||||
|
//2021-06-11之后(大于等于)成交的订单,只生成定金单食谱计划,不生成尾款食谱计划,之前成交的订单还是保持之前逻辑
|
||||||
|
public static final LocalDate newVersionPlanStartDate = DateUtils.stringToLocalDate("2021-06-11", "yyyy-MM-dd");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询食谱计划
|
* 查询食谱计划
|
||||||
*
|
*
|
||||||
@ -172,7 +175,7 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
//判断是否提成单,拆分单中的副单,体验单,定金单
|
//判断是否提成单,拆分单中的副单,体验单,定金单
|
||||||
if (sysOrder.getAfterSaleCommissOrder().intValue() == 1 || sysOrder.getMainOrderId().intValue() != 0 ||
|
if (sysOrder.getAfterSaleCommissOrder().intValue() == 1 || sysOrder.getMainOrderId().intValue() != 0 ||
|
||||||
// "2".equals(sysOrder.getOrderType()) || // 体验单也需要生成计划 2021.05.29
|
// "2".equals(sysOrder.getOrderType()) || // 体验单也需要生成计划 2021.05.29
|
||||||
"1".equals(sysOrder.getOrderMoneyType()) || sysOrder.getCounted() == 1) {
|
!isNeedByOrderMoneyType(sysOrder) || sysOrder.getCounted() == 1) {
|
||||||
System.out.println("---------------------" + sysOrder.getOrderId() + "不生成食谱------------------------");
|
System.out.println("---------------------" + sysOrder.getOrderId() + "不生成食谱------------------------");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -208,6 +211,21 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//定金单或尾款单是否需要生成食谱计划,2021-01-12修改为6月11日之后成交的订单只生成定金单计划
|
||||||
|
private boolean isNeedByOrderMoneyType(SysOrder sysOrder){
|
||||||
|
if("0".equals(sysOrder.getOrderMoneyType())){
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
//成交时间
|
||||||
|
LocalDate orderDate = DateUtils.dateToLocalDate(sysOrder.getOrderTime());
|
||||||
|
if(ChronoUnit.DAYS.between(newVersionPlanStartDate, orderDate) >= 0){
|
||||||
|
return "1".equals(sysOrder.getOrderMoneyType());
|
||||||
|
}else{
|
||||||
|
return "2".equals(sysOrder.getOrderMoneyType());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询食谱计划中对应食谱存在天数缺失的食谱计划,食谱计划发生变化时,可能会导致sys_customer_daily_menu表中天数缺失,需要查询出来进行补充
|
* 查询食谱计划中对应食谱存在天数缺失的食谱计划,食谱计划发生变化时,可能会导致sys_customer_daily_menu表中天数缺失,需要查询出来进行补充
|
||||||
* @param cusId 客户ID
|
* @param cusId 客户ID
|
||||||
|
@ -2,6 +2,8 @@ package com.stdiet.custom.service.impl;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.stdiet.common.utils.DateUtils;
|
import com.stdiet.common.utils.DateUtils;
|
||||||
|
import com.stdiet.custom.dto.response.VideoClassifyResponse;
|
||||||
|
import com.stdiet.custom.mapper.SysNutritionalVideoMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.stdiet.custom.mapper.SysVideoClassifyMapper;
|
import com.stdiet.custom.mapper.SysVideoClassifyMapper;
|
||||||
@ -20,6 +22,9 @@ public class SysVideoClassifyServiceImpl implements ISysVideoClassifyService
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SysVideoClassifyMapper sysVideoClassifyMapper;
|
private SysVideoClassifyMapper sysVideoClassifyMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysNutritionalVideoMapper sysNutritionalVideoMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询视频分类
|
* 查询视频分类
|
||||||
*
|
*
|
||||||
@ -94,12 +99,28 @@ public class SysVideoClassifyServiceImpl implements ISysVideoClassifyService
|
|||||||
return sysVideoClassifyMapper.deleteSysVideoClassifyById(id);
|
return sysVideoClassifyMapper.deleteSysVideoClassifyById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean delChildrenClassify(Long id){
|
||||||
|
//判断分类下是否存在视频,存在视频不能删除
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有类别
|
* 获取所有类别
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysVideoClassify> getAllClassify(){
|
public List<SysVideoClassify> getAllClassify(SysVideoClassify sysVideoClassify){
|
||||||
return sysVideoClassifyMapper.getAllClassify();
|
return sysVideoClassifyMapper.getAllClassify(sysVideoClassify);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按分类层级分类,返回视频目录列表
|
||||||
|
*
|
||||||
|
* @param sysVideoClassify 视频分类
|
||||||
|
* @return 视频分类集合
|
||||||
|
*/
|
||||||
|
public List<SysVideoClassify> getAllClassifyAndVideo(Long parentId){
|
||||||
|
return sysVideoClassifyMapper.getOneAllClassifyAndVideo(parentId);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -7,6 +7,8 @@
|
|||||||
<resultMap type="SysVideoClassify" id="SysVideoClassifyResult">
|
<resultMap type="SysVideoClassify" id="SysVideoClassifyResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="cateName" column="cate_name" />
|
<result property="cateName" column="cate_name" />
|
||||||
|
<result property="parentId" column="parent_id" />
|
||||||
|
<result property="orderNum" column="order_num" />
|
||||||
<result property="payFlag" column="pay_flag" />
|
<result property="payFlag" column="pay_flag" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
@ -16,12 +18,16 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectSysVideoClassifyVo">
|
<sql id="selectSysVideoClassifyVo">
|
||||||
select id, cate_name, pay_flag, create_time, create_by, update_time, update_by, del_flag from sys_video_classify
|
select id, cate_name, parent_id, order_num, pay_flag, create_time, create_by, update_time, update_by, del_flag from sys_video_classify
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSysVideoClassifyList" parameterType="SysVideoClassify" resultMap="SysVideoClassifyResult">
|
<select id="selectSysVideoClassifyList" parameterType="SysVideoClassify" resultMap="SysVideoClassifyResult">
|
||||||
<include refid="selectSysVideoClassifyVo"/>
|
select id, cate_name, parent_id, order_num, pay_flag, create_time from sys_video_classify
|
||||||
where del_flag = 0
|
where del_flag = 0
|
||||||
|
<if test="parentId != null">
|
||||||
|
and parent_id = #{parentId}
|
||||||
|
</if>
|
||||||
|
order by order_num asc,id asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectSysVideoClassifyById" parameterType="Long" resultMap="SysVideoClassifyResult">
|
<select id="selectSysVideoClassifyById" parameterType="Long" resultMap="SysVideoClassifyResult">
|
||||||
@ -34,6 +40,8 @@
|
|||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">id,</if>
|
<if test="id != null">id,</if>
|
||||||
<if test="cateName != null">cate_name,</if>
|
<if test="cateName != null">cate_name,</if>
|
||||||
|
<if test="parentId != null">parent_id,</if>
|
||||||
|
<if test="orderNum != null">order_num,</if>
|
||||||
<if test="payFlag != null">pay_flag,</if>
|
<if test="payFlag != null">pay_flag,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
@ -44,6 +52,8 @@
|
|||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">#{id},</if>
|
<if test="id != null">#{id},</if>
|
||||||
<if test="cateName != null">#{cateName},</if>
|
<if test="cateName != null">#{cateName},</if>
|
||||||
|
<if test="parentId != null">#{parentId},</if>
|
||||||
|
<if test="orderNum != null">#{orderNum},</if>
|
||||||
<if test="payFlag != null">#{payFlag},</if>
|
<if test="payFlag != null">#{payFlag},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
@ -57,6 +67,8 @@
|
|||||||
update sys_video_classify
|
update sys_video_classify
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="cateName != null">cate_name = #{cateName},</if>
|
<if test="cateName != null">cate_name = #{cateName},</if>
|
||||||
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||||
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||||
<if test="payFlag != null">pay_flag = #{payFlag},</if>
|
<if test="payFlag != null">pay_flag = #{payFlag},</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
@ -78,8 +90,62 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="getAllClassify" resultMap="SysVideoClassifyResult">
|
<select id="getAllClassify" resultMap="SysVideoClassifyResult" parameterType="SysVideoClassify">
|
||||||
select id,cate_name from sys_video_classify where del_flag = 0
|
select id, cate_name, parent_id, order_num, pay_flag, create_time, create_by, update_time, update_by, del_flag from sys_video_classify
|
||||||
|
where del_flag = 0
|
||||||
|
<if test="parentId != null">
|
||||||
|
and parent_id = #{parentId}
|
||||||
|
</if>
|
||||||
|
order by order_num asc,id asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<resultMap type="SysVideoClassify" id="VideoClassifyOneResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="cateName" column="cate_name" />
|
||||||
|
<!-- 查询子分类 -->
|
||||||
|
<!--<association property="childrenClassify" column="id" select="getTwoAllClassifyAndVideo"/>-->
|
||||||
|
<!-- 查询子视频 -->
|
||||||
|
<!--<association property="childrenVideo" column="id" select="getAllVideoByClassify"/>-->
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="SysVideoClassify" id="VideoClassifyTwoResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="cateName" column="cate_name" />
|
||||||
|
<!-- 查询子分类 -->
|
||||||
|
<!--<association property="childrenClassify" column="id" select="getThreeAllClassifyAndVideo"/>-->
|
||||||
|
<!-- 查询子视频 -->
|
||||||
|
<!--<association property="childrenVideo" column="id" select="getAllVideoByClassify"/>-->
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="com.stdiet.custom.dto.response.VideoClassifyThreeResponse" id="VideoClassifyThreeResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="cateName" column="cate_name" />
|
||||||
|
<!-- 查询子视频 -->
|
||||||
|
<association property="childrenVideo" column="id" select="getAllVideoByClassify"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="getOneAllClassifyAndVideo" resultMap="VideoClassifyOneResult" parameterType="SysVideoClassify">
|
||||||
|
select id, cate_name from sys_video_classify
|
||||||
|
left join sys_video_classify
|
||||||
|
where del_flag = 0 and parent_id = #{parentId}
|
||||||
|
order by order_num asc,id asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getTwoAllClassifyAndVideo" resultMap="VideoClassifyTwoResult" parameterType="Long">
|
||||||
|
select id, cate_name from sys_video_classify
|
||||||
|
where del_flag = 0 and parent_id = #{id}
|
||||||
|
order by order_num asc,id asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getThreeAllClassifyAndVideo" resultMap="VideoClassifyThreeResult" parameterType="Long">
|
||||||
|
select id, cate_name from sys_video_classify
|
||||||
|
where del_flag = 0 and parent_id = #{id}
|
||||||
|
order by order_num asc,id asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getAllVideoByClassify" resultType="Map" parameterType="Long">
|
||||||
|
select snv.video_id as videoId, snv.cover_url as coverUrl, snv.title, snv.description
|
||||||
|
from sys_nutritional_video snv where cate_id = #{id} and del_flag = 0 and show_flag = 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -106,7 +106,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
"/wap/**",
|
"/wap/**",
|
||||||
"/investigate/**",
|
"/investigate/**",
|
||||||
"/common/customerUploadFile",
|
"/common/customerUploadFile",
|
||||||
"/custom/nutritionQuestion/regenerateNutritionQuestionIndex"
|
"/custom/nutritionQuestion/regenerateNutritionQuestionIndex",
|
||||||
|
"/web/**"
|
||||||
).anonymous()
|
).anonymous()
|
||||||
.antMatchers(
|
.antMatchers(
|
||||||
HttpMethod.GET,
|
HttpMethod.GET,
|
||||||
|
@ -26,15 +26,14 @@
|
|||||||
<UploadFile ref="uploadFile" :prefix="'videoCover'" @callbackMethod="handleCoverUrl" :tips="'视频未传封面图片时,会主动截取封面,但会存在延迟,请勿直接发布到小程序'"></UploadFile>
|
<UploadFile ref="uploadFile" :prefix="'videoCover'" @callbackMethod="handleCoverUrl" :tips="'视频未传封面图片时,会主动截取封面,但会存在延迟,请勿直接发布到小程序'"></UploadFile>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div style="display:flex">
|
<div style="display:flex">
|
||||||
<el-form-item label="视频类别" prop="cateId">
|
<el-form-item label="视频类别" prop="cateId" style="width:300px">
|
||||||
<el-select v-model="videoFrom.cateId" clearable filterable placeholder="请选择类别">
|
<treeselect
|
||||||
<el-option
|
v-model="videoFrom.cateId"
|
||||||
v-for="classify in classifyList"
|
:options="classifyList"
|
||||||
:key="classify.id"
|
:normalizer="normalizer"
|
||||||
:label="classify.cateName"
|
:show-count="true"
|
||||||
:value="classify.id"
|
placeholder="选择分类"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="视频权限" prop="payLevel" style="margin-left:40px">
|
<el-form-item label="视频权限" prop="payLevel" style="margin-left:40px">
|
||||||
<el-select v-model="videoFrom.payLevel" clearable filterable placeholder="请选择权限">
|
<el-select v-model="videoFrom.payLevel" clearable filterable placeholder="请选择权限">
|
||||||
@ -78,6 +77,9 @@
|
|||||||
import {getUploadVideoAuth,addNutritionalVideo } from "@/api/custom/nutritionalVideo";
|
import {getUploadVideoAuth,addNutritionalVideo } from "@/api/custom/nutritionalVideo";
|
||||||
import {getAllClassify } from "@/api/custom/videoClassify";
|
import {getAllClassify } from "@/api/custom/videoClassify";
|
||||||
import UploadFile from "@/components/FileUpload/UploadFile";
|
import UploadFile from "@/components/FileUpload/UploadFile";
|
||||||
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
import IconSelect from "@/components/IconSelect";
|
||||||
export default {
|
export default {
|
||||||
name: "UploadVideo",
|
name: "UploadVideo",
|
||||||
data () {
|
data () {
|
||||||
@ -140,7 +142,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
UploadFile
|
UploadFile,Treeselect, IconSelect
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showDialog(classifyList, callback){
|
showDialog(classifyList, callback){
|
||||||
@ -150,7 +152,8 @@
|
|||||||
this.resetVideoFrom();
|
this.resetVideoFrom();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.callback = callback;
|
this.callback = callback;
|
||||||
this.classifyList = classifyList;
|
this.dealClassify(classifyList);
|
||||||
|
//this.classifyList = classifyList;
|
||||||
},
|
},
|
||||||
handleCoverUrl(url){
|
handleCoverUrl(url){
|
||||||
this.videoFrom.coverUrl = url;
|
this.videoFrom.coverUrl = url;
|
||||||
@ -181,6 +184,23 @@
|
|||||||
},
|
},
|
||||||
submitVideoForm(){
|
submitVideoForm(){
|
||||||
|
|
||||||
|
},
|
||||||
|
/** 转换菜单数据结构 */
|
||||||
|
normalizer(node) {
|
||||||
|
if (node.children && !node.children.length) {
|
||||||
|
delete node.children;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
id: node.id,
|
||||||
|
label: node.cateName,
|
||||||
|
children: node.children
|
||||||
|
};
|
||||||
|
},
|
||||||
|
dealClassify(data){
|
||||||
|
this.classifyList = [];
|
||||||
|
const classify = { id: 0, cateName: '主分类', children: [] };
|
||||||
|
classify.children = this.handleTree(data, "id");
|
||||||
|
this.classifyList.push(classify);
|
||||||
},
|
},
|
||||||
cancel(){
|
cancel(){
|
||||||
if(this.uploading){
|
if(this.uploading){
|
||||||
@ -211,6 +231,14 @@
|
|||||||
this.authProgress = 0
|
this.authProgress = 0
|
||||||
this.statusText = ""
|
this.statusText = ""
|
||||||
}**/
|
}**/
|
||||||
|
//视频分类不能选择主分类
|
||||||
|
if(this.videoFrom.cateId == 0){
|
||||||
|
this.$message({
|
||||||
|
message: "视频分类不能选择主分类",
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.videoFrom.fileName = this.file.name;
|
this.videoFrom.fileName = this.file.name;
|
||||||
if(this.videoFrom.fileName == null || this.videoFrom.fileName.length == 0 || this.videoFrom.fileName.lastIndexOf(".") == -1){
|
if(this.videoFrom.fileName == null || this.videoFrom.fileName.length == 0 || this.videoFrom.fileName.lastIndexOf(".") == -1){
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -243,7 +243,9 @@
|
|||||||
|
|
||||||
<!-- 视频分类管理 -->
|
<!-- 视频分类管理 -->
|
||||||
<el-dialog title="视频分类列表" :visible.sync="videoClassifyOpen" width="800px" append-to-body @closed="getAllVideoClassify();">
|
<el-dialog title="视频分类列表" :visible.sync="videoClassifyOpen" width="800px" append-to-body @closed="getAllVideoClassify();">
|
||||||
|
<div style="height: 500px; overflow: auto">
|
||||||
<VideoClassify ref="videoClassifyRef"></VideoClassify>
|
<VideoClassify ref="videoClassifyRef"></VideoClassify>
|
||||||
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
v-hasPermi="['custom:videoClassify:add']"
|
v-hasPermi="['custom:videoClassify:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!--<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@ -54,7 +54,7 @@
|
|||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['custom:videoClassify:remove']"
|
v-hasPermi="['custom:videoClassify:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</el-col>
|
</el-col>-->
|
||||||
<!--<el-col :span="1.5">
|
<!--<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
@ -67,11 +67,28 @@
|
|||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="videoClassifyList" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
v-loading="loading"
|
||||||
<el-table-column label="分类名称" align="center" prop="cateName" />
|
:data="videoClassifyList"
|
||||||
|
row-key="id"
|
||||||
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||||
|
>
|
||||||
|
<el-table-column label="分类名称" prop="cateName" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column label="显示排序" prop="orderNum" align="center"/>
|
||||||
|
<el-table-column label="创建时间" prop="createTime" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
icon="el-icon-plus"
|
||||||
|
type="text"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd(scope.row)"
|
||||||
|
v-hasPermi="['custom:videoClassify:add']"
|
||||||
|
>新增</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@ -90,21 +107,34 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<!--<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>-->
|
||||||
|
|
||||||
<!-- 添加或修改视频分类对话框 -->
|
<!-- 添加或修改视频分类对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="上级分类">
|
||||||
|
<treeselect
|
||||||
|
v-model="form.parentId"
|
||||||
|
:options="classifyOptions"
|
||||||
|
:normalizer="normalizer"
|
||||||
|
:show-count="true"
|
||||||
|
placeholder="选择上级分类"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="分类名称" prop="cateName">
|
<el-form-item label="分类名称" prop="cateName">
|
||||||
<el-input v-model.trim="form.cateName" placeholder="请输入分类名称" />
|
<el-input v-model.trim="form.cateName" placeholder="请输入分类名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="显示排序" prop="orderNum">
|
||||||
|
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
@ -114,8 +144,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listVideoClassify, getVideoClassify, delVideoClassify, addVideoClassify, updateVideoClassify, exportVideoClassify } from "@/api/custom/videoClassify";
|
import { listVideoClassify, getVideoClassify, delVideoClassify, addVideoClassify, updateVideoClassify, exportVideoClassify,getAllClassify } from "@/api/custom/videoClassify";
|
||||||
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
import IconSelect from "@/components/IconSelect";
|
||||||
export default {
|
export default {
|
||||||
name: "VideoClassify",
|
name: "VideoClassify",
|
||||||
data() {
|
data() {
|
||||||
@ -152,9 +184,11 @@
|
|||||||
cateName: [
|
cateName: [
|
||||||
{ required: true, message: "分类名称不能为空", trigger: "blur" },
|
{ required: true, message: "分类名称不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
}
|
},
|
||||||
|
classifyOptions:[]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
components: { Treeselect, IconSelect },
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
@ -163,7 +197,7 @@
|
|||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listVideoClassify(this.queryParams).then(response => {
|
listVideoClassify(this.queryParams).then(response => {
|
||||||
this.videoClassifyList = response.rows;
|
this.videoClassifyList = this.handleTree(response.rows, "id");
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
@ -178,6 +212,8 @@
|
|||||||
this.form = {
|
this.form = {
|
||||||
id: null,
|
id: null,
|
||||||
cateName: null,
|
cateName: null,
|
||||||
|
parentId: null,
|
||||||
|
orderNum: 0,
|
||||||
payFlag: null,
|
payFlag: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
createBy: null,
|
createBy: null,
|
||||||
@ -204,8 +240,14 @@
|
|||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
|
this.getTreeselect();
|
||||||
|
if (row != null && row.id) {
|
||||||
|
this.form.parentId = row.id;
|
||||||
|
} else {
|
||||||
|
this.form.parentId = 0;
|
||||||
|
}
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加视频分类";
|
this.title = "添加视频分类";
|
||||||
},
|
},
|
||||||
@ -269,7 +311,27 @@
|
|||||||
}).then(response => {
|
}).then(response => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
}).catch(function() {});
|
}).catch(function() {});
|
||||||
|
},
|
||||||
|
/** 转换菜单数据结构 */
|
||||||
|
normalizer(node) {
|
||||||
|
if (node.children && !node.children.length) {
|
||||||
|
delete node.children;
|
||||||
}
|
}
|
||||||
|
return {
|
||||||
|
id: node.id,
|
||||||
|
label: node.cateName,
|
||||||
|
children: node.children
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/** 查询目录下拉树结构 */
|
||||||
|
getTreeselect() {
|
||||||
|
getAllClassify().then(response => {
|
||||||
|
this.classifyOptions = [];
|
||||||
|
const classify = { id: 0, cateName: '主分类', children: [] };
|
||||||
|
classify.children = this.handleTree(response.data, "id");
|
||||||
|
this.classifyOptions.push(classify);
|
||||||
|
});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user