You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
49
hyhproject/admin/view/templatemsgs/edit_email.html
Executable file
49
hyhproject/admin/view/templatemsgs/edit_email.html
Executable file
@ -0,0 +1,49 @@
|
||||
{extend name="base" /}
|
||||
{block name="js"}
|
||||
<script src="__STATIC__/plugins/kindeditor/kindeditor.js?v={$v}" type="text/javascript" ></script>
|
||||
<script src="__ADMIN__/templatemsgs/templatemsgs.js?v={$v}" type="text/javascript"></script>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="l-loading" style="display: block" id="wst-loading"></div>
|
||||
<form autocomplete='off'>
|
||||
<input type='hidden' id='id' class='ipt' value="{$object['id']}"/>
|
||||
<input type='hidden' id='tplCode' class='ipt' value="{$object['tplCode']}"/>
|
||||
<table class='wst-form wst-box-top layui-form'>
|
||||
<tr>
|
||||
<th width='120'>发送时机:</th>
|
||||
<td>
|
||||
{volist name=':WSTDatas("TEMPLATE_EMAIL")' id='vo'}
|
||||
{if $vo['dataVal']==$object['tplCode']}{$vo['dataName']}{/if}
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>内容:</th>
|
||||
<td>
|
||||
<textarea id='tplContent' name='tplContent' style='width:70%;height:100px;' class='ipt' maxLength='150'>{$object['tplContent']}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>是否开启:</th>
|
||||
<td>
|
||||
<input type="checkbox" {if $object['status']==1}checked{/if} value='1' class="ipt" id="isShow2" name="seoMallSwitch" lay-skin="switch" lay-filter="isShow2" lay-text="开启|关闭">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th valign="top">说明:</th>
|
||||
<td id='tplDesc'>{$object['tplDesc']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' align='center' class='wst-bottombar'>
|
||||
<button type="button" class="btn btn-primary btn-mright" onclick='javascript:save(1)'><i class="fa fa-check"></i>保存</button>
|
||||
<button type="button" class="btn" onclick="javascript:history.go(-1)"><i class="fa fa-angle-double-left"></i>返回</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<script>
|
||||
$(function(){
|
||||
initEditor();
|
||||
});
|
||||
</script>
|
||||
{/block}
|
43
hyhproject/admin/view/templatemsgs/edit_msg.html
Executable file
43
hyhproject/admin/view/templatemsgs/edit_msg.html
Executable file
@ -0,0 +1,43 @@
|
||||
{extend name="base" /}
|
||||
{block name="js"}
|
||||
<script src="__ADMIN__/templatemsgs/templatemsgs.js?v={$v}" type="text/javascript"></script>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="l-loading" style="display: block" id="wst-loading"></div>
|
||||
<form autocomplete='off'>
|
||||
<input type='hidden' id='id' class='ipt' value="{$object['id']}"/>
|
||||
<input type='hidden' id='tplCode' class='ipt' value="{$object['tplCode']}"/>
|
||||
<table class='wst-form wst-box-top layui-form'>
|
||||
<tr>
|
||||
<th width='120'>发送时机:</th>
|
||||
<td>
|
||||
{volist name=':WSTDatas("TEMPLATE_SYS")' id='vo'}
|
||||
{if $vo['dataVal']==$object['tplCode']}{$vo['dataName']}{/if}
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>内容:</th>
|
||||
<td>
|
||||
<textarea id='tplContent' style='width:70%;height:100px;' class='ipt' maxLength='150'>{$object['tplContent']}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>是否开启:</th>
|
||||
<td>
|
||||
<input type="checkbox" {if $object['status']==1}checked{/if} value='1' class="ipt" id="isShow" name="seoMallSwitch" lay-skin="switch" lay-filter="isShow" lay-text="开启|关闭">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th valign="top">说明:</th>
|
||||
<td id='tplDesc'>{$object['tplDesc']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' align='center' class='wst-bottombar'>
|
||||
<button type="button" class="btn btn-primary btn-mright" onclick='javascript:save(0)'><i class="fa fa-check"></i>保存</button>
|
||||
<button type="button" class="btn" onclick="javascript:history.go(-1)"><i class="fa fa-angle-double-left"></i>返回</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{/block}
|
43
hyhproject/admin/view/templatemsgs/edit_sms.html
Executable file
43
hyhproject/admin/view/templatemsgs/edit_sms.html
Executable file
@ -0,0 +1,43 @@
|
||||
{extend name="base" /}
|
||||
{block name="js"}
|
||||
<script src="__ADMIN__/templatemsgs/templatemsgs.js?v={$v}" type="text/javascript"></script>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="l-loading" style="display: block" id="wst-loading"></div>
|
||||
<form autocomplete='off'>
|
||||
<input type='hidden' id='id' class='ipt' value="{$object['id']}"/>
|
||||
<input type='hidden' id='tplCode' class='ipt' value="{$object['tplCode']}"/>
|
||||
<table class='wst-form wst-box-top layui-form'>
|
||||
<tr>
|
||||
<th width='120'>发送时机:</th>
|
||||
<td>
|
||||
{volist name=':WSTDatas("TEMPLATE_SMS")' id='vo'}
|
||||
{if $vo['dataVal']==$object['tplCode']}{$vo['dataName']}{/if}
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>内容:</th>
|
||||
<td>
|
||||
<textarea id='tplContent' style='width:70%;height:100px;' class='ipt' maxLength='150'>{$object['tplContent']}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>是否开启:</th>
|
||||
<td>
|
||||
<input type="checkbox" {if $object['status']==1}checked{/if} value='1' class="ipt" id="isShow3" name="seoMallSwitch" lay-skin="switch" lay-filter="isShow3" lay-text="开启|关闭">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th valign="top">说明:</th>
|
||||
<td id='tplDesc'>{$object['tplDesc']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' align='center' class='wst-bottombar'>
|
||||
<button type="button" class="btn btn-primary btn-mright" onclick='javascript:save(2)'><i class="fa fa-check"></i>保存</button>
|
||||
<button type="button" class="btn" onclick="javascript:history.go(-1)"><i class="fa fa-angle-double-left"></i>返回</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{/block}
|
61
hyhproject/admin/view/templatemsgs/list.html
Executable file
61
hyhproject/admin/view/templatemsgs/list.html
Executable file
@ -0,0 +1,61 @@
|
||||
{extend name="base" /}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" type="text/css" href="__ADMIN__/js/mmgrid/mmGrid.css?v={$v}" />
|
||||
<style>
|
||||
body{overflow:hidden;}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script src="__ADMIN__/js/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script>
|
||||
<script src="__ADMIN__/templatemsgs/templatemsgs.js?v={$v}" type="text/javascript"></script>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-tab layui-tab-brief " lay-filter="msgTab">
|
||||
<ul class="layui-tab-title">
|
||||
<li {if condition="$src==0"}class="layui-this"{/if} onclick="initGridMsg(0)">消息模板</li>
|
||||
<li {if condition="$src==1"}class="layui-this"{/if} onclick="initGridEmail(0)">邮件模板</li>
|
||||
<li {if condition="$src==2"}class="layui-this"{/if} onclick="initGridSMS(0)">短信模板</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content " style="padding: 0px 0;">
|
||||
<div id="template_msg" class="layui-tab-item {if condition='$src==0'}layui-show{/if}">
|
||||
<div class='wst-grid' style='margin-top:5px'>
|
||||
<div id="mmg1" class="mmg1 layui-form"></div>
|
||||
<div id="pg1" style="text-align: right;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="template_email" class="layui-tab-item {if condition='$src==1'}layui-show{/if}">
|
||||
<div class='wst-grid' style='margin-top:5px'>
|
||||
<div id="mmg2" class="mmg2 layui-form"></div>
|
||||
<div id="pg2" style="text-align: right;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="template_sms" class="layui-tab-item {if condition='$src==2'}layui-show{/if}">
|
||||
<div id='alertTips' class='alert alert-success alert-tips fade in'>
|
||||
<div id='headTip' class='head'><i class='fa fa-lightbulb-o'></i>操作说明</div>
|
||||
<ul class='body'>
|
||||
<li>本功能主要用于管理短信发送的模板格式。</li>
|
||||
<li>若短信服务商未要求预先定义模板,则发送时以本系统模板为主(例如中国网建)。</li>
|
||||
<li>若短信服务商要求必须预先定义模板的(例如阿里云-云通信),则本系统中的模板仅作为建模参考,发送格式以短信服务商上的模板为主。</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='wst-grid'>
|
||||
<div id="mmg3" class="mmg3 layui-form"></div>
|
||||
<div id="pg3" style="text-align: right;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
h = WST.pageHeight();
|
||||
{if condition='$src==1'}
|
||||
initGridEmail(0);
|
||||
{elseif condition='$src==2'}
|
||||
initGridSMS(0);
|
||||
{else/}
|
||||
initGridMsg(0);
|
||||
{/if}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
|
196
hyhproject/admin/view/templatemsgs/templatemsgs.js
Executable file
196
hyhproject/admin/view/templatemsgs/templatemsgs.js
Executable file
@ -0,0 +1,196 @@
|
||||
var mmg,h;
|
||||
function initGridMsg(){
|
||||
var cols = [
|
||||
{title:'发送时机', name:'tplCode', width: 80},
|
||||
{title:'发送内容', name:'tplContent' ,width:600},
|
||||
{title:'是否开启', name:'status',align:'center',width:50,renderer: function(val,item,rowIndex){
|
||||
return '<input type="checkbox" '+((item['status']==1)?"checked":"")+' name="isShow2" lay-skin="switch" lay-filter="isShow2" data="'+item['id']+'" lay-text="开启|关闭">';
|
||||
|
||||
}},
|
||||
{title:'操作', name:'' ,width:20, align:'center', renderer: function(val,item,rowIndex){
|
||||
var h = "";
|
||||
if(WST.GRANT.XXMB_02)h += "<a class='btn btn-blue' onclick='javascript:toEditMsg("+item['id']+")'><i class='fa fa-pencil'></i>修改</a> ";
|
||||
return h;
|
||||
}}
|
||||
];
|
||||
|
||||
mmg = $('.mmg1').mmGrid({height: h-80,indexCol: true, cols: cols,method:'POST',
|
||||
url: WST.U('admin/templatemsgs/pageMsgQuery'), fullWidthRows: true, autoLoad: true,
|
||||
plugins: [
|
||||
$('#pg1').mmPaginator({})
|
||||
]
|
||||
});
|
||||
mmg.on('loadSuccess',function(){
|
||||
layui.form.render();
|
||||
layui.form.on('switch(isShow2)', function(data){
|
||||
var id = $(this).attr("data");
|
||||
if(this.checked){
|
||||
toggleIsShow(0,id);
|
||||
}else{
|
||||
toggleIsShow(1,id);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
function initGridEmail(){
|
||||
var cols = [
|
||||
{title:'发送时机', name:'tplCode', width: 80},
|
||||
{title:'发送内容', name:'tplContent' ,width:600},
|
||||
{title:'是否开启', name:'status',align:'center',width:50,renderer: function(val,item,rowIndex){
|
||||
return '<input type="checkbox" '+((item['status']==1)?"checked":"")+' name="isShow3" lay-skin="switch" lay-filter="isShow3" data="'+item['id']+'" lay-text="开启|关闭">';
|
||||
|
||||
}},
|
||||
{title:'操作', name:'' ,width:20, align:'center', renderer: function(val,item,rowIndex){
|
||||
var h = "";
|
||||
if(WST.GRANT.XXMB_02)h += "<a class='btn btn-blue' onclick='javascript:toEditEmail("+item['id']+")'><i class='fa fa-pencil'></i>修改</a> ";
|
||||
return h;
|
||||
}}
|
||||
];
|
||||
|
||||
mmg = $('.mmg2').mmGrid({height: h-80,indexCol: true, cols: cols,method:'POST',
|
||||
url: WST.U('admin/templatemsgs/pageEmailQuery'), fullWidthRows: true, autoLoad: true,
|
||||
plugins: [
|
||||
$('#pg2').mmPaginator({})
|
||||
]
|
||||
});
|
||||
mmg.on('loadSuccess',function(){
|
||||
layui.form.render();
|
||||
layui.form.on('switch(isShow3)', function(data){
|
||||
var id = $(this).attr("data");
|
||||
if(this.checked){
|
||||
toggleIsShow(0,id);
|
||||
}else{
|
||||
toggleIsShow(1,id);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
function initGridSMS(){
|
||||
var cols = [
|
||||
{title:'发送时机', name:'tplCode', width: 80},
|
||||
{title:'发送内容', name:'tplContent' ,width:600},
|
||||
{title:'是否开启', name:'status',align:'center',width:50,renderer: function(val,item,rowIndex){
|
||||
return '<input type="checkbox" '+((item['status']==1)?"checked":"")+' name="isShow4" lay-skin="switch" lay-filter="isShow4" data="'+item['id']+'" lay-text="开启|关闭">';
|
||||
|
||||
}},
|
||||
{title:'操作', name:'' ,width:20, align:'center', renderer: function(val,item,rowIndex){
|
||||
var h = "";
|
||||
if(WST.GRANT.XXMB_02)h += "<a class='btn btn-blue' onclick='javascript:toEditSMS("+item['id']+")'><i class='fa fa-pencil'></i>修改</a> ";
|
||||
return h;
|
||||
}}
|
||||
];
|
||||
|
||||
mmg = $('.mmg3').mmGrid({height: h-182,indexCol: true, cols: cols,method:'POST',
|
||||
url: WST.U('admin/templatemsgs/pageSMSQuery'), fullWidthRows: true, autoLoad: true,
|
||||
plugins: [
|
||||
$('#pg3').mmPaginator({})
|
||||
]
|
||||
});
|
||||
mmg.on('loadSuccess',function(){
|
||||
layui.form.render();
|
||||
layui.form.on('switch(isShow4)', function(data){
|
||||
var id = $(this).attr("data");
|
||||
if(this.checked){
|
||||
toggleIsShow(0,id);
|
||||
}else{
|
||||
toggleIsShow(1,id);
|
||||
}
|
||||
});
|
||||
})
|
||||
$('#headTip').WSTTips({width:90,height:35,callback:function(v){
|
||||
if(v){
|
||||
mmg.resize({height:h-182});
|
||||
}else{
|
||||
mmg.resize({height:h-124});
|
||||
}
|
||||
}});
|
||||
}
|
||||
|
||||
function toggleIsShow(t,v){
|
||||
if(!WST.GRANT.DQGL_02)return;
|
||||
var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
|
||||
$.post(WST.U('admin/TemplateMsgs/editiIsShow'),{id:v,status:t},function(data,textStatus){
|
||||
layer.close(loading);
|
||||
var json = WST.toAdminJson(data);
|
||||
if(json.status=='1'){
|
||||
WST.msg(json.msg,{icon:1});
|
||||
grid.reload();
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
});
|
||||
}
|
||||
var editor1;
|
||||
function initEditor(){
|
||||
KindEditor.ready(function(K) {
|
||||
editor1 = K.create('textarea[name="tplContent"]', {
|
||||
uploadJson : WST.conf.ROOT+'/admin/messages/editorUpload',
|
||||
height:'350px',
|
||||
allowFileManager : false,
|
||||
allowImageUpload : true,
|
||||
items:[
|
||||
'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
|
||||
'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
|
||||
'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
|
||||
'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
|
||||
'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
|
||||
'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|','image','table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
|
||||
'anchor', 'link', 'unlink', '|', 'about'
|
||||
],
|
||||
afterBlur: function(){ this.sync(); }
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function toEditMsg(id){
|
||||
location.href = WST.U('admin/templatemsgs/toEditMsg','id='+id);
|
||||
}
|
||||
function toEditEmail(id){
|
||||
location.href = WST.U('admin/templatemsgs/toEditEmail','id='+id);
|
||||
}
|
||||
function toEditSMS(id){
|
||||
location.href = WST.U('admin/templatemsgs/toEditSMS','id='+id);
|
||||
}
|
||||
function save(type){
|
||||
var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
|
||||
var params = WST.getParams('.ipt');
|
||||
$.post(WST.U('admin/templatemsgs/edit'),params,function(data,textStatus){
|
||||
layer.close(loading);
|
||||
var json = WST.toAdminJson(data);
|
||||
if(json.status=='1'){
|
||||
WST.msg("操作成功",{icon:1});
|
||||
location.href = WST.U('admin/templatemsgs/index','src='+type);
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
});
|
||||
}
|
||||
var isInit1 = false;
|
||||
var isInit2 = false;
|
||||
var isInit3 = false;
|
||||
//切换卡
|
||||
$(function (){
|
||||
var element = layui.element;
|
||||
element.on('tab(msgTab)', function(data){
|
||||
if(data.index==0){
|
||||
if(!isInit1){
|
||||
isInit1 = true;
|
||||
initGridMsg();
|
||||
}
|
||||
}else if(data.index==1){
|
||||
if(!isInit2){
|
||||
isInit2 = true;
|
||||
initGridEmail();
|
||||
}
|
||||
}else if(data.index==2){
|
||||
if(!isInit3){
|
||||
isInit3 = true;
|
||||
initGridSMS();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user