DateImgList.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <div class="container">
  3. <div class="head">时间 : {{createDate}}</div>
  4. <div class="listView">
  5. <template v-for="(image,index) in images" :key="image.url">
  6. <div :class="['item',selected.length >0 && selected[0] == image.treeId ? 'active' : '']" @click.stop="clickAction(image.treeId)">
  7. <div class="code">编号:{{image.code}}</div>
  8. <div class="periodName">{{image.periodName}}</div>
  9. <div class="img">
  10. <DrawBox v-if="switchValue&&image.markText" :sourceData="image.markText" width="255" height="230"></DrawBox>
  11. <img loading="lazy" :src="config.base_img_url2 + image.filename + resize" />
  12. <div class="watermark">
  13. {{image.uploadDate}}
  14. </div>
  15. </div>
  16. <AttributeList class="attrs" :data="image" :attrField="attrField"></AttributeList>
  17. <el-icon @click.stop="preview(index)" class="search cursor-pointer"><Search /></el-icon>
  18. </div>
  19. </template>
  20. </div>
  21. </div>
  22. </template>
  23. <script setup>
  24. import {ref} from "vue"
  25. import DrawBox from "@/components/drawBox.vue";
  26. import AttributeList from "../global/AttributeList";
  27. import config from "@/api/config.js"
  28. let resize = '?x-oss-process=image/resize,m_fill,w_300'
  29. let emits = defineEmits(["clickAction","preview"])
  30. const props = defineProps({
  31. createDate: {
  32. type: String,
  33. require: true
  34. },
  35. images:{require: true,type:Array},
  36. selected:{type:Array, require: true,},
  37. periodId:{type:Number, require: true},
  38. attrField:{type:String, require: true},
  39. switchValue: { type: Boolean, require: true },
  40. });
  41. function clickAction(treeId){
  42. emits("clickAction",'dateImgList',props.selected.length > 0 && props.selected[0] == treeId ? null : treeId)
  43. }
  44. function preview(index){
  45. const urls = []
  46. for(let item of props.images){
  47. urls.push(config.base_img_url2 + item.filename)
  48. }
  49. emits("preview",urls, props.images, index)
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. .container{
  54. background: #044053;
  55. border-radius: 4px;
  56. border: 1px solid rgba(81, 233, 240, 0.6);
  57. box-sizing: border-box;
  58. padding: 2px 2px 2px 2px;
  59. margin-bottom: 10px;
  60. }
  61. .head{
  62. width: 100%;
  63. color:#B4FFFB;
  64. font-weight: bold;
  65. padding: 10px 10px 0px 10px;
  66. div{
  67. margin-left: 10px;
  68. display:inline-block;
  69. }
  70. }
  71. .active{
  72. background: #cce5ee;
  73. border: 2px solid red;
  74. }
  75. .listView{
  76. width: 100%;
  77. overflow-x: scroll;
  78. overflow-y: hidden;
  79. padding: 10px;
  80. box-sizing: border-box;
  81. .item{
  82. display:inline-block;
  83. position: relative;
  84. width: 255px;
  85. height: 250px;
  86. margin: 0 10px 0 0;
  87. box-sizing: border-box;
  88. .periodName{
  89. position: absolute;
  90. color: #F4F4F4;
  91. font-weight: bold;
  92. left: 5px;
  93. top:5px;
  94. z-index: 1;
  95. }
  96. .code{
  97. position: absolute;
  98. z-index: 1;
  99. bottom: 0px;
  100. width: 100%;
  101. height: 20px;
  102. line-height: 20px;
  103. font-size: 16px;
  104. text-align: center;
  105. color: #01BBB3;
  106. font-weight: bold;
  107. }
  108. .img{
  109. position: absolute;
  110. z-index: 0;
  111. width: 100%;
  112. top: 0px;
  113. bottom: 20px;
  114. img{
  115. width: 100%;
  116. height: 100%;
  117. }
  118. }
  119. .attrs{
  120. position: absolute;
  121. z-index: 1;
  122. right: 0px;
  123. bottom: 20px;
  124. display: flex;
  125. flex-direction: column-reverse;
  126. }
  127. .search{
  128. position: absolute;
  129. color: #ffffff;
  130. background-color: #00000090;
  131. font-size: 20px;
  132. top: 0px;
  133. right:0px;
  134. z-index: 2;
  135. }
  136. }
  137. .bigImg{
  138. width: 1024px;
  139. height: 768px;
  140. }
  141. }
  142. </style>