Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104
commit
b2ae61316e
@ -0,0 +1,67 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 活动渠道信息对象 activity_channel_info
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-20
|
||||
*/
|
||||
public class ActivityChannelInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 渠道ID */
|
||||
private Long id;
|
||||
|
||||
/** 渠道类型 */
|
||||
@Excel(name = "渠道类型")
|
||||
private Integer channelType;
|
||||
|
||||
/** 渠道名称 */
|
||||
@Excel(name = "渠道名称")
|
||||
private String channelName;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setChannelType(Integer channelType)
|
||||
{
|
||||
this.channelType = channelType;
|
||||
}
|
||||
|
||||
public Integer getChannelType()
|
||||
{
|
||||
return channelType;
|
||||
}
|
||||
public void setChannelName(String channelName)
|
||||
{
|
||||
this.channelName = channelName;
|
||||
}
|
||||
|
||||
public String getChannelName()
|
||||
{
|
||||
return channelName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("channelType", getChannelType())
|
||||
.append("channelName", getChannelName())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.flossom.common.core.mapper;
|
||||
|
||||
import com.flossom.common.core.domain.entity.ActivityChannelInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 活动渠道信息Mapper接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-20
|
||||
*/
|
||||
public interface ActivityChannelInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询活动渠道信息
|
||||
*
|
||||
* @param id 活动渠道信息主键
|
||||
* @return 活动渠道信息
|
||||
*/
|
||||
public ActivityChannelInfo selectActivityChannelInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询活动渠道信息列表
|
||||
*
|
||||
* @param activityChannelInfo 活动渠道信息
|
||||
* @return 活动渠道信息集合
|
||||
*/
|
||||
public List<ActivityChannelInfo> selectActivityChannelInfoList(ActivityChannelInfo activityChannelInfo);
|
||||
|
||||
/**
|
||||
* 新增活动渠道信息
|
||||
*
|
||||
* @param activityChannelInfo 活动渠道信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertActivityChannelInfo(ActivityChannelInfo activityChannelInfo);
|
||||
|
||||
/**
|
||||
* 修改活动渠道信息
|
||||
*
|
||||
* @param activityChannelInfo 活动渠道信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateActivityChannelInfo(ActivityChannelInfo activityChannelInfo);
|
||||
|
||||
/**
|
||||
* 删除活动渠道信息
|
||||
*
|
||||
* @param id 活动渠道信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteActivityChannelInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除活动渠道信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteActivityChannelInfoByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
<?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.ActivityChannelInfoMapper">
|
||||
|
||||
<resultMap type="ActivityChannelInfo" id="ActivityChannelInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="channelType" column="channel_type" />
|
||||
<result property="channelName" column="channel_name" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectActivityChannelInfoVo">
|
||||
select id, channel_type, channel_name, create_time, create_by from activity_channel_info
|
||||
</sql>
|
||||
|
||||
<select id="selectActivityChannelInfoList" parameterType="ActivityChannelInfo" resultMap="ActivityChannelInfoResult">
|
||||
<include refid="selectActivityChannelInfoVo"/>
|
||||
<where>
|
||||
<if test="channelType != null "> and channel_type = #{channelType}</if>
|
||||
<if test="channelName != null and channelName != ''"> and channel_name like concat('%', #{channelName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectActivityChannelInfoById" parameterType="Long" resultMap="ActivityChannelInfoResult">
|
||||
<include refid="selectActivityChannelInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertActivityChannelInfo" parameterType="ActivityChannelInfo">
|
||||
insert into activity_channel_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="channelType != null">channel_type,</if>
|
||||
<if test="channelName != null">channel_name,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="channelType != null">#{channelType},</if>
|
||||
<if test="channelName != null">#{channelName},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateActivityChannelInfo" parameterType="ActivityChannelInfo">
|
||||
update activity_channel_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="channelType != null">channel_type = #{channelType},</if>
|
||||
<if test="channelName != null">channel_name = #{channelName},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteActivityChannelInfoById" parameterType="Long">
|
||||
delete from activity_channel_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteActivityChannelInfoByIds" parameterType="String">
|
||||
delete from activity_channel_info 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.ActivityChannelInfo;
|
||||
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.IActivityChannelInfoService;
|
||||
|
||||
/**
|
||||
* 活动渠道信息Controller
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/channelInfo")
|
||||
public class ActivityChannelInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IActivityChannelInfoService activityChannelInfoService;
|
||||
|
||||
/**
|
||||
* 查询活动渠道信息列表
|
||||
*/
|
||||
@RequiresPermissions("system:channelInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ActivityChannelInfo activityChannelInfo)
|
||||
{
|
||||
startPage();
|
||||
List<ActivityChannelInfo> list = activityChannelInfoService.selectActivityChannelInfoList(activityChannelInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出活动渠道信息列表
|
||||
*/
|
||||
@RequiresPermissions("system:channelInfo:export")
|
||||
@Log(title = "活动渠道信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ActivityChannelInfo activityChannelInfo)
|
||||
{
|
||||
List<ActivityChannelInfo> list = activityChannelInfoService.selectActivityChannelInfoList(activityChannelInfo);
|
||||
ExcelUtil<ActivityChannelInfo> util = new ExcelUtil<ActivityChannelInfo>(ActivityChannelInfo.class);
|
||||
util.exportExcel(response, list, "活动渠道信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活动渠道信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:channelInfo:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(activityChannelInfoService.selectActivityChannelInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增活动渠道信息
|
||||
*/
|
||||
@RequiresPermissions("system:channelInfo:add")
|
||||
@Log(title = "活动渠道信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ActivityChannelInfo activityChannelInfo)
|
||||
{
|
||||
return toAjax(activityChannelInfoService.insertActivityChannelInfo(activityChannelInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改活动渠道信息
|
||||
*/
|
||||
@RequiresPermissions("system:channelInfo:edit")
|
||||
@Log(title = "活动渠道信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ActivityChannelInfo activityChannelInfo)
|
||||
{
|
||||
return toAjax(activityChannelInfoService.updateActivityChannelInfo(activityChannelInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除活动渠道信息
|
||||
*/
|
||||
@RequiresPermissions("system:channelInfo:remove")
|
||||
@Log(title = "活动渠道信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(activityChannelInfoService.deleteActivityChannelInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package com.flossom.system.service;
|
||||
|
||||
import com.flossom.common.core.domain.entity.ActivityChannelInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 活动渠道信息Service接口
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-20
|
||||
*/
|
||||
public interface IActivityChannelInfoService
|
||||
{
|
||||
/**
|
||||
* 查询活动渠道信息
|
||||
*
|
||||
* @param id 活动渠道信息主键
|
||||
* @return 活动渠道信息
|
||||
*/
|
||||
public ActivityChannelInfo selectActivityChannelInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询活动渠道信息列表
|
||||
*
|
||||
* @param activityChannelInfo 活动渠道信息
|
||||
* @return 活动渠道信息集合
|
||||
*/
|
||||
public List<ActivityChannelInfo> selectActivityChannelInfoList(ActivityChannelInfo activityChannelInfo);
|
||||
|
||||
/**
|
||||
* 新增活动渠道信息
|
||||
*
|
||||
* @param activityChannelInfo 活动渠道信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertActivityChannelInfo(ActivityChannelInfo activityChannelInfo);
|
||||
|
||||
/**
|
||||
* 修改活动渠道信息
|
||||
*
|
||||
* @param activityChannelInfo 活动渠道信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateActivityChannelInfo(ActivityChannelInfo activityChannelInfo);
|
||||
|
||||
/**
|
||||
* 批量删除活动渠道信息
|
||||
*
|
||||
* @param ids 需要删除的活动渠道信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteActivityChannelInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除活动渠道信息信息
|
||||
*
|
||||
* @param id 活动渠道信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteActivityChannelInfoById(Long id);
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
package com.flossom.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.flossom.common.core.domain.entity.ActivityChannelInfo;
|
||||
import com.flossom.common.core.mapper.ActivityChannelInfoMapper;
|
||||
import com.flossom.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.flossom.system.service.IActivityChannelInfoService;
|
||||
|
||||
/**
|
||||
* 活动渠道信息Service业务层处理
|
||||
*
|
||||
* @author flossom
|
||||
* @date 2023-12-20
|
||||
*/
|
||||
@Service
|
||||
public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoService
|
||||
{
|
||||
@Autowired
|
||||
private ActivityChannelInfoMapper activityChannelInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询活动渠道信息
|
||||
*
|
||||
* @param id 活动渠道信息主键
|
||||
* @return 活动渠道信息
|
||||
*/
|
||||
@Override
|
||||
public ActivityChannelInfo selectActivityChannelInfoById(Long id)
|
||||
{
|
||||
return activityChannelInfoMapper.selectActivityChannelInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询活动渠道信息列表
|
||||
*
|
||||
* @param activityChannelInfo 活动渠道信息
|
||||
* @return 活动渠道信息
|
||||
*/
|
||||
@Override
|
||||
public List<ActivityChannelInfo> selectActivityChannelInfoList(ActivityChannelInfo activityChannelInfo)
|
||||
{
|
||||
return activityChannelInfoMapper.selectActivityChannelInfoList(activityChannelInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增活动渠道信息
|
||||
*
|
||||
* @param activityChannelInfo 活动渠道信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertActivityChannelInfo(ActivityChannelInfo activityChannelInfo)
|
||||
{
|
||||
activityChannelInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return activityChannelInfoMapper.insertActivityChannelInfo(activityChannelInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改活动渠道信息
|
||||
*
|
||||
* @param activityChannelInfo 活动渠道信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateActivityChannelInfo(ActivityChannelInfo activityChannelInfo)
|
||||
{
|
||||
return activityChannelInfoMapper.updateActivityChannelInfo(activityChannelInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除活动渠道信息
|
||||
*
|
||||
* @param ids 需要删除的活动渠道信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteActivityChannelInfoByIds(Long[] ids)
|
||||
{
|
||||
return activityChannelInfoMapper.deleteActivityChannelInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除活动渠道信息信息
|
||||
*
|
||||
* @param id 活动渠道信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteActivityChannelInfoById(Long id)
|
||||
{
|
||||
return activityChannelInfoMapper.deleteActivityChannelInfoById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询【请填写功能名称】列表
|
||||
export function listInfo(query) {
|
||||
return request({
|
||||
url: '/system/channelInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询【请填写功能名称】详细
|
||||
export function getInfo(id) {
|
||||
return request({
|
||||
url: '/system/channelInfo/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增【请填写功能名称】
|
||||
export function addInfo(data) {
|
||||
return request({
|
||||
url: '/system/channelInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改【请填写功能名称】
|
||||
export function updateInfo(data) {
|
||||
return request({
|
||||
url: '/system/channelInfo',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除【请填写功能名称】
|
||||
export function delInfo(id) {
|
||||
return request({
|
||||
url: '/system/channelInfo/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,249 @@
|
||||
<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="channelName">
|
||||
<el-input
|
||||
v-model="queryParams.channelName"
|
||||
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:channelInfo: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:channelInfo: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:channelInfo: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:channelInfo:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="渠道类型" align="center" prop="channelType" />
|
||||
<el-table-column label="渠道名称" align="center" prop="channelName" />
|
||||
<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:channelInfo:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:channelInfo: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="channelName">
|
||||
<el-input v-model="form.channelName" 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 { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/system/channelInfo";
|
||||
|
||||
export default {
|
||||
name: "Info",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 仪器渠道表格数据
|
||||
infoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
channelType: null,
|
||||
channelName: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询仪器渠道列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listInfo(this.queryParams).then(response => {
|
||||
this.infoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
channelType: null,
|
||||
channelName: null,
|
||||
createTime: null,
|
||||
createBy: 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
|
||||
getInfo(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) {
|
||||
updateInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addInfo(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 delInfo(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/info/export', {
|
||||
...this.queryParams
|
||||
}, `info_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue