11<template >
2- <div class =" sftp-file-manager" >
2+ <div class =" sftp-file-manager" :class = " { 'dark-theme': isDark } " >
33 <!-- 顶部工具栏 -->
44 <div class =" toolbar" >
55 <div class =" toolbar-buttons" >
176176
177177<script setup>
178178import { ref , onMounted , computed , watch } from ' vue' ;
179+ import { storeToRefs } from ' pinia' ;
179180import { ElMessage , ElMessageBox } from ' element-plus' ;
180181import { VueMonacoEditor } from ' @guolao/vue-monaco-editor' ;
181182import {
182183 ArrowUp , Refresh , FolderAdd , Upload , Delete , Loading ,
183184 Folder , Document , Right
184185} from ' @element-plus/icons-vue'
186+ import { useThemeStore } from ' @/stores/theme'
187+
188+ const themeStore = useThemeStore ()
189+ const { isDark } = storeToRefs (themeStore)
185190
186191const props = defineProps ({
187192 sftp: {
@@ -445,6 +450,11 @@ onMounted(() => {
445450 display : flex ;
446451 flex-direction : column ;
447452 color : #303133 ;
453+ transition : all 0.3s ease ;
454+ }
455+
456+ .dark-theme .sftp-file-manager {
457+ color : #ffffff ;
448458}
449459
450460.toolbar {
@@ -454,6 +464,12 @@ onMounted(() => {
454464 gap : 10px ;
455465 align-items : center ;
456466 flex-wrap : wrap ;
467+ transition : all 0.3s ease ;
468+ }
469+
470+ .dark-theme .toolbar {
471+ background-color : rgba (30 , 30 , 30 , 0.8 );
472+ border-bottom : 1px solid rgba (255 , 255 , 255 , 0.12 );
457473}
458474
459475.toolbar-buttons {
@@ -508,20 +524,40 @@ onMounted(() => {
508524 background-color : #ffffff ;
509525}
510526
527+ .dark-theme .file-item {
528+ background-color : rgba (255 , 255 , 255 , 0.08 );
529+ color : #ffffff ;
530+ border : 1px solid rgba (255 , 255 , 255 , 0.1 );
531+ }
532+
511533.file-item :hover {
512534 background-color : #f5f7fa ;
513535 border-color : #e4e7ed ;
514536}
515537
538+ .dark-theme .file-item :hover {
539+ background-color : rgba (255 , 255 , 255 , 0.12 );
540+ border-color : rgba (255 , 255 , 255 , 0.2 );
541+ }
542+
516543.file-item.selected {
517544 background-color : #ecf5ff ;
518545 border-color : #409eff ;
519546}
520547
548+ .dark-theme .file-item.selected {
549+ background-color : rgba (0 , 122 , 255 , 0.2 );
550+ border-color : #007AFF ;
551+ }
552+
521553.file-item.directory {
522554 font-weight : bold ;
523555}
524556
557+ .dark-theme .file-item.directory .file-name {
558+ color : #ffffff ;
559+ }
560+
525561.file-icon {
526562 margin-right : 10px ;
527563 font-size : 20px ;
@@ -538,13 +574,21 @@ onMounted(() => {
538574 color : #303133 ;
539575}
540576
577+ .dark-theme .file-name {
578+ color : #ffffff !important ;
579+ }
580+
541581.file-details {
542582 display : flex ;
543583 gap : 15px ;
544584 font-size : 12px ;
545585 color : #606266 ;
546586}
547587
588+ .dark-theme .file-details {
589+ color : #98989d ;
590+ }
591+
548592.file-actions {
549593 opacity : 0 ;
550594 transition : opacity 0.2s ;
@@ -560,6 +604,10 @@ onMounted(() => {
560604 color : #909399 ;
561605}
562606
607+ .dark-theme .empty-directory {
608+ color : #98989d ;
609+ }
610+
563611.editor-container {
564612 height : 600px ;
565613 display : flex ;
@@ -572,6 +620,13 @@ onMounted(() => {
572620 display : flex ;
573621 justify-content : space-between ;
574622 align-items : center ;
623+ transition : all 0.3s ease ;
624+ }
625+
626+ .dark-theme .editor-header {
627+ background-color : rgba (30 , 30 , 30 , 0.8 );
628+ border-bottom : 1px solid rgba (255 , 255 , 255 , 0.12 );
629+ color : #ffffff ;
575630}
576631
577632.file-editor-monaco {
0 commit comments