addpagebeanitem.js 1.1 KB
Newer Older
doc_wei's avatar
doc_wei 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
layui.config({
	base: basePath, 
	version: skyeyeVersion
}).extend({
    window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui'], function (exports) {
	winui.renderColor();
	layui.use(['form'], function (form) {
		var index = parent.layer.getFrameIndex(window.name);
	    var $ = layui.$,
	    	form = layui.form;
	    
	    matchingLanguage();
 		form.render();
	    form.on('submit(formAddBean)', function (data) {
	        if (winui.verifyForm(data.elem)) {
	        	var params = {
        			name: $("#pageName").val(),
        			filePath: $("#filePath").val(),
        			fileName: $("#fileName").val(),
        			rowId: parent.proId
	        	};
	        	
doc_wei's avatar
doc_wei 已提交
24
	        	AjaxPostUtil.request({url:reqBasePath + "rmxcx030", params:params, type: 'json', callback: function(json){
doc_wei's avatar
doc_wei 已提交
25
	 	   			if (json.returnCode == 0) {
doc_wei's avatar
doc_wei 已提交
26 27 28
		 	   			parent.layer.close(index);
		 	        	parent.refreshCode = '0';
	 	   			}else{
doc_wei's avatar
doc_wei 已提交
29
	 	   				winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
doc_wei's avatar
doc_wei 已提交
30 31 32 33 34 35 36 37 38 39 40
	 	   			}
	 	   		}});
	        }
	        return false;
	    });
	    
	    $("body").on("click", "#cancle", function(){
	    	parent.layer.close(index);
	    });
	});
});