Skip to content

Commit

Permalink
feat:心决门派增加
Browse files Browse the repository at this point in the history
  • Loading branch information
zhusha committed Jul 6, 2024
1 parent 30dbc07 commit fd7c3f0
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 86 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
},
"dependencies": {
"@jx3box/jx3box-bmap": "^0.1.13",
"@jx3box/jx3box-comment-ui": "^1.9.7",
"@jx3box/jx3box-common": "^8.2.20",
"@jx3box/jx3box-common-ui": "^8.9.0",
"@jx3box/jx3box-comment-ui": "^1.9.9",
"@jx3box/jx3box-common": "^8.2.24",
"@jx3box/jx3box-common-ui": "^8.9.4",
"@jx3box/jx3box-data": "^3.6.0",
"@jx3box/jx3box-editor": "^2.2.8",
"@jx3box/jx3box-editor": "^2.2.11",
"axios": "^0.21.1",
"core-js": "^3.4.3",
"element-ui": "^2.15.6",
Expand Down
139 changes: 80 additions & 59 deletions src/components/bahuang/right.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@
<div class="m-bahuang-r-citta">
<div class="u-bahuang-citta">
<el-select v-model="selectOptions.citta" placeholder="请选择门派" @change="cittaChange">
<el-option v-for="item in selectOptions.cittaArr" :key="item.value" :label="item.name"
:value="item.value"></el-option>
<el-option
v-for="item in selectOptions.cittaArr"
:key="item.value"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</div>
</div>
</div>
<!-- 心决-->

<!-- 心决效果-->
<span class="u-tips" v-show="!cittaEffect">
尚未选择
</span>
<span class="u-tips" v-show="!cittaEffect"> 尚未选择 </span>
<div class="m-citta" v-show="cittaEffect.length > 0">
<div class="m-citta-box" v-for="(item, i) in cittaEffect" :key="'xj' + i">
<img class="u-bahuang-img" :src="item.IconID | skillIcon(item.IconID)" />
Expand All @@ -27,28 +29,38 @@
</div>
</div>
<!--秘术-->
<div class="u-bahuang-r-title">秘术<br />
<div class="u-bahuang-r-title">
秘术<br />
<span class="u-tip">(左键选择激活,右键可删除秘术)</span>
</div>
<!-- 秘术区域-->
<div class="m-bahuang-r-arcane" :class="isLogin ? 'm-r-arcane-box' : ''">
<!-- 秘术展示-->
<span class="u-tips" v-show="selectOptions.arcane.length === 0">
尚未选择
</span>
<div class="u-skill" v-for="(item, i) in selectOptions.arcane" :key="'a' + i"
@contextmenu.prevent.capture='rightCancel(item, i, 1)'>
<skill :info="item.info" :select="item.select_r" :skillType="false" class="u-skill"
@click.native="skillClick(item, i)" /><br />
<span class="u-tips" v-show="selectOptions.arcane.length === 0"> 尚未选择 </span>
<div
class="u-skill"
v-for="(item, i) in selectOptions.arcane"
:key="'a' + i"
@contextmenu.prevent.capture="rightCancel(item, i, 1)"
>
<skill
:info="item.info"
:select="item.select_r"
:skillType="false"
class="u-skill"
@click.native="skillClick(item, i)"
/><br />
<span>{{ item.info.Name }}</span>
</div>

</div>
<!-- 激活秘术信息展示区域-->
<div class="u-bahuang-r-title">已激活秘术</div>
<div class="m-arcane-active">

<div v-for="(item, i) in selectOptions.arcane" :key="'aa' + i" :class="item.select_r ? 'u-arcane-active' : ''">
<div
v-for="(item, i) in selectOptions.arcane"
:key="'aa' + i"
:class="item.select_r ? 'u-arcane-active' : ''"
>
<div class="u-content" v-if="item.select_r">
<span class="u-name">
{{ item.info.Name }}:
Expand All @@ -58,49 +70,60 @@
</div>
</div>
<!-- 秘技4个-->
<div class="u-bahuang-r-title">秘技
<div class="u-bahuang-r-title">
秘技
<br />
<span class="u-tip">(右键可删除秘技)</span>
</div>
<div class="m-bahuang-r-cheats">
<span class="u-tips" v-show="selectOptions.cheats.length === 0">
尚未选择
</span>
<div class="u-bahuang-cheats" v-for="(item, i) in selectOptions.cheats" :key="'c' + i"
@contextmenu.prevent.capture='rightCancel(item, i, 2)'>
<span class="u-tips" v-show="selectOptions.cheats.length === 0"> 尚未选择 </span>
<div
class="u-bahuang-cheats"
v-for="(item, i) in selectOptions.cheats"
:key="'c' + i"
@contextmenu.prevent.capture="rightCancel(item, i, 2)"
>
<skill :info="item.info" :select="item.info.select" :skillType="true" class="u-skill" />
</div>

</div>

<!-- 绝技1个-->
<div class="u-bahuang-r-title">绝技</div>
<div class="m-bahuang-r-stunt">
<span class="u-tips" v-show="selectOptions.stunt.length === 0">
尚未选择
</span>
<skill v-for="(item, i) in selectOptions.stunt" :key="'s' + i" :info="item.info" :select="item.info.select"
:skillType="true" class="u-skill" />
<span class="u-tips" v-show="selectOptions.stunt.length === 0"> 尚未选择 </span>
<skill
v-for="(item, i) in selectOptions.stunt"
:key="'s' + i"
:info="item.info"
:select="item.info.select"
:skillType="true"
class="u-skill"
/>
</div>
<div class="m-btn">
<el-button class="u-btn" type="primary" icon="el-icon-document-add" v-if="isLogin"
@click="saveScheme(1)">保存为预设</el-button>
<el-button class="u-btn" type="primary" icon="el-icon-document-add" v-if="isLogin && isEdit"
@click="saveScheme(2)">另存为</el-button>
<el-button class="u-btn" type="primary" icon="el-icon-document-add" v-if="isLogin" @click="saveScheme(1)"
>保存为预设</el-button
>
<el-button
class="u-btn"
type="primary"
icon="el-icon-document-add"
v-if="isLogin && isEdit"
@click="saveScheme(2)"
>另存为</el-button
>
</div>


</div>
</template>

<script>
import { iconLink } from "@jx3box/jx3box-common/js/utils";
import skill from './skill'
import skill from "./skill";
import User from "@jx3box/jx3box-common/js/user";
export default {
name: "right",
components: {
skill
skill,
},
props: {
selectOptions: {
Expand All @@ -109,24 +132,25 @@ export default {
return {
arcane: [],
cheats: [],
stunt: []
}
}
stunt: [],
};
},
},
isEdit: {
type: Boolean,
default: false
}
default: false,
},
},
watch: {
selectOptions: { // 对对象进行深度监听
selectOptions: {
// 对对象进行深度监听
handler(n, o) {
if (n.citta !== null) {
this.cittaEffect = n.cittaArr[n.citta].content
this.cittaEffect = n.cittaArr[n.citta].content;
}
},
immediate: true,
deep: true
deep: true,
},
},
data: function () {
Expand All @@ -143,19 +167,17 @@ export default {
},
filters: {
skillIcon: function (id) {
if (!id) return '';
return iconLink(id, 'origin');
if (!id) return "";
return iconLink(id, "std");
},
},
created() {
},
created() {},
methods: {
cittaChange(val) {
this.cittaEffect = this.selectOptions.cittaArr[val].content
this.cittaEffect = this.selectOptions.cittaArr[val].content;
},
skillClick(item, i) {
this.$emit('skillClick', { info: item, index: i })
this.$emit("skillClick", { info: item, index: i });
},
// getActiveArcane(arcane){
// let arr=[]
Expand All @@ -174,16 +196,15 @@ export default {
* @param type 1 保存 2编辑状态另存为
*/
saveScheme(type) {
this.$emit('saveScheme', { type: type })
this.$emit("saveScheme", { type: type });
},
rightCancel(item, i, type) {
this.$emit('icoRemove', { item: item, index: i, type: type })
}
}
}
this.$emit("icoRemove", { item: item, index: i, type: type });
},
},
};
</script>

<style scoped lang="less">
@import "../../assets/css/bhhjSimulator/right.less";
</style>

60 changes: 37 additions & 23 deletions src/views/Bahuang.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,26 @@
</el-tabs>
<div class="m-tab-box">
<div class="u-box">
<div v-for="(item, i) in leftOptions[activeTabName]" :key="'a' + i" class="u-bahuang-l-box"
@click="leftIconClick(item, i, activeTabName)">
<div
v-for="(item, i) in leftOptions[activeTabName]"
:key="'a' + i"
class="u-bahuang-l-box"
@click="leftIconClick(item, i, activeTabName)"
>
<skill :info="item" :select="item.select" :skillType="false" />
<span class="u-name">{{ item.Name }}</span>
</div>
</div>
</div>
</div>
<div class="m-bahuang-content" v-loading="rightLoading">
<RightBox :selectOptions="selectOptions" :isEdit="isEdit" @skillClick="rightSkill($event)"
@saveScheme="openSaveScheme($event)" @icoRemove="icoRightRemove($event)" />
<RightBox
:selectOptions="selectOptions"
:isEdit="isEdit"
@skillClick="rightSkill($event)"
@saveScheme="openSaveScheme($event)"
@icoRemove="icoRightRemove($event)"
/>
</div>
<!--<div class="m-bahuang-right" v-if="isLogin">-->
<!--<el-button type="primary" @click="schemeDrawer = true" icon="el-icon-setting" size="small">我的预设</el-button>-->
Expand All @@ -37,8 +46,12 @@
<!--预设方案抽屉-->
<drawer :drawer="schemeDrawer" @update-drawer="updateDrawer" @use="useScheme($event)"></drawer>
<!--保存方案弹窗-->
<el-dialog :title="title" :visible.sync="dialogFormVisible" :close-on-press-escape="false"
:close-on-click-modal="false">
<el-dialog
:title="title"
:visible.sync="dialogFormVisible"
:close-on-press-escape="false"
:close-on-click-modal="false"
>
<el-form :model="schemeForm">
<el-form-item label="方案名称">
<el-input v-model="schemeForm.title" autocomplete="off"></el-input>
Expand All @@ -54,7 +67,7 @@
</el-dialog>
</app-layout>
</template>
<script >
<script>
import { getAppIcon, iconLink } from "@jx3box/jx3box-common/js/utils";
import RightBox from "@/components/bahuang/right.vue";
import skill from "@/components/bahuang/skill.vue";
Expand All @@ -69,7 +82,7 @@ export default {
RightBox,
skill,
drawer,
AppLayout
AppLayout,
},
data: function () {
return {
Expand Down Expand Up @@ -126,18 +139,19 @@ export default {
//xf筛选
let xf_filtrate = [],
xfArr = Object.entries(xf);
for (let i = 0; i < xfArr.length; i++) {
if (xfArr[i][1].client.indexOf("origin") !== -1) {
xf_filtrate.push(xfArr[i]);
}
}
this.xf_filtrate = xf_filtrate;
// for (let i = 0; i < xfArr.length; i++) {
// if (xfArr[i][1].client.indexOf("origin") !== -1) {
// xf_filtrate.push(xfArr[i]);
// }
// }
this.xf_filtrate = xfArr;
},
methods: {
getAppIcon,
getBhhj() {
getBhhjInfo()
.then((data) => {
console.log(data);
this.leftOptions.stunt = data[3];
this.leftOptions.arcane = data[4];
this.leftOptions.cheats = data[2];
Expand Down Expand Up @@ -185,16 +199,16 @@ export default {
info: item,
index: i,
};
let type = typeName
let type = typeName;
switch (typeName) {
case 'arcane':
type = 1
case "arcane":
type = 1;
break;
case 'cheats':
type = 2
case "cheats":
type = 2;
break;
case 'stunt':
type = 3
case "stunt":
type = 3;
break;
}
if (type === 1) {
Expand Down Expand Up @@ -394,10 +408,10 @@ export default {
this.rightLoading = false;
});
})
.catch(() => { });
.catch(() => {});
},
},
}
};
</script>

<style lang="less">
Expand Down

0 comments on commit fd7c3f0

Please sign in to comment.