Reply_wev8.js 2.2 KB
define("Reply_html",function(){return'<div id="NMEC_${id}" class="wev-comp-${compType}">\t<div class="wev-reply-btn" title="${btnName}">$${btnName}</div>\t<div class="wev-reply-formwrap">\t\t<form class="wev-reply-form"  method="post" action="${actionUrl}">\t\t{@each params as param,index}\t\t{@if param.isSystem == \'1\'}\t\t\t<input type="text" class="wev-reply-content" name="${param.paramName}" placeholder="${placeholder}" />\t\t{@else}\t\t\t<input type="hidden"  name="${param.paramName}" value="${param.paramValue}" paramkey="${param.paramKey}"/>\t\t{@/if}\t\t{@/each}\t\t{@if autoSave}\t\t\t<input type="hidden"  name="datasource" value="${datasource}" />\t\t\t<input type="hidden"  name="tablename" value="${tablename}" />\t\t\t<input type="hidden"  name="modelid" value="${modelid}" />\t\t{@/if}\t\t</form>\t</div></div>'}),define(["mUtil","Component"],function(p,e){return e.init(function(t){e.super(this,t),this.type="Reply",this.tpl=this.type+"_html",this.css=this.type+"_css";var r=this.viewModel={btnName:"",isShow:!0,autoSave:!0,actionUrl:"",tablename:"",datasource:"",placeholder:"",modelid:"",params:[],callback:null};this.mounted=function(){var o=this,n=this.type,a=this.$el,i=this.$container,l=a.children(".wev-comp-"+n);this.$once("moveComponent",function(){var t=i.children(".page-footer"),e=i.children(".page-content");t.length||(t=$('<div class="page-footer"></div>'),e.after(t)),a.parent().hasClass("page-footer")||(a.find("script").remove(),t.append(a).show()),1==r.isShow&&l.show(),t.height()?(t.attr("footer-height",t.height()),e.css("bottom",t.height()+"px")):t.attr("footer-height")?e.css("bottom",t.attr("footer-height")+"px"):e.css("bottom","0px")});var s=$(".wev-reply-btn",l);s.click(function(t){if($(".wev-reply-content",l).val()){if(!s.hasClass("disabled")){var e=$(".wev-reply-form",l),a=r.autoSave?p.getActionUrl(n,{action:"saveReplyData"},o.pageid):r.actionUrl,i=e.serialize();s.addClass("disabled"),p.getJSON(a,i,function(t){e[0].reset(),r.callback&&p.eval(r.callback,o.pageid),s.removeClass("disabled")},function(e){p.getLabel(4710,"保存失败",function(t){Mobile_NS.msg(e||t)}),s.removeClass("disabled")}),t.stopPropagation()}}else p.getLabel(5284,"内容不能为空",function(t){Mobile_NS.msg(t)})})}})});