From 4748bdd6db13a2068f70b72de82027cb7069e707 Mon Sep 17 00:00:00 2001 From: Kaviilee Date: Sat, 27 Jul 2024 17:21:22 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=AE=9E=E8=A3=85=E6=97=A0=E7=95=8C?= =?UTF-8?q?=E5=A5=87=E7=A9=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/assets/css/talent.less | 4 ++++ src/components/single/single.vue | 1 + src/service/talent.js | 4 ++-- src/views/Single.vue | 2 ++ src/views/Talent.vue | 28 ++++++++++++++++++++++++---- 6 files changed, 34 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index e508a054..99e2b115 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@jx3box/jx3box-dict": "^2.2.2", "@jx3box/jx3box-editor": "^2.2.12", "@jx3box/jx3box-macro": "^1.0.1", - "@jx3box/jx3box-talent": "^1.2.7", + "@jx3box/jx3box-talent": "^1.2.9", "@jx3box/jx3box-talent2": "^1.5.9", "axios": "^0.21.1", "codemirror": "^5.62.2", diff --git a/src/assets/css/talent.less b/src/assets/css/talent.less index 671b7897..7c8c9ccd 100644 --- a/src/assets/css/talent.less +++ b/src/assets/css/talent.less @@ -53,6 +53,8 @@ // .x; .mb(20px); .pr; + .flex; + gap: 20px; .u-toolbar { .pa; .rb(0); @@ -85,6 +87,8 @@ border-top-right-radius: 0; border-bottom-right-radius: 0; .fz(14px, 16px); + box-sizing: border-box; + height: 40px; } .el-input__inner { border-top-left-radius: 0; diff --git a/src/components/single/single.vue b/src/components/single/single.vue index f79130f4..a492f024 100644 --- a/src/components/single/single.vue +++ b/src/components/single/single.vue @@ -179,6 +179,7 @@ export default { try { schema = JSON.parse(schema); schema.container = container; + schema.client = schema.client || 'std'; let ins = new talent(schema); ins.then((t) => { diff --git a/src/service/talent.js b/src/service/talent.js index d50e0b2c..890e2e92 100644 --- a/src/service/talent.js +++ b/src/service/talent.js @@ -2,8 +2,8 @@ import axios from "axios"; import { __dataPath } from "@jx3box/jx3box-common/data/jx3box.json"; import { $cms } from "@jx3box/jx3box-common/js/https"; -function getTalentVersions() { - return axios.get(__dataPath + "talent/index.json"); +function getTalentVersions(std = "std") { + return axios.get(__dataPath + `talent/${std}/index.json`); } function getTalents(param) { diff --git a/src/views/Single.vue b/src/views/Single.vue index 2bf60f09..b12d7242 100644 --- a/src/views/Single.vue +++ b/src/views/Single.vue @@ -237,11 +237,13 @@ export default { // 正式服 this.data.forEach((item, i) => { let container = `#talent-box-${i}`; + console.log(item) let schema = item.talent; if (schema) { try { schema = JSON.parse(schema); schema.container = container; + schema.client = schema.client || 'std'; let ins = new talent(schema); ins.then((t) => { diff --git a/src/views/Talent.vue b/src/views/Talent.vue index 700d1737..29b68028 100644 --- a/src/views/Talent.vue +++ b/src/views/Talent.vue @@ -4,6 +4,10 @@

奇穴模拟器

+ + 旗舰 + 无界 +
选择版本 { + getTalentVersions(this.finalClient).then((res) => { this.versions = res.data; this.version = this.versions && this.versions.length && this.versions[0]["version"]; this.driver = new JX3_QIXUE({ version: this.version, editable: true, + client: this.finalClient, }); const vm = this; $(document).on("JX3_QIXUE_Change", function (e, ins) { @@ -286,7 +294,7 @@ export default { __data.version = ins.version; __data.xf = ins.xf; __data.sq = ins.sq.join(","); - vm.code = JSON.stringify(__data); + vm.code = JSON.stringify(ins.code); vm.pzcode = JSON.stringify(ins.overview); }); @@ -304,6 +312,18 @@ export default { page: function () { this.isLogin && this.loadList(); }, + finalClient: function (val) { + this.pzcode = ""; + this.code = ""; + this.xf = "其它"; + if (val == "std") { + this.sq = "1,1,1,1,1,1,1,1,1,1,1,1"; + } + if (val == "wujie") { + this.sq = "1,1,1,1"; + } + this.init(); + }, }, components: { talentDrawer,