import 'antd/es/space/style';
import _Space from 'antd/es/space';
import 'antd/es/button/style';
import _Button from 'antd/es/button';
import 'antd/es/form/style';
import _Form from 'antd/es/form';
import { d as __assign } from './index.js';
import { SimpleForm } from '@lm_fe/components';
import { SZsy_CtgRecord } from '@lm_fe/service';
import React__default, { useState, useEffect } from 'react';
import { H as HistoryTable } from './HistoryTable.js';
import '@lm_fe/pages';
import '@lm_fe/env';
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 '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/components_m';
import 'antd/es/table/style';
import 'antd/es/table';
import 'antd/es/tag/style';
import 'antd/es/tag';
function Test(props) {
  var _a = useState([]),
    state = _a[0],
    setState = _a[1];
  var _b = useState([]);
  _b[0];
  _b[1];
  var _c = useState(false),
    loading = _c[0],
    setLoading = _c[1];
  var _d = useState(0);
  _d[0];
  _d[1];
  var _e = useState();
  _e[0];
  _e[1];
  var _f = useState({
      pageCurrent: 1
    }),
    searchParams = _f[0],
    setSearchParams = _f[1];
  var _g = useState(0),
    total = _g[0],
    setTotal = _g[1];
  var limit = 12;
  var _h = useState(false);
  _h[0];
  _h[1];
  var form = _Form.useForm()[0];
  function fetchData() {
    setLoading(true);
    SZsy_CtgRecord.findRecordsPage(__assign({
      pageSize: limit
    }, searchParams)).then(function (r) {
      var totalRow = r.totalRow;
      r.pageSize;
      var list = r.list;
      setTotal(totalRow);
      setState(list);
      setTimeout(function () {
        return setLoading(false);
      }, 400);
    });
  }
  useEffect(function () {
    fetchData();
  }, [searchParams]);
  return /*#__PURE__*/React__default.createElement("div", {
    className: "site-layout-background",
    style: {
      padding: 12,
      overflowY: 'scroll',
      background: '#fff'
    }
  }, /*#__PURE__*/React__default.createElement(SimpleForm, {
    form: form,
    onValuesChange: function onValuesChange(a, b) {
      setSearchParams(__assign(__assign(__assign({}, searchParams), {
        pageCurrent: 1
      }), b));
    },
    blocks: [{
      title: '搜索条件',
      rows: [{
        itemsInRow: [{
          type: 'Input',
          outerOptions: {
            name: 'name',
            label: '姓名'
          },
          innerOptions: {}
        }, {
          type: 'DatePicker',
          outerOptions: {
            name: 'startDate',
            label: '开始时间'
          },
          innerOptions: {}
        }, {
          type: 'DatePicker',
          outerOptions: {
            name: 'endDate',
            label: '结束时间'
          },
          innerOptions: {}
        }, {
          type: 'Select',
          outerOptions: {
            name: 'state',
            label: '判图'
          },
          innerOptions: {
            options: [{
              value: 0,
              label: '否'
            }, {
              value: 1,
              label: '是'
            }]
          }
        }],
        layoutType: 6
      }]
    }]
  }), /*#__PURE__*/React__default.createElement("div", {
    style: {
      display: 'flex',
      justifyContent: 'flex-end',
      marginTop: 12
    }
  }, /*#__PURE__*/React__default.createElement(_Space, {
    style: {}
  }, /*#__PURE__*/React__default.createElement(_Button, {
    type: "primary",
    style: {
      padding: '0 24px'
    },
    onClick: function onClick(e) {
      form.resetFields();
      setSearchParams({
        pageCurrent: 1
      });
    }
  }, "\u91CD\u7F6E"), /*#__PURE__*/React__default.createElement(_Button, {
    type: "primary",
    style: {
      padding: '0 24px'
    },
    onClick: function onClick(e) {
      fetchData();
    }
  }, "\u67E5\u8BE2"))), /*#__PURE__*/React__default.createElement(HistoryTable, {
    loading: loading,
    pagination: {
      current: searchParams.pageCurrent,
      pageSize: limit,
      total: total,
      showSizeChanger: false,
      onChange: function onChange(page) {
        setSearchParams(__assign(__assign({}, searchParams), {
          pageCurrent: page
        }));
      }
    },
    dataSource: state
  }));
}
export { Test as default };
//# sourceMappingURL=src.pages.fetal-custom-analyse-list2.js.map
