Files
eip4-platform/docs/sql/2026-06-15_menu_maintain_master_detail_upsert.sql
zhengwr bf5659590f chore: 清理可再生 schema 产物 + gitignore 收口 + 菜单维护树计划/SQL
删除已跟踪的 batch_regression schema 产物(BatchConvertCli 可重生,体量大);.gitignore 屏蔽 tools/s3_rewriter/output/schema{,_out,_wsd}(各~20M)与 output 下重生副本分级清单.csv。补 2026-06-15 菜单维护树模式重建与树选择框修复计划 + menu_maintain 主子表 upsert SQL。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 14:09:00 +08:00

9 lines
3.5 KiB
SQL
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 菜单维护(b38737be) 主从布局 v5:树置于 grid 列。
-- v5 修「选不中」+「点一次发2次请求」:①树加 virtualThreshold:100000 关 amis 虚拟列表——SYS_MENU 100+ 节点
-- 触发 VirtualList,而选中高亮靠 valueSet.has(item) 对象身份判断,虚拟渲染下身份不一致致点中不高亮(${selId}
-- 其实已生效)。②去掉树的 onEvent.change→reload menuDetail:menuDetail service 的 api/sendOn 已带 ${selId},
-- selId 变即自动重拉,两条触发并存会一次点击发 2 请求且 onEvent 那条取旧值(竞态)。
-- 右表单选中即编辑;service.adaptor 去除 CHAR 补白使 根级菜单/上级 等引用列匹配选项显名(非裸码)。
-- 功能/根菜单 select 解析显名;保存=SYS_MENU_ADD(upsert);删除=SYS_MENU_DELETE。⚠️重导覆盖后须重跑本文件。
UPDATE eip3.sys_page_schema SET schema_json = $js${"type":"page","title":"菜单维护","body":[{"type":"grid","columns":[{"md":4,"columnClassName":"b-r pr-md","body":[{"type":"input-tree","name":"selId","id":"menuTree","label":false,"source":"/api/template/b38737be-aecf-44d9-b3d4-1823c5443fba/tree","initiallyOpen":true,"showOutline":true,"heightAuto":true,"searchable":true,"virtualThreshold":100000}]},{"md":8,"columnClassName":"pl-md","body":[{"type":"button-toolbar","className":"m-b-sm","buttons":[{"type":"button","label":"添加","level":"primary","icon":"fa fa-plus","onEvent":{"click":{"actions":[{"actionType":"setValue","componentId":"menuTree","args":{"value":""}},{"actionType":"setValue","componentId":"menuEditForm","args":{"value":{"SYS_MENU_ID":"","NAME":"","VIEW_TEMPLATEID":"","TYPENAME":"","SEQ":0,"PARENTID":"","MENUROOT":""}}}]}}},{"type":"button","label":"删除","level":"danger","icon":"fa fa-trash","disabledOn":"${!selId}","actionType":"ajax","confirmText":"确认删除选中菜单?有子菜单时会被拒绝。","api":{"method":"post","url":"/api/flow/SYS_MENU_DELETE","data":{"SYS_MENU_ID":"${selId}"}},"reload":"menuTree"}]},{"type":"service","id":"menuDetail","api":{"method":"get","url":"/api/entity/SYS_MENU/${selId}","sendOn":"${selId}"},"adaptor":"if(payload&&payload.data){payload.data.MENUROOT=(payload.data.MENUROOT||'').trim();payload.data.VIEW_TEMPLATEID=(payload.data.VIEW_TEMPLATEID||'').trim();payload.data.PARENTID=(payload.data.PARENTID||'').trim();}return payload;","body":[{"type":"form","id":"menuEditForm","title":"菜单","mode":"horizontal","horizontal":{"left":3,"right":8},"api":"post:/api/flow/SYS_MENU_ADD","body":[{"type":"input-text","name":"NAME","label":"菜单名称","required":true},{"type":"select","name":"VIEW_TEMPLATEID","label":"功能","source":"/api/picker/8b89fd29-8338-4c0f-94fe-6f81da2b0410/list?perPage=2000","searchable":true,"clearable":true,"placeholder":"目录可空,菜单指向页面"},{"type":"input-text","name":"TYPENAME","label":"分类名称"},{"type":"input-number","name":"SEQ","label":"排序"},{"type":"tree-select","name":"PARENTID","label":"上级菜单","source":"/api/template/b38737be-aecf-44d9-b3d4-1823c5443fba/tree","clearable":true,"placeholder":"留空 = 顶级"},{"type":"select","name":"MENUROOT","label":"根级菜单","source":"/api/picker/80554409-90eb-42c7-aaf5-1eee233794f5/list","clearable":true,"placeholder":"顶级目录需选根分组"},{"type":"hidden","name":"SYS_MENU_ID"}],"actions":[{"type":"submit","label":"保存","level":"primary","icon":"fa fa-save","reload":"menuTree"}]}]}]}]}]}$js$::jsonb, schema_etag='bespoke-menu-md-v5', version=version+1, update_time=1750100000000 WHERE template_id='b38737be-aecf-44d9-b3d4-1823c5443fba';