export default {
  data() {
    return {
      customFormItems: [
        {
          itemIndex: 0,
          replaceNum: 1,
          prop: 'range',
          inputType: 'select',
          placeholder: '统计范围',
          requiredWarning: '请先选择统计范围',
          options: [
            {
              value: '全部',
              label: '全部'
            },
            {
              value: '航线',
              label: '航线'
            }
          ],
          changeHandler(value) {
            this.setInOrOutOptions(value)
            const rangeMap = {
              航线: 'airline'
            }
            Object.entries(rangeMap).forEach(([k, v]) => {
              const theItem = this.formItems.find(item => item.prop === v)
              if (value === k) {
                theItem && (theItem.disabled = false)
              } else {
                this.formData[v] = ''
                theItem && (theItem.disabled = true)
              }
            })
          }
        },
        {
          itemIndex: 2,
          replaceNum: 1,
          prop: 'interval',
          inputType: 'select',
          placeholder: '时间维度',
          requiredWarning: '请先选择统计时间维度',
          disabled: true,
          defaultOption: '日',
          options: [
            {
              value: '日',
              label: '按日统计'
            }
          ]
        },
        {
          itemIndex: 5,
          replaceNum: 3
        },
        {
          itemIndex: 1,
          replaceNum: 1
        }
      ]
    }
  }
}
