This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-08-16 07:53:13 +08:00
parent 4d9bf3a486
commit e7b94c0d7d
19 changed files with 44 additions and 62 deletions

View File

@ -63,7 +63,6 @@ func (s apply) List(m *ice.Message, arg ...string) {
}
})
s.UserPlace.RewriteAppend(m)
s.Display(m, "")
}
func (s apply) Cancel(m *ice.Message, arg ...string) {
msg := s.changeStatus(m, ApplyCreate, ApplyCancel)

View File

@ -5,10 +5,7 @@ Volcanos(chat.ONIMPORT, {
can.onimport.itemcards(can, msg, function(value) { value._style = [value[PLACE_TYPE], value[USER_PLACE_ROLE], value[APPLY_STATUS]]
var status = value[APPLY_STATUS]
return [
{view: html.TITLE, list: [{text: value[PLACE_NAME]},
{text: [can.user.transValue(can, value, PLACE_TYPE), "", [mdb.TYPE, value[PLACE_TYPE], can.onimport.typeStyle(can, value, PLACE_TYPE)]]},
{text: [can.user.transValue(can, value, USER_PLACE_ROLE), "", [aaa.ROLE, value[USER_PLACE_ROLE], can.onimport.roleStyle(can, value, USER_PLACE_ROLE)]]},
]},
{view: html.TITLE, list: [{text: value[PLACE_NAME]}, can.onimport.textView(can, value, PLACE_TYPE, mdb.TYPE), can.onimport.textView(can, value, USER_PLACE_ROLE, aaa.ROLE)]},
{view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at)},
{text: [can.user.transValue(can, value, APPLY_STATUS)+" "+(status == "create" || status == "submit"? "🕑": status == "rejected"? "❌": "✅"), "", mdb.STATUS]},
]},

View File

@ -79,13 +79,13 @@ func (s Table) List(m *ice.Message, arg ...string) *ice.Message {
return m
}
func (s Table) TablesWithRole(m *ice.Message, arg []string, userPlace UserPlacer, place Placer, target Placer, fields ...ice.Any) *ice.Message {
s.Tables(m, kit.JoinWord("LEFT JOIN", s.TableName(kit.TypeName(userPlace)),
s.Tables(m, kit.JoinWord("INNER JOIN", s.TableName(kit.TypeName(userPlace)),
"ON", s.Key(target, model.USER_UID), "=", s.Key(userPlace, model.USER_UID),
"AND", s.Key(target, s.Keys(place, model.UID)), "=", s.Key(userPlace, s.Keys(place, model.UID)),
"AND", s.Key(userPlace, model.DELETED_AT), "IS NULL",
)).FieldsWithCreatedAT(m, target, append([]ice.Any{s.Key(target, model.USER_UID), s.AS(s.Key(userPlace, model.ROLE), s.Keys(userPlace, model.ROLE))}, fields...)...)
if len(arg) == 1 {
s.Table.Select(m, s.Key(target, s.Keys(place, model.UID)), arg[0])
m.Action(s.Create)
} else if len(arg) == 2 {
s.Table.SelectDetail(m, s.Key(target, s.Keys(place, model.UID)), arg[0], s.Key(target, model.UID), arg[1])
} else {

View File

@ -4,8 +4,8 @@ Volcanos(chat.ONIMPORT, {
can.onimport.itemcards(can, msg, function(value) { value._style = [value[PLACE_TYPE]||"", value[USER_PLACE_ROLE]||""]
return [
{view: html.TITLE, list:[{text: [value.name||value.user_name]},
value[PLACE_TYPE] && {text: [can.user.transValue(can, value, PLACE_TYPE), "", [mdb.TYPE, value[PLACE_TYPE], can.onimport.typeStyle(can, value, PLACE_TYPE)]]},
value[USER_PLACE_ROLE] && {text: [can.user.transValue(can, value, USER_PLACE_ROLE), "", [aaa.ROLE, value[USER_PLACE_ROLE], can.onimport.roleStyle(can, value, USER_PLACE_ROLE)]]},
can.onimport.textView(can, value, PLACE_TYPE, mdb.TYPE),
can.onimport.textView(can, value, USER_PLACE_ROLE, aaa.ROLE),
]},
{view: html.STATUS, list: [value.uid && {text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at||value.updated_at)}]},
]

View File

@ -28,7 +28,6 @@ func (s event) List(m *ice.Message, arg ...string) {
} else {
return
}
s.Display(m, "")
}
func init() { ice.TeamCtxCmd(event{Table: newTable()}) }

View File

@ -1,7 +1,5 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
var PLACE_NAME = msg.Option("_place_name"), PLACE_TYPE = msg.Option("_place_type")
var USER_PLACE_ROLE = msg.Option("_user_place_role"), STREET_NAME = msg.Option("_street_name"), ORDER_STATUS = "order_status"
can.onimport.itemcards(can, msg, function(value) {
return [
{view: html.TITLE, list: [{text: value.user_name}]},

View File

@ -15,6 +15,7 @@ const (
OPERATOR = "operator"
CREATED_AT = "created_at"
UPDATED_AT = "updated_at"
DELETED_AT = "deleted_at"
BEGIN_TIME = "begin_time"
END_TIME = "end_time"
OPEN_ID = "open_id"

View File

@ -23,7 +23,6 @@ type order struct {
func (s order) Create(m *ice.Message, arg ...string) {
s.Table.Create(m, arg...)
m.Info("what %v", m.FormatChain())
s.sendTemplate(m, m.Trans("role order create", "权限审批 请处理"))
}
func (s order) List(m *ice.Message, arg ...string) {
@ -49,7 +48,6 @@ func (s order) List(m *ice.Message, arg ...string) {
}
}).Action()
s.UserPlace.RewriteAppend(m)
s.Display(m, "")
}
func (s order) Reject(m *ice.Message, arg ...string) {
defer m.ToastProcess()()

View File

@ -5,9 +5,7 @@ Volcanos(chat.ONIMPORT, {
can.onimport.itemcards(can, msg, function(value) { value._style = [value[PLACE_TYPE], value[USER_PLACE_ROLE], value[ORDER_STATUS]]
var status = value[ORDER_STATUS]
return [
{view: html.TITLE, list: [{text: value.user_name},
{text: [can.user.transValue(can, value, USER_PLACE_ROLE), "", [aaa.ROLE, value[USER_PLACE_ROLE], can.onimport.roleStyle(can, value, USER_PLACE_ROLE)]]},
]},
{view: html.TITLE, list: [{text: value.user_name}, can.onimport.textView(can, value, USER_PLACE_ROLE, aaa.ROLE)]},
{view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at)},
{text: [can.user.transValue(can, value, ORDER_STATUS)+" "+(status == "create" || status == "submit"? "🕑": status == "rejected"? "❌": "✅"), "", mdb.STATUS]},
]},

View File

@ -2,7 +2,10 @@ var UID = "uid", PLACE_UID = "place_uid", PLACE_NAME = "place_name", PLACE_TYPE
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.isCmdMode() && can.user.isMobile && can.onappend.style(can, html.OUTPUT)
can.isCmdMode() && can.user.isMobile && can.onmotion.delay(can, function() { can.sup.onimport.size(can.sup, window.innerHeight, window.innerWidth) })
can.isCmdMode() && can.user.isMobile && can.onmotion.delay(can, function() { can.sup.onimport.size(can.sup, window.innerHeight, window.innerWidth) }, 300)
can.onimport.myPortal(can, msg)
// can.page.Append(can, can._output, [{type: "a", href: "tel:10086", inner: "10086"}])
},
myValue: function(can, value) {
return [
@ -10,9 +13,7 @@ Volcanos(chat.ONIMPORT, {
{text: [value.__type, "", [mdb.TYPE, value._type, value._type_style]]},
value._role != "visitor" && {text: [value.__role, "", [aaa.ROLE, value._role, value._role_style]]},
]},
{view: html.STATUS, list: [
{text: value.uid.slice(0, 6)}, {text: value.city_name}, {text: value._street},
]},
{view: html.STATUS, list: [{text: value.uid.slice(0, 6)}, {text: value.city_name}, {text: value._street}]},
]
},
myPortal: function(can, msg) {
@ -35,12 +36,6 @@ Volcanos(chat.ONIMPORT, {
can.onimport.myData(can, msg, can._output, PLACE_UID, PLACE_NAME)
}
},
typeStyle: function(can, value, key) {
return can.Conf("_lrans.value."+key+".style."+value[key])||""
},
roleStyle: function(can, value, key) {
return can.Conf("_trans.value."+key+".style."+value[key])||""
},
myPlace: function(can, msg, target, PLACE_UID, PLACE_NAME, PLACE_TYPE) { var place_uid
var USER_PLACE_ROLE = msg.Option("_user_place_role"), STREET_NAME = msg.Option("_street_name")
can.ui._target = can.page.Append(can, target||can._output, [html.OUTPUT])._target
@ -133,6 +128,9 @@ Volcanos(chat.ONIMPORT, {
})
})
},
typeStyle: function(can, value, key) { return can.Conf("_lrans.value."+key+".style."+value[key])||"" },
roleStyle: function(can, value, key) { return can.Conf("_trans.value."+key+".style."+value[key])||"" },
textView: function(can, value, key, type) { return value[key] && {text: [can.user.transValue(can, value, key), "", [type, value[key], can.Conf("_trans.value."+key+".style."+value[key])||""]]} },
})
Volcanos(chat.ONEXPORT, {
value: function(can, value, PLACE_UID, PLACE_NAME) {

View File

@ -1,5 +1,4 @@
{
"service": "系统服务",
"portal": "用户场景",
"setIcons": "设置图标",
"scanQRCode": "扫码添加",
@ -22,33 +21,22 @@
"create": "创建",
"project": "项目",
"oauth": "授权",
"service": "系统服务",
"icons": {
"service": "https://img.icons8.com/officel/80/activity-grid.png",
"qrcode": "https://img.icons8.com/officel/80/qr-code.png",
"apply": "https://img.icons8.com/officel/80/edit-property.png",
"order": "https://img.icons8.com/officel/80/receipt-approved.png",
"event": "https://img.icons8.com/officel/80/property-with-timer.png",
"email": "https://img.icons8.com/officel/80/reading-confirmation.png",
"placeUser": "https://img.icons8.com/officel/80/person-at-home.png",
"member": "https://img.icons8.com/officel/80/person-at-home.png"
"member": "https://img.icons8.com/officel/80/person-at-home.png",
"service": "https://img.icons8.com/officel/80/activity-grid.png"
},
"style": {
"placeRemove": "danger"
},
"input": {
"class": "基类",
"table": "应用",
"My Place": "我的场景",
"apply_status": "申请状态",
"order_status": "审批状态",
"begin_time": "起始时间",
"end_time": "结束时间",
"cancel_time": "取消时间",
"finish_time": "完成时间",
"created_at": "创建时间",
"operate": "操作",
"operator": "操作人",
"info": "详情",
"user_uid": "用户",
"user_name": "用户昵称",
"user_avatar": "用户头像",
@ -60,7 +48,19 @@
"street_name": "街道名称",
"school_name": "学校名称",
"company_name": "公司名称",
"city_name": "城市名称"
"city_name": "城市名称",
"apply_status": "申请状态",
"order_status": "审批状态",
"begin_time": "起始时间",
"end_time": "结束时间",
"cancel_time": "取消时间",
"finish_time": "完成时间",
"created_at": "创建时间",
"operate": "操作",
"operator": "操作人",
"info": "详情",
"class": "基类",
"table": "应用"
},
"value": {
"apply_status": {

View File

@ -34,6 +34,10 @@ func (s userPlace) List(m *ice.Message, arg ...string) {
)
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, model.PLACE_UID), arg[1])
} else {
return
}
s.RewriteAppend(m)
}

View File

@ -57,13 +57,10 @@ func (s Table) recordEvent(m *ice.Message, info string, arg ...string) *ice.Mess
type Tables struct {
Table
Portal Portal
portal string `data:"true"`
}
func (s Tables) Init(m *ice.Message, arg ...string) { s.Portal.Show(m) }
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {
}
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
func newTable() Table {
return Table{Table: guanlixitong.NewTable(userQueue{}, queue{})}

View File

@ -1,2 +0,0 @@
chapter "约号系统"
field web.code.mysql.query args `mysql yuehaoxitong`

View File

@ -99,10 +99,10 @@ func (s schedule) List(m *ice.Message, arg ...string) {
}
})
}
m.Action()
s.SelectJoin(m, s.reception)
s.SelectJoinUser(m)
s.RewriteAppend(m)
m.Action()
}
func (s schedule) SelectByStatus(m *ice.Message, arg ...string) *ice.Message {
order := m.Option(mdb.ORDER)

View File

@ -15,9 +15,7 @@ Volcanos(chat.ONIMPORT, {
}
return [
{view: html.TITLE, list:[{text: [value.name||value.user_name]}, {text: value.reception_name},
value.schedule_status != "finish" && {text: [can.user.transValue(can, value, "schedule_status"), "", [mdb.STATUS, value.schedule_status,
can.Conf("_trans.value.schedule_status.style."+value.schedule_status)||"",
]]},
value.schedule_status != "finish" && can.onimport.textView(can, value, "schedule_status", mdb.STATUS)
]},
{view: html.STATUS, list: [value.uid && {text: value.uid.slice(0, 6)}, {text: can.base.TimeTrim(value.created_at||value.updated_at)}]},
time, _time,

View File

@ -31,6 +31,10 @@ func (s userQueue) List(m *ice.Message, arg ...string) {
)
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, model.QUEUE_UID), arg[1])
} else {
return
}
s.SelectJoinCompany(m)
s.SelectJoinCity(m)

View File

@ -20,8 +20,7 @@ func (s volume) List(m *ice.Message, arg ...string) {
}
} else if len(arg) == 1 {
s.Tables(m, s.reception).FieldsWithCreatedAT(m, s,
model.RECEPTION_NAME, model.AMOUNT, model.COUNT,
model.EXPIRE, model.FINISH,
model.RECEPTION_NAME, model.AMOUNT, model.COUNT, model.EXPIRE, model.FINISH,
model.BEGIN_TIME, model.END_TIME,
)
s.Select(m, s.Key(s, model.QUEUE_UID), arg[0])

View File

@ -3,14 +3,8 @@ Volcanos(chat.ONIMPORT, {
can.onimport.itemcards(can, msg, function(value) {
return [
{view: html.TITLE, list:[{text: value.reception_name}]},
{view: html.STATUS, list:[
{text: "放号量: "}, {text: value.amount},
{text: "预约量: "}, {text: value.count||"0"},
]},
{view: html.STATUS, list:[
{text: "过号量: "}, {text: value.expire||"0"},
{text: "完成量: "}, {text: value.finish||"0"},
]},
{view: html.STATUS, list:[{text: "放号量: "}, {text: value.amount}, {text: "预约量: "}, {text: value.count}]},
{view: html.STATUS, list:[{text: "过号量: "}, {text: value.expire||"0"}, {text: "完成量: "}, {text: value.finish||"0"}]},
{view: html.STATUS, list:[{text: "开始时间:"}, {text: value.begin_time}]},
{view: html.STATUS, list:[{text: "结束时间:"}, {text: value.end_time}]},
]