mirror of
https://shylinux.com/x/operation
synced 2025-04-25 01:08:04 +08:00
add some
This commit is contained in:
parent
5118c259e4
commit
2eed8c96c5
@ -1,23 +0,0 @@
|
||||
package base
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type base struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(base{}) }
|
||||
|
||||
type BaseType int
|
||||
|
||||
const (
|
||||
BaseRD BaseType = iota
|
||||
BaseOP
|
||||
BaseHR
|
||||
)
|
||||
|
||||
var BaseTypeList = map[BaseType]string{
|
||||
BaseRD: "RD",
|
||||
BaseOP: "OP",
|
||||
BaseHR: "HR",
|
||||
}
|
||||
|
||||
func (s BaseType) String() string { return BaseTypeList[s] }
|
@ -1,41 +0,0 @@
|
||||
package base
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
"shylinux.com/x/operation/src/base/model"
|
||||
)
|
||||
|
||||
type Table struct {
|
||||
guanlixitong.Table
|
||||
list string `name:"list base_uid uid auto" role:"void"`
|
||||
}
|
||||
|
||||
func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
switch arg[0] {
|
||||
case model.USER_BASE_ROLE:
|
||||
s.InputsListRole(m, UserBaseRoleList, arg...)
|
||||
case model.BASE_TYPE:
|
||||
s.InputsList(m, BaseTypeList, 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_BASE_ROLE:
|
||||
value = UserBaseRole(kit.Int(value)).String()
|
||||
case model.BASE_TYPE:
|
||||
value = BaseType(kit.Int(value)).String()
|
||||
}
|
||||
return value
|
||||
})
|
||||
return s.Table.RewriteAppend(m)
|
||||
}
|
||||
|
||||
type Tables struct { Table }
|
||||
|
||||
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
@ -1,15 +0,0 @@
|
||||
package base
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type core 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 core) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
||||
|
||||
func init() { ice.TeamCtxCmd(core{}) }
|
@ -1,34 +0,0 @@
|
||||
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_BASE_ROLE = "user_base_role"
|
||||
BASE_UID = "base_uid"
|
||||
BASE_NAME = "base_name"
|
||||
BASE_TYPE = "base_type"
|
||||
CORE_UID = "_uid"
|
||||
)
|
||||
|
||||
type UserBase struct {
|
||||
db.ModelUserPlace
|
||||
BaseUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type Base struct {
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type Core struct {
|
||||
db.ModelContent
|
||||
BaseUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
|
||||
|
||||
func init() { db.CmdModels("", &UserBase{}, &Base{}, &Core{}) }
|
@ -1,13 +0,0 @@
|
||||
package base
|
||||
|
||||
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* base_name* base_type:select" role:"void"`
|
||||
}
|
||||
|
||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userBase{}, base{})}) }
|
@ -1,31 +0,0 @@
|
||||
{
|
||||
"portal": "base",
|
||||
"": "场景应用",
|
||||
"icons": {
|
||||
"": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
},
|
||||
"input": {
|
||||
"My Base": "我的场景",
|
||||
"user_base_role": "成员角色",
|
||||
"base_name": "场景名称",
|
||||
"base_type": "场景类型"
|
||||
},
|
||||
"value": {
|
||||
"user_base_role": {
|
||||
"visitor": "访客",
|
||||
"creator": "创建人",
|
||||
"leader": "管理人员",
|
||||
"worker": "工作人员",
|
||||
"server": "服务人员",
|
||||
"style": {
|
||||
"creator": "danger",
|
||||
"leader": "danger"
|
||||
}
|
||||
},
|
||||
"base_type": {
|
||||
"RD": "研发群",
|
||||
"OP": "运维群",
|
||||
"HR": "人力群"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package base
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
)
|
||||
|
||||
type userBase struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userBase{}) }
|
||||
|
||||
type UserBaseRole = guanlixitong.UserGroupRole
|
||||
|
||||
var UserBaseRoleList = guanlixitong.UserGroupRoleList
|
@ -3,6 +3,7 @@
|
||||
"version": "版本",
|
||||
"history": "记录",
|
||||
"serve": "服务",
|
||||
"config": "配置",
|
||||
"icons": {
|
||||
"serve": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
"version": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
|
@ -23,29 +23,30 @@ type serve struct {
|
||||
autogen string `name:"autogen name* help* class* table*" icon:"bi bi-plus-square-dotted" role:"leader,worker"`
|
||||
}
|
||||
|
||||
func (s serve) BeforeAction(m *ice.Message, arg ...string) *ice.Message {
|
||||
func (s serve) BeforeAction(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
return
|
||||
}
|
||||
kit.If(len(arg) == 1 || arg[0] != ctx.ACTION, func() { m.Option(model.REPOS_UID, arg[0]) })
|
||||
msg := m.Cmd(s.repos, s.Select, model.UID, m.Option(model.REPOS_UID), ice.Maps{mdb.TABLE: ""})
|
||||
m.Option(model.REPOS_NAME, msg.Append(model.NAME))
|
||||
return msg
|
||||
m.Options(model.REPOS_NAME, msg.Append(model.NAME), model.REPOS_TYPE, msg.Append(model.TYPE))
|
||||
}
|
||||
func (s serve) Imports(m *ice.Message, arg ...string) {
|
||||
s.spaceCmdy(m, web.CODE_GIT_REPOS, "init", kit.MergeURL2(m.Option(ice.MSG_USERHOST), "/x/"+m.Option(model.REPOS_NAME)))
|
||||
s.spaceCmdy(m, web.CODE_AUTOGEN, code.IMPORT, "gonganxitong", "shylinux.com/x/community")
|
||||
s.spaceCmdy(m, web.CODE_AUTOGEN, code.IMPORT, "db/mysql", "shylinux.com/x/mysql-story")
|
||||
s.spaceCmdy(m, web.CODE_VIMER, code.COMPILE)
|
||||
s.SpaceCmdy(m, ice.OPS, web.CODE_COMPILE, code.DEVPACK)
|
||||
m.Sleep("3s")
|
||||
s.spaceImport(m, "gonganxitong", "shylinux.com/x/community")
|
||||
s.spaceImport(m, "db/mysql", "shylinux.com/x/mysql-story")
|
||||
s.spaceCompile(m)
|
||||
}
|
||||
func (s serve) Autogen(m *ice.Message, arg ...string) {
|
||||
s.SpaceCmdy(m.SpawnSilent(), ice.OPS, web.CODE_COMPILE, code.DEVPACK)
|
||||
s.spaceCmdy(m, "web.team.gonganxitong.service", code.AUTOGEN, arg)
|
||||
s.spaceCmdy(m, cli.SYSTEM, "git", "add", "src")
|
||||
s.spaceCmdy(m, cli.SYSTEM, "git", "commit", "-am", "add some")
|
||||
s.spaceCmdy(m, cli.SYSTEM, "git", "push")
|
||||
s.spaceCmdy(m, web.CODE_VIMER, code.COMPILE)
|
||||
s.spaceRepos(m, "add", "src")
|
||||
s.spaceRepos(m, "commit", "-am", "add some")
|
||||
s.spaceRepos(m, "push")
|
||||
s.spaceCompile(m)
|
||||
}
|
||||
func (s serve) List(m *ice.Message, arg ...string) {
|
||||
msg := s.BeforeAction(m.Options(model.REPOS_UID, arg[0]))
|
||||
switch ReposType(kit.Int(msg.Append(model.TYPE))) {
|
||||
switch ReposType(kit.Int(m.Option(model.REPOS_TYPE))) {
|
||||
case ReposSystem:
|
||||
if s.spaceCmd(m, ctx.COMMAND, "web.team.gonganxitong.portal").Length() == 0 {
|
||||
s.Button(m, "", s.Imports)
|
||||
@ -56,22 +57,50 @@ func (s serve) List(m *ice.Message, arg ...string) {
|
||||
)).Table(func(value ice.Maps) {
|
||||
m.Push(model.NAME, strings.Split(value[nfs.PATH], "/")[1])
|
||||
})
|
||||
m.PushAction(s.Open, s.Config).Action(s.Autogen).Display("")
|
||||
m.PushAction(s.Open, s.Config, s.Vimer).Action(s.Autogen).Display("")
|
||||
s.Button(m, "", s.Autogen)
|
||||
}
|
||||
}
|
||||
func (s serve) Open(m *ice.Message, arg ...string) {
|
||||
m.ProcessOpen(web.S(m.Option(model.REPOS_NAME)) + web.C("web.team."+m.Option(model.NAME)+".portal"))
|
||||
m.ProcessOpen(s.spaceLink(m))
|
||||
}
|
||||
func (s serve) Config(m *ice.Message, arg ...string) {
|
||||
m.ProcessOpen(web.S(m.Option(model.REPOS_NAME)) + web.C("web.team."+m.Option(model.NAME)+".portal") + "?view=table")
|
||||
m.ProcessOpen(s.spaceLink(m, "view", "table"))
|
||||
}
|
||||
func (s serve) Vimer(m *ice.Message, arg ...string) {
|
||||
m.ProcessOpen(kit.MergeURL(web.S(m.Option(model.REPOS_NAME))+web.C("vimer"), nfs.PATH, "src/", nfs.FILE, m.Option(model.NAME)+"/portal.go"))
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(serve{}) }
|
||||
|
||||
func (s serve) spaceLink(m *ice.Message, arg ...ice.Any) string {
|
||||
return kit.MergeURL(web.S(m.Option(model.REPOS_NAME))+web.C("web.team."+m.Option(model.NAME)+".portal"), arg...)
|
||||
}
|
||||
func (s serve) spaceRepos(m *ice.Message, arg ...string) {
|
||||
s.spaceCmdy(m, cli.SYSTEM, "git", arg)
|
||||
}
|
||||
func (s serve) spaceImport(m *ice.Message, arg ...string) {
|
||||
s.spaceCmdy(m, web.CODE_AUTOGEN, code.IMPORT, arg)
|
||||
}
|
||||
func (s serve) spaceCompile(m *ice.Message) {
|
||||
if s.spaceCmdy(m, web.CODE_VIMER, code.COMPILE); m.IsErr() {
|
||||
return
|
||||
}
|
||||
m.WaitEvent(web.OPS_SERVER_OPEN, func(msg *ice.Message, arg ...string) bool {
|
||||
return msg.Option(mdb.NAME) == m.Option(model.REPOS_NAME)
|
||||
})
|
||||
}
|
||||
func (s serve) spaceCmdy(m *ice.Message, arg ...ice.Any) *ice.Message {
|
||||
if m.IsErr() {
|
||||
return m
|
||||
}
|
||||
m.SetAppend().SetResult()
|
||||
return s.SpaceCmdy(m, m.Option(model.REPOS_NAME), arg...)
|
||||
}
|
||||
func (s serve) spaceCmd(m *ice.Message, arg ...ice.Any) *ice.Message {
|
||||
if m.IsErr() {
|
||||
return m
|
||||
}
|
||||
m.SetAppend().SetResult()
|
||||
return s.SpaceCmd(m, m.Option(model.REPOS_NAME), arg...)
|
||||
}
|
||||
|
@ -1,41 +0,0 @@
|
||||
package h1
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
"shylinux.com/x/operation/src/h1/model"
|
||||
)
|
||||
|
||||
type Table struct {
|
||||
guanlixitong.Table
|
||||
list string `name:"list h1_uid uid auto" role:"void"`
|
||||
}
|
||||
|
||||
func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
switch arg[0] {
|
||||
case model.USER_H1_ROLE:
|
||||
s.InputsListRole(m, UserH1RoleList, arg...)
|
||||
case model.H1_TYPE:
|
||||
s.InputsList(m, H1TypeList, 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_H1_ROLE:
|
||||
value = UserH1Role(kit.Int(value)).String()
|
||||
case model.H1_TYPE:
|
||||
value = H1Type(kit.Int(value)).String()
|
||||
}
|
||||
return value
|
||||
})
|
||||
return s.Table.RewriteAppend(m)
|
||||
}
|
||||
|
||||
type Tables struct { Table }
|
||||
|
||||
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
23
src/h1/h1.go
23
src/h1/h1.go
@ -1,23 +0,0 @@
|
||||
package h1
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type h1 struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(h1{}) }
|
||||
|
||||
type H1Type int
|
||||
|
||||
const (
|
||||
H1RD H1Type = iota
|
||||
H1OP
|
||||
H1HR
|
||||
)
|
||||
|
||||
var H1TypeList = map[H1Type]string{
|
||||
H1RD: "RD",
|
||||
H1OP: "OP",
|
||||
H1HR: "HR",
|
||||
}
|
||||
|
||||
func (s H1Type) String() string { return H1TypeList[s] }
|
15
src/h1/h2.go
15
src/h1/h2.go
@ -1,15 +0,0 @@
|
||||
package h1
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type h2 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 h2) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
||||
|
||||
func init() { ice.TeamCtxCmd(h2{}) }
|
@ -1,9 +0,0 @@
|
||||
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]},
|
||||
] })
|
||||
},
|
||||
})
|
@ -1,31 +0,0 @@
|
||||
{
|
||||
"portal": "h1",
|
||||
"": "场景应用",
|
||||
"icons": {
|
||||
"": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
},
|
||||
"input": {
|
||||
"My H1": "我的场景",
|
||||
"user_h1_role": "成员角色",
|
||||
"h1_name": "场景名称",
|
||||
"h1_type": "场景类型"
|
||||
},
|
||||
"value": {
|
||||
"user_h1_role": {
|
||||
"visitor": "访客",
|
||||
"creator": "创建人",
|
||||
"leader": "管理人员",
|
||||
"worker": "工作人员",
|
||||
"server": "服务人员",
|
||||
"style": {
|
||||
"creator": "danger",
|
||||
"leader": "danger"
|
||||
}
|
||||
},
|
||||
"h1_type": {
|
||||
"RD": "研发群",
|
||||
"OP": "运维群",
|
||||
"HR": "人力群"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package h1
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
)
|
||||
|
||||
type userH1 struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userH1{}) }
|
||||
|
||||
type UserH1Role = guanlixitong.UserGroupRole
|
||||
|
||||
var UserH1RoleList = guanlixitong.UserGroupRoleList
|
@ -1,24 +1,24 @@
|
||||
package h2
|
||||
package h18
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
"shylinux.com/x/operation/src/h2/model"
|
||||
"shylinux.com/x/operation/src/h18/model"
|
||||
)
|
||||
|
||||
type Table struct {
|
||||
guanlixitong.Table
|
||||
list string `name:"list h2_uid uid auto" role:"void"`
|
||||
list string `name:"list h18_uid uid auto" role:"void"`
|
||||
}
|
||||
|
||||
func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
switch arg[0] {
|
||||
case model.USER_H2_ROLE:
|
||||
s.InputsListRole(m, UserH2RoleList, arg...)
|
||||
case model.H2_TYPE:
|
||||
s.InputsList(m, H2TypeList, arg...)
|
||||
case model.USER_H18_ROLE:
|
||||
s.InputsListRole(m, UserH18RoleList, arg...)
|
||||
case model.H18_TYPE:
|
||||
s.InputsList(m, H18TypeList, arg...)
|
||||
default:
|
||||
s.Table.Inputs(m, arg...)
|
||||
}
|
||||
@ -26,10 +26,10 @@ func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
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_H2_ROLE:
|
||||
value = UserH2Role(kit.Int(value)).String()
|
||||
case model.H2_TYPE:
|
||||
value = H2Type(kit.Int(value)).String()
|
||||
case model.USER_H18_ROLE:
|
||||
value = UserH18Role(kit.Int(value)).String()
|
||||
case model.H18_TYPE:
|
||||
value = H18Type(kit.Int(value)).String()
|
||||
}
|
||||
return value
|
||||
})
|
@ -1,8 +1,8 @@
|
||||
package h2
|
||||
package h18
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type h3 struct {
|
||||
type h0 struct {
|
||||
Table
|
||||
order string `data:"1"`
|
||||
fields string `data:"title,content,user_uid"`
|
||||
@ -10,6 +10,6 @@ type h3 struct {
|
||||
remove string `name:"remove" role:"leader"`
|
||||
}
|
||||
|
||||
func (s h3) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
||||
func (s h0) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
||||
|
||||
func init() { ice.TeamCtxCmd(h3{}) }
|
||||
func init() { ice.TeamCtxCmd(h0{}) }
|
23
src/h18/h18.go
Normal file
23
src/h18/h18.go
Normal file
@ -0,0 +1,23 @@
|
||||
package h18
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type h18 struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(h18{}) }
|
||||
|
||||
type H18Type int
|
||||
|
||||
const (
|
||||
H18RD H18Type = iota
|
||||
H18OP
|
||||
H18HR
|
||||
)
|
||||
|
||||
var H18TypeList = map[H18Type]string{
|
||||
H18RD: "RD",
|
||||
H18OP: "OP",
|
||||
H18HR: "HR",
|
||||
}
|
||||
|
||||
func (s H18Type) String() string { return H18TypeList[s] }
|
@ -10,25 +10,25 @@ const (
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
USER_UID = "user_uid"
|
||||
USER_H1_ROLE = "user_h1_role"
|
||||
H1_UID = "h1_uid"
|
||||
H1_NAME = "h1_name"
|
||||
H1_TYPE = "h1_type"
|
||||
H2_UID = "_uid"
|
||||
USER_H18_ROLE = "user_h18_role"
|
||||
H18_UID = "h18_uid"
|
||||
H18_NAME = "h18_name"
|
||||
H18_TYPE = "h18_type"
|
||||
H0_UID = "_uid"
|
||||
)
|
||||
|
||||
type UserH1 struct {
|
||||
type UserH18 struct {
|
||||
db.ModelUserPlace
|
||||
H1UID string `gorm:"type:char(32);index"`
|
||||
H18UID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type H1 struct {
|
||||
type H18 struct {
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type H2 struct {
|
||||
type H0 struct {
|
||||
db.ModelContent
|
||||
H1UID string `gorm:"type:char(32);index"`
|
||||
H18UID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
|
||||
|
||||
func init() { db.CmdModels("", &UserH1{}, &H1{}, &H2{}) }
|
||||
func init() { db.CmdModels("", &UserH18{}, &H18{}, &H0{}) }
|
@ -1,4 +1,4 @@
|
||||
package h1
|
||||
package h18
|
||||
|
||||
import (
|
||||
"shylinux.com/x/community/src/gonganxitong"
|
||||
@ -7,7 +7,7 @@ import (
|
||||
|
||||
type Portal struct {
|
||||
guanlixitong.Portal
|
||||
placeCreate string `name:"placeCreate city_name* company_name* h1_name* h1_type:select" role:"void"`
|
||||
placeCreate string `name:"placeCreate city_name* company_name* h18_name* h18_type:select" role:"void"`
|
||||
}
|
||||
|
||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userH1{}, h1{})}) }
|
||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userH18{}, h18{})}) }
|
@ -1,17 +1,17 @@
|
||||
{
|
||||
"portal": "h5",
|
||||
"portal": "h18",
|
||||
"": "场景应用",
|
||||
"icons": {
|
||||
"": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
},
|
||||
"input": {
|
||||
"My H5": "我的场景",
|
||||
"user_h5_role": "成员角色",
|
||||
"h5_name": "场景名称",
|
||||
"h5_type": "场景类型"
|
||||
"My H18": "我的场景",
|
||||
"user_h18_role": "成员角色",
|
||||
"h18_name": "场景名称",
|
||||
"h18_type": "场景类型"
|
||||
},
|
||||
"value": {
|
||||
"user_h5_role": {
|
||||
"user_h18_role": {
|
||||
"visitor": "访客",
|
||||
"creator": "创建人",
|
||||
"leader": "管理人员",
|
||||
@ -22,7 +22,7 @@
|
||||
"leader": "danger"
|
||||
}
|
||||
},
|
||||
"h5_type": {
|
||||
"h18_type": {
|
||||
"RD": "研发群",
|
||||
"OP": "运维群",
|
||||
"HR": "人力群"
|
15
src/h18/userH18.go
Normal file
15
src/h18/userH18.go
Normal file
@ -0,0 +1,15 @@
|
||||
package h18
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
)
|
||||
|
||||
type userH18 struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userH18{}) }
|
||||
|
||||
type UserH18Role = guanlixitong.UserGroupRole
|
||||
|
||||
var UserH18RoleList = guanlixitong.UserGroupRoleList
|
23
src/h2/h2.go
23
src/h2/h2.go
@ -1,23 +0,0 @@
|
||||
package h2
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type h2 struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(h2{}) }
|
||||
|
||||
type H2Type int
|
||||
|
||||
const (
|
||||
H2RD H2Type = iota
|
||||
H2OP
|
||||
H2HR
|
||||
)
|
||||
|
||||
var H2TypeList = map[H2Type]string{
|
||||
H2RD: "RD",
|
||||
H2OP: "OP",
|
||||
H2HR: "HR",
|
||||
}
|
||||
|
||||
func (s H2Type) String() string { return H2TypeList[s] }
|
@ -1,9 +0,0 @@
|
||||
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]},
|
||||
] })
|
||||
},
|
||||
})
|
@ -1,34 +0,0 @@
|
||||
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_H2_ROLE = "user_h2_role"
|
||||
H2_UID = "h2_uid"
|
||||
H2_NAME = "h2_name"
|
||||
H2_TYPE = "h2_type"
|
||||
H3_UID = "_uid"
|
||||
)
|
||||
|
||||
type UserH2 struct {
|
||||
db.ModelUserPlace
|
||||
H2UID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type H2 struct {
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type H3 struct {
|
||||
db.ModelContent
|
||||
H2UID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
|
||||
|
||||
func init() { db.CmdModels("", &UserH2{}, &H2{}, &H3{}) }
|
@ -1,13 +0,0 @@
|
||||
package h2
|
||||
|
||||
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* h2_name* h2_type:select" role:"void"`
|
||||
}
|
||||
|
||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userH2{}, h2{})}) }
|
@ -1,31 +0,0 @@
|
||||
{
|
||||
"portal": "h2",
|
||||
"": "场景应用",
|
||||
"icons": {
|
||||
"": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
},
|
||||
"input": {
|
||||
"My H2": "我的场景",
|
||||
"user_h2_role": "成员角色",
|
||||
"h2_name": "场景名称",
|
||||
"h2_type": "场景类型"
|
||||
},
|
||||
"value": {
|
||||
"user_h2_role": {
|
||||
"visitor": "访客",
|
||||
"creator": "创建人",
|
||||
"leader": "管理人员",
|
||||
"worker": "工作人员",
|
||||
"server": "服务人员",
|
||||
"style": {
|
||||
"creator": "danger",
|
||||
"leader": "danger"
|
||||
}
|
||||
},
|
||||
"h2_type": {
|
||||
"RD": "研发群",
|
||||
"OP": "运维群",
|
||||
"HR": "人力群"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package h2
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
)
|
||||
|
||||
type userH2 struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userH2{}) }
|
||||
|
||||
type UserH2Role = guanlixitong.UserGroupRole
|
||||
|
||||
var UserH2RoleList = guanlixitong.UserGroupRoleList
|
@ -1,41 +0,0 @@
|
||||
package h3
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
"shylinux.com/x/operation/src/h3/model"
|
||||
)
|
||||
|
||||
type Table struct {
|
||||
guanlixitong.Table
|
||||
list string `name:"list h3_uid uid auto" role:"void"`
|
||||
}
|
||||
|
||||
func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
switch arg[0] {
|
||||
case model.USER_H3_ROLE:
|
||||
s.InputsListRole(m, UserH3RoleList, arg...)
|
||||
case model.H3_TYPE:
|
||||
s.InputsList(m, H3TypeList, 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_H3_ROLE:
|
||||
value = UserH3Role(kit.Int(value)).String()
|
||||
case model.H3_TYPE:
|
||||
value = H3Type(kit.Int(value)).String()
|
||||
}
|
||||
return value
|
||||
})
|
||||
return s.Table.RewriteAppend(m)
|
||||
}
|
||||
|
||||
type Tables struct { Table }
|
||||
|
||||
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
23
src/h3/h3.go
23
src/h3/h3.go
@ -1,23 +0,0 @@
|
||||
package h3
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type h3 struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(h3{}) }
|
||||
|
||||
type H3Type int
|
||||
|
||||
const (
|
||||
H3RD H3Type = iota
|
||||
H3OP
|
||||
H3HR
|
||||
)
|
||||
|
||||
var H3TypeList = map[H3Type]string{
|
||||
H3RD: "RD",
|
||||
H3OP: "OP",
|
||||
H3HR: "HR",
|
||||
}
|
||||
|
||||
func (s H3Type) String() string { return H3TypeList[s] }
|
15
src/h3/h4.go
15
src/h3/h4.go
@ -1,15 +0,0 @@
|
||||
package h3
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type h4 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 h4) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
||||
|
||||
func init() { ice.TeamCtxCmd(h4{}) }
|
@ -1,9 +0,0 @@
|
||||
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]},
|
||||
] })
|
||||
},
|
||||
})
|
@ -1,34 +0,0 @@
|
||||
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_H3_ROLE = "user_h3_role"
|
||||
H3_UID = "h3_uid"
|
||||
H3_NAME = "h3_name"
|
||||
H3_TYPE = "h3_type"
|
||||
H4_UID = "_uid"
|
||||
)
|
||||
|
||||
type UserH3 struct {
|
||||
db.ModelUserPlace
|
||||
H3UID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type H3 struct {
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type H4 struct {
|
||||
db.ModelContent
|
||||
H3UID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
|
||||
|
||||
func init() { db.CmdModels("", &UserH3{}, &H3{}, &H4{}) }
|
@ -1,13 +0,0 @@
|
||||
package h3
|
||||
|
||||
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* h3_name* h3_type:select" role:"void"`
|
||||
}
|
||||
|
||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userH3{}, h3{})}) }
|
@ -1,31 +0,0 @@
|
||||
{
|
||||
"portal": "h3",
|
||||
"": "场景应用",
|
||||
"icons": {
|
||||
"": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
},
|
||||
"input": {
|
||||
"My H3": "我的场景",
|
||||
"user_h3_role": "成员角色",
|
||||
"h3_name": "场景名称",
|
||||
"h3_type": "场景类型"
|
||||
},
|
||||
"value": {
|
||||
"user_h3_role": {
|
||||
"visitor": "访客",
|
||||
"creator": "创建人",
|
||||
"leader": "管理人员",
|
||||
"worker": "工作人员",
|
||||
"server": "服务人员",
|
||||
"style": {
|
||||
"creator": "danger",
|
||||
"leader": "danger"
|
||||
}
|
||||
},
|
||||
"h3_type": {
|
||||
"RD": "研发群",
|
||||
"OP": "运维群",
|
||||
"HR": "人力群"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package h3
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
)
|
||||
|
||||
type userH3 struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userH3{}) }
|
||||
|
||||
type UserH3Role = guanlixitong.UserGroupRole
|
||||
|
||||
var UserH3RoleList = guanlixitong.UserGroupRoleList
|
@ -1,41 +0,0 @@
|
||||
package h5
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
"shylinux.com/x/operation/src/h5/model"
|
||||
)
|
||||
|
||||
type Table struct {
|
||||
guanlixitong.Table
|
||||
list string `name:"list h5_uid uid auto" role:"void"`
|
||||
}
|
||||
|
||||
func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
switch arg[0] {
|
||||
case model.USER_H5_ROLE:
|
||||
s.InputsListRole(m, UserH5RoleList, arg...)
|
||||
case model.H5_TYPE:
|
||||
s.InputsList(m, H5TypeList, 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_H5_ROLE:
|
||||
value = UserH5Role(kit.Int(value)).String()
|
||||
case model.H5_TYPE:
|
||||
value = H5Type(kit.Int(value)).String()
|
||||
}
|
||||
return value
|
||||
})
|
||||
return s.Table.RewriteAppend(m)
|
||||
}
|
||||
|
||||
type Tables struct { Table }
|
||||
|
||||
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
23
src/h5/h5.go
23
src/h5/h5.go
@ -1,23 +0,0 @@
|
||||
package h5
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type h5 struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(h5{}) }
|
||||
|
||||
type H5Type int
|
||||
|
||||
const (
|
||||
H5RD H5Type = iota
|
||||
H5OP
|
||||
H5HR
|
||||
)
|
||||
|
||||
var H5TypeList = map[H5Type]string{
|
||||
H5RD: "RD",
|
||||
H5OP: "OP",
|
||||
H5HR: "HR",
|
||||
}
|
||||
|
||||
func (s H5Type) String() string { return H5TypeList[s] }
|
15
src/h5/h6.go
15
src/h5/h6.go
@ -1,15 +0,0 @@
|
||||
package h5
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type h6 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 h6) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
||||
|
||||
func init() { ice.TeamCtxCmd(h6{}) }
|
@ -1,9 +0,0 @@
|
||||
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]},
|
||||
] })
|
||||
},
|
||||
})
|
@ -1,34 +0,0 @@
|
||||
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_H5_ROLE = "user_h5_role"
|
||||
H5_UID = "h5_uid"
|
||||
H5_NAME = "h5_name"
|
||||
H5_TYPE = "h5_type"
|
||||
H6_UID = "_uid"
|
||||
)
|
||||
|
||||
type UserH5 struct {
|
||||
db.ModelUserPlace
|
||||
H5UID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type H5 struct {
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type H6 struct {
|
||||
db.ModelContent
|
||||
H5UID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
|
||||
|
||||
func init() { db.CmdModels("", &UserH5{}, &H5{}, &H6{}) }
|
@ -1,13 +0,0 @@
|
||||
package h5
|
||||
|
||||
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* h5_name* h5_type:select" role:"void"`
|
||||
}
|
||||
|
||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userH5{}, h5{})}) }
|
@ -1,15 +0,0 @@
|
||||
package h5
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
)
|
||||
|
||||
type userH5 struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userH5{}) }
|
||||
|
||||
type UserH5Role = guanlixitong.UserGroupRole
|
||||
|
||||
var UserH5RoleList = guanlixitong.UserGroupRoleList
|
10
src/main.go
10
src/main.go
@ -9,15 +9,7 @@ import (
|
||||
_ "shylinux.com/x/operation/src/production"
|
||||
_ "shylinux.com/x/operation/src/storage"
|
||||
|
||||
_ "shylinux.com/x/operation/src/h1"
|
||||
|
||||
_ "shylinux.com/x/operation/src/h2"
|
||||
|
||||
_ "shylinux.com/x/operation/src/h3"
|
||||
|
||||
_ "shylinux.com/x/operation/src/h5"
|
||||
|
||||
_ "shylinux.com/x/operation/src/base"
|
||||
_ "shylinux.com/x/operation/src/h18"
|
||||
)
|
||||
|
||||
func main() { print(ice.Run()) }
|
||||
|
@ -20,6 +20,13 @@
|
||||
"type": "hash"
|
||||
}
|
||||
},
|
||||
"4835fa3efc154c875d4c2038c4734df7": {
|
||||
"meta": {
|
||||
"index": "web.team.base.portal",
|
||||
"time": "2024-10-05 19:05:06.830",
|
||||
"type": "hash"
|
||||
}
|
||||
},
|
||||
"4b1e97b62a44419c00caf65e297abd18": {
|
||||
"meta": {
|
||||
"index": "web.team.guanlixitong.portal",
|
||||
@ -69,6 +76,13 @@
|
||||
"type": "hash"
|
||||
}
|
||||
},
|
||||
"a532764a72e827135759c49816c17606": {
|
||||
"meta": {
|
||||
"index": "web.team.h5.portal",
|
||||
"time": "2024-10-05 19:04:16.866",
|
||||
"type": "hash"
|
||||
}
|
||||
},
|
||||
"ae10a051342a01926761a84f477b66ec": {
|
||||
"meta": {
|
||||
"index": "web.team.h1.portal",
|
||||
|
Loading…
x
Reference in New Issue
Block a user