This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-05-04 08:48:49 +08:00
parent 592013abfd
commit 3a382468f7
27 changed files with 194 additions and 72 deletions

View File

@ -54,7 +54,7 @@ func (s allow) List(m *ice.Message, arg ...string) {
} }
}) })
s.SelectJoinUser(m) s.SelectJoinUser(m)
s.DisplayBase(m, "") s.DisplayBase(m, "").DisplayCSS("")
} }
func (s allow) Reject(m *ice.Message, arg ...string) { func (s allow) Reject(m *ice.Message, arg ...string) {
s.process(m, AllowCreate, AllowRejected, "❌", m.Trans("allow rejected", "权限审批 已驳回")) s.process(m, AllowCreate, AllowRejected, "❌", m.Trans("allow rejected", "权限审批 已驳回"))

View File

@ -32,8 +32,7 @@ func (s apply) Create(m *ice.Message, arg ...string) {
} }
func (s apply) List(m *ice.Message, arg ...string) { func (s apply) List(m *ice.Message, arg ...string) {
s.FieldsWithCreatedAT(m, s, model.USER_UID, model.APPLY_STATUS, s.FieldsWithCreatedAT(m, s, model.USER_UID, model.APPLY_STATUS,
s.AS(s.Key(s, model.ROLE), s.Keys(s.UserPlace, model.ROLE)), model.BEGIN_TIME, model.END_TIME, s.AS(s.Key(s, model.ROLE), s.Keys(s.UserPlace, model.ROLE)), model.BEGIN_TIME, model.END_TIME)
)
if len(arg) == 1 { if len(arg) == 1 {
s.Select(m, model.PLACE_UID, arg[0], model.USER_UID, m.Option(model.USER_UID)) s.Select(m, model.PLACE_UID, arg[0], model.USER_UID, m.Option(model.USER_UID))
if m.Length() == 0 { if m.Length() == 0 {
@ -60,17 +59,17 @@ func (s apply) Cancel(m *ice.Message, arg ...string) {
s.changeStatus(m, ApplyCreate, ApplyCancel) s.changeStatus(m, ApplyCreate, ApplyCancel)
} }
func (s apply) ApplyCreate(m *ice.Message, arg ...string) { func (s apply) ApplyCreate(m *ice.Message, arg ...string) {
m.Option(model.UID, m.Cmdx("", s.Create, arg)) m.Option(model.UID, m.Cmdy("", s.Create, s.Keys(s.UserPlace, model.ROLE), "3").Result())
m.Cmdy("", s.Submit) m.Cmdy("", s.Submit)
} }
func (s Table) ApplyCreate(m *ice.Message, arg ...string) { func (s Table) ApplyCreate(m *ice.Message, arg ...string) {
m.Cmdy(s.Prefix(m, apply{}), s.ApplyCreate, model.ROLE, "3") m.Cmdy(s.Prefix(m, apply{}), s.ApplyCreate)
} }
func (s Table) ApplyCheck(m *ice.Message, arg ...string) { func (s Table) ApplyCheck(m *ice.Message, arg ...string) {
if m.Cmd(s.Prefix(m, apply{}), arg[0]).Length() == 0 { if m.Cmd(s.Prefix(m, apply{}), arg[0]).Length() == 0 {
m.EchoInfoButton("请申请加入团队", s.ApplyCreate) m.EchoInfoButton("请申请加入团队", s.ApplyCreate)
} else { } else {
m.Echo("\n权限申请已提交\n请等待管理员审批\n然后刷新界面查看最新状态") m.Echo("\n权限申请已提交\n请等待管理员审批\n然后刷新界面查看最新状态")
} }
} }
func (s apply) Submit(m *ice.Message, arg ...string) { func (s apply) Submit(m *ice.Message, arg ...string) {

View File

@ -71,7 +71,7 @@ func (s command) Cache(m *ice.Message, arg ...string) {
func (s command) List(m *ice.Message, arg ...string) *ice.Message { func (s command) List(m *ice.Message, arg ...string) *ice.Message {
s.Tables(m, s.service).Fields(m, s.Key(s, model.UPDATED_AT), s.Tables(m, s.service).Fields(m, s.Key(s, model.UPDATED_AT),
s.Key(s, model.INDEX), s.AS(s.Key(s.service, "`"+model.INDEX+"`"), model.PORTAL), s.AS(model.NODENAME, model.SPACE), s.Key(s, model.INDEX), s.AS(s.Key(s.service, "`"+model.INDEX+"`"), model.PORTAL), s.AS(model.NODENAME, model.SPACE),
).Orders(m, "`space`,`commands`.`index`").Limit(m, 300).Select(m).Action(s.Cache, s.Autogen) ).Orders(m, "`space`,`commands`.`index`").Limit(m, 3000).Select(m).Action(s.Cache, s.Autogen)
return m return m
} }

View File

@ -37,18 +37,20 @@ type Container interface {
type Table struct { type Table struct {
db.Table db.Table
UserPlace UserPlacer UserPlace UserPlacer
Place Placer Place Placer
Street Container Street Container
STREET_UID string STREET_UID string
PLACE_UID string PLACE_UID string
checkRole string `name:"checkRole role"` checkRole string `name:"checkRole role"`
inputs string `name:"inputs" role:"void"` inputs string `name:"inputs" role:"void"`
list string `name:"list place_uid uid auto" role:"void"` list string `name:"list place_uid uid auto" role:"void"`
marketInsert string `name:"marketInsert domain_uid* title* content" style:"notice" role:"leader"` marketInsert string `name:"marketInsert domain_uid* title* content" style:"notice" role:"leader"`
pushPublic string `name:"pushPublic domain_uid* title* content" role:"leader"` pushPublic string `name:"pushPublic domain_uid* title* content" role:"leader"`
memberList string `name:"memberList" role:"void"` memberList string `name:"memberList" role:"void"`
noticeList string `name:"noticeList" role:"void"` noticeList string `name:"noticeList" role:"void"`
marketPlaceInfo string `name:"marketPlaceInfo" role:"void"`
messagePlaceInfo string `name:"messagePlaceInfo" role:"void"`
// applyCreate string `name:"applyCreate" role:"void"` // applyCreate string `name:"applyCreate" role:"void"`
} }
@ -89,6 +91,10 @@ func (s Table) Inputs(m *ice.Message, arg ...string) {
s.InputsList(m, PlaceTypeList, arg...) s.InputsList(m, PlaceTypeList, arg...)
case model.DOMAIN_UID: case model.DOMAIN_UID:
s.AutoCmdy(m, api.GONGANXITONG_DOMAIN).DisplayInputKeyNameIconTitle() s.AutoCmdy(m, api.GONGANXITONG_DOMAIN).DisplayInputKeyNameIconTitle()
case model.FROM_USER_UID, model.TO_USER_UID:
m.Cmdy(s.Prefix(m, member{}), m.Option(model.PLACE_UID)).Cut(model.USER_UID, model.USER_NAME, model.USER_AVATAR)
m.RenameAppend(model.USER_UID, arg[0], model.NAME, model.USER_NAME, model.USER_AVATAR, mdb.ICONS)
m.DisplayInputKeyNameIconTitle()
default: default:
s.Table.Inputs(m, arg...) s.Table.Inputs(m, arg...)
} }
@ -424,6 +430,18 @@ func (s Table) DashboardUpdate(m *ice.Message, arg ...string) {
} }
m.Cmd(s.Prefix(m, Portal{}), s.DashboardUpdate) m.Cmd(s.Prefix(m, Portal{}), s.DashboardUpdate)
} }
func (s Table) MessagePlaceEnter(m *ice.Message, arg ...string) {
m.Cmdy(message{}, "placeEnter", arg)
}
func (s Table) MessagePlaceInfo(m *ice.Message, arg ...string) {
m.Cmdy(message{}, "placeInfo", arg)
}
func (s Table) MarketPlaceEnter(m *ice.Message, arg ...string) {
m.Cmdy(market{}, "placeEnter", arg)
}
func (s Table) MarketPlaceInfo(m *ice.Message, arg ...string) {
m.Cmdy(market{}, "placeInfo", arg)
}
func (s Table) MarketInsert(m *ice.Message, arg ...string) { func (s Table) MarketInsert(m *ice.Message, arg ...string) {
m.Cmdy(s.Prefix(m, Portal{}), s.MarketInsert, arg) m.Cmdy(s.Prefix(m, Portal{}), s.MarketInsert, arg)
} }
@ -448,9 +466,7 @@ func (s Table) SendMessage(m *ice.Message, from, to string, arg ...string) {
) )
} }
func (s Table) DoneMessage(m *ice.Message, arg ...string) { func (s Table) DoneMessage(m *ice.Message, arg ...string) {
m.Info("what %v", m.Option("message_uid"))
if m.Option(model.MESSAGE_UID) != "" { if m.Option(model.MESSAGE_UID) != "" {
m.Info("what %v", m.Option("message_uid"))
m.Spawn(ice.Maps{db.DB: ""}).Cmd(s.Prefix(m, message{}), message{}.Done, kit.Dict(model.UID, m.Option(model.MESSAGE_UID))) m.Spawn(ice.Maps{db.DB: ""}).Cmd(s.Prefix(m, message{}), message{}.Done, kit.Dict(model.UID, m.Option(model.MESSAGE_UID)))
} }
} }

View File

@ -8,19 +8,24 @@ import (
type domain struct { type domain struct {
Table Table
fields string `name:"name,order"`
create string `name:"create name* info" role:"tech"` create string `name:"create name* info" role:"tech"`
remove string `name:"remove" role:"tech"` remove string `name:"remove" role:"tech"`
list string `name:"list domain_uid auto" role:"void"` list string `name:"list domain_uid auto" role:"void"`
} }
func (s domain) Create(m *ice.Message, arg ...string) { s.Insert(m, arg...) } 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) { func (s domain) Remove(m *ice.Message, arg ...string) {
s.Delete(m.Options(model.UID, m.Option(model.DOMAIN_UID))) s.Delete(m.Options(model.UID, m.Option(model.DOMAIN_UID)))
} }
func (s domain) List(m *ice.Message, arg ...string) { func (s domain) List(m *ice.Message, arg ...string) {
s.Fields(m, model.UID, model.NAME) s.Fields(m, model.UID, model.NAME, "order")
if len(arg) == 0 { if len(arg) == 0 {
s.Select(m).RenameAppend(model.UID, model.DOMAIN_UID).Action() s.Select(m).RenameAppend(model.UID, model.DOMAIN_UID).Action()
m.SortInt("order")
} else if len(arg) == 1 { } else if len(arg) == 1 {
s.SelectDetail(m, model.UID, arg[0]) s.SelectDetail(m, model.UID, arg[0])
} }

View File

@ -50,7 +50,7 @@ func (s market) List(m *ice.Message, arg ...string) {
s.SelectJoinRecent(m, model.PLACE_UID) s.SelectJoinRecent(m, model.PLACE_UID)
s.SelectJoinUser(m, model.NAME, model.AVATAR, model.AUTH_UID) s.SelectJoinUser(m, model.NAME, model.AVATAR, model.AUTH_UID)
s.SelectJoinAuth(m) s.SelectJoinAuth(m)
s.DisplayBase(m, "") s.DisplayBase(m, "").DisplayCSS("")
} }
func (s market) ThumbToggle(m *ice.Message, arg ...string) { func (s market) ThumbToggle(m *ice.Message, arg ...string) {
m.OptionDefault(model.MARKET_UID, m.Option(model.UID)) m.OptionDefault(model.MARKET_UID, m.Option(model.UID))
@ -76,5 +76,21 @@ func (s market) FavorToggle(m *ice.Message, arg ...string) {
func (s market) ShareCreate(m *ice.Message, arg ...string) { func (s market) ShareCreate(m *ice.Message, arg ...string) {
s.AddCount(m, model.SHARE_COUNT, "1") s.AddCount(m, model.SHARE_COUNT, "1")
} }
func (s market) PlaceEnter(m *ice.Message, arg ...string) {
// m.ProcessField()
}
func (s market) PlaceInfo(m *ice.Message, arg ...string) {
s.Tables(m, s.command, s.service, s.LeftJoinValue(m, s.thumb, s), s.LeftJoinValue(m, s.favor, s)).FieldsWithCreatedAT(m, s,
s.Key(s, model.USER_UID), model.PLACE_UID, model.SERVICE_NAME, model.TITLE, model.CONTENT,
model.THUMB_COUNT, model.COMMENT_COUNT, model.FAVOR_COUNT, model.SHARE_COUNT, model.THUMB_STATUS, model.FAVOR_STATUS,
s.AS(model.NODENAME, model.SPACE), s.Key(s.command, model.INDEX), model.ARGS,
model.COMMAND_NAME,
)
s.Select(m, s.Key(s, model.UID), m.Option(model.MARKET_UID))
s.SelectJoinRecent(m, model.PLACE_UID)
s.SelectJoinUser(m, model.NAME, model.AVATAR, model.AUTH_UID)
s.SelectJoinAuth(m)
m.PushAction(s.MarketPlaceEnter)
}
func init() { ice.TeamCtxCmd(market{Table: newTable()}) } func init() { ice.TeamCtxCmd(market{Table: newTable()}) }

View File

@ -5,7 +5,7 @@ Volcanos(chat.ONIMPORT, {
can.onmotion.select(can, can.ui.tabs, html.DIV_ITEM, event.target), can.run(event, [], function(msg) { can.onimport._data(can, msg) }) can.onmotion.select(can, can.ui.tabs, html.DIV_ITEM, event.target), can.run(event, [], function(msg) { can.onimport._data(can, msg) })
}}]) }}])
can.page.Append(can, can.ui.tabs, msg.Table(function(value) { can.page.Append(can, can.ui.tabs, msg.Table(function(value) {
return {view: [[html.ITEM, value.uid == domain_uid? html.SELECT: ""], "", value.name], onclick: function(event) { can.misc.Cookie(can, "domain_uid", value.uid) return {view: [[html.ITEM, value.domain_uid == domain_uid? html.SELECT: ""], "", value.name], onclick: function(event) { can.misc.Cookie(can, "domain_uid", value.domain_uid)
can.onmotion.select(can, can.ui.tabs, html.DIV_ITEM, event.target), can.run(event, [], function(msg) { can.onimport._data(can, msg) }) can.onmotion.select(can, can.ui.tabs, html.DIV_ITEM, event.target), can.run(event, [], function(msg) { can.onimport._data(can, msg) })
}} }}
})) }))
@ -17,13 +17,12 @@ Volcanos(chat.ONIMPORT, {
{text: [value.user_name, "", aaa.USERNAME]}, can.onimport.authView(can, value), can.onimport.timeView(can, value), {text: [value.user_name, "", aaa.USERNAME]}, can.onimport.authView(can, value), can.onimport.timeView(can, value),
]}, ]},
{view: html.STATUS, list: [ {view: html.STATUS, list: [
// {text: [value.city_name, "", "city"]}, {text: [value.city_name, "", "city"]},
{text: [value.street_name, "", "street"]}, {text: [value.street_name, "", "street"]},
{text: [value.place_name, "", "place"]}, {text: [value.place_name, "", "place"]},
{text: [value.command_name, "", "command"]}, {text: [value.service_name, "", "service"]},
// {text: [value.service_name.split(" ")[0], "", "service"]},
]}, ]},
{view: html.OUTPUT, list: [value.title]}, {view: html.TITLE, list: [value.command_name, value.title]},
{view: html.OUTPUT, list: [value.content]}, {view: html.OUTPUT, list: [value.content]},
{view: html.ACTION, list: [ {view: html.ACTION, list: [
{view: html.ITEM, list: [{icon: "bi bi-hand-thumbs-up"}, {text: value.thumb_count||"点赞"}], onclick: function(event) { {view: html.ITEM, list: [{icon: "bi bi-hand-thumbs-up"}, {text: value.thumb_count||"点赞"}], onclick: function(event) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -29,7 +29,7 @@ func (s meeting) Enter(m *ice.Message, arg ...string) { m.ProcessOpen(m.Option(
func (s meeting) List(m *ice.Message, arg ...string) { func (s meeting) List(m *ice.Message, arg ...string) {
if s.cmdy(m, s.MeetingList, arg[1:]...); m.Length() > 0 { if s.cmdy(m, s.MeetingList, arg[1:]...); m.Length() > 0 {
if len(arg) == 1 { if len(arg) == 1 {
m.PushAction(s.Enter, s.Modify, s.Cancel).Action(s.Create).Display("") m.PushAction(s.Enter, s.Modify, s.Cancel).Action(s.Create).Display("").DisplayCSS("")
s.SpendlistCheck(m, 0) s.SpendlistCheck(m, 0)
} else if m.IsMobileUA() { } else if m.IsMobileUA() {
m.EchoQRCode(m.Append(model.LINK)).Display("").DisplayCSS("") m.EchoQRCode(m.Append(model.LINK)).Display("").DisplayCSS("")

View File

@ -1 +1,2 @@
$output>div.item.myself div.title span { font-weight:bold; } $output>div.item.myself div.title span { font-weight:bold; }
$output>div.item.card div.title span.role { margin-left:auto; }

View File

@ -52,6 +52,7 @@ func (s member) Enable(m *ice.Message, arg ...string) {
} }
func (s member) List(m *ice.Message, arg ...string) { func (s member) List(m *ice.Message, arg ...string) {
USER_PLACE_ROLE := s.Keys(s.UserPlace, model.ROLE) USER_PLACE_ROLE := s.Keys(s.UserPlace, model.ROLE)
s.Limit(m, 1000)
user_uid, isLeader, isCreator := m.Option(model.USER_UID), s.IsLeader(m), s.IsCreator(m) user_uid, isLeader, isCreator := m.Option(model.USER_UID), s.IsLeader(m), s.IsCreator(m)
s.FieldsWithCreatedAT(m, s.UserPlace, model.USER_UID, s.Keys(s.UserPlace, model.ROLE), s.AS(s.Key(s.UserPlace, model.STATUS), model.MEMBER_STATUS)) s.FieldsWithCreatedAT(m, s.UserPlace, model.USER_UID, s.Keys(s.UserPlace, model.ROLE), s.AS(s.Key(s.UserPlace, model.STATUS), model.MEMBER_STATUS))
if len(arg) == 1 { if len(arg) == 1 {
@ -101,6 +102,7 @@ func (s member) List(m *ice.Message, arg ...string) {
s.SelectJoinUser(m, model.NAME, model.INFO, model.AVATAR, model.AUTH_UID) s.SelectJoinUser(m, model.NAME, model.INFO, model.AVATAR, model.AUTH_UID)
s.SelectJoinAuth(m) s.SelectJoinAuth(m)
s.DisplayBase(m, "").DisplayCSS("") s.DisplayBase(m, "").DisplayCSS("")
m.Echo("count: %d", m.Length())
} }
func init() { ice.TeamCtxCmd(member{Tables: newTables()}) } func init() { ice.TeamCtxCmd(member{Tables: newTables()}) }

View File

@ -6,9 +6,10 @@ Volcanos(chat.ONIMPORT, {
{view: html.TITLE, list: [value.user_name, {view: html.TITLE, list: [value.user_name,
can.onimport.authView(can, value), can.onimport.textView(can, value, USER_PLACE_ROLE), can.onimport.authView(can, value), can.onimport.textView(can, value, USER_PLACE_ROLE),
value.member_status != "normal" && can.onimport.textView(can, value, "member_status"), value.member_status != "normal" && can.onimport.textView(can, value, "member_status"),
can.onimport.titleAction(can, value), // can.onimport.titleAction(can, value),
]}, ]},
{view: html.STATUS, list: [value.user_info]}, {view: html.STATUS, list: [value.user_info]},
can.onimport.titleAction(can, value),
] ]
}) })
}, },

View File

@ -64,8 +64,19 @@ func (s message) List(m *ice.Message, arg ...string) {
}).Action() }).Action()
m.RenameAppend(model.FROM_USER_UID, model.USER_UID) m.RenameAppend(model.FROM_USER_UID, model.USER_UID)
s.SelectJoinRecent(m, model.PLACE_UID) s.SelectJoinRecent(m, model.PLACE_UID)
s.SelectJoinUser(m) // s.SelectJoinUser(m)
s.DisplayBase(m, "") s.DisplayBase(m, "")
msg := m.Spawn()
s.Fields(msg, "status, count(*) AS count").Groups(msg, model.STATUS).Orders(msg, model.STATUS)
s.Select(msg, args...).Table(func(value ice.Maps) {
switch status := kit.Int(value[model.STATUS]); m.CommandKey() {
default:
m.Echo(MessageStatus(status).String()).Echo(": ")
m.Echo(value[model.COUNT]).Echo("\n")
}
})
} else if len(arg) == 2 { } else if len(arg) == 2 {
msg := s.SelectDetail(m.Spawn(), model.TO_USER_UID, m.Option(model.USER_UID), s.Key(s, model.UID), arg[1]) msg := s.SelectDetail(m.Spawn(), model.TO_USER_UID, m.Option(model.USER_UID), s.Key(s, model.UID), arg[1])
s.ProcessPodCmd(m, msg, model.MESSAGE_UID, arg[1]) s.ProcessPodCmd(m, msg, model.MESSAGE_UID, arg[1])
@ -86,6 +97,23 @@ func (s message) Sticky(m *ice.Message, arg ...string) {
func (s message) UnSticky(m *ice.Message, arg ...string) { func (s message) UnSticky(m *ice.Message, arg ...string) {
s.update(m, ice.Map{model.SCORE: 0}) s.update(m, ice.Map{model.SCORE: 0})
} }
func (s message) PlaceEnter(m *ice.Message, arg ...string) {
// m.ProcessField()
}
func (s message) PlaceInfo(m *ice.Message, arg ...string) {
s.Tables(m, s.command, s.service).FieldsWithCreatedAT(m, s,
model.FROM_USER_UID, model.COMMAND_NAME, model.MESSAGE_STATUS, model.SCORE,
model.PLACE_UID, model.SERVICE_NAME,
s.AS(model.NODENAME, model.SPACE), s.Key(s.command, model.INDEX), model.ARGS,
model.TITLE, model.CONTENT,
)
s.Select(m, s.Key(s, model.UID), m.Option(model.MESSAGE_UID))
m.RenameAppend(model.FROM_USER_UID, model.USER_UID)
s.SelectJoinRecent(m, model.PLACE_UID)
s.SelectJoinUser(m, model.NAME, model.AVATAR, model.AUTH_UID)
s.SelectJoinAuth(m)
m.PushAction(s.MessagePlaceEnter)
}
func init() { ice.TeamCtxCmd(message{Table: newTable()}) } func init() { ice.TeamCtxCmd(message{Table: newTable()}) }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -263,13 +263,13 @@ type Notice struct {
type Domain struct { type Domain struct {
db.ModelNameInfo db.ModelNameInfo
Order int `gorm:"default:0"`
} }
type Market struct { type Market struct {
db.ModelContent db.ModelContent
DomainUID string `gorm:"type:char(32);index"` DomainUID string `gorm:"type:char(32);index"`
PlaceUID string `gorm:"type:char(32)"`
UserUID string `gorm:"type:char(32)"`
CommandUID string `gorm:"type:char(32)"` CommandUID string `gorm:"type:char(32)"`
PlaceUID string `gorm:"type:char(32)"`
Args string `gorm:"type:varchar(128)"` Args string `gorm:"type:varchar(128)"`
ThumbCount int `gorm:"default:0"` ThumbCount int `gorm:"default:0"`
CommentCount int `gorm:"default:0"` CommentCount int `gorm:"default:0"`
@ -306,8 +306,8 @@ type Message struct {
db.ModelContent db.ModelContent
FromUserUID string `gorm:"type:char(32)"` FromUserUID string `gorm:"type:char(32)"`
ToUserUID string `gorm:"type:char(32);index"` ToUserUID string `gorm:"type:char(32);index"`
PlaceUID string `gorm:"type:char(32)"`
CommandUID string `gorm:"type:char(32)"` CommandUID string `gorm:"type:char(32)"`
PlaceUID string `gorm:"type:char(32)"`
Args string `gorm:"type:varchar(128)"` Args string `gorm:"type:varchar(128)"`
Status uint `gorm:"default:0"` Status uint `gorm:"default:0"`
Score uint `gorm:"default:0"` Score uint `gorm:"default:0"`

View File

@ -17,7 +17,8 @@ $action div.item.button i { display:none; }
$output div.title div.action div.item.notice input { background-color:var(--notice-bg-color); color:var(--notice-fg-color); } $output div.title div.action div.item.notice input { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
$output { background-color:var(--plugin-bg-color); } $output { background-color:var(--plugin-bg-color); }
$output>div.header { background-image:linear-gradient(var(--notice-bg-color), var(--plugin-bg-color)); height:240px; width:100%; position:absolute; left:0; } $output>div.header { background-image:linear-gradient(var(--notice-bg-color), var(--plugin-bg-color)); height:240px; width:100%; position:absolute; left:0; }
body.light $output>div.header { background-image:url("/p/src/gonganxitong/portal-header.png?pod=20240724-community"); } body.light $output>div.header { background-image:linear-gradient(#dbe7fe, var(--plugin-bg-color)); height:240px; width:100%; position:absolute; left:0; }
// body.light $output>div.header { background-image:url("/p/src/gonganxitong/portal-header.png?pod=20240724-community"); }
$output>div.header img { height:100%; width:100%; object-fit:cover; } $output>div.header img { height:100%; width:100%; object-fit:cover; }
$output>div.action>div.list { margin:0 10px; } $output>div.action>div.list { margin:0 10px; }
$output div.output>div.code { font-size:16px; position:relative; } $output div.output>div.code { font-size:16px; position:relative; }
@ -43,12 +44,14 @@ $output>div>div.list>div.title {
font-weight:bold; display:flex; align-items:center; font-weight:bold; display:flex; align-items:center;
border-left:var(--box-notice3); padding-left:10px; border-left:var(--box-notice3); padding-left:10px;
} }
$output>div>div.list.myallow>div.title { body.mobile $output fieldset.story>div.output>div.place_info { min-height:68px; }
border-left:var(--box-danger3); padding-left:10px; body.mobile $output fieldset.story>div.output>div.place_info>div.item>div.output { background-color:var(--plugin-bg-color); }
} body.mobile $output fieldset.story>div.output>table.detail tr.user_name { display:none; }
$output>div>div.list.myorder>div.title { body.mobile $output fieldset.story>div.output>table.detail tr.user_avatar { display:none; }
border-left:var(--box-danger3); padding-left:10px; body.mobile $output fieldset.story>div.output>table.detail tr.created_at { display:none; }
}
$output>div>div.list.myallow>div.title { border-left:var(--box-danger3); padding-left:10px; }
$output>div>div.list.myorder>div.title { border-left:var(--box-danger3); padding-left:10px; }
$output>div>div.list>div.title span:first-child { flex-grow:1; } $output>div>div.list>div.title span:first-child { flex-grow:1; }
$output>div>div.list>div.title div.action div.item.filter input:focus { width:320px; transition:width 0.5s; } $output>div>div.list>div.title div.action div.item.filter input:focus { width:320px; transition:width 0.5s; }
$output>div>div.list>div.title div.action div.item.filter input { transition:width 0.8s; } $output>div>div.list>div.title div.action div.item.filter input { transition:width 0.8s; }
@ -66,6 +69,7 @@ $output>div>div.list>div.role span.leader.select { border-bottom:var(--box-dange
$output>div>div.list>div.role span.boss.select { border-bottom:var(--box-danger); } $output>div>div.list>div.role span.boss.select { border-bottom:var(--box-danger); }
$output>div>div.list>div.output>div.item.index:not(.hide) { padding:5px 10px; display:flex; flex-direction:column; align-items:center; float:left; } $output>div>div.list>div.output>div.item.index:not(.hide) { padding:5px 10px; display:flex; flex-direction:column; align-items:center; float:left; }
$output>div>div.list>div.output>div.item.index img { height:36px; width:36px; object-fit:contain; } $output>div>div.list>div.output>div.item.index img { height:36px; width:36px; object-fit:contain; }
$output>div>div.list>div.output>div.item.index i { font-size:22px; padding:5px; }
$output>div>div.list>div.output>div.item.index span { font-size:12px; white-space:pre; max-width:80px; } $output>div>div.list>div.output>div.item.index span { font-size:12px; white-space:pre; max-width:80px; }
$output>div>div.list div.code { text-align:center; } $output>div>div.list div.code { text-align:center; }
$output>div>div.list div.code input { background-color:var(--notice-bg-color); color:var(--notice-fg-color); font-size:18px; margin:auto; min-width:200px; display:block; margin-top:10px; } $output>div>div.list div.code input { background-color:var(--notice-bg-color); color:var(--notice-fg-color); font-size:18px; margin:auto; min-width:200px; display:block; margin-top:10px; }
@ -80,14 +84,16 @@ $output div.item.card>div.output>div { width:100%; width:calc(100% - 53px); over
$output div.item.card div.title { width:100%; display:flex; position:relative; } $output div.item.card div.title { width:100%; display:flex; position:relative; }
$output div.item.card div.title span.type { line-height:22px; } $output div.item.card div.title span.type { line-height:22px; }
$output div.item.card div.title span.status { line-height:22px; } $output div.item.card div.title span.status { line-height:22px; }
$output div.item.card div.title span.price { margin-left:auto; } $output div.item.card div.title span.price { color:var(--danger-bg-color); margin-left:auto; }
$output div.item.card div.title span.auth { font-size:14px; padding:3px; } $output div.item.card div.title span.auth { font-size:14px; padding:3px; }
$output div.item.card div.title span.time { position:absolute; right:0; font-size:12px; color:gray; } $output div.item.card div.title span.time { position:absolute; right:0; font-size:12px; color:gray; }
$output div.item.card div.title span:first-child { word-break:break-all; } $output div.item.card div.title span:first-child { word-break:break-all; }
$output fieldset.story>div.item.card div.title span { line-height:26px; } $output fieldset.story>div.item.card div.title span { line-height:26px; }
// $output div.item.card>div.output>div.container>div.title span { line-height:26px; } // $output div.item.card>div.output>div.container>div.title span { line-height:26px; }
$output div.item.title { border-left:var(--box-notice3); margin-left:10px; padding:10px; background-color:var(--output-bg-color); } // $output div.item.title { border-left:var(--box-notice3); margin-left:10px; padding:10px; background-color:var(--output-bg-color); }
$output div.item.title { border-left:var(--box-notice3); margin-left:10px; padding:10px; background-color:var(--plugin-bg-color); }
$output div.item.title.dealList { border-left:var(--box-danger3); } $output div.item.title.dealList { border-left:var(--box-danger3); }
$output div.item.title.meetList { border-left:var(--box-danger3); }
$body div.inputs>div.input.float>div.action { display:flex; } $body div.inputs>div.input.float>div.action { display:flex; }
$output div.item.card div.title div.action input { margin-right:0; } $output div.item.card div.title div.action input { margin-right:0; }
@ -130,15 +136,16 @@ $output fieldset.story>legend { display:none; }
$output fieldset.story>form.option { display:none; } $output fieldset.story>form.option { display:none; }
$output fieldset.story>div.action { display:none; } $output fieldset.story>div.action { display:none; }
$output fieldset.story>div.status { display:none; } $output fieldset.story>div.status { display:none; }
$output fieldset.story>div.output { background-color:var(--plugin-bg-color); } $output>fieldset.story>div.output { background-color:var(--plugin-bg-color); }
$output fieldset.story>div.output div.code { padding:0; } $output fieldset.story>div.output div.code { padding:0; }
$output fieldset.story>div.output table.content td { box-shadow:none; } $output fieldset.story>div.output table.content td { box-shadow:none; }
$output fieldset.story>div.output table.content.detail td:last-child { text-align:left; }
$output fieldset.story>div.output table.content td img { max-width:100%; } $output fieldset.story>div.output table.content td img { max-width:100%; }
$output fieldset.story>div.output table.content tr.icon td img { max-height:128px; max-width:128px; } $output fieldset.story>div.output table.content tr.icon td img { max-height:128px; max-width:128px; }
$output fieldset.story>div.output table.content tr.user_avatar td img { max-height:128px; max-width:128px; } $output fieldset.story>div.output table.content tr.user_avatar td img { max-height:128px; max-width:128px; }
$output fieldset.story>div.output table.content tr.auth_avatar td img { max-height:128px; max-width:128px; } $output fieldset.story>div.output table.content tr.auth_avatar td img { max-height:128px; max-width:128px; }
$output fieldset.story>div.output>div.code { text-align:center; } $output fieldset.story>div.output>div.code { text-align:center; }
$output fieldset.story>div.output>div.code { display:flex; flex-direction:column; row-gap:10px; margin-top:20px; } $output fieldset.story>div.output>div.code { display:flex; flex-direction:column; row-gap:10px; margin-top:20px; margin-bottom:20px; }
$output fieldset.story>div.output>div.code>img { display:block; margin:auto; width:100%; max-width:320px; } $output fieldset.story>div.output>div.code>img { display:block; margin:auto; width:100%; max-width:320px; }
$output fieldset.story>div.output>div.code>input[type=button] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); float:right; } $output fieldset.story>div.output>div.code>input[type=button] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); float:right; }
$output fieldset.story>div.output>div.code>input[type=button].danger { border:var(--box-danger); background-color:transparent; color:var(--danger-bg-color); } $output fieldset.story>div.output>div.code>input[type=button].danger { border:var(--box-danger); background-color:transparent; color:var(--danger-bg-color); }
@ -147,6 +154,7 @@ $output fieldset.story>div.output>div.code div.item.button input[type=button] {
$output fieldset.story>div.output>div.code div.item.button input[type=button][name=cancel] { border:var(--box-border); background-color:var(--danger-bg-color); color:var(--danger-fg-color); } $output fieldset.story>div.output>div.code div.item.button input[type=button][name=cancel] { border:var(--box-border); background-color:var(--danger-bg-color); color:var(--danger-fg-color); }
$output fieldset.story>div.output>div.code div.item.button.danger input[type=button] { background-color:var(--danger-bg-color); color:var(--danger-fg-color); } $output fieldset.story>div.output>div.code div.item.button.danger input[type=button] { background-color:var(--danger-bg-color); color:var(--danger-fg-color); }
$output>fieldset.story>div.output div.item.card>div.output { padding:10px; width:100%; } $output>fieldset.story>div.output div.item.card>div.output { padding:10px; width:100%; }
$output>fieldset.story>div.output div.item.card.loaded>div.output { background-color:var(--plugin-bg-color); }
$output>fieldset.story>div.output div.item.card>div.output div.output { padding:5px 0; white-space:pre-line; } $output>fieldset.story>div.output div.item.card>div.output div.output { padding:5px 0; white-space:pre-line; }
$output fieldset.story.form>div.output>div.code>input[type=button] { font-size:18px; margin:10px; height:36px; } $output fieldset.story.form>div.output>div.code>input[type=button] { font-size:18px; margin:10px; height:36px; }
$output>fieldset.story.web.team.renzhengshouquan.profile { margin-top:0; } $output>fieldset.story.web.team.renzhengshouquan.profile { margin-top:0; }
@ -160,7 +168,7 @@ $output>fieldset.market>div.output>div.tabs { display:flex; width:100%; overflow
$output>fieldset.market>div.output>div.tabs>div.item { padding:5px 10px; float:left; white-space:pre; } $output>fieldset.market>div.output>div.tabs>div.item { padding:5px 10px; float:left; white-space:pre; }
$output>fieldset.market>div.output>div.tabs>div.item.select { border-top:var(--box-danger); background-color:var(--output-bg-color); color:var(--danger-bg-color); font-weight:bold; position:sticky; left:0; right:0; } $output>fieldset.market>div.output>div.tabs>div.item.select { border-top:var(--box-danger); background-color:var(--output-bg-color); color:var(--danger-bg-color); font-weight:bold; position:sticky; left:0; right:0; }
$output>fieldset.market>div.output>div.list div.item.card img { border-radius:50%; height:40px; width:40px; min-width:40px; } $output>fieldset.market>div.output>div.list div.item.card img { border-radius:50%; height:40px; width:40px; min-width:40px; }
$output>fieldset.market>div.output>div.list div.item.card div.status { font-size:14px; } $output>fieldset.market>div.output>div.list div.item.card div.status { font-size:12px; }
$output>fieldset.market>div.output>div.list div.item.card div.status>span.username { color:var(--body-fg-color); font-size:14px; } $output>fieldset.market>div.output>div.list div.item.card div.status>span.username { color:var(--body-fg-color); font-size:14px; }
$output>fieldset.market>div.output>div.list div.item.card div.status>span.time { float:right; } $output>fieldset.market>div.output>div.list div.item.card div.status>span.time { float:right; }
$output>fieldset.market>div.output>div.list div.item.card div.output div.action { color:gray; font-size:14px; width:100%; max-width:100%; display:flex; justify-content:space-around; position:relative; } $output>fieldset.market>div.output>div.list div.item.card div.output div.action { color:gray; font-size:14px; width:100%; max-width:100%; display:flex; justify-content:space-around; position:relative; }
@ -174,7 +182,7 @@ body.dark $output>div>div.list.mynotice>span:first-child { background-color:var(
body.width1 fieldset.panel.Action>div.output { background-color:var(--plugin-bg-color); } body.width1 fieldset.panel.Action>div.output { background-color:var(--plugin-bg-color); }
body.width1 div.input.float { margin:0; width:100% !important; max-width:100% !important; } body.width1 div.input.float { margin:0; width:100% !important; max-width:100% !important; }
body.width1 div.input.float input[name=submit] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); } body.width1 div.input.float input[name=submit] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
body.width1 $output img.qrcode { width:100%; margin:0; } // body.width1 $output img.qrcode { width:100%; margin:0; }
body.width1 $output>div>div.list>div.title div.action div.item.filter input:focus { width:200px; transition:width 0.5s; } body.width1 $output>div>div.list>div.title div.action div.item.filter input:focus { width:200px; transition:width 0.5s; }
body.width6 $output>div.output>div.code img.avatar { top:183px; } body.width6 $output>div.output>div.code img.avatar { top:183px; }
body:not(.width1) $output div.item.card { flex-direction:row-reverse; } body:not(.width1) $output div.item.card { flex-direction:row-reverse; }
@ -189,5 +197,5 @@ body:not(.mobile) $action div.item.notice input[type=button]:hover { background-
body.en $output>fieldset table.content td:first-child { max-width:190px; min-width:100px; width:unset;} body.en $output>fieldset table.content td:first-child { max-width:190px; min-width:100px; width:unset;}
body.en $output>fieldset table.content td { padding: 10px 5px; } body.en $output>fieldset table.content td { padding: 10px 5px; }
fieldset.web.team.storage.file div.item.card div.title span:first-child { flex-grow:1; } fieldset.web.team.storage.file div.item.card div.title span:first-child { flex-grow:1; }
fieldset.web.team.renzhengshouquan.profile>div.output div.code { margin-top:60px; margin-bottom:240px; } // fieldset.web.team.renzhengshouquan.profile>div.output div.code { margin-top:60px; margin-bottom:240px; }
$fieldset { box-shadow:none; } $fieldset { box-shadow:none; }

View File

@ -16,7 +16,6 @@ import (
"shylinux.com/x/mysql-story/src/db" "shylinux.com/x/mysql-story/src/db"
) )
// "member": "https://img.icons8.com/officel/80/person-at-home.png",
type Portal struct { type Portal struct {
ice.Hash ice.Hash
Table Table
@ -32,7 +31,6 @@ type Portal struct {
create string `name:"create index name icons"` create string `name:"create index name icons"`
list string `name:"list place_uid index uid auto" role:"void"` list string `name:"list place_uid index uid auto" role:"void"`
placeCreate string `name:"placeCreate city_name* street_name* place_name* place_type:select address" icon:"bi bi-plus-circle" role:"void"` placeCreate string `name:"placeCreate city_name* street_name* place_name* place_type:select address" icon:"bi bi-plus-circle" role:"void"`
// placeCreate string `name:"placeCreate city_name* street_name* place_name* place_type:select address" icon:"bi bi-plus-square" role:"void"`
placeRemove string `name:"placeRemove" role:"void"` placeRemove string `name:"placeRemove" role:"void"`
} }
@ -79,6 +77,11 @@ func (s Portal) Command(m *ice.Message, arg ...string) {
} }
} }
func (s Portal) Run(m *ice.Message, arg ...string) { func (s Portal) Run(m *ice.Message, arg ...string) {
if m.Option(model.MESSAGE_UID) != "" {
msg := m.Cmd(message{}, s.Table.Select, model.UID, m.Option(model.MESSAGE_UID))
m.Option(s.Keys(s.Place, model.UID), msg.Append(model.PLACE_UID))
m.Option(model.PLACE_UID, msg.Append(model.PLACE_UID))
}
if cmdPortal[arg[0]] != "" && cmdPortal[arg[0]] != m.PrefixKey() { if cmdPortal[arg[0]] != "" && cmdPortal[arg[0]] != m.PrefixKey() {
s.AutoCmdy(m, cmdPortal[arg[0]], ctx.ACTION, m.ActionKey(), arg) s.AutoCmdy(m, cmdPortal[arg[0]], ctx.ACTION, m.ActionKey(), arg)
return return
@ -154,6 +157,12 @@ func (s Portal) List(m *ice.Message, arg ...string) {
defer m.EchoQRCode(m.Cmdx("", s.Link, arg[0])) defer m.EchoQRCode(m.Cmdx("", s.Link, arg[0]))
} }
s.Hash.List(m).SortInt(mdb.ORDER) s.Hash.List(m).SortInt(mdb.ORDER)
m.RewriteAppend(func(value, key string, index int) string {
if key == "icons" {
value = m.Resource(value)
}
return value
})
} }
s.Place.RewriteAppend(m) s.Place.RewriteAppend(m)
if true { if true {
@ -352,7 +361,7 @@ func (s Portal) RecordEvent(m *ice.Message, arg ...string) {
s.event.Record(m.Spawn(kit.Dict(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))), arg[0], arg[1:]...) s.event.Record(m.Spawn(kit.Dict(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))), arg[0], arg[1:]...)
} }
func (s Portal) MarketInsert(m *ice.Message, arg ...string) { func (s Portal) MarketInsert(m *ice.Message, arg ...string) {
m.Option(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID))) // m.Option(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))
m.Option(ctx.ARGS, kit.Join([]string{m.Option(model.PLACE_UID), m.Option(model.UID)})) m.Option(ctx.ARGS, kit.Join([]string{m.Option(model.PLACE_UID), m.Option(model.UID)}))
m.Cmdy(s.Prefix(m, market{}), s.Create, arg) m.Cmdy(s.Prefix(m, market{}), s.Create, arg)
} }
@ -442,8 +451,12 @@ func (s Portal) Link(m *ice.Message, arg ...string) *ice.Message {
if len(arg) == 0 { if len(arg) == 0 {
return m.Echo(m.MergePodCmd("", s.Prefix(m, s))) return m.Echo(m.MergePodCmd("", s.Prefix(m, s)))
} }
return m.Echo(m.MergePodCmd("", s.Prefix(m, s), s.Keys(s.Place, model.UID), arg[0]) + p := m.MergePodCmd("", s.Prefix(m, s), s.Keys(s.Place, model.UID), arg[0])
"#" + kit.TrimSuffix(kit.Join([]string{arg[0], kit.Select("", arg, 1), kit.Select("", arg, 2)}, ":"), ":", ":")) if len(arg) == 1 {
return m.Echo(p)
}
h := kit.TrimSuffix(kit.Join([]string{arg[0], kit.Select("", arg, 1), kit.Select("", arg, 2)}, ":"), ":", ":")
return m.Echo(p + "#" + h)
} }
func init() { ice.TeamCtxCmd(Portal{Table: newTable()}) } func init() { ice.TeamCtxCmd(Portal{Table: newTable()}) }

View File

@ -1,13 +1,17 @@
var UID = "uid", PLACE_UID = "place_uid", PLACE_NAME = "place_name", PLACE_TYPE = "place_type", STREET_NAME = "street_name", CITY_NAME = "city_name" var UID = "uid", PLACE_UID = "place_uid", PLACE_NAME = "place_name", PLACE_TYPE = "place_type", STREET_NAME = "street_name", CITY_NAME = "city_name"
var USER_UID = "user_uid", USER_ROLE = "user_role", AUTH_UID = "auth_uid", AUTH_TYPE = "auth_type" var USER_UID = "user_uid", USER_ROLE = "user_role", AUTH_UID = "auth_uid", AUTH_TYPE = "auth_type"
Volcanos(chat.ONIMPORT, { Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { can.onappend.style(can, html.OUTPUT), can.onimport.myPortal(can, msg) }, _init: function(can, msg) {
can.onappend.style(can, html.OUTPUT), can.onimport.myPortal(can, msg)
},
otherList: function(can, msg, action) { if (!msg.IsDetail()) { return } typeof action == "string" && (action = [action]) otherList: function(can, msg, action) { if (!msg.IsDetail()) { return } typeof action == "string" && (action = [action])
can.core.Next(action, function(action, next) { can.core.Next(action, function(action, next) {
can.run(can.request({}, {uid: msg.Append(UID)}), action, function(msg) { if (msg.Length() == 0) { return next() } can.run(can.request({}, {uid: msg.Append(UID)}), action, function(msg) { if (msg.Length() == 0) { return next() }
can.page.Append(can, can._output, [{view: [[html.ITEM, html.TITLE, action], "", can.user.trans(can, action)]}]) can.page.Append(can, can._output, [{view: [[html.ITEM, html.TITLE, action], "", can.user.trans(can, action)]}])
can.onappend.plugin(can, {index: can.ConfIndex()}, function(sub) { can.onimport.myField(can, sub) can.onappend.plugin(can, {index: can.ConfIndex()}, function(sub) { can.onimport.myField(can, sub)
sub.run = function(event, cmds, cb) { if (!cmds || cmds.length == 0) { cb(msg) } }, next() sub.run = function(event, cmds, cb) {
if (!cmds || cmds.length == 0) { cb(msg) } else { can.run(event, cmds, cb) }
}, next()
sub.onexport.output = function(_sub, msg) { sub.onexport.output = function(_sub, msg) {
_sub.onaction.carddetail = function(event, _sub, value) { _sub.onaction.carddetail = function(event, _sub, value) {
can.onimport.myStory(can, {index: msg.Option("_command"), args: [msg.Option("place_uid"), value.uid]}) can.onimport.myStory(can, {index: msg.Option("_command"), args: [msg.Option("place_uid"), value.uid]})
@ -140,9 +144,9 @@ Volcanos(chat.ONIMPORT, {
(can.page.tagis(document.body, "body.width1") || can.user.isMobile && !can.user.isLandscape()) && (width = (can.ConfWidth()-40)/5) (can.page.tagis(document.body, "body.width1") || can.user.isMobile && !can.user.isLandscape()) && (width = (can.ConfWidth()-40)/5)
can.page.Append(can, target, msg.Table(function(value) { if (value.enable == ice.FALSE) { return } can.page.Append(can, target, msg.Table(function(value) { if (value.enable == ice.FALSE) { return }
if ((value.portal || value.public) && can.page.tagis(can._output, "div.output.public")) { if ((value.portal || value.public) && can.page.tagis(can._output, "div.output.public")) {
can.onimport.myTitle(can, value.index, value.name, can.ui.mylist) can.onimport.myTitle(can, value.index, value.name, can.ui.mylist), can.onmotion.toggle(can, can.ui.mylist, true)
can.onmotion.toggle(can, can.ui.mylist, true)
can.onappend.plugin(can, {index: value.index, args: [can.sup.current._uid]}, function(sub) { can.onappend.plugin(can, {index: value.index, args: [can.sup.current._uid]}, function(sub) {
sub.onimport._field = function(msg) { msg.Table(function(value) { can.onimport.myStory(can, value) }) }
sub.onexport.output = function(_sub, msg) { sub.onexport.output = function(_sub, msg) {
_sub.onaction.carddetail = function(event, _sub, value) { _sub.onaction.carddetail = function(event, _sub, value) {
can.onimport.myStory(can, {index: sub.ConfIndex(), args: [can.sup.current._uid, value.uid]}) can.onimport.myStory(can, {index: sub.ConfIndex(), args: [can.sup.current._uid, value.uid]})
@ -151,11 +155,23 @@ Volcanos(chat.ONIMPORT, {
} }
}, can.ui.mylist) }, can.ui.mylist)
} }
var cmd = value.index.split(".").pop()
return {view: [[html.ITEM, ctx.INDEX].concat( 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||""), value.type? [mdb.TYPE]: [], can.core.Split(value.type||""), value.role? [aaa.ROLE]: [], can.core.Split(value.role||""),
value.auth, value.view, value.auth, value.view,
)], style: {width: width}, list: [ )], style: {width: width}, list: [
{img: can.misc.ResourceIcons(can, value.icons)}, {text: can.user.trans(can, value.index.split(".").pop(), value.name)}, cmd == "market"? {icon: "bi bi-ubuntu"}:
cmd == "message"? {icon: "bi bi-card-checklist"}:
cmd == "recent"? {icon: "bi bi-clock-history"}:
cmd == "service"? {icon: "bi bi-box"}:
cmd == "support"? {icon: "bi bi-opencollective"}:
cmd == "qrcode"? {icon: "bi bi-qr-code"}:
cmd == "apply"? {icon: "bi bi-pencil-square"}:
cmd == "allow"? {icon: "bi bi-clipboard-check"}:
cmd == "event"? {icon: "bi bi-calendar4-week"}:
cmd == "notice"? {icon: "bi bi-megaphone"}:
{img: can.misc.ResourceIcons(can, value.icons)},
{text: can.user.trans(can, value.index.split(".").pop(), value.name)},
], onclick: function(event) { ], onclick: function(event) {
can.onimport.myStory(can, {space: can.ConfSpace(), index: value.index, args: [can.onexport.place(can)||can.misc.Search(can, can.Conf("_place_uid"))]}) can.onimport.myStory(can, {space: can.ConfSpace(), index: value.index, args: [can.onexport.place(can)||can.misc.Search(can, can.Conf("_place_uid"))]})
}} }}
@ -188,7 +204,8 @@ Volcanos(chat.ONIMPORT, {
layout: function(can) { layout: function(can) {
can.ui.tabs && can.ui.list && can.page.styleHeight(can, can.ui.list, can.ConfHeight()-can.ui.tabs.offsetHeight) can.ui.tabs && can.ui.list && can.page.styleHeight(can, can.ui.list, can.ConfHeight()-can.ui.tabs.offsetHeight)
if (can.ui.action && can.ui.output) { if (can.ui.action && can.ui.output) {
can.page.style(can, can.ui.output, html.HEIGHT, (can.user.isMobile? window.innerHeight: can.ConfHeight()) - can.ui.action.offsetHeight) // can.page.style(can, can.ui.output, html.HEIGHT, (can.user.isMobile? window.innerHeight: can.ConfHeight()) - can.ui.action.offsetHeight)
can.page.style(can, can.ui.output, html.HEIGHT, (can.ConfHeight()) - can.ui.action.offsetHeight)
} }
}, },
}) })

View File

@ -10,6 +10,7 @@
"read": "已读", "done": "完成", "sticky": "置顶", "unSticky": "取消置顶", "read": "已读", "done": "完成", "sticky": "置顶", "unSticky": "取消置顶",
"autogen": "生成", "compile": "编译", "oauth": "授权", "project": "项目", "autogen": "生成", "compile": "编译", "oauth": "授权", "project": "项目",
"marketInsert": "推广", "marketInsert": "推广",
"marketPlaceEnter": "进入",
"pushPublic": "推广", "pushPublic": "推广",
"applyCreate": "申请权限", "applyCreate": "申请权限",
"commentCreate": "评论", "applyQRCode": "邀请码", "commentCreate": "评论", "applyQRCode": "邀请码",
@ -18,6 +19,8 @@
"config": "配置", "code": "编程", "data": "数据", "cache": "缓存", "config": "配置", "code": "编程", "data": "数据", "cache": "缓存",
"promote": "升级", "demote": "降级", "promote": "升级", "demote": "降级",
"icons": { "icons": {
"market": "bi bi-ubuntu",
"message": "bi bi-card-checklist",
"goodslist": "https://img.icons8.com/officel/80/online-store.png", "goodslist": "https://img.icons8.com/officel/80/online-store.png",
"paymentlist": "https://img.icons8.com/officel/80/online-payment-with-a-credit-card.png", "paymentlist": "https://img.icons8.com/officel/80/online-payment-with-a-credit-card.png",
"meeting": "https://img.icons8.com/officel/80/video-conference.png", "meeting": "https://img.icons8.com/officel/80/video-conference.png",
@ -26,6 +29,7 @@
"photo": "https://img.icons8.com/officel/80/ios-photos.png" "photo": "https://img.icons8.com/officel/80/ios-photos.png"
}, },
"style": { "style": {
"marketPlaceEnter": "notice",
"reject": "danger", "reject": "danger",
"approve": "notice", "approve": "notice",
"disable": "danger", "disable": "danger",

View File

@ -1,13 +1,15 @@
Volcanos(chat.ONIMPORT, { Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { _init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { if (value.score > 0) { value._style = ["sticky"] } can.onimport.myView(can, msg, function(value) { value._style = []; if (value.score > 0) { value._style = ["sticky"] }
if (can._stacks_root._stacks[[value.space,value.index, value.place_uid].join(",")]) { value._style.push("loaded") }
value.icons = can.misc.Resource(can, value.service_icon.split("?")[0], value.space) value.icons = can.misc.Resource(can, value.service_icon.split("?")[0], value.space)
return [ return [
{view: html.TITLE, list: [value.place_name, can.onimport.authView(can, value), can.onimport.timeView(can, value)]}, {view: html.TITLE, list: [value.place_name, can.onimport.authView(can, value), can.onimport.timeView(can, value)]},
{view: html.STATUS, list: [value.city_name, value.street_name, value.service_name]}, {view: html.STATUS, list: [value.city_name, value.street_name, value.service_name]},
] ]
}, function(event, value) { can.onaction._goback(event, function() { }, function(event, value) { can.onaction._goback(event, function() {
can.onimport.myPlugin(can, {space: value.space, index: value.index, args: [value.place_uid]}) // can.onimport.myPlugin(can, {space: value.space, index: value.index, args: [value.place_uid]})
can.onimport.myStory(can, {space: value.space, index: value.index, args: [value.place_uid]})
}) }) }) })
}, },
}) })

View File

@ -8,7 +8,8 @@ Volcanos(chat.ONIMPORT, {
{view: html.STATUS, list: [value.module, value.version]}, {view: html.STATUS, list: [value.module, value.version]},
] ]
}, function(event, value) { can.onaction._goback(event, function() { }, function(event, value) { can.onaction._goback(event, function() {
can.onimport.myPlugin(can, {space: value.space, index: value.index}) // can.onimport.myPlugin(can, {space: value.space, index: value.index})
can.onimport.myStory(can, {space: value.space, index: value.index})
}) }) }) })
}, },
}) })

View File

@ -12,16 +12,20 @@ type Auth struct {
cert cert cert cert
order string `data:"2"` order string `data:"2"`
models string `data:"auth"` models string `data:"auth"`
fields string `data:"from_uid,name,info,auth_type,auth_status,avatar,background,service_uid,place_uid,user_uid"` fields string `data:"from_uid,score,name,info,auth_type,auth_status,avatar,background,service_uid,place_uid,user_uid"`
memberList string `name:"memberList" role:"leader,worker"` memberList string `name:"memberList" role:"worker"`
certList string `name:"certList" role:"leader,worker"` certList string `name:"certList" role:"worker"`
issue string `name:"issue" role:"leader,worker"` issue string `name:"issue" role:"worker"`
revoke string `name:"revoke" role:"leader,worker"` revoke string `name:"revoke" role:"worker"`
setScore string `name:"setScore score" role:"void"`
} }
func (s Auth) Remove(m *ice.Message, arg ...string) { func (s Auth) Remove(m *ice.Message, arg ...string) {
s.Delete(m) s.Delete(m)
} }
func (s Auth) SetScore(m *ice.Message, arg ...string) {
s.Update(m, arg, m.OptionSimple(model.UID)...)
}
func (s Auth) List(m *ice.Message, arg ...string) { func (s Auth) List(m *ice.Message, arg ...string) {
if len(arg) == 1 { if len(arg) == 1 {
s.Select(m, model.FROM_UID, arg[0]).Action() s.Select(m, model.FROM_UID, arg[0]).Action()
@ -36,7 +40,7 @@ func (s Auth) List(m *ice.Message, arg ...string) {
case AuthCreate: case AuthCreate:
m.PushButton(s.Issue, s.Remove) m.PushButton(s.Issue, s.Remove)
case AuthIssued: case AuthIssued:
m.PushButton(s.Revoke) m.PushButton(s.Revoke, s.SetScore)
case AuthRevoked: case AuthRevoked:
m.PushButton(s.Issue, s.Remove) m.PushButton(s.Issue, s.Remove)
default: default:

View File

@ -1,7 +1,7 @@
Volcanos(chat.ONIMPORT, { Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { _init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [ can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.name, can.onimport.textView(can, value, AUTH_TYPE), can.onimport.titleAction(can, value)]}, {view: html.TITLE, list: [value.name, value.score, can.onimport.textView(can, value, AUTH_TYPE), can.onimport.titleAction(can, value)]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), can.onimport.textView(can, value)]}, {view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), can.onimport.textView(can, value)]},
] }) ] })
}, },

View File

@ -46,7 +46,8 @@ func (s Table) AuthList(m *ice.Message, auth_uid string, cb func(value ice.Maps,
} }
func (s Table) authSort(m *ice.Message, arg ...string) { func (s Table) authSort(m *ice.Message, arg ...string) {
s.RewriteAppend(m) s.RewriteAppend(m)
m.Sort("auth_status,auth_type,created_at", []string{"issued"}, []string{"personal", "root", "city", "street", "school", "company", "service"}, ice.STR_R) m.Sort("auth_status,auth_type,score,created_at", []string{"issued"},
[]string{"personal", "root", "city", "street", "school", "company", "service"}, ice.INT_R, ice.STR_R)
} }
func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message { func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
m.RewriteAppend(func(value, key string, index int) string { m.RewriteAppend(func(value, key string, index int) string {

View File

@ -9,6 +9,7 @@ const (
TYPE = "type" TYPE = "type"
ROLE = "role" ROLE = "role"
STATUS = "status" STATUS = "status"
SCORE = "score"
TITLE = "title" TITLE = "title"
CONTENT = "content" CONTENT = "content"
AVATAR = "avatar" AVATAR = "avatar"
@ -63,6 +64,7 @@ type Auth struct {
StorageUID string `gorm:"type:char(32)"` StorageUID string `gorm:"type:char(32)"`
DashboardUID string `gorm:"type:char(32)"` DashboardUID string `gorm:"type:char(32)"`
Status uint8 `gorm:"default:0"` Status uint8 `gorm:"default:0"`
Score uint8 `gorm:"default:0"`
} }
type Cert struct { type Cert struct {
db.ModelWithUID db.ModelWithUID

View File

@ -1,3 +1,5 @@
$output>div>div.title { border-left:var(--box-notice3); padding:10px; margin-left:10px; } $output>div>div.title { border-left:var(--box-notice3); padding:10px; margin-left:10px; }
$output>div.from>div.title { border-left:var(--box-danger3); } $output>div.from>div.title { border-left:var(--box-danger3); }
$output div.item.card div.title span.type { margin-left:auto; }
$output div.item.card div.title div.action { top:24px; }
$output>div.head { margin-bottom:0; } $output>div.head { margin-bottom:0; }

View File

@ -62,7 +62,8 @@ Volcanos(chat.ONACTION, {
if (msg.Option("auth_type") == "company") { if (msg.Option("auth_type") == "company") {
can.user.open(can.misc.MergePodCmd(can, {pod: "20240724-community", cmd: "web.team.renzhengshouquan.admin", auth_uid: msg.Option("auth_uid"), view: "admin"})) can.user.open(can.misc.MergePodCmd(can, {pod: "20240724-community", cmd: "web.team.renzhengshouquan.admin", auth_uid: msg.Option("auth_uid"), view: "admin"}))
} else { } else {
can.onimport.myPlugin(can, {space: msg.Option("nodename"), index: msg.Option(ctx.INDEX), args: [msg.Option(PLACE_UID)]}) can.onimport.myStory(can, {space: msg.Option("nodename"), index: msg.Option(ctx.INDEX), args: [msg.Option(PLACE_UID)]})
// can.onimport.myPlugin(can, {space: msg.Option("nodename"), index: msg.Option(ctx.INDEX), args: [msg.Option(PLACE_UID)]})
} }
can.page.ClassList.del(can, can._fields, "_process") can.page.ClassList.del(can, can._fields, "_process")
}, },