Commit 23602c5d authored by 皮倩雯's avatar 皮倩雯

fix: '数据库初始化'

parent 3087d3c4
Pipeline #56534 passed with stages
......@@ -96,6 +96,7 @@ const DatabaseInitialization = props => {
const [secordColor, setsecordColor] = useState('gray');
const [lastColor, setLastColor] = useState('gray');
const [totalProduct, setTotalProduct] = useState('');
const [simpleProduct, setSimpleProduct] = useState('');
// 获取数据库配置信息
useEffect(() => {
......@@ -438,6 +439,12 @@ const DatabaseInitialization = props => {
duration: 5,
description: '数据库初始化成功',
});
setkeepNumber('');
setkeepNa('');
setkeepMsg('');
setkeepCo('');
setTotalProduct(res.data.productPackageSumCount);
setSimpleProduct(res.data.productPackageCount);
} else {
setFinish(true);
setfirstColor('red');
......@@ -454,6 +461,8 @@ const DatabaseInitialization = props => {
const flagChange = () => {
console.log(888);
setSimpleProduct('');
setTotalProduct('');
setValue('');
setKeepProduct([]);
// GetDb(1);
......@@ -477,6 +486,7 @@ const DatabaseInitialization = props => {
if (arr && bb != -1) {
console.log(arr);
} else {
console.log(keepValue);
let aa = keepValue;
aa[item] = e;
let a = Object.keys(aa);
......@@ -514,37 +524,46 @@ const DatabaseInitialization = props => {
console.log(99999999);
let obj = form.getFieldsValue();
CheckDatabaseIsExist({ ...obj }).then(res => {
// 数据库不存在
if (res.data === false) {
console.log(555);
// 有授权码
if (keepNumber) {
GetDb(1);
setCheckboxFlag(1);
setDbExists(false);
setMsg('');
notification.warning({
message: '提示',
duration: 5,
description: '已检测到License,需初始化数据库',
});
if (res.code == 0) {
// 数据库不存在
if (res.data === false) {
console.log(555);
// 有授权码
if (keepNumber) {
GetDb(1);
setCheckboxFlag(1);
setDbExists(false);
setMsg('');
notification.warning({
message: '提示',
duration: 5,
description: '已检测到License,需初始化数据库',
});
} else {
setCheckboxFlag(0);
setDbExists(false);
setMsg('');
notification.warning({
message: '提示',
duration: 5,
description: '未检测到License,自主选择产品进行数据库初始化',
});
}
} else {
setCheckboxFlag(0);
setDbExists(false);
setMsg('');
setCheckboxFlag(1);
setMsg('当前数据库已存在不可初始化');
notification.warning({
message: '提示',
duration: 5,
description: '未检测到License,自主选择产品进行数据库初始化',
description: '当前数据库已存在不可初始化',
});
}
} else {
setCheckboxFlag(1);
setMsg('当前数据库已存在不可初始化');
setMsg(res.msg);
notification.warning({
message: '提示',
duration: 5,
description: '当前数据库已存在不可初始化',
description: res.msg,
});
}
});
......@@ -654,7 +673,7 @@ const DatabaseInitialization = props => {
},
]}
>
<Input placeholder="请输入服务器名或IP地址" onBlur={save} />
<Input placeholder="请输入服务器名或IP地址" />
</Form.Item>
<Form.Item
label={`${formLables.userName}:`}
......@@ -681,7 +700,7 @@ const DatabaseInitialization = props => {
},
]}
>
<Input placeholder="请输入用户名称" onBlur={save} />
<Input placeholder="请输入用户名称" />
</Form.Item>
<Form.Item
label={`${formLables.password}:`}
......@@ -709,7 +728,7 @@ const DatabaseInitialization = props => {
},
]}
>
<Input placeholder="请输入用户密码" type="password" onBlur={save} />
<Input placeholder="请输入用户密码" type="password" />
</Form.Item>
<Form.Item
label={`${formLables.dbName}:`}
......@@ -740,7 +759,7 @@ const DatabaseInitialization = props => {
},
]}
>
<Input placeholder="请输入数据库名称" onBlur={save} />
<Input placeholder="请输入数据库名称" />
{/* <Select
showSearch
mode="tags"
......@@ -771,11 +790,24 @@ const DatabaseInitialization = props => {
</Select> */}
</Form.Item>
</Form>
<div style={{ marginTop: '50px', transform: 'scal(1.5)' }}>
<div style={{ float: 'right' }}>
<Button onClick={save}>环境检查</Button>
</div>
<div style={{ marginTop: '100px', transform: 'scal(1.5)' }}>
<Timeline>
<Timeline.Item color={firstColor}>数据库初始化完成</Timeline.Item>
<Timeline.Item color={secordColor}>
<p>产品授权打开已初始化的产品</p>
{/* {console.log(simpleProduct)}
{console.log(totalProduct)} */}
{/* {simpleProduct ? ( */}
<p>
已打开<span style={{ color: 'rgb(24 144 255)' }}>{simpleProduct}</span>/
<span style={{ color: 'rgb(24 144 255)' }}>{totalProduct}</span>个产品
</p>
{/* ) : (
<></>
)} */}
</Timeline.Item>
<Timeline.Item color={lastColor}>
<p>平台管理员勾选所有菜单权限</p>
......
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