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