Commit b9dd692f authored by 皮倩雯's avatar 皮倩雯

fix: '数据库初始化日志优化升级'

parent b66e2495
Pipeline #56790 waiting for manual action with stages
...@@ -866,7 +866,7 @@ const InitDataBase = props => { ...@@ -866,7 +866,7 @@ const InitDataBase = props => {
</Button> </Button>
</Space> </Space>
<Space> <Space>
<Button {/* <Button
type="primary" type="primary"
// onClick={() => { // onClick={() => {
// getInitList(); // getInitList();
...@@ -877,7 +877,7 @@ const InitDataBase = props => { ...@@ -877,7 +877,7 @@ const InitDataBase = props => {
}} }}
> >
数据库初始化 数据库初始化
</Button> </Button> */}
</Space> </Space>
</Space> </Space>
</div> </div>
......
...@@ -52,7 +52,7 @@ InitDataBaseContainer { ...@@ -52,7 +52,7 @@ InitDataBaseContainer {
.initItemData1 { .initItemData1 {
height: calc(100vh - 190px); height: calc(100vh - 190px);
overflow: scroll; // overflow: scroll;
.btnBox { .btnBox {
display: flex !important; display: flex !important;
justify-content: flex-end; justify-content: flex-end;
...@@ -62,6 +62,11 @@ InitDataBaseContainer { ...@@ -62,6 +62,11 @@ InitDataBaseContainer {
margin-bottom: 10px; margin-bottom: 10px;
margin-left: 8px; margin-left: 8px;
} }
// .ant-checkbox-wrapper {
// width: 298px;
// margin-bottom: 10px;
// margin-left: 8px;
// }
.view:hover { .view:hover {
cursor: not-allowed; cursor: not-allowed;
} }
...@@ -75,7 +80,7 @@ InitDataBaseContainer { ...@@ -75,7 +80,7 @@ InitDataBaseContainer {
justify-content: flex-end; justify-content: flex-end;
} }
.ant-checkbox-wrapper { .ant-checkbox-wrapper {
width: 350px; width: 269px;
margin-bottom: 10px; margin-bottom: 10px;
margin-left: 8px; margin-left: 8px;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-07-13 16:13:03 * @Date: 2022-07-13 16:13:03
* @LastEditTime: 2022-07-28 19:24:59 * @LastEditTime: 2022-08-01 09:59:17
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -323,12 +323,12 @@ const InitModal = props => { ...@@ -323,12 +323,12 @@ const InitModal = props => {
</Button>, </Button>,
]} ]}
> >
<div className={styles.initItemData1}> <div>
{visible && ( {visible && (
<div> <div className={styles.initItemData1}>
{title && {title &&
title.map((item, index) => ( title.map((item, index) => (
<div className={styles.cardItemData} key={index}> <div key={index}>
<Divider <Divider
orientation="center" orientation="center"
style={{ style={{
......
/* eslint-disable prefer-promise-reject-errors */
/* eslint-disable no-else-return */ /* eslint-disable no-else-return */
/* eslint-disable spaced-comment */ /* eslint-disable spaced-comment */
/* eslint-disable eqeqeq */ /* eslint-disable eqeqeq */
...@@ -12,11 +13,8 @@ import { ...@@ -12,11 +13,8 @@ import {
notification, notification,
Modal, Modal,
Spin, Spin,
Tabs,
Divider, Divider,
Checkbox, Checkbox,
Row,
Col,
Popconfirm, Popconfirm,
Timeline, Timeline,
} from 'antd'; } from 'antd';
...@@ -65,7 +63,9 @@ const DatabaseInitialization = props => { ...@@ -65,7 +63,9 @@ const DatabaseInitialization = props => {
initVisible: false, // 初始化选择产品弹窗 initVisible: false, // 初始化选择产品弹窗
}); // 修改弹窗 }); // 修改弹窗
const [initVisible, setInitVisible] = useState(false); // 数据库初始化弹窗 const [initVisible, setInitVisible] = useState(false); // 数据库初始化弹窗
const [initVisibledetail, setinitVisibledetail] = useState(false); // 数据库初始化详细信息弹窗
const [initContent, setInitContent] = useState(''); // 数据库初始化内容 const [initContent, setInitContent] = useState(''); // 数据库初始化内容
const [initContentdetail, setInitContentdetail] = useState(''); // 数据库初始化详细内容
const [cardLoading, setCardLoading] = useState(false); // 初始化card Loading const [cardLoading, setCardLoading] = useState(false); // 初始化card Loading
const [finish, setFinish] = useState(false); const [finish, setFinish] = useState(false);
const [initLoading, setInitLoading] = useState(false); const [initLoading, setInitLoading] = useState(false);
...@@ -92,11 +92,14 @@ const DatabaseInitialization = props => { ...@@ -92,11 +92,14 @@ const DatabaseInitialization = props => {
const [keepMsg, setkeepMsg] = useState(''); const [keepMsg, setkeepMsg] = useState('');
const [keepState, setKeepState] = useState(0); const [keepState, setKeepState] = useState(0);
const [allLength, setAllLength] = useState(''); const [allLength, setAllLength] = useState('');
const [beforeColor, setbeforeColor] = useState('gray');
const [firstColor, setfirstColor] = useState('gray'); const [firstColor, setfirstColor] = useState('gray');
const [secordColor, setsecordColor] = useState('gray'); const [secordColor, setsecordColor] = useState('gray');
const [lastColor, setLastColor] = useState('gray'); const [lastColor, setLastColor] = useState('gray');
const [totalProduct, setTotalProduct] = useState(''); const [totalProduct, setTotalProduct] = useState('');
const [simpleProduct, setSimpleProduct] = useState(''); const [simpleProduct, setSimpleProduct] = useState('');
const [loads, setLoads] = useState(true);
const [show, setShow] = useState('hidden');
// 获取数据库配置信息 // 获取数据库配置信息
useEffect(() => { useEffect(() => {
...@@ -105,11 +108,11 @@ const DatabaseInitialization = props => { ...@@ -105,11 +108,11 @@ const DatabaseInitialization = props => {
// form.setFieldsValue({ ip: '127.0.0.1', password: 'sa', userName: 'sa' }); // form.setFieldsValue({ ip: '127.0.0.1', password: 'sa', userName: 'sa' });
GetDb(); GetDb();
}, []); }, []);
const getProductList = () => { const getProductList = () => {
GetProductList().then(res => { GetProductList().then(res => {
setCardLoading(false); setCardLoading(false);
if (res.code === 0) { if (res.code === 0) {
console.log(res.data);
setKeepData(res.data); setKeepData(res.data);
let arr = formateArrDataA(res.data, 'productName'); let arr = formateArrDataA(res.data, 'productName');
let aa = Object.keys(arr); let aa = Object.keys(arr);
...@@ -120,9 +123,6 @@ const DatabaseInitialization = props => { ...@@ -120,9 +123,6 @@ const DatabaseInitialization = props => {
}); });
arr[i] = list; arr[i] = list;
}); });
console.log(aa);
console.log(arr);
console.log(keepProduct);
setAllLength(res.data.length); setAllLength(res.data.length);
setTitle(aa); setTitle(aa);
setData(arr); setData(arr);
...@@ -179,7 +179,6 @@ const DatabaseInitialization = props => { ...@@ -179,7 +179,6 @@ const DatabaseInitialization = props => {
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
if (res.data.content) { if (res.data.content) {
setInitLoading(false);
let arr = []; let arr = [];
arr.push( arr.push(
res.data.content.split(/(\r\n)|(\n)/).map((item, index) => ( res.data.content.split(/(\r\n)|(\n)/).map((item, index) => (
...@@ -196,7 +195,9 @@ const DatabaseInitialization = props => { ...@@ -196,7 +195,9 @@ const DatabaseInitialization = props => {
doInitLog(); doInitLog();
}, 600); }, 600);
} else { } else {
setLoads(false);
setInitLoading(false); setInitLoading(false);
setShow('visible');
if (time) { if (time) {
clearTimeout(time); clearTimeout(time);
time = null; time = null;
...@@ -209,6 +210,30 @@ const DatabaseInitialization = props => { ...@@ -209,6 +210,30 @@ const DatabaseInitialization = props => {
}); });
}; };
// 获取详细日志
const doInitLogdetali = () => {
getInitDBLogNew({ isAllInitDBLog: true })
.then(res => {
if (res.code === 0) {
if (res.data.content) {
let arr = [];
arr.push(
res.data.content.split(/(\r\n)|(\n)/).map((item, index) => (
// eslint-disable-next-line react/no-danger
<p key={index} dangerouslySetInnerHTML={{ __html: item }} />
)),
);
console.log(arr);
setInitContentdetail(arr);
scroll.current.scrollTop = scroll.current.scrollHeight;
}
}
})
.catch(err => {
console.log(err);
});
};
const onValuesChange = (value, b) => { const onValuesChange = (value, b) => {
form.setFieldsValue(value); form.setFieldsValue(value);
}; };
...@@ -219,6 +244,18 @@ const DatabaseInitialization = props => { ...@@ -219,6 +244,18 @@ const DatabaseInitialization = props => {
}); });
}; };
const handlelook = () => {
setinitVisibledetail(true);
doInitLogdetali();
};
// 关闭弹窗
const handleClickdetail = () => {
setinitVisibledetail(false);
setInitContentdetail('');
setFinish(false);
};
// 关闭弹窗 // 关闭弹窗
const handleClick = () => { const handleClick = () => {
setInitVisible(false); setInitVisible(false);
...@@ -324,9 +361,9 @@ const DatabaseInitialization = props => { ...@@ -324,9 +361,9 @@ const DatabaseInitialization = props => {
if (res.data.DBExists) { if (res.data.DBExists) {
setCheckboxFlag(1); setCheckboxFlag(1);
setMsg('当前数据库已存在不可初始化'); setMsg('当前数据库已存在不可初始化');
notification.warning({ notification.error({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: '当前数据库已存在不可初始化', description: '当前数据库已存在不可初始化',
}); });
} else if (!res.data.DBExists && !res.data.Project[0]) { } else if (!res.data.DBExists && !res.data.Project[0]) {
...@@ -334,22 +371,22 @@ const DatabaseInitialization = props => { ...@@ -334,22 +371,22 @@ const DatabaseInitialization = props => {
setMsg(''); setMsg('');
notification.warning({ notification.warning({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: '未检测到License,自主选择产品进行数据库初始化', description: '未检测到License,自主选择产品进行数据库初始化',
}); });
} else if (!res.data.DBExists && res.data.Project[0]) { } else if (!res.data.DBExists && res.data.Project[0]) {
setCheckboxFlag(1); setCheckboxFlag(1);
notification.success({ notification.success({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: '已检测到License,需初始化数据库', description: '已检测到License,需初始化数据库',
}); });
setMsg(''); setMsg('');
} }
} else { } else {
notification.warning({ notification.error({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: res.msg, description: res.msg,
}); });
} }
...@@ -416,9 +453,9 @@ const DatabaseInitialization = props => { ...@@ -416,9 +453,9 @@ const DatabaseInitialization = props => {
setDbExists(res.data.DBExists); setDbExists(res.data.DBExists);
setKeepDb(res.data); setKeepDb(res.data);
} else { } else {
notification.warning({ notification.error({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: res.msg, description: res.msg,
}); });
} }
...@@ -434,7 +471,6 @@ const DatabaseInitialization = props => { ...@@ -434,7 +471,6 @@ const DatabaseInitialization = props => {
let productSetting = e; let productSetting = e;
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
// 数据库存在调用编辑接口否则调用新增接口 // 数据库存在调用编辑接口否则调用新增接口
setInitLoading(true);
handleShowModal('initVisible', false); handleShowModal('initVisible', false);
setInitVisible(true); setInitVisible(true);
doInitLog(); doInitLog();
...@@ -469,11 +505,7 @@ const DatabaseInitialization = props => { ...@@ -469,11 +505,7 @@ const DatabaseInitialization = props => {
// return; // return;
// } // }
NewInitAddDataBase({ ...obj, productSetting }).then(res => { NewInitAddDataBase({ ...obj, productSetting }).then(res => {
setInitLoading(false);
if (res.code === 0) { if (res.code === 0) {
console.log(value);
console.log(keepProduct);
console.log(123231);
if (value.length > 0) { if (value.length > 0) {
setKeepProduct(value); setKeepProduct(value);
} }
...@@ -488,7 +520,7 @@ const DatabaseInitialization = props => { ...@@ -488,7 +520,7 @@ const DatabaseInitialization = props => {
}); });
notification.success({ notification.success({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: '数据库初始化成功', description: '数据库初始化成功',
}); });
setkeepNumber(''); setkeepNumber('');
...@@ -504,7 +536,7 @@ const DatabaseInitialization = props => { ...@@ -504,7 +536,7 @@ const DatabaseInitialization = props => {
setLastColor('gray'); setLastColor('gray');
notification.error({ notification.error({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: res.msg, description: res.msg,
}); });
} }
...@@ -512,7 +544,10 @@ const DatabaseInitialization = props => { ...@@ -512,7 +544,10 @@ const DatabaseInitialization = props => {
}; };
const flagChange = () => { const flagChange = () => {
console.log(888); setbeforeColor('gray');
setfirstColor('gray');
setsecordColor('gray');
setLastColor('gray');
setSimpleProduct(''); setSimpleProduct('');
setTotalProduct(''); setTotalProduct('');
setValue(''); setValue('');
...@@ -520,7 +555,6 @@ const DatabaseInitialization = props => { ...@@ -520,7 +555,6 @@ const DatabaseInitialization = props => {
setKeepValue([]); setKeepValue([]);
setProduct([]); setProduct([]);
onCheck(); onCheck();
// deleteInitDBLogNew();
}; };
const onChange1 = (e, item) => { const onChange1 = (e, item) => {
...@@ -585,14 +619,15 @@ const DatabaseInitialization = props => { ...@@ -585,14 +619,15 @@ const DatabaseInitialization = props => {
if (res.code == 0) { if (res.code == 0) {
// 数据库不存在 // 数据库不存在
if (res.data === false) { if (res.data === false) {
setbeforeColor('green');
// 有授权码 // 有授权码
if (keepNumber) { if (keepNumber) {
setCheckboxFlag(1); setCheckboxFlag(1);
setDbExists(false); setDbExists(false);
setMsg(''); setMsg('');
notification.warning({ notification.success({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: '已检测到License,需初始化数据库', description: '已检测到License,需初始化数据库',
}); });
} else { } else {
...@@ -601,16 +636,17 @@ const DatabaseInitialization = props => { ...@@ -601,16 +636,17 @@ const DatabaseInitialization = props => {
setMsg(''); setMsg('');
notification.warning({ notification.warning({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: '未检测到License,自主选择产品进行数据库初始化', description: '未检测到License,自主选择产品进行数据库初始化',
}); });
} }
} else { } else {
setbeforeColor('red');
setCheckboxFlag(1); setCheckboxFlag(1);
setMsg('当前数据库已存在不可初始化'); setMsg('当前数据库已存在不可初始化');
notification.warning({ notification.error({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: '当前数据库已存在不可初始化', description: '当前数据库已存在不可初始化',
}); });
} }
...@@ -619,7 +655,7 @@ const DatabaseInitialization = props => { ...@@ -619,7 +655,7 @@ const DatabaseInitialization = props => {
setCheckboxFlag(1); setCheckboxFlag(1);
notification.error({ notification.error({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: res.msg, description: res.msg,
}); });
} }
...@@ -631,38 +667,42 @@ const DatabaseInitialization = props => { ...@@ -631,38 +667,42 @@ const DatabaseInitialization = props => {
CheckDatabaseIsExist({ ...obj }).then(res => { CheckDatabaseIsExist({ ...obj }).then(res => {
if (res.code === 0) { if (res.code === 0) {
if (res.data === true) { if (res.data === true) {
setbeforeColor('red');
GetDbChange();
deleteInitDBLogNew();
setCheckboxFlag(1); setCheckboxFlag(1);
setMsg('当前数据库已存在不可初始化'); setMsg('当前数据库已存在不可初始化');
notification.warning({ notification.error({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: '当前数据库已存在不可初始化', description: '当前数据库已存在不可初始化',
}); });
} else { } else {
setbeforeColor('green');
setDbExists(false); setDbExists(false);
setMsg(''); setMsg('');
if (msg) { if (msg) {
notification.warning({ notification.error({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: '当前数据库不可初始化', description: '当前数据库不可初始化',
}); });
} else if (obj.ip == '' || obj.userName == '' || obj.password == '' || obj.dbName == '') { } else if (obj.ip == '' || obj.userName == '' || obj.password == '' || obj.dbName == '') {
notification.warning({ notification.warning({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: '请输入完整数据库信息', description: '请输入完整数据库信息',
}); });
} else if (checkboxFlag == 0 && value.length == 0) { } else if (checkboxFlag == 0 && value.length == 0) {
notification.warning({ notification.warning({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: '请勾选产品', description: '请勾选产品',
}); });
} else if (checkboxFlag == 1 && keepProduct.length == 0) { } else if (checkboxFlag == 1 && keepProduct.length == 0) {
notification.warning({ notification.warning({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: '请勾选产品', description: '请勾选产品',
}); });
} else { } else {
...@@ -690,7 +730,7 @@ const DatabaseInitialization = props => { ...@@ -690,7 +730,7 @@ const DatabaseInitialization = props => {
setCheckboxFlag(1); setCheckboxFlag(1);
notification.error({ notification.error({
message: '提示', message: '提示',
duration: 5, duration: 3,
description: res.msg, description: res.msg,
}); });
} }
...@@ -701,16 +741,16 @@ const DatabaseInitialization = props => { ...@@ -701,16 +741,16 @@ const DatabaseInitialization = props => {
}; };
const save = () => { const save = () => {
if ( flagChange();
form.getFieldValue().ip &&
form.getFieldValue().userName &&
form.getFieldValue().password &&
form.getFieldValue().dbName
) {
flagChange();
}
}; };
useEffect(() => {
if (!initVisible) {
setLoads(true);
setShow('hidden');
}
}, [initVisible]);
return ( return (
<> <>
<PageContainer className={styles.InitDataBaseContainer}> <PageContainer className={styles.InitDataBaseContainer}>
...@@ -735,6 +775,7 @@ const DatabaseInitialization = props => { ...@@ -735,6 +775,7 @@ const DatabaseInitialization = props => {
if (form.getFieldValue().ip == '') { if (form.getFieldValue().ip == '') {
return Promise.reject('ip必填'); return Promise.reject('ip必填');
} }
setbeforeColor('gray');
setfirstColor('gray'); setfirstColor('gray');
setsecordColor('gray'); setsecordColor('gray');
setLastColor('gray'); setLastColor('gray');
...@@ -754,6 +795,7 @@ const DatabaseInitialization = props => { ...@@ -754,6 +795,7 @@ const DatabaseInitialization = props => {
if (form.getFieldValue().userName == '') { if (form.getFieldValue().userName == '') {
return Promise.reject('用户名称必填'); return Promise.reject('用户名称必填');
} }
setbeforeColor('gray');
setfirstColor('gray'); setfirstColor('gray');
setsecordColor('gray'); setsecordColor('gray');
setLastColor('gray'); setLastColor('gray');
...@@ -774,6 +816,7 @@ const DatabaseInitialization = props => { ...@@ -774,6 +816,7 @@ const DatabaseInitialization = props => {
if (form.getFieldValue().password == '') { if (form.getFieldValue().password == '') {
return Promise.reject('用户密码必填'); return Promise.reject('用户密码必填');
} }
setbeforeColor('gray');
setfirstColor('gray'); setfirstColor('gray');
setsecordColor('gray'); setsecordColor('gray');
setLastColor('gray'); setLastColor('gray');
...@@ -797,6 +840,7 @@ const DatabaseInitialization = props => { ...@@ -797,6 +840,7 @@ const DatabaseInitialization = props => {
) { ) {
return Promise.reject('数据库名称必填'); return Promise.reject('数据库名称必填');
} }
setbeforeColor('gray');
setfirstColor('gray'); setfirstColor('gray');
setsecordColor('gray'); setsecordColor('gray');
setLastColor('gray'); setLastColor('gray');
...@@ -813,6 +857,7 @@ const DatabaseInitialization = props => { ...@@ -813,6 +857,7 @@ const DatabaseInitialization = props => {
</div> </div>
<div style={{ marginTop: '100px', transform: 'scal(1.5)' }}> <div style={{ marginTop: '100px', transform: 'scal(1.5)' }}>
<Timeline> <Timeline>
<Timeline.Item color={beforeColor}>环境检查通过</Timeline.Item>
<Timeline.Item color={firstColor}>数据库初始化完成</Timeline.Item> <Timeline.Item color={firstColor}>数据库初始化完成</Timeline.Item>
<Timeline.Item color={secordColor}> <Timeline.Item color={secordColor}>
<p>产品授权打开已初始化的产品</p> <p>产品授权打开已初始化的产品</p>
...@@ -880,7 +925,7 @@ const DatabaseInitialization = props => { ...@@ -880,7 +925,7 @@ const DatabaseInitialization = props => {
<div className={styles1.initItemData}> <div className={styles1.initItemData}>
{title && {title &&
title.map((item, index) => ( title.map((item, index) => (
<div key={index}> <div key={index} style={{ marginBottom: '10px' }}>
<Divider <Divider
orientation="center" orientation="center"
style={{ style={{
...@@ -954,12 +999,21 @@ const DatabaseInitialization = props => { ...@@ -954,12 +999,21 @@ const DatabaseInitialization = props => {
// overflowY: 'auto', // overflowY: 'auto',
}} }}
footer={[ footer={[
<Button
style={{ visibility: show }}
onClick={() => {
handlelook();
}}
>
查看详细信息
</Button>,
<Button <Button
onClick={() => { onClick={() => {
handleClick(); handleClick();
}} }}
key="back" key="back"
type="primary" type="primary"
loading={initLoading}
> >
关闭窗口 关闭窗口
</Button>, </Button>,
...@@ -973,12 +1027,50 @@ const DatabaseInitialization = props => { ...@@ -973,12 +1027,50 @@ const DatabaseInitialization = props => {
marginRight: ' -24px', marginRight: ' -24px',
}} }}
> >
{initContent || ( {initContent}
<Spin </div>
spinning={initLoading} <div style={{ position: 'relative' }}>
tip="loading..." <Spin
style={{ width: '100%', marginTop: '40px' }} spinning={initLoading}
/> tip="loading..."
style={{ width: '100%', marginTop: '40px' }}
/>
</div>
</Modal>
<Modal
title="初始化数据库详细日志"
visible={initVisibledetail}
onCancel={() => {
setinitVisibledetail(false);
setInitContentdetail('');
}}
width={900}
maskClosable={false}
bodyStyle={{
height: '600px',
// overflowY: 'auto',
}}
footer={[
<Button
onClick={() => {
handleClickdetail();
}}
key="back"
>
关闭窗口
</Button>,
]}
>
<div
ref={scroll}
style={{
maxHeight: '560px',
overflowY: 'auto',
marginRight: ' -24px',
}}
>
{initContentdetail || (
<Spin tip="loading..." style={{ width: '100%', marginTop: '40px' }} />
)} )}
</div> </div>
</Modal> </Modal>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-01-13 17:26:14 * @Date: 2022-01-13 17:26:14
* @LastEditTime: 2022-03-22 16:22:07 * @LastEditTime: 2022-08-02 14:10:39
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
...@@ -27,7 +27,7 @@ const AddModal = props => { ...@@ -27,7 +27,7 @@ const AddModal = props => {
}) })
.then(res => { .then(res => {
setLoading(false); setLoading(false);
if (res.msg === '') { if (res.code === 0) {
form.resetFields(); form.resetFields();
notification.success({ notification.success({
message: '通知', message: '通知',
...@@ -39,7 +39,7 @@ const AddModal = props => { ...@@ -39,7 +39,7 @@ const AddModal = props => {
notification.error({ notification.error({
message: '提示', message: '提示',
duration: 3, duration: 3,
description: res.message, description: res.msg,
}); });
} }
}) })
......
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