configure.jsx 737 B

12345678910111213141516171819202122232425262728293031323334
  1. const companyList = [
  2. {value:0,label:'广西'} ,
  3. {value:1,label:'广州'} ,
  4. {value:2,label:'石家庄'} ,
  5. {value:3,label:'北京'} ,
  6. {value:4,label:'贵州'} ,
  7. {value:5,label:'昆明'} ,
  8. {value:6,label:'武汉'} ,
  9. {value:7,label:'新疆'} ,
  10. {value:8,label:'郑州'} ,
  11. {value:9,label:'内蒙古'} ,
  12. ];
  13. function getCompanyName(value){
  14. let arr = companyList.filter(v=>v.value === value);
  15. let title = '';
  16. if(arr.length > 0){title = arr[0].label}
  17. return title;
  18. }
  19. function getCompanyValueArray(){
  20. let arr = [];
  21. companyList.map(v=>{
  22. arr.push(v.value)
  23. })
  24. return arr;
  25. }
  26. module.exports = {
  27. companyList,
  28. getCompanyName,
  29. getCompanyValueArray
  30. }