This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-09-05 20:02:44 +08:00
parent fb8e112883
commit 0d4b0617f6
15 changed files with 39 additions and 65 deletions

View File

@ -9,23 +9,19 @@ import (
type document struct {
Table
fields string `data:"subject,grade,document_type,title,content,icon,link"`
create string `name:"create subject* grade* document_type*:select title* content* icon link" role:"teacher"`
remove string `name:"remove" role:"teacher"`
}
func (s document) Create(m *ice.Message, arg ...string) {
arg = kit.TransArgKeys(arg, model.DOCUMENT_TYPE, model.TYPE)
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.LIBRARY_UID))...)
s.Table.ValueCreate(m, kit.TransArgKeys(arg, model.DOCUMENT_TYPE, model.TYPE)...)
}
func (s document) Remove(m *ice.Message, arg ...string) {
s.Table.Remove(m, m.OptionSimple(model.USER_UID, model.UID)...)
s.Table.ValueRemove(m, arg...)
}
func (s document) List(m *ice.Message, arg ...string) {
if len(arg) == 1 {
s.Select(m, model.LIBRARY_UID, arg[0])
} else if len(arg) == 2 {
s.SelectDetail(m, model.LIBRARY_UID, arg[0], model.UID, arg[1])
}
m.RenameAppend(model.TYPE, model.DOCUMENT_TYPE).PushAction(s.Remove)
s.Table.ValueList(m, arg).Display("")
}
func init() { ice.TeamCtxCmd(document{}) }

View File

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

View File

@ -15,7 +15,9 @@ const (
LIBRARY_TYPE = "library_type"
DOCUMENT_UID = "document_uid"
DOCUMENT_TYPE = "document_type"
SCHOOL_NAME = "school_name"
CITY_UID = "city_uid"
CITY_NAME = "city_name"
LINK = "link"
)

View File

@ -7,7 +7,7 @@ import (
type Portal struct {
jiaowuxitong.Portal
placeCreate string `name:"placeCreate city_name* school_name* library_type*:select library_name* link" role:"void"`
placeCreate string `name:"placeCreate city_name* school_name* library_name* library_type*:select link" role:"void"`
}
func init() { gonganxitong.PortalCmd(Portal{Portal: jiaowuxitong.NewPortal(userLibrary{}, library{})}) }

View File

@ -24,6 +24,8 @@ func (s Table) Inputs(m *ice.Message, arg ...string) {
case model.SCHOOL_UID:
m.Cmdy(school{}, s.Select).Cut(model.UID, model.NAME).RenameAppend(model.UID, arg[0])
m.DisplayInputKeyNameIconTitle()
case model.SCHOOL_NAME, model.CITY_NAME:
m.Cmdy(Portal{}, Portal{}.PlaceList, m.Option(model.USER_UID)).Cut(arg[0])
default:
s.Table.Inputs(m, arg...)
}

View File

@ -1,25 +1,16 @@
package jiaowuxitong
import (
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/education/src/jiaowuxitong/model"
)
import "shylinux.com/x/ice"
type homework struct {
Table
class class
userClass userClass
create string `name:"create title* content*" role:"teacher"`
fields string `data:"title,content"`
create string `name:"create title* content*" role:"teacher"`
remove string `name:"remove" role:"leader"`
}
func (s homework) Create(m *ice.Message, arg ...string) {
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.CLASS_UID, model.USER_UID))...)
s.RecordEventWithName(m, "")
}
func (s homework) List(m *ice.Message, arg ...string) {
s.TablesWithRole(m, arg, s.userClass, s.class, s, model.TITLE, model.CONTENT).Display("")
}
func (s homework) Create(m *ice.Message, arg ...string) { s.Table.ValueCreate(m, arg...) }
func (s homework) Remove(m *ice.Message, arg ...string) { s.Table.ValueRemove(m, arg...) }
func (s homework) List(m *ice.Message, arg ...string) { s.Table.ValueList(m, arg).Display("") }
func init() { ice.TeamCtxCmd(homework{}) }

View File

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

View File

@ -17,6 +17,7 @@ const (
SCHOOL_UID = "school_uid"
SCHOOL_NAME = "school_name"
CITY_UID = "city_uid"
CITY_NAME = "city_name"
GRADE = "grade"
)

View File

@ -4,7 +4,7 @@ import "shylinux.com/x/community/src/gonganxitong"
type Portal struct {
gonganxitong.Portal
placeCreate string `name:"placeCreate city_name* school_name* grade*:select class_type*:select class_name*" role:"void"`
placeCreate string `name:"placeCreate city_name* school_name* class_name* class_type*:select grade*:select" role:"void"`
}
func init() { gonganxitong.PortalCmd(NewPortal(userClass{}, class{})) }

View File

@ -7,7 +7,7 @@ import (
type Portal struct {
jiaowuxitong.Portal
placeCreate string `name:"placeCreate city_name* school_name* exam_type*:select exam_name*" role:"void"`
placeCreate string `name:"placeCreate city_name* school_name* exam_name* exam_type*:select" role:"void"`
}
func init() { gonganxitong.PortalCmd(Portal{Portal: jiaowuxitong.NewPortal(userExam{}, exam{})}) }

View File

@ -1,25 +1,16 @@
package kaoshixitong
import (
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/education/src/kaoshixitong/model"
)
import "shylinux.com/x/ice"
type question struct {
Table
exam exam
userExam userExam
create string `name:"create title* content*" role:"leader"`
fields string `data:"title,content"`
create string `name:"create title* content*" role:"teacher"`
remove string `name:"remove" role:"teacher"`
}
func (s question) Create(m *ice.Message, arg ...string) {
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.EXAM_UID))...)
s.RecordEventWithName(m, "")
}
func (s question) List(m *ice.Message, arg ...string) {
s.TablesWithRole(m, arg, s.userExam, s.exam, s, model.TITLE, model.CONTENT).Display("")
}
func (s question) Create(m *ice.Message, arg ...string) { s.Table.ValueCreate(m, arg...) }
func (s question) Remove(m *ice.Message, arg ...string) { s.Table.ValueRemove(m, arg...) }
func (s question) List(m *ice.Message, arg ...string) { s.Table.ValueList(m, arg).Display("") }
func init() { ice.TeamCtxCmd(question{}) }

View File

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

View File

@ -1,25 +1,16 @@
package zaixianketang
import (
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/education/src/zaixianketang/model"
)
import "shylinux.com/x/ice"
type lesson struct {
Table
course course
userCourse userCourse
create string `name:"create title* content*" role:"teacher"`
fields string `data:"title,content"`
create string `name:"create title* content*" role:"teacher"`
remove string `name:"remove" role:"teacher"`
}
func (s lesson) Create(m *ice.Message, arg ...string) {
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.COURSE_UID))...)
s.RecordEventWithName(m, "")
}
func (s lesson) List(m *ice.Message, arg ...string) {
s.TablesWithRole(m, arg, s.userCourse, s.course, s, model.TITLE, model.CONTENT).Display("")
}
func (s lesson) Create(m *ice.Message, arg ...string) { s.Table.ValueCreate(m, arg...) }
func (s lesson) Remove(m *ice.Message, arg ...string) { s.Table.ValueRemove(m, arg...) }
func (s lesson) List(m *ice.Message, arg ...string) { s.Table.ValueList(m, arg).Display("") }
func init() { ice.TeamCtxCmd(lesson{}) }

View File

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

View File

@ -7,7 +7,7 @@ import (
type Portal struct {
jiaowuxitong.Portal
placeCreate string `name:"placeCreate city_name* school_name* course_type*:select course_name*" role:"void"`
placeCreate string `name:"placeCreate city_name* school_name* course_name* course_type*:select" role:"void"`
}
func init() { gonganxitong.PortalCmd(Portal{Portal: jiaowuxitong.NewPortal(userCourse{}, course{})}) }