This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-08-05 23:20:48 +08:00
parent 7c9e9abc92
commit 9406833239
5 changed files with 25 additions and 29 deletions

View File

@ -8,6 +8,10 @@ import (
"shylinux.com/x/enterprise/src/guanlixitong/model" "shylinux.com/x/enterprise/src/guanlixitong/model"
) )
type Tables struct {
gonganxitong.Tables
list string `name:"list group_uid uid auto" role:"void"`
}
type Table struct { type Table struct {
gonganxitong.Table gonganxitong.Table
list string `name:"list group_uid uid auto" role:"void"` list string `name:"list group_uid uid auto" role:"void"`

View File

@ -1,20 +1,12 @@
package guanlixitong package guanlixitong
import ( import "shylinux.com/x/ice"
"shylinux.com/x/ice"
"shylinux.com/x/enterprise/src/guanlixitong/model"
)
type groupUser struct { type groupUser struct {
portal portal Tables
userGroup userGroup userGroup userGroup
list string `name:"list group_uid uid auto" help:"团队成员" icon:"https://img.icons8.com/officel/80/crowd.png" role:"void"`
} }
func (s groupUser) Init(m *ice.Message, arg ...string) {
s.portal.Show(m, model.ROLE, "creator,leader")
}
func (s groupUser) List(m *ice.Message, arg ...string) { func (s groupUser) List(m *ice.Message, arg ...string) {
m.Cmdy(s.userGroup, s.userGroup.User, arg).Display("") m.Cmdy(s.userGroup, s.userGroup.User, arg).Display("")
} }

View File

@ -1,10 +1,10 @@
Volcanos(chat.ONIMPORT, { Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { _init: function(can, msg) { var USER_GROUP_ROLE = "user_group_role"
if (msg.IsDetail()) { can.onexport.share_title(can, msg, "user_group_role"); return msg.Show(can) } if (msg.IsDetail()) { can.onexport.share_title(can, msg, USER_GROUP_ROLE); return msg.Show(can) }
can.onimport.itemcards(can, msg, function(value) { value._style = [value.user_group_role] can.onimport.itemcards(can, msg, function(value) { value._style = [value[USER_GROUP_ROLE]]
return [ return [
{view: html.TITLE, list: [{text: value.user_name}, {view: html.TITLE, list: [{text: value.user_name},
{text: [can.user.transValue(can, value, "user_group_role"), "", aaa.ROLE]}, {text: [can.user.transValue(can, value, USER_GROUP_ROLE), "", [aaa.ROLE, value[USER_GROUP_ROLE]]]},
]}, ]},
{view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at)}]}, {view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at)}]},
] ]

View File

@ -3,32 +3,31 @@
"scanQRCode": "扫码添加", "scanQRCode": "扫码添加",
"placeCreate": "创建团队", "placeCreate": "创建团队",
"placeRemove": "解散团队", "placeRemove": "解散团队",
"groupUser": "团队成员",
"target": "目标计划", "target": "目标计划",
"icons": { "icons": {
"groupUser": "https://img.icons8.com/officel/80/crowd.png",
"target": "https://img.icons8.com/officel/80/goal--v1.png" "target": "https://img.icons8.com/officel/80/goal--v1.png"
}, },
"input": { "input": {
"My Group": "我的团队", "My Group": "我的团队",
"user_name": "用户昵称",
"user_avatar": "用户头像",
"user_group_role": "用户角色", "user_group_role": "用户角色",
"group_uid": "团队",
"group_name": "团队名称", "group_name": "团队名称",
"group_type": "团队类型", "group_type": "团队类型",
"company_name": "公司名称" "company_name": "公司名称"
}, },
"value": { "value": {
"group_type": {
"RD": "研发",
"icons": {
"RD": "https://img.icons8.com/officel/80/code.png"
}
},
"user_group_role": { "user_group_role": {
"creator": "创建人", "creator": "创建人",
"visitor": "访客", "visitor": "访客",
"leader": "领导", "leader": "领导",
"member": "组员" "member": "组员"
},
"group_type": {
"RD": "研发",
"icons": {
"RD": "https://img.icons8.com/officel/80/code.png"
}
} }
} }
} }

View File

@ -1,14 +1,15 @@
Volcanos(chat.ONIMPORT, { Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { _init: function(can, msg) {
if (msg.IsDetail()) { var value = msg.TableDetail(); msg.Option("_share_content", value.content)
msg.Option("_share_title", can.base.trimPrefix(value.created_at.split(" ")[0], can.base.Time(null, "%y-")))
return msg.Show(can)
}
can.onimport.itemcards(can, msg, function(value) { return [ can.onimport.itemcards(can, msg, function(value) { return [
{view: html.TITLE, list: [{text: value.user_name}, {view: html.TITLE, list: [{text: value.user_name},
{text: [can.user.transValue(can, value, "user_group_role"), "", aaa.ROLE]}, {text: [can.user.transValue(can, value, "user_group_role"), "", aaa.ROLE]},
{text: can.base.TimeTrim(value.created_at)},
]}, ]},
{view: html.STATUS, list: [{text: value.content}]}, {view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at)},]},
{view: html.OUTPUT, list: [{text: value.content}]},
] }) ] })
if (msg.IsDetail()) { var value = msg.TableDetail(); msg.Option("_share_content", value.content)
msg.Option("_share_title", can.base.trimPrefix(value.created_at.split(" ")[0], can.base.Time(null, "%y-")))
}
}, },
}) })