- 集成消息服务API,实现消息列表分页加载功能 - 添加消息未读数量实时更新,每30秒自动刷新一次 - 实现消息标记已读、删除消息等操作功能 - 优化消息界面UI,支持无限滚动加载更多消息 - 添加消息内容预览和跳转到相关业务单据功能 - 在个人中心页面增加调试模式开关快捷入口 - 修复订单车辆组件中草帘价格验证逻辑问题 - 更新供应商称重模块,新增计价方式和定金支付验证 - 调整包装创建页面品牌选择样式布局 - 更新应用版本号至v0.0.76 - 集成经销商对账记录等相关业务服务模块
65 lines
1.5 KiB
JavaScript
65 lines
1.5 KiB
JavaScript
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
function processFile(filePath) {
|
|
try {
|
|
let content = fs.readFileSync(filePath, "utf8");
|
|
const original = content;
|
|
|
|
// 替换所有 number[] 为 string[]
|
|
content = content.replace(/number\[\]/g, "string[]");
|
|
|
|
// 可选:替换其他相关类型
|
|
content = content.replace(/Array<number>/g, "Array<string>");
|
|
content = content.replace(
|
|
/ReadonlyArray<number>/g,
|
|
"ReadonlyArray<string>",
|
|
);
|
|
|
|
if (content !== original) {
|
|
fs.writeFileSync(filePath, content, "utf8");
|
|
console.log(`✓ Updated: ${path.relative(process.cwd(), filePath)}`);
|
|
return true;
|
|
}
|
|
return false;
|
|
} catch (error) {
|
|
console.error(`✗ Error processing ${filePath}:`, error.message);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function processDirectory(dirPath) {
|
|
let updatedCount = 0;
|
|
|
|
function walk(dir) {
|
|
const items = fs.readdirSync(dir);
|
|
|
|
for (const item of items) {
|
|
const fullPath = path.join(dir, item);
|
|
const stat = fs.statSync(fullPath);
|
|
|
|
if (stat.isDirectory()) {
|
|
walk(fullPath);
|
|
} else if (item.endsWith(".ts") || item.endsWith(".tsx")) {
|
|
if (processFile(fullPath)) {
|
|
updatedCount++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
walk(dirPath);
|
|
return updatedCount;
|
|
}
|
|
|
|
// 主程序
|
|
const targetDir = "src/services";
|
|
if (fs.existsSync(targetDir)) {
|
|
console.log(`Processing directory: ${targetDir}`);
|
|
const updated = processDirectory(targetDir);
|
|
console.log(`\nDone! Updated ${updated} files.`);
|
|
} else {
|
|
console.error(`Directory not found: ${targetDir}`);
|
|
process.exit(1);
|
|
}
|