import 'antd/es/button/style';
import _Button from 'antd/es/button';
import 'antd/es/message/style';
import _message from 'antd/es/message';
import { b as __awaiter, c as __generator } from './index.js';
import { MyBaseList } from '@lm_fe/pages';
import { mchcEnv } from '@lm_fe/env';
import { getMomentRange, formatDate, request } from '@lm_fe/utils';
import { HighriskGradeDisplay } from '@lm_fe/components_m';
import React__default from 'react';
import 'antd/es/tabs/style';
import 'antd/es/tabs';
import 'lodash/size';
import 'lodash/get';
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';
function BreastCancerDataReport(prop) {
  var _this = this;
  return /*#__PURE__*/React__default.createElement(MyBaseList, {
    name: "/api/prenatal-visits/upload-logs",
    searchParams: {
      'visitType.equals': 0
    },
    needChecked: true,
    useListSourceCount: true,
    initialSearchValue: {
      validateDate: getMomentRange().近一周.map(formatDate)
    },
    searchConfig: [{
      label: '检查日期',
      name: 'visitDate',
      inputType: 'rangeDate'
    }, {
      label: '就诊卡号',
      name: 'outpatientNO',
      inputType: 'Input'
    }, {
      label: '姓名',
      name: 'name',
      inputType: 'Input'
    }, {
      label: '上报状态',
      name: 'uploadState',
      inputType: 'MS',
      inputProps: {
        optionKey: '上报状态'
      }
    }],
    showAction: false,
    showAdd: false,
    RenderBtns: function RenderBtns(ctx) {
      var selectRows = ctx.getCheckRows();
      return /*#__PURE__*/React__default.createElement(_Button, {
        disabled: !selectRows.length,
        onClick: function onClick() {
          return __awaiter(_this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
              switch (_a.label) {
                case 0:
                  return [4, request.post('/api/dataReport/reportIvisit', {
                    ids: selectRows.map(function (_) {
                      return _.id;
                    })
                  })];
                case 1:
                  res = _a.sent();
                  _message.success(res.data);
                  ctx.handleSearch();
                  return [2];
              }
            });
          });
        }
      }, "\u4E0A\u62A5");
    },
    tableColumns: [{
      title: '检查日期',
      dataIndex: 'visitDate'
    }, {
      title: '姓名',
      dataIndex: 'name'
    }, {
      title: '就诊卡号',
      dataIndex: 'outpatientNO'
    }, {
      title: '身份证号',
      dataIndex: 'idNO'
    }, {
      title: '审核人',
      dataIndex: 'auditorName'
    }, {
      label: '记录医生',
      name: 'doctorName',
      hidden: !mchcEnv["in"](['郫都'])
    }, {
      title: '高危等级颜色',
      dataIndex: 'pregnancy.highriskGrade',
      render: function render(value) {
        return /*#__PURE__*/React__default.createElement(HighriskGradeDisplay, {
          type: "highriskGrade",
          data: value
        });
      },
      hidden: !mchcEnv["in"](['郫都'])
    }, {
      title: '上报状态',
      dataIndex: 'uploadState',
      inputType: 'MS',
      inputProps: {
        optionKey: '上报状态',
        marshal: 0
      }
    }, {
      title: '上报说明',
      dataIndex: 'uploadMsg'
    }, {
      title: '上报时间',
      dataIndex: 'uploadDate'
    }]
  });
}
export { BreastCancerDataReport as default };
//# sourceMappingURL=pages.data-report.first-visit.js.map
