/*
 * Create:      柿子
 * CreateDate:  2023/11/28
 * Describe:    护士工作站 - 新版工作站
 * */
import React, { Component } from 'react';
import { Tabs, Select, Input, Radio, Card, Tooltip, Icon, Popover, Button, Badge } from 'antd';
import { Util, dayFormat } from 'tools';
import store from 'store';
import moment from 'moment';
import RangeDatePicker from 'components/rangePicker/index';
import PublicModalFormHooks from 'pages/common/PublicModalFormHooks';
import PublicTablePagination from 'pages/common/PubilcTablePagination';
import ShowComponentModal from 'pages/workstation/component/ShowComponentModal';
import PatientCourseInfo from 'pages/nurse/Patient/PatientCourseInfo'; // 患者历程
import ModificationPatientInfo from 'pages/registercard/component/ModificationPatientInfo';
import HistoricalNursingAssessmentForm from './component/HistoricalNursingAssessmentForm'; // 历史护理评估单
import AllMedicalOrders from './workstation/AllMedicalOrders'; // 全部医嘱
import MedicalOrdersNeedToBeProcessed from './workstation/MedicalOrdersNeedToBeProcessed'; // 需处理医嘱
import './style/index.less';
const { TabPane } = Tabs;
const { Search } = Input;

class NurseWorkstation extends Component {
  constructor(props) {
    super(props);
    this.state = {
      hisLeftNum: 292, // 记录隐藏时的宽度
      leftNum: 292,
      leftMinLimit: 111,
      leftMaxLimit: 500,
      selectData: {
        defaultDays: 1
      },
      patQueryActive: '1', // 患者查询页签
      queryParams: {
        locID: undefined, // 病区
        patAlias: undefined, // 患者信息
        endDate: moment().format(dayFormat), // 出院日期
        startDate: moment().format(dayFormat),
        groupID: undefined, // 分组
        shortcutID: undefined, // 快捷
      },
      loading: false, // 患者列表
      patSelectType: 'radio', // 患者列表选择类型 - 默认单选
      totalWidth: 0,
      columns: [],
      tableData: [],
      selectedRows: [],
      selectedRowKeys: [],
      queryHeight: 44, // 查询栏高度
      filterSettingsFormData: [], // 筛选设置弹窗表单数据
      filterSettingsRowData: {},
      leftCardFlag: false,
      rowID: '',
      rowData: {},
      isShowComponentModal: false,
      contentTabsList: [{
        id: '1',
        title: '需处理医嘱',
        dotFlag: 'Y',
        multipleFlag: 'Y'
      }, {
        id: '2',
        title: '全部医嘱',
        multipleFlag: 'Y'
      }, {
        id: '3',
        title: '单据打印',
        dotFlag: 'Y',
        multipleFlag: 'Y'
      }, {
        id: '4',
        title: '药品审核',
        dotFlag: 'Y',
        multipleFlag: 'Y'
      }, {
        id: '5',
        title: '护理记录',
        dotFlag: 'Y',
        multipleFlag: 'Y'
      }, {
        id: '6',
        title: '生命体征',
      }, {
        id: '7',
        title: '事件登记',
      }, {
        id: '8',
        title: '医嘱单',
      }, {
        id: '9',
        title: '住院费用',
      }, {
        id: '10',
        title: '补录费用',
      }, {
        id: '11',
        title: '住院病历',
      }, {
        id: '12',
        title: '出院相关',
      }], // 内容tabs
      contentActive: '1',
      multipleFlag: 'Y',
      colorPriorityFlag: 'N', // 颜色优先级标志 - 是否在修改颜色优先级
    };
    this.isResizing = false;
    this.resizePosition = null;
    this.NWContainer = React.createRef(); // 创建 Ref
    this.queryRef = React.createRef();
  }

  componentDidMount() {
    this.getTableColumns();
    // this.getSelectData();
    this.handleQuery();
    document.addEventListener('mousemove', this.handleVResizeOver);
    document.addEventListener('mouseup', this.handleStopResize);
  };

  componentWillUnmount() {
    document.removeEventListener('mousemove', this.handleVResizeOver);
    document.removeEventListener('mouseup', this.handleStopResize);
  };

  // 获取下拉数据
  getSelectData = async () => {
    try {
      let res = await React.$asyncPost(this, '123');
      let result = res?.result || {};
      this.setState({
        selectData: result,
      }, () => {
        this.getQueryDOMHeader();
      });
    } catch (error) {
      console.log(error);
      this.getQueryDOMHeader();
    }
  };

  // 拖动垂直调整块
  handleVResizeOver = (e) => {
    if (!this.isResizing) return;
    const { leftMinLimit, leftMaxLimit } = this.state;
    // 使用 offsetX 调整新值
    let newValue;
    if (this.resizePosition === 'left') {
      newValue = Math.max(leftMinLimit, Math.min(leftMaxLimit, e.clientX - this.NWContainer.current.offsetLeft - this.offsetXLeft));
      this.setState({ leftNum: newValue <= leftMinLimit ? 48 : newValue, leftCardFlag: newValue <= leftMinLimit ? true : false }, () => {
        this.handleRecordOperationalData();
      });
    }
  };

  // 记录操作数据
  handleRecordOperationalData = () => {
    const { leftNum } = this.state;
    React.$setLocalStorageData('NurseWorkstation', {
      operationInnerWidth: window.innerWidth, // 操作标志
      leftNum,
    });
  };

  // 开始拖动垂直调整块
  handleVResizeDown = (e, direction) => {
    e.preventDefault();
    React.$stopPropagation(e);
    if (!this.isResizing) {
      this.isResizing = true;
      this.resizePosition = direction;
      const rect = e.target.getBoundingClientRect();
      if (this.resizePosition === 'left') {
        this.offsetXLeft = e.clientX - rect.left;
      } else if (this.resizePosition === 'right') {
        this.offsetXRight = rect.right - e.clientX;
      }
    }
  };

  // 只要鼠标松开或者离开区域，那么就停止resize
  handleStopResize = (e) => {
    e.preventDefault();
    React.$stopPropagation(e);
    if (this.isResizing) {
      delete (this.resizePosition);
      this.isResizing = false;
      this.setState({});
    }
  };

  // 患者查询页签切换
  handlePatQueryTabsChange = (key) => {
    if (key === '3') { // 打开高级筛选设置
      this.filterSettingsRef && this.filterSettingsRef.modifyVisible(true);
      return;
    };
    this.setState({ patQueryActive: key }, () => {
      this.getQueryDOMHeader();
    });
  };

  // 获取表头数据
  getTableColumns = async () => {
    try {
      let data = {
        params: [{
          compontName: 'NurseWorkstationPatList',
          type: 'C',
        }]
      }
      let res = await React.$asyncPost(this, '01040073', data);
      let columns = res.result?.C || [];
      if (columns && columns.length > 0) {
        this.setState({
          columns,
          totalWidth: res.totalWidth
        })
      }
      this.setState({ filterSettingsFormData: res?.result?.formData || [] });
    } catch (error) {
      console.log(error)
    }
  };

  handleInputChange = (e, dataIndex, isQuery) => {
    this.state.queryParams[dataIndex] = e;
    this.setState({}, () => {
      isQuery === 'Y' && this.handleQuery();
    })
  };

  handleQuery = () => {
    let tableData = [{
      key: '1',
      patMedicalNo: '2102444',
      bedNo: '603',
      patName: '曹操',
      icon: '新',
      patSexDesc: '男',
      admID: '98682',
      patID: '71995'
    }, {
      key: '2',
      patMedicalNo: '2102445',
      bedNo: '604',
      patName: '大乔',
      icon: '新',
      patSexDesc: '女',
      admID: '98682',
      patID: '71995'
    }, {
      key: '3',
      patMedicalNo: '2102446',
      bedNo: '609',
      patName: '吕布',
      icon: '入',
      patSexDesc: '男',
      admID: '98682',
      patID: '71995'
    }, {
      key: '4',
      patMedicalNo: '2102447',
      bedNo: '605',
      patName: '貂蝉',
      icon: '新',
      patSexDesc: '女',
      admID: '98682',
      patID: '71995'
    }, {
      key: '5',
      patMedicalNo: '2102448',
      bedNo: '606',
      patName: '姜子牙',
      icon: '新',
      patSexDesc: '男',
      admID: '98682',
      patID: '71995'
    }];
    this.setState({ tableData });
  };

  // 患者列表选择类型切换
  handlePatSelectTypeChange = e => {
    this.setState({
      patSelectType: e.target.value,
      selectedRows: [],
      selectedRowKeys: [],
    });
  };

  // 操作行
  onClickRowPublic = (record) => {
    return {
      // 单击行选中
      onClick: () => {
        if (this.state.rowID === '' || (this.state.rowID && (this.state.rowID !== record.key))) {
          this.setState({
            rowID: record.key,
            rowData: record,
          })
        } else {
          this.handleClear();
        }
      }
    }
  };

  handleClear = () => {
    this.setState({ rowID: '', rowData: {} });
  };

  // 选中行操作
  setRowClassNamePublic = (record) => {
    return record.key === this.state.rowID ? 'clickRowStyle' : '';
  };

  handlePatSelectedRowKeysChange = (selectedRowKeys, selectedRows) => {
    this.setState({
      selectedRows,
      selectedRowKeys,
    })
  };

  // 获取查询栏高度
  getQueryDOMHeader = () => {
    this.setState({ queryHeight: this.queryRef?.current?.clientHeight || 44 });
  };

  // 高级筛选设置保存
  handleFilterSettingsSave = async values => {
    try {
      const { queryParams, selectData } = this.state;
      let defaultDays = parseInt(values?.defaultDays || '');
      if (defaultDays > 0 && queryParams?.modifyDateFlag !== 'Y') { // 判断是否修改日期 - 已修改不取默认天数
        this.state.queryParams.startDate = moment(moment().subtract(defaultDays, 'days')).format(dayFormat);
      }
      this.filterSettingsRef && this.filterSettingsRef.modifyVisible(false, 'Y');
      this.setState({ selectData: { ...selectData, ...values } }, () => {
        this.getQueryDOMHeader();
      });
    } catch (error) {
      this.setState({ tableData: [], mainTotal: 0, loading: false })
    }
  };

  // 控制左侧card显隐
  handleCardFlagChange = () => {
    let { leftCardFlag, leftMinLimit, hisLeftNum, leftNum } = this.state;
    let currentLeftCardFlag = !leftCardFlag;
    if (!leftCardFlag) { // 隐藏前记录当前左侧宽度
      this.state.hisLeftNum = leftNum;
    }
    this.state.leftNum = currentLeftCardFlag ? 48 : (hisLeftNum >= leftMinLimit ? hisLeftNum : leftMinLimit);
    this.setState({
      leftCardFlag: currentLeftCardFlag
    })
  };

  // 本次就诊日程
  handleViewPatientCourse = () => {
    const { rowData } = this.state;
    this.patConsumeRef?.showModal(rowData?.admID || '', rowData?.patID || ''); // 患者历程
  };

  // 历史查询
  handleHistoryQuery = () => {
    const { rowData } = this.state;
    let patientData = {
      patID: rowData?.patID,
      admID: rowData?.admID,
    };
    React.$setSessionData('patientData', patientData);
    this.modifyVisible('isShowComponentModal', true);
  };

  // 历史评估单
  handleHistoryAssessForm = () => {
    const { rowData } = this.state;
    console.log(rowData);
  };

  modifyVisible = (dataIndex, visible) => {
    this.state[dataIndex] = visible;
    this.setState({});
  };

  // 修改病人信息
  handleModifyPatInfo = async () => {
    try {
      const { rowData } = this.state;
      let data = {
        params: [{
          ...rowData
        }]
      }
      let res = await React.$asyncPost(this, '03050274', data);
      this.modifyPatInfoChild && this.modifyPatInfoChild.showModifDom(res.result);
    } catch (error) {
      console.log(error);
    }
  };

  // 历史护理评估单
  handleHistoryNursingAssessmentForm = () => {
    const { rowData } = this.state;
    this.hisNurseAssessRef && this.hisNurseAssessRef.modifyVisible(rowData);
  };

  handleContentTabsChange = key => {
    const { contentTabsList, patSelectType } = this.state;
    let multipleFlag = contentTabsList[key - 1]?.multipleFlag || 'N';
    if (multipleFlag !== 'Y' && patSelectType === 'multiple') {
      this.state.patSelectType = 'radio';
      this.state.selectedRows = [];
      this.state.selectedRowKeys = [];
    }
    this.setState({ contentActive: key, multipleFlag });
  };

  // 打开关闭颜色优先级的回调
  modifyColorPriorityFlag = (colorPriorityFlag) => {
    if (colorPriorityFlag === 'Y') {
      document.removeEventListener('mousemove', this.handleVResizeOver);
      document.removeEventListener('mouseup', this.handleStopResize);
    } else {
      document.addEventListener('mousemove', this.handleVResizeOver);
      document.addEventListener('mouseup', this.handleStopResize);
    }
    this.setState({ colorPriorityFlag });
  };

  render() {
    const { leftNum, patQueryActive, selectData, queryParams, patSelectType, tableData, loading, totalWidth, columns, selectedRowKeys, queryHeight, filterSettingsFormData, filterSettingsRowData, leftCardFlag, rowData,
      isShowComponentModal, selectedRows, contentTabsList, contentActive, multipleFlag, colorPriorityFlag
    } = this.state;
    const vCursor = this.isResizing ? 'e-resize' : 'default';

    // 列表多选操作
    let rowSelection = {
      selectedRowKeys,
      onChange: this.handlePatSelectedRowKeysChange,
    };
    return (
      <div
        className="nurse-workstation flex"
        ref={this.NWContainer} // 使用 Ref
        onMouseUp={colorPriorityFlag === 'N' ? this.handleStopResize : null}
        onMouseLeave={colorPriorityFlag === 'N' ? this.handleStopResize : null}
      >
        <div
          style={{
            width: leftNum,
            cursor: this.resizePosition === 'left' ? vCursor : '',
            height: '100%',
            position: 'relative'
          }}
        >
          {!leftCardFlag ? (
            <div className="nurse-workstation-left">
              <Tabs
                activeKey={patQueryActive}
                onChange={this.handlePatQueryTabsChange}
                tabBarExtraContent={(
                  <Tooltip placement="topRight" title="点击隐藏患者列表">
                    <span style={{ paddingRight: '8px' }}>
                      <Icon type="double-left" className="common-card-hide-icon common-card-show-icon" style={{ fontSize: '15px' }} onClick={this.handleCardFlagChange} />
                    </span>
                  </Tooltip>
                )}
              >
                <TabPane tab="出院患者" key="1"></TabPane>
                <TabPane tab="出院患者" key="2"></TabPane>
                <TabPane tab="高级筛选设置" key="3"></TabPane>
              </Tabs>
              <div className="nw-left-query" ref={this.queryRef}>
                {selectData?.locFlag === 'Y' && (
                  <Select
                    allowClear
                    showSearch
                    style={{ width: '100%', marginBottom: '6px' }}
                    value={queryParams?.locID}
                    placeholder="请选择病区"
                    optionFilterProp="search"
                    onChange={(e) => this.handleInputChange(e, 'locID', 'Y')}
                  >
                    {React.$SelectOptions(selectData?.locArr || [])}
                  </Select>
                )}
                <Search
                  allowClear
                  placeholder="床号/住院号/姓名/病人ID"
                  style={{ width: '100%', marginBottom: '6px' }}
                  value={queryParams?.patAlias}
                  onChange={(e) => this.handleInputChange(e.target.value, 'patAlias')}
                  onSearch={this.handleQuery}
                  onPressEnter={this.handleQuery}
                />
                {selectData?.groupFlag === 'Y' && (
                  <Select
                    allowClear
                    showSearch
                    style={{ width: '100%', marginBottom: '6px' }}
                    value={queryParams?.groupID}
                    placeholder="请选择分组"
                    optionFilterProp="search"
                    onChange={(e) => this.handleInputChange(e, 'groupID', 'Y')}
                  >
                    {React.$SelectOptions(selectData?.groupArr || [])}
                  </Select>
                )}
                {selectData?.shortcutFlag === 'Y' && (
                  <Select
                    allowClear
                    showSearch
                    style={{ width: '100%', marginBottom: '6px' }}
                    value={queryParams?.shortcutID}
                    placeholder="请选择快捷"
                    optionFilterProp="search"
                    onChange={(e) => this.handleInputChange(e, 'shortcutID', 'Y')}
                  >
                    {React.$SelectOptions(selectData?.shortcutArr || [])}
                  </Select>
                )}
                {patQueryActive === '2' && (
                  <div style={{ height: '38px', paddingBottom: '6px' }}>
                    <RangeDatePicker
                      label=""
                      width="300px"
                      isChange={true}
                      format={dayFormat}
                      endDate={queryParams?.endDate}
                      startDate={queryParams?.startDate}
                      endChange={(e) => this.handleInputChange(e, 'endDate')}
                      startChange={(e) => this.handleInputChange(e, 'startDate')}
                    />
                  </div>
                )}
              </div>
              <Card
                size="small"
                bordered={false}
                title={(
                  <div style={{ height: '24px' }} className="card-title-left-icon">
                    <div></div>
                    患者列表({tableData?.length || 0}人)
                  </div>
                )}
                extra={(
                  multipleFlag === 'Y' && (
                    <Radio.Group size="small" value={patSelectType} onChange={this.handlePatSelectTypeChange}>
                      <Radio.Button value="multiple">多选</Radio.Button>
                      <Radio.Button value="radio">单选</Radio.Button>
                    </Radio.Group>
                  )
                )}
              >
                <div className="table-body-height">
                  <PublicTablePagination
                    param={{
                      loading,
                      columns, // 表头配置
                      data: tableData, // 表格数据
                      x: totalWidth, // 表格的宽度
                      y: store.getState().tableHeight.y + 88 - queryHeight,
                      componentName: 'NurseWorkstationPatList',
                      height: store.getState().tableHeight.y + 135 - queryHeight + 'px',
                    }}
                    rowSelectionPublic={patSelectType === 'multiple' ? rowSelection : null}
                    getColumns={this.getTableColumns}
                    onClickRowPublic={this.onClickRowPublic}
                    setRowClassNamePublic={this.setRowClassNamePublic}
                  />
                </div>
              </Card>
            </div>
          ) : (
            <Card
              bordered={false}
              style={{ width: '48px', cursor: 'pointer', height: '100%' }}
              className="common-hide-card"
              onClick={this.handleCardFlagChange}
              title={(
                <Tooltip title="展开患者列表">
                  <Icon
                    type="double-right"
                    className="common-card-hide-icon common-card-show-icon"
                  />
                </Tooltip>
              )}>
              <span>展开患者信息查询列表</span>
            </Card>
          )}
          {/* 遮罩层 */}
          <div style={{ display: this.isResizing && this.resizePosition === 'left' ? 'block' : 'none' }} className="bbc-mask"></div>
        </div>
        <div
          draggable={false}
          className="common-v-resize"
          onMouseDown={(e) => this.handleVResizeDown(e, 'left')}
        >
          <div className={this.isResizing && this.resizePosition === 'left' ? 'common-v-resize-hover' : ''}></div>
        </div>
        <div
          style={{
            width: `calc(100% - ${leftNum + 6 + 'px'})`,
            cursor: this.resizePosition === 'left' ? vCursor : '',
            height: '100%',
            position: 'relative'
          }}
        >
          <div className="nurse-workstation-content">
            <div className="nw-content-header flex">
              {selectedRows && selectedRows.length > 0 ? ( // 患者信息多选
                <div className="nw-content-header-multiple">
                  <div style={{ maxWidth: 'calc(100% - 56px)', display: 'inline-block' }} className="ellipsis">
                    {selectedRows && selectedRows.map((item, index) => {
                      return (
                        <Button key={index}>{item?.bedNo || ''} / {item?.patName || ''}</Button>
                      )
                    })}
                  </div>
                  <div style={{ fontSize: '12px', fontWeight: 'normal', color: '#999', display: 'inline-block', width: '56px', textAlign: 'center' }}>
                    共选择<span className="common-number">{selectedRows.length || 0}</span>人
                  </div>
                </div>
              ) : (
                <>
                  <div className="nw-content-left flex-center">
                    <i
                      style={{ fontSize: '28px', color: rowData?.patSexDesc === '男' ? '#007AFF' : '#f759ab' }}
                      className={rowData?.patSexDesc === '男' ? 'iconfont icon-boys' : 'iconfont icon-girl'}
                    ></i>
                  </div>
                  <div className="nw-content-header-center flex">
                    <div className="nw-content-header-center-body flex-wrap-align-items">
                      <div>
                        <span className="nw-content-header-center-body-desc">床号：</span>
                        <span className="nw-content-header-center-body-value common-number">{rowData?.bedNo || '--'}</span>
                      </div>
                      <div>
                        <span className="nw-content-header-center-body-desc">姓名：</span>
                        <span className="nw-content-header-center-body-value">{rowData?.patName || '--'}</span>
                      </div>
                      <div>
                        <span className="nw-content-header-center-body-desc">性别：</span>
                        <span className="nw-content-header-center-body-value">{rowData?.patSexDesc || '--'}</span>
                      </div>
                      <div>
                        <span className="nw-content-header-center-body-desc">年龄：</span>
                        <span className="nw-content-header-center-body-value">{rowData?.patAge || '--'}</span>
                      </div>
                      <div>
                        <span className="nw-content-header-center-body-desc">住院号：</span>
                        <span className="nw-content-header-center-body-value">{rowData?.patMedicalNo || '--'}</span>
                      </div>
                      <div>
                        <span className="nw-content-header-center-body-desc">病人ID：</span>
                        <span className="nw-content-header-center-body-value">{rowData?.patNo || '--'}</span>
                      </div>
                      <div>
                        <span className="nw-content-header-center-body-desc">入院时间：</span>
                        <span className="nw-content-header-center-body-value">
                          {rowData && 'admDateTime' in rowData && rowData.admDateTime ? (
                            <>
                              {rowData?.admDateTime || ''}(<strong className="common-number">{rowData?.admInDays || ''}</strong>天)
                            </>
                          ) : '--'}
                        </span>
                      </div>
                      <div>
                        <span className="nw-content-header-center-body-desc">主诊断：</span>
                        <span style={{ maxWidth: '250px' }} className="nw-content-header-center-body-value ellipsis">
                          <Tooltip title={"胆囊结石伴有急性胆囊炎"}>{rowData?.admDiag || '--'}</Tooltip>
                        </span>
                      </div>
                      <div>
                        <span className="nw-content-header-center-body-desc">护理级别：</span>
                        <span className="nw-content-header-center-body-value">{rowData?.nurseLevel || '--'}</span>
                      </div>
                      <div>
                        <span className="nw-content-header-center-body-desc">责任医生：</span>
                        <span className="nw-content-header-center-body-value">{rowData?.admDocDesc || '--'}</span>
                      </div>
                      <div>
                        <span className="nw-content-header-center-body-desc">责任护士：</span>
                        <span className="nw-content-header-center-body-value">{rowData?.admNurDesc || '--'}</span>
                      </div>
                      <div>
                        <span style={{ width: '82px' }} className="nw-content-header-center-body-desc">总费用(元)：</span>
                        <span className="nw-content-header-center-body-value">{rowData?.fee || '--'}</span>
                      </div>
                      <div>
                        <span style={{ width: '82px' }} className="nw-content-header-center-body-desc">预交金(元)：</span>
                        <span>{rowData?.deposit || '--'}</span>
                      </div>
                      <div>
                        <span className="nw-content-header-center-body-desc">余额(元)：</span>
                        <span>{rowData?.balance || '--'}</span>
                      </div>
                      <div>
                        <span className="nw-content-header-center-body-desc">费别：</span>
                        <span>{rowData?.admReasonDesc || '--'}</span>
                      </div>
                    </div>
                  </div>
                  <div className="nw-content-right flex-center">
                    <Popover
                      trigger="hover"
                      placement="bottomRight"
                      overlayClassName="nw-content-right-popover"
                      content={(
                        <div style={{ position: 'initial' }} className="common-right-menu-wrap">
                          <div className="common-right-menu-option" onClick={this.handleViewPatientCourse}>
                            本次就诊日程
                          </div>
                          <div className="common-right-menu-option" onClick={this.handleHistoryQuery}>
                            历史查询
                          </div>
                          <div className="common-right-menu-option" onClick={this.handleHistoryAssessForm}>
                            历史评估单
                          </div>
                          <div className="common-right-menu-option" onClick={this.handleModifyPatInfo}>
                            修改基本信息
                          </div>
                          <div className="common-right-menu-option" onClick={this.handleHistoryNursingAssessmentForm}>
                            历史护理评估单
                          </div>
                        </div>
                      )}
                    >
                      <Icon style={{ fontSize: '18px' }} type="more" className="common-card-hide-icon common-card-show-icon" />
                    </Popover>
                  </div>
                </>
              )}
            </div>
            <div className="common-query-split-line" style={{ height: '6px' }}></div>
            <div className="nw-content-body">
              <Tabs
                activeKey={contentActive}
                onChange={this.handleContentTabsChange}
              >
                {contentTabsList && contentTabsList.map((item, index) => {
                  return <TabPane
                    key={String(index + 1)}
                    tab={(
                      <Badge dot={item?.dotFlag === 'Y'}>
                        {item?.title || ''}
                      </Badge>
                    )}
                  >
                    <div style={{ padding: '6px 0' }} className="scroll-bar-style">
                      {String(index + 1) === '1' ? (
                        <MedicalOrdersNeedToBeProcessed tableHeight={store.getState().tableHeight.y - 16} />
                      ) : String(index + 1) === '2' ? (
                        <AllMedicalOrders tableHeight={store.getState().tableHeight.y - 16} modifyColorPriorityFlag={this.modifyColorPriorityFlag} />
                      ) : ''}
                    </div>
                  </TabPane>
                })}
              </Tabs>
            </div>
          </div>
          {/* 遮罩层 */}
          <div style={{ display: this.isResizing && this.resizePosition === 'left' ? 'block' : 'none' }} className="bbc-mask"></div>
        </div>

        {/* 高级筛选设置 */}
        <PublicModalFormHooks
          width="460px"
          title="高级筛选设置"
          onRef={ref => this.filterSettingsRef = ref}
          formData={filterSettingsFormData}
          rowData={filterSettingsRowData}
          handleSave={this.handleFilterSettingsSave}
        />

        {/* 历史查询 */}
        <ShowComponentModal
          isShow={isShowComponentModal}
          dataSource={{
            ENDesc: '',
            title: '历史查询',
            component: 'pages/workstation/component/ConsultationHistory.jsx',
          }}
          onHide={() => this.modifyVisible('isShowComponentModal', false)}
        />

        {/* 患者历程 */}
        <PatientCourseInfo
          onRef={ref => this.patConsumeRef = ref}
        />

        {/* 修改病人信息 */}
        <ModificationPatientInfo
          OnChildref={ref => this.modifyPatInfoChild = ref}
          position="fixed"
        />

        {/* 历史护理评估单 */}
        <HistoricalNursingAssessmentForm
          onRef={ref => this.hisNurseAssessRef = ref}
        />
      </div>
    )
  }
};

export default NurseWorkstation;