diff --git a/src/components/AssetSelect/dialog.vue b/src/components/AssetSelect/dialog.vue index 8d1523c2e..fe57222df 100644 --- a/src/components/AssetSelect/dialog.vue +++ b/src/components/AssetSelect/dialog.vue @@ -12,6 +12,7 @@ > {} + }, value: { type: Array, default: () => [] diff --git a/src/components/AssetTreeTable/index.vue b/src/components/AssetTreeTable/index.vue index eebdee81c..508a6066a 100644 --- a/src/components/AssetTreeTable/index.vue +++ b/src/components/AssetTreeTable/index.vue @@ -39,6 +39,10 @@ export default { type: String, default: '/api/v1/assets/nodes/children/tree/' }, + treeUrlQuery: { + type: Object, + default: () => ({}) + }, treeSetting: { type: Object, default: () => ({}) @@ -54,6 +58,9 @@ export default { }, data() { const showAssets = this.treeSetting?.showAssets || this.showAssets + const treeUrlQuery = this.setTreeUrlQuery() + const assetTreeUrl = `${this.treeUrl}?assets=${showAssets ? '1' : '0'}&${treeUrlQuery}` + return { treeTabConfig: { activeMenu: 'CustomTree', @@ -72,7 +79,7 @@ export default { showSearch: true, url: this.url, nodeUrl: this.nodeUrl, - treeUrl: `${this.treeUrl}?assets=${showAssets ? '1' : '0'}`, + treeUrl: assetTreeUrl, callback: { onSelected: (event, treeNode) => this.getAssetsUrl(treeNode) }, @@ -117,6 +124,15 @@ export default { treeSetting.showDelete = this.$hasPerm('assets.delete_node') }, methods: { + setTreeUrlQuery() { + let str = '' + for (const key in this.treeUrlQuery) { + str += `${key}=${this.treeUrlQuery[key]}&` + } + str = str.substr(0, str.length - 1) + + return str + }, decorateRMenu() { const show_current_asset = this.$cookie.get('show_current_asset') || '0' if (show_current_asset === '1') { diff --git a/src/views/assets/Domain/DomainCreateUpdate.vue b/src/views/assets/Domain/DomainCreateUpdate.vue index 8e298aae5..73ae66649 100644 --- a/src/views/assets/Domain/DomainCreateUpdate.vue +++ b/src/views/assets/Domain/DomainCreateUpdate.vue @@ -24,7 +24,10 @@ export default { label: this.$t('assets.Assets'), el: { value: [], - baseUrl: '/api/v1/assets/assets/?domain_enabled=true' + baseUrl: '/api/v1/assets/assets/?domain_enabled=true', + treeUrlQuery: { + domain_enabled: true + } } } },