From 11939618885251a80e0d8e4c6a30e31f916ff13e Mon Sep 17 00:00:00 2001 From: root Date: Sat, 9 Nov 2024 11:35:30 +0800 Subject: [PATCH] add some --- src/guanlixitong/common.go | 2 + src/guanlixitong/conference.go | 14 ++++ src/guanlixitong/document.go | 14 ++++ src/guanlixitong/employee.go | 14 ++++ src/guanlixitong/equipment.go | 14 ++++ src/guanlixitong/interview.go | 21 ++++++ src/guanlixitong/inventory.go | 14 ++++ src/guanlixitong/model/model.go | 92 ++++++++++++++++++++----- src/guanlixitong/portal.json | 64 +++++++++++++++-- src/guanlixitong/procurement.go | 14 ++++ src/guanlixitong/recruitment.go | 98 +++++++++++++++++++++++++++ src/guanlixitong/recruitment.js | 17 +++++ src/guanlixitong/resume.go | 28 ++++++++ src/guanlixitong/resume.js | 16 +++++ src/main.go | 2 +- src/template/web.code.autogen/demo.go | 2 +- 16 files changed, 402 insertions(+), 24 deletions(-) create mode 100644 src/guanlixitong/conference.go create mode 100644 src/guanlixitong/document.go create mode 100644 src/guanlixitong/employee.go create mode 100644 src/guanlixitong/equipment.go create mode 100644 src/guanlixitong/interview.go create mode 100644 src/guanlixitong/inventory.go create mode 100644 src/guanlixitong/procurement.go create mode 100644 src/guanlixitong/recruitment.go create mode 100644 src/guanlixitong/recruitment.js create mode 100644 src/guanlixitong/resume.go create mode 100644 src/guanlixitong/resume.js diff --git a/src/guanlixitong/common.go b/src/guanlixitong/common.go index 48eef8c..d9a6008 100644 --- a/src/guanlixitong/common.go +++ b/src/guanlixitong/common.go @@ -39,6 +39,8 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message { value = UserGroupRole(kit.Int(value)).String() case model.GROUP_TYPE: value = GroupType(kit.Int(value)).String() + case model.RECRUITMENT_STATUS: + value = RecruitmentStatus(kit.Int(value)).String() } return value }) diff --git a/src/guanlixitong/conference.go b/src/guanlixitong/conference.go new file mode 100644 index 0000000..cc09736 --- /dev/null +++ b/src/guanlixitong/conference.go @@ -0,0 +1,14 @@ +package guanlixitong + +import "shylinux.com/x/ice" + +type conference struct { + Table + fields string `data:"title,content,user_uid"` + create string `name:"create title* content*" role:"leader"` + remove string `name:"remove" role:"leader"` +} + +func (s conference) List(m *ice.Message, arg ...string) { s.ValueList(m, arg) } + +func init() { ice.TeamCtxCmd(conference{}) } diff --git a/src/guanlixitong/document.go b/src/guanlixitong/document.go new file mode 100644 index 0000000..535a3e5 --- /dev/null +++ b/src/guanlixitong/document.go @@ -0,0 +1,14 @@ +package guanlixitong + +import "shylinux.com/x/ice" + +type document struct { + Table + fields string `data:"title,content,user_uid"` + create string `name:"create title* content*" role:"leader"` + remove string `name:"remove" role:"leader"` +} + +func (s document) List(m *ice.Message, arg ...string) { s.ValueList(m, arg) } + +func init() { ice.TeamCtxCmd(document{}) } diff --git a/src/guanlixitong/employee.go b/src/guanlixitong/employee.go new file mode 100644 index 0000000..7bcf9c3 --- /dev/null +++ b/src/guanlixitong/employee.go @@ -0,0 +1,14 @@ +package guanlixitong + +import "shylinux.com/x/ice" + +type employee struct { + Table + fields string `data:"title,content,user_uid"` + create string `name:"create title* content*" role:"leader"` + remove string `name:"remove" role:"leader"` +} + +func (s employee) List(m *ice.Message, arg ...string) { s.ValueList(m, arg) } + +func init() { ice.TeamCtxCmd(employee{}) } diff --git a/src/guanlixitong/equipment.go b/src/guanlixitong/equipment.go new file mode 100644 index 0000000..835db3f --- /dev/null +++ b/src/guanlixitong/equipment.go @@ -0,0 +1,14 @@ +package guanlixitong + +import "shylinux.com/x/ice" + +type equipment struct { + Table + fields string `data:"title,content,user_uid"` + create string `name:"create title* content*" role:"leader"` + remove string `name:"remove" role:"leader"` +} + +func (s equipment) List(m *ice.Message, arg ...string) { s.ValueList(m, arg) } + +func init() { ice.TeamCtxCmd(equipment{}) } diff --git a/src/guanlixitong/interview.go b/src/guanlixitong/interview.go new file mode 100644 index 0000000..20cb0fa --- /dev/null +++ b/src/guanlixitong/interview.go @@ -0,0 +1,21 @@ +package guanlixitong + +import "shylinux.com/x/ice" + +type interview struct { + Table + fields string `data:"title,content,address,begin_time,end_time,user_uid"` + create string `name:"create title* content* address* begin_time*@date end_time*@date" role:"leader"` + remove string `name:"remove" role:"leader"` +} + +func (s interview) List(m *ice.Message, arg ...string) { + s.ValueList(m, arg) + m.Table(func(value ice.Maps) { + m.PushButton(s.Start) + }) +} +func (s interview) Start(m *ice.Message, arg ...string) {} +func (s interview) stop(m *ice.Message, arg ...string) {} + +func init() { ice.TeamCtxCmd(interview{}) } diff --git a/src/guanlixitong/inventory.go b/src/guanlixitong/inventory.go new file mode 100644 index 0000000..637a9b0 --- /dev/null +++ b/src/guanlixitong/inventory.go @@ -0,0 +1,14 @@ +package guanlixitong + +import "shylinux.com/x/ice" + +type inventory struct { + Table + fields string `data:"title,content,user_uid"` + create string `name:"create title* content*" role:"leader"` + remove string `name:"remove" role:"leader"` +} + +func (s inventory) List(m *ice.Message, arg ...string) { s.ValueList(m, arg) } + +func init() { ice.TeamCtxCmd(inventory{}) } diff --git a/src/guanlixitong/model/model.go b/src/guanlixitong/model/model.go index 05546ec..b09e10e 100644 --- a/src/guanlixitong/model/model.go +++ b/src/guanlixitong/model/model.go @@ -3,21 +3,27 @@ package model import "shylinux.com/x/mysql-story/src/db" const ( - UID = "uid" - NAME = "name" - INFO = "info" - TYPE = "type" - TITLE = "title" - CONTENT = "content" - USER_UID = "user_uid" - USER_GROUP_ROLE = "user_group_role" - GROUP_UID = "group_uid" - GROUP_TYPE = "group_type" - CITY_UID = "city_uid" - CITY_NAME = "city_name" - COMPANY_UID = "company_uid" - COMPANY_NAME = "company_name" - AUTH_UID = "auth_uid" + UID = "uid" + NAME = "name" + INFO = "info" + TYPE = "type" + STATUS = "status" + TITLE = "title" + CONTENT = "content" + USER_UID = "user_uid" + USER_GROUP_ROLE = "user_group_role" + GROUP_UID = "group_uid" + GROUP_TYPE = "group_type" + CITY_UID = "city_uid" + CITY_NAME = "city_name" + MARKET_UID = "market_uid" + COMPANY_UID = "company_uid" + COMPANY_NAME = "company_name" + AUTH_UID = "auth_uid" + RECRUITMENT_STATUS = "recruitment_status" + SALARY = "salary" + SENIORITY = "seniority" + DEGREE = "degree" ) type UserGroup struct { @@ -35,5 +41,59 @@ type Target struct { db.ModelContent GroupUID string `gorm:"type:char(32);index"` } +type Recruitment struct { + db.ModelContent + GroupUID string `gorm:"type:char(32);index"` + Degree string `gorm:"type:varchar(32)"` + Seniority string `gorm:"type:varchar(32)"` + Salary string `gorm:"type:varchar(32)"` + Total int `gorm:"default:0"` + Count int `gorm:"default:0"` + Status uint8 `gorm:"default:0"` +} +type Resume struct { + db.ModelNameInfo + GroupUID string `gorm:"type:char(32);index"` + Email string `gorm:"type:varchar(32)"` + Mobile string `gorm:"type:varchar(32)"` + Degree string `gorm:"type:varchar(32)"` +} +type Interview struct { + db.ModelContent + GroupUID string `gorm:"type:char(32);index"` + Address string `gorm:"type:varchar(255)"` + BeginTime db.Time + EndTime db.Time +} +type Employee struct { + db.ModelContent + GroupUID string `gorm:"type:char(32);index"` +} +type Inventory struct { + db.ModelContent + GroupUID string `gorm:"type:char(32);index"` +} +type Procurement struct { + db.ModelContent + GroupUID string `gorm:"type:char(32);index"` +} +type Equipment struct { + db.ModelContent + GroupUID string `gorm:"type:char(32);index"` +} +type Conference struct { + db.ModelContent + GroupUID string `gorm:"type:char(32);index"` +} +type Document struct { + db.ModelContent + GroupUID string `gorm:"type:char(32);index"` +} -func init() { db.CmdModels("", &UserGroup{}, &Group{}, &Company{}, &Target{}) } +func init() { + db.CmdModels("", &UserGroup{}, &Group{}, &Company{}, &Target{}, + &Recruitment{}, &Resume{}, &Interview{}, &Employee{}, + &Inventory{}, &Procurement{}, &Equipment{}, + &Conference{}, &Document{}, + ) +} diff --git a/src/guanlixitong/portal.json b/src/guanlixitong/portal.json index a4405a0..fd35a12 100644 --- a/src/guanlixitong/portal.json +++ b/src/guanlixitong/portal.json @@ -1,14 +1,53 @@ { - "portal": "管理系统", "member": "团队成员", - "target": "目标计划", + "portal": "团队管理", "member": "团队成员", "target": "目标计划", + "recruitment": "招聘需求", "resume": "应聘简历", "interview": "招聘面试", "employee": "员工信息", + "inventory": "库存物资", "procurement": "采购清单", "equipment": "办公用品", + "conference": "在线会议", "document": "在线文档", + "resumeInsert": "投简历", "interviewInsert": "约面试", + "start": "开启", "icons": { + "recruitment": "https://img.icons8.com/officel/80/set-as-resume.png", + "resume": "https://img.icons8.com/officel/80/parse-from-clipboard.png", + "interview": "https://img.icons8.com/officel/80/meeting.png", + "employee": "https://img.icons8.com/officel/80/about-us-male--v2.png", + + "inventory": "https://img.icons8.com/officel/80/warehouse.png", + "procurement": "https://img.icons8.com/officel/80/purchase-order.png", + "equipment": "https://img.icons8.com/officel/80/office.png", + + "conference": "https://img.icons8.com/officel/80/video-conference.png", + "document": "https://img.icons8.com/officel/80/upload-link-document.png", "target": "https://img.icons8.com/officel/80/goal--v1.png" }, + "style": { + "resumeInsert": "notice", + "interviewInsert": "notice" + }, "input": { "My Group": "我的团队", "user_group_role": "成员角色", "group_name": "团队名称", - "group_type": "团队类型" + "group_type": "团队类型", + "recruitment_status": "招聘状态", + "recruitment": { + "title": "招聘岗位", + "degree": "学历要求", + "seniority": "经验要求", + "salary": "薪资待遇", + "content": "岗位要求", + "total": "招聘人数", + "name": "姓名", + "info": "简介", + "count": "已招人数" + }, + "resume": { + "name": "姓名", + "info": "简介", + "degree": "学历" + }, + "interview": { + "start": "开始面试" + } }, "value": { "user_group_role": { @@ -25,12 +64,25 @@ "group_type": { "RD": "研发", "OP": "运维", - "HR": "人力", + "HR": "人事", "FA": "财务", - "Admin": "行政", + "admin": "行政", "sales": "销售", "icons": { - "RD": "https://img.icons8.com/officel/80/code.png" + "RD": "https://img.icons8.com/officel/80/code.png", + "OP": "https://img.icons8.com/officel/80/console.png", + "HR": "https://img.icons8.com/officel/80/crowd.png", + "FA": "https://img.icons8.com/officel/80/sell-property.png", + "sales": "https://img.icons8.com/officel/80/administrator-male.png" + } + }, + "recruitment_status": { + "create": "待启动", + "start": "招聘中", + "stop": "停止招聘", + "style": { + "create": "danger", + "stop": "danger" } } } diff --git a/src/guanlixitong/procurement.go b/src/guanlixitong/procurement.go new file mode 100644 index 0000000..08f9218 --- /dev/null +++ b/src/guanlixitong/procurement.go @@ -0,0 +1,14 @@ +package guanlixitong + +import "shylinux.com/x/ice" + +type procurement struct { + Table + fields string `data:"title,content,user_uid"` + create string `name:"create title* content*" role:"leader"` + remove string `name:"remove" role:"leader"` +} + +func (s procurement) List(m *ice.Message, arg ...string) { s.ValueList(m, arg) } + +func init() { ice.TeamCtxCmd(procurement{}) } diff --git a/src/guanlixitong/recruitment.go b/src/guanlixitong/recruitment.go new file mode 100644 index 0000000..4899011 --- /dev/null +++ b/src/guanlixitong/recruitment.go @@ -0,0 +1,98 @@ +package guanlixitong + +import ( + "shylinux.com/x/ice" + kit "shylinux.com/x/toolkits" + + "shylinux.com/x/enterprise/src/guanlixitong/model" +) + +type recruitment struct { + Table + resume resume + fields string `data:"title,degree,seniority,salary,content,total,count,recruitment_status,user_uid"` + create string `name:"create title* degree* seniority* salary* content* total*=1" role:"leader"` + modify string `name:"modify content*" role:"leader"` + remove string `name:"remove" role:"leader"` + start string `name:"start" role:"leader"` + stop string `name:"stop" role:"leader"` + resumeInsert string `name:"create name* info* mobile* email degree*" role:"void"` +} + +func (s recruitment) Inputs(m *ice.Message, arg ...string) { + switch arg[0] { + case model.TITLE: + m.Push(arg[0], "高级销售") + m.Push(arg[0], "中级销售") + m.Push(arg[0], "初级销售") + case model.DEGREE: + m.Push(arg[0], "博士") + m.Push(arg[0], "硕士") + m.Push(arg[0], "本科") + m.Push(arg[0], "大专") + m.Push(arg[0], "高中") + m.Push(arg[0], "中专") + m.Push(arg[0], "初中") + case model.SENIORITY: + m.Push(arg[0], "10年以上") + m.Push(arg[0], "5-10年") + m.Push(arg[0], "3-5年") + m.Push(arg[0], "1-3年") + m.Push(arg[0], "应届生") + m.Push(arg[0], "在校生") + case model.SALARY: + m.Push(arg[0], "45K以上") + m.Push(arg[0], "35-45K") + m.Push(arg[0], "25-35K") + m.Push(arg[0], "15-25K") + m.Push(arg[0], "15K以下") + case model.CONTENT: + default: + s.Table.Inputs(m, arg...) + } +} +func (s recruitment) List(m *ice.Message, arg ...string) { + s.ValueList(m, arg).Table(func(value ice.Maps) { + switch RecruitmentStatus(kit.Int(value[model.RECRUITMENT_STATUS])) { + case RecruitmentCreate: + m.PushButton(s.Start, s.Modify, s.Remove) + case RecruitmentStart: + if m.Option(model.MARKET_UID) != "" { + m.PushButton(s.ResumeInsert) + } else if s.IsLeader(m) { + m.PushButton(s.ResumeInsert, s.MarketInsert, s.Modify, s.Stop) + } else { + m.PushButton(s.ResumeInsert) + } + case RecruitmentStop: + m.PushButton() + } + }).Display("") +} +func (s recruitment) Start(m *ice.Message, arg ...string) { + s.ValueModify(m, model.STATUS, kit.Format(RecruitmentStart)) +} +func (s recruitment) Stop(m *ice.Message, arg ...string) { + s.ValueModify(m, model.STATUS, kit.Format(RecruitmentStop)) +} +func (s recruitment) ResumeInsert(m *ice.Message, arg ...string) { + m.Cmdy(s.resume, s.Insert, arg, m.OptionSimple(model.GROUP_UID, model.USER_UID)) +} + +func init() { ice.TeamCtxCmd(recruitment{}) } + +type RecruitmentStatus int + +const ( + RecruitmentCreate RecruitmentStatus = iota + RecruitmentStart + RecruitmentStop +) + +var RecruitmentStatusList = map[RecruitmentStatus]string{ + RecruitmentCreate: "create", + RecruitmentStart: "start", + RecruitmentStop: "stop", +} + +func (s RecruitmentStatus) String() string { return RecruitmentStatusList[s] } diff --git a/src/guanlixitong/recruitment.js b/src/guanlixitong/recruitment.js new file mode 100644 index 0000000..033874b --- /dev/null +++ b/src/guanlixitong/recruitment.js @@ -0,0 +1,17 @@ +Volcanos(chat.ONIMPORT, { + _init: function(can, msg) { + can.onimport.myView(can, msg, function(value) { return [ + {view: html.TITLE, list: [ + value.title, can.onimport.textView(can, value, "recruitment_status"), can.onimport.titleAction(can, value), + // can.onimport.textView(can, value, "count", "status"), can.onimport.textView(can, value, "total", "status"), + ]}, + // {view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]}, + {view: html.STATUS, list: [ + can.onimport.textView(can, value, "degree", "status"), + can.onimport.textView(can, value, "seniority", "status"), + can.onimport.textView(can, value, "salary", "status"), + ]}, + {view: html.OUTPUT, list: [value.content]}, + ] }) + }, +}) \ No newline at end of file diff --git a/src/guanlixitong/resume.go b/src/guanlixitong/resume.go new file mode 100644 index 0000000..e53be39 --- /dev/null +++ b/src/guanlixitong/resume.go @@ -0,0 +1,28 @@ +package guanlixitong + +import ( + "shylinux.com/x/ice" + + "shylinux.com/x/enterprise/src/guanlixitong/model" +) + +type resume struct { + interview interview + Table + fields string `data:"name,info,mobile,email,degree,user_uid"` + create string `name:"create name* info* mobile* email degree" role:"leader"` + remove string `name:"remove" role:"leader"` + interviewInsert string `name:"create title* content* address* begin_time*@date end_time*@date" role:"leader"` +} + +func (s resume) List(m *ice.Message, arg ...string) { + s.ValueList(m, arg).Display("") + m.Table(func(value ice.Maps) { + m.PushButton(s.InterviewInsert) + }) +} +func (s resume) InterviewInsert(m *ice.Message, arg ...string) { + m.Cmdy(s.interview, s.interview.Insert, arg, m.OptionSimple(model.GROUP_UID, model.USER_UID)) +} + +func init() { ice.TeamCtxCmd(resume{}) } diff --git a/src/guanlixitong/resume.js b/src/guanlixitong/resume.js new file mode 100644 index 0000000..9f6524b --- /dev/null +++ b/src/guanlixitong/resume.js @@ -0,0 +1,16 @@ +Volcanos(chat.ONIMPORT, { + _init: function(can, msg) { + can.onimport.myView(can, msg, function(value) { return [ + {view: html.TITLE, list: [ + value.title||value.name||value.user_name, + can.onimport.titleAction(can, value), + ]}, + {view: html.STATUS, list: [ + can.onimport.textView(can, value, "degree", "status"), + can.onimport.textView(can, value, "seniority", "status"), + can.onimport.textView(can, value, "salary", "status"), + ]}, + {view: html.OUTPUT, list: [value.content||value.info]}, + ] }) + }, +}) \ No newline at end of file diff --git a/src/main.go b/src/main.go index db26222..eccc7bf 100644 --- a/src/main.go +++ b/src/main.go @@ -11,4 +11,4 @@ import ( func main() { print(ice.Run()) } -func init() { ice.Info.NodeMain = "web.team.guanlixitong.portal" } +func init() { ice.Info.NodeMain = "web.team.guanlixitong.portal" } \ No newline at end of file diff --git a/src/template/web.code.autogen/demo.go b/src/template/web.code.autogen/demo.go index e115ec0..f324ea0 100644 --- a/src/template/web.code.autogen/demo.go +++ b/src/template/web.code.autogen/demo.go @@ -9,6 +9,6 @@ type {{.Option "name"}} struct { remove string `name:"remove" role:"leader"` } -func (s {{.Option "name"}}) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") } +func (s {{.Option "name"}}) List(m *ice.Message, arg ...string) { s.ValueList(m, arg) } func init() { ice.TeamCtxCmd({{.Option "name"}}{}) }