function selectListALL (myJson, isAddDefault = false) {
  const myArray = []
  if (isAddDefault) {
    const defaultItem = {
      value: undefined,
      label: '未选择'
    }
    myArray.push(defaultItem)
  }
  let q_value = undefined
  let q_label = ''
  for (const key in myJson) {
    const content = myJson[key]
    if (content == '其它' || content == '全时段') {
      q_value = Number(key)
      q_label = content
    } else {
      const item = {
        value: undefined,
        label: '未选择'
      }
      item.value = Number(key)
      item.label = content
      myArray.push(item)
    }
  }
  if (q_value != undefined) {
    if (q_label != '') {
      const item = {
        value: q_value,
        label: q_label
      }
      myArray.push(item)
    }

  }
  var item = {
    label: '全部',
    value: ''
  }
  myArray.unshift(item)
  return myArray
}
function selectList (myJson, isAddDefault = false) {
  const myArray = []
  // if (isAddDefault) {
  //   const defaultItem = {
  //     value: undefined,
  //     label: '未选择'
  //   }
  //   myArray.push(defaultItem)
  // }
  for (const key in myJson) {
    const content = myJson[key]
    const item = {
      value: undefined,
      label: '未选择'
    }
    item.value = Number(key)
    item.label = content
    myArray.push(item)
  }
  // var item = {
  //   label: '全部',
  //   value: ''
  // }
  // myArray.unshift(item)
  return myArray
}

const weekList = [
  {
    value: '一',
    label: '周一'
  },
  {
    value: '二',
    label: '周二'
  },
  {
    value: '三',
    label: '周三'
  },
  {
    value: '四',
    label: '周四'
  },
  {
    value: '五',
    label: '周五'
  },
  {
    value: '六',
    label: '周六'
  },
  {
    value: '日',
    label: '周日'
  }
]
function generateTiemList () {
  var arr = []
  for (var i = 1; i < 25; i++) {
    var data = {}
    if (i < 10) {
      data.value = '0' + i
      data.label = '0' + i + ':00'
    } else {
      data.value = String(i)
      data.label = '' + i + ':00'
    }
    arr.push(data)
  }
  return arr
}
export {
  generateTiemList,
  selectListALL,
  selectList,

  weekList
}