Commit fc549f49 authored by Maofei94's avatar Maofei94

perf: 切换产品方案

parent 4cc667ee
Pipeline #22582 passed with stages
in 19 minutes 24 seconds
......@@ -93,6 +93,7 @@ const InitDataBase = props => {
.then(res => {
setCardLoading(false);
if (res.success) {
const { inUse } = res;
let obj = {};
Object.keys(dbForm).forEach(k => {
obj[k] = res[k];
......@@ -100,7 +101,12 @@ const InitDataBase = props => {
form.setFieldsValue(obj);
setDbForm(val => ({ ...val, ...obj }));
setAllSqulDir(res.allSqlDir);
if (res.allSqlDir.some(item => item === inUse)) {
setDefaultSqlDir(res.tableSQLDirName);
} else {
handeleChangeSQLDirName(res.allSqlDir[0]);
setDefaultSqlDir(res.allSqlDir[0]);
}
}
})
.catch(err => {
......@@ -278,8 +284,11 @@ const InitDataBase = props => {
};
// 产品方案选择框回调
const handleSelect = value => {
handeleChangeSQLDirName(value);
};
const handeleChangeSQLDirName = val => {
setTableSQLDirName({
dirName: value,
dirName: val,
_version: 9999,
_dc: new Date().getTime(),
})
......@@ -288,7 +297,7 @@ const InitDataBase = props => {
notification.success({
message: '提示',
duration: 3,
description: `已切换初始化脚本为:${value}`,
description: `已切换初始化脚本为:${val}`,
});
} else {
notification.error({
......
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