更新工具

This commit is contained in:
wh_zcy 2022-12-08 18:04:08 +08:00
parent ec63f234fc
commit 12400a82d4
3 changed files with 26 additions and 6 deletions

View File

@ -42,7 +42,7 @@ func (a *appTester) LazyInit(service service.PttService, obs observer.Observer)
intro := widget.NewLabel("")
intro.Wrapping = fyne.TextWrapWord
caseContent := container.NewBorder(
container.NewVBox(container.NewHBox(title, widget.NewSeparator(), widget.NewButton("压测", nil)), widget.NewSeparator(), intro), nil, nil, nil, content)
container.NewVBox(container.NewHBox(title), widget.NewSeparator(), intro), nil, nil, nil, content)
setNav := func(t *model.TestCase) {
defer a.progress.Hide()
@ -76,7 +76,7 @@ func (a *appTester) LazyInit(service service.PttService, obs observer.Observer)
OnNotify: func(data interface{}, args ...interface{}) {
tm := data.(time.Time)
cost := time.Since(tm)
logrus.WithFields(logrus.Fields{"Main": t.MainType, "Sub": t.SubType, "cost": cost}).Debug("耗时")
// logrus.WithFields(logrus.Fields{"Main": t.MainType, "Sub": t.SubType, "cost": cost}).Debug("耗时")
timeLbl.Text = fmt.Sprintf("耗时:%v", cost)
timeLbl.Refresh()
},
@ -180,6 +180,6 @@ func (a *appTester) Icon() fyne.Resource {
return theme.DocumentIcon()
}
func(a *appTester) Pressure() bool{
func (a *appTester) Pressure() bool {
return true
}

View File

@ -46,7 +46,7 @@ func (this *BingoView) CreateView(t *model.TestCase) fyne.CanvasObject {
aSel = &widget.Select{}
gridContainer = container.NewGridWithColumns(3, aSel, tEntry, nEntry)
aSel.Options = []string{"选择", "attr", "item", "hero", "equi", "mapid", "pataid", "worldtask"}
aSel.Options = []string{"选择", "attr", "item", "hero", "equi", "mapid", "pataid", "worldtask", "sociatyexp", "sociatyactivity"}
aSel.SetSelected("选择")
aSel.OnChanged = func(s string) {
if s == "attr" {
@ -61,9 +61,14 @@ func (this *BingoView) CreateView(t *model.TestCase) fyne.CanvasObject {
this.form.AppendItem(widget.NewFormItem(common.APP_TESTCASE_FORM_BINGO, gridContainer))
this.form.OnSubmit = func() {
bingo := fmt.Sprintf("bingo:%s,%s,%s", aSel.Selected, ttxt, nEntry.Text)
var bingo string
if ttxt == "" {
bingo = fmt.Sprintf("bingo:%s,%s", aSel.Selected, nEntry.Text)
} else {
bingo = fmt.Sprintf("bingo:%s,%s,%s", aSel.Selected, ttxt, nEntry.Text)
}
logrus.Info(bingo)
if aSel.Selected == "选择" || nEntry.Text == "" || ttxt == "" || nEntry.Text == "0" {
if aSel.Selected == "选择" || nEntry.Text == "0" {
dialog.ShowError(errors.New("请填写完整且正确的数值"), this.w)
return
}

View File

@ -46,6 +46,9 @@ type entryItem struct {
icon *widget.Entry
isApplyCheck *widget.Check
applyLv *widget.Entry
exp *widget.Label
activity *widget.Label
lv *widget.Label
}
func (this *SociatyMineView) CreateView(t *model.TestCase) fyne.CanvasObject {
@ -60,6 +63,9 @@ func (this *SociatyMineView) CreateView(t *model.TestCase) fyne.CanvasObject {
icon: widget.NewEntry(),
isApplyCheck: widget.NewCheck("审批", nil),
applyLv: widget.NewEntry(),
lv: widget.NewLabel(""),
exp: widget.NewLabel(""),
activity: widget.NewLabel(""),
}
this.form.AppendItem(widget.NewFormItem("公会名称", item.sociatyName))
@ -67,6 +73,9 @@ func (this *SociatyMineView) CreateView(t *model.TestCase) fyne.CanvasObject {
this.form.AppendItem(widget.NewFormItem("图标", item.icon))
this.form.AppendItem(widget.NewFormItem("审批", item.isApplyCheck))
this.form.AppendItem(widget.NewFormItem("入会等级", item.applyLv))
this.form.AppendItem(widget.NewFormItem("等级", item.lv))
this.form.AppendItem(widget.NewFormItem("经验", item.exp))
this.form.AppendItem(widget.NewFormItem("活跃值", item.activity))
//加载公会信息
this.loadSociaty = func() {
@ -258,6 +267,9 @@ func (this *SociatyMineView) sociatyRender(item *entryItem) {
item.icon.Text = this.sociaty.Icon
item.isApplyCheck.Checked = this.sociaty.IsApplyCheck
item.applyLv.Text = cast.ToString(this.sociaty.ApplyLv)
item.lv.Text = cast.ToString(this.sociaty.Lv)
item.exp.Text = cast.ToString(this.sociaty.Exp)
item.activity.Text = cast.ToString(this.sociaty.Activity)
}
}
@ -305,6 +317,9 @@ func (this *SociatyMineView) dataListener(item *entryItem) {
item.icon.Text = rsp.Sociaty.Icon
item.isApplyCheck.Checked = rsp.Sociaty.IsApplyCheck
item.applyLv.Text = cast.ToString(rsp.Sociaty.ApplyLv)
item.lv.Text = cast.ToString(rsp.Sociaty.Lv)
item.exp.Text = cast.ToString(rsp.Sociaty.Exp)
item.activity.Text = cast.ToString(rsp.Sociaty.Activity)
this.form.Refresh()
},
})