mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
feat(frontend):添加设置导出导入功能
- 在 App.d.ts 中添加 ExportConfig 函数声明 - 在 app.go 中实现 ExportConfig 方法,用于导出配置文件 - 在 App.js 中添加 ExportConfig 函数的 JavaScript 调用接口 - 在 settings.vue 中添加导出和导入配置的功能按钮,并实现相关逻辑 - 在 settings_api.go 中添加 Export 方法,用于生成配置文件的 JSON 字符串
This commit is contained in:
parent
3a3e0b0543
commit
3f73a5a521
1
app.go
1
app.go
@ -535,6 +535,7 @@ func (a *App) ExportConfig() string {
|
|||||||
file, err := runtime.SaveFileDialog(a.ctx, runtime.SaveDialogOptions{
|
file, err := runtime.SaveFileDialog(a.ctx, runtime.SaveDialogOptions{
|
||||||
Title: "导出配置文件",
|
Title: "导出配置文件",
|
||||||
CanCreateDirectories: true,
|
CanCreateDirectories: true,
|
||||||
|
DefaultFilename: "config.json",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.SugaredLogger.Errorf("导出配置文件失败:%s", err.Error())
|
logger.SugaredLogger.Errorf("导出配置文件失败:%s", err.Error())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user