24 changed files with 1966 additions and 144 deletions
-
12chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuConsultationFormsController.java
-
104chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuFeedbackController.java
-
274chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuUserController.java
-
2chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysLoginController.java
-
153chenhai-admin/src/main/java/com/chenhai/web/controller/system/SysMuhuUserController.java
-
12chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetCommentsController.java
-
12chenhai-system/src/main/java/com/chenhai/muhu/domain/MuhuConsultationForms.java
-
237chenhai-system/src/main/java/com/chenhai/muhu/domain/MuhuFeedback.java
-
8chenhai-system/src/main/java/com/chenhai/muhu/mapper/MuhuConsultationFormsMapper.java
-
61chenhai-system/src/main/java/com/chenhai/muhu/mapper/MuhuFeedbackMapper.java
-
8chenhai-system/src/main/java/com/chenhai/muhu/service/IMuhuConsultationFormsService.java
-
61chenhai-system/src/main/java/com/chenhai/muhu/service/IMuhuFeedbackService.java
-
105chenhai-system/src/main/java/com/chenhai/muhu/service/impl/MuhuConsultationFormsServiceImpl.java
-
117chenhai-system/src/main/java/com/chenhai/muhu/service/impl/MuhuFeedbackServiceImpl.java
-
16chenhai-system/src/main/java/com/chenhai/system/domain/SysMuhuUser.java
-
18chenhai-system/src/main/java/com/chenhai/system/service/ISysMuhuUserService.java
-
162chenhai-system/src/main/java/com/chenhai/system/service/impl/SysMuhuUserServiceImpl.java
-
44chenhai-system/src/main/resources/mapper/muhu/MuhuConsultationFormsMapper.xml
-
130chenhai-system/src/main/resources/mapper/muhu/MuhuFeedbackMapper.xml
-
69chenhai-system/src/main/resources/mapper/system/SysMuhuUserMapper.xml
-
44chenhai-ui/src/api/muhu/feedback.js
-
64chenhai-ui/src/api/system/muhuuser.js
-
272chenhai-ui/src/views/muhu/feedback/index.vue
-
27chenhai-ui/src/views/system/muhuuser/index.vue
@ -0,0 +1,104 @@ |
|||
package com.chenhai.web.controller.muhu; |
|||
|
|||
import java.util.List; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
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.chenhai.common.annotation.Log; |
|||
import com.chenhai.common.core.controller.BaseController; |
|||
import com.chenhai.common.core.domain.AjaxResult; |
|||
import com.chenhai.common.enums.BusinessType; |
|||
import com.chenhai.muhu.domain.MuhuFeedback; |
|||
import com.chenhai.muhu.service.IMuhuFeedbackService; |
|||
import com.chenhai.common.utils.poi.ExcelUtil; |
|||
import com.chenhai.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 反馈建议Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-02-10 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/muhu/feedback") |
|||
public class MuhuFeedbackController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private IMuhuFeedbackService muhuFeedbackService; |
|||
|
|||
/** |
|||
* 查询反馈建议列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('muhu:feedback:list') or @ss.hasRole('muhu')") |
|||
@GetMapping("/list") |
|||
public TableDataInfo list(MuhuFeedback muhuFeedback) |
|||
{ |
|||
startPage(); |
|||
List<MuhuFeedback> list = muhuFeedbackService.selectMuhuFeedbackList(muhuFeedback); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出反馈建议列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('muhu:feedback:export') or @ss.hasRole('muhu')") |
|||
@Log(title = "反馈建议", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response, MuhuFeedback muhuFeedback) |
|||
{ |
|||
List<MuhuFeedback> list = muhuFeedbackService.selectMuhuFeedbackList(muhuFeedback); |
|||
ExcelUtil<MuhuFeedback> util = new ExcelUtil<MuhuFeedback>(MuhuFeedback.class); |
|||
util.exportExcel(response, list, "反馈建议数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取反馈建议详细信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('muhu:feedback:query') or @ss.hasRole('muhu')") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") Long id) |
|||
{ |
|||
return success(muhuFeedbackService.selectMuhuFeedbackById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增反馈建议 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('muhu:feedback:add') or @ss.hasRole('muhu')") |
|||
@Log(title = "反馈建议", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody MuhuFeedback muhuFeedback) |
|||
{ |
|||
return toAjax(muhuFeedbackService.insertMuhuFeedback(muhuFeedback)); |
|||
} |
|||
|
|||
/** |
|||
* 修改反馈建议 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('muhu:feedback:edit') or @ss.hasRole('muhu')") |
|||
@Log(title = "反馈建议", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody MuhuFeedback muhuFeedback) |
|||
{ |
|||
return toAjax(muhuFeedbackService.updateMuhuFeedback(muhuFeedback)); |
|||
} |
|||
|
|||
/** |
|||
* 删除反馈建议 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('muhu:feedback:remove') or @ss.hasRole('muhu')") |
|||
@Log(title = "反馈建议", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable Long[] ids) |
|||
{ |
|||
return toAjax(muhuFeedbackService.deleteMuhuFeedbackByIds(ids)); |
|||
} |
|||
} |
|||
@ -0,0 +1,237 @@ |
|||
package com.chenhai.muhu.domain; |
|||
|
|||
import java.util.Date; |
|||
|
|||
import com.chenhai.common.core.domain.entity.SysUser; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.chenhai.common.annotation.Excel; |
|||
import com.chenhai.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 反馈建议对象 muhu_feedback |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-02-10 |
|||
*/ |
|||
public class MuhuFeedback extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 反馈ID */ |
|||
private Long id; |
|||
|
|||
/** 用户ID */ |
|||
@Excel(name = "用户ID") |
|||
private Long userId; |
|||
|
|||
/** 反馈类型 */ |
|||
@Excel(name = "反馈类型") |
|||
private String type; |
|||
|
|||
/** 反馈标题 */ |
|||
@Excel(name = "反馈标题") |
|||
private String title; |
|||
|
|||
/** 反馈内容 */ |
|||
@Excel(name = "反馈内容") |
|||
private String content; |
|||
|
|||
/** 联系方式 */ |
|||
@Excel(name = "联系方式") |
|||
private String contactInfo; |
|||
|
|||
/** 状态 */ |
|||
@Excel(name = "状态") |
|||
private String status; |
|||
|
|||
/** 优先级 */ |
|||
@Excel(name = "优先级") |
|||
private String priority; |
|||
|
|||
/** 平台来源 */ |
|||
@Excel(name = "平台来源") |
|||
private String platform; |
|||
|
|||
/** 应用版本号 */ |
|||
@Excel(name = "应用版本号") |
|||
private String version; |
|||
|
|||
/** 图片地址 */ |
|||
@Excel(name = "图片地址") |
|||
private String images; |
|||
|
|||
/** 创建时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date createdAt; |
|||
|
|||
/** 更新时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date updatedAt; |
|||
|
|||
/** 用户昵称 */ |
|||
private String nickName; |
|||
|
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
|
|||
public void setUserId(Long userId) |
|||
{ |
|||
this.userId = userId; |
|||
} |
|||
|
|||
public Long getUserId() |
|||
{ |
|||
return userId; |
|||
} |
|||
|
|||
public void setType(String type) |
|||
{ |
|||
this.type = type; |
|||
} |
|||
|
|||
public String getType() |
|||
{ |
|||
return type; |
|||
} |
|||
|
|||
public void setTitle(String title) |
|||
{ |
|||
this.title = title; |
|||
} |
|||
|
|||
public String getTitle() |
|||
{ |
|||
return title; |
|||
} |
|||
|
|||
public void setContent(String content) |
|||
{ |
|||
this.content = content; |
|||
} |
|||
|
|||
public String getContent() |
|||
{ |
|||
return content; |
|||
} |
|||
|
|||
public void setContactInfo(String contactInfo) |
|||
{ |
|||
this.contactInfo = contactInfo; |
|||
} |
|||
|
|||
public String getContactInfo() |
|||
{ |
|||
return contactInfo; |
|||
} |
|||
|
|||
public void setStatus(String status) |
|||
{ |
|||
this.status = status; |
|||
} |
|||
|
|||
public String getStatus() |
|||
{ |
|||
return status; |
|||
} |
|||
|
|||
public void setPriority(String priority) |
|||
{ |
|||
this.priority = priority; |
|||
} |
|||
|
|||
public String getPriority() |
|||
{ |
|||
return priority; |
|||
} |
|||
|
|||
public void setPlatform(String platform) |
|||
{ |
|||
this.platform = platform; |
|||
} |
|||
|
|||
public String getPlatform() |
|||
{ |
|||
return platform; |
|||
} |
|||
|
|||
public void setVersion(String version) |
|||
{ |
|||
this.version = version; |
|||
} |
|||
|
|||
public String getVersion() |
|||
{ |
|||
return version; |
|||
} |
|||
|
|||
public void setImages(String images) |
|||
{ |
|||
this.images = images; |
|||
} |
|||
|
|||
public String getImages() |
|||
{ |
|||
return images; |
|||
} |
|||
|
|||
public void setCreatedAt(Date createdAt) |
|||
{ |
|||
this.createdAt = createdAt; |
|||
} |
|||
|
|||
public Date getCreatedAt() |
|||
{ |
|||
return createdAt; |
|||
} |
|||
|
|||
public void setUpdatedAt(Date updatedAt) |
|||
{ |
|||
this.updatedAt = updatedAt; |
|||
} |
|||
|
|||
public Date getUpdatedAt() |
|||
{ |
|||
return updatedAt; |
|||
} |
|||
|
|||
public void setNickName(String nickName) |
|||
{ |
|||
this.nickName = nickName; |
|||
} |
|||
|
|||
public String getNickName() |
|||
{ |
|||
return nickName; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("userId", getUserId()) |
|||
.append("type", getType()) |
|||
.append("title", getTitle()) |
|||
.append("content", getContent()) |
|||
.append("contactInfo", getContactInfo()) |
|||
.append("status", getStatus()) |
|||
.append("priority", getPriority()) |
|||
.append("platform", getPlatform()) |
|||
.append("version", getVersion()) |
|||
.append("images", getImages()) |
|||
.append("createdAt", getCreatedAt()) |
|||
.append("updatedAt", getUpdatedAt()) |
|||
.append("nickName", getNickName()) |
|||
.toString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.chenhai.muhu.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.muhu.domain.MuhuFeedback; |
|||
|
|||
/** |
|||
* 反馈建议Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-02-10 |
|||
*/ |
|||
public interface MuhuFeedbackMapper |
|||
{ |
|||
/** |
|||
* 查询反馈建议 |
|||
* |
|||
* @param id 反馈建议主键 |
|||
* @return 反馈建议 |
|||
*/ |
|||
public MuhuFeedback selectMuhuFeedbackById(Long id); |
|||
|
|||
/** |
|||
* 查询反馈建议列表 |
|||
* |
|||
* @param muhuFeedback 反馈建议 |
|||
* @return 反馈建议集合 |
|||
*/ |
|||
public List<MuhuFeedback> selectMuhuFeedbackList(MuhuFeedback muhuFeedback); |
|||
|
|||
/** |
|||
* 新增反馈建议 |
|||
* |
|||
* @param muhuFeedback 反馈建议 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertMuhuFeedback(MuhuFeedback muhuFeedback); |
|||
|
|||
/** |
|||
* 修改反馈建议 |
|||
* |
|||
* @param muhuFeedback 反馈建议 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateMuhuFeedback(MuhuFeedback muhuFeedback); |
|||
|
|||
/** |
|||
* 删除反馈建议 |
|||
* |
|||
* @param id 反馈建议主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteMuhuFeedbackById(Long id); |
|||
|
|||
/** |
|||
* 批量删除反馈建议 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteMuhuFeedbackByIds(Long[] ids); |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.chenhai.muhu.service; |
|||
|
|||
import java.util.List; |
|||
import com.chenhai.muhu.domain.MuhuFeedback; |
|||
|
|||
/** |
|||
* 反馈建议Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-02-10 |
|||
*/ |
|||
public interface IMuhuFeedbackService |
|||
{ |
|||
/** |
|||
* 查询反馈建议 |
|||
* |
|||
* @param id 反馈建议主键 |
|||
* @return 反馈建议 |
|||
*/ |
|||
public MuhuFeedback selectMuhuFeedbackById(Long id); |
|||
|
|||
/** |
|||
* 查询反馈建议列表 |
|||
* |
|||
* @param muhuFeedback 反馈建议 |
|||
* @return 反馈建议集合 |
|||
*/ |
|||
public List<MuhuFeedback> selectMuhuFeedbackList(MuhuFeedback muhuFeedback); |
|||
|
|||
/** |
|||
* 新增反馈建议 |
|||
* |
|||
* @param muhuFeedback 反馈建议 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertMuhuFeedback(MuhuFeedback muhuFeedback); |
|||
|
|||
/** |
|||
* 修改反馈建议 |
|||
* |
|||
* @param muhuFeedback 反馈建议 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateMuhuFeedback(MuhuFeedback muhuFeedback); |
|||
|
|||
/** |
|||
* 批量删除反馈建议 |
|||
* |
|||
* @param ids 需要删除的反馈建议主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteMuhuFeedbackByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 删除反馈建议信息 |
|||
* |
|||
* @param id 反馈建议主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteMuhuFeedbackById(Long id); |
|||
} |
|||
@ -0,0 +1,117 @@ |
|||
package com.chenhai.muhu.service.impl; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
import com.chenhai.common.core.domain.entity.SysUser; |
|||
import com.chenhai.common.core.domain.model.LoginUser; |
|||
import com.chenhai.common.utils.SecurityUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.chenhai.muhu.mapper.MuhuFeedbackMapper; |
|||
import com.chenhai.muhu.domain.MuhuFeedback; |
|||
import com.chenhai.muhu.service.IMuhuFeedbackService; |
|||
|
|||
/** |
|||
* 反馈建议Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2026-02-10 |
|||
*/ |
|||
@Service |
|||
public class MuhuFeedbackServiceImpl implements IMuhuFeedbackService |
|||
{ |
|||
@Autowired |
|||
private MuhuFeedbackMapper muhuFeedbackMapper; |
|||
|
|||
/** |
|||
* 查询反馈建议 |
|||
* |
|||
* @param id 反馈建议主键 |
|||
* @return 反馈建议 |
|||
*/ |
|||
@Override |
|||
public MuhuFeedback selectMuhuFeedbackById(Long id) |
|||
{ |
|||
return muhuFeedbackMapper.selectMuhuFeedbackById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询反馈建议列表 |
|||
* |
|||
* @param muhuFeedback 反馈建议 |
|||
* @return 反馈建议 |
|||
*/ |
|||
@Override |
|||
public List<MuhuFeedback> selectMuhuFeedbackList(MuhuFeedback muhuFeedback) |
|||
{ |
|||
return muhuFeedbackMapper.selectMuhuFeedbackList(muhuFeedback); |
|||
} |
|||
|
|||
/** |
|||
* 新增反馈建议 |
|||
* |
|||
* @param muhuFeedback 反馈建议 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertMuhuFeedback(MuhuFeedback muhuFeedback) |
|||
{ |
|||
// 获取当前登录用户信息 |
|||
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|||
|
|||
if (loginUser != null && loginUser.getUser() != null) { |
|||
SysUser user = loginUser.getUser(); |
|||
// 自动设置用户ID和昵称 |
|||
muhuFeedback.setUserId(user.getUserId()); |
|||
muhuFeedback.setNickName(user.getNickName()); |
|||
} else { |
|||
// 如果没有登录用户,可以根据需要设置默认值或抛出异常 |
|||
throw new RuntimeException("用户未登录,无法提交反馈"); |
|||
} |
|||
|
|||
// 设置时间 |
|||
Date now = new Date(); |
|||
muhuFeedback.setCreatedAt(now); |
|||
muhuFeedback.setUpdatedAt(now); |
|||
|
|||
return muhuFeedbackMapper.insertMuhuFeedback(muhuFeedback); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 修改反馈建议 |
|||
* |
|||
* @param muhuFeedback 反馈建议 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateMuhuFeedback(MuhuFeedback muhuFeedback) |
|||
{ |
|||
return muhuFeedbackMapper.updateMuhuFeedback(muhuFeedback); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除反馈建议 |
|||
* |
|||
* @param ids 需要删除的反馈建议主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteMuhuFeedbackByIds(Long[] ids) |
|||
{ |
|||
return muhuFeedbackMapper.deleteMuhuFeedbackByIds(ids); |
|||
} |
|||
|
|||
/** |
|||
* 删除反馈建议信息 |
|||
* |
|||
* @param id 反馈建议主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteMuhuFeedbackById(Long id) |
|||
{ |
|||
return muhuFeedbackMapper.deleteMuhuFeedbackById(id); |
|||
} |
|||
} |
|||
@ -0,0 +1,130 @@ |
|||
<?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.chenhai.muhu.mapper.MuhuFeedbackMapper"> |
|||
|
|||
<resultMap type="MuhuFeedback" id="MuhuFeedbackResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="userId" column="user_id" /> |
|||
<result property="type" column="type" /> |
|||
<result property="title" column="title" /> |
|||
<result property="content" column="content" /> |
|||
<result property="contactInfo" column="contact_info" /> |
|||
<result property="status" column="status" /> |
|||
<result property="priority" column="priority" /> |
|||
<result property="platform" column="platform" /> |
|||
<result property="version" column="version" /> |
|||
<result property="images" column="images" /> |
|||
<result property="createdAt" column="created_at" /> |
|||
<result property="updatedAt" column="updated_at" /> |
|||
<result property="nickName" column="nick_name" /> |
|||
</resultMap> |
|||
|
|||
<!-- 修改为关联查询 --> |
|||
<sql id="selectMuhuFeedbackVo"> |
|||
select |
|||
f.id, |
|||
f.user_id, |
|||
f.type, |
|||
f.title, |
|||
f.content, |
|||
f.contact_info, |
|||
f.status, |
|||
f.priority, |
|||
f.platform, |
|||
f.version, |
|||
f.images, |
|||
f.created_at, |
|||
f.updated_at, |
|||
u.nick_name <!-- 从sys_user表关联查询昵称 --> |
|||
from muhu_feedback f |
|||
left join sys_user u on f.user_id = u.user_id |
|||
</sql> |
|||
|
|||
<select id="selectMuhuFeedbackList" parameterType="MuhuFeedback" resultMap="MuhuFeedbackResult"> |
|||
<include refid="selectMuhuFeedbackVo"/> |
|||
<where> |
|||
<if test="userId != null "> and user_id = #{userId}</if> |
|||
<if test="type != null and type != ''"> and type = #{type}</if> |
|||
<if test="title != null and title != ''"> and title = #{title}</if> |
|||
<if test="content != null and content != ''"> and content = #{content}</if> |
|||
<if test="contactInfo != null and contactInfo != ''"> and contact_info = #{contactInfo}</if> |
|||
<if test="status != null and status != ''"> and status = #{status}</if> |
|||
<if test="priority != null and priority != ''"> and priority = #{priority}</if> |
|||
<if test="platform != null and platform != ''"> and platform = #{platform}</if> |
|||
<if test="version != null and version != ''"> and version = #{version}</if> |
|||
<if test="images != null and images != ''"> and images = #{images}</if> |
|||
<if test="createdAt != null "> and created_at = #{createdAt}</if> |
|||
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if> |
|||
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectMuhuFeedbackById" parameterType="Long" resultMap="MuhuFeedbackResult"> |
|||
<include refid="selectMuhuFeedbackVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertMuhuFeedback" parameterType="MuhuFeedback" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into muhu_feedback |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="userId != null">user_id,</if> |
|||
<if test="type != null">type,</if> |
|||
<if test="title != null">title,</if> |
|||
<if test="content != null">content,</if> |
|||
<if test="contactInfo != null">contact_info,</if> |
|||
<if test="status != null">status,</if> |
|||
<if test="priority != null">priority,</if> |
|||
<if test="platform != null">platform,</if> |
|||
<if test="version != null">version,</if> |
|||
<if test="images != null">images,</if> |
|||
<if test="createdAt != null">created_at,</if> |
|||
<if test="updatedAt != null">updated_at,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="userId != null">#{userId},</if> |
|||
<if test="type != null">#{type},</if> |
|||
<if test="title != null">#{title},</if> |
|||
<if test="content != null">#{content},</if> |
|||
<if test="contactInfo != null">#{contactInfo},</if> |
|||
<if test="status != null">#{status},</if> |
|||
<if test="priority != null">#{priority},</if> |
|||
<if test="platform != null">#{platform},</if> |
|||
<if test="version != null">#{version},</if> |
|||
<if test="images != null">#{images},</if> |
|||
<if test="createdAt != null">#{createdAt},</if> |
|||
<if test="updatedAt != null">#{updatedAt},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateMuhuFeedback" parameterType="MuhuFeedback"> |
|||
update muhu_feedback |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="userId != null">user_id = #{userId},</if> |
|||
<if test="type != null">type = #{type},</if> |
|||
<if test="title != null">title = #{title},</if> |
|||
<if test="content != null">content = #{content},</if> |
|||
<if test="contactInfo != null">contact_info = #{contactInfo},</if> |
|||
<if test="status != null">status = #{status},</if> |
|||
<if test="priority != null">priority = #{priority},</if> |
|||
<if test="platform != null">platform = #{platform},</if> |
|||
<if test="version != null">version = #{version},</if> |
|||
<if test="images != null">images = #{images},</if> |
|||
<if test="createdAt != null">created_at = #{createdAt},</if> |
|||
<if test="updatedAt != null">updated_at = #{updatedAt},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteMuhuFeedbackById" parameterType="Long"> |
|||
delete from muhu_feedback where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteMuhuFeedbackByIds" parameterType="String"> |
|||
delete from muhu_feedback where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
</mapper> |
|||
@ -0,0 +1,44 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询反馈建议列表
|
|||
export function listFeedback(query) { |
|||
return request({ |
|||
url: '/muhu/feedback/list', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
|||
|
|||
// 查询反馈建议详细
|
|||
export function getFeedback(id) { |
|||
return request({ |
|||
url: '/muhu/feedback/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增反馈建议
|
|||
export function addFeedback(data) { |
|||
return request({ |
|||
url: '/muhu/feedback', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改反馈建议
|
|||
export function updateFeedback(data) { |
|||
return request({ |
|||
url: '/muhu/feedback', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除反馈建议
|
|||
export function delFeedback(id) { |
|||
return request({ |
|||
url: '/muhu/feedback/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
@ -0,0 +1,272 @@ |
|||
<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="title"> |
|||
<el-input |
|||
v-model="queryParams.title" |
|||
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="['muhu:feedback: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="['muhu:feedback: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="['muhu:feedback: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="['muhu:feedback:export']" |
|||
>导出</el-button> |
|||
</el-col> |
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="feedbackList" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center" /> |
|||
<el-table-column label="用户ID" align="center" prop="userId" /> |
|||
<el-table-column label="昵称" align="center" prop="nickName" /> |
|||
<el-table-column label="反馈内容" align="left" prop="content" min-width="200"> |
|||
<template slot-scope="scope"> |
|||
<div class="content-preview" v-html="scope.row.content"></div> |
|||
</template> |
|||
</el-table-column> |
|||
<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="['muhu:feedback:edit']" |
|||
>修改</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['muhu:feedback: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" |
|||
/> |
|||
|
|||
<!-- 添加或修改反馈建议对话框 --> |
|||
<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="content"> |
|||
<editor v-model="form.content" :min-height="192" /> |
|||
</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 { listFeedback, getFeedback, delFeedback, addFeedback, updateFeedback } from "@/api/muhu/feedback" |
|||
|
|||
export default { |
|||
name: "Feedback", |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 反馈建议表格数据 |
|||
feedbackList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
userId: null, |
|||
type: null, |
|||
title: null, |
|||
content: null, |
|||
contactInfo: null, |
|||
status: null, |
|||
priority: null, |
|||
platform: null, |
|||
version: null, |
|||
images: null, |
|||
createdAt: null, |
|||
updatedAt: null |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
this.getList() |
|||
}, |
|||
methods: { |
|||
/** 查询反馈建议列表 */ |
|||
getList() { |
|||
this.loading = true |
|||
listFeedback(this.queryParams).then(response => { |
|||
this.feedbackList = response.rows |
|||
this.total = response.total |
|||
this.loading = false |
|||
}) |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false |
|||
this.reset() |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
userId: null, |
|||
type: null, |
|||
title: null, |
|||
content: null, |
|||
contactInfo: null, |
|||
status: null, |
|||
priority: null, |
|||
platform: null, |
|||
version: null, |
|||
images: null, |
|||
createdAt: null, |
|||
updatedAt: 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 = "添加反馈建议" |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset() |
|||
const id = row.id || this.ids |
|||
getFeedback(id).then(response => { |
|||
this.form = response.data |
|||
this.open = true |
|||
this.title = "修改反馈建议" |
|||
}) |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate(valid => { |
|||
if (valid) { |
|||
if (this.form.id != null) { |
|||
updateFeedback(this.form).then(response => { |
|||
this.$modal.msgSuccess("修改成功") |
|||
this.open = false |
|||
this.getList() |
|||
}) |
|||
} else { |
|||
addFeedback(this.form).then(response => { |
|||
this.$modal.msgSuccess("新增成功") |
|||
this.open = false |
|||
this.getList() |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
/** 删除按钮操作 */ |
|||
handleDelete(row) { |
|||
const ids = row.id || this.ids |
|||
this.$modal.confirm('是否确认删除反馈建议编号为"' + ids + '"的数据项?').then(function() { |
|||
return delFeedback(ids) |
|||
}).then(() => { |
|||
this.getList() |
|||
this.$modal.msgSuccess("删除成功") |
|||
}).catch(() => {}) |
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
this.download('muhu/feedback/export', { |
|||
...this.queryParams |
|||
}, `feedback_${new Date().getTime()}.xlsx`) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue