主要更新内容: - 优化UI组件(视频播放器、HR访问模态框、岗位信息展示等) - 更新数据文件(简历、岗位、项目案例等) - 添加新的图片资源(面试状态图标等) - 新增AgentPage等页面组件 - 清理旧的备份文件,提升代码库整洁度 - 优化岗位等级和面试状态的数据结构 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
89 lines
4.2 KiB
JavaScript
89 lines
4.2 KiB
JavaScript
// 验证立即投递按钮与岗位剩余招聘量的隐藏逻辑一致性
|
||
|
||
const fs = require('fs');
|
||
const path = require('path');
|
||
|
||
console.log('🔍 验证立即投递按钮隐藏逻辑\n');
|
||
console.log('='.repeat(80));
|
||
|
||
// 检查 JobInfoModal 组件
|
||
console.log('\n1. 检查 JobInfoModal/index.jsx');
|
||
const jsxContent = fs.readFileSync(
|
||
path.join(__dirname, 'src/pages/CompanyJobsPage/components/JobInfoModal/index.jsx'),
|
||
'utf-8'
|
||
);
|
||
|
||
// 查找剩余招聘量的展示逻辑
|
||
const remainingPositionsMatch = jsxContent.match(/\/\*.*岗位剩余量.*\*\/[\s\S]*?\{[^}]*!data\?\.\isDelivered[\s\S]*?岗位招聘数量仅剩[\s\S]*?\}\)/);
|
||
|
||
// 查找立即投递按钮的展示逻辑
|
||
const deliverButtonMatch = jsxContent.match(/\/\*.*立即投递按钮.*\*\/[\s\S]*?\{[^}]*!data\?\.\isDelivered[\s\S]*?立即投递[\s\S]*?\}\)/);
|
||
|
||
if (remainingPositionsMatch && deliverButtonMatch) {
|
||
console.log(' ✅ 找到岗位剩余招聘量和立即投递按钮的展示逻辑');
|
||
|
||
// 提取两个逻辑块的条件
|
||
const extractConditions = (text) => {
|
||
return {
|
||
hasIsDelivered: text.includes('!data?.isDelivered'),
|
||
hasIsExpired: text.includes('!data?.isExpired'),
|
||
hasStatusExpired: text.includes("data?.status !== 'expired'"),
|
||
hasHideDeliverButton: text.includes('!hideDeliverButton')
|
||
};
|
||
};
|
||
|
||
const remainingConditions = extractConditions(remainingPositionsMatch[0]);
|
||
const deliverButtonConditions = extractConditions(deliverButtonMatch[0]);
|
||
|
||
console.log('\n 📋 岗位剩余招聘量条件:');
|
||
console.log(` - 未投递检查: ${remainingConditions.hasIsDelivered ? '✅' : '❌'}`);
|
||
console.log(` - 未过期检查: ${remainingConditions.hasIsExpired ? '✅' : '❌'}`);
|
||
console.log(` - status检查: ${remainingConditions.hasStatusExpired ? '✅' : '❌'}`);
|
||
console.log(` - 非面试状态: ${remainingConditions.hasHideDeliverButton ? '✅' : '❌'}`);
|
||
|
||
console.log('\n 📋 立即投递按钮条件:');
|
||
console.log(` - 未投递检查: ${deliverButtonConditions.hasIsDelivered ? '✅' : '❌'}`);
|
||
console.log(` - 未过期检查: ${deliverButtonConditions.hasIsExpired ? '✅' : '❌'}`);
|
||
console.log(` - status检查: ${deliverButtonConditions.hasStatusExpired ? '✅' : '❌'}`);
|
||
console.log(` - 非面试状态: ${deliverButtonConditions.hasHideDeliverButton ? '✅' : '❌'}`);
|
||
|
||
// 检查两个逻辑是否一致
|
||
const isConsistent =
|
||
remainingConditions.hasIsDelivered === deliverButtonConditions.hasIsDelivered &&
|
||
remainingConditions.hasIsExpired === deliverButtonConditions.hasIsExpired &&
|
||
remainingConditions.hasStatusExpired === deliverButtonConditions.hasStatusExpired &&
|
||
remainingConditions.hasHideDeliverButton === deliverButtonConditions.hasHideDeliverButton;
|
||
|
||
console.log(`\n ${isConsistent ? '✅' : '❌'} 两者逻辑${isConsistent ? '完全一致' : '不一致'}`);
|
||
|
||
if (isConsistent &&
|
||
remainingConditions.hasIsDelivered &&
|
||
remainingConditions.hasIsExpired &&
|
||
remainingConditions.hasStatusExpired &&
|
||
remainingConditions.hasHideDeliverButton) {
|
||
console.log('\n' + '='.repeat(80));
|
||
console.log('\n✅ 所有检查通过!立即投递按钮与岗位剩余招聘量使用相同的隐藏逻辑。\n');
|
||
console.log('📝 统一隐藏规则:');
|
||
console.log(' 以下情况将同时隐藏"岗位剩余招聘量"和"立即投递按钮":');
|
||
console.log(' - ✅ 已投递的岗位 (isDelivered = true)');
|
||
console.log(' - ✅ 已过期的岗位 (isExpired = true 或 status = "expired")');
|
||
console.log(' - ✅ 岗位面试状态中的岗位 (hideDeliverButton = true)');
|
||
console.log('\n 只有未投递、未过期的普通岗位才会显示这两个元素。');
|
||
} else {
|
||
console.log('\n' + '='.repeat(80));
|
||
console.log('\n⚠️ 检查未通过!');
|
||
if (!isConsistent) {
|
||
console.log(' ❌ 岗位剩余招聘量和立即投递按钮的显示逻辑不一致。\n');
|
||
}
|
||
}
|
||
|
||
} else {
|
||
console.log(' ❌ 未找到完整的展示逻辑');
|
||
if (!remainingPositionsMatch) {
|
||
console.log(' - 缺少岗位剩余招聘量逻辑');
|
||
}
|
||
if (!deliverButtonMatch) {
|
||
console.log(' - 缺少立即投递按钮逻辑');
|
||
}
|
||
}
|