noTerminal.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. export default {
  2. data() {
  3. return {
  4. customFormItems: [
  5. {
  6. itemIndex: 0,
  7. replaceNum: 1,
  8. prop: 'range',
  9. inputType: 'select',
  10. placeholder: '统计范围',
  11. requiredWarning: '请先选择统计范围',
  12. options: [
  13. {
  14. value: '全部',
  15. label: '全部'
  16. },
  17. {
  18. value: '航线',
  19. label: '航线'
  20. },
  21. {
  22. value: '基地分公司',
  23. label: '基地分公司'
  24. },
  25. {
  26. value: '航站',
  27. label: '航站'
  28. }
  29. ],
  30. changeHandler(value) {
  31. this.setInOrOutOptions(value)
  32. const rangeMap = {
  33. 航线: 'airline',
  34. 基地分公司: 'area',
  35. 航站: 'airport'
  36. }
  37. Object.entries(rangeMap).forEach(([k, v]) => {
  38. const theItem = this.formItems.find(item => item.prop === v)
  39. if (value === k) {
  40. theItem && (theItem.disabled = false)
  41. } else {
  42. this.formData[v] = ''
  43. theItem && (theItem.disabled = true)
  44. }
  45. })
  46. }
  47. },
  48. {
  49. itemIndex: 7,
  50. replaceNum: 1
  51. }
  52. ]
  53. }
  54. }
  55. }