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
96fd8cd2
Commit
96fd8cd2
authored
Jun 16, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
可见列设置
parent
7c2784f2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
33 deletions
+60
-33
pds.js
src/model/pds.js
+5
-0
pds.js
src/service/pds.js
+5
-0
ColSettingModal.jsx
src/view/Manage/Model/Component/ColSettingModal.jsx
+49
-32
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+0
-0
index.jsx
src/view/Manage/Model/index.jsx
+1
-1
No files found.
src/model/pds.js
View file @
96fd8cd2
...
...
@@ -127,4 +127,8 @@ export function* saveCols(payload) {
export
function
*
getCols
(
payload
)
{
return
yield
call
(
pds
.
getCols
,
payload
);
}
export
function
*
getAttrs
(
payload
)
{
return
yield
call
(
pds
.
getAttrs
,
payload
);
}
\ No newline at end of file
src/service/pds.js
View file @
96fd8cd2
...
...
@@ -126,4 +126,8 @@ export function saveCols(payload) {
export
function
getCols
(
payload
)
{
return
GetJSON
(
"/pdataservice/pdsModel/getVisibleTitle"
,
payload
);
}
export
function
getAttrs
(
payload
)
{
return
GetJSON
(
"/pdataservice/pdsModel/attrs"
,
payload
);
}
\ No newline at end of file
src/view/Manage/Model/Component/ColSettingModal.jsx
View file @
96fd8cd2
...
...
@@ -3,34 +3,45 @@ import { Modal, Button, Switch, Row, Col, Checkbox, Typography } from 'antd';
import
{
dispatch
}
from
'../../../../model'
;
const
cols
=
[
{
title
:
'服务名称'
},
{
title
:
'中文名称'
},
{
title
:
'路径'
},
{
title
:
'状态'
},
{
title
:
'管理人'
},
// {title: '是否启动OData'},
{
title
:
'版本号'
},
{
title
:
'服务描述'
},
];
const
ColSettingModal
=
(
props
)
=>
{
const
{
visible
,
onCancel
}
=
props
;
const
[
loadingAttrs
,
setLoadingAttrs
]
=
useState
(
false
);
const
[
attrs
,
setAttrs
]
=
useState
(
undefined
);
const
[
catagories
,
setCatagories
]
=
useState
(
undefined
);
const
[
checkedKeys
,
setCheckedKeys
]
=
useState
([]);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
useEffect
(()
=>
{
if
(
visible
)
{
getAttrs
();
getPreference
();
}
},
[
visible
]);
const
getAttrs
=
()
=>
{
setLoadingAttrs
(
true
);
dispatch
({
type
:
'pds.getAttrs'
,
payload
:
{
modelName
:
'DataService'
},
callback
:
data
=>
{
setAttrs
(
data
);
setCatagories
(
Array
.
from
(
new
Set
((
data
||
[]).
map
(
item
=>
item
.
status
))));
setLoadingAttrs
(
false
);
},
error
:
()
=>
{
setLoadingAttrs
(
false
);
}
})
}
const
getPreference
=
()
=>
{
dispatch
({
type
:
'pds.getCols'
,
payload
:
{
modelName
:
'DataService
Col
'
modelName
:
'DataService'
},
callback
:
data
=>
{
setCheckedKeys
(
data
?.
map
(
item
=>
item
.
titleCnName
));
...
...
@@ -42,14 +53,8 @@ const ColSettingModal = (props) => {
const
newCheckedKeys
=
[];
if
(
checked
)
{
cols
.
forEach
(
col
=>
{
newCheckedKeys
.
push
(
col
.
title
);
});
}
else
{
cols
.
forEach
(
col
=>
{
if
(
col
.
require
)
{
newCheckedKeys
.
push
(
col
.
title
);
}
attrs
?.
forEach
(
col
=>
{
newCheckedKeys
.
push
(
col
.
name
);
});
}
...
...
@@ -76,7 +81,7 @@ const ColSettingModal = (props) => {
dispatch
({
type
:
'pds.saveCols'
,
payload
:
{
params
:
{
modelName
:
'DataService
Col
'
},
params
:
{
modelName
:
'DataService'
},
data
:
checkedKeys
?.
map
(
item
=>
{
return
{
titleCnName
:
item
}
})
...
...
@@ -122,23 +127,35 @@ const ColSettingModal = (props) => {
/>
</
div
>
<
div
className=
'mt-3'
style=
{
{
maxHeight
:
450
,
overflow
:
'auto'
}
}
>
<
Row
>
{
c
ols
.
map
((
col
,
index
)
=>
{
c
atagories
?.
map
((
catagory
,
index
)
=>
{
return
(
<
Col
className=
'mb-3'
key=
{
index
}
md=
{
6
}
>
<
div
className=
'd-flex'
>
<
Checkbox
checked=
{
checkedKeys
.
indexOf
(
col
.
title
||
''
)
!==-
1
}
value=
{
col
.
title
}
onChange=
{
onCheckChange
}
disabled=
{
col
.
require
}
>
</
Checkbox
>
<
Typography
.
Paragraph
className=
'ml-1'
title=
{
col
.
title
}
ellipsis
>
{
col
.
title
}
</
Typography
.
Paragraph
>
<
div
key=
{
index
}
>
<
div
className=
'flex'
style=
{
{
alignItems
:
'center'
,
padding
:
'5px 0 15px'
}
}
>
<
div
style=
{
{
width
:
3
,
height
:
14
,
backgroundColor
:
'#0069AC'
,
marginRight
:
5
}
}
/>
<
span
style=
{
{
fontWeight
:
'bold'
,
color
:
'#464646'
}
}
>
{
catagory
}
</
span
>
</
div
>
</
Col
>
<
Row
>
{
attrs
?.
filter
(
col
=>
col
.
status
===
catagory
)?.
map
((
col
,
index
)
=>
{
return
(
<
Col
className=
'mb-3'
key=
{
index
}
md=
{
6
}
>
<
div
className=
'd-flex'
>
<
Checkbox
checked=
{
checkedKeys
.
indexOf
(
col
.
name
||
''
)
!==-
1
}
value=
{
col
.
name
}
onChange=
{
onCheckChange
}
>
</
Checkbox
>
<
Typography
.
Paragraph
className=
'ml-1'
title=
{
col
.
name
}
ellipsis
>
{
col
.
name
}
</
Typography
.
Paragraph
>
</
div
>
</
Col
>
)
})
}
</
Row
>
</
div
>
)
})
}
</
Row
>
</
div
>
</
Modal
>
)
...
...
src/view/Manage/Model/Component/ModelTable.jsx
View file @
96fd8cd2
This diff is collapsed.
Click to expand it.
src/view/Manage/Model/index.jsx
View file @
96fd8cd2
...
...
@@ -113,7 +113,7 @@ class Model extends React.Component {
dispatch
({
type
:
'pds.getCols'
,
payload
:
{
modelName
:
'DataService
Col
'
modelName
:
'DataService'
},
callback
:
data
=>
{
this
.
setState
({
visibleColNames
:
data
?.
map
(
item
=>
item
.
titleCnName
)});
...
...
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