轮播模块开发

master
elliott 2 years ago
parent 4a04c42766
commit 4f38e551ee

@ -23,7 +23,9 @@ public class SiteInfo extends BaseEntity
/** 站点管理ID */
private Long id;
/** 类型 1-弹窗列表 2-轮播列表 */
@Excel(name = "类型 1-弹窗列表 2-轮播列表 ")
private Integer siteType;
/** 站点名称 */
@Excel(name = "站点名称")
private String siteName;
@ -132,6 +134,20 @@ public class SiteInfo extends BaseEntity
private String machineId;
private List<Long> machineArray = new ArrayList<Long>();
private String handlerCompanyTagId;
private List<Long> handlerCompanyTagArray = new ArrayList<Long>();
/** 获取企微标签 */
@Excel(name = "获取企微标签")
private String handlerCompanyTag;
@Excel(name = "获取小程序标签")
private String handlerWechatTag;
/** 获取小程序标签ID */
private String handlerWechatTagId;
private List<Long> handlerWechatTagArray = new ArrayList<Long>();
/** 用户类型 0-全部 1-游客 2-会员 */
@Excel(name = "用户类型 0-全部 1-游客 2-会员")
@ -556,6 +572,62 @@ public class SiteInfo extends BaseEntity
this.machineArray = machineArray;
}
public Integer getSiteType() {
return siteType;
}
public void setSiteType(Integer siteType) {
this.siteType = siteType;
}
public String getHandlerCompanyTagId() {
return handlerCompanyTagId;
}
public void setHandlerCompanyTagId(String handlerCompanyTagId) {
this.handlerCompanyTagId = handlerCompanyTagId;
}
public List<Long> getHandlerCompanyTagArray() {
return handlerCompanyTagArray;
}
public void setHandlerCompanyTagArray(List<Long> handlerCompanyTagArray) {
this.handlerCompanyTagArray = handlerCompanyTagArray;
}
public String getHandlerWechatTagId() {
return handlerWechatTagId;
}
public void setHandlerWechatTagId(String handlerWechatTagId) {
this.handlerWechatTagId = handlerWechatTagId;
}
public List<Long> getHandlerWechatTagArray() {
return handlerWechatTagArray;
}
public void setHandlerWechatTagArray(List<Long> handlerWechatTagArray) {
this.handlerWechatTagArray = handlerWechatTagArray;
}
public String getHandlerCompanyTag() {
return handlerCompanyTag;
}
public void setHandlerCompanyTag(String handlerCompanyTag) {
this.handlerCompanyTag = handlerCompanyTag;
}
public String getHandlerWechatTag() {
return handlerWechatTag;
}
public void setHandlerWechatTag(String handlerWechatTag) {
this.handlerWechatTag = handlerWechatTag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="SiteInfo" id="SiteInfoResult">
<result property="id" column="id" />
<result property="siteType" column="site_type" />
<result property="siteName" column="site_name" />
<result property="fileUrl" column="file_url" />
<result property="siteStartTime" column="site_start_time" />
@ -23,6 +24,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="forbidWechatTag" column="forbid_wechat_tag" />
<result property="forbidWechatTagId" column="forbid_wechat_tag_id" />
<result property="forbidCompanyTag" column="forbid_company_tag" />
<result property="handlerCompanyTag" column="handler_company_tag" />
<result property="handlerCompanyTagId" column="handler_company_tag_id" />
<result property="handlerWechatTagId" column="handler_wechat_tag_id" />
<result property="handlerWechatTag" column="handler_wechat_tag" />
<result property="forbidCompanyTagId" column="forbid_company_tag_id" />
<result property="channelName" column="channel_name" />
<result property="channelId" column="channel_id" />
@ -46,12 +51,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectSiteInfoVo">
select id, site_name, file_url, site_start_time, site_end_time, user_register_start_time, user_register_end_time, open_type, push_type, push_number, push_timer, show_wechat_tag, show_wechat_tag_id, show_company_tag, show_company_tag_id, forbid_wechat_tag, forbid_wechat_tag_id, forbid_company_tag, forbid_company_tag_id, channel_name, channel_id, machine_name, machine_id, user_type, operate, sign_number, order_number, type, link, link_params, redirect_appid, redirect_url, video_no, feed_id, create_by, create_time, update_by, update_time from site_info
select id, site_type, site_name, file_url, site_start_time, site_end_time, user_register_start_time, user_register_end_time, open_type, push_type, push_number, push_timer, show_wechat_tag, show_wechat_tag_id, show_company_tag, show_company_tag_id, forbid_wechat_tag, forbid_wechat_tag_id, forbid_company_tag, handler_company_tag, handler_company_tag_id, handler_wechat_tag_id, handler_wechat_tag, forbid_company_tag_id, channel_name, channel_id, machine_name, machine_id, user_type, operate, sign_number, order_number, type, link, link_params, redirect_appid, redirect_url, video_no, feed_id, create_by, create_time, update_by, update_time from site_info
</sql>
<select id="selectSiteInfoList" parameterType="SiteInfo" resultMap="SiteInfoResult">
<include refid="selectSiteInfoVo"/>
<where>
<if test="siteType != null "> and site_type = #{siteType}</if>
<if test="siteName != null and siteName != ''"> and site_name like concat('%', #{siteName}, '%')</if>
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
<if test="siteStartTime != null "> and site_start_time = #{siteStartTime}</if>
@ -69,6 +75,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="forbidWechatTag != null and forbidWechatTag != ''"> and forbid_wechat_tag = #{forbidWechatTag}</if>
<if test="forbidWechatTagId != null and forbidWechatTagId != ''"> and forbid_wechat_tag_id = #{forbidWechatTagId}</if>
<if test="forbidCompanyTag != null and forbidCompanyTag != ''"> and forbid_company_tag = #{forbidCompanyTag}</if>
<if test="handlerCompanyTag != null and handlerCompanyTag != ''"> and handler_company_tag = #{handlerCompanyTag}</if>
<if test="handlerCompanyTagId != null and handlerCompanyTagId != ''"> and handler_company_tag_id = #{handlerCompanyTagId}</if>
<if test="handlerWechatTagId != null and handlerWechatTagId != ''"> and handler_wechat_tag_id = #{handlerWechatTagId}</if>
<if test="handlerWechatTag != null and handlerWechatTag != ''"> and handler_wechat_tag = #{handlerWechatTag}</if>
<if test="forbidCompanyTagId != null and forbidCompanyTagId != ''"> and forbid_company_tag_id = #{forbidCompanyTagId}</if>
<if test="channelName != null and channelName != ''"> and channel_name like concat('%', #{channelName}, '%')</if>
<if test="channelId != null and channelId != ''"> and channel_id = #{channelId}</if>
@ -86,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="videoNo != null and videoNo != ''"> and video_no = #{videoNo}</if>
<if test="feedId != null and feedId != ''"> and feed_id = #{feedId}</if>
</where>
order by order_number desc ,create_time desc
order by order_number desc , create_time desc
</select>
<select id="selectSiteInfoById" parameterType="Long" resultMap="SiteInfoResult">
@ -94,10 +104,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<insert id="insertSiteInfo" parameterType="SiteInfo">
<insert id="insertSiteInfo" parameterType="SiteInfo" useGeneratedKeys="true" keyProperty="id">
insert into site_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="siteType != null">site_type,</if>
<if test="siteName != null">site_name,</if>
<if test="fileUrl != null">file_url,</if>
<if test="siteStartTime != null">site_start_time,</if>
@ -115,6 +125,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="forbidWechatTag != null">forbid_wechat_tag,</if>
<if test="forbidWechatTagId != null">forbid_wechat_tag_id,</if>
<if test="forbidCompanyTag != null">forbid_company_tag,</if>
<if test="handlerCompanyTag != null">handler_company_tag,</if>
<if test="handlerCompanyTagId != null">handler_company_tag_id,</if>
<if test="handlerWechatTagId != null">handler_wechat_tag_id,</if>
<if test="handlerWechatTag != null">handler_wechat_tag,</if>
<if test="forbidCompanyTagId != null">forbid_company_tag_id,</if>
<if test="channelName != null">channel_name,</if>
<if test="channelId != null">channel_id,</if>
@ -137,7 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="siteType != null">#{siteType},</if>
<if test="siteName != null">#{siteName},</if>
<if test="fileUrl != null">#{fileUrl},</if>
<if test="siteStartTime != null">#{siteStartTime},</if>
@ -155,6 +169,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="forbidWechatTag != null">#{forbidWechatTag},</if>
<if test="forbidWechatTagId != null">#{forbidWechatTagId},</if>
<if test="forbidCompanyTag != null">#{forbidCompanyTag},</if>
<if test="handlerCompanyTag != null">#{handlerCompanyTag},</if>
<if test="handlerCompanyTagId != null">#{handlerCompanyTagId},</if>
<if test="handlerWechatTagId != null">#{handlerWechatTagId},</if>
<if test="handlerWechatTag != null">#{handlerWechatTag},</if>
<if test="forbidCompanyTagId != null">#{forbidCompanyTagId},</if>
<if test="channelName != null">#{channelName},</if>
<if test="channelId != null">#{channelId},</if>
@ -181,6 +199,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateSiteInfo" parameterType="SiteInfo">
update site_info
<trim prefix="SET" suffixOverrides=",">
<if test="siteType != null">site_type = #{siteType},</if>
<if test="siteName != null">site_name = #{siteName},</if>
<if test="fileUrl != null">file_url = #{fileUrl},</if>
<if test="siteStartTime != null">site_start_time = #{siteStartTime},</if>
@ -198,6 +217,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="forbidWechatTag != null">forbid_wechat_tag = #{forbidWechatTag},</if>
<if test="forbidWechatTagId != null">forbid_wechat_tag_id = #{forbidWechatTagId},</if>
<if test="forbidCompanyTag != null">forbid_company_tag = #{forbidCompanyTag},</if>
<if test="handlerCompanyTag != null">handler_company_tag = #{handlerCompanyTag},</if>
<if test="handlerCompanyTagId != null">handler_company_tag_id = #{handlerCompanyTagId},</if>
<if test="handlerWechatTagId != null">handler_wechat_tag_id = #{handlerWechatTagId},</if>
<if test="handlerWechatTag != null">handler_wechat_tag = #{handlerWechatTag},</if>
<if test="forbidCompanyTagId != null">forbid_company_tag_id = #{forbidCompanyTagId},</if>
<if test="channelName != null">channel_name = #{channelName},</if>
<if test="channelId != null">channel_id = #{channelId},</if>

@ -121,19 +121,21 @@ public class SiteInfoServiceImpl implements ISiteInfoService
List<SysTag> showCompanyTagNew = Lists.newArrayList();
List<SysTag> forbidWechatTagNew = Lists.newArrayList();
List<SysTag> forbidCompanyTagNew = Lists.newArrayList();
List<SysTag> handlerWechatTagNew = Lists.newArrayList();
List<SysTag> handlerCompanyTagNew = Lists.newArrayList();
List<ActivityChannelInfo> channelListNew = Lists.newArrayList();
this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew);
this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew);
// 开始保存关联关系
int i = siteInfoMapper.insertSiteInfo(siteInfo);
this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew);
this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew);
return i;
}
// 新增、更新统一处理关联关系
private void commonHandlerRelation(SiteInfo siteInfo,List<SysTag> showWechatTagNew,List<SysTag> showCompanyTagNew,List<SysTag> forbidWechatTagNew,List<SysTag> forbidCompanyTagNew,List<ActivityChannelInfo> channelListNew){
private void commonHandlerRelation(SiteInfo siteInfo,List<SysTag> showWechatTagNew,List<SysTag> showCompanyTagNew,List<SysTag> forbidWechatTagNew,List<SysTag> forbidCompanyTagNew,List<ActivityChannelInfo> channelListNew,List<SysTag> handlerWechatTagNew,List<SysTag> handlerCompanyTagNew){
// 保存可见小程序标签关联关系
for (SysTag tag: showWechatTagNew) {
SiteInfoTag infoTag = new SiteInfoTag();
@ -184,9 +186,29 @@ public class SiteInfoServiceImpl implements ISiteInfoService
channelInfo.setCreateTime(DateUtils.getNowDate());
siteInfoChannelMapper.insertSiteInfoChannel(channelInfo);
}
// 保存获得小程序关联关系
for (SysTag tag: handlerWechatTagNew) {
SiteInfoTag infoTag = new SiteInfoTag();
infoTag.setSiteId(siteInfo.getId());
infoTag.setTagId(tag.getId());
infoTag.setStatus(2l);
infoTag.setCreateBy(SecurityUtils.getUsername());
infoTag.setCreateTime(DateUtils.getNowDate());
siteInfoTagMapper.insertSiteInfoTag(infoTag);
}
// 保存获得企微标签关联关系
for (SysTag tag: handlerCompanyTagNew) {
SiteInfoTag infoTag = new SiteInfoTag();
infoTag.setSiteId(siteInfo.getId());
infoTag.setTagId(tag.getId());
infoTag.setStatus(2l);
infoTag.setCreateBy(SecurityUtils.getUsername());
infoTag.setCreateTime(DateUtils.getNowDate());
siteInfoTagMapper.insertSiteInfoTag(infoTag);
}
}
// 新增、更新统一调用汇总
private void commonHandler(SiteInfo siteInfo,List<SysTag> showWechatTagNew,List<SysTag> showCompanyTagNew,List<SysTag> forbidWechatTagNew,List<SysTag> forbidCompanyTagNew,List<ActivityChannelInfo> channelListNew){
private void commonHandler(SiteInfo siteInfo,List<SysTag> showWechatTagNew,List<SysTag> showCompanyTagNew,List<SysTag> forbidWechatTagNew,List<SysTag> forbidCompanyTagNew,List<ActivityChannelInfo> channelListNew,List<SysTag> handlerWechatTagNew,List<SysTag> handlerCompanyTagNew){
// 如果是自定义频次,则需要保存推送时间 周一到周日
if (!CollectionUtils.isEmpty(siteInfo.getPushTimerArray())) {
siteInfo.setPushTimer(StringUtils.join(siteInfo.getPushTimerArray(),","));
@ -260,6 +282,43 @@ public class SiteInfoServiceImpl implements ISiteInfoService
siteInfo.setForbidCompanyTagId(ids);
}
// 保存获得企微标签
if (!CollectionUtils.isEmpty(siteInfo.getHandlerCompanyTagArray())) {
List<Long> handlerCompanyTagArray = siteInfo.getHandlerCompanyTagArray();
for(long tagId : handlerCompanyTagArray) {
SysTag sysTag = sysTagMapper.selectDeptById(tagId);
if (Objects.nonNull(sysTag)) {
handlerCompanyTagNew.add(sysTag);
}
}
}
if (!CollectionUtils.isEmpty(handlerCompanyTagNew)) {
String tagNames = handlerCompanyTagNew.stream().map(SysTag::getTagName).collect(Collectors.joining(","));
siteInfo.setHandlerCompanyTag(tagNames);
List<Long> resultList = handlerCompanyTagNew.stream().map(SysTag::getId).collect(Collectors.toList());
String ids = StringUtils.join(resultList, ",");
siteInfo.setHandlerCompanyTagId(ids);
}
// 保存获得小程序标签
if (!CollectionUtils.isEmpty(siteInfo.getHandlerWechatTagArray())) {
List<Long> handlerWechatTagArray = siteInfo.getHandlerWechatTagArray();
for(long tagId : handlerWechatTagArray) {
SysTag sysTag = sysTagMapper.selectDeptById(tagId);
if (Objects.nonNull(sysTag)) {
handlerWechatTagNew.add(sysTag);
}
}
}
if (!CollectionUtils.isEmpty(handlerWechatTagNew)) {
String tagNames = handlerWechatTagNew.stream().map(SysTag::getTagName).collect(Collectors.joining(","));
siteInfo.setHandlerWechatTag(tagNames);
List<Long> resultList = handlerWechatTagNew.stream().map(SysTag::getId).collect(Collectors.toList());
String ids = StringUtils.join(resultList, ",");
siteInfo.setHandlerWechatTagId(ids);
}
// 保存渠道信息
if (!CollectionUtils.isEmpty(siteInfo.getChannelArray())) {
List<Long> channelArray = siteInfo.getChannelArray();
@ -305,12 +364,14 @@ public class SiteInfoServiceImpl implements ISiteInfoService
List<SysTag> forbidWechatTagNew = Lists.newArrayList();
List<SysTag> forbidCompanyTagNew = Lists.newArrayList();
List<ActivityChannelInfo> channelListNew = Lists.newArrayList();
this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew);
List<SysTag> handlerWechatTagNew = Lists.newArrayList();
List<SysTag> handlerCompanyTagNew = Lists.newArrayList();
this.commonHandler(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew);
// 删除关联关系
siteInfoTagMapper.deleteSiteInfoTagBySiteId(siteInfo.getId());
// 保存新的关联关系
this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew);
this.commonHandlerRelation(siteInfo,showWechatTagNew,showCompanyTagNew,forbidWechatTagNew,forbidCompanyTagNew,channelListNew,handlerWechatTagNew,handlerCompanyTagNew);
return siteInfoMapper.updateSiteInfo(siteInfo);
}

@ -0,0 +1,706 @@
<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="operate">
<el-select
v-model="queryParams.operate"
placeholder="请选择弹窗状态"
:style="{ width: '100%' }"
clearable
>
<el-option label="全部" value="" />
<el-option label="开启" value="1" />
<el-option label="关闭" value="2" />
</el-select>
</el-form-item>
<el-form-item label="弹窗类型" prop="openType">
<el-select
v-model="queryParams.openType"
placeholder="请选择弹窗类型"
:style="{ width: '100%' }"
clearable
>
<el-option label="全部" value="" />
<el-option label="首页" value="1" />
<el-option label="发现模块" value="2" />
<el-option label="我的模块" value="3" />
</el-select>
</el-form-item>
<el-form-item label="开启时间" prop="siteStartTime">
<el-date-picker clearable
v-model="queryParams.siteStartTime"
type="date"
value-format="yyyy-MM-dd HH:mm"
placeholder="请选择开启开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="" prop="siteEndTime">
<el-date-picker clearable
v-model="queryParams.siteEndTime"
type="date"
value-format="yyyy-MM-dd HH:mm"
placeholder="请选择开启结束时间">
</el-date-picker>
</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:siteInfo: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:siteInfo: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:siteInfo: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:siteInfo: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="id" />
<el-table-column label="升序排序" align="center" prop="orderNumber" >
<template slot-scope="scope">
<el-input v-model="scope.row.orderNumber" @blur="updateOrderNumber($event,scope.row)"></el-input>
</template>
</el-table-column>
<el-table-column label="轮播封面" align="center" prop="fileUrl" >
<template slot-scope="scope">
<el-image :src="scope.row.fileUrl" style="width: 60px;height: 80px">
<div slot="placeholder" class="image-slot"><span class="dot"></span>
</div>
</el-image>
</template>
</el-table-column>
<el-table-column label="标题" align="center" prop="siteName" />
<el-table-column label="活动时间" align="center" prop="siteStartTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.siteStartTime, '{y}-{m}-{d} {h}:{i}') }}</span>
~
<span>{{ parseTime(scope.row.siteEndTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="用户注册时间" align="center" prop="userRegisterStartTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.userRegisterStartTime, '{y}-{m}-{d} {h}:{i}') }}</span>
~
<span>{{ parseTime(scope.row.userRegisterEndTime, '{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="轮播状态" align="center" prop="operate" >
<template slot-scope="scope">
<span v-show="scope.row.operate == 1"></span>
<span v-show="scope.row.operate == 2"></span>
</template>
</el-table-column>
<el-table-column label="仪器" align="center" prop="machineName" />
<el-table-column label="打卡显示活动" align="center" prop="signNumber" />
<el-table-column label="跳转类型" align="center" prop="type" >
<template slot-scope="scope">
<span v-show="scope.row.type == 0"></span>
<span v-show="scope.row.type == 1"></span>
<span v-show="scope.row.type == 3"></span>
<span v-show="scope.row.type == 4"></span>
<span v-show="scope.row.type == 5"></span>
<span v-show="scope.row.type == 5"></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, 'edit')"
v-hasPermi="['system:siteInfo:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:siteInfo:remove']"
>删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-sort"
@click="handleUpdate(scope.row, 'copy')"
v-hasPermi="['system:siteInfo:edit']"
>复制</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-s-tools"
@click="closeWindow(scope.row, 1)"
v-if="scope.row.operate==2"
v-hasPermi="['system:siteInfo:edit']"
>开启轮播图</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-s-tools"
v-if="scope.row.operate==1"
@click="closeWindow(scope.row, 2)"
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="680px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-image :src="form.fileUrl" style="width: 300px;height: 400px;margin-left: 20%">
<div slot="placeholder" class="image-slot"><span class="dot"></span>
</div>
</el-image>
<el-form-item label="弹窗封面" prop="fileUrl">
<el-upload
ref="upload"
:limit="1"
accept=".jpg, .png, .jpeg"
:headers="upload.headers"
:action="upload.url"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">请上传启动页介绍图片建议尺寸为330px*460p</div>
</el-upload>
</el-form-item>
<el-form-item label="标题" prop="siteName">
<el-input v-model="form.siteName" placeholder="请输入标题" style="width: 80%" />
</el-form-item>
<el-form-item label="开启时间" prop="siteStartTime">
<el-date-picker
v-model="form.startTime"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm"
format="yyyy-MM-dd HH:mm"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="用户注册时间" prop="userRegisterStartTime" label-width="100px">
<el-date-picker
v-model="form.registerTime"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm"
format="yyyy-MM-dd HH:mm"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="弹窗类型" prop="openType">
<el-select v-model="form.openType">
<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-form-item label="推送次数" prop="pushNumber">
<el-radio-group v-model="form.pushType">
<el-radio :label="1">永久一次</el-radio>
<el-radio :label="2">每次进入</el-radio>
<el-radio :label="3">自定义频次</el-radio>
</el-radio-group>
</el-form-item>
<el-row>
<el-col :span = "12">
<el-form-item label="每天" prop="pushNumber" v-if="form.pushType==3">
<el-input-number v-model="form.pushNumber" :min="1" :max="10" label="请选择多少次"></el-input-number>
</el-form-item>
</el-col>
<el-col :span = "12">
<el-form-item label="推送时间" prop="pushTimer" v-if="form.pushType==3">
<el-select v-model="form.pushTimerArray" multiple placeholder="请选择" size="small">
<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-option label="星期四" :value="4" :key="4"></el-option>
<el-option label="星期五" :value="5" :key="5"></el-option>
<el-option label="星期六" :value="6" :key="6"></el-option>
<el-option label="星期日" :value="7" :key="7"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="可见小程序标签" prop="showWechatTagId" label-width="120px">
<treeselect v-model="form.showWechatTagArray" :options="chatTagOptions" :multiple="true" :show-count="true" placeholder="请选择小程序标签" :disable-branch-nodes="true" />
</el-form-item>
<el-form-item label="可见企微标签" prop="showCompanyTagId" label-width="120px">
<treeselect v-model="form.showCompanyTagArray" :options="tagOptions" :multiple="true" :show-count="true" placeholder="请选择企微标签" :disable-branch-nodes="true" />
</el-form-item>
<el-form-item label="禁止小程序标签" prop="forbidWechatTagId" label-width="120px">
<treeselect v-model="form.forbidWechatTagArray" :options="chatTagOptions" :multiple="true" :show-count="true" placeholder="请选择小程序标签" :disable-branch-nodes="true" />
</el-form-item>
<el-form-item label="禁止企微标签" prop="forbidCompanyTagId" label-width="120px">
<treeselect v-model="form.forbidCompanyTagArray" :options="tagOptions" :multiple="true" :show-count="true" placeholder="请选择企微标签" :disable-branch-nodes="true" />
</el-form-item>
<el-row>
<el-col :span = "12">
<el-form-item label="所属渠道" prop="channelId">
<el-select v-model="form.channelArray" multiple placeholder="请选择">
<el-option
v-for="item in channelList"
:key="item.id"
:label="item.channelName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span = "12">
<el-form-item label="仪器" prop="channelId">
<el-select v-model="form.machineArray" multiple placeholder="请选择">
<el-option
v-for="item in channelList"
:key="item.id"
:label="item.channelName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span = "12">
<el-form-item label="用户类型" prop="userType">
<el-select v-model="form.userType">
<el-option label="全部" :value="0" :key="0"></el-option>
<el-option label="游客" :value="1" :key="1"></el-option>
<el-option label="会员" :value="2" :key="2"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span = "12">
<el-form-item label="是否开启轮播图" prop="operate" label-width="120px">
<el-switch
v-model="form.operate"
>
</el-switch>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="点击弹窗获得小程序标签" prop="handlerWechatTagId" label-width="180px">
<treeselect v-model="form.handlerWechatTagArray" :options="chatTagOptions" :multiple="true" :show-count="true" placeholder="请选择小程序标签" :disable-branch-nodes="true" />
</el-form-item>
<el-form-item label="点击弹窗获得企微标签" prop="handlerCompanyTagId" label-width="180px">
<treeselect v-model="form.handlerCompanyTagArray" :options="tagOptions" :multiple="true" :show-count="true" placeholder="请选择企微标签" :disable-branch-nodes="true" />
</el-form-item>
<el-form-item label="打卡显示活动 " prop="signNumber" label-width="120px">
<el-input v-model="form.signNumber" placeholder="请输入打卡多少次显示活动 " />
</el-form-item>
<el-form-item label="排序" prop="orderNumber">
<el-input v-model="form.orderNumber" placeholder="请输入排序" />
</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 { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/system/siteInfo";
import { listChannelInfo} from "@/api/system/channelInfo";
import {getToken} from "@/utils/auth";
import { tagTreeSelect } from "@/api/system/wechatTab";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Info",
components: { Treeselect },
data() {
return {
//
loading: true,
// opearte
operate: 'copy',
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
infoList: [],
channelList:[],
//
title: "",
tagOptions: [],
chatTagOptions: [],
//
open: false,
//
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/file/upload"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
siteType: 2,
siteName: null,
fileUrl: null,
siteStartTime: null,
siteEndTime: null,
userRegisterStartTime: null,
userRegisterEndTime: null,
openType: null,
pushType: null,
pushNumber: null,
pushTimer: null,
showWechatTag: null,
showWechatTagId: null,
showCompanyTag: null,
showCompanyTagId: null,
forbidWechatTag: null,
forbidWechatTagId: null,
forbidCompanyTag: null,
forbidCompanyTagId: null,
channelName: null,
channelId: null,
machineName: null,
machineId: null,
userType: null,
operate: null,
signNumber: null,
orderNumber: null,
type: null,
link: null,
linkParams: null,
redirectAppid: null,
redirectUrl: null,
videoNo: null,
feedId: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
this.getDeptTree();
},
methods: {
/** 查询站点管理列表 */
getList() {
this.form.fileUrl = 'http://127.0.0.1:9300/statics/2023/12/16/0c49191de1ed8f91b28d9c2b12556154_20231216154804A002.mp4'
this.loading = true;
listInfo(this.queryParams).then(response => {
this.infoList = response.rows;
this.total = response.total;
this.loading = false;
});
listChannelInfo(this.queryParams).then(response => {
this.channelList = response.rows;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
siteType: null,
siteName: null,
fileUrl: null,
siteStartTime: null,
siteEndTime: null,
userRegisterStartTime: null,
userRegisterEndTime: null,
openType: null,
pushType: null,
pushNumber: null,
pushTimer: null,
showWechatTag: null,
showWechatTagId: null,
showCompanyTag: null,
showCompanyTagId: null,
forbidWechatTag: null,
forbidWechatTagId: null,
forbidCompanyTag: null,
forbidCompanyTagId: null,
channelName: null,
channelId: null,
machineName: null,
machineId: null,
userType: null,
operate: null,
signNumber: null,
orderNumber: 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();
},
/** 重置按钮操作 */
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, operate) {
this.operate = operate;
this.reset();
const id = row.id || this.ids
getInfo(id).then(response => {
this.form = response.data;
if(this.form.operate == 1) {
this.form.operate = true;
} else {
this.form.operate = false;
}
this.open = true;
this.title = "修改站点管理";
});
},
//
updateOrderNumber(event,row){
updateInfo(row).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
},
//
closeWindow(row, operate){
row.operate = operate;
updateInfo(row).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
//
if(this.form.startTime.length > 0) {
this.form.siteStartTime = this.form.startTime[0];
this.form.siteEndTime = this.form.startTime[1];
}
if(this.form.registerTime.length > 0) {
this.form.userRegisterStartTime = this.form.registerTime[0];
this.form.userRegisterEndTime = this.form.registerTime[1];
}
if(this.form.operate) {
this.form.operate = 1;
} else {
this.form.operate = 2;
}
this.form.siteType = 2;
this.form.startTime = [];
this.form.registerTime = [];
if (this.form.id != null && this.operate == 'edit') {
updateInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
if (this.operate == 'copy'){
this.form.id = null;
}
addInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
//
handleFileUploadProgress(event, file, fileList) {
console.log('上传处理中==>file',JSON.stringify(file))
},
//
handleFileSuccess(response, file, fileList, item) {
console.log('上传后的结果==>',JSON.stringify(response))
if(response.code == '200') {
this.form.fileUrl = response.data.url;
}
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除站点管理编号为"' + ids + '"的数据项?').then(function() {
return delInfo(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 查询部门下拉树结构 */
getDeptTree() {
tagTreeSelect({type: 2}).then(response => {
this.tagOptions = response.data;
});
tagTreeSelect({type: 1}).then(response => {
this.chatTagOptions = response.data;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/siteInfo/export', {
...this.queryParams
}, `info_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -148,7 +148,7 @@
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
@click="handleUpdate(scope.row, 'edit')"
v-hasPermi="['system:siteInfo:edit']"
>修改</el-button>
<el-button
@ -158,6 +158,13 @@
@click="handleDelete(scope.row)"
v-hasPermi="['system:siteInfo:remove']"
>删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-sort"
@click="handleUpdate(scope.row, 'copy')"
v-hasPermi="['system:siteInfo:edit']"
>复制</el-button>
<el-button
size="mini"
type="text"
@ -318,7 +325,7 @@
</el-form-item>
</el-col>
<el-col :span = "12">
<el-form-item label="是否开启弹窗" prop="userType" label-width="120px">
<el-form-item label="是否开启弹窗" prop="operate" label-width="120px">
<el-switch
v-model="form.operate"
>
@ -405,6 +412,8 @@ export default {
return {
//
loading: true,
// opearte
operate: 'copy',
//
ids: [],
//
@ -443,6 +452,7 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
siteType: 1,
siteName: null,
fileUrl: null,
siteStartTime: null,
@ -511,6 +521,7 @@ export default {
reset() {
this.form = {
id: null,
siteType: null,
siteName: null,
fileUrl: null,
siteStartTime: null,
@ -574,7 +585,8 @@ export default {
this.title = "添加站点管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
handleUpdate(row, operate) {
this.operate = operate;
this.reset();
const id = row.id || this.ids
getInfo(id).then(response => {
@ -623,15 +635,19 @@ export default {
} else {
this.form.operate = 2;
}
this.form.siteType = 1;
this.form.startTime = [];
this.form.registerTime = [];
if (this.form.id != null) {
if (this.form.id != null && this.operate == 'edit') {
updateInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
if (this.operate == 'copy'){
this.form.id = null;
}
addInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;

Loading…
Cancel
Save