This commit is contained in:
jingganjiaoyu 2024-08-05 02:09:25 +08:00
parent 3ebabcdc8e
commit 7c9e9abc92
9 changed files with 73 additions and 23 deletions

View File

@ -9,7 +9,7 @@ import (
type groupUser struct {
portal portal
userGroup userGroup
list string `name:"list group_uid uid auto" role:"void" help:"团队成员" icon:"https://img.icons8.com/officel/80/crowd.png"`
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) {

View File

@ -1,12 +1,13 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { if (msg.IsDetail()) { return msg.Dump(can) }
can.page.Append(can, can._output, msg.Table(function(value) { value._style = [value.user_group_role]
return can.onimport.itemcard(can, value, [
_init: function(can, msg) {
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]
return [
{view: html.TITLE, list: [{text: value.user_name},
{text: [can.user.transValue(can, value, "user_group_role"), "", aaa.ROLE]},
]},
{view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at)}]},
])
}))
]
})
},
})

View File

@ -7,6 +7,7 @@ const (
NAME = "name"
TYPE = "type"
ROLE = "role"
CONTENT = "content"
USER_UID = "user_uid"
USER_GROUP_ROLE = "user_group_role"
GROUP_UID = "group_uid"
@ -32,7 +33,7 @@ type Group struct {
type Company struct {
db.ModelWithUID
CityUID string `gorm:"type:char(32);index"`
Name string `gorm:"type:varchar(256);index"`
Name string `gorm:"type:varchar(256)"`
Info string
}
type Target struct {

View File

@ -9,11 +9,13 @@
},
"input": {
"My Group": "我的团队",
"user_name": "用户昵称",
"user_avatar": "用户头像",
"user_group_role": "用户角色",
"group_uid": "团队",
"group_name": "团队名称",
"company_name": "公司名称",
"city_name": "城市名称"
"group_type": "团队类型",
"company_name": "公司名称"
},
"value": {
"group_type": {
@ -23,9 +25,10 @@
}
},
"user_group_role": {
"creator": "创建人",
"visitor": "访客",
"leader": "领导",
"member": "组员"
}
}
}

View File

@ -1,10 +1,25 @@
package guanlixitong
import "shylinux.com/x/ice"
import (
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/enterprise/src/guanlixitong/model"
)
type target struct {
Table
userGroup userGroup
group group
portal string `data:"true"`
create string `name:"create group_uid* content*" role:"void"`
}
func (s target) Create(m *ice.Message, arg ...string) {
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID))...)
}
func (s target) List(m *ice.Message, arg ...string) {
s.TablesWithRole(m, arg, s, s.userGroup, s.group, model.CONTENT).Display("")
}
func init() { ice.TeamCtxCmd(target{}) }

View File

@ -0,0 +1,14 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.itemcards(can, msg, function(value) { return [
{view: html.TITLE, list: [{text: value.user_name},
{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}]},
] })
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-")))
}
},
})

View File

@ -13,20 +13,28 @@ type userGroup struct {
}
func (s userGroup) User(m *ice.Message, arg ...string) {
s.Select(m, model.GROUP_UID, arg[0]).RenameAppend(model.ROLE, model.USER_GROUP_ROLE)
if len(arg) == 1 {
s.Select(m, model.GROUP_UID, arg[0])
} else if len(arg) == 2 {
s.Select(m, model.GROUP_UID, arg[0], model.UID, arg[1])
} else {
return
}
m.RenameAppend(model.ROLE, model.USER_GROUP_ROLE)
s.SelectJoinUser(m)
s.RewriteAppend(m)
}
func (s userGroup) List(m *ice.Message, arg ...string) {
s.Tables(m, s.group, s.company).FieldsWithCreatedAT(m, s,
model.GROUP_NAME, model.GROUP_TYPE, model.USER_GROUP_ROLE,
model.COMPANY_NAME,
model.GROUP_UID, model.CITY_UID,
model.COMPANY_NAME, model.GROUP_UID, model.CITY_UID,
)
if len(arg) == 1 {
s.Select(m, model.USER_UID, arg[0])
} else if len(arg) == 2 {
s.SelectDetail(m, model.USER_UID, arg[0], model.GROUP_UID, arg[1])
} else {
return
}
s.SelectJoinCity(m)
s.RewriteAppend(m)

View File

@ -12,7 +12,7 @@
"icons": "https://img.icons8.com/officel/80/edit-property.png",
"index": "web.team.gonganxitong.apply",
"name": "权限申请",
"time": "2024-08-04 12:16:24.929"
"time": "2024-08-05 00:34:49.421"
}
},
"58724bdcc3cae3e26700cb3199e0602c": {
@ -27,7 +27,7 @@
"icons": "https://img.icons8.com/officel/80/receipt-approved.png",
"index": "web.team.gonganxitong.order",
"name": "权限审批",
"time": "2024-08-04 12:09:54.137"
"time": "2024-08-05 00:27:18.567"
}
},
"9c18032c5bc252f2986e1b20e7e77db7": {
@ -51,7 +51,7 @@
"icons": "https://img.icons8.com/officel/80/property-with-timer.png",
"index": "web.team.gonganxitong.event",
"name": "事件流",
"time": "2024-08-04 12:19:56.488"
"time": "2024-08-05 00:23:43.598"
}
},
"c36d47e2611b0d1e7a14088bc3293d04": {

View File

@ -16,7 +16,7 @@
"index": "web.team.guanlixitong.event",
"name": "事件流",
"order": "2",
"time": "2024-08-04 12:24:07.257"
"time": "2024-08-05 01:14:22.409"
}
},
"a4e85767b176b6a07751156a6b73fa94": {
@ -26,7 +26,15 @@
"index": "web.team.guanlixitong.order",
"name": "权限审批",
"order": "4",
"time": "2024-08-04 12:24:07.267"
"time": "2024-08-05 01:14:22.399"
}
},
"af25eeb7bb4ba367cee2baf11eeae742": {
"meta": {
"icons": "https://img.icons8.com/officel/80/crowd.png",
"index": "web.team.guanlixitong.groupUser",
"name": "团队成员",
"time": "2024-08-05 01:14:22.406"
}
},
"c36d47e2611b0d1e7a14088bc3293d04": {
@ -36,7 +44,7 @@
"index": "web.team.guanlixitong.apply",
"name": "权限申请",
"order": "3",
"time": "2024-08-04 12:24:07.255"
"time": "2024-08-05 01:14:22.416"
}
},
"fa5ff99e330772f88b929de7762a36f1": {
@ -46,7 +54,7 @@
"index": "web.team.guanlixitong.target",
"name": "目标计划",
"order": "5",
"time": "2024-08-04 12:24:07.267"
"time": "2024-08-05 01:14:22.419"
}
}
}