sysEveDesktopAdd.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

layui.config({
	base: basePath, 
	version: skyeyeVersion
}).extend({
    window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
	winui.renderColor();
	layui.use(['form'], function (form) {
		var index = parent.layer.getFrameIndex(window.name);
	    var $ = layui.$;
	    
	    matchingLanguage();
 		form.render();
 	    form.on('submit(formAddBean)', function (data) {
 	        if (winui.verifyForm(data.elem)) {
 	        	var params = {
 	        		desktopName: $("#desktopName").val(),
 	        		desktopCnName: $("#desktopCnName").val()
 	        	};
21
 	        	AjaxPostUtil.request({url: reqBasePath + "desktop002", params: params, type: 'json', callback: function(json) {
doc_wei's avatar
doc_wei 已提交
22 23 24 25
 	        		if(json.returnCode == 0){
 	        			parent.layer.close(index);
 	        			parent.refreshCode = '0';
 	        		}else{
26
 	        			winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
doc_wei's avatar
doc_wei 已提交
27 28 29 30 31 32
 	        		}
 	        	}});
 	        }
 	        return false;
 	    });
 	    
33
	    $("body").on("click", "#cancle", function() {
doc_wei's avatar
doc_wei 已提交
34 35 36 37
	    	parent.layer.close(index);
	    });
	});
});