mirror of
https://shylinux.com/x/community
synced 2025-04-25 09:38:06 +08:00
add some
This commit is contained in:
parent
494cd55393
commit
3ea9d3b12a
@ -301,6 +301,7 @@ func PortalCmd(portal ice.Any) {
|
||||
}
|
||||
table := portal.(interface{ getTable() Table }).getTable()
|
||||
cmd("portal", portal)
|
||||
cmd("search", search{Tables: Tables{Table: table}})
|
||||
cmd("qrcode", qrcode{Tables: Tables{Table: table}})
|
||||
cmd("event", event{Table: table})
|
||||
cmd("apply", apply{Table: table})
|
||||
|
@ -9,6 +9,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
{view: html.TITLE, list:[value.title||value.name||value.user_name,
|
||||
can.onimport.textView(can, value, PLACE_TYPE, mdb.TYPE), can.onimport.textView(can, value, USER_PLACE_ROLE, aaa.ROLE),
|
||||
]},
|
||||
{view: html.STATUS, list: [value.city_name, value.street_name, value.company_name]},
|
||||
{view: html.STATUS, list: [value.uid && value.uid.slice(0, 6), can.base.TimeTrim(value.created_at||value.updated_at)]},
|
||||
value.address && {view: html.STATUS, list: [value.address]},
|
||||
value.content && {view: html.OUTPUT, list: [value.content]},
|
||||
|
@ -13,6 +13,7 @@ const (
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
OPERATOR = "operator"
|
||||
CREATOR = "creator"
|
||||
CREATED_AT = "created_at"
|
||||
UPDATED_AT = "updated_at"
|
||||
DELETED_AT = "deleted_at"
|
||||
@ -38,6 +39,7 @@ const (
|
||||
SERVICE_TYPE = "service_type"
|
||||
MESSAGE_STATUS = "message_status"
|
||||
SERVICE_STATUS = "service_status"
|
||||
QRCODE_TYPE = "qrcode_type"
|
||||
FROM_USER_UID = "from_user_uid"
|
||||
TO_USER_UID = "to_user_uid"
|
||||
BEGIN_TIME = "begin_time"
|
||||
@ -47,6 +49,7 @@ const (
|
||||
EMAIL = "email"
|
||||
AVATAR = "avatar"
|
||||
ADDRESS = "address"
|
||||
INDEX = "index"
|
||||
INIT = "init"
|
||||
)
|
||||
|
||||
|
@ -23,6 +23,7 @@ type Portal struct {
|
||||
list string `name:"list place_uid index uid auto" role:"void"`
|
||||
placeCreate string `name:"placeCreate city_name* street_name* place_type*:select place_name* address*" icon:"bi bi-plus-square-dotted" role:"void"`
|
||||
placeRemove string `name:"placeRemove uid*" role:"void"`
|
||||
placeSearch string `name:"placeSearch" icon:"bi bi-search" role:"void"`
|
||||
scanQRCode string `name:"scanQRCode type text" icon:"bi bi-qr-code-scan" role:"void"`
|
||||
setIcons string `name:"setIcons icons" icon:"bi bi-info-square"`
|
||||
}
|
||||
@ -79,12 +80,27 @@ func (s Portal) List(m *ice.Message, arg ...string) {
|
||||
return
|
||||
}
|
||||
if len(arg) == 0 {
|
||||
m.Cmdy(s.UserPlace, m.Option(model.USER_UID)).PushAction(s.PlaceRemove).Action(s.PlaceCreate, s.ScanQRCode)
|
||||
kit.If(!m.IsErr() && m.Length() == 0, func() { m.EchoInfoButton("", s.PlaceCreate, s.ScanQRCode) })
|
||||
m.Cmdy(s.UserPlace, m.Option(model.USER_UID)).PushAction(s.PlaceRemove).Action(s.PlaceCreate, s.ScanQRCode, s.PlaceSearch)
|
||||
kit.If(!m.IsErr() && m.Length() == 0, func() { m.EchoInfoButton("", s.PlaceCreate, s.ScanQRCode, s.PlaceSearch) })
|
||||
} else if len(arg) == 1 {
|
||||
if arg[0] != "" {
|
||||
msg := m.Cmd(s.Place, s.Table.Select, model.UID, arg[0])
|
||||
s.AddRecent(m.Spawn(), arg[0], msg.Append(model.NAME), msg.Append(mdb.ICONS))
|
||||
m.Option("_user_place_role", s.Keys(s.UserPlace, model.ROLE))
|
||||
m.Option("_street_name", s.Keys(s.Street, model.NAME))
|
||||
msg := m.Cmd(s.UserPlace, m.Option(model.USER_UID), arg[0])
|
||||
if msg.Length() == 0 {
|
||||
msg = m.Cmd(s.Place, s.Table.Select, model.UID, arg[0])
|
||||
msg.Push(s.Keys(s.UserPlace, model.ROLE), "0")
|
||||
msg.RenameAppend(model.NAME, s.Keys(s.Place, model.NAME), model.TYPE, s.Keys(s.Place, model.TYPE))
|
||||
s.SelectJoin(msg, s.Street, model.NAME, model.CITY_UID)
|
||||
s.SelectJoin(msg, s.city)
|
||||
}
|
||||
s.UserPlace.RewriteAppend(msg)
|
||||
m.Options(msg.AppendSimple(
|
||||
s.Keys(s.UserPlace, model.ROLE),
|
||||
s.Keys(s.Place, model.NAME), s.Keys(s.Place, model.TYPE),
|
||||
s.Keys(s.Street, model.NAME), model.CITY_NAME,
|
||||
))
|
||||
s.AddRecent(msg, arg[0], msg.Append(s.Keys(s.Place, model.NAME)), msg.Append(mdb.ICONS))
|
||||
}
|
||||
s.Hash.List(m).SortInt(mdb.ORDER)
|
||||
} else if len(arg) == 2 {
|
||||
@ -118,6 +134,9 @@ func (s Portal) PlaceRemove(m *ice.Message, arg ...string) {
|
||||
defer m.ToastProcess()()
|
||||
m.Cmdy(s.UserPlace, s.Delete, m.OptionSimple(model.USER_UID, model.UID))
|
||||
}
|
||||
func (s Portal) PlaceSearch(m *ice.Message, arg ...string) {
|
||||
m.ProcessRewrite(model.INDEX, m.Prefix("search"))
|
||||
}
|
||||
func (s Portal) ScanQRCode(m *ice.Message, arg ...string) {
|
||||
defer m.ToastProcess()()
|
||||
if m.Option(mdb.TYPE) == mdb.TEXT {
|
||||
|
@ -1,21 +1,21 @@
|
||||
var UID = "uid", PLACE_UID = "place_uid", PLACE_NAME = "place_name", PLACE_TYPE = "place_type", STREET_NAME = "street_name"
|
||||
var UID = "uid", PLACE_UID = "place_uid", PLACE_NAME = "place_name", PLACE_TYPE = "place_type", STREET_NAME = "street_name", CITY_NAME = "city_name"
|
||||
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)
|
||||
if (can.user.isMobile && can.isCmdMode()) { can.onappend.style(can, html.OUTPUT)
|
||||
can.onmotion.delay(can, function() { can.sup.onimport.size(can.sup, window.innerHeight, window.innerWidth) })
|
||||
can.onmotion.delay(can, function() { can.sup.onimport.size(can.sup, window.innerHeight, window.innerWidth) }, 300)
|
||||
can.onmotion.delay(can, function() { can.sup.onimport.size(can.sup, window.innerHeight, window.innerWidth) }, 3000)
|
||||
}
|
||||
can.onimport.myPortal(can, msg)
|
||||
},
|
||||
typeStyle: function(can, value, key) { return can.Conf("_trans.value."+key+".style."+value[key])||"" },
|
||||
roleStyle: function(can, value, key) { return can.Conf("_trans.value."+key+".style."+value[key])||"" },
|
||||
myValue: function(can, value) {
|
||||
return [
|
||||
{view: html.TITLE, list: [value._name, {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: [value.uid.slice(0, 6), value.city_name, value._street]},
|
||||
]
|
||||
},
|
||||
myValue: function(can, value) { return [
|
||||
{view: html.TITLE, list: [value._name, {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: [value.uid.slice(0, 6), value.city_name, value._street]},
|
||||
] },
|
||||
myPortal: function(can, msg) {
|
||||
var PLACE_UID = msg.Option("_place_uid"), 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")
|
||||
@ -23,44 +23,48 @@ Volcanos(chat.ONIMPORT, {
|
||||
if (can.Option(PLACE_UID) == "" && can.Option(ctx.INDEX) == "") {
|
||||
if (can.db.hash.length > 1 && can.db.hash[0]) { return can.Option(PLACE_UID, can.db.hash[0]), can.Option(ctx.INDEX, can.db.hash[1]), can.Update() }
|
||||
can.ui = can.page.Append(can, can._output, [
|
||||
{view: html.OUTPUT, list: [
|
||||
// "mydebug.list",
|
||||
"myplace.list",
|
||||
"myinit.list",
|
||||
"myindex.list",
|
||||
"myallow.list",
|
||||
]},
|
||||
{view: html.OUTPUT, list: ["mydebug.list", "myplace.list", "myinit.list", "myindex.list", "myallow.list"]},
|
||||
{view: html.ACTION, list: ["myorder.list"]},
|
||||
])
|
||||
can.ui.mydebug && can.onimport.myDebug(can, msg, can.ui.mydebug)
|
||||
can.onimport.myDebug(can, msg, can.ui.mydebug)
|
||||
var uid = can.onimport.myPlace(can, msg, can.ui.myplace, PLACE_UID, PLACE_NAME, PLACE_TYPE)
|
||||
msg.Length() > 0? can.run({}, [uid], function(msg) { can._index_msg = msg
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex, PLACE_UID, USER_PLACE_ROLE), can.onimport.selectIndex(can, can.sup.current)
|
||||
can.onimport.myAllow(can, msg, can.ui.myallow, PLACE_UID, USER_PLACE_ROLE)
|
||||
can.onimport.myOrder(can, msg, can.ui.myorder, PLACE_UID, USER_PLACE_ROLE)
|
||||
can.sup.current && can.onexport.value(can, can.sup.current, PLACE_UID, PLACE_NAME)
|
||||
}): can.run({}, [uid], function(msg) { can._index_msg = msg
|
||||
can.onimport.myOrder(can, msg, can.ui.myorder, PLACE_UID, USER_PLACE_ROLE)
|
||||
can.sup.current && can.onexport.value(can, can.sup.current, PLACE_UID, PLACE_NAME)
|
||||
}), can.ui.place_count = msg.Length()
|
||||
} else if (can.Option(ctx.INDEX) == "") {
|
||||
can.sup._back_args = [can.Option(PLACE_UID)]
|
||||
can.ui = can.page.Append(can, can._output, [
|
||||
{view: html.OUTPUT, list: [
|
||||
// "mydebug.list",
|
||||
"myplace.list",
|
||||
"myindex.list",
|
||||
]},
|
||||
{view: html.OUTPUT, list: ["myplace.list", "myindex.list", "myallow.list"]},
|
||||
{view: html.ACTION, list: ["myorder.list"]},
|
||||
])
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex, PLACE_UID, USER_PLACE_ROLE), can.onimport.selectIndex(can, {
|
||||
place_name: msg.Option("place_name"),
|
||||
}, msg.Option("user_place_role"))
|
||||
var _msg = can.request({}, {_user_place_role: msg.Option("_user_place_role"), _street_name: msg.Option("_street_name")}); _msg.Push(kit.Dict(
|
||||
UID, "", PLACE_UID, can.Option(PLACE_UID), PLACE_NAME, msg.Option(PLACE_NAME), PLACE_TYPE, msg.Option(PLACE_TYPE), USER_PLACE_ROLE, msg.Option(USER_PLACE_ROLE),
|
||||
STREET_NAME, msg.Option(STREET_NAME), CITY_NAME, msg.Option(CITY_NAME),
|
||||
))
|
||||
_msg.Option(ice.MSG_ACTION, msg.Option(USER_PLACE_ROLE) == "visitor"? '["placeSearch"]': '["placeCreate","scanQRCode","placeSearch"]')
|
||||
can.onimport.myPlace(can, _msg, can.ui.myplace, PLACE_UID, PLACE_NAME, PLACE_TYPE)
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex, PLACE_UID, USER_PLACE_ROLE), can.onimport.selectIndex(can, can.sup.current)
|
||||
can.onimport.myAllow(can, msg, can.ui.myallow, PLACE_UID, USER_PLACE_ROLE)
|
||||
can.onimport.myOrder(can, msg, can.ui.myorder, PLACE_UID, USER_PLACE_ROLE)
|
||||
} else {
|
||||
can.onimport.myData(can, msg, can._output, PLACE_UID, PLACE_NAME)
|
||||
can.onimport.story(can, msg, can._output, PLACE_UID, PLACE_NAME)
|
||||
}
|
||||
},
|
||||
myTrans: function(can, value, PLACE_UID, PLACE_NAME, PLACE_TYPE, USER_PLACE_ROLE, STREET_NAME) {
|
||||
value.icons = can.Conf(can.core.Keys("_trans.value", PLACE_TYPE, mdb.ICONS, value[PLACE_TYPE]))
|
||||
value._uid = value[PLACE_UID], value._name = value[PLACE_NAME], value._street = value[STREET_NAME]
|
||||
value._type = value[PLACE_TYPE], value.__type = can.user.transValue(can, value, PLACE_TYPE)
|
||||
value._role = value[USER_PLACE_ROLE], value.__role = can.user.transValue(can, value, USER_PLACE_ROLE)
|
||||
value._type_style = can.onimport.typeStyle(can, value, PLACE_TYPE)
|
||||
value._role_style = can.onimport.roleStyle(can, value, USER_PLACE_ROLE)
|
||||
value.icons = can.Conf(can.core.Keys("_trans.value", PLACE_TYPE, mdb.ICONS, value[PLACE_TYPE]))
|
||||
},
|
||||
myDebug: function(can, msg, target, PLACE_UID, USER_PLACE_ROLE) {
|
||||
can.onmotion.hidden(can, target)
|
||||
can.page.Append(can, target, [{view: html.TITLE, list: [{text: can.user.trans(can, "My Debug", "我的调试")}]}])
|
||||
can.page.Append(can, target, [{text: window.innerWidth+", "+window.innerHeight}])
|
||||
},
|
||||
@ -73,30 +77,23 @@ Volcanos(chat.ONIMPORT, {
|
||||
can.ui._target = can.page.Append(can, target||can._output, [html.OUTPUT])._target
|
||||
msg.Length() > 0 && can.page.Append(can, can.ui._target, msg.Table(function(value) {
|
||||
place_uid = place_uid||value[PLACE_UID], value[PLACE_UID] == can.onexport.session(can, PLACE_UID) && (place_uid = value[PLACE_UID])
|
||||
place_uid == value[PLACE_UID] && (can.sup.current = value, can.onexport.title(can, value[PLACE_NAME]))
|
||||
value._uid = value[PLACE_UID], value._name = value[PLACE_NAME], value._street = value[STREET_NAME]
|
||||
value._type = value[PLACE_TYPE], value.__type = can.user.transValue(can, value, PLACE_TYPE)
|
||||
value._role = value[USER_PLACE_ROLE], value.__role = can.user.transValue(can, value, USER_PLACE_ROLE)
|
||||
value.icons = can.Conf(can.core.Keys("_trans.value", PLACE_TYPE, mdb.ICONS, value[PLACE_TYPE]))
|
||||
value._type_style = can.onimport.typeStyle(can, value, PLACE_TYPE)
|
||||
value._role_style = can.onimport.roleStyle(can, value, USER_PLACE_ROLE)
|
||||
place_uid == value[PLACE_UID] && (can.sup.current = value)
|
||||
can.onimport.myTrans(can, value, PLACE_UID, PLACE_NAME, PLACE_TYPE, USER_PLACE_ROLE, STREET_NAME)
|
||||
return can.onimport.itemcard(can, value, can.onimport.myValue(can, value, PLACE_UID, PLACE_NAME, STREET_NAME), function(event) {
|
||||
can.onexport.value(can, value, PLACE_UID, PLACE_NAME)
|
||||
})
|
||||
})), can.sup.current && can.onexport.value(can, can.sup.current, PLACE_UID, PLACE_NAME)
|
||||
can.page.Append(can, target, [{view: html.ACTION, _init: function(target) { can.onappend._action(can, msg.Option(ice.MSG_ACTION), target) }}])
|
||||
})), can.page.Append(can, target, [{view: html.ACTION, _init: function(target) { can.onappend._action(can, msg.Option(ice.MSG_ACTION), target) }}])
|
||||
return place_uid||""
|
||||
},
|
||||
myInit: function(can, msg, value, target) { if (!msg) { return }
|
||||
can.onmotion.hidden(can, target)
|
||||
can.page.Append(can, target, [{view: html.TITLE, list: [{text: can.user.trans(can, "My Init", "我的初始化")}]}])
|
||||
msg.Table(function(val) {
|
||||
if (parseInt(val.init) == parseInt(value.init)+1) { val.args = [value._uid], val.style = html.OUTPUT, value._init = true
|
||||
can.onappend.plugin(can, val, function(sub) { var run = sub.run
|
||||
sub.run = function(event, cmds, cb) {
|
||||
run(can.request(event, {user_place_uid: value.uid, user_place_init: value.init}), cmds, function(msg) {
|
||||
if (cmds[1] == mdb.CREATE || cmds.length == 1 && msg.Length() > 0) {
|
||||
can.onmotion.clearInput(can), can.Update()
|
||||
} else { cb(msg) }
|
||||
if (cmds[1] == mdb.CREATE || cmds.length == 1 && msg.Length() > 0) { can.onmotion.clearInput(can), can.Update() } else { cb(msg) }
|
||||
})
|
||||
}
|
||||
}, target)
|
||||
@ -104,7 +101,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
})
|
||||
},
|
||||
myList: function(can, msg, target, PLACE_UID, USER_PLACE_ROLE) {
|
||||
var width = (can.ConfWidth()-40)/parseInt((can.ConfWidth()-40)/100), height = width; can.user.isMobile && !can.user.isLandscape() && (width = (can.ConfWidth()-40)/4, height = width)
|
||||
var width = (can.ConfWidth()-40)/parseInt((can.ConfWidth()-40)/100); can.user.isMobile && !can.user.isLandscape() && (width = (can.ConfWidth()-40)/4)
|
||||
can.page.Append(can, target, msg.Table(function(value) { if (value.order < 100 && value.enable != ice.TRUE) { return }
|
||||
return {view: [[html.ITEM, ctx.INDEX].concat(
|
||||
value.type? [mdb.TYPE]: [], can.core.Split(value.type||""),
|
||||
@ -121,8 +118,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
can.page.Append(can, target, [{view: html.TITLE, list: [{text: can.user.trans(can, "My Index", "我的应用")}]}])
|
||||
var role = can.page.Append(can, target, [{view: aaa.ROLE, list: can.core.Item(can.Conf("_trans.value."+USER_PLACE_ROLE), function(key, value) {
|
||||
if (can.base.isIn(key, ctx.STYLE, mdb.ICONS)) { return }
|
||||
return {text: [can.user.trans(can, key, value), "", key], onclick: function(event) {
|
||||
can.onexport.value(can, can.sup.current, PLACE_UID)
|
||||
return {text: [can.user.trans(can, key, value), "", key], onclick: function(event) { can.onexport.value(can, can.sup.current, PLACE_UID)
|
||||
can.onimport.selectIndex(can, can.sup.current, key), can.onmotion.select(can, role, html.SPAN, event.target)
|
||||
}}
|
||||
}) }])._target; can.ui.role = role
|
||||
@ -135,14 +131,13 @@ Volcanos(chat.ONIMPORT, {
|
||||
var _msg = can.request(); msg.Table(function(value) { if (value.order > 89 && value.order < 100) { _msg.Push(value) } })
|
||||
var output = can.page.Append(can, target, [html.OUTPUT])._target
|
||||
can.onimport.myList(can, _msg, output, PLACE_UID, USER_PLACE_ROLE)
|
||||
can.onimport.layout(can)
|
||||
},
|
||||
myOrder: function(can, msg, target, PLACE_UID, USER_PLACE_ROLE) {
|
||||
can.page.Append(can, target, [{view: html.TITLE, list: [{text: can.user.trans(can, "My Order", "我的系统")}]}])
|
||||
var _msg = can.request(); msg.Table(function(value) { if (value.order > 99) { _msg.Push(value) } })
|
||||
var output = can.page.Append(can, target, [html.OUTPUT])._target
|
||||
can.onimport.myList(can, _msg, output, PLACE_UID, USER_PLACE_ROLE)
|
||||
can.onimport.layout(can)
|
||||
can.onimport.layout(can), can.onexport.value(can, can.sup.current, PLACE_UID)
|
||||
},
|
||||
selectIndex: function(can, value, role) { role = role||value._role
|
||||
can.ui.role && can.onmotion.toggle(can, can.ui.role, value._role == "creator")
|
||||
@ -157,28 +152,28 @@ Volcanos(chat.ONIMPORT, {
|
||||
}
|
||||
})
|
||||
},
|
||||
myData: function(can, msg, target, PLACE_UID, PLACE_NAME) {
|
||||
msg.Table(function(value) { function back() {} function refresh() {}
|
||||
var list = [can.page.button(can, can.user.trans(can, "goback", "返回"), function(event) { back() }), can.page.button(can, can.user.trans(can, "reload", "刷新"), function(event) { refresh() })]
|
||||
story: function(can, msg, target, PLACE_UID, PLACE_NAME) {
|
||||
msg.Table(function(value) { function goback() {} function reload() {}
|
||||
var list = [can.page.button(can, can.user.trans(can, "goback", "返回"), function(event) { goback() }), can.page.button(can, can.user.trans(can, "reload", "刷新"), function(event) { reload() })]
|
||||
var ui = can.page.Append(can, can._output, [{view: html.ACTION}])
|
||||
if (can.db.hash.length > 2 && can.db.hash[0] && can.db.hash[2]) { value.args = [can.db.hash[0], can.db.hash[2]] }
|
||||
value.style = html.OUTPUT, value.height = can.ConfHeight()-html.ACTION_HEIGHT
|
||||
can.onappend.plugin(can, value, function(sub) {
|
||||
can.onappend.plugin(can, value, function(sub) { sub.sup = can
|
||||
can.core.List(["_trans", "_icons", "_style", "_trans.input", "_trans.value"], function(key) {
|
||||
var value = sub.Conf(key); value && can.core.Item(can.Conf(key), function(k, v) { value[k] = value[k]||v })
|
||||
})
|
||||
can.onexport.title(can, sub.Conf(PLACE_NAME, msg.Option(PLACE_NAME)), value.help)
|
||||
sub.onexport.title = function(sub) { can.onexport.title.apply(can.onexport, [can].concat(can.core.List(arguments).slice(1))) }
|
||||
var run = sub.run; sub.run = function(event, cmds, cb) { run(can.request(event, {_place_name: sub.Conf(PLACE_NAME)}), cmds, cb) }
|
||||
can.page.Appends(can, ui.action, list)
|
||||
goback = function() { can.page.ClassList.add(can, can._fields, "_back")
|
||||
can.onexport.hash(can, ""), can.Option(PLACE_UID, ""), can.Option(ctx.INDEX, ""), can.Update()
|
||||
}
|
||||
reload = function() { sub.Update(), can.onmotion.delay(can, function() { can.user.toastSuccess(can, "reload") }, 300) }
|
||||
sub.onexport._output = function(_sub, msg) {
|
||||
can.core.Item(can.onimport, function(key, value) { _sub.onimport[key] = _sub.onimport[key]||value })
|
||||
can.core.Item(can.onexport, function(key, value) { _sub.onexport[key] = _sub.onexport[key]||value })
|
||||
}
|
||||
can.page.Appends(can, ui.action, list)
|
||||
back = function() { can.page.ClassList.add(can, can._fields, "_back")
|
||||
can.onexport.hash(can, ""), can.Option(PLACE_UID, ""), can.Option(ctx.INDEX, ""), can.Update()
|
||||
}
|
||||
refresh = function() { sub.Update(), can.onmotion.delay(can, function() { can.user.toastSuccess(can, "refresh") }, 300) }
|
||||
sub.onexport.output = function(_sub, msg) { can.onappend.style(sub, html.OUTPUT)
|
||||
can.page.styleHeight(can, _sub._target, can.ConfHeight() - 32)
|
||||
_sub.onimport._option = function(_sub, uid, index, place_uid) {
|
||||
@ -192,46 +187,51 @@ Volcanos(chat.ONIMPORT, {
|
||||
can.onexport.title(can, sub.Conf(PLACE_NAME), sub.ConfHelp(), msg.Option("_share_title")||"")
|
||||
can.user.agent.init(can, msg.Option("_share_content"), msg.Option("_share_icons")||value.icons)
|
||||
can.page.Appends(can, ui.action, list), msg.Option(ice.MSG_ACTION) && can.onappend._action(sub, msg.Option(ice.MSG_ACTION), ui.action, null, true)
|
||||
back = function() { can.page.ClassList.add(can, can._fields, "_back")
|
||||
if (_sub.onaction._back && _sub.onaction._back(_sub)) { return } can.Update()
|
||||
goback = function() { can.page.ClassList.add(can, can._fields, "_back")
|
||||
if (_sub.onaction._goback && _sub.onaction._goback(_sub)) { return } can.Update()
|
||||
}
|
||||
_sub.onaction._back = function(_sub) {
|
||||
_sub.onaction._goback = function(_sub) {
|
||||
if (sub.Option(UID)) {
|
||||
can.onexport.hash(can, can.Option(PLACE_UID), can.Option(ctx.INDEX)), sub.Option(UID, ""), sub.Update()
|
||||
} else {
|
||||
can.onexport.hash(can, ""), can.Option(PLACE_UID, ""), can.Option(ctx.INDEX, ""), can.Update()
|
||||
if (can.sup._back_args) {
|
||||
can.onexport.hash(can, ""), can.Option(PLACE_UID, can.sup._back_args[0]), can.Option(ctx.INDEX, ""), can.Update()
|
||||
} else {
|
||||
can.onexport.hash(can, ""), can.Option(PLACE_UID, ""), can.Option(ctx.INDEX, ""), can.Update()
|
||||
}
|
||||
}
|
||||
}
|
||||
refresh = function() {
|
||||
if (_sub.onaction._refresh) { return _sub.onaction._refresh(_sub) }
|
||||
sub.Update(), can.onmotion.delay(can, function() { can.user.toastSuccess(can, "refresh") }, 300)
|
||||
reload = function() {
|
||||
if (_sub.onaction._reload) { return _sub.onaction._reload(_sub) }
|
||||
sub.Update(), can.onmotion.delay(can, function() { can.user.toastSuccess(can, "reload") }, 300)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
plugin: function(can, value) { var action = can._root.Action
|
||||
var key = [value.space, value.index, value.args].join(".")
|
||||
var sub = action._plugins[key]
|
||||
var sup = can.sup.sup
|
||||
value.space = value.space||sup.ConfSpace()
|
||||
value.index = value.index||sup.ConfIndex()
|
||||
var key = [value.space, value.index, value.args].join(","), sub = action._plugins[key]
|
||||
if (sub) {
|
||||
can.page.SelectChild(can, action._output, html.FIELDSET_PLUGIN, function(target) { can.onmotion.toggle(can, target, target == sub._target) })
|
||||
sub.onimport.size(sub, window.innerHeight, window.innerWidth)
|
||||
can.user.title((value._title||"")+" "+sub.ConfHelp())
|
||||
sub.onimport.size(sub, window.innerHeight, window.innerWidth), can.user.title((value._title||"")+" "+sub.ConfHelp())
|
||||
return
|
||||
}
|
||||
can.misc.localStorage(can, [value.space, value.index, mdb.HASH].join(","), value.args? [value.args[0]]: "")
|
||||
var args = value.args; value.args = []; value.type = html.PLUGIN, value.style = html.OUTPUT
|
||||
var args = value.args; args && (value.args = [args[0]]); value.type = html.PLUGIN, value.style = html.OUTPUT
|
||||
can._root.Action.onappend.plugin(can._root.Action, value, function(sub) { action._plugins[key] = sub
|
||||
sub._back_args = value.args
|
||||
can.page.SelectChild(can, action._output, html.FIELDSET_PLUGIN, function(target) { can.onmotion.toggle(can, target, target == sub._target) })
|
||||
sub.onimport.size(sub, window.innerHeight, window.innerWidth)
|
||||
can.user.title((value._title||"")+" "+sub.ConfHelp())
|
||||
sub.onimport.size(sub, window.innerHeight, window.innerWidth), can.user.title((value._title||"")+" "+sub.ConfHelp())
|
||||
sub.onexport.title = function(can, title) { can.user.title(can.core.List(arguments).slice(1).join(" ")) }
|
||||
}, action._output)
|
||||
},
|
||||
float: function(can, value, cb) { value.style = html.OUTPUT
|
||||
can.onappend.plugin(can, value, function(sub) { var _back = can.onaction._back
|
||||
can.onaction._back = function() { can.onaction._back = _back, can.page.Remove(can, sub._target), can.onexport.title(can); return true }
|
||||
can.onaction._refresh = function() { sub.Update(), can.onmotion.delay(can, function() { can.user.toastSuccess(can, "refresh") }, 300) }
|
||||
can.onappend.plugin(can, value, function(sub) { var _goback = can.onaction._goback
|
||||
can.onaction._goback = function() { can.onaction._goback = _goback, can.page.Remove(can, sub._target), can.onexport.title(can); return true }
|
||||
can.onaction._reload = function() { sub.Update(), can.onmotion.delay(can, function() { can.user.toastSuccess(can, "reload") }, 300) }
|
||||
sub.onexport.output = function(_sub, msg) { can.onexport.title(can, sub.ConfHelp()+" "+msg.Option("_share_title"))
|
||||
sub.onimport.size(sub, window.innerHeight-html.ACTION_HEIGHT, window.innerWidth, false)
|
||||
}
|
||||
@ -245,12 +245,13 @@ Volcanos(chat.ONIMPORT, {
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONEXPORT, {
|
||||
value: function(can, value, PLACE_UID) {
|
||||
value: function(can, value, PLACE_UID) { if (!value) { return }
|
||||
can.sup.current = value, can.onimport.selectIndex(can, can.sup.current)
|
||||
can.onexport.session(can, PLACE_UID, value._uid), can.onexport.hash(can, value._uid)
|
||||
can.onexport.title(can, value._name, can.ConfHelp()), can.user.agent.init(can)
|
||||
can.page.Select(can, can.ui._target, "div.item.card.uid-"+value._uid, function(item) { can.onmotion.select(can, can.ui._target, html.DIV_ITEM, item) })
|
||||
can.sup.current = value, can.onimport.selectIndex(can, can.sup.current), can.onexport.title(can, value._name, can.ConfHelp())
|
||||
can.onexport.session(can, PLACE_UID, value._uid), can.onexport.hash(can, value._uid), can.user.agent.init(can)
|
||||
can.onmotion.delay(can, function() { can.onmotion.toggle(can, can.ui.myinit, !!value._init) })
|
||||
can.onmotion.toggle(can, can.ui.myallow, can.page.Select(can, can.ui.myallow, "div.item.index.role."+value._role).length > 0)
|
||||
can.ui.myallow && can.onmotion.toggle(can, can.ui.myallow, can.page.Select(can, can.ui.myallow, "div.item.index.role."+value._role).length > 0)
|
||||
can.ui.myinit && can.onmotion.delay(can, function() { can.onmotion.toggle(can, can.ui.myinit, !!value._init) })
|
||||
if (!can._index_msg || can.onmotion.cache(can, function() { return value._uid }, can.ui.myinit)) { return }
|
||||
can.ui.myinit && can.onimport.myInit(can, can._index_msg, value, can.ui.myinit)
|
||||
},
|
||||
|
@ -1,5 +1,7 @@
|
||||
{
|
||||
"portal": "用户场景", "placeCreate": "添加场景", "placeRemove": "删除场景", "scanQRCode": "扫码添加",
|
||||
"portal": "用户场景",
|
||||
"placeCreate": "创建", "placeRemove": "删除",
|
||||
"placeSearch": "搜索", "scanQRCode": "扫码",
|
||||
"qrcode": "场景码", "event": "事件流", "apply": "权限申请", "allow": "权限审批",
|
||||
"email": "邮箱配置", "member": "场景成员", "placeUser": "场景成员",
|
||||
"message": "消息待办", "recent": "最近访问", "service": "服务发现", "support": "客服支持",
|
||||
@ -36,6 +38,7 @@
|
||||
"street_name": "街道名称",
|
||||
"company_name": "公司名称",
|
||||
"city_name": "城市名称",
|
||||
"qrcode_type": "链接类型",
|
||||
"apply_status": "申请状态",
|
||||
"allow_status": "审批状态",
|
||||
"begin_time": "起始时间",
|
||||
@ -93,6 +96,10 @@
|
||||
"service_status": {
|
||||
"online": "在线"
|
||||
},
|
||||
"qrcode_type": {
|
||||
"portal": "门户首页",
|
||||
"apply": "权限申请"
|
||||
},
|
||||
"place_type": {
|
||||
"house": "住宅",
|
||||
"hotel": "宾馆",
|
||||
|
@ -10,11 +10,22 @@ type qrcode struct {
|
||||
Tables
|
||||
order string `data:"90"`
|
||||
role string `data:"creator"`
|
||||
apply string `name:"apply" role:"void"`
|
||||
}
|
||||
|
||||
func (s qrcode) List(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.UserPlace, m.Option(model.USER_UID), arg[0]).Cut(model.CITY_NAME, s.Keys(s.Street, model.NAME), s.Keys(s.Place, model.NAME))
|
||||
func (s qrcode) Apply(m *ice.Message, arg ...string) {
|
||||
s.info(m, arg[0], "apply")
|
||||
m.Option(ice.MSG_FG, "blue")
|
||||
m.EchoQRCode(s.Link(m, arg[0]))
|
||||
}
|
||||
func (s qrcode) List(m *ice.Message, arg ...string) {
|
||||
s.info(m, arg[0], "portal")
|
||||
m.EchoQRCode(m.MergePodCmd("", m.Prefix("portal"), s.Keys(s.Place, model.UID), arg[0]))
|
||||
}
|
||||
func (s qrcode) info(m *ice.Message, place_uid, typ string) {
|
||||
m.Cmdy(s.UserPlace, m.Option(model.USER_UID), place_uid).Cut(model.CITY_NAME, s.Keys(s.Street, model.NAME), s.Keys(s.Place, model.NAME))
|
||||
m.Push(model.QRCODE_TYPE, typ)
|
||||
m.Action(s.Apply)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(qrcode{Tables: newTables()}) }
|
||||
|
@ -5,13 +5,9 @@ Volcanos(chat.ONIMPORT, {
|
||||
return [
|
||||
{view: html.TITLE, list: [[args[1]].join(" "), sub? {text: ["load", "", mdb.STATUS]}: ""]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.updated_at), value.name]},
|
||||
// {view: html.STATUS, list: [value.name]},
|
||||
// {view: html.STATUS, list: [value.space]},
|
||||
// {view: html.STATUS, list: [value.index]},
|
||||
// {view: html.OUTPUT, list: [value.info]},
|
||||
]
|
||||
}, function(event, value) { var args = can.core.Split(value.args)
|
||||
can.onaction._back(can)
|
||||
can.onaction._goback(can)
|
||||
can.onimport.plugin(can, {_title: args[1], space: value.space, index: value.index, args: [args[0]]})
|
||||
})
|
||||
},
|
||||
|
28
src/gonganxitong/search.go
Normal file
28
src/gonganxitong/search.go
Normal file
@ -0,0 +1,28 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type search struct {
|
||||
Tables
|
||||
visitor string `name:"visitor" role:"void"`
|
||||
}
|
||||
|
||||
func (s search) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) < 2 {
|
||||
m.Cmdy(s.Place, s.Select).Action()
|
||||
} else if len(arg) == 2 {
|
||||
m.FieldsSetDetail().Cmdy(s.Place, s.Select, model.UID, arg[1]).Action()
|
||||
}
|
||||
m.RenameAppend(model.TYPE, s.Keys(s.Place, model.TYPE))
|
||||
s.SelectJoin(m, s.Street, model.NAME, model.CITY_UID)
|
||||
s.SelectJoinCity(m)
|
||||
m.RenameAppend(model.CREATOR, model.USER_UID)
|
||||
s.SelectJoinUser(m)
|
||||
m.Display("")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(search{Tables: newTables()}) }
|
15
src/gonganxitong/search.js
Normal file
15
src/gonganxitong/search.js
Normal file
@ -0,0 +1,15 @@
|
||||
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.name||value.title||value.user_name]},
|
||||
{view: html.STATUS, list: [value.uid && value.uid.slice(0, 6), can.base.TimeTrim(value.created_at||value.updated_at)]},
|
||||
{view: html.STATUS, list: [value.city_name, value.street_name, value.company_name]},
|
||||
{view: html.OUTPUT, list: [value.info||value.content]},
|
||||
]
|
||||
}, function(event, value) {
|
||||
// can.onaction._goback(can)
|
||||
can.onimport.plugin(can, {args: [value.uid]})
|
||||
})
|
||||
},
|
||||
})
|
@ -7,7 +7,7 @@ Volcanos(chat.ONIMPORT, {
|
||||
{view: html.STATUS, list: [value.module, value.version]},
|
||||
{view: html.STATUS, list: [value.domain.split("?")[0]]},
|
||||
] }, function(event, value) {
|
||||
can.onaction._back(can)
|
||||
can.onaction._goback(can)
|
||||
can.onimport.plugin(can, {space: value.space||value.nodename, index: value.index})
|
||||
})
|
||||
},
|
||||
|
@ -1,7 +1,5 @@
|
||||
{
|
||||
"portal": "活动组织",
|
||||
"placeCreate": "创建组织",
|
||||
"placeRemove": "删除组织",
|
||||
"activity": "活动安排",
|
||||
"member": "组织成员",
|
||||
"icons": {
|
||||
|
@ -19,8 +19,8 @@ type call struct {
|
||||
func (s call) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 1 {
|
||||
m.Option(mdb.ORDER, model.TAKE_TIME)
|
||||
s.Schedule.SelectByStatus(m, arg[0], kit.Format(ScheduleTake))
|
||||
kit.If(m.Length() == 0, func() { m.Echo(m.Trans("not found order", "没有等待")) }, func() { m.Action(s.Call) })
|
||||
s.SelectByStatus(m, arg[0], kit.Format(ScheduleTake))
|
||||
kit.If(m.Length() == 0, func() { m.Echo(m.Trans("wait take", "等待取号")) }, func() { m.Action(s.Call) })
|
||||
} else if len(arg) == 2 {
|
||||
m.Cmdy(s.Schedule, arg[0], arg[1]).Action(s.Call)
|
||||
} else if len(arg) == 3 {
|
||||
|
@ -22,6 +22,7 @@ const (
|
||||
SCHEDULE_UID = "schedule_uid"
|
||||
SCHEDULE_STATUS = "schedule_status"
|
||||
COMPANY_UID = "company_uid"
|
||||
CALL_UID = "call_uid"
|
||||
BEGIN_TIME = "begin_time"
|
||||
END_TIME = "end_time"
|
||||
CANCEL_TIME = "cancel_time"
|
||||
@ -71,6 +72,7 @@ type Schedule struct {
|
||||
ReceptionUID string `gorm:"type:char(32);index:idx_queue"`
|
||||
VolumeUID string `gorm:"type:char(32);index:idx_queue"`
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
CallUID string `gorm:"type:char(32);index"`
|
||||
CancelTime db.Time
|
||||
TakeTime db.Time
|
||||
CallTime db.Time
|
||||
|
@ -14,15 +14,15 @@ type plan struct {
|
||||
}
|
||||
|
||||
func (s plan) Create(m *ice.Message, arg ...string) {
|
||||
s.Create(m, kit.Simple(arg, m.OptionSimple(model.QUEUE_UID, model.USER_UID), model.STATUS, SchedulePlan)...)
|
||||
s.Schedule.Create(m, kit.Simple(arg, m.OptionSimple(model.QUEUE_UID, model.USER_UID), model.STATUS, SchedulePlan)...)
|
||||
}
|
||||
func (s plan) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 1 {
|
||||
s.Schedule.SelectByStatus(m, kit.Simple(arg[0], SchedulePlan, m.OptionSimple(model.USER_UID))...).PushAction(s.Cancel)
|
||||
s.SelectByStatus(m, kit.Simple(arg[0], SchedulePlan, m.OptionSimple(model.USER_UID))...).PushAction(s.Cancel)
|
||||
kit.If(m.Length() == 0, func() { m.EchoInfoButton("", s.Create) }, func() { m.Action(s.Create) })
|
||||
} else if len(arg) == 2 {
|
||||
m.FieldsSetDetail()
|
||||
s.Schedule.SelectByStatus(m, kit.Simple(arg[0], SchedulePlan, m.OptionSimple(model.USER_UID), s.Key(s.Schedule, model.UID), arg[1])...).PushAction(s.Cancel)
|
||||
s.SelectByStatus(m, kit.Simple(arg[0], SchedulePlan, m.OptionSimple(model.USER_UID), s.Key(s.Schedule, model.UID), arg[1])...).PushAction(s.Cancel)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
{
|
||||
"portal": "约号系统",
|
||||
"placeCreate": "创建场景",
|
||||
"placeRemove": "删除场景",
|
||||
"queueUser": "服务人员",
|
||||
"reception": "服务场所",
|
||||
"volume": "服务计划",
|
||||
@ -37,6 +35,9 @@
|
||||
"reception_name": "服务场所",
|
||||
"volume_uid": "服务计划",
|
||||
"schedule_status": "订单状态",
|
||||
"begin_time": "开始时间",
|
||||
"end_time": "结束时间",
|
||||
"cancel_time": "取消时间",
|
||||
"take_time": "取号时间",
|
||||
"call_time": "叫号时间",
|
||||
"expire_time": "过期时间",
|
||||
|
@ -2,6 +2,7 @@ package yuehaoxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/yuehaoxitong/model"
|
||||
)
|
||||
@ -33,6 +34,7 @@ func (s reception) List(m *ice.Message, arg ...string) {
|
||||
}
|
||||
} else if len(arg) == 1 {
|
||||
s.Table.Select(m, model.QUEUE_UID, arg[0])
|
||||
kit.If(!m.IsErr() && m.Length() == 0, func() { m.EchoInfoButton("") })
|
||||
} else if len(arg) == 2 {
|
||||
s.Table.SelectDetail(m, model.QUEUE_UID, arg[0], model.UID, arg[1])
|
||||
}
|
||||
|
@ -28,18 +28,24 @@ func (s Schedule) Create(m *ice.Message, arg ...string) {
|
||||
s.addCount(m, mdb.COUNT, "1")
|
||||
s.Table.Create(m, arg...)
|
||||
})
|
||||
s.SendMessage(m, m.Option(model.USER_UID), m.Option(model.USER_UID), m.Option(model.QUEUE_UID), m.Result())
|
||||
s.sendTemplate(m, "约号成功", m.Result())
|
||||
}
|
||||
func (s Schedule) Call(m *ice.Message, arg ...string) {
|
||||
defer m.ToastProcess("叫号中...")("叫号成功")
|
||||
s.Orders(m, model.TAKE_TIME).Limit(m, 1)
|
||||
s.SelectByStatus(m, m.Option(model.QUEUE_UID), kit.Format(ScheduleTake)).PushAction(s.Expire, s.Finish)
|
||||
// s.Select(m, kit.Simple(m.OptionSimple(model.QUEUE_UID, model.RECEPTION_UID), mdb.STATUS, ScheduleTake)...)
|
||||
user_uid := m.Option(model.USER_UID)
|
||||
if m.Option(model.RECEPTION_UID) != "" {
|
||||
s.SelectByStatus(m, kit.Simple(m.Option(model.QUEUE_UID), kit.Format(ScheduleTake), m.OptionSimple(model.RECEPTION_UID))...).PushAction(s.Expire, s.Finish)
|
||||
} else {
|
||||
s.SelectByStatus(m, m.Option(model.QUEUE_UID), kit.Format(ScheduleTake)).PushAction(s.Expire, s.Finish)
|
||||
}
|
||||
if m.Length() == 0 {
|
||||
m.ProcessRewrite(model.UID, "")
|
||||
return
|
||||
}
|
||||
s.changeStatus(m, ScheduleTake, ScheduleCall, arg...)
|
||||
s.changeStatus(m, ScheduleTake, ScheduleCall, model.CALL_UID, user_uid)
|
||||
s.SendMessage(m, user_uid, m.Append(model.USER_UID), m.Option(model.QUEUE_UID), m.Append(model.UID))
|
||||
s.sendTemplate(m, "服务已叫号", m.Append(model.UID))
|
||||
m.ProcessRewrite(model.UID, m.Append(model.UID))
|
||||
}
|
||||
@ -47,7 +53,7 @@ func (s Schedule) List(m *ice.Message, arg ...string) {
|
||||
role := UserQueueRole(kit.Int(m.Cmd(s.userQueue, s.Select, m.OptionSimple(model.QUEUE_UID, model.USER_UID)).Append(model.ROLE)))
|
||||
s.Tables(m, s.volume).FieldsWithCreatedAT(m, s, model.SCHEDULE_STATUS, model.BEGIN_TIME, model.END_TIME,
|
||||
model.CANCEL_TIME, model.TAKE_TIME, model.CALL_TIME, model.EXPIRE_TIME, model.FINISH_TIME,
|
||||
s.Key(s, model.OPERATOR), s.Key(s, model.RECEPTION_UID), model.USER_UID, model.VOLUME_UID,
|
||||
s.Key(s, model.CALL_UID), s.Key(s, model.RECEPTION_UID), model.USER_UID, model.VOLUME_UID,
|
||||
)
|
||||
if role == UserQueueCreator || role == UserQueueManager {
|
||||
if len(arg) == 1 {
|
||||
@ -67,9 +73,9 @@ func (s Schedule) List(m *ice.Message, arg ...string) {
|
||||
})
|
||||
} else if role == UserQueueWorker {
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, s.Key(s, model.QUEUE_UID), arg[0], s.Key(s, model.OPERATOR), m.Option(model.USER_UID))
|
||||
s.Select(m, s.Key(s, model.QUEUE_UID), arg[0], model.CALL_UID, m.Option(model.USER_UID))
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, s.Key(s, model.QUEUE_UID), arg[0], s.Key(s, model.OPERATOR), m.Option(model.USER_UID), s.Key(s, model.UID), arg[1])
|
||||
s.SelectDetail(m, s.Key(s, model.QUEUE_UID), arg[0], model.CALL_UID, m.Option(model.USER_UID), s.Key(s, model.UID), arg[1])
|
||||
}
|
||||
m.Table(func(value ice.Maps) {
|
||||
switch ScheduleStatus(kit.Int(value[model.SCHEDULE_STATUS])) {
|
||||
@ -96,7 +102,7 @@ func (s Schedule) List(m *ice.Message, arg ...string) {
|
||||
}
|
||||
s.SelectJoin(m, s.reception)
|
||||
s.SelectJoinUser(m)
|
||||
s.RewriteAppend(m)
|
||||
m.Display("")
|
||||
m.Action()
|
||||
}
|
||||
func (s Schedule) SelectByStatus(m *ice.Message, arg ...string) *ice.Message {
|
||||
@ -109,49 +115,59 @@ func (s Schedule) SelectByStatus(m *ice.Message, arg ...string) *ice.Message {
|
||||
s.Select(m, kit.Simple(s.Key(s, model.QUEUE_UID), arg[0], model.STATUS, arg[1], arg[2:])...).Action()
|
||||
s.SelectJoin(m, s.reception)
|
||||
s.SelectJoinUser(m)
|
||||
s.RewriteAppend(m)
|
||||
m.Display("")
|
||||
return m
|
||||
}
|
||||
func (s Schedule) Cancel(m *ice.Message, arg ...string) {
|
||||
defer m.ToastProcess("取消中...")("取消成功")
|
||||
if m.WarnNotFound(s.Select(m, m.OptionSimple(model.UID, model.USER_UID)...).Length() == 0) {
|
||||
args := m.OptionSimple(model.USER_UID, model.UID)
|
||||
if m.WarnNotFound(s.Select(m, args...).Length() == 0) {
|
||||
return
|
||||
}
|
||||
s.Transaction(m, func() {
|
||||
s.addCount(m, mdb.COUNT, "-1")
|
||||
s.changeStatus(m, SchedulePlan, ScheduleCancel, arg...)
|
||||
s.changeStatus(m, SchedulePlan, ScheduleCancel)
|
||||
})
|
||||
s.sendTemplate(m, "约号取消")
|
||||
m.ProcessRefresh()
|
||||
}
|
||||
func (s Schedule) Take(m *ice.Message, arg ...string) {
|
||||
defer m.ToastProcess("取号中...")("取号成功")
|
||||
if m.WarnNotFound(s.Select(m, m.OptionSimple(model.UID, model.USER_UID)...).Length() == 0) {
|
||||
args := m.OptionSimple(model.USER_UID, model.UID)
|
||||
if m.WarnNotFound(s.Select(m, args...).Length() == 0) {
|
||||
return
|
||||
}
|
||||
s.changeStatus(m, SchedulePlan, ScheduleTake, arg...)
|
||||
s.changeStatus(m, SchedulePlan, ScheduleTake)
|
||||
s.sendTemplate(m, "取号成功")
|
||||
m.ProcessRefresh()
|
||||
}
|
||||
func (s Schedule) Expire(m *ice.Message, arg ...string) {
|
||||
defer m.ToastProcess("过号中...")("过号成功")
|
||||
args := kit.Simple(model.CALL_UID, m.Option(model.USER_UID), m.OptionSimple(model.UID))
|
||||
if m.WarnNotFound(s.Select(m, args...).Length() == 0) {
|
||||
return
|
||||
}
|
||||
s.Transaction(m, func() {
|
||||
s.addCount(m, "", "1")
|
||||
s.changeStatus(m, ScheduleCall, ScheduleExpire, arg...)
|
||||
s.changeStatus(m, ScheduleCall, ScheduleExpire)
|
||||
})
|
||||
s.Select(m.FieldsSetDetail(), model.UID, m.Option(model.UID))
|
||||
s.Select(m.FieldsSetDetail(), args...)
|
||||
s.sendTemplate(m, "服务已过号")
|
||||
m.ProcessRefresh()
|
||||
// m.ProcessRefresh()
|
||||
}
|
||||
func (s Schedule) Finish(m *ice.Message, arg ...string) {
|
||||
defer m.ToastProcess("完成中...")("完成成功")
|
||||
args := kit.Simple(model.CALL_UID, m.Option(model.USER_UID), m.OptionSimple(model.UID))
|
||||
if m.WarnNotFound(s.Select(m, args...).Length() == 0) {
|
||||
return
|
||||
}
|
||||
s.Transaction(m, func() {
|
||||
s.addCount(m, "", "1")
|
||||
s.changeStatus(m, ScheduleCall, ScheduleFinish, arg...)
|
||||
s.changeStatus(m, ScheduleCall, ScheduleFinish)
|
||||
})
|
||||
s.Select(m.FieldsSetDetail(), model.UID, m.Option(model.UID))
|
||||
s.Select(m.FieldsSetDetail(), args...)
|
||||
s.sendTemplate(m, "服务已完成")
|
||||
m.ProcessRefresh()
|
||||
// m.ProcessRefresh()
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(Schedule{}) }
|
||||
@ -161,7 +177,7 @@ func (s Schedule) addCount(m *ice.Message, key, count string) {
|
||||
}
|
||||
func (s Schedule) changeStatus(m *ice.Message, from, to ScheduleStatus, arg ...string) *ice.Message {
|
||||
key := m.ActionKey() + "_time"
|
||||
s.Table.ChangeStatus(m, m.Option(model.UID), int(from), int(to), kit.TransArgValueTime(append(arg, key, m.Time()), key)...)
|
||||
s.Table.ChangeStatus(m, m.Option(model.UID), int(from), int(to), append(arg, key, m.Time())...)
|
||||
return m
|
||||
}
|
||||
func (s Schedule) sendTemplate(m *ice.Message, title string, arg ...string) *ice.Message {
|
||||
|
@ -14,11 +14,11 @@ type take struct {
|
||||
|
||||
func (s take) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 1 {
|
||||
s.Schedule.SelectByStatus(m, kit.Simple(arg[0], SchedulePlan, m.OptionSimple(model.USER_UID))...).PushAction(s.Take)
|
||||
s.SelectByStatus(m, kit.Simple(arg[0], SchedulePlan, m.OptionSimple(model.USER_UID))...).PushAction(s.Take)
|
||||
kit.If(m.Length() == 0, func() { m.Echo(m.Trans("not found plan", "没有未取的号")) })
|
||||
} else if len(arg) == 2 {
|
||||
m.FieldsSetDetail()
|
||||
s.Schedule.SelectByStatus(m, kit.Simple(arg[0], SchedulePlan, m.OptionSimple(model.USER_UID), s.Key(s.Schedule, model.UID), arg[1])...).PushAction(s.Take)
|
||||
s.SelectByStatus(m, kit.Simple(arg[0], SchedulePlan, m.OptionSimple(model.USER_UID), s.Key(s.Schedule, model.UID), arg[1])...).PushAction(s.Take)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ 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])
|
||||
s.SelectDetail(m, model.USER_UID, arg[0], model.QUEUE_UID, arg[1])
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
@ -23,6 +23,18 @@
|
||||
"type": "view"
|
||||
}
|
||||
},
|
||||
"69eab73272862fc0b0202533c8ea58a0": {
|
||||
"meta": {
|
||||
"index": "web.team.zhengshuxitong.portal",
|
||||
"name": "证书系统",
|
||||
"river": "2",
|
||||
"scene": "main",
|
||||
"space": "20240724-education",
|
||||
"storm": "6",
|
||||
"time": "2024-08-28 10:08:56.342",
|
||||
"type": "view"
|
||||
}
|
||||
},
|
||||
"6c428f2a2570bcb73784536c11cb90a1": {
|
||||
"meta": {
|
||||
"name": "云社区",
|
||||
@ -45,15 +57,27 @@
|
||||
"type": "view"
|
||||
}
|
||||
},
|
||||
"7ea8d32a7a9cfe236d406e43392b0ddd": {
|
||||
"meta": {
|
||||
"index": "web.team.jiaocaiziliao.portal",
|
||||
"name": "教材资料",
|
||||
"river": "2",
|
||||
"scene": "main",
|
||||
"space": "20240724-education",
|
||||
"storm": "3",
|
||||
"time": "2024-08-28 10:06:47.277",
|
||||
"type": "view"
|
||||
}
|
||||
},
|
||||
"8b52c29cfbb4b823d4687022a143ba9e": {
|
||||
"meta": {
|
||||
"index": "web.team.operation.portal",
|
||||
"name": "系统运维",
|
||||
"index": "web.team.shichangyingxiao.portal",
|
||||
"name": "市场营销",
|
||||
"river": "3",
|
||||
"scene": "main",
|
||||
"space": "20240724-enterprise",
|
||||
"storm": "5",
|
||||
"time": "2024-08-27 19:02:46.713",
|
||||
"storm": "3",
|
||||
"time": "2024-08-28 10:29:27.373",
|
||||
"type": "view"
|
||||
}
|
||||
},
|
||||
@ -79,15 +103,39 @@
|
||||
"type": "view"
|
||||
}
|
||||
},
|
||||
"b736946fef122e25ade814a489b891f4": {
|
||||
"meta": {
|
||||
"index": "web.team.kaoshixitong.portal",
|
||||
"name": "考试系统",
|
||||
"river": "2",
|
||||
"scene": "main",
|
||||
"space": "20240724-education",
|
||||
"storm": "5",
|
||||
"time": "2024-08-28 10:08:25.805",
|
||||
"type": "view"
|
||||
}
|
||||
},
|
||||
"dc6bc74090f4baee2a44547c00168326": {
|
||||
"meta": {
|
||||
"index": "web.team.development.portal",
|
||||
"name": "系统开发",
|
||||
"index": "web.team.zijinlian.portal",
|
||||
"name": "资金链",
|
||||
"river": "3",
|
||||
"scene": "main",
|
||||
"space": "20240724-enterprise",
|
||||
"storm": "5",
|
||||
"time": "2024-08-28 10:27:24.360",
|
||||
"type": "view"
|
||||
}
|
||||
},
|
||||
"dd0ee46421005876f5745a0f68fe1218": {
|
||||
"meta": {
|
||||
"index": "web.team.zaixianketang.portal",
|
||||
"name": "在线课堂",
|
||||
"river": "2",
|
||||
"scene": "main",
|
||||
"space": "20240724-education",
|
||||
"storm": "4",
|
||||
"time": "2024-08-27 19:02:18.982",
|
||||
"time": "2024-08-28 10:07:46.050",
|
||||
"type": "view"
|
||||
}
|
||||
},
|
||||
@ -98,7 +146,7 @@
|
||||
"river": "3",
|
||||
"scene": "main",
|
||||
"space": "20240724-enterprise",
|
||||
"storm": "3",
|
||||
"storm": "4",
|
||||
"time": "2024-08-16 12:47:08.340",
|
||||
"type": "view"
|
||||
}
|
||||
|
@ -8,8 +8,7 @@
|
||||
"icons": "https://img.icons8.com/officel/80/receipt.png",
|
||||
"index": "web.team.yuehaoxitong.take",
|
||||
"name": "取号",
|
||||
"order": "13",
|
||||
"role": "creator,visitor,waiter",
|
||||
"order": "12",
|
||||
"time": "2024-08-11 09:30:00.532"
|
||||
}
|
||||
},
|
||||
@ -23,7 +22,7 @@
|
||||
"index": "web.team.yuehaoxitong.reception",
|
||||
"init": "1",
|
||||
"name": "服务场所",
|
||||
"order": "23",
|
||||
"order": "20",
|
||||
"role": "creator,manager",
|
||||
"time": "2024-08-11 09:30:00.536"
|
||||
}
|
||||
@ -62,7 +61,7 @@
|
||||
"index": "web.team.yuehaoxitong.allow",
|
||||
"name": "权限审批",
|
||||
"order": "93",
|
||||
"role": "creator",
|
||||
"role": "creator,manager",
|
||||
"time": "2024-08-16 10:29:53.817"
|
||||
}
|
||||
},
|
||||
@ -75,8 +74,8 @@
|
||||
"icons": "https://img.icons8.com/officel/80/calling.png",
|
||||
"index": "web.team.yuehaoxitong.call",
|
||||
"name": "叫号",
|
||||
"order": "14",
|
||||
"role": "creator,worker",
|
||||
"order": "13",
|
||||
"role": "creator,manager,worker",
|
||||
"time": "2024-08-11 09:30:00.541"
|
||||
}
|
||||
},
|
||||
@ -150,8 +149,9 @@
|
||||
"enable": "true",
|
||||
"icons": "https://img.icons8.com/officel/80/open-sign.png",
|
||||
"index": "web.team.yuehaoxitong.open",
|
||||
"init": "2",
|
||||
"name": "放号",
|
||||
"order": "11",
|
||||
"order": "10",
|
||||
"role": "creator,manager",
|
||||
"time": "2024-08-11 09:30:00.511"
|
||||
}
|
||||
@ -165,8 +165,7 @@
|
||||
"icons": "https://img.icons8.com/officel/80/order-history.png",
|
||||
"index": "web.team.yuehaoxitong.history",
|
||||
"name": "我的订单",
|
||||
"order": "20",
|
||||
"role": "creator,worker,visitor,waiter",
|
||||
"order": "23",
|
||||
"time": "2024-08-11 09:30:00.544"
|
||||
}
|
||||
},
|
||||
@ -180,6 +179,7 @@
|
||||
"index": "web.team.yuehaoxitong.member",
|
||||
"name": "场景成员",
|
||||
"order": "80",
|
||||
"role": "creator,manager",
|
||||
"time": "2024-08-12 08:56:10.816"
|
||||
}
|
||||
},
|
||||
@ -193,7 +193,6 @@
|
||||
"index": "web.team.yuehaoxitong.service",
|
||||
"name": "服务发现",
|
||||
"order": "102",
|
||||
"role": "creator",
|
||||
"time": "2024-08-11 09:30:00.529"
|
||||
}
|
||||
},
|
||||
@ -206,8 +205,7 @@
|
||||
"icons": "https://img.icons8.com/officel/80/calendar-plus.png",
|
||||
"index": "web.team.yuehaoxitong.plan",
|
||||
"name": "约号",
|
||||
"order": "12",
|
||||
"role": "creator,visitor,waiter",
|
||||
"order": "11",
|
||||
"time": "2024-08-11 09:30:00.514"
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user