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
0e9bfe4b
Commit
0e9bfe4b
authored
Oct 15, 2021
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 添加外部字段模块,修改表返回位置问题
parent
5946c5ef
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
292 additions
and
151 deletions
+292
-151
index.jsx
src/pages/platformCenter/bsmanager/tablemanager/index.jsx
+226
-139
flowNode.jsx
...s/platformCenter/bsmanager/workFlow/flowNode/flowNode.jsx
+1
-1
flowNode.less
.../platformCenter/bsmanager/workFlow/flowNode/flowNode.less
+9
-0
NodeEdit.jsx
...manager/workFlow/flowNode/flowNodeComponents/NodeEdit.jsx
+21
-1
Fieldselection.jsx
.../flowNodeComponents/nodeEditComponents/Fieldselection.jsx
+1
-3
filedConfig.jsx
src/pages/platformCenter/filedConfig/filedConfig.jsx
+5
-3
editorModal.jsx
src/pages/platformCenter/standingBook/editorModal.jsx
+26
-2
utils.js
src/pages/webConfig/utils.js
+1
-0
bs.jsx
src/services/platform/bs.jsx
+2
-2
No files found.
src/pages/platformCenter/bsmanager/tablemanager/index.jsx
View file @
0e9bfe4b
import
React
,
{
useEffect
,
useState
}
from
'react'
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
{
import
{
// Tree,
// Tree,
...
@@ -11,58 +11,92 @@ import {
...
@@ -11,58 +11,92 @@ import {
notification
,
notification
,
Spin
,
Spin
,
Tooltip
,
Tooltip
,
Badge
,
Spac
Badge
,
Spac
,
}
from
'antd'
;
}
from
'antd'
;
import
{
EditOutlined
,
DeleteOutlined
,
FontColorsOutlined
,
PlusSquareOutlined
,
SortDescendingOutlined
,
PlusOutlined
,
BorderInnerOutlined
}
from
'@ant-design/icons'
;
import
{
EditOutlined
,
DeleteOutlined
,
FontColorsOutlined
,
PlusSquareOutlined
,
SortDescendingOutlined
,
PlusOutlined
,
BorderInnerOutlined
,
}
from
'@ant-design/icons'
;
import
PageContainer
from
'@/components/BasePageContainer'
;
import
PageContainer
from
'@/components/BasePageContainer'
;
import
{
CM_Table_LoadTable
,
removeTable
,
loadUnattachedTables
}
from
'@/services/platform/bs'
import
{
import
styles
from
'./index.less'
CM_Table_LoadTable
,
import
Editor
from
'./components/Field/editor'
removeTable
,
import
AddTablelList
from
'./components/Field/addTable'
loadUnattachedTables
,
import
AffiliateAdd
from
'./components/Field/affiliateAdd'
}
from
'@/services/platform/bs'
;
import
LoadGroup
from
'./components/Field/loadGroup'
import
styles
from
'./index.less'
;
import
Editor
from
'./components/Field/editor'
;
import
AddTablelList
from
'./components/Field/addTable'
;
import
AffiliateAdd
from
'./components/Field/affiliateAdd'
;
import
LoadGroup
from
'./components/Field/loadGroup'
;
import
{
useHistory
}
from
'react-router-dom'
;
import
{
useHistory
}
from
'react-router-dom'
;
const
{
Search
}
=
Input
;
const
{
Search
}
=
Input
;
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
const
placeholder
=
"请输入表名"
const
placeholder
=
'请输入表名'
;
const
TableManager
=
(
props
)
=>
{
const
TableManager
=
props
=>
{
const
history
=
useHistory
();
const
history
=
useHistory
();
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
visible
,
setVisible
]
=
useState
(
false
);
// 弹窗
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
type
,
setType
]
=
useState
(
''
);
// 弹窗类型
const
[
formObj
,
setFormObj
]
=
useState
({});
const
[
formObj
,
setFormObj
]
=
useState
({});
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 弹窗类型
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 弹窗类型
const
[
searchValue
,
setSearchValue
]
=
useState
(
''
)
const
[
searchValue
,
setSearchValue
]
=
useState
(
''
);
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
true
)
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
true
);
const
[
tableList
,
setTableList
]
=
useState
([])
const
[
tableList
,
setTableList
]
=
useState
([]);
const
[
groupArr
,
setGroupArr
]
=
useState
([])
const
[
groupArr
,
setGroupArr
]
=
useState
([]);
const
[
allData
,
setAllData
]
=
useState
([])
const
[
allData
,
setAllData
]
=
useState
([]);
const
[
tableData
,
setTableData
]
=
useState
([])
const
[
tableData
,
setTableData
]
=
useState
([]);
const
[
select
,
setSelect
]
=
useState
([])
const
[
select
,
setSelect
]
=
useState
([]);
const
[
selectTableName
,
setSelectTableName
]
=
useState
({})
const
[
selectTableName
,
setSelectTableName
]
=
useState
(
''
);
useEffect
((
record
)
=>
{
useEffect
(
loadTable
(
searchValue
)
record
=>
{
getField
()
loadTable
(
searchValue
);
if
(
props
.
history
.
location
.
state
)
{
getField
();
let
template
=
props
.
history
.
location
.
state
.
template
// if (props.history.location.query && selectTableName !== {}) {
setSelectTableName
(
template
)
// let { template } = props.history.location.query;
// setSelectTableName(template);
// }
},
[
flag
],
);
// 重字段配置返回后需要返回到原来的位置
useEffect
(()
=>
{
let
arr
=
Object
.
keys
(
allData
);
console
.
log
(
selectTableName
,
'selectTableName'
);
console
.
log
(
arr
,
'arr'
);
console
.
log
(
props
.
history
.
location
.
query
,
'props.history.location.query'
);
if
(
arr
.
length
>
0
&&
props
.
history
.
location
.
query
&&
selectTableName
==
''
)
{
console
.
log
(
234534256342
);
let
{
tableScroll
,
template
}
=
props
.
history
.
location
.
query
;
setSelectTableName
(
template
);
setTimeout
(()
=>
{
document
.
querySelector
(
'.ant-table-body'
).
scrollTop
=
tableScroll
;
},
0
);
}
}
},
[
flag
])
},
[
allData
]);
// 附加
//附加
const
add
=
record
=>
{
const
add
=
(
record
)
=>
{
setFormObj
(
record
);
setFormObj
(
record
);
setType
(
'affiliateAdd'
);
setType
(
'affiliateAdd'
);
setVisible
(
true
);
setVisible
(
true
);
}
};
//
修改表名
//
修改表名
const
changeDesc
=
(
record
)
=>
{
const
changeDesc
=
record
=>
{
setType
(
'edit'
);
setType
(
'edit'
);
setVisible
(
true
);
setVisible
(
true
);
setFormObj
(
record
);
setFormObj
(
record
);
}
};
//
删除表
//
删除表
const
deleteChart
=
(
record
)
=>
{
const
deleteChart
=
record
=>
{
removeTable
({
tableID
:
record
.
tableID
,
removeFields
:
true
}).
then
(
res
=>
{
removeTable
({
tableID
:
record
.
tableID
,
removeFields
:
true
}).
then
(
res
=>
{
if
(
res
.
msg
===
'Ok'
||
res
.
msg
===
''
)
{
if
(
res
.
msg
===
'Ok'
||
res
.
msg
===
''
)
{
notification
.
success
({
notification
.
success
({
...
@@ -70,138 +104,146 @@ const TableManager = (props) => {
...
@@ -70,138 +104,146 @@ const TableManager = (props) => {
duration
:
3
,
duration
:
3
,
description
:
'删除成功'
,
description
:
'删除成功'
,
});
});
setFlag
(
flag
+
1
)
setFlag
(
flag
+
1
);
}
}
else
{
else
{
notification
.
error
({
notification
.
error
({
message
:
'提示'
,
message
:
'提示'
,
duration
:
3
,
duration
:
3
,
description
:
res
.
msg
,
description
:
res
.
msg
,
});
});
}
}
})
});
}
};
const
onSubmit
=
prop
=>
{
const
onSubmit
=
prop
=>
{
setVisible
(
false
);
setVisible
(
false
);
setFlag
(
flag
+
1
)
setFlag
(
flag
+
1
);
};
};
//
建表
//
建表
const
AddTable
=
()
=>
{
const
AddTable
=
()
=>
{
setType
(
'add'
);
setType
(
'add'
);
setVisible
(
true
);
setVisible
(
true
);
}
};
//
附加表
//
附加表
const
AffiliateAddTable
=
()
=>
{
const
AffiliateAddTable
=
()
=>
{
setType
(
'affiliateAdd'
);
setType
(
'affiliateAdd'
);
setFormObj
({});
setFormObj
({});
setVisible
(
true
);
setVisible
(
true
);
}
};
//
字段配置
//
字段配置
const
fieldsConfig
=
(
record
,
e
)
=>
{
const
fieldsConfig
=
(
record
,
e
)
=>
{
e
.
stopPropagation
()
e
.
stopPropagation
();
setFormObj
(
record
);
setFormObj
(
record
);
history
.
push
({
pathname
:
`/platformCenter/bsmanger/filedConfig/
${
record
.
tableName
}
`
,
state
:
{
template
:
record
}
})
history
.
push
({
pathname
:
`/platformCenter/bsmanger/filedConfig/
${
record
.
tableName
}
`
,
state
:
{
template
:
record
,
tableScroll
:
document
.
querySelector
(
'.ant-table-body'
).
scrollTop
,
},
});
// setType('config');
// setType('config');
// setVisible(true);
// setVisible(true);
}
};
//
分组与排序
//
分组与排序
const
sort
=
(
record
)
=>
{
const
sort
=
record
=>
{
setFormObj
(
record
);
setFormObj
(
record
);
setType
(
'sort'
);
setType
(
'sort'
);
setVisible
(
true
);
setVisible
(
true
);
}
};
//
搜索框改变时存储输入的值
//
搜索框改变时存储输入的值
const
handleChange
=
(
e
)
=>
{
const
handleChange
=
e
=>
{
setSearchValue
(
e
.
target
.
value
)
setSearchValue
(
e
.
target
.
value
);
}
};
//
搜索
//
搜索
const
handleSearch
=
(
text
)
=>
{
const
handleSearch
=
text
=>
{
loadTable
(
text
)
loadTable
(
text
);
setSearchValue
(
text
)
setSearchValue
(
text
);
}
};
const
getField
=
()
=>
{
const
getField
=
()
=>
{
loadUnattachedTables
().
then
(
res
=>
{
loadUnattachedTables
().
then
(
res
=>
{
if
(
res
.
data
.
root
&&
res
.
data
.
root
.
length
)
{
if
(
res
.
data
.
root
&&
res
.
data
.
root
.
length
)
{
setTableList
(
res
.
data
.
root
)
setTableList
(
res
.
data
.
root
);
}
})
}
}
//加载表
});
const
loadTable
=
(
keyword
)
=>
{
};
setTreeLoading
(
true
)
// 加载表
const
loadTable
=
keyword
=>
{
setTreeLoading
(
true
);
CM_Table_LoadTable
({
CM_Table_LoadTable
({
_version
:
9999
,
_version
:
9999
,
filter
:
keyword
||
''
filter
:
keyword
||
''
,
}).
then
(
})
res
=>
{
.
then
(
res
=>
{
setTreeLoading
(
false
)
setTreeLoading
(
false
);
if
(
res
.
msg
===
'Ok'
)
{
if
(
res
.
msg
===
'Ok'
)
{
setTableData
(
res
.
data
.
root
)
setTableData
(
res
.
data
.
root
);
let
groupData
=
formateArrDataA
(
res
.
data
.
root
,
'groupName'
)
let
groupData
=
formateArrDataA
(
res
.
data
.
root
,
'groupName'
);
let
newArr
=
[]
let
newArr
=
[];
Object
.
keys
(
groupData
).
map
((
item
,
index
)
=>
{
Object
.
keys
(
groupData
).
map
((
item
,
index
)
=>
{
newArr
.
push
({
type
:
item
,
key
:
index
})
newArr
.
push
({
type
:
item
,
key
:
index
});
})
});
setAllData
(
groupData
)
setAllData
(
groupData
);
setGroupArr
(
newArr
)
setGroupArr
(
newArr
);
setSelect
(
newArr
)
setSelect
(
newArr
);
}
}
}
).
catch
(
e
=>
{
setTreeLoading
(
true
)
})
})
}
.
catch
(
e
=>
{
setTreeLoading
(
true
);
});
};
const
formateArrDataA
=
(
initialArr
,
name
)
=>
{
const
formateArrDataA
=
(
initialArr
,
name
)
=>
{
// 判定传参是否符合规则
// 判定传参是否符合规则
if
(
!
(
initialArr
instanceof
Array
))
{
if
(
!
(
initialArr
instanceof
Array
))
{
return
'请传入正确格式的数组'
return
'请传入正确格式的数组'
;
}
}
if
(
!
name
)
{
if
(
!
name
)
{
return
'请传入对象属性'
return
'请传入对象属性'
;
}
}
//
先获取一下这个数组中有多少个"name"
//
先获取一下这个数组中有多少个"name"
let
nameArr
=
[]
let
nameArr
=
[];
for
(
let
i
in
initialArr
)
{
for
(
let
i
in
initialArr
)
{
if
(
nameArr
.
indexOf
(
initialArr
[
i
][
`
${
name
}
`
])
===
-
1
)
{
if
(
nameArr
.
indexOf
(
initialArr
[
i
][
`
${
name
}
`
])
===
-
1
)
{
nameArr
.
push
(
initialArr
[
i
][
`
${
name
}
`
])
nameArr
.
push
(
initialArr
[
i
][
`
${
name
}
`
]);
}
}
}
}
//
新建一个包含多个list的结果对象
//
新建一个包含多个list的结果对象
let
tempObj
=
{}
let
tempObj
=
{};
// 根据不同的"name"生成多个数组
// 根据不同的"name"生成多个数组
for
(
let
k
in
nameArr
)
{
for
(
let
k
in
nameArr
)
{
for
(
let
j
in
initialArr
)
{
for
(
let
j
in
initialArr
)
{
if
(
initialArr
[
j
][
`
${
name
}
`
]
==
nameArr
[
k
])
{
if
(
initialArr
[
j
][
`
${
name
}
`
]
==
nameArr
[
k
])
{
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
tempObj
[
nameArr
[
k
]]
=
tempObj
[
nameArr
[
k
]]
||
[]
tempObj
[
nameArr
[
k
]]
=
tempObj
[
nameArr
[
k
]]
||
[];
tempObj
[
nameArr
[
k
]].
push
(
initialArr
[
j
])
tempObj
[
nameArr
[
k
]].
push
(
initialArr
[
j
]);
}
}
}
}
}
}
for
(
let
keys
in
tempObj
)
{
for
(
let
keys
in
tempObj
)
{
let
arr
=
[]
let
arr
=
[];
tempObj
[
keys
].
map
((
item
,
index
)
=>
{
tempObj
[
keys
].
map
((
item
,
index
)
=>
{
tempObj
[
keys
]
=
arr
;
tempObj
[
keys
]
=
arr
;
item
.
key
=
index
item
.
key
=
index
;
arr
.
push
(
item
)
arr
.
push
(
item
);
})
});
}
return
tempObj
}
}
return
tempObj
;
};
const
setRowClassName
=
record
=>
const
setRowClassName
=
record
=>
Object
.
entries
(
record
).
toString
()
===
Object
.
entries
(
selectTableName
).
toString
()
?
styles
.
clickRowStyle
:
''
;
Object
.
entries
(
record
).
toString
()
===
const
expandedRowRender
=
(
item
)
=>
{
Object
.
entries
(
selectTableName
).
toString
()
?
styles
.
clickRowStyle
:
''
;
const
expandedRowRender
=
item
=>
{
const
columns1
=
[
const
columns1
=
[
{
{
title
:
'名称'
,
title
:
'名称'
,
dataIndex
:
'tableName'
,
dataIndex
:
'tableName'
,
key
:
'tableName'
,
key
:
'tableName'
,
width
:
300
,
width
:
300
,
render
:
(
text
,
record
)
=>
<
div
onClick=
{
e
=>
fieldsConfig
(
record
,
e
)
}
>
{
text
}
</
div
>,
render
:
(
text
,
record
)
=>
(
<
div
onClick=
{
e
=>
fieldsConfig
(
record
,
e
)
}
>
{
text
}
</
div
>
),
},
},
{
{
title
:
'别名'
,
title
:
'别名'
,
...
@@ -213,7 +255,7 @@ const TableManager = (props) => {
...
@@ -213,7 +255,7 @@ const TableManager = (props) => {
title
:
'表格样式'
,
title
:
'表格样式'
,
dataIndex
:
'tableStyle'
,
dataIndex
:
'tableStyle'
,
key
:
'tableStyle'
,
key
:
'tableStyle'
,
align
:
'center'
align
:
'center'
,
},
},
{
{
title
:
'附加字段'
,
title
:
'附加字段'
,
...
@@ -227,10 +269,16 @@ const TableManager = (props) => {
...
@@ -227,10 +269,16 @@ const TableManager = (props) => {
key
:
'missingFieldCount'
,
key
:
'missingFieldCount'
,
align
:
'center'
,
align
:
'center'
,
render
:
text
=>
{
render
:
text
=>
{
return
(<
div
className=
{
classnames
({
return
(
[
styles
.
lack
]:
text
!==
'(无)'
,
<
div
})
}
>
{
text
}
</
div
>)
className=
{
classnames
({
}
[
styles
.
lack
]:
text
!==
'(无)'
,
})
}
>
{
text
}
</
div
>
);
},
},
},
{
{
title
:
'未附加'
,
title
:
'未附加'
,
...
@@ -294,30 +342,53 @@ const TableManager = (props) => {
...
@@ -294,30 +342,53 @@ const TableManager = (props) => {
</
Space
>
</
Space
>
),
),
},
},
];
];
return
<
Table
columns=
{
columns1
}
bordered
size=
"small"
onRow=
{
record
=>
{
return
(
<
Table
columns=
{
columns1
}
bordered
size=
"small"
onRow=
{
record
=>
{
return
{
return
{
onDoubleClick
:
event
=>
{
onDoubleClick
:
event
=>
{
event
.
stopPropagation
()
event
.
stopPropagation
();
history
.
push
({
pathname
:
`/platformCenter/bsmanger/filedConfig/${record.tableName}`
,
state
:
{
template
:
record
}
})
history
.
push
({
pathname
:
`/platformCenter/bsmanger/filedConfig/${
record.tableName
}`
,
state
:
{
template
:
record
,
tableScroll
:
document
.
querySelector
(
'.ant-table-body'
)
.
scrollTop
,
},
});
},
},
onClick
:
event
=>
{
onClick
:
event
=>
{
event
.
stopPropagation
()
event
.
stopPropagation
();
setSelectTableName
(
record
)
setSelectTableName
(
record
);
},
// 点击行
},
// 点击行
}
};
}
}
}
}
rowClassName=
{
setRowClassName
}
rowClassName=
{
setRowClassName
}
showHeader=
{
false
}
dataSource=
{
allData
[
item
.
type
]
}
pagination=
{
false
}
/>;
showHeader=
{
false
}
dataSource=
{
allData
[
item
.
type
]
}
pagination=
{
false
}
/>
);
};
};
const
columns
=
[
const
columns
=
[
{
{
title
:
'名称'
,
dataIndex
:
'type'
,
key
:
'type'
,
title
:
'名称'
,
dataIndex
:
'type'
,
key
:
'type'
,
render
:
text
=>
{
render
:
text
=>
{
return
(<
a
style=
{
{
fontWeight
:
'bold'
}
}
>
{
text
}
(
{
allData
&&
allData
[
text
]
?
allData
[
text
].
length
:
0
}
个)
</
a
>)
return
(
<
a
style=
{
{
fontWeight
:
'bold'
}
}
>
{
text
}
(
{
allData
&&
allData
[
text
]
?
allData
[
text
].
length
:
0
}
个)
</
a
>
);
},
},
width
:
260
,
width
:
260
,
},
},
...
@@ -345,8 +416,8 @@ const TableManager = (props) => {
...
@@ -345,8 +416,8 @@ const TableManager = (props) => {
key
:
'missingFieldCount'
,
key
:
'missingFieldCount'
,
align
:
'center'
,
align
:
'center'
,
render
:
text
=>
{
render
:
text
=>
{
return
(<
div
>
{
text
}
</
div
>)
return
<
div
>
{
text
}
</
div
>;
}
},
},
},
{
{
title
:
'未附加'
,
title
:
'未附加'
,
...
@@ -359,27 +430,24 @@ const TableManager = (props) => {
...
@@ -359,27 +430,24 @@ const TableManager = (props) => {
dataIndex
:
'groupCount'
,
dataIndex
:
'groupCount'
,
key
:
'groupCount'
,
key
:
'groupCount'
,
align
:
'center'
,
align
:
'center'
,
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
dataIndex
:
'title'
,
dataIndex
:
'title'
,
key
:
'title'
,
key
:
'title'
,
align
:
'center'
,
align
:
'center'
,
},
},
];
];
const
onUnfold
=
(
expanded
,
record
)
=>
{
const
onUnfold
=
(
expanded
,
record
)
=>
{
const
data
=
[...
select
]
const
data
=
[...
select
];
let
index
=
data
.
indexOf
(
record
)
let
index
=
data
.
indexOf
(
record
);
if
(
expanded
)
{
if
(
expanded
)
{
data
.
push
(
record
)
data
.
push
(
record
);
}
else
{
}
else
{
data
.
splice
(
index
,
1
)
data
.
splice
(
index
,
1
);
}
setSelect
(
data
)
}
}
setSelect
(
data
);
};
return
(
return
(
<
Spin
tip=
"loading..."
spinning=
{
treeLoading
}
>
<
Spin
tip=
"loading..."
spinning=
{
treeLoading
}
>
<
PageContainer
>
<
PageContainer
>
...
@@ -394,15 +462,34 @@ const TableManager = (props) => {
...
@@ -394,15 +462,34 @@ const TableManager = (props) => {
onChange=
{
handleChange
}
onChange=
{
handleChange
}
value=
{
searchValue
}
value=
{
searchValue
}
enterButton
enterButton
style=
{
{
width
:
"300px"
}
}
style=
{
{
width
:
'300px'
}
}
/>
/>
</
div
>
</
div
>
<
Button
type=
"primary"
style=
{
{
marginLeft
:
"10px"
}
}
icon=
{
<
BorderInnerOutlined
/>
}
onClick=
{
AddTable
}
>
建表
</
Button
>
<
Button
<
Button
type=
"primary"
style=
{
{
marginLeft
:
"10px"
}
}
icon=
{
<
PlusOutlined
/>
}
onClick=
{
AffiliateAddTable
}
>
附加表
</
Button
>
type=
"primary"
style=
{
{
marginLeft
:
'10px'
}
}
icon=
{
<
BorderInnerOutlined
/>
}
onClick=
{
AddTable
}
>
建表
</
Button
>
<
Button
type=
"primary"
style=
{
{
marginLeft
:
'10px'
}
}
icon=
{
<
PlusOutlined
/>
}
onClick=
{
AffiliateAddTable
}
>
附加表
</
Button
>
</
div
>
</
div
>
<
div
style=
{
{
width
:
'100vm'
,
height
:
'calc(100vh - 150px) '
,
background
:
'#ffffff'
}
}
>
<
div
style=
{
{
width
:
'100vm'
,
height
:
'calc(100vh - 150px) '
,
background
:
'#ffffff'
,
}
}
>
{
/* <Table
{
/* <Table
columns={columns}
columns={columns}
dataSource={tableData}
dataSource={tableData}
...
@@ -424,7 +511,7 @@ const TableManager = (props) => {
...
@@ -424,7 +511,7 @@ const TableManager = (props) => {
className=
"components-table-demo-nested"
className=
"components-table-demo-nested"
columns=
{
columns
}
columns=
{
columns
}
expandable=
{
{
expandedRowRender
}
}
expandable=
{
{
expandedRowRender
}
}
expandedRowKeys=
{
select
.
map
(
item
=>
item
.
key
)
}
//
展开的行
expandedRowKeys=
{
select
.
map
(
item
=>
item
.
key
)
}
//
展开的行
expandRowByClick=
{
true
}
expandRowByClick=
{
true
}
defaultExpandAllRows=
{
true
}
defaultExpandAllRows=
{
true
}
dataSource=
{
groupArr
}
dataSource=
{
groupArr
}
...
@@ -443,7 +530,8 @@ const TableManager = (props) => {
...
@@ -443,7 +530,8 @@ const TableManager = (props) => {
onCancel=
{
()
=>
setVisible
(
false
)
}
onCancel=
{
()
=>
setVisible
(
false
)
}
callBackSubmit=
{
onSubmit
}
callBackSubmit=
{
onSubmit
}
type=
{
type
}
type=
{
type
}
formObj=
{
formObj
}
/>
formObj=
{
formObj
}
/>
)
}
)
}
{
visible
&&
type
===
'add'
&&
(
{
visible
&&
type
===
'add'
&&
(
<
AddTablelList
<
AddTablelList
...
@@ -474,7 +562,6 @@ const TableManager = (props) => {
...
@@ -474,7 +562,6 @@ const TableManager = (props) => {
)
}
)
}
</
PageContainer
>
</
PageContainer
>
</
Spin
>
</
Spin
>
)
);
};
}
export
default
TableManager
;
export
default
TableManager
;
src/pages/platformCenter/bsmanager/workFlow/flowNode/flowNode.jsx
View file @
0e9bfe4b
...
@@ -85,7 +85,7 @@ const FlowNode = () => {
...
@@ -85,7 +85,7 @@ const FlowNode = () => {
// 控制表格的展开跟收起
// 控制表格的展开跟收起
const
onUnfold
=
(
expanded
,
record
)
=>
{
const
onUnfold
=
(
expanded
,
record
)
=>
{
const
data
=
[...
expandedRowKeys
];
const
data
=
[...
expandedRowKeys
];
let
index
=
data
.
indexOf
(
record
);
let
index
=
data
.
indexOf
(
record
.
GroupName
);
if
(
expanded
)
{
if
(
expanded
)
{
data
.
push
(
record
.
GroupName
);
data
.
push
(
record
.
GroupName
);
}
else
{
}
else
{
...
...
src/pages/platformCenter/bsmanager/workFlow/flowNode/flowNode.less
View file @
0e9bfe4b
...
@@ -113,7 +113,16 @@
...
@@ -113,7 +113,16 @@
margin-bottom: 10px;
margin-bottom: 10px;
font-weight: 700;
font-weight: 700;
color: #15428b;
color: #15428b;
line-height: 100%;
border-top-color: #99bbe8;
border-top-color: #99bbe8;
.groupName {
display: inline-block;
margin-right: 10px;
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
}
...
...
src/pages/platformCenter/bsmanager/workFlow/flowNode/flowNodeComponents/NodeEdit.jsx
View file @
0e9bfe4b
...
@@ -100,19 +100,36 @@ const NodeEdit = props => {
...
@@ -100,19 +100,36 @@ const NodeEdit = props => {
loadEventFields
({
eventTableName
:
value
.
TableName
}).
then
(
res
=>
{
loadEventFields
({
eventTableName
:
value
.
TableName
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
let
defaultCheckedList
=
value
[
val
]
?
value
[
val
].
split
(
','
)
:
[];
let
defaultCheckedList
=
value
[
val
]
?
value
[
val
].
split
(
','
)
:
[];
let
allFields
=
[];
// 所有得字段用来判断是否为外部字段
// 处理树形结构
// 处理树形结构
let
checkList
=
res
.
data
.
map
(
item
=>
{
let
checkList
=
res
.
data
.
map
(
item
=>
{
let
plainOptions
=
[];
let
plainOptions
=
[];
// 存入没个组得字段
item
.
root
.
forEach
(
ele
=>
{
item
.
root
.
forEach
(
ele
=>
{
plainOptions
=
[...
plainOptions
,
ele
.
fieldName
];
plainOptions
=
[...
plainOptions
,
ele
.
fieldName
];
});
});
// 存所有得字段
allFields
=
[...
allFields
,
...
plainOptions
];
return
{
return
{
groupName
:
item
.
groupName
,
groupName
:
item
.
groupName
,
plainOptions
,
plainOptions
,
defaultCheckedList
:
[],
defaultCheckedList
:
[],
};
};
});
});
let
externalFields
=
{
groupName
:
'外部字段'
,
indeterminate
:
false
,
checkAll
:
true
,
plainOptions
:
[],
defaultCheckedList
:
[],
};
// 外部字段
defaultCheckedList
.
forEach
(
item
=>
{
defaultCheckedList
.
forEach
(
item
=>
{
// 添加外部字段
let
isExternal
=
allFields
.
some
(
checkName
=>
checkName
===
item
);
if
(
!
isExternal
)
{
externalFields
.
plainOptions
.
push
(
item
);
externalFields
.
defaultCheckedList
.
push
(
item
);
}
checkList
.
forEach
(
element
=>
{
checkList
.
forEach
(
element
=>
{
// 当前得模块是否有当前字段
// 当前得模块是否有当前字段
let
indeterminate
=
element
.
plainOptions
.
some
(
let
indeterminate
=
element
.
plainOptions
.
some
(
...
@@ -140,7 +157,10 @@ const NodeEdit = props => {
...
@@ -140,7 +157,10 @@ const NodeEdit = props => {
}
}
});
});
});
});
console
.
log
(
checkList
,
'checkList'
);
// 添加外部字段
if
(
externalFields
.
plainOptions
.
length
>
0
)
{
checkList
.
push
(
externalFields
);
}
setFieldList
(
checkList
);
setFieldList
(
checkList
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
setShowField
(
true
);
setShowField
(
true
);
...
...
src/pages/platformCenter/bsmanager/workFlow/flowNode/flowNodeComponents/nodeEditComponents/Fieldselection.jsx
View file @
0e9bfe4b
...
@@ -98,9 +98,7 @@ const Fieldselection = props => {
...
@@ -98,9 +98,7 @@ const Fieldselection = props => {
<
div
className=
{
styles
.
cardBox
}
key=
{
index
}
>
<
div
className=
{
styles
.
cardBox
}
key=
{
index
}
>
<
div
className=
{
styles
.
title
}
>
<
div
className=
{
styles
.
title
}
>
<
Divider
orientation=
"left"
className=
{
styles
.
cardDivider
}
>
<
Divider
orientation=
"left"
className=
{
styles
.
cardDivider
}
>
<
span
style=
{
{
marginRight
:
'10px'
}
}
>
<
span
className=
{
styles
.
groupName
}
>
{
item
.
groupName
}
</
span
>
{
item
.
groupName
}
</
span
>
<
Checkbox
<
Checkbox
indeterminate=
{
item
.
indeterminate
}
indeterminate=
{
item
.
indeterminate
}
onChange=
{
e
=>
onCheckAllChange
(
e
,
index
)
}
onChange=
{
e
=>
onCheckAllChange
(
e
,
index
)
}
...
...
src/pages/platformCenter/filedConfig/filedConfig.jsx
View file @
0e9bfe4b
...
@@ -358,11 +358,13 @@ const AddModal = props => {
...
@@ -358,11 +358,13 @@ const AddModal = props => {
};
};
// 返回上一级
// 返回上一级
const
back
=
()
=>
{
const
back
=
()
=>
{
console
.
log
(
props
)
let
{
template
,
tableScroll
}
=
props
.
location
.
state
;
let
template
=
props
.
location
.
state
.
template
;
history
.
push
({
history
.
push
({
pathname
:
'/platformCenter/bsmanger/tablemanger'
,
pathname
:
'/platformCenter/bsmanger/tablemanger'
,
state
:
{
template
},
query
:
{
template
,
tableScroll
,
},
});
});
};
};
const
onUnfold
=
(
expanded
,
record
)
=>
{
const
onUnfold
=
(
expanded
,
record
)
=>
{
...
...
src/pages/platformCenter/standingBook/editorModal.jsx
View file @
0e9bfe4b
/* eslint-disable guard-for-in */
/* eslint-disable no-restricted-syntax */
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
import
{
Form
,
Form
,
...
@@ -64,6 +66,7 @@ const AddModal = props => {
...
@@ -64,6 +66,7 @@ const AddModal = props => {
const
[
Type
,
setType
]
=
useState
(
''
);
const
[
Type
,
setType
]
=
useState
(
''
);
const
[
characterValue
,
setCharacterValue
]
=
useState
(
''
);
const
[
characterValue
,
setCharacterValue
]
=
useState
(
''
);
const
[
standingType
,
setStandingType
]
=
useState
([
'台账'
,
'反馈'
,
'设备'
]);
const
[
standingType
,
setStandingType
]
=
useState
([
'台账'
,
'反馈'
,
'设备'
]);
const
[
allFileds
,
setAllFileds
]
=
useState
([]);
// 当前表所有的字段
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
{
Item
}
=
Form
;
const
{
Item
}
=
Form
;
// 提交
// 提交
...
@@ -166,14 +169,18 @@ const AddModal = props => {
...
@@ -166,14 +169,18 @@ const AddModal = props => {
if
(
!
name
)
{
if
(
!
name
)
{
return
'请传入对象属性'
;
return
'请传入对象属性'
;
}
}
//先获取一下这个数组中有多少个"name"
//
先获取一下这个数组中有多少个"name"
let
nameArr
=
[];
let
nameArr
=
[];
let
allFile
=
[];
for
(
let
i
in
initialArr
)
{
for
(
let
i
in
initialArr
)
{
allFile
.
push
(
initialArr
[
i
].
fieldName
);
if
(
nameArr
.
indexOf
(
initialArr
[
i
][
`
${
name
}
`
])
===
-
1
)
{
if
(
nameArr
.
indexOf
(
initialArr
[
i
][
`
${
name
}
`
])
===
-
1
)
{
nameArr
.
push
(
initialArr
[
i
][
`
${
name
}
`
]);
nameArr
.
push
(
initialArr
[
i
][
`
${
name
}
`
]);
}
}
}
}
//新建一个包含多个list的结果对象
// 保存所有的字段用来比较是否有外部字段
setAllFileds
(
allFile
);
// 新建一个包含多个list的结果对象
let
tempObj
=
{};
let
tempObj
=
{};
// 根据不同的"name"生成多个数组
// 根据不同的"name"生成多个数组
console
.
log
(
initialArr
);
console
.
log
(
initialArr
);
...
@@ -204,9 +211,26 @@ const AddModal = props => {
...
@@ -204,9 +211,26 @@ const AddModal = props => {
setInputVaule
(
inputText
);
setInputVaule
(
inputText
);
};
};
const
pickFiled
=
fileds
=>
{
const
pickFiled
=
fileds
=>
{
// 添加外部字段
let
fil
=
{
...
filed
};
fil
[
'外部字段'
]
=
[];
let
isExternal
;
inputValue
[
fileds
].
split
(
','
).
forEach
(
item
=>
{
isExternal
=
allFileds
.
some
(
val
=>
val
===
item
);
if
(
!
isExternal
&&
item
!==
''
)
{
fil
[
'外部字段'
].
push
(
item
);
}
});
if
(
fil
[
'外部字段'
].
length
===
0
)
{
delete
fil
[
'外部字段'
];
}
setFiled
(
fil
);
setTypes
(
'add'
);
setTypes
(
'add'
);
setCharacterValue
(
inputValue
[
fileds
]);
setCharacterValue
(
inputValue
[
fileds
]);
setCheckedList
(
inputValue
[
fileds
].
split
(
','
));
setCheckedList
(
inputValue
[
fileds
].
split
(
','
));
setPickItem
(
fileds
);
setPickItem
(
fileds
);
setIsVisible
(
true
);
setIsVisible
(
true
);
};
};
...
...
src/pages/webConfig/utils.js
View file @
0e9bfe4b
...
@@ -69,6 +69,7 @@ export const defaultWebConfigObj = {
...
@@ -69,6 +69,7 @@ export const defaultWebConfigObj = {
mapPlan
:
''
,
mapPlan
:
''
,
qrcode
:
''
,
qrcode
:
''
,
loginTemplate
:
'Default.html'
,
loginTemplate
:
'Default.html'
,
alarmWays
:
notificationTypes
.
MQTT
,
};
};
export
const
getDefaultGetWebconfig
=
({
export
const
getDefaultGetWebconfig
=
({
...
...
src/services/platform/bs.jsx
View file @
0e9bfe4b
...
@@ -25,11 +25,11 @@ export const loadUnattachedTables = () =>
...
@@ -25,11 +25,11 @@ export const loadUnattachedTables = () =>
//7.附加表
//7.附加表
export
const
addTables
=
(
param
)
=>
export
const
addTables
=
(
param
)
=>
ge
t
(
`
${
PUBLISH_SERVICE
}
/CaseManage/AddTables`
,
param
);
pos
t
(
`
${
PUBLISH_SERVICE
}
/CaseManage/AddTables`
,
param
);
//8.添加表字段
//8.添加表字段
export
const
addFields
=
(
param
)
=>
export
const
addFields
=
(
param
)
=>
ge
t
(
`
${
PUBLISH_SERVICE
}
/CaseManage/AddFields`
,
param
);
pos
t
(
`
${
PUBLISH_SERVICE
}
/CaseManage/AddFields`
,
param
);
//9.获取表信息
//9.获取表信息
...
...
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