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
87fe3060
Commit
87fe3060
authored
Jun 26, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务增加固定列
parent
aa547828
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
24 deletions
+62
-24
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+62
-24
No files found.
src/view/Manage/Model/Component/ModelTable.jsx
View file @
87fe3060
...
@@ -16,6 +16,7 @@ import { dispatch } from '../../../../model';
...
@@ -16,6 +16,7 @@ import { dispatch } from '../../../../model';
import
{
showMessage
,
getQueryParam
,
paginate
,
isSzseEnv
,
formatDate
,
getDataModelerRole
}
from
'../../../../util'
;
import
{
showMessage
,
getQueryParam
,
paginate
,
isSzseEnv
,
formatDate
,
getDataModelerRole
}
from
'../../../../util'
;
import
{
AnchorId
,
AnchorTimestamp
,
Action
,
CatalogId
,
ModelerId
,
DataModelerRoleReader
}
from
'../../../../util/constant'
;
import
{
AnchorId
,
AnchorTimestamp
,
Action
,
CatalogId
,
ModelerId
,
DataModelerRoleReader
}
from
'../../../../util/constant'
;
import
{
AppContext
}
from
"../../../../App"
;
import
{
AppContext
}
from
"../../../../App"
;
import
SelectUser
from
"./SelectUsers"
;
// import Tag from "../../Tag";
// import Tag from "../../Tag";
import
'./ModelTable.less'
;
import
'./ModelTable.less'
;
...
@@ -180,22 +181,61 @@ const ModelTable = (props) => {
...
@@ -180,22 +181,61 @@ const ModelTable = (props) => {
filter
:
false
,
filter
:
false
,
}
}
const
editorCol
=
{
const
fixedCols
=
[
title
:
'管理人'
,
{
dataIndex
:
'editor'
,
title
:
'路径'
,
width
:
100
,
dataIndex
:
'path'
,
ellipsis
:
true
,
width
:
120
,
filter
:
false
,
ellipsis
:
true
,
render
:
(
editor
,
record
)
=>
{
filter
:
false
,
const
user
=
users
?.
filter
((
user
)
=>
user
.
pernr
===
editor
);
render
:
(
text
,
_
,
__
)
=>
{
if
(
user
&&
user
.
length
>
0
)
{
return
(
return
<
Tooltip
title=
{
user
[
0
].
nachn
?
`${user[0].nachn}(${user[0].pernr})`
:
user
[
0
].
pernr
}
>
<
Tooltip
title=
{
text
||
''
}
>
<
Text
ellipsis=
{
true
}
>
{
user
[
0
].
nachn
?
`${user[0].nachn}(${user[0].pernr})`
:
user
[
0
].
pernr
}
</
Text
>
<
Text
ellipsis=
{
true
}
>
{
text
||
''
}
</
Text
>
</
Tooltip
>
</
Tooltip
>
)
}
}
return
''
;
},
}
{
}
title
:
'状态'
,
dataIndex
:
'state'
,
width
:
100
,
ellipsis
:
true
,
filter
:
false
,
render
:
(
_
,
record
)
=>
{
let
color
=
''
;
if
(
record
?.
state
?.
id
===
'1'
)
{
color
=
'#DE7777'
;
}
else
if
(
record
?.
state
?.
id
===
'2'
)
{
color
=
'#779BDE'
;
}
else
if
(
record
?.
state
?.
id
===
'4'
)
{
color
=
'#77DEBF'
;
}
return
(
<
span
>
<
span
style=
{
{
display
:
'inline-block'
,
width
:
10
,
height
:
10
,
borderRadius
:
5
,
marginRight
:
5
,
backgroundColor
:
color
}
}
></
span
>
<
span
>
{
record
?.
state
?.
cnName
||
''
}
</
span
>
</
span
>
);
}
},
{
title
:
'管理人'
,
dataIndex
:
'editor'
,
width
:
100
,
ellipsis
:
true
,
filter
:
false
,
render
:
(
editor
,
record
)
=>
{
return
<
SelectUser
type=
'detail'
users=
{
users
}
value=
{
editor
}
/>;
}
},
]
const
actionCol
=
{
const
actionCol
=
{
title
:
'操作'
,
title
:
'操作'
,
...
@@ -521,13 +561,11 @@ const ModelTable = (props) => {
...
@@ -521,13 +561,11 @@ const ModelTable = (props) => {
if (item.userSelected === true) {
if (item.userSelected === true) {
col.render = (_, record) => {
col.render = (_, record) => {
const user = users?.filter((user)=>(user.pernr===record.basicInfo?.[item.key]));
return <SelectUser
if (user && user.length > 0) {
type='detail'
return <Tooltip title={user[0].nachn?`
$
{
user
[
0
].
nachn
}(
$
{
user
[
0
].
pernr
})
`:user[0].pernr}>
users={users}
<Text ellipsis={true}>{user[0].nachn?`
$
{
user
[
0
].
nachn
}(
$
{
user
[
0
].
pernr
})
`:user[0].pernr}</Text>
value={record.basicInfo?.[item.key]}
</Tooltip>
/>;
}
return '';
};
};
}
}
...
@@ -536,9 +574,9 @@ const ModelTable = (props) => {
...
@@ -536,9 +574,9 @@ const ModelTable = (props) => {
});
});
if (!modelId) {
if (!modelId) {
newCols = [indexCol, ...newCols,
editorCol
, actionCol];
newCols = [indexCol, ...newCols,
...fixedCols
, actionCol];
} else {
} else {
newCols = [...newCols,
editorCol
, actionCol];
newCols = [...newCols,
...fixedCols
, actionCol];
}
}
if ((visibleColNames||[]).length > 0) {
if ((visibleColNames||[]).length > 0) {
...
...
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