From 7277325f0ac63a081b9b359419d2b7bd024af7a0 Mon Sep 17 00:00:00 2001 From: shy Date: Fri, 15 Nov 2024 20:09:28 +0800 Subject: [PATCH] add some --- src/guanlixitong/company.css | 15 +++++++ src/guanlixitong/company.go | 6 +-- src/guanlixitong/company.js | 69 ++++++++++++++++++++---------- src/template/web.code.css/demo.css | 3 ++ 4 files changed, 66 insertions(+), 27 deletions(-) create mode 100644 src/guanlixitong/company.css create mode 100644 src/template/web.code.css/demo.css diff --git a/src/guanlixitong/company.css b/src/guanlixitong/company.css new file mode 100644 index 0000000..ed59213 --- /dev/null +++ b/src/guanlixitong/company.css @@ -0,0 +1,15 @@ +$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; +} \ No newline at end of file diff --git a/src/guanlixitong/company.go b/src/guanlixitong/company.go index b42d083..8052560 100644 --- a/src/guanlixitong/company.go +++ b/src/guanlixitong/company.go @@ -2,7 +2,6 @@ package guanlixitong import ( "shylinux.com/x/ice" - "shylinux.com/x/icebergs/base/ctx" "shylinux.com/x/community/src/api" "shylinux.com/x/enterprise/src/guanlixitong/model" @@ -39,13 +38,12 @@ func (s company) List(m *ice.Message, arg ...string) { } else { s.AutoCmdy(m, api.RENZHENGSHOUQUAN_AUTH, m.Append(model.AUTH_UID)) m.Cut("service_uid", "place_uid") + defer m.Sort("service_name,place_name") s.SelectJoinRecent(m, "") s.SelectJoinService(m) - m.Sort("service_name,place_name") } } - m.Display("") - ctx.Toolkit(m.Message, s.Prefix(m, Portal{})) + m.Display("").DisplayCSS("") } func (s company) AuthCreate(m *ice.Message, arg ...string) { msg := s.CityCmd(m, s.Select, model.UID, m.Option(model.CITY_UID)) diff --git a/src/guanlixitong/company.js b/src/guanlixitong/company.js index 7dcb1a8..2df968c 100644 --- a/src/guanlixitong/company.js +++ b/src/guanlixitong/company.js @@ -1,30 +1,53 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { - if (can.Option("company_name")) { var list = {}; can.ui = can.onappend.layout(can) - 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}, function(event, item, show, target) { if (show) { return } - can.runActionCommand(can.request(event, {view: "table", pod: value.nodename}), value.index, [], function(msg) { - can.onimport.itemlist(can, msg.Table(), function(event, item, show, target) { if (show) { return } - can.onimport.itemlist(can, can.core.List(list[value.service_uid], function(value) { - return {icon: value.service_icon, name: value.place_name, - service_uid: value.service_uid, place_uid: value.place_uid, - nodename: value.nodename, - index: value.index, - } - }), function(event, value, show, target) { if (show) { return } - if (can.onmotion.cache(can, function() { return [value.service_uid, value.place_uid, item.index] }, can.ui.content)) { return } - can.onappend.plugin(can, {space: value.nodename, index: item.index, args: [value.place_uid]}, function(sub) { - sub.run = function(event, cmds, cb) { can.request(event, {pod: value.nodename}) - can._root.Action.run(event, ["a", "b", ctx.RUN, value.index, ctx.RUN, item.index].concat(cmds), cb) - } - }, can.ui.content) - }, null, target) - }, null, target) - }) - }) - }), can.db.list = list + if (can.Option("company_name")) { + 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.runActionCommand(can.request(event, {view: "table", pod: value.nodename}), value.index, [], 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, {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, ["a", "b", ctx.RUN, value.index, 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/template/web.code.css/demo.css b/src/template/web.code.css/demo.css new file mode 100644 index 0000000..e9fd552 --- /dev/null +++ b/src/template/web.code.css/demo.css @@ -0,0 +1,3 @@ +$output { + +} \ No newline at end of file