import _get from 'lodash/get';
import { _ as __extends, b as __awaiter, c as __generator } from './index.js';
import React__default from 'react';
import { BaseTableOld, BaseListOld, PanelWithChild } from '@lm_fe/components_m';
import { mchcEnv } from '@lm_fe/env';
import { SLocal_History } from '@lm_fe/service';
import { getSearchParamsValue, request } from '@lm_fe/utils';
import 'antd/es/tabs/style';
import 'antd/es/tabs';
import 'lodash/size';
import 'lodash/orderBy';
import 'lodash/map';
import '@lm_fe/components';
import 'antd/es/collapse/style';
import 'antd/es/collapse';
import 'antd/es/badge/style';
import 'antd/es/badge';
import 'antd/es/button/style';
import 'antd/es/button';
import 'lodash/assign';
import '@ant-design/icons';
import '@lm_fe/pages';
var ProductsTable = function (_super) {
  __extends(ProductsTable, _super);
  function ProductsTable() {
    return _super !== null && _super.apply(this, arguments) || this;
  }
  return ProductsTable;
}(BaseTableOld);
var tableColumns_建瓯 = [{
  title: '检查日期',
  dataIndex: 'visitDate',
  align: 'center'
}, {
  title: '检查人',
  dataIndex: 'doctorName',
  align: 'center'
}, {
  align: 'center',
  "dataIndex": "advice",
  "title": "保健指导"
}, {
  "dataIndex": "treatmentRecords",
  align: 'center',
  "title": "治疗记录"
}];
var tableColumns = [{
  title: '检查类型',
  dataIndex: 'visitType',
  align: 'center'
}, {
  title: '检查流水号',
  dataIndex: 'serialNo',
  align: 'center'
}, {
  title: '检查日期',
  dataIndex: 'visitDate',
  align: 'center'
}, {
  title: '主诉',
  dataIndex: 'chiefcomplaint',
  align: 'center'
}, {
  title: '诊断',
  dataIndex: 'diagnosis',
  align: 'center'
}, {
  title: '诊断编码',
  dataIndex: 'diagnosisCode',
  align: 'center'
}, {
  title: '检查结果',
  dataIndex: 'result',
  align: 'center'
}, {
  title: '处理意见',
  dataIndex: 'advice',
  align: 'center'
}, {
  title: '医生',
  dataIndex: 'doctor',
  align: 'center'
}];
function get_tableColumns() {
  if (mchcEnv.is('建瓯')) {
    return tableColumns_建瓯;
  }
  return tableColumns;
}
var List$1 = function (_super) {
  __extends(List, _super);
  function List() {
    var _this = _super !== null && _super.apply(this, arguments) || this;
    _this.staticDefaultQuery = {
      page: 0,
      size: 20
    };
    _this.handleAdd = function () {
      return __awaiter(_this, void 0, void 0, function () {
        var patientId;
        return __generator(this, function (_a) {
          patientId = this.props.id;
          this.props.updateWomenExamRecordsEditingId;
          this.props.history;
          SLocal_History.safe_history_push("/gynecological-diseases/women/women-exam-records/add?patientId=".concat(patientId), this.props);
          return [2];
        });
      });
    };
    _this.handleEdit = function (rowData) {
      return function () {
        var id = rowData.id;
        _this.props.history;
        SLocal_History.safe_history_push("/gynecological-diseases/women/women-exam-records/edit?id=".concat(id), _this.props);
      };
    };
    return _this;
  }
  List.defaultProps = {
    baseUrl: '/api/gynecological-visits',
    baseTitle: '妇女检查记录',
    needPagination: true,
    showQuery: false,
    showAdd: true,
    showAction: true,
    tableColumns: get_tableColumns(),
    rowKey: 'id',
    Table: ProductsTable
  };
  return List;
}(BaseListOld);
var List = function (_super) {
  __extends(List, _super);
  function List() {
    var _this = _super !== null && _super.apply(this, arguments) || this;
    _this.state = {
      data: {}
    };
    _this.renderHeader = function () {
      var data = _this.state.data;
      return /*#__PURE__*/React__default.createElement("div", {
        className: PanelWithChild.styles["panel-with-child_header"]
      }, /*#__PURE__*/React__default.createElement("div", {
        className: PanelWithChild.styles["panel-with-child_header-item"]
      }, /*#__PURE__*/React__default.createElement("span", {
        className: PanelWithChild.styles["panel-with-child_header-item-label"]
      }, "\u59D3\u540D:"), /*#__PURE__*/React__default.createElement("span", {
        className: PanelWithChild.styles["panel-with-child_header-item-value"]
      }, _get(data, 'name'))), /*#__PURE__*/React__default.createElement("div", {
        className: PanelWithChild.styles["panel-with-child_header-item"]
      }, /*#__PURE__*/React__default.createElement("span", {
        className: PanelWithChild.styles["panel-with-child_header-item-label"]
      }, "\u5E74\u9F84:"), /*#__PURE__*/React__default.createElement("span", {
        className: PanelWithChild.styles["panel-with-child_header-item-value"]
      }, _get(data, 'age'))), /*#__PURE__*/React__default.createElement("div", {
        className: PanelWithChild.styles["panel-with-child_header-secend-item"]
      }, /*#__PURE__*/React__default.createElement("span", {
        className: PanelWithChild.styles["panel-with-child_header-secend-item-label"]
      }, "\u95E8\u8BCA\u53F7:"), /*#__PURE__*/React__default.createElement("span", {
        className: PanelWithChild.styles["panel-with-child_header-secend-item-value"]
      }, _get(data, 'outpatientNO'))));
    };
    _this.renderContent = function () {
      var id = getSearchParamsValue('id');
      return /*#__PURE__*/React__default.createElement(List$1, {
        asChildComponentQueryLabel: "gynecologicalPatientId.equals",
        id: id
      });
    };
    return _this;
  }
  List.prototype.componentDidMount = function () {
    return __awaiter(this, void 0, void 0, function () {
      var id, data;
      return __generator(this, function (_a) {
        switch (_a.label) {
          case 0:
            id = getSearchParamsValue('id');
            return [4, request.get("/api/gynecological-patients/".concat(id))];
          case 1:
            data = _a.sent().data;
            this.setState({
              data: data
            });
            return [2];
        }
      });
    });
  };
  return List;
}(PanelWithChild);
export { List as default };
//# sourceMappingURL=gynecological-diseases.women.women-exam-records.js.map
