Skip to content

Commit

Permalink
#821 enhance table comp
Browse files Browse the repository at this point in the history
  • Loading branch information
homiexie committed Apr 22, 2020
1 parent ffdeec7 commit 4cd8836
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion cmdb-ui/src/pages/components/cmdb-table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,13 @@ export default {
return (
<div>
{this.tableInnerActions.map(_ => {
if (_.visible ? _.visible.value === !!params.row[_.visible.key] : true) {
if (
_.visible
? _.visible.key === 'nextOperations'
? !!params.row[_.visible.key].find(op => op === _.actionType)
: _.visible.value === !!params.row[_.visible.key]
: true
) {
return (
<Button
{...{ props: { ..._.props } }}
Expand Down
2 changes: 1 addition & 1 deletion cmdb-ui/src/pages/util/state-operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const getExtraInnerActions = async () => {
})
if (statusCode === 'OK') {
return data.contents
.filter(_ => _.code !== 'insert' && _.code !== 'update' && _.code !== 'delete')
.filter(_ => _.code !== 'insert' && _.code !== 'update' && _.code !== 'delete') // update delete 表示可编辑和可删除,
.map(item => {
return {
label: item.value,
Expand Down

0 comments on commit 4cd8836

Please sign in to comment.