This commit is contained in:
zlwu committed 2026-05-20 15:10:55 +08:00
1 parent 27ac28b8f5
commit 276299ff27
16 files changed
+3999 -3707

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
# Graph Report - src (2026-05-20)
## Corpus Check
- Large corpus: 575 files · ~284,580 words. Semantic extraction will be expensive (many Claude tokens). Consider running on a subfolder, or use --no-semantic to run AST-only.
- Large corpus: 575 files · ~284,612 words. Semantic extraction will be expensive (many Claude tokens). Consider running on a subfolder, or use --no-semantic to run AST-only.
## Summary
- 1440 nodes · 1839 edges · 43 communities detected
+1 -1
View File
@@ -263,7 +263,7 @@
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/workflow/process/index.vue": 1779227504.2942972,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/menu/index.vue": 1779257191.27756,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/site/index.vue": 1779257191.280453,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue": 1779259560.1445239,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue": 1779259846.8851933,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dict/index.vue": 1779259163.7560437,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/leave/index.vue": 1779257191.2768743,
"/Users/wuzilong/work/00code/zkxw/web-admin/src/views/production/output-type/index.vue": 1779257191.2697432,
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_zkxw_web_admin_src_views_system_dept_index_vue", "label": "index.vue", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L1"}, {"id": "dept_index_get", "label": "get()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L323"}, {"id": "dept_index_catch", "label": "catch()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L457"}, {"id": "dept_index_preorder", "label": "preorder()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L496"}, {"id": "dept_index_postorder", "label": "postorder()", "file_type": "code", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L504"}], "edges": [{"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_system_dept_index_vue", "target": "element_plus", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L245", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_system_dept_index_vue", "target": "icons_vue", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L246", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_system_dept_index_vue", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_components_business_system_view_dialog_index_vue", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L247", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_system_dept_index_vue", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_api_admin", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L248", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_system_dept_index_vue", "target": "users_wuzilong_work_00code_zkxw_web_admin_src_utils_tree_path", "relation": "imports_from", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L256", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_system_dept_index_vue", "target": "dept_index_get", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L323", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_system_dept_index_vue", "target": "dept_index_catch", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L457", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_system_dept_index_vue", "target": "dept_index_preorder", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L496", "weight": 1.0}, {"source": "users_wuzilong_work_00code_zkxw_web_admin_src_views_system_dept_index_vue", "target": "dept_index_postorder", "relation": "contains", "confidence": "EXTRACTED", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L504", "weight": 1.0}], "raw_calls": [{"caller_nid": "dept_index_get", "callee": "trim", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L324"}, {"caller_nid": "dept_index_catch", "callee": "error", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L458"}, {"caller_nid": "dept_index_preorder", "callee": "toggleRowExpansion", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L499"}, {"caller_nid": "dept_index_postorder", "callee": "toggleRowExpansion", "source_file": "/Users/wuzilong/work/00code/zkxw/web-admin/src/views/system/dept/index.vue", "source_location": "L508"}]}
+59 -22
View File
@@ -88,9 +88,9 @@
/>
<el-table-column prop="userNo" label="用户账号" min-width="120" align="center" header-align="center" />
<el-table-column prop="nickName" label="用户名" min-width="100" align="center" header-align="center" />
<el-table-column prop="deptName" label="所属组织" min-width="160" align="center" header-align="center">
<el-table-column prop="deptName" label="所属组织" min-width="200" align="center" header-align="center">
<template #default="{ row }">
{{ row.deptName || '-' }}
{{ formatUserDeptDisplay(row) }}
</template>
</el-table-column>
<el-table-column prop="phoneNo" label="手机号" min-width="140" align="center" header-align="center">
@@ -219,6 +219,7 @@
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
import {
fetchUserList,
fetchUserDetail,
fetchCreateUser,
fetchUpdateUser,
fetchDeleteUser,
@@ -226,6 +227,7 @@
fetchDeptTree,
fetchRoleOptions
} from '@/api/admin'
import { buildPathLabelMapFromTreeRoots } from '@/utils/tree-path'
const roleOptions = ref<Array<{ label: string; value: string }>>([])
@@ -244,6 +246,29 @@
const deptTreeRef = ref()
const selectedDeptId = ref<string | null>(null)
const deptPathLabelMap = computed(() =>
buildPathLabelMapFromTreeRoots(deptTree.value, {
idKey: 'id',
nameKey: 'deptName',
childrenKey: 'children'
})
)
function formatUserDeptDisplay(row: Api.User.UserItem) {
const id = (row.deptId || '').trim()
if (!id) return '—'
return deptPathLabelMap.value.get(id) || row.deptName || '—'
}
function formatUserRoleDisplay(row: Api.User.UserItem) {
const ids = row.roleIds || []
if (!ids.length) return '—'
const labels = ids
.map((id) => roleOptions.value.find((o) => o.value === id)?.label)
.filter((name): name is string => Boolean(name))
return labels.length ? labels.join('、') : '—'
}
const searchForm = reactive<{ keyword: string; status: string }>({ keyword: '', status: '' })
const tableData = ref<Api.User.UserItem[]>([])
const loading = ref(false)
@@ -359,24 +384,30 @@
formRef.value?.clearValidate?.()
}
function handleEdit(row: Api.User.UserItem) {
async function handleEdit(row: Api.User.UserItem) {
isEdit.value = true
dialogTitle.value = '编辑用户'
editingId.value = row.id
formData.userNo = row.userNo
formData.nickName = row.nickName
formData.password = ''
formData.deptId = row.deptId || ''
formData.email = row.email || ''
formData.phoneNo = row.phoneNo || ''
formData.sex = row.sex || '0'
formData.avatar = row.avatar || ''
formData.status = row.status || '1'
formData.orderNum = row.orderNum ?? 0
formData.remark = row.remark || ''
formData.roleIds = (row as any).roleIds || []
dialogVisible.value = true
formRef.value?.clearValidate?.()
try {
const detail = await fetchUserDetail(row.id)
formData.userNo = detail.userNo
formData.nickName = detail.nickName
formData.password = ''
formData.deptId = detail.deptId || ''
formData.email = detail.email || ''
formData.phoneNo = detail.phoneNo || ''
formData.sex = detail.sex || '0'
formData.avatar = detail.avatar || ''
formData.status = detail.status || '1'
formData.orderNum = detail.orderNum ?? 0
formData.remark = detail.remark || ''
formData.roleIds = detail.roleIds ? [...detail.roleIds] : []
dialogVisible.value = true
formRef.value?.clearValidate?.()
} catch (e) {
console.error('加载用户详情失败:', e)
ElMessage.error('加载用户详情失败')
}
}
async function handleSubmit() {
@@ -393,7 +424,7 @@
status: formData.status,
orderNum: formData.orderNum,
remark: formData.remark?.trim() || undefined,
roleIds: formData.roleIds.length ? formData.roleIds : undefined
roleIds: [...formData.roleIds]
})
} else {
await fetchCreateUser({
@@ -443,7 +474,7 @@
fields: [
{ label: '用户账号', value: row.userNo },
{ label: '用户名', value: row.nickName },
{ label: '所属组织', value: row.deptName },
{ label: '所属组织', value: formatUserDeptDisplay(row) },
{ label: '手机号', value: row.phoneNo },
{ label: '邮箱', value: row.email },
{
@@ -451,6 +482,7 @@
value: ({ '0': '男', '1': '女', '2': '未知' } as Record<string, string>)[row.sex] || '未知'
},
{ label: '状态', value: row.status === '1' ? '正常' : '停用', tagType: row.status === '1' ? 'success' : 'info' },
{ label: '角色', value: formatUserRoleDisplay(row), span: true },
{ label: '创建时间', value: row.createTime },
{ label: '备注', value: row.remark, span: true }
]
@@ -458,9 +490,14 @@
]
})
function handleView(row: Api.User.UserItem) {
viewRow.value = row
viewVisible.value = true
async function handleView(row: Api.User.UserItem) {
try {
viewRow.value = await fetchUserDetail(row.id)
viewVisible.value = true
} catch (e) {
console.error('加载用户详情失败:', e)
ElMessage.error('加载用户详情失败')
}
}
onMounted(() => {