Calendar_wev8.js
41.4 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
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
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
if(typeof(MEC_NS) == 'undefined'){
MEC_NS = {};
}
MEC_NS.Calendar = function(type, id, mecJson){
this.type = type;
if(!id){
id = new UUID().toString();
}
this.id = id;
if(!mecJson){
mecJson = this.getDefaultMecJson();
}
this.mecJson = mecJson;
};
/*获取id。 必需的方法*/
MEC_NS.Calendar.prototype.getID = function(){
return this.id;
};
/*获取设计的html, 页面上怎么显示控件完全依赖于此方法。 必需的方法*/
MEC_NS.Calendar.prototype.getDesignHtml = function(){
return getDesignHtml(this);
};
MEC_NS.Calendar.prototype.runWhenPageOnLoad = function(){
this.afterDesignHtmlBuild();
};
/*页面上显示控件完成后调用此方法,主要用于一些必须要使用js对页面进行后置操作时,无需要此方法可至空。 不必需的方法,有此方法系统自动调用*/
MEC_NS.Calendar.prototype.afterDesignHtmlBuild = function(){
var that = this;
var theId = that.id;
setTimeout(function() { // 使用模板后 插件dom未渲染完成 Swipe插件初始化出现问题 需要延时
M_Calendar.initCalendar("NMEC_" + theId);
if(typeof(_m_upDownCalendar) != "undefined"){
_m_upDownCalendar = true;
}
if(that.mecJson["isShowLunar"] == 1){
$("table",$("._m_cdar_loadCalendarDay_Container")).removeClass("_m_cdar_noneLunar");
}else{
$("table",$("._m_cdar_loadCalendarDay_Container")).addClass("_m_cdar_noneLunar");
}
if(that.mecJson["isShowGoBack"] == 1){
$("#_m_cdar_calendarYearMonth").removeClass("_m_cdar_calendarYearMonth_noBack").addClass("_m_cdar_calendarYearMonth");
}else{
$("#_m_cdar_calendarYearMonth").removeClass("_m_cdar_calendarYearMonth").addClass("_m_cdar_calendarYearMonth_noBack");
}
if(that.mecJson["isShowNew"] == 1){
$("#addDataByCalendarDate").show();
}
if(that.mecJson["isDefaultShrink"] == "1"){
$("#upDownCalendar").triggerHandler("click");
}
}, 200);
};
/*获取构建属性编辑窗体的html,添加和单击控件后会调用此方法,由此方法去构建属性编辑窗体。 必需的方法*/
MEC_NS.Calendar.prototype.getAttrDlgHtml = function(){
var styleL = "_style" + _userLanguage;
var theId = this.id;
var htm = "<div id=\"MADCdar_"+theId+"\">";
htm += "<div class=\"title\">"+SystemEnv.getHtmlNoteName(4650)+"</div>"; //日历信息
htm += "<div class=\"form-group\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label1"+styleL+"\">"+SystemEnv.getHtmlNoteName(4410)+"</span>" //显示农历:
+ "<div class=\"col-m-8\">"
+ "<span class=\"cbboxEntry\">"
+ "<input type=\"checkbox\" id=\"isShowLunar_"+theId+"\" value=\"\" onclick=\"MADCdar_isShowLunar('"+theId+"');\"/>"
+ "</span>"
+ "</div>"
+ "</div>"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label1"+styleL+"\">"+SystemEnv.getHtmlNoteName(4411)+"</span>" //显示返回:
+ "<div class=\"col-m-8\">"
+ "<span class=\"cbboxEntry\">"
+ "<input type=\"checkbox\" id=\"isShowGoBack_"+theId+"\" value=\"\" onclick=\"MADCdar_isShowGoBack('"+theId+"');\"/>"
+ "</span>"
+ "</div>"
+ "</div>"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label1"+styleL+"\">"+SystemEnv.getHtmlNoteName(4985)+"</span>" //默认收起:
+ "<div class=\"col-m-8\">"
+ "<span class=\"cbboxEntry\">"
+ "<input type=\"checkbox\" id=\"isDefaultShrink_"+theId+"\" value=\"\" onclick=\"MADCdar_isDefaultShrink('"+theId+"');\"/>"
+ "</span>"
+ "</div>"
+ "</div>"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label1"+styleL+"\">"+SystemEnv.getHtmlNoteName(4412)+"</span>" //显示新建:
+ "<div class=\"col-m-8\">"
+ "<span class=\"cbboxEntry\">"
+ "<input type=\"checkbox\" id=\"isShowNew_"+theId+"\" value=\"\" onclick=\"MADCdar_isShowNew('"+theId+"');\"/>"
+ "</span>"
/*
+ "<span id=\"span_parsedWay_"+theId+"\" style=\"display:none;width:100px;\">"
+"<select class=\"form-control\" id=\"parseWayChoose_"+theId+"\" onchange=\"MADCdar_parseWayChoose('"+theId+"');\">"
+" <option value=\"\"></option>"
+" <option value=\"1\">"+SystemEnv.getHtmlNoteName(4413)+"</option>" //自动解析新建地址
+" <option value=\"2\">"+SystemEnv.getHtmlNoteName(4414)+"</option>" //手动输入脚本
+"</select>"
+ "</span>"
*/
+ "</div>"
/*
+ "<div id=\"span_parsedWay_"+theId+"_2\" class=\"col\" style=\"display:none;margin-left:10px;\">"
+ "<div id=\"clickScriptWrap_"+theId+"\" class=\"click-control btn_click_describe\" style=\"width:24px; height:24px;\" onclick=\"MADCdar_addClickScript(this,'"+theId+"')\">"
+ "<input id=\"clickScript_"+theId+"\" type=\"hidden\" value=\"\">"
+ "</div>"
+ "</div>"
*/
+ "</div>"
+ "<div class=\"row span_parsedWay\" id=\"span_parsedWay_"+theId+"\" style=\"display:none;\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label1"+styleL+"\">"+SystemEnv.getHtmlNoteName(5088)+"</span>" //新建动作:
+ "<div class=\"col-m-8\">"
+ "<span>"
+"<select class=\"form-control\" id=\"parseWayChoose_"+theId+"\" onchange=\"MADCdar_parseWayChoose('"+theId+"');\">"
+" <option value=\"1\">"+SystemEnv.getHtmlNoteName(4413)+"</option>" //自动解析新建地址
+" <option value=\"2\">"+SystemEnv.getHtmlNoteName(4414)+"</option>" //手动输入脚本
+"</select>"
+ "</span>"
+ "</div>"
+ "</div>"
+ "<div class=\"row span_parsedWay\" id=\"span_parsedWay_"+theId+"_2\" style=\"display:none;\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label1"+styleL+"\">"+SystemEnv.getHtmlNoteName(5089)+"</span>" //输入脚本:
+ "<div class=\"col-m-8\">"
+ "<div>"
+ "<div id=\"clickScriptWrap_"+theId+"\" class=\"click-control\" style=\"width:24px; height:24px;margin:0px;\" onclick=\"MADCdar_addClickScript(this,'"+theId+"')\">"
+ "<input id=\"clickScript_"+theId+"\" type=\"hidden\" value=\"\">"
+ "</div>"
+ "</div>"
+ "</div>"
+ "</div>"
htm += "</div>";
var getDataShowWayOptionHtml = function(dataShowWay){
var optionHtml = "";
optionHtml += " <option value=\"\"></option>";
optionHtml += " <option value=\"1\">"+SystemEnv.getHtmlNoteName(4417)+"</option>"; //刷新列表
if(dataShowWay == 2){//兼容历史数据
optionHtml += " <option value=\"2\">"+SystemEnv.getHtmlNoteName(4418)+"</option>"; //刷新Url列表
}
optionHtml += " <option value=\"4\">"+SystemEnv.getHtmlNoteName(4419)+"</option>"; //刷新时间轴
optionHtml += " <option value=\"5\">"+SystemEnv.getHtmlNoteName(3916)+"</option>"; //自定义
return optionHtml;
};
htm += "<div class=\"title\">"+SystemEnv.getHtmlNoteName(4415)+"</div>";
htm += "<div class=\"form-group\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4416)+"</span>" //点击日期:
+ "<div class=\"col-m-8\">"
+"<select class=\"form-control\" id=\"dataShowWay_"+theId+"\" onchange=\"MADCdar_dataShowWay('"+theId+"');\">"
+ getDataShowWayOptionHtml(this.mecJson.dataShowWay)
+"</select>"
+ "</div>"
+ "</div>"
+ "<div id=\"div_dataShowWay_"+theId+"_1\" class=\"div_dataShowWay\" style=\"display:none;\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4420)+"</span>" //选择列表:
+ "<div class=\"col-m-8\">"
+"<select class=\"form-control\" id=\"listChoose_"+theId+"\" onchange=\"MADCdar_listChoose('"+theId+"');\">"
+" <option value=\"\"></option>"
+"</select>"
+ "</div>"
+ "</div>"
+ "<div class=\"div_dataShowWay_fieldSet div_dataShowWay_sqlField\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4426)+"</span>" //字段区间设置:
+ "<div class=\"col-m-2\">"
+"<select class=\"form-control\" id=\"listBetweenFieldSet_"+theId+"\" onchange=\"MADCdar_BetweenFieldChoose(1,'"+theId+"');\">"
+" <option value=\"1\">"+SystemEnv.getHtmlNoteName(3632)+"</option>" //等于
+" <option value=\"2\">"+SystemEnv.getHtmlNoteName(4422)+"</option>" //区间
+"</select>"
+ "</div>"
+ "<div class=\"col-4\" style=\"padding-left:5px;\" id=\"listEqFieldSpan_"+theId+"\">"
+"<select class=\"form-control\" id=\"listFieldSet_"+theId+"\">"
+" <option value=\"\"></option>"
+"</select>"
+ "</div>"
+ "</div>"
+ "<div id=\"listLtGtFieldSpan_"+theId+"\" class=\"row\" style=\"display:none\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\" >"+SystemEnv.getHtmlNoteName(4423)+"</span>" //开始日期:
+ "<div class=\"col-3\">"
+"<select class=\"form-control\" id=\"listBetweenStartFieldSet_"+theId+"\" >"
+" <option value=\"\"></option>"
+"</select>"
+ "</div>"
+ "<span class=\"col-3 MADCdar_BaseInfo_Entry_Label"+styleL+"\" style=\"text-align: right;\">"+SystemEnv.getHtmlNoteName(4424)+"</span>" //结束日期:
+ "<div class=\"col-3\">"
+"<select class=\"form-control\" id=\"listBetweenEndFieldSet_"+theId+"\" >"
+" <option value=\"\"></option>"
+"</select>"
+ "</div>"
+ "</div>"
+ "</div>"//end div_dataShowWay_sqlField
+ "<div class=\"div_dataShowWay_fieldSet div_dataShowWay_customField hide\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(6134)+"</span>" //列表输入参数:
+ "<div class=\"col-m-8\">"
+"<input type=\"text\" id=\"customListFieldSet_"+theId+"\" class=\"form-control\" placeholder=\""+SystemEnv.getHtmlNoteName(6133)+"\" value=\"\">"//如:searchKey
+ "</div>"
+ "</div>"
+ "</div>"//end div_dataShowWay_customField
+ "</div>"
+ "<div id=\"div_dataShowWay_"+theId+"_2\" class=\"div_dataShowWay\" style=\"display:none;\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4420)+"</span>" //选择Url列表:
+ "<div class=\"col-m-8\">"
+"<select class=\"form-control\" id=\"urlListChoose_"+theId+"\" onchange=\"MADCdar_urlListChoose('"+theId+"');\">"
+" <option value=\"\"></option>"
+"</select>"
+ "</div>"
+ "</div>"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(6134)+"</span>" //列表输入参数:
+ "<div class=\"col-m-8\">"
+"<input type=\"text\" id=\"urlListFieldSet_"+theId+"\" class=\"form-control\" placeholder=\""+SystemEnv.getHtmlNoteName(6133)+"\" value=\"\">"
+ "</div>"
+ "</div>"
+ "</div>"
+ "<div id=\"div_dataShowWay_"+theId+"_3\" class=\"div_dataShowWay\" style=\"display:none;\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4420)+"</span>" //选择WS列表:
+ "<div class=\"col-m-8\">"
+"<select class=\"form-control\" id=\"wsListChoose_"+theId+"\" onchange=\"MADCdar_wsListChoose('"+theId+"');\">"
+" <option value=\"\"></option>"
+"</select>"
+ "</div>"
+ "</div>"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4426)+"</span>" //字段设置:
+ "<div class=\"col-m-8\">"
+"<input type=\"text\" id=\"wsListFieldSet_"+theId+"\" class=\"form-control\" value=\"\">"
+ "</div>"
+ "</div>"
+ "</div>"
+ "<div id=\"div_dataShowWay_"+theId+"_4\" class=\"div_dataShowWay\" style=\"display:none;\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4420)+"</span>" //选择时间轴:
+ "<div class=\"col-m-8\">"
+"<select class=\"form-control\" id=\"timeLineChoose_"+theId+"\" onchange=\"MADCdar_timeLineChoose('"+theId+"');\">"
+" <option value=\"\"></option>"
+"</select>"
+ "</div>"
+ "</div>"
+ "<div class=\"div_dataShowWay_fieldSet div_dataShowWay_sqlField\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4426)+"</span>" //字段区间设置:
+ "<div class=\"col-m-2\">"
+"<select class=\"form-control\" id=\"timeLineBetweenFieldSet_"+theId+"\" onchange=\"MADCdar_BetweenFieldChoose(2,'"+theId+"');\">"
+" <option value=\"1\">"+SystemEnv.getHtmlNoteName(3632)+"</option>" //等于
+" <option value=\"2\">"+SystemEnv.getHtmlNoteName(4422)+"</option>" //区间
+"</select>"
+ "</div>"
+ "<div class=\"col-4\" style=\"padding-left:5px;\" id=\"timeLineEqFieldSpan_"+theId+"\">"
+"<select class=\"form-control\" id=\"timeLineFieldSet_"+theId+"\">"
+" <option value=\"\"></option>"
+"</select>"
+ "</div>"
+ "</div>"
+ "<div id=\"timeLineLtGtFieldSpan_"+theId+"\" class=\"row\" style=\"display:none;\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\" >"+SystemEnv.getHtmlNoteName(4423)+"</span>" //开始日期:
+ "<div class=\"col-3\">"
+"<select class=\"form-control\" id=\"timeLineBetweenStartFieldSet_"+theId+"\">"
+" <option value=\"\"></option>"
+"</select>"
+ "</div>"
+ "<span class=\"col-3 MADCdar_BaseInfo_Entry_Label"+styleL+"\" style=\"text-align: right;\">"+SystemEnv.getHtmlNoteName(4424)+"</span>" //结束日期:
+ "<div class=\"col-3\" >"
+"<select class=\"form-control\" id=\"timeLineBetweenEndFieldSet_"+theId+"\">"
+" <option value=\"\"></option>"
+"</select>"
+ "</div>"
+ "</div>"
+ "</div>"//end div_dataShowWay_sqlField
+ "<div class=\"div_dataShowWay_fieldSet div_dataShowWay_customField hide\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(6134)+"</span>" //列表输入参数:
+ "<div class=\"col-m-8\">"
+"<input type=\"text\" id=\"customTimelineFieldSet_"+theId+"\" class=\"form-control\" placeholder=\""+SystemEnv.getHtmlNoteName(6133)+"\" value=\"\">"//如:searchKey
+ "</div>"
+ "</div>"
+ "</div>"//end div_dataShowWay_customField
+ "</div>"
+ "<div id=\"div_dataShowWay_"+theId+"_5\" class=\"div_dataShowWay\" style=\"display:none;\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4349)+"</span>" //单击事件:
+ "<div class=\"col-m-8\">"
+ "<div id=\"clickScriptWrap_"+theId+"\" class=\"col click-control\" onclick=\"MADCdar_addClickScript(this,'"+theId+"')\">"
+ "<input id=\"customClickScript_"+theId+"\" type=\"hidden\" value=\"\">"
+ SystemEnv.getHtmlNoteName(4574) + SystemEnv.getHtmlNoteName(4634) //单击脚本
+ "</div>"
+ "</div>"
+ "</div>"
+ "</div>"
+ "<div class=\"div_InitScope\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(5090)+"</span>" //初始数据:
+ "<div class=\"col-4\">"
+"<select class=\"form-control\" id=\"dataInitScope_"+theId+"\">"
+" <option value=\"1\">"+SystemEnv.getHtmlNoteName(4430)+"</option>" //当天
+" <option value=\"2\">"+SystemEnv.getHtmlNoteName(3409)+"</option>" //本周
+" <option value=\"3\">"+SystemEnv.getHtmlNoteName(3410)+"</option>" //本月
+" <option value=\"4\">"+SystemEnv.getHtmlNoteName(3407)+"</option>" //全部
+"</select>"
+ "</div>"
+ "<span class=\"col pd-7\" style=\"padding-left:5px;\">("+SystemEnv.getHtmlNoteName(4431)+")</span>" //首次初始化生效
+ "</div>"
+ "</div>"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADCdar_BaseInfo_Entry_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(5091)+"</span>" //重新加载:
+ "<div class=\"col-m-8\">"
+ "<span class=\"pr-10\">"
+ "<input type=\"checkbox\" id=\"isReloadSwitch_"+theId+"\" value=\"\"/>"
+ "</span>"
+ "<span class=\"inline-tip\">("+SystemEnv.getHtmlNoteName(4433)+")</span>" //切换周月的时候重新加载数据
+ "</div>"
+ "</div>";
htm += "</div>";
htm += "<div class=\"title row\">"
+ SystemEnv.getHtmlNoteName(4434) //日期标记
+ "<div class=\"col-4 tr multi-checkbox\" style=\"font-weight: normal;\">"
+ "<span>"
+ "<input type=\"checkbox\" name=\"sourceType_"+theId+"\" value=\"1\" onclick=\"MADCdar_ChangeSourceType(this, '"+theId+"');\"/><span class=\"cbboxLabel\">SQL</span>"
+ "</span>"
+ "<span>"
+ "<input type=\"checkbox\" name=\"sourceType_"+theId+"\" value=\"2\" onclick=\"MADCdar_ChangeSourceType(this, '"+theId+"');\"/><span class=\"cbboxLabel\">Url</span>"
+ "</span>"
+ "</div>"
htm += "</div>";
htm += "<div class=\"content\">"
+ "<div id=\"div_sourceType_"+theId+"_1\" class=\"div_sourceType\" style=\"display:none;\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control\">"+SystemEnv.getHtmlNoteName(4201)+"</span>" //数据源:
+ "<div class=\"col-m-8\">"
+"<select class=\"form-control\" id=\"datasource_"+theId+"\">"
+" <option value=\"\">(local)</option>"
+"</select>"
+ "</div>"
+ "</div>"
+ "<div class=\"row\" style='position: relative'>"
+ "<span class=\"col-2 span-control\" style=\"vertical-align: top;\">SQL:</span>"
+ "<div class=\"col-m-8\">"
+ "<textarea id=\"sql_"+theId+"\" class=\"area-control\" style=\"height: 120px;\" placeholder=\""+SystemEnv.getHtmlNoteName(4380) +"\"></textarea>" //请在此处键入SQL
+ "</div>"
+ "<div class=\"helper\" data-tipmsg=\""+ MADCdar_dateMarkSQLTip() +"\" style=\"top:7px;right:10px\" for=\"default\">?</div>"
+ "</div>"
+ "</div>"
+ "<div id=\"div_sourceType_"+theId+"_2\" class=\"div_sourceType\" style=\"display:none;\">"
+ "<div class=\"row\" style='position: relative'>"
+ "<span class=\"col-2 span-control\" style=\"vertical-align: top;\">URL:</span>"
+ "<div class=\"col-m-8\">"
+ "<textarea id=\"url_"+theId+"\" class=\"area-control\" style=\"height: 120px;\" placeholder=\""+SystemEnv.getHtmlNoteName(4381)+"\"></textarea>" //请在此处键入Url
+ "</div>"
+ "<div class=\"helper\" data-tipmsg=\""+ MADCdar_dateMarkURLTip() +"\" style=\"top:7px;right:10px\" for=\"default\">?</div>"
+ "</div>"
+ "</div>";
htm += "</div>";
htm += "<div class=\"bottom\"><div class=\"save-btn\" onclick=\"refreshMecDesign('"+theId+"');\">"+SystemEnv.getHtmlNoteName(3451)+"</div></div>"; //确定
htm += "</div>";
htm += "<div class=\"MAD_Alert\">"+SystemEnv.getHtmlNoteName(4115)+"</div>"; //已生成到布局
return htm;
};
/*构建属性编辑窗体完成后调用此方法,主要用于一些必须要使用js对页面进行后置操作时,无需要此方法可至空。 不必需的方法,有此方法系统自动调用*/
MEC_NS.Calendar.prototype.afterAttrDlgBuild = function(){
var theId = this.id;
var sourceTypeV = this.mecJson["sourceType"];
var $sourceType = $("input[type='checkbox'][name='sourceType_"+theId+"'][value='"+sourceTypeV+"']");
if($sourceType.length > 0){
$sourceType.checked();
}
var datasource = Mec_FiexdUndefinedVal(this.mecJson["datasource"]);
$("#datasource_"+theId).val(datasource);
MADCdar_setDataSourceHTML(theId, datasource);
$("#sql_"+theId).val(Mec_FiexdUndefinedVal(this.mecJson["sql"]));
$("#url_"+theId).val(Mec_FiexdUndefinedVal(this.mecJson["url"]));
var dataShowWay = Mec_FiexdUndefinedVal(this.mecJson["dataShowWay"]);
$("#dataShowWay_"+theId).val(dataShowWay);
if(dataShowWay != ""){
MADCdar_dataShowWay(theId);
}
var listChoose = Mec_FiexdUndefinedVal(this.mecJson["listChoose"]);
$("#listChoose_"+theId).val(listChoose);
if(listChoose != ""){
MADCdar_listChoose(theId);
}
var listBetweenFieldSet = Mec_FiexdUndefinedVal(this.mecJson["listBetweenFieldSet"]);
$("#listBetweenFieldSet_"+theId).val(listBetweenFieldSet);
if(listBetweenFieldSet != ""){
MADCdar_BetweenFieldChoose(1,theId);
}
$("#listFieldSet_"+theId).val(MADCdar_convertFieldSet(listChoose, this.mecJson["listFieldSet"]));
$("#listBetweenStartFieldSet_"+theId).val(MADCdar_convertFieldSet(listChoose, this.mecJson["listBetweenStartFieldSet"]));
$("#listBetweenEndFieldSet_"+theId).val(MADCdar_convertFieldSet(listChoose, this.mecJson["listBetweenEndFieldSet"]));
$("#customListFieldSet_"+theId).val(this.mecJson["customListFieldSet"] || "");
$("#urlListChoose_"+theId).val(this.mecJson["urlListChoose"]);
$("#urlListFieldSet_"+theId).val(this.mecJson["urlListFieldSet"]);
$("#wsListChoose_"+theId).val(this.mecJson["wsListChoose"]);
$("#wsListFieldSet_"+theId).val(this.mecJson["wsListFieldSet"]);
var timeLineChoose = Mec_FiexdUndefinedVal(this.mecJson["timeLineChoose"]);
$("#timeLineChoose_"+theId).val(timeLineChoose);
if(timeLineChoose != ""){
MADCdar_timeLineChoose(theId);
}
var timeLineBetweenFieldSet = Mec_FiexdUndefinedVal(this.mecJson["timeLineBetweenFieldSet"]);
$("#timeLineBetweenFieldSet_"+theId).val(timeLineBetweenFieldSet);
if(timeLineBetweenFieldSet != ""){
MADCdar_BetweenFieldChoose(2,theId);
}
$("#timeLineFieldSet_"+theId).val(MADCdar_convertFieldSet(timeLineChoose, this.mecJson["timeLineFieldSet"]));
$("#timeLineBetweenStartFieldSet_"+theId).val(MADCdar_convertFieldSet(timeLineChoose, this.mecJson["timeLineBetweenStartFieldSet"]));
$("#timeLineBetweenEndFieldSet_"+theId).val(MADCdar_convertFieldSet(timeLineChoose, this.mecJson["timeLineBetweenEndFieldSet"]));
$("#customTimelineFieldSet_"+theId).val(this.mecJson["customTimelineFieldSet"] || "");
$("#dataInitScope_"+theId).val(this.mecJson["dataInitScope"]);
var isReloadSwitch = this.mecJson["isReloadSwitch"];
$("#isReloadSwitch_"+theId).val(isReloadSwitch);
if(isReloadSwitch == 1){
$("#isReloadSwitch_"+theId).checked();
}
var $customClickScript = $("#customClickScript_"+theId);
$customClickScript.val(this.mecJson["customClickScript"]);
SL_ChangeStyle($customClickScript.parent(), this.mecJson["customClickScript"]);
var isShowLunar = this.mecJson["isShowLunar"];
$("#isShowLunar_"+theId).val(isShowLunar);
if(isShowLunar == 1){
$("#isShowLunar_"+theId).checked();
}
var isShowGoBack = this.mecJson["isShowGoBack"];
$("#isShowGoBack_"+theId).val(isShowGoBack);
if(isShowGoBack == 1){
$("#isShowGoBack_"+theId).checked();
MADCdar_isShowGoBack(theId);
}
var isDefaultShrink = this.mecJson["isDefaultShrink"];
if(isDefaultShrink == "1"){
$("#isDefaultShrink_"+theId).checked();
}
var isShowNew = Mec_FiexdUndefinedVal(this.mecJson["isShowNew"]);
$("#isShowNew_"+theId).val(isShowNew);
$("#parseWayChoose_"+theId).val(this.mecJson["parseWayChoose"]);
if(isShowNew == 1){
$("#isShowNew_"+theId).checked();
MADCdar_isShowNew(theId);
}
var $clickScript = $("#clickScript_"+theId);
$clickScript.val(this.mecJson["clickScript"]);
SL_ChangeStyle($clickScript.parent(), this.mecJson["clickScript"]);
var $attrContainer = $("#MADCdar_"+theId);
$attrContainer.checkbox();
require(["modal"], function(modal) {
var indexArr = [];
$($attrContainer).on("click",".helper", function(e) {
indexArr.push(modal.tips($(this).data('tipmsg'), $(this), {
area: ['250px', ''],
placement: "left"
}));
e.stopPropagation();
});
$("body").on("click", function(e) {
var $target = $(e.target);
var layero = $target.parents(".layui-layer-tips");
if(layero.length) return;
indexArr.map(function (v) {
modal.close(v);
});
});
});
};
/*获取JSON*/
MEC_NS.Calendar.prototype.getMecJson = function(){
var theId = this.id;
this.mecJson["id"] = theId;
this.mecJson["mectype"] = this.type;
var $attrContainer = $("#MAD_"+theId);
if($attrContainer.length > 0){
this.mecJson["sourceType"] = $("input[type='checkbox'][name='sourceType_"+theId+"']:checked").val();
this.mecJson["datasource"] = $("#datasource_"+theId).val();
this.mecJson["sql"] = $("#sql_"+theId).val();
this.mecJson["url"] = $("#url_"+theId).val();
this.mecJson["dataShowWay"] = $("#dataShowWay_"+theId).val();
var $listChoose = $("#listChoose_"+theId),
listChooseId = $listChoose.val(),
$option = $listChoose.find("option[value='"+listChooseId+"']");
this.mecJson["listChoose"] = listChooseId;
this.mecJson["listChooseSourceType"] = $option.data("sourcetype");
this.mecJson["listChooseMecType"] = $option.data("mectype");
this.mecJson["listBetweenFieldSet"] = $("#listBetweenFieldSet_"+theId).val();
this.mecJson["listFieldSet"] = $("#listFieldSet_"+theId).val();
this.mecJson["listFieldidSet"] = Mec_FiexdUndefinedVal($("#listFieldSet_"+theId+" option:selected").attr("fieldid"));
this.mecJson["listBetweenStartFieldSet"] = $("#listBetweenStartFieldSet_"+theId).val();
this.mecJson["listBetweenStartFieldidSet"] = Mec_FiexdUndefinedVal($("#listBetweenStartFieldSet_"+theId+" option:selected").attr("fieldid"));
this.mecJson["listBetweenEndFieldSet"] = $("#listBetweenEndFieldSet_"+theId).val();
this.mecJson["listBetweenEndFieldidSet"] = Mec_FiexdUndefinedVal($("#listBetweenEndFieldSet_"+theId+" option:selected").attr("fieldid"));
this.mecJson["customListFieldSet"] = $("#customListFieldSet_"+theId).val();
this.mecJson["urlListChoose"] = $("#urlListChoose_"+theId).val();
this.mecJson["urlListFieldSet"] = $("#urlListFieldSet_"+theId).val();
this.mecJson["wsListChoose"] = $("#wsListChoose_"+theId).val();
this.mecJson["wsListFieldSet"] = $("#wsListFieldSet_"+theId).val();
var $timeLineChoose = $("#timeLineChoose_"+theId),
timeLineChooseId = $timeLineChoose.val(),
$option = $timeLineChoose.find("option[value='"+timeLineChooseId+"']");
this.mecJson["timeLineChoose"] = timeLineChooseId;
this.mecJson["timeLineChooseSourceType"] = $option.data("sourcetype");
this.mecJson["timeLineChooseMecType"] = $option.data("mectype");
this.mecJson["timeLineBetweenFieldSet"] = $("#timeLineBetweenFieldSet_"+theId).val();
this.mecJson["timeLineFieldSet"] = $("#timeLineFieldSet_"+theId).val();
this.mecJson["timeLineFieldidSet"] = Mec_FiexdUndefinedVal($("#timeLineFieldSet_"+theId+" option:selected").attr("fieldid"));
this.mecJson["timeLineBetweenStartFieldSet"] = $("#timeLineBetweenStartFieldSet_"+theId).val();
this.mecJson["timeLineBetweenStartFieldidSet"] = Mec_FiexdUndefinedVal($("#timeLineBetweenStartFieldSet_"+theId+" option:selected").attr("fieldid"));
this.mecJson["timeLineBetweenEndFieldSet"] = $("#timeLineBetweenEndFieldSet_"+theId).val();
this.mecJson["timeLineBetweenEndFieldidSet"] = Mec_FiexdUndefinedVal($("#timeLineBetweenEndFieldSet_"+theId+" option:selected").attr("fieldid"));
this.mecJson["customTimelineFieldSet"] = $("#customTimelineFieldSet_"+theId).val();
this.mecJson["dataInitScope"] = $("#dataInitScope_"+theId).val();
this.mecJson["isReloadSwitch"] = $("#isReloadSwitch_"+theId).is(":checked") ? "1" : "0";
this.mecJson["customClickScript"] = $("#customClickScript_"+theId).val();
this.mecJson["isShowLunar"] = $("#isShowLunar_"+theId).is(":checked") ? "1" : "0";
this.mecJson["isShowGoBack"] = $("#isShowGoBack_"+theId).is(":checked") ? "1" : "0";
this.mecJson["isDefaultShrink"] = $("#isDefaultShrink_"+theId).is(":checked") ? "1" : "0";
this.mecJson["isShowNew"] = $("#isShowNew_"+theId).is(":checked") ? "1" : "0";
this.mecJson["parseWayChoose"] = $("#parseWayChoose_"+theId).val();
this.mecJson["clickScript"] = $("#clickScript_"+theId).val();
}
return this.mecJson;
};
MEC_NS.Calendar.prototype.getDefaultMecJson = function(){
var theId = this.id;
var defMecJson = {};
defMecJson["id"] = theId;
defMecJson["mectype"] = this.type;
defMecJson["sourceType"] = "1"; //SQL
defMecJson["datasource"] = ""; //单击类型
defMecJson["sql"] = ""; //sql
defMecJson["url"] = ""; //url
defMecJson["dataShowWay"] = ""; //数据展现方式
defMecJson["listChoose"] = "";
defMecJson["listBetweenFieldSet"] = "1"; //字段区间设置默认按"等于"
defMecJson["listFieldSet"] = "";
defMecJson["listBetweenStartFieldSet"] = "";
defMecJson["listBetweenEndFieldSet"] = "";
defMecJson["customListFieldSet"] = "searchKey";
defMecJson["urlListChoose"] = "";
defMecJson["urlListFieldSet"] = "";
defMecJson["wsListChoose"] = "";
defMecJson["wsListFieldSet"] = "";
defMecJson["timeLineChoose"] = "";
defMecJson["timeLineBetweenFieldSet"] = "1"; //字段区间设置默认按"等于"
defMecJson["timeLineFieldSet"] = "";
defMecJson["timeLineBetweenStartFieldSet"] = "";
defMecJson["timeLineBetweenEndFieldSet"] = "";
defMecJson["dataInitScope"] = "1"; //当天
defMecJson["isReloadSwitch"] = "0"; //切换周、月是否重新加载数据,默认不加载
defMecJson["customClickScript"] = "var _date = $cal_date; /*"+SystemEnv.getHtmlNoteName(4437)+"*/"; //$cal_date为日历控件单击事件触发时的日期
defMecJson["isShowLunar"] = "1"; //默认显示农历
defMecJson["isShowGoBack"] = ""; //显示返回
defMecJson["isShowNew"] = "1"; //默认显示新建
defMecJson["parseWayChoose"] = "1"; //解析方式(默认自动新建地址)
defMecJson["clickScript"] = "var _date = $cal_date; /*"+SystemEnv.getHtmlNoteName(4438)+"*/"; //$cal_date为日历控件当前选中的日期
return defMecJson;
};
function MADCdar_ChangeSourceType(cbObj, mec_id){
setTimeout(function(){ //checkbox用了插件,不延时checkbox的checked状态获取不准确
var objV = cbObj.value;
if(!cbObj.checked){
changeCheckboxStatus(cbObj, true);
return;
}else{
$("input[type='checkbox'][name='sourceType_"+mec_id+"']").each(function(){
if(this.value != objV){
changeCheckboxStatus(this, false);
}
});
}
$(".div_sourceType", "#MADCdar_"+mec_id).hide();
$("#div_sourceType_"+mec_id+"_" + objV).show();
},100);
}
function MADCdar_setDataSourceHTML(mec_id,val){
var $MADCdar_DataSource = $("#datasource_" + mec_id);
var url = jionActionUrl("com.weaver.formmodel.mobile.servlet.MobileAppBaseAction", "action=getDataSource");
FormmodeUtil.doAjaxDataLoad(url, function(datas){
for(var i = 0; i < datas.length; i++){
var data = datas[i];
var pointid = data;
var selected = "";
if (pointid=="" || typeof(pointid)=="undefined") continue;
if (pointid == val) selected = "selected";
var dataSourceSelectHtml = "<option value=\""+pointid+"\" "+selected+">";
dataSourceSelectHtml += pointid;
dataSourceSelectHtml += "</option>";
$MADCdar_DataSource.append(dataSourceSelectHtml);
}
});
}
function MADCdar_dataShowWay(theId){
var showWayV = $("#dataShowWay_"+theId).val();
if(showWayV == "1"){ //List
MADCdar_set_List_UList_timeLinrOption(theId, $("#listChoose_"+theId), "List,NList");
}else if(showWayV == "2"){ //UrlList
MADCdar_set_List_UList_timeLinrOption(theId, $("#urlListChoose_"+theId), "UrlList");
}else if(showWayV == "3"){ //WSList
MADCdar_set_List_UList_timeLinrOption(theId, $("#wsListChoose_"+theId), "WSList");
}else if(showWayV == "4"){ //Timelinr
MADCdar_set_List_UList_timeLinrOption(theId, $("#timeLineChoose_"+theId), "Timelinr,NTimeline");
}
var $attrContainer = $("#MADCdar_"+theId);
$attrContainer.find(".div_dataShowWay").hide();
$("#div_dataShowWay_"+theId+"_" + showWayV).show();
}
function MADCdar_set_List_UList_timeLinrOption(theId, urlListLinrObj, types){
urlListLinrObj.html("");
urlListLinrObj.append("<option value=\"\"></option>");
var mecHandlerList = [];
types.split(",").forEach(function(type) {
mecHandlerList.push.apply(mecHandlerList, MECHandlerPool.getHandlerByType(type));
});
for(var i = 0; i < mecHandlerList.length; i++){
var mecHandlerObj = mecHandlerList[i];
var mecHandlerid = mecHandlerObj.getID();
var sourceData = mecHandlerObj.mecJson.sourceData || {}, sourceType = sourceData.sourceType || "";
if(sourceType == 2) continue;//不支持模拟数据
var optionStr = "<option data-mectype=\""+mecHandlerObj.type+"\" data-sourcetype=\""+sourceType+"\" value=\""+mecHandlerid+"\">";
optionStr += mecHandlerObj.getName();
optionStr += "</option>";
urlListLinrObj.append(optionStr);
}
}
function MADCdar_listChoose(theId){
var mec_idV = $("#listChoose_"+theId).val();
$("#listFieldSet_"+theId).html("").append("<option value=\"\"></option>");
$("#listBetweenStartFieldSet_"+theId).html("").append("<option value=\"\"></option>");
$("#listBetweenEndFieldSet_"+theId).html("").append("<option value=\"\"></option>");
var renderFields = function(fieldList){
var optionStr = "";
for(var i = 0; i < fieldList.length; i++){
var field = fieldList[i], prefix = field.sqlField ? "" : (field.detailtable ? "d1." : "t1.");
optionStr += "<option value=\""+ prefix + field.fieldName + "\" fieldid=\""+field.fieldid+"\">";
optionStr += field.fieldDesc +(field.detailtable ? "-"+SystemEnv.getHtmlNoteName(4865) : "");//4865-明细字段
optionStr += "</option>";
}
$("#listFieldSet_"+theId).append(optionStr);
$("#listBetweenStartFieldSet_"+theId).append(optionStr);
$("#listBetweenEndFieldSet_"+theId).append(optionStr);
};
try{
if(mec_idV != ""){
var mecHandler = MECHandlerPool.getHandler(mec_idV), sourceType = "1";
if(mecHandler.type == 'NList'){
var sourceData = mecHandler.mecJson.sourceData || {};
sourceType = sourceData.sourceType;
if(sourceType == "1" || sourceType == "3"){
renderFields(mecHandler.getSourceFields(sourceData));
}
}else{
renderFields(mecHandler.getFieldInfo());
}
MADCdar_afterListChoose(theId, "1", sourceType);
Mec_SetLazyLoad(mec_idV); //设置延迟加载
}
}catch(e){
}
}
function MADCdar_urlListChoose(theId){
var mec_idV = $("#urlListChoose_"+theId).val();
try{
if(mec_idV != ""){
Mec_SetLazyLoad(mec_idV); //设置延迟加载
}
}catch(e){
}
}
function MADCdar_wsListChoose(theId){
var mec_idV = $("#wsListChoose_"+theId).val();
try{
if(mec_idV != ""){
Mec_SetLazyLoad(mec_idV); //设置延迟加载
}
}catch(e){
}
}
function MADCdar_timeLineChoose(theId){
var mec_idV = $("#timeLineChoose_"+theId).val();
$("#timeLineFieldSet_"+theId).html("").append("<option value=\"\"></option>");
$("#timeLineBetweenStartFieldSet_"+theId).html("").append("<option value=\"\"></option>");
$("#timeLineBetweenEndFieldSet_"+theId).html("").append("<option value=\"\"></option>");
var renderFields = function(fieldList){
var optionStr = '';
for(var i = 0; i < fieldList.length; i++){
var field = fieldList[i], prefix = field.sqlField ? "" : (field.detailtable ? "d1." : "t1.");
optionStr += "<option value=\"" + prefix + field.fieldName + "\" fieldid=\""+field.fieldid+"\">";
optionStr += field.fieldDesc +(field.detailtable ? "-"+SystemEnv.getHtmlNoteName(4865) : "");//4865-明细字段
optionStr += "</option>";
}
$("#timeLineFieldSet_"+theId).append(optionStr);
$("#timeLineBetweenStartFieldSet_"+theId).append(optionStr);
$("#timeLineBetweenEndFieldSet_"+theId).append(optionStr);
}
try{
if(mec_idV != ""){
var mecHandler = MECHandlerPool.getHandler(mec_idV), sourceType = '1';
if(mecHandler.type == 'NTimeline'){
var sourceData = mecHandler.mecJson.sourceData || {};
sourceType = sourceData.sourceType;
if(sourceType == '1' || sourceType == '3'){
renderFields(mecHandler.getSourceFields(sourceData));
}
} else {
renderFields(mecHandler.getFieldInfo());
}
MADCdar_afterListChoose(theId, '4', sourceType);
Mec_SetLazyLoad(mec_idV); //设置延迟加载
}
}catch(e){
}
}
function MADCdar_afterListChoose(theId, dataShowWay, sourceType){
var $dataShowWayContainer = $("#div_dataShowWay_"+theId+"_" + dataShowWay);
$dataShowWayContainer.find(".div_dataShowWay_fieldSet").hide();
if(sourceType == 1 || sourceType == 3){
$dataShowWayContainer.find(".div_dataShowWay_sqlField").show();
}else{
$dataShowWayContainer.find(".div_dataShowWay_customField").show();
}
}
function MADCdar_BetweenFieldChoose(type,theId){
if("1" == type){
var mec_idV = $("#listBetweenFieldSet_"+theId).val();
if(mec_idV == "1"){
$("#listEqFieldSpan_"+theId).show();
$("#listLtGtFieldSpan_"+theId).hide();
}else{
$("#listEqFieldSpan_"+theId).hide();
$("#listLtGtFieldSpan_"+theId).show();
}
}else if("2" == type){
var mec_idV = $("#timeLineBetweenFieldSet_"+theId).val();
if(mec_idV == "1"){
$("#timeLineEqFieldSpan_"+theId).show();
$("#timeLineLtGtFieldSpan_"+theId).hide();
}else{
$("#timeLineEqFieldSpan_"+theId).hide();
$("#timeLineLtGtFieldSpan_"+theId).show();
}
}
}
function MADCdar_isShowLunar(theId){
var isShowLunarV = $("#isShowLunar_"+theId);
if(isShowLunarV[0].checked){
$("table",$("._m_cdar_loadCalendarDay_Container")).removeClass("_m_cdar_noneLunar");
}else{
$("table",$("._m_cdar_loadCalendarDay_Container")).addClass("_m_cdar_noneLunar");
}
}
function MADCdar_isShowGoBack(theId){
setTimeout(function(){ //checkbox用了插件,不延时checkbox的checked状态获取不准确
var isShowGoBackV = $("#isShowGoBack_"+theId);
if(isShowGoBackV[0].checked){
$("#_m_cdar_calendarYearMonth").removeClass("_m_cdar_calendarYearMonth_noBack").addClass("_m_cdar_calendarYearMonth");
}else{
$("#_m_cdar_calendarYearMonth").removeClass("_m_cdar_calendarYearMonth").addClass("_m_cdar_calendarYearMonth_noBack");
}
},100);
}
function MADCdar_isDefaultShrink(theId){
setTimeout(function(){ //checkbox用了插件,不延时checkbox的checked状态获取不准确
var isDefaultShrink = $('#isDefaultShrink_'+theId);
var upDownCalendar = $("#"+theId+" ._m_cdar_upDownCalendar");
if(isDefaultShrink[0].checked){
if(!upDownCalendar.hasClass("_m_cdar_upDownCalendarSwitch")){
upDownCalendar.triggerHandler("click");
}
}else if(upDownCalendar.hasClass("_m_cdar_upDownCalendarSwitch")){
upDownCalendar.triggerHandler("click");
}
},100);
}
function MADCdar_isShowNew(theId){
setTimeout(function(){ //checkbox用了插件,不延时checkbox的checked状态获取不准确
var isShowNewV = $("#isShowNew_"+theId);
if(isShowNewV[0].checked){
$("#span_parsedWay_"+theId).show();
$("#addDataByCalendarDate",$("#NMEC_"+theId)).show();
if($("#parseWayChoose_"+theId+" option:selected").val() == 2){
$("#span_parsedWay_"+theId+"_2").show();
}
}else{
$(".span_parsedWay").hide();
$("#addDataByCalendarDate",$("#NMEC_"+theId)).hide();
}
},100);
}
function MADCdar_parseWayChoose(theId){
var parseWayChoose = $("#parseWayChoose_"+theId);
if(parseWayChoose.val() == 2){
$("#span_parsedWay_"+theId+"_2").show();
}else{
$("#span_parsedWay_"+theId+"_2").hide();
}
}
function MADCdar_addClickScript(obj,mec_id){
var $btnScript = $(obj).find("input");
SL_AddScriptToField($btnScript);
}
function MADCdar_dateMarkSQLTip(){
var tip = SystemEnv.getHtmlNoteName(4435);//请在此处键入查询出需要标记的日期SQL,例如:
tip += "\n select rcdate , 'red' from uf_schedule where status = 1 ";
tip += "\n union all ";
tip += "\n select rcdate , 'blue' from uf_schedule where status = 2 ";
return tip;
}
function MADCdar_dateMarkURLTip(){
var tip = SystemEnv.getHtmlNoteName(6132) ;//请在此处键入查询出需要标记的日期Url,返回JSON格式如:
tip += "\n[";
tip += "\n { date : '2018-05-03', color : 'red' }, ";
tip += "\n { date : '2018-05-04', color : 'blue' } ";
tip += "\n]";
return tip;
}
function MADCdar_convertFieldSet(mec_idV, fieldSet){
try{
var reg = new RegExp(/^(d1\.|t1\.)/);
if(mec_idV && fieldSet && !fieldSet.match(reg)){
var fieldList = "";
var mecHandler = MECHandlerPool.getHandler(mec_idV), sourceType = "1";
if(mecHandler.type == 'NList'){
var sourceData = mecHandler.mecJson.sourceData || {};
sourceType = sourceData.sourceType;
if(sourceType == "1" || sourceType == "3"){
fieldList = mecHandler.getSourceFields(sourceData);
}
}else{
fieldList = mecHandler.getFieldInfo();
}
if(fieldList && fieldList.length>0){
var field = fieldList[0], prefix = field.sqlField ? "" : (field.detailtable ? "d1." : "t1.");
fieldSet = prefix + fieldSet;
}
}
}catch(e){
}
return fieldSet;
}