import useModel from './model'
export default {
  handleSelect(idx: number, e: any) {
    let arr: string[] = []
    let is = useModel?.selectType?.value[idx]?.is_select
    useModel.selectType.value[idx].is_select = !is
    useModel.selectType.value?.map((res: any) => {
      if (res?.is_select) {
        arr?.push(e?.type)
      }
    })
    useModel.selectEdType.value = arr
    console.log(idx, 'e')
  },
  handleInit() {
    useModel.selectEdType.value = ['SMS', 'MiniProgram', 'OfficialAccount']
    useModel.selectType.value = [
      {
        label: '小程序催缴通知',
        des: '覆盖范围：仅限完成小程序订阅授权且保持通知开启状态的客户。',
        is_select: true,
        type: 'MiniProgram'
      },
      {
        label: '公众号催缴通知',
        des: '覆盖范围：限定已关注物业服务公众号的客户。',
        is_select: true,
        type: 'OfficialAccount'
      },
      {
        label: '发送短信通知',
        des: '该方式实现近100%客户触达',
        subDes: '（注：需号码状态正常且未设置短信拦截）',
        tab: '100%触达',
        is_select: true,
        type: 'SMS'
      }
    ]
  }
}
