index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <!-- 面试日历 -->
  3. <div id="interviewCalendar" class="box">
  4. <div class="interviewCalendar">
  5. <el-calendar v-model="dayValue">
  6. </el-calendar>
  7. </div>
  8. <div style="min-width: 1050px">
  9. <div style="display: flex;justify-content: center;font-weight: bold;padding: 25px;font-size: 18px;letter-spacing: 5px">
  10. <div><i class="el-icon-arrow-left" style="cursor: pointer" @click="changeWeek(-1)"></i>{{weekDay1.getFullYear()}}年{{weekDay1.getMonth()+1}}月{{weekDay1.getDate()}}日-{{weekDay2.getMonth()+1}}月{{weekDay2.getDate()}}日
  11. <i class="el-icon-arrow-right" style="cursor: pointer" @click="changeWeek(1)"></i></div>
  12. </div>
  13. <div class="week_box" >
  14. <div v-if="weekDayList.length>0" v-for="(item, index) in weekDay" :key="index" :class="dayValue.getDate()==weekDayList[index].num?'selColor card_date':'card_date'">
  15. <div>{{ item }}</div>
  16. <div :class="dayValue.getDate()==weekDayList[index].num?'selCircle':'selNone'">{{ weekDayList[index].num }}</div>
  17. </div>
  18. </div>
  19. <div class="week_box week_container" id="weekContainer">
  20. <div v-if="dayInterviewVos.length>0" v-for="(item, index) in dayInterviewVos" :key="index" class="day_row">
  21. <div v-for="(item_c, index_c) in item.quantumList" :key="index_c" :class="index==0?'day_col day_row0':'day_col'">
  22. <div v-if="index==0" class="timeLine">
  23. {{timeline[index_c]}}
  24. </div>
  25. <div v-for="(item_cc, index_cc) in item_c.recruitInterviewList" :key="index_cc" class="day_col_item">
  26. <div> {{item_cc.realName}} - {{item_cc.job}}</div>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. dayValue: new Date(),
  39. loading: false, //当前表单加载是否加载动画
  40. weekDay:['周一','周二','周三','周四','周五','周六','周日'],
  41. weekDayList:[],
  42. date_num: [],
  43. currIndex:0,
  44. dayInterviewVos:[],
  45. timeline:['凌晨0点','凌晨1点','凌晨2点','凌晨3点','凌晨4点','凌晨5点','上午6点','上午7点','上午8点','上午9点','上午10点','上午11点','中午12点','下午1点',
  46. '下午2点','下午3点','下午4点','下午5点','下午6点','晚上7点','晚上8点','晚上9点','晚上10点','晚上11点'],
  47. weekDay1:new Date(),
  48. weekDay2:new Date(),
  49. };
  50. },
  51. mounted() {
  52. this.search();
  53. },
  54. methods: {
  55. changeWeek(index){
  56. if(index==-1){
  57. this.dayValue.setTime(this.dayValue.getTime()-7*24*60*60*1000)
  58. }
  59. if(index==1){
  60. this.dayValue.setTime(this.dayValue.getTime()+7*24*60*60*1000)
  61. }
  62. let d = new Date()
  63. d.setTime(this.dayValue.getTime())
  64. this.dayValue = d
  65. this.search()
  66. },
  67. search() {
  68. let that = this
  69. this.loading = true;
  70. var data = {
  71. year: this.dayValue.getFullYear(),
  72. month: this.dayValue.getMonth()+1,
  73. day: this.dayValue.getDate()
  74. };
  75. this.$api.recruitinterviewlist(data).then((res) => {
  76. if(res.code==200){
  77. that.dayInterviewVos = res.data.dayInterviewVos
  78. that.weekDayList = []
  79. for(let i = 0; i < that.dayInterviewVos.length; i++) {
  80. if(res.data.dayInterviewVos[i].date==that.dayValue.getDate()){
  81. that.currIndex = i
  82. }
  83. let weekDay = {
  84. num:that.dayInterviewVos[i].date
  85. }
  86. that.weekDayList.push(weekDay)
  87. }
  88. for(let i = 0; i < that.weekDayList.length; i++) {
  89. var d=new Date();
  90. d.setTime(that.dayValue.getTime()+(i-that.currIndex)*24*60*60*1000)
  91. that.weekDayList[i].day = d
  92. if(i==0){
  93. that.weekDay1 = d
  94. }
  95. if(i==6){
  96. that.weekDay2 = d
  97. }
  98. }
  99. that.$nextTick(function(){
  100. console.log(document.getElementById('weekContainer'),333)
  101. document.getElementById('weekContainer').scrollTop = 479
  102. });
  103. }
  104. });
  105. this.loading = false;
  106. },
  107. },
  108. watch:{
  109. dayValue(val, oldVal){//普通的watch监听
  110. console.log("a: "+val, oldVal);
  111. console.log("a: "+this.dayValue.getDate());
  112. this.search()
  113. }
  114. }
  115. };
  116. </script>
  117. <style >
  118. .interviewCalendar .el-calendar-table .el-calendar-day{
  119. height: auto;
  120. }
  121. .interviewCalendar .el-calendar-table tr:first-child td{
  122. border-top: none;
  123. }
  124. .interviewCalendar .el-calendar-table td{
  125. border-bottom: none;
  126. border-right: none;
  127. }
  128. .interviewCalendar .el-calendar-table tr td:first-child{
  129. border-left: none;
  130. }
  131. .interviewCalendar .el-button--mini, .el-button--mini.is-round{
  132. padding: 7px;
  133. }
  134. </style>
  135. <style lang="less" scoped>
  136. .day_col_item{
  137. color: #666666;
  138. font-size: 14px;
  139. }
  140. .timeLine{
  141. position: absolute;
  142. left: -55px;
  143. top: 20px;
  144. color: #666666;
  145. font-size: 12px;
  146. }
  147. .day_row0{
  148. border-left: 1px solid #EBEEF5;
  149. }
  150. .day_col:first-child{
  151. border-top: 1px solid #EBEEF5;
  152. }
  153. .day_col{
  154. width: 100%;
  155. height: 60px;
  156. border-bottom: 1px solid #EBEEF5;
  157. border-right: 1px solid #EBEEF5;
  158. position: relative;
  159. }
  160. .day_row{
  161. width: 14%;
  162. text-align: center;
  163. }
  164. .selNone {
  165. margin-top: 20px
  166. }
  167. .selCircle {
  168. border-radius: 50%;
  169. width: 50px;
  170. height: 50px;
  171. color: #ffffff !important;
  172. background-color: #3494F7;
  173. text-align: center;
  174. line-height: 50px;
  175. margin: 0 auto;
  176. }
  177. .selColor{
  178. color: #3494F7 !important;
  179. }
  180. .week_container{
  181. height: 600px;
  182. overflow-y: auto;
  183. margin-bottom: 50px;
  184. }
  185. .week_container::-webkit-scrollbar {
  186. display: none; /* Chrome Safari */
  187. }
  188. .week_box{
  189. min-width: 1050px;
  190. display: flex;
  191. justify-content:center;
  192. margin-top: 20px;
  193. padding-left: 50px;
  194. }
  195. .card_date {
  196. width: 14%;
  197. text-align: center;
  198. color: #000;
  199. }
  200. .box{
  201. display: flex;
  202. width: 100%;
  203. min-width: 1350px;
  204. }
  205. .interviewCalendar{
  206. width: 300px;
  207. height: 350px;
  208. }
  209. </style>