This is an automated email from the ASF dual-hosted git repository.
zihaoxiang pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new faaef5fc5b [Fix-15644][ui] fix ui Failed to query list after editing
file (#15647)
faaef5fc5b is described below
commit faaef5fc5b4846b141fbf9ff76d2a2f50f6575cc
Author: 八角龙 <[email protected]>
AuthorDate: Tue Jul 16 17:51:18 2024 +0800
[Fix-15644][ui] fix ui Failed to query list after editing file (#15647)
* [bug][ui] fix ui Failed to query list after editing file
---
.../src/views/resource/components/resource/edit/index.tsx | 14 ++++++++++++--
.../views/resource/components/resource/edit/use-edit.ts | 5 +----
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git
a/dolphinscheduler-ui/src/views/resource/components/resource/edit/index.tsx
b/dolphinscheduler-ui/src/views/resource/components/resource/edit/index.tsx
index 29000302eb..fed715e59b 100644
--- a/dolphinscheduler-ui/src/views/resource/components/resource/edit/index.tsx
+++ b/dolphinscheduler-ui/src/views/resource/components/resource/edit/index.tsx
@@ -24,12 +24,14 @@ import { useEdit, useIsDetailPageStore } from './use-edit'
import Card from '@/components/card'
import MonacoEditor from '@/components/monaco-editor'
import styles from '../index.module.scss'
+import { useDetailPageStore } from
"@/views/resource/components/resource/table/use-table";
export default defineComponent({
name: 'ResourceEdit',
setup() {
const route = useRoute()
const router = useRouter()
+ const detailPageStore = useDetailPageStore()
const isDetailPageStore = useIsDetailPageStore()
isDetailPageStore.$reset()
@@ -43,16 +45,24 @@ export default defineComponent({
const { getResourceView, handleUpdateContent } = useEdit(state)
const handleFileContent = () => {
- isDetailPageStore.setIsDetailPage(true)
state.fileForm.content = resourceViewRef.state.value.content
handleUpdateContent(fullName, tenantCode)
+ updateDetailPage()
}
const handleReturn = () => {
- isDetailPageStore.setIsDetailPage(true)
+ updateDetailPage()
router.go(-1)
}
+ const updateDetailPage = () => {
+ isDetailPageStore.setIsDetailPage(true)
+ const pathSplit = fullName.split('/')
+ pathSplit.pop()
+ detailPageStore.fullName = pathSplit.join('/')
+ detailPageStore.tenantCode = tenantCode
+ }
+
const resourceViewRef = getResourceView(fullName, tenantCode)
watch(
() => resourceViewRef.state.value.content,
diff --git
a/dolphinscheduler-ui/src/views/resource/components/resource/edit/use-edit.ts
b/dolphinscheduler-ui/src/views/resource/components/resource/edit/use-edit.ts
index 2ec97926b3..ffaa6b8f74 100644
---
a/dolphinscheduler-ui/src/views/resource/components/resource/edit/use-edit.ts
+++
b/dolphinscheduler-ui/src/views/resource/components/resource/edit/use-edit.ts
@@ -19,10 +19,7 @@ import { useI18n } from 'vue-i18n'
import type { Router } from 'vue-router'
import { useRouter } from 'vue-router'
import { useAsyncState } from '@vueuse/core'
-import {
- updateResourceContent,
- viewResource
-} from '@/service/modules/resources'
+import { updateResourceContent, viewResource } from
'@/service/modules/resources'
import { defineStore } from 'pinia'
export function useEdit(state: any) {