mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 14:25:23 +00:00
feat: 修改资产选择组件支持我的资产选择
This commit is contained in:
@@ -39,6 +39,14 @@ export default {
|
|||||||
componentName: 'AssetSelect',
|
componentName: 'AssetSelect',
|
||||||
components: { TreeTable, Select2, Dialog },
|
components: { TreeTable, Select2, Dialog },
|
||||||
props: {
|
props: {
|
||||||
|
baseUrl: {
|
||||||
|
type: String,
|
||||||
|
default: '/api/v1/assets/assets/'
|
||||||
|
},
|
||||||
|
baseNodeUrl: {
|
||||||
|
type: String,
|
||||||
|
default: '/api/v1/assets/nodes/'
|
||||||
|
},
|
||||||
value: {
|
value: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => []
|
||||||
@@ -68,7 +76,7 @@ export default {
|
|||||||
multiple: true,
|
multiple: true,
|
||||||
clearable: true,
|
clearable: true,
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/assets/assets/',
|
url: this.baseUrl,
|
||||||
transformOption: (item) => {
|
transformOption: (item) => {
|
||||||
return { label: item.name + '(' + item.address + ')', value: item.id }
|
return { label: item.name + '(' + item.address + ')', value: item.id }
|
||||||
}
|
}
|
||||||
@@ -84,15 +92,15 @@ export default {
|
|||||||
showMenu: false,
|
showMenu: false,
|
||||||
showRefresh: true,
|
showRefresh: true,
|
||||||
showAssets: false,
|
showAssets: false,
|
||||||
url: '/api/v1/assets/assets/',
|
url: this.baseUrl,
|
||||||
nodeUrl: '/api/v1/assets/nodes/',
|
nodeUrl: this.baseNodeUrl,
|
||||||
// ?assets=0不显示资产. =1显示资产
|
// ?assets=0不显示资产. =1显示资产
|
||||||
treeUrl: '/api/v1/assets/nodes/children/tree/?assets=0'
|
treeUrl: `${this.baseNodeUrl}/children/tree/?assets=0`
|
||||||
},
|
},
|
||||||
select2Config: select2Config,
|
select2Config: select2Config,
|
||||||
dialogSelect2Config: select2Config,
|
dialogSelect2Config: select2Config,
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: '/api/v1/assets/assets/',
|
url: this.baseUrl,
|
||||||
hasTree: true,
|
hasTree: true,
|
||||||
hasSelection: false,
|
hasSelection: false,
|
||||||
canSelect: this.canSelect,
|
canSelect: this.canSelect,
|
||||||
|
@@ -86,6 +86,8 @@ export default {
|
|||||||
required: false
|
required: false
|
||||||
}],
|
}],
|
||||||
el: {
|
el: {
|
||||||
|
baseUrl: '/api/v1/perms/users/self/assets/',
|
||||||
|
baseNodeUrl: '/api/v1/perms/users/self/nodes/',
|
||||||
value: []
|
value: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user