smodule9.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <div class="module-main">
  3. <div class="module-box">
  4. <div class="main-box">
  5. <div class="module-title">
  6. 可视化轨迹展示
  7. </div>
  8. <div class="patrol">
  9. <div class="patrol-box">
  10. <div v-for="(item,index) in imgs" :key="index" class="list">
  11. <div class="top-img">
  12. <img :src="item.img" alt="">
  13. </div>
  14. <div class="patrol-title line1">
  15. {{item.title}}
  16. </div>
  17. </div>
  18. </div>
  19. <div class="echarts">
  20. <dv-scroll-board v-if="flag" :config="config" style="width:100%;height:100%" />
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. import Vue from 'vue';
  29. import Component from 'vue-class-component';
  30. import echarts from '@/common/components/echarts.vue';
  31. import api from '../../api';
  32. @Component({
  33. props: {
  34. data: {
  35. type: Object,
  36. default: null,
  37. },
  38. },
  39. components: {
  40. echarts,
  41. },
  42. })
  43. export default class smodule8 extends Vue {
  44. imgs = [];
  45. flag = false;
  46. config = {
  47. header: ['地点', '时间', '人员', '内容'],
  48. data: [],
  49. rowNum: 4,
  50. // index: true,
  51. // columnWidth: [80],
  52. align: ['center', 'center', 'center', 'center', 'center', 'center', 'center', 'center'],
  53. headerBGC: 'rgba(17, 43, 117, 0.5)',
  54. oddRowBGC: 'rgba(17, 43, 117, 0.5)',
  55. evenRowBGC: 'rgba(9, 32, 99, 0.5)',
  56. }
  57. created() {
  58. this.getPatrolRecord();
  59. setInterval(() => {
  60. this.getPatrolRecord();
  61. }, 1000 * 60);
  62. }
  63. getPatrolRecord() {
  64. api.getPatrolRecord().then((res) => {
  65. this.imgs = res.data.imgs;
  66. this.flag = false;
  67. this.$nextTick(() => {
  68. this.flag = true;
  69. this.config.data = res.data.lists;
  70. });
  71. }).catch(() => {}).finally(() => {
  72. this.flag = true;
  73. });
  74. }
  75. }
  76. </script>
  77. <style lang="css">
  78. .line1 {
  79. overflow: hidden;
  80. text-overflow: ellipsis;
  81. display: box;
  82. display: -webkit-box;
  83. line-clamp: 1;
  84. box-orient: vertical;
  85. -webkit-line-clamp: 1;
  86. -webkit-box-orient: vertical;
  87. word-break: break-all;
  88. }
  89. </style>
  90. <style scoped lang="scss">
  91. *{
  92. box-sizing:border-box;
  93. color: #fff;
  94. }
  95. .text-right{
  96. text-align: right;
  97. }
  98. .pull-right{
  99. float: right !important;
  100. }
  101. .module-title{
  102. position: relative;
  103. height: 40px;
  104. line-height: 40px;
  105. font-size: 16px;
  106. }
  107. .module-title::before{
  108. content: '';
  109. position: absolute;
  110. z-index: 1;
  111. height: 8px;
  112. width: 72px;
  113. top: 32px;
  114. left: 0;
  115. background-image: url(../../images/smodule/org-title.png);
  116. background-size: 100% 100%;
  117. }
  118. .main-box{
  119. width: 100%;
  120. height: 100%;
  121. padding: 10px;
  122. position: relative;
  123. padding-top: 0;
  124. }
  125. .module-select{
  126. width: 80px;
  127. height: 20px;
  128. color: #A6D6FF;
  129. background-color: #061A3B;
  130. outline: none;
  131. border: 1px solid #A6D6FF;
  132. float: right;
  133. vertical-align: middle;
  134. margin-top: 15px;
  135. margin-right: 5px;
  136. }
  137. .echarts{
  138. width: auto;
  139. height: calc(100% - 90px);
  140. margin-top: 10px;
  141. }
  142. .patrol{
  143. padding: 10px;
  144. width: auto;
  145. height: calc(100% - 40px);
  146. .patrol-box{
  147. height: 90px;
  148. overflow: hidden;
  149. .list{
  150. height: 90px;
  151. width: 30%;
  152. margin-left: 3%;
  153. overflow: hidden;
  154. text-align: center;
  155. float: left;
  156. .top-img{
  157. width: 100%;
  158. height: 70px;
  159. overflow: hidden;
  160. img{
  161. width: 100%;
  162. height: 100%;
  163. }
  164. }
  165. .patrol-title{
  166. height: 20px;
  167. line-height: 20px;
  168. font-size: 12px;
  169. background-color: rgba(69, 117, 230, 0.2);
  170. }
  171. }
  172. }
  173. .patrol-box:first-child{
  174. margin-left: 0;
  175. }
  176. }
  177. </style>