jt
2021-06-10 5d0d028456874576560552f5a5c4e8b801786f11
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
/**
* 模块名:easyui方法修改
* 程序名: easyui.fix.js
* Copyright(c) haninfo
**/
 
var easyuifix = {};
 
/* for easyloader.js
 * add after row 13 usage: easyuifix.addLoadModules(_1);
 */
easyuifix.easyloader_addLoadModules = function (modules) {
    $.extend(modules, {
        juidatepick: {
            js: "/Content/js/jquery-plugin/jquery-ui/js/jquery-ui-datepick.min.js",
            css: "/Content/js/jquery-plugin/jquery-ui/css/jquery-ui.css"
        },
        daterange: {
            js: "/Content/js/jquery-plugin/daterange/jquery.daterange.js",
            css: "/Content/js/jquery-plugin/daterange/jquery.daterange.css",
            dependencies: ["juidatepick"]
        },
        extend: {
            js: "/Content/js/jquery-easyui-1.3.2/jquery.easyui.extend.js"
        },
        lookup: {
            js: "/Content/js/jquery-easyui-1.3.2/plugins/jquery.lookup.js",
            dependencies: ["combo"]
        },
        autocomplete: {
            js: "/Content/js/jquery-easyui-1.3.2/plugins/jquery.autocomplete.js",
            dependencies: ["combo"]
        }
    });
};
 
easyuifix.easyloader_setting = function (easyloader,src) {
    easyloader.theme = utils.getRequest("theme", src);
    easyloader.locale = utils.getRequest("locale", src);
};
 
/* for parser.js
* add after row 89 usage: easyuifix.parser_addplugins($.parser.plugins);
*/
easyuifix.parser_addplugins = function (plugins) {
    var arr = ["daterange", "lookup", "autocomplete"];
    for (var i in arr) 
        plugins.push(arr[i]);
};
 
/* for jquery.easyui.min.js 
* add after row 3745 between row [tab.panel("options").tab.remove();] and row [tab.panel("destroy");]
* for clear memory 
* usage: 
*     tab.panel("options").tab.remove();
*     easyuifix.easyui_min_setIframeFree();
*     tab.panel("destroy");
*/
easyuifix.easyui_min_setIframeFree = function (tab) {
    var frame = $('iframe', tab); if (frame.length > 0) { frame[0].contentWindow.document.write(''); frame[0].contentWindow.close(); frame.remove(); if ($.browser.msie) { CollectGarbage(); } }
}
 
/* for tabs.js
* add after row 392 _5a.onSelect.call(_58,_5f,_31(_58,_5d));
  usage: easyuifix.tabs_showtabonselect(_5d);
*/
easyuifix.tabs_showtabonselect =function(tab){
    tab.show();    //打开时其它页签先隐藏,,提升用户体验,点击时再显示
}
 
/* for easyui-lang_zh_CN.js
*/
easyuifix.lang_zh_CN = function () {
    if ($.fn.lookup) {
        $.fn.lookup.defaults.missingMessage = '该输入项为必输项';
    }
};
 
/* for easyui-datagrid.js
* _175 = easyuifix.datagrid_editors_checkboxVal(_173, 174);
*/
easyuifix.datagrid_editors_checkboxVal = function (checkbox,value) {
    return (typeof value == 'boolean' && $(checkbox).val() == value.toString());
};
 
/* for easyui-datagrid.js
*/
easyuifix.datagrid_beforeDestroyEditor = function (jq, rowIndex, row) {
    var opts = jQuery.data(jq, "datagrid").options;
    if (opts.OnBeforeDestroyEditor) {
        var editors = {}, list = jQuery(jq).datagrid('getEditors', rowIndex) || [];
        jQuery.each(list, function () { editors[this.field] = this; });
        opts.OnBeforeDestroyEditor(editors, row, rowIndex, jq);
    }
};
/* for easyui-datagrid.js and easyui.min.js
*/
easyuifix.datagrid_afterCreateEditor = function (jq, rowIndex, row) {
    var opts = jQuery.data(jq, "datagrid").options;
    if (opts.OnAfterCreateEditor) {
        var editors = {}, list = jQuery(jq).datagrid('getEditors', rowIndex) || [];
        jQuery.each(list, function () { editors[this.field] = this; });
        opts.OnAfterCreateEditor(editors, row, rowIndex, jq);
    }
};
 
/* for easyui-combo.js to convert disable to readonly
*/
easyuifix.combo_disableToReadonly = function (jq, b) {
    var options = $.data(jq, "combo").options;
    var combo = $.data(jq, "combo").combo;
    if (b) {
        options.disabled = true;
        $(jq).attr("readonly", true);
        combo.find(".combo-value").attr("readonly", true).addClass("readonly");
        combo.find(".combo-text").attr("readonly", true).addClass("readonly");
    } else {
        options.disabled = false;
        $(jq).removeAttr("readonly");
        combo.find(".combo-value").removeAttr("readonly").removeClass("readonly");
        combo.find(".combo-text").removeAttr("readonly").removeClass("readonly");
    }
};
 
/* for easyui-spinner.js to convert disable to readonly
*/
easyuifix.spinner_disableToReadonly = function (jq, b) {
    var options = $.data(jq, "spinner").options;
    if (b) {
        options.disabled = true;
        $(jq).attr("readonly", true).addClass("readonly");
    } else {
        options.disabled = false;
        $(jq).removeAttr("readonly").removeClass("readonly");
    }
};
 
 
/* for datagrid.js
* add at last if (easyuifix) easyuifix.datagrid_editor_extend();
*/
easyuifix.datagrid_editor_extend = function () {
    if ($.fn.datagrid) {
        if ($.fn.numberspinner) {
            $.extend($.fn.datagrid.defaults.editors, {
                numberspinner: {
                    init: function (container, options) {
                        var input = $('<input type="text">').appendTo(container);
                        return input.numberspinner(options);
                    },
                    destroy: function (target) {
                        $(target).numberspinner('destroy');
                    },
                    getValue: function (target) {
                        return $(target).numberspinner('getValue');
                    },
                    setValue: function (target, value) {
                        $(target).numberspinner('setValue', value);
                    },
                    resize: function (target, width) {
                        $(target).numberspinner('resize', width);
                    }
                }
            });
        }
 
        if ($.fn.autocomplete) {
            $.extend($.fn.datagrid.defaults.editors, {
                autocomplete: {
                    init: function (container, options) {
                        var input = $('<input type="text" class="z-text datagrid-editable-input">').appendTo(container);
                        return input.autocomplete(options);
                    },
                    destroy: function (target) {
                        $(target).autocomplete('destroy');
                    },
                    getValue: function (target) {
                        return $(target).val();
                    },
                    setValue: function (target, value) {
                        $(target).val(value);
                    },
                    resize: function (target, width) {
                        $(target).width(width);
                    }
                }
            });
        }
 
        if ($.fn.lookup) {
            $.extend($.fn.datagrid.defaults.editors, {
                lookup: {
                    init: function (container, options) {
                        var input = $('<input type="text" class="z-text datagrid-editable-input">').appendTo(container);
                        return input.lookup(options);
                    },
                    destroy: function (target) {
                        $(target).lookup('destroy');
                    },
                    getValue: function (target) {
                        return $(target).lookup('getValue');
                    },
                    setValue: function (target, value) {
                        $(target).lookup('setValue', value);
                    },
                    resize: function (target, width) {
                        $(target).lookup('resize', width);
                    }
                }
            });
        }
 
        $.extend($.fn.datagrid.defaults.editors, {
            label: {
                init: function (container, options) {
                    var input = $('<div></div>').appendTo(container);
                    return input;
                },
                destroy: function (target) {
 
                },
                getValue: function (target) {
                    return $(target).html();
                },
                setValue: function (target, value) {
                    $(target).html(value);
                },
                resize: function (target, width) {
 
                }
            }
        });
    }
}