mirror of
https://shylinux.com/x/community
synced 2025-07-03 05:51:20 +08:00
41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
package gonganxitong
|
|
|
|
import (
|
|
"shylinux.com/x/ice"
|
|
|
|
"shylinux.com/x/community/src/gonganxitong/model"
|
|
)
|
|
|
|
type domain struct {
|
|
Table
|
|
order string `data:"508"`
|
|
role string `data:"tech"`
|
|
fields string `name:"name,order"`
|
|
create string `name:"create name* info" role:"tech"`
|
|
remove string `name:"remove" role:"tech"`
|
|
list string `name:"list place_uid domain_uid auto" role:"void"`
|
|
}
|
|
|
|
func (s domain) Create(m *ice.Message, arg ...string) { s.Insert(m, arg...) }
|
|
func (s domain) Modify(m *ice.Message, arg ...string) {
|
|
s.Update(m, arg, model.UID, m.Option(model.DOMAIN_UID))
|
|
}
|
|
func (s domain) Remove(m *ice.Message, arg ...string) {
|
|
s.Delete(m.Options(model.UID, m.Option(model.DOMAIN_UID)))
|
|
}
|
|
func (s domain) List(m *ice.Message, arg ...string) {
|
|
m.Display("/plugin/table.js")
|
|
s.Fields(m, model.UID, model.NAME, "order")
|
|
if len(arg) < 2 {
|
|
s.Select(m).RenameAppend(model.UID, model.DOMAIN_UID).Action()
|
|
m.SortInt("order")
|
|
} else {
|
|
s.SelectDetail(m, model.UID, arg[0])
|
|
}
|
|
if m.IsTech() {
|
|
m.PushAction(s.Remove).Action(s.Create)
|
|
}
|
|
}
|
|
|
|
func init() { ice.TeamCtxCmd(domain{}) }
|