主要更新: - 更新所有12个产业的教务系统数据和功能 - 删除所有 node_modules 文件夹(节省3.7GB) - 删除所有 .yoyo 缓存文件夹(节省1.2GB) - 删除所有 dist 构建文件(节省55MB) 项目优化: - 项目大小从 8.1GB 减少到 3.2GB(节省60%空间) - 保留完整的源代码和配置文件 - .gitignore 已配置,防止再次提交大文件 启动脚本: - start-industry.sh/bat/ps1 脚本会自动检测并安装依赖 - 首次启动时自动运行 npm install - 支持单个或批量启动产业系统 🤖 Generated with 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(' - 缺少立即投递按钮逻辑');
|
||
}
|
||
}
|