Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104
commit
734f21eee6
@ -0,0 +1,62 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxScriptMessage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消息模版Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-22
|
||||
*/
|
||||
public interface WxScriptMessageMapper
|
||||
{
|
||||
/**
|
||||
* 查询消息模版
|
||||
*
|
||||
* @param id 消息模版主键
|
||||
* @return 消息模版
|
||||
*/
|
||||
public WxScriptMessage selectWxScriptMessageById(Long id);
|
||||
|
||||
/**
|
||||
* 查询消息模版列表
|
||||
*
|
||||
* @param wxScriptMessage 消息模版
|
||||
* @return 消息模版集合
|
||||
*/
|
||||
public List<WxScriptMessage> selectWxScriptMessageList(WxScriptMessage wxScriptMessage);
|
||||
|
||||
/**
|
||||
* 新增消息模版
|
||||
*
|
||||
* @param wxScriptMessage 消息模版
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxScriptMessage(WxScriptMessage wxScriptMessage);
|
||||
|
||||
/**
|
||||
* 修改消息模版
|
||||
*
|
||||
* @param wxScriptMessage 消息模版
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxScriptMessage(WxScriptMessage wxScriptMessage);
|
||||
|
||||
/**
|
||||
* 删除消息模版
|
||||
*
|
||||
* @param id 消息模版主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxScriptMessageById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除消息模版
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxScriptMessageByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,134 @@
|
||||
<?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.WxScriptMessageMapper">
|
||||
|
||||
<resultMap type="WxScriptMessage" id="WxScriptMessageResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="messageType" column="message_type" />
|
||||
<result property="messageTitle" column="message_title" />
|
||||
<result property="machineId" column="machine_id" />
|
||||
<result property="machineName" column="machine_name" />
|
||||
<result property="messageContent" column="message_content" />
|
||||
<result property="status" column="status" />
|
||||
<result property="type" column="type" />
|
||||
<result property="link" column="link" />
|
||||
<result property="linkParams" column="link_params" />
|
||||
<result property="redirectAppid" column="redirect_appid" />
|
||||
<result property="redirectUrl" column="redirect_url" />
|
||||
<result property="videoNo" column="video_no" />
|
||||
<result property="feedId" column="feed_id" />
|
||||
<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="selectWxScriptMessageVo">
|
||||
select id, message_type, message_title, machine_id, machine_name, message_content, status, type, link, link_params, redirect_appid, redirect_url, video_no, feed_id, create_by, create_time, update_by, update_time from wx_script_message
|
||||
</sql>
|
||||
|
||||
<select id="selectWxScriptMessageList" parameterType="WxScriptMessage" resultMap="WxScriptMessageResult">
|
||||
<include refid="selectWxScriptMessageVo"/>
|
||||
<where>
|
||||
<if test="messageType != null "> and message_type = #{messageType}</if>
|
||||
<if test="messageTitle != null and messageTitle != ''"> and message_title = #{messageTitle}</if>
|
||||
<if test="machineId != null "> and machine_id = #{machineId}</if>
|
||||
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if>
|
||||
<if test="messageContent != null and messageContent != ''"> and message_content = #{messageContent}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="type != null "> and type = #{type}</if>
|
||||
<if test="link != null and link != ''"> and link = #{link}</if>
|
||||
<if test="linkParams != null and linkParams != ''"> and link_params = #{linkParams}</if>
|
||||
<if test="redirectAppid != null and redirectAppid != ''"> and redirect_appid = #{redirectAppid}</if>
|
||||
<if test="redirectUrl != null and redirectUrl != ''"> and redirect_url = #{redirectUrl}</if>
|
||||
<if test="videoNo != null and videoNo != ''"> and video_no = #{videoNo}</if>
|
||||
<if test="feedId != null and feedId != ''"> and feed_id = #{feedId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWxScriptMessageById" parameterType="Long" resultMap="WxScriptMessageResult">
|
||||
<include refid="selectWxScriptMessageVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWxScriptMessage" parameterType="WxScriptMessage">
|
||||
insert into wx_script_message
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="messageType != null">message_type,</if>
|
||||
<if test="messageTitle != null">message_title,</if>
|
||||
<if test="machineId != null">machine_id,</if>
|
||||
<if test="machineName != null">machine_name,</if>
|
||||
<if test="messageContent != null">message_content,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="link != null">link,</if>
|
||||
<if test="linkParams != null">link_params,</if>
|
||||
<if test="redirectAppid != null">redirect_appid,</if>
|
||||
<if test="redirectUrl != null">redirect_url,</if>
|
||||
<if test="videoNo != null">video_no,</if>
|
||||
<if test="feedId != null">feed_id,</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="id != null">#{id},</if>
|
||||
<if test="messageType != null">#{messageType},</if>
|
||||
<if test="messageTitle != null">#{messageTitle},</if>
|
||||
<if test="machineId != null">#{machineId},</if>
|
||||
<if test="machineName != null">#{machineName},</if>
|
||||
<if test="messageContent != null">#{messageContent},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="link != null">#{link},</if>
|
||||
<if test="linkParams != null">#{linkParams},</if>
|
||||
<if test="redirectAppid != null">#{redirectAppid},</if>
|
||||
<if test="redirectUrl != null">#{redirectUrl},</if>
|
||||
<if test="videoNo != null">#{videoNo},</if>
|
||||
<if test="feedId != null">#{feedId},</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="updateWxScriptMessage" parameterType="WxScriptMessage">
|
||||
update wx_script_message
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="messageType != null">message_type = #{messageType},</if>
|
||||
<if test="messageTitle != null">message_title = #{messageTitle},</if>
|
||||
<if test="machineId != null">machine_id = #{machineId},</if>
|
||||
<if test="machineName != null">machine_name = #{machineName},</if>
|
||||
<if test="messageContent != null">message_content = #{messageContent},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="link != null">link = #{link},</if>
|
||||
<if test="linkParams != null">link_params = #{linkParams},</if>
|
||||
<if test="redirectAppid != null">redirect_appid = #{redirectAppid},</if>
|
||||
<if test="redirectUrl != null">redirect_url = #{redirectUrl},</if>
|
||||
<if test="videoNo != null">video_no = #{videoNo},</if>
|
||||
<if test="feedId != null">feed_id = #{feedId},</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="deleteWxScriptMessageById" parameterType="Long">
|
||||
delete from wx_script_message where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWxScriptMessageByIds" parameterType="String">
|
||||
delete from wx_script_message 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.WxScriptMessage;
|
||||
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.IWxScriptMessageService;
|
||||
|
||||
/**
|
||||
* 消息模版Controller
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/scriptMessage")
|
||||
public class WxScriptMessageController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWxScriptMessageService wxScriptMessageService;
|
||||
|
||||
/**
|
||||
* 查询消息模版列表
|
||||
*/
|
||||
@RequiresPermissions("system:scriptMessage:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WxScriptMessage wxScriptMessage)
|
||||
{
|
||||
startPage();
|
||||
List<WxScriptMessage> list = wxScriptMessageService.selectWxScriptMessageList(wxScriptMessage);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出消息模版列表
|
||||
*/
|
||||
@RequiresPermissions("system:scriptMessage:export")
|
||||
@Log(title = "消息模版", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WxScriptMessage wxScriptMessage)
|
||||
{
|
||||
List<WxScriptMessage> list = wxScriptMessageService.selectWxScriptMessageList(wxScriptMessage);
|
||||
ExcelUtil<WxScriptMessage> util = new ExcelUtil<WxScriptMessage>(WxScriptMessage.class);
|
||||
util.exportExcel(response, list, "消息模版数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取消息模版详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:scriptMessage:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(wxScriptMessageService.selectWxScriptMessageById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增消息模版
|
||||
*/
|
||||
@RequiresPermissions("system:scriptMessage:add")
|
||||
@Log(title = "消息模版", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WxScriptMessage wxScriptMessage)
|
||||
{
|
||||
return toAjax(wxScriptMessageService.insertWxScriptMessage(wxScriptMessage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改消息模版
|
||||
*/
|
||||
@RequiresPermissions("system:scriptMessage:edit")
|
||||
@Log(title = "消息模版", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WxScriptMessage wxScriptMessage)
|
||||
{
|
||||
return toAjax(wxScriptMessageService.updateWxScriptMessage(wxScriptMessage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除消息模版
|
||||
*/
|
||||
@RequiresPermissions("system:scriptMessage:remove")
|
||||
@Log(title = "消息模版", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(wxScriptMessageService.deleteWxScriptMessageByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.flossom.system.service;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxScriptMessage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 消息模版Service接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-22
|
||||
*/
|
||||
public interface IWxScriptMessageService
|
||||
{
|
||||
/**
|
||||
* 查询消息模版
|
||||
*
|
||||
* @param id 消息模版主键
|
||||
* @return 消息模版
|
||||
*/
|
||||
public WxScriptMessage selectWxScriptMessageById(Long id);
|
||||
|
||||
/**
|
||||
* 查询消息模版列表
|
||||
*
|
||||
* @param wxScriptMessage 消息模版
|
||||
* @return 消息模版集合
|
||||
*/
|
||||
public List<WxScriptMessage> selectWxScriptMessageList(WxScriptMessage wxScriptMessage);
|
||||
|
||||
/**
|
||||
* 新增消息模版
|
||||
*
|
||||
* @param wxScriptMessage 消息模版
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWxScriptMessage(WxScriptMessage wxScriptMessage);
|
||||
|
||||
/**
|
||||
* 修改消息模版
|
||||
*
|
||||
* @param wxScriptMessage 消息模版
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWxScriptMessage(WxScriptMessage wxScriptMessage);
|
||||
|
||||
/**
|
||||
* 批量删除消息模版
|
||||
*
|
||||
* @param ids 需要删除的消息模版主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxScriptMessageByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除消息模版信息
|
||||
*
|
||||
* @param id 消息模版主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWxScriptMessageById(Long id);
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package com.flossom.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.flossom.common.core.domain.entity.WxScriptMessage;
|
||||
import com.flossom.common.core.mapper.WxScriptMessageMapper;
|
||||
import com.flossom.common.core.utils.DateUtils;
|
||||
import com.flossom.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.flossom.system.service.IWxScriptMessageService;
|
||||
|
||||
/**
|
||||
* 消息模版Service业务层处理
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-22
|
||||
*/
|
||||
@Service
|
||||
public class WxScriptMessageServiceImpl implements IWxScriptMessageService
|
||||
{
|
||||
@Autowired
|
||||
private WxScriptMessageMapper wxScriptMessageMapper;
|
||||
|
||||
/**
|
||||
* 查询消息模版
|
||||
*
|
||||
* @param id 消息模版主键
|
||||
* @return 消息模版
|
||||
*/
|
||||
@Override
|
||||
public WxScriptMessage selectWxScriptMessageById(Long id)
|
||||
{
|
||||
return wxScriptMessageMapper.selectWxScriptMessageById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询消息模版列表
|
||||
*
|
||||
* @param wxScriptMessage 消息模版
|
||||
* @return 消息模版
|
||||
*/
|
||||
@Override
|
||||
public List<WxScriptMessage> selectWxScriptMessageList(WxScriptMessage wxScriptMessage)
|
||||
{
|
||||
return wxScriptMessageMapper.selectWxScriptMessageList(wxScriptMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增消息模版
|
||||
*
|
||||
* @param wxScriptMessage 消息模版
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWxScriptMessage(WxScriptMessage wxScriptMessage)
|
||||
{
|
||||
wxScriptMessage.setCreateTime(DateUtils.getNowDate());
|
||||
wxScriptMessage.setCreateBy(SecurityUtils.getUsername());
|
||||
return wxScriptMessageMapper.insertWxScriptMessage(wxScriptMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改消息模版
|
||||
*
|
||||
* @param wxScriptMessage 消息模版
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWxScriptMessage(WxScriptMessage wxScriptMessage)
|
||||
{
|
||||
wxScriptMessage.setUpdateTime(DateUtils.getNowDate());
|
||||
wxScriptMessage.setUpdateBy(SecurityUtils.getUsername());
|
||||
return wxScriptMessageMapper.updateWxScriptMessage(wxScriptMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除消息模版
|
||||
*
|
||||
* @param ids 需要删除的消息模版主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWxScriptMessageByIds(Long[] ids)
|
||||
{
|
||||
return wxScriptMessageMapper.deleteWxScriptMessageByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除消息模版信息
|
||||
*
|
||||
* @param id 消息模版主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWxScriptMessageById(Long id)
|
||||
{
|
||||
return wxScriptMessageMapper.deleteWxScriptMessageById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询消息模版列表
|
||||
export function listMessage(query) {
|
||||
return request({
|
||||
url: '/system/scriptMessage/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询消息模版详细
|
||||
export function getMessage(id) {
|
||||
return request({
|
||||
url: '/system/scriptMessage/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增消息模版
|
||||
export function addMessage(data) {
|
||||
return request({
|
||||
url: '/system/scriptMessage',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改消息模版
|
||||
export function updateMessage(data) {
|
||||
return request({
|
||||
url: '/system/scriptMessage',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除消息模版
|
||||
export function delMessage(id) {
|
||||
return request({
|
||||
url: '/system/scriptMessage/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,477 @@
|
||||
<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="messageTitle">
|
||||
<el-input
|
||||
v-model="queryParams.messageTitle"
|
||||
placeholder="请输入消息标题"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="仪器ID" prop="machineId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.machineId"-->
|
||||
<!-- placeholder="请输入仪器ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="仪器名字" prop="machineName">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.machineName"-->
|
||||
<!-- placeholder="请输入仪器名字"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="跳转链接" prop="link">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.link"-->
|
||||
<!-- placeholder="请输入跳转链接"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="跳转链接参数" prop="linkParams">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.linkParams"-->
|
||||
<!-- placeholder="请输入跳转链接参数"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="外链小程序appid" prop="redirectAppid">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.redirectAppid"-->
|
||||
<!-- placeholder="请输入外链小程序appid"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="外链小程序url" prop="redirectUrl">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.redirectUrl"-->
|
||||
<!-- placeholder="请输入外链小程序url"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="视频号" prop="videoNo">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.videoNo"-->
|
||||
<!-- placeholder="请输入视频号"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="视频号feedId" prop="feedId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.feedId"-->
|
||||
<!-- placeholder="请输入视频号feedId"-->
|
||||
<!-- 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:scriptMessage: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:scriptMessage: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:scriptMessage: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:scriptMessage: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="序号" align="center" prop="id" />
|
||||
<el-table-column label="消息类型" align="center" prop="messageType" >
|
||||
<template slot-scope="scope">
|
||||
<span v-show="scope.row.messageType == 1">用户注册</span>
|
||||
<span v-show="scope.row.messageType == 2">提交留言</span>
|
||||
<span v-show="scope.row.messageType == 3">仪器绑定</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="消息标题" align="center" prop="messageTitle" />
|
||||
<el-table-column label="状态" align="center" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<span v-show="scope.row.status == 1">关闭</span>
|
||||
<span v-show="scope.row.status == 0">开启</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="消息内容" align="center" prop="messageContent" />
|
||||
<el-table-column label="更新人" align="center" prop="updateBy" />
|
||||
<el-table-column label="更新时间" align="center" prop="createTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.updateTime,'{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" align="center" prop="createBy" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime,'{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</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="['system:scriptMessage:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:scriptMessage:remove']"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-s-tools"
|
||||
@click="closeStatus(scope.row, 0)"
|
||||
v-if="scope.row.status==1"
|
||||
v-hasPermi="['system:siteInfo:edit']"
|
||||
>开启弹窗</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-s-tools"
|
||||
v-if="scope.row.status==0"
|
||||
@click="closeStatus(scope.row, 1)"
|
||||
v-hasPermi="['system:siteInfo:edit']"
|
||||
>关闭弹窗</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="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span = "12">
|
||||
<el-form-item label="消息类型" prop="messageType">
|
||||
<el-select v-model="form.messageType">
|
||||
<el-option label="用户注册" :value="1" :key="1"></el-option>
|
||||
<el-option label="提交留言" :value="2" :key="2"></el-option>
|
||||
<el-option label="仪器绑定" :value="3" :key="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span = "12">
|
||||
<el-form-item label="消息是否开启" prop="status" label-width="120px">
|
||||
<el-switch
|
||||
v-model="form.status"
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="仪器信息" prop="userType" v-if="form.messageType == 3">
|
||||
<el-select v-model="form.machineId">
|
||||
<el-option label="仪器1" :value="0" :key="0"></el-option>
|
||||
<el-option label="仪器2" :value="1" :key="1"></el-option>
|
||||
<el-option label="仪器3" :value="2" :key="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="标题" prop="messageTitle">
|
||||
<el-input v-model="form.messageTitle" placeholder="请输入消息标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="消息内容">
|
||||
<editor v-model="form.messageContent" :min-height="192"/>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="跳转类型" prop="type">
|
||||
<el-select v-model="form.type">
|
||||
<el-option label="无跳转" :value="0" :key="0"></el-option>
|
||||
<el-option label="跳转内部链接" :value="1" :key="1"></el-option>
|
||||
<el-option label="跳转小程序" :value="4" :key="4"></el-option>
|
||||
<el-option label="跳转外部链接" :value="3" :key="3"></el-option>
|
||||
<el-option label="导向视频号" :value="5" :key="5"></el-option>
|
||||
<el-option label="导向视频号直播间" :value="6" :key="6"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="form.type == 1">
|
||||
<el-form-item label="内部链接" prop="link">
|
||||
<el-input v-model="form.link" placeholder="请输入内部链接" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="form.type == 1">
|
||||
<el-form-item label="跳转参数" prop="linkParams">
|
||||
<el-input v-model="form.linkParams" placeholder="请输入跳转参数" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="form.type == 3">
|
||||
<el-form-item label="外部链接" prop="link">
|
||||
<el-input v-model="form.link" placeholder="请输入外部链接" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="form.type == 4">
|
||||
<el-form-item label="APPID" prop="redirectAppid">
|
||||
<el-input v-model="form.redirectAppid" placeholder="请输入小程序APPID" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="form.type == 4" label-width="90px">
|
||||
<el-form-item label="页面链接" prop="redirectUrl">
|
||||
<el-input v-model="form.redirectUrl" placeholder="请输入页面链接" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="form.type == 5 || form.type == 6">
|
||||
<el-form-item label="视频号ID" prop="videoNo">
|
||||
<el-input v-model="form.videoNo" placeholder="请输入视频号ID" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="form.type == 5" label-width="90px">
|
||||
<el-form-item label="feedId" prop="feedId">
|
||||
<el-input v-model="form.feedId" placeholder="请输入视频号feedId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</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/scriptMessage";
|
||||
|
||||
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,
|
||||
messageType: null,
|
||||
messageTitle: null,
|
||||
machineId: null,
|
||||
machineName: null,
|
||||
messageContent: null,
|
||||
status: null,
|
||||
type: null,
|
||||
link: null,
|
||||
linkParams: null,
|
||||
redirectAppid: null,
|
||||
redirectUrl: null,
|
||||
videoNo: null,
|
||||
feedId: 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,
|
||||
messageType: null,
|
||||
messageTitle: null,
|
||||
machineId: null,
|
||||
machineName: null,
|
||||
messageContent: null,
|
||||
status: null,
|
||||
type: null,
|
||||
link: null,
|
||||
linkParams: null,
|
||||
redirectAppid: null,
|
||||
redirectUrl: null,
|
||||
videoNo: null,
|
||||
feedId: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 关闭开启状态
|
||||
closeStatus(row, status){
|
||||
row.status = status;
|
||||
updateMessage(row).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
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;
|
||||
if(this.form.status == 1) {
|
||||
this.form.status = false;
|
||||
} else {
|
||||
this.form.status = true;
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "修改消息模版";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if(this.form.status) {
|
||||
this.form.status = 0;
|
||||
} else {
|
||||
this.form.status = 1;
|
||||
}
|
||||
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