-
- {{ $t('Habit.currentProject') }}
-
{
return store.state.UserHabit.userDetail
@@ -603,13 +611,19 @@ export default defineComponent({
// 监听路由,当路由地址为/home/history时homeMainData.showHistory为true,改变左侧菜单颜色
watch(
- () => route.path,
- () => {
+ [() => route.path, () => route.fullPath],
+ ([path, fullPath]) => {
if (route.path == '/home/history') {
homeMainData.showHistory = true
} else {
homeMainData.showHistory = false
}
+ // 当fullPath为/home时表示在新建项目
+ if (route.fullPath === '/home') {
+ homeMainData.isNewProject = true
+ } else {
+ homeMainData.isNewProject = false
+ }
},
{ immediate: true }
)
@@ -1001,14 +1015,18 @@ export default defineComponent({
return store.state.Workspace.projectPath
})
- const disabledCurrentProject = computed(() => {
- if(!currentProjectPath.value) return true
- if(route.fullPath === currentProjectPath.value) return true
- return false
+ const disabledCurrentProject = computed(() => {
+ if (!currentProjectPath.value) return true
+
+ return false
})
- const handleNavigateToCurrentProject = () => {
- console.log('store地址',currentProjectPath.value,'当前路径',route.fullPath)
+ const currentProjectActive = computed(() => {
+ return currentProjectPath.value === route.fullPath
+ })
+
+ const handleNavigateToCurrentProject = () => {
+ if (currentProjectActive.value) return
if (currentProjectPath.value) {
router.push(currentProjectPath.value)
}
@@ -1047,8 +1065,9 @@ export default defineComponent({
newProject,
bathGeneration,
toUserManual,
- currentProjectPath,
- disabledCurrentProject,
+ currentProjectPath,
+ disabledCurrentProject,
+ currentProjectActive,
handleNavigateToCurrentProject
}
},
@@ -1705,7 +1724,8 @@ export default defineComponent({
}
.newObj {
border-radius: 2rem;
- border: 2px solid #000;
+ border: 2px solid rgba(0, 0, 0, 0.1);
+ background: #fff;
display: flex;
align-items: center;
justify-content: center;
@@ -1714,6 +1734,12 @@ export default defineComponent({
width: 25.1rem;
// height: 6.8rem;
padding: calc(2rem - 2px) 0;
+ &.active {
+ border-color: rgba(0, 0, 0, 0.5);
+ }
+ &:hover {
+ border-color: rgba(0, 0, 0, 0.5);
+ }
> svg {
margin-right: 1.3rem;
width: 1.6rem;
@@ -2190,23 +2216,43 @@ export default defineComponent({
}
.current-projct {
- // text-align: center;
- padding: 1.2rem;
- font-size: 1.8rem;
+ font-size: 2rem;
cursor: pointer;
- font-weight: 500;
+ border: 2px solid rgba(0, 0, 0, 0.1);
border-radius: 2rem;
- border: 2px solid #000;
- text-align: center;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 25.1rem;
+ padding: calc(2rem - 2px) 0;
+ margin-top: 2rem;
+ &.filled {
+ background-color: #fff;
+ }
+
+ .current-project-icon {
+ margin-right: 1.3rem;
+ }
&.disabled {
- color: #a5b0c2;
- border-color: #a5b0c2;
+ color: #9a9a9a;
+ border-color: rgba(0, 0, 0, 0.1);
+ background: #f5f5f5;
cursor: not-allowed;
}
+ &.active {
+ cursor: not-allowed;
+ border-color: rgba(0, 0, 0, 0.5);
+ }
- &:hover {
- background: #fff;
+ &.filled:hover {
+ border-color: rgba(0, 0, 0, 0.5);
}
}
+.divider {
+ width: 100%;
+ height: 1px;
+ margin-top: 3rem;
+ background-color: rgba(0, 0, 0, 0.1);
+}