管理端微信小程序首页轮播图配置项
parent
9cec82dc96
commit
6506f893eb
|
@ -0,0 +1,105 @@
|
||||||
|
package com.zxf.web.controller.wheel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.zxf.system.domain.ZxfmnWheel;
|
||||||
|
import com.zxf.system.service.IZxfmnWheelService;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
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.zxf.common.annotation.Log;
|
||||||
|
import com.zxf.common.core.controller.BaseController;
|
||||||
|
import com.zxf.common.core.domain.AjaxResult;
|
||||||
|
import com.zxf.common.enums.BusinessType;
|
||||||
|
import com.zxf.common.utils.poi.ExcelUtil;
|
||||||
|
import com.zxf.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wheelController
|
||||||
|
*
|
||||||
|
* @author zxf
|
||||||
|
* @date 2023-07-18
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wheel/wheel")
|
||||||
|
public class ZxfmnWheelController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IZxfmnWheelService zxfmnWheelService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询wheel列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('wheel:wheel:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(ZxfmnWheel zxfmnWheel)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<ZxfmnWheel> list = zxfmnWheelService.selectZxfmnWheelList(zxfmnWheel);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出wheel列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('wheel:wheel:export')")
|
||||||
|
@Log(title = "wheel", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, ZxfmnWheel zxfmnWheel)
|
||||||
|
{
|
||||||
|
List<ZxfmnWheel> list = zxfmnWheelService.selectZxfmnWheelList(zxfmnWheel);
|
||||||
|
ExcelUtil<ZxfmnWheel> util = new ExcelUtil<ZxfmnWheel>(ZxfmnWheel.class);
|
||||||
|
util.exportExcel(response, list, "wheel数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取wheel详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('wheel:wheel:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Integer id)
|
||||||
|
{
|
||||||
|
return success(zxfmnWheelService.selectZxfmnWheelById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增wheel
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('wheel:wheel:add')")
|
||||||
|
@Log(title = "wheel", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody ZxfmnWheel zxfmnWheel)
|
||||||
|
{
|
||||||
|
return toAjax(zxfmnWheelService.insertZxfmnWheel(zxfmnWheel));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改wheel
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('wheel:wheel:edit')")
|
||||||
|
@Log(title = "wheel", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody ZxfmnWheel zxfmnWheel)
|
||||||
|
{
|
||||||
|
return toAjax(zxfmnWheelService.updateZxfmnWheel(zxfmnWheel));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除wheel
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('wheel:wheel:remove')")
|
||||||
|
@Log(title = "wheel", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Integer[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(zxfmnWheelService.deleteZxfmnWheelByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,6 +5,8 @@ import com.zxf.common.annotation.Anonymous;
|
||||||
import com.zxf.common.core.domain.AjaxResult;
|
import com.zxf.common.core.domain.AjaxResult;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -17,17 +19,27 @@ import java.util.Map;
|
||||||
public class wxBusinessControllApi {
|
public class wxBusinessControllApi {
|
||||||
private static final Logger log = LoggerFactory.getLogger(wxBusinessControllApi.class);
|
private static final Logger log = LoggerFactory.getLogger(wxBusinessControllApi.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取首页轮播图片地址信息
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Anonymous
|
@Anonymous
|
||||||
@GetMapping("/getimage")
|
@GetMapping("/getimage")
|
||||||
public AjaxResult getimage(@RequestParam Map param) {
|
public AjaxResult getimage(@RequestParam Map param) {
|
||||||
log.info("获取首页轮播图图片地址 到时候返回静态服务器绝对路径");
|
log.info("获取首页轮播图图片地址 到时候返回静态服务器绝对路径");
|
||||||
List a = new ArrayList();
|
List<Map<String,Object>> images=jdbcTemplate.queryForList("select CONCAT('http://127.0.0.1:8080',img_url ) img_url from zxfmn_wheel");
|
||||||
a.add("/images/1.jpg");
|
return AjaxResult.success(images);
|
||||||
a.add("/images/2.jpg");
|
|
||||||
a.add("/images/3.jpg");
|
|
||||||
return AjaxResult.success(a);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,121 @@
|
||||||
|
package com.zxf.system.domain;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.zxf.common.annotation.Excel;
|
||||||
|
import com.zxf.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wheel对象 zxfmn_wheel
|
||||||
|
*
|
||||||
|
* @author zxf
|
||||||
|
* @date 2023-07-18
|
||||||
|
*/
|
||||||
|
public class ZxfmnWheel extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/** 1 展示 2 不展示 */
|
||||||
|
@Excel(name = "1 展示 2 不展示")
|
||||||
|
private String isFlag;
|
||||||
|
|
||||||
|
/** 图片地址 */
|
||||||
|
@Excel(name = "图片地址")
|
||||||
|
private String imgUrl;
|
||||||
|
|
||||||
|
/** 跳转地址 */
|
||||||
|
@Excel(name = "跳转地址")
|
||||||
|
private String skipUrl;
|
||||||
|
|
||||||
|
/** 富文本信息展示 */
|
||||||
|
@Excel(name = "富文本信息展示")
|
||||||
|
private String richText;
|
||||||
|
|
||||||
|
/** 视频地址 */
|
||||||
|
@Excel(name = "视频地址")
|
||||||
|
private String videoText;
|
||||||
|
|
||||||
|
/** 扩展 */
|
||||||
|
@Excel(name = "扩展")
|
||||||
|
private String extend;
|
||||||
|
|
||||||
|
public void setId(Integer id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setIsFlag(String isFlag)
|
||||||
|
{
|
||||||
|
this.isFlag = isFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsFlag()
|
||||||
|
{
|
||||||
|
return isFlag;
|
||||||
|
}
|
||||||
|
public void setImgUrl(String imgUrl)
|
||||||
|
{
|
||||||
|
this.imgUrl = imgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImgUrl()
|
||||||
|
{
|
||||||
|
return imgUrl;
|
||||||
|
}
|
||||||
|
public void setSkipUrl(String skipUrl)
|
||||||
|
{
|
||||||
|
this.skipUrl = skipUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSkipUrl()
|
||||||
|
{
|
||||||
|
return skipUrl;
|
||||||
|
}
|
||||||
|
public void setRichText(String richText)
|
||||||
|
{
|
||||||
|
this.richText = richText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRichText()
|
||||||
|
{
|
||||||
|
return richText;
|
||||||
|
}
|
||||||
|
public void setVideoText(String videoText)
|
||||||
|
{
|
||||||
|
this.videoText = videoText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVideoText()
|
||||||
|
{
|
||||||
|
return videoText;
|
||||||
|
}
|
||||||
|
public void setExtend(String extend)
|
||||||
|
{
|
||||||
|
this.extend = extend;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExtend()
|
||||||
|
{
|
||||||
|
return extend;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("isFlag", getIsFlag())
|
||||||
|
.append("imgUrl", getImgUrl())
|
||||||
|
.append("skipUrl", getSkipUrl())
|
||||||
|
.append("richText", getRichText())
|
||||||
|
.append("videoText", getVideoText())
|
||||||
|
.append("extend", getExtend())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.zxf.system.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.zxf.system.domain.ZxfmnWheel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wheelMapper接口
|
||||||
|
*
|
||||||
|
* @author zxf
|
||||||
|
* @date 2023-07-18
|
||||||
|
*/
|
||||||
|
public interface ZxfmnWheelMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询wheel
|
||||||
|
*
|
||||||
|
* @param id wheel主键
|
||||||
|
* @return wheel
|
||||||
|
*/
|
||||||
|
public ZxfmnWheel selectZxfmnWheelById(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询wheel列表
|
||||||
|
*
|
||||||
|
* @param zxfmnWheel wheel
|
||||||
|
* @return wheel集合
|
||||||
|
*/
|
||||||
|
public List<ZxfmnWheel> selectZxfmnWheelList(ZxfmnWheel zxfmnWheel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增wheel
|
||||||
|
*
|
||||||
|
* @param zxfmnWheel wheel
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertZxfmnWheel(ZxfmnWheel zxfmnWheel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改wheel
|
||||||
|
*
|
||||||
|
* @param zxfmnWheel wheel
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateZxfmnWheel(ZxfmnWheel zxfmnWheel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除wheel
|
||||||
|
*
|
||||||
|
* @param id wheel主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteZxfmnWheelById(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除wheel
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteZxfmnWheelByIds(Integer[] ids);
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.zxf.system.service;
|
||||||
|
|
||||||
|
import com.zxf.system.domain.ZxfmnWheel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wheelService接口
|
||||||
|
*
|
||||||
|
* @author zxf
|
||||||
|
* @date 2023-07-18
|
||||||
|
*/
|
||||||
|
public interface IZxfmnWheelService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询wheel
|
||||||
|
*
|
||||||
|
* @param id wheel主键
|
||||||
|
* @return wheel
|
||||||
|
*/
|
||||||
|
public ZxfmnWheel selectZxfmnWheelById(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询wheel列表
|
||||||
|
*
|
||||||
|
* @param zxfmnWheel wheel
|
||||||
|
* @return wheel集合
|
||||||
|
*/
|
||||||
|
public List<ZxfmnWheel> selectZxfmnWheelList(ZxfmnWheel zxfmnWheel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增wheel
|
||||||
|
*
|
||||||
|
* @param zxfmnWheel wheel
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertZxfmnWheel(ZxfmnWheel zxfmnWheel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改wheel
|
||||||
|
*
|
||||||
|
* @param zxfmnWheel wheel
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateZxfmnWheel(ZxfmnWheel zxfmnWheel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除wheel
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的wheel主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteZxfmnWheelByIds(Integer[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除wheel信息
|
||||||
|
*
|
||||||
|
* @param id wheel主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteZxfmnWheelById(Integer id);
|
||||||
|
}
|
|
@ -0,0 +1,95 @@
|
||||||
|
package com.zxf.system.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.zxf.system.domain.ZxfmnWheel;
|
||||||
|
import com.zxf.system.mapper.ZxfmnWheelMapper;
|
||||||
|
import com.zxf.system.service.IZxfmnWheelService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wheelService业务层处理
|
||||||
|
*
|
||||||
|
* @author zxf
|
||||||
|
* @date 2023-07-18
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ZxfmnWheelServiceImpl implements IZxfmnWheelService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ZxfmnWheelMapper zxfmnWheelMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询wheel
|
||||||
|
*
|
||||||
|
* @param id wheel主键
|
||||||
|
* @return wheel
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ZxfmnWheel selectZxfmnWheelById(Integer id)
|
||||||
|
{
|
||||||
|
return zxfmnWheelMapper.selectZxfmnWheelById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询wheel列表
|
||||||
|
*
|
||||||
|
* @param zxfmnWheel wheel
|
||||||
|
* @return wheel
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ZxfmnWheel> selectZxfmnWheelList(ZxfmnWheel zxfmnWheel)
|
||||||
|
{
|
||||||
|
return zxfmnWheelMapper.selectZxfmnWheelList(zxfmnWheel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增wheel
|
||||||
|
*
|
||||||
|
* @param zxfmnWheel wheel
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertZxfmnWheel(ZxfmnWheel zxfmnWheel)
|
||||||
|
{
|
||||||
|
return zxfmnWheelMapper.insertZxfmnWheel(zxfmnWheel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改wheel
|
||||||
|
*
|
||||||
|
* @param zxfmnWheel wheel
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateZxfmnWheel(ZxfmnWheel zxfmnWheel)
|
||||||
|
{
|
||||||
|
return zxfmnWheelMapper.updateZxfmnWheel(zxfmnWheel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除wheel
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的wheel主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteZxfmnWheelByIds(Integer[] ids)
|
||||||
|
{
|
||||||
|
return zxfmnWheelMapper.deleteZxfmnWheelByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除wheel信息
|
||||||
|
*
|
||||||
|
* @param id wheel主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteZxfmnWheelById(Integer id)
|
||||||
|
{
|
||||||
|
return zxfmnWheelMapper.deleteZxfmnWheelById(id);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,81 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zxf.system.mapper.ZxfmnWheelMapper">
|
||||||
|
|
||||||
|
<resultMap type="ZxfmnWheel" id="ZxfmnWheelResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="isFlag" column="is_flag" />
|
||||||
|
<result property="imgUrl" column="img_url" />
|
||||||
|
<result property="skipUrl" column="skip_url" />
|
||||||
|
<result property="richText" column="rich_text" />
|
||||||
|
<result property="videoText" column="video_text" />
|
||||||
|
<result property="extend" column="extend" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectZxfmnWheelVo">
|
||||||
|
select id, is_flag, img_url, skip_url, rich_text, video_text, extend from zxfmn_wheel
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectZxfmnWheelList" parameterType="ZxfmnWheel" resultMap="ZxfmnWheelResult">
|
||||||
|
<include refid="selectZxfmnWheelVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
|
||||||
|
<if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
|
||||||
|
<if test="skipUrl != null and skipUrl != ''"> and skip_url = #{skipUrl}</if>
|
||||||
|
<if test="richText != null and richText != ''"> and rich_text = #{richText}</if>
|
||||||
|
<if test="videoText != null and videoText != ''"> and video_text = #{videoText}</if>
|
||||||
|
<if test="extend != null and extend != ''"> and extend = #{extend}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectZxfmnWheelById" parameterType="Integer" resultMap="ZxfmnWheelResult">
|
||||||
|
<include refid="selectZxfmnWheelVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertZxfmnWheel" parameterType="ZxfmnWheel" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into zxfmn_wheel
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="isFlag != null">is_flag,</if>
|
||||||
|
<if test="imgUrl != null">img_url,</if>
|
||||||
|
<if test="skipUrl != null">skip_url,</if>
|
||||||
|
<if test="richText != null">rich_text,</if>
|
||||||
|
<if test="videoText != null">video_text,</if>
|
||||||
|
<if test="extend != null">extend,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="isFlag != null">#{isFlag},</if>
|
||||||
|
<if test="imgUrl != null">#{imgUrl},</if>
|
||||||
|
<if test="skipUrl != null">#{skipUrl},</if>
|
||||||
|
<if test="richText != null">#{richText},</if>
|
||||||
|
<if test="videoText != null">#{videoText},</if>
|
||||||
|
<if test="extend != null">#{extend},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateZxfmnWheel" parameterType="ZxfmnWheel">
|
||||||
|
update zxfmn_wheel
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
||||||
|
<if test="imgUrl != null">img_url = #{imgUrl},</if>
|
||||||
|
<if test="skipUrl != null">skip_url = #{skipUrl},</if>
|
||||||
|
<if test="richText != null">rich_text = #{richText},</if>
|
||||||
|
<if test="videoText != null">video_text = #{videoText},</if>
|
||||||
|
<if test="extend != null">extend = #{extend},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteZxfmnWheelById" parameterType="Integer">
|
||||||
|
delete from zxfmn_wheel where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteZxfmnWheelByIds" parameterType="String">
|
||||||
|
delete from zxfmn_wheel where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,44 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询wheel列表
|
||||||
|
export function listWheel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wheel/wheel/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询wheel详细
|
||||||
|
export function getWheel(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wheel/wheel/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增wheel
|
||||||
|
export function addWheel(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wheel/wheel',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改wheel
|
||||||
|
export function updateWheel(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wheel/wheel',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除wheel
|
||||||
|
export function delWheel(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wheel/wheel/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
|
@ -0,0 +1,287 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="跳转地址" prop="skipUrl">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.skipUrl"
|
||||||
|
placeholder="请输入跳转地址"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="扩展" prop="extend">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.extend"
|
||||||
|
placeholder="请输入扩展"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['wheel:wheel:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['wheel:wheel:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['wheel:wheel:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['wheel:wheel:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="wheelList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="是否发布" align="center" prop="isFlag" />
|
||||||
|
<el-table-column label="图片地址" align="center" prop="imgUrl" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<image-preview :src="scope.row.imgUrl" :width="50" :height="50"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="跳转地址" align="center" prop="skipUrl" />
|
||||||
|
<el-table-column label="富文本信息展示" align="center" prop="richText" />
|
||||||
|
<el-table-column label="视频地址" align="center" prop="videoText" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<image-preview :src="scope.row.videoText" :width="50" :height="50"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="扩展" align="center" prop="extend" />
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['wheel:wheel:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['wheel:wheel:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改wheel对话框 -->
|
||||||
|
<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-item label="图片地址" prop="imgUrl">
|
||||||
|
<image-upload v-model="form.imgUrl"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="跳转地址" prop="skipUrl">
|
||||||
|
<el-input v-model="form.skipUrl" placeholder="请输入跳转地址" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="富文本信息展示">
|
||||||
|
<editor v-model="form.richText" :min-height="192"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="视频地址" prop="videoText">
|
||||||
|
<image-upload v-model="form.videoText"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="扩展" prop="extend">
|
||||||
|
<el-input v-model="form.extend" placeholder="请输入扩展" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listWheel, getWheel, delWheel, addWheel, updateWheel } from "@/api/wheel/wheel";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Wheel",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// wheel表格数据
|
||||||
|
wheelList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
isFlag: null,
|
||||||
|
imgUrl: null,
|
||||||
|
skipUrl: null,
|
||||||
|
richText: null,
|
||||||
|
videoText: null,
|
||||||
|
extend: null
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询wheel列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listWheel(this.queryParams).then(response => {
|
||||||
|
this.wheelList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
isFlag: null,
|
||||||
|
imgUrl: null,
|
||||||
|
skipUrl: null,
|
||||||
|
richText: null,
|
||||||
|
videoText: null,
|
||||||
|
extend: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加wheel";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getWheel(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改wheel";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateWheel(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addWheel(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除wheel编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return delWheel(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('wheel/wheel/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `wheel_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in New Issue