feat: 新增自定义图标库并调整菜单图标与菜单归属
1. 新增 iconfont 自定义图标库及相关依赖文件 2. 调整菜单图标为自定义字体图标,替换原有 Ant Design 图标 3. 将客户拜访菜单从客户管理移动到项目管理作为首个子菜单 4. 优化侧边菜单展开逻辑与图标样式适配
This commit is contained in:
1 parent
c60caa4770
commit
68af363ca9
12 files changed
+207
-19
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
*.zip
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
@font-face {
|
||||||
|
font-family: "iconfont"; /* Project id 5232815 */
|
||||||
|
/* Color fonts */
|
||||||
|
src:
|
||||||
|
url('data:application/x-font-woff2;charset=utf-8;base64,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') format('woff2'),
|
||||||
|
url('iconfont.woff?t=1789098374123') format('woff'),
|
||||||
|
url('iconfont.ttf?t=1789098374123') format('truetype');
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-family: "iconfont" !important;
|
||||||
|
font-size: 16px;
|
||||||
|
font-style: normal;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
.xt-jihuabaifang:before {
|
||||||
|
content: "\e6c4";
|
||||||
|
}
|
||||||
|
|
||||||
|
.xt-xiaochengxu:before {
|
||||||
|
content: "\e61e";
|
||||||
|
}
|
||||||
|
|
||||||
|
.xt-baifangshenyue:before {
|
||||||
|
content: "\e6c6";
|
||||||
|
}
|
||||||
|
|
||||||
|
.xt-topology:before {
|
||||||
|
content: "\e67c";
|
||||||
|
}
|
||||||
|
|
||||||
|
.xt-xiangmukancha:before {
|
||||||
|
content: "\e633";
|
||||||
|
}
|
||||||
|
|
||||||
|
.xt-xiangmufangan:before {
|
||||||
|
content: "\e738";
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
window._iconfont_svg_string_5232815='<svg><symbol id="xt-jihuabaifang" viewBox="0 0 1024 1024"><path d="M879.552 617.664l-278.4 0c-57.088 0-103.552 46.464-103.552 103.552l0 198.464c0 57.088 46.464 103.552 103.552 103.552l278.4 0c57.088 0 103.552-46.464 103.552-103.552l0-198.464C983.104 664.128 936.64 617.664 879.552 617.664zM912.704 919.744c0 18.24-14.848 33.152-33.152 33.152l-278.4 0c-18.304 0-33.152-14.848-33.152-33.152l0-198.464c0-18.24 14.848-33.152 33.152-33.152l278.4 0c18.304 0 33.152 14.848 33.152 33.152L912.704 919.744z" fill="#4BBDFE" ></path><path d="M735.936 840.064l-71.104 0c-19.648 0-35.584 15.872-35.584 35.584s15.872 35.584 35.584 35.584l71.104 0c19.648 0 35.584-15.872 35.584-35.584S755.648 840.064 735.936 840.064z" fill="#4BBDFE" ></path><path d="M807.104 729.792l-142.272 0c-19.648 0-35.584 15.872-35.584 35.584 0 19.648 15.872 35.584 35.584 35.584l142.272 0c19.648 0 35.584-15.872 35.584-35.584C842.624 745.664 826.752 729.792 807.104 729.792z" fill="#4BBDFE" ></path><path d="M551.936 487.744c82.368-43.2 138.816-129.472 138.816-228.736 0-142.4-115.84-258.304-258.24-258.304-142.4 0-258.304 115.84-258.304 258.304 0 99.392 56.512 185.728 139.072 228.864C189.504 527.36 92.096 626.24 55.168 751.104c-1.344 4.608-2.688 9.344-3.84 14.016-5.952 23.232-8.576 47.36-10.304 71.232-1.408 19.392 13.184 36.288 32.576 37.632 0.896 0.064 1.728 0.064 2.56 0.064 15.872 0 29.632-10.688 33.856-25.664 3.456-12.352 2.944-25.344 4.48-37.952 1.472-12.16 4.032-24.256 7.424-35.968 38.4-135.424 163.072-235.008 310.656-235.008 64.576 0 124.672 19.264 175.232 52.032l109.312 0C672 544.32 615.488 508.16 551.936 487.744zM244.608 259.008c0-103.552 84.288-187.84 187.84-187.84s187.84 84.288 187.84 187.84S536.064 446.784 432.512 446.784 244.608 362.56 244.608 259.008z" fill="#4BBDFE" ></path></symbol><symbol id="xt-xiaochengxu" viewBox="0 0 1024 1024"><path d="M512 128c-211.7 0-384 172.3-384 384s172.3 384 384 384 384-172.3 384-384-172.3-384-384-384z m0 717.4c-183.8 0-333.4-149.6-333.4-333.4S328.2 178.6 512 178.6 845.4 328.2 845.4 512 695.8 845.4 512 845.4z" ></path><path d="M702.9 334.9c-24.9-14.2-54.6-17.1-81.6-8.1-26.4 8.8-48 28.3-59.5 53.6L418 618.9l-1.6 3c-5.6 12.9-16.5 22.9-29.8 27.4-13.5 4.5-27.9 3.1-40.5-4.1-19.8-11.3-29.4-35.4-22.7-57.2 7.1-23 28.3-26.5 75.1-29l3.5-0.2c14-0.8 24.7-12.7 23.9-26.6-0.8-14-12.7-24.6-26.6-23.9l-3.4 0.2c-45.7 2.4-102.6 5.5-120.8 64.7-13.6 44.3 5.7 93.1 46 116 15.4 8.8 32.7 13.3 50 13.3 10.7 0 21.3-1.7 31.6-5.1 26.4-8.8 48-28.3 59.5-53.6L606 405.1l1.6-3c5.6-12.9 16.5-22.9 29.8-27.4 13.5-4.5 27.9-3.1 40.5 4.1 19.8 11.3 29.4 35.4 22.7 57.2-7.1 23.2-28.5 26.6-75.7 29.1l-2.8 0.1c-14 0.7-24.7 12.6-24 26.6 0.7 14 12.6 24.8 26.6 24l2.8-0.1c46-2.4 103.2-5.3 121.5-64.7 13.5-44.4-5.8-93.2-46.1-116.1z" ></path></symbol><symbol id="xt-baifangshenyue" viewBox="0 0 1024 1024"><path d="M540.077419 333.625806c0-99.096774-85.883871-180.025806-188.283871-180.025806-105.703226 0-188.283871 80.929032-188.283871 180.025806 0 95.793548 79.277419 173.419355 178.374194 180.025807-37.987097 1.651613-74.322581 9.909677-109.006452 26.425806-36.335484 16.516129-69.367742 41.290323-97.445161 71.019355s-49.548387 66.064516-66.064516 105.703226c-14.864516 41.290323-24.774194 84.232258-24.774194 127.174194 0 14.864516 11.56129 28.077419 28.07742 28.077419S99.096774 858.83871 99.096774 843.974194c0-72.670968 28.077419-143.690323 74.322581-194.890323s110.658065-79.277419 178.374193-79.277419c29.729032 0 59.458065 6.606452 87.535484 16.516129 13.212903 6.606452 29.729032-1.651613 34.683871-14.864516 6.606452-13.212903-1.651613-29.729032-14.864516-34.683871-29.729032-11.56129-64.412903-18.167742-95.793548-19.819355 97.445161-9.909677 176.722581-87.535484 176.72258-183.329033zM351.793548 459.148387c-74.322581 0-133.780645-56.154839-133.780645-125.522581s61.109677-125.522581 133.780645-125.52258c74.322581 0 133.780645 56.154839 133.780646 125.52258s-61.109677 125.522581-133.780646 125.522581zM645.780645 726.709677l-95.793548-54.503225c-9.909677-6.606452-23.122581-3.303226-28.07742 8.258064-1.651613 3.303226-3.303226 6.606452-3.303225 9.909678v29.729032H348.490323c-14.864516 0-28.077419 11.56129-28.07742 28.077419 0 14.864516 11.56129 28.077419 28.07742 28.07742h170.116129v28.077419c0 9.909677 9.909677 19.819355 19.819354 19.819355 3.303226 0 8.258065-1.651613 9.909678-3.303226l95.793548-54.503226c9.909677-6.606452 13.212903-18.167742 8.258065-28.077419-1.651613-6.606452-3.303226-9.909677-6.606452-11.561291z m61.109678-180.025806h166.812903c9.909677 0 18.167742 8.258065 18.167742 18.167742 0 9.909677-8.258065 18.167742-18.167742 18.167742H706.890323c-9.909677 0-18.167742-8.258065-18.167742-18.167742s8.258065-18.167742 18.167742-18.167742z m138.735483-351.793548c74.322581 0 133.780645 59.458065 133.780646 133.780645v366.658064c0 74.322581-59.458065 133.780645-133.780646 133.780645h-49.548387c-14.864516 0-28.077419-11.56129-28.077419-28.077419 0-14.864516 11.56129-28.077419 28.077419-28.077419h49.548387c44.593548 0 80.929032-36.335484Line truncated
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
"id": "5232815",
|
||||||
|
"name": "鑫潼智电后台",
|
||||||
|
"font_family": "iconfont",
|
||||||
|
"css_prefix_text": "xt-",
|
||||||
|
"description": "",
|
||||||
|
"glyphs": [
|
||||||
|
{
|
||||||
|
"icon_id": "905033",
|
||||||
|
"name": "客户拜访",
|
||||||
|
"font_class": "jihuabaifang",
|
||||||
|
"unicode": "e6c4",
|
||||||
|
"unicode_decimal": 59076
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "4424124",
|
||||||
|
"name": "小程序",
|
||||||
|
"font_class": "xiaochengxu",
|
||||||
|
"unicode": "e61e",
|
||||||
|
"unicode_decimal": 58910
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "4520265",
|
||||||
|
"name": "拜访审阅",
|
||||||
|
"font_class": "baifangshenyue",
|
||||||
|
"unicode": "e6c6",
|
||||||
|
"unicode_decimal": 59078
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "4922685",
|
||||||
|
"name": "拓扑",
|
||||||
|
"font_class": "topology",
|
||||||
|
"unicode": "e67c",
|
||||||
|
"unicode_decimal": 59004
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "11622405",
|
||||||
|
"name": "项目勘察",
|
||||||
|
"font_class": "xiangmukancha",
|
||||||
|
"unicode": "e633",
|
||||||
|
"unicode_decimal": 58931
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "46034577",
|
||||||
|
"name": "项目方案",
|
||||||
|
"font_class": "xiangmufangan",
|
||||||
|
"unicode": "e738",
|
||||||
|
"unicode_decimal": 59192
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -140,7 +140,14 @@ const iconMap: Record<string, Component> = {
|
|||||||
DashboardOutlined,
|
DashboardOutlined,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// iconfont 图标类名前缀(对应 assets/fonts/iconfont/iconfont.css 的 css_prefix_text)
|
||||||
|
const ICONFONT_PREFIX = 'xt-'
|
||||||
|
|
||||||
function resolveIcon(icon?: string | null) {
|
function resolveIcon(icon?: string | null) {
|
||||||
|
// icon 值形如 xt-xxx 时渲染 iconfont 图标,否则回退到 ant-design 图标
|
||||||
|
if (icon && icon.startsWith(ICONFONT_PREFIX)) {
|
||||||
|
return () => h('i', { class: `iconfont ${icon}` })
|
||||||
|
}
|
||||||
const iconComponent = icon ? iconMap[icon] : undefined
|
const iconComponent = icon ? iconMap[icon] : undefined
|
||||||
return () => h(iconComponent || MenuOutlined)
|
return () => h(iconComponent || MenuOutlined)
|
||||||
}
|
}
|
||||||
@@ -194,6 +201,20 @@ const menuItems = computed<MenuItem[]>(() => [
|
|||||||
...buildMenuItems(permissionStore.menus),
|
...buildMenuItems(permissionStore.menus),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
// 子菜单路径 → 所属父级目录的菜单 key,用于按当前路由展开对应的父菜单
|
||||||
|
// (不能按路径首段推导:如“客户拜访”归属项目管理,但路径仍为 /customer/visit)
|
||||||
|
const parentKeyMap = computed<Record<string, string>>(() => {
|
||||||
|
const map: Record<string, string> = {}
|
||||||
|
for (const node of permissionStore.menus) {
|
||||||
|
if (node.menuType !== 1) continue
|
||||||
|
const dirKey = node.menuPath || `dir-${node.id}`
|
||||||
|
for (const child of node.children || []) {
|
||||||
|
if (child.menuPath) map[child.menuPath] = dirKey
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map
|
||||||
|
})
|
||||||
|
|
||||||
// 计算属性
|
// 计算属性
|
||||||
const userInfo = computed(() => permissionStore.userInfo)
|
const userInfo = computed(() => permissionStore.userInfo)
|
||||||
const displayName = computed(() => userInfo.value?.realName || userInfo.value?.username || '管理员')
|
const displayName = computed(() => userInfo.value?.realName || userInfo.value?.username || '管理员')
|
||||||
@@ -219,10 +240,10 @@ watch(
|
|||||||
(path) => {
|
(path) => {
|
||||||
selectedKeys.value = [path]
|
selectedKeys.value = [path]
|
||||||
|
|
||||||
// 自动展开父级菜单
|
// 自动展开当前菜单所属的父级目录
|
||||||
const pathParts = path.split('/').filter(Boolean)
|
const parentKey = parentKeyMap.value[path]
|
||||||
if (pathParts.length > 1) {
|
if (parentKey) {
|
||||||
openKeys.value = [`/${pathParts[0]}`]
|
openKeys.value = [parentKey]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
@@ -234,9 +255,9 @@ watch(collapsed, (val) => {
|
|||||||
openKeys.value = []
|
openKeys.value = []
|
||||||
} else {
|
} else {
|
||||||
// 展开时根据当前路由自动打开对应的父菜单
|
// 展开时根据当前路由自动打开对应的父菜单
|
||||||
const pathParts = route.path.split('/').filter(Boolean)
|
const parentKey = parentKeyMap.value[route.path]
|
||||||
if (pathParts.length > 1) {
|
if (parentKey) {
|
||||||
openKeys.value = [`/${pathParts[0]}`]
|
openKeys.value = [parentKey]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -306,6 +327,30 @@ function handleUserMenuClick({ key }: { key: string }) {
|
|||||||
border-right: none;
|
border-right: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// iconfont 图标统一:该图标集为彩色字体,颜色写死在字形里,无法用 color 覆盖,
|
||||||
|
// 这里用 filter 统一压成单色,并按菜单状态在灰 / 白之间切换,与 ant-design 图标观感保持一致
|
||||||
|
// 尺寸统一:ant-design 菜单图标为 14px,而 iconfont.css 自带 font-size: 16px,
|
||||||
|
// 故此处显式对齐为 14px,并重置 line-height,避免字体图标在 antd 的 line-height: 0 下出现基线偏移
|
||||||
|
:deep(.ant-menu) .iconfont {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1;
|
||||||
|
vertical-align: -0.125em;
|
||||||
|
filter: brightness(0) invert(0.65);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 折叠态与 ant-design 图标同步放大到 16px
|
||||||
|
:deep(.ant-menu-inline-collapsed) .iconfont {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-menu-item:hover) .iconfont,
|
||||||
|
:deep(.ant-menu-item-selected) .iconfont,
|
||||||
|
:deep(.ant-menu-submenu-title:hover) .iconfont,
|
||||||
|
:deep(.ant-menu-submenu-selected) .iconfont {
|
||||||
|
filter: brightness(0) invert(1);
|
||||||
|
}
|
||||||
|
|
||||||
.collapse-btn {
|
.collapse-btn {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { createApp } from "vue";
|
|||||||
import Antd from "ant-design-vue";
|
import Antd from "ant-design-vue";
|
||||||
import "ant-design-vue/dist/reset.css";
|
import "ant-design-vue/dist/reset.css";
|
||||||
import "@/assets/styles/global.less";
|
import "@/assets/styles/global.less";
|
||||||
|
import "@/assets/fonts/iconfont/iconfont.css";
|
||||||
import App from "./App.vue";
|
import App from "./App.vue";
|
||||||
import router from "./router";
|
import router from "./router";
|
||||||
import pinia from "./stores";
|
import pinia from "./stores";
|
||||||
|
|||||||
+13
-12
@@ -85,7 +85,7 @@ ON CONFLICT (id) DO UPDATE SET
|
|||||||
INSERT INTO sys_menu (id, parent_id, menu_name, menu_path, component, icon, sort_order, menu_type, permission, visible) VALUES
|
INSERT INTO sys_menu (id, parent_id, menu_name, menu_path, component, icon, sort_order, menu_type, permission, visible) VALUES
|
||||||
(12, 1, '客户档案管理', '/customer/info', 'customer/info/index', 'UserOutlined', 1, 2, 'customer:list', 1),
|
(12, 1, '客户档案管理', '/customer/info', 'customer/info/index', 'UserOutlined', 1, 2, 'customer:list', 1),
|
||||||
(13, 1, '客户部门', '/customer/department', 'customer/department/index', 'TeamOutlined', 2, 2, 'customer:department', 1),
|
(13, 1, '客户部门', '/customer/department', 'customer/department/index', 'TeamOutlined', 2, 2, 'customer:department', 1),
|
||||||
(14, 1, '客户小程序授权管理', '/customer/account', 'customer/account/index', 'SafetyOutlined', 3, 2, 'customer:account', 1),
|
(14, 1, '客户小程序授权管理', '/customer/account', 'customer/account/index', 'xt-xiaochengxu', 3, 2, 'customer:account', 1),
|
||||||
(15, 1, '新增客户', NULL, NULL, NULL, 1, 3, 'customer:create', 1),
|
(15, 1, '新增客户', NULL, NULL, NULL, 1, 3, 'customer:create', 1),
|
||||||
(16, 1, '编辑客户', NULL, NULL, NULL, 2, 3, 'customer:update', 1),
|
(16, 1, '编辑客户', NULL, NULL, NULL, 2, 3, 'customer:update', 1),
|
||||||
(17, 1, '删除客户', NULL, NULL, NULL, 3, 3, 'customer:delete', 1),
|
(17, 1, '删除客户', NULL, NULL, NULL, 3, 3, 'customer:delete', 1),
|
||||||
@@ -106,18 +106,19 @@ ON CONFLICT (id) DO UPDATE SET
|
|||||||
permission = EXCLUDED.permission,
|
permission = EXCLUDED.permission,
|
||||||
visible = EXCLUDED.visible;
|
visible = EXCLUDED.visible;
|
||||||
|
|
||||||
-- 初始菜单(客户扩展子菜单 + 项目域子菜单,id:24-31 + 空间拓扑 32)
|
-- 初始菜单(项目域子菜单 + 客户扩展子菜单,id:24-31 + 空间拓扑 32)
|
||||||
-- 客户域:客户拜访(customer:visit) / 空间拓扑与用电架构(customer:topology)
|
-- 项目域:客户拜访(customer:visit) / 项目勘察(project:survey) / 项目方案(project:plan)
|
||||||
-- 项目域:项目勘察(project:survey) / 项目方案(project:plan) / 合同管理(project:contract)
|
-- 合同管理(project:contract) / 项目验收(project:acceptance) / 回访记录(project:visit)
|
||||||
-- 项目验收(project:acceptance) / 回访记录(project:visit)
|
-- 客户域:空间拓扑与用电架构(customer:topology)
|
||||||
|
-- 注:客户拜访归属“项目管理”,但仍沿用 /customer/visit 路径与 customer:visit 权限码
|
||||||
INSERT INTO sys_menu (id, parent_id, menu_name, menu_path, component, icon, sort_order, menu_type, permission, visible) VALUES
|
INSERT INTO sys_menu (id, parent_id, menu_name, menu_path, component, icon, sort_order, menu_type, permission, visible) VALUES
|
||||||
(24, 1, '客户拜访', '/customer/visit', 'customer/visit/index', 'AccountBookOutlined', 4, 2, 'customer:visit', 1),
|
(24, 2, '客户拜访', '/customer/visit', 'customer/visit/index', 'xt-jihuabaifang', 1, 2, 'customer:visit', 1),
|
||||||
(27, 2, '项目勘察', '/project/survey', 'project/survey/index', 'CarryOutOutlined', 1, 2, 'project:survey', 1),
|
(27, 2, '项目勘察', '/project/survey', 'project/survey/index', 'xt-xiangmukancha', 2, 2, 'project:survey', 1),
|
||||||
(28, 2, '项目方案', '/project/plan', 'project/plan/index', 'FileSearchOutlined', 2, 2, 'project:plan', 1),
|
(28, 2, '项目方案', '/project/plan', 'project/plan/index', 'xt-xiangmufangan', 3, 2, 'project:plan', 1),
|
||||||
(29, 2, '合同管理', '/project/contract', 'project/contract/index', 'FileDoneOutlined', 3, 2, 'project:contract', 1),
|
(29, 2, '合同管理', '/project/contract', 'project/contract/index', 'FileDoneOutlined', 4, 2, 'project:contract', 1),
|
||||||
(30, 2, '项目验收', '/project/acceptance', 'project/acceptance/index', 'ThunderboltOutlined', 4, 2, 'project:acceptance',1),
|
(30, 2, '项目验收', '/project/acceptance', 'project/acceptance/index', 'ThunderboltOutlined', 5, 2, 'project:acceptance',1),
|
||||||
(31, 2, '回访记录', '/project/visit', 'project/visit/index', 'AuditOutlined', 5, 2, 'project:visit', 1),
|
(31, 2, '回访记录', '/project/visit', 'project/visit/index', 'AuditOutlined', 6, 2, 'project:visit', 1),
|
||||||
(32, 1, '空间拓扑与用电架构', '/customer/topology', 'customer/topology/index', 'ApartmentOutlined', 5, 2, 'customer:topology',1)
|
(32, 1, '空间拓扑与用电架构', '/customer/topology', 'customer/topology/index', 'xt-topology', 5, 2, 'customer:topology',1)
|
||||||
ON CONFLICT (id) DO UPDATE SET
|
ON CONFLICT (id) DO UPDATE SET
|
||||||
parent_id = EXCLUDED.parent_id,
|
parent_id = EXCLUDED.parent_id,
|
||||||
menu_name = EXCLUDED.menu_name,
|
menu_name = EXCLUDED.menu_name,
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
-- ============================================================
|
||||||
|
-- 增量脚本:导航菜单图标切换为 iconfont 自定义图标
|
||||||
|
-- 日期:2026-09-11
|
||||||
|
-- 数据库:PostgreSQL 15+ (xintong)
|
||||||
|
-- 说明:将 5 个业务菜单的 sys_menu.icon 由 ant-design 图标名
|
||||||
|
-- 改为前端 iconfont 类名(xt- 前缀),前端据此渲染字体图标。
|
||||||
|
-- 图标源自 client/src/assets/fonts/iconfont(css_prefix_text = xt-)。
|
||||||
|
-- 幂等脚本,可重复执行。
|
||||||
|
--
|
||||||
|
-- 用法:
|
||||||
|
-- psql -U postgres -d xintong -f 20260911_menu_iconfont.sql
|
||||||
|
-- ============================================================
|
||||||
|
|
||||||
|
BEGIN;
|
||||||
|
|
||||||
|
UPDATE sys_menu SET icon = 'xt-xiaochengxu' WHERE menu_path = '/customer/account'; -- 客户小程序授权管理
|
||||||
|
UPDATE sys_menu SET icon = 'xt-jihuabaifang' WHERE menu_path = '/customer/visit'; -- 客户拜访
|
||||||
|
UPDATE sys_menu SET icon = 'xt-topology' WHERE menu_path = '/customer/topology'; -- 空间拓扑与用电架构
|
||||||
|
UPDATE sys_menu SET icon = 'xt-xiangmukancha' WHERE menu_path = '/project/survey'; -- 项目勘察
|
||||||
|
UPDATE sys_menu SET icon = 'xt-xiangmufangan' WHERE menu_path = '/project/plan'; -- 项目方案
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
-- ============================================================
|
||||||
|
-- 验证查询(可选)
|
||||||
|
-- ============================================================
|
||||||
|
SELECT id, menu_name, menu_path, icon
|
||||||
|
FROM sys_menu
|
||||||
|
WHERE menu_path IN ('/customer/account', '/customer/visit', '/customer/topology',
|
||||||
|
'/project/survey', '/project/plan')
|
||||||
|
ORDER BY id;
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
-- 把“客户拜访”从“客户管理”移动到“项目管理”,并调整为项目管理下的第 1 个菜单
|
||||||
|
-- 说明:仅调整归属(parent_id)与排序(sort_order),
|
||||||
|
-- menu_path(/customer/visit)、component(customer/visit/index)、permission(customer:visit) 保持不变
|
||||||
|
BEGIN;
|
||||||
|
|
||||||
|
-- 客户拜访改挂到项目管理(parent_id=2),并排在项目勘察之前
|
||||||
|
UPDATE sys_menu SET parent_id = 2, sort_order = 1 WHERE menu_path = '/customer/visit';
|
||||||
|
|
||||||
|
-- 项目管理下原有子菜单顺序后移,保持连续
|
||||||
|
UPDATE sys_menu SET sort_order = 2 WHERE menu_path = '/project/survey'; -- 项目勘察
|
||||||
|
UPDATE sys_menu SET sort_order = 3 WHERE menu_path = '/project/plan'; -- 项目方案
|
||||||
|
UPDATE sys_menu SET sort_order = 4 WHERE menu_path = '/project/contract'; -- 合同管理
|
||||||
|
UPDATE sys_menu SET sort_order = 5 WHERE menu_path = '/project/acceptance'; -- 项目验收
|
||||||
|
UPDATE sys_menu SET sort_order = 6 WHERE menu_path = '/project/visit'; -- 回访记录
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
Reference in new issue
Block a user