Commit d4c2f828 by zhaochengxiang

bug fix

parent d32405a9
import React from "react" import React from "react"
import { Space, Button, Descriptions, Form, Input, Tooltip, Typography, Select, Spin } from "antd" import { Space, Button, Descriptions, Form, Input, Tooltip, Typography, Select, Spin, Modal } from "antd"
import produce from "immer" import produce from "immer"
import Table from '../../../util/Component/Table' import Table from '../../../util/Component/Table'
...@@ -12,6 +12,7 @@ const FC = (props) => { ...@@ -12,6 +12,7 @@ const FC = (props) => {
const [waiting, setWaiting] = React.useState(false) const [waiting, setWaiting] = React.useState(false)
const [data, setData] = React.useState() const [data, setData] = React.useState()
const [form] = Form.useForm() const [form] = Form.useForm()
const [modal, contextHolder] = Modal.useModal()
const id = getQueryParam('id', props.location?.search) const id = getQueryParam('id', props.location?.search)
const type = getQueryParam('type', props.location?.search) const type = getQueryParam('type', props.location?.search)
...@@ -100,12 +101,13 @@ const FC = (props) => { ...@@ -100,12 +101,13 @@ const FC = (props) => {
}, },
callback: (data) => { callback: (data) => {
setWaiting(false) setWaiting(false)
if (data && !data.success) { if (data && !data.success) {
if (data.msg) { if (data.msg) {
const msg = (data?.msg||'').replace(RegExp("\n", "g"),"<br />") const msg = (data?.msg||'').replace(RegExp("\n", "g"),"<br />")
modal.warning({ modal.warning({
title: '提示', title: '提示',
content: msg, content: <span dangerouslySetInnerHTML={{ __html: msg }} />,
okText: '确定', okText: '确定',
onOk: () => { onOk: () => {
window.close() window.close()
...@@ -133,8 +135,8 @@ const FC = (props) => { ...@@ -133,8 +135,8 @@ const FC = (props) => {
} }
return ( return (
<Spin spinning={loading||waiting}> <div className='p-5' style={{ height: '100%', overflow: 'auto' }}>
<div className='p-5' style={{ height: '100%' }}> <Spin spinning={loading||waiting}>
<div className='flex' style={{ justifyContent: 'end' }}> <div className='flex' style={{ justifyContent: 'end' }}>
<Space> <Space>
<Button onClick={onSaveClick}>保存</Button> <Button onClick={onSaveClick}>保存</Button>
...@@ -186,8 +188,9 @@ const FC = (props) => { ...@@ -186,8 +188,9 @@ const FC = (props) => {
</Form> </Form>
</div> </div>
<List ref={listRef} type={type} data={data} taskId={taskId} /> <List ref={listRef} type={type} data={data} taskId={taskId} />
</div> </Spin>
</Spin> {contextHolder}
</div>
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment