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
e3649913
Commit
e3649913
authored
Apr 14, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型切换规范和模版 修改接口
parent
bd3c0aba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
26 deletions
+31
-26
datamodel.js
src/model/datamodel.js
+4
-0
datamodeler.js
src/service/datamodeler.js
+5
-0
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+22
-26
No files found.
src/model/datamodel.js
View file @
e3649913
...
...
@@ -82,6 +82,10 @@ export function* getDraft(payload) {
return
yield
call
(
datamodelerService
.
draft
,
payload
);
}
export
function
*
getConsult
(
payload
)
{
return
yield
call
(
datamodelerService
.
consult
,
payload
);
}
export
function
*
getSupportedDatatypes
()
{
return
yield
call
(
datamodelerService
.
getSupportedDatatypes
);
}
...
...
src/service/datamodeler.js
View file @
e3649913
...
...
@@ -41,6 +41,11 @@ export function draft(payload) {
return
PostJSON
(
"/datamodeler/easyDataModelerDesign/draft"
,
payload
);
}
//切换模版或者规范时调用
export
function
consult
(
payload
)
{
return
PostJSON
(
"/datamodeler/easyDataModelerDesign/consult"
,
payload
);
}
//获取支持的数据类型
export
function
getSupportedDatatypes
()
{
return
GetJSON
(
"/datamodeler/easyDataModelerCURD/getSupportedDatatypes"
);
...
...
src/view/Manage/Model/Component/ImportAction.jsx
View file @
e3649913
...
...
@@ -62,24 +62,32 @@ const ImportAction = (props) => {
}
},
callback
:
data
=>
{
if
(
!
modelerData
)
{
setModelerData
(
data
||
{});
form
.
setFieldsValue
({
cnName
:
data
.
cnName
||
''
,
name
:
data
.
name
||
''
,
remark
:
data
.
remark
||
''
,
easyDataModelerModelingTemplate
:
data
.
easyDataModelerModelingTemplate
||
''
});
}
else
{
//切换规则,更新数据表结构
setModelerData
({...
modelerData
,
easyDataModelerDataModelAttributes
:
[...
data
.
easyDataModelerDataModelAttributes
]
})
}
setModelerData
(
data
||
{});
form
.
setFieldsValue
({
cnName
:
data
.
cnName
||
''
,
name
:
data
.
name
||
''
,
remark
:
data
.
remark
||
''
,
easyDataModelerModelingTemplate
:
data
.
easyDataModelerModelingTemplate
||
''
});
onChange
&&
onChange
(
data
||
{});
getSupportedDatatypes
();
}
})
}
const
getConsult
=
(
data
)
=>
{
dispatch
({
type
:
'datamodel.getConsult'
,
payload
:
{
data
},
callback
:
data
=>
{
setModelerData
({...
modelerData
,
easyDataModelerDataModelAttributes
:
[...
data
.
easyDataModelerDataModelAttributes
]
})
onChange
&&
onChange
(
data
||
{});
}
})
}
const
getCurrentDataModel
=
()
=>
{
dispatchLatest
({
type
:
'datamodel.getDataModel'
,
...
...
@@ -121,14 +129,8 @@ const ImportAction = (props) => {
setModelerData
(
newModelerData
)
onChange
&&
onChange
(
newModelerData
);
(
modelerData
.
easyDataModelerDataModelAttributes
||
[]).
forEach
((
_attribute
,
index
)
=>
{
if
(
_attribute
.
name
&&
_attribute
.
name
!==
''
)
{
_hints
.
push
(
_attribute
.
cnName
);
}
});
setConstraint
(
currentConstraint
);
get
Draft
(
currentConstraint
,
template
,
_hints
);
get
Consult
(
newModelerData
);
}
const
onTemplateChange
=
(
value
)
=>
{
...
...
@@ -150,14 +152,8 @@ const ImportAction = (props) => {
setModelerData
(
newModelerData
)
onChange
&&
onChange
(
newModelerData
);
(
modelerData
.
easyDataModelerDataModelAttributes
||
[]).
forEach
((
_attribute
,
index
)
=>
{
if
(
_attribute
.
name
&&
_attribute
.
name
!==
''
)
{
_hints
.
push
(
_attribute
.
cnName
);
}
});
setTemplate
(
currentTemplate
);
get
Draft
(
constraint
,
currentTemplate
,
_hints
);
get
Consult
(
newModelerData
);
}
const
getSupportedDatatypes
=
()
=>
{
...
...
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