From ec51ff30dab5ea00d51e117b11783007561d1c9b Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 9 Jul 2026 12:03:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=9F=E6=88=B7=E5=93=81=E7=89=8C?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2(tenant=5Fbrand.ui)=20+=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E7=AB=AF=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/tenant_brand.ui | 26 ++++++++++++++++++++++++++ wwwroot/tenant_brand_save.dspy | 13 +++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 wwwroot/tenant_brand.ui create mode 100644 wwwroot/tenant_brand_save.dspy diff --git a/wwwroot/tenant_brand.ui b/wwwroot/tenant_brand.ui new file mode 100644 index 00000000..0dfe323b --- /dev/null +++ b/wwwroot/tenant_brand.ui @@ -0,0 +1,26 @@ +# 租户品牌设置 - 设置左上角图标和系统名称 +userorgid = await get_userorgid() +env = request._run_ns +async with get_sor_context(env, 'sage') as sor: + org = (await sor.sqlExe('SELECT orgname, iconid FROM organization WHERE id = ${orgid}$', {'orgid': userorgid}))[0] + +result = { + "widgettype": "VBox", + "options": {"width": "100%", "padding": "20px", "spacing": 16}, + "subwidgets": [ + {"widgettype": "Title3", "options": {"text": "租户品牌设置"}}, + {"widgettype": "Text", "options": {"text": "设置左上角显示的图标和系统名称"}}, + { + "widgettype": "Form", + "options": { + "url": entire_url('./tenant_brand_save.dspy'), + "cols": 1, + "submit_label": "保存", + "fields": [ + {"name": "orgname", "type": "text", "label": "系统名称", "default": org.orgname or ''}, + {"name": "iconid", "type": "file", "label": "图标(SVG/PNG)", "uitype": "file", "accept": ".svg,.png,.jpg"} + ] + } + } + ] +} diff --git a/wwwroot/tenant_brand_save.dspy b/wwwroot/tenant_brand_save.dspy new file mode 100644 index 00000000..833a37da --- /dev/null +++ b/wwwroot/tenant_brand_save.dspy @@ -0,0 +1,13 @@ +# 保存租户品牌设置 +userorgid = await get_userorgid() +orgname = params_kw.get('orgname', '') +iconid = params_kw.get('iconid', '') + +env = request._run_ns +async with get_sor_context(env, 'sage') as sor: + await sor.U('organization', {'id': userorgid, 'orgname': orgname, 'iconid': iconid}) + +result = { + "widgettype": "Message", + "options": {"title": "成功", "message": "品牌设置已保存,刷新页面生效", "type": "success"} +}