Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Export Button Logic Differentiation #4618

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/components/Table/ListTable/TableAction/RightSide.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,20 @@ export default {
})
},
iExportOptions() {
if (this.$route.name === 'AssetAccountList') {
// 在账号列表中,第一次点击 export 时的 url 是 /accounts/account-secrets/ 都导致无法出现对话框
return assignIfNot(this.exportOptions, { url: this.tableUrl })
}

/**
* 原本是使用 assignIfNot 此函数内部使用 partialRight, 该函数
* 只在目标对象的属性未定义时才从源对象复制属性,如果目标对象已经有值,则保留原值
* 那如果首次点击的树节点,那么此时 url 就会被确定,后续点击的树节点,那么 url 就不会
* 改变了
*
* 主要是在资产列表中,切换节点的时候
*/
return Object.assign({}, this.exportOptions, { url: this.tableUrl })
return Object.assign(this.exportOptions, { url: this.tableUrl })
}
},
methods: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code seems to define a Vue component that exports an asset account list page. The method exportOptions has been updated from using the partialRight function incorrectly with assignIfNot and reusing it with Object.assign instead.

The main issue is related to URL assignment when navigating assets lists between nodes or after exporting. Currently, if there's no explicit change on navigation or export options, subsequent calls to /accounts/account-secrets/ will not lead to different URLs. This needs modification according to the current scenario:

  • After successfully switching back to the tree view mode (account details), you may want to adjust how exported URLs are determined based on the user interaction. For instance:
    exportDefaultMethods() {
      this.importTreeNode(false);

In general, these issues should be addressed to ensure consistent behavior across both views while also improving error handling for invalid or unexpected behaviors.

Expand Down