smodule102.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <div class="module-main">
  3. <div class="module-box">
  4. <div class="main-top-box">
  5. <div class="module-public module-bottom-box">
  6. <div class="header">巡更现场照片</div>
  7. <div class="bottom-content-box">
  8. <div v-for="(item,index) in imgs.slice(0, Math.ceil(imgs.length / 2))" :key="index" class="imgbox">
  9. <img :src="item.images" alt="" @click="img(item.images)">
  10. <div class="name">{{item.addr}}</div>
  11. </div>
  12. </div>
  13. <div class="bottom-content-box">
  14. <div v-for="(item2,index2) in imgs.slice(Math.ceil(imgs.length / 2))" :key="index2" class="imgbox">
  15. <img :src="item2.images" alt="" @click="img(item2.images)">
  16. <div class="name">{{item2.addr}}</div>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. </div></template>
  23. <script>
  24. import Vue from 'vue';
  25. import Component from 'vue-class-component';
  26. import api from '../../api';
  27. @Component({
  28. props: {
  29. data: {
  30. type: Object,
  31. default: null,
  32. },
  33. },
  34. })
  35. export default class Echarts extends Vue {
  36. imgs = []
  37. created() {
  38. this.getPatrolImg3();
  39. setInterval(() => {
  40. this.getPatrolImg3();
  41. }, 15000);
  42. }
  43. getPatrolImg3() {
  44. api.getPatrolImg3().then((res) => {
  45. this.imgs = res.data;
  46. }).catch(() => {}).finally(() => {
  47. });
  48. }
  49. img(val) {
  50. this.$alert(`<div style="width:100%;height:80%"><img src="${val}" style="width:100%;height:80%"></div>`, '图片详情', {
  51. dangerouslyUseHTMLString: true,
  52. closeOnClickModal: true,
  53. showConfirmButton: false,
  54. });
  55. }
  56. }
  57. </script>
  58. <style scoped lang="scss">
  59. .module-box{
  60. width: 100%;
  61. height: 100%;
  62. background-image: url(../../images/screen-tem13/bg4.png);
  63. background-repeat: no-repeat;
  64. background-size: 100% 100%;
  65. }
  66. .main-top-box{
  67. width: 100%;
  68. height: 50%;
  69. }
  70. .module-box .header{
  71. width: 97%;
  72. height: 35px;
  73. line-height: 35px;
  74. font-weight: bold;
  75. font-size: 15px;
  76. color: #0BE2DF;
  77. padding-left: 10px;
  78. .pull-right{
  79. float: right;
  80. font-size: 12px;
  81. color: #fff;
  82. font-weight: 400;
  83. .font-color{
  84. color: #0BE2DF;
  85. }
  86. .font-color1{
  87. color: #FF0000;
  88. }
  89. }
  90. }
  91. .module-bottom-box{
  92. width: 100%;
  93. height: 100%;
  94. // margin-top: 2.38%;
  95. position: relative;
  96. }
  97. .module-bottom-box .bottom-content-box{
  98. width: 100%;
  99. height: calc(100% - 35px);
  100. overflow: hidden;
  101. margin-top: 15px;
  102. }
  103. .main-top-box .bottom-content-box .imgbox{
  104. width: 16%;
  105. height: 100%;
  106. margin-left: 0.6%;
  107. display: inline-block;
  108. float: left;
  109. img{
  110. width: 100%;
  111. height: calc(100% - 30px);
  112. border-radius: 10px;
  113. }
  114. .name{
  115. width: 100%;
  116. height: 30px;
  117. line-height: 30px;
  118. text-align: center;
  119. font-size: 13px;
  120. }
  121. }
  122. </style>