mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-01 23:18:17 +00:00
[Update] 修改资产授权规则详情资产页面Relation
This commit is contained in:
parent
2111380838
commit
de6c0e8cfc
@ -64,18 +64,18 @@ export default {
|
||||
assetRelationConfig: {
|
||||
icon: 'fa-edit',
|
||||
title: this.$t('perms.addAssetToThisPermission'),
|
||||
performAdd: (items) => {
|
||||
performAdd: (items, that) => {
|
||||
const relationUrl = `/api/v1/perms/asset-permissions-assets-relations/`
|
||||
const objectId = this.object.id
|
||||
const data = items.map(v => {
|
||||
const data = items.map(item => {
|
||||
return {
|
||||
assetpermission: objectId,
|
||||
asset: v
|
||||
asset: item
|
||||
}
|
||||
})
|
||||
return this.$axios.post(relationUrl, data)
|
||||
},
|
||||
onAddSuccess: (that) => {
|
||||
onAddSuccess: (items, that) => {
|
||||
this.$log.debug('AssetSelect value', that.assets)
|
||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||
this.$refs.ListTable.reloadTable()
|
||||
@ -154,7 +154,6 @@ export default {
|
||||
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||
that.$refs.select2.clearSelected()
|
||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||
this.$refs.ListTable.reloadTable()
|
||||
},
|
||||
performDelete: (item) => {
|
||||
const itemId = item.value
|
||||
@ -173,7 +172,6 @@ export default {
|
||||
that.select2.disabledValues.splice(i, 1)
|
||||
}
|
||||
this.$message.success(this.$t('common.deleteSuccessMsg'))
|
||||
this.$refs.ListTable.reloadTable()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<AssetSelect ref="assetSelect" @getAsset="getAsset" />
|
||||
<AssetSelect ref="assetSelect" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -47,25 +47,19 @@ export default {
|
||||
},
|
||||
onAddSuccess: {
|
||||
type: Function,
|
||||
default(that) {
|
||||
this.$log.debug('AssetSelect value', that.assets)
|
||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||
}
|
||||
default: (objects, that) => {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
assets: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addObjects() {
|
||||
this.performAdd(this.assets, this).then(
|
||||
() => this.onAddSuccess(this)
|
||||
const objects = this.$refs.assetSelect.$refs.select2.iValue
|
||||
this.performAdd(objects, this).then(
|
||||
() => this.onAddSuccess(objects, this)
|
||||
)
|
||||
},
|
||||
getAsset(assets) {
|
||||
this.assets = assets
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user