1、使用情况月模式和周模式支持开口子

```typescriptreact
dragEnd = (data?: any, custoParams?: any) => {
    const { canCreate, dragStartIndex } = this.state;
    const { needCallBack, callBack } = this.props
    const { baseData: { canQuickCreate }, isHideCreateBtn } = this.props.roomUsageStore
    const start: any[] = data.start
    const end: any[] = data.end
    const addressIndex: number = parseInt(start[0], 10)
    const { slideTabValue, baseData: { startHour, dayDspunit, endHour, roomConflictType }, resourceDatas, startDate, baseData } = this.props.roomUsageStore;
    const roomInfo: any = resourceDatas[addressIndex]
    const address = roomInfo.id
    const { beginDate, endDate, begintime, endtime,dragBeginIndex,dragEndIndex } = getMeetingParams(slideTabValue.mode, startHour, dayDspunit, startDate, data,custoParams)
    //判断data.start & data.end 奇偶，判断出起点和终点的index
    const dragStart = Number(data?.start?.[1]);
    // const endIndex = data?.index?.dataIndex;
    let endIndex = Number(data?.end?.[1]);
    let startIndex: any;
    /* 判读当前所选范围是否有会议 */
    let hasMt: boolean = false;
    if (slideTabValue.mode === 'day') {
      const idx = data?.index?.index?.split('_')?.[1] || data?.index?.dataIndex;
      console.log(idx)
      endIndex = dayDspunit == 1 ? idx : Number(data?.index?.dataIndex) * dayDspunit + Number(idx);
      startIndex = dragStartIndex;
      // endIndex = data?.index?.index?.indexOf('_1') > -1 ? (Number(data?.index?.dataIndex) * 2) + 1 : (Number(data?.index?.dataIndex) * 2) + 2;
    }
    else if (slideTabValue.mode === 'week') {
      if(custoParams && custoParams.length > 0){
        endIndex = Number(data?.index?.dataIndex.split('_')?.[0]) * custoParams.length + Number(dragEndIndex);
        startIndex = Number(dragStartIndex) * custoParams.length + Number(dragBeginIndex);
      }else{
        startIndex = dragStartIndex;
        endIndex = data?.index?.dataIndex;
      }
    } else if (slideTabValue.mode === 'month') {
      if(custoParams && custoParams.length > 0){
        endIndex = Number(data?.index?.dataIndex.split('_')?.[0]) * custoParams.length + Number(dragEndIndex);
        startIndex = Number(dragStartIndex) * custoParams.length + Number(dragBeginIndex);
      }else{
        let startTemp = dragStartIndex;
        if (dragStartIndex.substr(0, 1) === '0') {
          startTemp = Number(dragStartIndex.split('')?.[1])
        }
        startIndex = startTemp
      }
    }
```

注意点：customParams，传入自定义的时间段，需要数组格式，并且是特定格式：

![image.png](https://weapp.eteams.cn/api/file/preview?fileId=1003942176132775936&type=imgs)这样，无论是新建按钮，还是拖拽，会按照传入的时间格式，进行时间传入。
