4.30推送
parent
92811c515a
commit
fe6a5d3c8b
@ -0,0 +1,84 @@
|
||||
package com.flossom.common.core.domain.entity;
|
||||
|
||||
import com.flossom.common.core.annotation.Excel;
|
||||
import com.flossom.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
|
||||
/**
|
||||
* 日化产品信息对象 wx_daily_care_products
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-04-28
|
||||
*/
|
||||
public class WxDailyCareProducts extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 日化产品名称 */
|
||||
@Excel(name = "日化产品名称")
|
||||
private String productName;
|
||||
|
||||
/** 日化产品图片 */
|
||||
@Excel(name = "日化产品图片")
|
||||
private String productImg;
|
||||
|
||||
/** 介绍文案 */
|
||||
@Excel(name = "介绍文案")
|
||||
private String introduce;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setProductName(String productName)
|
||||
{
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getProductName()
|
||||
{
|
||||
return productName;
|
||||
}
|
||||
public void setProductImg(String productImg)
|
||||
{
|
||||
this.productImg = productImg;
|
||||
}
|
||||
|
||||
public String getProductImg()
|
||||
{
|
||||
return productImg;
|
||||
}
|
||||
public void setIntroduce(String introduce)
|
||||
{
|
||||
this.introduce = introduce;
|
||||
}
|
||||
|
||||
public String getIntroduce()
|
||||
{
|
||||
return introduce;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("productName", getProductName())
|
||||
.append("productImg", getProductImg())
|
||||
.append("introduce", getIntroduce())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.flossom.common.core.domain.vo;
|
||||
|
||||
/**
|
||||
* 仪器数据库操作实体
|
||||
*
|
||||
* @author CGLiang
|
||||
* @version 2.0.0
|
||||
* @date 2024/4/26
|
||||
*/
|
||||
public class WxInstrumentVO {
|
||||
|
||||
/**
|
||||
* 仪器ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 仪器名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxDailyCareProducts;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 日化产品信息Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-04-28
|
||||
*/
|
||||
public interface WxDailyCareProductsMapper
|
||||
{
|
||||
/**
|
||||
* 查询日化产品信息
|
||||
*
|
||||
* @param id 日化产品信息主键
|
||||
* @return 日化产品信息
|
||||
*/
|
||||
public WxDailyCareProducts selectWxDailyCareProductsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询日化产品信息列表
|
||||
*
|
||||
* @param wxDailyCareProducts 日化产品信息
|
||||
* @return 日化产品信息集合
|
||||
*/
|
||||
public List<WxDailyCareProducts> selectWxDailyCareProductsList(WxDailyCareProducts wxDailyCareProducts);
|
||||
|
||||
/**
|
||||
* 新增日化产品信息
|
||||
*
|
||||
* @param wxDailyCareProducts 日化产品信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxDailyCareProducts(WxDailyCareProducts wxDailyCareProducts);
|
||||
|
||||
/**
|
||||
* 修改日化产品信息
|
||||
*
|
||||
* @param wxDailyCareProducts 日化产品信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxDailyCareProducts(WxDailyCareProducts wxDailyCareProducts);
|
||||
|
||||
/**
|
||||
* 删除日化产品信息
|
||||
*
|
||||
* @param id 日化产品信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxDailyCareProductsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除日化产品信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxDailyCareProductsByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.flossom.common.core.response.miniProgram;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 眼雕大师模式定制电流配置响模型
|
||||
* @author CGLiang
|
||||
* @version 2.0.0
|
||||
* @date 2024/4/16
|
||||
*/
|
||||
public class PartitionConfigResponse {
|
||||
|
||||
/**
|
||||
* 眼周需求选择分组编号
|
||||
*/
|
||||
private List<String> feelingType;
|
||||
|
||||
/**
|
||||
* 部位
|
||||
*/
|
||||
private Double pullingSeconds;
|
||||
|
||||
/**
|
||||
* 电流种类
|
||||
*/
|
||||
private Double moisturizeSeconds;
|
||||
|
||||
/**
|
||||
* 电流种类等级分值
|
||||
*/
|
||||
private Double eyeSculptSeconds;
|
||||
|
||||
|
||||
public PartitionConfigResponse() {
|
||||
}
|
||||
|
||||
public PartitionConfigResponse(List<String> feelingType, Double pullingSeconds, Double moisturizeSeconds, Double eyeSculptSeconds) {
|
||||
this.feelingType = feelingType;
|
||||
this.pullingSeconds = pullingSeconds;
|
||||
this.moisturizeSeconds = moisturizeSeconds;
|
||||
this.eyeSculptSeconds = eyeSculptSeconds;
|
||||
}
|
||||
|
||||
public List<String> getFeelingType() {
|
||||
return feelingType;
|
||||
}
|
||||
|
||||
public void setFeelingType(List<String> feelingType) {
|
||||
this.feelingType = feelingType;
|
||||
}
|
||||
|
||||
public Double getPullingSeconds() {
|
||||
return pullingSeconds;
|
||||
}
|
||||
|
||||
public void setPullingSeconds(Double pullingSeconds) {
|
||||
this.pullingSeconds = pullingSeconds;
|
||||
}
|
||||
|
||||
public Double getMoisturizeSeconds() {
|
||||
return moisturizeSeconds;
|
||||
}
|
||||
|
||||
public void setMoisturizeSeconds(Double moisturizeSeconds) {
|
||||
this.moisturizeSeconds = moisturizeSeconds;
|
||||
}
|
||||
|
||||
public Double getEyeSculptSeconds() {
|
||||
return eyeSculptSeconds;
|
||||
}
|
||||
|
||||
public void setEyeSculptSeconds(Double eyeSculptSeconds) {
|
||||
this.eyeSculptSeconds = eyeSculptSeconds;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
<?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.flossom.common.core.mapper.WxDailyCareProductsMapper">
|
||||
|
||||
<resultMap type="com.flossom.common.core.domain.entity.WxDailyCareProducts" id="WxDailyCareProductsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="productImg" column="product_img" />
|
||||
<result property="introduce" column="introduce" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWxDailyCareProductsVo">
|
||||
select id, product_name, product_img, introduce, create_by, create_time, update_by, update_time from wx_daily_care_products
|
||||
</sql>
|
||||
|
||||
<select id="selectWxDailyCareProductsList" parameterType="com.flossom.common.core.domain.entity.WxDailyCareProducts" resultMap="WxDailyCareProductsResult">
|
||||
<include refid="selectWxDailyCareProductsVo"/>
|
||||
<where>
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="productImg != null and productImg != ''"> and product_img = #{productImg}</if>
|
||||
<if test="introduce != null and introduce != ''"> and introduce = #{introduce}</if>
|
||||
</where>
|
||||
order by update_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectWxDailyCareProductsById" parameterType="java.lang.Long" resultMap="WxDailyCareProductsResult">
|
||||
<include refid="selectWxDailyCareProductsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWxDailyCareProducts" parameterType="com.flossom.common.core.domain.entity.WxDailyCareProducts" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into wx_daily_care_products
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="productName != null and productName != ''">product_name,</if>
|
||||
<if test="productImg != null and productImg != ''">product_img,</if>
|
||||
<if test="introduce != null and introduce != ''">introduce,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="productName != null and productName != ''">#{productName},</if>
|
||||
<if test="productImg != null and productImg != ''">#{productImg},</if>
|
||||
<if test="introduce != null and introduce != ''">#{introduce},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWxDailyCareProducts" parameterType="com.flossom.common.core.domain.entity.WxDailyCareProducts">
|
||||
update wx_daily_care_products
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productName != null and productName != ''">product_name = #{productName},</if>
|
||||
<if test="productImg != null and productImg != ''">product_img = #{productImg},</if>
|
||||
<if test="introduce != null and introduce != ''">introduce = #{introduce},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWxDailyCareProductsById" parameterType="java.lang.Long">
|
||||
delete from wx_daily_care_products where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWxDailyCareProductsByIds" parameterType="java.lang.String">
|
||||
delete from wx_daily_care_products where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,106 @@
|
||||
package com.flossom.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxDailyCareProducts;
|
||||
import com.flossom.common.core.utils.poi.ExcelUtil;
|
||||
import com.flossom.common.core.web.controller.BaseController;
|
||||
import com.flossom.common.core.web.domain.AjaxResult;
|
||||
import com.flossom.common.core.web.page.TableDataInfo;
|
||||
import com.flossom.common.log.annotation.Log;
|
||||
import com.flossom.common.log.enums.BusinessType;
|
||||
import com.flossom.common.security.annotation.RequiresPermissions;
|
||||
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.flossom.system.service.IWxDailyCareProductsService;
|
||||
|
||||
/**
|
||||
* 日化产品信息Controller
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-04-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/products")
|
||||
public class WxDailyCareProductsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWxDailyCareProductsService wxDailyCareProductsService;
|
||||
|
||||
/**
|
||||
* 查询日化产品信息列表
|
||||
*/
|
||||
@RequiresPermissions("system:products:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WxDailyCareProducts wxDailyCareProducts)
|
||||
{
|
||||
startPage();
|
||||
List<WxDailyCareProducts> list = wxDailyCareProductsService.selectWxDailyCareProductsList(wxDailyCareProducts);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出日化产品信息列表
|
||||
*/
|
||||
@RequiresPermissions("system:products:export")
|
||||
@Log(title = "日化产品信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WxDailyCareProducts wxDailyCareProducts)
|
||||
{
|
||||
List<WxDailyCareProducts> list = wxDailyCareProductsService.selectWxDailyCareProductsList(wxDailyCareProducts);
|
||||
ExcelUtil<WxDailyCareProducts> util = new ExcelUtil<WxDailyCareProducts>(WxDailyCareProducts.class);
|
||||
util.exportExcel(response, list, "日化产品信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取日化产品信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:products:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(wxDailyCareProductsService.selectWxDailyCareProductsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增日化产品信息
|
||||
*/
|
||||
@RequiresPermissions("system:products:add")
|
||||
@Log(title = "日化产品信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WxDailyCareProducts wxDailyCareProducts)
|
||||
{
|
||||
return toAjax(wxDailyCareProductsService.insertWxDailyCareProducts(wxDailyCareProducts));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改日化产品信息
|
||||
*/
|
||||
@RequiresPermissions("system:products:edit")
|
||||
@Log(title = "日化产品信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WxDailyCareProducts wxDailyCareProducts)
|
||||
{
|
||||
return toAjax(wxDailyCareProductsService.updateWxDailyCareProducts(wxDailyCareProducts));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除日化产品信息
|
||||
*/
|
||||
@RequiresPermissions("system:products:remove")
|
||||
@Log(title = "日化产品信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(wxDailyCareProductsService.deleteWxDailyCareProductsByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.flossom.system.service;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxDailyCareProducts;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 日化产品信息Service接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-04-28
|
||||
*/
|
||||
public interface IWxDailyCareProductsService
|
||||
{
|
||||
/**
|
||||
* 查询日化产品信息
|
||||
*
|
||||
* @param id 日化产品信息主键
|
||||
* @return 日化产品信息
|
||||
*/
|
||||
public WxDailyCareProducts selectWxDailyCareProductsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询日化产品信息列表
|
||||
*
|
||||
* @param wxDailyCareProducts 日化产品信息
|
||||
* @return 日化产品信息集合
|
||||
*/
|
||||
public List<WxDailyCareProducts> selectWxDailyCareProductsList(WxDailyCareProducts wxDailyCareProducts);
|
||||
|
||||
/**
|
||||
* 新增日化产品信息
|
||||
*
|
||||
* @param wxDailyCareProducts 日化产品信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxDailyCareProducts(WxDailyCareProducts wxDailyCareProducts);
|
||||
|
||||
/**
|
||||
* 修改日化产品信息
|
||||
*
|
||||
* @param wxDailyCareProducts 日化产品信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxDailyCareProducts(WxDailyCareProducts wxDailyCareProducts);
|
||||
|
||||
/**
|
||||
* 批量删除日化产品信息
|
||||
*
|
||||
* @param ids 需要删除的日化产品信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxDailyCareProductsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除日化产品信息信息
|
||||
*
|
||||
* @param id 日化产品信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxDailyCareProductsById(Long id);
|
||||
}
|
||||
@ -0,0 +1,98 @@
|
||||
package com.flossom.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxDailyCareProducts;
|
||||
import com.flossom.common.core.mapper.WxDailyCareProductsMapper;
|
||||
import com.flossom.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.flossom.system.service.IWxDailyCareProductsService;
|
||||
|
||||
/**
|
||||
* 日化产品信息Service业务层处理
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2024-04-28
|
||||
*/
|
||||
@Service
|
||||
public class WxDailyCareProductsServiceImpl implements IWxDailyCareProductsService
|
||||
{
|
||||
@Autowired
|
||||
private WxDailyCareProductsMapper wxDailyCareProductsMapper;
|
||||
|
||||
/**
|
||||
* 查询日化产品信息
|
||||
*
|
||||
* @param id 日化产品信息主键
|
||||
* @return 日化产品信息
|
||||
*/
|
||||
@Override
|
||||
public WxDailyCareProducts selectWxDailyCareProductsById(Long id)
|
||||
{
|
||||
return wxDailyCareProductsMapper.selectWxDailyCareProductsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询日化产品信息列表
|
||||
*
|
||||
* @param wxDailyCareProducts 日化产品信息
|
||||
* @return 日化产品信息
|
||||
*/
|
||||
@Override
|
||||
public List<WxDailyCareProducts> selectWxDailyCareProductsList(WxDailyCareProducts wxDailyCareProducts)
|
||||
{
|
||||
return wxDailyCareProductsMapper.selectWxDailyCareProductsList(wxDailyCareProducts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增日化产品信息
|
||||
*
|
||||
* @param wxDailyCareProducts 日化产品信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWxDailyCareProducts(WxDailyCareProducts wxDailyCareProducts)
|
||||
{
|
||||
wxDailyCareProducts.setCreateTime(DateUtils.getNowDate());
|
||||
wxDailyCareProducts.setUpdateTime(DateUtils.getNowDate());
|
||||
return wxDailyCareProductsMapper.insertWxDailyCareProducts(wxDailyCareProducts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改日化产品信息
|
||||
*
|
||||
* @param wxDailyCareProducts 日化产品信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWxDailyCareProducts(WxDailyCareProducts wxDailyCareProducts)
|
||||
{
|
||||
wxDailyCareProducts.setUpdateTime(DateUtils.getNowDate());
|
||||
return wxDailyCareProductsMapper.updateWxDailyCareProducts(wxDailyCareProducts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除日化产品信息
|
||||
*
|
||||
* @param ids 需要删除的日化产品信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWxDailyCareProductsByIds(Long[] ids)
|
||||
{
|
||||
return wxDailyCareProductsMapper.deleteWxDailyCareProductsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除日化产品信息信息
|
||||
*
|
||||
* @param id 日化产品信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWxDailyCareProductsById(Long id)
|
||||
{
|
||||
return wxDailyCareProductsMapper.deleteWxDailyCareProductsById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询日化产品信息列表
|
||||
export function listProducts(query) {
|
||||
return request({
|
||||
url: '/system/products/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询日化产品信息详细
|
||||
export function getProducts(id) {
|
||||
return request({
|
||||
url: '/system/products/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增日化产品信息
|
||||
export function addProducts(data) {
|
||||
return request({
|
||||
url: '/system/products',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改日化产品信息
|
||||
export function updateProducts(data) {
|
||||
return request({
|
||||
url: '/system/products',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除日化产品信息
|
||||
export function delProducts(id) {
|
||||
return request({
|
||||
url: '/system/products/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -1,293 +1,381 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
|
||||
<el-tab-pane :label="item.code" :name="item.code" v-for="(item, index) of liningList">
|
||||
<div style="width: 200px; float: left;">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<!-- 左侧表单项 -->
|
||||
<div class="form-top">
|
||||
<div class="form-top--left">
|
||||
<el-form-item label="膜布名称" prop="name" style="width: 500px">
|
||||
<el-input v-model="item.name" placeholder="请输入膜布名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="购买入口是否显示" label-width="150px" prop="name" style="width: 500px">
|
||||
<el-switch
|
||||
v-model="item.isShowBuy == 1"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="购买商城appid" label-width="150px" prop="skipAppid" style="width: 500px">
|
||||
<el-input v-model="item.skipAppid" placeholder="请输入购买商城appid"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="膜布图标" prop="icon" width="150px">
|
||||
<template>
|
||||
<!-- 膜布图标 -->
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:action="uploadUrl"
|
||||
:headers="headers"
|
||||
:file-list="item.fileList"
|
||||
list-type="picture-card"
|
||||
accept=".jpg,.png"
|
||||
:limit="1"
|
||||
:class="{ hide: item.uploadHide }"
|
||||
:on-remove="iconUploadRemove"
|
||||
:on-success="iconUploadSuccess"
|
||||
:on-error="uploadError"
|
||||
:before-upload="handleBeforeUploadImage"
|
||||
>
|
||||
<i slot="default" class="el-icon-plus"></i>
|
||||
<div slot="file" slot-scope="{ file }">
|
||||
<img :src="file.url" class="el-upload-list__item-thumbnail" alt=""/>
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span @click="iconPicturePreview(file)" class="el-upload-list__item-preview">
|
||||
<i class="el-icon-zoom-in"></i>
|
||||
</span>
|
||||
<span v-if="!disabled" @click="iconUploadRemove(file)" class="el-upload-list__item-delete">
|
||||
<i class="el-icon-delete"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件</div>
|
||||
</el-upload>
|
||||
<!-- 预览窗口 -->
|
||||
<el-dialog :visible.sync="dialogVisible" append-to-body>
|
||||
<img width="100%" :src="dialogImageUrl" alt=""/>
|
||||
</el-dialog>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- 右侧表单项 -->
|
||||
<div class="form-top--right">
|
||||
<el-form-item label="膜布描述" prop="desc" style="width: 500px">
|
||||
<el-input v-model="item.desc" placeholder="请输入膜布描述"/>
|
||||
</el-form-item>
|
||||
<el-form-item style="height: 36px"/>
|
||||
<el-form-item label="购买商城PATH" label-width="150px" prop="skipPath" style="width: 500px">
|
||||
<el-input v-model="item.skipPath" placeholder="请输入购买商城PATH"/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" style="margin-left: 90%;">
|
||||
<el-button type="primary" @click="submitForm(item)">提 交</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
|
||||
<el-tab-pane
|
||||
:label="item.code"
|
||||
:name="item.code"
|
||||
:key="item.code"
|
||||
v-for="(item, index) of liningList"
|
||||
>
|
||||
<div style="width: 200px; float: left">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<!-- 左侧表单项 -->
|
||||
<div class="form-top">
|
||||
<div class="form-top--left">
|
||||
<el-form-item
|
||||
label="膜布名称"
|
||||
prop="name"
|
||||
style="width: 500px"
|
||||
class="is-required"
|
||||
>
|
||||
<el-input v-model="item.name" placeholder="请输入膜布名称" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
class="is-required"
|
||||
label="购买入口是否显示"
|
||||
label-width="150px"
|
||||
prop="name"
|
||||
style="width: 500px"
|
||||
>
|
||||
<el-switch
|
||||
v-model="item.isShowBuyOpen"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="item.isShowBuyOpen"
|
||||
class="is-required"
|
||||
label="购买商城appid"
|
||||
label-width="150px"
|
||||
prop="skipAppid"
|
||||
style="width: 500px"
|
||||
>
|
||||
<el-input
|
||||
v-model="item.skipAppid"
|
||||
placeholder="请输入购买商城appid"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
class="is-required"
|
||||
label="膜布图标"
|
||||
prop="icon"
|
||||
width="150px"
|
||||
>
|
||||
<template>
|
||||
<!-- 膜布图标 -->
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:action="uploadUrl"
|
||||
:headers="headers"
|
||||
:file-list="item.fileList"
|
||||
list-type="picture-card"
|
||||
accept=".jpg,.png"
|
||||
:limit="1"
|
||||
:class="{ hide: item.uploadHide }"
|
||||
:on-remove="iconUploadRemove"
|
||||
:on-success="iconUploadSuccess"
|
||||
:on-error="uploadError"
|
||||
:before-upload="handleBeforeUploadImage"
|
||||
>
|
||||
<i slot="default" class="el-icon-plus"></i>
|
||||
<div slot="file" slot-scope="{ file }">
|
||||
<img
|
||||
:src="file.url"
|
||||
class="el-upload-list__item-thumbnail"
|
||||
alt=""
|
||||
/>
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span
|
||||
@click="iconPicturePreview(file)"
|
||||
class="el-upload-list__item-preview"
|
||||
>
|
||||
<i class="el-icon-zoom-in"></i>
|
||||
</span>
|
||||
<span
|
||||
v-if="!disabled"
|
||||
@click="iconUploadRemove(file)"
|
||||
class="el-upload-list__item-delete"
|
||||
>
|
||||
<i class="el-icon-delete"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">
|
||||
只能上传jpg/png文件
|
||||
</div>
|
||||
</el-upload>
|
||||
<!-- 预览窗口 -->
|
||||
<el-dialog :visible.sync="dialogVisible" append-to-body>
|
||||
<img width="100%" :src="dialogImageUrl" alt="" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- 右侧表单项 -->
|
||||
<div class="form-top--right">
|
||||
<el-form-item label="膜布描述" prop="desc" style="width: 500px">
|
||||
<el-input v-model="item.desc" placeholder="请输入膜布描述" />
|
||||
</el-form-item>
|
||||
<el-form-item style="height: 36px" />
|
||||
<el-form-item
|
||||
v-show="item.isShowBuyOpen"
|
||||
class="is-required"
|
||||
label="购买商城PATH"
|
||||
label-width="150px"
|
||||
prop="skipPath"
|
||||
style="width: 500px"
|
||||
>
|
||||
<el-input
|
||||
v-model="item.skipPath"
|
||||
placeholder="请输入购买商城PATH"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" style="margin-left: 90%">
|
||||
<el-button type="primary" @click="submitForm(item)"
|
||||
>提 交</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listLining, getLining, delLining, addLining, updateLining} from "@/api/system/lining";
|
||||
import {getToken} from "@/utils/auth";
|
||||
import {
|
||||
listLining,
|
||||
getLining,
|
||||
delLining,
|
||||
addLining,
|
||||
updateLining,
|
||||
} from '@/api/system/lining'
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
name: "Lining",
|
||||
data() {
|
||||
return {
|
||||
// 激活标签页
|
||||
activeName: "M01",
|
||||
/* 文件上传地址 */
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + '/file/upload',
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + getToken(),
|
||||
},
|
||||
fileList: [
|
||||
[], []
|
||||
],
|
||||
// 上传后是否隐藏
|
||||
// uploadHide: false,
|
||||
disabled: false,
|
||||
dialogImageUrl: '',
|
||||
dialogVisible: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 膜布表格数据
|
||||
liningList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
code: null,
|
||||
name: null,
|
||||
desc: null,
|
||||
isShowBuy: null,
|
||||
skipAppid: null,
|
||||
skipPath: null,
|
||||
icon: null,
|
||||
status: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询膜布列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listLining().then(response => {
|
||||
response?.rows?.forEach(item => {
|
||||
this.liningList.push({
|
||||
...item,
|
||||
// 上传后是否隐藏
|
||||
uploadHide: item?.icon != null,
|
||||
fileList: [{
|
||||
name: item?.icon,
|
||||
url: item?.icon
|
||||
}]
|
||||
})
|
||||
})
|
||||
console.log(this.liningList);
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
code: null,
|
||||
name: null,
|
||||
desc: null,
|
||||
isShowBuy: null,
|
||||
skipAppid: null,
|
||||
skipPath: null,
|
||||
icon: null,
|
||||
status: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getLining(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改膜布";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm(item) {
|
||||
this.form = item;
|
||||
this.form.icon = item.fileList[0].url;
|
||||
if (this.form.id != null) {
|
||||
updateLining(this.form).then(response => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
} else {
|
||||
this.$modal.msgError("修改失败");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addLining(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
},
|
||||
iconUploadRemove(file, fileList) {
|
||||
this.liningList.forEach(e => {
|
||||
if (this.activeName === e.code) {
|
||||
e.fileList = [];
|
||||
e.uploadHide = false;
|
||||
}
|
||||
})
|
||||
},
|
||||
iconUploadSuccess(response, file) {
|
||||
if (response.code == 200) {
|
||||
this.form.banner = response.data.url
|
||||
this.liningList.forEach(e => {
|
||||
if (this.activeName === e.code) {
|
||||
e.fileList = [{
|
||||
name: response.data.url,
|
||||
url: response.data.url
|
||||
}];
|
||||
e.uploadHide = true;
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error('图片插入失败')
|
||||
}
|
||||
},
|
||||
handleBeforeUploadImage(file) {
|
||||
let fileType = ['jpg', 'png', 'JPG', 'PNG']
|
||||
const fileName = file.name.split('.')
|
||||
const fileExt = fileName[fileName.length - 1]
|
||||
const isTypeOk = fileType.indexOf(fileExt) >= 0
|
||||
if (!isTypeOk) {
|
||||
this.$modal.msgError(`文件类型只能为jpg格式/png格式`)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
iconPicturePreview(file) {
|
||||
this.dialogImageUrl = file.url
|
||||
this.dialogVisible = true
|
||||
},
|
||||
/* 文件上传失败 */
|
||||
uploadError() {
|
||||
this.$message.error('文件上传失败')
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
},
|
||||
}
|
||||
};
|
||||
name: 'Lining',
|
||||
data() {
|
||||
return {
|
||||
// 激活标签页
|
||||
activeName: 'M01',
|
||||
/* 文件上传地址 */
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + '/file/upload',
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + getToken(),
|
||||
},
|
||||
fileList: [[], []],
|
||||
// 上传后是否隐藏
|
||||
// uploadHide: false,
|
||||
disabled: false,
|
||||
dialogImageUrl: '',
|
||||
dialogVisible: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 膜布表格数据
|
||||
liningList: [],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
code: null,
|
||||
name: null,
|
||||
desc: null,
|
||||
isShowBuy: null,
|
||||
skipAppid: null,
|
||||
skipPath: null,
|
||||
icon: null,
|
||||
status: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询膜布列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listLining().then((response) => {
|
||||
response?.rows?.forEach((item) => {
|
||||
this.liningList.push({
|
||||
...item,
|
||||
// 上传后是否隐藏
|
||||
isShowBuyOpen: item?.isShowBuy == 1,
|
||||
uploadHide: item?.icon != null,
|
||||
fileList: [
|
||||
{
|
||||
name: item?.icon,
|
||||
url: item?.icon,
|
||||
},
|
||||
],
|
||||
})
|
||||
})
|
||||
console.log(this.liningList)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
code: null,
|
||||
name: null,
|
||||
desc: null,
|
||||
isShowBuy: null,
|
||||
isShowBuyOpen: false,
|
||||
skipAppid: null,
|
||||
skipPath: null,
|
||||
icon: null,
|
||||
status: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getLining(id).then((response) => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = '修改膜布'
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm(item) {
|
||||
this.form = item
|
||||
this.form.icon = item.fileList[0].url
|
||||
this.form.isShowBuy = item.isShowBuyOpen ? 1 : 0
|
||||
if (this.form.name == '') {
|
||||
this.$modal.msgError('请输入膜布名称')
|
||||
return
|
||||
}
|
||||
if (this.form.name.length > 15) {
|
||||
this.$modal.msgError('膜布名称的长度不能超出15个字符')
|
||||
return
|
||||
}
|
||||
if (this.form.desc != '' && this.form.desc.length > 30) {
|
||||
this.$modal.msgError('膜布描述的长度不能超出30个字符')
|
||||
return
|
||||
}
|
||||
if (this.form.isShowBuyOpen && this.form.skipAppid == '') {
|
||||
this.$modal.msgError('请输入购买商城appid')
|
||||
return
|
||||
}
|
||||
if (this.form.isShowBuyOpen && this.form.skipPath == '') {
|
||||
this.$modal.msgError('请输入购买商城PATH')
|
||||
return
|
||||
}
|
||||
if (this.form.id != null) {
|
||||
updateLining(this.form).then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
} else {
|
||||
this.$modal.msgError('修改失败')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
addLining(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
},
|
||||
iconUploadRemove(file, fileList) {
|
||||
this.liningList.forEach((e) => {
|
||||
if (this.activeName === e.code) {
|
||||
e.fileList = []
|
||||
e.uploadHide = false
|
||||
}
|
||||
})
|
||||
},
|
||||
iconUploadSuccess(response, file) {
|
||||
if (response.code == 200) {
|
||||
this.form.banner = response.data.url
|
||||
this.liningList.forEach((e) => {
|
||||
if (this.activeName === e.code) {
|
||||
e.fileList = [
|
||||
{
|
||||
name: response.data.url,
|
||||
url: response.data.url,
|
||||
},
|
||||
]
|
||||
e.uploadHide = true
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error('图片插入失败')
|
||||
}
|
||||
},
|
||||
handleBeforeUploadImage(file) {
|
||||
let fileType = ['jpg', 'png', 'JPG', 'PNG']
|
||||
const fileName = file.name.split('.')
|
||||
const fileExt = fileName[fileName.length - 1]
|
||||
const isTypeOk = fileType.indexOf(fileExt) >= 0
|
||||
if (!isTypeOk) {
|
||||
this.$modal.msgError(`文件类型只能为jpg格式/png格式`)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
iconPicturePreview(file) {
|
||||
this.dialogImageUrl = file.url
|
||||
this.dialogVisible = true
|
||||
},
|
||||
/* 文件上传失败 */
|
||||
uploadError() {
|
||||
this.$message.error('文件上传失败')
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.app-container {
|
||||
.form-top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.form-top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.form-top--right {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.form-top--right {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.form-bottom {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.form-bottom {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
::v-deep .hide .el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
::v-deep .hide .el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue