This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-05-27 08:14:58 +08:00
parent e9b2fd3836
commit 027834cad2
29 changed files with 487 additions and 6 deletions

3
go.mod
View File

@ -21,6 +21,8 @@ require (
)
require (
2025-dev.shylinux.com/x/20250211-service v0.0.6 // indirect
2025-dev.shylinux.com/x/20250215-cluster v0.0.7 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emersion/go-imap v1.2.1 // indirect
@ -44,4 +46,5 @@ require (
modernc.org/mathutil v1.5.0 // indirect
modernc.org/memory v1.5.0 // indirect
modernc.org/sqlite v1.23.1 // indirect
shylinux.com/x/operation v0.0.14 // indirect
)

9
go.sum
View File

@ -1,3 +1,8 @@
2025-dev.shylinux.com/x/20250211-service v0.0.6 h1:FOQ6Z+eHsY+3qfIoKHjblbIs6BUyHPq1xGK1wvFdfXo=
2025-dev.shylinux.com/x/20250211-service v0.0.6/go.mod h1:iHH7uHRP7WasG19pNjujlXwZFjJqzX3dS0/T1imfsj0=
2025-dev.shylinux.com/x/20250215-cluster v0.0.6/go.mod h1:4sbNfB+nBVmIpRSzVlY+uiEQv44JdPfwwBpwWzbQktw=
2025-dev.shylinux.com/x/20250215-cluster v0.0.7 h1:GhQImaF6RbliJ6467gdeB4AVzCNyz5LwmA9AeCphEvo=
2025-dev.shylinux.com/x/20250215-cluster v0.0.7/go.mod h1:rhNacwQogLrmiNkmoptqpKY9ieRXAhVHenHwZRcdBB8=
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
github.com/agiledragon/gomonkey v2.0.2+incompatible h1:eXKi9/piiC3cjJD1658mEE2o3NjkJ5vDLgYjCQu0Xlw=
@ -186,14 +191,18 @@ shylinux.com/x/go-qrcode v0.0.3/go.mod h1:KAbtU+KwiiABMZ/CJ0zh9PI2AX82Uf9rRYcQ4O
shylinux.com/x/go-sql-mysql v0.0.2/go.mod h1:lHjRMZz5Lii6U+49fhkbCWgsnL+yux54SYJYWqASN8Y=
shylinux.com/x/golang-story v0.0.32 h1:7xu28iREL2cuZzf80luJwI9BWptow+ME00L1lgyjmDI=
shylinux.com/x/golang-story v0.0.32/go.mod h1:NsI5fULu3q7o2b+VzZ5tiJ3+0pUTjE9DdQxa870htmw=
shylinux.com/x/ice v1.5.72/go.mod h1:ouTMN0stkJu1RGAQrMHrGj/BqDynyD1VV53shR9zQm4=
shylinux.com/x/ice v1.5.73/go.mod h1:uGI73gYkk+FiJt5qmy/aYhoKRJ4wobcJk3WrPGh8Waw=
shylinux.com/x/ice v1.5.74 h1:5hTPmchO79b1d2+/DwBDLiG2WkTL65G/hOEAcGJVeB8=
shylinux.com/x/ice v1.5.74/go.mod h1:/XAib8Ha+z6jzLRs2Pig+qxDx4C8dT8Vfaq2InJ/lkU=
shylinux.com/x/icebergs v1.9.73/go.mod h1:3Bdp3tjzw+hUKJF+kR8pfsrbjAf72DVZmCaE8/MPFtk=
shylinux.com/x/icebergs v1.9.75/go.mod h1:3Bdp3tjzw+hUKJF+kR8pfsrbjAf72DVZmCaE8/MPFtk=
shylinux.com/x/icebergs v1.9.76 h1:SHOTbiO+jh09GEFzoo8t8kmR1BCu+zkNCpdfxPCLeu0=
shylinux.com/x/icebergs v1.9.76/go.mod h1:3Bdp3tjzw+hUKJF+kR8pfsrbjAf72DVZmCaE8/MPFtk=
shylinux.com/x/mysql-story v0.6.32 h1:Q274WFJ09ocnf8nhlQnKr02FMMdPYBLWqu2IjTVqGiM=
shylinux.com/x/mysql-story v0.6.32/go.mod h1:8HCeDUV6ghaIeJD1IEhSeSOfVC9wEI93y2G9QBLtJJY=
shylinux.com/x/operation v0.0.14 h1:tS8JOJwrM6ZpO6WmvQ0Fpl4vOOx0PcyC+7eq1j5aFwY=
shylinux.com/x/operation v0.0.14/go.mod h1:QYPjnjzoWh9VMpU8GJU2wL06djzBHhZzif5nhnjJMCE=
shylinux.com/x/toolkits v0.7.10/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=
shylinux.com/x/toolkits v1.0.19 h1:Nrx0xYRc5ph1WS66EZ1hJUCe+2FdSWQ4QP6tBlguikQ=
shylinux.com/x/toolkits v1.0.19/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=

View File

@ -5,12 +5,12 @@ import (
_ "shylinux.com/x/enterprise/src/gongyinglian"
_ "shylinux.com/x/enterprise/src/guanlixitong"
_ "shylinux.com/x/enterprise/src/shichangyingxiao"
_ "shylinux.com/x/enterprise/src/zijinlian"
_ "shylinux.com/x/enterprise/src/xiangmuguanli"
_ "shylinux.com/x/enterprise/src/peixunguanli"
_ "shylinux.com/x/enterprise/src/shichangyingxiao"
_ "shylinux.com/x/enterprise/src/xiangmuguanli"
_ "shylinux.com/x/enterprise/src/yingxiaotuiguang"
_ "shylinux.com/x/enterprise/src/zijinlian"
_ "shylinux.com/x/operation/src/production"
)
func main() { print(ice.Run()) }

View File

@ -0,0 +1,41 @@
package peixunguanli
import (
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/enterprise/src/guanlixitong"
"shylinux.com/x/enterprise/src/peixunguanli/model"
)
type Table struct {
guanlixitong.Table
list string `name:"list train_uid uid auto" role:"void"`
}
func (s Table) Inputs(m *ice.Message, arg ...string) {
switch arg[0] {
case model.USER_TRAIN_ROLE:
s.InputsListRole(m, UserTrainRoleList, arg...)
case model.TRAIN_TYPE:
s.InputsList(m, TrainTypeList, arg...)
default:
s.Table.Inputs(m, arg...)
}
}
func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
m.RewriteAppend(func(value, key string, index int) string {
switch key {
case model.USER_TRAIN_ROLE:
value = UserTrainRole(kit.Int(value)).String()
case model.TRAIN_TYPE:
value = TrainType(kit.Int(value)).String()
}
return value
})
return s.Table.RewriteAppend(m)
}
type Tables struct { Table }
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}

View File

@ -0,0 +1,17 @@
package peixunguanli
import "shylinux.com/x/ice"
type course struct {
Table
order string `data:"2"`
fields string `data:"title,content"`
create string `name:"create title* content*" role:"leader"`
remove string `name:"remove" role:"leader"`
}
func (s course) List(m *ice.Message, arg ...string) {
// s.ValueList(m, arg).Display("")
}
func init() { ice.TeamCtxCmd(course{}) }

BIN
src/peixunguanli/course.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1,17 @@
package peixunguanli
import "shylinux.com/x/ice"
type evaluation struct {
Table
order string `data:"4"`
fields string `data:"title,content"`
create string `name:"create title* content*" role:"leader"`
remove string `name:"remove" role:"leader"`
}
func (s evaluation) List(m *ice.Message, arg ...string) {
// s.ValueList(m, arg).Display("")
}
func init() { ice.TeamCtxCmd(evaluation{}) }

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -0,0 +1,17 @@
package peixunguanli
import "shylinux.com/x/ice"
type feedback struct {
Tables
order string `data:"5"`
fields string `data:"title,content"`
create string `name:"create title* content*" role:"leader"`
remove string `name:"remove" role:"leader"`
}
func (s feedback) List(m *ice.Message, arg ...string) {
// s.ValueList(m, arg).Display("")
}
func init() { ice.TeamCtxCmd(feedback{}) }

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -0,0 +1,51 @@
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_TRAIN_ROLE = "user_train_role"
TRAIN_UID = "train_uid"
TRAIN_NAME = "train_name"
TRAIN_TYPE = "train_type"
PLAN_UID = "plan_uid"
)
type UserTrain struct {
db.ModelUserPlace
TrainUID string `gorm:"type:char(32);index"`
}
type Train struct {
db.ModelPlace
CompanyUID string `gorm:"type:char(32);index"`
}
type Plan struct {
db.ModelContent
TrainUID string `gorm:"type:char(32);index"`
}
type Course struct {
db.ModelContent
TrainUID string `gorm:"type:char(32);index"`
}
type Record struct {
db.ModelContent
TrainUID string `gorm:"type:char(32);index"`
}
type Evaluation struct {
db.ModelContent
TrainUID string `gorm:"type:char(32);index"`
}
type Feedback struct {
db.ModelContent
TrainUID string `gorm:"type:char(32);index"`
}
func init() {
db.CmdModels("", &UserTrain{}, &Train{}, &Plan{}, &Course{}, &Record{}, &Evaluation{}, &Feedback{})
}

15
src/peixunguanli/plan.go Normal file
View File

@ -0,0 +1,15 @@
package peixunguanli
import "shylinux.com/x/ice"
type plan struct {
Table
order string `data:"1"`
fields string `data:"title,content,user_uid"`
create string `name:"create title* content*" role:"leader"`
remove string `name:"remove" role:"leader"`
}
func (s plan) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
func init() { ice.TeamCtxCmd(plan{}) }

9
src/peixunguanli/plan.js Normal file
View File

@ -0,0 +1,9 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.title||value.name]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
{view: html.OUTPUT, list: [value.content||value.info]},
] })
},
})

BIN
src/peixunguanli/plan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -0,0 +1,13 @@
package peixunguanli
import (
"shylinux.com/x/community/src/gonganxitong"
"shylinux.com/x/enterprise/src/guanlixitong"
)
type Portal struct {
guanlixitong.Portal
placeCreate string `name:"placeCreate city_name* company_name* train_name* train_type:select" role:"void"`
}
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userTrain{}, train{})}) }

View File

@ -0,0 +1,39 @@
{
"portal": "培训管理",
"plan": "培训计划",
"course": "培训课程",
"record": "培训记录",
"evaluation": "考核评估",
"feedback": "建议反馈",
"icons": {
"plan": "plan.png",
"course": "course.png",
"record": "record.png",
"evaluation": "evaluation.png",
"feedback": "feedback.png"
},
"input": {
"My Train": "我的场景",
"user_train_role": "成员角色",
"train_name": "场景名称",
"train_type": "场景类型"
},
"value": {
"user_train_role": {
"visitor": "访客",
"creator": "创建人",
"leader": "管理人员",
"worker": "工作人员",
"server": "服务人员",
"style": {
"creator": "danger",
"leader": "danger"
}
},
"train_type": {
"RD": "研发群",
"OP": "运维群",
"HR": "人力群"
}
}
}

View File

@ -0,0 +1,17 @@
package peixunguanli
import "shylinux.com/x/ice"
type record struct {
Table
order string `data:"3"`
fields string `data:"title,content"`
create string `name:"create title* content*" role:"leader"`
remove string `name:"remove" role:"leader"`
}
func (s record) List(m *ice.Message, arg ...string) {
// s.ValueList(m, arg).Display("")
}
func init() { ice.TeamCtxCmd(record{}) }

BIN
src/peixunguanli/record.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

23
src/peixunguanli/train.go Normal file
View File

@ -0,0 +1,23 @@
package peixunguanli
import "shylinux.com/x/ice"
type train struct{ Table }
func init() { ice.TeamCtxCmd(train{}) }
type TrainType int
const (
TrainRD TrainType = iota
TrainOP
TrainHR
)
var TrainTypeList = map[TrainType]string{
TrainRD: "RD",
TrainOP: "OP",
TrainHR: "HR",
}
func (s TrainType) String() string { return TrainTypeList[s] }

View File

@ -0,0 +1,15 @@
package peixunguanli
import (
"shylinux.com/x/ice"
"shylinux.com/x/enterprise/src/guanlixitong"
)
type userTrain struct{ Table }
func init() { ice.TeamCtxCmd(userTrain{}) }
type UserTrainRole = guanlixitong.UserGroupRole
var UserTrainRoleList = guanlixitong.UserGroupRoleList

View File

@ -0,0 +1,41 @@
package yingxiaotuiguang
import (
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/enterprise/src/guanlixitong"
"shylinux.com/x/enterprise/src/yingxiaotuiguang/model"
)
type Table struct {
guanlixitong.Table
list string `name:"list promotion_uid uid auto" role:"void"`
}
func (s Table) Inputs(m *ice.Message, arg ...string) {
switch arg[0] {
case model.USER_PROMOTION_ROLE:
s.InputsListRole(m, UserPromotionRoleList, arg...)
case model.PROMOTION_TYPE:
s.InputsList(m, PromotionTypeList, arg...)
default:
s.Table.Inputs(m, arg...)
}
}
func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
m.RewriteAppend(func(value, key string, index int) string {
switch key {
case model.USER_PROMOTION_ROLE:
value = UserPromotionRole(kit.Int(value)).String()
case model.PROMOTION_TYPE:
value = PromotionType(kit.Int(value)).String()
}
return value
})
return s.Table.RewriteAppend(m)
}
type Tables struct { Table }
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}

View File

@ -0,0 +1,34 @@
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_PROMOTION_ROLE = "user_promotion_role"
PROMOTION_UID = "promotion_uid"
PROMOTION_NAME = "promotion_name"
PROMOTION_TYPE = "promotion_type"
PRODUCT_UID = "product_uid"
)
type UserPromotion struct {
db.ModelUserPlace
PromotionUID string `gorm:"type:char(32);index"`
}
type Promotion struct {
db.ModelPlace
CompanyUID string `gorm:"type:char(32);index"`
}
type Product struct {
db.ModelContent
PromotionUID string `gorm:"type:char(32);index"`
}
func init() { db.CmdModels("", &UserPromotion{}, &Promotion{}, &Product{}) }

View File

@ -0,0 +1,13 @@
package yingxiaotuiguang
import (
"shylinux.com/x/community/src/gonganxitong"
"shylinux.com/x/enterprise/src/guanlixitong"
)
type Portal struct {
guanlixitong.Portal
placeCreate string `name:"placeCreate city_name* company_name* promotion_name* promotion_type:select" role:"void"`
}
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userPromotion{}, promotion{})}) }

View File

@ -0,0 +1,31 @@
{
"portal": "营销推广",
"product": "场景应用",
"icons": {
"product": "https://img.icons8.com/officel/80/activity-grid.png"
},
"input": {
"My Promotion": "我的场景",
"user_promotion_role": "成员角色",
"promotion_name": "场景名称",
"promotion_type": "场景类型"
},
"value": {
"user_promotion_role": {
"visitor": "访客",
"creator": "创建人",
"leader": "管理人员",
"worker": "工作人员",
"server": "服务人员",
"style": {
"creator": "danger",
"leader": "danger"
}
},
"promotion_type": {
"RD": "研发群",
"OP": "运维群",
"HR": "人力群"
}
}
}

View File

@ -0,0 +1,15 @@
package yingxiaotuiguang
import "shylinux.com/x/ice"
type product struct {
Table
order string `data:"1"`
fields string `data:"title,content,user_uid"`
create string `name:"create title* content*" role:"leader"`
remove string `name:"remove" role:"leader"`
}
func (s product) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
func init() { ice.TeamCtxCmd(product{}) }

View File

@ -0,0 +1,9 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.title||value.name]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
{view: html.OUTPUT, list: [value.content||value.info]},
] })
},
})

View File

@ -0,0 +1,23 @@
package yingxiaotuiguang
import "shylinux.com/x/ice"
type promotion struct{ Table }
func init() { ice.TeamCtxCmd(promotion{}) }
type PromotionType int
const (
PromotionRD PromotionType = iota
PromotionOP
PromotionHR
)
var PromotionTypeList = map[PromotionType]string{
PromotionRD: "RD",
PromotionOP: "OP",
PromotionHR: "HR",
}
func (s PromotionType) String() string { return PromotionTypeList[s] }

View File

@ -0,0 +1,15 @@
package yingxiaotuiguang
import (
"shylinux.com/x/ice"
"shylinux.com/x/enterprise/src/guanlixitong"
)
type userPromotion struct{ Table }
func init() { ice.TeamCtxCmd(userPromotion{}) }
type UserPromotionRole = guanlixitong.UserGroupRole
var UserPromotionRoleList = guanlixitong.UserGroupRoleList

View File

@ -83,6 +83,13 @@
"type": "hash"
}
},
"39afa938372a41145248ba146adf59f8": {
"meta": {
"index": "web.team.peixunguanli.portal",
"time": "2025-05-22 18:37:53.154",
"type": "hash"
}
},
"3d5e29345efc954914f0ca14ecce26b3": {
"meta": {
"index": "web.team.development.portal",
@ -132,6 +139,13 @@
"type": "hash"
}
},
"5d9b843233b06dde7e1ae7a27f2a7efb": {
"meta": {
"index": "web.team.yingxiaotuiguang.portal",
"time": "2025-05-26 18:52:45.217",
"type": "hash"
}
},
"63c64bf8b1b104e2db3493f457fd48a7": {
"meta": {
"index": "aaa.asign",