Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ declare module 'vue' {
NMessageProvider: typeof import('naive-ui')['NMessageProvider']
NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
NPageHeader: typeof import('naive-ui')['NPageHeader']
NPopover: typeof import('naive-ui')['NPopover']
NSpace: typeof import('naive-ui')['NSpace']
NStatistic: typeof import('naive-ui')['NStatistic']
NSwitch: typeof import('naive-ui')['NSwitch']
Expand Down
1 change: 1 addition & 0 deletions src/components/Layout/LayoutWork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
class="resize-content"
>
<!-- <ProjectTree /> -->
侧边栏
</div>
<div
class="resize-line"
Expand Down
4 changes: 2 additions & 2 deletions src/modules/HomeFront/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
title="主页"
flex-content
>
<template #action>
<!-- <template #action>
<n-button>测绘</n-button>
</template>
</template> -->

<n-data-table
:columns="tableColumns"
Expand Down
3 changes: 0 additions & 3 deletions src/router/frontend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,6 @@ export const routesHomeFrontend: RouteRecordRaw = {
{
path: 'dashboard',
name: 'DashboardIndex',
meta: {
title: 'Dashboard'
},
redirect: {
name: 'DashboardConsole'
},
Expand Down
30 changes: 20 additions & 10 deletions src/widgets/WorkTabs/Tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
v-for="(tabItem) in workTabsStore.currentTabsInCacheSpace"
:key="tabItem.tabKey"
ref="refsTabs"
class="tab-item-box"
:class="{
active: tabItem.tabKey === workTabsStore.currentCacheSpace?.activeTabKey
}"
:class="[
'tab-item-box',
{
'active': tabItem.tabKey === workTabsStore.currentCacheSpace?.activeTabKey
}
]"
@click="handleSwitch(tabItem)"
>
<span
Expand All @@ -28,17 +30,18 @@
>{{ tabItem.customLabel || tabItem.label }}</span>
<div
v-if="!isOnlyOneTab"
class="tab-item-icon"
class="tab-item-icon flex items-center"
@click.stop="handleCloseTab(tabItem)"
>
<IconFont icon="icon-error" />
<n-icon :component="IosCloseCircleOutline" />
</div>
</li>
</ul>
</div>
</template>

<script lang="ts" setup>
import { IosCloseCircleOutline } from '@vicons/ionicons4'
import useWorkTabsStore from './store'
import type { WorkTab } from './types'

Expand Down Expand Up @@ -206,10 +209,11 @@ onUnmounted(async() => {
padding: 0 11px 0 12px;
cursor: pointer;
transition: all .2s;
background-color: #dee2ea;
border-radius: 8px 8px 0 0;
margin-right: 2px;

--at-apply: bg-#dee2ea dark:bg-#565555;

&:last-child {
margin-right: 0;
transition: all .2s;
Expand All @@ -231,25 +235,31 @@ onUnmounted(async() => {
font-size: 14px;
font-family: PingFangSC-Regular, "PingFang SC";
font-weight: 400;
color: #303133;

--at-apply: c-#303133 dark:c-#dee2ea;
}

&:hover {
background-color: #cacfd8;
--at-apply: bg-#cacfd8 dark:bg-#3e3e3e;

& > .tab-item-icon {
color: #909399;
}
}

&.active {
background-color: #fff;
--at-apply: bg-#fff dark:bg-#1e1e20;

& > .tab-item-label {
--at-apply: dark:c-#fff;
}

& > .tab-item-icon {
color: transparent;
}

&:hover {
--at-apply: dark:bg-#1e1e20;

& > .tab-item-icon {
color: #b6b9c1;
Expand Down
35 changes: 15 additions & 20 deletions src/widgets/WorkTabs/TabsOptions.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<template>
<el-popover
<n-popover
trigger="hover"
:width="236"
:show-after="300"
popper-class="tabs-options-box"
style="width: 236px"
:delay="300"
class="tabs-options-box"
placement="bottom-start"
@show="isKeepHover = true"
@hide="isKeepHover = false"
@update:show="(showValue) => isKeepHover = showValue"
>
<template #reference>
<template #trigger>
<div
class="tabs-options-action"
class="tabs-options-action hover-bg-#cacfd8 dark:hover-c-#303133"
:class="{
'is-hover': isKeepHover
'bg-#cacfd8 dark:c-#303133': isKeepHover
}"
>
<IconFont icon="icon-arrow_down" />
<n-icon
:component="KeyboardDoubleArrowDownFilled"
/>
</div>
</template>
<template #default>
Expand All @@ -27,7 +28,7 @@
@click="handleCloseOtherTabs()"
>
<span class="close-icon">
<IconFont icon="icon-error" />
<n-icon :component="IosCloseCircleOutline" />
</span>
<span class="close-other-text">关闭其他标签</span>
</div>
Expand Down Expand Up @@ -55,11 +56,13 @@
</li>
</ul>
</template>
</el-popover>
</n-popover>
</template>

<script lang="ts" setup>

import { IosCloseCircleOutline } from '@vicons/ionicons4'
import { KeyboardDoubleArrowDownFilled } from '@vicons/material'
import useWorkTabsStore from './store'
import type { WorkTab } from './types'

Expand Down Expand Up @@ -110,14 +113,6 @@ const isKeepHover = ref(false)
transition: .3s;
cursor: pointer;
z-index: 0;

&:hover {
background-color: #cacfd8;
}

&.is-hover {
background-color: #cacfd8;
}
}

.tabs-options-box {
Expand Down
17 changes: 12 additions & 5 deletions src/widgets/WorkTabs/TabsOutset.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
<template>
<div
id="tabs-outset-box"
@click="handleJumpToCockpit()"
@click="handleJumpToOverview()"
>
<IconFont icon="icon-jiashicang" />
<span class="tabs-outset-box-label">驾</span>
<n-icon
:component="AppFolder20Regular"
/>
<span
v-if="false"
class="tabs-outset-box-label"
>驾</span>
</div>
</template>

<script lang="ts" setup>
import { AppFolder20Regular } from '@vicons/fluent'


/**
* 驾驶舱 - 🏠
Expand All @@ -20,9 +27,9 @@ defineOptions({

const router = useTabRouter()

const handleJumpToCockpit = () => {
const handleJumpToOverview = () => {
router.push({
name: 'GroupProjectCockpit'
name: 'GroupProjectDetail'
})
}
</script>
Expand Down
7 changes: 2 additions & 5 deletions src/widgets/WorkTabs/index.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<template>
<div class="work-tabs-container">
<div class="work-tabs__controller">
<div class="work-tabs__controller bg-#eaedf2 dark:bg-#7a7a7a">
<TabsOutset v-if="showOutset" />
<TabsHeader />
<!-- TODO: 需要将 element-plus 重构为 naive-ui 组件 -->
<!-- <TabsOptions /> -->
<TabsOptions />
</div>

<div class="work-tabs__content">
Expand Down Expand Up @@ -43,7 +42,6 @@ const showOutset = computed(() => route.path.includes('/group-project'))
justify-content: space-between;
user-select: none;
padding: 16px 21px 0 24px;
background-color: #eaedf2;
position: relative;
}

Expand All @@ -61,7 +59,6 @@ const showOutset = computed(() => route.path.includes('/group-project'))
.work-tabs__content {
flex: 1;
min-height: 0;
background-color: #fff;
overflow-y: auto;
}
}
Expand Down