优化:CSV编辑模式/PDF导出重构/收藏夹bug修复/移除useLocalStorage
- FileEditorPanel: CSV新增预览/编辑切换、PDF导出;提取openPrintWindow公共函数 - useFavorites: 修复find回调中fav变量遮蔽bug(f.path)、sort改为副本排序 - useFavoriteFiles/DeviceTest: 移除useLocalStorage抽象层,直接管理localStorage - system.ts: createDir/createFile签名改为(parent, name)两参数拼接 - useFileOperations: createNewFile移除无用content参数 - 清理OpenClaw相关Wails绑定
This commit is contained in:
@@ -110,23 +110,25 @@ export async function deletePath(path: string): Promise<any> {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建目录
|
||||
* 创建目录(parentPath + dirname 拼接为完整路径)
|
||||
*/
|
||||
export async function createDir(path: string): Promise<any> {
|
||||
export async function createDir(parentPath: string, dirname: string): Promise<any> {
|
||||
if (!window.go?.main?.App?.CreateDir) {
|
||||
throw new Error('CreateDir API 不可用')
|
||||
}
|
||||
return await window.go.main.App.CreateDir(path)
|
||||
const fullPath = parentPath.replace(/\/$/, '') + '/' + dirname
|
||||
return await window.go.main.App.CreateDir(fullPath)
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建文件
|
||||
* 创建文件(dirPath + filename 拼接为完整路径)
|
||||
*/
|
||||
export async function createFile(path: string): Promise<any> {
|
||||
export async function createFile(dirPath: string, filename: string): Promise<any> {
|
||||
if (!window.go?.main?.App?.CreateFile) {
|
||||
throw new Error('CreateFile API 不可用')
|
||||
}
|
||||
return await window.go.main.App.CreateFile(path)
|
||||
const fullPath = dirPath.replace(/\/$/, '') + '/' + filename
|
||||
return await window.go.main.App.CreateFile(fullPath)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user