shanxi_todo.js 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. function task() {
  2. $.get('/api/Orders/todo',{orgid:orgid},function (res) {
  3. if(res.status === 0) {
  4. var list = res.data.data;
  5. if(list.length > 0){
  6. var str = '';
  7. for (var i=0;i<list.length;i++){
  8. list[i]['IMAGES'] = list[i]['IMAGES'] ==='' || list[i]['IMAGES']== null ? '否' : '是';
  9. list[i]['VIDEOS'] = list[i]['VIDEOS'] ==='' || list[i]['VIDEOS']== null ? '否' : '是';
  10. str += '<tr>';
  11. str += '<td>'+list[i]['TODO_ID']+'</td>';
  12. str += '<td>'+list[i]['TASK_TYPE']+'</td>';
  13. str += '<td class="table-task-name">'+list[i]['CONTENT']+'</td>';
  14. str += '<td>'+list[i]['executor']+'</td>';
  15. str += '<td class="table-task-name">'+list[i]['DEP']+'</td>';
  16. str += '<td>'+list[i]['CREATTE_TIME']+'</td>';
  17. str += '<td>'+list[i]['IMAGES']+'</td>';
  18. str += '<td>'+list[i]['VIDEOS']+'</td>';
  19. str += '<td>'+list[i]['HANDOUT_TIME']+'</td>';
  20. if (list[i]['TODO_MODE'] == 3) {
  21. str += '<td style="color: #11F000;">' + '已完成' + '</td>';
  22. } else {
  23. str += '<td style="color: #FD0000;">' + '未完成' + '</td>';
  24. }
  25. str += '</tr>';
  26. }
  27. $('#task-order').html(str);
  28. }
  29. if (list.length > 10) {
  30. $(function(){
  31. var text=$("#task-order:first");
  32. var clear;
  33. text.hover(function(){
  34. clearInterval(clear);
  35. },function(){
  36. clear=setInterval(function(){
  37. var field=text.find("tr:first");
  38. var high=field.height();
  39. text.animate({ marginTop:-high+"px"},600,function(){
  40. field.css("marginTop",0).appendTo(text);
  41. text.css("marginTop",0);
  42. })
  43. },3000)//滚动间隔时间
  44. }).trigger("mouseleave");//自动滚动
  45. });
  46. }
  47. }
  48. })
  49. }
  50. task();
  51. setInterval(function () {
  52. task();
  53. },1000*60);
  54. function realSysTime(clock) {
  55. var now = new Date();
  56. var year = now.getFullYear(); //获取年份
  57. var month = now.getMonth(); //获取月份
  58. var date = now.getDate(); //获取日期
  59. var day = now.getDay(); //获取星期
  60. var hour = now.getHours(); //获取小时
  61. var minute = now.getMinutes(); //获取分钟
  62. var seconds = now.getSeconds(); //获取秒
  63. month = month + 1;
  64. var arr_week = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
  65. var week = arr_week[day];
  66. if (month<10) {
  67. month = '0'+month
  68. }
  69. if (date<10) {
  70. date = '0'+date
  71. }
  72. if (hour<10) {
  73. hour = '0'+hour
  74. }
  75. if (minute<10) {
  76. minute = '0'+minute
  77. }
  78. if (seconds<10) {
  79. seconds = '0'+seconds
  80. }
  81. var time = year + "年" + month + "月" + date + "日 " + week + " " + hour + ":" + minute + ":" + seconds;
  82. clock.innerHTML = time;
  83. }
  84. function show() {
  85. window.setInterval("realSysTime(clock)", 1000);
  86. }
  87. window.onload=show();