timeLine.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <div>
  3. <div style="display: flex;flex-direction: row;margin-bottom:20px">
  4. <div v-for="(obj, index1) in list" style="width: 13vw;">
  5. <div style="display: flex;flex-direction: row;">
  6. <div style="height: 40px;">
  7. <img v-if="getCurrentStation(obj.stationName, index1)" style="width: 30px;" src="@/assets/images/icon/小货车.png" />
  8. </div>
  9. <!-- <div style="height: 40px;">
  10. <img v-if="getCurrentStation(obj.stationName, index1)" style="width: 40px;margin-left: 4vw;"
  11. src="@/assets/images/icon/小货车.png" />
  12. </div> -->
  13. </div>
  14. <!-- <div
  15. style="width:13vw;display: flex;flex-direction: row; font-family: 思源黑体;font-size: 12px;font-weight: bold;color:#C0C4CC">
  16. <div v-show="index1 != 0">{{ formatDate(obj.planInTime) }}</div>
  17. <div style="padding-left: 20px;">{{ formatDate(obj.planOutTime) }}</div>
  18. </div> -->
  19. </div>
  20. </div>
  21. <div style="display: flex;flex-direction: row;padding-left: 3%;">
  22. <div v-for="(item, index) in list" style="width: 13vw;">
  23. <div>
  24. <div style="display: flex;flex-direction: row;">
  25. <div class="activitieyContent" v-if="index == 0" style="background: #06D903;">
  26. 起
  27. <div style="position: absolute;top:-26px;color:#C0C4CC;font-weight: bold;">{{ formatDate(item.planOutTime)}}</div>
  28. </div>
  29. <div class="activitieyContent" v-if="index> 0 && index<list.length-1" style="">
  30. {{ index }}
  31. <div style="position: absolute;top:-26px;left:-35px;color:#C0C4CC;font-weight:bold;width:100px;display:flex;justify-content: space-evenly;">
  32. <div>{{ formatDate(item.planInTime) }}</div> <div>{{ formatDate(item.planOutTime) }}</div>
  33. </div>
  34. </div>
  35. <div class="activitieyContent" v-if="index == list.length-1" style="background: #ad012f;">
  36. 终
  37. <div style="position: absolute;top:-26px;color:#C0C4CC;font-weight: bold;">{{ formatDate(item.planInTime)}}</div>
  38. </div>
  39. <div class="line" style="margin: 2px 4px;margin-top:13px;" v-if="index != list.length - 1"></div>
  40. </div>
  41. <div
  42. style="writing-mode:vertical-rl;width: 35px;line-height: 40px;font-family: 思源黑体;text-align: left;font-size: 13px;font-weight: bold;letter-spacing: 4px;margin-top: 5px;"
  43. >
  44. {{ item.stationName }}
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </template>
  51. <script lang="ts" setup>
  52. const props = defineProps({
  53. list: {
  54. type: [Object],
  55. default: ""
  56. },
  57. stationInfo: {
  58. type: Object,
  59. default: ""
  60. }
  61. });
  62. const activities = [
  63. {
  64. content: '白下',
  65. endTime: '7:00',
  66. people: '五六七',
  67. done: true,
  68. color: '#06D903',
  69. index: '起点',
  70. rank: 1,
  71. isNow: true
  72. },
  73. {
  74. content: '白下',
  75. people: '吉吉国王',
  76. done: false,
  77. startTime: '8:00',
  78. endTime: '9:00',
  79. index: '站点1',
  80. color: '#409EFF',
  81. rank: 2
  82. },
  83. {
  84. content: '白下',
  85. people: '吉吉国王',
  86. done: false,
  87. startTime: '8:00',
  88. endTime: '9:00',
  89. index: '站点2',
  90. color: '#409EFF',
  91. rank: 3
  92. },
  93. {
  94. content: '白下',
  95. people: '吉吉国王',
  96. done: false,
  97. startTime: '8:00',
  98. endTime: '9:00',
  99. index: '站点2',
  100. color: '#409EFF',
  101. rank: 4
  102. },
  103. {
  104. content: '白下',
  105. people: '吉吉国王',
  106. done: false,
  107. startTime: '8:00',
  108. endTime: '9:00',
  109. index: '站点2',
  110. color: '#409EFF',
  111. rank: 999
  112. },
  113. ]
  114. const formatDate = (value) => {
  115. var detaAtty = value.split(":")
  116. if (detaAtty.length > 1) {
  117. return detaAtty[0] + ":" + detaAtty[1]
  118. } else {
  119. return value
  120. }
  121. }
  122. const getCurrentStation = (name, index) => {
  123. var stationObj = props.stationInfo;
  124. if (stationObj.passStations == 'null') {
  125. console.log(index == 0)
  126. return index == 0
  127. } else {
  128. var passStationsArry = stationObj.passStations.split(",");
  129. }
  130. }
  131. onMounted(() => {
  132. console.log(props.stationInfo)
  133. // getCurrentStation()
  134. });
  135. </script>
  136. <style lang="scss" scoped>
  137. .activitieyContent {
  138. width: 30px;
  139. height: 30px;
  140. opacity: 1;
  141. background-color: #6495ED;
  142. border-radius: 50%;
  143. text-align: center;
  144. line-height: 30px;
  145. font-family: 思源黑体;
  146. font-size: 12px;
  147. color: #ffffff;
  148. margin-left: 2px;
  149. position: relative;
  150. }
  151. .line {
  152. width: 10vw;
  153. height: 3px;
  154. border-radius: 10px;
  155. opacity: 1;
  156. background: #D8D8D8;
  157. }
  158. </style>