LiveBroadcast.vue 7.6 KB

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