mirror of
https://shylinux.com/x/education
synced 2025-04-25 01:58:05 +08:00
add some
This commit is contained in:
parent
49f7726917
commit
afbde5d48e
@ -1,20 +1,12 @@
|
||||
package jiaowuxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/education/src/jiaowuxitong/model"
|
||||
)
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type classUser struct {
|
||||
portal Portal
|
||||
Tables
|
||||
userClass userClass
|
||||
list string `name:"list class_uid uid auto" help:"班级成员" icon:"https://img.icons8.com/officel/80/crowd.png" role:"void"`
|
||||
}
|
||||
|
||||
func (s classUser) Init(m *ice.Message, arg ...string) {
|
||||
s.portal.Show(m, model.ROLE, "creator,teacher")
|
||||
}
|
||||
func (s classUser) List(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.userClass, s.userClass.User, arg).Display("")
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
if (msg.IsDetail()) { can.onexport.share_title(can, msg, "user_class_role"); return msg.Show(can) }
|
||||
can.onimport.itemcards(can, msg, function(value) { value._style = [value.user_class_role]
|
||||
_init: function(can, msg) { var USER_CLASS_ROLE = "user_class_role"
|
||||
if (msg.IsDetail()) { can.onexport.share_title(can, msg, USER_CLASS_ROLE); return msg.Show(can) }
|
||||
can.onimport.itemcards(can, msg, function(value) { value._style = [value[USER_CLASS_ROLE]]
|
||||
return [
|
||||
{view: html.TITLE, list: [{text: value.user_name},
|
||||
{text: [can.user.transValue(can, value, "user_class_role"), "", [aaa.ROLE, value.user_class_role]]},
|
||||
{text: [can.user.transValue(can, value, USER_CLASS_ROLE), "", [aaa.ROLE, value[USER_CLASS_ROLE]]]},
|
||||
]},
|
||||
{view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at)}]},
|
||||
]
|
||||
|
@ -1,15 +1,15 @@
|
||||
var UID = "uid", CLASS_NAME = "class_name"
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
if (msg.IsDetail()) { var value = msg.TableDetail(); msg.Option("_share_content", value.content)
|
||||
msg.Option("_share_title", can.base.trimPrefix(value.created_at.split(" ")[0], can.base.Time(null, "%y-")))
|
||||
return msg.Show(can)
|
||||
}
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [{text: value.user_name},
|
||||
{text: [can.user.transValue(can, value, "user_class_role"), "", aaa.ROLE]},
|
||||
{text: can.base.TimeTrim(value.created_at)},
|
||||
]},
|
||||
{view: html.STATUS, list: [{text: value.content}]},
|
||||
{view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at)},]},
|
||||
{view: html.OUTPUT, list: [{text: value.content}]},
|
||||
] })
|
||||
if (msg.IsDetail()) { var value = msg.TableDetail(); msg.Option("_share_content", value.content)
|
||||
msg.Option("_share_title", can.base.trimPrefix(value.created_at.split(" ")[0], can.base.Time(null, "%y-")))
|
||||
}
|
||||
},
|
||||
})
|
@ -2,8 +2,10 @@
|
||||
"portal": "教务系统",
|
||||
"placeCreate": "创建班级",
|
||||
"placeRemove": "删除班级",
|
||||
"classUser": "班级成员",
|
||||
"homework": "家庭作业",
|
||||
"icons": {
|
||||
"classUser": "https://img.icons8.com/officel/80/crowd.png",
|
||||
"homework": "https://img.icons8.com/officel/80/homework.png"
|
||||
},
|
||||
"input": {
|
||||
@ -16,18 +18,18 @@
|
||||
"school_name": "学校名称"
|
||||
},
|
||||
"value": {
|
||||
"class_type": {
|
||||
"term": "学期制",
|
||||
"weekly": "周期性",
|
||||
"step": "阶段性",
|
||||
"free": "自由式"
|
||||
},
|
||||
"user_class_role": {
|
||||
"creator": "创建人",
|
||||
"visitor": "访客",
|
||||
"teacher": "老师",
|
||||
"student": "学生",
|
||||
"parent": "家长"
|
||||
},
|
||||
"class_type": {
|
||||
"term": "学期制",
|
||||
"weekly": "周期性",
|
||||
"step": "阶段性",
|
||||
"free": "自由式"
|
||||
}
|
||||
}
|
||||
}
|
@ -27,14 +27,10 @@ func (s userClass) User(m *ice.Message, arg ...string) {
|
||||
func (s userClass) List(m *ice.Message, arg ...string) {
|
||||
s.Tables(m, s.class, s.school).FieldsWithCreatedAT(m, s,
|
||||
model.CLASS_NAME, model.CLASS_TYPE, model.USER_CLASS_ROLE,
|
||||
model.SCHOOL_NAME, model.GRADE,
|
||||
model.CLASS_UID, model.CITY_UID,
|
||||
model.CITY_UID, model.SCHOOL_NAME, model.GRADE,
|
||||
model.CLASS_UID,
|
||||
)
|
||||
if len(arg) == 0 {
|
||||
if m.IsTech() {
|
||||
s.Select(m)
|
||||
}
|
||||
} else if len(arg) == 1 {
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, model.USER_UID, arg[0])
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.USER_UID, arg[0], s.Key(s.class, model.UID), arg[1])
|
||||
|
Loading…
x
Reference in New Issue
Block a user