index.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <div class="page">
  3. <van-list
  4. v-model="loadingMore"
  5. :finished="finished"
  6. :immediate-check="false"
  7. :finished-text="total ? '没有更多了' : ''"
  8. @load="onLoadMore"
  9. >
  10. <div class="page-top"></div>
  11. <div class="page-content">
  12. <div class="search-title">设备种类查询:</div>
  13. <div class="search-container">
  14. <el-select
  15. v-model="listQuery.productTypeId"
  16. slot="prepend"
  17. placeholder="设备种类"
  18. class="select-type"
  19. >
  20. <template v-for="product in productSelectList">
  21. <el-option
  22. :label="product.name"
  23. :value="product.productTypeId"
  24. :key="product.productTypeId"
  25. ></el-option>
  26. </template>
  27. </el-select>
  28. <el-input
  29. :placeholder="
  30. searchQuery.type === 1 ? '请输入SN码' : '请输入机构名'
  31. "
  32. v-model="searchQuery.keyword"
  33. class="input-with-select"
  34. >
  35. <el-select
  36. v-model="searchQuery.type"
  37. slot="prepend"
  38. placeholder="请选择"
  39. >
  40. <el-option label="SN码" :value="1"></el-option>
  41. <el-option label="机构名" :value="2"></el-option>
  42. </el-select>
  43. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  44. </el-input>
  45. <el-button class="submit" type="warning" @click="onSearch"
  46. >查询</el-button
  47. >
  48. </div>
  49. <template v-if="list.length > 0 || searchFlag">
  50. <!-- 标题 -->
  51. <div class="title px-4 pt-12 pb-6 md:px-0">
  52. 共<span v-text="total"></span>台设备
  53. </div>
  54. <!-- 列表 -->
  55. <div class="list">
  56. <div
  57. class="section flex justify-between mb-4"
  58. v-for="item in list"
  59. :key="item.productId"
  60. @click="toDetail(item)"
  61. >
  62. <img class="cover" :src="item.productImage" />
  63. <div class="info">
  64. <div class="name" v-text="item.productName"></div>
  65. <div class="code">SN码:{{ item.snCode | formatSnCode }}</div>
  66. <el-popover placement="right" title="机构列表" trigger="hover">
  67. <template v-for="club in item.clubList">
  68. <div
  69. @click.stop="toClubDetail(club)"
  70. :key="club.authId"
  71. class="club-item"
  72. >
  73. {{ club.authParty }}
  74. </div>
  75. </template>
  76. <div class="club-name" slot="reference">
  77. 所属机构:
  78. <template v-for="(club, index) in item.clubList">
  79. <span :key="club.authId"
  80. ><i v-if="index !== 0">,</i>{{ club.authParty }}</span
  81. >
  82. </template>
  83. </div>
  84. </el-popover>
  85. </div>
  86. </div>
  87. </div>
  88. <!-- 列表为空 -->
  89. <SimpleEmpty
  90. v-if="!total && !isRequest"
  91. name="icon-empty-device.png"
  92. description="敬请期待~"
  93. ></SimpleEmpty>
  94. </template>
  95. </div>
  96. </van-list>
  97. </div>
  98. </template>
  99. <script>
  100. import deviceListMixin from '@/mixins/deviceList'
  101. export default {
  102. layout: 'app-normal',
  103. mixins: [deviceListMixin],
  104. }
  105. </script>
  106. <style scoped lang="scss">
  107. .input-with-select {
  108. ::v-deep {
  109. .el-input-group__prepend {
  110. background-color: #fff;
  111. }
  112. }
  113. }
  114. ::v-deep {
  115. .el-button--warning {
  116. background-color: #bc1724;
  117. border-color: #bc1724;
  118. &:hover {
  119. background: #cf1b2a;
  120. border-color: #cf1b2a;
  121. }
  122. }
  123. }
  124. // pc 端
  125. @media screen and (min-width: 768px) {
  126. .el-popover {
  127. .club-item {
  128. line-height: 24px;
  129. cursor: pointer;
  130. &:hover {
  131. color: #bc1724;
  132. }
  133. }
  134. }
  135. .page {
  136. position: relative;
  137. min-height: calc(100vh - 80px - 80px);
  138. background-color: #fff;
  139. }
  140. .page-top {
  141. height: 420px;
  142. background: url(~assets/theme-images/normal/pc/banner-device.png);
  143. background-size: auto 420px;
  144. background-position: center;
  145. .logo {
  146. display: block;
  147. width: 120px;
  148. height: 120px;
  149. border-radius: 50%;
  150. background: #fff;
  151. }
  152. .name {
  153. font-size: 30px;
  154. color: #fff;
  155. }
  156. }
  157. .page-content {
  158. width: 1000px;
  159. margin: 0 auto;
  160. .search-title {
  161. font-size: 16px;
  162. color: #404040;
  163. margin: 25px 0;
  164. }
  165. .search-container {
  166. display: flex;
  167. justify-content: space-between;
  168. .input-with-select {
  169. margin: 0 15px;
  170. .el-select {
  171. ::v-deep {
  172. .el-input {
  173. width: 130px;
  174. }
  175. }
  176. }
  177. }
  178. .submit {
  179. width: 295px;
  180. }
  181. }
  182. .title {
  183. font-size: 16px;
  184. color: #404040;
  185. span {
  186. color: #bc1724;
  187. }
  188. }
  189. .list {
  190. display: flex;
  191. align-items: center;
  192. flex-wrap: wrap;
  193. justify-content: space-between;
  194. .empty {
  195. width: 390px;
  196. }
  197. .section {
  198. width: 490px;
  199. height: 136px;
  200. background-color: #f3f5f6;
  201. border-radius: 4px;
  202. box-sizing: border-box;
  203. padding: 16px;
  204. cursor: pointer;
  205. transition: all 0.4s;
  206. &:hover {
  207. box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
  208. }
  209. .cover {
  210. display: block;
  211. width: 104px;
  212. height: 104px;
  213. }
  214. .info {
  215. width: 336px;
  216. position: relative;
  217. .name {
  218. font-size: 18px;
  219. color: #101010;
  220. font-weight: bold;
  221. margin-bottom: 16px;
  222. margin-top: 4px;
  223. text-overflow: ellipsis;
  224. white-space: nowrap;
  225. overflow: hidden;
  226. }
  227. .code,
  228. .club-name {
  229. position: relative;
  230. font-size: 14px;
  231. color: #666;
  232. line-height: 24px;
  233. text-overflow: ellipsis;
  234. white-space: nowrap;
  235. overflow: hidden;
  236. margin-top: 6px;
  237. span {
  238. color: #1890ff;
  239. }
  240. }
  241. }
  242. }
  243. }
  244. }
  245. }
  246. // 移动 端
  247. @media screen and (max-width: 768px) {
  248. .page-top {
  249. height: 46vw;
  250. background: url(~assets/theme-images/normal/pc/banner-device.png);
  251. background-size: auto 46vw;
  252. background-position: center;
  253. .logo {
  254. display: block;
  255. width: 14.8vw;
  256. height: 14.8vw;
  257. border-radius: 50%;
  258. background: #fff;
  259. }
  260. .name {
  261. font-size: 4vw;
  262. color: #fff;
  263. }
  264. }
  265. .page-content {
  266. position: relative;
  267. .search-title {
  268. font-size: 3.4vw;
  269. color: #404040;
  270. margin: 3.2vw;
  271. }
  272. .search-container {
  273. padding: 0 3.2vw;
  274. .select-type {
  275. width: 100%;
  276. }
  277. .input-with-select {
  278. margin: 3.2vw 0;
  279. .el-select {
  280. ::v-deep {
  281. .el-input {
  282. width: 130px;
  283. }
  284. }
  285. }
  286. }
  287. .submit {
  288. width: 100%;
  289. }
  290. }
  291. .title {
  292. font-size: 3.4vw;
  293. color: #404040;
  294. span {
  295. color: #bc1724;
  296. }
  297. }
  298. .list {
  299. display: flex;
  300. align-items: center;
  301. flex-direction: column;
  302. .section {
  303. width: 93.6vw;
  304. height: 26vw;
  305. background-color: #f3f5f6;
  306. border-radius: 4px;
  307. box-sizing: border-box;
  308. padding: 3.2vw;
  309. .cover {
  310. display: block;
  311. width: 19.6vw;
  312. height: 19.6vw;
  313. }
  314. .info {
  315. width: 64vw;
  316. position: relative;
  317. margin-left: 3.2vw;
  318. .name {
  319. font-size: 4vw;
  320. color: #101010;
  321. font-weight: bold;
  322. margin-bottom: 4vw;
  323. text-overflow: ellipsis;
  324. white-space: nowrap;
  325. overflow: hidden;
  326. }
  327. .code,
  328. .club-name {
  329. width: 66vw;
  330. position: relative;
  331. font-size: 3vw;
  332. color: #404040;
  333. line-height: 5vw;
  334. text-overflow: ellipsis;
  335. white-space: nowrap;
  336. overflow: hidden;
  337. span {
  338. color: #6d9eff;
  339. }
  340. }
  341. }
  342. }
  343. }
  344. }
  345. }
  346. </style>