This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-05-13 11:51:38 +08:00
parent 06270ce5b1
commit 1a99c2c96e
5 changed files with 32 additions and 21 deletions

View File

@ -100,6 +100,7 @@ func (s Table) Inputs(m *ice.Message, arg ...string) {
} }
} }
func (s Table) InputsUID(m *ice.Message, arg []string, target ice.Any, args ...string) { func (s Table) InputsUID(m *ice.Message, arg []string, target ice.Any, args ...string) {
s.Limit(m, 300)
s.Fields(m, model.UID, model.TITLE) s.Fields(m, model.UID, model.TITLE)
m.Cmdy(target, s.Select, args).RenameAppend(model.UID, arg[0]) m.Cmdy(target, s.Select, args).RenameAppend(model.UID, arg[0])
m.DisplayInputKeyNameIconTitle() m.DisplayInputKeyNameIconTitle()
@ -173,11 +174,14 @@ func (s Table) ValueList(m *ice.Message, arg []string, fields ...ice.Any) *ice.M
defer m.Options(db.FIELDS, fields).Set(ice.MSG_OPTION, db.FIELDS) defer m.Options(db.FIELDS, fields).Set(ice.MSG_OPTION, db.FIELDS)
} }
if s.ValueModel(m, s.ValueList, arg...); len(arg) == 1 { if s.ValueModel(m, s.ValueList, arg...); len(arg) == 1 {
s.UserPlaceInit(m) if s.UserPlaceInit(m); s.IsWorker(m) {
if s.IsWorker(m) {
s.Button(m, "", s.Create) s.Button(m, "", s.Create)
} }
} }
m.RewriteAppend(func(value, key string, index int) string {
kit.If(value == "" && key == model.UPDATED_AT, func() { value = m.Appendv(model.CREATED_AT)[index] })
return value
})
return m return m
// return s.SelectJoinUser(m) // return s.SelectJoinUser(m)
} }

View File

@ -18,6 +18,7 @@ type member struct {
disable string `name:"disable" role:"void"` disable string `name:"disable" role:"void"`
promote string `name:"promote" role:"void"` promote string `name:"promote" role:"void"`
demote string `name:"demote" role:"void"` demote string `name:"demote" role:"void"`
setCookie string `name:"setCookie" help:"切换"`
} }
func (s member) Remove(m *ice.Message, arg ...string) { func (s member) Remove(m *ice.Message, arg ...string) {
@ -50,11 +51,15 @@ func (s member) Enable(m *ice.Message, arg ...string) {
s.recordEvent(m, "✅", m.Trans("enable member", "启用成员"), html.NOTICE) s.recordEvent(m, "✅", m.Trans("enable member", "启用成员"), html.NOTICE)
} }
} }
func (s member) SetCookie(m *ice.Message, arg ...string) {
m.Cmdy(s.UserPlace, s.Select, model.UID, m.Option(model.UID))
m.ProcessCookie(model.USER_UID, m.Append(model.USER_UID))
}
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))
s.Limit(m, 300)
if len(arg) == 1 { if len(arg) == 1 {
m.Cmdy(s.UserPlace, s.Select, s.Keys(s.Place, model.UID), arg[0]).Action() m.Cmdy(s.UserPlace, s.Select, s.Keys(s.Place, model.UID), arg[0]).Action()
} else if len(arg) == 2 { } else if len(arg) == 2 {
@ -72,6 +77,7 @@ func (s member) List(m *ice.Message, arg ...string) {
} }
} }
button := []ice.Any{} button := []ice.Any{}
kit.If(m.IsTech() && value[model.USER_UID] != user_uid, func() { button = append(button, s.SetCookie) })
if MemberStatus(kit.Int(value[model.MEMBER_STATUS])) == MemberNormal { if MemberStatus(kit.Int(value[model.MEMBER_STATUS])) == MemberNormal {
if isCreator { if isCreator {
switch kit.Int(value[USER_PLACE_ROLE]) { switch kit.Int(value[USER_PLACE_ROLE]) {

View File

@ -83,7 +83,8 @@ $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 { color:var(--danger-bg-color); margin-left:auto; } $output div.item.card div.title span.price { color:var(--danger-bg-color); }
body.width1 $output div.item.card div.title span.price { 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; }
@ -131,13 +132,11 @@ $output table.content.detail tr.action i { display:none; }
$output table.content.detail tr.uid { display:none; } $output table.content.detail tr.uid { display:none; }
$output table.content.detail input { border:none; } $output table.content.detail input { border:none; }
$output fieldset.story>div.output>div.tabs { $output fieldset.story.otherList>div.output { max-height:unset !important; }
background-color:var(--plugin-bg-color); display:flex; position:sticky; top:0; z-index:1; $output fieldset.story>div.output>div.tabs { background-color:var(--plugin-bg-color); display:flex; overflow:auto; position:sticky; top:0; z-index:1; }
overflow:auto; $output fieldset.story>div.output>div.tabs>div.item { white-space:pre; line-height:22px; padding:5px; }
} $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 { white-space:pre; padding:5px; width:100%; } $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>div.output>div.tabs>div.item.select { background-color:var(--output-bg-color); border-top:var(--box-notice); }
$output fieldset.story>div.output>div.tabs>div.item.danger.select { background-color:var(--output-bg-color); border-top:var(--box-danger); }
$output fieldset.story>div.output>div.tabs>div.item:hover { background-color:var(--output-bg-color); } $output fieldset.story>div.output>div.tabs>div.item:hover { background-color:var(--output-bg-color); }
$output>div.output>div.code { padding:10px; } $output>div.output>div.code { padding:10px; }

View File

@ -1,5 +1,6 @@
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"
var TYPE = "type", ROLE = "role", STATUS = "status"
Volcanos(chat.ONIMPORT, { Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { _init: function(can, msg) {
can.onappend.style(can, html.OUTPUT), can.onimport.myPortal(can, msg) can.onappend.style(can, html.OUTPUT), can.onimport.myPortal(can, msg)
@ -9,12 +10,13 @@ Volcanos(chat.ONIMPORT, {
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)
can.onappend.style(sub, "otherList")
sub.run = function(event, cmds, cb) { sub.run = function(event, cmds, cb) {
if (!cmds || cmds.length == 0) { cb(msg) } else { can.run(event, cmds, cb) } if (!cmds || cmds.length == 0) { cb(msg) } else { can.run(event, cmds, cb) }
}, next() }, 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("_other_cmd"), args: [value.place_uid||msg.Option("place_uid"), value.uid]})
return true return true
} }
} }

View File

@ -22,7 +22,7 @@ type user struct {
modify string `name:"modify info" role:"void"` modify string `name:"modify info" role:"void"`
list string `name:"list uid auto" role:"void"` list string `name:"list uid auto" role:"void"`
email string `name:"email email*"` email string `name:"email email*"`
setCookie string `name:"setCookie" help:"切换" role:"void"` setCookie string `name:"setCookie" help:"切换"`
sendCookie string `name:"sendCookie" help:"授权" role:"void"` sendCookie string `name:"sendCookie" help:"授权" role:"void"`
} }