(function(){
    X.pageLogic['addproject_owner_name_list'] = {
        init : function(){
            var me = this;
            me.addprojectownernamelist(); 
            layui.table.on('tool(eventattradmintest)', function(obj){
                var data = obj.data;
                if(obj.event === 'edit'){
                    data['cat'] = 'event'
                    X.parametersopen(data,"addproject_owner_name",'auto',function(){
                      me.addprojectownernamelist();  
                    })
                }
            })


        },
        addprojectownernamelist : function(){
            X.laytabledata("#eventattradmin-table","project/project_name",[[
                {field:'game', title: '项目名', sort: true}
                ,{field:'name', title: '显示名'}
                ,{field:'main_channel', title: '发行渠道 : 渠道参数',templet:function(d){
                    var txt = '';
                    for(let i in d.ditch){
                        if(d.ditch[i]['main_channel'] != undefined  && d.ditch[i]['ditch'] != undefined) {

                        }
                        txt +=  d.ditch[i]['main_channel']+ " : " + d.ditch[i]['ditch'] +'<br>'
                    } 
                    return txt
                }}
                ,{fixed: 'right', title:'操作', toolbar: '#addprojectownernameDemo', width:80}
            ]]);
        }



    };
})();
