同步业务菜单现有图标配置

This commit is contained in:
焦龙言
2026-07-28 09:39:54 +08:00
parent b4822fef12
commit acddc8a237
4 changed files with 33 additions and 16 deletions
@@ -594,13 +594,13 @@ EXPECTED_TOP_LEVEL_MENU_POSITIONS = {
3: ('系统工具', 0, 6),
}
EXPECTED_BUSINESS_ROOT_ICONS = {
121: 'dict',
122: 'form',
121: 'documentation',
122: 'build',
123: 'chart',
}
EXPECTED_TOP_LEVEL_MENU_STABLE_FIELDS = {
121: ('基础资料维护', 'businessMaster', None, '', '', '1', '0', 'M', '0', '0', '', 'dict'),
122: ('业务管理', 'businessOperation', None, '', '', '1', '0', 'M', '0', '0', '', 'form'),
121: ('基础资料维护', 'businessMaster', None, '', '', '1', '0', 'M', '0', '0', '', 'documentation'),
122: ('业务管理', 'businessOperation', None, '', '', '1', '0', 'M', '0', '0', '', 'build'),
123: ('报表查询', 'businessReport', None, '', '', '1', '0', 'M', '0', '0', '', 'chart'),
1: ('系统管理', 'system', None, '', '', '1', '0', 'M', '0', '0', '', 'system'),
2: ('系统监控', 'monitor', None, '', '', '1', '0', 'M', '0', '0', '', 'monitor'),
@@ -1259,8 +1259,25 @@ class SqlContractTest(unittest.TestCase):
self.assertNotRegex(executable.lower(), r'\bsys_role_menu\b')
expected_rows = [
('121', '基础资料维护', 'businessMaster', None, '', '', '1', '0', 'M', '0', '0', '', '0', '1', '#', 'dict'),
('122', '业务管理', 'businessOperation', None, '', '', '1', '0', 'M', '0', '0', '', '0', '2', '#', 'form'),
(
'121',
'基础资料维护',
'businessMaster',
None,
'',
'',
'1',
'0',
'M',
'0',
'0',
'',
'0',
'1',
'#',
'documentation',
),
('122', '业务管理', 'businessOperation', None, '', '', '1', '0', 'M', '0', '0', '', '0', '2', '#', 'build'),
('123', '报表查询', 'businessReport', None, '', '', '1', '0', 'M', '0', '0', '', '0', '3', '#', 'chart'),
]
self.assertEqual(
@@ -1277,7 +1294,7 @@ class SqlContractTest(unittest.TestCase):
'select menu_id from sys_menu where menu_id in (121, 122, 123) order by menu_id for update'
)
expected_update = (
"update sys_menu set icon = case menu_id when 121 then 'dict' when 122 then 'form' "
"update sys_menu set icon = case menu_id when 121 then 'documentation' when 122 then 'build' "
"when 123 then 'chart' else icon end where menu_id in (121, 122, 123)"
)
self.assertEqual(lock_statement, transaction_body[0])
@@ -1339,7 +1356,7 @@ class SqlContractTest(unittest.TestCase):
def test_top_level_menu_contract_rejects_same_stable_field_drift_in_both_initializers(self) -> None:
mutations = (
(1, '系统管理', 'system', 'driftSystemIcon'),
(121, '基础资料维护', 'dict', 'driftBusinessIcon'),
(121, '基础资料维护', 'documentation', 'driftBusinessIcon'),
)
for filename in INITIALIZERS:
sql = (SQL_ROOT / filename).read_text(encoding='utf-8')