index.vue 8.6 KB

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