Browse Source

[fix-13504] Display the current project name on the left corner of the page (#13572)

Co-authored-by: xiecao <haolong.zhl@alibaba-inc.com>
3.2.0-release
QuantumXiecao 2 years ago committed by GitHub
parent
commit
dd4804ee4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      dolphinscheduler-ui/src/layouts/content/components/sidebar/use-menuClick.ts
  2. 1
      dolphinscheduler-ui/src/layouts/content/index.tsx
  3. 21
      dolphinscheduler-ui/src/layouts/content/use-dataList.ts
  4. 5
      dolphinscheduler-ui/src/views/projects/list/use-table.ts

10
dolphinscheduler-ui/src/layouts/content/components/sidebar/use-menuClick.ts

@ -15,16 +15,18 @@
* limitations under the License. * limitations under the License.
*/ */
import { useRouter } from 'vue-router' import {LocationQueryRaw, useRouter} from 'vue-router'
import type { Router } from 'vue-router' import type { Router } from 'vue-router'
import { MenuOption } from 'naive-ui' import { MenuOption } from 'naive-ui'
export function useMenuClick() { export function useMenuClick() {
const router: Router = useRouter() const router: Router = useRouter()
const handleMenuClick = (key: string, unused: MenuOption) => { const handleMenuClick = (key: string, menuOption: MenuOption) => {
// console.log(key, item) router.push({
router.push({ path: `${key}` }) path: `${key}`,
query: menuOption.payload? menuOption.payload as LocationQueryRaw: {}
})
} }
return { return {

1
dolphinscheduler-ui/src/layouts/content/index.tsx

@ -77,7 +77,6 @@ const Content = defineComponent({
} }
getSideMenu(state) getSideMenu(state)
const currentSide = ( const currentSide = (
route.meta.activeSide route.meta.activeSide
? route.meta.activeSide ? route.meta.activeSide

21
dolphinscheduler-ui/src/layouts/content/use-dataList.ts

@ -89,6 +89,7 @@ export function useDataList() {
const changeMenuOption = (state: any) => { const changeMenuOption = (state: any) => {
const projectCode = route.params.projectCode || '' const projectCode = route.params.projectCode || ''
const projectName = route.query.projectName || ''
state.menuOptions = [ state.menuOptions = [
{ {
label: () => h(NEllipsis, null, { default: () => t('menu.home') }), label: () => h(NEllipsis, null, { default: () => t('menu.home') }),
@ -101,9 +102,10 @@ export function useDataList() {
icon: renderIcon(ProfileOutlined), icon: renderIcon(ProfileOutlined),
children: [ children: [
{ {
label: t('menu.project_overview'), label: t('menu.project_overview') + (projectName? `[${projectName}]` : ''),
key: `/projects/${projectCode}`, key: `/projects/${projectCode}`,
icon: renderIcon(FundProjectionScreenOutlined) icon: renderIcon(FundProjectionScreenOutlined),
payload: {projectName:projectName}
}, },
{ {
label: t('menu.workflow'), label: t('menu.workflow'),
@ -112,15 +114,18 @@ export function useDataList() {
children: [ children: [
{ {
label: t('menu.workflow_relation'), label: t('menu.workflow_relation'),
key: `/projects/${projectCode}/workflow/relation` key: `/projects/${projectCode}/workflow/relation`,
payload: {projectName:projectName}
}, },
{ {
label: t('menu.workflow_definition'), label: t('menu.workflow_definition'),
key: `/projects/${projectCode}/workflow-definition` key: `/projects/${projectCode}/workflow-definition`,
payload: {projectName:projectName}
}, },
{ {
label: t('menu.workflow_instance'), label: t('menu.workflow_instance'),
key: `/projects/${projectCode}/workflow/instances` key: `/projects/${projectCode}/workflow/instances`,
payload: {projectName:projectName}
} }
] ]
}, },
@ -131,11 +136,13 @@ export function useDataList() {
children: [ children: [
{ {
label: t('menu.task_definition'), label: t('menu.task_definition'),
key: `/projects/${projectCode}/task/definitions` key: `/projects/${projectCode}/task/definitions`,
payload: {projectName:projectName}
}, },
{ {
label: t('menu.task_instance'), label: t('menu.task_instance'),
key: `/projects/${projectCode}/task/instances` key: `/projects/${projectCode}/task/instances`,
payload: {projectName:projectName}
} }
] ]
} }

5
dolphinscheduler-ui/src/views/projects/list/use-table.ts

@ -82,7 +82,10 @@ export function useTable() {
ButtonLink, ButtonLink,
{ {
onClick: () => { onClick: () => {
router.push({ path: `/projects/${row.code}` }) router.push({
path: `/projects/${row.code}`,
query: {projectName: row.name}
})
} }
}, },
{ {

Loading…
Cancel
Save