This commit is contained in:
root 2024-11-09 11:35:30 +08:00
parent 120b16122a
commit 1193961888
16 changed files with 402 additions and 24 deletions

View File

@ -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
})

View File

@ -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{}) }

View File

@ -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{}) }

View File

@ -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{}) }

View File

@ -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{}) }

View File

@ -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{}) }

View File

@ -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{}) }

View File

@ -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{},
)
}

View File

@ -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"
}
}
}

View File

@ -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{}) }

View File

@ -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] }

View File

@ -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]},
] })
},
})

View File

@ -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{}) }

View File

@ -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]},
] })
},
})

View File

@ -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"}}{}) }