123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380 |
- <template>
- <div class="page">
- <van-list
- v-model="loadingMore"
- :finished="finished"
- :immediate-check="false"
- :finished-text="total ? '没有更多了' : ''"
- @load="onLoadMore"
- >
- <div class="page-top"></div>
- <div class="page-content">
- <div class="search-title">设备种类查询:</div>
- <div class="search-container">
- <el-select
- v-model="listQuery.productTypeId"
- slot="prepend"
- placeholder="设备种类"
- class="select-type"
- >
- <template v-for="product in productSelectList">
- <el-option
- :label="product.name"
- :value="product.productTypeId"
- :key="product.productTypeId"
- ></el-option>
- </template>
- </el-select>
- <el-input
- :placeholder="
- searchQuery.type === 1 ? '请输入SN码' : '请输入完整的机构名称'
- "
- v-model="searchQuery.keyword"
- class="input-with-select"
- >
- <el-select
- v-model="searchQuery.type"
- slot="prepend"
- placeholder="请选择"
- >
- <el-option label="SN码" :value="1"></el-option>
- <el-option label="机构名" :value="2"></el-option>
- </el-select>
- <i slot="prefix" class="el-input__icon el-icon-search"></i>
- </el-input>
- <el-button class="submit" type="warning" @click="onSearch"
- >查询</el-button
- >
- </div>
- <div class="area">
- <RossSelectGroup @change="onCityChange" ref="citySelect" />
- </div>
- <template v-if="list.length > 0 || searchFlag">
- <!-- 标题 -->
- <div class="title px-4 pt-12 pb-6 md:px-0">
- 共<span v-text="total"></span>台设备
- </div>
- <!-- 列表 -->
- <div class="list">
- <div
- class="section flex justify-between mb-4"
- v-for="item in list"
- :key="item.productId"
- @click="toDetail(item)"
- >
- <img class="cover" :src="item.productImage" />
- <div class="info">
- <div class="name" v-text="item.productName"></div>
- <div class="code">SN码:{{ item.snCode | formatSnCode }}</div>
- <el-popover placement="right" title="机构列表" trigger="hover">
- <template v-for="club in item.clubList">
- <div
- @click.stop="toClubDetail(club)"
- :key="club.authId"
- class="club-item"
- >
- {{ club.authParty }}
- </div>
- </template>
- <div class="club-name" slot="reference">
- 所属机构:
- <template v-for="(club, index) in item.clubList">
- <span :key="club.authId"
- ><i v-if="index !== 0">,</i>{{ club.authParty }}</span
- >
- </template>
- </div>
- </el-popover>
- </div>
- </div>
- </div>
- <!-- 列表为空 -->
- <SimpleEmpty
- v-if="!total && !isRequest"
- name="icon-empty-device.png"
- description="未找到相关设备~"
- ></SimpleEmpty>
- </template>
- </div>
- </van-list>
- </div>
- </template>
- <script>
- import deviceListMixin from '@/mixins/deviceList'
- export default {
- layout: 'app-normal',
- mixins: [deviceListMixin],
- }
- </script>
- <style scoped lang="scss">
- .input-with-select {
- ::v-deep {
- .el-input-group__prepend {
- background-color: #fff;
- }
- }
- }
- ::v-deep {
- .el-button--warning {
- background-color: #bc1724;
- border-color: #bc1724;
- &:hover {
- background: #cf1b2a;
- border-color: #cf1b2a;
- }
- }
- }
- // pc 端
- @media screen and (min-width: 768px) {
- .el-popover {
- .club-item {
- line-height: 24px;
- cursor: pointer;
- &:hover {
- color: #bc1724;
- }
- }
- }
- .page {
- position: relative;
- min-height: calc(100vh - 80px - 80px);
- background-color: #fff;
- }
- .page-top {
- height: 420px;
- background: url(~assets/theme-images/normal/pc/banner-device.png);
- background-size: auto 420px;
- background-position: center;
- .logo {
- display: block;
- width: 120px;
- height: 120px;
- border-radius: 50%;
- background: #fff;
- }
- .name {
- font-size: 30px;
- color: #fff;
- }
- }
- .page-content {
- width: 1000px;
- margin: 0 auto;
- .search-title {
- font-size: 16px;
- color: #404040;
- margin: 25px 0;
- }
- .search-container {
- display: flex;
- justify-content: space-between;
- .input-with-select {
- margin: 0 15px;
- .el-select {
- ::v-deep {
- .el-input {
- width: 130px;
- }
- }
- }
- }
- .submit {
- width: 295px;
- }
- }
- .title {
- font-size: 16px;
- color: #404040;
- span {
- color: #bc1724;
- }
- }
- .list {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- justify-content: space-between;
- .empty {
- width: 390px;
- }
- .section {
- width: 490px;
- height: 136px;
- background-color: #f3f5f6;
- border-radius: 4px;
- box-sizing: border-box;
- padding: 16px;
- cursor: pointer;
- transition: all 0.4s;
- &:hover {
- box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
- }
- .cover {
- display: block;
- width: 104px;
- height: 104px;
- }
- .info {
- width: 336px;
- position: relative;
- .name {
- font-size: 18px;
- color: #101010;
- font-weight: bold;
- margin-bottom: 16px;
- margin-top: 4px;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- .code,
- .club-name {
- position: relative;
- font-size: 14px;
- color: #666;
- line-height: 24px;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- margin-top: 6px;
- span {
- color: #1890ff;
- }
- }
- }
- }
- }
- }
- }
- // 移动 端
- @media screen and (max-width: 768px) {
- .page-top {
- height: 46vw;
- background: url(~assets/theme-images/normal/pc/banner-device.png);
- background-size: auto 46vw;
- background-position: center;
- .logo {
- display: block;
- width: 14.8vw;
- height: 14.8vw;
- border-radius: 50%;
- background: #fff;
- }
- .name {
- font-size: 4vw;
- color: #fff;
- }
- }
- .page-content {
- position: relative;
- .search-title {
- font-size: 3.4vw;
- color: #404040;
- margin: 3.2vw;
- }
- .search-container {
- padding: 0 3.2vw;
- .select-type {
- width: 100%;
- }
- .input-with-select {
- margin: 3.2vw 0;
- .el-select {
- ::v-deep {
- .el-input {
- width: 130px;
- }
- }
- }
- }
- .submit {
- width: 100%;
- }
- }
- .title {
- font-size: 3.4vw;
- color: #404040;
- span {
- color: #bc1724;
- }
- }
- .list {
- display: flex;
- align-items: center;
- flex-direction: column;
- .section {
- width: 93.6vw;
- height: 26vw;
- background-color: #f3f5f6;
- border-radius: 4px;
- box-sizing: border-box;
- padding: 3.2vw;
- .cover {
- display: block;
- width: 19.6vw;
- height: 19.6vw;
- }
- .info {
- width: 64vw;
- position: relative;
- margin-left: 3.2vw;
- .name {
- font-size: 4vw;
- color: #101010;
- font-weight: bold;
- margin-bottom: 4vw;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- .code,
- .club-name {
- width: 66vw;
- position: relative;
- font-size: 3vw;
- color: #404040;
- line-height: 5vw;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- span {
- color: #6d9eff;
- }
- }
- }
- }
- }
- }
- }
- </style>
|