新增readme
This commit is contained in:
22
src/constants/departments.js
Normal file
22
src/constants/departments.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* 部门常量
|
||||
*
|
||||
* 与后端 backmanager-server 数据库 departments 表定义的 6 个部门一一对应。
|
||||
* 当前使用本地常量,避免每次加载都请求后端。
|
||||
*
|
||||
* 如需改为动态获取,请:
|
||||
* 1. 确保后端已部署 GET /api/departments 接口
|
||||
* 2. 在 src/api/employee.js 中取消 getDepartmentList 的注释(替换现有实现)
|
||||
* 3. 在组件中调用 getDepartmentList() 替代导入此文件
|
||||
*/
|
||||
export const DEPARTMENT_LIST = [
|
||||
{ id: 1, name: 'admin', description: '信息技术部' },
|
||||
{ id: 2, name: 'general_manager', description: '总经理办公室' },
|
||||
{ id: 3, name: 'franchise_manager', description: '招商部' },
|
||||
{ id: 4, name: 'operations_manager', description: '运营部' },
|
||||
{ id: 5, name: 'procurement_manager', description: '采购部' },
|
||||
{ id: 6, name: 'finance', description: '财务部' },
|
||||
]
|
||||
|
||||
/** 描述文本列表(用于 employee 表单的部门下拉选择) */
|
||||
export const DEPARTMENT_NAME_LIST = DEPARTMENT_LIST.map(d => d.description)
|
||||
Reference in New Issue
Block a user