resources.js 448 Bytes
const _ = require('lodash');
const camelCase = global.yoho.camelCase;

/**
 * 处理楼层数据
 * @param  {[array]} list
 * @return {[array]}
 */
module.exports = (list) => {
    const formatData = [];

    list = list || [];
    list = camelCase(list);

    _.forEach(list, (floor) => {
        floor[_.camelCase(floor.templateName)] = true;

        // 特殊资源位处理

        formatData.push(floor);
    });


    return formatData;
};