123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <div id="mailList" class="plg-tab-container">
- <div id="mail" class="grid-container-full"></div>
- </div>
- <div id="mailList_mywin" style="display: none;height: 550px;">
- <div id="mailList_g1"></div>
- </div>
- <style type="text/css">
- .layui-form-label{width:210px;}
- .layui-input{width:66%;}
- .plg-btn-height-auto, .plg-btn-normal, .plg-btn-normal:hover {
- height: auto!important;
- }
- .plg-btn-normal, .plg-btn-normal:hover {
- border-radius: 4px;
- box-shadow: 0 2px 0 rgba(0, 0, 0, 0.015);
- color: rgba(0, 0, 0, 0.65);
- background-color: #fff;
- border-color: #d9d9d9;
- }
- .plg-btn-normal {
- border: 1px solid rgb(217, 217, 217)!important;
- }
- .plg-btn-normal:hover {
- border: 1px solid #3da0e3!important;
- }
- </style>
- <script type="text/javascript">
- (function(){
-
- var form=$("#mailList #form1");
-
- var opts = {
- skin:"terrace",
- columns:[
- {id:"id",name:"id",type:'txt',width:100,hidden:true},
- {id:"toAddress",name:"收件人邮箱",type:'ro',width:150},
- {id:"subject",name:"邮件标题",type:'ro',width:200},
- {id:"content",name:"邮件内容",type:'ro',width:"*"},
- {id:"attachment",name:"附件",type:'ro',width:150, hidden:true},
- {id:"fromName",name:"发件人名称",type:'ro',width:120},
- {id:"createTime",name:"创建时间",type:'ro',width:200},
- {id:"host",name:"邮件服务器",type:'ro',width:150, hidden:true},
- {id:"fromAddress",name:"发件人邮箱",type:'ro',width:150,hidden:true}
- // {id:"systemId",name:"系统id",type:'ro',width:150,hidden:true}
- ],
- toolbar:[
- {type:"combo", name:"systemId", label:"系统id:", width:140},{type: "newcolumn"},
- {type:"button", name:"addBtn", className:"plg-toolbar-right",value:"<i class='layui-icon layui-icon-add-1'></i>写邮件"},{type: "newcolumn"},
- {type:"input", name:"toAddress", label:"收件人邮箱:",offsetLeft:10, placeholder: '请输入收件人邮箱'},{type: "newcolumn"},
- {type:"input", name:"content", label:"邮件内容:",offsetLeft:10, placeholder: '请输入邮件内容'},{type: "newcolumn"},
- {type:"button", name:"searchBtn", className:"", value:"查询"},{type: "newcolumn"},
- {type:"button", name:"all", className:"normal", value:"所有"}
- ],
- formData:[
- {type:"settings",inputWidth :300,width:400,labelWidth:80,position:"label-left",labelAlign:"left"},
- {type: "hidden", name:"id", value:""},
- {type: "input", name: "toAddress", label: "收件人邮箱:", validate: 'NotEmpty', required: true, placeholder: '多收件人请用";"分隔'},
- {type: "input", name:"subject", label:"邮件标题:", validate: 'NotEmpty', required: true, placeholder: '请输入邮件标题'},
- {type: "input", name:"fromName", label:"发件人名称:"},
- {type: "combo", name: "systemId", width:300, label: "系统id:", remote:{url:'/api/service-users/sys/getSelectSystem/v1.0',data:{},valueField:"val",textField:"val",method:"get"}},
- {type: "input", name:"content", label:"邮件内容:", validate: 'NotEmpty', required: true, placeholder: '请输入邮件内容',rows: 5}
- ],
- pagebar:{
- buttons:[
- {text:"<i class='layui-icon layui-icon-delete '></i>删除",className:"layui-btn-danger plg-btn-height-auto",name:"delete"}
- ]
- },
- url:"/api/service-mail/mail",//数据接口
- type:"get",//数据提交方式,默认为get
- params:{pageNum:1,pageSize:10},//查询提交参数,分页参数默认为pageNum,pageSize
- page:true, //是否启用分页
- multiselect:true,//是否支持多选
- imagePath:"../../prologui/assets/PlgGrid/",
- totalCount:"totalCount" //总记录数字段,默认totalCount
- };
- var mail = new PlgGrid(opts);
- mail.renderTo("mail");
- mail.loadData();
-
- mail.attachToolBarEvent("onButtonClick", function(name,ids){
- if(name=="searchBtn"){
- var fdata = mail.getToolBarForm().getFormData();
- mail.setParams(fdata);
- mail.reload();
- }else if(name=="all"){
- mail.setParams({pageNum:1,pageSize:10,systemId:"",name:""});
- mail.reload();
- }else if(name=="addBtn"){
- mailList_add();
- }
- });
-
- mail.attachPageBarEvent(function(name,ids){
- if(name=="delete"){
- if(ids==""){
- return;
- }
- PlgDialog.confirm('确定删除?', {
- title:'删除提示',
- btnAlign:'c',
- btn: ['确定', '取消'] //可以无限个按钮
- }, function(index, layero){
- $.ajax({
- url: '/api/service-mail/mail/del',
- type: 'post',
- data:{id:ids},
- success:function (data) {
- PlgDialog.close(index);
- mail.reload();
- PlgDialog.msg(data.message);
- }
- });
- });
- }
- });
- function mailList_add(){
- mail.showDialog(0,"写邮件",450,400,{url:"/api/service-mail/mail/sendMail",type:"post",contentType:"application/x-www-form-urlencoded"});
- var g = mail.getGridForm();
- g.loadComboData("systemId",{url:'/api/service-users/sys/getSelectSystem/v1.0',data:{},valueField:"val",textField:"val",method:"get"});
- }
-
- // mail.on("onRowDblClicked",function(){
- // mail.showDialog(1,"编辑",450,300,{url:"/api/service-quartz/mail",type:"put",contentType:"application/json"});
- // });
-
- var f = mail.getToolBarForm();
- f.loadComboData("systemId",{url:'/api/service-users/sys/getSelectSystem/v1.0',data:{},valueField:"val",textField:"val",method:"get"});
- })()
-
- </script>
|