teamTemplateAdd.js 2.4 KB
Newer Older
doc_wei's avatar
doc_wei 已提交
1 2 3 4 5 6

layui.config({
	base: basePath, 
	version: skyeyeVersion
}).extend({
    window: 'js/winui.window'
7
}).define(['window', 'jquery', 'winui', 'textool', 'tableTreeDj'], function (exports) {
doc_wei's avatar
doc_wei 已提交
8 9 10 11
	winui.renderColor();
	layui.use(['form'], function (form) {
		var index = parent.layer.getFrameIndex(window.name);
	    var $ = layui.$,
12 13
			textool = layui.textool,
			tableTree = layui.tableTreeDj;
doc_wei's avatar
doc_wei 已提交
14 15 16 17 18
		textool.init({eleId: 'remark', maxlength: 200});

		skyeyeClassEnumUtil.showEnumDataListByClassName("teamObjectType", 'select', "objectType", '', form);
		skyeyeClassEnumUtil.showEnumDataListByClassName("commonEnable", 'radio', "enabled", '', form);

19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
		loadTreeTable();
		function loadTreeTable() {
			tableTree.render({
				id: 'messageTable',
				elem: '#messageTable',
				data: [{"id": "123qwe", "name": "阿萨斯多", "pId": "0", "lay_is_open": true},
					   {"id": "123qwe1", "name": "阿萨斯多qqq", "pId": "123qwe", "lay_is_open": true}],
				cols: [[
					{ field: 'name', title: '菜单名称', width: 120 },
					{ field: 'menuNameEn', title: '英文名称', width: 150 },
					{ field: 'orderNum', title: '排序', align: 'center', width: 80 },
					{ field: 'desktopName', title: '所属桌面', width: 120 },
					{ field: 'menuParentName', title: '父菜单', width: 100 },
					{ field: 'menuUrl', title: '菜单链接', width: 160 }
				]],
				done: function(json) {
					matchingLanguage();
				}
			}, {
				keyId: 'id',
				keyPid: 'pId',
				title: 'name',
				defaultShow: true,
			});
		}


doc_wei's avatar
doc_wei 已提交
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
		loadAuthList();
		form.on('select(objectType)', function(data) {
			loadAuthList();
		});

	    matchingLanguage();
 		form.render();
 	    form.on('submit(formAddBean)', function (data) {
 	        if (winui.verifyForm(data.elem)) {
 	        	var params = {
					dictName: $("#dictName").val(),
					dictCode: $("#dictCode").val(),
					enabled: $("#enabled input:radio:checked").val(),
					remark: $("#remark").val(),
 	        	};
 	        	AjaxPostUtil.request({url: reqBasePath + "writeDictTypeMation", params: params, type: 'json', method: "POST", callback: function (json) {
					parent.layer.close(index);
					parent.refreshCode = '0';
 	        	}});
 	        }
 	        return false;
 	    });

		 function loadAuthList() {
			 var objectType = $('#objectType').val();
doc_wei's avatar
doc_wei 已提交
71
			 teamObjectPermissionUtil.insertPageShow(objectType, 'authList', form);
doc_wei's avatar
doc_wei 已提交
72 73 74 75 76 77 78
		 }
 	    
	    $("body").on("click", "#cancle", function() {
	    	parent.layer.close(index);
	    });
	});
});