mirror of
https://shylinux.com/x/community
synced 2025-04-25 17:48:06 +08:00
add some
This commit is contained in:
parent
b099a48807
commit
b4dafdd4f6
@ -172,4 +172,5 @@ func PortalCmd(portal ice.Any) {
|
||||
cmd("apply", apply{Table: table})
|
||||
cmd("order", order{Table: table})
|
||||
cmd("event", event{Table: table})
|
||||
cmd("service", service{})
|
||||
}
|
||||
|
@ -20,6 +20,9 @@ type email struct {
|
||||
}
|
||||
|
||||
func (s email) List(m *ice.Message, arg ...string) {
|
||||
if !m.IsTech() {
|
||||
return
|
||||
}
|
||||
if msg := m.Cmd(s.user, s.user.Select, model.UID, m.Option(model.USER_UID)); msg.Append(model.EMAIL) == "" {
|
||||
m.EchoInfoButton(m.Trans("please apply email", "请申请邮箱"), s.Apply)
|
||||
} else {
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"express": "寄快递",
|
||||
"express": "收发快递",
|
||||
"icons": {
|
||||
"express": "https://img.icons8.com/officel/80/shipped.png"
|
||||
},
|
||||
|
@ -7,4 +7,8 @@ type express struct {
|
||||
portal string `data:"true"`
|
||||
}
|
||||
|
||||
func (s express) List(m *ice.Message, arg ...string) {
|
||||
m.Echo("hello world")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(express{}) }
|
||||
|
@ -18,6 +18,7 @@ const (
|
||||
OPERATE = "operate"
|
||||
OPERATOR = "operator"
|
||||
CREATED_AT = "created_at"
|
||||
UPDATED_AT = "updated_at"
|
||||
BEGIN_TIME = "begin_time"
|
||||
END_TIME = "end_time"
|
||||
OPEN_ID = "open_id"
|
||||
@ -79,6 +80,19 @@ type City struct {
|
||||
Name string `gorm:"type:char(32);index"`
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
db.ModelWithUID
|
||||
Icon string `gorm:"type:char(32)"`
|
||||
Name string `gorm:"type:char(32)"`
|
||||
Index string `gorm:"type:char(32)"`
|
||||
Hostname string `gorm:"type:char(32)"`
|
||||
Pathname string `gorm:"type:char(255)"`
|
||||
Nodename string `gorm:"type:char(32)"`
|
||||
Nodetype string `gorm:"type:char(32)"`
|
||||
Domain string `gorm:"type:char(255)"`
|
||||
Module string `gorm:"type:char(32)"`
|
||||
Version string `gorm:"type:char(32)"`
|
||||
}
|
||||
type Event struct {
|
||||
db.ModelWithUID
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
@ -106,5 +120,5 @@ type Order struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
db.CmdModels("", &Sess{}, &User{}, &UserPlace{}, &Place{}, &Street{}, &City{}, Event{}, Apply{}, Order{})
|
||||
db.CmdModels("", &Sess{}, &User{}, &UserPlace{}, &Place{}, &Street{}, &City{}, Event{}, Apply{}, Order{}, Service{})
|
||||
}
|
||||
|
@ -15,23 +15,35 @@ type Portal struct {
|
||||
Table
|
||||
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"`
|
||||
field string `data:"time,name,icons,index,order,enable,type,role,view"`
|
||||
list string `name:"list place_uid index uid auto" role:"void"`
|
||||
placeCreate string `name:"placeCreate city_name* street_name* place_type*:select name* address*" role:"void"`
|
||||
create string `name:"create name icons index"`
|
||||
placeCreate string `name:"placeCreate city_name* street_name* place_type*:select name* address*" icon:"bi bi-plus-square-dotted" role:"void"`
|
||||
placeRemove string `name:"placeRemove uid*" role:"void"`
|
||||
scanQRCode string `name:"scanQRCode type text" role:"void"`
|
||||
scanQRCode string `name:"scanQRCode type text" icon:"bi bi-qr-code-scan" role:"void"`
|
||||
setIcons string `name:"setIcons icons" icon:"bi bi-info-square"`
|
||||
}
|
||||
|
||||
func (s Portal) BeforeMigrate(m *ice.Message, arg ...string) {
|
||||
}
|
||||
func (s Portal) AfterMigrate(m *ice.Message, arg ...string) {
|
||||
m.GoSleep("30ms", func() {
|
||||
m.Option(ctx.INDEX, m.PrefixKey())
|
||||
m.Cmdy(s.service, s.Update, m.ConfigSimple(mdb.ICON, mdb.NAME))
|
||||
})
|
||||
}
|
||||
func (s Portal) Inputs(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.Place, m.ActionKey(), arg)
|
||||
}
|
||||
func (s Portal) SetIcons(m *ice.Message, arg ...string) {
|
||||
s.Hash.Modify(m, arg...)
|
||||
}
|
||||
func (s Portal) List(m *ice.Message, arg ...string) {
|
||||
if m.Option("form") == "table" {
|
||||
s.Hash.List(m, arg...).SortInt(mdb.ORDER)
|
||||
if m.Option(mdb.VIEW) == mdb.TABLE {
|
||||
s.Hash.List(m, arg...).PushAction(mdb.DETAIL, s.SetIcons, s.Remove).SortInt(mdb.ORDER)
|
||||
return
|
||||
}
|
||||
if len(arg) == 0 {
|
||||
@ -86,6 +98,13 @@ func (s Portal) ScanQRCode(m *ice.Message, arg ...string) {
|
||||
|
||||
func init() { ice.TeamCtxCmd(Portal{Table: newTable()}) }
|
||||
|
||||
type portal struct {
|
||||
Portal
|
||||
name string `data:"公安系统"`
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(portal{Portal: Portal{Table: newTable()}}) }
|
||||
|
||||
func (s Portal) Show(m *ice.Message, arg ...string) {
|
||||
m.GoSleep("30ms", func() {
|
||||
cmd := m.GetCommand()
|
||||
|
@ -1,22 +1,22 @@
|
||||
{
|
||||
"portal": "用户场所",
|
||||
"service": "系统服务",
|
||||
"portal": "用户场景",
|
||||
"setIcons": "设置图标",
|
||||
"scanQRCode": "扫码添加",
|
||||
"placeCreate": "添加场所",
|
||||
"placeRemove": "删除场所",
|
||||
"qrcode": "场所码",
|
||||
"placeCreate": "添加场景",
|
||||
"placeRemove": "删除场景",
|
||||
"qrcode": "场景码",
|
||||
"apply": "权限申请",
|
||||
"order": "权限审批",
|
||||
"event": "事件流",
|
||||
"email": "邮箱配置",
|
||||
"placeUser": "场所用户",
|
||||
"placeUser": "场景用户",
|
||||
"cancel": "取消",
|
||||
"submit": "提交",
|
||||
"reject": "驳回",
|
||||
"approve": "通过",
|
||||
"icons": {
|
||||
"scanQRCode": "bi bi-qr-code-scan",
|
||||
"placeRemove": "bi bi-plus-square-dotted",
|
||||
"placeCreate": "bi bi-plus-square-dotted",
|
||||
"service": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
"qrcode": "https://img.icons8.com/officel/80/qr-code.png",
|
||||
"apply": "https://img.icons8.com/officel/80/edit-property.png",
|
||||
"order": "https://img.icons8.com/officel/80/receipt-approved.png",
|
||||
@ -28,7 +28,7 @@
|
||||
"placeRemove": "danger"
|
||||
},
|
||||
"input": {
|
||||
"My Place": "我的场所",
|
||||
"My Place": "我的场景",
|
||||
"apply_status": "申请状态",
|
||||
"order_status": "审批状态",
|
||||
"begin_time": "起始时间",
|
||||
@ -37,9 +37,10 @@
|
||||
"user_name": "用户昵称",
|
||||
"user_avatar": "用户头像",
|
||||
"user_place_role": "用户角色",
|
||||
"place_name": "场所名称",
|
||||
"place_type": "场所类型",
|
||||
"place_address": "场所地址",
|
||||
"place_uid": "场景",
|
||||
"place_name": "场景名称",
|
||||
"place_type": "场景类型",
|
||||
"place_address": "场景地址",
|
||||
"street_name": "街道名称",
|
||||
"city_name": "城市名称"
|
||||
},
|
||||
|
44
src/gonganxitong/service.go
Normal file
44
src/gonganxitong/service.go
Normal file
@ -0,0 +1,44 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/ctx"
|
||||
"shylinux.com/x/icebergs/base/nfs"
|
||||
"shylinux.com/x/icebergs/base/tcp"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type service struct {
|
||||
Table
|
||||
portal string `data:"true"`
|
||||
domain string `data:"gonganxitong"`
|
||||
create string `name:"create name help table"`
|
||||
}
|
||||
|
||||
func (s service) Update(m *ice.Message, arg ...string) {
|
||||
uid := kit.Hashs(ice.Info.Hostname, ice.Info.Pwd, m.Option(ctx.INDEX))
|
||||
s.Table.Create(m, model.UID, uid, tcp.HOSTNAME, ice.Info.Hostname, nfs.PATHNAME, ice.Info.Pwd, ctx.INDEX, m.Option(ctx.INDEX))
|
||||
s.Table.Update(m, kit.Dict(arg, web.DOMAIN, ice.Info.Make.Domain,
|
||||
tcp.NODENAME, ice.Info.NodeName, tcp.NODETYPE, ice.Info.NodeType,
|
||||
nfs.MODULE, ice.Info.Make.Module, nfs.VERSION, ice.Info.Make.Versions(),
|
||||
), model.UID, uid)
|
||||
}
|
||||
func (s service) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 2 {
|
||||
s.Table.SelectDetail(m, model.UID, arg[1])
|
||||
} else {
|
||||
s.Orders(m, s.Desc(model.UPDATED_AT)).Select(m)
|
||||
}
|
||||
m.PushAction(s.Open, s.Conf).Display("")
|
||||
}
|
||||
func (s service) Open(m *ice.Message, arg ...string) {
|
||||
m.ProcessOpen(web.S(m.Option(tcp.NODENAME)) + web.C(m.Option(ctx.INDEX)))
|
||||
}
|
||||
func (s service) Conf(m *ice.Message, arg ...string) {
|
||||
m.ProcessOpen(web.S(m.Option(tcp.NODENAME)) + web.C(m.Option(ctx.INDEX)) + "?view=table")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(service{}) }
|
14
src/gonganxitong/service.js
Normal file
14
src/gonganxitong/service.js
Normal file
@ -0,0 +1,14 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.itemcards(can, msg, function(value) { value._style = [value.nodetype]
|
||||
return [
|
||||
{view: html.TITLE, list: [{text: value.name}, {text: [value.nodetype, "", mdb.TYPE]}]},
|
||||
{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}]},
|
||||
// {view: html.STATUS, list: [{text: value.hostname}, {text: value.pathname}]},
|
||||
]
|
||||
})
|
||||
},
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user