mirror of
https://shylinux.com/x/enterprise
synced 2025-04-25 17:18:06 +08:00
add some
This commit is contained in:
parent
05aa8296e0
commit
bf77469cdc
@ -1,41 +0,0 @@
|
||||
package development
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/enterprise/src/development/model"
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
)
|
||||
|
||||
type Table struct {
|
||||
guanlixitong.Table
|
||||
list string `name:"list repos_uid uid auto" role:"void"`
|
||||
}
|
||||
|
||||
func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
switch arg[0] {
|
||||
case model.USER_REPOS_ROLE:
|
||||
s.InputsListRole(m, UserReposRoleList, arg...)
|
||||
case model.REPOS_TYPE:
|
||||
s.InputsList(m, ReposTypeList, 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_REPOS_ROLE:
|
||||
value = UserReposRole(kit.Int(value)).String()
|
||||
case model.REPOS_TYPE:
|
||||
value = ReposType(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,35 +0,0 @@
|
||||
package model
|
||||
|
||||
import "shylinux.com/x/mysql-story/src/db"
|
||||
|
||||
const (
|
||||
UID = "uid"
|
||||
NAME = "name"
|
||||
TYPE = "type"
|
||||
ROLE = "role"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
USER_UID = "user_uid"
|
||||
USER_REPOS_ROLE = "user_repos_role"
|
||||
REPOS_UID = "repos_uid"
|
||||
REPOS_NAME = "repos_name"
|
||||
REPOS_TYPE = "repos_type"
|
||||
RELEASE_UID = "release_uid"
|
||||
COMPANY_UID = "company_uid"
|
||||
CITY_UID = "city_uid"
|
||||
)
|
||||
|
||||
type UserRepos struct {
|
||||
db.ModelUserPlace
|
||||
ReposUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type Repos struct {
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type Release struct {
|
||||
db.ModelContent
|
||||
ReposUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
|
||||
func init() { db.CmdModels("", &UserRepos{}, &Repos{}, &Release{}) }
|
@ -1,13 +0,0 @@
|
||||
package development
|
||||
|
||||
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* repos_type*:select repos_name*" role:"void"`
|
||||
}
|
||||
|
||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userRepos{}, repos{})}) }
|
@ -1,30 +0,0 @@
|
||||
{
|
||||
"portal": "系统开发",
|
||||
"member": "项目成员",
|
||||
"release": "版本发布",
|
||||
"icons": {
|
||||
"release": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
},
|
||||
"input": {
|
||||
"My Repos": "我的项目",
|
||||
"user_repos_role": "用户角色",
|
||||
"repos_name": "项目名称",
|
||||
"repos_type": "项目类型"
|
||||
},
|
||||
"value": {
|
||||
"user_repos_role": {
|
||||
"visitor": "访客",
|
||||
"creator": "创建人",
|
||||
"leader": "管理人员",
|
||||
"worker": "工作人员",
|
||||
"server": "服务人员",
|
||||
"style": {
|
||||
"creator": "danger"
|
||||
}
|
||||
},
|
||||
"repos_type": {
|
||||
"local": "本地",
|
||||
"remote": "远程"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package development
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/enterprise/src/development/model"
|
||||
)
|
||||
|
||||
type release struct {
|
||||
Table
|
||||
repos repos
|
||||
userRepos userRepos
|
||||
create string `name:"create title* content*" role:"leader"`
|
||||
}
|
||||
|
||||
func (s release) Create(m *ice.Message, arg ...string) {
|
||||
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.REPOS_UID))...)
|
||||
s.RecordEventWithName(m, "")
|
||||
}
|
||||
func (s release) List(m *ice.Message, arg ...string) {
|
||||
s.TablesWithRole(m, arg, s.userRepos, s.repos, s, model.TITLE, model.CONTENT).Display("")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(release{}) }
|
@ -1,12 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title]},
|
||||
{view: html.STATUS, list: [
|
||||
value.uid.slice(0, 6), can.base.TimeTrim(value.created_at),
|
||||
value.user_name, can.onimport.textView(can, value, "user_repos_role", aaa.ROLE),
|
||||
]},
|
||||
{view: html.OUTPUT, list: [value.content]},
|
||||
] })
|
||||
},
|
||||
})
|
@ -1,21 +0,0 @@
|
||||
package development
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type repos struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(repos{}) }
|
||||
|
||||
type ReposType int
|
||||
|
||||
const (
|
||||
ReposLocal ReposType = iota
|
||||
ReposRemote
|
||||
)
|
||||
|
||||
var ReposTypeList = map[ReposType]string{
|
||||
ReposLocal: "local",
|
||||
ReposRemote: "remote",
|
||||
}
|
||||
|
||||
func (s ReposType) String() string { return ReposTypeList[s] }
|
@ -1,15 +0,0 @@
|
||||
package development
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
)
|
||||
|
||||
type userRepos struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userRepos{}) }
|
||||
|
||||
type UserReposRole = guanlixitong.UserGroupRole
|
||||
|
||||
var UserReposRoleList = guanlixitong.UserGroupRoleList
|
@ -2,6 +2,6 @@ package gongyinglian
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type brand struct{ TableView }
|
||||
type brand struct{ Value }
|
||||
|
||||
func init() { ice.TeamCtxCmd(brand{}) }
|
||||
|
@ -1,8 +1,8 @@
|
||||
package gongyinglian
|
||||
|
||||
import (
|
||||
"path"
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/enterprise/src/gongyinglian/model"
|
||||
@ -65,17 +65,8 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
||||
})
|
||||
return s.Table.RewriteAppend(m)
|
||||
}
|
||||
func (s TableView) transPrice(m *ice.Message, arg ...string) []string {
|
||||
for i := 0; i < len(arg); i += 2 {
|
||||
switch arg[i] {
|
||||
case model.AMOUNT, model.PRICE:
|
||||
arg[i+1] = kit.Format(kit.Int(kit.Float(arg[i+1]) * 100))
|
||||
}
|
||||
}
|
||||
return arg
|
||||
}
|
||||
func (s Table) CheckRole(m *ice.Message, arg ...string) *ice.Message {
|
||||
role := UserStoreRole(kit.Int(m.Cmd(userStore{}, s.Select, m.OptionSimple(model.STORE_UID, model.USER_UID)).Append(model.ROLE)))
|
||||
role := UserStoreRole(s.UserPlaceRole(m))
|
||||
m.WarnNotRight(!kit.IsIn(role.String(), append(arg, UserStoreCreator.String())...), role.String())
|
||||
return m
|
||||
}
|
||||
@ -114,7 +105,11 @@ func (s Table) checkOrderRole(m *ice.Message, arg ...string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
type TableView struct {
|
||||
type Tables struct{ Table }
|
||||
|
||||
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
||||
|
||||
type Value struct {
|
||||
Table
|
||||
fields string `data:"name,info"`
|
||||
create string `name:"create name info" role:"boss"`
|
||||
@ -122,35 +117,54 @@ type TableView struct {
|
||||
remove string `name:"remove" role:"boss"`
|
||||
}
|
||||
|
||||
func (s TableView) Create(m *ice.Message, arg ...string) {
|
||||
arg = s.transPrice(m, arg...)
|
||||
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.STORE_UID))...)
|
||||
s.RecordEventWithName(m, "")
|
||||
func (s Value) Create(m *ice.Message, arg ...string) {
|
||||
s.Table.ValueCreate(m, s.transPrice(m, arg...)...)
|
||||
}
|
||||
func (s TableView) Modify(m *ice.Message, arg ...string) {
|
||||
arg = s.transPrice(m, arg...)
|
||||
s.Table.Update(m, kit.Dict(arg), m.OptionSimple(model.STORE_UID, model.UID)...)
|
||||
s.RecordEventWithName(m, "")
|
||||
func (s Value) Modify(m *ice.Message, arg ...string) {
|
||||
s.Table.ValueModify(m, s.transPrice(m, arg...)...)
|
||||
}
|
||||
func (s TableView) Remove(m *ice.Message, arg ...string) {
|
||||
s.Table.Delete(m, m.OptionSimple(model.STORE_UID, model.UID)...)
|
||||
s.RecordEventWithName(m, "")
|
||||
func (s Value) Remove(m *ice.Message, arg ...string) {
|
||||
s.Table.ValueRemove(m, arg...)
|
||||
}
|
||||
func (s TableView) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
s.Select(m, m.OptionSimple(model.STORE_UID)...)
|
||||
func (s Value) List(m *ice.Message, arg ...string) {
|
||||
s.Table.ValueList(m, arg)
|
||||
if m.Length() == 0 {
|
||||
m.EchoInfoButton("")
|
||||
}
|
||||
if m.Exists(path.Join(path.Dir(kit.FileLines(1)), m.CommandKey()+".js")) {
|
||||
m.Display(m.CommandKey() + ".js")
|
||||
}
|
||||
}
|
||||
func (s Value) transPrice(m *ice.Message, arg ...string) []string {
|
||||
for i := 0; i < len(arg); i += 2 {
|
||||
switch arg[i] {
|
||||
case model.AMOUNT, model.PRICE:
|
||||
arg[i+1] = kit.Format(kit.Int(kit.Float(arg[i+1]) * 100))
|
||||
}
|
||||
}
|
||||
return arg
|
||||
}
|
||||
|
||||
type Relative struct{ Table }
|
||||
|
||||
func (s Relative) List(m *ice.Message, arg ...string) {
|
||||
if !s.checkListRole(m, arg...) {
|
||||
return
|
||||
}
|
||||
kit.If(m.Config(mdb.FIELDS), func(p string) { s.FieldsWithCreatedAT(m, "", kit.TransArgs(kit.Split(p, ",", ","))...) })
|
||||
order := Order{}
|
||||
s.Tables(m, Order{}).FieldsWithCreatedAT(m, order,
|
||||
s.AS(model.TO_USER_UID, model.USER_UID), m.CommandKey()+"_"+model.STATUS,
|
||||
s.Key(order, model.AMOUNT), s.Key(order, model.TOTAL),
|
||||
model.COMPANY_UID, model.OPEN_ID, model.ORDER_UID,
|
||||
)
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, model.STORE_UID, arg[0])
|
||||
kit.If(m.Length() == 0, func() { m.EchoInfoButton("", s.Create) })
|
||||
s.Select(m, model.FROM_STORE_UID, arg[0]).Action()
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.STORE_UID, arg[0], model.UID, arg[1])
|
||||
s.SelectDetail(m, model.FROM_STORE_UID, arg[0], s.Key(m.CommandKey(), model.UID), arg[1])
|
||||
} else {
|
||||
return
|
||||
}
|
||||
m.PushAction(s.Modify, s.Remove)
|
||||
s.SelectJoinCompany(m)
|
||||
s.SelectJoinUser(m)
|
||||
m.Display(m.CommandKey() + ".js")
|
||||
}
|
||||
|
||||
type Tables struct{ Table }
|
||||
|
||||
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
type expense struct {
|
||||
TableView
|
||||
Value
|
||||
fields string `data:"expense_type,amount,name,info"`
|
||||
create string `name:"create expense_type* amount* name info" role:"boss"`
|
||||
modify string `name:"modify amount* name info" role:"boss"`
|
||||
@ -16,11 +16,11 @@ type expense struct {
|
||||
|
||||
func (s expense) Create(m *ice.Message, arg ...string) {
|
||||
arg = kit.TransArgKeys(arg, model.EXPENSE_TYPE, model.TYPE)
|
||||
s.TableView.Create(m, kit.Simple(arg, model.FROM_USER_UID, m.Option(model.USER_UID))...)
|
||||
s.Value.Create(m, kit.Simple(arg, model.FROM_USER_UID, m.Option(model.USER_UID))...)
|
||||
}
|
||||
func (s expense) List(m *ice.Message, arg ...string) {
|
||||
if s.checkListRole(m, arg...) {
|
||||
s.TableView.List(m, arg...)
|
||||
s.Value.List(m, arg...)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,34 +1,8 @@
|
||||
package gongyinglian
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/gongyinglian/model"
|
||||
)
|
||||
|
||||
type express struct {
|
||||
Table
|
||||
order Order
|
||||
}
|
||||
|
||||
func (s express) List(m *ice.Message, arg ...string) {
|
||||
if !s.checkListRole(m, arg...) {
|
||||
return
|
||||
}
|
||||
s.Tables(m, s.order).FieldsWithCreatedAT(m, s,
|
||||
s.AS(model.TO_USER_UID, model.USER_UID), model.EXPRESS_STATUS,
|
||||
model.COMPANY_UID, model.OPEN_ID, model.ORDER_UID,
|
||||
)
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, model.FROM_STORE_UID, arg[0]).Action()
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.FROM_STORE_UID, arg[0], s.Key(s, model.UID), arg[1])
|
||||
} else {
|
||||
return
|
||||
}
|
||||
s.SelectJoinCompany(m)
|
||||
s.SelectJoinUser(m)
|
||||
}
|
||||
type express struct{ Relative }
|
||||
|
||||
func init() { ice.TeamCtxCmd(express{}) }
|
||||
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
type loan struct {
|
||||
TableView
|
||||
Value
|
||||
fields string `data:"loan_type,amount,name,info"`
|
||||
create string `name:"create loan_type* amount name info" role:"boss"`
|
||||
modify string `name:"modify name info amount" role:"boss"`
|
||||
@ -16,11 +16,11 @@ type loan struct {
|
||||
|
||||
func (s loan) Create(m *ice.Message, arg ...string) {
|
||||
arg = kit.TransArgKeys(arg, model.LOAN_TYPE, model.TYPE)
|
||||
s.TableView.Create(m, kit.Simple(arg, model.TO_USER_UID, m.Option(model.USER_UID))...)
|
||||
s.Value.Create(m, kit.Simple(arg, model.TO_USER_UID, m.Option(model.USER_UID))...)
|
||||
}
|
||||
func (s loan) List(m *ice.Message, arg ...string) {
|
||||
if s.checkListRole(m, arg...) {
|
||||
s.TableView.List(m, arg...)
|
||||
s.Value.List(m, arg...)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,8 +11,6 @@ const (
|
||||
STATUS = "status"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
ADDRESS = "address"
|
||||
OPEN_ID = "open_id"
|
||||
USER_UID = "user_uid"
|
||||
USER_STORE_ROLE = "user_store_role"
|
||||
STORE_UID = "store_uid"
|
||||
@ -44,13 +42,14 @@ const (
|
||||
LOAN_TYPE = "loan_type"
|
||||
COMPANY_UID = "company_uid"
|
||||
CITY_UID = "city_uid"
|
||||
ADDRESS = "address"
|
||||
OPEN_ID = "open_id"
|
||||
AMOUNT = "amount"
|
||||
TOTAL = "total"
|
||||
PRICE = "price"
|
||||
STOCK = "stock"
|
||||
COUNT = "count"
|
||||
UNIT = "unit"
|
||||
INIT = "init"
|
||||
)
|
||||
|
||||
type UserStore struct {
|
||||
@ -62,27 +61,25 @@ type Store struct {
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type Shop struct {
|
||||
db.ModelWithUID
|
||||
db.ModelNameInfo
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
StoreUID string `gorm:"type:char(32);index"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Address string `gorm:"type:varchar(255)"`
|
||||
}
|
||||
type Warehouse struct {
|
||||
db.ModelWithUID
|
||||
db.ModelNameInfo
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
StoreUID string `gorm:"type:char(32);index"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Address string `gorm:"type:varchar(255)"`
|
||||
}
|
||||
type Product struct {
|
||||
db.ModelWithUID
|
||||
db.ModelNameInfo
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
StoreUID string `gorm:"type:char(32);index"`
|
||||
ShopUID string `gorm:"type:char(32);index"`
|
||||
WarehouseUID string `gorm:"type:char(32);index"`
|
||||
QualityUID string `gorm:"type:char(32);index"`
|
||||
BrandUID string `gorm:"type:char(32);index"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Info string
|
||||
Type uint8 `gorm:"default:0"`
|
||||
Price uint `gorm:"default:0"`
|
||||
Stock uint `gorm:"default:0"`
|
||||
Unit string `gorm:"type:varchar(8)"`
|
||||
@ -116,34 +113,22 @@ type OrderDetail struct {
|
||||
Count int `gorm:"default:0"`
|
||||
}
|
||||
type Payment struct {
|
||||
db.ModelWithUID
|
||||
OrderUID string `gorm:"type:char(32);index"`
|
||||
CompanyUID string `gorm:"type:char(32)"`
|
||||
OpenID string `gorm:"type:varchar(128)"`
|
||||
Status uint8 `gorm:"default:0"`
|
||||
db.ModelExternal
|
||||
OrderUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type Express struct {
|
||||
db.ModelWithUID
|
||||
OrderUID string `gorm:"type:char(32);index"`
|
||||
CompanyUID string `gorm:"type:char(32)"`
|
||||
OpenID string `gorm:"type:varchar(128)"`
|
||||
Status uint8 `gorm:"default:0"`
|
||||
db.ModelExternal
|
||||
OrderUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type Return struct {
|
||||
db.ModelWithUID
|
||||
db.ModelExternal
|
||||
OrderUID string `gorm:"type:char(32);index"`
|
||||
ExpressUID string `gorm:"type:char(32)"`
|
||||
CompanyUID string `gorm:"type:char(32)"`
|
||||
OpenID string `gorm:"type:varchar(128)"`
|
||||
Status uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Refund struct {
|
||||
db.ModelWithUID
|
||||
db.ModelExternal
|
||||
OrderUID string `gorm:"type:char(32);index"`
|
||||
PaymentUID string `gorm:"type:char(32)"`
|
||||
CompanyUID string `gorm:"type:char(32)"`
|
||||
OpenID string `gorm:"type:varchar(128)"`
|
||||
Status uint8 `gorm:"default:0"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
@ -155,34 +140,28 @@ func init() {
|
||||
}
|
||||
|
||||
type Brand struct {
|
||||
db.ModelWithUID
|
||||
db.ModelNameInfo
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
StoreUID string `gorm:"type:char(32);index"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Info string
|
||||
}
|
||||
type Quality struct {
|
||||
db.ModelWithUID
|
||||
db.ModelNameInfo
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
StoreUID string `gorm:"type:char(32);index"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Info string
|
||||
}
|
||||
type Expense struct {
|
||||
db.ModelWithUID
|
||||
db.ModelNameInfo
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
StoreUID string `gorm:"type:char(32);index"`
|
||||
FromUserUID string `gorm:"type:char(32)"`
|
||||
ToUserUID string `gorm:"type:char(32)"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Info string
|
||||
Type uint8 `gorm:"default:0"`
|
||||
Amount int `gorm:"default:0"`
|
||||
Amount int `gorm:"default:0"`
|
||||
}
|
||||
type Loan struct {
|
||||
db.ModelWithUID
|
||||
db.ModelNameInfo
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
StoreUID string `gorm:"type:char(32);index"`
|
||||
FromUserUID string `gorm:"type:char(32)"`
|
||||
ToUserUID string `gorm:"type:char(32)"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Info string
|
||||
Type uint8 `gorm:"default:0"`
|
||||
Amount int `gorm:"default:0"`
|
||||
Amount int `gorm:"default:0"`
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
|
||||
_init: function(can, msg) {
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.name||value.user_name||"待确认", can.onimport.textView(can, value, "order_type", mdb.TYPE)]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), can.onimport.textView(can, value, "order_status", mdb.STATUS)]},
|
||||
|
@ -1,35 +1,8 @@
|
||||
package gongyinglian
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/gongyinglian/model"
|
||||
)
|
||||
|
||||
type payment struct {
|
||||
Table
|
||||
order Order
|
||||
}
|
||||
|
||||
func (s payment) List(m *ice.Message, arg ...string) {
|
||||
if !s.checkListRole(m, arg...) {
|
||||
return
|
||||
}
|
||||
s.Tables(m, s.order).FieldsWithCreatedAT(m, s,
|
||||
s.AS(model.TO_USER_UID, model.USER_UID), model.PAYMENT_STATUS,
|
||||
model.COMPANY_UID, model.OPEN_ID, model.ORDER_UID,
|
||||
s.Key(s.order, model.AMOUNT), model.TOTAL,
|
||||
)
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, model.FROM_STORE_UID, arg[0]).Action()
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.FROM_STORE_UID, arg[0], s.Key(s, model.UID), arg[1])
|
||||
} else {
|
||||
return
|
||||
}
|
||||
s.SelectJoinCompany(m)
|
||||
s.SelectJoinUser(m)
|
||||
}
|
||||
type payment struct{ Relative }
|
||||
|
||||
func init() { ice.TeamCtxCmd(payment{}) }
|
||||
|
||||
|
@ -10,6 +10,4 @@ type Portal struct {
|
||||
placeCreate string `name:"placeCreate city_name* company_name* store_type*:select store_name*" role:"void"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userStore{}, store{})})
|
||||
}
|
||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userStore{}, store{})}) }
|
||||
|
@ -53,6 +53,7 @@
|
||||
"product_type": "产品类型",
|
||||
"company_uid": "公司",
|
||||
"to_store_uid": "收货店铺",
|
||||
"from_store_uid":"出货店铺",
|
||||
"payment_status": "付款状态",
|
||||
"express_status": "快递状态",
|
||||
"return_status": "退货状态",
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
type Product struct {
|
||||
TableView
|
||||
Value
|
||||
shop Shop
|
||||
warehouse Warehouse
|
||||
quality quality
|
||||
@ -24,7 +24,7 @@ type Product struct {
|
||||
|
||||
func (s Product) Create(m *ice.Message, arg ...string) {
|
||||
arg = kit.TransArgKeys(arg, model.PRODUCT_TYPE, model.TYPE)
|
||||
s.TableView.Create(m, arg...)
|
||||
s.Value.Create(m, arg...)
|
||||
}
|
||||
func (s Product) List(m *ice.Message, arg ...string) {
|
||||
if m.Option(model.PRODUCT_TYPE) != kit.Format(ProductGoods) && !s.checkListRole(m, arg...) {
|
||||
@ -53,10 +53,10 @@ func (s Product) List(m *ice.Message, arg ...string) {
|
||||
}
|
||||
m.PushAction(s.Modify, s.Remove).Display("")
|
||||
}
|
||||
func (s Product) SetShop(m *ice.Message, arg ...string) { s.TableView.Modify(m, arg...) }
|
||||
func (s Product) SetWarehouse(m *ice.Message, arg ...string) { s.TableView.Modify(m, arg...) }
|
||||
func (s Product) SetQuality(m *ice.Message, arg ...string) { s.TableView.Modify(m, arg...) }
|
||||
func (s Product) SetBrand(m *ice.Message, arg ...string) { s.TableView.Modify(m, arg...) }
|
||||
func (s Product) SetShop(m *ice.Message, arg ...string) { s.Value.Modify(m, arg...) }
|
||||
func (s Product) SetWarehouse(m *ice.Message, arg ...string) { s.Value.Modify(m, arg...) }
|
||||
func (s Product) SetQuality(m *ice.Message, arg ...string) { s.Value.Modify(m, arg...) }
|
||||
func (s Product) SetBrand(m *ice.Message, arg ...string) { s.Value.Modify(m, arg...) }
|
||||
|
||||
func init() { ice.TeamCtxCmd(Product{}) }
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
|
||||
_init: function(can, msg) {
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.name, can.onimport.textView(can, value, "product_type", mdb.TYPE)]},
|
||||
{view: html.STATUS, list: ["单价:", value.price, "元", "库存:", value.stock, value.unit, value.shop_name||"", value.warehouse_name||""]},
|
||||
|
@ -2,6 +2,6 @@ package gongyinglian
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type quality struct{ TableView }
|
||||
type quality struct{ Value }
|
||||
|
||||
func init() { ice.TeamCtxCmd(quality{}) }
|
||||
|
@ -1,35 +1,8 @@
|
||||
package gongyinglian
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/gongyinglian/model"
|
||||
)
|
||||
|
||||
type refund struct {
|
||||
Table
|
||||
order Order
|
||||
}
|
||||
|
||||
func (s refund) List(m *ice.Message, arg ...string) {
|
||||
if !s.checkListRole(m, arg...) {
|
||||
return
|
||||
}
|
||||
s.Tables(m, s.order).FieldsWithCreatedAT(m, s,
|
||||
s.AS(model.TO_USER_UID, model.USER_UID), model.REFUND_STATUS,
|
||||
model.COMPANY_UID, model.OPEN_ID, model.ORDER_UID,
|
||||
s.Key(s.order, model.AMOUNT), model.TOTAL,
|
||||
)
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, model.FROM_STORE_UID, arg[0]).Action()
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.FROM_STORE_UID, arg[0], s.Key(s, model.UID), arg[1])
|
||||
} else {
|
||||
return
|
||||
}
|
||||
s.SelectJoinCompany(m)
|
||||
s.SelectJoinUser(m)
|
||||
}
|
||||
type refund struct{ Relative }
|
||||
|
||||
func init() { ice.TeamCtxCmd(refund{}) }
|
||||
|
||||
|
@ -1,34 +1,8 @@
|
||||
package gongyinglian
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/gongyinglian/model"
|
||||
)
|
||||
|
||||
type Return struct {
|
||||
Table
|
||||
order Order
|
||||
}
|
||||
|
||||
func (s Return) List(m *ice.Message, arg ...string) {
|
||||
if !s.checkListRole(m, arg...) {
|
||||
return
|
||||
}
|
||||
s.Tables(m, s.order).FieldsWithCreatedAT(m, s,
|
||||
s.AS(model.TO_USER_UID, model.USER_UID), model.RETURN_STATUS,
|
||||
model.COMPANY_UID, model.OPEN_ID, model.ORDER_UID,
|
||||
)
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, model.FROM_STORE_UID, arg[0]).Action()
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.FROM_STORE_UID, arg[0], s.Key(s, model.UID), arg[1])
|
||||
} else {
|
||||
return
|
||||
}
|
||||
s.SelectJoinCompany(m)
|
||||
s.SelectJoinUser(m)
|
||||
}
|
||||
type Return struct{ Relative }
|
||||
|
||||
func init() { ice.TeamCtxCmd(Return{}) }
|
||||
|
||||
|
@ -1,12 +1,20 @@
|
||||
package gongyinglian
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
)
|
||||
|
||||
type Shop struct {
|
||||
TableView
|
||||
Value
|
||||
fields string `data:"name,address"`
|
||||
create string `name:"create name* address" role:"boss"`
|
||||
modify string `name:"modify name* address" role:"boss"`
|
||||
}
|
||||
|
||||
func (s Shop) List(m *ice.Message, arg ...string) {
|
||||
s.Table.ValueList(m, arg)
|
||||
kit.If(m.Length() == 0, func() { m.EchoInfoButton("") })
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(Shop{}) }
|
||||
|
@ -24,7 +24,7 @@ func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(company{}, s.Select).Cut(model.UID, model.NAME).RenameAppend(model.UID, arg[0])
|
||||
m.DisplayInputKeyNameIconTitle()
|
||||
case model.COMPANY_NAME, model.CITY_NAME:
|
||||
m.Cmdy(Portal{}, "placeList", m.Option(model.USER_UID)).Cut(arg[0])
|
||||
m.Cmdy(Portal{}, Portal{}.PlaceList, m.Option(model.USER_UID)).Cut(arg[0])
|
||||
default:
|
||||
s.Table.Inputs(m, arg...)
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import "shylinux.com/x/community/src/gonganxitong"
|
||||
|
||||
type Portal struct {
|
||||
gonganxitong.Portal
|
||||
placeCreate string `name:"placeCreate city_name* company_name* group_type*:select group_name*" role:"void"`
|
||||
placeCreate string `name:"placeCreate city_name* company_name* group_name* group_type*:select" role:"void"`
|
||||
}
|
||||
|
||||
func init() { gonganxitong.PortalCmd(NewPortal(userGroup{}, group{})) }
|
||||
|
@ -1,25 +1,16 @@
|
||||
package guanlixitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong/model"
|
||||
)
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type target struct {
|
||||
Table
|
||||
group group
|
||||
userGroup userGroup
|
||||
create string `name:"create title* content*" role:"leader"`
|
||||
fields string `data:"title,content"`
|
||||
create string `name:"create title* content*" role:"leader"`
|
||||
remove string `name:"remove" role:"leader"`
|
||||
}
|
||||
|
||||
func (s target) Create(m *ice.Message, arg ...string) {
|
||||
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.GROUP_UID, model.USER_UID))...)
|
||||
s.RecordEventWithName(m, "")
|
||||
}
|
||||
func (s target) List(m *ice.Message, arg ...string) {
|
||||
s.TablesWithRole(m, arg, s.userGroup, s.group, s, model.TITLE, model.CONTENT).Display("")
|
||||
}
|
||||
func (s target) Create(m *ice.Message, arg ...string) { s.Table.ValueCreate(m, arg...) }
|
||||
func (s target) Remove(m *ice.Message, arg ...string) { s.Table.ValueRemove(m, arg...) }
|
||||
func (s target) List(m *ice.Message, arg ...string) { s.Table.ValueList(m, arg).Display("") }
|
||||
|
||||
func init() { ice.TeamCtxCmd(target{}) }
|
||||
|
@ -1,5 +1,5 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
|
||||
_init: function(can, msg) {
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]},
|
||||
|
@ -1,21 +0,0 @@
|
||||
package operation
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type cloud struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(cloud{}) }
|
||||
|
||||
type CloudType int
|
||||
|
||||
const (
|
||||
CloudAliyun CloudType = iota
|
||||
CloudTencent
|
||||
)
|
||||
|
||||
var CloudTypeList = map[CloudType]string{
|
||||
CloudAliyun: "aliyun",
|
||||
CloudTencent: "tencent",
|
||||
}
|
||||
|
||||
func (s CloudType) String() string { return CloudTypeList[s] }
|
@ -1,41 +0,0 @@
|
||||
package operation
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
"shylinux.com/x/enterprise/src/operation/model"
|
||||
)
|
||||
|
||||
type Table struct {
|
||||
guanlixitong.Table
|
||||
list string `name:"list cloud_uid uid auto" role:"void"`
|
||||
}
|
||||
|
||||
func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
switch arg[0] {
|
||||
case model.USER_CLOUD_ROLE:
|
||||
s.InputsListRole(m, UserCloudRoleList, arg...)
|
||||
case model.CLOUD_TYPE:
|
||||
s.InputsList(m, CloudTypeList, 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_CLOUD_ROLE:
|
||||
value = UserCloudRole(kit.Int(value)).String()
|
||||
case model.CLOUD_TYPE:
|
||||
value = CloudType(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,35 +0,0 @@
|
||||
package model
|
||||
|
||||
import "shylinux.com/x/mysql-story/src/db"
|
||||
|
||||
const (
|
||||
UID = "uid"
|
||||
NAME = "name"
|
||||
TYPE = "type"
|
||||
ROLE = "role"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
USER_UID = "user_uid"
|
||||
USER_CLOUD_ROLE = "user_cloud_role"
|
||||
CLOUD_UID = "cloud_uid"
|
||||
CLOUD_NAME = "cloud_name"
|
||||
CLOUD_TYPE = "cloud_type"
|
||||
PUBLISH_UID = "publish_uid"
|
||||
COMPANY_UID = "company_uid"
|
||||
CITY_UID = "city_uid"
|
||||
)
|
||||
|
||||
type UserCloud struct {
|
||||
db.ModelUserPlace
|
||||
CloudUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type Cloud struct {
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
type Publish struct {
|
||||
db.ModelContent
|
||||
CloudUID string `gorm:"type:char(32);index"`
|
||||
}
|
||||
|
||||
func init() { db.CmdModels("", &UserCloud{}, &Cloud{}, &Publish{}) }
|
@ -1,15 +0,0 @@
|
||||
package operation
|
||||
|
||||
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* cloud_type*:select cloud_name*" role:"void"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userCloud{}, cloud{})})
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
{
|
||||
"portal": "系统运维",
|
||||
"publish": "系统发布",
|
||||
"icons": {
|
||||
"publish": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
},
|
||||
"input": {
|
||||
"My Cloud": "我的集群",
|
||||
"user_cloud_role": "用户角色",
|
||||
"cloud_name": "集群名称",
|
||||
"cloud_type": "集群类型"
|
||||
},
|
||||
"value": {
|
||||
"user_cloud_role": {
|
||||
"visitor": "访客",
|
||||
"creator": "创建人",
|
||||
"leader": "管理人员",
|
||||
"worker": "工作人员",
|
||||
"server": "服务人员",
|
||||
"style": {
|
||||
"creator": "danger",
|
||||
"leader": "danger"
|
||||
}
|
||||
},
|
||||
"cloud_type": {
|
||||
"aliyun": "阿里云",
|
||||
"tencent": "腾讯云",
|
||||
"icons": {
|
||||
"aliyun": "usr/icons/aliyun.png",
|
||||
"tencent": "usr/icons/tencent.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package operation
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/enterprise/src/operation/model"
|
||||
)
|
||||
|
||||
type publish struct {
|
||||
Table
|
||||
cloud cloud
|
||||
userCloud userCloud
|
||||
create string `name:"create title* content*" role:"leader"`
|
||||
}
|
||||
|
||||
func (s publish) Create(m *ice.Message, arg ...string) {
|
||||
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.CLOUD_UID))...)
|
||||
s.RecordEventWithName(m, "")
|
||||
}
|
||||
func (s publish) List(m *ice.Message, arg ...string) {
|
||||
s.TablesWithRole(m, arg, s.userCloud, s.cloud, s, model.TITLE, model.CONTENT).Display("")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(publish{}) }
|
@ -1,12 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title]},
|
||||
{view: html.STATUS, list: [
|
||||
value.uid.slice(0, 6), can.base.TimeTrim(value.created_at),
|
||||
value.user_name, can.onimport.textView(can, value, "user_cloud_role", aaa.ROLE),
|
||||
]},
|
||||
{view: html.OUTPUT, list: [value.content]},
|
||||
] })
|
||||
},
|
||||
})
|
@ -1,15 +0,0 @@
|
||||
package operation
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
)
|
||||
|
||||
type userCloud struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userCloud{}) }
|
||||
|
||||
type UserCloudRole = guanlixitong.UserGroupRole
|
||||
|
||||
var UserCloudRoleList = guanlixitong.UserGroupRoleList
|
@ -7,7 +7,7 @@ import (
|
||||
|
||||
type Portal struct {
|
||||
guanlixitong.Portal
|
||||
placeCreate string `name:"placeCreate city_name* company_name* channel_type*:select channel_name*" role:"void"`
|
||||
placeCreate string `name:"placeCreate city_name* company_name* channel_name* channel_type*:select" role:"void"`
|
||||
}
|
||||
|
||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userChannel{}, channel{})}) }
|
||||
|
@ -1,25 +1,16 @@
|
||||
package shichangyingxiao
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/enterprise/src/shichangyingxiao/model"
|
||||
)
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type promotion struct {
|
||||
Table
|
||||
channel channel
|
||||
userChannel userChannel
|
||||
create string `name:"create title* content*" role:"leader"`
|
||||
fields string `data:"title,content"`
|
||||
create string `name:"create title* content*" role:"leader"`
|
||||
remove string `name:"remove" role:"leader"`
|
||||
}
|
||||
|
||||
func (s promotion) Create(m *ice.Message, arg ...string) {
|
||||
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.CHANNEL_UID))...)
|
||||
s.RecordEventWithName(m, "")
|
||||
}
|
||||
func (s promotion) List(m *ice.Message, arg ...string) {
|
||||
s.TablesWithRole(m, arg, s.userChannel, s.channel, s, model.TITLE, model.CONTENT).Display("")
|
||||
}
|
||||
func (s promotion) Create(m *ice.Message, arg ...string) { s.Table.ValueCreate(m, arg...) }
|
||||
func (s promotion) Remove(m *ice.Message, arg ...string) { s.Table.ValueRemove(m, arg...) }
|
||||
func (s promotion) List(m *ice.Message, arg ...string) { s.Table.ValueList(m, arg).Display("") }
|
||||
|
||||
func init() { ice.TeamCtxCmd(promotion{}) }
|
||||
|
@ -1,5 +1,5 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
|
||||
_init: function(can, msg) {
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]},
|
||||
|
@ -1,25 +1,16 @@
|
||||
package zijinlian
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/enterprise/src/zijinlian/model"
|
||||
)
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type investment struct {
|
||||
Table
|
||||
capital capital
|
||||
userCapital userCapital
|
||||
create string `name:"create title* content*" role:"leader"`
|
||||
fields string `data:"title,content"`
|
||||
create string `name:"create title* content*" role:"leader"`
|
||||
remove string `name:"remove" role:"leader"`
|
||||
}
|
||||
|
||||
func (s investment) Create(m *ice.Message, arg ...string) {
|
||||
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.CAPITAL_UID))...)
|
||||
s.RecordEventWithName(m, "")
|
||||
}
|
||||
func (s investment) List(m *ice.Message, arg ...string) {
|
||||
s.TablesWithRole(m, arg, s.userCapital, s.capital, s, model.TITLE, model.CONTENT).Display("")
|
||||
}
|
||||
func (s investment) Create(m *ice.Message, arg ...string) { s.Table.ValueCreate(m, arg...) }
|
||||
func (s investment) Remove(m *ice.Message, arg ...string) { s.Table.ValueRemove(m, arg...) }
|
||||
func (s investment) List(m *ice.Message, arg ...string) { s.Table.ValueList(m, arg) }
|
||||
|
||||
func init() { ice.TeamCtxCmd(investment{}) }
|
||||
|
@ -1,5 +1,5 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
|
||||
_init: function(can, msg) {
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]},
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
|
||||
type Portal struct {
|
||||
guanlixitong.Portal
|
||||
placeCreate string `name:"placeCreate city_name* company_name* capital_type*:select capital_name*" role:"void"`
|
||||
placeCreate string `name:"placeCreate city_name* company_name* capital_name* capital_type*:select" role:"void"`
|
||||
}
|
||||
|
||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userCapital{}, capital{})}) }
|
||||
|
Loading…
x
Reference in New Issue
Block a user