Commit 4cc667ee authored by Maofei94's avatar Maofei94

fix: 数据库初始化log

parent f0efdd11
Pipeline #22533 passed with stages
in 18 minutes 40 seconds
......@@ -116,13 +116,19 @@ const InitDataBase = props => {
})
.then(res => {
if (res.success) {
let arr = [];
arr.push(
res.content
.split(/(\r\n)|(\n)/)
.map((item, index) => <p key={index}>{item}</p>),
);
setInitContent(arr);
if (res.content) {
let arr = [];
arr.push(
res.content
.split(/(\r\n)|(\n)/)
.map((item, index) => <p key={index}>{item}</p>),
);
setInitContent(arr);
scroll.current.scrollTop = scroll.current.scrollHeight;
}
if (!res.finish) {
doInitLog();
}
}
})
.catch(err => {
......@@ -136,12 +142,6 @@ const InitDataBase = props => {
setInitVisible(true);
let obj = form.getFieldsValue();
doInitLog();
for (let i = 0; i < 10; i++) {
setTimeout(() => {
doInitLog();
}, 1000);
}
initDBv4({
_version: 9999,
_dc: Date.now(),
......@@ -163,21 +163,11 @@ const InitDataBase = props => {
setCardLoading(false);
console.log(err);
});
const timer = setInterval(() => {
if (
scroll.current.scrollHeight ===
scroll.current.clientHeight + scroll.current.scrollTop
) {
clearInterval(timer);
}
scroll.current.scrollTo(0, scroll.current.scrollHeight - 570);
}, 1000);
};
const onValuesChange = (value, b) => {
form.setFieldsValue(value);
};
const onChange = value => {
console.log(value);
const { length } = value;
form.setFieldsValue({
dbName: value[length - 1],
......@@ -280,7 +270,6 @@ const InitDataBase = props => {
};
// 点击表格回显到表单
const tableClick = item => {
console.log(item);
let obj = { ...dbForm };
Object.keys(obj).forEach(k => {
obj[k] = item[k];
......@@ -346,7 +335,6 @@ const InitDataBase = props => {
desc,
})
.then(res => {
console.log(res);
setModalVisible(false);
setUpData(upData + 1);
})
......@@ -588,6 +576,10 @@ const InitDataBase = props => {
onCancel={() => {
setInitVisible(false);
setInitContent('');
deleteInitDBLog({
_version: 9999,
_dc: Date.now(),
});
}}
width={800}
maskClosable={false}
......@@ -615,7 +607,11 @@ const InitDataBase = props => {
}}
>
{initContent || (
<Spin spinning style={{ width: '100%', marginTop: '40px' }} />
<Spin
spinning
tip="loading..."
style={{ width: '100%', marginTop: '40px' }}
/>
)}
</div>
</Modal>
......
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