diff --git a/backend/core/basic/character.py b/backend/core/basic/character.py index 3faa438f..82f47aee 100644 --- a/backend/core/basic/character.py +++ b/backend/core/basic/character.py @@ -543,6 +543,7 @@ class Character(CharacterProperty): return res def calc_init(self, setInfo: dict[str, dict]): + self.equ_options = setInfo.get('options', {}) # 打造信息导入 self.SetDetail(setInfo) # 技能等级设置 diff --git a/backend/core/equipment/version_0/__init__.py b/backend/core/equipment/version_0/__init__.py index a53f752f..704b6e4e 100644 --- a/backend/core/equipment/version_0/__init__.py +++ b/backend/core/equipment/version_0/__init__.py @@ -10,7 +10,7 @@ from . import suit from .register import execture options = [ - {'id': 1, 'name': '龙战八荒,', 'options': ['BUFF OFF', 'BUFF ON', '期望']}, + {'id': 1, 'name': '龙战八荒', 'options': ['BUFF OFF', 'BUFF ON', '期望']}, {'id': 2, 'name': '混沌净化', 'options': ['净化', '堕落']}, {'id': 3, 'name': '群猎美学', 'options': ['单刷', '组队']}, {'id': 4, 'name': '魔攻核', 'options': ['普通', '追击']}, diff --git a/frontend/package.json b/frontend/package.json index e8cf0b52..806fa0ef 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -15,8 +15,6 @@ "format": "prettier --write src/" }, "dependencies": { - "@iconify/vue": "^4.3.0", - "@radix-ui/colors": "^3.0.0", "@vueuse/core": "^12.8.2", "axios": "^1.8.2", "hoci": "^0.6.0", diff --git a/frontend/src/api/calc/index.ts b/frontend/src/api/calc/index.ts index 5b4f8fe9..622a3663 100644 --- a/frontend/src/api/calc/index.ts +++ b/frontend/src/api/calc/index.ts @@ -6,7 +6,7 @@ export default defineRequest((request) => { async calc(config: IConfig) { const res = await request.post('/calc', config) return res.data - } + }, } }) // Compare this snippet from frontend/src/api/common/index.ts: diff --git a/frontend/src/api/calc/type.ts b/frontend/src/api/calc/type.ts index 8dc88a34..602c514f 100644 --- a/frontend/src/api/calc/type.ts +++ b/frontend/src/api/calc/type.ts @@ -1,12 +1,11 @@ export interface IResult { uuid: string skills: IResultSkill[] - info:IResultUserInfo[] - suits:IResultSuit[] - buffer:boolean + info: IResultUserInfo[] + suits: IResultSuit[] + buffer: boolean } - export interface IResultSkill { name: string icon: string @@ -16,24 +15,24 @@ export interface IResultSkill { cd: number damage: number mode: string - buff:number[] + buff: number[] learnLv: number } export interface IResultUserInfo { - name:string - value:string|number + name: string + value: string | number } -export interface IResultSuit{ - id:number - count:number - imageUrl:string - level:number - name:string - point:number - rarity:string - value:string +export interface IResultSuit { + id: number + count: number + imageUrl: string + level: number + name: string + point: number + rarity: string + value: string } export interface IResultSkillCount { diff --git a/frontend/src/api/common.ts b/frontend/src/api/common.ts index 9032824b..26b2cdd5 100644 --- a/frontend/src/api/common.ts +++ b/frontend/src/api/common.ts @@ -27,7 +27,7 @@ if (import.meta.env.MODE == 'web' || import.meta.env.MODE == 'show') { baseURL = 'https://api.dnftools.com/' } -if(import.meta.env.MODE == 'test') { +if (import.meta.env.MODE == 'test') { baseURL = 'https://testapi.dnftools.com/' } diff --git a/frontend/src/api/info/type.ts b/frontend/src/api/info/type.ts index e15a81e1..8dbf491e 100644 --- a/frontend/src/api/info/type.ts +++ b/frontend/src/api/info/type.ts @@ -35,16 +35,17 @@ export interface ICharacterInfo { skills: ISkill[] suits: ISuit[] avatar: Record - jades:IJade[] - sundry:Record + jades: IJade[] + sundry: Record + options: { id: number; name: string; options: string[] }[] } export interface ISundry { - id:number, - options:{ - name:string, - value:number - }[], + id: number + options: { + name: string + value: number + }[] } export interface IEquipment { @@ -56,19 +57,19 @@ export interface IEquipment { categorize: string suit: string[] rarity: string - max_adaptation:number - STR:number[] - INT:number[] - Vitality:number[] - Spirit:number[] - AtkP:number[] - AtkM:number[] - AtkI:number[] - SkillAttack:number[] - Attack:number[] - Buffer:number[] + max_adaptation: number + STR: number[] + INT: number[] + Vitality: number[] + Spirit: number[] + AtkP: number[] + AtkM: number[] + AtkI: number[] + SkillAttack: number[] + Attack: number[] + Buffer: number[] detail: string - bufferDetail:string + bufferDetail: string } export interface ISkill { @@ -77,7 +78,7 @@ export interface ISkill { id: number learnLv: number position: number - line:number + line: number type: string maxLearnLv: number maxLv: number @@ -90,12 +91,12 @@ export interface ISuit { imageUrl: string suitId: number suitName: string - point:number + point: number rarity: string level: number SkillAttack: number - Buffer:number - value:string + Buffer: number + value: string } export interface IEnchantingInfo { @@ -118,10 +119,10 @@ export interface IAvatarInfo { } export interface IJade { - name:string - id:number - max:number - min:number - pre:number - unit:string + name: string + id: number + max: number + min: number + pre: number + unit: string } diff --git a/frontend/src/components/base/README b/frontend/src/components/base/README index 240cca2d..1bb61d6c 100644 --- a/frontend/src/components/base/README +++ b/frontend/src/components/base/README @@ -1 +1 @@ -无样式的基础组件 \ No newline at end of file +无样式的基础组件 diff --git a/frontend/src/components/base/index.ts b/frontend/src/components/base/index.ts index a6ff8e66..a2e05bfe 100644 --- a/frontend/src/components/base/index.ts +++ b/frontend/src/components/base/index.ts @@ -1 +1 @@ -export { default as NTooltip } from "./tooltip" +export { default as NTooltip } from './tooltip' diff --git a/frontend/src/components/base/tooltip.tsx b/frontend/src/components/base/tooltip.tsx index 97a969a5..00761ccc 100644 --- a/frontend/src/components/base/tooltip.tsx +++ b/frontend/src/components/base/tooltip.tsx @@ -1,42 +1,52 @@ -import { syncRefs, useVModel } from "@vueuse/core" -import type { CSSProperties, PropType } from "vue"; -import { Teleport, Transition, computed, defineComponent, nextTick, reactive, ref, renderSlot, watch } from "vue" -import { provideShow } from "../hooks/show" +import { syncRefs, useVModel } from '@vueuse/core' +import type { CSSProperties, PropType } from 'vue' +import { + Teleport, + Transition, + computed, + defineComponent, + nextTick, + reactive, + ref, + renderSlot, + watch, +} from 'vue' +import { provideShow } from '../hooks/show' export const tooltipProps = { popClass: { - type: String + type: String, }, position: { - type: String as PropType<"bottom" | "top" | "left" | "right" | "auto">, - default: () => "auto" + type: String as PropType<'bottom' | 'top' | 'left' | 'right' | 'auto'>, + default: () => 'auto', }, offset: { type: Number, - default: () => 8 + default: () => 8, }, lazy: { type: Boolean, - default: () => false + default: () => false, }, visible: { type: Boolean, - default: () => false + default: () => false, }, disabled: { type: Boolean, - default: () => false - } + default: () => false, + }, } export default defineComponent({ - name: "ITooltip", + name: 'ITooltip', props: tooltipProps, - emits: ["change", "update:visible"], + emits: ['change', 'update:visible'], setup(props, { slots, emit }) { const isOpen = ref(props.visible) - syncRefs(useVModel(props, "visible"), isOpen) + syncRefs(useVModel(props, 'visible'), isOpen) provideShow(isOpen) @@ -47,13 +57,19 @@ export default defineComponent({ const dropdownPosition = reactive({ x: 0, y: 0 }) - const isShow = computed(() => isOpen.value && triggerRef.value && popupRef.value && dropdownPosition.x + dropdownPosition.y > 0) + const isShow = computed( + () => + isOpen.value && + triggerRef.value && + popupRef.value && + dropdownPosition.x + dropdownPosition.y > 0, + ) const dropdownStyle = computed(() => { return { left: `${dropdownPosition.x}px`, top: `${dropdownPosition.y}px`, - visibility: isShow.value ? "visible" : "hidden" + visibility: isShow.value ? 'visible' : 'hidden', } }) @@ -66,9 +82,9 @@ export default defineComponent({ timer = setTimeout( () => { isOpen.value = true - emit("change", true) + emit('change', true) }, - props.lazy ? 800 : 100 + props.lazy ? 800 : 100, ) } @@ -78,7 +94,7 @@ export default defineComponent({ } clearTimeout(timer) isOpen.value = false - emit("change", false) + emit('change', false) } function resize() { @@ -96,34 +112,37 @@ export default defineComponent({ const offset = props.offset switch (props.position) { - case "auto": - case "bottom": + case 'auto': + case 'bottom': x = left + width / 2 y = top + height + offset break - case "top": + case 'top': x = left y = top - pHeight - offset break - case "left": + case 'left': x = left - pWidth - offset y = top break - case "right": + case 'right': x = left + width + offset y = top break } - if (props.position == "auto") { + if (props.position == 'auto') { x = window.innerWidth - x > 500 ? x + 20 : x - 20 - 310 - y = window.innerHeight - y > popup.offsetHeight + 50 ? y : window.innerHeight - (popup.offsetHeight + 50) + y = + window.innerHeight - y > popup.offsetHeight + 50 + ? y + : window.innerHeight - (popup.offsetHeight + 50) } dropdownPosition.x = x dropdownPosition.y = y } } - watch(isOpen, val => { + watch(isOpen, (val) => { if (val) { mounted.value = true } @@ -133,12 +152,16 @@ export default defineComponent({ return () => { return (
- {renderSlot(slots, "default")} + {renderSlot(slots, 'default')} {mounted.value && !props.disabled && ( -
- {renderSlot(slots, "popper")} +
+ {renderSlot(slots, 'popper')}
)} @@ -146,5 +169,5 @@ export default defineComponent({
) } - } + }, }) diff --git a/frontend/src/components/calc/README b/frontend/src/components/calc/README index 782a9261..2ad1d84e 100644 --- a/frontend/src/components/calc/README +++ b/frontend/src/components/calc/README @@ -1 +1 @@ -DNF风格定制组件 \ No newline at end of file +DNF风格定制组件 diff --git a/frontend/src/components/calc/action-dialog/index.vue b/frontend/src/components/calc/action-dialog/index.vue index d4f49b49..16d3ab6f 100644 --- a/frontend/src/components/calc/action-dialog/index.vue +++ b/frontend/src/components/calc/action-dialog/index.vue @@ -1,101 +1,101 @@ diff --git a/frontend/src/components/calc/autocomplete/index.vue b/frontend/src/components/calc/autocomplete/index.vue index ca639706..a8a85915 100644 --- a/frontend/src/components/calc/autocomplete/index.vue +++ b/frontend/src/components/calc/autocomplete/index.vue @@ -1,31 +1,40 @@ diff --git a/frontend/src/components/calc/button/index.vue b/frontend/src/components/calc/button/index.vue index cf91a5d7..1580c10f 100644 --- a/frontend/src/components/calc/button/index.vue +++ b/frontend/src/components/calc/button/index.vue @@ -1,116 +1,120 @@ diff --git a/frontend/src/components/calc/cascader/index.vue b/frontend/src/components/calc/cascader/index.vue index 7bd0793e..492ddd63 100644 --- a/frontend/src/components/calc/cascader/index.vue +++ b/frontend/src/components/calc/cascader/index.vue @@ -1,9 +1,9 @@ diff --git a/frontend/src/components/calc/checkbox-group/index.vue b/frontend/src/components/calc/checkbox-group/index.vue index d2570f0a..1010c06f 100644 --- a/frontend/src/components/calc/checkbox-group/index.vue +++ b/frontend/src/components/calc/checkbox-group/index.vue @@ -1,25 +1,25 @@ diff --git a/frontend/src/components/calc/collapse/index.vue b/frontend/src/components/calc/collapse/index.vue index b99920ea..0efe864e 100644 --- a/frontend/src/components/calc/collapse/index.vue +++ b/frontend/src/components/calc/collapse/index.vue @@ -1,33 +1,41 @@ diff --git a/frontend/src/components/calc/dialog/index.vue b/frontend/src/components/calc/dialog/index.vue index 6d88712b..d2183399 100644 --- a/frontend/src/components/calc/dialog/index.vue +++ b/frontend/src/components/calc/dialog/index.vue @@ -1,63 +1,72 @@ diff --git a/frontend/src/components/calc/iconselect/index.vue b/frontend/src/components/calc/iconselect/index.vue index b9f5c3a8..91d0d4ec 100644 --- a/frontend/src/components/calc/iconselect/index.vue +++ b/frontend/src/components/calc/iconselect/index.vue @@ -1,33 +1,42 @@ diff --git a/frontend/src/components/calc/index.ts b/frontend/src/components/calc/index.ts index 2be4ca9a..825c115d 100644 --- a/frontend/src/components/calc/index.ts +++ b/frontend/src/components/calc/index.ts @@ -1,18 +1,17 @@ -import type { App } from "vue" -import Button from "./button/index.vue" -import Tabs from "./tabs/index.vue" -import Tab from "./tab/index.vue" -import Select from "./select/index.vue" -import Option from "./option/index.vue" -import Menu from "./menu/menu.vue" -import Checkbox from "./checkbox/index.vue" -import Collapse from "./collapse/index.vue" -import Dialog from "./dialog/index.vue" -import Tooltip from "./tooltip/index.vue" -import Iconselect from "./iconselect/index.vue" -import Selection from "./selection/index.vue" -import Slider from "./slider/index.vue" - +import type { App } from 'vue' +import Button from './button/index.vue' +import Tabs from './tabs/index.vue' +import Tab from './tab/index.vue' +import Select from './select/index.vue' +import Option from './option/index.vue' +import Menu from './menu/menu.vue' +import Checkbox from './checkbox/index.vue' +import Collapse from './collapse/index.vue' +import Dialog from './dialog/index.vue' +import Tooltip from './tooltip/index.vue' +import Iconselect from './iconselect/index.vue' +import Selection from './selection/index.vue' +import Slider from './slider/index.vue' export const components = { Button, @@ -27,7 +26,7 @@ export const components = { Tooltip, Iconselect, Selection, - Slider + Slider, } export type CalcComponents = typeof components diff --git a/frontend/src/components/calc/item/index.vue b/frontend/src/components/calc/item/index.vue index d807fbc1..996d40aa 100644 --- a/frontend/src/components/calc/item/index.vue +++ b/frontend/src/components/calc/item/index.vue @@ -1,4 +1,4 @@ diff --git a/frontend/src/components/calc/loading/index.vue b/frontend/src/components/calc/loading/index.vue index 074a6ad8..69eefe0a 100644 --- a/frontend/src/components/calc/loading/index.vue +++ b/frontend/src/components/calc/loading/index.vue @@ -1,23 +1,26 @@ diff --git a/frontend/src/components/calc/menu/menu.vue b/frontend/src/components/calc/menu/menu.vue index 048324fb..ae79b322 100644 --- a/frontend/src/components/calc/menu/menu.vue +++ b/frontend/src/components/calc/menu/menu.vue @@ -1,10 +1,10 @@ diff --git a/frontend/src/components/calc/option/index.vue b/frontend/src/components/calc/option/index.vue index d807fbc1..996d40aa 100644 --- a/frontend/src/components/calc/option/index.vue +++ b/frontend/src/components/calc/option/index.vue @@ -1,4 +1,4 @@ diff --git a/frontend/src/components/calc/pagination/index.vue b/frontend/src/components/calc/pagination/index.vue index d3a5173a..3133dd6b 100644 --- a/frontend/src/components/calc/pagination/index.vue +++ b/frontend/src/components/calc/pagination/index.vue @@ -1,33 +1,35 @@ diff --git a/frontend/src/components/calc/progress/index.vue b/frontend/src/components/calc/progress/index.vue index 64b902d1..b465ba72 100644 --- a/frontend/src/components/calc/progress/index.vue +++ b/frontend/src/components/calc/progress/index.vue @@ -1,17 +1,17 @@ diff --git a/frontend/src/components/calc/select/index.vue b/frontend/src/components/calc/select/index.vue index 7146c1a5..598f9841 100644 --- a/frontend/src/components/calc/select/index.vue +++ b/frontend/src/components/calc/select/index.vue @@ -1,57 +1,67 @@ diff --git a/frontend/src/components/calc/selection/index.vue b/frontend/src/components/calc/selection/index.vue index 2d16b51b..24b57370 100644 --- a/frontend/src/components/calc/selection/index.vue +++ b/frontend/src/components/calc/selection/index.vue @@ -1,5 +1,5 @@ diff --git a/frontend/src/components/calc/shared.ts b/frontend/src/components/calc/shared.ts index acb9ff67..879e13a8 100644 --- a/frontend/src/components/calc/shared.ts +++ b/frontend/src/components/calc/shared.ts @@ -1,3 +1,3 @@ -import type { InjectionKey } from "vue"; +import type { InjectionKey } from 'vue' -export const CHECKBOX_GROUP: InjectionKey = Symbol("checkbox-group") +export const CHECKBOX_GROUP: InjectionKey = Symbol('checkbox-group') diff --git a/frontend/src/components/calc/slider/index.vue b/frontend/src/components/calc/slider/index.vue index f8f5a1cf..a05249d6 100644 --- a/frontend/src/components/calc/slider/index.vue +++ b/frontend/src/components/calc/slider/index.vue @@ -3,37 +3,36 @@ import { defineComponent, ref, computed, shallowRef, watch } from 'vue' import { useVModel, useDraggable, clamp } from '@vueuse/core' export default defineComponent({ - name: "ISlider", + name: 'ISlider', props: { modelValue: { type: Number, - default: 0 + default: 0, }, min: { type: Number, - default: 0 + default: 0, }, max: { type: Number, - default: 100 + default: 100, }, step: { type: Number, - default: 1 + default: 1, }, disabled: { type: Boolean, - default: false + default: false, }, showPercent: { type: Boolean, - default: true + default: true, }, formatValue: { type: Function, - default: undefined - } - + default: undefined, + }, }, emits: ['update:modelValue', 'change'], setup(props, { emit }) { @@ -47,17 +46,20 @@ export default defineComponent({ useDraggable(buttonRef, { onMove(position) { - if (!runwayRef.value || props.disabled){ + if (!runwayRef.value || props.disabled) { return } const runwayRect = runwayRef.value?.getBoundingClientRect() - if (!runwayRect){ - return + if (!runwayRect) { + return } // 使用runway的位置和宽度来计算百分比 - const percentage = Math.max(0, Math.min(100, ((position.x - runwayRect.left) / runwayRect.width) * 100)) + const percentage = Math.max( + 0, + Math.min(100, ((position.x - runwayRect.left) / runwayRect.width) * 100), + ) const range = props.max - props.min let value = (percentage * range) / 100 + props.min @@ -70,20 +72,17 @@ export default defineComponent({ modelValue.value = value emit('change', value) - } + }, }) return () => (
-
+
-
+
{props.showPercent && ( -
- {props.formatValue ? props.formatValue(modelValue.value) : `${percentage.value.toFixed(0)}%`} +
+ {props.formatValue + ? props.formatValue(modelValue.value) + : `${percentage.value.toFixed(0)}%`}
)}
) - } + }, }) @@ -204,4 +209,3 @@ export default defineComponent({ font-weight: 500; } - diff --git a/frontend/src/components/calc/tab/index.vue b/frontend/src/components/calc/tab/index.vue index 2dcd7450..11fb93b9 100644 --- a/frontend/src/components/calc/tab/index.vue +++ b/frontend/src/components/calc/tab/index.vue @@ -1,16 +1,16 @@ diff --git a/frontend/src/components/calc/tabs/constants.ts b/frontend/src/components/calc/tabs/constants.ts index dc06fe9f..4577bcc1 100644 --- a/frontend/src/components/calc/tabs/constants.ts +++ b/frontend/src/components/calc/tabs/constants.ts @@ -1,5 +1,5 @@ -export const AciveSymbol = Symbol("[i-tabs]active") +export const AciveSymbol = Symbol('[i-tabs]active') -export const AciveClassSymbol = Symbol("[i-tabs]active-class") +export const AciveClassSymbol = Symbol('[i-tabs]active-class') -export const ChangeActiveSymbol = Symbol("[i-tabs]change-active") +export const ChangeActiveSymbol = Symbol('[i-tabs]change-active') diff --git a/frontend/src/components/calc/tabs/index.vue b/frontend/src/components/calc/tabs/index.vue index 850bd296..f1f40188 100644 --- a/frontend/src/components/calc/tabs/index.vue +++ b/frontend/src/components/calc/tabs/index.vue @@ -1,30 +1,30 @@ diff --git a/frontend/src/components/calc/tooltip/index.vue b/frontend/src/components/calc/tooltip/index.vue index 2174da11..c4f5578c 100644 --- a/frontend/src/components/calc/tooltip/index.vue +++ b/frontend/src/components/calc/tooltip/index.vue @@ -1,24 +1,27 @@ diff --git a/frontend/src/components/calc/tree/index.vue b/frontend/src/components/calc/tree/index.vue index 04f012da..34321b54 100644 --- a/frontend/src/components/calc/tree/index.vue +++ b/frontend/src/components/calc/tree/index.vue @@ -1,55 +1,55 @@ diff --git a/frontend/src/components/calc/tree/node.vue b/frontend/src/components/calc/tree/node.vue index c8b7ba8e..785a7c93 100644 --- a/frontend/src/components/calc/tree/node.vue +++ b/frontend/src/components/calc/tree/node.vue @@ -1,34 +1,34 @@ diff --git a/frontend/src/components/calc/tree/types.ts b/frontend/src/components/calc/tree/types.ts index 554d618d..bd4cf8a6 100644 --- a/frontend/src/components/calc/tree/types.ts +++ b/frontend/src/components/calc/tree/types.ts @@ -1,10 +1,10 @@ -export interface TreeNode { - label: string - id?: string | number - value?: any - children?: TreeNode[] - onSelect?: () => void - [key: string]: any -} - -export interface TreeData {} +export interface TreeNode { + label: string + id?: string | number + value?: any + children?: TreeNode[] + onSelect?: () => void + [key: string]: any +} + +export interface TreeData {} diff --git a/frontend/src/components/dnf/Avatar/List/index.vue b/frontend/src/components/dnf/Avatar/List/index.vue index 3a948ddc..489998e6 100644 --- a/frontend/src/components/dnf/Avatar/List/index.vue +++ b/frontend/src/components/dnf/Avatar/List/index.vue @@ -36,11 +36,10 @@ const infoStyle = (part: string) => { // x += 179 // index -= 5 // } - if(part == '宠物'){ - x+= 5*39 - y+= 1*40 - } - else if (part.includes('宠物装备')) { + if (part == '宠物') { + x += 5 * 39 + y += 1 * 40 + } else if (part.includes('宠物装备')) { x += 6 * 39 y += (index - infoStore.avatarParts.findIndex((p) => p == '宠物装备-红')) * 40 } else { @@ -63,7 +62,7 @@ const choosePart = (part: string) => { const partName = (part: string) => { if (part == '武器装扮') return '武器' - if(part == '快捷栏装备') return '快捷' + if (part == '快捷栏装备') return '快捷' return part.replace('宠物装备-', '') } diff --git a/frontend/src/components/dnf/Equipment/Icon/index.vue b/frontend/src/components/dnf/Equipment/Icon/index.vue index dde3f1a5..ec52e5cf 100644 --- a/frontend/src/components/dnf/Equipment/Icon/index.vue +++ b/frontend/src/components/dnf/Equipment/Icon/index.vue @@ -1,20 +1,21 @@ - `` + +`` diff --git a/frontend/src/components/dnf/Equipment/Info/index.vue b/frontend/src/components/dnf/Equipment/Info/index.vue index ae34e7b8..09fccf3e 100644 --- a/frontend/src/components/dnf/Equipment/Info/index.vue +++ b/frontend/src/components/dnf/Equipment/Info/index.vue @@ -17,7 +17,7 @@
-
{{ props.equipment?.name }}
+
{{ props.equipment?.name }}
{{ props.equipment?.categorize }}
@@ -28,29 +28,35 @@
{{ props.equipment?.rarity }}
{{ props.equipment?.itemDetailType }}
- +
-
-
+
+
-
-
+
+
-
- - @@ -65,29 +71,44 @@ const props = defineProps<{ const rarity = computed(() => rarityClass(props.equipment?.rarity ?? '')) -const mainAttr = computed(()=>{ - const attrs :(keyof IEquipment)[] = ['STR', 'INT', 'Vitality', 'Spirit','AtkP','AtkM','AtkI','SkillAttack','Attack','Buffer'] - let info = "" +const mainAttr = computed(() => { + const attrs: (keyof IEquipment)[] = [ + 'STR', + 'INT', + 'Vitality', + 'Spirit', + 'AtkP', + 'AtkM', + 'AtkI', + 'SkillAttack', + 'Attack', + 'Buffer', + ] + let info = '' for (const attr of attrs) { const item = props.equipment?.[attr] as number[] if (item?.[0]) { - info += `${formatAttr(attr,item?.[0])}\n` + info += `${formatAttr(attr, item?.[0])}\n` } } - return info; - - + return info }) -const detail = computed(()=>props.equipment?.detail.replace(/\[([^\[\]技能]+?)\]/g, '[$1]')) +const detail = computed(() => + props.equipment?.detail.replace( + /\[([^\[\]技能]+?)\]/g, + '[$1]', + ), +) -const bufferDetail = computed(()=> -{ +const bufferDetail = computed(() => { const detail = props.equipment?.bufferDetail - if(!detail || detail == '-') return undefined - return props.equipment?.bufferDetail.replace(/\[([^\[\]技能]+?)\]/g, '[$1]') -} ) - + if (!detail || detail == '-') return undefined + return props.equipment?.bufferDetail.replace( + /\[([^\[\]技能]+?)\]/g, + '[$1]', + ) +})