This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-10-04 12:23:30 +08:00
parent 109a06534b
commit f3421afe4a
12 changed files with 19 additions and 31 deletions

View File

@ -12,7 +12,6 @@
"library_name": "文库名称", "library_name": "文库名称",
"library_type": "文库类型", "library_type": "文库类型",
"document_type": "文档类型", "document_type": "文档类型",
"school_name": "学校名称",
"school": "学校", "school": "学校",
"subject": "学科", "subject": "学科",
"grade": "年级" "grade": "年级"

View File

@ -45,8 +45,9 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
}) })
return s.Table.RewriteAppend(m) return s.Table.RewriteAppend(m)
} }
func (s Table) SelectJoinSchool(m *ice.Message) *ice.Message { func (s Table) SelectJoinSchool(m *ice.Message) {
return s.SelectJoin(m, school{}, model.NAME, model.CITY_UID) s.SelectJoin(m, school{}, model.NAME, model.CITY_UID)
s.SelectJoinCity(m)
} }
func (s Table) CheckRole(m *ice.Message, arg ...string) { func (s Table) CheckRole(m *ice.Message, arg ...string) {
role := UserClassRole(s.UserPlaceRole(m)) role := UserClassRole(s.UserPlaceRole(m))

View File

@ -6,7 +6,7 @@ type homework struct {
Table Table
fields string `data:"title,content,user_uid"` fields string `data:"title,content,user_uid"`
create string `name:"create title* content*" role:"teacher"` create string `name:"create title* content*" role:"teacher"`
remove string `name:"remove" role:"leader"` remove string `name:"remove" role:"teacher"`
} }
func (s homework) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") } func (s homework) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }

View File

@ -1,8 +1,6 @@
{ {
"portal": "教务系统", "portal": "教务系统", "member": "班级成员",
"homework": "家庭作业", "homework": "家庭作业",
"member": "班级成员",
"school": "学校信息",
"icons": { "icons": {
"homework": "https://img.icons8.com/officel/80/homework.png" "homework": "https://img.icons8.com/officel/80/homework.png"
}, },
@ -11,7 +9,6 @@
"user_class_role": "用户角色", "user_class_role": "用户角色",
"class_name": "班级名称", "class_name": "班级名称",
"class_type": "班级类型", "class_type": "班级类型",
"school_name": "学校名称",
"grade": "入学年份" "grade": "入学年份"
}, },
"value": { "value": {

View File

@ -2,7 +2,6 @@ package jiaowuxitong
import ( import (
"shylinux.com/x/ice" "shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/education/src/jiaowuxitong/model" "shylinux.com/x/education/src/jiaowuxitong/model"
) )
@ -23,24 +22,22 @@ func (s school) FindOrCreateByName(m *ice.Message, arg ...string) {
} }
} }
func (s school) Modify(m *ice.Message, arg ...string) { func (s school) Modify(m *ice.Message, arg ...string) {
s.Update(m, kit.Dict(m.OptionSimple(model.INFO)), m.OptionSimple(model.UID)...) s.Update(m, m.OptionSimple(model.INFO), m.OptionSimple(model.UID)...)
} }
func (s school) List(m *ice.Message, arg ...string) { func (s school) List(m *ice.Message, arg ...string) {
if len(arg) == 0 { if len(arg) == 0 {
s.CityList(m) s.CityList(m)
} else if len(arg) == 1 { } else if msg := s.CityList(m.Spawn(), arg[0]); len(arg) == 1 {
msg := s.CityList(m.Spawn(), arg[0])
s.Select(m, model.CITY_UID, msg.Append(model.UID)) s.Select(m, model.CITY_UID, msg.Append(model.UID))
} else if len(arg) == 2 { } else if len(arg) == 2 {
msg := s.CityList(m.Spawn(), arg[0])
s.Select(m, model.CITY_UID, msg.Append(model.UID), model.NAME, arg[1]) s.Select(m, model.CITY_UID, msg.Append(model.UID), model.NAME, arg[1])
if m.Append(model.AUTH_UID) == "" && m.IsTech() { if m.Append(model.AUTH_UID) == "" {
m.EchoInfoButton("请申请学校认证", s.AuthCreate) m.EchoInfoButton("请申请学校认证", s.AuthCreate)
} }
} }
} }
func (s school) AuthCreate(m *ice.Message, arg ...string) { func (s school) AuthCreate(m *ice.Message, arg ...string) {
msg := m.Cmd("web.team.gonganxitong.city", s.Select, model.UID, m.Option(model.CITY_UID)) msg := s.CityCmd(m, s.Select, model.UID, m.Option(model.CITY_UID))
s.Table.AuthCreate(m, 5, msg.Append(model.AUTH_UID), m.OptionSimple(model.UID)...) s.Table.AuthCreate(m, 5, msg.Append(model.AUTH_UID), m.OptionSimple(model.UID)...)
} }

View File

@ -5,17 +5,15 @@ import "shylinux.com/x/mysql-story/src/db"
const ( const (
UID = "uid" UID = "uid"
NAME = "name" NAME = "name"
INFO = "info"
TYPE = "type" TYPE = "type"
TITLE = "title" TITLE = "title"
CONTENT = "content" CONTENT = "content"
USER_UID = "user_uid" USER_UID = "user_uid"
USER_EXAM_ROLE = "user_exam_role" USER_EXAM_ROLE = "user_exam_role"
EXAM_UID = "exam_uid" EXAM_UID = "exam_uid"
EXAM_NAME = "exam_name"
EXAM_TYPE = "exam_type" EXAM_TYPE = "exam_type"
QUESTION_UID = "question_uid" QUESTION_UID = "question_uid"
SCHOOL_UID = "school_uid"
CITY_UID = "city_uid"
) )
type UserExam struct { type UserExam struct {

View File

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

View File

@ -8,8 +8,7 @@
"My Exam": "我的考试", "My Exam": "我的考试",
"user_exam_role": "用户角色", "user_exam_role": "用户角色",
"exam_name": "考试名称", "exam_name": "考试名称",
"exam_type": "考试类型", "exam_type": "考试类型"
"school_name": "学校名称"
}, },
"value": { "value": {
"user_exam_role": { "user_exam_role": {

View File

@ -5,17 +5,15 @@ import "shylinux.com/x/mysql-story/src/db"
const ( const (
UID = "uid" UID = "uid"
NAME = "name" NAME = "name"
INFO = "info"
TYPE = "type" TYPE = "type"
TITLE = "title" TITLE = "title"
CONTENT = "content" CONTENT = "content"
USER_UID = "user_uid" USER_UID = "user_uid"
USER_COURSE_ROLE = "user_course_role" USER_COURSE_ROLE = "user_course_role"
COURSE_UID = "course_uid" COURSE_UID = "course_uid"
COURSE_NAME = "course_name"
COURSE_TYPE = "course_type" COURSE_TYPE = "course_type"
LESSON_UID = "lesson_uid" LESSON_UID = "lesson_uid"
SCHOOL_UID = "school_uid"
CITY_UID = "city_uid"
) )
type UserCourse struct { type UserCourse struct {

View File

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

View File

@ -8,8 +8,7 @@
"My Course": "我的课程", "My Course": "我的课程",
"user_course_role": "用户角色", "user_course_role": "用户角色",
"course_name": "课程名称", "course_name": "课程名称",
"course_type": "课程类型", "course_type": "课程类型"
"school_name": "学校名称"
}, },
"value": { "value": {
"user_course_role": { "user_course_role": {