import { b as __awaiter, c as __generator } from './index.js';
import { OkButton } from '@lm_fe/components_m';
import { BF_Wrap2, MyBaseList } from '@lm_fe/pages';
import { downloadFile, formatDate, request } from '@lm_fe/utils';
import React__default from 'react';
import '@lm_fe/env';
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 'antd/es/button/style';
import 'antd/es/button';
import 'lodash/assign';
import '@ant-design/icons';
import '@lm_fe/service';
function Archive(props) {
  var _this = this;
  var _a = BF_Wrap2({
      default_conf: {
        title: '统计管理-建档统计',
        tableColumns: function tableColumns() {
          return import('./statistics.archives.list2.js');
        },
        searchConfig: function searchConfig() {
          return import('./statistics.archives.list3.js');
        },
        name: '/api/pregnancies',
        showAction: 0,
        showAdd: 0
      }
    }),
    config = _a.config,
    Wrap = _a.Wrap;
  return /*#__PURE__*/React__default.createElement(Wrap, null, /*#__PURE__*/React__default.createElement(MyBaseList, {
    showAdd: !!(config === null || config === void 0 ? void 0 : config.showAdd),
    showAction: !!(config === null || config === void 0 ? void 0 : config.showAction),
    name: config === null || config === void 0 ? void 0 : config.name,
    tableColumns: __DEV__ ? function () {
      return import('./statistics.archives.list2.js');
    } : config === null || config === void 0 ? void 0 : config.tableColumns,
    searchConfig: config === null || config === void 0 ? void 0 : config.searchConfig,
    RenderBtns: function RenderBtns(ctx) {
      return /*#__PURE__*/React__default.createElement(OkButton, {
        onClick: function onClick(e) {
          return __awaiter(_this, void 0, void 0, function () {
            var res;
            return __generator(this, function (_a) {
              switch (_a.label) {
                case 0:
                  return [4, request.get('/api/pregnancies/createPregnancyExport', {
                    params: ctx.getSearchParams(),
                    responseType: 'blob'
                  })];
                case 1:
                  res = _a.sent();
                  downloadFile(res.data, "\u5EFA\u6863\u7EDF\u8BA1\u8868".concat(formatDate(), ".xls"), 'application/vnd.ms-excel');
                  return [2];
              }
            });
          });
        }
      }, "\u5BFC\u51FA");
    }
  }));
}
export { Archive as default };
//# sourceMappingURL=statistics.archives.list.js.map
