// 涉及全景相关配置信息 export const PAYROLL_HEADER = [ { label: '月份', prop: 'month' }, { label: '机构', prop: 'organizationName', width: 200 }, { label: '姓名', prop: 'employeeName', align: 'center' }, { label: '统一认证号', prop: 'unifiedCertificationNumber', align: 'center', width: 120 }, { label: '起薪类型', prop: 'payrollCategory' }, { label: '绩效工资', prop: 'meritPay', align: 'center' }, { label: '加班工资', prop: 'workOvertime', align: 'center' }, { label: '交通补贴', prop: 'commuteSubsidy' }, { label: '通讯补贴', prop: 'communicationSubsidy' }, { label: '午餐费补贴', prop: 'lunchSubsidy', width: 120 }, { label: '岗位贡献补贴', prop: 'jobContributionSubsidy', width: 120 }, { label: '交流干部补贴', prop: 'exchangeCadresSubsidy', width: 120 }, { label: '网点岗位津贴', prop: 'networkJobSubsidy', width: 120 }, { label: '网讯稿酬', prop: 'newsSubsidy' }, { label: '独生子女费', prop: 'onlyChild', width: 120 }, { label: '养老保险', prop: 'pensionInsurance' }, { label: '医疗保险', prop: 'medicalInsurance' }, { label: '失业保险', prop: 'unemploymentInsurance' }, { label: '住房公积金', prop: 'housingProvidentFund', width: 120 }, { label: '企业年金', prop: 'enterpriseAnnuity' }, { label: '个人所得税', prop: 'individualIncomeTax', width: 120 }, { label: '工资扣款', prop: 'payrollDeduction' }, { label: '合计', prop: 'totalSalary', align: 'center' } ] /** * 查询节点返回完整路径数组 * @param {Array} tree 树形结构数据 * @param {String} targetCode 目标节点 * @param {Array} path 路径存储 * @param {Object} obj 节点属性 * @returns */ export function findPath (tree, targetCode, path = [], obj = { children: 'child', value: 'organizationNo', label: 'organizationName' }) { for (const node of tree) { // 将当前节点加入路径 const currentPath = [...path, { value: node[obj.value], label: node[obj.label] }] // 如果当前节点是目标节点,返回路径 if (node[obj.value] === targetCode) { return currentPath } // 如果当前节点有子节点,递归查找 if (node[obj.children] && node[obj.children].length > 0) { const result = findPath(node[obj.children], targetCode, currentPath, obj) if (result) { return result } } } // 如果没有找到目标节点,返回 null return null }