This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-08-21 23:13:00 +08:00
parent fa06d9d60f
commit f7bed30a46
33 changed files with 321 additions and 430 deletions

View File

@ -12,10 +12,8 @@ type allow struct {
user user
event event
apply apply
order string `data:"4"`
order string `data:"93"`
role string `data:"creator"`
portal string `data:"true"`
domain string `data:"gonganxitong"`
create string `name:"create user_uid* apply_uid* status*"`
reject string `name:"reject" role:"void"`
approve string `name:"approve" role:"void"`
@ -47,7 +45,6 @@ func (s allow) List(m *ice.Message, arg ...string) {
m.PushButton()
}
}).Action()
s.UserPlace.RewriteAppend(m)
}
func (s allow) Reject(m *ice.Message, arg ...string) {
defer m.ToastProcess()()

View File

@ -1,17 +1,14 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
var PLACE_NAME = msg.Option("_place_name"), PLACE_TYPE = msg.Option("_place_type")
var USER_PLACE_ROLE = msg.Option("_user_place_role"), STREET_NAME = msg.Option("_street_name"), ALLOW_STATUS = "allow_status"
can.onimport.itemcards(can, msg, function(value) { value._style = [value[PLACE_TYPE], value[USER_PLACE_ROLE], value[ALLOW_STATUS]]
var status = value[ALLOW_STATUS]
return [
{view: html.TITLE, list: [{text: value.user_name}, can.onimport.textView(can, value, USER_PLACE_ROLE, aaa.ROLE)]},
{view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at)},
{text: [can.user.transValue(can, value, ALLOW_STATUS)+" "+(status == "create" || status == "submit"? "🕑": status == "rejected"? "❌": "✅"), "", mdb.STATUS]},
]},
{view: html.STATUS, list: [{text: value.begin_time.split(" ")[0]}, {text: value.end_time.split(" ")[0]}]},
{view: html.STATUS, list: [{text: value.city_name}, {text: value[STREET_NAME]}]},
]
})
can.onimport.itemcards(can, msg, function(value) { var status = value[ALLOW_STATUS]; return [
{view: html.TITLE, list: [value.user_name, can.onimport.textView(can, value, USER_PLACE_ROLE, aaa.ROLE)]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at),
{text: [can.user.transValue(can, value, ALLOW_STATUS)+" "+(status == "create" || status == "submit"? "🕑": status == "rejected"? "❌": "✅"), "", mdb.STATUS]},
]},
{view: html.STATUS, list: [value.begin_time.split(" ")[0], value.end_time.split(" ")[0]]},
{view: html.STATUS, list: [value.city_name, value[STREET_NAME]]},
] })
},
})

View File

@ -11,10 +11,8 @@ type apply struct {
Table
user user
event event
order string `data:"3"`
order string `data:"92"`
role string `data:"creator"`
portal string `data:"true"`
domain string `data:"gonganxitong"`
create string `name:"create user_place_role*:select begin_time:select@date end_time:select@date" role:"void"`
cancel string `name:"cancel" role:"void"`
submit string `name:"submit" role:"void"`
@ -42,10 +40,8 @@ func (s apply) List(m *ice.Message, arg ...string) {
model.BEGIN_TIME, model.END_TIME,
)
if len(arg) == 1 {
if s.Table.Select(m, model.USER_UID, m.Option(model.USER_UID), model.PLACE_UID, arg[0]); m.Length() == 0 {
m.EchoInfoButton(m.Trans("please create apply", "请创建权限申请"), s.Create)
return
}
s.Table.Select(m, model.USER_UID, m.Option(model.USER_UID), model.PLACE_UID, arg[0])
kit.If(m.Length() == 0, func() { m.EchoInfoButton("", s.Create) })
} else if len(arg) == 2 {
s.Table.SelectDetail(m, model.USER_UID, m.Option(model.USER_UID), model.PLACE_UID, arg[0], s.Key(s, model.UID), arg[1])
if ApplyStatus(kit.Int(m.Append(model.APPLY_STATUS))) == ApplySubmit {
@ -62,11 +58,9 @@ func (s apply) List(m *ice.Message, arg ...string) {
m.PushButton()
}
})
s.UserPlace.RewriteAppend(m)
}
func (s apply) Cancel(m *ice.Message, arg ...string) {
msg := s.changeStatus(m, ApplyCreate, ApplyCancel)
s.sendTemplate(msg, m.Trans("role apply canceled", "权限申请 已取消"))
s.changeStatus(m, ApplyCreate, ApplyCancel)
}
func (s apply) Submit(m *ice.Message, arg ...string) {
msg := s.changeStatus(m, ApplyCreate, ApplySubmit)
@ -87,7 +81,6 @@ func (s apply) Submit(m *ice.Message, arg ...string) {
}
m.Cmd(allow{}, s.Create, msg.AppendSimple(model.USER_UID), model.APPLY_UID, m.Option(model.UID), model.STATUS, OrderCreate)
s.RecordEvent(m, "", kit.Format("🕑 %s"+m.Trans(" apply submit", "权限申请提交"), s.TransRole(m)), m.Option(model.UID))
s.sendTemplate(m, m.Trans("role apply submited", "权限申请 已提交"))
}
func (s apply) Reject(m *ice.Message, arg ...string) {
msg := s.changeStatus(m, ApplySubmit, ApplyRejected)

View File

@ -1,17 +1,14 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
var PLACE_NAME = msg.Option("_place_name"), PLACE_TYPE = msg.Option("_place_type")
var USER_PLACE_ROLE = msg.Option("_user_place_role"), STREET_NAME = msg.Option("_street_name"), APPLY_STATUS = "apply_status"
can.onimport.itemcards(can, msg, function(value) { value._style = [value[PLACE_TYPE], value[USER_PLACE_ROLE], value[APPLY_STATUS]]
var status = value[APPLY_STATUS]
return [
{view: html.TITLE, list: [{text: value[PLACE_NAME]}, can.onimport.textView(can, value, PLACE_TYPE, mdb.TYPE), can.onimport.textView(can, value, USER_PLACE_ROLE, aaa.ROLE)]},
{view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at)},
{text: [can.user.transValue(can, value, APPLY_STATUS)+" "+(status == "create" || status == "submit"? "🕑": status == "rejected"? "❌": "✅"), "", mdb.STATUS]},
]},
{view: html.STATUS, list: [{text: value.begin_time.split(" ")[0]}, {text: value.end_time.split(" ")[0]}]},
{view: html.STATUS, list: [{text: value.city_name}, {text: value[STREET_NAME]}]},
]
})
can.onimport.itemcards(can, msg, function(value) { var status = value[APPLY_STATUS]; return [
{view: html.TITLE, list: [value[PLACE_NAME], can.onimport.textView(can, value, PLACE_TYPE, mdb.TYPE), can.onimport.textView(can, value, USER_PLACE_ROLE, aaa.ROLE)]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at),
{text: [can.user.transValue(can, value, APPLY_STATUS)+" "+(status == "create" || status == "submit"? "🕑": status == "rejected"? "❌": "✅"), "", mdb.STATUS]},
]},
{view: html.STATUS, list: [value.begin_time.split(" ")[0], value.end_time.split(" ")[0]]},
{view: html.STATUS, list: [value.city_name, value[STREET_NAME]]},
] })
},
})

View File

@ -15,6 +15,10 @@ import (
"shylinux.com/x/mysql-story/src/db"
)
type UserPlacer interface {
Placer
User(m *ice.Message, arg ...string)
}
type Placer interface {
Inputs(m *ice.Message, arg ...string)
Select(m *ice.Message, arg ...string) *ice.Message
@ -22,10 +26,6 @@ type Placer interface {
TransValue(m *ice.Message, key string, arg ...string) string
TransRole(m *ice.Message, arg ...string) string
}
type UserPlacer interface {
Placer
User(m *ice.Message, arg ...string)
}
type Container interface {
FindOrCreateByName(m *ice.Message, arg ...string)
}
@ -41,13 +41,8 @@ type Table struct {
}
func (s Table) Init(m *ice.Message, arg ...string) {
s.Table.Init(m, arg...)
m.GoSleep("30ms", func() {
if m.Target().Commands[m.CommandKey()].Icon != "" {
Portal{}.Show(m)
} else {
kit.If(m.Config(web.PORTAL) == ice.TRUE, func() { Portal{}.Show(m) })
}
s.Table.Init(m, arg...).GoSleep("30ms", func() {
kit.If(m.GetCommand().Icon, func() { Portal{}.Show(m) })
})
}
func (s Table) Exit(m *ice.Message, arg ...string) {
@ -55,18 +50,10 @@ func (s Table) Exit(m *ice.Message, arg ...string) {
}
func (s Table) Inputs(m *ice.Message, arg ...string) {
switch arg[0] {
case model.PLACE_TYPE:
for k, v := range PlaceTypeList {
m.Push(arg[0], k).Push(model.NAME, v)
}
m.SortInt(arg[0]).DisplayInputKeyNameIconTitle()
case model.USER_PLACE_ROLE:
for k, v := range UserPlaceRoleList {
if k != UserPlaceCreator && k != UserPlaceVisitor {
m.Push(arg[0], k).Push(model.NAME, v)
}
}
m.SortInt(arg[0]).DisplayInputKeyNameIconTitle()
s.InputsListRole(m, UserPlaceRoleList, arg...)
case model.PLACE_TYPE:
s.InputsList(m, PlaceTypeList, arg...)
case ctx.INDEX:
mdb.HashInputs(m.Message, arg)
default:
@ -89,15 +76,14 @@ func (s Table) InputsListRole(m *ice.Message, list ice.Any, arg ...string) {
}
m.SortInt(arg[0]).DisplayInputKeyNameIconTitle()
}
func (s Table) List(m *ice.Message, arg ...string) *ice.Message {
func (s Table) List(m *ice.Message, arg ...string) {
if m.IsTech() {
if len(arg) == 0 {
s.Select(m)
} else if len(arg) == 2 {
s.Select(m, model.UID, arg[1])
s.SelectDetail(m, model.UID, arg[1])
}
}
return m
}
func (s Table) TablesWithRole(m *ice.Message, arg []string, userPlace UserPlacer, place Placer, target Placer, fields ...ice.Any) *ice.Message {
s.Tables(m, kit.JoinWord("INNER JOIN", s.TableName(kit.TypeName(userPlace)),
@ -112,7 +98,6 @@ func (s Table) TablesWithRole(m *ice.Message, arg []string, userPlace UserPlacer
} else {
return m
}
userPlace.RewriteAppend(m)
return s.SelectJoinUser(m)
}
func (s Table) Select(m *ice.Message, arg ...string) *ice.Message {
@ -135,10 +120,16 @@ func (s Table) RenameAppend(m *ice.Message, arg ...string) Table {
}
func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
m.RewriteAppend(func(value, key string, index int) string {
kit.If(key == model.PLACE_TYPE, func() { value = PlaceType(kit.Int(value)).String() })
kit.If(key == model.USER_PLACE_ROLE, func() { value = UserPlaceRole(kit.Int(value)).String() })
kit.If(key == model.ALLOW_STATUS, func() { value = OrderStatus(kit.Int(value)).String() })
kit.If(key == model.APPLY_STATUS, func() { value = ApplyStatus(kit.Int(value)).String() })
switch key {
case model.USER_PLACE_ROLE:
value = UserPlaceRole(kit.Int(value)).String()
case model.PLACE_TYPE:
value = PlaceType(kit.Int(value)).String()
case model.APPLY_STATUS:
value = ApplyStatus(kit.Int(value)).String()
case model.ALLOW_STATUS:
value = OrderStatus(kit.Int(value)).String()
}
return value
})
return m
@ -181,9 +172,10 @@ func (s Table) AddRecent(m *ice.Message, arg ...string) {
cmd := m.GetCommand()
m.Cmd(recent{}, s.Create, mdb.NAME, cmd.Help, mdb.ICON, m.Resource(kit.Select(ice.Info.NodeIcon, cmd.Icon)), web.SPACE, m.Option(ice.MSG_USERPOD), ctx.INDEX, m.PrefixKey(), ctx.ARGS, kit.Join(arg))
}
func (s Table) SendMessage(m *ice.Message, to_user_uid string, arg ...string) {
func (s Table) SendMessage(m *ice.Message, place_name, to_user_uid string, arg ...string) {
cmd := m.GetCommand()
m.Cmd(message{}, s.Create, model.TO_USER_UID, to_user_uid, mdb.NAME, cmd.Help, mdb.ICON, cmd.Icon, web.SPACE, m.Option(ice.MSG_USERPOD), ctx.INDEX, m.PrefixKey(), ctx.ARGS, kit.Join(arg))
m.Cmd(message{}, s.Create, model.TO_USER_UID, to_user_uid, model.PLACE_NAME, place_name,
mdb.NAME, cmd.Help, mdb.ICON, cmd.Icon, web.SPACE, m.Option(ice.MSG_USERPOD), ctx.INDEX, m.PrefixKey(), ctx.ARGS, kit.Join(arg))
}
func (s Table) SendTemplate(m *ice.Message, from, user_uid, title string, arg ...string) {
if m.IsErr() {
@ -193,11 +185,8 @@ func (s Table) SendTemplate(m *ice.Message, from, user_uid, title string, arg ..
if name == "" {
name = m.Option(s.Keys(s.Place, model.NAME)) + " " + s.Place.TransValue(m, s.Keys(s.UserPlace, model.ROLE))
}
uid := kit.Select(m.Option(model.UID), arg, 1)
place_uid := kit.Select("", arg, 2)
if place_uid == "" {
place_uid = m.Option(s.Keys(s.Place, model.UID))
}
uid, place_uid := kit.Select(m.Option(model.UID), arg, 1), kit.Select("", arg, 2)
kit.If(place_uid == "", func() { place_uid = m.Option(s.Keys(s.Place, model.UID)) })
link := Portal{}.Link(m, place_uid, m.PrefixKey(), uid)
m.Cmd(user{}, s.SendTemplate, from, user_uid, link, title, name, kit.Cut(uid, 6))
}
@ -211,8 +200,7 @@ func (s Table) Display(m *ice.Message, file string) *ice.Message {
if s.Street != nil {
m.Option("_street_name", s.ToLower(kit.TypeName(s.Street))+"_name")
}
base := path.Dir(kit.FileLine(1, 100))
sub := path.Dir(kit.FileLine(-1, 100))
base, sub := path.Dir(kit.FileLine(1, 100)), path.Dir(kit.FileLine(-1, 100))
return m.Display(kit.Format(mdb.Cache(m.Message, kit.Keys(m.PrefixKey(), ctx.DISPLAY, file), func() ice.Any {
if file == "" {
file = m.Resource(path.Join(sub, m.CommandKey()+".js"))
@ -231,10 +219,7 @@ func (s Table) Link(m *ice.Message, arg ...string) string {
return Portal{}.Link(m, arg...)
}
type Tables struct {
Table
portal string `data:"true"`
}
type Tables struct{ Table }
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
@ -266,17 +251,18 @@ func PortalCmd(portal ice.Any) {
cmd.Actions[ice.CTX_INIT].Hand = icebergs.MergeHand(cmd.Actions[ice.CTX_INIT].Hand, func(m *icebergs.Message, arg ...string) {
ice.LoadTrans(m.Spawn(kit.Dict("_template", path.Join(path.Dir(base), "portal.json"))), m.CommandKey(), cmd)
ice.LoadTrans(m, m.CommandKey(), cmd)
mdb.Config(m, db.DOMAIN, "gonganxitong")
})
}
table := portal.(interface{ getTable() Table }).getTable()
cmd("portal", portal)
cmd("qrcode", qrcode{Tables: Tables{Table: table}})
cmd("event", event{Table: table})
cmd("apply", apply{Table: table})
cmd("allow", allow{Table: table})
cmd("event", event{Table: table})
cmd("member", placeUser{Tables: Tables{Table: table}})
cmd("service", service{Table: table})
cmd("recent", recent{})
cmd("message", message{})
cmd("recent", recent{})
cmd("service", service{Table: table})
cmd("support", support{})
}

View File

@ -1,16 +1,14 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { can.onimport.shareTitle && can.onimport.shareTitle(can, msg)
var PLACE_NAME = msg.Option("_place_name"), PLACE_TYPE = msg.Option("_place_type"), USER_PLACE_ROLE = msg.Option("_user_place_role")
can.onimport.itemcards(can, msg, function(value) { value._style = [value[PLACE_TYPE]||"", value[USER_PLACE_ROLE]||""]
return [
{view: html.TITLE, list:[{text: [value.title||value.name||value.user_name]},
can.onimport.textView(can, value, PLACE_TYPE, mdb.TYPE), can.onimport.textView(can, value, USER_PLACE_ROLE, aaa.ROLE),
]},
{view: html.STATUS, list: [value.uid && {text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at||value.updated_at)}]},
value.address && {view: html.STATUS, list: [{text: value.address}]},
value.content && {view: html.OUTPUT, list: [{text: value.content}]},
value.info && {view: html.OUTPUT, list: [{text: value.info}]},
]
})
can.onimport.itemcards(can, msg, function(value) { return [
{view: html.TITLE, list:[value.title||value.name||value.user_name,
can.onimport.textView(can, value, PLACE_TYPE, mdb.TYPE), can.onimport.textView(can, value, USER_PLACE_ROLE, aaa.ROLE),
]},
{view: html.STATUS, list: [value.uid && value.uid.slice(0, 6), can.base.TimeTrim(value.created_at||value.updated_at)]},
value.address && {view: html.STATUS, list: [value.address]},
value.content && {view: html.OUTPUT, list: [value.content]},
value.info && {view: html.OUTPUT, list: [value.info]},
] })
},
})

View File

@ -10,11 +10,9 @@ import (
type event struct {
Table
user user
order string `data:"2"`
role string `data:"creator"`
portal string `data:"true"`
domain string `data:"gonganxitong"`
user user
order string `data:"91"`
role string `data:"creator"`
}
func (s event) List(m *ice.Message, arg ...string) {

View File

@ -1,11 +1,9 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.itemcards(can, msg, function(value) {
return [
{view: html.TITLE, list: [{text: value.user_name}]},
{view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at)}]},
{view: html.OUTPUT, list: [{text: value.info}]},
]
})
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
can.onimport.itemcards(can, msg, function(value) { return [
{view: html.TITLE, list: [value.user_name]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at)]},
{view: html.OUTPUT, list: [value.info]},
] })
},
})

View File

@ -1,8 +0,0 @@
package express
import (
"shylinux.com/x/community/src/gonganxitong"
_ "shylinux.com/x/community/src/gonganxitong/express/model"
)
type Table struct{ gonganxitong.Table }

View File

@ -1,7 +0,0 @@
{
"express": "收发快递",
"icons": {
"express": "https://img.icons8.com/officel/80/shipped.png"
},
"value": {}
}

View File

@ -1,14 +0,0 @@
package express
import "shylinux.com/x/ice"
type express struct {
Table
portal string `data:"true"`
}
func (s express) List(m *ice.Message, arg ...string) {
m.Echo("hello world")
}
func init() { ice.TeamCtxCmd(express{}) }

View File

@ -1,12 +0,0 @@
package model
import "shylinux.com/x/mysql-story/src/db"
type Express struct {
db.ModelWithUID
FromPlaceUID string `gorm:"type:char(32);index"`
ToPlaceUID string `gorm:"type:char(32);index"`
Status uint8
}
func init() { db.CmdModels("", &Express{}) }

View File

@ -9,19 +9,16 @@ import (
type message struct {
Table
order string `data:"100"`
portal string `data:"true"`
domain string `data:"gonganxitong"`
read string `name:"read" role:"void"`
done string `name:"done" role:"void"`
order string `data:"100"`
read string `name:"read" role:"void"`
done string `name:"done" role:"void"`
}
func (s message) Create(m *ice.Message, arg ...string) {
s.Table.Create(m, kit.Simple(arg, model.FROM_USER_UID, m.Option(model.USER_UID))...)
}
func (s message) List(m *ice.Message, arg ...string) {
s.Select(m, model.TO_USER_UID, m.Option(model.USER_UID))
m.Table(func(value ice.Maps) {
s.Select(m, model.TO_USER_UID, m.Option(model.USER_UID)).Table(func(value ice.Maps) {
switch MessageStatus(kit.Int(value[model.STATUS])) {
case MessageCreate:
m.PushButton(s.Read, s.Done)
@ -30,8 +27,7 @@ func (s message) List(m *ice.Message, arg ...string) {
default:
m.PushButton()
}
})
m.Action()
}).Action()
}
func (s message) Read(m *ice.Message, arg ...string) {
s.Table.Update(m, kit.Dict(model.STATUS, MessageRead), m.OptionSimple(model.TO_USER_UID, model.UID)...)

View File

@ -1,11 +1,9 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
can.onimport.itemcards(can, msg, function(value) { return [
{view: html.TITLE, list: [{text: value.name}]},
{view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at)}, {text: value.user_name}]},
{view: html.OUTPUT, list: [{text: value.info}]},
] }, function(event, value) { var args = can.core.Split(value.args)
can.onimport._option(can, args[1], value.index, args[0])
})
{view: html.TITLE, list: [value.name]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]},
{view: html.OUTPUT, list: [value.info]},
] }, function(event, value) { can.onimport.float(can, value) })
},
})

View File

@ -10,6 +10,7 @@ const (
TYPE = "type"
ROLE = "role"
STATUS = "status"
TITLE = "title"
CONTENT = "content"
OPERATOR = "operator"
CREATED_AT = "created_at"
@ -33,8 +34,8 @@ const (
APPLY_STATUS = "apply_status"
ALLOW_UID = "allow_uid"
ALLOW_STATUS = "allow_status"
TO_USER_UID = "to_user_uid"
FROM_USER_UID = "from_user_uid"
TO_USER_UID = "to_user_uid"
BEGIN_TIME = "begin_time"
END_TIME = "end_time"
OPERATE = "operate"
@ -61,7 +62,7 @@ type UserPlace struct {
db.ModelWithUID
UserUID string `gorm:"type:char(32);index"`
PlaceUID string `gorm:"type:char(32);index"`
Role uint8
Role uint8 `gorm:"default:0"`
BeginTime db.Time
EndTime db.Time
}
@ -70,26 +71,26 @@ type Place struct {
StreetUID string `gorm:"type:char(32);index"`
Name string `gorm:"type:varchar(64)"`
Address string `gorm:"type:varchar(255)"`
Type uint8
Type uint8 `gorm:"default:0"`
}
type Street struct {
db.ModelWithUID
CityUID string `gorm:"type:char(32);index:idx_city"`
Name string `gorm:"type:char(64);index:idx_city"`
Name string `gorm:"type:varchar(64);index:idx_city"`
Info string
}
type City struct {
db.ModelWithUID
Name string `gorm:"type:char(64);index"`
Name string `gorm:"type:varchar(64);index"`
}
type Event struct {
db.ModelWithUID
PlaceUID string `gorm:"type:char(32);index:idx_place"`
UserUID string `gorm:"type:char(32);index:idx_place"`
Index string `gorm:"type:varchar(32)"`
Index string `gorm:"type:varchar(64)"`
Operate string `gorm:"type:varchar(32)"`
Args string `gorm:"type:varchar(32)"`
Args string `gorm:"type:varchar(128)"`
Info string `gorm:"type:varchar(255)"`
}
type Apply struct {
@ -97,45 +98,22 @@ type Apply struct {
PlaceUID string `gorm:"type:char(32);index:idx_place"`
UserUID string `gorm:"type:char(32);index:idx_place"`
Tables string `gorm:"type:varchar(32)"`
Status uint8
Role uint8
Status uint8 `gorm:default:0`
Role uint8 `gorm:default:0`
BeginTime db.Time
EndTime db.Time
}
type Allow struct {
db.ModelWithUID
UserUID string `gorm:"type:char(32);index"`
ApplyUID string `gorm:"type:char(32);index"`
Status uint8
}
type Service struct {
db.ModelWithUID
Icon string `gorm:"type:varchar(32)"`
Name string `gorm:"type:varchar(32)"`
Index string `gorm:"type:varchar(32)"`
Hostname string `gorm:"type:varchar(32)"`
Pathname string `gorm:"type:varchar(255)"`
Nodename string `gorm:"type:varchar(32)"`
Nodetype string `gorm:"type:varchar(32)"`
Portal string `gorm:"type:varchar(255)"`
Domain string `gorm:"type:varchar(255)"`
Module string `gorm:"type:varchar(32)"`
Version string `gorm:"type:varchar(32)"`
}
type Recent struct {
db.ModelWithUID
UserUID string `gorm:"type:char(32);index"`
Name string `gorm:"type:varchar(32)"`
Icon string `gorm:"type:varchar(128)"`
Space string `gorm:"type:varchar(32)"`
Index string `gorm:"type:varchar(64)"`
Args string `gorm:"type:varchar(128)"`
UserUID string `gorm:"type:char(32)"`
Status uint8 `gorm:"default:0"`
}
type Message struct {
db.ModelWithUID
FromUserUID string `gorm:"type:char(32);index"`
ToUserUID string `gorm:"type:char(32);index"`
PlaceName string `gorm:"type:varchar(32)"`
Name string `gorm:"type:varchar(32)"`
Icon string `gorm:"type:varchar(128)"`
Space string `gorm:"type:varchar(32)"`
@ -143,7 +121,39 @@ type Message struct {
Args string `gorm:"type:varchar(128)"`
Status uint `gorm:"default:0"`
}
type Recent struct {
db.ModelWithUID
UserUID string `gorm:"type:char(32);index"`
Icon string `gorm:"type:varchar(128)"`
Name string `gorm:"type:varchar(32)"`
Space string `gorm:"type:varchar(32)"`
Index string `gorm:"type:varchar(64)"`
Args string `gorm:"type:varchar(128)"`
}
type Service struct {
db.ModelWithUID
Icon string `gorm:"type:varchar(128)"`
Name string `gorm:"type:varchar(32)"`
Index string `gorm:"type:varchar(64)"`
Module string `gorm:"type:varchar(32)"`
Version string `gorm:"type:varchar(32)"`
Domain string `gorm:"type:varchar(255)"`
Portal string `gorm:"type:varchar(255)"`
Nodename string `gorm:"type:varchar(32)"`
Nodetype string `gorm:"type:varchar(32)"`
Pathname string `gorm:"type:varchar(255)"`
Hostname string `gorm:"type:varchar(32)"`
}
type Support struct {
db.ModelWithUID
FromUserUID string `gorm:"type:char(32);index"`
ToUserUID string `gorm:"type:char(32);index"`
Content string
}
func init() {
db.CmdModels("", &Sess{}, &User{}, &UserPlace{}, &Place{}, &Street{}, &City{}, Event{}, Apply{}, Allow{}, Service{}, Recent{}, Message{})
db.CmdModels("",
&Sess{}, &User{}, &UserPlace{}, &Place{}, &Street{}, &City{},
Event{}, Apply{}, Allow{}, Message{}, Recent{}, Service{}, Support{},
)
}

View File

@ -3,12 +3,11 @@ package gonganxitong
import "shylinux.com/x/ice"
type placeUser struct {
order string `data:"5"`
Tables
order string `data:"80"`
}
func (s placeUser) List(m *ice.Message, arg ...string) {
s.Display(m, "")
m.Cmdy(s.UserPlace, s.UserPlace.User, arg).Action()
}

View File

@ -1,69 +1,48 @@
$output { background-color:var(--plugin-bg-color); }
$output>div>div.list {background-color:var(--output-bg-color); padding:10px; overflow-x:hidden; position:relative; }
// $output>div.list.myplace { position:sticky; top:10px; }
// $output>div.action { position:sticky; bottom:10px; }
$output>div.output>div.list:last-child { margin-bottom:0; }
$output>div>div.list { border-radius:10px; margin:10px; }
$output>div>div.list { border-radius:10px; background-color:var(--output-bg-color); padding:10px; margin:10px; }
$output>div>div.list>div.title { font-weight:bold; display:flex; align-items:center; }
$output>div>div.list>div.title span:first-child { flex-grow:1; }
$output>div>div.list>div.title div.action div.item { margin-right:5px; }
$output>div>div.list>div.title div.action div.item.button.icons input { display:none; }
$output>div>div.list>div.role:not(.hide) { display:flex; align-items:center; justify-content:space-around; }
$output>div>div.list>div.role span { padding:5px; cursor:pointer; }
$output>div>div.list>div.role span.select { border-bottom:var(--box-notice3); }
$output>div>div.list>div.output>div.item.index { padding:10px; display:flex; flex-direction:column; align-items:center; float:left; }
$output>div>div.list>div.output>div.item.index.hide { display:none; }
$output>div>div.list>div.role span.select { border-bottom:var(--box-notice); }
$output>div>div.list>div.output>div.item.index:not(.hide) { padding:10px; display:flex; flex-direction:column; align-items:center; float:left; }
$output>div>div.list>div.output>div.item.index img { width:100%; }
// $output>div.list>div.output { max-height:400px; }
$output>div>div.list>div.action { display:flex; justify-content:center; }
$output>div>div.list>div.action div.item { margin-right:5px; }
$output>div>div.list>div.action div.item input[type=button] { color:var(--notice-bg-color); border:none; }
$output>div>div.list>div.action div.item i { display:none; }
$output>div.output>div.list:last-child { margin-bottom:0; }
$output>div.action div.item.button { margin-right:5px; }
$output>div.action div.item.button input { border:none; color:var(--notice-bg-color); min-width:60px; float:left; }
// $output>div.action div.item.button input[name=create] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
// $output>div.action div.item.button input[name=create] { border:var(--box-notice); }
$output>div.action div.item.button input:hover { background-color:var(--hover-bg-color); }
$output>div.action div.item.button i { display:none; }
$output>div.action div.item.button span { display:none; }
$output>fieldset table.content td { box-shadow:none; }
$output>div.action div.item.button i { display:none; }
$output span.type { border:var(--box-notice); color:var(--notice-bg-color); padding:0 3px; }
$output span.role { border:var(--box-notice); color:var(--notice-bg-color); padding:0 3px; }
// $output span.status { border:var(--box-notice); color:var(--notice-bg-color); }
$output fieldset>div.output>div.code>img { display:block; margin:auto; }
$output fieldset>div.output>div.code { text-align:center; }
$output span.type.danger { border:var(--box-danger); color:var(--danger-bg-color); }
$output span.role.danger { border:var(--box-danger); color:var(--danger-bg-color); }
$output span.status.danger { border:var(--box-danger); color:var(--danger-bg-color); }
// $output span.status.expire { border:var(--box-danger); color:var(--danger-bg-color); }
$output table.content.detail tr.action input.icons { display:unset; }
$output table.content.detail tr.action i { display:none; }
$output table.content td.action i { display:none; }
$output table.content td.action input.icons { display:unset; }
$output fieldset.form>div.output>div.code>input[type=button] {
font-size:18px; margin:10px; height:36px;
}
$output fieldset>div.output>div.code>input[type=button] {
background-color:var(--notice-bg-color); color:var(--notice-fg-color);
margin-right:10px; min-width:80px; float:right;
}
$output fieldset>div.output>div.code>input[type=button].danger {
background-color:var(--danger-bg-color); color:var(--danger-fg-color);
}
$output fieldset>div.output>div.code>input[type=button][name=cancel] {
background-color:var(--danger-bg-color); color:var(--danger-fg-color);
}
body.en $output>fieldset table.content td:first-child { max-width:180px; width:unset;}
$output>fieldset table.content tr.uid { display:none; }
$output>fieldset table.content tr.order_uid { display:none; }
$output>fieldset table.content tr.place_uid { display:none; }
$output>fieldset table.content tr.group_uid { display:none; }
$output>fieldset table.content tr.class_uid { display:none; }
$output>fieldset table.content td img { max-width:100%; }
$output table.content td.action i { display:none; }
$output fieldset.form>div.output>div.code>input[type=button] { font-size:18px; margin:10px; height:36px; }
$output fieldset>div.output>div.code>input[type=button] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); margin-right:10px; min-width:80px; float:right; }
$output fieldset>div.output>div.code>input[type=button].danger { background-color:var(--danger-bg-color); color:var(--danger-fg-color); }
$output fieldset>div.output>div.code>input[type=button][name=cancel] { background-color:var(--danger-bg-color); color:var(--danger-fg-color); }
$output fieldset.story fieldset.story { position:absolute; top:0; }
$output fieldset.story { box-shadow:none; }
$output fieldset.story>div.output { background-color:var(--plugin-bg-color); }
$output fieldset.story>div.output table.content td { box-shadow:none; }
$output fieldset.story>div.output table.content tr.uid { display:none; }
$output fieldset.story>div.output table.content td img { max-width:100%; }
$output>fieldset.story>div.output div.item.card>div.output { padding:10px; }
$output>fieldset.story>div.output div.item.card>div.output div.output { padding:10px 0; white-space:pre-line; }
$output fieldset.story>div.output>div.code { text-align:center; }
$output fieldset.story>div.output>div.code>img { display:block; margin:auto; }
$output>fieldset.qrcode table.content td { text-align:center; }
$output>fieldset.qrcode div.code { text-align:center; }
$output>fieldset.story { box-shadow:none; }
$output>fieldset.story>div.output { background-color:var(--plugin-bg-color); }
body:not(.mobile) $output>fieldset.story>div.output div.item.card:not(:hover) { background-color:var(--output-bg-color); }
$output>fieldset.story>div.output div.item.card>div.output { padding:10px; }
$output>fieldset.story>div.output div.item.card>div.output div.output { padding:10px 0; white-space:pre-line; }
body.en $output>fieldset table.content td:first-child { max-width:180px; width:unset;}

View File

@ -12,16 +12,15 @@ import (
)
type Portal struct {
ice.Hash
Table
ice.Hash
user user
city city
service service
export string `data:"true"`
short string `data:"index"`
field string `data:"time,name,icons,index,order,enable,type,role,view"`
list string `name:"list place_uid index uid auto" role:"void"`
field string `data:"time,index,name,icons,order,enable,type,role,view"`
create string `name:"create index name icons"`
list string `name:"list place_uid index uid auto" role:"void"`
placeCreate string `name:"placeCreate city_name* street_name* place_type*:select place_name* address*" icon:"bi bi-plus-square-dotted" role:"void"`
placeRemove string `name:"placeRemove uid*" role:"void"`
scanQRCode string `name:"scanQRCode type text" icon:"bi bi-qr-code-scan" role:"void"`
@ -38,9 +37,9 @@ func (s Portal) Exit(m *ice.Message, arg ...string) {
func (s Portal) BeforeMigrate(m *ice.Message, arg ...string) {
}
func (s Portal) AfterMigrate(m *ice.Message, arg ...string) {
cmd := m.GetCommand()
m.GoSleep("30ms", func() {
cmd := m.Target().Commands[m.CommandKey()]
m.Cmdy(s.service, s.Table.Update, mdb.NAME, cmd.Help, mdb.ICON, kit.Select(ice.Info.NodeIcon, cmd.Icon), ctx.INDEX, m.PrefixKey())
m.Cmdy(service{}, s.Table.Update, ctx.INDEX, m.PrefixKey(), mdb.NAME, cmd.Help, mdb.ICON, m.Resource(kit.Select(ice.Info.NodeIcon, cmd.Icon)))
})
}
func (s Portal) Inputs(m *ice.Message, arg ...string) {
@ -48,14 +47,14 @@ func (s Portal) Inputs(m *ice.Message, arg ...string) {
}
func (s Portal) Run(m *ice.Message, arg ...string) {
m.Search(arg[0], func(key string, cmd *ice.Command) {
role := cmd.Role
sub, role := "", cmd.Role
if len(arg) > 1 && arg[1] == ctx.ACTION {
if action, ok := cmd.Actions[arg[2]]; ok {
role = action.Role
sub, role = arg[2], action.Role
}
} else {
if action, ok := cmd.Actions[arg[1]]; ok {
role = action.Role
sub, role = arg[1], action.Role
}
}
if kit.IsIn(role, "", aaa.VOID) {
@ -65,26 +64,27 @@ func (s Portal) Run(m *ice.Message, arg ...string) {
m.Cmdy(arg)
}
}
s.Place.RewriteAppend(m)
if sub != mdb.INPUTS {
s.Place.RewriteAppend(m)
}
})
}
func (s Portal) List(m *ice.Message, arg ...string) {
if m.Option(mdb.VIEW) == mdb.TABLE {
s.Hash.List(m, arg...).PushAction(mdb.DETAIL, s.SetIcons, s.Remove).SortInt(mdb.ORDER)
s.Hash.List(m, arg...).PushAction(mdb.DETAIL, s.Remove).SortInt(mdb.ORDER)
return
}
if len(arg) == 0 {
s.AddRecent(m)
m.Cmdy(s.UserPlace, m.Option(model.USER_UID)).PushAction(s.PlaceRemove).Action(s.PlaceCreate, s.ScanQRCode)
kit.If(!m.IsErr() && m.Length() == 0, func() {
m.EchoInfoButton(m.Trans("Please Create Your Place", "请添加场所"), s.PlaceCreate, s.ScanQRCode)
})
kit.If(!m.IsErr() && m.Length() == 0, func() { m.EchoInfoButton("", s.PlaceCreate, s.ScanQRCode) })
} else if len(arg) == 1 {
msg := m.Cmd(s.Place, s.Table.Select, model.UID, arg[0])
s.AddRecent(m.Spawn(), arg[0], msg.Append(model.NAME), msg.Append(mdb.ICONS))
s.Hash.List(m).SortInt(mdb.ORDER)
} else if len(arg) == 2 {
msg := m.Cmd(s.Place, s.Place.Select, model.UID, arg[0])
msg := m.Cmd(s.Place, s.Table.Select, model.UID, arg[0])
m.Option(s.Keys(s.Place, model.NAME), msg.Append(model.NAME))
m.Cmdy(ctx.COMMAND, arg[1]).Push(ctx.ARGS, arg[0])
} else if len(arg) == 1 {
s.Hash.List(m, arg[1:]...).SortInt(mdb.ORDER)
} else {
m.FieldsSetDetail().Cmdy(arg[1], mdb.SELECT, model.UID, arg[2]).PushAction().Action()
}
@ -104,41 +104,32 @@ func (s Portal) PlaceCreate(m *ice.Message, arg ...string) {
if m.Cmdy(s.Place, s.Create, arg[2:]).IsErr() {
return
}
s.RecordEvent(m, m.Result(), m.Trans("create place", "创建服务场景")+" "+name, m.Result())
args := kit.Simple(m.OptionSimple(model.USER_UID), s.Keys(s.Place, model.UID), m.Result(), model.ROLE, UserPlaceCreator)
m.SetResult().Cmdy(s.UserPlace, s.Create, args).ProcessRefresh()
m.Cmd(s.user, s.SendTemplate, "", "", s.Link(m, m.Result()), m.Trans("create place", "创建服务场景"), name, m.Result())
s.RecordEventWithName(m.Options(mdb.NAME, name), m.Result(), "")
args := kit.Simple(s.Keys(s.Place, model.UID), m.Result(), m.OptionSimple(model.USER_UID), model.ROLE, UserPlaceCreator)
m.SetResult().Cmdy(s.UserPlace, s.Create, args)
}
func (s Portal) PlaceRemove(m *ice.Message, arg ...string) {
defer m.ToastProcess()()
m.Cmdy(s.UserPlace, s.Delete, m.OptionSimple(model.UID)).ProcessRefresh()
m.Cmd(s.user, s.SendTemplate, "", "", s.Link(m, m.Result()), m.Trans("remove place", "删除服务场景"), m.Option("_name"), m.Option(model.UID))
m.Cmdy(s.UserPlace, s.Delete, m.OptionSimple(model.USER_UID, model.UID))
}
func (s Portal) ScanQRCode(m *ice.Message, arg ...string) {
defer m.ToastProcess()()
if m.Option(mdb.TYPE) == mdb.TEXT {
args := kit.Simple(m.OptionSimple(model.USER_UID), s.Key(s.Place, model.UID), m.Option(mdb.TEXT))
m.Cmdy(s.UserPlace, s.Create, args, model.ROLE, UserPlaceVisitor)
m.Cmdy(s.UserPlace, s.Create, s.Key(s.Place, model.UID), m.Option(mdb.TEXT), m.OptionSimple(model.USER_UID), model.ROLE, UserPlaceVisitor)
} else if m.Option(mdb.TYPE) == web.LINK {
args := m.ParseURL(m.Option(mdb.TEXT))
if len(args) > 1 && args[1] == m.Prefix("apply") {
args := kit.Simple(m.OptionSimple(model.USER_UID), s.Keys(s.Place, model.UID), args[0])
m.Cmdy(s.UserPlace, s.Create, args, model.ROLE, UserPlaceVisitor)
m.Cmdy(s.UserPlace, s.Create, s.Keys(s.Place, model.UID), args[0], m.OptionSimple(model.USER_UID), model.ROLE, UserPlaceVisitor)
}
}
}
func (s Portal) SetIcons(m *ice.Message, arg ...string) {
s.Hash.Modify(m, arg...)
}
func init() { ice.TeamCtxCmd(Portal{Table: newTable()}) }
func (s Portal) Create(m *ice.Message, arg ...string) {
args := []string{ctx.INDEX, m.Option(ctx.INDEX)}
msg := s.Hash.Select(m.Spawn(), m.Option(ctx.INDEX))
if msg.Length() > 0 {
args = append(args, mdb.TIME, msg.Append(mdb.TIME))
}
kit.If(msg.Length() > 0, func() { args = append(args, mdb.TIME, msg.Append(mdb.TIME)) })
m.Search(m.Option(ctx.INDEX), func(key string, cmd *ice.Command) {
args = append(args, mdb.NAME, cmd.Help, mdb.ICONS, cmd.Icon)
kit.For([]string{mdb.ORDER, mdb.TYPE, aaa.ROLE, mdb.VIEW}, func(key string) {
@ -153,13 +144,7 @@ func (s Portal) Show(m *ice.Message, arg ...string) {
m.GoSleep("300ms", func() { m.Cmd(m.Prefix(web.PORTAL), s.Create, ctx.INDEX, key) })
}
func (s Portal) Link(m *ice.Message, arg ...string) string {
return m.MergePodCmd("", m.Prefix(web.PORTAL)) + "?debug=true" +
"#" + kit.TrimSuffix(kit.Join([]string{arg[0], kit.Select(m.Prefix("apply"), arg, 1), kit.Select("", arg, 2)}, ":"), ":")
return m.MergePodCmd("", m.Prefix(web.PORTAL)) + "#" + kit.TrimSuffix(kit.Join([]string{arg[0], kit.Select(m.Prefix("apply"), arg, 1), kit.Select("", arg, 2)}, ":"), ":")
}
type portal struct {
Portal
name string `data:"公安系统"`
}
func init() { ice.TeamCtxCmd(portal{Portal: Portal{Table: newTable()}}) }
func init() { ice.TeamCtxCmd(Portal{Table: newTable()}) }

View File

@ -5,15 +5,16 @@ Volcanos(chat.ONIMPORT, {
can.isCmdMode() && can.user.isMobile && can.onmotion.delay(can, function() { can.sup.onimport.size(can.sup, window.innerHeight, window.innerWidth) })
can.isCmdMode() && can.user.isMobile && can.onmotion.delay(can, function() { can.sup.onimport.size(can.sup, window.innerHeight, window.innerWidth) }, 300)
can.onimport.myPortal(can, msg)
// can.page.Append(can, can._output, [{type: "a", href: "tel:10086", inner: "10086"}])
},
layout: function(can) {
can.ui.action && can.onmotion.delay(can, function() { can.page.style(can, can.ui.output, html.HEIGHT, can.ConfHeight() - can.ui.action.offsetHeight) })
},
myValue: function(can, value) {
return [
{view: html.TITLE, list: [{text: value._name},
{text: [value.__type, "", [mdb.TYPE, value._type, value._type_style]]},
{view: html.TITLE, list: [value._name, {text: [value.__type, "", [mdb.TYPE, value._type, value._type_style]]},
value._role != "visitor" && {text: [value.__role, "", [aaa.ROLE, value._role, value._role_style]]},
]},
{view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: value.city_name}, {text: value._street}]},
{view: html.STATUS, list: [value.uid.slice(0, 6), value.city_name, value._street]},
]
},
myPortal: function(can, msg) {
@ -23,22 +24,20 @@ Volcanos(chat.ONIMPORT, {
if (can.Option(PLACE_UID) == "") {
if (can.db.hash.length > 1 && can.db.hash[0]) { return can.Option(PLACE_UID, can.db.hash[0]), can.Option(ctx.INDEX, can.db.hash[1]), can.Update() }
can.ui = can.page.Append(can, can._output, [
{view: "output", list: ["myplace.list", "myindex.list"]},
{view: "action", list: ["myorder.list"]},
{view: html.OUTPUT, list: ["myplace.list", "myindex.list"]},
{view: html.ACTION, list: ["myorder.list"]},
])
can.page.Append(can, can.ui.myplace, [{view: html.TITLE, list: [
{text: can.user.trans(can, "My "+can.base.capital(PLACE_NAME.replace("_name", "")), null, html.INPUT)},
{view: html.ACTION, _init: function(target) { msg.Option(ice.MSG_ACTION) && can.onappend._action(can, msg.Option(ice.MSG_ACTION), target) }}
]}])
var uid = can.onimport.myPlace(can, msg, can.ui.myplace, PLACE_UID, PLACE_NAME, PLACE_TYPE)
can.ui.place_count = msg.Length()
msg.Length() > 0 && can.run({}, [uid], function(msg) {
can.page.Append(can, can.ui.myindex, [{view: html.TITLE, list: [{text: can.user.trans(can, "My Index", "我的应用")}]}])
can.onimport.myIndex(can, msg, can.ui.myindex, PLACE_UID, USER_PLACE_ROLE)
can.onimport.selectIndex(can, can.sup.current)
can.onimport.myIndex(can, msg, can.ui.myindex, PLACE_UID, USER_PLACE_ROLE), can.onimport.selectIndex(can, can.sup.current)
can.page.Append(can, can.ui.myorder, [{view: html.TITLE, list: [{text: can.user.trans(can, "My Order", "我的系统")}]}])
can.onimport.myOrder(can, msg, can.ui.myorder, PLACE_UID, USER_PLACE_ROLE)
})
}), can.ui.place_count = msg.Length()
} else {
can.onimport.myData(can, msg, can._output, PLACE_UID, PLACE_NAME)
}
@ -64,8 +63,7 @@ Volcanos(chat.ONIMPORT, {
},
myList: function(can, msg, target, PLACE_UID, USER_PLACE_ROLE) {
var width = (can.ConfWidth()-40)/parseInt((can.ConfWidth()-40)/100), height = width+20; can.user.isMobile && !can.user.isLandscape() && (width = (can.ConfWidth()-40)/4, height = width+20)
return can.page.Append(can, target||can._output, msg.Table(function(value) {
// if (value.enable != ice.TRUE) { return }
can.page.Append(can, target, msg.Table(function(value) { if (value.order < 100 && value.enable != ice.TRUE) { return }
return {view: [[html.ITEM, ctx.INDEX].concat(
value.type? [mdb.TYPE]: [], can.core.Split(value.type||""),
value.role? [aaa.ROLE]: [], can.core.Split(value.role||""),
@ -75,35 +73,29 @@ Volcanos(chat.ONIMPORT, {
can.page.ClassList.del(can, can._fields, "_back"), can.page.ClassList.add(can, can._fields, "_goto")
can.Option(PLACE_UID, can.onexport.session(can, PLACE_UID)), can.Option(ctx.INDEX, value.index), can.Update()
}}
}))._target
}))
},
myIndex: function(can, msg, target, PLACE_UID, USER_PLACE_ROLE) {
var role = can.page.Append(can, target, [{view: aaa.ROLE, list: can.core.Item(can.Conf("_trans.value."+USER_PLACE_ROLE), function(key, value) {
if (key == "style") { return }
if (can.base.isIn(key, ctx.STYLE, mdb.ICONS)) { return }
return {text: [can.user.trans(can, key, value), "", key], onclick: function(event) {
can.onimport.selectIndex(can, can.sup.current, key)
can.onmotion.select(can, role, html.SPAN, event.target)
can.onimport.selectIndex(can, can.sup.current, key), can.onmotion.select(can, role, html.SPAN, event.target)
}}
}) }])._target; can.ui.role = role
var _msg = can.request()
var _msg = can.request(); msg.Table(function(value) { if (value.order < 99) { _msg.Push(value) } })
var output = can.page.Append(can, target, [html.OUTPUT])._target
msg.Table(function(value) { if (value.order < 99) { _msg.Push(value) } })
can.onimport.myList(can, _msg, output, PLACE_UID, USER_PLACE_ROLE)
can.onmotion.delay(can, function() {
can.page.style(can, can.ui.output, html.HEIGHT, can.ConfHeight() - can.ui.action.offsetHeight)
})
can.onmotion.delay(can, function() { can.page.style(can, can.ui.output, html.HEIGHT, can.ConfHeight() - can.ui.action.offsetHeight) })
},
myOrder: function(can, msg, target, PLACE_UID, USER_PLACE_ROLE) {
var _msg = can.request()
msg.Table(function(value) { if (value.order > 99) { _msg.Push(value) } })
var _msg = can.request(); msg.Table(function(value) { if (value.order > 99) { _msg.Push(value) } })
var output = can.page.Append(can, target, [html.OUTPUT])._target
can.onimport.myList(can, _msg, output, PLACE_UID, USER_PLACE_ROLE)
},
selectIndex: function(can, value, role) { role = role||value._role
can.ui.role && can.onmotion.toggle(can, can.ui.role, value._role == "creator")
can.ui.role && can.onmotion.select(can, can.ui.role, html.SPAN, can.page.SelectOne(can, can.ui.role, "span."+role))
can.page.Select(can, can.ui.myindex, html.DIV_ITEM, function(target) {
var list = target.className.split(" ")
can.page.Select(can, can.ui.myindex, html.DIV_ITEM, function(target) { var list = target.className.split(" ")
if (list.indexOf(mdb.TYPE) > -1 && list.indexOf(value._type) == -1) {
can.onmotion.toggle(can, target, false)
} else if (list.indexOf(aaa.ROLE) > -1 && list.indexOf(role) == -1) {
@ -120,7 +112,6 @@ Volcanos(chat.ONIMPORT, {
if (can.db.hash.length > 2 && can.db.hash[0] && can.db.hash[2]) { value.args = [can.db.hash[0], can.db.hash[2]] }
value.style = html.OUTPUT, value.height = can.ConfHeight()-html.ACTION_HEIGHT
can.onappend.plugin(can, value, function(sub) {
refresh = function() { sub.Update(), can.onmotion.delay(can, function() { can.user.toastSuccess(can, "refresh") }, 300) }
can.core.List(["_trans", "_icons", "_style", "_trans.input", "_trans.value"], function(key) {
var value = sub.Conf(key); value && can.core.Item(can.Conf(key), function(k, v) { value[k] = value[k]||v })
})
@ -134,43 +125,86 @@ Volcanos(chat.ONIMPORT, {
back = function() { can.page.ClassList.add(can, can._fields, "_back")
can.onexport.hash(can, ""), can.Option(PLACE_UID, ""), can.Option(ctx.INDEX, ""), can.Update()
}
refresh = function() { sub.Update(), can.onmotion.delay(can, function() { can.user.toastSuccess(can, "refresh") }, 300) }
sub.onexport.output = function(_sub, msg) { can.onappend.style(sub, html.OUTPUT)
can.page.styleHeight(can, _sub._target, can.ConfHeight() - 32)
_sub.onimport._option = function(_sub, uid, index, place_uid) {
can.Option(PLACE_UID, place_uid), can.Option(ctx.INDEX, index)
can.onexport.hash(can, place_uid||can.Option(PLACE_UID), index||can.Option(ctx.INDEX), uid), can.Update()
}
_sub.onexport.title = function(_sub, title) {
title? can.onexport.title(can, sub.Conf(PLACE_NAME), title):
can.onexport.title(can, sub.Conf(PLACE_NAME), sub.ConfHelp(), msg.Option("_share_title")||"")
}
can.onexport.hash(can, can.Option(PLACE_UID), value.index, sub.Option(UID))
can.onexport.title(can, sub.Conf(PLACE_NAME), sub.ConfHelp(), msg.Option("_share_title")||"")
can.user.agent.init(can, msg.Option("_share_content"), msg.Option("_share_icons")||value.icons)
can.page.Appends(can, ui.action, list), msg.Option(ice.MSG_ACTION) && can.onappend._action(sub, msg.Option(ice.MSG_ACTION), ui.action, null, true)
back = function() { can.page.ClassList.add(can, can._fields, "_back")
if (_sub.onaction._back) { return _sub.onaction._back(_sub) }
}
_sub.onaction._back = function() {
if (sub.Option(UID)) {
can.onexport.hash(can, can.Option(PLACE_UID), can.Option(ctx.INDEX)), sub.Option(UID, ""), sub.Update()
} else {
can.onexport.hash(can, ""), can.Option(PLACE_UID, ""), can.Option(ctx.INDEX, ""), can.Update()
}
}
refresh = function() {
if (_sub.onaction._refresh) { return _sub.onaction._refresh(_sub) }
sub.Update(), can.onmotion.delay(can, function() { can.user.toastSuccess(can, "refresh") }, 300)
}
}
})
})
},
typeStyle: function(can, value, key) { return can.Conf("_lrans.value."+key+".style."+value[key])||"" },
plugin: function(can, value) { var action = can._root.Action
var key = [value.space, value.index, value.args].join(".")
var sub = action._plugins[key]
if (sub) {
can.page.SelectChild(can, action._output, html.FIELDSET_PLUGIN, function(target) { can.onmotion.toggle(can, target, target == sub._target) })
sub.onimport.size(sub, window.innerHeight, window.innerWidth)
can.user.title((value._title||"")+" "+sub.ConfHelp())
return
}
var args = value.args; value.args = []; value.type = html.PLUGIN, value.style = html.OUTPUT
can._root.Action.onappend.plugin(can._root.Action, value, function(sub) { action._plugins[key] = sub
can.misc.localStorage(can, [sub.ConfSpace(), sub.ConfIndex(), mdb.HASH].join(","), "")
can.page.SelectChild(can, action._output, html.FIELDSET_PLUGIN, function(target) { can.onmotion.toggle(can, target, target == sub._target) })
sub.onimport.size(sub, window.innerHeight, window.innerWidth)
can.user.title((value._title||"")+" "+sub.ConfHelp())
sub.onexport.title = function(can, title) { can.user.title(can.core.List(arguments).slice(1).join(" ")) }
}, action._output)
},
float: function(can, value) { value.style = html.OUTPUT
can.onappend.plugin(can, value, function(sub) {
sub.onexport.output = function(_sub, msg) {
can.onexport.title(can, sub.ConfHelp()+" "+msg.Option("_share_title"))
}
var _back = can.onaction._back
can.onaction._back = function() { can.onaction._back = _back, can.page.Remove(can, sub._target)
can.onexport.title(can)
}
can.onaction._refresh = function() { sub.Update(), can.onmotion.delay(can, function() { can.user.toastSuccess(can, "refresh") }, 300) }
})
},
typeStyle: function(can, value, key) { return can.Conf("_trans.value."+key+".style."+value[key])||"" },
roleStyle: function(can, value, key) { return can.Conf("_trans.value."+key+".style."+value[key])||"" },
textView: function(can, value, key, type) { return value[key] && {text: [can.user.transValue(can, value, key), "", [type, value[key], can.Conf("_trans.value."+key+".style."+value[key])||""]]} },
shareTitle: function(can, msg, title, content) {
if (msg.IsDetail()) { var value = msg.TableDetail()
msg.Option("_share_title", (value[title]||value.name||value.uid).slice(0, 6)), msg.Option("_share_content", value[content]||value["info"])
}
},
})
Volcanos(chat.ONEXPORT, {
value: function(can, value, PLACE_UID, PLACE_NAME) {
can.page.Select(can, can.ui._target, "div.item.card.uid-"+value._uid, function(item) { can.onmotion.select(can, can.ui._target, html.DIV_ITEM, item) })
can.sup.current = value, can.onimport.selectIndex(can, can.sup.current), can.onexport.title(can, value[PLACE_NAME], can.ConfHelp())
can.onexport.session(can, PLACE_UID, value[PLACE_UID]), can.onexport.hash(can, value[PLACE_UID]), can.user.agent.init(can)
},
share_title: function(can, msg, title, role) {
msg.Option("_share_icons", msg.Append("user_avatar"))
msg.Option("_share_content", can.user.transValue(can, msg, role)+" "+msg.Append("user_name"))
},
})
msg.Option("_share_title", (value[title]||value.name||value.uid).slice(0, 6)), msg.Option("_share_content", value[content]||value.info)
} },
})
Volcanos(chat.ONEXPORT, {
value: function(can, value, PLACE_UID, PLACE_NAME) {
can.page.Select(can, can.ui._target, "div.item.card.uid-"+value._uid, function(item) { can.onmotion.select(can, can.ui._target, html.DIV_ITEM, item) })
can.sup.current = value, can.onimport.selectIndex(can, can.sup.current), can.onexport.title(can, value[PLACE_NAME], can.ConfHelp())
can.onexport.session(can, PLACE_UID, value[PLACE_UID]), can.onexport.hash(can, value[PLACE_UID]), can.user.agent.init(can)
},
share_title: function(can, msg, title, role) {
msg.Option("_share_icons", msg.Append("user_avatar"))
msg.Option("_share_content", can.user.transValue(can, msg, role)+" "+msg.Append("user_name"))
},
})

View File

@ -1,40 +1,19 @@
{
"portal": "用户场景",
"setIcons": "设置图标",
"scanQRCode": "扫码添加",
"placeCreate": "添加场景",
"placeRemove": "删除场景",
"qrcode": "场景码",
"apply": "权限申请",
"allow": "权限审批",
"event": "事件流",
"email": "邮箱配置",
"placeUser": "服务人员",
"member": "服务人员",
"cancel": "取消",
"submit": "提交",
"finish": "完成",
"reject": "驳回",
"approve": "通过",
"autogen": "生成",
"compile": "编译",
"create": "创建",
"project": "项目",
"oauth": "授权",
"message": "消息待办",
"recent": "最近访问",
"service": "服务发现",
"support": "客服支持",
"read": "已读",
"done": "完成",
"portal": "用户场景", "placeCreate": "添加场景", "placeRemove": "删除场景", "scanQRCode": "扫码添加",
"qrcode": "场景码", "event": "事件流", "apply": "权限申请", "allow": "权限审批",
"email": "邮箱配置", "member": "服务人员", "placeUser": "场景用户",
"message": "消息待办", "recent": "最近访问", "service": "服务发现", "support": "客服支持",
"cancel": "取消", "submit": "提交", "finish": "完成", "reject": "驳回", "approve": "通过",
"read": "已读", "done": "完成",
"autogen": "生成", "compile": "编译", "oauth": "授权", "project": "项目",
"icons": {
"qrcode": "https://img.icons8.com/officel/80/qr-code.png",
"event": "https://img.icons8.com/officel/80/property-with-timer.png",
"apply": "https://img.icons8.com/officel/80/edit-property.png",
"allow": "https://img.icons8.com/officel/80/receipt-approved.png",
"event": "https://img.icons8.com/officel/80/property-with-timer.png",
"email": "https://img.icons8.com/officel/80/reading-confirmation.png",
"placeUser": "https://img.icons8.com/officel/80/person-at-home.png",
"member": "https://img.icons8.com/officel/80/person-at-home.png",
"placeUser": "https://img.icons8.com/officel/80/person-at-home.png",
"message": "https://img.icons8.com/officel/80/test-partial-passed.png",
"recent": "https://img.icons8.com/officel/80/multiple-smartphones.png",
"service": "https://img.icons8.com/officel/80/activity-grid.png",
@ -54,8 +33,6 @@
"place_type": "场景类型",
"place_address": "场景地址",
"street_name": "街道名称",
"school_name": "学校名称",
"company_name": "公司名称",
"city_name": "城市名称",
"apply_status": "申请状态",
"allow_status": "审批状态",
@ -64,8 +41,8 @@
"cancel_time": "取消时间",
"finish_time": "完成时间",
"created_at": "创建时间",
"operate": "操作",
"operator": "操作人",
"operate": "操作",
"info": "详情",
"class": "基类",
"table": "应用"

View File

@ -7,9 +7,9 @@ import (
)
type qrcode struct {
order string `data:"1"`
role string `data:"creator"`
Tables
order string `data:"90"`
role string `data:"creator"`
}
func (s qrcode) List(m *ice.Message, arg ...string) {

View File

@ -12,15 +12,13 @@ import (
type recent struct {
Table
order string `data:"101"`
portal string `data:"true"`
domain string `data:"gonganxitong"`
create string `name:"create name icon space index args"`
remove string `name:"remove" role:"void"`
open string `name:"open" role:"void"`
}
func (s recent) Create(m *ice.Message, arg ...string) {
if s.Table.Select(m, m.OptionSimple(model.USER_UID, web.SPACE, ctx.INDEX)...).Length() == 0 {
if s.Table.Select(m, m.OptionSimple(model.USER_UID, web.SPACE, ctx.INDEX, ctx.ARGS)...).Length() == 0 {
}
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID))...)
}
@ -36,7 +34,7 @@ func (s recent) List(m *ice.Message, arg ...string) {
m.PushAction(s.Open, s.Remove).Action()
}
func (s recent) Open(m *ice.Message, arg ...string) {
m.ProcessOpen(web.S(m.Option(web.SPACE)) + web.C(m.Option(ctx.INDEX)))
m.ProcessOpen(web.S(m.Option(web.SPACE)) + web.C(m.Option(ctx.INDEX)) + "#" + kit.Join(kit.Split(m.Option(ctx.ARGS)), ":"))
}
func init() { ice.TeamCtxCmd(recent{}) }

View File

@ -1,11 +1,17 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
can.onimport.itemcards(can, msg, function(value) { return [
{view: html.TITLE, list: [value.name]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]},
{view: html.STATUS, list: [value.space]},
{view: html.STATUS, list: [value.index]},
{view: html.OUTPUT, list: [value.info]},
] })
can.onimport.itemcards(can, msg, function(value) { var args = can.core.Split(value.args)
var sub = can._root.Action._plugins[[value.space, value.index, args[0]].join(".")]
return [
{view: html.TITLE, list: [args[1]||value.name, sub? {text: ["load", "", mdb.STATUS]}: ""]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at)]},
{view: html.STATUS, list: [value.space]},
{view: html.STATUS, list: [value.index]},
{view: html.OUTPUT, list: [value.info]},
]
}, function(event, value) { var args = can.core.Split(value.args)
can.onimport.plugin(can, {_title: args[1], space: value.space, index: value.index, args: args[0]})
can.onaction._back(can)
})
},
})

View File

@ -20,9 +20,7 @@ import (
type service struct {
Table
order string `data:"102"`
portal string `data:"true"`
domain string `data:"gonganxitong"`
update string `name:"update name icon index"`
update string `name:"update index name icon"`
autogen string `name:"autogen name* help* class* table*" icon:"bi bi-plus-square-dotted"`
oauth string `name:"oauth" icon:"bi bi-shield-fill-check"`
open string `name:"open" role:"void"`
@ -32,14 +30,16 @@ type service struct {
func (s service) Update(m *ice.Message, arg ...string) {
uid := kit.Hashs(ice.Info.Hostname, ice.Info.Pwd, m.Option(ctx.INDEX))
if s.Table.Select(m.Spawn(), model.UID, uid).Length() == 0 {
s.Table.Create(m, kit.Simple(model.UID, uid, m.OptionSimple(mdb.NAME, mdb.ICON), tcp.HOSTNAME, ice.Info.Hostname, nfs.PATHNAME, ice.Info.Pwd, m.OptionSimple(ctx.INDEX))...)
s.Table.Create(m, kit.Simple(model.UID, uid,
m.OptionSimple(ctx.INDEX), m.OptionSimple(mdb.NAME, mdb.ICON),
tcp.HOSTNAME, ice.Info.Hostname, nfs.PATHNAME, ice.Info.Pwd,
)...)
m.Cmd(m.Prefix(web.PORTAL)).Table(func(value ice.Maps) { m.Cmd(m.Prefix(web.PORTAL), mdb.MODIFY, value[ctx.INDEX], mdb.ENABLE, ice.TRUE) })
}
s.Table.Update(m, kit.Dict(arg, m.OptionSimple(mdb.NAME, mdb.ICON),
nfs.MODULE, ice.Info.Make.Module, nfs.VERSION, ice.Info.Make.Versions(),
tcp.NODENAME, ice.Info.NodeName, tcp.NODETYPE, ice.Info.NodeType,
web.DOMAIN, ice.Info.Make.Domain,
web.PORTAL, ctx.GetCmdFile(m.Message, m.Prefix(web.PORTAL)),
web.DOMAIN, ice.Info.Make.Domain, web.PORTAL, ctx.GetCmdFile(m.Message, m.Prefix(web.PORTAL)),
), model.UID, uid)
}
func (s service) Autogen(m *ice.Message, arg ...string) {
@ -98,7 +98,7 @@ func (s service) List(m *ice.Message, arg ...string) {
} else {
m.PushAction(s.Open).Action()
}
m.Display("").Sort("status,updated_at", []string{web.ONLINE}, ice.STR_R)
m.Sort("status,updated_at", []string{web.ONLINE}, ice.STR_R).Display("")
}
func (s service) Open(m *ice.Message, arg ...string) {
m.ProcessOpen(web.S(m.Option(tcp.NODENAME)) + web.C(m.Option(ctx.INDEX)))

View File

@ -1,14 +1,14 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.itemcards(can, msg, function(value) { value._style = [value.nodetype, value.status]
return [
{view: html.TITLE, list: [{text: value.name}, {text: [value.nodetype, "", mdb.TYPE]}, value.status && {text: [value.status, "", mdb.STATUS]}]},
{view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.updated_at)}]},
{view: html.STATUS, list: [{text: value.index}]},
{view: html.STATUS, list: [{text: value.module}, {text: value.version}]},
{view: html.STATUS, list: [{text: value.domain.split("?")[0]}]},
// {view: html.STATUS, list: [{text: value.hostname}, {text: value.pathname}]},
]
can.onimport.itemcards(can, msg, function(value) { return [
{view: html.TITLE, list: [value.name, can.onimport.textView(can, value, "nodetype", mdb.TYPE), can.onimport.textView(can, value, "status", mdb.STATUS)]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.updated_at)]},
{view: html.STATUS, list: [value.index]},
{view: html.STATUS, list: [value.module, value.version]},
{view: html.STATUS, list: [value.domain.split("?")[0]]},
] }, function(event, value) {
can.onimport.plugin(can, {space: value.space||value.nodename, index: value.index})
can.onaction._back(can)
})
},
})

View File

@ -3,10 +3,8 @@ package gonganxitong
import "shylinux.com/x/ice"
type support struct {
Tables
order string `data:"103"`
portal string `data:"true"`
domain string `data:"gonganxitong"`
Table
order string `data:"103"`
}
func (s support) List(m *ice.Message, arg ...string) {}

View File

@ -40,16 +40,6 @@ func (s Table) CheckRole(m *ice.Message, arg ...string) *ice.Message {
m.WarnNotRight(!kit.IsIn(role.String(), append(arg, User{{.Option "Class"}}Creator.String())...), role.String())
return m
}
func (s Table) checkRole(m *ice.Message, arg ...User{{.Option "Class"}}Role) bool {
kit.If(len(arg) == 0, func() { arg = append(arg, User{{.Option "Class"}}Leader) })
role := User{{.Option "Class"}}Role(kit.Int(m.Cmd(user{{.Option "Class"}}{}, s.Select, m.OptionSimple(model.{{.Option "CLASS"}}_UID, model.USER_UID)).Append(model.ROLE)))
for _, v := range append(arg, User{{.Option "Class"}}Creator) {
if role == v {
return true
}
}
return !m.WarnNotRight(true, role.String())
}
func (s Table) recordEvent(m *ice.Message, info string, arg ...string) {
s.Table.RecordEvent(m, m.Option(model.{{.Option "CLASS"}}_UID), info, kit.Select(m.Option(model.UID), arg, 0))
}

View File

@ -11,14 +11,12 @@ type {{.Option "table"}} struct {
Table
{{.Option "class"}} {{.Option "class"}}
user{{.Option "Class"}} user{{.Option "Class"}}
create string `name:"create title* content*" role:"void"`
create string `name:"create title* content*" role:"leader"`
}
func (s {{.Option "table"}}) Create(m *ice.Message, arg ...string) {
if s.checkRole(m) {
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.{{.Option "CLASS"}}_UID))...)
s.recordEvent(m, m.Trans("create {{.Option "table"}} ", "创建场景数据 ")+m.Option(model.TITLE), m.Result())
}
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.{{.Option "CLASS"}}_UID))...)
s.recordEventWithName(m, "")
}
func (s {{.Option "table"}}) List(m *ice.Message, arg ...string) {
s.TablesWithRole(m, arg, s.user{{.Option "Class"}}, s.{{.Option "class"}}, s, model.TITLE, model.CONTENT).Display("")

View File

@ -1,12 +1,12 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
can.onimport.itemcards(can, msg, function(value) { return [
{view: html.TITLE, list: [{text: value.title}]},
{view: html.TITLE, list: [value.title]},
{view: html.STATUS, list: [
{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at)},
{text: value.user_name}, {text: [can.user.transValue(can, value, "user_{{.Option "class"}}_role"), "", [aaa.ROLE, can.onimport.roleStyle(can, value, "user_{{.Option "class"}}_role")]]},
value.uid.slice(0, 6), can.base.TimeTrim(value.created_at),
value.user_name, can.onimport.textView(can, value, "user_{{.Option "class"}}_role", aaa.ROLE),
]},
{view: html.OUTPUT, list: [{text: value.content}]},
{view: html.OUTPUT, list: [value.content]},
] })
},
})

View File

@ -23,13 +23,13 @@ type User{{.Option "Class"}} struct {
db.ModelWithUID
UserUID string `gorm:"type:char(32);index"`
{{.Option "Class"}}UID string `gorm:"type:char(32);index"`
Role uint8
Role uint8 `gorm:"default:0"`
}
type {{.Option "Class"}} struct {
db.ModelWithUID
CompanyUID string `gorm:"type:char(32);index"`
Name string `gorm:"type:varchar(64)"`
Type uint8
Type uint8 `gorm:"default:0"`
}
type {{.Option "Table"}} struct {
db.ModelWithUID

View File

@ -30,20 +30,23 @@ func (s user) Create(m *ice.Message, arg ...string) {
}
}
func (s user) List(m *ice.Message, arg ...string) {
s.Table.List(m, arg...).Table(func(value ice.Maps) {
if value[model.UID] != m.Option(model.USER_UID) {
m.PushButton(s.SetCookie)
} else {
m.PushButton()
}
})
}
func (s user) Email(m *ice.Message, arg ...string) {
s.Table.Update(m, kit.Dict(m.OptionSimple(model.EMAIL)), model.UID, m.Option(model.USER_UID))
if m.IsTech() {
s.Table.List(m, arg...)
m.Table(func(value ice.Maps) {
if value[model.UID] != m.Option(model.USER_UID) {
m.PushButton(s.SetCookie)
} else {
m.PushButton()
}
})
}
}
func (s user) SetCookie(m *ice.Message, arg ...string) {
m.ProcessCookie(model.USER_UID, m.Option(model.UID))
}
func (s user) Email(m *ice.Message, arg ...string) {
s.Table.Update(m, kit.Dict(m.OptionSimple(model.EMAIL)), model.UID, m.Option(model.USER_UID))
}
func (s user) SendTemplate(m *ice.Message, arg ...string) { // from uid url type name hash
if ice.Info.NodeName != m.Config("community") {
m.AdminCmd(web.SPACE, m.Config("community"), m.PrefixKey(), m.ActionKey(), arg, kit.Dict(ice.MSG_USERROLE, aaa.TECH))

View File

@ -15,9 +15,7 @@ type userPlace struct {
}
func (s userPlace) User(m *ice.Message, arg ...string) {
s.Tables(m, s.user).FieldsWithCreatedAT(m, s,
model.USER_AVATAR, model.USER_NAME, model.USER_PLACE_ROLE, model.BEGIN_TIME, model.END_TIME,
)
s.Tables(m, s.user).FieldsWithCreatedAT(m, s, model.USER_AVATAR, model.USER_NAME, model.USER_PLACE_ROLE)
if len(arg) == 1 {
s.Select(m, model.PLACE_UID, arg[0])
} else if len(arg) == 2 {

View File

@ -4,7 +4,6 @@ import (
"shylinux.com/x/ice"
_ "shylinux.com/x/community/src/gonganxitong"
_ "shylinux.com/x/community/src/gonganxitong/express"
_ "shylinux.com/x/community/src/yuehaoxitong"
)