From 3a1fc0bbfe5605c861129f46c06e90feba0974c4 Mon Sep 17 00:00:00 2001 From: "DESKTOP-4RNDQIC\\29019" <290198252@qq.com> Date: Sun, 9 May 2021 22:24:21 +0800 Subject: [PATCH] no message --- controller/openapi.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/controller/openapi.go b/controller/openapi.go index 274f186..2cdb706 100644 --- a/controller/openapi.go +++ b/controller/openapi.go @@ -89,18 +89,21 @@ func RangeWidget(p *Widget ) string{ return "" } ret := "" - ret += p.Class + "#" + p.Name + " \r\n{\r\n}\r\n" + parent := "" + tmp := p + for ;tmp != nil;tmp = tmp.Parent{ + parent = tmp.Class + " #" + tmp.Name + " " + parent + } + ret += parent + " \r\n{\r\n}\r\n" + if(p.Childs.Len() > 0){ wid := p.Childs.Front() for ;wid != nil;wid = wid.Next(){ - output := "" tmp := wid.Value.(*Widget) - for ;tmp != nil;tmp = tmp.Parent{ - output = tmp.Class + " #" + tmp.Name + " " + output - } - ret += output + "\r\n{\r\n}\r\n" + ret += RangeWidget(tmp) } } + // log.Print(ret) return ret } @@ -115,7 +118,6 @@ func GetUifrom(path io.Reader) string{ switch startElement := token.(type) { case xml.StartElement: if(startElement.Name.Local == "widget"){ - // log.Print(startElement.Name.Local) if(list.Len() == 0){ ins := new(Widget) ins.Class = getAttr("class",startElement.Attr) @@ -126,7 +128,6 @@ func GetUifrom(path io.Reader) string{ ins := new(Widget) ins.Class = getAttr("class",startElement.Attr) ins.Name = getAttr("name",startElement.Attr) - // log.Print(list.Back().Value.(*Widget)) ins.Parent = list.Back().Value.(*Widget) list.Back().Value.(*Widget).Childs.PushBack(ins) list.PushBack(ins)