This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-08-27 23:05:09 +08:00
parent e7ff16b0b4
commit 494cd55393
10 changed files with 87 additions and 56 deletions

View File

@ -3,6 +3,7 @@ package gonganxitong
import (
"path"
"reflect"
"strconv"
"shylinux.com/x/ice"
icebergs "shylinux.com/x/icebergs"
@ -67,6 +68,19 @@ func (s Table) InputsList(m *ice.Message, list ice.Any, arg ...string) {
}
m.SortInt(arg[0]).DisplayInputKeyNameIconTitle()
}
func (s Table) InputsListValue(m *ice.Message, list ice.Any, key string) string {
k, e := strconv.ParseInt(key, 10, 64)
if e != nil {
return key
}
it := reflect.ValueOf(list).MapRange()
for it.Next() {
if it.Key().Int() == k {
return it.Value().String()
}
}
return ""
}
func (s Table) InputsListRole(m *ice.Message, list ice.Any, arg ...string) {
it := reflect.ValueOf(list).MapRange()
for it.Next() {
@ -126,6 +140,9 @@ func (s Table) RenameAppend(m *ice.Message, arg ...string) Table {
}
func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
m.RewriteAppend(func(value, key string, index int) string {
if _, e := strconv.ParseInt(value, 10, 64); e != nil {
return value
}
switch key {
case model.USER_PLACE_ROLE:
value = UserPlaceRole(kit.Int(value)).String()
@ -179,8 +196,16 @@ func (s Table) RecordEvent(m *ice.Message, place_uid, info string, arg ...string
}
func (s Table) RecordEventWithName(m *ice.Message, place_uid, info string, arg ...string) {
uid := kit.Select(m.Result(), m.Option(model.UID))
kit.If(info == "", func() { info = m.ActionCmdTitle() })
s.RecordEvent(m, place_uid, kit.JoinWord(info, kit.Cut(uid, 6), m.Option(model.NAME)), uid)
kit.If(info == "", func() {
info = m.ActionCmdTitle()
switch m.ActionKey() {
case mdb.CREATE:
info = "✅ " + info
case mdb.REMOVE:
info = "❌ " + info
}
})
s.RecordEvent(m, place_uid, kit.JoinWord(info, kit.Cut(uid, 6), kit.Select(m.Option(model.TITLE), m.Option(model.NAME))), uid)
}
func (s Table) AddRecent(m *ice.Message, arg ...string) {
cmd := m.GetCommand()

View File

@ -6,11 +6,8 @@ Volcanos(chat.ONIMPORT, {
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)
},
layout: function(can) {
can.ui.action && can.ui.output && can.onmotion.delay(can, function() {
can.page.style(can, can.ui.output, html.HEIGHT, can.ConfHeight() - can.ui.action.offsetHeight)
})
},
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]]},
@ -67,22 +64,6 @@ Volcanos(chat.ONIMPORT, {
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}])
},
myInit: function(can, msg, value, target) { if (!msg) { return }
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) }
})
}
}, target)
}
})
},
myPlace: function(can, msg, target, PLACE_UID, PLACE_NAME, PLACE_TYPE) { var place_uid
can.page.Append(can, target, [{view: html.TITLE, list: [
{text: can.user.trans(can, "My "+can.base.capital(PLACE_NAME.replace("_name", "")), null, html.INPUT)},
@ -106,6 +87,22 @@ Volcanos(chat.ONIMPORT, {
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.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) }
})
}
}, target)
}
})
},
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)
can.page.Append(can, target, msg.Table(function(value) { if (value.order < 100 && value.enable != ice.TRUE) { return }
@ -241,9 +238,11 @@ Volcanos(chat.ONIMPORT, {
cb && cb(sub)
})
},
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])||"" },
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])||""]]} },
layout: function(can) {
can.ui.action && can.ui.output && can.onmotion.delay(can, function() {
can.page.style(can, can.ui.output, html.HEIGHT, can.ConfHeight() - can.ui.action.offsetHeight)
})
},
})
Volcanos(chat.ONEXPORT, {
value: function(can, value, PLACE_UID) {

View File

@ -2,10 +2,7 @@ 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.title]},
{view: html.STATUS, list: [
value.uid.slice(0, 6), can.base.TimeTrim(value.created_at),
value.user_name, can.onimport.textView(can, value, "user_{{.Option "class"}}_role", aaa.ROLE),
]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]},
{view: html.OUTPUT, list: [value.content]},
] })
},

View File

@ -2,10 +2,7 @@ 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.title]},
{view: html.STATUS, list: [
value.uid.slice(0, 6), can.base.TimeTrim(value.created_at),
value.user_name, can.onimport.textView(can, value, "user_group_role", aaa.ROLE),
]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]},
{view: html.OUTPUT, list: [value.content]},
] })
},

View File

@ -21,7 +21,8 @@
"worker": "成员",
"server": "服务人员",
"style": {
"creator": "danger"
"creator": "danger",
"leader": "danger"
}
},
"group_type": {

View File

@ -33,19 +33,21 @@ const (
COUNT = "count"
EXPIRE = "expire"
FINISH = "finish"
INIT = "init"
)
type UserQueue struct {
db.ModelWithUID
UserUID string `gorm:"type:char(32);index"`
QueueUID string `gorm:"type:char(32);index"`
Role uint8
Role uint8 `gorm:"default:0"`
Init uint8 `gorm:"default:0"`
}
type Queue struct {
db.ModelWithUID
CompanyUID string `gorm:"type:char(32);index"`
Name string `gorm:"type:varchar(64)"`
Type uint8
Type uint8 `gorm:"default:0"`
}
type Reception struct {
db.ModelWithUID
@ -74,7 +76,7 @@ type Schedule struct {
CallTime db.Time
ExpireTime db.Time
FinishTime db.Time
Status uint8
Status uint8 `gorm:"default:0"`
}
func init() { db.CmdModels("", &UserQueue{}, &Queue{}, &Reception{}, Volume{}, &Schedule{}) }

View File

@ -27,6 +27,7 @@ func (s userQueue) List(m *ice.Message, arg ...string) {
s.Tables(m, s.queue).FieldsWithCreatedAT(m, s,
model.QUEUE_NAME, model.QUEUE_TYPE, model.USER_QUEUE_ROLE,
model.COMPANY_UID, model.QUEUE_UID,
model.INIT,
)
if len(arg) == 1 {
s.Select(m, model.USER_UID, arg[0])

View File

@ -1,4 +1,16 @@
{
"1acab83a5952361da7a970ce996e9a5b": {
"meta": {
"index": "web.team.jiaowuxitong.portal",
"name": "教务系统",
"river": "2",
"scene": "main",
"space": "20240724-education",
"storm": "2",
"time": "2024-08-27 22:18:56.908",
"type": "view"
}
},
"40ba2f5011f0b96119fcd3cc0063d407": {
"meta": {
"index": "web.team.gonganxitong.portal",
@ -28,7 +40,7 @@
"river": "1",
"scene": "main",
"space": "20240724-community",
"storm": "3",
"storm": "4",
"time": "2024-08-09 07:16:47.915",
"type": "view"
}
@ -47,14 +59,12 @@
},
"95f6dcca421c62f3ecdc502291e414eb": {
"meta": {
"index": "web.team.jiaowuxitong.portal",
"name": "云教育",
"river": "2",
"scene": "main",
"space": "20240724-education",
"storm": "1",
"time": "2024-08-09 07:15:11.790",
"type": "view"
"time": "2024-08-27 22:18:23.129",
"type": "click"
}
},
"ad3c49c1bd59eaf07b2b98a703cd839c": {
@ -100,18 +110,16 @@
"river": "1",
"scene": "main",
"space": "20240724-community",
"storm": "4",
"storm": "3",
"time": "2024-08-27 19:01:26.564",
"type": "view"
}
},
"f66067639088a9bba8ca15024752c221": {
"meta": {
"index": "web.team.guanlixitong.portal",
"name": "云办公",
"river": "3",
"scene": "main",
"space": "20240724-enterprise",
"storm": "1",
"time": "2024-08-09 07:15:35.626",
"type": "click"

View File

@ -36,7 +36,7 @@
"index": "web.team.huodongzuzhi.event",
"name": "事件流",
"order": "91",
"role": "creator",
"role": "creator,leader",
"time": "2024-08-25 12:53:13.203"
}
},
@ -67,7 +67,7 @@
"index": "web.team.huodongzuzhi.apply",
"name": "权限申请",
"order": "92",
"role": "creator",
"role": "creator,leader",
"time": "2024-08-25 12:53:13.212"
}
},
@ -78,7 +78,7 @@
"index": "web.team.huodongzuzhi.qrcode",
"name": "场景码",
"order": "90",
"role": "creator",
"role": "creator,leader",
"time": "2024-08-25 12:53:13.189"
}
},
@ -89,7 +89,7 @@
"index": "web.team.huodongzuzhi.allow",
"name": "权限审批",
"order": "93",
"role": "creator",
"role": "creator,leader",
"time": "2024-08-25 12:53:13.191"
}
},

View File

@ -21,8 +21,9 @@
"enable": "true",
"icons": "https://img.icons8.com/officel/80/meeting-room.png",
"index": "web.team.yuehaoxitong.reception",
"init": "1",
"name": "服务场所",
"order": "10",
"order": "23",
"role": "creator,manager",
"time": "2024-08-11 09:30:00.536"
}
@ -46,7 +47,7 @@
"icons": "https://img.icons8.com/officel/80/qr-code.png",
"index": "web.team.yuehaoxitong.qrcode",
"name": "场景码",
"order": "1",
"order": "90",
"role": "creator,manager",
"time": "2024-08-11 09:30:00.550"
}
@ -60,7 +61,7 @@
"icons": "https://img.icons8.com/officel/80/receipt-approved.png",
"index": "web.team.yuehaoxitong.allow",
"name": "权限审批",
"order": "4",
"order": "93",
"role": "creator",
"time": "2024-08-16 10:29:53.817"
}
@ -112,7 +113,7 @@
"icons": "https://img.icons8.com/officel/80/edit-property.png",
"index": "web.team.yuehaoxitong.apply",
"name": "权限申请",
"order": "3",
"order": "92",
"role": "creator,manager",
"time": "2024-08-11 09:30:00.552"
}
@ -178,7 +179,7 @@
"icons": "https://img.icons8.com/officel/80/person-at-home.png",
"index": "web.team.yuehaoxitong.member",
"name": "场景成员",
"order": "5",
"order": "80",
"time": "2024-08-12 08:56:10.816"
}
},
@ -219,7 +220,7 @@
"icons": "https://img.icons8.com/officel/80/property-with-timer.png",
"index": "web.team.yuehaoxitong.event",
"name": "事件流",
"order": "2",
"order": "91",
"role": "creator,manager",
"time": "2024-08-11 09:30:00.518"
}