sysEveWinEdit.js 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

layui.config({
	base: basePath, 
	version: skyeyeVersion
}).extend({
    window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'fileUpload'], function (exports) {
	winui.renderColor();
	layui.use(['form', 'textool'], function (form) {
		var index = parent.layer.getFrameIndex(window.name);
	    var $ = layui.$,
		    form = layui.form,
			textool = layui.textool;
	    
	    AjaxPostUtil.request({url: reqBasePath + "sysevewin003", params: {id: parent.rowId}, type: 'json', method: "GET", callback: function (json) {
16
			$("#name").val(json.bean.name);
17 18 19 20 21 22 23 24 25
			$("#sysUrl").val(json.bean.sysUrl);
			$("#content").val(json.bean.content);
			textool.init({eleId: 'content', maxlength: 200});
		}});
   		matchingLanguage();
		form.render();
	    form.on('submit(formEditBean)', function (data) {
	        if (winui.verifyForm(data.elem)) {
        		var params = {
26
					name: $("#name").val(),
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
					content: $("#content").val(),
					sysUrl: $("#sysUrl").val(),
    				id: parent.rowId,
        		};
    			AjaxPostUtil.request({url: reqBasePath + "writeSysEveWinMation", params: params, type: 'json', method: "POST", callback: function (json) {
					parent.layer.close(index);
					parent.refreshCode = '0';
    			}});
	        }
	        return false;
	    });
	    
	    // 取消
	    $("body").on("click", "#cancle", function() {
	    	parent.layer.close(index);
	    });
	    
	});
});