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