mirror of
https://shylinux.com/x/community
synced 2025-07-01 21:21:19 +08:00
add some
This commit is contained in:
parent
d01dd2dc63
commit
e2ed5278f5
@ -214,18 +214,21 @@ func (s Table) DoneMessage(m *ice.Message, arg ...string) {
|
|||||||
m.Spawn(ice.Maps{db.DB: ""}).Cmd(message{}, message{}.Done, kit.Dict(model.UID, m.Option(model.MESSAGE_UID)))
|
m.Spawn(ice.Maps{db.DB: ""}).Cmd(message{}, message{}.Done, kit.Dict(model.UID, m.Option(model.MESSAGE_UID)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (s Table) SendTemplate(m *ice.Message, from, user_uid, title string, arg ...string) {
|
func (s Table) SendTemplate(m *ice.Message, from, to, title string, arg ...string) {
|
||||||
if m.IsErr() {
|
if m.IsErr() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
name := kit.Select("", arg, 0)
|
m.Cmd(Portal{}, m.PrefixKey(), from, to, title, arg)
|
||||||
|
}
|
||||||
|
func (s Portal) SendTemplate(m *ice.Message, arg ...string) {
|
||||||
|
name := kit.Select("", arg, 4)
|
||||||
if name == "" {
|
if name == "" {
|
||||||
name = m.Option(s.Keys(s.Place, model.NAME)) + " " + s.Place.TransValue(m, s.Keys(s.UserPlace, model.ROLE))
|
name = m.Option(s.Keys(s.Place, model.NAME)) + " " + s.Place.TransValue(m, s.Keys(s.UserPlace, model.ROLE))
|
||||||
}
|
}
|
||||||
uid, place_uid := kit.Select(m.Option(model.UID), arg, 1), kit.Select("", arg, 2)
|
uid, place_uid := kit.Select(m.Option(model.UID), arg, 5), kit.Select("", arg, 6)
|
||||||
kit.If(place_uid == "", func() { place_uid = m.Option(s.Keys(s.Place, model.UID)) })
|
kit.If(place_uid == "", func() { place_uid = m.Option(s.Keys(s.Place, model.UID)) })
|
||||||
link := Portal{}.Link(m, place_uid, m.PrefixKey(), uid)
|
link := Portal{}.Link(m, place_uid, arg[0], uid)
|
||||||
m.Cmd(user{}, s.SendTemplate, from, user_uid, link, title, name, kit.Cut(uid, 6))
|
m.Cmd(user{}, s.SendTemplate, arg[1], arg[2], link, arg[3], name, kit.Cut(uid, 6))
|
||||||
}
|
}
|
||||||
func (s Table) DisplayBase(m *ice.Message, file string) *ice.Message {
|
func (s Table) DisplayBase(m *ice.Message, file string) *ice.Message {
|
||||||
if s.Place != nil {
|
if s.Place != nil {
|
||||||
|
@ -7,7 +7,7 @@ $output div.item.card div.title span.time { position:absolute; right:0; font-siz
|
|||||||
$output div.item.card div.status span { word-break:break-all; }
|
$output div.item.card div.status span { word-break:break-all; }
|
||||||
$output div.item.card img { border-radius:5px; padding:0; margin:0; margin-right:10px; height:48px; width:48px; }
|
$output div.item.card img { border-radius:5px; padding:0; margin:0; margin-right:10px; height:48px; width:48px; }
|
||||||
$output div.item.card.sticky>div.output { background-color:var(--plugin-bg-color); color:var(--notice-bg-color); }
|
$output div.item.card.sticky>div.output { background-color:var(--plugin-bg-color); color:var(--notice-bg-color); }
|
||||||
$output>div>div.list { border-radius:10px; background-color:var(--output-bg-color); padding:10px; margin:10px; }
|
$output>div>div.list { box-shadow:var(--box-shadow); 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 { 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 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 { margin-right:5px; }
|
||||||
@ -22,7 +22,7 @@ $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 { 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 input[type=button] { color:var(--notice-bg-color); border:none; }
|
||||||
$output>div>div.list>div.action div.item i { display:none; }
|
$output>div>div.list>div.action div.item i { display:none; }
|
||||||
$output>div.output>div.list:last-child { margin-bottom:0; }
|
// $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 { 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 { border:none; color:var(--notice-bg-color); min-width:60px; float:left; }
|
||||||
$output>div.action div.item.button input:hover { background-color:var(--hover-bg-color); }
|
$output>div.action div.item.button input:hover { background-color:var(--hover-bg-color); }
|
||||||
|
@ -65,7 +65,6 @@ func (s Portal) Run(m *ice.Message, arg ...string) {
|
|||||||
sub, role = arg[1], action.Role
|
sub, role = arg[1], action.Role
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m.Info("what %v", role)
|
|
||||||
if kit.IsIn(role, "", aaa.VOID) {
|
if kit.IsIn(role, "", aaa.VOID) {
|
||||||
kit.If(!ctx.PodCmd(m.Message, arg) && aaa.Right(m.Message, arg), func() { m.Cmdy(arg) })
|
kit.If(!ctx.PodCmd(m.Message, arg) && aaa.Right(m.Message, arg), func() { m.Cmdy(arg) })
|
||||||
} else {
|
} else {
|
||||||
|
@ -6,10 +6,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Portal struct {
|
type Portal struct {
|
||||||
gonganxitong.Portal
|
guanlixitong.Portal
|
||||||
placeCreate string `name:"placeCreate city_name* company_name* group_name*" role:"void"`
|
placeCreate string `name:"placeCreate city_name* company_name* group_type*:select group_name*" role:"void"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userGroup{}, group{})}) }
|
||||||
gonganxitong.PortalCmd(Portal{Portal: gonganxitong.NewPortal(userGroup{}, group{}, guanlixitong.Company{})})
|
|
||||||
}
|
|
||||||
|
@ -12,5 +12,4 @@ func init() { ice.TeamCtxCmd(userGroup{}) }
|
|||||||
|
|
||||||
type UserGroupRole = guanlixitong.UserGroupRole
|
type UserGroupRole = guanlixitong.UserGroupRole
|
||||||
|
|
||||||
var UserGroupCreator = guanlixitong.UserGroupCreator
|
|
||||||
var UserGroupRoleList = guanlixitong.UserGroupRoleList
|
var UserGroupRoleList = guanlixitong.UserGroupRoleList
|
||||||
|
@ -19,8 +19,7 @@ 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])
|
s.Select(m, model.FROM_UID, arg[0])
|
||||||
} else if len(arg) == 2 {
|
} else if len(arg) == 2 {
|
||||||
s.SelectDetail(m, model.FROM_UID, arg[0], model.UID, arg[1])
|
s.SelectDetail(m, model.FROM_UID, arg[0], model.UID, arg[1]).Action(s.CertList, s.MemberList)
|
||||||
m.Action(s.CertList, s.MemberList)
|
|
||||||
}
|
}
|
||||||
m.Table(func(value ice.Maps) {
|
m.Table(func(value ice.Maps) {
|
||||||
switch AuthStatus(kit.Int(value[model.STATUS])) {
|
switch AuthStatus(kit.Int(value[model.STATUS])) {
|
||||||
|
@ -2,6 +2,7 @@ package renzhengshouquan
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"shylinux.com/x/ice"
|
"shylinux.com/x/ice"
|
||||||
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
|
|
||||||
"shylinux.com/x/community/src/gonganxitong"
|
"shylinux.com/x/community/src/gonganxitong"
|
||||||
@ -10,7 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Portal struct {
|
type Portal struct {
|
||||||
gonganxitong.Portal
|
guanlixitong.Portal
|
||||||
placeCreate string `name:"placeCreate city_name* company_name* auth_type*:select auth_name*" role:"void"`
|
placeCreate string `name:"placeCreate city_name* company_name* auth_type*:select auth_name*" role:"void"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,7 +26,7 @@ func (s Portal) PlaceCreate(m *ice.Message, arg ...string) {
|
|||||||
from := ""
|
from := ""
|
||||||
switch AuthType(kit.Int(m.Option(model.AUTH_TYPE))) {
|
switch AuthType(kit.Int(m.Option(model.AUTH_TYPE))) {
|
||||||
case AuthRoot:
|
case AuthRoot:
|
||||||
from = "root"
|
from = aaa.ROOT
|
||||||
case AuthCity:
|
case AuthCity:
|
||||||
from = s.findAuthFrom(m, AuthRoot)
|
from = s.findAuthFrom(m, AuthRoot)
|
||||||
case AuthCompany, AuthPersonal:
|
case AuthCompany, AuthPersonal:
|
||||||
@ -65,7 +66,7 @@ func (s Portal) PlaceList(m *ice.Message, arg ...string) *ice.Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
gonganxitong.PortalCmd(Portal{Portal: gonganxitong.NewPortal(userAuth{}, auth{}, guanlixitong.Company{})})
|
gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userAuth{}, auth{})})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s Portal) findAuthFrom(m *ice.Message, authType AuthType, arg ...string) string {
|
func (s Portal) findAuthFrom(m *ice.Message, authType AuthType, arg ...string) string {
|
||||||
|
@ -12,5 +12,4 @@ func init() { ice.TeamCtxCmd(userAuth{}) }
|
|||||||
|
|
||||||
type UserAuthRole = guanlixitong.UserGroupRole
|
type UserAuthRole = guanlixitong.UserGroupRole
|
||||||
|
|
||||||
var UserAuthCreator = guanlixitong.UserGroupCreator
|
|
||||||
var UserAuthRoleList = guanlixitong.UserGroupRoleList
|
var UserAuthRoleList = guanlixitong.UserGroupRoleList
|
||||||
|
@ -41,5 +41,3 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
|||||||
type Tables struct{ Table }
|
type Tables struct{ Table }
|
||||||
|
|
||||||
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
||||||
|
|
||||||
func newTable() Table { return Table{Table: guanlixitong.NewTable(userQueue{}, queue{})} }
|
|
||||||
|
@ -6,10 +6,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Portal struct {
|
type Portal struct {
|
||||||
gonganxitong.Portal
|
guanlixitong.Portal
|
||||||
placeCreate string `name:"placeCreate city_name* company_name* queue_name*" role:"void"`
|
placeCreate string `name:"placeCreate city_name* company_name* queue_type*:select queue_name*" role:"void"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userQueue{}, queue{})}) }
|
||||||
gonganxitong.PortalCmd(Portal{Portal: gonganxitong.NewPortal(userQueue{}, queue{}, guanlixitong.Company{})})
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user