Picture.js 698 Bytes
define(["utils"], function (_u) {
    'use strict';

    function Picture() { 
    }

    Picture.prototype = {
        transferToVM: function (dm) {
            var h = dm.height;
            var w = dm.width;

            if (dm.picturesize == 2) {
                h = w = "";
            }
            var path = isNaN(dm.pic_path)? dm.pic_path:''; //如果传的是DOCID 不显示
            path = new RegExp("{|}").test(path) ? '': path;  //如果传的是变量 不显示
            return {
                url: "javascript:;",
                path: path,
                width: _u.toPixel(w),
                height: _u.toPixel(h)
            };
        }
    };

    return Picture;
});