bhd-components 0.11.10 → 0.11.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.es5.development.js +20 -35
- package/dist/index.esm.es5.production.js +1 -1
- package/dist/vendor.esm.es5.development.js +1 -1
- package/dist/vendor.esm.es5.production.js +1 -1
- package/es2017/AIMessageList/components/virtuosoList/index.js +17 -32
- package/esm/AIMessageList/components/virtuosoList/index.js +20 -35
- package/package.json +1 -1
|
@@ -15053,7 +15053,7 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
15053
15053
|
sendingId: "",
|
|
15054
15054
|
isSending: isSending
|
|
15055
15055
|
});
|
|
15056
|
-
|
|
15056
|
+
// const timeRenderCache = useRef(new Map<string, React.ReactNode>()).current;
|
|
15057
15057
|
// const htmlRenderCache = useRef(new Map<string, React.ReactNode>()).current;
|
|
15058
15058
|
useImperativeHandle(ref, function() {
|
|
15059
15059
|
return {
|
|
@@ -15568,55 +15568,40 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
15568
15568
|
var renderTime = function(item) {
|
|
15569
15569
|
if (!showTime) return null;
|
|
15570
15570
|
// 生成缓存键
|
|
15571
|
-
|
|
15571
|
+
// const cacheKey = `${item.id}`;
|
|
15572
15572
|
// 检查缓存中是否已有结果
|
|
15573
|
-
if (timeRenderCache.has(cacheKey)) {
|
|
15574
|
-
|
|
15575
|
-
}
|
|
15573
|
+
// if (timeRenderCache.has(cacheKey)) {
|
|
15574
|
+
// return timeRenderCache.get(cacheKey);
|
|
15575
|
+
// }
|
|
15576
15576
|
var index = recordRef.current.dataSource.findIndex(function(i) {
|
|
15577
15577
|
return i.id == item.id;
|
|
15578
15578
|
});
|
|
15579
15579
|
var timeObj = parseDate(item.createTime);
|
|
15580
15580
|
var time = null;
|
|
15581
15581
|
var nowObj = parseDate(new Date().valueOf());
|
|
15582
|
+
var prevItem = recordRef.current.dataSource[index - 1];
|
|
15582
15583
|
if (timeObj.year === nowObj.year && timeObj.month === nowObj.month && timeObj.day === nowObj.day) {
|
|
15583
15584
|
// 当天显示 时分
|
|
15584
|
-
time = "".concat(timeObj.hours, ":").concat(timeObj.minutes);
|
|
15585
|
-
} else {
|
|
15586
|
-
// 非当天 显示年月日 时分
|
|
15587
|
-
var prevItem = recordRef.current.dataSource[index - 1];
|
|
15588
15585
|
if (prevItem) {
|
|
15589
15586
|
var beforeTime = prevItem.createTime;
|
|
15590
15587
|
var beforeTimeObj = parseDate(beforeTime);
|
|
15591
15588
|
// 判断与上一条数据 是否超过10分钟
|
|
15592
15589
|
if (timeObj.timestamp - beforeTimeObj.timestamp > 10 * 60 * 1000) {
|
|
15590
|
+
time = "".concat(timeObj.hours, ":").concat(timeObj.minutes);
|
|
15591
|
+
}
|
|
15592
|
+
} else {
|
|
15593
|
+
time = "".concat(timeObj.hours, ":").concat(timeObj.minutes);
|
|
15594
|
+
}
|
|
15595
|
+
} else {
|
|
15596
|
+
// 非当天 显示年月日 时分
|
|
15597
|
+
var prevItem1 = recordRef.current.dataSource[index - 1];
|
|
15598
|
+
if (prevItem1) {
|
|
15599
|
+
var beforeTime1 = prevItem1.createTime;
|
|
15600
|
+
var beforeTimeObj1 = parseDate(beforeTime1);
|
|
15601
|
+
// 判断与上一条数据 是否超过10分钟
|
|
15602
|
+
if (timeObj.timestamp - beforeTimeObj1.timestamp > 10 * 60 * 1000) {
|
|
15593
15603
|
time = "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day, " ").concat(timeObj.hours, ":").concat(timeObj.minutes);
|
|
15594
15604
|
}
|
|
15595
|
-
// if (
|
|
15596
|
-
// timeObj.year !== beforeTimeObj.year ||
|
|
15597
|
-
// timeObj.month !== beforeTimeObj.month ||
|
|
15598
|
-
// timeObj.day !== beforeTimeObj.day
|
|
15599
|
-
// ) {
|
|
15600
|
-
// // 显示 年月日 时分
|
|
15601
|
-
// time = `${timeObj.year}-${timeObj.month}-${timeObj.day} ${timeObj.hours}:${timeObj.minutes}`;
|
|
15602
|
-
// } else {
|
|
15603
|
-
// // 没有跨天 判断是否相隔超过10分钟
|
|
15604
|
-
// if (timeObj.timestamp - beforeTimeObj.timestamp > 10 * 60 * 1000) {
|
|
15605
|
-
// // 超过10分钟 显示
|
|
15606
|
-
// // let now = new Date();
|
|
15607
|
-
// // // 当天的日期
|
|
15608
|
-
// // let nowTimeStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}`;
|
|
15609
|
-
// // if (
|
|
15610
|
-
// // nowTimeStr === `${timeObj.year}-${timeObj.month}-${timeObj.day}`
|
|
15611
|
-
// // ) {
|
|
15612
|
-
// // // 是当天 显示 时分
|
|
15613
|
-
// // time = `${timeObj.hours}:${timeObj.minutes}`;
|
|
15614
|
-
// // } else {
|
|
15615
|
-
// // // 不是当天 显示 年月日 时分
|
|
15616
|
-
// // time = `${timeObj.year}-${timeObj.month}-${timeObj.day} ${timeObj.hours}:${timeObj.minutes}`;
|
|
15617
|
-
// // }
|
|
15618
|
-
// }
|
|
15619
|
-
// }
|
|
15620
15605
|
} else {
|
|
15621
15606
|
time = "".concat(timeObj.year, "-").concat(timeObj.month, "-").concat(timeObj.day, " ").concat(timeObj.hours, ":").concat(timeObj.minutes);
|
|
15622
15607
|
}
|
|
@@ -15626,7 +15611,7 @@ var VirtuosoList = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
15626
15611
|
children: time
|
|
15627
15612
|
}) : null;
|
|
15628
15613
|
// 将结果存入缓存
|
|
15629
|
-
timeRenderCache.set(cacheKey, result);
|
|
15614
|
+
// timeRenderCache.set(cacheKey, result);
|
|
15630
15615
|
return result;
|
|
15631
15616
|
};
|
|
15632
15617
|
var findCopyContent = function(e) {
|