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
945c34ea
Commit
945c34ea
authored
Nov 26, 2020
by
陈前坚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: dictionary
parent
7b67f75d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
303 additions
and
1 deletion
+303
-1
AppDic.js
src/pages/platformCenter/dictionary/AppDic.js
+46
-0
WebDic.js
src/pages/platformCenter/dictionary/WebDic.js
+200
-0
WebDic.less
src/pages/platformCenter/dictionary/WebDic.less
+24
-0
index.js
src/pages/platformCenter/dictionary/index.js
+26
-0
UserManage.less
src/pages/userCenter/UserManage.less
+5
-0
config.js
src/routes/config.js
+2
-1
No files found.
src/pages/platformCenter/dictionary/AppDic.js
0 → 100644
View file @
945c34ea
import
React
from
'react'
;
import
{
Table
,
Row
,
Col
}
from
'antd'
;
const
appDic
=
()
=>
{
console
.
log
(
'123'
);
return
(
<
Row
>
<
Col
span
=
{
12
}
>
<
Table
size
=
"small"
bordered
// columns={columns}
// dataSource={data0}
scroll
=
{{
x
:
'max-content'
}}
pagination
=
{{
showTotal
:
(
total
,
range
)
=>
`第
${
range
[
0
]}
-
${
range
[
1
]}
条/共
${
total
}
条`
,
pageSizeOptions
:
[
10
,
20
,
50
,
100
],
defaultPageSize
:
10
,
showQuickJumper
:
true
,
showSizeChanger
:
true
,
}}
/
>
<
/Col
>
<
Col
span
=
{
12
}
>
<
Table
size
=
"small"
bordered
// columns={columns}
// dataSource={data0}
scroll
=
{{
x
:
'max-content'
}}
pagination
=
{{
showTotal
:
(
total
,
range
)
=>
`第
${
range
[
0
]}
-
${
range
[
1
]}
条/共
${
total
}
条`
,
pageSizeOptions
:
[
10
,
20
,
50
,
100
],
defaultPageSize
:
10
,
showQuickJumper
:
true
,
showSizeChanger
:
true
,
}}
/
>
<
/Col
>
<
/Row
>
);
};
export
default
appDic
;
src/pages/platformCenter/dictionary/WebDic.js
0 → 100644
View file @
945c34ea
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Table
,
Modal
,
Form
,
Input
,
Space
,
Button
,
Popconfirm
,
notification
,
message
,
}
from
'antd'
;
import
{
get
}
from
'@/services/index'
;
import
styles
from
'./WebDic.less'
;
const
WebDic
=
()
=>
{
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
editVisible
,
setEditVisible
]
=
useState
(
false
);
// const [editValue, setEditValue] = useState('');
// const [description, setDescription] = useState('');
const
[
data
,
setData
]
=
useState
([]);
const
[
subData
,
setSubData
]
=
useState
([]);
const
[
select
,
setSelect
]
=
useState
({});
const
[
editForm
]
=
Form
.
useForm
();
const
columns
=
[
{
title
:
'名称'
,
dataIndex
:
'nodeName'
,
key
:
'nodeName'
,
width
:
300
,
},
{
title
:
'值'
,
dataIndex
:
'nodeValue'
,
key
:
'nodeValue'
,
},
{
title
:
'操作'
,
key
:
'action'
,
width
:
200
,
render
:
record
=>
(
<
Space
>
<
Button
type
=
"primary"
size
=
"small"
onClick
=
{
e
=>
{
e
.
stopPropagation
();
setSelect
(
record
);
setEditVisible
(
true
);
console
.
log
(
record
);
editForm
.
setFieldsValue
({
nodeName
:
record
.
nodeName
,
nodeValue
:
record
.
nodeValue
,
});
}}
>
修改
<
/Button
>
<
Popconfirm
title
=
"是否删除该数据?"
okText
=
"确认"
cancelText
=
"取消"
// onConfirm={submitDelete}
>
<
Button
size
=
"small"
danger
onClick
=
{
e
=>
{
e
.
stopPropagation
();
setSelect
(
record
);
}}
>
删除
<
/Button
>
<
/Popconfirm
>
<
/Space
>
),
},
];
useEffect
(()
=>
{
getData
(
'-1'
);
},
[]);
const
getData
=
value
=>
{
setLoading
(
true
);
get
(
`/Cityinterface/rest/services/OMS.svc/D_GetDataDictionaryList`
,
{
_version
:
9999
,
_dc
:
new
Date
().
getTime
(),
nodeID
:
value
,
key
:
''
,
})
.
then
(
res
=>
{
if
(
res
.
length
>
0
)
{
res
.
map
(
item
=>
{
item
.
key
=
item
.
nodeID
;
return
item
;
});
if
(
value
===
'-1'
)
{
setData
(
res
);
// 设置一级条目
}
else
if
(
value
)
{
setSubData
(
res
);
// 设置二级条目
}
// 获取二级条目
if
(
res
&&
res
[
0
]
&&
res
[
0
].
parentID
===
'-1'
)
{
getData
(
res
[
0
].
nodeID
);
}
}
else
{
notification
.
error
({
message
:
'获取失败'
,
description
:
res
.
message
,
});
}
setLoading
(
false
);
})
.
catch
(
err
=>
{
setLoading
(
false
);
message
.
error
(
err
);
});
};
const
setRowClassName
=
record
=>
record
.
nodeID
===
select
.
nodeID
?
styles
.
clickRowStyle
:
''
;
const
submitEdit
=
()
=>
{
const
nodeName
=
editForm
.
getFieldValue
(
'nodeName'
);
const
nodeValue
=
editForm
.
getFieldValue
(
'nodeValue'
);
};
return
(
<
div
className
=
{
styles
.
WebDic
}
>
<
Table
size
=
"small"
bordered
columns
=
{
columns
}
dataSource
=
{
data
}
scroll
=
{{
x
:
'max-content'
}}
rowClassName
=
{
setRowClassName
}
onRow
=
{
record
=>
({
onClick
:
()
=>
{
getData
(
record
.
nodeID
);
setSelect
(
record
);
},
})}
pagination
=
{{
showTotal
:
(
total
,
range
)
=>
`第
${
range
[
0
]}
-
${
range
[
1
]}
条/共
${
total
}
条`
,
pageSizeOptions
:
[
10
,
20
,
50
,
100
],
showQuickJumper
:
true
,
showSizeChanger
:
true
,
}}
/
>
<
Table
size
=
"small"
bordered
columns
=
{
columns
}
dataSource
=
{
subData
}
scroll
=
{{
x
:
'max-content'
}}
pagination
=
{{
showTotal
:
(
total
,
range
)
=>
`第
${
range
[
0
]}
-
${
range
[
1
]}
条/共
${
total
}
条`
,
pageSizeOptions
:
[
10
,
20
,
50
,
100
],
showQuickJumper
:
true
,
showSizeChanger
:
true
,
}}
/
>
{
/* 修改 */
}
<
Modal
title
=
{
select
.
parentID
===
'-1'
?
'修改一级条目'
:
'修改二级条目'
}
visible
=
{
editVisible
}
onOk
=
{
submitEdit
}
onCancel
=
{()
=>
{
setEditVisible
(
false
);
}}
okText
=
"确认"
cancelText
=
"取消"
>
<
Form
form
=
{
editForm
}
labelCol
=
{{
span
:
3
}}
>
<
Form
.
Item
name
=
"nodeName"
label
=
"名称"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入名称"
/>
<
/Form.Item
>
{
select
.
nodeID
!==
'-1'
&&
(
<
Form
.
Item
name
=
"nodeValue"
label
=
"值"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
>
<
Input
placeholder
=
"请输入值"
/>
<
/Form.Item
>
)}
<
/Form
>
<
/Modal
>
<
/div
>
);
};
export
default
WebDic
;
src/pages/platformCenter/dictionary/WebDic.less
0 → 100644
View file @
945c34ea
.WebDic{
overflow: auto;
height:calc(100vh-200px);
.ant-table-thead tr th{
font-weight: 600;
color:rgba(0,0,0,0.85);
}
.ant-pagination{
z-index: 999;
background: white;
margin: 2px 0px;
padding:6px 10px;
}
.ant-table-tbody{
.clickRowStyle{
background: #74bafc;
}
.clickRowStyle:hover>td{
background: #aed8fa;
}
}
}
\ No newline at end of file
src/pages/platformCenter/dictionary/index.js
0 → 100644
View file @
945c34ea
import
React
from
'react'
;
import
{
Tabs
,
Card
}
from
'antd'
;
import
PageContainer
from
'@/components/BasePageContainer'
;
import
WebDic
from
'./WebDic'
;
import
AppDic
from
'./AppDic'
;
// import VersionPublish from './VersionPublish';
const
dictionary
=
()
=>
{
const
{
TabPane
}
=
Tabs
;
return
(
<
PageContainer
>
<
Card
>
<
Tabs
defaultActiveKey
=
"1"
type
=
"card"
>
<
TabPane
tab
=
"web数据字典"
key
=
"1"
>
<
WebDic
/>
<
/TabPane
>
<
TabPane
tab
=
"app数据字典"
key
=
"2"
type
=
"card"
>
<
AppDic
/>
<
/TabPane
>
<
/Tabs
>
<
/Card
>
<
/PageContainer
>
);
};
export
default
dictionary
;
src/pages/userCenter/UserManage.less
View file @
945c34ea
...
...
@@ -39,6 +39,11 @@
.ant-dropdown-menu-item > .anticon:first-child {
vertical-align: 0.15em !important;
}
.ant-table-tbody{
.ant-table-row:hover>td{
background: #aed8fa !important;
}
}
}
.redText{
color: red;
...
...
src/routes/config.js
View file @
945c34ea
...
...
@@ -22,6 +22,7 @@ import CurrentSolution from '@/pages/database/CurrentSolution';
import
UserManage
from
'../pages/userCenter/UserManage'
;
import
RoleManage
from
'@/pages/userCenter/roleManage/RoleManage'
;
import
SiteManage
from
'../pages/userCenter/siteManage/SiteManage'
;
import
Dictionary
from
'../pages/platformCenter/dictionary'
;
import
ServiceLog
from
'../pages/log/serviceLog'
;
import
LoginLog
from
'../pages/log/loginLog'
;
import
OmsLog
from
'../pages/log/omsLog'
;
...
...
@@ -194,7 +195,7 @@ export default {
{
path
:
'/platformCenter/dictionary'
,
name
:
'数据字典'
,
component
:
Welcome
,
component
:
Dictionary
,
},
],
},
...
...
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