From 55e79f0a7a8e481b30f7fb805f9b9f32ee223ef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B3=96=E9=86=8B=E8=99=BE=E4=BB=81?= Date: Thu, 30 May 2024 23:06:33 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E9=95=87=E6=B4=BE=20=E6=AF=8F=E8=A1=8C?= =?UTF-8?q?=E6=89=80=E9=9C=80=E7=82=B9=E6=95=B0=E6=A0=B9=E6=8D=AE=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E8=BF=94=E5=9B=9E=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Talent2.vue | 49 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/src/views/Talent2.vue b/src/views/Talent2.vue index da08c430..998f428f 100644 --- a/src/views/Talent2.vue +++ b/src/views/Talent2.vue @@ -588,7 +588,6 @@ export default { begin: item.talent_tabs[0] === item.first ? "left" : "right", content: content, talent: item.talent_tabs, - condition: [0, 5, 10, 15, 20, 25, 25], }; } }); @@ -627,6 +626,26 @@ export default { } return ""; }, + getnAllPoint(talentId) { + const condition = this.talentOriginData.condition; + for (const key in condition) { + const d = condition[key]; + if (d[talentId]) { + return d[talentId].nAllPoint; + } + } + return ""; + }, + getNeedLevel(talentId) { + const condition = this.talentOriginData.condition; + for (const key in condition) { + const d = condition[key]; + if (d[talentId]) { + return d[talentId].nNeedLevel; + } + } + return ""; + }, getMountId(xf) { const d = this.talentOriginData.mount.find((item) => item.first === xf); if (d) { @@ -1270,7 +1289,8 @@ export default { if (l) { this.$set(l, "on", false); this.$set(l, "count", 0); - l["pretab"] = this.getPreTab(l.id); + this.$set(l, "pretab", this.getPreTab(l.id)); + this.$set(l, "nAllPoint", this.getnAllPoint(l.id)); } return l; }); @@ -1291,7 +1311,8 @@ export default { if (r) { this.$set(r, "on", false); this.$set(r, "count", 0); - r["pretab"] = this.getPreTab(r.id); + this.$set(r, "pretab", this.getPreTab(r.id)); + this.$set(r, "nAllPoint", this.getnAllPoint(r.id)); } return r; }); @@ -1312,9 +1333,27 @@ export default { this.total = defaultConfigs.total; // this.total = 99; } + // 激活条件 拿每行的第一个功法的激活条件 组成 这样的格式 [0, 5, 10, 15, 20, 25] + if (xfConfigs[val]?.condition) { + this.condition = xfConfigs[val]?.condition; + } else { + if (this.talentContent[this.begin] && this.talentContent[this.begin].length) { + const condition = this.talentContent[this.begin].map((items, index) => { + items = items.filter((item) => item !== null); + if (items[0]) { + return items[0].nAllPoint; + } else { + // 当前行无功法默认 * 5 + return index * 5; + } + }); + this.condition = condition; + console.log(this.condition); + } else { + this.condition = [0, 5, 10, 15, 20, 25]; + } + } - // 激活条件 - this.condition = xfConfigs[val]?.condition || [0, 5, 10, 15, 20, 25]; // this.mutex = xfConfigs[val]?.mutex || []; // 初始化code