LiveBroadcast.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div class="container">
  3. <div class="review-main">
  4. <div class="condition-wrap">
  5. <div class="condition-wrap-left">
  6. <Button type="primary">新媒体新技术</Button>
  7. <Button type="success">创新实验室</Button>
  8. </div>
  9. <div class="condition-wrap-right">
  10. <Select v-model="yearDefault" size="large" style="width:100px">
  11. <Option v-for="item in years" :value="item" :key="item">{{ item }}</Option>
  12. </Select>
  13. <Select v-model="monthDefault" size="large" style="width:100px">
  14. <Option v-for="item in monthes" :value="item" :key="item">{{ item }}</Option>
  15. </Select>
  16. <Button size="large">返回今天</Button>
  17. </div>
  18. </div>
  19. <full-calendar :config="config"
  20. :events="fcEvents"
  21. ref="calendar">
  22. </full-calendar>
  23. </div>
  24. </div>
  25. </template>
  26. <script>
  27. import FullCalendar from 'vue-full-calendar'
  28. //import 'fullcalendar/dist/fullcalendar.css'
  29. export default {
  30. components: {
  31. FullCalendar
  32. },
  33. data() {
  34. return {
  35. yearDefault:'2019年',
  36. years: [
  37. "2012年",
  38. "2013年",
  39. "2014年",
  40. "2015年",
  41. "2016年",
  42. "2017年",
  43. "2018年",
  44. "2019年",
  45. "2020年",
  46. "2021年",
  47. "2022年",
  48. "2023年",
  49. "2024年",
  50. ],
  51. monthDefault: '1月',
  52. monthes: [
  53. '1月',
  54. '2月',
  55. '3月',
  56. '4月',
  57. '5月',
  58. '6月',
  59. '7月',
  60. '8月',
  61. '9月',
  62. '11月',
  63. '12月',
  64. ],
  65. fcEvents: [
  66. ],
  67. config: {
  68. firstDay:'1',//以周日为每周的第一天
  69. // weekends: true,//是否在日历中显示周末
  70. locale: 'zh-cn',//语言
  71. defaultView: 'month',//默认按月显示
  72. height: 'auto',//高度
  73. fixedWeekCount:false,//是否固定显示六周
  74. // weekMode:"liquid",//周数不定,每周的高度可变,整个日历高度不变
  75. allDaySlot:false,
  76. // allDay:true,
  77. header: {//表头信息
  78. left: 'prev, next, today',
  79. center: 'title',
  80. right: 'hide, custom'
  81. },
  82. },
  83. lessonList:[]
  84. }
  85. },
  86. methods: {
  87. getDay(day, jsEvent) {
  88. console.log(day);
  89. console.log(jsEvent);
  90. }
  91. },
  92. mounted() {
  93. this.lessonList = require("@/static/lessonList.json");
  94. for (let i = 0; i < this.lessonList.length; i++) {
  95. var sdate = new Date(this.lessonList[i].startTime.time);
  96. let sY = sdate.getFullYear() + '-';
  97. let sM = (sdate.getMonth() + 1 < 10 ? '0' + (sdate.getMonth() + 1) : sdate.getMonth() + 1) + '-';
  98. let sD = sdate.getDate() + ' ';
  99. var edate = new Date(this.lessonList[i].endTime.time);
  100. let eY = edate.getFullYear() + '-';
  101. let eM = (edate.getMonth() + 1 < 10 ? '0' + (edate.getMonth() + 1) : edate.getMonth() + 1) + '-';
  102. let eD = edate.getDate() + ' ';
  103. this.fcEvents.push({
  104. title:'名称:'+this.lessonList[i].viwActivityTypeTip,
  105. start: sY + sM + sD,
  106. end: eY + eM + eD
  107. });
  108. this.fcEvents.push({
  109. title:'学校:'+this.lessonList[i].schoolName,
  110. start: sY + sM + sD,
  111. end: eY + eM + eD
  112. });
  113. this.fcEvents.push({
  114. title:'主讲人:'+this.lessonList[i].employeeName,
  115. start: sY + sM + sD,
  116. end: eY + eM + eD
  117. });
  118. this.fcEvents.push({
  119. title:'学科:'+this.lessonList[i].parentCategoryName,
  120. start: sY + sM + sD,
  121. end: eY + eM + eD
  122. });
  123. this.fcEvents.push({
  124. title:'课题:'+this.lessonList[i].parentProjectName,
  125. start: sY + sM + sD,
  126. end: eY + eM + eD
  127. });
  128. this.fcEvents.push({
  129. title:'时间:'+this.lessonList[i].timeRangeTipHHmm,
  130. start: sY + sM + sD,
  131. end: eY + eM + eD
  132. });
  133. }
  134. console.log(this.lessonList);
  135. }
  136. }
  137. </script>
  138. <style scoped>
  139. html, body, #app {
  140. height: 100% !important;
  141. user-select: none;
  142. }
  143. .main-content {
  144. background:rgb(248,248,248) !important;
  145. }
  146. .container {
  147. width: 1200px;
  148. margin: 100px auto;
  149. display:flex;
  150. flex-direction:row;
  151. justify-content:space-between;
  152. }
  153. .review-main {
  154. background:#fff;
  155. width:100%;
  156. padding:10px 25px;
  157. }
  158. .review-main /deep/ .full-calendar-header {
  159. display:none;
  160. }
  161. .review-main /deep/ .comp-full-calendar {
  162. padding:0px;
  163. max-width:1200px;
  164. }
  165. .review-main /deep/ .weeks {
  166. background: -webkit-linear-gradient(#E1E7EC, #B9C6D1); /* Safari 5.1 - 6.0 */
  167. background: -o-linear-gradient(#E1E7EC, #B9C6D1); /* Opera 11.1 - 12.0 */
  168. background: -moz-linear-gradient(#E1E7EC, #B9C6D1); /* Firefox 3.6 - 15 */
  169. background: linear-gradient(#E1E7EC, #B9C6D1); /* 标准的语法 */
  170. height: 40px;
  171. line-height: 40px;
  172. }
  173. .review-main /deep/ .full-calendar-body .dates .week-row .day-cell.today {
  174. background:#dfe6ec;
  175. }
  176. .review-main /deep/ .week-row > .not-cur-month {
  177. background: linear-gradient( -45deg, #ecf0f4 25%, #ffffff 0, #ffffff 50%, #ecf0f4 0, #ecf0f4 75%, #ffffff 0 ); /* 标准的语法(必须放在最后) */
  178. background-size: 20px 20px;
  179. }
  180. .review-main /deep/ .week-row {
  181. height:140px;
  182. }
  183. .review-main /deep/ .events-week {
  184. height:140px;
  185. }
  186. .review-main /deep/ .full-calendar-body .dates .dates-events .events-week .events-day .event-box .event-item {
  187. background:none;
  188. height:15px;
  189. }
  190. /*.review-main /deep/ .full-calendar-body .dates .dates-events .events-week .events-day .event-box .more-link {
  191. display:none;
  192. }*/
  193. .condition-wrap {
  194. display:flex;
  195. flex-direction:row;
  196. justify-content : space-between;
  197. }
  198. </style>