Commit 0ebbcf2a by 李伟康

提交代码

1 parent 3c378b32
import Request from '../request'
var request = new Request()
// window.$HTTP
export default {
/**获取品牌名称*/
getBrandList () {
return request.get('brand/getBrandName', {
req: {
corporateGroupName: '集团1',
queryTime: '2022-06-23'
}
})
}
}
......@@ -23,7 +23,7 @@
:class="['options-item flex',{'active':i.active}]"
:key="index"
@click="chooseBrand({i,index})"
>{{i.name}}</div>
>{{i.brandName}}</div>
</template>
</div>
</div>
......@@ -43,19 +43,6 @@
</template>
<script type='text/ecmascript-6'>
let test = [{ name: '东风本田' },
{ name: '别克' },
{ name: '凯迪拉克' },
{ name: 'MINI' },
{ name: '荣威' },
{ name: '上海大众' },
{ name: '沃尔沃' },
{ name: '一汽丰田' },
{ name: '平行进口' },
{ name: '奥迪' },
{ name: '广汽本田' },
{ name: '比亚迪' },
{ name: '奔驰' },]
export default {
name: 'ViewControl',
data () {
......@@ -69,8 +56,18 @@ export default {
}
},
mounted () {
test.map(e => e.active = false)
this.brands = test
this.api.common.getBrandList().then(({ code, data }) => {
let brands = []
if (code == 0) {
data.dataList.map(e => {
brands.push({
brandName: e,
active: false
})
})
}
this.brands = brands
})
},
methods: {
change (index, item) {
......@@ -80,7 +77,7 @@ export default {
this.tab = ['广汇集团', '品牌概览']
} else {
if (!item) return
this.tab[1] = item.name
this.tab[1] = item.brandName
}
this.tabIndex = index
this.emit()
......@@ -97,7 +94,7 @@ export default {
reportType: reportIndex == 0 ? 1 : 0 //月表0,日表1
}
if (tabIndex == 1) brands.map(e => {
if (e.active) params.brand = e
if (e.active) params.brandName = e.brandName
})
this.$store.state.app.reportParams = params
},
......@@ -166,7 +163,7 @@ export default {
top: 4.1vh;
right: 0;
width: 50%;
height: 30vh;
max-height: 30vh;
background: #383737;
border: 1px solid rgba(96, 98, 102, 1);
box-shadow: 0px 3px 2px 1px rgba(0, 0, 0, 0.5);
......@@ -177,7 +174,7 @@ export default {
&:hover {
display: block;
}
&:hover .brand{
&:hover .brand {
background-color: #096;
}
.options-item {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!