func (this *SupplierController) UiAdd() { item := s.Supplier oItemDef, _ := itemDef.EntityDefMap[item] oItemDef.FillEnum(s.Category, getCategoryEnumList()) this.Data["Service"] = "/item/add/" + item this.Data["Form"] = ui.BuildAddForm(oItemDef, u.TUId()) this.Data["Onload"] = ui.BuildAddOnLoadJs(oItemDef) this.TplNames = "item/add.tpl" }
func (this *AccountController) UiAdd() { if this.GetCurRole() == s.RoleUser { this.Ctx.WriteString("没有权限") return } item := s.Account oItemDef, _ := itemDef.EntityDefMap[item] oldValueMap := map[string]interface{}{ s.Sn: u.TUId(), s.PayerName: this.GetCurUserName(), s.Payer: this.GetCurUserSn(), } this.Data["Form"] = ui.BuildUpdatedFormWithStatus(extendUserField(oItemDef, s.Payer), oldValueMap, make(map[string]string)) this.Data["Service"] = "/item/add/" + item this.Data["Onload"] = ui.BuildAddOnLoadJs(oItemDef) this.TplNames = "item/add.tpl" }
func (this *UiController) Add() { item, ok := this.Ctx.Input.Params[":hi"] if !ok { beego.Error(stat.ParamItemError) this.Ctx.WriteString(stat.ParamItemError) return } oItemDef, ok := itemDef.EntityDefMap[item] if !ok { beego.Error(fmt.Sprintf("Item %s not define", item)) this.Ctx.WriteString(stat.ItemNotDefine) return } this.Data["Service"] = "/item/add/" + item this.Data["Form"] = ui.BuildAddForm(oItemDef, u.TUId()) this.Data["Onload"] = ui.BuildAddOnLoadJs(oItemDef) this.TplNames = "item/add.tpl" }