RetrievalView.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <div class="containe">
  3. <div class="picture">
  4. <img src="../../assets/img/Group 467.png" alt="" />
  5. </div>
  6. <div class="search">
  7. <el-input
  8. type="text"
  9. placeholder="请输入文档信息"
  10. v-model="input"
  11. @keyup.enter.native="searchs"
  12. ></el-input>
  13. <span class="cen—top-span" @click="searchs">快速搜索</span>
  14. <img
  15. src="../../assets/img/ri:search-2-line@2x.png"
  16. class="cen—top-img"
  17. />
  18. </div>
  19. <div class="mains" @scroll="handleScroll">
  20. <div
  21. v-for="item in count"
  22. :key="item.id"
  23. class="main-main"
  24. >
  25. <div class="one" @click="docName(item.id, item.content.info)">
  26. {{ item.content.info.docName }}
  27. </div>
  28. <div class="two">
  29. <div class="two1">
  30. <img src="../../assets/img/UserCircle.png" />
  31. {{ item.content.info.createBy }}
  32. </div>
  33. <div>
  34. <img src="../../assets/img/Clock.png" />
  35. {{ item.content.info.createTime }}
  36. </div>
  37. </div>
  38. <div
  39. class="three"
  40. v-for="highlightFieldsContentItem in item.highlightFields.content"
  41. :key="highlightFieldsContentItem.id"
  42. v-html="highlightFieldsContentItem"
  43. style="white-space: normal"
  44. ></div>
  45. <ul class="four">
  46. <li v-for="tagName in item.content.info.tagList" :key="tagName.id">
  47. {{ tagName.tagName }}
  48. </li>
  49. </ul>
  50. </div>
  51. </div>
  52. </div>
  53. </template>
  54. <script>
  55. import { ret } from "@/api/doc/share1.js";
  56. export default {
  57. data() {
  58. return {
  59. //搜索框绑定
  60. input: "",
  61. //搜索出来的数据
  62. count: [],
  63. page: 0,
  64. size: 3
  65. };
  66. },
  67. mounted() {
  68. //添加滚动条事件
  69. window.addEventListener("scroll", this.handleScroll, true);
  70. this.input=this.$route.query.datas;
  71. },
  72. methods: {
  73. handleScroll() {
  74. const container = document.querySelector(".mains");
  75. const { scrollTop, scrollHeight, clientHeight } = container;
  76. // console.log('scrollHeight',scrollHeight);
  77. // console.log('clientHeight',clientHeight);
  78. // console.log(scrollTop);
  79. // 是否达到页面底部
  80. if (scrollTop + clientHeight >= scrollHeight) {
  81. // console.log('滚动到底部了!')
  82. this.page+=1
  83. // 执行加载
  84. this.searchs()
  85. }
  86. },
  87. //查找返回的数据
  88. searchs() {
  89. // console.log('this.input=',this.input)
  90. // console.log('this.page=',this.page)
  91. // console.log('this.size=',this.size)
  92. ret({ content: this.input, page: this.page, size: this.size }).then((item) => {
  93. // console.log('item=',item)
  94. if (item.length > 0) {
  95. this.count.push(...item);
  96. }
  97. })
  98. },
  99. //预览界面
  100. docName(curentDocId, value) {
  101. this.$tab.openPage(
  102. // window.open("/individual/Pre/user/" + curentDocId, "_blank"),
  103. window.open("/individual/Pre/user/" + curentDocId+ "?value=" + JSON.stringify(value), "_blank"),
  104. );
  105. },
  106. },
  107. };
  108. </script>
  109. <style lang='scss'>
  110. .three {
  111. margin-bottom: calc(100vw * (10 / 1920));
  112. em {
  113. color: #f00 !important;
  114. }
  115. }
  116. </style>
  117. <style scoped lang='scss'>
  118. .containe {
  119. color: #7ea4c8;
  120. font-size: 0.14rem;
  121. font-family: PingFang SC-Medium, PingFang SC;
  122. font-weight: 500;
  123. .picture {
  124. width: calc(100vw * (220 / 1920));
  125. height: calc(100vh * (57 / 1080));
  126. margin-left: calc(100vw * (860 / 1920));
  127. margin-top: calc(100vh * (100 / 1080));
  128. margin-bottom: calc(100vh * (40 / 1080));
  129. img {
  130. width: 100%;
  131. height: 100%;
  132. display: block;
  133. }
  134. }
  135. .search {
  136. width: calc(100vw * (864 / 1920));
  137. height: calc(100vh * (50 / 1080));
  138. margin-left: calc(100vw * (528 / 1920));
  139. margin-bottom: calc(100vh * (50 / 1080));
  140. position: relative;
  141. .cen—top-img {
  142. width: calc(100vw * (24 / 1920));
  143. height: calc(100vh * (24 / 1080));
  144. position: absolute;
  145. left: calc(100vw * (15 / 1920));
  146. top: calc(100vh * (15 / 1080));
  147. }
  148. .el-input {
  149. width: calc(100vw * (750 / 1920));
  150. height: calc(100vh * (50 / 1080));
  151. margin-right: calc(100vw * (14 / 1920));
  152. }
  153. .cen—top-span {
  154. display: inline-block;
  155. width: calc(100vw * (100 / 1920));
  156. height: calc(100vh * (50 / 1080));
  157. background: #2e8aecff;
  158. color: #ffffffcc;
  159. text-align: center;
  160. line-height: calc(100vh * (50 / 1080));
  161. &:hover{
  162. cursor: pointer
  163. }
  164. }
  165. }
  166. .mains {
  167. width: calc(100vw * (1450 / 1920));
  168. height: calc(100vh * (670 / 1080));
  169. // background: seagreen;
  170. margin-left: calc(100vw * (230 / 1920));
  171. overflow: auto;
  172. .main-main {
  173. width: calc(100vw * (1430 / 1920));
  174. // height: calc(100vh * (220 / 1080));
  175. padding: calc(100vh * (20 / 1080));
  176. border-bottom: 1px dashed #083b61ff;
  177. .one {
  178. margin-bottom: calc(100vw * (10 / 1920));
  179. color: #2e8aecff;
  180. font-size: 14px;
  181. text-decoration: underline;
  182. }
  183. .two {
  184. margin-bottom: calc(100vh * (10 / 1080));
  185. display: flex;
  186. .two1 {
  187. margin-right: calc(100vw * (30 / 1920));
  188. }
  189. img {
  190. vertical-align: middle;
  191. }
  192. }
  193. .four {
  194. display: flex;
  195. list-style: none;
  196. padding: 0;
  197. li {
  198. // width: calc(100vw * (62 / 1920));
  199. // height: calc(100vh * (24 / 1080));
  200. border: 1px solid #ff9839ff;
  201. background: #bba99240;
  202. padding: 0 5px;
  203. margin-right: calc(100vw * (5 / 1920));
  204. }
  205. }
  206. }
  207. }
  208. //滚动条样式
  209. ::-webkit-scrollbar {
  210. width: 3.5px;
  211. }
  212. ::-webkit-scrollbar-track {
  213. background-color: rgba(0, 0, 0, 0);
  214. }
  215. ::-webkit-scrollbar-thumb {
  216. background: #2e8aec;
  217. border-radius: 3px;
  218. }
  219. ::-webkit-scrollbar-thumb:hover {
  220. background: #2e8aec;
  221. }
  222. }
  223. ::v-deep .el-input--medium .el-input__inner {
  224. padding-left: calc(100vw * (50 / 1920));
  225. background: #14265e80;
  226. border: 1px solid #01d1ffff;
  227. color: #7ea4c8ff;
  228. }
  229. </style>