refactor(module-management): 清理未使用的代码——解构、导出、返回槽、死 computed、死 CSS

- groupNodeMap 在 TableEditPanel/ModuleStructureTree 中解构却未使用 → 移除
- useGroupTree 返回对象中 groupTree/groupNodeMap 无消费者 → 移除
- FIELD_TYPE_LABELS 导出仅内部使用 → 去 export
- sortGroupNodesByXh 导出仅内部使用 → 去 export
- buildBreadcrumb + moduleBreadcrumb 完全死代码 → 删除
- useModuleTree 返回对象中未消费的 moduleTreeLoading/moduleKeyword/moduleExpandedKeys/deleteModule/moduleBreadcrumb → 移除
- useModuleSave 返回对象中未消费的 validateAutoCode/configSaving → 移除
- useModuleConfig 返回对象中未消费的 8 个成员 → 移除(仅保留 index.vue 解构的 5 个)
- FormInspector 中 .mm-fdesign__stale-tag 死样式(预留样式,模板未使用) → 删除
- ModuleBasicPanel 中 .mm-basic__hint 死样式(模板未使用) → 删除

lint: 零新增告警(54w/3e 不变);test: 184/185 通过(唯一失败为既有 fms-table 判断)
This commit is contained in:
oneao committed 2026-08-28 19:21:28 +08:00
1 parent fefdcb9ca8
commit c2fee5a294
9 files changed
+6 -61

No files matched your search

@@ -272,15 +272,6 @@ function onI18nSaved(key) {
} }
} }
/* 编辑方式等字段的说明文字 */
.mm-basic__hint {
grid-column: 1 / -1;
margin: -4px 0 8px;
color: var(--fms-text-secondary);
font-size: 12px;
line-height: 1.6;
}
.mm-basic__i18n-btn { .mm-basic__i18n-btn {
flex: none; flex: none;
display: inline-flex; display: inline-flex;
@@ -234,19 +234,6 @@ const TEXTAREA_HEIGHT_OPTIONS = [
font-size: 10px; font-size: 10px;
} }
/* 「源已移除」告警徽标:供后续若字段来源缺失时高亮使用(仅样式层) */
.mm-fdesign__stale-tag {
display: inline-flex;
align-items: center;
padding: 0 5px;
border: 1px solid color-mix(in srgb, var(--fms-danger, #f5222d) 45%, transparent);
border-radius: var(--fms-control-radius, 4px);
background: color-mix(in srgb, var(--fms-danger, #f5222d) 10%, var(--fms-card));
color: var(--fms-danger, #f5222d);
font-size: 10px;
line-height: 16px;
}
/* 折叠属性面板(覆盖 ui Button 默认尺寸) */ /* 折叠属性面板(覆盖 ui Button 默认尺寸) */
.mm-fdesign__collapse.button { .mm-fdesign__collapse.button {
display: inline-flex; display: inline-flex;
@@ -59,7 +59,7 @@ const { fieldName, controlTypeLabel } = useFieldLookup(() => props.fields)
/* ================= 分组树构建 ================= /* ================= 分组树构建 =================
* 树构建与元信息推导见 composables/useGroupTree(面板与结构树共用)。 */ * 树构建与元信息推导见 composables/useGroupTree(面板与结构树共用)。 */
const { groupNodeMap, groupColumnsMap, bandMeta, isDescendantGroup, groupIdOfRow } = useGroupTree( const { groupColumnsMap, bandMeta, isDescendantGroup, groupIdOfRow } = useGroupTree(
computed(() => props.groups), computed(() => props.groups),
computed(() => props.rows), computed(() => props.rows),
) )
@@ -145,7 +145,7 @@ const columnWidthOptions = computed(() => {
}) })
/* ================= 分组树(多级表头) ================= */ /* ================= 分组树(多级表头) ================= */
const { groupNodeMap, groupColumnsMap, bandMeta, isDescendantGroup, groupIdOfRow } = useGroupTree(localGroups, localEdit) const { groupColumnsMap, bandMeta, isDescendantGroup, groupIdOfRow } = useGroupTree(localGroups, localEdit)
const visualColumns = computed(() => { const visualColumns = computed(() => {
const columns = groupColumnsMap.value const columns = groupColumnsMap.value
@@ -5,7 +5,7 @@
*/ */
import { computed } from 'vue' import { computed } from 'vue'
export const FIELD_TYPE_LABELS = { const FIELD_TYPE_LABELS = {
input: '输入框', input: '输入框',
textarea: '文本域', textarea: '文本域',
number: '数字', number: '数字',
@@ -6,7 +6,7 @@
import { computed } from 'vue' import { computed } from 'vue'
// toSorted 返回新数组,必须回写原数组,否则 buildGroupTree 的排序不生效 // toSorted 返回新数组,必须回写原数组,否则 buildGroupTree 的排序不生效
export function sortGroupNodesByXh(nodes) { function sortGroupNodesByXh(nodes) {
const sorted = nodes.toSorted((a, b) => (a.group.b_xh || 0) - (b.group.b_xh || 0)) const sorted = nodes.toSorted((a, b) => (a.group.b_xh || 0) - (b.group.b_xh || 0))
nodes.splice(0, nodes.length, ...sorted) nodes.splice(0, nodes.length, ...sorted)
return nodes return nodes
@@ -114,5 +114,5 @@ export function useGroupTree(groupsRef, rowsRef) {
return false return false
} }
return { groupTree, groupNodeMap, groupColumnsMap, bandMeta, isDescendantGroup, groupIdOfRow } return { groupColumnsMap, bandMeta, isDescendantGroup, groupIdOfRow }
} }
@@ -264,17 +264,9 @@ export function useModuleConfig(deps) {
} }
return { return {
configLoading,
configSyncing,
loadedModuleId,
originals,
drafts,
hasModuleChanges,
loadModuleConfig,
reloadModule, reloadModule,
onModuleSelect, onModuleSelect,
onFieldsUpdate, onFieldsUpdate,
applyDisabledFieldDefaults,
onAutoCodeUpdate, onAutoCodeUpdate,
syncFields, syncFields,
} }
@@ -162,5 +162,5 @@ export function useModuleSave({
} }
} }
return { saveModule, validateAutoCode, configSaving } return { saveModule }
} }
@@ -121,20 +121,6 @@ export function removeModuleNode(nodes, id) {
} }
} }
/** 从根到当前节点的名称路径(面包屑用) */
export function buildBreadcrumb(node, finder) {
const names = []
let cur = node
const seen = new Set()
while (cur && !seen.has(String(cur.b_id))) {
seen.add(String(cur.b_id))
names.unshift(cur.b_name || cur.b_code)
if (cur.b_parent_id == null) break
cur = finder(String(cur.b_parent_id))
}
return names
}
/* ================= 响应式 composable ================= */ /* ================= 响应式 composable ================= */
/** /**
@@ -361,22 +347,11 @@ export function useModuleTree(deps) {
}) })
} }
const moduleBreadcrumb = computed(() =>
selectedModule.value
? buildBreadcrumb(selectedModule.value, (id) => findModuleNode(moduleTreeData.value, id))
: [],
)
return { return {
moduleTreeLoading,
moduleKeyword,
moduleExpandedKeys,
filteredModuleTree, filteredModuleTree,
loadModuleTree, loadModuleTree,
buildModuleContextMenu, buildModuleContextMenu,
onModuleContextMenuClick, onModuleContextMenuClick,
addModule, addModule,
deleteModule,
moduleBreadcrumb,
} }
} }