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 @@ -276,7 +276,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl
276 type: 1 276 type: 1
277 , title: '及时消息自定义展示示例' 277 , title: '及时消息自定义展示示例'
278 , closeBtn: 1 278 , closeBtn: 1
279 - , area: ['40%', '30%'] 279 + , area: ['60%', '70%']
280 , shade: 0.8 280 , shade: 0.8
281 , id: 'lay_cron_noticeTimely' //设定一个id,防止重复弹出 281 , id: 'lay_cron_noticeTimely' //设定一个id,防止重复弹出
282 , content: $("#notice_timely_template").html() 282 , content: $("#notice_timely_template").html()
@@ -133,24 +133,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl @@ -133,24 +133,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl
133 // 点击删除事件 133 // 点击删除事件
134 $('.link-noticeTimely-state-delete').unbind('click').on('click', function () { 134 $('.link-noticeTimely-state-delete').unbind('click').on('click', function () {
135 var ids = [$(this).data('id')]; 135 var ids = [$(this).data('id')];
136 - layer.confirm('确认要删除吗?', {icon: 3}, function () {  
137 - layer.load(2);  
138 - $.ajax({  
139 - url: domainName + '/api-web/noticeTimely/stateDelete?access_token=' + accessToken,  
140 - type: 'POST',  
141 - data: JSON.stringify(ids),  
142 - contentType: "application/json;charset=UTF-8",  
143 - success: function (response) {  
144 - layer.closeAll('loading');  
145 - if (response.success) {  
146 - layer.msg('删除成功!', {icon: 1, time: 3000});  
147 - loadStateTable(id);  
148 - } else {  
149 - layer.msg('删除失败!', {icon: 2, time: 3000});  
150 - }  
151 - }  
152 - })  
153 - }); 136 + deleteStateById(ids);
154 }); 137 });
155 } 138 }
156 }); 139 });
@@ -240,7 +223,13 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl @@ -240,7 +223,13 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl
240 loadStateTable(id); 223 loadStateTable(id);
241 }, 224 },
242 yes: function (index, layero) { 225 yes: function (index, layero) {
243 - 226 + //获取选中数据
  227 + var checks = table.checkStatus('table-noticeTimely-state-list').data;
  228 + var list= checks.map(item => item.id);
  229 + if(list.length>0){
  230 + deleteStateById(list);
  231 + }
  232 + layer.close(index);
244 } 233 }
245 }); 234 });
246 }); 235 });
@@ -298,6 +287,28 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl @@ -298,6 +287,28 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'treeTabl
298 }); 287 });
299 } 288 }
300 289
  290 + //根据id删除及时消息发送信息
  291 + function deleteStateById(ids) {
  292 + layer.confirm('确认要删除吗?', {icon: 3}, function () {
  293 + layer.load(2);
  294 + $.ajax({
  295 + url: domainName + '/api-web/noticeTimely/stateDelete?access_token=' + accessToken,
  296 + type: 'POST',
  297 + data: JSON.stringify(ids),
  298 + contentType: "application/json;charset=UTF-8",
  299 + success: function (response) {
  300 + layer.closeAll('loading');
  301 + if (response.success) {
  302 + layer.msg('删除成功!', {icon: 1, time: 3000});
  303 + loadStateTable(id);
  304 + } else {
  305 + layer.msg('删除失败!', {icon: 2, time: 3000});
  306 + }
  307 + }
  308 + })
  309 + });
  310 + }
  311 +
301 //刷新组表格 312 //刷新组表格
302 function reloadTable() { 313 function reloadTable() {
303 var params = form.val('form-noticeTimely-condition'); 314 var params = form.val('form-noticeTimely-condition');
@@ -110,16 +110,16 @@ @@ -110,16 +110,16 @@
110 <fieldset class="layui-elem-field layui-field-title"> 110 <fieldset class="layui-elem-field layui-field-title">
111 <legend>自定义展示 &nbsp; &nbsp; 111 <legend>自定义展示 &nbsp; &nbsp;
112 <a class="layui-btn layui-btn-xs layui-btn-normal" id="editNoticeTimelyParamBtn"><i class="layui-icon">&#xe654;</i></a> 112 <a class="layui-btn layui-btn-xs layui-btn-normal" id="editNoticeTimelyParamBtn"><i class="layui-icon">&#xe654;</i></a>
  113 + <div class="layui-form-mid layui-word-aux" id="notice_timely_param_hint"
  114 + style="margin-left: 10px;padding: 4px!important;position: relative;display: flex;align-items: center;float:right">
  115 + <i class="layui-icon form-btn-icon">&#xe702;</i>
  116 + </div>
113 </legend> 117 </legend>
114 </fieldset> 118 </fieldset>
115 <div class="layui-form-item hide" id="notice_timely_param_sql"> 119 <div class="layui-form-item hide" id="notice_timely_param_sql">
116 <label class="layui-form-label textarea-label">展示内容</label> 120 <label class="layui-form-label textarea-label">展示内容</label>
117 <div class="layui-input-block" style="display: flex;"> 121 <div class="layui-input-block" style="display: flex;">
118 <textarea name="details" placeholder="请输入展示内容" class="layui-textarea" style="width: 92%"></textarea> 122 <textarea name="details" placeholder="请输入展示内容" class="layui-textarea" style="width: 92%"></textarea>
119 - <div class="layui-form-mid layui-word-aux" id="notice_timely_param_hint"  
120 - style="margin-left: 10px;padding: 0!important;position: relative;display: flex;align-items: center;">  
121 - <i class="layui-icon form-btn-icon">&#xe702;</i>  
122 - </div>  
123 </div> 123 </div>
124 </div> 124 </div>
125 <div class="layui-form-item hide" id="notice_timely_param_level"> 125 <div class="layui-form-item hide" id="notice_timely_param_level">
@@ -155,25 +155,50 @@ @@ -155,25 +155,50 @@
155 <script type="text/html" id="notice_timely_template"> 155 <script type="text/html" id="notice_timely_template">
156 <div id="cronContent" style="color:#000000"> 156 <div id="cronContent" style="color:#000000">
157 <p style="margin: 10px auto; padding: 0px;"> 157 <p style="margin: 10px auto; padding: 0px;">
158 -   <strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);">自定义展示用法详解</span></strong> 158 +   <strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);">展示内容用法详解</span></strong>
159 </p> 159 </p>
160 <p style="margin: 10px auto; padding: 0px;"> 160 <p style="margin: 10px auto; padding: 0px;">
161 -   <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 161 +   <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
162 </p> 162 </p>
163 <p style="margin: 10px auto; padding: 0px;"> 163 <p style="margin: 10px auto; padding: 0px;">
164 -   <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;发送的内容就是拼接起来的内 164 +   <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;发送的内容就是拼接起来的内
  165 + </p>
  166 + <p style="margin: 10px auto; padding: 0px;">
  167 +   <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;进行换行
  168 + </p>
  169 + <p style="margin: 10px auto; padding: 0px;">
  170 +   <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;默认为所有列加逗号的拼
  171 + </p>
  172 +
  173 + <p>
  174 + &nbsp;
  175 + </p>
  176 + <p style="margin: 10px auto; padding: 0px;">
  177 +   <strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);">展示配置用法详解</span></strong>
  178 + </p>
  179 + <p style="margin: 10px auto; padding: 0px;">
  180 +   <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;展示设置中的颜色默认为绿
  181 + </p>
  182 + <p style="margin: 10px auto; padding: 0px;">
  183 +   <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;自动识别两者比较大小——数字或字符
  184 + </p>
  185 + <p style="margin: 10px auto; padding: 0px;">
  186 +   <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;每种颜色对应不同的声
  187 + </p>
  188 + <p>
  189 + &nbsp;
165 </p> 190 </p>
166 <p style="margin: 10px auto; padding: 0px;"> 191 <p style="margin: 10px auto; padding: 0px;">
167 -   <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;进行换行 192 +   <strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 18px; color: rgb(255, 0, 0);">跳转地址用法详解</span></strong>
168 </p> 193 </p>
169 <p style="margin: 10px auto; padding: 0px;"> 194 <p style="margin: 10px auto; padding: 0px;">
170 -   <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;默认为所有列加逗号的拼 195 +   <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
171 </p> 196 </p>
172 <p style="margin: 10px auto; padding: 0px;"> 197 <p style="margin: 10px auto; padding: 0px;">
173 -   <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;展示设置中的颜色默认为绿 198 +   <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://开头
174 </p> 199 </p>
175 <p style="margin: 10px auto; padding: 0px;"> 200 <p style="margin: 10px auto; padding: 0px;">
176 -   <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;自动识别两者比较大小——数字或字符 201 +   <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;即时消息弹窗点击后会跳转该路
177 </p> 202 </p>
178 </div> 203 </div>
179 </script> 204 </script>