import 'antd/es/spin/style';
import _Spin from 'antd/es/spin';
import 'antd/es/pagination/style';
import _Pagination from 'antd/es/pagination';
import 'antd/es/empty/style';
import _Empty from 'antd/es/empty';
import 'antd/es/menu/style';
import _Menu from 'antd/es/menu';
import 'antd/es/divider/style';
import _Divider from 'antd/es/divider';
import 'antd/es/button/style';
import _Button from 'antd/es/button';
import 'antd/es/form/style';
import _Form from 'antd/es/form';
import 'antd/es/layout/style';
import _Layout from 'antd/es/layout';
import { s as styleInject, d as __assign, f as __rest, b as __awaiter, c as __generator } from './index.js';
import { LazyAntd, SimpleForm } from '@lm_fe/components';
import { mchcEvent, mchcLogger } from '@lm_fe/env';
import { SZsy_CtgRecord } from '@lm_fe/service';
import { event, request, getSearchParamsValue, getSearchParamsAll, formatDate } from '@lm_fe/utils';
import React__default, { useState, useCallback, useEffect } from 'react';
import 'antd/es/modal/style';
import _Modal from 'antd/es/modal';
import 'antd/es/space/style';
import _Space from 'antd/es/space';
import 'antd/es/checkbox/style';
import _Checkbox from 'antd/es/checkbox';
import 'antd/es/input/style';
import _Input from 'antd/es/input';
import 'antd/es/input-number/style';
import _InputNumber from 'antd/es/input-number';
import 'antd/es/message/style';
import _message from 'antd/es/message';
import { _ as _extends } from './extends.js';
import { mchcModal__ } from '@lm_fe/pages';
import { H as HistoryTable } from './HistoryTable.js';
import 'antd/es/tabs/style';
import 'antd/es/tabs';
import 'lodash/size';
import 'lodash/get';
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';
var css_248z = ":global(.ant-carousel .slick-prev,\n    .ant-carousel .slick-next,\n    .ant-carousel .slick-prev:hover,\n    .ant-carousel .slick-next:hover) {\n  font-size: inherit;\n  color: red;\n  background: yellow;\n}\n";
styleInject(css_248z);
function inRange(value, min, max) {
  var v = typeof value === 'string' ? Number(value) : value;
  var result = false;
  if (v >= min && v <= max) result = true;
  return result;
}
function getValue(v) {
  var a = String(v);
  var modified = a.startsWith('00');
  return modified ? Number.parseInt(a) : false;
}
function isModified(v) {
  return typeof v === 'number';
}
var emptyValue = {
  Sogc: {
    bhrscore: null,
    ltvvalue: null,
    ltvscore: null,
    accscore: null,
    accvalue: null,
    bhrvalue: null,
    decscore: null,
    decvalue: null,
    total: null,
    result: ''
  },
  Nst: {
    bhrscore: null,
    ltvscore: null,
    accdurationscore: null,
    accamplscore: null,
    fmscore: null,
    total: null,
    bhrvalue: null,
    ltvvalue: null,
    accdurationvalue: null,
    accamplvalue: null,
    fmvalue: null
  },
  Krebs: {
    ltvvalue: null,
    total: null,
    bhrscore: null,
    ltvscore: null,
    stvscore: null,
    accscore: null,
    decscore: null,
    fmscore: null,
    bhrvalue: null,
    ltvalue: null,
    stvvalue: null,
    accvalue: null,
    decvalue: '',
    fmvalue: null
  },
  Fischer: {
    ltvvalue: null,
    bhrscore: null,
    ltvscore: null,
    stvscore: null,
    accscore: null,
    decscore: null,
    total: null,
    bhrvalue: null,
    ltvalue: null,
    stvvalue: null,
    accvalue: null,
    decvalue: ''
  },
  Cstoct: {
    ldvalue: null,
    ldscore: null,
    vdscore: null,
    vdvalue: null,
    edscore: null,
    edvalue: null,
    bhrscore: null,
    ltvvalue: null,
    ltvscore: null,
    accscore: null,
    accvalue: null,
    bhrvalue: null,
    decscore: null,
    decvalue: null,
    sinusoidscore: null,
    sinusoidvalue: null,
    total: null,
    result: ''
  },
  Cst: {
    bhrscore: null,
    ltvvalue: null,
    ltvscore: null,
    stvscore: null,
    stvvalue: null,
    accscore: null,
    accvalue: null,
    bhrvalue: null,
    decscore: null,
    decvalue: null,
    total: null
  }
};
function Cst(_data) {
  var cstdata = JSON.parse(JSON.stringify(_data));
  var _a = cstdata,
    bhrvalue = _a.bhrvalue,
    ltvvalue = _a.ltvvalue,
    stvvalue = _a.stvvalue,
    accvalue = _a.accvalue,
    decvalue = _a.decvalue;
  var bhr = Number(bhrvalue) || 0;
  var zhenfu_tv = Number(ltvvalue) || 0;
  var zhouqi_tv = Number(stvvalue) || 0;
  var accnum = getValue(accvalue);
  var decnum = getValue(decvalue);
  if (bhr < 100 || bhr > 180) {
    cstdata.bhrscore = 0;
  } else if (inRange(bhr, 100, 109) || inRange(bhr, 161, 180)) {
    cstdata.bhrscore = 1;
  } else if (inRange(bhr, 110, 160)) {
    cstdata.bhrscore = 2;
  }
  if (zhenfu_tv < 5) {
    cstdata.ltvscore = 0;
  } else if (inRange(zhenfu_tv, 5, 9) || zhenfu_tv > 30) {
    cstdata.ltvscore = 1;
  } else if (inRange(zhenfu_tv, 10, 30)) {
    cstdata.ltvscore = 2;
  }
  if (zhouqi_tv < 3) {
    cstdata.stvscore = 0;
  } else if (inRange(zhouqi_tv, 3, 6)) {
    cstdata.stvscore = 1;
  } else if (zhouqi_tv > 6) {
    cstdata.stvscore = 2;
  }
  if (isModified(accnum)) {
    cstdata.accscore = accnum;
  }
  if (isModified(decnum)) {
    cstdata.decscore = decnum;
  }
  cstdata.total = cstdata.bhrscore + cstdata.accscore + cstdata.decscore + cstdata.ltvscore + cstdata.stvscore;
  return cstdata;
}
function Cstoct(_data) {
  var cstoctdata = JSON.parse(JSON.stringify(_data));
  if (!cstoctdata) return;
  var bhrvalue = cstoctdata.bhrvalue,
    accvalue = cstoctdata.accvalue,
    sinusoidvalue = cstoctdata.sinusoidvalue,
    ldvalue = cstoctdata.ldvalue,
    ltvvalue = cstoctdata.ltvvalue,
    edvalue = cstoctdata.edvalue,
    vdvalue = cstoctdata.vdvalue;
  var bhr = getValue(bhrvalue);
  var acc = getValue(accvalue);
  var ltv = getValue(ltvvalue);
  var sinusoid = getValue(sinusoidvalue);
  var ld = getValue(ldvalue);
  var ed = getValue(edvalue);
  var vd = getValue(vdvalue);
  if (isModified(bhr)) {
    cstoctdata.bhrscore = bhr;
  }
  if (isModified(ltv)) {
    cstoctdata.ltvscore = ltv;
  }
  if (isModified(sinusoid)) {
    cstoctdata.sinusoidscore = sinusoid;
  }
  if (isModified(acc)) {
    cstoctdata.accscore = acc;
  }
  if (isModified(ed)) {
    cstoctdata.edscore = ed;
  }
  if (isModified(ld)) {
    cstoctdata.ldscore = ld;
  }
  if (isModified(vd)) {
    cstoctdata.vdscore = vd;
  }
  var bhrscore = cstoctdata.bhrscore,
    accscore = cstoctdata.accscore,
    sinusoidscore = cstoctdata.sinusoidscore,
    ltvscore = cstoctdata.ltvscore,
    ldscore = cstoctdata.ldscore,
    edscore = cstoctdata.edscore,
    vdscore = cstoctdata.vdscore;
  var all = [bhrscore, accscore, sinusoidscore, ltvscore, ldscore, edscore, vdscore];
  cstoctdata.result = '正常';
  if (all.some(function (_) {
    return _ === 2;
  })) {
    cstoctdata.result = '异常';
  } else if (all.some(function (_) {
    return _ === 1;
  })) {
    cstoctdata.result = '可疑';
  } else if (all.some(function (_) {
    return _ === 3;
  })) {
    cstoctdata.result = '时长不足';
  }
  return cstoctdata;
}
function Fischer(_data) {
  var fischerdata = JSON.parse(JSON.stringify(_data));
  var bhrvalue = fischerdata.bhrvalue,
    ltvvalue = fischerdata.ltvvalue,
    stvvalue = fischerdata.stvvalue,
    accvalue = fischerdata.accvalue,
    decvalue = fischerdata.decvalue;
  var bhr = Number(bhrvalue) || 0;
  var zhenfu_tv = Number(ltvvalue) || 0;
  var zhouqi_tv = Number(stvvalue) || 0;
  var accnum = Number(accvalue) || 0;
  var decnum = getValue(decvalue);
  if (bhr < 100 || bhr > 180) {
    fischerdata.bhrscore = 0;
  } else if (inRange(bhr, 100, 109) || inRange(bhr, 161, 180)) {
    fischerdata.bhrscore = 1;
  } else if (inRange(bhr, 110, 160)) {
    fischerdata.bhrscore = 2;
  }
  if (zhenfu_tv < 5) {
    fischerdata.ltvscore = 0;
  } else if (inRange(zhenfu_tv, 5, 9) || zhenfu_tv > 30) {
    fischerdata.ltvscore = 1;
  } else if (inRange(zhenfu_tv, 10, 30)) {
    fischerdata.ltvscore = 2;
  }
  fischerdata.stvvalue = zhouqi_tv;
  if (zhouqi_tv < 3) {
    fischerdata.stvscore = 0;
  } else if (inRange(zhouqi_tv, 3, 6)) {
    fischerdata.stvscore = 1;
  } else if (zhouqi_tv > 6) {
    fischerdata.stvscore = 2;
  }
  if (accnum == 0) {
    fischerdata.accscore = 0;
  } else if (inRange(accnum, 1, 4)) {
    fischerdata.accscore = 1;
  } else if (accnum > 4) {
    fischerdata.accscore = 2;
  }
  if (isModified(decnum)) {
    fischerdata.decscore = decnum;
  }
  fischerdata.total = fischerdata.bhrscore + fischerdata.accscore + fischerdata.decscore + fischerdata.ltvscore + fischerdata.stvscore;
  return fischerdata;
}
function Krebs(_data) {
  var krebsdata = JSON.parse(JSON.stringify(_data));
  if (!krebsdata) return;
  var bhrvalue = krebsdata.bhrvalue,
    ltvvalue = krebsdata.ltvvalue,
    stvvalue = krebsdata.stvvalue,
    accvalue = krebsdata.accvalue,
    decvalue = krebsdata.decvalue,
    fmvalue = krebsdata.fmvalue;
  var bhr = Number(bhrvalue) || 0;
  var zhenfu_tv = Number(ltvvalue) || 0;
  var zhouqi_tv = Number(stvvalue) || 0;
  var accnum = Number(accvalue) || 0;
  var decnum = Number(decvalue) || 0;
  var fmnum = Number(fmvalue) || 0;
  krebsdata.bhrvalue = bhr;
  if (bhr < 100 || bhr > 180) {
    krebsdata.bhrscore = 0;
  } else if (inRange(bhr, 100, 109) || inRange(bhr, 161, 180)) {
    krebsdata.bhrscore = 1;
  } else if (inRange(bhr, 110, 160)) {
    krebsdata.bhrscore = 2;
  }
  krebsdata.ltvvalue = zhenfu_tv;
  if (zhenfu_tv < 5) {
    krebsdata.ltvscore = 0;
  } else if (inRange(zhenfu_tv, 5, 9) || zhenfu_tv > 25) {
    krebsdata.ltvscore = 1;
  } else if (inRange(zhenfu_tv, 10, 25)) {
    krebsdata.ltvscore = 2;
  }
  krebsdata.stvvalue = zhouqi_tv;
  if (zhouqi_tv < 3) {
    krebsdata.stvscore = 0;
  } else if (inRange(zhouqi_tv, 3, 6)) {
    krebsdata.stvscore = 1;
  } else if (zhouqi_tv > 6) {
    krebsdata.stvscore = 2;
  }
  krebsdata.accvalue = accnum;
  if (accnum == 0) {
    krebsdata.accscore = 0;
  } else if (inRange(accnum, 1, 4)) {
    krebsdata.accscore = 1;
  } else if (accnum > 4) {
    krebsdata.accscore = 2;
  }
  if (decnum >= 2) {
    krebsdata.decscore = 0;
  } else if (decnum == 1) {
    krebsdata.decscore = 1;
  } else {
    krebsdata.decscore = 2;
  }
  if (fmnum == 0) {
    krebsdata.fmscore = 0;
  } else if (inRange(fmnum, 1, 4)) {
    krebsdata.fmscore = 1;
  } else if (fmnum > 4) {
    krebsdata.fmscore = 2;
  }
  krebsdata.total = krebsdata.bhrscore + krebsdata.accscore + krebsdata.decscore + krebsdata.ltvscore + krebsdata.stvscore + krebsdata.fmscore;
  return krebsdata;
}
function Nst(_data) {
  var nstdata = JSON.parse(JSON.stringify(_data));
  var bhrvalue = nstdata.bhrvalue,
    ltvvalue = nstdata.ltvvalue,
    accdurationvalue = nstdata.accdurationvalue,
    accamplvalue = nstdata.accamplvalue,
    fmvalue = nstdata.fmvalue;
  var bhr = Number(bhrvalue) || 0;
  var ltv = Number(ltvvalue) || 0;
  var fhr_uptime = Number(accdurationvalue) || 0;
  var fhr_ampl = Number(accamplvalue) || 0;
  var fmnum = Number(fmvalue);
  if (bhr < 100) nstdata.bhrscore = 0;else if (inRange(bhr, 100, 109) || bhr > 160) nstdata.bhrscore = 1;else if (inRange(bhr, 110, 160)) {
    nstdata.bhrscore = 2;
  }
  if (ltv < 5) {
    nstdata.ltvscore = 0;
  } else if (inRange(ltv, 5, 9) || ltv > 30) {
    nstdata.ltvscore = 1;
  } else if (inRange(ltv, 10, 30)) {
    nstdata.ltvscore = 2;
  }
  if (fhr_uptime < 10) {
    nstdata.accdurationscore = 0;
  } else if (inRange(fhr_uptime, 10, 14)) {
    nstdata.accdurationscore = 1;
  } else if (fhr_uptime >= 15) {
    nstdata.accdurationscore = 2;
  }
  if (fhr_ampl < 10) {
    nstdata.accamplscore = 0;
  } else if (inRange(fhr_ampl, 10, 14)) {
    nstdata.accamplscore = 1;
  } else if (fhr_ampl >= 15) {
    nstdata.accamplscore = 2;
  }
  if (!Number.isNaN(fmnum)) {
    nstdata.fmvalue = fmnum;
    if (fmnum == 0) {
      nstdata.fmscore = 0;
    } else if (inRange(fmnum, 1, 2)) {
      nstdata.fmscore = 1;
    } else if (fmnum >= 3) {
      nstdata.fmscore = 2;
    }
  }
  nstdata.total = nstdata.accamplscore + nstdata.accdurationscore + nstdata.bhrscore + nstdata.fmscore + nstdata.ltvscore;
  return nstdata;
}
function Sogc(_data) {
  var sogcdata = JSON.parse(JSON.stringify(_data));
  var bhrvalue = sogcdata.bhrvalue,
    accvalue = sogcdata.accvalue,
    decvalue = sogcdata.decvalue,
    ltvvalue = sogcdata.ltvvalue;
  var bhr = getValue(bhrvalue);
  var acc = getValue(accvalue);
  var dec = getValue(decvalue);
  var ltv = getValue(ltvvalue);
  if (isModified(bhr)) {
    sogcdata.bhrscore = bhr;
  }
  if (isModified(ltv)) {
    sogcdata.ltvscore = ltv;
  }
  if (isModified(acc)) {
    sogcdata.accscore = acc;
  }
  if (isModified(dec)) {
    sogcdata.decscore = dec;
  }
  var bhrscore = sogcdata.bhrscore,
    accscore = sogcdata.accscore,
    decscore = sogcdata.decscore,
    ltvscore = sogcdata.ltvscore;
  var all = [bhrscore, accscore, decscore, ltvscore];
  sogcdata.result = '正常';
  if (all.some(function (_) {
    return _ === 2;
  })) {
    sogcdata.result = '异常';
  } else if (all.some(function (_) {
    return _ === 1;
  })) {
    sogcdata.result = '可疑';
  } else if (all.some(function (_) {
    return _ === 3;
  })) {
    sogcdata.result = '时长不足';
  }
  return sogcdata;
}
var strategies = {
  Cst: Cst,
  Cstoct: Cstoct,
  Fischer: Fischer,
  Krebs: Krebs,
  Nst: Nst,
  Sogc: Sogc
};
var strategies$1 = function strategies$1(key, oldData) {
  var s = strategies[key];
  return s === null || s === void 0 ? void 0 : s(oldData);
};
LazyAntd.Tree;
LazyAntd.TreeSelect;
var Select = LazyAntd.Select;
LazyAntd.Table;
LazyAntd.Dropdown;
LazyAntd.Pagination;
var id = 0;
function Opts(_a) {
  var m = _a.m,
    o = __rest(_a, ["m"]);
  return /*#__PURE__*/React__default.createElement(Select, _extends({
    style: {
      width: 240
    }
  }, o), m.map(function (_a) {
    var n = _a[0],
      label = _a[1];
    return /*#__PURE__*/React__default.createElement(Select.Option, {
      value: "00".concat(n, ",").concat(label),
      key: "00".concat(n, ",").concat(label, ",").concat(++id)
    }, label);
  }));
}
function getDeformedOptions(timeChecked) {
  if (timeChecked === void 0) {
    timeChecked = false;
  }
  return {
    S: function S(props) {
      return /*#__PURE__*/React__default.createElement(Select, _extends({
        style: {
          width: 120
        }
      }, props), /*#__PURE__*/React__default.createElement(Select.Option, {
        value: 0
      }, "\u6B63\u5E38"), /*#__PURE__*/React__default.createElement(Select.Option, {
        value: 1
      }, "\u53EF\u7591"), /*#__PURE__*/React__default.createElement(Select.Option, {
        value: 2
      }, "\u5F02\u5E38"), timeChecked ? /*#__PURE__*/React__default.createElement(Select.Option, {
        value: 3
      }, "\u65F6\u957F\u4E0D\u8DB3") : null);
    }
  };
}
var tableData = {
  Fischer: [{
    name: '胎心基线(bpm)',
    0: '<100,>180',
    1: '100~109,161~180',
    2: '110~160',
    key: 'bhr'
  }, {
    name: '振幅变异(bpm)',
    0: '<5',
    1: '5~9,>30',
    2: '10~30',
    key: 'ltv'
  }, {
    name: '周期变异(次)',
    0: '<2',
    1: '2~6',
    2: '>6',
    key: 'stv'
  }, {
    name: '加速(次)',
    0: '无',
    1: '1～4',
    2: '>4',
    key: 'acc'
  }, {
    name: '减速(次)',
    0: 'LD',
    1: 'VD',
    2: '无，其它',
    key: 'dec',
    R: function R(props) {
      return /*#__PURE__*/React__default.createElement(Opts, _extends({
        m: [[0, 'LD'], [1, 'VD'], [2.1, '无'], [2.2, '其它']]
      }, props));
    }
  }],
  Nst: [{
    name: '胎心基线(bpm)',
    0: '<100',
    1: '100~109,>160',
    2: '110~160',
    key: 'bhr'
  }, {
    name: '振幅变异(bpm)',
    0: '<5',
    1: '5~9,>30',
    2: '10~30',
    key: 'ltv'
  }, {
    name: '胎动FHR上升时间(s)',
    0: '<10s',
    1: '10~14s',
    2: '≥15s',
    key: 'accduration'
  }, {
    name: '胎动FHR变化(bpm)',
    0: '<10',
    1: '10~14',
    2: '≥15',
    key: 'accampl'
  }, {
    name: '胎动次数(次)',
    0: '无',
    1: '1~2',
    2: '≥3',
    key: 'fm'
  }],
  Krebs: [{
    name: '胎心基线(bpm)',
    0: '<100,>180',
    1: '100~109,161~180',
    2: '110~160',
    key: 'bhr'
  }, {
    name: '振幅变异(bpm)',
    0: '<5',
    1: '5~9,>25',
    2: '10~25',
    key: 'ltv'
  }, {
    name: '周期变异(次)',
    0: '<3',
    1: '3~6',
    2: '>6',
    key: 'stv'
  }, {
    name: '加速(次)',
    0: '0',
    1: '1~4',
    2: '>4',
    key: 'acc'
  }, {
    name: '减速(次)',
    0: '≥2',
    1: '1',
    2: '无或早期减速',
    key: 'dec'
  }, {
    name: '胎动(次)',
    0: '0',
    1: '1～4',
    2: '>4',
    key: 'fm'
  }],
  Cst: [{
    name: '胎心基线',
    0: '<100,>180',
    1: '100~109,161~180',
    2: '110~160',
    key: 'bhr'
  }, {
    name: '振幅变异',
    0: '<5',
    1: '5~9,>30',
    2: '10~30',
    key: 'ltv'
  }, {
    name: '周期变异',
    0: '<2',
    1: '2～6',
    2: '>6',
    key: 'stv'
  }, {
    name: '加速',
    0: '无',
    1: '周期性',
    2: '散在性',
    key: 'acc',
    R: function R(props) {
      return /*#__PURE__*/React__default.createElement(Opts, _extends({
        m: [[0, '无'], [1, '周期性'], [2, '散在性']]
      }, props));
    }
  }, {
    name: '减速',
    0: '晚期+其他',
    1: '变异减速',
    2: '无',
    key: 'dec',
    R: function R(props) {
      return /*#__PURE__*/React__default.createElement(Opts, _extends({
        m: [[0.1, '晚期'], [0.2, '其他'], [1, '基线变异'], [2, '无']]
      }, props));
    }
  }],
  Sogc: [{
    name: '胎心基线',
    0: '110~160bpm',
    1: '100~109bpm、>160bpm、基线上升',
    2: '基线过缓<100bpm、基线过速>160bpm、基线不确定',
    key: 'bhr',
    R: function R(props) {
      return /*#__PURE__*/React__default.createElement(Opts, _extends({
        m: [[0.0, '110~160bpm'], [1.1, '100~109bpm'], [1.2, '大于160bpm'], [1.3, '基线上升'], [2.1, '基线过缓小于00bpm'], [2.2, '基线过速大于160bpm'], [2.3, '基线不确定']]
      }, props));
    }
  }, {
    name: '基线变异',
    0: '6~25次/分、≤5次/分<40分钟',
    1: '≤5次/分40~80分钟',
    2: '≤5次/分>80分钟、≥26次/分>10分钟、正弦型',
    key: 'ltv',
    R: function R(props) {
      return /*#__PURE__*/React__default.createElement(Opts, _extends({
        m: [[0.1, '6~25次/分'], [0.2, '≤5次/分小于40分钟'], [1.0, '≤5次/分40~80分钟'], [2.1, '≤5次/分大于80分钟'], [2.2, '≥26次/分大于10分钟'], [2.3, '正弦型']]
      }, props));
    }
  }, {
    name: '减速',
    0: '无减速或偶发变异减速<30秒',
    1: '变异减速30~60秒',
    2: '变异减速>60秒、晚期减速',
    key: 'dec',
    R: function R(props) {
      return /*#__PURE__*/React__default.createElement(Opts, _extends({
        m: [[0.1, '无减速'], [0.2, '偶发变异减速小于30秒'], [1.0, '变异减速30~60秒'], [2.1, '变异减速大于60秒'], [2.2, '晚期减速']]
      }, props));
    }
  }, {
    name: '加速',
    0: '≥2次40分钟内',
    1: '<2次40~80分钟',
    2: '<2次>80分钟',
    key: 'acc',
    timeChecked: true,
    R: function R(props) {
      return /*#__PURE__*/React__default.createElement(Opts, _extends({
        m: [[0, '≥2次40分钟内'], [1, '小于2次40~80分钟'], [2, '小于2次大于80分钟']]
      }, props));
    }
  }].map(function (_) {
    return __assign(__assign({}, _), getDeformedOptions(_.timeChecked));
  }),
  Cstoct: [{
    name: '胎心基线',
    0: '110~160bpm',
    1: '<110bpm不伴基线变异缺失、>160bpm',
    2: '<100bpm伴基线变异缺失',
    key: 'bhr',
    R: function R(props) {
      return /*#__PURE__*/React__default.createElement(Opts, _extends({
        m: [[0.0, '110~160bpm'], [1.1, '小于110bpm不伴基线变异缺失'], [1.2, '大于160bpm'], [2.0, '小于100bpm伴基线变异缺失']]
      }, props));
    }
  }, {
    name: '基线变异',
    0: '6~25次/分(中变异)',
    1: '0次/分不伴反复出现的晚期减速、≤5次/分(小变异)、≥26次/分',
    2: '0次/分伴胎心过缓反复出现的变异减速或晚期减速',
    key: 'ltv',
    R: function R(props) {
      return /*#__PURE__*/React__default.createElement(Opts, _extends({
        m: [[0.0, '6~25次/分(中变异)'], [1.1, '0次/分不伴反复出现的晚期减速'], [1.2, '≤5次/分(小变异)'], [1.3, '≥26次/分'], [2.1, '0次/分伴胎心过缓反复出现的变异减速'], [2.2, '晚期减速']]
      }, props));
    }
  }, {
    name: '加速',
    0: '有',
    1: '刺激胎儿后仍缺失',
    2: '无',
    key: 'acc',
    R: function R(props) {
      return /*#__PURE__*/React__default.createElement(Opts, _extends({
        m: [[0, '有'], [1, '刺激胎儿后仍缺失'], [2, '无']]
      }, props));
    }
  }, {
    name: '早期减速',
    0: '有/无',
    1: '',
    2: '',
    key: 'ed',
    R: function R(props) {
      return /*#__PURE__*/React__default.createElement(Opts, _extends({
        m: [[0.0, '有'], [0.0, '无']]
      }, props));
    }
  }, {
    name: '变异减速',
    0: '无',
    1: '反复出现伴小变异或中变异、延迟减速(>2分但<10分)、非特异性的变异减速',
    2: '反复出现伴基线变异缺失',
    key: 'vd',
    R: function R(props) {
      return /*#__PURE__*/React__default.createElement(Opts, _extends({
        m: [[0.0, '无'], [1.1, '反复出现伴小变异或中变异'], [1.2, '延迟减速(大于2分但小于10分)'], [1.3, '非特异性的变异减速'], [2.0, '反复出现伴基线变异缺失']]
      }, props));
    }
  }, {
    name: '晚期减速',
    0: '无',
    1: '反复出现伴中变异',
    2: '反复出现伴基线变异缺失',
    key: 'ld',
    R: function R(props) {
      return /*#__PURE__*/React__default.createElement(Opts, _extends({
        m: [[0, '无'], [1, '反复出现伴中变异'], [2, '反复出现伴基线变异缺失']]
      }, props));
    }
  }, {
    name: '正弦曲线',
    0: '无',
    1: '',
    2: '有',
    key: 'sinusoid',
    R: function R(props) {
      return /*#__PURE__*/React__default.createElement(Opts, _extends({
        m: [[0, '无'], [2, '有']]
      }, props));
    }
  }].map(function (_) {
    return __assign(__assign({}, _), getDeformedOptions());
  })
};
tableData.Sogc.deformed = true;
tableData.Cstoct.deformed = true;
var info = _message.info;
function useSign() {
  var _a = useState(''),
    qrCodeBase64 = _a[0],
    setQrCodeBase64 = _a[1];
  var _b = useState(false),
    qrCodeBase64Loading = _b[0],
    setQrCodeBase64Loading = _b[1];
  var _c = useState(false),
    modalVisible = _c[0],
    setModalVisible = _c[1];
  var _d = useState(false),
    signed = _d[0],
    setSigned = _d[1];
  var _e = useState(),
    qrCodeIdentity = _e[0],
    setQrCodeIdentity = _e[1];
  var fetchSigninfo = useCallback(function () {
    if (qrCodeIdentity) {
      SZsy_CtgRecord.confirmQrCode(qrCodeIdentity).then(function (_a) {
        var verifyStatus = _a.verifyStatus,
          userToken = _a.userToken;
        if (verifyStatus !== 1) {
          setModalVisible(false);
          if (verifyStatus == 0) {
            setSigned(true);
            info('签名成功');
            event.emit('signed', qrCodeIdentity, userToken);
          } else {
            info('签名失败');
          }
        }
      });
    }
  }, [qrCodeIdentity,,]);
  useEffect(function () {
    var timeoutId = modalVisible && setInterval(fetchSigninfo, 1500);
    return function () {
      timeoutId && clearInterval(timeoutId);
    };
  }, [modalVisible, fetchSigninfo]);
  var fetchQrCode = function fetchQrCode(note) {
    setQrCodeBase64Loading(true);
    SZsy_CtgRecord.getQrCode(note).then(function (r) {
      var qrCodeIdentity = r.qrCodeIdentity,
        qrCodeBase64 = r.qrCodeBase64;
      if (qrCodeIdentity && qrCodeBase64) {
        setModalVisible(true);
        setQrCodeIdentity(qrCodeIdentity);
        setQrCodeBase64(qrCodeBase64);
      } else {
        _message.warning('服务错误！');
      }
    })["finally"](function () {
      return setQrCodeBase64Loading(false);
    });
  };
  return {
    fetchQrCode: fetchQrCode,
    qrCodeBase64: qrCodeBase64,
    modalVisible: modalVisible,
    setModalVisible: setModalVisible,
    qrCodeBase64Loading: qrCodeBase64Loading,
    signed: signed
  };
}
var T = function T(props) {
  props.hidden;
  var pv = props.pv,
    fetchData = props.fetchData;
  var _a = useState(false),
    isSaved = _a[0],
    setIsSaved = _a[1];
  var _b = useState(false),
    isEditing = _b[0],
    setIsEditing = _b[1];
  var form0 = _Form.useForm()[0];
  var form1 = _Form.useForm()[0];
  var _c = useState('Nst'),
    cacheType = _c[0],
    setCacheType = _c[1];
  var dataSource = tableData[cacheType];
  var deformed = dataSource.deformed;
  var _d = useSign(),
    fetchQrCode = _d.fetchQrCode,
    qrCodeBase64 = _d.qrCodeBase64,
    modalVisible = _d.modalVisible,
    setModalVisible = _d.setModalVisible;
  function saveCb(qrCodeIdentity, userToken) {
    return __awaiter(this, void 0, void 0, function () {
      var res;
      return __generator(this, function (_a) {
        switch (_a.label) {
          case 0:
            return [4, do_save({
              signOriginData: qrCodeIdentity,
              signedData: userToken
            })];
          case 1:
            res = _a.sent();
            return [2, res];
        }
      });
    });
  }
  function do_save() {
    return __awaiter(this, arguments, void 0, function (data) {
      var save, res;
      if (data === void 0) {
        data = {};
      }
      return __generator(this, function (_a) {
        switch (_a.label) {
          case 0:
            if (!pv) return [2, false];
            save = __assign(__assign({}, form0.getFieldsValue()), form1.getFieldsValue());
            return [4, SZsy_CtgRecord.saveRecord(__assign(__assign(__assign(__assign(__assign({}, pv), save), {
              state: 1
            }), data), {
              id: pv.id
            }))];
          case 1:
            res = _a.sent();
            return [4, fetchData()];
          case 2:
            _a.sent();
            _message.info('保存成功');
            return [2, res];
        }
      });
    });
  }
  useEffect(function () {
    mchcEvent.on('signed', saveCb);
    return function () {
      mchcEvent.off('signed', saveCb);
    };
  }, [saveCb]);
  [{
    title: '项目',
    dataIndex: 'name',
    render: function render(a) {
      return /*#__PURE__*/React__default.createElement("span", {
        style: {
          whiteSpace: 'nowrap'
        }
      }, a);
    }
  }, {
    title: deformed ? '正常' : '0分',
    dataIndex: '0',
    render: function render(a) {
      return /*#__PURE__*/React__default.createElement("div", {
        title: a,
        style: {
          cursor: 'help',
          fontSize: 12
        }
      }, a);
    }
  }, {
    title: deformed ? '可疑' : '1分',
    dataIndex: '1',
    render: function render(a) {
      return /*#__PURE__*/React__default.createElement("div", {
        title: a,
        style: {
          cursor: 'help',
          fontSize: 12
        }
      }, a);
    }
  }, {
    title: deformed ? '异常' : '2分',
    dataIndex: '2',
    render: function render(a) {
      return /*#__PURE__*/React__default.createElement("div", {
        title: a,
        style: {
          cursor: 'help',
          fontSize: 12
        }
      }, a);
    }
  }, {
    title: /*#__PURE__*/React__default.createElement(_Form.Item, {
      name: deformed ? 'result' : 'total',
      label: deformed ? '结果' : '总分',
      style: {
        margin: '0 12px',
        marginBottom: 0,
        display: 'flex',
        justifyContent: 'center'
      }
    }, /*#__PURE__*/React__default.createElement(_InputNumber, {
      disabled: true,
      style: {
        marginRight: 0
      }
    })),
    dataIndex: 'result',
    render: function render(a, _a) {
      var key = _a.key,
        R = _a.R;
      return /*#__PURE__*/React__default.createElement(_Form.Item, {
        name: "".concat(key, "value"),
        style: {
          margin: -8,
          marginTop: -8,
          marginBottom: -8
        }
      }, R ? /*#__PURE__*/React__default.createElement(R, {
        disabled: isDisabled
      }) : /*#__PURE__*/React__default.createElement(_Input, {
        size: "small",
        disabled: isDisabled,
        style: {
          width: '80%'
        }
      }));
    }
  }, {
    title: deformed ? '类型' : '得分',
    dataIndex: 'score',
    render: function render(a, _a) {
      var key = _a.key,
        S = _a.S;
      return /*#__PURE__*/React__default.createElement(_Form.Item, {
        name: "".concat(key, "score"),
        style: {
          margin: -8,
          marginTop: -8,
          marginBottom: -8,
          padding: '0 8px'
        }
      }, S ? /*#__PURE__*/React__default.createElement(S, {
        disabled: true
      }) : /*#__PURE__*/React__default.createElement(_InputNumber, {
        size: "small",
        disabled: true,
        style: {}
      }));
    }
  }].filter(function (_) {
    return !!_;
  }).map(function (_) {
    return __assign(__assign({}, _), {
      align: 'center'
    });
  });
  useEffect(function () {
    form1.setFieldsValue({
      type: cacheType
    });
  }, [cacheType]);
  useEffect(function () {
    if (pv === null || pv === void 0 ? void 0 : pv.type) {
      form0.setFieldsValue(pv);
      form1.setFieldsValue(pv);
      setCacheType(pv === null || pv === void 0 ? void 0 : pv.type);
    } else {
      setCacheType('Nst');
      form0.setFieldsValue(emptyValue['Nst']);
    }
    if ((pv === null || pv === void 0 ? void 0 : pv.state) === 1) {
      setIsSaved(true);
    }
    setIsEditing(false);
  }, [pv]);
  var isDisabled = isSaved && !isEditing;
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(_Form, {
    form: form0,
    size: "small",
    style: {
      display: 'block',
      position: 'relative',
      margin: 12
    },
    initialValues: {
      deformed: deformed
    },
    layout: "inline",
    onValuesChange: function onValuesChange(a, b) {
      var vk = Object.keys(b);
      var k_ = Object.keys(a)[0];
      if (/score$/.test(k_)) {
        var total = vk.filter(function (k) {
          return /score$/.test(k);
        }).map(function (_) {
          return b[_];
        }).reduce(function (a, b) {
          return a + b;
        }, 0);
        form0.setFieldsValue({
          total: total
        });
      }
      var newData = strategies$1(form1.getFieldsValue().type, form0.getFieldsValue());
      newData && form0.setFieldsValue(newData);
    }
  }, /*#__PURE__*/React__default.createElement(_Form.Item, {
    name: 'deformed',
    style: {
      display: 'none',
      visibility: 'hidden'
    },
    valuePropName: "checked"
  }, /*#__PURE__*/React__default.createElement(_Checkbox, null))), /*#__PURE__*/React__default.createElement(SimpleForm, {
    onValuesChange: function onValuesChange(a, b) {
      var keys = ['nst', 'cst', 'oct'];
      var _a = Object.entries(a)[0],
        k = _a[0],
        v = _a[1];
      var index = keys.indexOf(k);
      var old = b.diagnosis || '';
      var nstReg = /【NST：.*】/;
      var cstReg = /【CST：.*】/;
      var octReg = /【OCT：.*】/;
      if (index === 0) {
        var text_1 = "\u3010NST\uFF1A".concat(v, "\u3011");
        old = old.replace(cstReg, '');
        old = old.replace(octReg, '');
        var diagnosis = nstReg.test(old) ? old.replace(nstReg, function () {
          return text_1;
        }) : old.concat(text_1);
        form1.setFieldsValue({
          cst: undefined,
          oct: undefined,
          diagnosis: diagnosis
        });
      } else if (index === 1) {
        var text_2 = "\u3010CST\uFF1A".concat(v, "\u3011");
        old = old.replace(nstReg, '');
        old = old.replace(octReg, '');
        var diagnosis = cstReg.test(old) ? old.replace(cstReg, function () {
          return text_2;
        }) : old.concat(text_2);
        form1.setFieldsValue({
          nst: undefined,
          oct: undefined,
          diagnosis: diagnosis
        });
      } else if (index === 2) {
        var text_3 = "\u3010OCT\uFF1A".concat(v, "\u3011");
        old = old.replace(nstReg, '');
        old = old.replace(cstReg, '');
        var diagnosis = octReg.test(old) ? old.replace(octReg, function () {
          return text_3;
        }) : old.concat(text_3);
        form1.setFieldsValue({
          nst: undefined,
          cst: undefined,
          diagnosis: diagnosis
        });
      }
      if (a.type) {
        if ((pv === null || pv === void 0 ? void 0 : pv.type) === a.type) {
          form0.setFieldsValue(pv);
        } else {
          form0.setFieldsValue(emptyValue[a.type]);
        }
      }
      b.type && setCacheType(b.type);
    },
    disabled: isDisabled,
    form: form1,
    blocks: [{
      rows: [{
        itemsInRow: [{
          type: 'Select',
          outerOptions: {
            name: 'type',
            label: '分析方法'
          },
          innerOptions: {
            allowClear: false,
            options: ['Nst', 'Krebs', 'Fischer', 'Sogc', 'Cst', 'Cstoct'].map(function (_) {
              return {
                label: _,
                value: _
              };
            })
          }
        }, {
          type: 'Select',
          outerOptions: {
            name: 'fetal',
            label: '胎心率'
          },
          innerOptions: {
            options: ['FHR1', 'FHR2', 'FHR3'].map(function (_) {
              return {
                label: _,
                value: _
              };
            })
          }
        }],
        layoutType: 6
      }, {
        itemsInRow: [{
          type: 'Select',
          outerOptions: {
            name: 'nst',
            label: 'nst'
          },
          innerOptions: {
            options: ['正常', '异常', '不典型'].map(function (_) {
              return {
                label: _,
                value: _
              };
            })
          }
        }, {
          type: 'Select',
          outerOptions: {
            name: 'oct',
            label: 'oct'
          },
          innerOptions: {
            options: ['阴性', '阳性', '可疑'].map(function (_) {
              return {
                label: _,
                value: _
              };
            })
          }
        }, {
          type: 'Select',
          outerOptions: {
            name: 'cst',
            label: 'cst'
          },
          innerOptions: {
            options: ['Ⅰ类', 'Ⅱ类', 'Ⅲ类'].map(function (_) {
              return {
                label: _,
                value: _
              };
            })
          }
        }],
        layoutType: 6
      }, {
        itemsInRow: [{
          type: 'TextArea',
          outerOptions: {
            name: 'diagnosis',
            label: '诊断意见'
          },
          layoutType: 16
        }, {
          type: 'Custom',
          customNode: /*#__PURE__*/React__default.createElement(_Space, {
            style: {
              marginLeft: 12
            }
          }, isSaved ? isDisabled ? /*#__PURE__*/React__default.createElement(_Button, {
            type: "primary",
            style: {
              padding: '0 24px'
            },
            disabled: !pv,
            onClick: function onClick(e) {
              setIsEditing(true);
            }
          }, "\u4FEE\u6539") : null : /*#__PURE__*/React__default.createElement(_Button, {
            type: "primary",
            style: {
              padding: '0 24px'
            },
            disabled: !pv,
            onClick: function onClick(e) {
              do_save();
            }
          }, "\u4FDD\u5B58"), isEditing ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(_Button, {
            style: {
              padding: '0 24px'
            },
            disabled: !pv,
            onClick: function onClick(e) {
              setIsEditing(false);
              if (pv === null || pv === void 0 ? void 0 : pv.type) {
                form0.setFieldsValue(pv);
                form1.setFieldsValue(pv);
              }
            }
          }, "\u53D6\u6D88"), /*#__PURE__*/React__default.createElement(_Button, {
            type: "primary",
            style: {
              padding: '0 24px'
            },
            disabled: !pv,
            onClick: function onClick(e) {
              do_save();
              setIsEditing(false);
            }
          }, "\u786E\u5B9A")) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(_Button, {
            type: "primary",
            style: {
              padding: '0 24px'
            },
            disabled: (pv === null || pv === void 0 ? void 0 : pv.state) !== 1,
            onClick: function onClick(e) {
              pv && fetchQrCode(pv.doctorId);
              console.log(form0.getFieldsValue(), form1.getFieldsValue());
            }
          }, "\u7B7E\u540D"), /*#__PURE__*/React__default.createElement(_Button, {
            type: "primary",
            style: {
              padding: '0 24px'
            },
            disabled: (pv === null || pv === void 0 ? void 0 : pv.state) !== 1,
            onClick: function onClick(e) {
              request.post("/Obcloud/api/ctg/sign/archive?recordId=".concat(pv === null || pv === void 0 ? void 0 : pv.id)).then(function (_a) {
                _a.data;
              });
            }
          }, "\u5F52\u6863"), /*#__PURE__*/React__default.createElement(_Button, {
            type: "primary",
            style: {
              padding: '0 24px'
            },
            disabled: (pv === null || pv === void 0 ? void 0 : pv.state) !== 1,
            onClick: function onClick(e) {
              if (pv) {
                SZsy_CtgRecord.getReport(pv.id).then(function (data) {
                  mchcLogger.log('data', data);
                  mchcModal__.open('print_modal', {
                    modal_data: {
                      printData: data
                    }
                  });
                });
              }
            }
          }, "\u6253\u5370"), /*#__PURE__*/React__default.createElement(_Button, {
            type: "primary",
            style: {
              padding: '0 24px'
            },
            disabled: (pv === null || pv === void 0 ? void 0 : pv.state) !== 1,
            onClick: function onClick(e) {
              if (pv) {
                SZsy_CtgRecord.getRecordHistory(pv.id).then(function (data) {
                  mchcModal__.open('test', {
                    title: '历史判图',
                    width: '80vw',
                    modal_data: {
                      content: /*#__PURE__*/React__default.createElement(HistoryTable, {
                        dataSource: data,
                        type: "recordHistoryId"
                      })
                    }
                  });
                });
              }
            }
          }, "\u5386\u53F2\u5224\u56FE"))),
          layoutType: 8
        }]
      }]
    }]
  }), /*#__PURE__*/React__default.createElement(_Modal, {
    visible: modalVisible,
    footer: null,
    title: "\u8BF7\u626B\u7801",
    onCancel: function onCancel() {
      return setModalVisible(false);
    }
  }, /*#__PURE__*/React__default.createElement("img", {
    src: qrCodeBase64,
    width: "480"
  })));
};
var ATable = T;
_Layout.Header;
var Content = _Layout.Content;
_Layout.Sider;
var PAGE_START = 1;
var initParams = {
  state: 0
};
function Test(props) {
  var _a;
  var _b = useState([]),
    state = _b[0],
    setState = _b[1];
  var _c = useState([]),
    imgArr = _c[0],
    setImgArr = _c[1];
  var _d = useState(false),
    loading = _d[0],
    setLoading = _d[1];
  var _e = useState(false),
    list_loading = _e[0],
    setList_Loading = _e[1];
  var _f = useState(0),
    imgIdx = _f[0],
    setImgIdx = _f[1];
  var _g = useState(),
    currentPv = _g[0],
    setCurrentPv = _g[1];
  var _h = useState(0),
    total = _h[0],
    setTotal = _h[1];
  var _j = useState(PAGE_START),
    _pageCurrent = _j[0],
    set_pageCurrent = _j[1];
  var limit = 16;
  var form = _Form.useForm()[0];
  var outpatientNo = getSearchParamsValue('outpatientNo');
  var inpatientNo = getSearchParamsValue('inpatientNo');
  var all = getSearchParamsAll();
  function fetchData() {
    return __awaiter(this, arguments, void 0, function (_page, s, isLoading) {
      if (_page === void 0) {
        _page = _pageCurrent;
      }
      if (s === void 0) {
        s = form.getFieldsValue();
      }
      if (isLoading === void 0) {
        isLoading = true;
      }
      return __generator(this, function (_a) {
        if (_pageCurrent !== _page) {
          set_pageCurrent(_page);
        }
        if (isLoading) setList_Loading(true);
        return [2, SZsy_CtgRecord.findRecordsPage(__assign(__assign(__assign({
          pageSize: limit
        }, s), {
          pageCurrent: _page
        }), all)).then(function (r) {
          var list = r.list;
          r.pageSize;
          var totalRow = r.totalRow;
          setState(list);
          if (currentPv) {
            var newTarget = list.find(function (_) {
              return _.id === currentPv.id;
            });
            if (newTarget) setCurrentPv(newTarget);
          } else {
            setCurrentPv(list[0]);
          }
          setTotal(totalRow);
        })["finally"](function () {
          return setList_Loading(false);
        })];
      });
    });
  }
  function clickHandler(pv) {
    setCurrentPv(pv);
    setLoading(true);
    SZsy_CtgRecord.getSliceImages(pv.id).then(function (r) {
      setImgArr(r);
      setImgIdx(0);
      setTimeout(function () {
        return setLoading(false);
      }, 400);
    });
  }
  function desklogin() {
    return __awaiter(this, void 0, void 0, function () {
      var searchData, appId, empid, empId, patId, data, timestamp, sign, res;
      return __generator(this, function (_a) {
        switch (_a.label) {
          case 0:
            mchcLogger.log('desklogin 0');
            searchData = getSearchParamsAll();
            appId = searchData.appId, empid = searchData.empid, empId = searchData.empId, patId = searchData.patId, data = searchData.data, timestamp = searchData.timestamp, sign = searchData.sign;
            if (!(appId || empId || empid || patId || data || timestamp || sign)) return [3, 4];
            _a.label = 1;
          case 1:
            _a.trys.push([1, 3,, 4]);
            return [4, request.post('/api/desklogin', searchData)];
          case 2:
            res = _a.sent();
            return [2, res];
          case 3:
            _a.sent();
            return [3, 4];
          case 4:
            return [2];
        }
      });
    });
  }
  useEffect(function () {
    var _init = __assign(__assign({}, initParams), {
      inpatientNo: inpatientNo,
      outpatientNo: outpatientNo
    });
    desklogin().then(function () {
      fetchData(PAGE_START, _init);
      form.setFieldsValue(_init);
    });
  }, []);
  useEffect(function () {
    var id = setInterval(function () {
      fetchData(_pageCurrent, form.getFieldsValue(), false);
    }, 5 * 60 * 1000);
    return function () {
      return clearInterval(id);
    };
  }, [_pageCurrent]);
  var targetImg = imgArr[imgIdx];
  return /*#__PURE__*/React__default.createElement("div", {
    style: {
      height: '100%',
      display: 'flex',
      padding: 12,
      background: '#fff'
    }
  }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(SimpleForm, {
    form: form,
    formItems: [{
      type: 'DatePicker',
      outerOptions: {
        name: 'startDate',
        label: '开始时间'
      },
      innerOptions: {
        style: {
          width: 240
        }
      }
    }, {
      type: 'DatePicker',
      outerOptions: {
        name: 'endDate',
        label: '结束时间'
      },
      innerOptions: {
        style: {
          width: 240
        }
      }
    }, {
      type: 'Select',
      outerOptions: {
        name: 'state',
        label: '判图状态'
      },
      innerOptions: {
        options: [{
          value: 0,
          label: '否'
        }, {
          value: 1,
          label: '是'
        }],
        style: {
          width: 240
        }
      }
    }, outpatientNo ? {
      type: 'Input',
      outerOptions: {
        name: 'outpatientNo',
        label: '就诊卡号'
      },
      innerOptions: {
        style: {
          width: 240
        },
        disabled: true
      }
    } : null, inpatientNo ? {
      type: 'Input',
      outerOptions: {
        name: 'inpatientNo',
        label: '住院号'
      },
      innerOptions: {
        style: {
          width: 240
        },
        disabled: true
      }
    } : null]
  }), /*#__PURE__*/React__default.createElement(_Button, {
    block: true,
    onClick: function onClick() {
      fetchData(PAGE_START);
    },
    type: "primary",
    loading: list_loading
  }, "\u67E5\u8BE2"), /*#__PURE__*/React__default.createElement(_Divider, {
    style: {
      margin: '6px 0'
    }
  }), (state === null || state === void 0 ? void 0 : state.length) ? /*#__PURE__*/React__default.createElement(_Menu, {
    activeKey: (_a = currentPv === null || currentPv === void 0 ? void 0 : currentPv.id) === null || _a === void 0 ? void 0 : _a.toString(),
    mode: "inline",
    style: {
      width: 320
    }
  }, state.map(function (_) {
    return /*#__PURE__*/React__default.createElement(_Menu.Item, {
      key: _.id,
      onClick: function onClick(e) {
        return clickHandler(_);
      },
      style: {
        outline: _.state ? '1px solid #333' : 'unset',
        margin: '6px 0'
      }
    }, /*#__PURE__*/React__default.createElement("span", {
      style: {
        minWidth: 44,
        display: 'inline-block'
      }
    }, _.name), /*#__PURE__*/React__default.createElement(_Divider, {
      type: "vertical"
    }), formatDate(_.visitDate), /*#__PURE__*/React__default.createElement(_Divider, {
      type: "vertical"
    }), _.docNo);
  })) : /*#__PURE__*/React__default.createElement(_Empty, null), /*#__PURE__*/React__default.createElement(_Pagination, {
    size: "small",
    showSizeChanger: false,
    current: _pageCurrent,
    total: total,
    pageSize: limit,
    onChange: function onChange(page) {
      fetchData(page);
    },
    style: {
      marginTop: 12
    }
  })), /*#__PURE__*/React__default.createElement(Content, {
    className: "site-layout-background",
    style: {
      width: 1200,
      padding: 0,
      overflowY: 'scroll'
    }
  }, /*#__PURE__*/React__default.createElement(_Spin, {
    tip: "Loading...",
    spinning: loading
  }, /*#__PURE__*/React__default.createElement("div", {
    style: {}
  }, /*#__PURE__*/React__default.createElement("div", {
    style: {
      display: 'flex',
      alignItems: 'center',
      flexDirection: 'column'
    }
  }, /*#__PURE__*/React__default.createElement("div", {
    style: {
      padding: 12,
      margin: 12,
      background: '#ddd',
      boxSizing: 'content-box'
    }
  }, targetImg ? /*#__PURE__*/React__default.createElement("img", {
    src: targetImg,
    width: "100%",
    height: "100%"
  }) : /*#__PURE__*/React__default.createElement(_Empty, {
    style: {
      marginTop: 240
    }
  })), /*#__PURE__*/React__default.createElement(_Pagination, {
    showSizeChanger: false,
    size: "small",
    total: imgArr.length,
    pageSize: 1,
    current: imgIdx + 1,
    onChange: function onChange(page) {
      return setImgIdx(page - 1);
    }
  })))), currentPv ? /*#__PURE__*/React__default.createElement(ATable, {
    name: "xx",
    pv: currentPv,
    fetchData: fetchData
  }) : null));
}
export { Test as default };
//# sourceMappingURL=src.pages.fetal-custom-analyse2.js.map
