diff --git a/backend/dataFiles/dcalc_0.db b/backend/dataFiles/dcalc_0.db index 860b5894..9874bced 100644 Binary files a/backend/dataFiles/dcalc_0.db and b/backend/dataFiles/dcalc_0.db differ diff --git a/frontend/src/api/info/type.ts b/frontend/src/api/info/type.ts index 484f87a7..9495f2a0 100644 --- a/frontend/src/api/info/type.ts +++ b/frontend/src/api/info/type.ts @@ -50,6 +50,7 @@ export interface ISkill { position: number type: string maxLearnLv: number + maxLv: number } export interface ISuit { diff --git a/frontend/src/pages/Character/Equipment/Weapon.vue b/frontend/src/pages/Character/Equipment/Weapon.vue index 95a80b05..23d9946c 100644 --- a/frontend/src/pages/Character/Equipment/Weapon.vue +++ b/frontend/src/pages/Character/Equipment/Weapon.vue @@ -44,5 +44,6 @@ const chooseWeapon = (weapon: IEquipment | undefined) => { if (weapon) { configStore.config.equips['武器'].id = weapon.id } + console.log(configStore.config) } diff --git a/frontend/src/pages/Character/Skill/SkillTree/index.tsx b/frontend/src/pages/Character/Skill/SkillTree/index.tsx index c40a7bb3..33eb2c1c 100644 --- a/frontend/src/pages/Character/Skill/SkillTree/index.tsx +++ b/frontend/src/pages/Character/Skill/SkillTree/index.tsx @@ -1,6 +1,6 @@ import { getImageURL } from '@/utils/images' import type { ISkill } from '@/api/info/type' -import {useVModel} from '@vueuse/core' +import { useVModel } from '@vueuse/core' import './style.scss' export default defineComponent({ @@ -37,22 +37,79 @@ export default defineComponent({ const columns = [...new Array(9).keys()] + const activeSkill = ref(-1) + + const chooseSkill = (skill: ISkill) => { + if (activeSkill.value == skill.id) activeSkill.value = -1 + else activeSkill.value = skill.id + } + + const actionSkillLv = (skill: ISkill, operation:string) => { + if(operation == 'add'){ + lvInfo.value[skill.id.toString()] = { lv: Math.min(lvInfo.value[skill.id.toString()]?.lv + 1,skill.maxLv) } + return; + } + if(operation == 'addMax'){ + lvInfo.value[skill.id.toString()] = { lv: skill.maxLearnLv } + return; + } + if(operation == 'sub'){ + lvInfo.value[skill.id.toString()] = { lv: Math.max(lvInfo.value[skill.id.toString()]?.lv - 1,0) } + return; + } + if(operation == 'subMax'){ + lvInfo.value[skill.id.toString()] = { lv: 0 } + return; + } + } + + const renderSkill = (skill: ISkill, index: number) => ( + <> +
+ {activeSkill.value == skill.id && renderSkillAction(skill)} +
chooseSkill(skill)} + key={index} + > + +
+ {lvInfo.value?.[skill.id.toString()]?.lv ?? 0} +
+
+
+ + ) + + const renderSkillAction = (skill: ISkill) => ( + <> + <> +
+
+
+ + + + +
+
+ + + ) + return () => ( <>
-
其
余
- {((getSkill(0, 15, -1) ?? []) as ISkill[])?.map((skill, index) => ( -
- -
- {lvInfo.value?.[skill.id.toString()]?.lv ?? 0} -
-
- ))} +
+ 其
余 +
+ {((getSkill(0, 15, -1) ?? []) as ISkill[])?.map((skill, index) => + renderSkill(skill, index), + )}
{lvList.map((lv, index) => (
@@ -63,19 +120,7 @@ export default defineComponent({ )} {columns.map((column, i) => { const skill = getSkill(lv, lvList[index + 1] ?? 150, column) as ISkill - return skill ? ( -
- -
- {lvInfo.value?.[skill.id.toString()]?.lv ?? 0} -
-
- ) : ( -
- ) + return skill ? renderSkill(skill, index) :
})}