result_calendar.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <script src="/static/fullcalendar-3.10.2/lib/jquery.min.js"></script>
  4. <script src='/static/fullcalendar-3.10.2/lib/moment.min.js'></script>
  5. <script src="/static/fullcalendar-3.10.2/fullcalendar.min.js"></script>
  6. <script src="/static/fullcalendar-3.10.2/locale/zh-cn.js"></script>
  7. <link rel="stylesheet" href="/static/fullcalendar-3.10.2/fullcalendar.min.css" />
  8. <link href='/static/fullcalendar-3.10.2/fullcalendar.print.min.css' rel='stylesheet' media='print' />
  9. <style>
  10. .bgstatus{
  11. display: inline-block;
  12. width: 60px;
  13. height: 20px;
  14. line-height: 20px;
  15. color: #fff;
  16. border-radius: 3px;
  17. text-align: center;
  18. }
  19. .bgs0{
  20. background-color: #777777;
  21. }
  22. </style>
  23. <div class="ibox">
  24. <div class="ibox-title">
  25. <h5>{$addrName}</h5>
  26. <div class="ibox-tools">
  27. <a class="toback" href="javascript:;" onclick="history.back();">
  28. 返回上一页
  29. </a>
  30. </div>
  31. </div>
  32. <div class="ibox-content">
  33. <div id="calendar"></div>
  34. </div>
  35. </div>
  36. {/block}
  37. {block name="script"}
  38. <script>
  39. var url = "{:url('PatrolTask/taskjsonResult')}?mode={$mode}&addrId={$addrId}";
  40. var date = new Date();
  41. var d = date.getDate();
  42. var m = date.getMonth();
  43. var y = date.getFullYear();
  44. var calendar = $('#calendar').fullCalendar({
  45. firstDay: 1,
  46. locale:'zh-cn',
  47. currentTimezone: 'Asia/Shanghai',
  48. eventLimit: false, //多个记录,显示更多查看
  49. buttonText: {
  50. prev: '<',
  51. next: '>',
  52. prevYear: '去年',
  53. nextYear: '明年',
  54. today: '今天',
  55. month: '月',
  56. week: '周',
  57. day: '日'
  58. },
  59. header: {
  60. left: 'prev,next today',
  61. center: 'title',
  62. right: 'month,agendaWeek,agendaDay'
  63. },
  64. events: url,
  65. loading: function(bool) {
  66. if (bool) {
  67. var layerIndex = layer.load(1);
  68. } else {
  69. layer.closeAll('loading');
  70. }
  71. },
  72. eventRender: function(event, element) {
  73. element.html(event.title);
  74. },
  75. editable: false,
  76. selectable: true,
  77. selectHelper: true,
  78. select: function(start, end, allDay) {
  79. }
  80. ,
  81. eventClick: function(calEvent, jsEvent, view) {
  82. layer.confirm('请选择您想做的操作', {
  83. icon: 3,
  84. // btn: ['编辑', '删除'],
  85. btn: ['详情'],
  86. skin: 'layer-ext-moon',
  87. btn1: function(index) {
  88. layer.close(index);
  89. var editurl = "{:url('patrol_record/details',[],'')}/id/"+calEvent.id+"/mode/{$mode}?type=-1";
  90. lay_open("查看", editurl);
  91. },
  92. });
  93. }
  94. });
  95. var formatDateTime = function(date) {
  96. date = new Date(date.getTime() + date.getTimezoneOffset() * 60000);
  97. var y = date.getFullYear();
  98. var m = date.getMonth() + 1;
  99. m = m < 10 ? ('0' + m) : m;
  100. var d = date.getDate();
  101. d = d < 10 ? ('0' + d) : d;
  102. var h = date.getHours();
  103. h = h < 10 ? ('0' + h) : h;
  104. var minute = date.getMinutes();
  105. minute = minute < 10 ? ('0' + minute) : minute;
  106. var second = date.getSeconds();
  107. second = second < 10 ? ('0' + second) : second;
  108. return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
  109. };
  110. function lay_open (title,url) {
  111. layer.open({
  112. type: 2,
  113. title: title,
  114. shadeClose: true,
  115. shade: 0.3,
  116. maxmin: true,
  117. area: ['90%', '90%'],
  118. content: url,
  119. end: function () {
  120. }
  121. });
  122. }
  123. </script>
  124. {/block}