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
7c81744f
Commit
7c81744f
authored
Jul 14, 2021
by
shaoan123
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决表字段搜索bug
parent
3739e38c
Pipeline
#31553
skipped with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
133 additions
and
63 deletions
+133
-63
index.jsx
src/pages/platformCenter/bsmanager/tablemanager/index.jsx
+1
-1
standingBook.jsx
src/pages/platformCenter/standingBook/standingBook.jsx
+119
-62
standingBook.less
src/pages/platformCenter/standingBook/standingBook.less
+7
-0
api.js
src/services/standingBook/api.js
+6
-0
No files found.
src/pages/platformCenter/bsmanager/tablemanager/index.jsx
View file @
7c81744f
...
@@ -301,7 +301,7 @@ const TableManager = () => {
...
@@ -301,7 +301,7 @@ const TableManager = () => {
{
{
title
:
'类型'
,
dataIndex
:
'type'
,
key
:
'type'
,
title
:
'类型'
,
dataIndex
:
'type'
,
key
:
'type'
,
render
:
text
=>
{
render
:
text
=>
{
return
(<
div
style=
{
{
color
:
'#3764a0'
}
}
>
{
text
}
(
{
allData
[
text
].
length
}
个)
</
div
>)
return
(<
div
style=
{
{
color
:
'#3764a0'
}
}
>
{
text
}
(
{
allData
?[
text
].
length
:
0
}
个)
</
div
>)
}
}
},
},
...
...
src/pages/platformCenter/standingBook/standingBook.jsx
View file @
7c81744f
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
import
{
Form
,
Form
,
Modal
,
Card
,
Space
,
Space
,
Table
,
Table
,
Button
,
Button
,
Popconfirm
,
Popconfirm
,
Spin
,
Spin
,
Tooltip
,
notification
,
notification
,
}
from
'antd'
;
}
from
'antd'
;
import
{
import
{
reloadTableFields
,
removeFields
}
from
'@/services/platform/bs'
;
UserOutlined
,
UserAddOutlined
,
UsergroupAddOutlined
,
EditOutlined
,
EditTwoTone
,
DeleteOutlined
,
IdcardOutlined
,
UnlockOutlined
,
ApartmentOutlined
,
StopOutlined
,
DoubleLeftOutlined
,
DoubleRightOutlined
,
DownOutlined
,
BorderlessTableOutlined
,
LockOutlined
,
PlusSquareFilled
,
EllipsisOutlined
,
PlusOutlined
,
SyncOutlined
,
}
from
'@ant-design/icons'
;
import
classnames
from
'classnames'
;
import
PageContainer
from
'@/components/BasePageContainer'
;
import
{
GetCM_Ledger_LoadLedgers
,
reloadTableFields
,
removeFields
}
from
'@/services/standingBook/api'
;
import
styles
from
'./standingBook.less'
;
const
AddModal
=
props
=>
{
const
AddModal
=
props
=>
{
const
[
allData
,
setAllData
]
=
useState
([]);
const
[
allData
,
setAllData
]
=
useState
([]);
const
[
tableData
,
setTableData
]
=
useState
([]);
const
[
tableData
,
setTableData
]
=
useState
([]);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
const
[
treeLoading
,
setTreeLoading
]
=
useState
(
false
);
const
[
treeVisible
,
setTreeVisible
]
=
useState
(
true
);
// 树是否可见
const
[
formObj
,
setFormObj
]
=
useState
(
''
);
const
[
formObj
,
setFormObj
]
=
useState
(
''
);
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 弹窗类型
const
[
flag
,
setFlag
]
=
useState
(
0
);
// 弹窗类型
const
[
isVisible
,
setIsVisible
]
=
useState
(
false
);
// 弹窗
const
[
isVisible
,
setIsVisible
]
=
useState
(
false
);
// 弹窗
...
@@ -37,58 +60,72 @@ const AddModal = props => {
...
@@ -37,58 +60,72 @@ const AddModal = props => {
const
expandedRowRender
=
(
item
)
=>
{
const
expandedRowRender
=
(
item
)
=>
{
const
columns
=
[
const
columns
=
[
{
{
title
:
'字段名'
,
title
:
'台账类型'
,
dataIndex
:
'type'
,
key
:
'type'
,
width
:
100
,
},
{
title
:
'台账名称'
,
dataIndex
:
'name'
,
dataIndex
:
'name'
,
key
:
'name'
,
key
:
'name'
,
width
:
150
,
align
:
'center'
,
render
:
text
=>
<
a
>
{
text
}
</
a
>
,
width
:
200
,
},
},
{
{
title
:
'
别
名'
,
title
:
'
台账表
名'
,
dataIndex
:
'
alias
'
,
dataIndex
:
'
tableName
'
,
key
:
'
alias
'
,
key
:
'
tableName
'
,
align
:
'center'
,
align
:
'center'
,
width
:
200
,
width
:
200
,
},
},
{
{
title
:
'
字段类型
'
,
title
:
'
台账字段
'
,
dataIndex
:
'
storeType
'
,
dataIndex
:
'
fields
'
,
key
:
'
storeType
'
,
key
:
'
fields
'
,
align
:
'center'
,
align
:
'center'
,
width
:
20
0
,
width
:
15
0
,
},
},
{
{
title
:
'
形态
'
,
title
:
'
检索字段
'
,
dataIndex
:
's
hape
'
,
dataIndex
:
's
earchFields
'
,
key
:
's
hape
'
,
key
:
's
earchFields
'
,
align
:
'center'
,
align
:
'center'
,
width
:
20
0
,
width
:
15
0
,
},
},
{
{
title
:
'
配置
'
,
title
:
'
添加字段
'
,
dataIndex
:
'
config
'
,
dataIndex
:
'
addFields
'
,
key
:
'
config
'
,
key
:
'
addFields
'
,
align
:
'center'
,
align
:
'center'
,
width
:
20
0
,
width
:
15
0
,
},
},
{
{
title
:
'
只读
'
,
title
:
'
编辑字段
'
,
dataIndex
:
'
readOnly
'
,
dataIndex
:
'
editFields
'
,
key
:
'
readOnly
'
,
key
:
'
editFields
'
,
align
:
'center'
,
align
:
'center'
,
width
:
20
0
,
width
:
15
0
,
},
},
{
{
title
:
'
同步
'
,
title
:
'
前端字段
'
,
dataIndex
:
'
syncEvent
'
,
dataIndex
:
'
webFields
'
,
key
:
'
syncEvent
'
,
key
:
'
webFields
'
,
align
:
'center'
,
align
:
'center'
,
width
:
200
,
width
:
150
,
},
{
title
:
'手持字段'
,
dataIndex
:
'mobileFields'
,
key
:
'mobileFields'
,
align
:
'center'
,
width
:
150
,
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
width
:
2
5
0
,
width
:
2
0
0
,
ellipsis
:
true
,
ellipsis
:
true
,
align
:
'center'
,
align
:
'center'
,
render
:
(
text
,
record
)
=>
(
render
:
(
text
,
record
)
=>
(
...
@@ -134,15 +171,12 @@ const AddModal = props => {
...
@@ -134,15 +171,12 @@ const AddModal = props => {
];
];
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
props
.
match
.
params
.
id
)
{
setFormObj
(
props
.
match
.
params
.
id
)
setTreeLoading
(
true
);
setTreeLoading
(
true
);
reloadTableFields
({
GetCM_Ledger_LoadLedgers
().
then
(
res
=>
{
tableName
:
props
.
match
.
params
.
id
,
console
.
log
(
'res'
,
res
);
}).
then
(
res
=>
{
setTreeLoading
(
false
);
setTreeLoading
(
false
);
if
(
res
.
msg
===
'Ok'
)
{
if
(
res
.
msg
===
'Ok'
)
{
let
arr
=
formateArrDataA
(
res
.
data
.
root
,
'
group
'
)
let
arr
=
formateArrDataA
(
res
.
data
.
root
,
'
type
'
)
let
newArr
=
[]
let
newArr
=
[]
Object
.
keys
(
arr
).
map
((
item
,
index
)
=>
{
Object
.
keys
(
arr
).
map
((
item
,
index
)
=>
{
newArr
.
push
({
type
:
item
,
key
:
index
})
newArr
.
push
({
type
:
item
,
key
:
index
})
...
@@ -151,7 +185,7 @@ const AddModal = props => {
...
@@ -151,7 +185,7 @@ const AddModal = props => {
setTableData
(
newArr
);
setTableData
(
newArr
);
}
}
});
});
}
},
[
flag
]);
},
[
flag
]);
const
formateArrDataA
=
(
initialArr
,
name
)
=>
{
const
formateArrDataA
=
(
initialArr
,
name
)
=>
{
// 判定传参是否符合规则
// 判定传参是否符合规则
...
@@ -211,29 +245,52 @@ const AddModal = props => {
...
@@ -211,29 +245,52 @@ const AddModal = props => {
};
};
return
(
return
(
<
div
style=
{
{
width
:
'100vm'
,
height
:
'calc(100vh - 100px) '
,
background
:
'#ffffff'
}
}
>
<
PageContainer
className=
{
styles
.
userManageContainer
}
>
<
Spin
tip=
"loading..."
spinning=
{
treeLoading
}
>
<
div
className=
{
styles
.
contentContainer
}
></
div
>
<
Table
<
Card
columns=
{
columns
}
className=
{
classnames
({
dataSource=
{
tableData
}
[
styles
.
orgContainer
]:
true
,
expandable=
{
{
expandedRowRender
}
}
[
styles
.
orgContainerHide
]:
!
treeVisible
,
showHeader=
{
false
}
})
}
// pagination={{ pageSize: 10 }}
>
scroll=
{
{
y
:
'45rem'
}
}
<
div
>
size=
"small"
<
span
rowKey=
{
(
record
,
index
)
=>
`complete${record.tableID}${index}`
}
style=
{
{
pagination=
{
{
fontSize
:
'15px '
,
showTotal
:
(
total
,
range
)
=>
fontWeight
:
'bold'
,
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
}
}
pageSizeOptions
:
[
10
,
20
,
50
,
100
],
>
defaultPageSize
:
20
,
机构列表
showQuickJumper
:
true
,
</
span
>
showSizeChanger
:
true
,
<
Tooltip
title=
"添加顶级机构"
>
}
}
<
PlusSquareFilled
/>
</
Spin
>
style=
{
{
color
:
'#1890FF'
,
fontSize
:
'25px'
,
verticalAlign
:
'middle'
,
float
:
'right'
}
}
/>
</
Tooltip
>
<
hr
style=
{
{
width
:
'100%'
,
color
:
'#eeecec'
}
}
/>
</
div
>
<
div
className=
{
styles
.
switcher
}
>
{
treeVisible
&&
(
<
Tooltip
title=
"隐藏机构列表"
>
<
DoubleLeftOutlined
onClick=
{
()
=>
setTreeVisible
(
false
)
}
/>
</
Tooltip
>
)
}
{
!
treeVisible
&&
(
<
Tooltip
title=
"显示机构列表"
>
<
DoubleRightOutlined
onClick=
{
()
=>
setTreeVisible
(
true
)
}
/>
</
Tooltip
>
)
}
</
div
>
</
div
>
</
Card
>
</
PageContainer
>
);
);
};
};
export
default
AddModal
;
export
default
AddModal
;
src/pages/platformCenter/standingBook/standingBook.less
0 → 100644
View file @
7c81744f
.orgContainerHide{
// transform: translateX(-230px);
left: 0px;
top: 0;
width: 26px;
}
\ No newline at end of file
src/services/standingBook/api.js
0 → 100644
View file @
7c81744f
import
{
CITY_SERVICE
,
get
,
PUBLISH_SERVICE
,
post
,
postForm
}
from
'../index'
;
// 加载台账
export
const
GetCM_Ledger_LoadLedgers
=
query
=>
get
(
`
${
PUBLISH_SERVICE
}
/WorkOrderCenter/GetCM_Ledger_LoadLedgers`
,
query
);
\ 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