This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-06-19 19:19:58 +08:00
parent a2e5d88c83
commit 94e0b93d51
10 changed files with 67 additions and 59 deletions

View File

@ -249,6 +249,9 @@ func (s Table) SelectJoinCity(m *ice.Message, arg ...string) *ice.Message {
kit.If(len(arg) == 0, func() { arg = append(arg, model.NAME) })
return s.SelectJoin(m, city{}, arg...)
}
func (s Table) SelectJoinToUser(m *ice.Message) *ice.Message {
return s.SelectJoinBy(m, model.TO_USER_UID, model.UID, "to_user", api.GONGANXITONG_USER, model.NAME, model.AVATAR)
}
func (s Table) SelectJoinUser(m *ice.Message, arg ...string) *ice.Message {
kit.If(len(arg) == 0, func() { arg = append(arg, model.NAME, model.AVATAR) })
if kit.IndexOf(m.Appendv(ice.MSG_APPEND), model.USER_UID) == -1 && kit.IndexOf(m.Appendv(ice.KEY), model.USER_UID) == -1 {
@ -267,44 +270,7 @@ func (s Table) SelectJoinAuth(m *ice.Message, arg ...string) *ice.Message {
return s.SelectJoin(m, s.findSpaceCmd(m, api.RENZHENGSHOUQUAN_AUTH), arg...)
}
func (s Table) SelectJoinSess(m *ice.Message, arg ...string) *ice.Message {
if m.Length() == 0 {
return m
}
UID, TARGET_UID := model.USER_UID, model.USER_UID
target := sess{}
list := []string{}
m.Table(func(value ice.Maps) { list = kit.AddUniq(list, value[UID]) })
msg := m.Spawn()
arg = kit.Split("agent,system,ip,location,ua")
s.Fields(msg, append(arg, TARGET_UID)).Orders(msg, s.Desc(model.CREATED_AT)).Groups(msg, TARGET_UID).Limit(msg, 3000)
data := msg.CmdMap(target, s.SelectList, TARGET_UID, list, TARGET_UID)
m.Table(func(value ice.Maps) {
recent := data[value[UID]]
kit.For(arg, func(k string) { m.Push(k, recent[k]) })
})
return m
}
func (s Table) SelectJoinToUser(m *ice.Message) *ice.Message {
s.SelectJoinBy(m, model.TO_USER_UID, model.UID, "to_user", api.GONGANXITONG_USER, model.NAME, model.AVATAR)
return m
}
func (s Table) SelectJoinBy(m *ice.Message, UID, TARGET_UID string, prefix string, target ice.Any, arg ...string) *ice.Message {
if m.Length() == 0 {
return m
}
if kit.IndexOf(m.Appendv(ice.MSG_APPEND), UID) == -1 && kit.IndexOf(m.Appendv(ice.KEY), UID) == -1 {
return m
}
list := []string{}
m.Table(func(value ice.Maps) { list = kit.AddUniq(list, value[UID]) })
msg := m.Spawn()
s.Fields(msg, append(arg, TARGET_UID)).Orders(msg, s.Desc(model.CREATED_AT)).Groups(msg, TARGET_UID).Limit(msg, 3000)
data := msg.CmdMap(target, s.SelectList, TARGET_UID, list, TARGET_UID)
m.Table(func(value ice.Maps) {
recent := data[value[UID]]
kit.For(arg, func(k string) { m.Push(s.Keys(prefix, k), recent[k]) })
})
return m
return s.SelectJoinBy(m, model.USER_UID, model.USER_UID, "", sess{}, kit.Split("agent,system,ua,ip,location")...)
}
func (s Table) SelectJoinService(m *ice.Message, arg ...string) *ice.Message {
kit.If(len(arg) == 0, func() { arg = append(arg, model.SPACE, model.INDEX, model.NAME, model.ICON) })
@ -327,6 +293,24 @@ func (s Table) SelectJoinRecent(m *ice.Message, PLACE_UID string, arg ...string)
})
return m
}
func (s Table) SelectJoinBy(m *ice.Message, UID, TARGET_UID string, prefix string, target ice.Any, arg ...string) *ice.Message {
if m.Length() == 0 {
return m
}
if kit.IndexOf(m.Appendv(ice.MSG_APPEND), UID) == -1 && kit.IndexOf(m.Appendv(ice.KEY), UID) == -1 {
return m
}
list := []string{}
m.Table(func(value ice.Maps) { list = kit.AddUniq(list, value[UID]) })
msg := m.Spawn()
s.Fields(msg, append(arg, TARGET_UID)).Orders(msg, s.Desc(model.CREATED_AT)).Groups(msg, TARGET_UID).Limit(msg, 3000)
data := msg.CmdMap(target, s.SelectList, TARGET_UID, list, TARGET_UID)
m.Table(func(value ice.Maps) {
recent := data[value[UID]]
kit.For(arg, func(k string) { m.Push(s.Keys(prefix, k), recent[k]) })
})
return m
}
func (s Table) Update(m *ice.Message, data ice.Any, arg ...string) {
if len(arg) == 0 {
arg = append(arg, model.UID, kit.Select(m.Option(model.UID), m.Option(s.Keys(m.CommandKey(), model.UID))))

View File

@ -8,6 +8,8 @@ import (
"shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/web"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/community/src/gonganxitong/model"
)
type grant struct {
@ -40,7 +42,7 @@ func (s grant) Confirm(m *ice.Message, arg ...string) {
defer m.ProcessOpen(msg.Append(mdb.TEXT))
m.Option(ice.MSG_USERIP, msg.Append(aaa.IP))
m.Option(ice.MSG_USERUA, msg.Append(aaa.UA))
msg := m.Cmd(s.sess, s.Create)
msg := m.Cmd(s.sess, s.Create, model.USER_UID, m.Option(ice.MSG_USERUID))
m.Cmd(web.SPACE, m.Option(ice.FROM_DAEMON), ice.MSG_SESSID, msg.Option(ice.MSG_SESSID))
m.Echo(ice.SUCCESS)
}

View File

@ -62,11 +62,10 @@ func (s member) List(m *ice.Message, arg ...string) {
return
}
s.SelectJoinUser(m, model.NAME, model.INFO, model.AVATAR, model.LANGUAGE, model.AUTH_UID)
if s.IsLeader(m) {
if s.SelectJoinAuth(m); s.IsLeader(m) {
s.SelectJoinSess(m)
s.OtherListCmd(m, s.SessList)
}
s.SelectJoinAuth(m)
m.Table(func(value ice.Maps) {
if !m.FieldsIsDetail() {
if user_uid == value[model.USER_UID] {
@ -140,7 +139,7 @@ func (s member) SetInfo(m *ice.Message, arg ...string) {
m.Cmdy(s.UserPlace, s.Modify, arg)
}
func (s member) UserInfo(m *ice.Message, arg ...string) {
if msg := m.Cmd(api.RENZHENGSHOUQUAN_AUTH, s.Select, model.USER_UID, m.Option(model.UID)); msg.Append(model.UID) == "" {
if msg := m.Cmd(api.RENZHENGSHOUQUAN_AUTH, s.Select, model.USER_UID, m.Option(model.TO_USER_UID)); msg.Append(model.UID) == "" {
m.ProcessHold()
} else {
m.ProcessField(api.RENZHENGSHOUQUAN_PORTAL, []string{msg.Append(model.UID)}, arg...)

View File

@ -71,6 +71,7 @@ $output>div.action { background-color:var(--output-bg-color); }
$output div.item.card:not(:last-child) { margin-bottom:2px; }
$output div.item.card.sticky { position:sticky; top:0; z-index:2; }
$output div.item.card.loaded { position:sticky; top:0; z-index:2; }
$output div.item.card>div.action { top:24px; }
$output div.item.card div.title { width:100%; display:flex; align-items:center; position:relative; }
$output div.item.card div.title span:first-child { word-break:break-all; }
$output div.item.card div.title span.type { line-height:18px; }
@ -85,7 +86,7 @@ $output div.item.card div.action input { padding:0 10px; margin-left:0; margin-r
body.width1 $output div.item.card>div.action { max-width:240px; display:flex; flex-wrap:wrap; justify-content:center; }
$output div.item.card div.status span { word-break:break-all; }
$output div.item.card div.container div.status img { height:24px; width:24px; min-width:24px; }
$output div.item.card img { border-radius:5px; padding:0; margin:0; height:48px; width:48px; min-width:48px; object-fit:cover; }
$output div.item.card img { border-radius:5px; padding:0; margin:0; height:40px; width:40px; min-width:40px; object-fit:cover; }
$output div.item.card img:not(:last-child) { margin-right:10px; }
$output div.item.card div.container img { margin-right:0; height:100%; width:100%; }
$output div.item.card div.container>div.action { position:relative; float:right; }
@ -103,10 +104,10 @@ $output div.output>div.code>img.avatar {
$output input[type=button][name=submit] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
$output input.notice[type=button] { background-color:transparent; color:var(--notice-bg-color); }
$output input.danger[type=button] { color:var(--danger-bg-color); }
$output span.type { border:none; border-radius:5px; background-color:var(--hover-bg-color); color:var(--notice-bg-color); font-size:var(--status-font-size); line-height:18px; padding:2px 8px; }
$output span.role { border:none; border-radius:5px; background-color:var(--hover-bg-color); color:var(--notice-bg-color); font-size:var(--status-font-size); line-height:18px; padding:2px 8px; }
$output span.level { border:none; border-radius:5px; background-color:var(--hover-bg-color); color:var(--notice-bg-color); font-size:var(--status-font-size); line-height:18px; padding:2px 8px; }
$output span.status { border:none; border-radius:5px; background-color:var(--hover-bg-color); color:var(--notice-bg-color); font-size:var(--status-font-size); line-height:18px; padding:2px 8px; }
$output span.type { border:none; border-radius:5px; background-color:var(--hover-bg-color); color:var(--notice-bg-color); white-space:pre; font-size:var(--status-font-size); line-height:18px; padding:2px 8px; }
$output span.role { border:none; border-radius:5px; background-color:var(--hover-bg-color); color:var(--notice-bg-color); white-space:pre; font-size:var(--status-font-size); line-height:18px; padding:2px 8px; }
$output span.level { border:none; border-radius:5px; background-color:var(--hover-bg-color); color:var(--notice-bg-color); white-space:pre; font-size:var(--status-font-size); line-height:18px; padding:2px 8px; }
$output span.status { border:none; border-radius:5px; background-color:var(--hover-bg-color); color:var(--notice-bg-color); white-space:pre; font-size:var(--status-font-size); line-height:18px; padding:2px 8px; }
$output span.type.danger { color:var(--danger-bg-color); }
$output span.role.danger { color:var(--danger-bg-color); }
$output span.level.danger { color:var(--danger-bg-color); }
@ -139,6 +140,13 @@ $output fieldset.story>div.output>div.tabs>div.item.all { position:sticky; left:
$output fieldset.story>div.output>div.tabs>div.item.select { border-top:var(--box-notice); background-color:var(--output-bg-color); }
$output fieldset.story>div.output>div.tabs>div.item.select { position:sticky; right:0; }
$output fieldset.story>div.output>div.tabs>div.item.danger.select { border-top:var(--box-danger); background-color:var(--output-bg-color); }
$output fieldset.story.otherList>div.output>div.todo { display:none; }
$output fieldset.story>div.output>div.todo { padding:5px 10px 20px; }
$output fieldset.story>div.output>div.todo>div.item { display:flex; align-items:center; justify-content:center; }
$output fieldset.story>div.output>div.todo>div.item span { display:none; }
$output fieldset.story>div.output>div.todo>div.item input { min-width:120px; }
$output fieldset.story>div.output>div.todo>div.item.notice input { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
body:not(.mobile) $output fieldset.story>div.output>div.todo>div.item.notice input:hover { background-color:var(--hover-bg-color); color:var(--notice-bg-color); }
$output>fieldset.market div.tabs { display:flex; width:100%; overflow:auto; height:30px; position:sticky; top:0; z-index:1; }
$output>fieldset.market div.tabs>div.item { padding:5px 10px; float:left; white-space:pre; }
$output>fieldset.market 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; }
@ -184,10 +192,8 @@ $output>fieldset.story.web.team.credit>div.output>div.code { margin-top:64px; }
$output fieldset.story.web.team.dashboard.summary>div.output { min-height:64px; }
$output fieldset.story.web.team.production.coder>div.output { background-color:var(--output-bg-color); }
$output>fieldset.qrcode table.content td { text-align:center; }
$output>fieldset.market>div.output>div.list div.item.card img { height:48px; width:48px; min-width:48px; }
$output>fieldset.market>div.output>div.list div.item.card div.status>span.username {
color:#576b95; font-weight:bold; font-size:14px;
}
// $output>fieldset.market>div.output>div.list div.item.card img { height:48px; width:48px; min-width:48px; }
$output>fieldset.market>div.output>div.list div.item.card div.status>span.username { color:#576b95; font-weight:bold; font-size:14px; }
$output>fieldset.market>div.output>div.list div.item.card div.status>span.time { float:right; line-height:20px; }
$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 i { margin-right:5px; }

View File

@ -91,9 +91,9 @@ func (s Portal) Run(m *ice.Message, arg ...string) {
m.Optionv(model.TO_USER_UID, []string{})
}
}()
m.OptionDefault(model.FROM_USER_UID, m.Option(ice.MSG_USERUID))
m.OptionDefault(model.TO_USER_UID, m.Option(model.USER_UID))
m.OptionDefault(model.TO_USER_UID, m.Option(ice.MSG_USERUID))
m.OptionDefault(model.FROM_USER_UID, m.Option(ice.MSG_USERUID))
m.Option(model.USER_UID, m.Option(ice.MSG_USERUID))
m.Option(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))
m.Option(model.COMMAND_UID, CommandUID(m, arg[0]))
@ -144,7 +144,7 @@ func (s Portal) List(m *ice.Message, arg ...string) {
m.Echo("用户已禁用").Option("display.style", html.OUTPUT)
return
}
m.OptionDefault(model.USER_UID, m.Option(ice.MSG_USERUID))
m.Option(model.USER_UID, m.Option(ice.MSG_USERUID))
if m.Option(mdb.VIEW) == mdb.TABLE || len(arg) > 0 && arg[0] == mdb.TABLE {
s.Hash.List(m, kit.Slice(arg, 1)...).PushAction(mdb.DETAIL, s.Hash.Remove).Action().SortInt(mdb.ORDER)
return

View File

@ -4,6 +4,7 @@ var TYPE = "type", ROLE = "role", STATUS = "status"
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onappend.style(can, html.OUTPUT), can.onimport.myPortal(can, msg)
can.misc.Cookie(can, "user_uid", "")
},
qrcode: function(can, msg, avatar, target) { target = target||can.ui.output, can.onappend.board(can, msg, target)
can.page.Append(can, can.page.SelectOne(can, target, "div.code"), [{img: can.misc.Resource(can, avatar||can.ConfIcons()||can.user.info.favicon), className: "avatar"}])
@ -30,8 +31,9 @@ Volcanos(chat.ONIMPORT, {
can.page.Appends(can, target||can.ui.list, [{view: html.TITLE, list: [{text: can.user.trans(can, name, help)}]}])
},
myPortal: function(can, msg) { can.sup.current = {}
// can.page.tagis(document.body, "body.width1") && (can.user.isMobile = true, can.sup.user.isMobile = true)
// can.onmotion.delay(can, function() { can.page.tagis(document.body, "body.width1") && (can.user.isMobile = true, can.sup.user.isMobile = true) }, 300)
// can.onappend.plugin(can, {index: "can.cookie"})
can.page.tagis(document.body, "body.width1") && (can.user.isMobile = true, can.sup.user.isMobile = true)
can.onmotion.delay(can, function() { can.page.tagis(document.body, "body.width1") && (can.user.isMobile = true, can.sup.user.isMobile = true) }, 300)
can.core.List(["_place_uid", "_place_name", "_place_type", "_user_place_role", "_street_name"], function(key) { can.Conf(key, msg.Option(key)) })
var PLACE_UID = can.Conf("_place_uid"), PLACE_NAME = can.Conf("_place_name"), PLACE_TYPE = can.Conf("_place_type")
var USER_PLACE_ROLE = can.Conf("_user_place_role"), STREET_NAME = can.Conf("_street_name")
@ -135,6 +137,7 @@ Volcanos(chat.ONIMPORT, {
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.onmotion.toggle(can, can.ui.mylist, true)
can.onappend.plugin(can, {index: value.index, args: [can.sup.current._uid], width: can.ConfWidth()-40}, function(sub) {
can._plugins = can._plugins||[], can._plugins.push(sub)
sub.onimport._field = function(msg) { msg.Table(function(value) { can.onimport.myStory(can, value) }) }
sub.onexport.output = function(_sub, msg) {
_sub.onaction.carddetail = function(event, _sub, value) {
@ -182,7 +185,20 @@ Volcanos(chat.ONIMPORT, {
},
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.ui.todo && can.page.styleHeight(can, can.ui.list, can.ConfHeight()-can.ui.tabs.offsetHeight-can.ui.todo.offsetHeight)
if (can.ui.action && can.ui.output) { can.page.style(can, can.ui.output, html.HEIGHT, (can.ConfHeight()) - can.ui.action.offsetHeight) }
if (can._stacks_current && can.sup == can._stacks_current[0]) {
can.core.List(can._stacks_current.slice(1), function(p) {
p.onimport.size(p, can.ConfHeight()-can._action.offsetHeight, can.ConfWidth())
})
can.core.List(can._plugins, function(p) {
p.onimport.size(p, can.ConfHeight(), can.ConfWidth())
})
} else if (!can._stacks_current) {
can.core.List(can._plugins, function(p) {
p.onimport.size(p, can.ConfHeight(), can.ConfWidth())
})
}
},
})
Volcanos(chat.ONACTION, {

View File

@ -12,6 +12,7 @@
"applyCreate": "申请权限", "commentCreate": "评论", "applyQRCode": "邀请码",
"config": "配置", "code": "编程", "data": "数据", "cache": "缓存",
"clean": "数据清理",
"sessList": "会话列表",
"icons": {
"qrcode": "bi bi-qr-code",
"apply": "bi bi-pencil-square",

View File

@ -45,7 +45,7 @@ func (s sess) Check(m *ice.Message, arg ...string) {
kit.If(msg.Append(model.LANGUAGE), func(p string) { m.Option(ice.MSG_LANGUAGE, p) })
m.Option(ice.MSG_AVATAR, msg.Append(model.AVATAR))
m.Option(ice.MSG_USERUID, msg.Append(model.UID))
m.OptionDefault(model.USER_UID, msg.Append(model.UID))
// m.OptionDefault(model.USER_UID, msg.Append(model.UID))
m.Option("user.status", msg.Append(model.STATUS))
}
func (s sess) Repair(m *ice.Message, arg ...string) {

View File

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

View File

@ -34,11 +34,11 @@ func (s profile) List(m *ice.Message, arg ...string) {
s.Select(m, model.UID, arg[0]).Action()
button := []ice.Any{}
name := m.Append(model.NAME)
button = append(button, s.Enter)
switch AuthType(kit.Int(m.Append(model.AUTH_TYPE))) {
case AuthService:
s.SelectJoinRecent(m, "")
s.SelectJoinService(m)
button = append(button, s.Enter, s.Open)
name = kit.JoinWord(m.Append(model.CITY_NAME), m.Append(model.STREET_NAME), m.Append(model.PLACE_NAME))
case AuthCompany:
case AuthPersonal:
@ -55,7 +55,7 @@ func (s profile) AuthList(m *ice.Message, arg ...string) {
if value[model.PLACE_UID] == "" {
m.PushButton()
} else {
m.PushButton(s.Enter, s.Open)
m.PushAction(s.Enter, s.Open)
}
})
s.SelectJoinRecent(m, "")