diff --git a/src/gonganxitong/common.go b/src/gonganxitong/common.go index e6ad910..ff22d25 100644 --- a/src/gonganxitong/common.go +++ b/src/gonganxitong/common.go @@ -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() diff --git a/src/gonganxitong/portal.js b/src/gonganxitong/portal.js index 466013f..b50e10f 100644 --- a/src/gonganxitong/portal.js +++ b/src/gonganxitong/portal.js @@ -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) { diff --git a/src/gonganxitong/template/homework.js b/src/gonganxitong/template/homework.js index 72f557b..158e0d4 100644 --- a/src/gonganxitong/template/homework.js +++ b/src/gonganxitong/template/homework.js @@ -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]}, ] }) }, diff --git a/src/huodongzuzhi/activity.js b/src/huodongzuzhi/activity.js index 5228c29..b7ff53c 100644 --- a/src/huodongzuzhi/activity.js +++ b/src/huodongzuzhi/activity.js @@ -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]}, ] }) }, diff --git a/src/huodongzuzhi/portal.json b/src/huodongzuzhi/portal.json index 5479447..40c152c 100644 --- a/src/huodongzuzhi/portal.json +++ b/src/huodongzuzhi/portal.json @@ -21,7 +21,8 @@ "worker": "成员", "server": "服务人员", "style": { - "creator": "danger" + "creator": "danger", + "leader": "danger" } }, "group_type": { diff --git a/src/yuehaoxitong/model/model.go b/src/yuehaoxitong/model/model.go index 4ea4bc9..6704a99 100644 --- a/src/yuehaoxitong/model/model.go +++ b/src/yuehaoxitong/model/model.go @@ -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{}) } diff --git a/src/yuehaoxitong/userQueue.go b/src/yuehaoxitong/userQueue.go index d951fb3..94180da 100644 --- a/src/yuehaoxitong/userQueue.go +++ b/src/yuehaoxitong/userQueue.go @@ -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]) diff --git a/usr/local/export/web.chat.wx.menu/hash.json b/usr/local/export/web.chat.wx.menu/hash.json index a66602e..f608bcd 100644 --- a/usr/local/export/web.chat.wx.menu/hash.json +++ b/usr/local/export/web.chat.wx.menu/hash.json @@ -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" diff --git a/usr/local/export/web.team.huodongzuzhi.portal/hash.json b/usr/local/export/web.team.huodongzuzhi.portal/hash.json index fdb152e..24cb060 100644 --- a/usr/local/export/web.team.huodongzuzhi.portal/hash.json +++ b/usr/local/export/web.team.huodongzuzhi.portal/hash.json @@ -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" } }, diff --git a/usr/local/export/web.team.yuehaoxitong.portal/hash.json b/usr/local/export/web.team.yuehaoxitong.portal/hash.json index 1fb7bcf..0d5bffb 100644 --- a/usr/local/export/web.team.yuehaoxitong.portal/hash.json +++ b/usr/local/export/web.team.yuehaoxitong.portal/hash.json @@ -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" }