Commit 3087d3c4 authored by 皮倩雯's avatar 皮倩雯

fix: '数据库初始化功能'

parent 0533f22c
Pipeline #56516 passed with stages
...@@ -6,15 +6,16 @@ ...@@ -6,15 +6,16 @@
} }
.tCenter { .tCenter {
text-align: center; text-align: center;
.btnBox {
display: flex !important;
justify-content: space-between;
}
} }
.decsBox { .decsBox {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
} }
.btnBox {
display: flex !important;
justify-content: space-between;
}
.ant-modal-header { .ant-modal-header {
height: 70px; height: 70px;
} }
...@@ -28,6 +29,7 @@ InitDataBaseContainer { ...@@ -28,6 +29,7 @@ InitDataBaseContainer {
margin-top: 10px; margin-top: 10px;
border: 1px solid #ecf0fa; border: 1px solid #ecf0fa;
border-top: none; border-top: none;
.ant-tabs-nav { .ant-tabs-nav {
background-color: #f4f6fc; background-color: #f4f6fc;
.ant-tabs-tab { .ant-tabs-tab {
...@@ -48,9 +50,32 @@ InitDataBaseContainer { ...@@ -48,9 +50,32 @@ InitDataBaseContainer {
} }
} }
.initItemData1 {
height: calc(100vh - 190px);
overflow: scroll;
.btnBox {
display: flex !important;
justify-content: flex-end;
}
.ant-checkbox-wrapper {
width: 298px;
margin-bottom: 10px;
margin-left: 8px;
}
.view:hover {
cursor: not-allowed;
}
}
.initItemData { .initItemData {
height: calc(100vh - 190px);
overflow: scroll;
.btnBox {
display: flex !important;
justify-content: flex-end;
}
.ant-checkbox-wrapper { .ant-checkbox-wrapper {
width: 300px; width: 350px;
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-26 13:35:37 * @LastEditTime: 2022-07-28 19:24:59
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
...@@ -323,7 +323,7 @@ const InitModal = props => { ...@@ -323,7 +323,7 @@ const InitModal = props => {
</Button>, </Button>,
]} ]}
> >
<div className={styles.initItemData}> <div className={styles.initItemData1}>
{visible && ( {visible && (
<div> <div>
{title && {title &&
......
.tableTitle {
font-size: 16px;
}
.mgTop20 {
// height: calc(100vh - 170px);
}
.tCenter {
text-align: center;
}
.decsBox {
height: 32px;
line-height: 32px;
}
.btnBox {
display: flex !important;
justify-content: flex-end;
}
.ant-modal-header {
height: 70px;
}
InitDataBaseContainer {
.ant-card-body {
padding-bottom: 0px !important;
}
}
.cardContainer {
margin-top: 10px;
border: 1px solid #ecf0fa;
border-top: none;
.ant-tabs-nav {
background-color: #f4f6fc;
.ant-tabs-tab {
background-color: transparent;
border: none;
border-top: 2px solid transparent;
box-sizing: content-box;
}
.ant-tabs-tab-active {
border: none;
background-color: #fff;
border-top: 2px solid #1685ff;
}
}
.tabContainer {
padding-left: 20px;
box-sizing: border-box;
}
}
.initItemData {
.ant-checkbox-wrapper {
width: 300px;
margin-bottom: 10px;
margin-left: 8px;
}
.view:hover {
cursor: not-allowed;
}
}
...@@ -12,6 +12,7 @@ const ProductConfig = props => { ...@@ -12,6 +12,7 @@ const ProductConfig = props => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [flag, setFlag] = useState(1); const [flag, setFlag] = useState(1);
const [list, setList] = useState(new Set()); const [list, setList] = useState(new Set());
const [keepData, setKeepData] = useState(false);
// 默认展示第一项 // 默认展示第一项
// useEffect(() => { // useEffect(() => {
// setLoading(true); // setLoading(true);
...@@ -60,6 +61,8 @@ const ProductConfig = props => { ...@@ -60,6 +61,8 @@ const ProductConfig = props => {
data: { AllProducts, UserProducts }, data: { AllProducts, UserProducts },
} = res; } = res;
// setProductList(AllProducts); // setProductList(AllProducts);
console.log(res.data.IsAuthorize);
setKeepData(res.data.IsAuthorize);
setUserProductsList(UserProducts); setUserProductsList(UserProducts);
console.log(UserProducts); console.log(UserProducts);
console.log(userProductsList); console.log(userProductsList);
...@@ -185,6 +188,7 @@ const ProductConfig = props => { ...@@ -185,6 +188,7 @@ const ProductConfig = props => {
console.log(value); console.log(value);
setProductObj({ ...value }); setProductObj({ ...value });
}; };
const renderListItem = arr => ( const renderListItem = arr => (
<div style={{ marginBottom: '25px', borderBottom: '1px solid #ccc', paddingBottom: '25px' }}> <div style={{ marginBottom: '25px', borderBottom: '1px solid #ccc', paddingBottom: '25px' }}>
{arr.map(item => ( {arr.map(item => (
...@@ -199,7 +203,7 @@ const ProductConfig = props => { ...@@ -199,7 +203,7 @@ const ProductConfig = props => {
<div onClick={e => e.stopPropagation()}> <div onClick={e => e.stopPropagation()}>
<Switch <Switch
checked={item.IsUsed} checked={item.IsUsed}
// disabled disabled={keepData ? true : false}
checkedChildren="启用" checkedChildren="启用"
unCheckedChildren="关闭" unCheckedChildren="关闭"
onClick={e => { onClick={e => {
......
...@@ -22,6 +22,7 @@ import Login from '@/pages/user/login'; ...@@ -22,6 +22,7 @@ import Login from '@/pages/user/login';
import CurrentSolution from '@/pages/currentSolution/CurrentSolution'; import CurrentSolution from '@/pages/currentSolution/CurrentSolution';
// 数据库管理 // 数据库管理
import InitDataBase from '@/pages/database/InitDataBase/InitDataBase'; import InitDataBase from '@/pages/database/InitDataBase/InitDataBase';
import DatabaseInitialization from '@/pages/database/databaseInitialization/DatabaseInitialization';
import ManagementDataBase from '@/pages/database/ManagementDataBase/ManagementDataBase'; import ManagementDataBase from '@/pages/database/ManagementDataBase/ManagementDataBase';
import DatabaseConnectConfig from '@/pages/database/databaseConfig/DatabaseConfig'; import DatabaseConnectConfig from '@/pages/database/databaseConfig/DatabaseConfig';
// 用户中心 // 用户中心
...@@ -102,6 +103,12 @@ export default { ...@@ -102,6 +103,12 @@ export default {
component: BlankLayout, component: BlankLayout,
authority: superAuthority, authority: superAuthority,
routes: [ routes: [
{
path: '/dbm/dbInitializa',
name: '数据库初始化',
authority: superAuthority,
component: DatabaseInitialization,
},
{ {
path: '/dbm/dbInit', path: '/dbm/dbInit',
name: '数据库连接', name: '数据库连接',
......
...@@ -216,3 +216,15 @@ export const DeleteMainServer = params => ...@@ -216,3 +216,15 @@ export const DeleteMainServer = params =>
// 测试主站连接 // 测试主站连接
export const GetUrlConnectionTest = params => export const GetUrlConnectionTest = params =>
get(`${PUBLISH_SERVICE}/DBManager/GetUrlConnectionTest`, params); get(`${PUBLISH_SERVICE}/DBManager/GetUrlConnectionTest`, params);
export const CheckConnection = params =>
post(`${PUBLISH_SERVICE}/DBManager/CheckConnection`, params);
export const CheckDatabaseIsExist = params =>
post(`${PUBLISH_SERVICE}/DBManager/CheckDatabaseIsExist`, params);
// 给平台管理员赋值所有菜单权限
export const SetAdminMenuToRole = params =>
get(`${PUBLISH_SERVICE}/UserCenter/SetAdminMenuToRole`, params);
export const NewInitAddDataBase = params =>
post(`${PUBLISH_SERVICE}/DBManager/NewInitAddDataBase`, params);
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