Browse Source

[Fix][UI Next][V1.0.0-Alpha] Menu error (#9036)

* modify the sidebar menu control mode

* modify side menu

* store last path

* fix security auth error

* fix resource e2e

* fix resource manage e2e bug
3.0.0/version-upgrade
Devosend 3 years ago committed by GitHub
parent
commit
d91711b322
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/ResourcePage.java
  2. 30
      dolphinscheduler-ui-next/src/layouts/content/components/navbar/index.tsx
  3. 4
      dolphinscheduler-ui-next/src/layouts/content/components/sidebar/index.tsx
  4. 37
      dolphinscheduler-ui-next/src/layouts/content/index.tsx
  5. 17
      dolphinscheduler-ui-next/src/layouts/content/use-dataList.ts
  6. 7
      dolphinscheduler-ui-next/src/router/index.ts
  7. 2
      dolphinscheduler-ui-next/src/router/modules/data-quality.ts
  8. 1
      dolphinscheduler-ui-next/src/router/modules/datasource.ts
  9. 5
      dolphinscheduler-ui-next/src/router/modules/monitor.ts
  10. 19
      dolphinscheduler-ui-next/src/router/modules/projects.ts
  11. 17
      dolphinscheduler-ui-next/src/router/modules/resources.ts
  12. 9
      dolphinscheduler-ui-next/src/router/modules/security.ts
  13. 1
      dolphinscheduler-ui-next/src/router/routes.ts
  14. 51
      dolphinscheduler-ui-next/src/store/menu/menu.ts
  15. 34
      dolphinscheduler-ui-next/src/store/route/route.ts
  16. 8
      dolphinscheduler-ui-next/src/store/route/types.ts
  17. 8
      dolphinscheduler-ui-next/src/views/login/use-login.ts
  18. 3
      dolphinscheduler-ui-next/src/views/projects/list/use-table.ts
  19. 2
      dolphinscheduler-ui-next/src/views/resource/file/index.tsx

7
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/ResourcePage.java

@ -47,20 +47,21 @@ public class ResourcePage extends NavBarPage implements NavBarPage.NavBarItem {
public <T extends ResourcePage.Tab> T goToTab(Class<T> tab) {
if (tab == FileManagePage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/file-manage"));
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(fileManageTab));
fileManageTab.click();
((JavascriptExecutor) driver).executeScript("arguments[0].click();", fileManageTab());
return tab.cast(new FileManagePage(driver));
}
if (tab == UdfManagePage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(udfManageTab));
udfManageTab.click();
((JavascriptExecutor) driver).executeScript("arguments[0].click();", udfManageTab());
return tab.cast(new UdfManagePage(driver));
}
if (tab == FunctionManagePage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(functionManageTab));
functionManageTab.click();
((JavascriptExecutor) driver).executeScript("arguments[0].click();", functionManageTab());
return tab.cast(new FunctionManagePage(driver));
}

30
dolphinscheduler-ui-next/src/layouts/content/components/navbar/index.tsx

@ -15,7 +15,8 @@
* limitations under the License.
*/
import { defineComponent, PropType } from 'vue'
import { defineComponent, PropType, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import styles from './index.module.scss'
import { NMenu } from 'naive-ui'
import Logo from '../logo'
@ -23,8 +24,6 @@ import Locales from '../locales'
import Timezone from '../timezone'
import User from '../user'
import Theme from '../theme'
import { useMenuClick } from './use-menuClick'
import { useMenuStore } from '@/store/menu/menu'
const Navbar = defineComponent({
name: 'Navbar',
@ -46,11 +45,24 @@ const Navbar = defineComponent({
default: []
}
},
emits: ['handleMenuClick'],
setup(props, ctx) {
const { handleMenuClick } = useMenuClick(ctx)
const menuStore = useMenuStore()
return { handleMenuClick, menuStore }
setup() {
const route = useRoute()
const router = useRouter()
const menuKey = ref(route.meta.activeMenu as string)
const handleMenuClick = (key: string) => {
router.push({ path: `/${key}` })
}
watch(
() => route.path,
() => {
menuKey.value = route.meta.activeMenu as string
}
)
return { handleMenuClick, menuKey }
},
render() {
return (
@ -58,7 +70,7 @@ const Navbar = defineComponent({
<Logo />
<div class={styles.nav}>
<NMenu
value={this.menuStore.getMenuKey}
value={this.menuKey}
mode='horizontal'
options={this.headerMenuOptions}
onUpdateValue={this.handleMenuClick}

4
dolphinscheduler-ui-next/src/layouts/content/components/sidebar/index.tsx

@ -18,7 +18,6 @@
import { defineComponent, ref, PropType } from 'vue'
import { NLayoutSider, NMenu } from 'naive-ui'
import { useMenuClick } from './use-menuClick'
import { useMenuStore } from '@/store/menu/menu'
const Sidebar = defineComponent({
name: 'Sidebar',
@ -33,7 +32,6 @@ const Sidebar = defineComponent({
}
},
setup() {
const menuStore = useMenuStore()
const collapsedRef = ref(false)
const defaultExpandedKeys = [
'workflow',
@ -46,7 +44,7 @@ const Sidebar = defineComponent({
const { handleMenuClick } = useMenuClick()
return { collapsedRef, defaultExpandedKeys, handleMenuClick, menuStore }
return { collapsedRef, defaultExpandedKeys, handleMenuClick }
},
render() {
return (

37
dolphinscheduler-ui-next/src/layouts/content/index.tsx

@ -20,8 +20,8 @@ import { NLayout, NLayoutContent, NLayoutHeader, useMessage } from 'naive-ui'
import NavBar from './components/navbar'
import SideBar from './components/sidebar'
import { useDataList } from './use-dataList'
import { useMenuStore } from '@/store/menu/menu'
import { useLocalesStore } from '@/store/locales/locales'
import { useRouteStore } from '@/store/route/route'
import { useI18n } from 'vue-i18n'
import { useRoute } from 'vue-router'
@ -31,9 +31,9 @@ const Content = defineComponent({
window.$message = useMessage()
const route = useRoute()
const menuStore = useMenuStore()
const { locale } = useI18n()
const localesStore = useLocalesStore()
const routeStore = useRouteStore()
const {
state,
changeMenuOption,
@ -51,16 +51,11 @@ const Content = defineComponent({
})
const getSideMenu = (state: any) => {
const key = menuStore.getMenuKey
const key = route.meta.activeMenu
state.sideMenuOptions =
state.menuOptions.filter((menu: { key: string }) => menu.key === key)[0]
?.children || state.menuOptions
state.isShowSide = menuStore.getShowSideStatus
}
const getSideMenuOptions = (item: any) => {
menuStore.setMenuKey(item.key)
getSideMenu(state)
state.isShowSide = route.meta.showSide
}
watch(useI18n().locale, () => {
@ -74,17 +69,26 @@ const Content = defineComponent({
() => route.path,
() => {
if (route.path !== '/login') {
state.isShowSide = menuStore.getShowSideStatus
routeStore.setLastRoute(route.path)
state.isShowSide = route.meta.showSide as boolean
if (route.matched[1].path === '/projects/:projectCode') {
changeMenuOption(state)
getSideMenu(state)
}
sideKeyRef.value = route.matched[1].path.includes(':projectCode')
? route.matched[1].path.replace(
getSideMenu(state)
const currentSide = (
route.meta.activeSide
? route.meta.activeSide
: route.matched[1].path
) as string
sideKeyRef.value = currentSide.includes(':projectCode')
? currentSide.replace(
':projectCode',
menuStore.getProjectCode
route.params.projectCode as string
)
: route.matched[1].path
: currentSide
}
},
{ immediate: true }
@ -92,9 +96,7 @@ const Content = defineComponent({
return {
...toRefs(state),
menuStore,
changeMenuOption,
getSideMenuOptions,
sideKeyRef
}
},
@ -104,7 +106,6 @@ const Content = defineComponent({
<NLayoutHeader style='height: 65px'>
<NavBar
class='tab-horizontal'
onHandleMenuClick={this.getSideMenuOptions}
headerMenuOptions={this.headerMenuOptions}
localesOptions={this.localesOptions}
timezoneOptions={this.timezoneOptions}

17
dolphinscheduler-ui-next/src/layouts/content/use-dataList.ts

@ -48,14 +48,14 @@ import {
BarsOutlined,
CloudServerOutlined
} from '@vicons/antd'
import { useMenuStore } from '@/store/menu/menu'
import { useRoute } from 'vue-router'
import { useUserStore } from '@/store/user/user'
import { timezoneList } from '@/utils/timezone'
import type { UserInfoRes } from '@/service/modules/users/types'
export function useDataList() {
const { t } = useI18n()
const menuStore = useMenuStore()
const route = useRoute()
const userStore = useUserStore()
const renderIcon = (icon: any) => {
@ -87,6 +87,7 @@ export function useDataList() {
})
const changeMenuOption = (state: any) => {
const projectCode = route.params.projectCode || ''
state.menuOptions = [
{
label: t('menu.home'),
@ -100,7 +101,7 @@ export function useDataList() {
children: [
{
label: t('menu.project_overview'),
key: `/projects/${menuStore.getProjectCode}`,
key: `/projects/${projectCode}`,
icon: renderIcon(FundProjectionScreenOutlined)
},
{
@ -110,15 +111,15 @@ export function useDataList() {
children: [
{
label: t('menu.workflow_relation'),
key: `/projects/${menuStore.getProjectCode}/workflow/relation`
key: `/projects/${projectCode}/workflow/relation`
},
{
label: t('menu.workflow_definition'),
key: `/projects/${menuStore.getProjectCode}/workflow-definition`
key: `/projects/${projectCode}/workflow-definition`
},
{
label: t('menu.workflow_instance'),
key: `/projects/${menuStore.getProjectCode}/workflow/instances`
key: `/projects/${projectCode}/workflow/instances`
}
]
},
@ -129,11 +130,11 @@ export function useDataList() {
children: [
{
label: t('menu.task_definition'),
key: `/projects/${menuStore.getProjectCode}/task/definitions`
key: `/projects/${projectCode}/task/definitions`
},
{
label: t('menu.task_instance'),
key: `/projects/${menuStore.getProjectCode}/task/instances`
key: `/projects/${projectCode}/task/instances`
}
]
}

7
dolphinscheduler-ui-next/src/router/index.ts

@ -22,8 +22,6 @@ import {
RouteLocationNormalized
} from 'vue-router'
import routes from './routes'
import { useMenuStore } from '@/store/menu/menu'
import { useUserStore } from '@/store/user/user'
import type { UserInfoRes } from '@/service/modules/users/types'
@ -40,6 +38,7 @@ const router = createRouter({
interface metaData {
title?: string
activeMenu?: string
showSide?: boolean
auth?: Array<string>
}
@ -54,14 +53,12 @@ router.beforeEach(
next: NavigationGuardNext
) => {
NProgress.start()
const menuStore = useMenuStore()
const userStore = useUserStore()
const metaData: metaData = to.meta
menuStore.setShowSideStatus(metaData.showSide || false)
if (
metaData.auth?.includes('ADMIN_USER') &&
(userStore.getUserInfo as UserInfoRes).userType !== 'ADMIN_USER' &&
menuStore.getMenuKey === 'security'
metaData.activeMenu === 'security'
) {
to.fullPath = '/security/token-manage'
next({ name: 'token-manage' })

2
dolphinscheduler-ui-next/src/router/modules/data-quality.ts

@ -35,6 +35,7 @@ export default {
component: components['data-quality-task-result'],
meta: {
title: '数据质量-task-result',
activeMenu: 'data-quality',
showSide: true,
auth: []
}
@ -45,6 +46,7 @@ export default {
component: components['data-quality-rule'],
meta: {
title: '数据质量-rule',
activeMenu: 'data-quality',
showSide: true,
auth: []
}

1
dolphinscheduler-ui-next/src/router/modules/datasource.ts

@ -34,6 +34,7 @@ export default {
component: components['datasource-list'],
meta: {
title: '数据源中心',
activeMenu: 'datasource',
showSide: false,
auth: []
}

5
dolphinscheduler-ui-next/src/router/modules/monitor.ts

@ -35,6 +35,7 @@ export default {
component: components['monitor-servers-master'],
meta: {
title: '服务管理-Master',
activeMenu: 'monitor',
showSide: true,
auth: []
}
@ -45,6 +46,7 @@ export default {
component: components['monitor-servers-worker'],
meta: {
title: '服务管理-Worker',
activeMenu: 'monitor',
showSide: true,
auth: []
}
@ -55,6 +57,7 @@ export default {
component: components['monitor-servers-db'],
meta: {
title: '服务管理-DB',
activeMenu: 'monitor',
showSide: true,
auth: []
}
@ -65,6 +68,7 @@ export default {
component: components['monitor-statistics-statistics'],
meta: {
title: '统计管理-Statistics',
activeMenu: 'monitor',
showSide: true,
auth: []
}
@ -75,6 +79,7 @@ export default {
component: components['monitor-statistics-audit-log'],
meta: {
title: '审计日志-AuditLog',
activeMenu: 'monitor',
showSide: true,
auth: []
}

19
dolphinscheduler-ui-next/src/router/modules/projects.ts

@ -37,6 +37,7 @@ export default {
component: components['projects-list'],
meta: {
title: '项目',
activeMenu: 'projects',
showSide: false,
auth: []
}
@ -47,6 +48,7 @@ export default {
component: components['projects-overview'],
meta: {
title: '项目概览',
activeMenu: 'projects',
showSide: true,
auth: []
}
@ -57,6 +59,7 @@ export default {
component: components['projects-workflow-relation'],
meta: {
title: '工作流关系',
activeMenu: 'projects',
showSide: true,
auth: []
}
@ -67,6 +70,7 @@ export default {
component: components['projects-workflow-definition'],
meta: {
title: '工作流定义',
activeMenu: 'projects',
showSide: true,
auth: []
}
@ -77,6 +81,8 @@ export default {
component: components['projects-workflow-definition-timing'],
meta: {
title: '定时管理',
activeMenu: 'projects',
activeSide: '/projects/:projectCode/workflow-definition',
showSide: true,
auth: []
}
@ -87,6 +93,8 @@ export default {
component: components['projects-workflow-definition-create'],
meta: {
title: '创建工作流定义',
activeMenu: 'projects',
activeSide: '/projects/:projectCode/workflow-definition',
showSide: true,
auth: []
}
@ -97,6 +105,8 @@ export default {
component: components['projects-workflow-definition-detail'],
meta: {
title: '工作流定义详情',
activeMenu: 'projects',
activeSide: '/projects/:projectCode/workflow-definition',
showSide: true,
auth: []
}
@ -107,6 +117,7 @@ export default {
component: components['projects-workflow-instance'],
meta: {
title: '工作流实例',
activeMenu: 'projects',
showSide: true,
auth: []
}
@ -117,6 +128,8 @@ export default {
component: components['projects-workflow-instance-detail'],
meta: {
title: '工作流实例详情',
activeMenu: 'projects',
activeSide: '/projects/:projectCode/workflow/instances',
showSide: true,
auth: []
}
@ -127,6 +140,8 @@ export default {
component: components['projects-workflow-instance-gantt'],
meta: {
title: '工作流实例甘特图',
activeMenu: 'projects',
activeSide: '/projects/:projectCode/workflow/instances',
showSide: true,
auth: []
}
@ -137,6 +152,7 @@ export default {
component: components['projects-task-definition'],
meta: {
title: '任务定义',
activeMenu: 'projects',
showSide: true,
auth: []
}
@ -147,6 +163,7 @@ export default {
component: components['projects-task-instance'],
meta: {
title: '任务实例',
activeMenu: 'projects',
showSide: true,
auth: []
}
@ -157,6 +174,8 @@ export default {
component: components['projects-workflow-definition-tree'],
meta: {
title: '工作流定义树形图',
activeMenu: 'projects',
activeSide: '/projects/:projectCode/workflow-definition',
showSide: true,
auth: []
}

17
dolphinscheduler-ui-next/src/router/modules/resources.ts

@ -35,6 +35,7 @@ export default {
component: components['resource-file'],
meta: {
title: '文件管理',
activeMenu: 'resource',
showSide: true,
auth: []
}
@ -45,6 +46,8 @@ export default {
component: components['resource-file-create'],
meta: {
title: '文件创建',
activeMenu: 'resource',
activeSide: '/resource/file-manage',
showSide: true,
auth: []
}
@ -55,6 +58,8 @@ export default {
component: components['resource-file-edit'],
meta: {
title: '文件编辑',
activeMenu: 'resource',
activeSide: '/resource/file-manage',
showSide: true,
auth: []
}
@ -65,6 +70,8 @@ export default {
component: components['resource-file'],
meta: {
title: '文件管理',
activeMenu: 'resource',
activeSide: '/resource/file-manage',
showSide: true,
auth: []
}
@ -75,6 +82,8 @@ export default {
component: components['resource-file-edit'],
meta: {
title: '文件详情',
activeMenu: 'resource',
activeSide: '/resource/file-manage',
showSide: true,
auth: []
}
@ -85,6 +94,8 @@ export default {
component: components['resource-file-create'],
meta: {
title: '文件创建',
activeMenu: 'resource',
activeSide: '/resource/file-manage',
showSide: true,
auth: []
}
@ -95,6 +106,7 @@ export default {
component: components['resource-udf-resource'],
meta: {
title: '资源管理',
activeMenu: 'resource',
showSide: true,
auth: []
}
@ -105,6 +117,8 @@ export default {
component: components['resource-udf-resource'],
meta: {
title: '资源管理',
activeMenu: 'resource',
activeSide: '/resource/resource-manage',
showSide: true,
auth: []
}
@ -115,6 +129,7 @@ export default {
component: components['resource-udf-function'],
meta: {
title: '函数管理',
activeMenu: 'resource',
showSide: true,
auth: []
}
@ -125,6 +140,7 @@ export default {
component: components['resource-task-group-option'],
meta: {
title: '任务组配置',
activeMenu: 'resource',
showSide: true,
auth: []
}
@ -135,6 +151,7 @@ export default {
component: components['resource-task-group-queue'],
meta: {
title: '任务组队列',
activeMenu: 'resource',
showSide: true,
auth: []
}

9
dolphinscheduler-ui-next/src/router/modules/security.ts

@ -35,6 +35,7 @@ export default {
component: components['security-tenant-manage'],
meta: {
title: '租户管理',
activeMenu: 'security',
showSide: true,
auth: ['ADMIN_USER']
}
@ -45,6 +46,7 @@ export default {
component: components['security-user-manage'],
meta: {
title: '用户管理',
activeMenu: 'security',
showSide: true,
auth: ['ADMIN_USER']
}
@ -55,6 +57,7 @@ export default {
component: components['security-alarm-group-manage'],
meta: {
title: '告警组管理',
activeMenu: 'security',
showSide: true,
auth: ['ADMIN_USER']
}
@ -65,6 +68,7 @@ export default {
component: components['security-worker-group-manage'],
meta: {
title: 'Worker分组管理',
activeMenu: 'security',
showSide: true,
auth: ['ADMIN_USER']
}
@ -75,6 +79,7 @@ export default {
component: components['security-yarn-queue-manage'],
meta: {
title: 'Yarn队列管理',
activeMenu: 'security',
showSide: true,
auth: ['ADMIN_USER']
}
@ -85,6 +90,7 @@ export default {
component: components['security-environment-manage'],
meta: {
title: '环境管理',
activeMenu: 'security',
showSide: true,
auth: ['ADMIN_USER']
}
@ -95,6 +101,7 @@ export default {
component: components['security-token-manage'],
meta: {
title: '令牌管理管理',
activeMenu: 'security',
showSide: true,
auth: []
}
@ -105,6 +112,7 @@ export default {
component: components['security-alarm-instance-manage'],
meta: {
title: '告警实例管理',
activeMenu: 'security',
showSide: true,
auth: ['ADMIN_USER']
}
@ -115,6 +123,7 @@ export default {
component: components['security-k8s-namespace-manage'],
meta: {
title: 'K8S命名空间管理',
activeMenu: 'security',
showSide: true,
auth: ['ADMIN_USER']
}

1
dolphinscheduler-ui-next/src/router/routes.ts

@ -45,6 +45,7 @@ const basePage: RouteRecordRaw[] = [
component: components['home'],
meta: {
title: '首页',
activeMenu: 'home',
auth: []
}
},

51
dolphinscheduler-ui-next/src/store/menu/menu.ts

@ -1,51 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { defineStore } from 'pinia'
import MenuState from './types'
export const useMenuStore = defineStore({
id: 'menu',
state: (): MenuState => ({
menuKey: 'home',
isShowSide: false,
projectCode: ''
}),
persist: true,
getters: {
getMenuKey(): string {
return this.menuKey
},
getShowSideStatus(): boolean {
return this.isShowSide || false
},
getProjectCode(): string {
return this.projectCode || ''
}
},
actions: {
setMenuKey(menuKey: string): void {
this.menuKey = menuKey
},
setShowSideStatus(isShowSide: boolean): void {
this.isShowSide = isShowSide
},
setProjectCode(projectCode: string): void {
this.projectCode = projectCode
}
}
})

34
dolphinscheduler-ui-next/src/layouts/content/components/navbar/use-menuClick.ts → dolphinscheduler-ui-next/src/store/route/route.ts

@ -15,21 +15,23 @@
* limitations under the License.
*/
import { useRouter } from 'vue-router'
import type { Router } from 'vue-router'
import { MenuOption } from 'naive-ui'
import { SetupContext } from 'vue'
import { defineStore } from 'pinia'
import RouteState from './types'
export function useMenuClick(ctx: SetupContext<'handleMenuClick'[]>) {
const router: Router = useRouter()
const handleMenuClick = (key: string, item: MenuOption) => {
// console.log(key, item)
ctx.emit('handleMenuClick', item)
router.push({ path: `/${key}` })
}
return {
handleMenuClick
export const useRouteStore = defineStore({
id: 'route',
state: (): RouteState => ({
lastRoute: 'home'
}),
persist: true,
getters: {
getLastRoute(): string {
return this.lastRoute
}
},
actions: {
setLastRoute(lastRoute: string): void {
this.lastRoute = lastRoute
}
}
}
})

8
dolphinscheduler-ui-next/src/store/menu/types.ts → dolphinscheduler-ui-next/src/store/route/types.ts

@ -15,10 +15,8 @@
* limitations under the License.
*/
interface MenuState {
menuKey: string
isShowSide: boolean
projectCode: string
interface RouteState {
lastRoute: string
}
export default MenuState
export default RouteState

8
dolphinscheduler-ui-next/src/views/login/use-login.ts

@ -22,13 +22,13 @@ import { useUserStore } from '@/store/user/user'
import type { Router } from 'vue-router'
import type { SessionIdRes } from '@/service/modules/login/types'
import type { UserInfoRes } from '@/service/modules/users/types'
import { useMenuStore } from '@/store/menu/menu'
import { useRouteStore } from '@/store/route/route'
import { useTimezoneStore } from '@/store/timezone/timezone'
export function useLogin(state: any) {
const router: Router = useRouter()
const userStore = useUserStore()
const menuStore = useMenuStore()
const routeStore = useRouteStore()
const timezoneStore = useTimezoneStore()
const handleLogin = () => {
@ -45,9 +45,9 @@ export function useLogin(state: any) {
: Intl.DateTimeFormat().resolvedOptions().timeZone
await timezoneStore.setTimezone(timezone)
const key = menuStore.getMenuKey
const path = routeStore.lastRoute
router.push({ path: key || 'home' })
router.push({ path: path || 'home' })
}
})
}

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

@ -24,7 +24,6 @@ import { parseTime } from '@/utils/common'
import { deleteProject } from '@/service/modules/projects'
import { format } from 'date-fns'
import { useRouter } from 'vue-router'
import { useMenuStore } from '@/store/menu/menu'
import {
NButton,
NEllipsis,
@ -40,7 +39,6 @@ import { DeleteOutlined, EditOutlined } from '@vicons/antd'
export function useTable() {
const { t } = useI18n()
const router: Router = useRouter()
const menuStore = useMenuStore()
const handleEdit = (row: any) => {
variables.showModalRef = true
@ -82,7 +80,6 @@ export function useTable() {
ButtonLink,
{
onClick: () => {
menuStore.setProjectCode(row.code)
router.push({ path: `/projects/${row.code}` })
}
},

2
dolphinscheduler-ui-next/src/views/resource/file/index.tsx

@ -192,7 +192,7 @@ export default defineComponent({
const initBreadcrumb = async (dirs: string[]) => {
let index = 0
for (let dir of dirs) {
for (const dir of dirs) {
const newDir = dirs.slice(0, index + 1).join('/')
if (newDir) {
const id = 0

Loading…
Cancel
Save