TaskEvent.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <el-drawer
  3. :title="title"
  4. :modal-append-to-body="false"
  5. :modal="false"
  6. size="35%"
  7. :visible.sync="dialogVisible"
  8. >
  9. <div class="content-container">
  10. <!-- <vuescroll :ops="ops" style="height: calc(100vh - 310px)">
  11. <el-timeline>
  12. <el-timeline-item v-for="item in eventList" :key="item.eventId" :hide-timestamp="false">
  13. <div class="record-item">
  14. <p class="time">{{ item.eventTime }}</p>
  15. <p class="title">{{ item.accountNameFr }}</p>
  16. <p class="desc">
  17. {{ item.eventDesc }}
  18. </p>
  19. </div>
  20. </el-timeline-item>
  21. </el-timeline>
  22. </vuescroll> -->
  23. <el-timeline>
  24. <el-timeline-item v-for="item in eventList" :key="item.eventId" :hide-timestamp="false">
  25. <div class="record-item">
  26. <p class="time">{{ item.eventTime }}</p>
  27. <p class="title">{{ item.accountNameFr }}</p>
  28. <p class="desc">
  29. {{ item.eventDesc }}
  30. </p>
  31. </div>
  32. </el-timeline-item>
  33. </el-timeline>
  34. <div class="btn-group">
  35. <el-button class="cancel-btn" @click="dialogVisible = false">关闭</el-button>
  36. </div>
  37. </div>
  38. </el-drawer>
  39. </template>
  40. <script>
  41. import { getTaskEventByTaskId } from '@/api/system/taskEventApi'
  42. import vuescroll from 'vuescroll'
  43. export default {
  44. name: 'AppListComponent',
  45. components: {
  46. // eslint-disable-next-line vue/no-unused-components
  47. vuescroll
  48. },
  49. props: {
  50. title: {
  51. type: String,
  52. default: '操作记录'
  53. }
  54. },
  55. data() {
  56. return {
  57. ops: {
  58. bar: {
  59. keepShow: false,
  60. background: 'rgba(144, 147, 153, 0.4)',
  61. onlyShowBarOnScroll: false
  62. }
  63. },
  64. rules: {},
  65. dialogVisible: false,
  66. eventList: []
  67. }
  68. },
  69. mounted() {
  70. },
  71. methods: {
  72. // Fetch Event Data
  73. getEventList(data) {
  74. getTaskEventByTaskId(data).then((resp) => {
  75. const { code, data, msg } = resp
  76. if (code === 0) {
  77. this.eventList = data
  78. } else {
  79. this.$message.error(msg)
  80. }
  81. }).catch((error) => {
  82. console.log(error)
  83. })
  84. },
  85. // Show Event Dialog
  86. showTaskEvent(taskId) {
  87. this.eventList = []
  88. this.dialogVisible = true
  89. this.getEventList(taskId)
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss">
  95. </style>
  96. <style lang="scss" scoped>
  97. .content-container {
  98. margin: 15px;
  99. position: relative;
  100. height: calc(100% - 15px);
  101. .el-timeline {
  102. width: 360px;
  103. margin: 15px auto 0;
  104. padding: 0 0 0 90px;
  105. }
  106. .record-item {
  107. position: relative;
  108. top: -44px;
  109. .time {
  110. font-size: 12px;
  111. font-weight: 400;
  112. color: #A9BDC9;
  113. position: absolute;
  114. left: -165px;
  115. top: 7px;
  116. }
  117. .title {
  118. font-size: 16px;
  119. font-weight: 400;
  120. color: #A9BDC9;
  121. line-height: 54px;
  122. }
  123. .desc {
  124. font-size: 16px;
  125. font-weight: 400;
  126. color: #FFFFFF;
  127. line-height: 2em;
  128. margin: 0;
  129. }
  130. }
  131. .btn-group {
  132. margin-left: 30px;
  133. .el-button {
  134. margin: 0 0 15px;
  135. }
  136. .cancel-btn {
  137. background: #004F7B;
  138. border-color: #004F7B;
  139. color: #FFF;
  140. &:hover {
  141. background: #026197;
  142. border-color: #026197;
  143. }
  144. }
  145. }
  146. }
  147. </style>