完成大体功能和样式

This commit is contained in:
2026-01-15 17:18:24 +08:00
parent 036eb3a206
commit 44a4b33502
211 changed files with 5480 additions and 7826 deletions

16
common/utils/text.js Normal file
View File

@@ -0,0 +1,16 @@
/**
* 文本省略处理
* @param {String} text 原始文本
* @param {Number} maxLen 最大显示字数
* @param {String} suffix 省略后缀,默认 ...
* @returns {String}
*/
function ellipsisText(text, maxLen = 20, suffix = '...') {
if (!text) return '';
if (text.length <= maxLen) return text;
return text.slice(0, maxLen) + suffix;
}
module.exports = {
ellipsisText
};