|
@@ -1,12 +1,13 @@
|
|
|
import React, { useState, useEffect, useRef } from 'react';
|
|
|
-import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space } from 'antd';
|
|
|
+import { Form, Input, Button, Table, Row, Col, Select, Modal, DatePicker, Space, message } from 'antd';
|
|
|
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons';
|
|
|
import { getCookie } from '@utils/index'
|
|
|
import '@common/common.less';
|
|
|
+import moment from "moment";
|
|
|
+import "moment/locale/zh-cn"
|
|
|
import apiObj from '@api/index';
|
|
|
-// import AddRules from './addRules';
|
|
|
-// import FiledContext from './filed-context';
|
|
|
-import { message } from "antd/lib/index";
|
|
|
+import EditProblem from './editProblem';
|
|
|
+import ProblemContext from './problem-context';
|
|
|
const { post, api, xPost } = apiObj;
|
|
|
const { RangePicker } = DatePicker;
|
|
|
const { Option } = Select;
|
|
@@ -22,6 +23,8 @@ function FieldProblem() {
|
|
|
const [visible, setVisible] = useState(false);
|
|
|
const [size, setSize] = useState(15);
|
|
|
const [current, setCurrent] = useState(1);
|
|
|
+ const [problemDetail, setProblemDetail] = useState(null);//详情数据
|
|
|
+ const [title, setTitle] = useState();//正则式数据
|
|
|
const [regularList, setRegularList] = useState([]);//正则式数据
|
|
|
const [tableList, setTableList] = useState([]);//表名称
|
|
|
const [colList, setColList] = useState([]);//字段名称
|
|
@@ -35,7 +38,7 @@ function FieldProblem() {
|
|
|
let data = {
|
|
|
pages: 1,
|
|
|
current: 1,
|
|
|
- size: size
|
|
|
+ size: size,
|
|
|
}
|
|
|
//表格数据
|
|
|
function getColumnResultPage(param) {
|
|
@@ -66,68 +69,23 @@ function FieldProblem() {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- //获取字段名
|
|
|
- function getColumnName(columnCname, columnEname) {
|
|
|
- const param = {
|
|
|
- columnCname: columnCname,
|
|
|
- columnEname: columnEname
|
|
|
- }
|
|
|
- post(api.getColumnName, param).then((res) => {
|
|
|
- if (res.data.code === 200) {
|
|
|
- const data = res.data.data;
|
|
|
- setColList([...data]);
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- //获取表名称
|
|
|
- function getTableName(tableCname, tableEname) {
|
|
|
- const param = {
|
|
|
- tableCname: tableCname,
|
|
|
- tableEname: tableEname
|
|
|
- }
|
|
|
- post(api.getTableName, param).then((res) => {
|
|
|
- if (res.data.code === 200) {
|
|
|
- const data = res.data.data;
|
|
|
- setTableList([...data]);
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- //表名称搜索(中文)
|
|
|
- function cnameSearch(val) {
|
|
|
- getTableName(val, '')
|
|
|
- }
|
|
|
- //表名称搜索(英文)
|
|
|
- function enameSearch(val) {
|
|
|
- getTableName('', val)
|
|
|
- }
|
|
|
- //字段名称搜索(中文)
|
|
|
- function colmeSearch(val) {
|
|
|
- getColumnName(val, '')
|
|
|
- }
|
|
|
- //字段名称搜索(英文)
|
|
|
- function coleneSearch(val) {
|
|
|
- getColumnName('', val)
|
|
|
- }
|
|
|
- //正则式名称搜索
|
|
|
- function onSearch(val) {
|
|
|
- getRegular(val)
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
- //新增修改跳转
|
|
|
- function showModal(type) {
|
|
|
- setAddVisible(true)
|
|
|
+ //修改
|
|
|
+ function showModal(title, row, type) {
|
|
|
+ setVisible(true)
|
|
|
+ setProblemDetail(row)
|
|
|
+ setTitle(title)
|
|
|
setType(type)
|
|
|
- setFiledDetail({
|
|
|
- columnList: [{
|
|
|
- columnCname: "",
|
|
|
- columnEname: "",
|
|
|
- ableCname: "",
|
|
|
- tableEname: ""
|
|
|
- }],
|
|
|
- standardValueList: [{
|
|
|
- tit: ''
|
|
|
- }]
|
|
|
- })
|
|
|
+ }
|
|
|
+ //返回
|
|
|
+ function cancel() {
|
|
|
+ setVisible(false)
|
|
|
+ setProblemDetail(null)
|
|
|
+ }
|
|
|
+ function userChange() {
|
|
|
+ setVisible(false)
|
|
|
+ getColumnResultPage();
|
|
|
}
|
|
|
function onSizeChange(current, pageSize) {
|
|
|
params.current = current
|
|
@@ -143,18 +101,13 @@ function FieldProblem() {
|
|
|
setParams(params)
|
|
|
setCurrent(page)
|
|
|
getColumnResultPage()
|
|
|
- }
|
|
|
- //返回
|
|
|
- function goBack() {
|
|
|
- setAddVisible(false);
|
|
|
- // setOrgDetail(null)
|
|
|
- // getTableData();
|
|
|
- }
|
|
|
- //保存
|
|
|
- function addSubFiled() {
|
|
|
-
|
|
|
}
|
|
|
const onFinish = (value) => {
|
|
|
+ if (value.time) {
|
|
|
+ value.solveTimeStart = moment(value.time[0]).format('YYYY-MM-DD 00:00:00');
|
|
|
+ value.solveTimeEnd = moment(value.time[1]).format('YYYY-MM-DD 23:23:59');
|
|
|
+ }
|
|
|
+ delete value.time
|
|
|
const param = {
|
|
|
...data,
|
|
|
...value,
|
|
@@ -179,10 +132,14 @@ function FieldProblem() {
|
|
|
{ title: '表名称(英文)', dataIndex: 'tableEname', key: 'tableEname' },
|
|
|
{ title: '字段名称(中文)', dataIndex: 'columnCname', key: 'columnCname' },
|
|
|
{ title: '字段名称(英文)', dataIndex: 'columnEname', key: 'columnEname' },
|
|
|
- { title: '上传字段值', dataIndex: 'optimizeCountSql', key: 'optimizeCountSql' },
|
|
|
- { title: '备注', dataIndex: 'standardValue', key: 'standardValue' },
|
|
|
- { title: '问题类型', dataIndex: 'regularName', key: 'regularName' },
|
|
|
- { title: '更新时间', dataIndex: 'regularName', key: 'regularName' },
|
|
|
+ { title: '上传字段值', dataIndex: 'tableVal', key: 'tableVal' },
|
|
|
+ { title: '备注', dataIndex: 'description', key: 'description' },
|
|
|
+ {
|
|
|
+ title: '问题类型', dataIndex: 'type', render: (text, record) => {
|
|
|
+ return record.type == 1 ? "数据缺失" : record.type == 2 ? "非标准值" : "正则校验失败";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { title: '更新时间', dataIndex: 'auditTime', key: 'auditTime' },
|
|
|
{
|
|
|
title: '状态', dataIndex: 'isRequired', key: 'isRequired', render: (text, record) => {
|
|
|
return record.isSolved == 1 ? "已解决" : "未解决";
|
|
@@ -191,19 +148,12 @@ function FieldProblem() {
|
|
|
{
|
|
|
title: '操作', dataIndex: 'key', render: (text, record) => (
|
|
|
<Space size="middle">
|
|
|
- <a >修改</a>
|
|
|
+ <a onClick={e => showModal('修改字段校验问题明细', record, 3)}>修改</a>
|
|
|
</Space>
|
|
|
)
|
|
|
}
|
|
|
];
|
|
|
|
|
|
- // if (addVisible && filedDetail) {
|
|
|
- // return (
|
|
|
- // <FiledContext.Provider value={{ type, save: addSubFiled, detail: filedDetail }}>
|
|
|
- // <AddRules back={goBack} />
|
|
|
- // </FiledContext.Provider>
|
|
|
- // )
|
|
|
- // }
|
|
|
return (
|
|
|
<div className="wrapper">
|
|
|
<div className="filter-box">
|
|
@@ -213,78 +163,59 @@ function FieldProblem() {
|
|
|
onFinish={onFinish}
|
|
|
>
|
|
|
<Row gutter={24}>
|
|
|
- <Col span={5} key={0}>
|
|
|
- <Form.Item label="表名称(中文)" name="tableCname">
|
|
|
- <Select showSearch allowClear onSearch={cnameSearch} placeholder="请选择">
|
|
|
- {tableList.map((item) => {
|
|
|
- return (
|
|
|
- <Option value={item.tableCname} key={item.tableCname}>{item.tableCname}</Option>
|
|
|
- )
|
|
|
- })}
|
|
|
- </Select>
|
|
|
+ <Col span={6} key={0}>
|
|
|
+ <Form.Item label="日期" name="time">
|
|
|
+ <RangePicker
|
|
|
+ placeholder={['开始时间', '结束时间']}
|
|
|
+ />
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
<Col span={5} key={1}>
|
|
|
- <Form.Item label="表名称(英文)" name="tableEname">
|
|
|
- <Select showSearch allowClear onSearch={enameSearch} placeholder="请选择">
|
|
|
- {tableList.map((item) => {
|
|
|
- return (
|
|
|
- <Option value={item.tableEname} key={item.tableEname}>{item.tableEname}</Option>
|
|
|
- )
|
|
|
- })}
|
|
|
- </Select>
|
|
|
+ <Form.Item label="住院序号" name="behospitalCode">
|
|
|
+ <Input placeholder="请输入" autoComplete='off' />
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
<Col span={5} key={2}>
|
|
|
- <Form.Item label="字段名称(中文)" name="columnCname">
|
|
|
- <Select showSearch allowClear onSearch={colmeSearch} placeholder="请选择">
|
|
|
- {colList.map((item) => {
|
|
|
- return (
|
|
|
- <Option value={item.columnCname} key={item.columnCname}>{item.columnCname}</Option>
|
|
|
- )
|
|
|
- })}
|
|
|
- </Select>
|
|
|
+ <Form.Item label="文书编号" name="recId">
|
|
|
+ <Input placeholder="请输入" autoComplete='off' />
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
<Col span={5} key={3}>
|
|
|
- <Form.Item label="字段名称(英文)" name="columnEname">
|
|
|
- <Select showSearch allowClear onSearch={coleneSearch} placeholder="请选择">
|
|
|
- {colList.map((item) => {
|
|
|
- return (
|
|
|
- <Option value={item.columnEname} key={item.columnEname}>{item.columnEname}</Option>
|
|
|
- )
|
|
|
- })}
|
|
|
- </Select>
|
|
|
+ <Form.Item label="文书标题" name="recTitle">
|
|
|
+ <Input placeholder="请输入" autoComplete='off' />
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
<Col span={5} key={4}>
|
|
|
- <Form.Item label="是否必填" name="isRequired">
|
|
|
+ <Form.Item label="质控模块名称" name="modeName">
|
|
|
+ <Input placeholder="请输入" autoComplete='off' />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ <Col span={5} key={5}>
|
|
|
+ <Form.Item label="问题类型" name="type">
|
|
|
<Select
|
|
|
placeholder="请选择"
|
|
|
allowClear
|
|
|
>
|
|
|
- <Option value="1" key={1}>是</Option>
|
|
|
- <Option value="0" key={0}>否</Option>
|
|
|
+ <Option value="" key={0}>全部</Option>
|
|
|
+ <Option value="1" key={1}>数据缺失</Option>
|
|
|
+ <Option value="2" key={2}>非标准值</Option>
|
|
|
+ <Option value="3" key={3}>正则校验失败</Option>
|
|
|
</Select>
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
- <Col span={5} key={5}>
|
|
|
- <Form.Item label="标准值" name="standardValue">
|
|
|
- <Input placeholder="请输入" autoComplete='off' />
|
|
|
- </Form.Item>
|
|
|
- </Col>
|
|
|
- <Col span={5} key={6}>
|
|
|
- <Form.Item label="正则名称" name="regularName">
|
|
|
- <Select showSearch allowClear onSearch={onSearch} placeholder="请选择">
|
|
|
- {regularList.map((item) => {
|
|
|
- return (
|
|
|
- <Option value={item.name} key={item.id}>{item.name}</Option>
|
|
|
- )
|
|
|
- })}
|
|
|
+ <Col span={5} key={7}>
|
|
|
+ <Form.Item label="状态" name="isSolved">
|
|
|
+ <Select
|
|
|
+ placeholder="请选择"
|
|
|
+ allowClear
|
|
|
+ >
|
|
|
+ <Option value="" key={3}>全部</Option>
|
|
|
+ <Option value="0" key={0}>未处理</Option>
|
|
|
+ <Option value="1" key={1}>已处理</Option>
|
|
|
</Select>
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
- <Col span={6} key={7}>
|
|
|
+ <Col span={4} key={8}>
|
|
|
<Form.Item>
|
|
|
<Button type="primary" htmlType="submit">
|
|
|
查询
|
|
@@ -300,16 +231,16 @@ function FieldProblem() {
|
|
|
|
|
|
<div className="table">
|
|
|
<div className="table-header">
|
|
|
- <h2 className="table-title">职务职称变更记录</h2>
|
|
|
+ <h2 className="table-title">字段校验问题明细</h2>
|
|
|
<Space size="middle">
|
|
|
- <Button type="primary" icon={<PlusOutlined />} onClick={() => showModal(1)}>新增</Button>
|
|
|
+ <Button type="primary" onClick={() => showModal(1)}>数据校验</Button>
|
|
|
</Space>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<Table
|
|
|
columns={columns}
|
|
|
- scroll={{ y: 'calc(100vh - 380px)' }}
|
|
|
+ scroll={{ y: 'calc(100vh - 400px)' }}
|
|
|
dataSource={logList}
|
|
|
rowKey={record => record.columnId}
|
|
|
pagination={{
|
|
@@ -324,6 +255,24 @@ function FieldProblem() {
|
|
|
total: total
|
|
|
}} />
|
|
|
</div>
|
|
|
+
|
|
|
+ {visible && problemDetail ?
|
|
|
+ <Modal
|
|
|
+ title={title}
|
|
|
+ okText='确定'
|
|
|
+ cancelText='取消'
|
|
|
+ width="500px"
|
|
|
+ visible={visible}
|
|
|
+ onCancel={cancel}
|
|
|
+ footer={null}
|
|
|
+ forceRender={true}
|
|
|
+ >
|
|
|
+ <ProblemContext.Provider value={{ problemDetail, type }}>
|
|
|
+ <EditProblem userChange={userChange} />
|
|
|
+ </ProblemContext.Provider>
|
|
|
+
|
|
|
+ </Modal>
|
|
|
+ : ''}
|
|
|
</div >
|
|
|
)
|
|
|
}
|