123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- <template>
- <div>
- <div class="saga-brand-box mt90 por">
- <div class="breadcrumb-content">
- <div style="width: 1020px">
- <el-breadcrumb
- separator-class="el-icon-arrow-right"
- style="width: 320px;display: inline-block"
- >
- <el-breadcrumb-item>所有分类</el-breadcrumb-item>
- <el-breadcrumb-item>给排水专业</el-breadcrumb-item>
- <el-breadcrumb-item>燃气系统</el-breadcrumb-item>
- <el-breadcrumb-item>品牌名称</el-breadcrumb-item>
- </el-breadcrumb>
- <span v-for="(item,index) in allSelect" v-if="item.check" class="select">{{item.BrandCname}}
- <i class="el-icon-close" @click="deleteCurrent(item,index)"></i></span>
- </div>
- <span class="total poa">共<b>42</b>件相关产品</span>
- </div>
- <div class="device-sys">
- <div class="left">品牌:</div>
- <div class="main" :class="more=='收起'? 'mt30':''">
- <ul v-if="more=='更多'">
- <li v-for="(item,index) in allDate" :key="index" v-if="index < 8" @click="handleCurrentBrand(item,index)"
- :class="item.check ?'light':''">
- {{item.BrandCname}}
- </li>
- </ul>
- <template v-else>
- <div :class="more=='收起' ? 'check':''">
- <span
- class="saga-product-letter"
- v-for="(list, letter,index) in brandList"
- @click="handleLetter(index,list,letter)"
- :class="idx=== index?'litter-light':''"
- > {{letter}}</span>
- </div>
- <ul>
- <li v-for="(item,index) in allDate" :key="index" @click="handleCurrentBrand(item,index)"
- :class="item.check ?'light':''">{{item.BrandCname}}
- </li>
- </ul>
- </template>
- </div>
- <div class="right" @click="allData" :class="more == '更多' ? 'dark' :'light'" style="position:relative;">
- <el-dropdown @command="handleCommand" style="line-height: 40px;" v-show="more=='收起'"
- :class="more=='收起'?'pos-drop':''">
- <span class="el-dropdown-link">
- {{sort}}<i class="el-icon-arrow-down el-icon--right"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item v-for="(val, key) in sortMap" :key="key" :command="key">{{val}}</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <p style="cursor: pointer;" :class="more=='收起'? 'pos-down':''">{{more}}
- <span :class="more=='更多' ? 'el-icon-caret-bottom':'el-icon-caret-top'"></span>
- </p>
- </div>
- </div>
- </div>
- <div class="saga-brand-box mt20">
- <detailTable/>
- </div>
- </div>
- </template>
- <script>
- import detailTable from "../../public/detailTable";
- import brandList from "@/data/brandList"
- export default {
- components: {detailTable},
- created() {
- this.brandList = Object.assign({
- '全部': [{
- id: 0,
- name: '全部'
- }
- ]
- }, brandList)
- for (let key in this.brandList) {
- if (Array.isArray(brandList[key])) {
- let list = this.temporary.concat(brandList[key])
- list.map(i => this.$set(i, 'check', false))
- this.temporary = list
- this.allDate = list
- this.allSelect = list
- }
- }
- },
- mounted() {
- },
- data() {
- return {
- idx: 0,
- more: '更多',
- // limitSys: 18,
- isShow: true,
- brandList: {},
- allDate: [],
- temporary: [],//全部数据
- allSelect: [],//选择的数据
- sortMap: {
- zh: "中文排序",
- en: "英文排序",
- },
- sort: "中文排序",
- }
- },
- computed: {},
- methods: {
- handleCommand(command) {// 切换排序方式
- this.sort = this.sortMap[command]
- },
- allData() {
- this.isShow = !this.isShow
- if (this.isShow) {
- this.more = '收起'
- } else {
- this.more = '更多'
- }
- },
- handleLetter(index, list, letter) {
- this.idx = index
- this.allDate = list
- if (index == 0) {
- this.allDate = this.temporary
- }
- },
- handleCurrentBrand(item, index) {
- item.check = !item.check
- this.allSelect.map((i, idx) => {
- if (idx == index) {
- i.check = item.check
- }
- })
- },
- deleteCurrent(item, index) {
- item.check = false
- this.allSelect.map((i, idx) => {
- if (idx == index) {
- i.check = item.check
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .mt90 {
- margin-top: 90px;
- }
- .mt20 {
- margin-top: 20px;
- }
- .mt30 {
- margin-top: 30px;
- }
- .por {
- position: relative;
- }
- .poa {
- position: absolute;
- }
- .saga-brand-box {
- width: 100%;
- padding: 16px;
- box-sizing: border-box;
- background: rgba(255, 255, 255, 1);
- .breadcrumb-content {
- display: flex;
- border-bottom: 1px solid #EFF0F1;
- padding-bottom: 20px;
- .total {
- text-align: right;
- color: #8D9399;
- right: 0;
- margin-right: 30px;
- b {
- color: #1F2429;
- }
- }
- .select {
- margin-left: 20px;
- display: inline-block;
- background: #EFF0F1;
- padding: 0 10px;
- line-height: 20px;
- cursor: pointer;
- margin-top: -3px;
- margin-bottom: 10px;
- }
- }
- .device-sys {
- display: flex;
- margin-top: 10px;
- border-bottom: 1px solid #EFF0F1;
- padding-bottom: 10px;
- position: relative;
- .left {
- padding-top: 6px;
- color: #8D9399;
- width: 50px;
- }
- .right {
- width: 100px;
- text-align: center;
- padding-top: 6px;
- }
- .main {
- color: #1F2429;
- width: 1020px;
- max-height: 150px;
- overflow: auto;
- ul {
- li {
- display: inline-block;
- line-height: 25px;
- width: 230px;
- margin-right: 20px;
- text-align: left;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- cursor: pointer;
- }
- }
- }
- .saga-product-letter {
- display: inline-block;
- padding: 3px;
- background: #EEEEEE;
- margin-right: 5px;
- font-size: 12px;
- cursor: pointer;
- }
- }
- /deep/ .el-breadcrumb__item:first-child .el-breadcrumb__inner:first-child {
- color: #8D9399
- }
- .dark {
- color: #8D9399
- }
- .light {
- color: #3A8DDE;
- }
- .litter-light {
- background: #D1E3F4 !important;
- color: #3A8DDE;
- }
- .check {
- position: absolute;
- top: 5px;
- }
- .pos-drop {
- top: -10px;
- left: -80px;
- }
- .pos-down {
- position: relative;
- top: -38px;
- }
- }
- </style>
|