/**
 * Created by Mai on 2017/6/21.
 */

var projectInfoObj = {
    projectInfo: null,
    getFullPathHtml: function (proj) {
        var fullPath = [], i, pm = '<a href="/pm">项目管理</a>', angleRight = '<i class="fa fa-angle-right fa-fw"></i>';
        fullPath.push(pm);
        if (proj && proj.fullFolder) {
            for (i = 0; i < proj.fullFolder.length; i++) {
                fullPath.push(angleRight, proj.fullFolder[i]);
            }
            fullPath.push(angleRight, proj.name);
        }
        return fullPath.join('');
    },
    showProjectInfo: function (proj) {
        var that = this;
        CommonAjax.post('/pm/api/getProject', {"user_id": userID, "proj_id": scUrlUtil.GetQueryString('project')}, function (data) {
            if (data) {
                that.projectInfo = data;
                $('#fullpath').html(that.getFullPathHtml(that.projectInfo));
            }
        });
    }
};
