poi-plugin-kai-planner 1.0.10 → 1.0.12
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/README.md
CHANGED
|
@@ -41,10 +41,12 @@
|
|
|
41
41
|
- Wishlist 展开明细中的“当前持有”计数会去除改修星数大于 0 的装备以及计划起点装备
|
|
42
42
|
- 页面顶部 tab、上一次数据源更新、检查更新与更新提示统一使用 `14px` 字号
|
|
43
43
|
- Daily 与 Wishlist 主表的折叠箭头统一为:未展开 `▶`、已展开 `▼`
|
|
44
|
+
- Daily 与 Wishlist 中的类型 filter 已调整为更接近 `poi-plugin-item-info` 的 `checkbox + icon` 轻量布局
|
|
44
45
|
|
|
45
46
|
## 装备类型 icon 兼容性说明
|
|
46
47
|
|
|
47
48
|
- 当前所有装备类型 icon 均直接使用 POI 宿主的 `SlotitemIcon` 默认渲染尺寸
|
|
49
|
+
- Daily 表格、Wishlist 表格、类型 filter 现在都直接从 `views/components/etc/icon` 引入宿主 `SlotitemIcon`
|
|
48
50
|
- 插件侧不再对 `SlotitemIcon` 做 `zoom`、`transform: scale(...)` 或其它自定义缩放处理
|
|
49
51
|
- 原因是不同用户的 POI / Electron / 系统缩放环境下,非宿主默认缩放可能导致 icon 错位、放大或整页异常
|
|
50
|
-
-
|
|
52
|
+
- 若后续仍需优化观感,优先参考 `poi-plugin-item-info` 的宿主友好结构,通过 checkbox / label 布局、外层 gap 、margin 等轻量样式调整观感
|
package/package.json
CHANGED
|
@@ -1,61 +1,84 @@
|
|
|
1
1
|
/* src/app/components/EquipTypeIconFilter.js */
|
|
2
2
|
|
|
3
3
|
const React = require("react");
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
let SlotitemIcon = null;
|
|
6
|
+
try {
|
|
7
|
+
({ SlotitemIcon } = require("views/components/etc/icon"));
|
|
8
|
+
} catch {}
|
|
5
9
|
|
|
6
10
|
function EquipTypeIconFilter({ options, selectedKeys, onToggle, onClear }) {
|
|
7
11
|
if (!Array.isArray(options) || options.length === 0) return null;
|
|
8
12
|
|
|
9
13
|
const selectedSet = new Set((selectedKeys || []).map(String));
|
|
10
|
-
const
|
|
14
|
+
const areaStyle = {
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexWrap: "wrap",
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
};
|
|
19
|
+
const entryStyle = {
|
|
11
20
|
display: "inline-flex",
|
|
12
21
|
alignItems: "center",
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
marginRight: "1em",
|
|
23
|
+
marginBottom: 8,
|
|
24
|
+
cursor: "pointer",
|
|
25
|
+
};
|
|
26
|
+
const checkboxStyle = {
|
|
27
|
+
verticalAlign: "middle",
|
|
28
|
+
display: "inline-block",
|
|
29
|
+
margin: 0,
|
|
30
|
+
marginRight: 4,
|
|
31
|
+
};
|
|
32
|
+
const actionButtonStyle = {
|
|
33
|
+
marginTop: 10,
|
|
34
|
+
marginBottom: 10,
|
|
35
|
+
minWidth: 120,
|
|
36
|
+
height: 24,
|
|
18
37
|
border: "1px solid rgba(255,255,255,0.12)",
|
|
19
|
-
background: "rgba(255,255,255,0.
|
|
38
|
+
background: "rgba(255,255,255,0.08)",
|
|
20
39
|
color: "#e5e7eb",
|
|
21
40
|
cursor: "pointer",
|
|
22
|
-
flexShrink: 0,
|
|
23
41
|
};
|
|
24
42
|
|
|
25
43
|
return React.createElement(
|
|
26
44
|
"div",
|
|
27
|
-
|
|
45
|
+
null,
|
|
28
46
|
React.createElement(
|
|
29
|
-
"
|
|
30
|
-
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
"div",
|
|
48
|
+
{ style: areaStyle },
|
|
49
|
+
...options.map((option) => {
|
|
50
|
+
const key = String(option.key);
|
|
51
|
+
const active = selectedSet.has(key);
|
|
52
|
+
return React.createElement(
|
|
53
|
+
"label",
|
|
54
|
+
{
|
|
55
|
+
key,
|
|
56
|
+
style: entryStyle,
|
|
57
|
+
title: option.name || key,
|
|
58
|
+
},
|
|
59
|
+
React.createElement("input", {
|
|
60
|
+
type: "checkbox",
|
|
61
|
+
checked: active,
|
|
62
|
+
onChange: () => onToggle(key),
|
|
63
|
+
style: checkboxStyle,
|
|
64
|
+
}),
|
|
65
|
+
SlotitemIcon ? React.createElement(SlotitemIcon, { slotitemId: option.iconType }) : null
|
|
66
|
+
);
|
|
67
|
+
})
|
|
40
68
|
),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
69
|
+
React.createElement(
|
|
70
|
+
"div",
|
|
71
|
+
{ style: { display: "flex", gap: 12, flexWrap: "wrap" } },
|
|
72
|
+
React.createElement(
|
|
45
73
|
"button",
|
|
46
74
|
{
|
|
47
|
-
key,
|
|
48
75
|
type: "button",
|
|
49
|
-
onClick:
|
|
50
|
-
|
|
51
|
-
style: {
|
|
52
|
-
...baseButtonStyle,
|
|
53
|
-
background: active ? "rgba(255,255,255,0.14)" : "rgba(255,255,255,0.04)",
|
|
54
|
-
},
|
|
76
|
+
onClick: onClear,
|
|
77
|
+
style: actionButtonStyle,
|
|
55
78
|
},
|
|
56
|
-
|
|
57
|
-
)
|
|
58
|
-
|
|
79
|
+
"重置选项"
|
|
80
|
+
)
|
|
81
|
+
)
|
|
59
82
|
);
|
|
60
83
|
}
|
|
61
84
|
|
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const React = require("react");
|
|
4
4
|
|
|
5
|
-
const { SlotitemTypeIcon } = require("../../components/SlotitemTypeIcon");
|
|
6
|
-
|
|
7
|
-
const { EquipTypeIconFilter } = require("../../components/EquipTypeIconFilter");
|
|
8
|
-
|
|
9
5
|
const { loadStaticData } = require("../../../data/loaders/loadStaticData");
|
|
10
6
|
|
|
11
7
|
const {
|
|
@@ -278,9 +274,7 @@ class DailyTab extends React.Component {
|
|
|
278
274
|
|
|
279
275
|
error: null,
|
|
280
276
|
|
|
281
|
-
search: ""
|
|
282
|
-
|
|
283
|
-
selectedEquipTypes: [],
|
|
277
|
+
search: ""
|
|
284
278
|
};
|
|
285
279
|
|
|
286
280
|
this.refresh = this.refresh.bind(this);
|
|
@@ -502,39 +496,9 @@ class DailyTab extends React.Component {
|
|
|
502
496
|
.trim()
|
|
503
497
|
.toLowerCase();
|
|
504
498
|
|
|
505
|
-
const selectedEquipTypes = Array.isArray(this.state.selectedEquipTypes)
|
|
506
|
-
? this.state.selectedEquipTypes.map(String)
|
|
507
|
-
: [];
|
|
508
|
-
|
|
509
|
-
const selectedEquipTypeSet = new Set(selectedEquipTypes);
|
|
510
|
-
|
|
511
499
|
const allRows = vm && vm.rows ? vm.rows : [];
|
|
512
500
|
|
|
513
|
-
const equipTypeOptions = [];
|
|
514
|
-
|
|
515
|
-
const seenEquipTypes = new Set();
|
|
516
|
-
|
|
517
|
-
for (const row of allRows) {
|
|
518
|
-
const key = row && row.iconType != null ? String(row.iconType) : "";
|
|
519
|
-
|
|
520
|
-
if (!key || seenEquipTypes.has(key)) continue;
|
|
521
|
-
|
|
522
|
-
seenEquipTypes.add(key);
|
|
523
|
-
|
|
524
|
-
equipTypeOptions.push({
|
|
525
|
-
key,
|
|
526
|
-
|
|
527
|
-
iconType: row.iconType,
|
|
528
|
-
|
|
529
|
-
name: String(row && row.equipTypeName ? row.equipTypeName : ""),
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
|
|
533
501
|
const rows = allRows.filter((r) => {
|
|
534
|
-
const typeKey = r && r.iconType != null ? String(r.iconType) : "";
|
|
535
|
-
|
|
536
|
-
if (selectedEquipTypeSet.size && !selectedEquipTypeSet.has(typeKey))
|
|
537
|
-
return false;
|
|
538
502
|
|
|
539
503
|
if (
|
|
540
504
|
q &&
|
|
@@ -599,36 +563,6 @@ class DailyTab extends React.Component {
|
|
|
599
563
|
),
|
|
600
564
|
),
|
|
601
565
|
|
|
602
|
-
equipTypeOptions.length
|
|
603
|
-
? React.createElement(
|
|
604
|
-
"div",
|
|
605
|
-
|
|
606
|
-
{ style: { marginTop: 10 } },
|
|
607
|
-
|
|
608
|
-
React.createElement(EquipTypeIconFilter, {
|
|
609
|
-
options: equipTypeOptions,
|
|
610
|
-
|
|
611
|
-
selectedKeys: selectedEquipTypes,
|
|
612
|
-
|
|
613
|
-
onToggle: (key) =>
|
|
614
|
-
this.setState((prev) => {
|
|
615
|
-
const current = new Set(
|
|
616
|
-
Array.isArray(prev.selectedEquipTypes)
|
|
617
|
-
? prev.selectedEquipTypes.map(String)
|
|
618
|
-
: [],
|
|
619
|
-
);
|
|
620
|
-
|
|
621
|
-
if (current.has(key)) current.delete(key);
|
|
622
|
-
else current.add(key);
|
|
623
|
-
|
|
624
|
-
return { selectedEquipTypes: Array.from(current) };
|
|
625
|
-
}),
|
|
626
|
-
|
|
627
|
-
onClear: () => this.setState({ selectedEquipTypes: [] })
|
|
628
|
-
}),
|
|
629
|
-
)
|
|
630
|
-
: null,
|
|
631
|
-
|
|
632
566
|
React.createElement(
|
|
633
567
|
"div",
|
|
634
568
|
|
|
@@ -708,7 +642,7 @@ class DailyTab extends React.Component {
|
|
|
708
642
|
|
|
709
643
|
{ style: { margin: "0 0 10px", opacity: 0.8 } },
|
|
710
644
|
|
|
711
|
-
`今日可改修装备:${rows.length} 条${
|
|
645
|
+
`今日可改修装备:${rows.length} 条${q ? `(搜索:${this.state.search})` : ""}`,
|
|
712
646
|
),
|
|
713
647
|
|
|
714
648
|
React.createElement(
|
|
@@ -828,10 +762,6 @@ React.createElement("th", { style: { ...thStyle, ...upgradeColStyle } }, "可进
|
|
|
828
762
|
foldIcon,
|
|
829
763
|
),
|
|
830
764
|
|
|
831
|
-
React.createElement(SlotitemTypeIcon, {
|
|
832
|
-
iconType: r.iconType,
|
|
833
|
-
title: r.equipTypeName,
|
|
834
|
-
}),
|
|
835
765
|
|
|
836
766
|
React.createElement(
|
|
837
767
|
"div",
|
|
@@ -31,7 +31,6 @@ const {
|
|
|
31
31
|
upsertLastResult,
|
|
32
32
|
} = require("../../../storage/userPlans/planStore");
|
|
33
33
|
const { CreatePlanForm } = require("./CreatePlanForm");
|
|
34
|
-
const { EquipTypeIconFilter } = require("../../components/EquipTypeIconFilter");
|
|
35
34
|
const { WishlistTable } = require("./components/WishlistTable");
|
|
36
35
|
const { WishlistExpandedDetail } = require("./components/WishlistExpandedDetail");
|
|
37
36
|
const { buildWishlistViewModel } = require("../../../services/wishlist/buildWishlistViewModel");
|
|
@@ -108,7 +107,6 @@ class WishlistTab extends React.Component {
|
|
|
108
107
|
rebindInputById: {},
|
|
109
108
|
editById: {},
|
|
110
109
|
filterTargetName: "",
|
|
111
|
-
selectedTargetEquipTypes: [],
|
|
112
110
|
activePlanTab: "unfinished",
|
|
113
111
|
showCreateForm: false,
|
|
114
112
|
create: {
|
|
@@ -632,37 +630,7 @@ class WishlistTab extends React.Component {
|
|
|
632
630
|
masterEquipsById,
|
|
633
631
|
masterEquipTypesById: state.const.$equipTypes || {},
|
|
634
632
|
});
|
|
635
|
-
const
|
|
636
|
-
? this.state.selectedTargetEquipTypes.map(String)
|
|
637
|
-
: [];
|
|
638
|
-
const selectedTargetEquipTypeSet = new Set(selectedTargetEquipTypes);
|
|
639
|
-
const targetEquipTypeOptions = [];
|
|
640
|
-
const seenTargetEquipTypes = new Set();
|
|
641
|
-
for (const rowVm of vm.rows || []) {
|
|
642
|
-
const key = rowVm && rowVm.targetIconType != null ? String(rowVm.targetIconType) : "";
|
|
643
|
-
if (!key || seenTargetEquipTypes.has(key)) continue;
|
|
644
|
-
seenTargetEquipTypes.add(key);
|
|
645
|
-
targetEquipTypeOptions.push({
|
|
646
|
-
key,
|
|
647
|
-
iconType: rowVm.targetIconType,
|
|
648
|
-
name: String(rowVm && rowVm.targetEquipTypeName ? rowVm.targetEquipTypeName : ""),
|
|
649
|
-
});
|
|
650
|
-
}
|
|
651
|
-
const matchesSelectedTargetType = (rowVm) => {
|
|
652
|
-
const key = rowVm && rowVm.targetIconType != null ? String(rowVm.targetIconType) : "";
|
|
653
|
-
return !selectedTargetEquipTypeSet.size || selectedTargetEquipTypeSet.has(key);
|
|
654
|
-
};
|
|
655
|
-
const filteredVm = {
|
|
656
|
-
...vm,
|
|
657
|
-
rows: (vm.rows || []).filter(matchesSelectedTargetType),
|
|
658
|
-
unfinishedRows: (vm.unfinishedRows || []).filter(matchesSelectedTargetType),
|
|
659
|
-
completedRows: (vm.completedRows || []).filter(matchesSelectedTargetType),
|
|
660
|
-
};
|
|
661
|
-
filteredVm.counts = {
|
|
662
|
-
total: filteredVm.rows.length,
|
|
663
|
-
unfinished: filteredVm.unfinishedRows.length,
|
|
664
|
-
completed: filteredVm.completedRows.length,
|
|
665
|
-
};
|
|
633
|
+
const filteredVm = vm;
|
|
666
634
|
const activePlanTab = this.state.activePlanTab || "unfinished";
|
|
667
635
|
const activeRows = activePlanTab === "completed" ? filteredVm.completedRows : filteredVm.unfinishedRows;
|
|
668
636
|
|
|
@@ -691,26 +659,6 @@ class WishlistTab extends React.Component {
|
|
|
691
659
|
React.createElement("button", { onClick: () => this.setState({ showCreateForm: true }) }, "新增改修计划"),
|
|
692
660
|
React.createElement("button", { onClick: this.refreshPlans }, "刷新")
|
|
693
661
|
),
|
|
694
|
-
targetEquipTypeOptions.length
|
|
695
|
-
? React.createElement(
|
|
696
|
-
"div",
|
|
697
|
-
{ style: { marginTop: 10 } },
|
|
698
|
-
React.createElement(EquipTypeIconFilter, {
|
|
699
|
-
options: targetEquipTypeOptions,
|
|
700
|
-
selectedKeys: selectedTargetEquipTypes,
|
|
701
|
-
onToggle: (key) =>
|
|
702
|
-
this.setState((prev) => {
|
|
703
|
-
const current = new Set(
|
|
704
|
-
Array.isArray(prev.selectedTargetEquipTypes) ? prev.selectedTargetEquipTypes.map(String) : []
|
|
705
|
-
);
|
|
706
|
-
if (current.has(key)) current.delete(key);
|
|
707
|
-
else current.add(key);
|
|
708
|
-
return { selectedTargetEquipTypes: Array.from(current) };
|
|
709
|
-
}),
|
|
710
|
-
onClear: () => this.setState({ selectedTargetEquipTypes: [] }),
|
|
711
|
-
})
|
|
712
|
-
)
|
|
713
|
-
: null,
|
|
714
662
|
React.createElement(
|
|
715
663
|
"div",
|
|
716
664
|
{ style: planTabBar },
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* src/app/tabs/wishlist/components/WishlistTable.js */
|
|
2
2
|
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const { SlotitemTypeIcon } = require("../../../components/SlotitemTypeIcon");
|
|
5
4
|
|
|
6
5
|
const PRIORITY_STYLE_MAP = {
|
|
7
6
|
P0: { color: "#fecaca", borderColor: "rgba(239,68,68,0.55)", background: "rgba(239,68,68,0.16)" },
|
|
@@ -108,7 +107,7 @@ function WishlistTable({
|
|
|
108
107
|
},
|
|
109
108
|
React.createElement(
|
|
110
109
|
"td",
|
|
111
|
-
{ style:
|
|
110
|
+
{ style: td },
|
|
112
111
|
React.createElement(
|
|
113
112
|
"div",
|
|
114
113
|
{ style: { display: "flex", gap: 8, alignItems: "center" } },
|
|
@@ -133,10 +132,6 @@ function WishlistTable({
|
|
|
133
132
|
},
|
|
134
133
|
expandIcon
|
|
135
134
|
),
|
|
136
|
-
React.createElement(SlotitemTypeIcon, {
|
|
137
|
-
iconType: rowVm.targetIconType,
|
|
138
|
-
title: rowVm.targetEquipTypeName,
|
|
139
|
-
}),
|
|
140
135
|
React.createElement(
|
|
141
136
|
"div",
|
|
142
137
|
null,
|