2025-05-12 11:10:43 +08:00

56 lines
1.7 KiB
Go

package production
import (
"time"
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/operation/src/production/model"
)
type Meet struct {
Table
order string `data:"8"`
fields string `data:"from_user_uid,to_user_uid,meet_type,title,content,link,begin_time,end_time,issue_uid,plan_uid,company_uid"`
create string `name:"create issue_uid* from_user_uid* to_user_uid* meet_type* title* content* link* date time" role:"leader"`
remove string `name:"remove" role:"leader"`
}
func (s Meet) Create(m *ice.Message, arg ...string) {
t := time.Unix(kit.Time(m.Option("date")+" "+m.Option("time")+":00")/int64(time.Second), 0)
m.Options(model.BEGIN_TIME, t.Format(ice.MOD_TIME), model.END_TIME, t.Add(30*time.Minute).Format(ice.MOD_TIME))
s.ValueCreate(m, m.OptionSimple("issue_uid,from_user_uid,to_user_uid,meet_type,title,content,link,begin_time,end_time,plan_uid")...)
s.SendMessage(s.GetCommandUID(m), m.Option(model.FROM_USER_UID), m.Option(model.TO_USER_UID))
s.SendMessage(s.GetCommandUID(m), m.Option(model.TO_USER_UID), m.Option(model.FROM_USER_UID))
}
func (s Meet) List(m *ice.Message, arg ...string) {
s.ValueList(m, arg).PushAction(s.Preview).Display("")
if s.IsLeader(m) {
m.RenameAppend(model.TO_USER_UID, model.USER_UID)
} else {
m.RenameAppend(model.FROM_USER_UID, model.USER_UID)
}
kit.If(!s.IsLeader(m) && m.Length() == 0, func() { m.SetResult().Echo("请等待管理员创建会议") })
}
func init() { ice.TeamCtxCmd(Meet{}) }
type MeetType int
const (
MeetTalk MeetType = iota
MeetValue
MeetCheck
MeetPlan
)
var MeetTypeList = map[MeetType]string{
MeetTalk: "需求沟通",
MeetValue: "原型评审",
MeetCheck: "项目验收",
MeetPlan: "方向规划",
}
func (s MeetType) String() string { return MeetTypeList[s] }