修正基本架构逻辑,基本实现离线功能

This commit is contained in:
2024-10-11 01:03:17 +08:00
parent 1a0a9466d8
commit 0716c82833
14 changed files with 331 additions and 96 deletions
+4 -11
View File
@@ -9,23 +9,17 @@ import (
"fyne.io/fyne/v2/widget"
"regexp"
"strings"
"time"
"work_cation/global"
"work_cation/models"
"work_cation/pkg/utils"
"work_cation/repo"
"work_cation/service"
)
var erlangCard *models.ErlangCards
func CreateErlangCard(w fyne.Window) fyne.CanvasObject {
if erlangCard == nil {
erlangCard = &models.ErlangCards{
UUID: utils.Uuid.CreateUUID(),
UserID: repo.User.GetUserInfo(global.DB).ID,
}
}
var (
// 创建数据
erlangCard = &models.ErlangCards{BaseCard: models.NewBaseCard(models.ToolTypeErlang, repo.User.GetUserInfo(global.DB).ID)}
// 基础表单
formBase = &widget.Form{}
// 变量表单
@@ -49,8 +43,7 @@ func CreateErlangCard(w fyne.Window) fyne.CanvasObject {
return
}
dialog.ShowInformation("ok", "创建成功", w)
// 更换
erlangCard.UUID = utils.Uuid.CreateUUID()
time.AfterFunc(2*time.Second, func() { w.Close() })
})
return container.NewBorder(container.NewHBox(widget.NewLabel("新建"), widget.NewSeparator()),