NLargeList.js
1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
define(["utils"], function (_u) {
    'use strict';
    
    function NLargeList() {
        this.store = {};
    }
    NLargeList.prototype = {
        transferToVM: function (dm) {
            var btns = dm.customBtns || [],
                showView = dm.showSet.view || {},
                sourceData = dm.sourceData || {},
                sourceType = sourceData.sourceType;
            showView.titlefield.fielddesc = showView.titlefield.fielddesc?_u.delHtmlTag(showView.titlefield.fielddesc):'';
            return {
                dataSource: {
                    type: sourceType == 1 ? 'cube' : 'other'
                },
                quickSearch: {
                    hide: dm.quickSearch !== "1",
                    tip: dm.searchTips
                },
                advancedSearch: {
                    enable: sourceData.sourceType == 1 && dm.advancedSearch == 1,
                },
                options: {
                    readonly: dm.dataReadonly == 1
                },
                btns: btns.map(function (btn) {
                    var btnType = btn.btnType, picPath = btn.picPath || "", btnText = btn.btnText || "";
                    return {
                        type: btnType,
                        icon: btnType == "1" ? "" : picPath,
                        text: btnType == "2" ? "" : btnText
                    };
                }),
                d: {
                    img: showView.imgfield.fielddesc === SystemEnv.getHtmlNoteName(4168) ? "" : showView.imgfield.fielddesc, // 无
                    title: showView.titlefield.fielddesc|| SystemEnv.getHtmlNoteName(3534), // 标题
                    others: showView.otherfields.map(function (o) {
                        return o.map(function (v) {
                            return _u.delHtmlTag(v.fielddesc) || SystemEnv.getHtmlNoteName(4139); // 选择字段 
                        });
                    })
                }
            };
        }
    };
    return NLargeList;
});