12345678910111213141516171819202122232425262728 |
- const companyList = [
- {value:0,label:'广西'} ,
- {value:1,label:'广州'} ,
- {value:2,label:'石家庄'} ,
- {value:3,label:'北京'} ,
- ];
- function getCompanyName(value){
- let arr = companyList.filter(v=>v.value === value);
- let title = '';
- if(arr.length > 0){title = arr[0].label}
- return title;
- }
- function getCompanyValueArray(){
- let arr = [];
- companyList.map(v=>{
- arr.push(v.value)
- })
- return arr;
- }
- module.exports = {
- companyList,
- getCompanyName,
- getCompanyValueArray
- }
|