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

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

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