operateScheduleCalendar.jsp 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <%@ page language="java" contentType="text/html;charset=GBK"
  2. pageEncoding="GBK"%>
  3. <%String view = "";
  4. if(!"".equals(request.getParameter("viewName")) && null != request.getParameter("viewName")){
  5. view = request.getParameter("viewName");
  6. }else{
  7. view = request.getAttribute("viewName").toString();
  8. }
  9. %>
  10. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  11. <html>
  12. <head>
  13. <title>他人的日程</title>
  14. <link rel="stylesheet" href="/shares/fullcalendar/jquery/themes/base/jquery.ui.all.css">
  15. <link rel="stylesheet" href="/shares/fullcalendar/fullcalendar/cupertino/theme.css">
  16. <link href="${ pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  17. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  18. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
  19. <link href='/shares/fullcalendar/fullcalendar/fullcalendar.css' rel='stylesheet' />
  20. <link href='/shares/fullcalendar/fullcalendar/fullcalendar.print.css' rel='stylesheet' media='print' />
  21. <script src='/shares/fullcalendar/jquery/jquery-1.8.0.min.js'></script>
  22. <script src='/shares/fullcalendar/jquery/jquery-ui-1.10.2.custom.min.js'></script>
  23. <script src='/shares/fullcalendar/fullcalendar/fullcalendar.min.js'></script>
  24. <script src='${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js'></script>
  25. <script src='${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDialog.js'></script>
  26. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
  27. <script type="text/javascript" src="/shares/js/common.js"></script>
  28. <script type="text/javascript" src="/shares/js/yw/master1/common.js"></script>
  29. <script type="text/javascript">
  30. var dialog3 = null;
  31. var editDialog = null;
  32. var infoDialog = null;
  33. $(function (){
  34. var schedule_user = $("#schedule_user").ligerComboBox({
  35. url :'MTScheduleAction.do?task=getManager',
  36. textField : 'manager_name',
  37. valueField : 'manager_id',
  38. valueFieldID: 'schedule_user_',
  39. initValue:'${userid}',
  40. onSelected : function (value, text){
  41. $('#calendar').empty();
  42. loadSelect(value,text);
  43. }
  44. });
  45. });
  46. function loadSelect(value,text){
  47. $(document).ready(function() {
  48. var calendar = $('#calendar').fullCalendar({
  49. header: {
  50. left: 'prev,next today',
  51. center: 'title',
  52. right: 'month,agendaWeek,agendaDay'
  53. },
  54. theme: true,
  55. timeFormat:{agenda: 'HH:mm { - HH:mm }','': 'HH:mm { - HH:mm }' },
  56. columnFormat:{//每种视图每列显示的时间格式
  57. month: 'ddd',
  58. week: 'M/d(ddd)',
  59. day: 'M/d(ddd)'
  60. },
  61. titleFormat:{//视图标题时间显示的格式
  62. month: 'yyyy年 MMMM ',
  63. week: "yyyy年 MMM d{ '&#8212;'[ MMM] d日 }",
  64. day: 'dddd, MMM d, yyyy'
  65. },
  66. axisFormat:'HH:mm',//日视图左侧时间显示的格式
  67. allDaySlot:false,
  68. allDayText:'今天的任务',
  69. //contentHeight: 10000,
  70. //weekMode: "liquid",
  71. minTime:'8:00',//在日视图和周视图显示起始时间的设置
  72. maxTime:'22:00',//在日视图和周视图显示结束时间的设置
  73. slotMinutes:30,//在日视图和周视图每一行间隔的分钟,目前设为30分钟
  74. defaultView: '<%=view%>',
  75. monthNames: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
  76. monthNamesShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
  77. dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
  78. dayNamesShort: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
  79. today: ["今天"],
  80. firstDay: 1,
  81. buttonText: {
  82. today: '今天',
  83. month: '月视图',
  84. week: '周视图',
  85. day: '日视图',
  86. prev: '<<',
  87. next: '>>'
  88. },
  89. eventSources: [
  90. {
  91. url: 'MTScheduleAction.do?task=list&userId='+value // 把从后台取出未开始的日程记录数据进行封装以后在页面上以fullCalendar的方式进行显示
  92. },
  93. {
  94. url: 'MTScheduleAction.do?task=timeOutList&userId='+value, //把从后台取出超时的日程记录数据
  95. color: 'gray'
  96. },
  97. {
  98. url: 'MTScheduleAction.do?task=completeList&userId='+value, //把从后台取出完成的日程记录数据
  99. color: 'green'
  100. }
  101. ],
  102. eventMouseover: function (calEvent, jsEvent, view) {
  103. var status = "";
  104. if (calEvent.complete == 0){
  105. status = "已完成";
  106. }
  107. else if (calEvent.complete == 1 && calEvent._day != null){
  108. status = "未开始";
  109. }
  110. else if (calEvent.complete == 1 && calEvent._day == null){
  111. status = "已超时";
  112. }
  113. $(this).attr('title', "标题:" + calEvent.title + "\n" + "状态:" + status );
  114. $(this).css('font-weight', 'normal');
  115. },
  116. eventClick: function (event, jsEvent, view ) {
  117. var viewName = $('#calendar').fullCalendar( 'getView' ).name;
  118. var start = $.fullCalendar.formatDate(event.start, "yyyy-MM-dd HH:mm");
  119. var end = $.fullCalendar.formatDate(event.end, "yyyy-MM-dd HH:mm");
  120. var title = event.title;
  121. var schedule_level_ = event.schedule_level;
  122. var schedule_level = "";
  123. if (event.schedule_level == 1){
  124. schedule_level = "重要/紧急";
  125. }else if (event.schedule_level == 2){
  126. schedule_level = "重要/不紧急";
  127. }else if (event.schedule_level == 3){
  128. schedule_level = "不重要/紧急";
  129. }else if (event.schedule_level == 4){
  130. schedule_level = "不重要/不紧急";
  131. }else if (event.schedule_level == 0){
  132. schedule_level = "未指定";
  133. }
  134. var schedule_type_ = event.schedule_type;
  135. var schedule_type = "";
  136. if(event.schedule_type == 1){
  137. schedule_type = "个人事务";
  138. }else if (event.schedule_type == 2){
  139. schedule_type = "工作事务";
  140. }
  141. var schedule_detail = event.schedule_detail;
  142. var _day = event._day;
  143. var _hour = event._hour;
  144. var _minute = event._minute;
  145. var alarm_type1 = event.alarm_type1;
  146. var alarm_type2 = event.alarm_type2;
  147. var id = event.id;
  148. var complete = event.complete;
  149. var s = "&start="+start + "&end="+end + "&title="+encodeURI(encodeURI(title)) + "&schedule_level_="+schedule_level_
  150. +"&schedule_level="+encodeURI(encodeURI(schedule_level)) + "&schedule_type_="+schedule_type_
  151. +"&schedule_type="+encodeURI(encodeURI(schedule_type)) + "&schedule_detail="+encodeURI(encodeURI(schedule_detail))
  152. +"&_day="+_day + "&_hour="+_hour + "&_minute="+_minute + "&alarm_type1="+alarm_type1 + "&alarm_type2="+alarm_type2
  153. +"&id="+id + "&complete="+complete + "&viewName=" + viewName + "&backType=1";
  154. infoDialog = item( 'MTScheduleAction.do?task=info'+s + '&userId=' + value );
  155. },
  156. selectable: true,
  157. selectHelper: true,
  158. select: function(start, end, allDay) {
  159. var viewName = $('#calendar').fullCalendar( 'getView' ).name;
  160. dialog3 = item('MTScheduleAction.do?task=toCreate&startDate=' + $.fullCalendar.formatDate(start, "yyyy-MM-dd HH:mm")
  161. + '&endDate=' + $.fullCalendar.formatDate(end, "yyyy-MM-dd HH:mm") + '&userId=' + value
  162. + "&viewName=" + viewName + "&backType=1");
  163. }
  164. });
  165. });
  166. }
  167. $(document).ready(function() {
  168. $('#calendar').fullCalendar({
  169. header: {
  170. left: 'prev,next today',
  171. center: 'title',
  172. right: 'month,agendaWeek,agendaDay'
  173. },
  174. theme: true,
  175. timeFormat:{agenda: 'HH:mm { - HH:mm }','': 'HH:mm { - HH:mm }' },
  176. columnFormat:{//每种视图每列显示的时间格式
  177. month: 'ddd',
  178. week: 'M/d(ddd)',
  179. day: 'M/d(ddd)'
  180. },
  181. titleFormat:{//视图标题时间显示的格式
  182. month: 'yyyy年 MMMM ',
  183. week: "yyyy年 MMM d{ '&#8212;'[ MMM] d日 }",
  184. day: 'dddd, MMM d, yyyy'
  185. },
  186. axisFormat:'HH:mm',//日视图左侧时间显示的格式
  187. allDaySlot:false,
  188. allDayText:'今天的任务',
  189. //contentHeight: 10000,
  190. //weekMode: "liquid",
  191. minTime:'8:00',//在日视图和周视图显示起始时间的设置
  192. maxTime:'22:00',//在日视图和周视图显示结束时间的设置
  193. slotMinutes:30,//在日视图和周视图每一行间隔的分钟,目前设为30分钟
  194. defaultView: 'agendaWeek',
  195. monthNames: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
  196. monthNamesShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
  197. dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
  198. dayNamesShort: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
  199. today: ["今天"],
  200. firstDay: 1,
  201. buttonText: {
  202. today: '今天',
  203. month: '月视图',
  204. week: '周视图',
  205. day: '日视图',
  206. prev: '<<',
  207. next: '>>'
  208. }
  209. });
  210. });
  211. </script>
  212. </head>
  213. <body>
  214. <div id="wrap1">
  215. <div class="default_search" style="margin-bottom: 10px;">
  216. <ul class="list_search">
  217. <li class="title" >切换日程表:</li>
  218. <li class="text">
  219. <input type="text" name="schedule_user" id="schedule_user" >
  220. <input type="hidden" id="schedule_user_">
  221. </li>
  222. </ul>
  223. </div>
  224. <br><br>
  225. <div id='calendar'></div>
  226. </div>
  227. </body>
  228. </html>