You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

7 lines
7.7 KiB
Plaintext

11 months ago
/*!
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
*
* @author ThinkGem
* @version 2019-1-6
*/
$("#dataGrid").dataGrid({data:columnList,datatype:"local",rowNum:3000,sortableColumn:false,dataId:"aa",autoGridHeight:function(){return $(window).height()-$(".nav-tabs").outerHeight()-$(".box-footer").outerHeight()-95},autoGridWidth:function(){return $(".main-content").width()-25},columnModel:[{header:"编码",name:"id",frozen:true,hidden:true,editable:true},{header:"状态",name:"status",frozen:true,hidden:true,editable:true},{header:"列名",name:"columnSort",width:30,frozen:true,align:"center",editable:true,edittype:"text",editoptions:{maxlength:"8","class":"form-control required digits hide columnSort",dataInit:function(a){if($(a).val()==""){$(a).val($(a).closest("table").find("tr").length*10)}$(a).parent().append('<i class="fa fa-arrows" style="color:#aaa;cursor:move"></i>')}},classes:"columnSort"},{header:"列名",name:"columnName",width:110,frozen:true,formatter:function(d,b,c,a){if(c.status==Global.STATUS_DELETE){return'<span title="已被删除的列,保存后下次将不可见" style="color:red">'+c.columnName+' <i class="fa icon-question"></i></span>'}return c.columnName}},{header:"列名",name:"columnName",frozen:true,hidden:true,editable:true},{header:"列说明",name:"comments",width:110,frozen:true,editable:true,edittype:"text",editoptions:{maxlength:"100","class":"form-control required"}},{header:"字段类型",name:"columnType",hidden:true,editable:true},{header:"字段类型",name:"columnType",width:110,formatter:function(d,b,c,a){return c.columnType}},{header:"属性类型",name:"attrType",width:90,editable:true,edittype:"select",editoptions:{"class":"form-control required","data-msg-required":"请选择属性类型",items:(config.attrTypeList),itemLabel:"label",itemValue:"value",dataInit:function(a){$(a).select2().on("change",function(){try{$(this).valid()}catch(b){}})}}},{header:'属性名称 <i class="fa icon-question" title="实体对象的属性字段支持复杂格式:对象名.属性名|属性名2例如用户user.userCode|userName主要用于树选择组件如果子表则写主表实体类名 + 主键例如formEntity.entityId"></i>',name:"fullAttrName",width:100,editable:true,edittype:"text",editoptions:{maxlength:"100","class":"form-control required","data-msg-required":"请选择属性名称"}},{header:"主键",name:"isPk",width:40,align:"center",editable:true,edittype:"checkbox",editoptions:{"class":"form-control",value:"1",dataInit:function(a){$(a).iCheck().on("change",function(){try{$(this).valid()}catch(b){}})}}},{header:"插入",name:"isInsert",width:40,align:"center",editable:true,edittype:"checkbox",editoptions:{"class":"form-control",value:"1",dataInit:function(a){$(a).iCheck().on("change",function(){try{$(this).valid()}catch(b){}})}}},{header:"更新",name:"isUpdate",width:40,align:"center",editable:true,edittype:"checkbox",editoptions:{"class":"form-control",value:"1",dataInit:function(a){$(a).iCheck().on("change",function(){try{$(this).valid()}catch(b){}})}}},{header:"列表",name:"isList",width:40,align:"center",editable:true,edittype:"checkbox",editoptions:{"class":"form-control",value:"1",dataInit:function(a){$(a).iCheck().on("change",function(){try{$(this).valid()}catch(b){}})}}},{header:"查询",name:"isQuery",width:40,align:"center",editable:true,edittype:"checkbox",editoptions:{"class":"form-control",value:"1",dataInit:function(a){$(a).iCheck().on("change",function(){try{$(this).valid()}catch(b){}})}}},{header:"匹配方式",name:"queryType",width:100,editable:true,edittype:"select",editoptions:{"class":"form-control required","data-msg-required":"请选择匹配方式",items:(config.queryTypeList),itemLabel:"label",itemValue:"value",dataInit:function(a){$(a).select2().on("change",function(){try{$(this).valid()}catch(b){}})}}},{header:"编辑",name:"isEdit",width:40,align:"center",editable:true,edittype:"checkbox",editoptions:{"class":"form-control",value:"1",dataInit:function(a){$(a).iCheck().on("change",function(){try{$(this).valid()}catch(b){}})}}},{header:"必填",name:"isRequired",width:40,align:"center",editable:true,edittype:"checkbox",editopt