configure.jsx 542 B

12345678910111213141516171819202122232425262728
  1. const companyList = [
  2. {value:0,label:'广西'} ,
  3. {value:1,label:'广州'} ,
  4. {value:2,label:'石家庄'} ,
  5. {value:3,label:'北京'} ,
  6. ];
  7. function getCompanyName(value){
  8. let arr = companyList.filter(v=>v.value === value);
  9. let title = '';
  10. if(arr.length > 0){title = arr[0].label}
  11. return title;
  12. }
  13. function getCompanyValueArray(){
  14. let arr = [];
  15. companyList.map(v=>{
  16. arr.push(v.value)
  17. })
  18. return arr;
  19. }
  20. module.exports = {
  21. companyList,
  22. getCompanyName,
  23. getCompanyValueArray
  24. }