init
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
<script lang="tsx">
|
||||
import { computed, defineComponent, ref, renderList } from 'vue'
|
||||
import { computed, defineComponent, ref } from 'vue'
|
||||
import type { IEnchantingInfo } from '@/api/info/type'
|
||||
import { useInfoStore, useConfigStore } from '@/stores'
|
||||
import EquList from '@/components/dnf/Equipment/List/index.vue'
|
||||
import { getImageURL } from '@/utils/images'
|
||||
import { UiCheckbox } from '@/components/ui/checkbox'
|
||||
import ForgeSelect, { type ForgeSelectOption } from './ForgeSelect.vue'
|
||||
import ForgeSlider from './ForgeSlider.vue'
|
||||
export default defineComponent({
|
||||
name: 'Equip',
|
||||
setup() {
|
||||
@@ -121,11 +123,32 @@ export default defineComponent({
|
||||
//精度
|
||||
const precision = currentInfo<number>('precision', 0)
|
||||
|
||||
const reinforceTypeOptions: ForgeSelectOption[] = [
|
||||
{ label: '强化', value: 0 },
|
||||
{ label: '增幅', value: 1 },
|
||||
]
|
||||
const reinforceOptions: ForgeSelectOption[] = Array.from({ length: 31 }, (_, value) => ({
|
||||
label: String(value),
|
||||
value,
|
||||
}))
|
||||
const refineOptions: ForgeSelectOption[] = Array.from({ length: 9 }, (_, value) => ({
|
||||
label: `锻造+ ${value}`,
|
||||
value,
|
||||
}))
|
||||
const adaptationOptions: ForgeSelectOption[] = Array.from({ length: 4 }, (_, value) => ({
|
||||
label: String(value),
|
||||
value,
|
||||
}))
|
||||
const enchantOptions = computed<ForgeSelectOption[]>(() => [
|
||||
{ label: '无', value: '' },
|
||||
...(enchant_list.value ?? []).map((item) => ({ label: item.detail, value: item.id })),
|
||||
])
|
||||
|
||||
// 武器融合
|
||||
return () => {
|
||||
return (
|
||||
<>
|
||||
<div class="h-150px flex justify-center items-center">
|
||||
<div class="forge-preview">
|
||||
<EquList
|
||||
v-model:part={part.value}
|
||||
withBg={false}
|
||||
@@ -136,108 +159,86 @@ export default defineComponent({
|
||||
|
||||
<div class="flex flex-wrap equ-profile">
|
||||
<div class="equ-profile-item">
|
||||
<div class="mr-10px row-name">当前部位</div>
|
||||
<div class="row-name">当前部位</div>
|
||||
<span> {part.value}</span>
|
||||
{can_upgrade.value ? (
|
||||
<calc-checkbox
|
||||
style="margin-left:auto"
|
||||
v-model={global_change.value}
|
||||
label="全局修改"
|
||||
></calc-checkbox>
|
||||
) : (
|
||||
<div></div>
|
||||
)}
|
||||
<label class="forge-checkbox" style="margin-left:auto">
|
||||
<UiCheckbox v-model={global_change.value} aria-label="全局修改" />
|
||||
<span>全局修改</span>
|
||||
</label>
|
||||
) : null}
|
||||
</div>
|
||||
{part.value == '副武器' ? (
|
||||
<>
|
||||
<div class="equ-profile-item">
|
||||
<div class="row-name">增幅</div>
|
||||
<calc-select v-model={reinforce_type.value} class="flex-1 !h-20px">
|
||||
<calc-option value={0}>强化</calc-option>
|
||||
<calc-option value={1}>增幅</calc-option>
|
||||
</calc-select>
|
||||
<calc-select v-model={reinforce.value} class="flex-1 !h-20px">
|
||||
{renderList(31, (i) => (
|
||||
<calc-option value={i - 1}>{i - 1}</calc-option>
|
||||
))}
|
||||
</calc-select>
|
||||
</div>
|
||||
</>
|
||||
<div class="equ-profile-item">
|
||||
<div class="row-name">增幅</div>
|
||||
<ForgeSelect
|
||||
v-model={reinforce_type.value}
|
||||
label="副武器强化类型"
|
||||
options={reinforceTypeOptions}
|
||||
/>
|
||||
<ForgeSelect
|
||||
v-model={reinforce.value}
|
||||
label="副武器强化等级"
|
||||
options={reinforceOptions}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
{can_upgrade.value ? (
|
||||
<div class="equ-profile-item">
|
||||
<div class="row-name">增幅</div>
|
||||
<calc-select v-model={reinforce_type.value} class="flex-1 !h-20px">
|
||||
<calc-option value={0}>强化</calc-option>
|
||||
<calc-option value={1}>增幅</calc-option>
|
||||
</calc-select>
|
||||
<calc-select v-model={reinforce.value} class="flex-1 !h-20px">
|
||||
{renderList(31, (i) => (
|
||||
<calc-option value={i - 1}>{i - 1}</calc-option>
|
||||
))}
|
||||
</calc-select>
|
||||
<ForgeSelect
|
||||
v-model={reinforce_type.value}
|
||||
label={`${part.value}强化类型`}
|
||||
options={reinforceTypeOptions}
|
||||
/>
|
||||
<ForgeSelect
|
||||
v-model={reinforce.value}
|
||||
label={`${part.value}强化等级`}
|
||||
options={reinforceOptions}
|
||||
/>
|
||||
{part.value == '武器' && (
|
||||
<calc-select v-model={refine.value} class="flex-1 !h-20px">
|
||||
{renderList(9, (i) => (
|
||||
<calc-option value={i - 1}>锻造+ {i - 1}</calc-option>
|
||||
))}
|
||||
</calc-select>
|
||||
<ForgeSelect
|
||||
v-model={refine.value}
|
||||
label="武器锻造等级"
|
||||
options={refineOptions}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div></div>
|
||||
)}
|
||||
) : null}
|
||||
|
||||
<div class="equ-profile-item">
|
||||
<div class="row-name">附魔</div>
|
||||
<calc-select v-model={enchant.value} class="flex-1 !h-20px">
|
||||
<calc-option value={''}>无</calc-option>
|
||||
{renderList(enchant_list.value ?? [], (item) => (
|
||||
<calc-option value={item.id}>{item.detail}</calc-option>
|
||||
))}
|
||||
</calc-select>
|
||||
<ForgeSelect
|
||||
v-model={enchant.value}
|
||||
label={`${part.value}附魔`}
|
||||
options={enchantOptions.value}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{can_upgrade.value ? (
|
||||
<div class="equ-profile-item">
|
||||
<div class="row-name">调适</div>
|
||||
{/* <calc-slider
|
||||
showValue={true}
|
||||
showPercent={false}
|
||||
v-model={adaptation.value}
|
||||
min={0}
|
||||
max={3}
|
||||
step={1}
|
||||
class="flex-1 !h-20px"
|
||||
/> */}
|
||||
<calc-select v-model={adaptation.value} class="flex-1 !h-20px">
|
||||
{renderList(4, (i) => (
|
||||
<calc-option value={i - 1}>{i - 1}</calc-option>
|
||||
))}
|
||||
</calc-select>
|
||||
<ForgeSelect
|
||||
v-model={adaptation.value}
|
||||
label={`${part.value}调适`}
|
||||
options={adaptationOptions}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div></div>
|
||||
)}
|
||||
) : null}
|
||||
{can_set_secret.value ? (
|
||||
<>
|
||||
<div class="equ-profile-item">
|
||||
<div class="row-name">精度</div>
|
||||
<calc-slider
|
||||
showPercent={true}
|
||||
showValue={false}
|
||||
v-model={precision.value}
|
||||
min={0}
|
||||
max={100}
|
||||
step={1}
|
||||
class="flex-1 !h-20px"
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<div></div>
|
||||
)}
|
||||
<div class="equ-profile-item">
|
||||
<div class="row-name">精度</div>
|
||||
<ForgeSlider
|
||||
modelValue={precision.value}
|
||||
onUpdate:modelValue={(value) => (precision.value = value)}
|
||||
label={`${part.value}秘宝精度`}
|
||||
min={0}
|
||||
max={100}
|
||||
step={1}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user