<import-sjs name="utils" from="./index.sjs"/>
<wrapper>
  <view class="hospital-num-source">
    <view
      class="source-header"
      style="top: {{ headerHeight }}px"
    >
      <date-control
        onChange="onChange"
        dateList="{{ dateList }}"
      />
    </view>
    <view class="hospital-num-source-content">
      <block a:if="{{ nativeList.length > 0 }}">
        <block a:for="{{ dataSource }}" a:for-item="p">
          <block a:if="{{ p.items.length > 0 }}">
            <view class="sub-title">{{ p.name }}</view>
            <view class="normal-items">
              <view a:for="{{ p.items }}" class="normal-item">
                <num-item
                  item="{{ item }}"
                  isRange="{{ !!date }}"
                  isFlex="{{ utils.checkFlex() }}"
                  componentData="{{ componentData }}"
                />
              </view>
            </view>
          </block>
        </block>
      </block>
      <empty
        title="抱歉，当日无医生排班"
        height="calc(100vh - 2.2rem)"
        message="您可以查看其他日期号源"
        a:if="{{ !nativeList.length && !loading }}"
      />
      <view
        a:if="{{ loading }}"
        class="loading-container"
      >
        <loading size="48px" />
      </view>
      <view
        class="no-more"
        a:if="{{ nativeList.length > 0 && isLastPage }}"
      >
        ~没有更多了~
      </view>
    </view>
    <modal
      show="{{ showModal }}"
      onButtonClick="onModalClick"
      disableScroll="{{false}}"
      zIndex="10"
      buttons="{{ [
        {
          text: modalBtnNum > 0 ? modalBtnNum + 's后可点击' : '确定',
          extClass: 'buttonBold',
        },
      ] }}"
      >
      <view slot="header">{{ title }}</view>
        <mas-adc-rich-pro content="{{ content }}"/>
    </modal>
  </view>
</wrapper>
