Commit dc0254a5 by 李洋

11

parent f9f4dc87
......@@ -49,15 +49,4 @@ layui.use(['laydate','form','table'], function(){
]]
});
form.render();
});
// //指定条件搜索
// $('#search-btn').click(function () {
// var search_tpl_id = $('#search-tpl-id').val();
// var search_user = $('#search-msg-userobj').val();
// var search_sendtime_start = $('#Choice_start').val();
// var search_sendtime_end = $('#Choice_end').val();
// var search_channel = $('#search-msg-channel option:selected').val();
// var search_status = $('#search-msg-status option:selected').val();
// window.location.href="/message/allhistorylist?search_tpl_id="+search_tpl_id+"&search_user="+search_user+"&search_sendtime_start="+search_sendtime_start+"&search_sendtime_end="+search_sendtime_end+"&search_channel="+search_channel+"&search_status="+search_status;
// })
\ No newline at end of file
});
\ No newline at end of file
//选择定时推送时间
layui.use('laydate', function(){
layui.use(['laydate','table','laypage','form'], function(){
var $ = layui.$;
var laydate = layui.laydate;
var form = layui.form;
var table = layui.table;
var laypage = layui.laypage;
//执行一个laydate实例
laydate.render({
elem: '#Choice_start', //指定元素
// type:'datetime',
// format:'yyyy-MM-dd HH-mm'
elem: '#start_time'
});
});
layui.use('laydate', function(){
var laydate = layui.laydate;
//执行一个laydate实例
laydate.render({
elem: '#Choice_end', //指定元素
// type:'datetime',
// format:'yyyy-MM-dd HH-mm'
elem: '#end_time'
});
//监听表单提交按钮
form.on('submit(search)', function(data){
//console.log(data.elem); //被执行事件的元素DOM对象,一般为button对象
// console.log(data.form); //被执行提交的form对象,一般在存在form标签时才会返回
// console.log(data.field); //当前容器的全部表单字段,名值对形式:{name: value}
// layer.alert(JSON.stringify(data.field), {
// title: '最终的提交信息'
// });
// return false;
//根据搜索条件 重载表单
apo_table.reload({
where: data.field,//设定异步数据接口的额外参数,任意设
page: {
curr: 1 //重新从第 1 页开始
}
});
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
});
var apo_table = table.render({
elem: '#table',
url: '/message/manualhistorylist',
id: 'table',
page: true,
limit: 10,
cols: [[ //表头
{field: 'log_id', title: '消息编号',align:'center',width:145},
{field: 'title', title: '消息标题',align:'center',width:145},
{field: 'description', title: '消息描述',align:'center',width:145},
{field: 'channel_type_str', title: '消息渠道',align:'center',width:145},
{field: 'obj_user', title: '推送目标',align:'center',width:145},
{field: 'actual_send_time_str', title: '发送时间',align:'center',width:145},
{fixed: 'right', title:'操作', width:150, align:'center', toolbar: '#bar'}
]]
});
//监听表格 工具栏点击
table.on('tool(table)', function(obj){
var data = obj.data;
var layEvent = obj.event;
var tr = obj.tr;
console.log(data);
if(layEvent === 'detail'){
window.location.href = '/message/sendmanualmessage?log_id='+data['log_id']+'op_type='+1;
}else if(layEvent === 're_send'){
window.location.href = '/message/sendmanualmessage?log_id='+data['log_id']+'op_type='+2;
}
});
//获取选中数据
var active = {
//可添加多个按钮 根据data-type给出的函数名决定调用
send_manual_msg:function(){
window.location.href="/message/sendmanualmessage";
}
};
//监听相关按钮点击 根据data-type值来确定是哪个按钮 然后调用对应的方法
$('.layui-btn').on('click', function(){
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
});
//指定条件搜索
$('#search-btn').click(function () {
var search_desc = $('#search-desc').val();
var search_channel = $('#choose-tpl option:selected').val();
var search_sendtime_start = $('#Choice_start').val();
var search_sendtime_end = $('#Choice_end').val();
window.location.href="/message/manualhistorylist?search_desc="+search_desc+"&search_channel="+search_channel+"&search_sendtime_start="+search_sendtime_start+"&search_sendtime_end="+search_sendtime_end;
})
\ No newline at end of file
form.render();
});
\ No newline at end of file
<style>
.p-l{
margin: 20px;
background-color: rgba(255, 249, 242, 0.02);
height: auto;
}
.p-l label{
margin-left: 30px;
}
.div-b{
margin-top: 20px;
}
table{
table-layout: fixed;
word-break: break-all;
word-wrap: break-word; //表格固定布局
}
.filter-label-left{
width: 90px;
text-align: left;
......@@ -87,9 +69,6 @@
<table class="layui-hide" id="table" lay-filter="table"></table>
@else
<div style="text-align: center">
<label style="margin-top: 30px">对不起,您没有权限查看此页面</label>
......
<style>
.p-l{
margin: 20px;
background-color: rgba(255, 249, 242, 0.02);
height: auto;
.filter-label-left{
width: 90px;
text-align: left;
}
.p-l label{
margin-left: 30px;
}
.div-b{
.first-label{
margin-left: 20px;
margin-top: 20px;
}
</style>
@if($manualhistorylist_check)
<div class="gray-bg">
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<div class="form-inline p-l">
<form method="get" action="/message/templatelist">
<div style="text-align: center" class="div-b">
@if($manualmessage_send)
<a class="btn btn-primary btn-sm" href="/message/sendmanualmessage" style="float: left;margin-left: 30px">发送消息</a>
@endif
<label>消息描述:</label>
<input type="text" class="form-control" id="search-desc" placeholder="请输入消息描述" value="{{ $search_desc }}">
<label>消息渠道:</label>
<select class="form-control" name="inner-choose-type" id="choose-tpl">
@for($i=0;$i<count($msg_channels);$i++)
<option value="{{ $i }}" @if($i==$search_channel) selected @endif>{{ $msg_channels[$i] }}</option>
@endfor
</select>
<label>发送时间:</label>
<input type="text" class="form-control" id="Choice_start" name="create_time_start/condition" value="{{ $search_sendtime_start }}"/>-
<input type="text" class="form-control" id="Choice_end" name="create_time_end/condition" value="{{ $search_sendtime_end }}"/>
<input class="btn btn-primary btn-sm" id="search-btn" style="float: right; margin-right: 60px" value="搜索"/>
</div>
</form>
</div>
</div>
@if(count($info)>0)
<div class="ibox-content">
<div class="dataTables_wrapper form-inline dt-bootstrap">
<div class="row">
<div class="col-sm-12">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr role="row">
<th style="width:100px;" class="text-center">消息编号</th>
<th style="width:100px;" class="text-center">消息标题</th>
<th style="width:150px;" class="text-center">消息描述</th>
<th style="width:100px;" class="text-center">消息渠道</th>
<th style="width:100px;" class="text-center">推送目标</th>
<th style="width:100px;" class="text-center">发送时间</th>
<th style="width:100px;" class="text-center">操作</th>
</tr>
</thead>
<form class="layui-form" action="">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label filter-label-left first-label">消息描述:</label>
<div class="layui-input-inline" style="width: 200px; margin-top: 20px;">
<input type="text" name="msg_tpl_description" autocomplete="off" class="layui-input"/>
</div>
<tbody>
@for($i=0;$i<count($info);$i++)
<tr role="row" style="text-align: center">
<td>{{ $info[$i]->log_id }}</td>
<td>{{ $info[$i]->title }}</td>
<td>{{ $info[$i]->ex_str }}</td>
<td>{{ $info[$i]->channels_str }}</td>
@if($info[$i]->obj_user=='is_to_all')
<td>全部用户</td>
@else
<td>{{ $info[$i]->obj_user }}</td>
@endif
<?php
if(empty($info[$i]->actual_send_time))
{
$info[$i]->actual_send_time = '';
}else
{
$info[$i]->actual_send_time=date("Y-m-d H:i:s",$info[$i]->actual_send_time);
}
<label class="layui-form-label filter-label-left first-label">消息渠道:</label>
<div class="layui-input-inline" style="width: 150px; margin-top: 20px;">
<select name="msg_channels" lay-filter="msg_channels">
<option value="" selected="">请选择</option>
@foreach(Config('msgconfig.msg_channels') as $k=>$v)
<option value="{{$k}}">{{$v}}</option>
@endforeach
</select>
</div>
?>
<td>{{ $info[$i]->actual_send_time }}</td>
@if($manualmessage_edit)
<td>
<a href="{{url('message/sendmanualmessage')}}?log_id={{$info[$i]->log_id}}&op_type=1" class="btn btn-xs btn-outline btn-primary">查看</a>
<a href="{{url('message/sendmanualmessage')}}?log_id={{$info[$i]->log_id}}&op_type=2" class="btn btn-xs btn-outline btn-warning">重新发送</a>
</td>
@endif
</tr>
@endfor
</tbody>
<label class="layui-form-label filter-label-left first-label">发送时间:</label>
<div class="layui-inline" style="margin-top: 20px;">
<input type="text" class="layui-input" name="start_time" id="start_time" autocomplete="off">
</div>
<div class="layui-inline" style="margin-top: 20px;">
<div class="layui-form-mid">--</div>
</div>
<div class="layui-inline" style="margin-top: 20px;">
<input type="text" class="layui-input" name="end_time" id="end_time" autocomplete="off">
</div>
</table>
{{$info->appends([
'search_desc'=>$search_desc,
'search_channel'=>$search_channel,
'search_sendtime_start'=>$search_sendtime_start,
'search_sendtime_end'=>$search_sendtime_end,
])->links() }}
</div>
</div>
<div class="row" id="my_list_paginate"></div>
</div>
</div>
@else
<div style="text-align: center">
<label>很抱歉,暂无数据</label>
</div>
@endif
<div class="layui-input-inline" style="margin-top: 20px; float: right;">
<button class="layui-btn" lay-submit lay-filter="search" data-type="reload">查询</button>
</div>
</div>
</div>
</div>
</div>
</form>
@if($manualmessage_send)
<div style="margin-top: 20px;">
<button class="layui-btn" id="send_manual_msg" data-type="send_manual_msg">发送消息</button>
</div>
@endif
<table class="layui-hide" id="table" lay-filter="table"></table>
<script type="text/html" id="bar">
<a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
<a class="layui-btn layui-btn-xs" lay-event="re_send">重新发送</a>
</script>
@else
<div style="text-align: center">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment