This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-11-19 09:32:14 +08:00
parent a7ad71a768
commit 88f7e6f13c
6 changed files with 99 additions and 7 deletions

View File

@ -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"
}
}

View File

@ -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; }

View File

@ -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{}) }

View File

@ -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)
},
})

View File

@ -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": "我的认证",

View File

@ -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)]})
}