import { mchcEnv } from '@lm_fe/env';
import { getSearchParamsValue } from '@lm_fe/utils';
import 'antd/es/modal/style';
import _Modal from 'antd/es/modal';
import 'antd/es/button/style';
import _Button from 'antd/es/button';
import { _ as __extends, b as __awaiter, c as __generator } from './index.js';
import { LazyAntd, DatePicker_L } from '@lm_fe/components';
import { getOrderTime } from '@lm_fe/components_m';
import dayjs from 'dayjs';
import React__default, { Component, lazy } from 'react';
function filter_diagnoses(diagnoses) {
  if (!diagnoses) return [];
  var serialNo = getSearchParamsValue('serialNo');
  if (!serialNo) return diagnoses;
  var filterData = mchcEnv.is('广三') ? diagnoses.filter(function (_) {
    if (!_.serialNo) return true;
    return _.serialNo === serialNo;
  }) : diagnoses;
  return diagnoses !== null && diagnoses !== void 0 ? diagnoses : filterData;
}
LazyAntd.Tree;
LazyAntd.TreeSelect;
LazyAntd.Select;
LazyAntd.Table;
LazyAntd.Dropdown;
LazyAntd.Pagination;
var Index$1 = function (_super) {
  __extends(Index, _super);
  function Index() {
    var _this = _super !== null && _super.apply(this, arguments) || this;
    _this.state = {
      menzhenDate: new Date(),
      orderData: null,
      selectList: ['本周五', '下周五', '下下周五'],
      hasAppointment: false
    };
    _this.handleDateChange = function (date, dateString) {
      _this.setState({
        menzhenDate: dateString
      });
    };
    _this.handleTimeSelect = function (v) {
      _this.setState({
        menzhenDate: getOrderTime(v)
      });
    };
    _this.handleCancel = function () {
      var closeModal = _this.props.closeModal;
      closeModal('isShowMenzhen');
    };
    _this.handleOk = function () {
      var closeModal = _this.props.closeModal;
      var menzhenDate = _this.state.menzhenDate;
      closeModal('isShowMenzhen', "\u7CD6\u5C3F\u75C5\u65E5\u95F4\u95E8\u8BCA(".concat(dayjs(menzhenDate).format('YYYY-MM-DD'), ")"), 'prescription');
    };
    _this.buttons = function () {
      var hasAppointment = _this.state.hasAppointment;
      return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(_Button, {
        onClick: _this.handleCancel
      }, "\u53D6\u6D88"), /*#__PURE__*/React__default.createElement(_Button, {
        type: "primary",
        onClick: _this.handleOk
      }, hasAppointment ? '改期' : '确定'));
    };
    return _this;
  }
  Index.prototype.componentDidMount = function () {
    return __awaiter(this, void 0, void 0, function () {
      return __generator(this, function (_a) {
        return [2];
      });
    });
  };
  Index.prototype.render = function () {
    var _this = this;
    var isShowMenzhen = this.props.isShowMenzhen;
    var _a = this.state,
      menzhenDate = _a.menzhenDate;
    _a.selectList;
    _a.orderData;
    return /*#__PURE__*/React__default.createElement(_Modal, {
      visible: isShowMenzhen,
      onCancel: this.handleCancel,
      footer: this.buttons(),
      title: /*#__PURE__*/React__default.createElement("span", null, "\u7CD6\u5C3F\u75C5\u65E5\u95F4\u95E8\u8BCA\u9884\u7EA6")
    }, /*#__PURE__*/React__default.createElement("span", null, "\u9884\u7EA6\u65F6\u95F4"), /*#__PURE__*/React__default.createElement(DatePicker_L, {
      allowClear: false,
      value: dayjs(menzhenDate),
      onChange: function onChange(date, dateString) {
        return _this.handleDateChange(date, dateString);
      }
    }));
  };
  return Index;
}(Component);
function Index(props) {
  var changePreventPreeclampsia = props.changePreventPreeclampsia,
    closeModal = props.closeModal,
    isShowPreventPreeclampsia = props.isShowPreventPreeclampsia;
  var handleCancel = function handleCancel() {
    changePreventPreeclampsia(false);
  };
  var handleOk = function handleOk() {
    closeModal('', '阿司匹林', 'prescription');
    changePreventPreeclampsia(false);
  };
  return /*#__PURE__*/React__default.createElement(_Modal, {
    title: "\u8BF7\u6CE8\u610F\uFF01",
    className: "diag-reminder-wrapper",
    visible: isShowPreventPreeclampsia,
    onCancel: handleCancel,
    onOk: handleOk
  }, /*#__PURE__*/React__default.createElement("p", null, "\u662F\u5426\u4F7F\u7528 \u201C\u963F\u53F8\u5339\u6797\u201D \u9884\u9632\u5B50\u75EB\u524D\u671F"));
}
var Inner = /*#__PURE__*/lazy(function () {
  return import('./prenatal-visit.pregnancy.doctor-end13.js');
});
function ManagementPlan(props) {
  return /*#__PURE__*/React__default.createElement(Inner, props);
}
export { Index$1 as I, ManagementPlan as M, Index as a, filter_diagnoses as f };
//# sourceMappingURL=index2.js.map
