feat: 右侧内容区改 TabPanel,菜单项点击动态添加/切换 tab
This commit is contained in:
parent
9482b4741d
commit
adc3bad5b2
233
wwwroot/index.ui
233
wwwroot/index.ui
@ -7,6 +7,14 @@
|
||||
"padding": "0"
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Html",
|
||||
"options": {
|
||||
"html": "<script>\n(function(){\n if (bricks.TabPanel.prototype._dyn_patched) return;\n bricks.TabPanel.prototype._dyn_patched = true;\n bricks.TabPanel.prototype.open_tab = async function(desc){\n if (this.content_buffer.hasOwnProperty(desc.name)){\n if (desc.name !== this.cur_tab_name){\n this.cur_tab_name = desc.name;\n this.switch_content(this.content_buffer[desc.name]);\n if (this.toolbar && this.toolbar.click) this.toolbar.click(desc.name);\n }\n return;\n }\n desc.content = desc.content || {\"widgettype\":\"urlwidget\",\"options\":{\"url\":desc.url}};\n this.opts.items.push(desc);\n if (this.add_tab) this.add_tab(desc);\n var w = await bricks.widgetBuild(desc.content, this, {});\n if (!w) return;\n this.content_buffer[desc.name] = w;\n this.cur_tab_name = desc.name;\n this.switch_content(w);\n };\n bricks.TabPanel.prototype.show_tabcontent = async function(event){\n var tdesc = event.params;\n if (tdesc.name === this.cur_tab_name) return;\n var items = this.opts.items;\n for (var i=0;i<items.length;i++){\n if (tdesc.name === items[i].name){\n var w = this.content_buffer[tdesc.name];\n if (!w){\n var c = items[i].content || {\"widgettype\":\"urlwidget\",\"options\":{\"url\":items[i].url}};\n w = await bricks.widgetBuild(c, this, {});\n if (w) this.content_buffer[tdesc.name] = w;\n }\n if (w){ this.cur_tab_name = tdesc.name; this.switch_content(w); }\n return;\n }\n }\n };\n})();\n</script>",
|
||||
"width": "0",
|
||||
"height": "0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "HBox",
|
||||
"options": {
|
||||
@ -90,73 +98,97 @@
|
||||
"name": "pipeline_core",
|
||||
"label": "产线管理",
|
||||
"icon": "{{entire_url('/imgs/cubes.svg')}}",
|
||||
"url": "{{entire_url('/pipeline_core')}}"
|
||||
"script": "this.open_tab({name:'pipeline_core',label:'产线管理',url:'/pipeline_core',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "pipeline_sdlc",
|
||||
"label": "开发产线",
|
||||
"icon": "{{entire_url('/imgs/workflow.svg')}}",
|
||||
"url": "{{entire_url('/pipeline-sdlc')}}"
|
||||
"script": "this.open_tab({name:'pipeline_sdlc',label:'开发产线',url:'/pipeline-sdlc',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "pipeline_ops",
|
||||
"label": "运营管理",
|
||||
"icon": "{{entire_url('/imgs/dashboard.svg')}}",
|
||||
"url": "{{entire_url('/pipeline_ops')}}"
|
||||
"script": "this.open_tab({name:'pipeline_ops',label:'运营管理',url:'/pipeline_ops',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "pipeline_dist",
|
||||
"label": "分销管理",
|
||||
"icon": "{{entire_url('/imgs/truck.svg')}}",
|
||||
"url": "{{entire_url('/pipeline_dist')}}"
|
||||
"script": "this.open_tab({name:'pipeline_dist',label:'分销管理',url:'/pipeline_dist',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "pipeline_task",
|
||||
"label": "任务中心",
|
||||
"icon": "{{entire_url('/imgs/rocket.svg')}}",
|
||||
"url": "{{entire_url('/pipeline_task')}}"
|
||||
"script": "this.open_tab({name:'pipeline_task',label:'任务中心',url:'/pipeline_task',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "pipeline_ktv",
|
||||
"label": "KTV产线",
|
||||
"icon": "{{entire_url('/imgs/mic.svg')}}",
|
||||
"url": "{{entire_url('/pipeline_task/task_submit.ui')}}"
|
||||
"script": "this.open_tab({name:'pipeline_ktv',label:'KTV产线',url:'/pipeline_task/task_submit.ui',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "showcase",
|
||||
"label": "展示平台",
|
||||
"icon": "{{entire_url('/imgs/user-circle.svg')}}",
|
||||
"url": "{{entire_url('/showcase')}}"
|
||||
"script": "this.open_tab({name:'showcase',label:'展示平台',url:'/showcase',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "tenant",
|
||||
"label": "租户管理",
|
||||
"icon": "{{entire_url('/imgs/globe.svg')}}",
|
||||
"url": "{{entire_url('/tenant')}}"
|
||||
"script": "this.open_tab({name:'tenant',label:'租户管理',url:'/tenant',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "app_audit",
|
||||
"label": "审计日志",
|
||||
"icon": "{{entire_url('/imgs/database.svg')}}",
|
||||
"url": "{{entire_url('/app_audit')}}"
|
||||
"script": "this.open_tab({name:'app_audit',label:'审计日志',url:'/app_audit',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "org_remote",
|
||||
"label": "远程空间",
|
||||
"icon": "",
|
||||
"url": "{{entire_url('/pipeline-sdlc/sd_org_remote')}}"
|
||||
"script": "this.open_tab({name:'org_remote',label:'远程空间',url:'/pipeline-sdlc/sd_org_remote',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "product_management",
|
||||
"label": "产品管理",
|
||||
"icon": "",
|
||||
"items": [
|
||||
{"name": "pm_category", "label": "产品类别管理", "url": "{{entire_url('/product_management/product_category_tree')}}"},
|
||||
{"name": "pm_product", "label": "产品管理", "url": "{{entire_url('/product_management/product_list')}}"},
|
||||
{"name": "pm_resource", "label": "产品资源绑定", "url": "{{entire_url('/product_management/product_resource_list')}}"},
|
||||
{"name": "pm_supplier", "label": "资源供应商关联", "url": "{{entire_url('/product_management/product_resource_supplier_list')}}"},
|
||||
{"name": "pm_subscription", "label": "客户订购管理", "url": "{{entire_url('/product_management/product_subscription_list')}}"},
|
||||
{"name": "pm_usage", "label": "产品消费记录", "url": "{{entire_url('/product_management/product_usage_log_list')}}"}
|
||||
{
|
||||
"name": "pm_category",
|
||||
"label": "产品类别管理",
|
||||
"script": "this.open_tab({name:'pm_category',label:'产品类别管理',url:'/product_management/product_category_tree',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "pm_product",
|
||||
"label": "产品管理",
|
||||
"script": "this.open_tab({name:'pm_product',label:'产品管理',url:'/product_management/product_list',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "pm_resource",
|
||||
"label": "产品资源绑定",
|
||||
"script": "this.open_tab({name:'pm_resource',label:'产品资源绑定',url:'/product_management/product_resource_list',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "pm_supplier",
|
||||
"label": "资源供应商关联",
|
||||
"script": "this.open_tab({name:'pm_supplier',label:'资源供应商关联',url:'/product_management/product_resource_supplier_list',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "pm_subscription",
|
||||
"label": "客户订购管理",
|
||||
"script": "this.open_tab({name:'pm_subscription',label:'客户订购管理',url:'/product_management/product_subscription_list',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "pm_usage",
|
||||
"label": "产品消费记录",
|
||||
"script": "this.open_tab({name:'pm_usage',label:'产品消费记录',url:'/product_management/product_usage_log_list',removable:true})"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -164,10 +196,26 @@
|
||||
"label": "折扣管理",
|
||||
"icon": "",
|
||||
"items": [
|
||||
{"name": "d_list", "label": "折扣管理", "url": "{{entire_url('/discount/discount_list/index.ui')}}"},
|
||||
{"name": "d_marketing", "label": "营销方案", "url": "{{entire_url('/discount/discount_marketing_list/index.ui')}}"},
|
||||
{"name": "d_promo", "label": "促销码", "url": "{{entire_url('/discount/discount_promo_code_list/index.ui')}}"},
|
||||
{"name": "d_bind", "label": "客户归属", "url": "{{entire_url('/discount/discount_customer_bind_list/index.ui')}}"}
|
||||
{
|
||||
"name": "d_list",
|
||||
"label": "折扣管理",
|
||||
"script": "this.open_tab({name:'d_list',label:'折扣管理',url:'/discount/discount_list/index.ui',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "d_marketing",
|
||||
"label": "营销方案",
|
||||
"script": "this.open_tab({name:'d_marketing',label:'营销方案',url:'/discount/discount_marketing_list/index.ui',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "d_promo",
|
||||
"label": "促销码",
|
||||
"script": "this.open_tab({name:'d_promo',label:'促销码',url:'/discount/discount_promo_code_list/index.ui',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "d_bind",
|
||||
"label": "客户归属",
|
||||
"script": "this.open_tab({name:'d_bind',label:'客户归属',url:'/discount/discount_customer_bind_list/index.ui',removable:true})"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -175,7 +223,11 @@
|
||||
"label": "定价管理",
|
||||
"icon": "",
|
||||
"items": [
|
||||
{"name": "pricing_program", "label": "定价管理", "url": "{{entire_url('/pricing/pricing_program')}}"}
|
||||
{
|
||||
"name": "pricing_program",
|
||||
"label": "定价管理",
|
||||
"script": "this.open_tab({name:'pricing_program',label:'定价管理',url:'/pricing/pricing_program',removable:true})"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -183,10 +235,26 @@
|
||||
"label": "支付管理",
|
||||
"icon": "",
|
||||
"items": [
|
||||
{"name": "pay_recharge", "label": "充值", "url": "{{entire_url('/unipay/recharge.ui')}}"},
|
||||
{"name": "pay_refund", "label": "退款", "url": "{{entire_url('/unipay/refund.ui')}}"},
|
||||
{"name": "pay_manual", "label": "手动充值", "url": "{{entire_url('/unipay/manual_recharge.ui')}}"},
|
||||
{"name": "pay_transfer", "label": "转账信息", "url": "{{entire_url('/unipay/transfer_info.ui')}}"}
|
||||
{
|
||||
"name": "pay_recharge",
|
||||
"label": "充值",
|
||||
"script": "this.open_tab({name:'pay_recharge',label:'充值',url:'/unipay/recharge.ui',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "pay_refund",
|
||||
"label": "退款",
|
||||
"script": "this.open_tab({name:'pay_refund',label:'退款',url:'/unipay/refund.ui',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "pay_manual",
|
||||
"label": "手动充值",
|
||||
"script": "this.open_tab({name:'pay_manual',label:'手动充值',url:'/unipay/manual_recharge.ui',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "pay_transfer",
|
||||
"label": "转账信息",
|
||||
"script": "this.open_tab({name:'pay_transfer',label:'转账信息',url:'/unipay/transfer_info.ui',removable:true})"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -194,15 +262,51 @@
|
||||
"label": "系统管理",
|
||||
"icon": "",
|
||||
"items": [
|
||||
{"name": "rbac_users", "label": "用户管理", "url": "{{entire_url('/rbac/users')}}"},
|
||||
{"name": "rbac_addadmin", "label": "添加管理员", "url": "{{entire_url('/rbac/add_adminuser.ui')}}"},
|
||||
{"name": "rbac_list_path", "label": "查询路径权限角色", "url": "{{entire_url('/rbac/list_path_roles.ui')}}"},
|
||||
{"name": "rbac_find_unauth", "label": "扫描未授权文件", "url": "{{entire_url('/rbac/find_unauth_files.dspy')}}"},
|
||||
{"name": "rbac_refresh", "label": "刷新权限缓存", "url": "{{entire_url('/rbac/refresh_userperm.dspy')}}"},
|
||||
{"name": "ab_svgicon", "label": "图标管理", "url": "{{entire_url('/appbase/svgicon')}}"},
|
||||
{"name": "ab_codemgr", "label": "代码管理", "url": "{{entire_url('/appbase/appcodes')}}"},
|
||||
{"name": "ab_params", "label": "参数管理", "url": "{{entire_url('/appbase/params')}}"},
|
||||
{"name": "ab_jsonapi", "label": "json应用接口", "url": "{{entire_url('/appbase/jsonhttpapi')}}"}
|
||||
{
|
||||
"name": "rbac_users",
|
||||
"label": "用户管理",
|
||||
"script": "this.open_tab({name:'rbac_users',label:'用户管理',url:'/rbac/users',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "rbac_addadmin",
|
||||
"label": "添加管理员",
|
||||
"script": "this.open_tab({name:'rbac_addadmin',label:'添加管理员',url:'/rbac/add_adminuser.ui',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "rbac_list_path",
|
||||
"label": "查询路径权限角色",
|
||||
"script": "this.open_tab({name:'rbac_list_path',label:'查询路径权限角色',url:'/rbac/list_path_roles.ui',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "rbac_find_unauth",
|
||||
"label": "扫描未授权文件",
|
||||
"script": "this.open_tab({name:'rbac_find_unauth',label:'扫描未授权文件',url:'/rbac/find_unauth_files.dspy',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "rbac_refresh",
|
||||
"label": "刷新权限缓存",
|
||||
"script": "this.open_tab({name:'rbac_refresh',label:'刷新权限缓存',url:'/rbac/refresh_userperm.dspy',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "ab_svgicon",
|
||||
"label": "图标管理",
|
||||
"script": "this.open_tab({name:'ab_svgicon',label:'图标管理',url:'/appbase/svgicon',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "ab_codemgr",
|
||||
"label": "代码管理",
|
||||
"script": "this.open_tab({name:'ab_codemgr',label:'代码管理',url:'/appbase/appcodes',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "ab_params",
|
||||
"label": "参数管理",
|
||||
"script": "this.open_tab({name:'ab_params',label:'参数管理',url:'/appbase/params',removable:true})"
|
||||
},
|
||||
{
|
||||
"name": "ab_jsonapi",
|
||||
"label": "json应用接口",
|
||||
"script": "this.open_tab({name:'ab_jsonapi',label:'json应用接口',url:'/appbase/jsonhttpapi',removable:true})"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@ -211,40 +315,47 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"widgettype": "VScrollPanel",
|
||||
"widgettype": "TabPanel",
|
||||
"id": "main_content",
|
||||
"options": {
|
||||
"css": "filler",
|
||||
"width": "100%",
|
||||
"height": "100%"
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"width": "100%",
|
||||
"padding": "32px",
|
||||
"spacing": "24px"
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Title2",
|
||||
"height": "100%",
|
||||
"tab_pos": "top",
|
||||
"items": [
|
||||
{
|
||||
"name": "home",
|
||||
"label": "主页",
|
||||
"removable": false,
|
||||
"content": {
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"text": "产线平台"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"text": "管理产线定义、运营配置、分销渠道与任务执行",
|
||||
"cfontsize": 1.2
|
||||
}
|
||||
"width": "100%",
|
||||
"padding": "40px",
|
||||
"spacing": "16px"
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Title2",
|
||||
"options": {
|
||||
"text": "产线平台"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"text": "管理产线定义、运营配置、分销渠道与任务执行",
|
||||
"cfontsize": 1.2,
|
||||
"color": "#64748b"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user