TopSearch.js 838 Bytes
define(function () {
    'use strict';

    function TopSearch() { 
    }

    TopSearch.prototype = {
        transferToVM: function (dm) {
            var navs = [];
            var size = dm.searchFields.length;
            var bound = size > 4 ? 3 : size;
            for(var i = 0; i < bound; i++){
                var condition = dm.searchFields[i];
                navs.push({
                    text: condition.showName
                });
            }
            if(size > 4){
                navs.push({
                    text: SystemEnv.getHtmlNoteName(6203),//筛选
                    cls: "more"
                });
            }
            if(!navs.length){
                navs.push({text:''});
            }
            return {
                navs: navs
            };
        }
    };

    return TopSearch;
});