Compare commits
No commits in common. "3a7665e3de4311c72e71f6ca3d5b94b9e303972b" and "889c4b8a580acb3b5357a2832b50714dabacffe5" have entirely different histories.
3a7665e3de
...
889c4b8a58
Binary file not shown.
|
Before Width: | Height: | Size: 55 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.8 KiB |
84
src/App.vue
84
src/App.vue
|
|
@ -10,7 +10,7 @@ import { useFileTree } from "./composables/useFileTree";
|
||||||
import { useConfig } from "./composables/useConfig";
|
import { useConfig } from "./composables/useConfig";
|
||||||
import { useTheme } from "./composables/useTheme";
|
import { useTheme } from "./composables/useTheme";
|
||||||
import { ConfigProvider } from 'ant-design-vue';
|
import { ConfigProvider } from 'ant-design-vue';
|
||||||
import { SettingOutlined, DeleteOutlined, FolderOpenOutlined } from '@ant-design/icons-vue';
|
import { SettingOutlined } from '@ant-design/icons-vue';
|
||||||
|
|
||||||
const { setRootPath } = useFileTree();
|
const { setRootPath } = useFileTree();
|
||||||
const { loadConfig } = useConfig();
|
const { loadConfig } = useConfig();
|
||||||
|
|
@ -222,14 +222,6 @@ const handleSelectDirectory = async () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeHistoryDir = async (path) => {
|
|
||||||
const index = historyDirs.value.indexOf(path);
|
|
||||||
if (index > -1) {
|
|
||||||
historyDirs.value.splice(index, 1);
|
|
||||||
await saveGlobalConfig();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleHistorySelect = (path) => {
|
const handleHistorySelect = (path) => {
|
||||||
openDirectory(path);
|
openDirectory(path);
|
||||||
showHistory.value = false;
|
showHistory.value = false;
|
||||||
|
|
@ -321,25 +313,12 @@ const { state } = useFileTree(); // 需要获取 rootPath 用于保存
|
||||||
</a-modal>
|
</a-modal>
|
||||||
|
|
||||||
<!-- 历史记录弹窗 -->
|
<!-- 历史记录弹窗 -->
|
||||||
<a-modal v-model:open="showHistory" title="选择历史目录" :footer="null" width="600px">
|
<a-modal v-model:open="showHistory" title="选择历史目录" :footer="null">
|
||||||
<div v-if="historyDirs.length === 0" class="empty-history">
|
<a-list :data-source="historyDirs">
|
||||||
暂无历史记录
|
|
||||||
</div>
|
|
||||||
<a-list v-else :data-source="historyDirs" size="small" :split="false">
|
|
||||||
<template #renderItem="{ item }">
|
<template #renderItem="{ item }">
|
||||||
<a-list-item class="history-item">
|
<a-list-item>
|
||||||
<div class="history-content" @click="handleHistorySelect(item)">
|
<a-button type="link" @click="handleHistorySelect(item)">
|
||||||
<FolderOpenOutlined class="history-icon" />
|
{{ item }}
|
||||||
<span class="history-text" :title="item">{{ item }}</span>
|
|
||||||
</div>
|
|
||||||
<a-button
|
|
||||||
type="text"
|
|
||||||
danger
|
|
||||||
size="small"
|
|
||||||
class="delete-btn"
|
|
||||||
@click.stop="removeHistoryDir(item)"
|
|
||||||
>
|
|
||||||
<DeleteOutlined />
|
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-list-item>
|
</a-list-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -440,55 +419,4 @@ const { state } = useFileTree(); // 需要获取 rootPath 用于保存
|
||||||
border-color: var(--text-color);
|
border-color: var(--text-color);
|
||||||
box-shadow: 0 0 0 2px var(--primary-color-bg);
|
box-shadow: 0 0 0 2px var(--primary-color-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.history-item {
|
|
||||||
padding: 4px 8px !important;
|
|
||||||
border-radius: 6px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background-color 0.2s;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.history-item:hover {
|
|
||||||
background-color: rgba(0, 0, 0, 0.04);
|
|
||||||
}
|
|
||||||
|
|
||||||
.history-content {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
overflow: hidden;
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.history-icon {
|
|
||||||
margin-right: 8px;
|
|
||||||
color: var(--primary-color, #1890ff);
|
|
||||||
font-size: 16px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.history-text {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
color: var(--text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.delete-btn {
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.history-item:hover .delete-btn {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty-history {
|
|
||||||
text-align: center;
|
|
||||||
padding: 40px 0;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue