@pisell/materials 6.11.30 → 6.11.32
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendarDemo.js +113 -119
- package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +3 -2
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendarDemo.js +24 -12
- package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +3 -2
- package/package.json +3 -3
|
@@ -1619,55 +1619,47 @@ function buildGroupedCourtRows(courts) {
|
|
|
1619
1619
|
var remainder = courts.filter(function (c) {
|
|
1620
1620
|
return !consumedIds.has(c.id);
|
|
1621
1621
|
});
|
|
1622
|
-
var byType =
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
var idSafe = String(label).replace(/\s+/g, "-");
|
|
1647
|
-
rows.push({
|
|
1648
|
-
kind: "group",
|
|
1649
|
-
id: "group-".concat(idSafe),
|
|
1650
|
-
label: label,
|
|
1651
|
-
count: items.length,
|
|
1652
|
-
collapsed: !!collapsedGroups[label]
|
|
1622
|
+
var byType = {};
|
|
1623
|
+
remainder.forEach(function (court) {
|
|
1624
|
+
var label = court.type && String(court.type).trim() !== "" ? String(court.type) : "Resource";
|
|
1625
|
+
if (!byType[label]) byType[label] = [];
|
|
1626
|
+
byType[label].push(court);
|
|
1627
|
+
});
|
|
1628
|
+
Object.keys(byType).forEach(function (label) {
|
|
1629
|
+
var items = byType[label];
|
|
1630
|
+
if (!items.length) return;
|
|
1631
|
+
var idSafe = String(label).replace(/\s+/g, "-");
|
|
1632
|
+
rows.push({
|
|
1633
|
+
kind: "group",
|
|
1634
|
+
id: "group-".concat(idSafe),
|
|
1635
|
+
label: label,
|
|
1636
|
+
count: items.length,
|
|
1637
|
+
collapsed: !!collapsedGroups[label]
|
|
1638
|
+
});
|
|
1639
|
+
if (!collapsedGroups[label]) {
|
|
1640
|
+
items.forEach(function (court) {
|
|
1641
|
+
return rows.push(_objectSpread(_objectSpread({
|
|
1642
|
+
kind: "court"
|
|
1643
|
+
}, court), {}, {
|
|
1644
|
+
group: label
|
|
1645
|
+
}));
|
|
1653
1646
|
});
|
|
1654
|
-
if (!collapsedGroups[label]) {
|
|
1655
|
-
items.forEach(function (court) {
|
|
1656
|
-
return rows.push(_objectSpread(_objectSpread({
|
|
1657
|
-
kind: "court"
|
|
1658
|
-
}, court), {}, {
|
|
1659
|
-
group: label
|
|
1660
|
-
}));
|
|
1661
|
-
});
|
|
1662
|
-
}
|
|
1663
|
-
};
|
|
1664
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
1665
|
-
if (_loop()) continue;
|
|
1666
1647
|
}
|
|
1667
|
-
}
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1648
|
+
});
|
|
1649
|
+
var courtRowsOnly = rows.filter(function (r) {
|
|
1650
|
+
return r.kind === "court";
|
|
1651
|
+
});
|
|
1652
|
+
/** 全部分组折叠时只有 group 头、无 court 行 → 日视图 0/0 free 与空白主体;退化为平铺 */
|
|
1653
|
+
if (courtRowsOnly.length === 0 && courts.length > 0) {
|
|
1654
|
+
return courts.map(function (c) {
|
|
1655
|
+
return {
|
|
1656
|
+
kind: "court",
|
|
1657
|
+
id: c.id,
|
|
1658
|
+
name: c.name,
|
|
1659
|
+
type: c.type,
|
|
1660
|
+
group: c.type
|
|
1661
|
+
};
|
|
1662
|
+
});
|
|
1671
1663
|
}
|
|
1672
1664
|
return rows;
|
|
1673
1665
|
}
|
|
@@ -1678,34 +1670,34 @@ function buildGroupedCourtRows(courts) {
|
|
|
1678
1670
|
*/
|
|
1679
1671
|
function assignDayOverlapLanesInPlace(overlays) {
|
|
1680
1672
|
var byCourt = new Map();
|
|
1681
|
-
var
|
|
1682
|
-
|
|
1673
|
+
var _iterator = _createForOfIteratorHelper(overlays),
|
|
1674
|
+
_step;
|
|
1683
1675
|
try {
|
|
1684
|
-
for (
|
|
1685
|
-
var o =
|
|
1676
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
1677
|
+
var o = _step.value;
|
|
1686
1678
|
var list = byCourt.get(o.courtId);
|
|
1687
1679
|
if (list) list.push(o);else byCourt.set(o.courtId, [o]);
|
|
1688
1680
|
}
|
|
1689
1681
|
} catch (err) {
|
|
1690
|
-
|
|
1682
|
+
_iterator.e(err);
|
|
1691
1683
|
} finally {
|
|
1692
|
-
|
|
1684
|
+
_iterator.f();
|
|
1693
1685
|
}
|
|
1694
|
-
var
|
|
1695
|
-
|
|
1686
|
+
var _iterator2 = _createForOfIteratorHelper(byCourt.values()),
|
|
1687
|
+
_step2;
|
|
1696
1688
|
try {
|
|
1697
|
-
for (
|
|
1698
|
-
var _list =
|
|
1689
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
1690
|
+
var _list = _step2.value;
|
|
1699
1691
|
_list.sort(function (a, b) {
|
|
1700
1692
|
if (a.start !== b.start) return a.start - b.start;
|
|
1701
1693
|
return b.span - a.span;
|
|
1702
1694
|
});
|
|
1703
1695
|
var laneEnds = [];
|
|
1704
|
-
var
|
|
1705
|
-
|
|
1696
|
+
var _iterator3 = _createForOfIteratorHelper(_list),
|
|
1697
|
+
_step3;
|
|
1706
1698
|
try {
|
|
1707
|
-
for (
|
|
1708
|
-
var _o =
|
|
1699
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
1700
|
+
var _o = _step3.value;
|
|
1709
1701
|
var oEnd = _o.start + _o.span;
|
|
1710
1702
|
var lane = 0;
|
|
1711
1703
|
while (lane < laneEnds.length && laneEnds[lane] > _o.start) {
|
|
@@ -1720,52 +1712,52 @@ function assignDayOverlapLanesInPlace(overlays) {
|
|
|
1720
1712
|
}
|
|
1721
1713
|
/** 仅用「实际占到的最大 lane+1」,避免 laneEnds 与真实条数不一致时多留空带 */
|
|
1722
1714
|
} catch (err) {
|
|
1723
|
-
|
|
1715
|
+
_iterator3.e(err);
|
|
1724
1716
|
} finally {
|
|
1725
|
-
|
|
1717
|
+
_iterator3.f();
|
|
1726
1718
|
}
|
|
1727
1719
|
var maxL = 0;
|
|
1728
|
-
var
|
|
1729
|
-
|
|
1720
|
+
var _iterator4 = _createForOfIteratorHelper(_list),
|
|
1721
|
+
_step4;
|
|
1730
1722
|
try {
|
|
1731
|
-
for (
|
|
1732
|
-
var _o2 =
|
|
1723
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
1724
|
+
var _o2 = _step4.value;
|
|
1733
1725
|
maxL = Math.max(maxL, _o2.lane);
|
|
1734
1726
|
}
|
|
1735
1727
|
} catch (err) {
|
|
1736
|
-
|
|
1728
|
+
_iterator4.e(err);
|
|
1737
1729
|
} finally {
|
|
1738
|
-
|
|
1730
|
+
_iterator4.f();
|
|
1739
1731
|
}
|
|
1740
1732
|
var laneCount = Math.max(1, maxL + 1);
|
|
1741
|
-
var
|
|
1742
|
-
|
|
1733
|
+
var _iterator5 = _createForOfIteratorHelper(_list),
|
|
1734
|
+
_step5;
|
|
1743
1735
|
try {
|
|
1744
|
-
for (
|
|
1745
|
-
var _o3 =
|
|
1736
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
1737
|
+
var _o3 = _step5.value;
|
|
1746
1738
|
_o3.laneCount = laneCount;
|
|
1747
1739
|
}
|
|
1748
1740
|
} catch (err) {
|
|
1749
|
-
|
|
1741
|
+
_iterator5.e(err);
|
|
1750
1742
|
} finally {
|
|
1751
|
-
|
|
1743
|
+
_iterator5.f();
|
|
1752
1744
|
}
|
|
1753
1745
|
}
|
|
1754
1746
|
} catch (err) {
|
|
1755
|
-
|
|
1747
|
+
_iterator2.e(err);
|
|
1756
1748
|
} finally {
|
|
1757
|
-
|
|
1749
|
+
_iterator2.f();
|
|
1758
1750
|
}
|
|
1759
1751
|
}
|
|
1760
1752
|
|
|
1761
1753
|
/** 扫描时间轴:同一 court 在任一时刻的最大并行条数(用于行高,与分 lane 一致) */
|
|
1762
1754
|
function maxConcurrentBookingsOnCourt(overlays, courtId) {
|
|
1763
1755
|
var ev = [];
|
|
1764
|
-
var
|
|
1765
|
-
|
|
1756
|
+
var _iterator6 = _createForOfIteratorHelper(overlays),
|
|
1757
|
+
_step6;
|
|
1766
1758
|
try {
|
|
1767
|
-
for (
|
|
1768
|
-
var o =
|
|
1759
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
1760
|
+
var o = _step6.value;
|
|
1769
1761
|
if (o.courtId !== courtId) continue;
|
|
1770
1762
|
ev.push({
|
|
1771
1763
|
t: o.start,
|
|
@@ -1777,9 +1769,9 @@ function maxConcurrentBookingsOnCourt(overlays, courtId) {
|
|
|
1777
1769
|
});
|
|
1778
1770
|
}
|
|
1779
1771
|
} catch (err) {
|
|
1780
|
-
|
|
1772
|
+
_iterator6.e(err);
|
|
1781
1773
|
} finally {
|
|
1782
|
-
|
|
1774
|
+
_iterator6.f();
|
|
1783
1775
|
}
|
|
1784
1776
|
ev.sort(function (a, b) {
|
|
1785
1777
|
if (a.t !== b.t) return a.t - b.t;
|
|
@@ -1814,11 +1806,11 @@ function clusterDayCourtOverlaysByOverlap(overlays, courtId) {
|
|
|
1814
1806
|
var clusters = [];
|
|
1815
1807
|
var cur = [];
|
|
1816
1808
|
var curMaxEnd = -Infinity;
|
|
1817
|
-
var
|
|
1818
|
-
|
|
1809
|
+
var _iterator7 = _createForOfIteratorHelper(sorted),
|
|
1810
|
+
_step7;
|
|
1819
1811
|
try {
|
|
1820
|
-
for (
|
|
1821
|
-
var o =
|
|
1812
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
1813
|
+
var o = _step7.value;
|
|
1822
1814
|
var oe = o.start + o.span;
|
|
1823
1815
|
if (!cur.length) {
|
|
1824
1816
|
cur = [o];
|
|
@@ -1835,9 +1827,9 @@ function clusterDayCourtOverlaysByOverlap(overlays, courtId) {
|
|
|
1835
1827
|
}
|
|
1836
1828
|
}
|
|
1837
1829
|
} catch (err) {
|
|
1838
|
-
|
|
1830
|
+
_iterator7.e(err);
|
|
1839
1831
|
} finally {
|
|
1840
|
-
|
|
1832
|
+
_iterator7.f();
|
|
1841
1833
|
}
|
|
1842
1834
|
if (cur.length) clusters.push(cur);
|
|
1843
1835
|
return clusters;
|
|
@@ -1901,19 +1893,19 @@ function buildOverlayBookings(visibleCourtRows, dayKey, bookings) {
|
|
|
1901
1893
|
/** 同一 court + id 只保留一条 overlay,避免数据源重复时出现叠字/重影 */
|
|
1902
1894
|
var seen = new Set();
|
|
1903
1895
|
var out = [];
|
|
1904
|
-
var
|
|
1896
|
+
var _loop = function _loop() {
|
|
1905
1897
|
var _dayRowHeights$i;
|
|
1906
1898
|
var row = visibleCourtRows[i];
|
|
1907
1899
|
if (row.kind !== "court") return 1; // continue
|
|
1908
1900
|
var rowHeight = (_dayRowHeights$i = dayRowHeights[i]) !== null && _dayRowHeights$i !== void 0 ? _dayRowHeights$i : dayRowHeight;
|
|
1909
|
-
var
|
|
1901
|
+
var _iterator8 = _createForOfIteratorHelper(bookings.filter(function (b) {
|
|
1910
1902
|
return b.courtId === row.id;
|
|
1911
1903
|
})),
|
|
1912
|
-
|
|
1904
|
+
_step8;
|
|
1913
1905
|
try {
|
|
1914
|
-
for (
|
|
1906
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
1915
1907
|
var _item$id;
|
|
1916
|
-
var item =
|
|
1908
|
+
var item = _step8.value;
|
|
1917
1909
|
var dedupeKey = "".concat(row.id, "\0").concat((_item$id = item.id) !== null && _item$id !== void 0 ? _item$id : "", "\0").concat(dayKey);
|
|
1918
1910
|
if (seen.has(dedupeKey)) continue;
|
|
1919
1911
|
var seg = getBookingSegmentForDate(item, dayKey);
|
|
@@ -1936,13 +1928,13 @@ function buildOverlayBookings(visibleCourtRows, dayKey, bookings) {
|
|
|
1936
1928
|
});
|
|
1937
1929
|
}
|
|
1938
1930
|
} catch (err) {
|
|
1939
|
-
|
|
1931
|
+
_iterator8.e(err);
|
|
1940
1932
|
} finally {
|
|
1941
|
-
|
|
1933
|
+
_iterator8.f();
|
|
1942
1934
|
}
|
|
1943
1935
|
};
|
|
1944
1936
|
for (var i = 0; i < visibleCourtRows.length; i++) {
|
|
1945
|
-
if (
|
|
1937
|
+
if (_loop()) continue;
|
|
1946
1938
|
}
|
|
1947
1939
|
assignDayOverlapLanesInPlace(out);
|
|
1948
1940
|
return out;
|
|
@@ -2087,13 +2079,16 @@ export default function BookingCalendarDemo() {
|
|
|
2087
2079
|
var courts = useMemo(function () {
|
|
2088
2080
|
var r = props.resources;
|
|
2089
2081
|
if (Array.isArray(r) && r.length > 0) {
|
|
2090
|
-
|
|
2082
|
+
var mapped = r.filter(function (x) {
|
|
2083
|
+
return x && x.id !== undefined && x.id !== null && String(x.id).trim() !== "";
|
|
2084
|
+
}).map(function (x) {
|
|
2091
2085
|
return {
|
|
2092
|
-
id: x.id,
|
|
2093
|
-
name: x.name,
|
|
2086
|
+
id: String(x.id),
|
|
2087
|
+
name: x.name != null && String(x.name).trim() !== "" ? String(x.name) : String(x.id),
|
|
2094
2088
|
type: x.groupType && String(x.groupType).trim() !== "" ? String(x.groupType) : "Resource"
|
|
2095
2089
|
};
|
|
2096
2090
|
});
|
|
2091
|
+
if (mapped.length > 0) return mapped;
|
|
2097
2092
|
}
|
|
2098
2093
|
return DEFAULT_COURTS;
|
|
2099
2094
|
}, [props.resources]);
|
|
@@ -2465,21 +2460,21 @@ export default function BookingCalendarDemo() {
|
|
|
2465
2460
|
var courtDayDisplayLaneCount = {};
|
|
2466
2461
|
var hiddenDayOverlayIdSet = new Set();
|
|
2467
2462
|
var dayOverlayOverflowPluses = [];
|
|
2468
|
-
var
|
|
2469
|
-
|
|
2463
|
+
var _iterator9 = _createForOfIteratorHelper(visibleCourtRows),
|
|
2464
|
+
_step9;
|
|
2470
2465
|
try {
|
|
2471
|
-
for (
|
|
2472
|
-
var row =
|
|
2466
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
2467
|
+
var row = _step9.value;
|
|
2473
2468
|
if (row.kind !== "court") continue;
|
|
2474
2469
|
var cid = row.id;
|
|
2475
2470
|
var rawLc = maxConcurrentBookingsOnCourt(overlays, cid);
|
|
2476
2471
|
courtDayDisplayLaneCount[cid] = effectiveDayOverlayDisplayLaneCount(rawLc);
|
|
2477
2472
|
var clusters = clusterDayCourtOverlaysByOverlap(overlays, cid);
|
|
2478
|
-
var
|
|
2479
|
-
|
|
2473
|
+
var _iterator10 = _createForOfIteratorHelper(clusters),
|
|
2474
|
+
_step10;
|
|
2480
2475
|
try {
|
|
2481
|
-
for (
|
|
2482
|
-
var cluster =
|
|
2476
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
2477
|
+
var cluster = _step10.value;
|
|
2483
2478
|
if (cluster.length <= DAY_OVERLAY_VISIBLE_BOOKING_CAP) continue;
|
|
2484
2479
|
var sortedByLane = _toConsumableArray(cluster).sort(function (a, b) {
|
|
2485
2480
|
return a.lane - b.lane || a.start - b.start;
|
|
@@ -2491,18 +2486,18 @@ export default function BookingCalendarDemo() {
|
|
|
2491
2486
|
var hidden = sortedByLane.slice(DAY_OVERLAY_VISIBLE_BOOKING_CAP);
|
|
2492
2487
|
var minS = Infinity;
|
|
2493
2488
|
var maxE = -Infinity;
|
|
2494
|
-
var
|
|
2495
|
-
|
|
2489
|
+
var _iterator11 = _createForOfIteratorHelper(cluster),
|
|
2490
|
+
_step11;
|
|
2496
2491
|
try {
|
|
2497
|
-
for (
|
|
2498
|
-
var _o4 =
|
|
2492
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
2493
|
+
var _o4 = _step11.value;
|
|
2499
2494
|
minS = Math.min(minS, _o4.start);
|
|
2500
2495
|
maxE = Math.max(maxE, _o4.start + _o4.span);
|
|
2501
2496
|
}
|
|
2502
2497
|
} catch (err) {
|
|
2503
|
-
|
|
2498
|
+
_iterator11.e(err);
|
|
2504
2499
|
} finally {
|
|
2505
|
-
|
|
2500
|
+
_iterator11.f();
|
|
2506
2501
|
}
|
|
2507
2502
|
var anchor = hidden[0];
|
|
2508
2503
|
dayOverlayOverflowPluses.push({
|
|
@@ -2519,15 +2514,15 @@ export default function BookingCalendarDemo() {
|
|
|
2519
2514
|
});
|
|
2520
2515
|
}
|
|
2521
2516
|
} catch (err) {
|
|
2522
|
-
|
|
2517
|
+
_iterator10.e(err);
|
|
2523
2518
|
} finally {
|
|
2524
|
-
|
|
2519
|
+
_iterator10.f();
|
|
2525
2520
|
}
|
|
2526
2521
|
}
|
|
2527
2522
|
} catch (err) {
|
|
2528
|
-
|
|
2523
|
+
_iterator9.e(err);
|
|
2529
2524
|
} finally {
|
|
2530
|
-
|
|
2525
|
+
_iterator9.f();
|
|
2531
2526
|
}
|
|
2532
2527
|
return {
|
|
2533
2528
|
dayRowHeights: expandedHeights,
|
|
@@ -3234,7 +3229,6 @@ export default function BookingCalendarDemo() {
|
|
|
3234
3229
|
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, key, _objectSpread(_objectSpread({}, prev[key] || {}), {}, _defineProperty({}, filesSubtab, true))));
|
|
3235
3230
|
});
|
|
3236
3231
|
}, [detailItem, detailMode, detailTab, filesSubtab]);
|
|
3237
|
-
console.log(visibleCourtRows, 'visibleCourtRows1234', visibleCourts, collapsedGroups);
|
|
3238
3232
|
return /*#__PURE__*/React.createElement(Spin, {
|
|
3239
3233
|
spinning: Boolean(props.loading),
|
|
3240
3234
|
wrapperClassName: "pisell-rb-cal-spin-wrap flex min-h-0 flex-1 flex-col"
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
/** 与中间日程条同一行:整行深色底,左标题 / 中选日 / 右操作 */
|
|
35
35
|
.pisell-reservation-schedule-band-schedule-row {
|
|
36
36
|
display: grid;
|
|
37
|
-
|
|
37
|
+
/** 左右按内容占位,剩余宽度给中间,避免「等分 1fr」把左侧挤窄后标题与 Segmented 被迫换行 */
|
|
38
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
38
39
|
align-items: center;
|
|
39
40
|
width: 100%;
|
|
40
41
|
min-width: 0;
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
.pisell-reservation-schedule-band-schedule {
|
|
64
|
-
justify-self:
|
|
65
|
+
justify-self: stretch;
|
|
65
66
|
min-width: 0;
|
|
66
67
|
display: flex;
|
|
67
68
|
flex-direction: row;
|
|
@@ -1540,15 +1540,15 @@ function buildGroupedCourtRows(courts, collapsedGroups = {}) {
|
|
|
1540
1540
|
}
|
|
1541
1541
|
});
|
|
1542
1542
|
const remainder = courts.filter((c) => !consumedIds.has(c.id));
|
|
1543
|
-
const byType =
|
|
1544
|
-
|
|
1543
|
+
const byType = {};
|
|
1544
|
+
remainder.forEach((court) => {
|
|
1545
1545
|
const label = court.type && String(court.type).trim() !== "" ? String(court.type) : "Resource";
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
if (!items.length)
|
|
1546
|
+
if (!byType[label]) byType[label] = [];
|
|
1547
|
+
byType[label].push(court);
|
|
1548
|
+
});
|
|
1549
|
+
Object.keys(byType).forEach((label) => {
|
|
1550
|
+
const items = byType[label];
|
|
1551
|
+
if (!items.length) return;
|
|
1552
1552
|
const idSafe = String(label).replace(/\s+/g, "-");
|
|
1553
1553
|
rows.push({
|
|
1554
1554
|
kind: "group",
|
|
@@ -1560,6 +1560,16 @@ function buildGroupedCourtRows(courts, collapsedGroups = {}) {
|
|
|
1560
1560
|
if (!collapsedGroups[label]) {
|
|
1561
1561
|
items.forEach((court) => rows.push({ kind: "court", ...court, group: label }));
|
|
1562
1562
|
}
|
|
1563
|
+
});
|
|
1564
|
+
const courtRowsOnly = rows.filter((r) => r.kind === "court");
|
|
1565
|
+
if (courtRowsOnly.length === 0 && courts.length > 0) {
|
|
1566
|
+
return courts.map((c) => ({
|
|
1567
|
+
kind: "court",
|
|
1568
|
+
id: c.id,
|
|
1569
|
+
name: c.name,
|
|
1570
|
+
type: c.type,
|
|
1571
|
+
group: c.type
|
|
1572
|
+
}));
|
|
1563
1573
|
}
|
|
1564
1574
|
return rows;
|
|
1565
1575
|
}
|
|
@@ -1834,11 +1844,14 @@ function BookingCalendarDemo(props = {}) {
|
|
|
1834
1844
|
const courts = (0, import_react.useMemo)(() => {
|
|
1835
1845
|
const r = props.resources;
|
|
1836
1846
|
if (Array.isArray(r) && r.length > 0) {
|
|
1837
|
-
|
|
1838
|
-
id
|
|
1839
|
-
|
|
1847
|
+
const mapped = r.filter(
|
|
1848
|
+
(x) => x && x.id !== void 0 && x.id !== null && String(x.id).trim() !== ""
|
|
1849
|
+
).map((x) => ({
|
|
1850
|
+
id: String(x.id),
|
|
1851
|
+
name: x.name != null && String(x.name).trim() !== "" ? String(x.name) : String(x.id),
|
|
1840
1852
|
type: x.groupType && String(x.groupType).trim() !== "" ? String(x.groupType) : "Resource"
|
|
1841
1853
|
}));
|
|
1854
|
+
if (mapped.length > 0) return mapped;
|
|
1842
1855
|
}
|
|
1843
1856
|
return DEFAULT_COURTS;
|
|
1844
1857
|
}, [props.resources]);
|
|
@@ -2803,7 +2816,6 @@ function BookingCalendarDemo(props = {}) {
|
|
|
2803
2816
|
[key]: { ...prev[key] || {}, [filesSubtab]: true }
|
|
2804
2817
|
}));
|
|
2805
2818
|
}, [detailItem, detailMode, detailTab, filesSubtab]);
|
|
2806
|
-
console.log(visibleCourtRows, "visibleCourtRows1234", visibleCourts, collapsedGroups);
|
|
2807
2819
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
2808
2820
|
import_antd.Spin,
|
|
2809
2821
|
{
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
/** 与中间日程条同一行:整行深色底,左标题 / 中选日 / 右操作 */
|
|
35
35
|
.pisell-reservation-schedule-band-schedule-row {
|
|
36
36
|
display: grid;
|
|
37
|
-
|
|
37
|
+
/** 左右按内容占位,剩余宽度给中间,避免「等分 1fr」把左侧挤窄后标题与 Segmented 被迫换行 */
|
|
38
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
38
39
|
align-items: center;
|
|
39
40
|
width: 100%;
|
|
40
41
|
min-width: 0;
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
.pisell-reservation-schedule-band-schedule {
|
|
64
|
-
justify-self:
|
|
65
|
+
justify-self: stretch;
|
|
65
66
|
min-width: 0;
|
|
66
67
|
display: flex;
|
|
67
68
|
flex-direction: row;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "6.11.
|
|
3
|
+
"version": "6.11.32",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
"antd-mobile": "^5.38.1",
|
|
101
101
|
"vod-js-sdk-v6": "^1.4.11",
|
|
102
102
|
"@pisell/date-picker": "3.0.8",
|
|
103
|
-
"@pisell/
|
|
104
|
-
"@pisell/
|
|
103
|
+
"@pisell/utils": "3.0.2",
|
|
104
|
+
"@pisell/icon": "0.0.11"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"react": "^18.0.0",
|