mirror of
https://shylinux.com/x/operation
synced 2025-07-01 21:21:19 +08:00
60 lines
2.1 KiB
Go
60 lines
2.1 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:"10"`
|
|
fields string `data:"from_user_uid,to_user_uid,meet_type,title,content,link,begin_time,end_time,issue_uid,plan_uid,story_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"`
|
|
preview string `name:"preview" help:"入会" role:"worker"`
|
|
}
|
|
|
|
func (s Meet) Create(m *ice.Message, arg ...string) {
|
|
t := time.Unix(kit.Time(kit.Select(m.Option("date")+" "+m.Option("time")+":00", m.Option(model.BEGIN_TIME)))/int64(time.Second), 0)
|
|
m.OptionDefault(model.BEGIN_TIME, t.Format(ice.MOD_TIME), model.END_TIME, t.Add(30*time.Minute).Format(ice.MOD_TIME))
|
|
m.Option(model.COMPANY_UID, m.Cmd(story{}, s.Select, model.UID, m.Option(model.STORY_UID)).Append(model.COMPANY_UID))
|
|
s.ValueCreate(m, m.OptionSimple("issue_uid,from_user_uid,to_user_uid,meet_type,title,content,link,begin_time,end_time,plan_uid,company_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) {
|
|
if s.ValueList(m, arg).Display(""); s.IsLeader(m) {
|
|
m.RenameAppend(model.TO_USER_UID, model.USER_UID)
|
|
m.PushAction(s.Preview, s.Remove)
|
|
} else {
|
|
m.RenameAppend(model.FROM_USER_UID, model.USER_UID)
|
|
m.PushAction(s.Preview)
|
|
}
|
|
kit.If(!s.IsLeader(m) && m.Length() == 0, func() { m.SetResult().Echo("请等待管理员创建会议") })
|
|
s.OtherListCmd(m, s.IssueList, s.DesignList, s.DealList)
|
|
}
|
|
|
|
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] }
|