Commit d4c2f828 by zhaochengxiang

bug fix

parent d32405a9
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 Table from '../../../util/Component/Table'
......@@ -12,6 +12,7 @@ const FC = (props) => {
const [waiting, setWaiting] = React.useState(false)
const [data, setData] = React.useState()
const [form] = Form.useForm()
const [modal, contextHolder] = Modal.useModal()
const id = getQueryParam('id', props.location?.search)
const type = getQueryParam('type', props.location?.search)
......@@ -100,12 +101,13 @@ const FC = (props) => {
},
callback: (data) => {
setWaiting(false)
if (data && !data.success) {
if (data.msg) {
const msg = (data?.msg||'').replace(RegExp("\n", "g"),"<br />")
modal.warning({
title: '提示',
content: msg,
content: <span dangerouslySetInnerHTML={{ __html: msg }} />,
okText: '确定',
onOk: () => {
window.close()
......@@ -133,8 +135,8 @@ const FC = (props) => {
}
return (
<Spin spinning={loading||waiting}>
<div className='p-5' style={{ height: '100%' }}>
<div className='p-5' style={{ height: '100%', overflow: 'auto' }}>
<Spin spinning={loading||waiting}>
<div className='flex' style={{ justifyContent: 'end' }}>
<Space>
<Button onClick={onSaveClick}>保存</Button>
......@@ -186,8 +188,9 @@ const FC = (props) => {
</Form>
</div>
<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