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
931c7144
Commit
931c7144
authored
May 21, 2021
by
shaoan123
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接表字段的附加表接口
parent
42e0676c
Pipeline
#28038
skipped with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
15 deletions
+50
-15
addTable.jsx
...nter/bsmanager/tablemanager/components/Field/addTable.jsx
+36
-9
affiliateAdd.jsx
.../bsmanager/tablemanager/components/Field/affiliateAdd.jsx
+8
-4
bs.jsx
src/services/platform/bs.jsx
+6
-2
No files found.
src/pages/platformCenter/bsmanager/tablemanager/components/Field/addTable.jsx
View file @
931c7144
...
...
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import
{
Form
,
Modal
,
Input
,
Select
,
Checkbox
,
Divider
,
notification
,
Row
}
from
'antd'
;
import
{
createTable
,
loadTableFields
createTable
,
loadTableFields
,
addFields
}
from
'@/services/platform/bs'
import
styles
from
'./index.less'
...
...
@@ -19,6 +19,7 @@ const editor = props => {
const
[
indeterminate
,
setIndeterminate
]
=
useState
(
true
);
const
[
isVisible
,
setIsVisible
]
=
useState
(
true
);
const
[
checkAll
,
setCheckAll
]
=
useState
(
false
);
const
[
chartName
,
setChartName
]
=
useState
(
''
);
//附加表名称
const
onChange
=
list
=>
{
setCheckedList
(
list
);
...
...
@@ -50,6 +51,7 @@ const editor = props => {
description
:
'建表成功'
,
});
setIsVisible
(
false
)
setChartName
(
res
.
data
.
tableInfo
.
Name
)
loadTableFields
({
tableName
:
res
.
data
.
tableInfo
.
Name
}).
then
(
response
=>
{
if
(
response
.
data
.
root
.
length
)
{
let
arr
=
[],
newArr
=
[]
...
...
@@ -93,14 +95,39 @@ const editor = props => {
},
[
visible
]);
const
handleOk
=
()
=>
{
form
.
resetFields
();
callBackSubmit
();
console
.
log
();
notification
.
success
({
message
:
'提示'
,
duration
:
3
,
description
:
'新增成功'
,
});
if
(
chartName
!=
''
)
{
addFields
({
tableName
:
chartName
,
fieldNames
:
checkedList
.
join
(
','
)
}).
then
(
res
=>
{
if
(
res
.
msg
===
"Ok"
)
{
notification
.
success
({
message
:
'提示'
,
duration
:
1
,
description
:
'附加字段添加成功'
,
});
setIsModalVisible
(
false
)
form
.
resetFields
();
callBackSubmit
();
}
else
{
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
res
.
msg
,
});
}
}).
catch
(
err
=>
{
console
.
log
(
'err'
,
err
);
})
}
else
{
notification
.
success
({
message
:
'提示'
,
duration
:
1
,
description
:
'表名称没添加'
,
});
}
}
const
handleCancel
=
()
=>
{
setIsModalVisible
(
false
)
...
...
src/pages/platformCenter/bsmanager/tablemanager/components/Field/affiliateAdd.jsx
View file @
931c7144
...
...
@@ -6,6 +6,7 @@ import {
}
from
'@/services/platform/bs'
import
styles
from
'./index.less'
const
CheckboxGroup
=
Checkbox
.
Group
;
import
qs
from
'qs'
;
const
{
Option
}
=
Select
;
const
AddModal
=
props
=>
{
const
{
callBackSubmit
=
()
=>
{
},
type
,
visible
,
tableList
}
=
props
;
...
...
@@ -33,14 +34,17 @@ const AddModal = props => {
const
onSubmit
=
()
=>
{
let
fieldNames
=
[];
(
checkedList
||
[]).
map
(
item
=>
{
fieldNames
.
push
({
fieldNames
:
item
})
fieldNames
.
push
({
fieldNames
:
item
})
})
form
.
validateFields
().
then
(
validate
=>
{
if
(
validate
)
{
setLoading
(
true
);
let
obj
=
form
.
getFieldsValue
();
console
.
log
({
tableName
:
obj
.
tableName
,
alias
:
obj
.
tableAlias
||
''
,
fieldNames
:
checkedList
});
addTables
({
tableName
:
obj
.
tableName
,
alias
:
obj
.
tableAlias
||
''
,
fieldNames
:
checkedList
}).
then
(
res
=>
{
let
params
=
{
tableName
:
obj
.
tableName
,
alias
:
obj
.
tableAlias
||
''
,
fieldNames
:
checkedList
}
console
.
log
(
checkedList
,
'checkedList'
);
addTables
({
tableName
:
obj
.
tableName
,
alias
:
obj
.
tableAlias
||
''
,
fieldNames
:
checkedList
.
join
(
','
)}).
then
(
res
=>
{
setLoading
(
false
);
if
(
res
.
msg
===
"Ok"
)
{
form
.
resetFields
();
...
...
@@ -55,7 +59,7 @@ const AddModal = props => {
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
'新增失败'
,
description
:
res
.
msg
,
});
}
})
...
...
src/services/platform/bs.jsx
View file @
931c7144
...
...
@@ -25,4 +25,8 @@ export const loadUnattachedTables = () =>
//7.附加表
export
const
addTables
=
(
param
)
=>
get
(
`
${
PUBLISH_SERVICE
}
/CaseManage/AddTables`
,
param
);
\ No newline at end of file
get
(
`
${
PUBLISH_SERVICE
}
/CaseManage/AddTables`
,
param
);
//8.添加表字段
export
const
addFields
=
(
param
)
=>
get
(
`
${
PUBLISH_SERVICE
}
/CaseManage/AddFields`
,
param
);
\ 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