import 'antd/es/pagination/style';
import _Pagination from 'antd/es/pagination';
import 'antd/es/button/style';
import _Button from 'antd/es/button';
import 'antd/es/modal/style';
import _Modal from 'antd/es/modal';
import { PDFPreview_View } from '@lm_fe/components_m';
import { MyBaseList, mchcModal__, SnapButton } from '@lm_fe/pages';
import React__default, { useState } from 'react';
import { APP_CONFIG } from '@lm_fe/env';
import dayjs from 'dayjs';
import { s as styleInject } from './index.js';
import 'antd/es/tabs/style';
import 'antd/es/tabs';
import 'lodash/size';
import 'lodash/get';
import '@lm_fe/utils';
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 'lodash/assign';
import '@ant-design/icons';
import '@lm_fe/service';
var queryFormDescriptions = {
  name: {
    name: 'name',
    label: '孕妇姓名',
    inputType: 'input',
    filterType: ''
  },
  patientNo: {
    name: 'patientNo',
    label: '就诊卡号',
    inputType: 'input',
    filterType: ''
  },
  reportDate: {
    name: 'reportDate',
    label: '上传日期',
    inputType: 'rangeDate',
    filterType: ''
  },
  title: {
    name: 'title',
    label: '报告名称',
    inputType: 'select',
    filterType: '',
    options: [{
      label: '地中海贫血筛查',
      value: '地中海贫血筛查'
    }, {
      label: '血清铁蛋白',
      value: '血清铁蛋白'
    }, {
      label: '戊型肝炎病毒抗体',
      value: '戊型肝炎病毒抗体'
    }, {
      label: '乙型肝炎病毒抗体',
      value: '乙型肝炎病毒抗体'
    }, {
      label: '其他',
      value: '其他'
    }]
  }
};
var tableColumns = [{
  title: '就诊卡号',
  dataIndex: 'patientNo',
  width: APP_CONFIG.CELL_WIDTH_MIDDLE
}, {
  title: '姓名',
  dataIndex: 'name',
  width: APP_CONFIG.CELL_WIDTH_MIDDLE
}, {
  title: '检查医院',
  dataIndex: 'organization',
  width: APP_CONFIG.CELL_WIDTH_MIDDLE
}, {
  title: '项目类型',
  dataIndex: 'type',
  width: APP_CONFIG.CELL_WIDTH_MIDDLE
}, {
  title: '项目名称',
  dataIndex: 'title',
  width: APP_CONFIG.CELL_WIDTH_MIDDLE
}, {
  title: '上传日期',
  dataIndex: 'reportDate',
  width: APP_CONFIG.CELL_WIDTH_SMALL,
  render: function render(text) {
    return dayjs(text).format('YYYY-MM-DD');
  }
}, {
  title: '操作人',
  dataIndex: 'recorder',
  width: APP_CONFIG.CELL_WIDTH_SMALL
}, {
  title: '结果',
  dataIndex: 'result',
  width: APP_CONFIG.CELL_WIDTH_SMALL
}];
var css_248z = ".custom-outercourt-modal {\n  width: 820px !important;\n  height: 98vh;\n  padding-bottom: 0;\n}\n.custom-outercourt-modal .ant-modal-close-x {\n  width: 39px;\n  height: 39px;\n  line-height: 39px;\n}\n.custom-outercourt-modal .ant-modal-header {\n  padding: 8px 12px;\n}\n.custom-outercourt-modal .ant-modal-content {\n  height: 100%;\n}\n.custom-outercourt-modal .ant-modal-content .ant-modal-body {\n  height: calc(100% - 42px);\n  text-align: center;\n}\n.custom-outercourt-modal .ant-modal-content .img-container {\n  height: calc(100% - 32px);\n  overflow: auto;\n  margin-bottom: 8px;\n}\n.custom-outercourt-modal .ant-modal-content .img-container .hideContent {\n  display: none;\n}\n.custom-outercourt-modal .ant-modal-content .img-container .isShow {\n  display: block;\n}\n.custom-outercourt-modal img {\n  width: 100%;\n}\n";
styleInject(css_248z);
_Modal.error;
var hostUrl = process.env.NODE_ENV === 'production' ? '' : 'http://120.79.170.18:8904';
function Gaopaiyi_List(props) {
  props.type;
  var search = props.search;
  return /*#__PURE__*/React__default.createElement(MyBaseList, {
    showAdd: false,
    showRowEditBtn: false,
    initialSearchValue: search,
    searchParams: {
      sort: 'reportDate,DESC'
    },
    ActionAddonBefore: function ActionAddonBefore(ctx) {
      return /*#__PURE__*/React__default.createElement(_Button, {
        size: "small",
        onClick: function onClick() {
          mchcModal__.open('test', {
            modal_data: {
              content: /*#__PURE__*/React__default.createElement(Render_report, {
                row: ctx.rowData
              })
            }
          });
        }
      }, "\u67E5\u770B");
    },
    RenderBtns: function RenderBtns(ctx) {
      return /*#__PURE__*/React__default.createElement(SnapButton, null);
    },
    name: "/api/outer-reports",
    searchConfig: Object.values(queryFormDescriptions),
    tableColumns: tableColumns
  });
}
function Render_report(props) {
  var _a, _b, _c, _d;
  var row = props.row;
  var _e = useState(1),
    current = _e[0],
    setCurrent = _e[1];
  var pathArr = (_c = (_b = (_a = row.path) === null || _a === void 0 ? void 0 : _a.split) === null || _b === void 0 ? void 0 : _b.call(_a, '`#')) !== null && _c !== void 0 ? _c : [];
  var path = (_d = pathArr.find(function (_, idx) {
    return idx == current - 1;
  })) !== null && _d !== void 0 ? _d : '';
  var node = path.includes('.pdf') ? /*#__PURE__*/React__default.createElement(PDFPreview_View, {
    key: path,
    file: "".concat(hostUrl).concat(path)
  }) : /*#__PURE__*/React__default.createElement("img", {
    width: "100%",
    key: path,
    alt: "out-pic",
    src: "".concat(hostUrl).concat(path)
  });
  return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
    style: {
      marginBottom: 12,
      maxHeight: '80vh',
      overflowY: 'scroll'
    }
  }, node), /*#__PURE__*/React__default.createElement(_Pagination, {
    current: current,
    total: pathArr.length,
    pageSize: 1,
    onChange: function onChange(c) {
      return setCurrent(c);
    },
    style: {
      textAlign: 'center'
    }
  }));
}
export { Gaopaiyi_List as default };
//# sourceMappingURL=prenatal-visit.report.list.js.map
