Commit 4260a4a7 by 李洋

添加消息模板类别

parent 80fd4cbe
......@@ -48,8 +48,6 @@ class MessageApiController extends Controller
private function addTemplate($request)
{
$data = $request->input();
// var_dump($data);die;
$insert_tpl_id = $data['tpl_id'];
//至少选择一个渠道
......@@ -59,8 +57,14 @@ class MessageApiController extends Controller
if (empty($data['description'])) {
$this->Export(11002, '请输入消息key');
}
if (empty($data['tpl_key'])) {
$this->Export(11003, '请输入模板描述');
// if (empty($data['tpl_key'])) {
// $this->Export(11003, '请输入模板描述');
// }
if (empty($data['cls_id'])){
$this->Export(11024, '请输入模板分类');
}
if (empty($data['sub_cls_id'])){
$this->Export(11025, '请输入模板二级分类');
}
$is_dumplicated = DB::connection('message')->table('lie_msg_tpl')->where('description',$data['description'])->first();
......@@ -87,11 +91,12 @@ class MessageApiController extends Controller
$tpl_model['tpl_id'] = $data['tpl_id'];
$tpl_model['channels'] = $data['channels'];
$tpl_model['description'] = $data['description'];
$tpl_model['ex_str'] = $data['tpl_key'];
// $tpl_model['ex_str'] = $data['tpl_key'];
$tpl_model['source_type'] = $data['source_type'];
$tpl_model['creater'] = $data['creater'];
$tpl_model['obj_user'] = $data['obj_user'];
$tpl_model['msg_type'] = $data['msg_type'];
$tpl_model['sub_cls_id'] = $data['sub_cls_id'];
if (empty($tpl_model['tpl_id'])) {
$tpl_model['create_time'] = time();
......@@ -356,4 +361,14 @@ class MessageApiController extends Controller
$this->Export($response['err_code'], $response['err_msg']);
}
/** 获取模板子分类
* @param $request
*/
private function getSubTplCls($request){
$data = $request->input();
$sub_tpl_info = DB::connection('message')->table('lie_msg_tpl_sub_classify')->select('sub_cls_id','sub_cls_name')
->where('cls_id',$data['sel_msg_tpl_cls'])->get();
$this->Export(0, 'success',objectToArray($sub_tpl_info));
}
}
\ No newline at end of file
......@@ -385,32 +385,39 @@ class MessageController extends Controller
// 新增编辑消息模板
private function addtemplate(Request $request, $id, $viewid)
{
Csrf($request);
$perms_arr = ['template_create'];
$res_perm = $this->getUserPerms($request,$perms_arr);
$template_create = $res_perm['template_create'];
$rq_tpl_id = $request->input('tpl_id');
$db = DB::connection('message');
//是否包含某一渠道
$isContainInner = '';
$isContainSMS = '';
$isContainEmail = '';
$isContainWechatNotify = '';
$isContainDing = '';
//渠道模板id
$inner_chn_tpl_id = '';
$sms_chn_tpl_id = '';
$email_chn_tpl_id = '';
$wechatNotify_chn_tpl_id = '';
$ding_chn_tpl_id = '';
//消息模板一级分类
$msg_tpl_cls = $db->table('lie_msg_tpl_classify')->orderby('cls_id','asc')->get();
$msg_tpl_clses = [];
foreach ($msg_tpl_cls as $k=>$v){
$msg_tpl_clses[$v->cls_id] = $v->cls_name;
}
//消息模板二级分类
$msg_tpl_sub_clses = [];
if(!empty($rq_tpl_id))
{
//通过tpl_id找到模板的渠道们 和 描述等
$info = $db->table('lie_msg_tpl')->select('tpl_id','description','channels','msg_type','creater','source_type','obj_user','ex_str')->where('tpl_id',$rq_tpl_id)->first();
$info = $db->table('lie_msg_tpl as mt')->select('mt.tpl_id','mt.description','mt.channels','mt.msg_type','mt.creater','mt.source_type','mt.obj_user','mt.ex_str','mtsc.sub_cls_id','mtsc.sub_cls_name','mtsc.cls_id','mtc.cls_name')
->leftjoin('lie_msg_tpl_sub_classify as mtsc','mt.sub_cls_id','=','mtsc.sub_cls_id')
->leftjoin('lie_msg_tpl_classify as mtc','mtc.cls_id','=','mtsc.cls_id')
->where('tpl_id',$rq_tpl_id)->first();
//获取消息模板二级分类
if (!empty($info->cls_id)){
$msg_tpl_sub_cls = $db->table('lie_msg_tpl_sub_classify')->select('sub_cls_id','sub_cls_name','cls_id')
->where('cls_id',$info->cls_id)->get();
foreach ($msg_tpl_sub_cls as $k=>$v){
$msg_tpl_sub_clses[$v->sub_cls_id] = $v->sub_cls_name;
}
}
//通过找到的 channels 去渠道模板表里 把每个channel找出来
$tpl_channels_arr = explode(',',$info->channels);
$channel_tpls = [];
......@@ -439,52 +446,21 @@ class MessageController extends Controller
$channel_tpls[$channel_type] = $channel_tpl_obj;
}
$info->channel_tpls = $channel_tpls;
//判断包含的消息渠道(用于展示消息渠道)(利用之前分割字符串得到的数组)
$isContainInner = in_array('1',$tpl_channels_arr);
$isContainSMS = in_array('2',$tpl_channels_arr);
$isContainEmail = in_array('3',$tpl_channels_arr);
$isContainWechatNotify = in_array('4',$tpl_channels_arr);
$isContainDing = in_array('5',$tpl_channels_arr);
}
if(empty($info))
{
$info = (object)null;
$info->tpl_id = '';
$info->ex_str = '';
$info->description = '';
$info->channels ='';
$info->channel_tpls = [];
$info->msg_type = '';
$info->creater = '';
}
//消息类型枚举
$msg_type = [
'请选择',
'公告',
'活动',
'新闻',
'其他'
];
$data=[
'title'=>'asd',
'id'=>$id,
'info'=>$info,
'msg_type'=>$msg_type,
'isContainInner'=>$isContainInner,
'isContainSMS'=>$isContainSMS,
'isContainEmail'=>$isContainEmail,
'isContainWechatNotify'=>$isContainWechatNotify,
'isContainDing'=>$isContainDing,
'inner_chn_tpl_id'=>$inner_chn_tpl_id,
'sms_chn_tpl_id'=>$sms_chn_tpl_id,
'email_chn_tpl_id'=>$email_chn_tpl_id,
'wechatNotify_chn_tpl_id'=>$wechatNotify_chn_tpl_id,
'ding_chn_tpl_id'=>$ding_chn_tpl_id,
'template_create' => $template_create
'info'=>!empty($info)?$info:(object)null,
'inner_chn_tpl_id'=>!empty($inner_chn_tpl_id)?$inner_chn_tpl_id:'',
'sms_chn_tpl_id'=>!empty($sms_chn_tpl_id)?$sms_chn_tpl_id:'',
'email_chn_tpl_id'=>!empty($email_chn_tpl_id)?$email_chn_tpl_id:'',
'wechatNotify_chn_tpl_id'=>!empty($wechatNotify_chn_tpl_id)?$wechatNotify_chn_tpl_id:'',
'ding_chn_tpl_id'=>!empty($ding_chn_tpl_id)?$ding_chn_tpl_id:'',
'tpl_channels_arr'=>!empty($tpl_channels_arr)?$tpl_channels_arr:[],
'template_create' => $template_create,
'msg_tpl_clses'=>$msg_tpl_clses,
'msg_tpl_sub_clses'=>$msg_tpl_sub_clses
];
return view($viewid, $data);
......
......@@ -51,4 +51,11 @@ return [
5 => '钉钉消息'
],
'msg_type' => [
1 => '公告',
2 => '活动',
3 => '新闻',
4 => '其他'
]
];
\ No newline at end of file
layui.use(['jquery','element', 'layer', 'form'], function(){
var $ = layui.$;
var element = layui.element;
var layer = layui.layer;
var form = layui.form;
//监听模板分类选择 并刷新二级分类数据
form.on('select(msg_tpl_cls)', function(data){
var sel_msg_tpl_cls = data.value;
$.ajax({
url: "/msgapi/getSubTplCls",
dataType: 'json',
data: {
sel_msg_tpl_cls: sel_msg_tpl_cls
},
success: function (result) {
var optionstring = "";
$.each(result.data, function(i,item){
optionstring += "<option value=" + item.sub_cls_id + ">" + item.sub_cls_name + "</option>";
});
$("#msg_tpl_sub_cls").html('<option value=""></option>' + optionstring);
form.render('select');
}
});
});
form.render();
});
$('#msg-tpl-submit').click(function()
{
//前端校验
......@@ -12,15 +40,15 @@ $('#msg-tpl-submit').click(function()
return false;
}
if(!$('#msg-tpl-desc1').val())
{
Prompt('请输入消息key', 5);
return false;
}
// if(!$('#msg-tpl-desc1').val())
// {
// Prompt('请输入消息描述', 5);
// return false;
// }
if(!$('#msg-tpl-desc').val())
{
Prompt('请输入模板描述', 5);
Prompt('请输入模板key', 5);
return false;
}
......@@ -114,6 +142,8 @@ function addTemplate()
tpl_id:$('#tpl-id').val(),
channels:getChosenMsgChannels(),
msg_type:$('#inner-tpl-type option:selected').val(),
cls_id:$('#msg_tpl_cls option:selected').val(),
sub_cls_id:$('#msg_tpl_sub_cls option:selected').val(),
source_type:1,
creater:$('#creater').val(),
tpl_key:$('#msg-tpl-desc1').val(),
......
......@@ -97,203 +97,243 @@
}
}
</style>
<style>
.title-width{
width: 120px;
}
</style>
@if($template_create)
<div class="wrapper wrapper-content">
<div class="col-lg-11">
<div class="ibox float-e-margins">
<div class="layui-form">
{{--外部统一模板描述+消息渠道提示--}}
<div style="margin-left: 40px;">
{{--模板iD和创建人--}}
<input id="tpl-id" type="hidden" @if(!empty($info->tpl_id)) value="{{ $info->tpl_id }}" @endif>
<input id="creater" type="hidden" @if(!empty($info->creater)) value="{{ $info->creater }}" @endif>
{{--外部统一模板描述+消息渠道提示--}}
<div style="margin-left: 40px;">
{{--模板iD和创建人--}}
<input id="tpl-id" type="hidden" value="{{ $info->tpl_id }}">
<input id="creater" type="hidden" value="{{ $info->creater }}">
<div class="col-sm-10 form-inline" style="margin-top: 20px">
<label class="col-sm-2 control-label" id="msg-tpl-channels"><span style="color: red">*</span> 消息渠道:</label>
<div class="col-sm-4">
<input type="checkbox" name="chk-channels" id="chk-channels-inner" value="1" @if(!empty($isContainInner)) checked @endif/><label>站内信</label>
<input type="checkbox" name="chk-channels" id="chk-channels-sms" value="2" @if(!empty($isContainSMS)) checked @endif/><label>短息</label>
<input type="checkbox" name="chk-channels" id="chk-channels-email" value="3" @if(!empty($isContainEmail)) checked @endif/><label>邮箱</label>
<input type="checkbox" name="chk-channels" id="chk-channels-wechat-notify" value="4" @if(!empty($isContainWechatNotify)) checked @endif/><label>微信通知</label>
<input type="checkbox" name="chk-channels" id="chk-channels-ding" value="5" @if(!empty($isContainDing)) checked @endif/><label>钉钉通知</label>
<div class="layui-form-item" style="margin-top: 30px;">
<label class="layui-form-label title-width">消息模板分类:</label>
<div class="layui-input-inline" style="width: 200px;">
<select name="msg_tpl_cls" lay-filter="msg_tpl_cls" id="msg_tpl_cls">
<option value="" selected="">请选择</option>
@foreach($msg_tpl_clses as $key=>$value)
<option value="{{$key}}" @if(!empty($info->cls_id) && $key==$info->cls_id) selected @endif>{{$value}}</option>
@endforeach
</select>
</div>
</div>
</div>
<div class="col-sm-10 form-inline" style="margin-top: 20px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 模板描述:</label>
<div class="col-sm-3">
<input type="text" id="msg-tpl-desc1" class="form-control" placeholder="请输入模板描述" value="{{ $info->ex_str }}"/>
<label id="msg-tpl-desc1-length"></label>
<div class="layui-form-item" style="margin-top: 30px;">
<label class="layui-form-label title-width">消息模板二级分类:</label>
<div class="layui-input-inline" style="width: 200px;">
<select name="msg_tpl_sub_cls" lay-filter="msg_tpl_sub_cls" id="msg_tpl_sub_cls">
<option value="" selected="">请选择</option>
@foreach($msg_tpl_sub_clses as $key=>$value)
<option value="{{$key}}" @if(!empty($info->sub_cls_id) && $key==$info->sub_cls_id) selected @endif>{{$value}}</option>
@endforeach
</select>
</div>
</div>
<div class="layui-form-item" pane="">
<label class="layui-form-label title-width">消息渠道:</label>
<div class="layui-input-inline" style="width: 80px">
<input type="checkbox" name="chk-channels" id="chk-channels-inner" title="站内信" lay-skin="primary" value="1" @if(in_array('1',$tpl_channels_arr)) checked checked @endif/>
</div>
<div class="layui-input-inline" style="width: 80px">
<input type="checkbox" name="chk-channels" id="chk-channels-sms" title="短信" lay-skin="primary" value="2" @if(in_array('2',$tpl_channels_arr)) checked checked @endif/>
</div>
<div class="layui-input-inline" style="width: 80px">
<input type="checkbox" name="chk-channels" id="chk-channels-email" title="邮箱" lay-skin="primary" value="3" @if(in_array('3',$tpl_channels_arr)) checked checked @endif/>
</div>
<div class="layui-input-inline" style="width: 80px">
<input type="checkbox" name="chk-channels" id="chk-channels-wechat-notify" title="微信通知" lay-skin="primary" value="4" @if(in_array('4',$tpl_channels_arr)) checked checked @endif/>
</div>
<div class="layui-input-inline" style="width: 80px">
<input type="checkbox" name="chk-channels" id="chk-channels-ding" title="钉钉通知" lay-skin="primary" value="5" @if(in_array('5',$tpl_channels_arr)) checked checked @endif/>
</div>
</div>
<div class="layui-form-item" style="margin-top: 20px;">
<label class="layui-form-label title-width">模板描述:</label>
<div class="layui-input-inline">
<input type="text" id="msg-tpl-desc1" class="layui-input" placeholder="请输入模板描述" @if(!empty($info->ex_str )) value="{{ $info->ex_str }}" @endif/>
</div>
</div>
</div>
<div class="col-sm-10 form-inline" style="margin-top: 20px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 消息key:</label>
<div class="col-sm-3">
<input type="text" id="msg-tpl-desc" class="form-control" placeholder="请输入消息key" value="{{ $info->description }}"/>
<label id="msg-tpl-desc-length"></label>
<div class="layui-form-item" style="margin-top: 20px;">
<label class="layui-form-label title-width">消息key:</label>
<div class="layui-input-inline">
<input type="text" id="msg-tpl-desc" class="layui-input" placeholder="请输入消息key" @if(!empty($info->description)) value="{{ $info->description }}" @endif/>
</div>
</div>
</div>
</div>
<div class="ibox-content">
<div class="row mapping-rows">
<div style="margin-left: 40px;">
<div class="ibox-content">
<div class="row mapping-rows">
<div style="margin-left: 40px;">
{{--渠道模板Tabbar--}}
<div class="tab" role="tabpanel" style="margin-top: 40px;">
{{--渠道模板Tabbar--}}
<div class="tab" role="tabpanel" style="margin-top: 40px;">
<ul class="nav nav-tabs" role="tablist" style="margin-left: 20px;">
<li role="presentation" class="active">
<a href="#innner" aria-controls="innner" role="tab" data-toggle="tab">
<i class="layui-icon">&#xe68e;</i>
<span>站内信</span>
</a>
</li>
<li role="presentation">
<a href="#sms" aria-controls="sms" role="tab" data-toggle="tab">
<i class="layui-icon">&#xe606;</i>
<span>短息</span>
</a>
</li>
<li role="presentation">
<a href="#email" aria-controls="email" role="tab" data-toggle="tab">
<i class="layui-icon">&#xe609;</i>
<span>邮件</span>
</a>
</li>
<li role="presentation">
<a href="#wechat-notify" aria-controls="wechat-notify" role="tab" data-toggle="tab">
<i class="layui-icon">&#xe63a;</i>
<span>微信通知</span>
</a>
</li>
<li role="presentation">
<a href="#ding" aria-controls="ding" role="tab" data-toggle="tab">
<i class="layui-icon">&#xe63a;</i>
<span>钉钉通知</span>
</a>
</li>
</ul>
</div>
<ul class="nav nav-tabs" role="tablist" style="margin-left: 20px;">
<li role="presentation" class="active">
<a href="#innner" aria-controls="innner" role="tab" data-toggle="tab">
<i class="layui-icon">&#xe68e;</i>
<span>站内信</span>
</a>
</li>
<li role="presentation">
<a href="#sms" aria-controls="sms" role="tab" data-toggle="tab">
<i class="layui-icon">&#xe606;</i>
<span>短息</span>
</a>
</li>
<li role="presentation">
<a href="#email" aria-controls="email" role="tab" data-toggle="tab">
<i class="layui-icon">&#xe609;</i>
<span>邮件</span>
</a>
</li>
<li role="presentation">
<a href="#wechat-notify" aria-controls="wechat-notify" role="tab" data-toggle="tab">
<i class="layui-icon">&#xe63a;</i>
<span>微信通知</span>
</a>
</li>
<li role="presentation">
<a href="#ding" aria-controls="ding" role="tab" data-toggle="tab">
<i class="layui-icon">&#xe63a;</i>
<span>钉钉通知</span>
</a>
</li>
</ul>
</div>
{{--渠道模板内容--}}
<div class="tab-content tabs">
{{--站内信--}}
<div role="tabpanel" class="tab-pane fade in active" id="innner">
<input type="hidden" id="inner-chn-tpl-id" value="{{ $inner_chn_tpl_id }}">
<div class="col-sm-10 form-inline" style="margin-top: 40px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 站内信类型:</label>
<div class="col-sm-3">
<select class="form-control" name="inner-tpl-type" id="inner-tpl-type">
@for($i=0;$i<5;$i++)
<option value="{{ $i }}" @if($i==$info->msg_type) selected @endif>{{ $msg_type[$i] }}</option>
@endfor
</select>
{{--渠道模板内容--}}
<div class="tab-content tabs">
{{--站内信--}}
<div role="tabpanel" class="tab-pane fade in active" id="innner">
<input type="hidden" id="inner-chn-tpl-id" value="{{ $inner_chn_tpl_id }}">
<div class="layui-form-item" style="margin-top: 30px;">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 站内信类型:</label>
<div class="layui-input-inline" style="width: 170px;">
<select class="form-control" name="inner-tpl-type" id="inner-tpl-type">
<option value="0" selected>请选择</option>
@foreach(Config('msgconfig.msg_type') as $k=>$v)
<option value="{{ $k }}" @if(!empty($info->msg_type) && $k==$info->msg_type) selected @endif>{{ $v }}</option>
@endforeach
</select>
</div>
</div>
</div>
<div class="col-sm-10 form-inline" style="margin-top: 20px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 站内信标题:</label>
<div class="col-sm-3">
<input type="text" id="inner-tpl-title" class="form-control" placeholder="请输入标题" value=@if(!empty($info->channel_tpls['1'])) "{{ $info->channel_tpls['1']->title }}" @endif>
<label id="inner-tpl-title-length"></label>
<div class="col-sm-10 form-inline" style="margin-top: 20px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 站内信标题:</label>
<div class="col-sm-3">
<input type="text" id="inner-tpl-title" class="form-control" placeholder="请输入标题" value=@if(!empty($info->channel_tpls['1'])) "{{ $info->channel_tpls['1']->title }}" @endif>
<label id="inner-tpl-title-length"></label>
</div>
</div>
</div>
<div class="col-sm-10" style="margin-top: 20px">
<label><span style="color: red">*</span>站内信内容:</label>
<script type="text/plain" id="inner-tpl-content">@if(!empty($info->channel_tpls['1']->content)) {!! $info->channel_tpls['1']->content !!} @endif</script>
<script type="text/javascript">UE.getEditor('inner-tpl-content');</script>
</div>
<div class="col-sm-10 form-inline" style="margin-top: 20px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 点击消息操作:</label>
<div class="col-sm-8">
<input type="radio" id="inner-tpl-op-open" name="inner-tpl-op" value="1" @if(!empty($info->channel_tpls['1']) && 1==$info->channel_tpls['1']->op_type) checked @endif/><label for="inner-tpl-op-open">打开消息</label>
<div class="col-sm-10 form-inline" style="margin-top: 20px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 站内信内容:</label>
</div>
<div class="col-sm-offset-2 col-sm-8">
<input type="radio" id="inner-tpl-op-url" name="inner-tpl-op" value="2" @if(!empty($info->channel_tpls['1']) && 2==$info->channel_tpls['1']->op_type) checked @endif/><label for="inner-tpl-op-url">打开URL</label>
<input class="form-control" type="text" id="inner-tpl-op-url-text" name="inner-tpl-url-text" placeholder="请输入URL" value=@if(!empty($info->channel_tpls['1']) && 2==$info->channel_tpls['1']->op_type) "{{ $info->channel_tpls['1']->url }}" @endif>
<div class="col-sm-10" style="margin-top: 30px;">
<script type="text/plain" id="inner-tpl-content">@if(!empty($info->channel_tpls['1']->content)) {!! $info->channel_tpls['1']->content !!} @endif</script>
<script type="text/javascript">UE.getEditor('inner-tpl-content');</script>
</div>
</div>
</div>
{{--短信--}}
<div role="tabpanel" class="tab-pane fade" id="sms">
<input type="hidden" id="sms-chn-tpl-id" value="{{ $sms_chn_tpl_id }}">
<div class="col-sm-10" style="margin-top: 40px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 短信内容:</label>
<div class="col-sm-10">
<textarea rows="2" cols="10" id="sms-tpl-content" class="form-control" placeholder="请输入短信内容">@if(!empty($info->channel_tpls['2'])) {{ $info->channel_tpls['2']->content }} @endif</textarea>
<label id="sms-content-length">预计1条短信</label>
<div class="col-sm-10 form-inline" style="margin-top: 20px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 点击消息操作:</label>
<div class="col-sm-8">
<input type="radio" id="inner-tpl-op-open" name="inner-tpl-op" value="1" @if(!empty($info->channel_tpls['1']) && 1==$info->channel_tpls['1']->op_type) checked @endif/><label for="inner-tpl-op-open">打开消息</label>
</div>
<div class="col-sm-8">
<input type="radio" id="inner-tpl-op-url" name="inner-tpl-op" value="2" @if(!empty($info->channel_tpls['1']) && 2==$info->channel_tpls['1']->op_type) checked @endif/><label for="inner-tpl-op-url">打开URL</label>
<input class="form-control" type="text" id="inner-tpl-op-url-text" name="inner-tpl-url-text" placeholder="请输入URL" value=@if(!empty($info->channel_tpls['1']) && 2==$info->channel_tpls['1']->op_type) "{{ $info->channel_tpls['1']->url }}" @endif>
</div>
</div>
</div>
</div>
{{--邮件--}}
<div role="tabpanel" class="tab-pane fade" id="email">
<input type="hidden" id="email-chn-tpl-id" value="{{ $email_chn_tpl_id }}">
<div class="col-sm-10 form-inline" style="margin-top: 40px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 邮件标题:</label>
<div class="col-sm-3">
<input type="text" id="email-tpl-title" class="form-control" placeholder="请输入邮件标题" value=@if(!empty($info->channel_tpls['3'])) "{{ $info->channel_tpls['3']->title }}" @endif>
<label id="email-tpl-title-length"></label>
{{--短信--}}
<div role="tabpanel" class="tab-pane fade" id="sms">
<input type="hidden" id="sms-chn-tpl-id" value="{{ $sms_chn_tpl_id }}">
<div class="col-sm-10" style="margin-top: 40px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 短信内容:</label>
<div class="col-sm-10">
<textarea rows="2" cols="10" id="sms-tpl-content" class="form-control" placeholder="请输入短信内容">@if(!empty($info->channel_tpls['2'])) {{ $info->channel_tpls['2']->content }} @endif</textarea>
<label id="sms-content-length">预计1条短信</label>
</div>
</div>
</div>
<div class="col-sm-10" style="margin-top: 20px">
<label><span style="color: red">*</span>邮件内容:</label>
<script type="text/plain" id="email-tpl-content">@if(!empty($info->channel_tpls['3']->content)) {!! $info->channel_tpls['3']->content !!} @endif</script>
<script type="text/javascript">UE.getEditor('email-tpl-content');</script>
</div>
</div>
{{--邮件--}}
<div role="tabpanel" class="tab-pane fade" id="email">
<input type="hidden" id="email-chn-tpl-id" value="{{ $email_chn_tpl_id }}">
<div class="col-sm-10 form-inline" style="margin-top: 40px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 邮件标题:</label>
<div class="col-sm-3">
<input type="text" id="email-tpl-title" class="form-control" placeholder="请输入邮件标题" value=@if(!empty($info->channel_tpls['3'])) "{{ $info->channel_tpls['3']->title }}" @endif>
<label id="email-tpl-title-length"></label>
</div>
</div>
{{--微信通知--}}
<div role="tabpanel" class="tab-pane fade" id="wechat-notify">
<input type="hidden" id="wechatnotify-chn-tpl-id" value="{{ $wechatNotify_chn_tpl_id }}">
<div class="col-sm-10 form-inline" style="margin-top: 40px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 微信模板ID:</label>
<div class="col-sm-3">
<input type="text" id="wechat-notify-tpl-title" class="form-control" placeholder="请输入微信模板编号" value=@if(!empty($info->channel_tpls['4'])) "{{ $info->channel_tpls['4']->title }}" @endif>
<div class="col-sm-10" style="margin-top: 20px">
<label><span style="color: red">*</span>邮件内容:</label>
<script type="text/plain" id="email-tpl-content">@if(!empty($info->channel_tpls['3']->content)) {!! $info->channel_tpls['3']->content !!} @endif</script>
<script type="text/javascript">UE.getEditor('email-tpl-content');</script>
</div>
</div>
<div class="col-sm-10 form-inline" style="margin-top: 40px">
<label class="col-sm-2 control-label"> 微信模板头:</label>
<div class="col-sm-3">
<input type="text" id="wechat-notify-tpl-head" class="form-control" placeholder="请输入微信模板头" value=@if(!empty($info->channel_tpls['4'])) "{{ $info->channel_tpls['4']->content['wechat_tpl_head'] }}" @endif>
{{--微信通知--}}
<div role="tabpanel" class="tab-pane fade" id="wechat-notify">
<input type="hidden" id="wechatnotify-chn-tpl-id" value="{{ $wechatNotify_chn_tpl_id }}">
<div class="col-sm-10 form-inline" style="margin-top: 40px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 微信模板ID:</label>
<div class="col-sm-3">
<input type="text" id="wechat-notify-tpl-title" class="form-control" placeholder="请输入微信模板编号" value=@if(!empty($info->channel_tpls['4'])) "{{ $info->channel_tpls['4']->title }}" @endif>
</div>
</div>
</div>
<div class="col-sm-10 form-inline" style="margin-top: 40px">
<label class="col-sm-2 control-label"> 微信模板尾:</label>
<div class="col-sm-3">
<input type="text" id="wechat-notify-tpl-tail" class="form-control" placeholder="请输入微信模板尾" value=@if(!empty($info->channel_tpls['4'])) "{{ $info->channel_tpls['4']->content['wechat_tpl_tail'] }}" @endif>
<div class="col-sm-10 form-inline" style="margin-top: 40px">
<label class="col-sm-2 control-label"> 微信模板头:</label>
<div class="col-sm-3">
<input type="text" id="wechat-notify-tpl-head" class="form-control" placeholder="请输入微信模板头" value=@if(!empty($info->channel_tpls['4'])) "{{ $info->channel_tpls['4']->content['wechat_tpl_head'] }}" @endif>
</div>
</div>
</div>
<div class="col-sm-10 form-inline" style="margin-top: 40px">
<label class="col-sm-2 control-label"> 跳转URL:</label>
<div class="col-sm-3">
<input type="text" id="wechat-notify-tpl-url" class="form-control" placeholder="请输入跳转URL" value=@if(!empty($info->channel_tpls['4'])) "{{ $info->channel_tpls['4']->url }}" @endif>
<div class="col-sm-10 form-inline" style="margin-top: 40px">
<label class="col-sm-2 control-label"> 微信模板尾:</label>
<div class="col-sm-3">
<input type="text" id="wechat-notify-tpl-tail" class="form-control" placeholder="请输入微信模板尾" value=@if(!empty($info->channel_tpls['4'])) "{{ $info->channel_tpls['4']->content['wechat_tpl_tail'] }}" @endif>
</div>
</div>
<div class="col-sm-10 form-inline" style="margin-top: 40px">
<label class="col-sm-2 control-label"> 跳转URL:</label>
<div class="col-sm-3">
<input type="text" id="wechat-notify-tpl-url" class="form-control" placeholder="请输入跳转URL" value=@if(!empty($info->channel_tpls['4'])) "{{ $info->channel_tpls['4']->url }}" @endif>
</div>
</div>
</div>
</div>
{{--钉钉消息--}}
<div role="tabpanel" class="tab-pane fade" id="ding">
<input type="hidden" id="ding-chn-tpl-id" value="{{ $ding_chn_tpl_id }}">
<div class="col-sm-10" style="margin-top: 40px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 钉钉消息内容:</label>
<div class="col-sm-10">
<textarea rows="2" cols="10" id="ding-tpl-content" class="form-control" placeholder="请输入钉钉消息内容">@if(!empty($info->channel_tpls['5'])) {{ $info->channel_tpls['5']->content }} @endif</textarea>
<label id="ding-content-length"></label>
{{--钉钉消息--}}
<div role="tabpanel" class="tab-pane fade" id="ding">
<input type="hidden" id="ding-chn-tpl-id" value="{{ $ding_chn_tpl_id }}">
<div class="col-sm-10" style="margin-top: 40px">
<label class="col-sm-2 control-label"><span style="color: red">*</span> 钉钉消息内容:</label>
<div class="col-sm-10">
<textarea rows="2" cols="10" id="ding-tpl-content" class="form-control" placeholder="请输入钉钉消息内容">@if(!empty($info->channel_tpls['5'])) {{ $info->channel_tpls['5']->content }} @endif</textarea>
<label id="ding-content-length"></label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
......
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