Authored by 王涛

Merge branch 'master-V32-XuHaoJie' into 'master'

通用-及时消息配置-及时消息配置提示信息优化



See merge request !387
... ... @@ -276,7 +276,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl
type: 1
, title: '及时消息自定义展示示例'
, closeBtn: 1
, area: ['40%', '30%']
, area: ['60%', '70%']
, shade: 0.8
, id: 'lay_cron_noticeTimely' //设定一个id,防止重复弹出
, content: $("#notice_timely_template").html()
... ...
... ... @@ -133,24 +133,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl
// 点击删除事件
$('.link-noticeTimely-state-delete').unbind('click').on('click', function () {
var ids = [$(this).data('id')];
layer.confirm('确认要删除吗?', {icon: 3}, function () {
layer.load(2);
$.ajax({
url: domainName + '/api-web/noticeTimely/stateDelete?access_token=' + accessToken,
type: 'POST',
data: JSON.stringify(ids),
contentType: "application/json;charset=UTF-8",
success: function (response) {
layer.closeAll('loading');
if (response.success) {
layer.msg('删除成功!', {icon: 1, time: 3000});
loadStateTable(id);
} else {
layer.msg('删除失败!', {icon: 2, time: 3000});
}
}
})
});
deleteStateById(ids);
});
}
});
... ... @@ -240,7 +223,13 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl
loadStateTable(id);
},
yes: function (index, layero) {
//获取选中数据
var checks = table.checkStatus('table-noticeTimely-state-list').data;
var list= checks.map(item => item.id);
if(list.length>0){
deleteStateById(list);
}
layer.close(index);
}
});
});
... ... @@ -298,6 +287,28 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl
});
}
//根据id删除及时消息发送信息
function deleteStateById(ids) {
layer.confirm('确认要删除吗?', {icon: 3}, function () {
layer.load(2);
$.ajax({
url: domainName + '/api-web/noticeTimely/stateDelete?access_token=' + accessToken,
type: 'POST',
data: JSON.stringify(ids),
contentType: "application/json;charset=UTF-8",
success: function (response) {
layer.closeAll('loading');
if (response.success) {
layer.msg('删除成功!', {icon: 1, time: 3000});
loadStateTable(id);
} else {
layer.msg('删除失败!', {icon: 2, time: 3000});
}
}
})
});
}
//刷新组表格
function reloadTable() {
var params = form.val('form-noticeTimely-condition');
... ...
... ... @@ -110,16 +110,16 @@
<fieldset class="layui-elem-field layui-field-title">
<legend>自定义展示 &nbsp; &nbsp;
<a class="layui-btn layui-btn-xs layui-btn-normal" id="editNoticeTimelyParamBtn"><i class="layui-icon">&#xe654;</i></a>
<div class="layui-form-mid layui-word-aux" id="notice_timely_param_hint"
style="margin-left: 10px;padding: 4px!important;position: relative;display: flex;align-items: center;float:right">
<i class="layui-icon form-btn-icon">&#xe702;</i>
</div>
</legend>
</fieldset>
<div class="layui-form-item hide" id="notice_timely_param_sql">
<label class="layui-form-label textarea-label">展示内容</label>
<div class="layui-input-block" style="display: flex;">
<textarea name="details" placeholder="请输入展示内容" class="layui-textarea" style="width: 92%"></textarea>
<div class="layui-form-mid layui-word-aux" id="notice_timely_param_hint"
style="margin-left: 10px;padding: 0!important;position: relative;display: flex;align-items: center;">
<i class="layui-icon form-btn-icon">&#xe702;</i>
</div>
</div>
</div>
<div class="layui-form-item hide" id="notice_timely_param_level">
... ... @@ -155,25 +155,50 @@
<script type="text/html" id="notice_timely_template">
<div id="cronContent" style="color:#000000">
<p style="margin: 10px auto; padding: 0px;">
  <strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);">自定义展示用法详解</span></strong>
  <strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);">展示内容用法详解</span></strong>
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">1</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">配置SQL为:select content,way from b_notice_his LIMIT 0,5</span></strong>&nbsp;&nbsp;</span>&nbsp;表示有两列数据,分别为content和way
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">1</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">配置SQL为:select content,way from b_notice_his LIMIT 0,5</span></strong>&nbsp;&nbsp;</span>&nbsp;表示有两列数据,分别为content和way
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">2</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">展示内容为:测试,发送内容为#{content},发送类型为#{way}</span></strong>&nbsp;&nbsp;</span>&nbsp;发送的内容就是拼接起来的内
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">2</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">若展示内容为:测试,发送内容为#{content},发送类型为#{way}</span></strong>&nbsp;&nbsp;</span>&nbsp;发送的内容就是拼接起来的内
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">3</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">只支持Mysql语法,且查询结果多行时,默认使用第一行数据</span></strong>&nbsp;&nbsp;</span>&nbsp;可嵌入&lt;/br&gt;进行换行
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">4</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">#{}里面只支持单个参数,展示内容可以不填</span></strong>&nbsp;&nbsp;</span>&nbsp;默认为所有列加逗号的拼
</p>
<p>
&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  <strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);">展示配置用法详解</span></strong>
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">1</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">自定义展示设置可只选颜色,也可自定义条件。若不满足条件默认为绿色</span></strong>&nbsp;&nbsp;</span>&nbsp;展示设置中的颜色默认为绿
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">2</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">当自定义展示设置多天记录时,只会采用第一条</span></strong>&nbsp;&nbsp;</span>&nbsp;自动识别两者比较大小——数字或字符
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">3</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">颜色的选择和弹出声音有关系</span></strong>&nbsp;&nbsp;</span>&nbsp;每种颜色对应不同的声
</p>
<p>
&nbsp;
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">3</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">其他:只支持Mysql语法,且查询结果多行时,默认使用第一行数据</span></strong>&nbsp;&nbsp;</span>&nbsp;可嵌入&lt;/br&gt;进行换行
  <strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);">跳转地址用法详解</span></strong>
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">4</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">注意:#{}里面只支持单个参数,展示内容可以不填</span></strong>&nbsp;&nbsp;</span>&nbsp;默认为所有列加逗号的拼
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">1</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">跳转地址的文本框也支持模板配置</span></strong>&nbsp;&nbsp;</span>&nbsp;参数必须是SQL
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">5</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">重点:自定义展示设置可只选颜色,也可自定义条件。若不满足条件默认为绿色</span></strong>&nbsp;&nbsp;</span>&nbsp;展示设置中的颜色默认为绿
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">2</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">跳转地址的下拉框数据在数据字典中配置</span></strong>&nbsp;&nbsp;</span>&nbsp;必须以http://https://开头
</p>
<p style="margin: 10px auto; padding: 0px;">
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">6</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">特殊:当自定义展示设置多天记录时,只会采用第一条</span></strong>&nbsp;&nbsp;</span>&nbsp;自动识别两者比较大小——数字或字符
  <span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 0);">3</span></span><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(0, 0, 255);">跳转地址的实际数据是下拉框跟文本框拼接的内容</span></strong>&nbsp;&nbsp;</span>&nbsp;即时消息弹窗点击后会跳转该路
</p>
</div>
</script>
... ...