1.新增充值档位配置
2.新增充值/提现配置
This commit is contained in:
109
web/src/views/backend/config/depositChannel/popupForm.vue
Normal file
109
web/src/views/backend/config/depositChannel/popupForm.vue
Normal file
@@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="ba-operate-dialog"
|
||||
:close-on-click-modal="false"
|
||||
:model-value="baTable.form.operate === 'Edit'"
|
||||
@close="baTable.toggleForm"
|
||||
>
|
||||
<template #header>
|
||||
<div class="title" v-drag="['.ba-operate-dialog', '.el-dialog__header']" v-zoom="'.ba-operate-dialog'">
|
||||
{{ t('Edit') }}
|
||||
</div>
|
||||
</template>
|
||||
<el-scrollbar v-loading="baTable.form.loading" class="ba-table-form-scrollbar">
|
||||
<div
|
||||
class="ba-operate-form ba-Edit-form"
|
||||
:style="config.layout.shrink ? '' : 'width: calc(100% - ' + baTable.form.labelWidth! / 2 + 'px)'"
|
||||
>
|
||||
<el-form
|
||||
v-if="!baTable.form.loading"
|
||||
ref="formRef"
|
||||
@submit.prevent=""
|
||||
@keyup.enter="baTable.onSubmit(formRef)"
|
||||
:model="baTable.form.items"
|
||||
:label-position="config.layout.shrink ? 'top' : 'right'"
|
||||
:label-width="baTable.form.labelWidth + 'px'"
|
||||
:rules="formRules"
|
||||
>
|
||||
<el-alert class="ba-table-alert" type="info" :closable="false" show-icon>
|
||||
{{ t('config.depositChannel.form_tip') }}
|
||||
</el-alert>
|
||||
|
||||
<el-form-item :label="t('config.depositChannel.code')" prop="code">
|
||||
<el-input :model-value="String(baTable.form.items!.code ?? '')" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('config.depositChannel.display_name')">
|
||||
<el-input :model-value="registryDisplayName" readonly />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="t('config.depositChannel.sort')" prop="sort">
|
||||
<el-input-number v-model="baTable.form.items!.sort" :min="0" :max="9999" :controls="true" class="w100" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('config.depositChannel.status')" prop="status">
|
||||
<el-switch v-model="baTable.form.items!.status" :active-value="1" :inactive-value="0" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="t('config.depositChannel.tier_ids')" prop="tier_ids">
|
||||
<el-select
|
||||
v-model="baTable.form.items!.tier_ids"
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
filterable
|
||||
clearable
|
||||
class="w100"
|
||||
:placeholder="t('config.depositChannel.tier_ids_ph')"
|
||||
>
|
||||
<el-option v-for="opt in tierOptions" :key="opt.id" :label="opt.label" :value="opt.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
<template #footer>
|
||||
<div :style="'width: calc(100% - ' + baTable.form.labelWidth! / 1.8 + 'px)'">
|
||||
<el-button @click="baTable.toggleForm()">{{ t('Cancel') }}</el-button>
|
||||
<el-button v-blur :loading="baTable.form.submitLoading" type="primary" @click="baTable.onSubmit(formRef)">
|
||||
{{ t('Save') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import { computed, inject, useTemplateRef } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useConfig } from '/@/stores/config'
|
||||
|
||||
type TierOpt = { id: string; label: string }
|
||||
|
||||
const config = useConfig()
|
||||
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||
const baTable = inject('baTable') as baTable
|
||||
const { t } = useI18n()
|
||||
|
||||
const tierOptions = computed(() => {
|
||||
const raw = baTable.table.extend?.tier_options
|
||||
return Array.isArray(raw) ? (raw as TierOpt[]) : []
|
||||
})
|
||||
|
||||
const registryDisplayName = computed(() => {
|
||||
const code = String(baTable.form.items?.code ?? '')
|
||||
const reg = baTable.table.extend?.registry as Record<string, { name?: string }> | undefined
|
||||
if (!code || !reg || !reg[code]) {
|
||||
return code
|
||||
}
|
||||
const n = reg[code].name
|
||||
return typeof n === 'string' && n !== '' ? n : code
|
||||
})
|
||||
|
||||
const formRules = {}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.w100 {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user