Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104
commit
f486b01aec
@ -0,0 +1,122 @@
|
||||
package com.flossom.hzMapper.domain;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 共创管理-留言管理对象 ct_leave_message
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
public class CtLeaveMessage extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 来源 1-我的模块 */
|
||||
@Excel(name = "来源 1-我的模块 ")
|
||||
private Integer source;
|
||||
|
||||
/** 来源名称 */
|
||||
@Excel(name = "来源名称")
|
||||
private String sourceName;
|
||||
|
||||
/** 用户头像 */
|
||||
@Excel(name = "用户头像")
|
||||
private String userImg;
|
||||
|
||||
/** 用户昵称 */
|
||||
@Excel(name = "用户昵称")
|
||||
private String userName;
|
||||
|
||||
/** 用户手机号码 */
|
||||
@Excel(name = "用户手机号码")
|
||||
private String userPhone;
|
||||
|
||||
/** 用户留言 */
|
||||
@Excel(name = "用户留言")
|
||||
private String messageInfo;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setSource(Integer source)
|
||||
{
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public Integer getSource()
|
||||
{
|
||||
return source;
|
||||
}
|
||||
public void setSourceName(String sourceName)
|
||||
{
|
||||
this.sourceName = sourceName;
|
||||
}
|
||||
|
||||
public String getSourceName()
|
||||
{
|
||||
return sourceName;
|
||||
}
|
||||
public void setUserImg(String userImg)
|
||||
{
|
||||
this.userImg = userImg;
|
||||
}
|
||||
|
||||
public String getUserImg()
|
||||
{
|
||||
return userImg;
|
||||
}
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
public void setUserPhone(String userPhone)
|
||||
{
|
||||
this.userPhone = userPhone;
|
||||
}
|
||||
|
||||
public String getUserPhone()
|
||||
{
|
||||
return userPhone;
|
||||
}
|
||||
public void setMessageInfo(String messageInfo)
|
||||
{
|
||||
this.messageInfo = messageInfo;
|
||||
}
|
||||
|
||||
public String getMessageInfo()
|
||||
{
|
||||
return messageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("source", getSource())
|
||||
.append("sourceName", getSourceName())
|
||||
.append("userImg", getUserImg())
|
||||
.append("userName", getUserName())
|
||||
.append("userPhone", getUserPhone())
|
||||
.append("messageInfo", getMessageInfo())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.flossom.hzMapper.mapper;
|
||||
|
||||
import com.flossom.hzMapper.domain.CtLeaveMessage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 共创管理-留言管理Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
public interface CtLeaveMessageMapper
|
||||
{
|
||||
/**
|
||||
* 查询共创管理-留言管理
|
||||
*
|
||||
* @param id 共创管理-留言管理主键
|
||||
* @return 共创管理-留言管理
|
||||
*/
|
||||
public CtLeaveMessage selectCtLeaveMessageById(Long id);
|
||||
|
||||
/**
|
||||
* 查询共创管理-留言管理列表
|
||||
*
|
||||
* @param ctLeaveMessage 共创管理-留言管理
|
||||
* @return 共创管理-留言管理集合
|
||||
*/
|
||||
public List<CtLeaveMessage> selectCtLeaveMessageList(CtLeaveMessage ctLeaveMessage);
|
||||
|
||||
/**
|
||||
* 新增共创管理-留言管理
|
||||
*
|
||||
* @param ctLeaveMessage 共创管理-留言管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCtLeaveMessage(CtLeaveMessage ctLeaveMessage);
|
||||
|
||||
/**
|
||||
* 修改共创管理-留言管理
|
||||
*
|
||||
* @param ctLeaveMessage 共创管理-留言管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCtLeaveMessage(CtLeaveMessage ctLeaveMessage);
|
||||
|
||||
/**
|
||||
* 删除共创管理-留言管理
|
||||
*
|
||||
* @param id 共创管理-留言管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCtLeaveMessageById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除共创管理-留言管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCtLeaveMessageByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
<?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.hzMapper.mapper.CtLeaveMessageMapper">
|
||||
|
||||
<resultMap type="CtLeaveMessage" id="CtLeaveMessageResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="source" column="source" />
|
||||
<result property="sourceName" column="source_name" />
|
||||
<result property="userImg" column="user_img" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="userPhone" column="user_phone" />
|
||||
<result property="messageInfo" column="message_info" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCtLeaveMessageVo">
|
||||
select id, source, source_name, user_img, user_name, user_phone, message_info, create_time from ct_leave_message
|
||||
</sql>
|
||||
|
||||
<select id="selectCtLeaveMessageList" parameterType="CtLeaveMessage" resultMap="CtLeaveMessageResult">
|
||||
<include refid="selectCtLeaveMessageVo"/>
|
||||
<where>
|
||||
<if test="source != null "> and source = #{source}</if>
|
||||
<if test="sourceName != null and sourceName != ''"> and source_name like concat('%', #{sourceName}, '%')</if>
|
||||
<if test="userImg != null and userImg != ''"> and user_img = #{userImg}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="userPhone != null and userPhone != ''"> and user_phone = #{userPhone}</if>
|
||||
<if test="messageInfo != null and messageInfo != ''"> and message_info = #{messageInfo}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCtLeaveMessageById" parameterType="Long" resultMap="CtLeaveMessageResult">
|
||||
<include refid="selectCtLeaveMessageVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCtLeaveMessage" parameterType="CtLeaveMessage" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ct_leave_message
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="source != null">source,</if>
|
||||
<if test="sourceName != null">source_name,</if>
|
||||
<if test="userImg != null">user_img,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="userPhone != null">user_phone,</if>
|
||||
<if test="messageInfo != null">message_info,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="source != null">#{source},</if>
|
||||
<if test="sourceName != null">#{sourceName},</if>
|
||||
<if test="userImg != null">#{userImg},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="userPhone != null">#{userPhone},</if>
|
||||
<if test="messageInfo != null">#{messageInfo},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCtLeaveMessage" parameterType="CtLeaveMessage">
|
||||
update ct_leave_message
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="source != null">source = #{source},</if>
|
||||
<if test="sourceName != null">source_name = #{sourceName},</if>
|
||||
<if test="userImg != null">user_img = #{userImg},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="userPhone != null">user_phone = #{userPhone},</if>
|
||||
<if test="messageInfo != null">message_info = #{messageInfo},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCtLeaveMessageById" parameterType="Long">
|
||||
delete from ct_leave_message where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCtLeaveMessageByIds" parameterType="String">
|
||||
delete from ct_leave_message where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,105 @@
|
||||
package com.flossom.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
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 com.flossom.hzMapper.domain.CtLeaveMessage;
|
||||
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.ICtLeaveMessageService;
|
||||
/**
|
||||
* 共创管理-留言管理Controller
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/leaveMessage")
|
||||
public class CtLeaveMessageController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICtLeaveMessageService ctLeaveMessageService;
|
||||
|
||||
/**
|
||||
* 查询共创管理-留言管理列表
|
||||
*/
|
||||
@RequiresPermissions("system:leaveMessage:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CtLeaveMessage ctLeaveMessage)
|
||||
{
|
||||
startPage();
|
||||
List<CtLeaveMessage> list = ctLeaveMessageService.selectCtLeaveMessageList(ctLeaveMessage);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出共创管理-留言管理列表
|
||||
*/
|
||||
@RequiresPermissions("system:leaveMessage:export")
|
||||
@Log(title = "共创管理-留言管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CtLeaveMessage ctLeaveMessage)
|
||||
{
|
||||
List<CtLeaveMessage> list = ctLeaveMessageService.selectCtLeaveMessageList(ctLeaveMessage);
|
||||
ExcelUtil<CtLeaveMessage> util = new ExcelUtil<CtLeaveMessage>(CtLeaveMessage.class);
|
||||
util.exportExcel(response, list, "共创管理-留言管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取共创管理-留言管理详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:leaveMessage:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(ctLeaveMessageService.selectCtLeaveMessageById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增共创管理-留言管理
|
||||
*/
|
||||
@RequiresPermissions("system:leaveMessage:add")
|
||||
@Log(title = "共创管理-留言管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CtLeaveMessage ctLeaveMessage)
|
||||
{
|
||||
return toAjax(ctLeaveMessageService.insertCtLeaveMessage(ctLeaveMessage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改共创管理-留言管理
|
||||
*/
|
||||
@RequiresPermissions("system:leaveMessage:edit")
|
||||
@Log(title = "共创管理-留言管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CtLeaveMessage ctLeaveMessage)
|
||||
{
|
||||
return toAjax(ctLeaveMessageService.updateCtLeaveMessage(ctLeaveMessage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除共创管理-留言管理
|
||||
*/
|
||||
@RequiresPermissions("system:leaveMessage:remove")
|
||||
@Log(title = "共创管理-留言管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(ctLeaveMessageService.deleteCtLeaveMessageByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.flossom.system.service;
|
||||
|
||||
import com.flossom.hzMapper.domain.CtLeaveMessage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 共创管理-留言管理Service接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
public interface ICtLeaveMessageService
|
||||
{
|
||||
/**
|
||||
* 查询共创管理-留言管理
|
||||
*
|
||||
* @param id 共创管理-留言管理主键
|
||||
* @return 共创管理-留言管理
|
||||
*/
|
||||
public CtLeaveMessage selectCtLeaveMessageById(Long id);
|
||||
|
||||
/**
|
||||
* 查询共创管理-留言管理列表
|
||||
*
|
||||
* @param ctLeaveMessage 共创管理-留言管理
|
||||
* @return 共创管理-留言管理集合
|
||||
*/
|
||||
public List<CtLeaveMessage> selectCtLeaveMessageList(CtLeaveMessage ctLeaveMessage);
|
||||
|
||||
/**
|
||||
* 新增共创管理-留言管理
|
||||
*
|
||||
* @param ctLeaveMessage 共创管理-留言管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCtLeaveMessage(CtLeaveMessage ctLeaveMessage);
|
||||
|
||||
/**
|
||||
* 修改共创管理-留言管理
|
||||
*
|
||||
* @param ctLeaveMessage 共创管理-留言管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCtLeaveMessage(CtLeaveMessage ctLeaveMessage);
|
||||
|
||||
/**
|
||||
* 批量删除共创管理-留言管理
|
||||
*
|
||||
* @param ids 需要删除的共创管理-留言管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCtLeaveMessageByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除共创管理-留言管理信息
|
||||
*
|
||||
* @param id 共创管理-留言管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCtLeaveMessageById(Long id);
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
package com.flossom.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.flossom.common.core.utils.DateUtils;
|
||||
import com.flossom.hzMapper.domain.CtLeaveMessage;
|
||||
import com.flossom.hzMapper.mapper.CtLeaveMessageMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.flossom.system.service.ICtLeaveMessageService;
|
||||
|
||||
/**
|
||||
* 共创管理-留言管理Service业务层处理
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-11
|
||||
*/
|
||||
@Service
|
||||
public class CtLeaveMessageServiceImpl implements ICtLeaveMessageService
|
||||
{
|
||||
@Autowired
|
||||
private CtLeaveMessageMapper ctLeaveMessageMapper;
|
||||
|
||||
/**
|
||||
* 查询共创管理-留言管理
|
||||
*
|
||||
* @param id 共创管理-留言管理主键
|
||||
* @return 共创管理-留言管理
|
||||
*/
|
||||
@Override
|
||||
public CtLeaveMessage selectCtLeaveMessageById(Long id)
|
||||
{
|
||||
return ctLeaveMessageMapper.selectCtLeaveMessageById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询共创管理-留言管理列表
|
||||
*
|
||||
* @param ctLeaveMessage 共创管理-留言管理
|
||||
* @return 共创管理-留言管理
|
||||
*/
|
||||
@Override
|
||||
public List<CtLeaveMessage> selectCtLeaveMessageList(CtLeaveMessage ctLeaveMessage)
|
||||
{
|
||||
return ctLeaveMessageMapper.selectCtLeaveMessageList(ctLeaveMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增共创管理-留言管理
|
||||
*
|
||||
* @param ctLeaveMessage 共创管理-留言管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCtLeaveMessage(CtLeaveMessage ctLeaveMessage)
|
||||
{
|
||||
ctLeaveMessage.setCreateTime(DateUtils.getNowDate());
|
||||
return ctLeaveMessageMapper.insertCtLeaveMessage(ctLeaveMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改共创管理-留言管理
|
||||
*
|
||||
* @param ctLeaveMessage 共创管理-留言管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCtLeaveMessage(CtLeaveMessage ctLeaveMessage)
|
||||
{
|
||||
return ctLeaveMessageMapper.updateCtLeaveMessage(ctLeaveMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除共创管理-留言管理
|
||||
*
|
||||
* @param ids 需要删除的共创管理-留言管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCtLeaveMessageByIds(Long[] ids)
|
||||
{
|
||||
return ctLeaveMessageMapper.deleteCtLeaveMessageByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除共创管理-留言管理信息
|
||||
*
|
||||
* @param id 共创管理-留言管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCtLeaveMessageById(Long id)
|
||||
{
|
||||
return ctLeaveMessageMapper.deleteCtLeaveMessageById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询共创管理-留言管理列表
|
||||
export function listMessage(query) {
|
||||
return request({
|
||||
url: '/system/leaveMessage/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询共创管理-留言管理详细
|
||||
export function getMessage(id) {
|
||||
return request({
|
||||
url: '/system/leaveMessage/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增共创管理-留言管理
|
||||
export function addMessage(data) {
|
||||
return request({
|
||||
url: '/system/leaveMessage',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改共创管理-留言管理
|
||||
export function updateMessage(data) {
|
||||
return request({
|
||||
url: '/system/leaveMessage',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除共创管理-留言管理
|
||||
export function delMessage(id) {
|
||||
return request({
|
||||
url: '/system/leaveMessage/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,308 @@
|
||||
<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="来源 1-我的模块 " prop="source">
|
||||
<el-input
|
||||
v-model="queryParams.source"
|
||||
placeholder="请输入来源 1-我的模块 "
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源名称" prop="sourceName">
|
||||
<el-input
|
||||
v-model="queryParams.sourceName"
|
||||
placeholder="请输入来源名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户头像" prop="userImg">
|
||||
<el-input
|
||||
v-model="queryParams.userImg"
|
||||
placeholder="请输入用户头像"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户昵称" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入用户昵称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户手机号码" prop="userPhone">
|
||||
<el-input
|
||||
v-model="queryParams.userPhone"
|
||||
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="['system:leaveMessage: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="['system:leaveMessage: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="['system:leaveMessage: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="['system:leaveMessage:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="messageList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键ID" align="center" prop="id" />
|
||||
<el-table-column label="来源 1-我的模块 " align="center" prop="source" />
|
||||
<el-table-column label="来源名称" align="center" prop="sourceName" />
|
||||
<el-table-column label="用户头像" align="center" prop="userImg" />
|
||||
<el-table-column label="用户昵称" align="center" prop="userName" />
|
||||
<el-table-column label="用户手机号码" align="center" prop="userPhone" />
|
||||
<el-table-column label="用户留言" align="center" prop="messageInfo" />
|
||||
<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="['system:leaveMessage:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:leaveMessage: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="来源 1-我的模块 " prop="source">
|
||||
<el-input v-model="form.source" placeholder="请输入来源 1-我的模块 " />
|
||||
</el-form-item>
|
||||
<el-form-item label="来源名称" prop="sourceName">
|
||||
<el-input v-model="form.sourceName" placeholder="请输入来源名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户头像" prop="userImg">
|
||||
<el-input v-model="form.userImg" placeholder="请输入用户头像" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户昵称" prop="userName">
|
||||
<el-input v-model="form.userName" placeholder="请输入用户昵称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户手机号码" prop="userPhone">
|
||||
<el-input v-model="form.userPhone" placeholder="请输入用户手机号码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户留言" prop="messageInfo">
|
||||
<el-input v-model="form.messageInfo" type="textarea" 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 { listMessage, getMessage, delMessage, addMessage, updateMessage } from "@/api/system/leaveMessage";
|
||||
|
||||
export default {
|
||||
name: "Message",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 共创管理-留言管理表格数据
|
||||
messageList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
source: null,
|
||||
sourceName: null,
|
||||
userImg: null,
|
||||
userName: null,
|
||||
userPhone: null,
|
||||
messageInfo: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询共创管理-留言管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listMessage(this.queryParams).then(response => {
|
||||
this.messageList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
source: null,
|
||||
sourceName: null,
|
||||
userImg: null,
|
||||
userName: null,
|
||||
userPhone: null,
|
||||
messageInfo: null,
|
||||
createTime: 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
|
||||
getMessage(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) {
|
||||
updateMessage(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addMessage(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 delMessage(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/message/export', {
|
||||
...this.queryParams
|
||||
}, `message_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue