Commit bff351dd authored by 张烨's avatar 张烨

merge: fix conflict

parents 7edd22db 9e688003
import { import { LogoutOutlined } from '@ant-design/icons';
LogoutOutlined,
SettingOutlined,
UserOutlined,
} from '@ant-design/icons';
import { Avatar, Menu, Spin } from 'antd'; import { Avatar, Menu, Spin } from 'antd';
import React from 'react'; import React from 'react';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
...@@ -10,6 +6,7 @@ import HeaderDropdown from '../HeaderDropdown'; ...@@ -10,6 +6,7 @@ import HeaderDropdown from '../HeaderDropdown';
import styles from './index.less'; import styles from './index.less';
import { setAuthority } from '@/utils/authority'; import { setAuthority } from '@/utils/authority';
import logo from '@/assets/images/logo/panda-logo2.png';
class AvatarDropdown extends React.Component { class AvatarDropdown extends React.Component {
/* eslint-disable no-unused-vars */ /* eslint-disable no-unused-vars */
onMenuClick = event => { onMenuClick = event => {
...@@ -27,9 +24,8 @@ class AvatarDropdown extends React.Component { ...@@ -27,9 +24,8 @@ class AvatarDropdown extends React.Component {
render() { render() {
const { const {
currentUser = { currentUser = {
avatar: avatar: logo,
'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png', name: '测试人员',
name: 'Serati Ma',
}, },
} = this.props; } = this.props;
const menuHeaderDropdown = ( const menuHeaderDropdown = (
......
...@@ -23,26 +23,28 @@ const GlobalHeaderRight = props => { ...@@ -23,26 +23,28 @@ const GlobalHeaderRight = props => {
className={`${styles.action} ${styles.search}`} className={`${styles.action} ${styles.search}`}
placeholder="站内搜索" placeholder="站内搜索"
defaultValue="" defaultValue=""
options={[ options={
{ [
label: <a href="https://umijs.org/zh/guide/umi-ui.html">umi ui</a>, // {
value: 'umi ui', // label: <a href="https://umijs.org/zh/guide/umi-ui.html">umi ui</a>,
}, // value: 'umi ui',
{ // },
label: <a href="next.ant.design">Ant Design</a>, // {
value: 'Ant Design', // label: <a href="next.ant.design">Ant Design</a>,
}, // value: 'Ant Design',
{ // },
label: <a href="https://protable.ant.design/">Pro Table</a>, // {
value: 'Pro Table', // label: <a href="https://protable.ant.design/">Pro Table</a>,
}, // value: 'Pro Table',
{ // },
label: <a href="https://prolayout.ant.design/">Pro Layout</a>, // {
value: 'Pro Layout', // label: <a href="https://prolayout.ant.design/">Pro Layout</a>,
}, // value: 'Pro Layout',
]} // },
]
}
/> />
<Tooltip title="使用文档"> {/* <Tooltip title="使用文档">
<a <a
style={{ style={{
color: 'inherit', color: 'inherit',
...@@ -54,7 +56,7 @@ const GlobalHeaderRight = props => { ...@@ -54,7 +56,7 @@ const GlobalHeaderRight = props => {
> >
<QuestionCircleOutlined /> <QuestionCircleOutlined />
</a> </a>
</Tooltip> </Tooltip> */}
<NoticeIcon className={styles.action} /> <NoticeIcon className={styles.action} />
<Avatar /> <Avatar />
{/* <SelectLang className={styles.action} /> */} {/* <SelectLang className={styles.action} /> */}
......
...@@ -6,10 +6,11 @@ import { ...@@ -6,10 +6,11 @@ import {
Button, Button,
Select, Select,
Table, Table,
Tag,
Space, Space,
notification, notification,
Modal Modal,
Row,
Col
} from 'antd'; } from 'antd';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
...@@ -25,8 +26,7 @@ const formLables = { ...@@ -25,8 +26,7 @@ const formLables = {
}; };
const InitDataBase = props => { const InitDataBase = props => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const onFinish = e => {}; const [tableLoading, setTableLoading] = useState(false);//连接记录
const [tableLoading, setTableLoading] = useState(false);
const [dbForm, setDbForm] = useState({ const [dbForm, setDbForm] = useState({
ip: '', ip: '',
dbName: '', dbName: '',
...@@ -35,7 +35,9 @@ const InitDataBase = props => { ...@@ -35,7 +35,9 @@ const InitDataBase = props => {
inUse: '', inUse: '',
}); });
const [data, setData] = useState([]); //数据库链接记录 const [data, setData] = useState([]); //数据库链接记录
const [upData,setUpData] = useState(1);//列表刷新标记
const [option, setOption] = useState([]); //下拉列表数据 const [option, setOption] = useState([]); //下拉列表数据
const [desc, setDesc] = useState('');//修改描述
const [modalVisible, setModalVisible] = useState(false) const [modalVisible, setModalVisible] = useState(false)
console.log(window.location.host); console.log(window.location.host);
//获取数据库链接记录 //获取数据库链接记录
...@@ -59,7 +61,7 @@ const InitDataBase = props => { ...@@ -59,7 +61,7 @@ const InitDataBase = props => {
setTableLoading(false); setTableLoading(false);
console.error(err); console.error(err);
}); });
}, []); }, [upData]);
//获取数据库配置信息 //获取数据库配置信息
useEffect(() => { useEffect(() => {
get(`/Cityinterface/rest/services/OMS.svc/S_GetDataBaseConfig`, { get(`/Cityinterface/rest/services/OMS.svc/S_GetDataBaseConfig`, {
...@@ -67,7 +69,7 @@ const InitDataBase = props => { ...@@ -67,7 +69,7 @@ const InitDataBase = props => {
dc: 1603334559186, dc: 1603334559186,
}) })
.then(res => { .then(res => {
console.log(res); console.log(res,'69res');
if (res.success) { if (res.success) {
let obj = {}; let obj = {};
for (let k in dbForm) { for (let k in dbForm) {
...@@ -93,10 +95,75 @@ const InitDataBase = props => { ...@@ -93,10 +95,75 @@ const InitDataBase = props => {
dbName: value, dbName: value,
}); });
}; };
//保存连接
const onFinish = values => {
const obj = values
get('/Cityinterface/rest/services/OMS.svc/S_SaveConnection',{
_version:9999,
_dc:new Date().getTime(),
ip:obj.ip,
dbName:obj.dbName,
userName:obj.userName,
password:obj.password
}).then(res =>{
if(res.GetMe===true){
setUpData(upData+1)
notification.success({
message: '通知',
duration: 3,
description: '保存成功',
});
}else{
notification.error({
message: '提示',
duration: 3,
description: res.Say.Message||'保存失败',
});
}
}).catch(err =>{
console.log(err)
notification.error({
message: '提示',
duration: 3,
description: err||'保存失败',
});
})
};
const onCheck = e => { const onCheck = e => {
//测试连接
console.log(dbForm); console.log(dbForm);
console.log(form.getFieldValue()); console.log(form.getFieldValue());
console.log(form.getFieldsValue()); console.log(form.getFieldsValue());
const obj = form.getFieldsValue()
get('/Cityinterface/rest/services/OMS.svc/S_GetConnectionTest',{
_version:9999,
_dc:new Date().getTime(),
ip:obj.ip,
dbName:obj.dbName,
userName:obj.userName,
password:obj.password
}).then(res =>{
if(res.GetMe===true){
notification.success({
message: '通知',
duration: 3,
description: '连接成功',
});
}else{
notification.error({
message: '提示',
duration: 3,
description: res.Say.Message||'连接失败',
});
}
}).catch(err =>{
console.log(err)
notification.error({
message: '提示',
duration: 3,
description: err||'连接失败',
});
})
}; };
const selectFocus = e => { const selectFocus = e => {
setOption([]); setOption([]);
...@@ -133,9 +200,35 @@ const InitDataBase = props => { ...@@ -133,9 +200,35 @@ const InitDataBase = props => {
} }
form.setFieldsValue(obj); form.setFieldsValue(obj);
}; };
//修改描述 //展示修改描述
const changeDesc = () => { const changeDesc = () => {
setModalVisible(true) setModalVisible(true)
setDesc('')
}
const descChange = (e) =>{
const { value } = e.target
setDesc(value)
}
//弹窗确认回调
const modalOkCallback = () =>{
console.log(form.getFieldsValue());
const obj = form.getFieldsValue()
get('/Cityinterface/rest/services/OMS.svc/S_UpdateConnDesc',{
_version:9999,
_dc:new Date().getTime(),
ip:obj.ip,
dbName:obj.dbName,
userName:obj.userName,
password:obj.password,
desc
}).then(res =>{
console.log(res)
setModalVisible(false)
setUpData(upData+1)
}).catch(err =>{
console.error(err)
setModalVisible(false)
})
} }
const columns = [ const columns = [
{ {
...@@ -235,7 +328,7 @@ const InitDataBase = props => { ...@@ -235,7 +328,7 @@ const InitDataBase = props => {
<div className={styles.tCenter}> <div className={styles.tCenter}>
<Space size="large"> <Space size="large">
<Button onClick={onCheck}>测试连接</Button> <Button onClick={onCheck}>测试连接</Button>
<Button type='primary' htmlType="submit">保存连接</Button> <Button type='primary' htmlType="submit" loading={tableLoading}>保存连接</Button>
<Button type='primary' danger htmlType="reset" onClick={()=>{initClick()}}> <Button type='primary' danger htmlType="reset" onClick={()=>{initClick()}}>
数据库初始化 数据库初始化
</Button> </Button>
...@@ -264,20 +357,26 @@ const InitDataBase = props => { ...@@ -264,20 +357,26 @@ const InitDataBase = props => {
/> />
</Card> </Card>
<Modal <Modal
title='修改描述链接' title='修改链接描述'
visible={modalVisible} visible={modalVisible}
maskClosable maskClosable
onOk={() => setModalVisible(false)} onOk={() => modalOkCallback() }
onCancel={() => setModalVisible(false)} onCancel={() => setModalVisible(false)}
width="1000px" width="1000px"
bodyStyle={{ bodyStyle={{
minHeight:'100px' minHeight:'100px'
}} }}
footer={ cancelText='取消'
<Button type='primary' onClick={() => setModalVisible(false)}>关闭窗口</Button> okText='确认修改'
} destroyOnClose={true}
> >
<div>测试</div> <Row >
<Col span={1} className={styles.decsBox}>描述:</Col>
<Col span={11} >
<Input placeholder='请输入描述' onChange={(value)=>{
descChange(value)
}}></Input></Col>
</Row>
</Modal> </Modal>
</PageContainer> </PageContainer>
</> </>
......
...@@ -6,4 +6,8 @@ ...@@ -6,4 +6,8 @@
} }
.tCenter{ .tCenter{
text-align: center; text-align: center;
}
.decsBox{
height: 32px;
line-height: 32px;
} }
\ No newline at end of file
...@@ -8,6 +8,7 @@ const ManagementDataBase = () => { ...@@ -8,6 +8,7 @@ const ManagementDataBase = () => {
const [autoCheckList, setAutoCheckList] = useState([]); const [autoCheckList, setAutoCheckList] = useState([]);
const [checkList, setCheckList] = useState([]); const [checkList, setCheckList] = useState([]);
const [logList, setLogList] = useState([]); const [logList, setLogList] = useState([]);
const [checkFlag, setCheckFlag] = useState(1)
const [checkLoading, setCheckLoading] = useState(false); const [checkLoading, setCheckLoading] = useState(false);
const [logLoading, setLogLoading] = useState(false); const [logLoading, setLogLoading] = useState(false);
const [modalVisible, setModalVisible] = useState(false); // 弹窗 const [modalVisible, setModalVisible] = useState(false); // 弹窗
...@@ -43,7 +44,7 @@ const ManagementDataBase = () => { ...@@ -43,7 +44,7 @@ const ManagementDataBase = () => {
setCheckLoading(false); setCheckLoading(false);
console.error(err); console.error(err);
}); });
}, []); }, [checkFlag]);
//获取数据库升级记录 //获取数据库升级记录
useEffect(() => { useEffect(() => {
setLogLoading(true); setLogLoading(true);
...@@ -69,8 +70,7 @@ const ManagementDataBase = () => { ...@@ -69,8 +70,7 @@ const ManagementDataBase = () => {
}); });
}, []); }, []);
const handleCheck = () => { const handleCheck = () => {
console.log('check DB'); setCheckFlag(checkFlag+1)
alert('check DB')
}; };
const handleUpdate = () => { const handleUpdate = () => {
alert('updatedb') alert('updatedb')
...@@ -181,10 +181,11 @@ const ManagementDataBase = () => { ...@@ -181,10 +181,11 @@ const ManagementDataBase = () => {
dataSource={autoCheckList} dataSource={autoCheckList}
bordered bordered
loading={checkLoading} loading={checkLoading}
scroll={{y:400}}
/> />
<div className={ styles.tCenter}> <div className={ styles.tCenter}>
<Space> <Space>
<Button type='primary' onClick={handleCheck}>检查</Button> <Button type='primary' onClick={handleCheck} loading={checkLoading}>检查</Button>
<Button danger type='primary' onClick={handleUpdate}>升级</Button> <Button danger type='primary' onClick={handleUpdate}>升级</Button>
</Space> </Space>
</div> </div>
...@@ -200,6 +201,7 @@ const ManagementDataBase = () => { ...@@ -200,6 +201,7 @@ const ManagementDataBase = () => {
dataSource={checkList} dataSource={checkList}
bordered bordered
loading={checkLoading} loading={checkLoading}
scroll={{y:400}}
/> />
</Card> </Card>
<Card className={styles.mgTop20}> <Card className={styles.mgTop20}>
...@@ -210,6 +212,7 @@ const ManagementDataBase = () => { ...@@ -210,6 +212,7 @@ const ManagementDataBase = () => {
dataSource={logList} dataSource={logList}
bordered bordered
loading={logLoading} loading={logLoading}
scroll={{y:400}}
/> />
</Card> </Card>
</PageContainer> </PageContainer>
......
...@@ -15,6 +15,7 @@ import TestModal from './ModalComponent'; ...@@ -15,6 +15,7 @@ import TestModal from './ModalComponent';
import ListCard from './ListCard'; import ListCard from './ListCard';
import { get, post } from '../../services'; import { get, post } from '../../services';
import { orgGet,orgTest } from '../../services/orgnazation/api' import { orgGet,orgTest } from '../../services/orgnazation/api'
import styles from './DefaultComponent.less'
const { Search } = Input const { Search } = Input
const { TreeNode } = TreeSelect; const { TreeNode } = TreeSelect;
// const treeData = [ // const treeData = [
...@@ -92,7 +93,8 @@ const DefaultComponent = ()=> { ...@@ -92,7 +93,8 @@ const DefaultComponent = ()=> {
{ {
title:'微信账户', title:'微信账户',
dataIndex:'wxid', dataIndex:'wxid',
key:'wxid' key:'wxid',
ellipsis: true,
} }
] ]
useEffect( ()=>{ useEffect( ()=>{
...@@ -237,14 +239,16 @@ const DefaultComponent = ()=> { ...@@ -237,14 +239,16 @@ const DefaultComponent = ()=> {
<ListCard optionsList ={testPeoList}></ListCard> <ListCard optionsList ={testPeoList}></ListCard>
</TestModal> </TestModal>
</Card> </Card>
<Card> <Card className={styles.mgTop20}>
<div>一般用户的用户列表</div> <div classNam={styles.tableTitle}>一般用户的用户列表</div>
<Table <Table
className={styles.mgTop20}
rowSelection={rowSelection} rowSelection={rowSelection}
columns={columns} columns={columns}
dataSource ={tableData} dataSource ={tableData}
bordered bordered
rowKey='userID' rowKey='userID'
scroll={{y:400}}
></Table> ></Table>
</Card> </Card>
</PageContainer> </PageContainer>
......
.tableTitle{
font-size: 16px;
}
.mgTop20{
margin-top: 20px !important;
}
...@@ -54,7 +54,7 @@ const Login = props => { ...@@ -54,7 +54,7 @@ const Login = props => {
)} )}
<UserName <UserName
name="userName" name="userName"
placeholder="用户名: admin or user" placeholder="请输入用户名"
rules={[ rules={[
{ {
required: true, required: true,
...@@ -64,7 +64,7 @@ const Login = props => { ...@@ -64,7 +64,7 @@ const Login = props => {
/> />
<Password <Password
name="password" name="password"
placeholder="密码: ant.design" placeholder="请输入密码"
rules={[ rules={[
{ {
required: true, required: true,
...@@ -79,13 +79,13 @@ const Login = props => { ...@@ -79,13 +79,13 @@ const Login = props => {
> >
自动登录 自动登录
</Checkbox> </Checkbox>
<a {/* <a
style={{ style={{
float: 'right', float: 'right',
}} }}
> >
忘记密码 忘记密码
</a> </a> */}
</div> </div>
<Submit loading={submitting}>登录</Submit> <Submit loading={submitting}>登录</Submit>
</LoginForm> </LoginForm>
......
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