From 88f7e6f13c1a3c2c0039073d050b1e8617340d3c Mon Sep 17 00:00:00 2001 From: shy Date: Tue, 19 Nov 2024 09:32:14 +0800 Subject: [PATCH] add some --- src/main.go | 2 +- src/renzhengshouquan/admin.css | 6 ++++ src/renzhengshouquan/admin.go | 31 ++++++++++++++++++ src/renzhengshouquan/admin.js | 54 ++++++++++++++++++++++++++++++++ src/renzhengshouquan/portal.json | 9 +++--- src/renzhengshouquan/profile.js | 4 +-- 6 files changed, 99 insertions(+), 7 deletions(-) create mode 100644 src/renzhengshouquan/admin.css create mode 100644 src/renzhengshouquan/admin.go create mode 100644 src/renzhengshouquan/admin.js diff --git a/src/main.go b/src/main.go index d4278c9..b31a177 100644 --- a/src/main.go +++ b/src/main.go @@ -14,4 +14,4 @@ func main() { print(ice.Run()) } func init() { ice.Info.NodeMain = "web.team.gonganxitong.portal" ice.Info.CodeMain = "src/gonganxitong/portal.go" -} +} \ No newline at end of file diff --git a/src/renzhengshouquan/admin.css b/src/renzhengshouquan/admin.css new file mode 100644 index 0000000..7f6f043 --- /dev/null +++ b/src/renzhengshouquan/admin.css @@ -0,0 +1,6 @@ +$option div.item.text input { display:none; } +$output fieldset.story>form.option>div.item.text { display:none; } +$output fieldset.story>form.option>div.item.icon.delete { display:none; } +$output fieldset.story>div.output>div.item>div.output div.title>div.action { display:none; } +$output fieldset.story>div.status { display:none; } +$output>div.project div.list { padding-left:10px; margin-left:20px; clear:both; } \ No newline at end of file diff --git a/src/renzhengshouquan/admin.go b/src/renzhengshouquan/admin.go new file mode 100644 index 0000000..1bab5fc --- /dev/null +++ b/src/renzhengshouquan/admin.go @@ -0,0 +1,31 @@ +package renzhengshouquan + +import ( + "shylinux.com/x/ice" + + "shylinux.com/x/community/src/renzhengshouquan/model" +) + +type admin struct { + Tables + auth Auth + userAuth userAuth + order string `data:"4"` + open string `name:"open" role:"void"` +} + +func (s admin) List(m *ice.Message, arg ...string) { + if m.Option("view") == "admin" { + m.Cmdy(s.auth, arg[0]).Cut(model.SERVICE_UID, model.PLACE_UID) + s.SelectJoinRecent(m, "") + s.SelectJoinService(m) + m.Display("").DisplayCSS("").Sort("service_name,place_name") + } else { + m.EchoInfoButton("请打开管理后台", s.Open) + } +} +func (s admin) Open(m *ice.Message, arg ...string) { + m.ProcessOpen(m.MergePodCmd("", m.PrefixKey(), model.AUTH_UID, m.Option(model.AUTH_UID), "view", "admin")) +} + +func init() { ice.TeamCtxCmd(admin{}) } diff --git a/src/renzhengshouquan/admin.js b/src/renzhengshouquan/admin.js new file mode 100644 index 0000000..554d405 --- /dev/null +++ b/src/renzhengshouquan/admin.js @@ -0,0 +1,54 @@ +Volcanos(chat.ONIMPORT, { + _init: function(can, msg) { + if (can.isCmdMode()) { + can.ui = can.onappend.layout(can), can.onimport.service(can, msg) + } else { + msg.Dump(can) + } + }, + service: function(can, msg) { var list = {} + msg.Table(function(value) { if (list[value.service_uid]) { list[value.service_uid].push(value); return } list[value.service_uid] = [value] + can.onimport.item(can, {icon: value.service_icon, name: value.service_name, _hash: value.service_name.split(" ")[0]}, function(event, item, show, target) { if (show) { return } + can.request(event, {view: "table", pod: value.nodename}) + can._root.Action.run(event, [ctx.ACTION, ctx.RUN, value.index, value.place_uid], function(msg) { + can.onimport.index(can, msg, value, target) + }) + }) + }), can.db.list = list + }, + index: function(can, msg, value, target) { + can.onimport.itemlist(can, msg.Table(function(item) { + item._hash = [value.service_name.split(" ")[0], item.name], item.__title = item.name + return item + }), function(event, item, show, target) { + if (show) { return } + var hash = [value.service_name.split(" ")[0], item.name] + can.onimport.itemlist(can, can.core.List(can.db.list[value.service_uid], function(value) { + value._hash = hash.concat(value.place_name), value.__title = [item.name, value.place_name].join(" ") + value.icon = value.service_icon, value.name = value.place_name + return value + }), function(event, value, show, target) { if (show) { return } + can.onimport.content(can, value, item) + }, null, target) + }, null, target) + }, + content: function(can, value, item) { + if (can.onmotion.cache(can, function() { return [value.service_uid, value.place_uid, item.index] }, can.ui.content)) { return } + var uid = can.db.hash[3] && can.db.hash.slice(0, 3).join(",") == value._hash.join(",")? can.db.hash[3]: null + can.onappend.plugin(can._root.Action, {space: value.nodename, index: item.index, args: [value.place_uid].concat(uid? [uid]: [])}, function(sub) { + sub.run = function(event, cmds, cb) { can.request(event, {pod: value.nodename}) + can._root.Action.run(event, [ctx.ACTION, ctx.RUN, value.index, ctx.ACTION, ctx.RUN, item.index].concat(cmds), cb) + } + if (uid) { sub._history.push([value.place_uid]) } + sub.onexport.output = function(_sub, msg) { if (!can.isCmdMode()) { return } + if (msg.IsDetail()) { + can.user.title(value.__title+" "+(msg.Append("name")||msg.Append("title"))) + can.onexport.hash(can, value._hash.concat(sub.Option(UID))) + } else { + can.user.title(value.__title) + can.onexport.hash(can, value._hash) + } + } + }, can.ui.content) + }, +}) \ No newline at end of file diff --git a/src/renzhengshouquan/portal.json b/src/renzhengshouquan/portal.json index 998c580..455c241 100644 --- a/src/renzhengshouquan/portal.json +++ b/src/renzhengshouquan/portal.json @@ -1,6 +1,6 @@ { "portal": "认证授权", - "cert": "上传证件", "auth": "认证授权", "profile": "用户名片", + "cert": "上传证件", "auth": "认证授权", "admin": "管理后台", "profile": "用户名片", "certList": "证件", "memberList": "成员", "issue": "认证", "revoke": "吊销", "enter": "进入", "style": { @@ -9,9 +9,10 @@ "enter": "notice" }, "icons": { - "auth": "https://img.icons8.com/officel/80/activity-grid.png", - "cert": "https://img.icons8.com/officel/80/activity-grid.png", - "profile": "https://img.icons8.com/officel/80/activity-grid.png" + "cert": "https://img.icons8.com/officel/80/identification-documents--v2.png", + "auth": "https://img.icons8.com/officel/80/id-verified.png", + "admin": "https://img.icons8.com/officel/80/structured-document-data.png", + "profile": "https://img.icons8.com/officel/80/passport.png" }, "input": { "My Auth": "我的认证", diff --git a/src/renzhengshouquan/profile.js b/src/renzhengshouquan/profile.js index ce48397..372e178 100644 --- a/src/renzhengshouquan/profile.js +++ b/src/renzhengshouquan/profile.js @@ -5,7 +5,7 @@ Volcanos(chat.ONIMPORT, { can.onaction.updateBackground && can.onaction.updateBackground(event, can) }}]) can.page.Append(can, can.ui.head, [can.onimport.itemcard(can, value, [ - {view: html.TITLE, list: [value.name, can.onimport.authView(can, value), can.onimport.textView(can, value, AUTH_TYPE), can.onimport.titleAction(can, msg)]}, + {view: html.TITLE, list: [value.name, can.onimport.authView(can, value), can.onimport.textView(can, value, AUTH_TYPE), can.onimport.titleAction(can, value)]}, {view: html.STATUS, list: [value.city_name, value.street_name, value.service_name]}, {view: html.STATUS, list: [value.info]}, ], function() {})]) @@ -60,7 +60,7 @@ Volcanos(chat.ONIMPORT, { Volcanos(chat.ONACTION, { enter: function(event, can) { var msg = can.request(event) if (msg.Option("auth_type") == "company") { - can.user.open(can.misc.MergePodCmd(can, {pod: "20240724-enterprise", cmd: "web.team.guanlixitong.company", auth_uid: msg.Option("auth_uid")})) + can.user.open(can.misc.MergePodCmd(can, {pod: "20240724-community", cmd: "web.team.renzhengshouquan.admin", auth_uid: msg.Option("auth_uid"), view: "admin"})) } else { can.onimport.myPlugin(can, {space: msg.Option("nodename"), index: msg.Option(ctx.INDEX), args: [msg.Option(PLACE_UID)]}) }