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
7bbee9a2
Commit
7bbee9a2
authored
Dec 12, 2022
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改表管理类型为动态
parent
0044845e
Pipeline
#65327
passed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
39 deletions
+35
-39
TableView.jsx
...ages/bsmanager/base/tablemanager/components/TableView.jsx
+11
-18
index.jsx
src/pages/bsmanager/base/tablemanager/index.jsx
+24
-21
No files found.
src/pages/bsmanager/base/tablemanager/components/TableView.jsx
View file @
7bbee9a2
...
...
@@ -282,7 +282,7 @@ const EditableCell = ({
return
<
td
{
...
restProps
}
>
{
childNode
}
</
td
>;
};
const
TableView
=
props
=>
{
const
{
callBackSubmit
,
onCancel
,
visible
,
type
,
formObj
,
tableType
}
=
props
;
const
{
callBackSubmit
,
onCancel
,
visible
,
type
,
formObj
,
tableType
,
defaultFieldsList
}
=
props
;
const
[
dataSource
,
setDataSource
]
=
useState
([]);
const
[
count
,
setCount
]
=
useState
(
0
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
...
...
@@ -339,22 +339,16 @@ const TableView = props => {
notification
.
error
({
message
:
'提示'
,
duration
:
3
,
description
:
'网络异常'
});
});
}
else
{
let
list
=
[];
GetDefaultTableFields
().
then
(
res
=>
{
console
.
log
(
res
.
data
);
res
.
data
.
forEach
(
item
=>
{
if
(
item
.
value
===
tableType
)
{
list
=
item
.
list
.
map
((
val
,
index
)
=>
({
...
val
,
keyIndex
:
index
}));
}
});
console
.
log
(
list
);
setDefaultData
(
list
);
setCount
(
list
.
length
);
setShowDefault
(
false
);
let
listitem
=
JSON
.
parse
(
JSON
.
stringify
(
list
));
listitem
=
listitem
.
filter
(
item
=>
!
item
.
ReadOnly
);
setDataSource
(
listitem
);
});
let
list
=
defaultFieldsList
.
find
(
item
=>
item
.
value
===
tableType
)
.
list
.
map
((
item
,
i
)
=>
({
...
item
,
keyIndex
:
i
}));
console
.
log
(
list
);
setDefaultData
(
list
);
setCount
(
list
.
length
);
setShowDefault
(
false
);
let
listitem
=
JSON
.
parse
(
JSON
.
stringify
(
list
));
listitem
=
listitem
.
filter
(
item
=>
!
item
.
ReadOnly
);
setDataSource
(
listitem
);
}
}
else
{
setShowDefault
(
false
);
...
...
@@ -543,7 +537,6 @@ const TableView = props => {
align
:
'center'
,
render
:
(
text
,
record
)
=>
(
<>
{
console
.
log
(
record
)
}
<
span
>
{
text
}
</
span
>
{
record
.
IsIndex
&&
(
<
img
src=
{
index
}
style=
{
{
height
:
'25px'
,
marginLeft
:
'5px'
}
}
alt=
""
/>
...
...
src/pages/bsmanager/base/tablemanager/index.jsx
View file @
7bbee9a2
...
...
@@ -18,6 +18,7 @@ import {
Dropdown
,
Menu
,
Modal
,
message
,
}
from
'antd'
;
import
{
EditOutlined
,
...
...
@@ -43,6 +44,7 @@ import {
loadUnattachedTables
,
checkTableType
,
regroupTableType
,
GetDefaultTableFields
,
}
from
'@/services/tablemanager/tablemanager'
;
import
{
useHistory
}
from
'react-router-dom'
;
import
{
Ellipse
}
from
'bizcharts/lib/g-components'
;
...
...
@@ -53,7 +55,7 @@ import AddTablelList from './components/TableView';
import
AffiliateAdd
from
'./components/Field/affiliateAdd'
;
import
LoadGroup
from
'./components/Field/loadGroup'
;
import
LoadGroupNew
from
'./components/Field/loadGroupNew'
;
import
{
defaultFields
}
from
'./components/defaultFields'
;
//
import { defaultFields } from './components/defaultFields';
import
styles
from
'./index.less'
;
const
{
Search
}
=
Input
;
const
{
Option
}
=
Select
;
...
...
@@ -82,19 +84,27 @@ const TableManager = props => {
const
[
treeVisible
,
setTreeVisible
]
=
useState
(
true
);
// 是否显示左侧树
const
[
hoverItemIndex
,
setHoverItemIndex
]
=
useState
(
0
);
// hover流程索引
const
[
pickIndex
,
setPickIndex
]
=
useState
(
0
);
const
[
defaultFields1
,
setDefaultFields1
]
=
useState
([
'事件表'
,
'事件工单表'
,
'工单表'
,
'台账表'
,
'设备表'
,
'反馈表'
,
]);
const
[
tableType
,
setTableType
]
=
useState
(
defaultFields1
[
0
]);
const
[
defaultFields
,
setDefaultFields
]
=
useState
([]);
const
[
defaultFieldsList
,
setDefaultFieldsList
]
=
useState
([]);
const
[
tableType
,
setTableType
]
=
useState
(
defaultFields
[
0
]);
const
[
groupPopVisible
,
setgGroupPopVisible
]
=
useState
(
false
);
const
[
checkMsg
,
setCheckMsg
]
=
useState
();
const
initNum
=
useRef
(
0
);
useEffect
(()
=>
{
GetDefaultTableFields
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
let
list
=
[];
setDefaultFieldsList
(
res
.
data
);
res
.
data
.
forEach
(
item
=>
{
list
.
push
(
item
.
value
);
});
setDefaultFields
(
list
);
}
else
{
message
.
error
(
res
.
msg
);
}
});
},
[]);
useEffect
(
record
=>
{
if
(
props
.
history
.
location
.
query
&&
initNum
.
current
==
0
)
{
...
...
@@ -256,15 +266,7 @@ const TableManager = props => {
let
bb
=
[];
console
.
log
(
groupData
,
'groupData'
);
// 对分组进行排序
const
sortNameArr
=
[
'事件表'
,
'事件工单表'
,
'工单表'
,
'台账表'
,
'设备表'
,
'反馈表'
,
'其他表'
,
];
const
sortNameArr
=
res
.
data
.
groupNames
;
const
sortList
=
[];
sortNameArr
.
forEach
(
ele
=>
{
Object
.
keys
(
groupData
).
map
((
item
,
index
)
=>
{
...
...
@@ -526,7 +528,7 @@ const TableManager = props => {
});
};
const
menu
=
(
<
Menu
onClick=
{
onMenuClick
}
items=
{
defaultFields
1
.
map
(
item
=>
({
key
:
item
,
label
:
item
}))
}
/>
<
Menu
onClick=
{
onMenuClick
}
items=
{
defaultFields
.
map
(
item
=>
({
key
:
item
,
label
:
item
}))
}
/>
);
return
(
<
Spin
tip=
"loading..."
spinning=
{
treeLoading
}
>
...
...
@@ -702,6 +704,7 @@ const TableManager = props => {
onCancel=
{
()
=>
setVisible
(
false
)
}
formObj=
{
formObj
}
callBackSubmit=
{
onSubmit
}
defaultFieldsList=
{
defaultFieldsList
}
tableType=
{
tableType
}
/>
{
visible
&&
type
===
'affiliateAdd'
&&
(
...
...
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