Commit bb3e1de2 authored by 张烨's avatar 张烨
parents cf20c7b5 2e55f28e
......@@ -2,11 +2,17 @@ import React, { useState, useEffect, useCallback, useRef } from 'react';
import { Spin, Button } from 'antd';
import ListCardItem from './ItemCard';
import { get, post } from '@/services';
import { orgTest } from '@/services/orgnazation/api';
import styles from './ItemCard.less';
const tip = 'loading...';
const ListCard = props => {
const { ouid, searchWord, valueCallback, onCommit = () => {} } = props;
const {
ouid,
searchWord,
valueCallback,
onCommit = () => {},
itemObj,
} = props;
const [valueList, setValueList] = useState({});
const [dataList, setdataList] = useState([]);
const [loading, setLoading] = useState(true);
......@@ -16,7 +22,7 @@ const ListCard = props => {
setValueList({ ...valueList });
valueCallback({ ...valueList });
}, []);
console.log(itemObj, 'itemObj');
useEffect(() => {
setLoading(true);
const defaultConfig = {
......@@ -30,9 +36,9 @@ const ListCard = props => {
get('/Cityinterface/rest/services/OMS.svc/W4_GetMenuByRoleWithLevel', {
// OUID:ouid||'',
// stationID: ouid || '',
roleID: ouid,
subSystemValue: 'city',
subSystemName: 'city',
roleID: itemObj.roleID,
subSystemValue: itemObj.subSystemValue,
subSystemName: itemObj.subSystemValue,
_version: 9999,
_dc: new Date().getTime(),
})
......@@ -98,13 +104,11 @@ const ListCard = props => {
</>
)}
{true && !loading && dataList && (
<Button
type="primary"
onClick={() => onCommit(valueList)}
style={{ marginTop: '20px' }}
>
提交
</Button>
<div className={styles.btnBox}>
<Button type="primary" onClick={() => onCommit(valueList)}>
提交
</Button>
</div>
)}
</div>
);
......
......@@ -12,7 +12,7 @@
}
.topCheckbox{
height: 20px;
margin: -10px 0 0 20px;
margin: -10px 0 0 0px;
line-height: 20px;
}
.checkdiv {
......@@ -25,7 +25,7 @@
.divSingle{
border: none;
margin-top: 20px;
flex:0 0 150px;
flex:0 0 200px;
background: transparent;
}
.isSearch{
......@@ -33,9 +33,17 @@
background-color: yellow;
}
.boldLabel{
font-size: 14px;
font-size: 15px;
font-weight: bold;
background-color: #fff;
}
.btnBox{
position: sticky;
bottom: 0px;
background-color: #fff;
width: 100%;
height: 80px;
padding: 0 20px;
display: flex;
align-items: center;
}
\ No newline at end of file
......@@ -190,7 +190,7 @@ const InitDataBase = props => {
if (res.GetMe === true) {
setUpData(upData + 1);
notification.success({
message: '通知',
message: '提示',
duration: 3,
description: '保存成功',
});
......@@ -535,11 +535,16 @@ const InitDataBase = props => {
}}
>
{allSqlDir &&
allSqlDir.map((item, index) => (
<Option value={item} key={index}>
{item}
</Option>
))}
allSqlDir.map((item, index) => {
if (item === '产品方案 (GCK平台)') {
return null;
}
return (
<Option value={item} key={index}>
{item}
</Option>
);
})}
</Select>
)}
</Space>
......
......@@ -119,7 +119,9 @@ const ManagementDataBase = () => {
const handleLog = text => {
console.log(text);
let arr = [];
arr.push(text.split(/(\r\n)|(\n)/).map(item => <p>{item}</p>));
arr.push(
text.split(/(\r\n)|(\n)/).map((item, index) => <p key={index}>{item}</p>),
);
setModalVisible(true);
// setContent(text);
setContent(arr);
......
......@@ -164,12 +164,25 @@ const MongDBTable = props => {
dataIndex: 'options',
key: 'options',
render: (val, item) => [
<Tag color="#2db7f5" onClick={() => handleCon(val, item)}>
<Button
size="small"
type="primary"
onClick={() => handleCon(val, item)}
>
测试连接
</Tag>,
<Tag color="gold" onClick={() => handleEdit(val, item)}>
</Button>,
<Button
style={{
margin: '0 10px',
backgroundColor: '#fffbe6',
color: '#faad14',
borderColor: '#ffe58f',
}}
size="small"
onClick={() => handleEdit(val, item)}
>
编辑
</Tag>,
</Button>,
<Popconfirm
title={`是否删除连接${item.name}`}
cancelText="取消"
......@@ -177,7 +190,9 @@ const MongDBTable = props => {
// placement="right"
onConfirm={() => handleDel(val, item)}
>
<Tag color="#f50">删除</Tag>
<Button size="small" danger>
删除
</Button>
</Popconfirm>,
],
},
......@@ -202,31 +217,31 @@ const MongDBTable = props => {
>
添加MongDB数据库连接
</Button>,
<Popconfirm
title={
<div>
<p>
是否将confcenter、citytemp、buffile、log文件内容迁移至
Mongodb数据库中(会覆盖重名文件)?
</p>
<p>(连接配置取标签mongodb)</p>
</div>
}
cancelText="取消"
okText="确认"
onConfirm={handleConfirm}
placement="rightTop"
>
<Button
style={{
color: '#fff',
background: '#e6a23c',
borderColor: '#f5dab1',
}}
>
文件迁移
</Button>
</Popconfirm>,
// <Popconfirm
// title={
// <div>
// <p>
// 是否将confcenter、citytemp、buffile、log文件内容迁移至
// Mongodb数据库中(会覆盖重名文件)?
// </p>
// <p>(连接配置取标签mongodb)</p>
// </div>
// }
// cancelText="取消"
// okText="确认"
// onConfirm={handleConfirm}
// placement="rightTop"
// >
// <Button
// style={{
// color: '#fff',
// background: '#e6a23c',
// borderColor: '#f5dab1',
// }}
// >
// 文件迁移
// </Button>
// </Popconfirm>,
]}
/>
<AddModal
......
......@@ -144,12 +144,25 @@ const MySQLTable = props => {
key: 'options',
width: 300,
render: (val, item) => [
<Tag color="#2db7f5" onClick={() => handleCon(val, item)}>
<Button
size="small"
type="primary"
onClick={() => handleCon(val, item)}
>
测试连接
</Tag>,
<Tag color="gold" onClick={() => handleEdit(val, item)}>
</Button>,
<Button
style={{
margin: '0 10px',
backgroundColor: '#fffbe6',
color: '#faad14',
borderColor: '#ffe58f',
}}
size="small"
onClick={() => handleEdit(val, item)}
>
编辑
</Tag>,
</Button>,
<Popconfirm
title={`是否删除连接${item.name}`}
cancelText="取消"
......@@ -157,7 +170,9 @@ const MySQLTable = props => {
// placement="right"
onConfirm={() => handleDel(val, item)}
>
<Tag color="#f50">删除</Tag>
<Button size="small" danger>
删除
</Button>
</Popconfirm>,
],
},
......
......@@ -137,12 +137,25 @@ const OracleTable = props => {
key: 'options',
width: 300,
render: (val, item) => [
<Tag color="#2db7f5" onClick={() => handleCon(val, item)}>
<Button
size="small"
type="primary"
onClick={() => handleCon(val, item)}
>
测试连接
</Tag>,
<Tag color="gold" onClick={() => handleEdit(val, item)}>
</Button>,
<Button
style={{
margin: '0 10px',
backgroundColor: '#fffbe6',
color: '#faad14',
borderColor: '#ffe58f',
}}
size="small"
onClick={() => handleEdit(val, item)}
>
编辑
</Tag>,
</Button>,
<Popconfirm
title={`是否删除连接${item.name}`}
cancelText="取消"
......@@ -150,7 +163,9 @@ const OracleTable = props => {
// placement="right"
onConfirm={() => handleDel(val, item)}
>
<Tag color="#f50">删除</Tag>
<Button size="small" danger>
删除
</Button>
</Popconfirm>,
],
},
......
import React, { useEffect, useState } from 'react';
import ProTable from '@ant-design/pro-table';
import { Button, Tag, Popconfirm, notification } from 'antd';
import { Button, Popconfirm, notification } from 'antd';
import {
getSQLServerConnString,
deleteConnString,
......@@ -144,12 +144,25 @@ const SQLServerTable = props => {
key: 'options',
width: 300,
render: (val, item) => [
<Tag color="#2db7f5" onClick={() => handleCon(val, item)}>
<Button
size="small"
type="primary"
onClick={() => handleCon(val, item)}
>
测试连接
</Tag>,
<Tag color="gold" onClick={() => handleEdit(val, item)}>
</Button>,
<Button
style={{
margin: '0 10px',
backgroundColor: '#fffbe6',
color: '#faad14',
borderColor: '#ffe58f',
}}
size="small"
onClick={() => handleEdit(val, item)}
>
编辑
</Tag>,
</Button>,
<Popconfirm
title={`是否删除连接${item.name}`}
cancelText="取消"
......@@ -157,7 +170,9 @@ const SQLServerTable = props => {
// placement="right"
onConfirm={() => handleDel(val, item)}
>
<Tag color="#f50">删除</Tag>
<Button size="small" danger>
删除
</Button>
</Popconfirm>,
],
},
......
......@@ -2,7 +2,7 @@ import React, { useState, useEffect, useCallback, useRef } from 'react';
import { Spin, Button } from 'antd';
import ListCardItem from './listCardItem';
import { get, post } from '../../services';
import { orgTest } from '@/services/orgnazation/api';
import styles from './listCardItem.less';
const tip = 'loading...';
const ListCard = props => {
......@@ -76,13 +76,11 @@ const ListCard = props => {
))
)}
{true && !loading && dataList && (
<Button
type="primary"
onClick={() => onCommit()}
style={{ marginTop: '20px' }}
>
提交
</Button>
<div className={styles.btnBox}>
<Button type="primary" onClick={() => onCommit()}>
提交
</Button>
</div>
)}
</div>
);
......
......@@ -5,22 +5,46 @@
border: 1px solid #b5b8c8;
margin-top: 20px;
min-height: 50px;
padding: 10px 20px;
.topCheckbox{
height: 20px;
background-color: #fff;
margin: -10px 0 0 20px;
margin: -20px 0 0 0;
font-weight: bold;
line-height: 20px;
span{
font-size: 15px;
}
}
.checkdiv {
display: flex;
margin-left: 20px;
justify-content: space-between;
padding: 10px 0;
.ant-checkbox-group{
width: 100%;
display: flex;
flex-wrap: wrap;
align-items: center;
.ant-checkbox-group-item{
flex:0 0 auto;
margin-right: 100px;
margin-bottom: 5px;
}
}
.check {
// margin: 10px 0 ;
// flex: 1;
}
}
}
.isSearch{
color: red;
background-color: yellow;
}
.btnBox{
position: sticky;
bottom: 0px;
background-color: #fff;
width: 100%;
height: 80px;
padding: 0 20px;
display: flex;
align-items: center;
}
\ No newline at end of file
......@@ -97,15 +97,6 @@ const ListCardItem = props => {
options={defaultList}
/>
)}
{/* { <CheckGroup onChange = {(e) => { handleChecked(e)}} >
{defaultList && defaultList.length>0 &&
defaultList.map( (item, index) =>{
return item.label.includes(searchWord) &&
<Checkbox key={index} value={item.value} >{item.label}{item.userID}{String(item.isChecked)}</Checkbox>
})
}
</CheckGroup>} */}
</div>
</div>
</>
......
......@@ -10,10 +10,8 @@ import {
Button,
Space,
} from 'antd';
import { PageContainer, GridContent } from '@ant-design/pro-layout';
import PageContainer from '@/components/BasePageContainer';
import {
chooseUserToStation,
getUserRelationList,
setMenuToRole,
getRoleGroupList,
} from '@/services/userCenter/roleManage/api';
......@@ -30,7 +28,7 @@ const placeholder = '请输入功能名称';
const SiteManage = () => {
const [treeData, setTreeData] = useState([]);
const [searchWord, setSearchWord] = useState('');
const [ouid, setOuid] = useState('');
const [roleID, setRoleID] = useState(''); // 角色ID
const [saveTreeId, setSaveTreeId] = useState(''); // 保存点击回调的ird
const [modalVisible, setModalVisible] = useState(false); // 新增弹窗
const [flag, setFlag] = useState(1);
......@@ -46,13 +44,17 @@ const SiteManage = () => {
const { node } = treenode;
setItemObj(node);
console.log(e, node, 'node');
let id = e[0];
if (id) {
setCurrentSelectId(id);
setSaveTreeId(id);
setOuid(id);
const { roleID: id } = node;
// setCurrentSelectId(e);
if (e[0]) {
setCurrentSelectId(e);
if (id) {
setSaveTreeId(id);
setRoleID(id);
} else {
setRoleID(saveTreeId);
}
} else {
setOuid(saveTreeId);
}
};
useEffect(() => {
......@@ -67,21 +69,7 @@ const SiteManage = () => {
}
});
}, [flag]);
// useEffect(() => {
// setSpinLoading(true);
// getUserRelationList({
// userID: 82,
// _version: 9999,
// _dc: Date.now(),
// }).then(res => {
// setSpinLoading(false);
// let arr = res.roleList;
// let arr2 = transTree2(arr);
// setTreeData(arr2);
// });
// }, []);
const handleAdd = e => {
console.log(e);
setModalVisible(true);
};
// 角色删除
......@@ -114,7 +102,8 @@ const SiteManage = () => {
item.roleList.map(itemRole => {
if (itemRole.roleList) {
itemRole.title = itemRole.visibleTitle || '';
itemRole.key = itemRole.visibleTitle || '';
itemRole.key =
itemRole.visibleTitle + Math.floor(Math.random() * 100 + 1) || '';
itemRole.groupflag = itemRole.visibleTitle;
itemRole.roleList.map(i => {
i.title = i.roleName;
......@@ -176,7 +165,7 @@ const SiteManage = () => {
let arr = Object.values(subList);
setMenuToRole(
qs.stringify({
roleID: ouid,
roleID,
menuNameList: String(arr.flat()),
}),
{
......@@ -213,19 +202,22 @@ const SiteManage = () => {
<Spin
tip="loading...."
spinning={spinLoading}
style={{ marginTop: '20px' }}
style={{ margin: '20px auto ', display: 'block' }}
>
<Tree
showLine={{ showLeafIcon: false }}
showIcon
// onSelect={(e, node) => handleTreeSelect(e, node)}
onSelect={handleTreeSelect}
treeData={treeData}
// selectedKeys={[currentSelectId]}
blockNode
defaultExpandAll
/>
{/* <Tree></Tree> */}
{treeData && treeData.length > 0 && (
<Tree
showLine={{ showLeafIcon: false }}
showIcon
onSelect={handleTreeSelect}
treeData={treeData}
// selectedKeys={currentSelectId}
blockNode
defaultExpandAll
// defaultExpandedKeys={currentSelectId}
autoExpandParent
expandedKeys={currentSelectId}
/>
)}
</Spin>
<AddModal
visible={modalVisible}
......@@ -309,9 +301,10 @@ const SiteManage = () => {
</Row>
</Card>
<Card className={styles.cardBoxR}>
{ouid && (
{roleID && (
<ListCard
ouid={ouid}
ouid={roleID}
itemObj={itemObj}
searchWord={searchWord}
valueCallback={valueCallback}
onCommit={handleCommit}
......
.cardBox{
min-height: calc(100vh - 200px);
min-height: calc(100vh - 80px);
// max-height: calc(100vh - 200px);
// overflow-y: scroll;
}
......
......@@ -4,6 +4,8 @@
}
.cardBoxR{
min-height: calc(100vh - 172px);
max-height: calc(100vh - 172px);
overflow-y: scroll;
}
.ant-tree-node-content-wrapper-open{
display: flex;
......
import { get, post } from '@/services/index';
import { get, post, PUBLISH_SERVICE } from '@/services/index';
/**
* @数据库初始化
......@@ -15,7 +15,7 @@ import { get, post } from '@/services/index';
* }
*/
export const connectionTest = params =>
get('/DBManager/ConnectionTest', params);
get(`${PUBLISH_SERVICE}/DBManager/ConnectionTest`, params);
// 获取数据库配置信息
export const getDataBaseConfig = 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