Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
3717c68a
Commit
3717c68a
authored
Oct 23, 2020
by
赵吉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: youhua
parent
e08c4d7b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
194 additions
and
160 deletions
+194
-160
.eslintrc.js
.eslintrc.js
+1
-1
InitDataBase.jsx
src/pages/database/InitDataBase.jsx
+0
-0
ManagementDataBase.jsx
src/pages/database/ManagementDataBase.jsx
+192
-157
config.js
src/routes/config.js
+1
-2
No files found.
.eslintrc.js
View file @
3717c68a
...
...
@@ -67,7 +67,7 @@ module.exports = {
'newline-per-chained-call'
:
0
,
'no-confusing-arrow'
:
0
,
'no-console'
:
1
,
'no-unused-vars'
:
2
,
'no-unused-vars'
:
1
,
'no-use-before-define'
:
0
,
'prefer-template'
:
2
,
'react/jsx-wrap-multilines'
:
0
,
...
...
src/pages/database/InitDataBase.jsx
View file @
3717c68a
This diff is collapsed.
Click to expand it.
src/pages/database/ManagementDataBase.jsx
View file @
3717c68a
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Card
,
Form
,
Input
,
Button
,
Select
,
Table
,
Tag
,
Space
}
from
'antd'
;
import
React
,{
useEffect
,
useState
}
from
'react'
;
import
{
Card
,
Form
,
Input
,
Button
,
Select
,
Table
,
Tag
,
Space
,
Modal
}
from
'antd'
;
import
{
PageContainer
}
from
'@ant-design/pro-layout'
;
import
{
connect
}
from
'react-redux'
;
import
{
get
,
post
}
from
'services'
;
const
ManagementDataBase
=
()
=>
{
const
[
autoCheckList
,
setAutoCheckList
]
=
useState
([]);
const
[
checkList
,
setCheckList
]
=
useState
([]);
const
[
logList
,
setLogList
]
=
useState
([]);
// 检查数据库表
useEffect
(()
=>
{
get
(
`/Cityinterface/rest/services/OMS.svc/TableCheck`
,
{
_version
:
9999
,
_dc
:
new
Date
().
getTime
(),
})
.
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
sucess
)
{
const
{
list
,
messageList
}
=
res
;
//自动检测列表
let
arr
=
list
.
map
((
item
,
index
)
=>
{
item
.
key
=
index
;
return
item
;
});
//手动检查列表
let
arr2
=
messageList
.
map
((
item
,
index
)
=>
{
// eslint-disable-next-line no-param-reassign
item
.
key
=
index
;
return
item
;
});
console
.
log
(
arr
);
setAutoCheckList
(
arr
);
setCheckList
(
arr2
);
}
})
.
catch
(
err
=>
{
console
.
error
(
err
);
});
},
[]);
//获取数据库升级记录
useEffect
(()
=>
{
get
(
`/Cityinterface/rest/services/OMS.svc/DatabaseStandard_GetLog`
,
{
_version
:
9999
,
_dc
:
new
Date
().
getTime
(),
})
.
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
)
{
setLogList
(
res
);
}
})
.
catch
(
err
=>
{
console
.
error
(
err
);
});
},
[]);
const
handleCheck
=
()
=>
{
console
.
log
(
'check DB'
);
};
const
handleUpdate
=
()
=>
{
console
.
log
(
'updatedb'
);
};
const
autoCheckColumns
=
[
{
title
:
'表名称'
,
dataIndex
:
'tableName'
,
key
:
'tableName'
,
},
{
title
:
'类型'
,
dataIndex
:
'type'
,
key
:
'type'
,
},
{
title
:
'差异比较'
,
dataIndex
:
'message'
,
key
:
'message'
,
},
];
const
checkColumns
=
[
{
title
:
'表名称'
,
dataIndex
:
'tableName'
,
key
:
'tableName'
,
width
:
200
,
},
{
title
:
'类型'
,
dataIndex
:
'type'
,
key
:
'type'
,
},
{
title
:
'差异比较'
,
dataIndex
:
'message'
,
key
:
'message'
,
ellipsis
:
true
,
// width:80
},
];
const
logColumns
=
[
{
title
:
'登录名'
,
dataIndex
:
'updateBy'
,
key
:
'updateBy'
,
},
{
title
:
'数据库名称'
,
dataIndex
:
'name'
,
key
:
'name'
,
},
{
title
:
'数据库版本'
,
dataIndex
:
'version'
,
key
:
'version'
,
},
{
title
:
'数据库版本'
,
dataIndex
:
'version'
,
key
:
'version'
,
},
{
title
:
'升级时间'
,
dataIndex
:
'updateTime'
,
key
:
'updateTime'
,
},
{
title
:
'版本日志'
,
dataIndex
:
'despersion'
,
key
:
'despersion'
,
},
{
title
:
'升级内容'
,
dataIndex
:
'content'
,
key
:
'content'
,
ellipsis
:
true
,
},
];
return
(
<>
<
PageContainer
>
<
Card
>
<
Table
columns=
{
autoCheckColumns
}
dataSource=
{
autoCheckList
}
bordered
/>
<
Space
>
<
Button
onClick=
{
handleCheck
}
>
检查
</
Button
>
<
Button
onClick=
{
handleUpdate
}
>
升级
</
Button
>
</
Space
>
</
Card
>
<
Card
>
<
Table
columns=
{
checkColumns
}
dataSource=
{
checkList
}
bordered
/>
</
Card
>
<
Card
>
<
Table
columns=
{
logColumns
}
dataSource=
{
logList
}
bordered
/>
</
Card
>
</
PageContainer
>
</>
);
};
const
[
autoCheckList
,
setAutoCheckList
]
=
useState
([])
const
[
checkList
,
setCheckList
]
=
useState
([])
const
[
logList
,
setLogList
]
=
useState
([])
const
[
checkLoading
,
setCheckLoading
]
=
useState
(
false
)
const
[
logLoading
,
setLogLoading
]
=
useState
(
false
)
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
)
//弹窗
const
[
content
,
setContent
]
=
useState
(
null
)
//检查数据库表
useEffect
(
()
=>
{
setCheckLoading
(
true
)
get
(
`/Cityinterface/rest/services/OMS.svc/TableCheck`
,{
_version
:
9999
,
_dc
:
new
Date
().
getTime
()
}).
then
(
res
=>
{
setCheckLoading
(
false
)
console
.
log
(
res
)
if
(
res
.
sucess
){
const
{
list
,
messageList
}
=
res
//自动检测列表
let
arr
=
list
.
map
((
item
,
index
)
=>
{
item
.
key
=
index
return
item
})
//手动检查列表
let
arr2
=
messageList
.
map
((
item
,
index
)
=>
{
item
.
key
=
index
return
item
})
console
.
log
(
arr
)
setAutoCheckList
(
arr
)
setCheckList
(
arr2
)
}
}).
catch
(
err
=>
{
setCheckLoading
(
false
)
console
.
error
(
err
)
})
},[])
//获取数据库升级记录
useEffect
(
()
=>
{
setLogLoading
(
true
)
get
(
`/Cityinterface/rest/services/OMS.svc/DatabaseStandard_GetLog`
,{
_version
:
9999
,
_dc
:
new
Date
().
getTime
()
}).
then
(
res
=>
{
setLogLoading
(
false
)
console
.
log
(
res
)
if
(
res
){
let
arr
=
[]
res
.
map
((
item
,
index
)
=>
{
item
.
key
=
index
arr
.
push
(
item
)
})
setLogList
(
res
)
}
}).
catch
(
err
=>
{
setLogLoading
(
false
)
console
.
error
(
err
)
})
},[])
const
handleCheck
=
()
=>
{
console
.
log
(
'check DB'
)
}
const
handleUpdate
=
()
=>
{
console
.
log
(
'updatedb'
)
}
const
handleLog
=
(
text
)
=>
{
setModalVisible
(
true
)
setContent
(
text
)
}
const
autoCheckColumns
=
[
{
title
:
'表名称'
,
dataIndex
:
'tableName'
,
key
:
'tableName'
,
},
{
title
:
'类型'
,
dataIndex
:
'type'
,
key
:
'type'
,
},
{
title
:
'差异比较'
,
dataIndex
:
'message'
,
key
:
'message'
,
},
];
const
checkColumns
=
[
{
title
:
'表名称'
,
dataIndex
:
'tableName'
,
key
:
'tableName'
,
width
:
200
},
// {
// title:'类型',
// dataIndex: 'type',
// key: 'type',
// },
{
title
:
'差异比较'
,
dataIndex
:
'message'
,
key
:
'message'
,
ellipsis
:
true
,
// width:80
},
];
const
logColumns
=
[
{
title
:
'登录名'
,
dataIndex
:
'updateBy'
,
key
:
'updateBy'
,
},
{
title
:
'数据库名称'
,
dataIndex
:
'name'
,
key
:
'name'
,
},
{
title
:
'数据库版本'
,
dataIndex
:
'version'
,
key
:
'version'
,
},
{
title
:
'升级时间'
,
dataIndex
:
'updateTime'
,
key
:
'updateTime'
,
},
{
title
:
'版本日志'
,
dataIndex
:
'despersion'
,
key
:
'despersion'
,
render
:
(
text
)
=>
{
return
(
<
button
onClick
={()=
>
{
handleLog
(
text
)
}
}
>
日志
</
button
>
)
}
},
{
title
:
'升级内容'
,
dataIndex
:
'content'
,
key
:
'content'
,
ellipsis
:
true
,
render
:
(
text
)
=>
{
return
(
<
button
onClick
={()=
>
{
handleLog
(
text
)
}
}
>
升级内容
</
button
>
)
}
},
]
export
default
ManagementDataBase
;
return
(
<>
<
PageContainer
>
<
Card
>
<
div
>
表结构自动化修复
</
div
>
<
Table
columns=
{
autoCheckColumns
}
dataSource=
{
autoCheckList
}
bordered
loading=
{
checkLoading
}
></
Table
>
<
Space
>
<
Button
onClick=
{
handleCheck
}
>
检查
</
Button
>
<
Button
onClick=
{
handleUpdate
}
>
升级
</
Button
>
</
Space
>
</
Card
>
<
Card
>
<
div
>
表字段手动修复 (字段长度不统一,请手动修改差异,数据可能会截断,请谨慎操作)
</
div
>
<
Table
columns=
{
checkColumns
}
dataSource=
{
checkList
}
bordered
loading=
{
checkLoading
}
></
Table
>
</
Card
>
<
Card
>
<
div
>
数据库升级记录
</
div
>
<
Table
columns=
{
logColumns
}
dataSource=
{
logList
}
bordered
loading=
{
logLoading
}
></
Table
>
</
Card
>
</
PageContainer
>
<
Modal
title=
'详细信息'
visible=
{
modalVisible
}
keyboard=
{
false
}
maskClosable
onOk=
{
()
=>
setModalVisible
(
false
)
}
onCancel=
{
()
=>
setModalVisible
(
false
)
}
footer=
{
[
<
Button
onClick=
{
()
=>
setModalVisible
(
false
)
}
>
关闭窗口
</
Button
>
]
}
>
{
content
}
</
Modal
>
</>
)
}
export
default
ManagementDataBase
\ No newline at end of file
src/routes/config.js
View file @
3717c68a
...
...
@@ -2,10 +2,9 @@ import UserLayout from '../layouts/UserLayout';
import
Login
from
'../pages/user/login'
;
import
BasicLayout
from
'../layouts/BasicLayout'
;
import
Welcome
from
'../pages/Welcome'
;
import
RequestTest
from
'../pages/testPages/request'
;
import
InitDataBase
from
'../pages/database/InitDataBase'
;
import
ManagementDataBase
from
'../pages/database/ManagementDataBase'
;
// import OrgAndUser from '../pages/organization/OrgAndUser';
export
default
{
routes
:
[
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment