actModelEdit.js 2.4 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

layui.config({
	base: basePath, 
	version: skyeyeVersion
}).extend({
    window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'colorpicker', 'textool', 'fileUpload'], function (exports) {
	winui.renderColor();
	layui.use(['form'], function (form) {
		var index = parent.layer.getFrameIndex(window.name);
	    var $ = layui.$;
	    var colorpicker = layui.colorpicker,
	    	textool = layui.textool;
	    
	    showGrid({
		 	id: "showForm",
		 	url: flowableBasePath + "queryActModelMationById",
		 	params: {id: parent.rowId},
			method: 'GET',
		 	pagination: false,
		 	template: $("#beanTemplate").html(),
doc_wei's avatar
doc_wei 已提交
22
		 	ajaxSendAfter: function (json) {
doc_wei's avatar
doc_wei 已提交
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
				$("input:radio[name=commonUsed][value=" + json.bean.commonUsed + "]").attr("checked", true);

				// 加载图标信息
				systemCommonUtil.initEditIconChooseHtml('iconMation', form, colorpicker, 17, json.bean);

		 		textool.init({eleId: 'remark', maxlength: 200});
		 		
		        matchingLanguage();
		 		form.render();
		 	    form.on('submit(formEditBean)', function (data) {
		 	        if (winui.verifyForm(data.elem)) {
		 	        	var params = {
		 	        		id: parent.rowId,
		 	        		title: $("#title").val(),
		 	        		tokenUrl: $("#tokenUrl").val(),
		 	        		remark: $("#remark").val(),
doc_wei's avatar
doc_wei 已提交
39
							commonUsed: data.field.commonUsed,
doc_wei's avatar
doc_wei 已提交
40 41 42 43
							actFlowId: $("#actFlowId").attr("actFlowId"),
							addPageUrl: $("#addPageUrl").val(),
							editPageUrl: $("#editPageUrl").val(),
							revokeMapping: $("#revokeMapping").val()
doc_wei's avatar
doc_wei 已提交
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
		 	        	};
						// 获取图标信息
						params = systemCommonUtil.getIconChoose(params);
						if (!params["iconChooseResult"]) {
							return false;
						}

		 	        	AjaxPostUtil.request({url: flowableBasePath + "writeActModelMation", params: params, type: 'json', method: 'POST', callback: function (json) {
							parent.layer.close(index);
							parent.refreshCode = '0';
		 	        	}});
		 	        }
		 	        return false;
		 	    });
		 	}
		});

doc_wei's avatar
doc_wei 已提交
61 62 63 64 65 66 67 68 69 70 71 72 73
		// 工作流模型选择
		$("body").on("click", "#actFlowIdSel", function (e) {
			_openNewWindows({
				url: "../../tpl/actFlow/actFlowChoose.html",
				title: "工作流模型选择",
				pageId: "actFlowChoose",
				area: ['90vw', '90vh'],
				callBack: function (refreshCode) {
					$("#actFlowId").val(actFlowMation.flowName);
					$("#actFlowId").attr("actFlowId", actFlowMation.id);
				}});
		});

doc_wei's avatar
doc_wei 已提交
74 75 76 77 78
	    $("body").on("click", "#cancle", function() {
	    	parent.layer.close(index);
	    });
	});
});