Ldc
2024-04-07 0652600959e5e3b5796fb6e8da129704ca95347a
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
 * 自定义页面展示
 * @author wangting
 * @date 2021-6-1
 */
layui.define(['layer','element','flow'],function(exports){
    var webUtil = $webUtil;
    var Class = function() {
        this.MODELNAME = "view/showDetail";
        this.moduleKey = "showDetail";
        this.backPath = configData.compatibility?path:configData.objectServicePath;
        this.url = {
        };
        //必有
        this.getContent = function (id,options) {
            var that = this;
            that.id=id;
            var html = [
                '<div class="showDetail" id="showDetail_',id,'" lay-filter="showDetail_',id,'" style="display:block;"></div>'
            ].join("");
            return html;
        };
        //必有
        this.init = function (id, options) {
            var that = this;
            webUtil.copyConfig(that, that.moduleKey);
            that.id=id;
 
            $.extend(that.sourceData,options);
 
            that.options=options;
        };
 
        //必有,展示UI内容
        this.loadForUI=function (sourceData) {
            if (!sourceData) {
                return;
            }
            var that = this;
            var baseAction = layui['BaseAction'];
            baseAction.callPreEvent(that.options, that, function (options) {
                that.doLoad(sourceData, function () {
                    baseAction.callPostEvent(that.options, that, that.options.callback);
                });
            });
        }
 
        this.doLoad=function (sourceData,callback){
            var that = this;
            $("#showDetail_"+that.id).empty();
            var html=''
            for (var i in sourceData){
                html+=i+': '+sourceData[i]+'<hr/>'
            }
            $("#showDetail_"+that.id).html(html)
            if(callback){
                callback()
            }
        }
 
 
        this.refresh = function(){
            var that = this;
 
        };
 
        this.destory = function(){
            var that = this;
            var filter = "showDetail_" + that.id;
            $('#'+filter).remove()
        };
    };
    var cs = new Class();
    exports(cs.MODELNAME,cs);
});