Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
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
zhaochengxiang
szse
Commits
0b799bad
Commit
0b799bad
authored
Jul 27, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发布
parent
cf619b4c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
7 deletions
+58
-7
datamodel.js
src/model/datamodel.js
+4
-0
datamodeler.js
src/service/datamodeler.js
+4
-0
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+45
-7
ModelTable.less
src/view/Manage/Model/Component/ModelTable.less
+5
-0
No files found.
src/model/datamodel.js
View file @
0b799bad
...
@@ -74,6 +74,10 @@ export function* getCurrentDataModelStateCatalog(payload) {
...
@@ -74,6 +74,10 @@ export function* getCurrentDataModelStateCatalog(payload) {
return
yield
call
(
datamodelerService
.
getCurrentDataModelStateCatalog
,
payload
);
return
yield
call
(
datamodelerService
.
getCurrentDataModelStateCatalog
,
payload
);
}
}
export
function
*
nextState
(
payload
)
{
return
yield
call
(
datamodelerService
.
nextState
,
payload
);
}
export
function
*
extractExcelContent
(
payload
)
{
export
function
*
extractExcelContent
(
payload
)
{
return
yield
call
(
datamodelerService
.
extractExcelContent
,
payload
);
return
yield
call
(
datamodelerService
.
extractExcelContent
,
payload
);
}
}
...
...
src/service/datamodeler.js
View file @
0b799bad
...
@@ -31,6 +31,10 @@ export function getCurrentDataModelStateCatalog(payload) {
...
@@ -31,6 +31,10 @@ export function getCurrentDataModelStateCatalog(payload) {
return
GetJSON
(
"/datamodeler/easyDataModelerCURD/getCurrentDataModelStateCatalog"
,
payload
);
return
GetJSON
(
"/datamodeler/easyDataModelerCURD/getCurrentDataModelStateCatalog"
,
payload
);
}
}
export
function
nextState
(
payload
)
{
return
GetJSON
(
"/datamodeler/easyDataModelerCURD/nextState"
,
payload
);
}
export
function
extractExcelContent
(
payload
)
{
export
function
extractExcelContent
(
payload
)
{
return
PostFile
(
"/datamodeler/easyDataModelerDesign/kickStart"
,
payload
);
return
PostFile
(
"/datamodeler/easyDataModelerDesign/kickStart"
,
payload
);
}
}
...
...
src/view/Manage/Model/Component/ModelTable.jsx
View file @
0b799bad
import
React
,
{
useState
,
useEffect
,
useRef
}
from
"react"
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
"react"
;
import
{
Space
,
Button
,
Tooltip
,
Modal
,
Select
,
Input
}
from
'antd'
;
import
{
Space
,
Button
,
Tooltip
,
Modal
,
Select
,
Input
,
Divider
}
from
'antd'
;
import
{
EditOutlined
,
ReconciliationOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
;
import
{
EditOutlined
,
ReconciliationOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
;
import
SmoothScroll
from
'smooth-scroll'
;
import
SmoothScroll
from
'smooth-scroll'
;
import
ProTable
from
"@ant-design/pro-table"
;
import
ProTable
from
"@ant-design/pro-table"
;
...
@@ -84,9 +84,9 @@ const ModelTable = (props) => {
...
@@ -84,9 +84,9 @@ const ModelTable = (props) => {
{
{
title
:
'操作'
,
title
:
'操作'
,
key
:
'action'
,
key
:
'action'
,
width
:
12
0
,
width
:
23
0
,
render
:
(
text
,
record
)
=>
{
render
:
(
_
,
record
)
=>
{
return
(
return
(
<
Space
size=
'small'
>
<
Space
size=
'small'
>
<
Tooltip
placement=
'bottom'
title=
{
'修改'
}
>
<
Tooltip
placement=
'bottom'
title=
{
'修改'
}
>
<
Button
icon=
{
<
EditOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
editItem
(
record
);
}
}
/>
<
Button
icon=
{
<
EditOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
editItem
(
record
);
}
}
/>
...
@@ -94,12 +94,21 @@ const ModelTable = (props) => {
...
@@ -94,12 +94,21 @@ const ModelTable = (props) => {
<
Tooltip
placement=
'bottom'
title=
{
'详情'
}
>
<
Tooltip
placement=
'bottom'
title=
{
'详情'
}
>
<
Button
icon=
{
<
ReconciliationOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
detailItem
(
record
);
}
}
/>
<
Button
icon=
{
<
ReconciliationOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
detailItem
(
record
);
}
}
/>
</
Tooltip
>
</
Tooltip
>
{
/* <Tooltip placement='bottom' title={'提交审核'}>
<Button icon={<CheckOutlined />} size='small' />
</Tooltip> */
}
<
Tooltip
placement=
'bottom'
title=
{
'删除'
}
>
<
Tooltip
placement=
'bottom'
title=
{
'删除'
}
>
<
Button
icon=
{
<
DeleteOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
deleteItem
(
record
);
}
}
/>
<
Button
icon=
{
<
DeleteOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
deleteItem
(
record
);
}
}
/>
</
Tooltip
>
</
Tooltip
>
{
(
record
?.
state
?.
supportedActions
||
[]).
length
>
0
&&
record
?.
state
?.
supportedActions
.
map
((
item
,
index
)
=>
{
return
(
<
React
.
Fragment
>
{
index
===
0
&&
<
Divider
type=
'vertical'
/>
}
<
Button
key=
{
index
}
size=
'small'
onClick=
{
()
=>
{
stateAction
(
record
,
item
);
}
}
>
{
item
.
cnName
||
''
}
</
Button
>
</
React
.
Fragment
>
);
})
}
</
Space
>
</
Space
>
)
)
}
}
...
@@ -114,6 +123,35 @@ const ModelTable = (props) => {
...
@@ -114,6 +123,35 @@ const ModelTable = (props) => {
onItemAction
&&
onItemAction
(
record
.
id
||
''
,
'detail'
);
onItemAction
&&
onItemAction
(
record
.
id
||
''
,
'detail'
);
}
}
const
stateAction
=
(
record
,
action
)
=>
{
modal
.
confirm
({
title
:
'提示!'
,
content
:
`您确定要
${
action
.
cnName
||
''
}
该模型吗?`
,
onOk
:
()
=>
{
dispatchLatest
({
type
:
'datamodel.nextState'
,
payload
:
{
easyDataModelerDataModelId
:
record
.
id
,
actionId
:
action
.
id
},
callback
:
()
=>
{
showMessage
(
'success'
,
`模型
${
action
.
cnName
||
''
}
成功`
);
onChange
&&
onChange
();
const
index
=
selectedRowKeys
.
findIndex
((
rowKey
)
=>
rowKey
===
record
.
id
);
if
(
index
!==
-
1
)
{
const
newSelectedRowKeys
=
[...
selectedRowKeys
];
newSelectedRowKeys
.
splice
(
index
,
1
);
setSelectedRowKeys
(
newSelectedRowKeys
);
onSelect
&&
onSelect
(
newSelectedRowKeys
);
}
}
})
}
});
}
const
deleteItem
=
(
record
)
=>
{
const
deleteItem
=
(
record
)
=>
{
modal
.
confirm
({
modal
.
confirm
({
...
...
src/view/Manage/Model/Component/ModelTable.less
View file @
0b799bad
...
@@ -10,4 +10,8 @@
...
@@ -10,4 +10,8 @@
padding: 0 !important;
padding: 0 !important;
}
}
}
}
.yy-divider-vertical {
margin: 0 2px !important;
}
}
}
\ No newline at end of file
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