Skip to content

Commit

Permalink
perf: 实装无界奇穴
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaviilee committed Jul 27, 2024
1 parent e0c9411 commit 4748bdd
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/assets/css/talent.less
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
// .x;
.mb(20px);
.pr;
.flex;
gap: 20px;
.u-toolbar {
.pa;
.rb(0);
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/components/single/single.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions src/service/talent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions src/views/Single.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
28 changes: 24 additions & 4 deletions src/views/Talent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<div class="m-talent-header">
<h1 class="m-talent-title">奇穴模拟器</h1>
<div class="m-talent-panel">
<el-radio-group v-model="finalClient">
<el-radio-button label="std">旗舰</el-radio-button>
<el-radio-button label="wujie">无界</el-radio-button>
</el-radio-group>
<div class="m-talent-version">
<span class="u-label">选择版本</span>
<el-select
Expand Down Expand Up @@ -93,7 +97,7 @@ import JX3_QIXUE from "@jx3box/jx3box-talent";
import $ from "jquery";
import schemas from "@/assets/data/schemas.json";
import cloneDeep from "lodash/cloneDeep";
import { getTalentVersions, getTalents, addTalent, putTalent, removeTalent } from "@/service/talent.js";
import { getTalentVersions, addTalent, putTalent } from "@/service/talent.js";
import User from "@jx3box/jx3box-common/js/user";
import talentDrawer from "@/components/talent/talent_drawer.vue";
import { copy } from "@/utils/clipboard";
Expand All @@ -120,6 +124,7 @@ export default {
drawer: false,
currentSchema: "",
finalClient: "std",
};
},
computed: {
Expand All @@ -132,7 +137,7 @@ export default {
params: function () {
const { mount, version, code, pzcode, xf } = this;
return {
client: 'std',
client: "std",
type: "talent",
mount,
version,
Expand All @@ -144,6 +149,7 @@ export default {
xfMaps: function () {
const xfMaps = cloneDeep(xfmap);
delete xfMaps["山居剑意"];
delete xfMaps["通用"];
return xfMaps;
},
isEditing: function () {
Expand Down Expand Up @@ -180,6 +186,7 @@ export default {
xf: this.xf,
sq: this.sq,
editable: true,
client: this.finalClient,
});
});
},
Expand Down Expand Up @@ -272,21 +279,22 @@ export default {
this.parseSchema();
},
init: function () {
getTalentVersions().then((res) => {
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) {
let __data = {};
__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);
});
Expand All @@ -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,
Expand Down

0 comments on commit 4748bdd

Please sign in to comment.