多单位版国产化地质资料管理系统
zs
2025-12-18 4f0d9bde31a80f6279e26466250da7716eec627f
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
var wcp = wcp || {};
(function ($) {
    //日志
    wcp.log = wcp.log || {};
 
    wcp.log.levels = {
        DEBUG: 1,
        INFO: 2,
        WARN: 3,
        ERROR: 4,
        FATAL: 5
    };
 
    wcp.log.level = wcp.log.levels.DEBUG;
 
    wcp.log.log = function (logObject, logLevel) {
        if (!window.console || !window.console.log) {
            return;
        }
 
        if (logLevel != undefined && logLevel < wcp.log.level) {
            return;
        }
 
        console.log(logObject);
    };
 
    wcp.log.debug = function (logObject) {
        wcp.log.log("DEBUG: ", wcp.log.levels.DEBUG);
        wcp.log.log(logObject, wcp.log.levels.DEBUG);
    };
 
    wcp.log.info = function (logObject) {
        wcp.log.log("INFO: ", wcp.log.levels.INFO);
        wcp.log.log(logObject, wcp.log.levels.INFO);
    };
 
    wcp.log.warn = function (logObject) {
        wcp.log.log("WARN: ", wcp.log.levels.WARN);
        wcp.log.log(logObject, wcp.log.levels.WARN);
    };
 
    wcp.log.error = function (logObject) {
        wcp.log.log("ERROR: ", wcp.log.levels.ERROR);
        wcp.log.log(logObject, wcp.log.levels.ERROR);
    };
 
    wcp.log.fatal = function (logObject) {
        wcp.log.log("FATAL: ", wcp.log.levels.FATAL);
        wcp.log.log(logObject, wcp.log.levels.FATAL);
    };
 
    //提醒
    wcp.notify = wcp.notify || {};
 
    wcp.notify.success = function (message, title, options) {
        wcp.log.warn('wcp.notify.success 没有定义!');
    };
 
    wcp.notify.info = function (message, title, options) {
        wcp.log.warn('wcp.notify.info 没有定义!');
    };
 
    wcp.notify.warn = function (message, title, options) {
        wcp.log.warn('wcp.notify.warn 没有定义!');
    };
 
    wcp.notify.error = function (message, title, options) {
        wcp.log.warn('wcp.notify.error 没有定义!');
    };
 
    //消息
    wcp.message = wcp.message || {};
 
    var showMessage = function (message, title) {
        alert((title || '') + ' ' + message);
 
        if (!$) {
            wcp.log.warn('jQuery 没有定义,wcp.message 将不能返回 promise!');
            return null;
        }
 
        return $.Deferred(function ($dfd) {
            $dfd.resolve();
        });
    };
 
    wcp.message.info = function (message, title) {
        wcp.log.warn('wcp.message.info 没有定义!');
        return showMessage(message, title);
    };
 
    wcp.message.success = function (message, title) {
        wcp.log.warn('wcp.message.success 没有定义!');
        return showMessage(message, title);
    };
 
    wcp.message.warn = function (message, title) {
        wcp.log.warn('wcp.message.warn 没有定义!');
        return showMessage(message, title);
    };
 
    wcp.message.error = function (message, title) {
        wcp.log.warn('wcp.message.error 没有定义!');
        return showMessage(message, title);
    };
 
    wcp.message.confirm = function (message, titleOrCallback, callback) {
        wcp.log.warn('wcp.message.confirm 没有定义!');
 
        if (titleOrCallback && !(typeof titleOrCallback == 'string')) {
            callback = titleOrCallback;
        }
 
        var result = confirm(message);
        callback && callback(result);
 
        if (!$) {
            wcp.log.warn('jQuery 没有定义,wcp.message 将不能返回 promise!');
            return null;
        }
 
        return $.Deferred(function ($dfd) {
            $dfd.resolve();
        });
    };
 
    /* UI *******************************************************/
 
    wcp.ui = wcp.ui || {};
 
    /* UI BLOCK */
    //Defines UI Block API, not implements it
 
    wcp.ui.block = function (elm) {
        wcp.log.warn('wcp.ui.block 没有定义!');
    };
 
    wcp.ui.unblock = function (elm) {
        wcp.log.warn('wcp.ui.unblock 没有定义!');
    };
 
    /* UI BUSY */
    //Defines UI Busy API, not implements it
 
    wcp.ui.setBusy = function (elm, optionsOrPromise) {
        wcp.log.warn('wcp.ui.setBusy 没有定义!');
    };
 
    wcp.ui.clearBusy = function (elm) {
        wcp.log.warn('wcp.ui.clearBusy 没有定义!');
    };
 
    //* Picker 资源选择器*******************************************************/
    wcp.picker = wcp.picker || {};
 
    wcp.picker.selectUser = function (elm) {
        wcp.log.warn('wcp.picker.selectUser 没有定义!');
    };
    wcp.picker.selectDept = function (elm) {
        wcp.log.warn('wcp.picker.selectDept 没有定义!');
    };
    wcp.picker.selectGroup = function (elm) {
        wcp.log.warn('wcp.picker.selectGroup 没有定义!');
    };
    wcp.picker.selectRole = function (elm) {
        wcp.log.warn('wcp.picker.selectRole 没有定义!');
    };
    wcp.picker.selectForm = function (elm) {
        wcp.log.warn('wcp.picker.selectForm 没有定义!');
    };
    wcp.picker.selectTable = function (elm) {
        wcp.log.warn('wcp.picker.selectTable 没有定义!');
    };
    wcp.picker.selectTableColumn = function (elm) {
        wcp.log.warn('wcp.picker.selectTableColumn 没有定义!');
    };
    wcp.picker.selectModule = function (elm) {
        wcp.log.warn('wcp.picker.selectModule 没有定义!');
    };
    wcp.picker.selectIcon = function (elm) {
        wcp.log.warn('wcp.picker.selectIcon 没有定义!');
    };
    wcp.picker.selectKeyword = function (elm) {
        wcp.log.warn('wcp.picker.selectKeyword 没有定义!');
    };
    wcp.picker.selectResource = function (elm) {
        wcp.log.warn('wcp.picker.selectResource 没有定义!');
    };
    wcp.picker.selectPlanDetailTemplate = function (elm) {
        wcp.log.warn('wcp.picker.selectPlanTemplate 没有定义!');
    };
    wcp.picker.selectOperation = function (elm) {
        wcp.log.warn('wcp.picker.selectOperation 没有定义!');
    };
 
    //事件总线
    wcp.event = (function () {
 
        var _callbacks = {};
 
        var on = function (eventName, callback) {
            if (!_callbacks[eventName]) {
                _callbacks[eventName] = [];
            }
 
            _callbacks[eventName].push(callback);
        };
 
        var off = function (eventName, callback) {
            var callbacks = _callbacks[eventName];
            if (!callbacks) {
                return;
            }
 
            var index = -1;
            for (var i = 0; i < callbacks.length; i++) {
                if (callbacks[i] === callback) {
                    index = i;
                    break;
                }
            }
 
            if (index < 0) {
                return;
            }
 
            _callbacks[eventName].splice(index, 1);
        };
 
        var trigger = function (eventName) {
            var callbacks = _callbacks[eventName];
            if (!callbacks || !callbacks.length) {
                return;
            }
 
            var args = Array.prototype.slice.call(arguments, 1);
            for (var i = 0; i < callbacks.length; i++) {
                callbacks[i].apply(this, args);
            }
        };
 
        // 公共接口 ///////////////////////////////////////////////////
 
        return {
            on: on,
            off: off,
            trigger: trigger
        };
    })();
 
 
    //工具类
    wcp.utils = wcp.utils || {};
 
    /* 创建一个命名空间
    *  例如:
    *  var taskService = wcp.utils.createNamespace(wcp, 'services.task');
    *  taskService will be equal to wcp.services.task
    *  first argument (root) must be defined first
    ************************************************************/
    wcp.utils.createNamespace = function (root, ns) {
        var parts = ns.split('.');
        for (var i = 0; i < parts.length; i++) {
            if (typeof root[parts[i]] == 'undefined') {
                root[parts[i]] = {};
            }
 
            root = root[parts[i]];
        }
 
        return root;
    };
 
    /* 字符串替换
    *  given string (str).
    *  Example:
    *  wcp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string'
    ************************************************************/
    wcp.utils.replaceAll = function (str, search, replacement) {
        var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
        return str.replace(new RegExp(fix, 'g'), replacement);
    };
 
    /* 格式化字符串
    *  Example:
    *  wcp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana'
    ************************************************************/
    wcp.utils.formatString = function () {
        if (arguments.length < 1) {
            return null;
        }
 
        var str = arguments[0];
 
        for (var i = 1; i < arguments.length; i++) {
            var placeHolder = '{' + (i - 1) + '}';
            str = wcp.utils.replaceAll(str, placeHolder, arguments[i]);
        }
 
        return str;
    };
 
    /* 字符串转换为PascalCase模式
     *
     ************************************************************/
    wcp.utils.toPascalCase = function (str) {
        if (!str || !str.length) {
            return str;
        }
 
        if (str.length === 1) {
            return str.charAt(0).toUpperCase();
        }
 
        return str.charAt(0).toUpperCase() + str.substr(1);
    }
 
    /* 字符串转换为camelCase模式
     *
     ************************************************************/
    wcp.utils.toCamelCase = function (str) {
        if (!str || !str.length) {
            return str;
        }
 
        if (str.length === 1) {
            return str.charAt(0).toLowerCase();
        }
 
        return str.charAt(0).toLowerCase() + str.substr(1);
    }
 
    /* 截断字符串
     *
     ************************************************************/
    wcp.utils.truncateString = function (str, maxLength) {
        if (!str || !str.length || str.length <= maxLength) {
            return str;
        }
 
        return str.substr(0, maxLength);
    };
 
    /* 截断字符串,并增加后缀
     *
     ************************************************************/
    wcp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) {
        postfix = postfix || '...';
 
        if (!str || !str.length || str.length <= maxLength) {
            return str;
        }
 
        if (maxLength <= postfix.length) {
            return postfix.substr(0, maxLength);
        }
 
        return str.substr(0, maxLength - postfix.length) + postfix;
    };
 
    /* 判断是否为函数
     *
     ************************************************************/
    wcp.utils.isFunction = function (obj) {
        if ($) {
            //Prefer to use jQuery if possible
            return $.isFunction(obj);
        }
 
        //alternative for $.isFunction
        return !!(obj && obj.constructor && obj.call && obj.apply);
    };
 
    /* 使用Base64编码Url参数,并且替换+、/、=,防止传输出现问题
     * 需要引入plugins中的crypto-js文件夹的core.js和enc-base64.js
     * @param urlParam
     */
    wcp.utils.encodeBase64UrlParam = function (urlParam) {
        var wordArray = CryptoJS.enc.Utf8.parse(urlParam);
        var base64 = CryptoJS.enc.Base64.stringify(wordArray);
 
        var ret = wcp.utils.replaceAll(base64, "+", "*");
        ret = wcp.utils.replaceAll(ret, "/", "-");
        ret = wcp.utils.replaceAll(ret, "=", ".");
 
        return ret;
    }
 
    /* 生成查询字符串
     * parameterInfos should be an array of { name, value } objects
     * where name is query string parameter name and value is it's value.
     * includeQuestionMark is true by default.
     */
    wcp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) {
        if (includeQuestionMark === undefined) {
            includeQuestionMark = true;
        }
 
 
        var qs = '';
 
        function addSeperator() {
            if (!qs.length) {
                if (includeQuestionMark) {
                    qs = qs + '?';
                }
            } else {
                qs = qs + '&';
            }
        }
 
        for (var i = 0; i < parameterInfos.length; ++i) {
            var parameterInfo = parameterInfos[i];
            if (parameterInfo.value === undefined) {
                continue;
            }
 
            if (parameterInfo.value === null) {
                parameterInfo.value = '';
            }
 
            addSeperator();
 
            if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") {
                qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON());
            } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) {
                for (var j = 0; j < parameterInfo.value.length; j++) {
                    if (j > 0) {
                        addSeperator();
                    }
 
                    qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]);
                }
            } else {
                qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value);
            }
        }
 
        return qs;
    }
 
    /*
     * 设置Cookie
     * This is a simple implementation created to be used by wcp.
     * Please use a complete cookie library if you need.
     * @param {string} key
     * @param {string} value
     * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session.
     * @param {string} path (optional)
     */
    wcp.utils.setCookieValue = function (key, value, expireDate, path) {
        var cookieValue = encodeURIComponent(key) + '=';
 
        if (value) {
            cookieValue = cookieValue + encodeURIComponent(value);
        }
 
        if (expireDate) {
            cookieValue = cookieValue + "; expires=" + expireDate.toUTCString();
        }
 
        if (path) {
            cookieValue = cookieValue + "; path=" + path;
        }
 
        document.cookie = cookieValue;
    };
 
    /*
     * 获取一个Cookie
     * This is a simple implementation created to be used by wcp.
     * Please use a complete cookie library if you need.
     * @param {string} key
     * @returns {string} Cookie value or null
     */
    wcp.utils.getCookieValue = function (key) {
        var equalities = document.cookie.split('; ');
        for (var i = 0; i < equalities.length; i++) {
            if (!equalities[i]) {
                continue;
            }
 
            var splitted = equalities[i].split('=');
            if (splitted.length != 2) {
                continue;
            }
 
            if (decodeURIComponent(splitted[0]) === key) {
                return decodeURIComponent(splitted[1] || '');
            }
        }
 
        return null;
    };
 
    /*
     * 删除一个Cookie
     * This is a simple implementation created to be used by wcp.
     * Please use a complete cookie library if you need.
     * @param {string} key
     * @param {string} path (optional)
     */
    wcp.utils.deleteCookie = function (key, path) {
        var cookieValue = encodeURIComponent(key) + '=';
 
        cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString();
 
        if (path) {
            cookieValue = cookieValue + "; path=" + path;
        }
 
        document.cookie = cookieValue;
    }
 
    /*
     * 按比例缩放图片
     */
    wcp.utils.autoResizeImage = function (maxWidth, maxHeight, imgId) {
        var img = new Image();
        img.src = $("#" + imgId).attr('src');
        var hRatio;
        var wRatio;
        var ratio = 1;
        var w = img.width;
        var h = img.height;
        wRatio = maxWidth / w;
        hRatio = maxHeight / h;
        if (maxWidth == 0 && maxHeight == 0) {
            ratio = 1;
        } else if (maxWidth == 0) { //
            if (hRatio < 1)
                ratio = hRatio;
        } else if (maxHeight == 0) {
            if (wRatio < 1)
                ratio = wRatio;
        } else if (wRatio < 1 || hRatio < 1) {
            ratio = (wRatio <= hRatio ? wRatio : hRatio);
        }
        if (ratio < 1) {
            w = w * ratio;
            h = h * ratio;
        }
 
        $("#" + imgId).height(h);
        $("#" + imgId).width(w);
    }
 
 
    /* 时间处理 *****************************************/
    wcp.timing = wcp.timing || {};
 
    wcp.timing.utcClockProvider = (function () {
 
        var toUtc = function (date) {
            return Date.UTC(
                date.getUTCFullYear()
                , date.getUTCMonth()
                , date.getUTCDate()
                , date.getUTCHours()
                , date.getUTCMinutes()
                , date.getUTCSeconds()
                , date.getUTCMilliseconds()
            );
        }
 
        var now = function () {
            return new Date();
        };
 
        var normalize = function (date) {
            if (!date) {
                return date;
            }
 
            return new Date(toUtc(date));
        };
 
        // Public interface ///////////////////////////////////////////////////
 
        return {
            now: now,
            normalize: normalize,
            supportsMultipleTimezone: true
        };
    })();
 
    wcp.timing.localClockProvider = (function () {
 
        var toLocal = function (date) {
            return new Date(
                date.getFullYear()
                , date.getMonth()
                , date.getDate()
                , date.getHours()
                , date.getMinutes()
                , date.getSeconds()
                , date.getMilliseconds()
            );
        }
 
        var now = function () {
            return toLocal(new Date());
        }
 
        var normalize = function (date) {
            if (!date) {
                return date;
            }
 
            return toLocal(date);
        }
 
        // Public interface ///////////////////////////////////////////////////
 
        return {
            now: now,
            normalize: normalize,
            supportsMultipleTimezone: false
        };
    })();
 
    wcp.timing.unspecifiedClockProvider = (function () {
 
        var now = function () {
            return new Date();
        }
 
        var normalize = function (date) {
            return date;
        }
 
        // Public interface ///////////////////////////////////////////////////
 
        return {
            now: now,
            normalize: normalize,
            supportsMultipleTimezone: false
        };
    })();
 
    wcp.timing.convertToUserTimezone = function (date) {
        var localTime = date.getTime();
        var utcTime = localTime + (date.getTimezoneOffset() * 60000);
        var targetTime = parseInt(utcTime) + parseInt(wcp.timing.timeZoneInfo.windows.currentUtcOffsetInMilliseconds);
        return new Date(targetTime);
    };
 
    /* 时钟 *****************************************/
    wcp.clock = wcp.clock || {};
 
    wcp.clock.now = function () {
        if (wcp.clock.provider) {
            return wcp.clock.provider.now();
        }
 
        return new Date();
    }
 
    wcp.clock.normalize = function (date) {
        if (wcp.clock.provider) {
            return wcp.clock.provider.normalize(date);
        }
 
        return date;
    }
 
    wcp.clock.provider = wcp.timing.unspecifiedClockProvider;
})(jQuery);
 
//加载日期控件只能对yyy-MM格式化
function loadDateControl(columnId) {
    $('#' + columnId).datebox({
        //显示日趋选择对象后再触发弹出月份层的事件,初始化时没有生成月份层
        onShowPanel: function () {
            //触发click事件弹出月份层
            span.trigger('click');
            if (!tds)
                //延时触发获取月份对象,因为上面的事件触发和对象生成有时间间隔
                setTimeout(function () {
                    tds = p.find('div.calendar-menu-month-inner td');
                    tds.click(function (e) {
                        //禁止冒泡执行easyui给月份绑定的事件
                        e.stopPropagation();
                        //得到年份
                        var year = /\d{4}/.exec(span.html())[0],
                            //月份
                            //之前是这样的month = parseInt($(this).attr('abbr'), 10) + 1;
                            month = parseInt($(this).attr('abbr'), 10);
 
                        //隐藏日期对象
                        $('#' + columnId).datebox('hidePanel')
                            //设置日期的值
                            .datebox('setValue', year + '-' + month);
                    });
                }, 0);
        },
        //配置parser,返回选择的日期
        parser: function (s) {
            if (!s) return new Date();
            var arr = s.split('-');
            return new Date(parseInt(arr[0], 10), parseInt(arr[1], 10) - 1, 1);
        },
        //配置formatter,只返回年月 之前是这样的d.getFullYear() + '-' +(d.getMonth());
        formatter: function (d) {
            var currentMonth = (d.getMonth() + 1);
            var currentMonthStr = currentMonth < 10 ? ('0' + currentMonth) : (currentMonth + '');
            return d.getFullYear() + '-' + currentMonthStr;
        }
    });
 
    //日期选择对 象
    var p = $('#' + columnId).datebox('panel'),
        //日期选择对象中月份
        tds = false,
        //显示月份层的触发控件
        span = p.find('span.calendar-text');
    var curr_time = new Date();
    //设置前当月
    $("#" + columnId).datebox("setValue", myformatter(curr_time));
}
 
//格式化日期
function myformatter(date) {
    //获取年份
    var y = date.getFullYear();
    //获取月份
    var m = date.getMonth() + 1;
    return y + '-' + m;
}
 
//年格式化
function yearFormatter(date) {
    var y = date.getFullYear();
    var m = date.getMonth() + 1;
    var d = date.getDate();
    return y;
}
 
//获取年份
function yearParser(s) {
    if (!s) return new Date();
    var y = s;
    var date;
    if (!isNaN(y)) {
        return new Date(y, 0, 1);
    } else {
        return new Date();
    }
}
 
//通过Tab页签打开窗口
wcp.openUrlByTab = function (pageUrl, title, ids, refreshData) {
    if (top.addPanel) {
        top.addPanel(pageUrl, title);
        var curTabWin = null;
        var curTab = top.$('#tt').tabs('getSelected');
        if (curTab && curTab.find('iframe').length > 0) {
            curTabWin = curTab.find('iframe')[0].contentWindow;
            //将回调函数传给子页面
            $(curTabWin).load(function () {
                if (curTabWin.params) {
                    //将回调函数传给子页面
                    if (ids) {
                        curTabWin.params.ids = ids;
                    }
 
                    curTabWin.params.parent = window;
                    curTabWin.params.callBack = refreshData;
                }
            });
        }
    } else {
        wcp.openUrlByWindow(pageUrl);
    }
}
 
//通过Layer打开窗口
wcp.openUrlByLayer = function (pageWidth, pageHeight, pageUrl, title, ids, refreshData) {
    top.layer.open({
        title: title,
        type: 2,
        area: [pageWidth + "px", pageHeight + "px"],
        fixed: false,
        content: pageUrl,
        success: function (layero, index) {
            var body = window.top.layer.getChildFrame('body', index);
            var iframeWin = window.top[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象
            //将回调函数传给子页面
            if (iframeWin.params) {
                if (ids) {
                    iframeWin.params.ids = ids;
                }
                iframeWin.params.parent = window;
                iframeWin.params.callBack = refreshData;
            }
        }
    });
}
 
wcp.openUrlByWindow = function (pageUrl, ids, refreshData) {
    var myWindow = window.open(pageUrl);
    //将回调函数传给子页面
    $(myWindow).load(function () {
        if (myWindow.params) {
            if (ids) {
                myWindow.params.ids = ids;
            }
            myWindow.params.parent = window;
            myWindow.params.callBack = refreshData;
        }
    });
}
 
//居中显示打开窗口
wcp.openUrlByWindow = function (pageUrl, ids, name, iWidth, iHeight, refreshData) {
    var iTop = (window.screen.height - 30 - iHeight) / 2; //获得窗口的垂直位置;
    var iLeft = (window.screen.width - 10 - iWidth) / 2; //获得窗口的水平位置;
    var myWindow;
    if (iWidth == 0) {
        myWindow = window.open(pageUrl);
    } else {
        myWindow = window.open(pageUrl, name.replace(":", ""), 'height=' + iHeight + ',innerHeight=' + iHeight + ',width=' + iWidth + ',innerWidth=' + iWidth + ',top=' + iTop + ',left=' + iLeft + ',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
    }
    //将回调函数传给子页面
    $(myWindow).load(function () {
        if (myWindow.params) {
            if (ids) {
                myWindow.params.ids = ids;
            }
            myWindow.params.parent = window;
            myWindow.params.callBack = refreshData;
        }
    });
}