LiveBroadcast.vue 8.5 KB

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