Merge pull request #188 from betaxab/pr-mobile-optimization
style: Optimize web pages for mobile devices
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { computed } from "vue";
|
||||
import type { ComputedRef } from "vue";
|
||||
import { useDevicesSize } from "@/hooks/useDevicesSize";
|
||||
|
||||
interface LayoutModel {
|
||||
formLayout: ComputedRef<"vertical" | "horizontal">;
|
||||
tableFixed: ComputedRef<"" | "right">;
|
||||
descriptionsLayout: ComputedRef<"inline-vertical" | "right">;
|
||||
descriptionsColumn: (min?: number, max?: number) => number;
|
||||
dialogWidth: (min?: string, max?: string) => string;
|
||||
}
|
||||
|
||||
export const useLayoutModel = (): LayoutModel => {
|
||||
const { isMobile } = useDevicesSize();
|
||||
|
||||
const formLayout = computed(() => (isMobile.value ? "vertical" : "horizontal"));
|
||||
const tableFixed = computed(() => (isMobile.value ? "" : "right"));
|
||||
const descriptionsLayout = computed(() => (isMobile.value ? "inline-vertical" : "right"));
|
||||
const descriptionsColumn = (min: number = 1, max: number = 2) => (isMobile.value ? min : max);
|
||||
const dialogWidth = (min: string = "40%", max: string = "95%") => (isMobile.value ? max : min);
|
||||
|
||||
return { formLayout, tableFixed, descriptionsLayout, descriptionsColumn, dialogWidth };
|
||||
};
|
||||
@@ -23,6 +23,7 @@
|
||||
}
|
||||
|
||||
.card {
|
||||
min-width: 0;
|
||||
background: $color-bg-2;
|
||||
border: 1px solid $color-border-2;
|
||||
border-radius: 4px;
|
||||
@@ -46,11 +47,17 @@ p {
|
||||
margin: 0;
|
||||
color: $color-text-2;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.link {
|
||||
display: inline;
|
||||
color: $color-link;
|
||||
text-decoration: none;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.link:hover {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<a-modal width="680px" :visible="visible" @close="onClose" @cancel="onClose" @update:visible="onClose" unmount-on-close>
|
||||
<a-modal :width="detailDialogWidth" :visible="visible" @close="onClose" @cancel="onClose" @update:visible="onClose" unmount-on-close>
|
||||
<template #title>
|
||||
<div class="detail-modal-title">
|
||||
<icon-star />
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<!-- 功能操作按钮 -->
|
||||
<template #footer>
|
||||
<a-space>
|
||||
<a-space wrap>
|
||||
<a-button
|
||||
v-if="detailData.status === 2 && detailData.notify_state === 0"
|
||||
type="primary"
|
||||
@@ -41,7 +41,7 @@
|
||||
</a-tag>
|
||||
</template>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-user />
|
||||
@@ -50,7 +50,7 @@
|
||||
<div class="detail-value">{{ detailData.name }}</div>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-swap />
|
||||
@@ -63,7 +63,7 @@
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-file />
|
||||
@@ -74,7 +74,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-tag />
|
||||
@@ -87,7 +87,7 @@
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-archive />
|
||||
@@ -100,7 +100,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-pushpin />
|
||||
@@ -150,7 +150,7 @@
|
||||
<!-- 回调信息卡片 -->
|
||||
<a-card class="detail-card" title="回调信息" :bordered="false" v-if="detailData.status === 2 || detailData.status === 5">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-check />
|
||||
@@ -162,7 +162,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="12" v-if="detailData.return_url">
|
||||
<a-col :xs="24" :sm="24" :md="12" v-if="detailData.return_url">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-link />
|
||||
@@ -181,7 +181,7 @@
|
||||
<!-- 区块链信息卡片 -->
|
||||
<a-card class="detail-card" title="区块链数据" :bordered="false" v-if="detailData.status === 2 || detailData.status === 5">
|
||||
<a-row :gutter="24" v-if="detailData.ref_hash">
|
||||
<a-col :span="12" v-if="detailData.ref_block_num">
|
||||
<a-col :xs="24" :sm="24" :md="12" v-if="detailData.ref_block_num">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-layers />
|
||||
@@ -190,7 +190,7 @@
|
||||
<div class="detail-value">{{ detailData.ref_block_num }}</div>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-safe />
|
||||
@@ -218,7 +218,7 @@
|
||||
<!-- 时间信息卡片 -->
|
||||
<a-card class="detail-card" title="订单时间" :bordered="false">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12" v-if="detailData.created_at">
|
||||
<a-col :xs="24" :sm="24" :md="12" v-if="detailData.created_at">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-plus-circle />
|
||||
@@ -227,7 +227,7 @@
|
||||
<div class="detail-value">{{ formatDateTime(detailData.created_at) }}</div>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-check-circle v-if="detailData.confirmed_at && (detailData.status === 2 || detailData.status === 5)" />
|
||||
@@ -261,6 +261,7 @@ import { getCryptoColor } from "@/views/rate/common";
|
||||
import { delOrderApi } from "@/api/modules/order/index";
|
||||
import { Notification, Modal } from "@arco-design/web-vue";
|
||||
import { manualNotifyAPI } from "@/api/modules/order/index";
|
||||
import { useLayoutModel } from "@/hooks/useLayoutModel";
|
||||
|
||||
const props = defineProps({
|
||||
visible: Boolean,
|
||||
@@ -270,6 +271,9 @@ const props = defineProps({
|
||||
}
|
||||
});
|
||||
|
||||
const { dialogWidth } = useLayoutModel();
|
||||
const detailDialogWidth = computed(() => dialogWidth("820px"));
|
||||
|
||||
const emits = defineEmits(["close", "refresh"]);
|
||||
|
||||
const onClose = () => emits("close");
|
||||
@@ -358,7 +362,18 @@ const currencySymbolMap: Record<string, string> = {
|
||||
const getCurrencySymbol = (fiat: string) => currencySymbolMap[fiat] || "";
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.arco-modal-body) {
|
||||
max-height: calc(100vh - 172px);
|
||||
overflow-y: auto;
|
||||
padding: 16px 20px;
|
||||
scrollbar-width: none;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.detail-modal-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -366,13 +381,20 @@ const getCurrencySymbol = (fiat: string) => currencySymbolMap[fiat] || "";
|
||||
}
|
||||
|
||||
.detail-content {
|
||||
padding: 8px 0;
|
||||
max-height: 70vh;
|
||||
overflow-y: auto;
|
||||
padding: 0;
|
||||
overflow-y: visible;
|
||||
}
|
||||
|
||||
.detail-card {
|
||||
margin-bottom: 16px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.detail-card :deep(.arco-card-header) {
|
||||
padding: 14px 20px 10px;
|
||||
}
|
||||
|
||||
.detail-card :deep(.arco-card-body) {
|
||||
padding: 16px 20px 12px;
|
||||
}
|
||||
|
||||
.detail-card:last-child {
|
||||
@@ -387,11 +409,12 @@ const getCurrencySymbol = (fiat: string) => currencySymbolMap[fiat] || "";
|
||||
}
|
||||
|
||||
.detail-item {
|
||||
margin-bottom: 20px;
|
||||
margin-bottom: 16px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.detail-item:last-child {
|
||||
margin-bottom: 0;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
@@ -400,7 +423,7 @@ const getCurrencySymbol = (fiat: string) => currencySymbolMap[fiat] || "";
|
||||
gap: 8px;
|
||||
font-weight: 500;
|
||||
color: var(--color-text-2);
|
||||
margin-bottom: 6px;
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
@@ -408,7 +431,8 @@ const getCurrencySymbol = (fiat: string) => currencySymbolMap[fiat] || "";
|
||||
font-size: 14px;
|
||||
color: var(--color-text-1);
|
||||
line-height: 1.5;
|
||||
padding-left: 26px;
|
||||
min-width: 0;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.detail-value :deep(.arco-typography) {
|
||||
@@ -432,7 +456,7 @@ const getCurrencySymbol = (fiat: string) => currencySymbolMap[fiat] || "";
|
||||
}
|
||||
|
||||
.address-value :deep(.arco-typography-operation-copy) {
|
||||
color: var(--color-link);
|
||||
color: $color-link;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
@@ -488,7 +512,7 @@ const getCurrencySymbol = (fiat: string) => currencySymbolMap[fiat] || "";
|
||||
}
|
||||
|
||||
.detail-content {
|
||||
max-height: 80vh;
|
||||
max-height: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -11,7 +11,7 @@
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row justify="center" class="margin-top">
|
||||
<a-col :xs="18" :sm="12" :md="12" :lg="12" :xl="8" :xxl="8">
|
||||
<a-col :xs="18" :sm="12" :md="12" :lg="12" :xl="12" :xxl="12">
|
||||
<a-form ref="formRef" auto-label-width :layout="formLayout" :model="form" :rules="rules" @submit="handleSubmit">
|
||||
<div v-if="currentStep == 1">
|
||||
<a-form-item field="name" label="收款项目" :validate-trigger="['change', 'input']">
|
||||
@@ -43,11 +43,11 @@
|
||||
<template #subtitle> {{ resultSubtitle }} </template>
|
||||
<template #extra>
|
||||
<a-space direction="vertical" size="large">
|
||||
<div v-if="resultStatus === 'success'">
|
||||
订单链接:
|
||||
<a-link :href="paymentUrl" target="_blank" :hoverable="false">{{ paymentUrl }}</a-link>
|
||||
</div>
|
||||
<a-space>
|
||||
<a-space v-if="resultStatus === 'success'" class="payment-link-row" wrap>
|
||||
<span>订单链接: </span>
|
||||
<a-link class="payment-link" :href="paymentUrl" target="_blank" :hoverable="false">{{ paymentUrl }}</a-link>
|
||||
</a-space>
|
||||
<a-space wrap>
|
||||
<a-button type="primary" v-if="resultStatus === 'success'" @click="copyLink">复制订单链接</a-button>
|
||||
<a-button @click="resetForm">再次创建</a-button>
|
||||
</a-space>
|
||||
@@ -66,7 +66,7 @@
|
||||
</a-row>
|
||||
<a-row v-if="currentStep == 2">
|
||||
<a-col :span="16" :offset="4">
|
||||
<a-typography style="padding: 24px; background: var(--color-fill-2)">
|
||||
<a-typography class="result-tip">
|
||||
<a-typography-paragraph>提示</a-typography-paragraph>
|
||||
<ul>
|
||||
<li>您可以将该链接发给客户让其支付</li>
|
||||
@@ -225,4 +225,34 @@ const resetForm = () => {
|
||||
.margin-top {
|
||||
margin-top: 60px;
|
||||
}
|
||||
|
||||
.result-tip {
|
||||
padding: 24px;
|
||||
background: var(--color-fill-2);
|
||||
}
|
||||
|
||||
.payment-link-row {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.payment-link {
|
||||
max-width: 100%;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.container {
|
||||
padding: 32px 0;
|
||||
}
|
||||
|
||||
.margin-top {
|
||||
margin-top: 32px;
|
||||
}
|
||||
|
||||
.result-tip {
|
||||
padding: 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<div class="snow-page">
|
||||
<div class="snow-inner">
|
||||
<a-form ref="formRef" :model="formData.form" auto-label-width>
|
||||
<a-form ref="formRef" auto-label-width :model="formData.form">
|
||||
<a-row :gutter="16">
|
||||
<a-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6">
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-form-item field="order_id" label="商户订单">
|
||||
<a-input v-model="formData.form.order_id" placeholder="请输入商户订单" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6">
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-form-item field="trade_type" label="交易类型">
|
||||
<a-select v-model="formData.form.trade_type" placeholder="请选择交易类型" allow-clear allow-search>
|
||||
<a-option v-for="item in tradeTypeOptions" :key="item.value" :value="item.value">
|
||||
@@ -17,7 +17,7 @@
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6">
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-form-item field="status" label="订单状态">
|
||||
<a-select v-model="formData.form.status" placeholder="请选择订单状态" allow-clear>
|
||||
<a-option v-for="item in statusOptions" :key="item.value" :value="item.value">
|
||||
@@ -27,48 +27,45 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6" class="btn-col">
|
||||
<a-form-item label=" " style="margin-bottom: 0">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="getOrderList">
|
||||
<template #icon><icon-search /></template>
|
||||
查询
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-space class="search-btn" wrap>
|
||||
<a-button type="primary" @click="getOrderList">
|
||||
<template #icon><icon-search /></template>
|
||||
查询
|
||||
</a-button>
|
||||
<a-button @click="onReset">
|
||||
<template #icon><icon-refresh /></template>
|
||||
重置
|
||||
</a-button>
|
||||
<a-popconfirm :content="batchDelConfirm" type="warning" @ok="onBatchDelete">
|
||||
<a-button v-show="selectedKeys.length > 0" type="primary" status="danger">
|
||||
<template #icon><icon-delete /></template>
|
||||
删除
|
||||
</a-button>
|
||||
<a-button @click="onReset">
|
||||
<template #icon><icon-refresh /></template>
|
||||
重置
|
||||
</a-button>
|
||||
<a-popconfirm :content="batchDelConfirm" type="warning" @ok="onBatchDelete">
|
||||
<a-button v-show="selectedKeys.length > 0" type="primary" status="danger">
|
||||
<template #icon><icon-delete /></template>
|
||||
删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button type="text" @click="formData.search = !formData.search">
|
||||
{{ formData.search ? "收起" : "展开" }}
|
||||
<icon-down :class="{ 'rotate-icon': formData.search }" />
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-popconfirm>
|
||||
<a-button type="text" @click="formData.search = !formData.search">
|
||||
{{ formData.search ? "收起" : "展开" }}
|
||||
<icon-down :class="{ 'rotate-icon': formData.search }" />
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="16" v-if="formData.search">
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-form-item field="trade_id" label="交易ID">
|
||||
<a-input v-model="formData.form.trade_id" placeholder="请输入交易ID" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-form-item field="address" label="钱包地址">
|
||||
<a-input v-model="formData.form.address" placeholder="请输入钱包地址" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-form-item field="createTime" label="创建时间">
|
||||
<a-range-picker v-model="formData.form.createTime" show-time format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<template v-if="formData.search">
|
||||
<a-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6">
|
||||
<a-form-item field="trade_id" label="交易ID">
|
||||
<a-input v-model="formData.form.trade_id" placeholder="请输入交易ID" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6">
|
||||
<a-form-item field="address" label="钱包地址">
|
||||
<a-input v-model="formData.form.address" placeholder="请输入钱包地址" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="12" :md="12" :lg="8" :xl="6">
|
||||
<a-form-item field="createTime" label="创建时间">
|
||||
<a-range-picker v-model="formData.form.createTime" show-time format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
</a-row>
|
||||
</a-form>
|
||||
|
||||
@@ -124,7 +121,7 @@
|
||||
|
||||
<!-- 不常用的操作优先放置在详情页,尽量保持第一视角的干净整洁 -->
|
||||
<template #optional="{ record }">
|
||||
<a-space>
|
||||
<a-space wrap>
|
||||
<a-button size="mini" type="primary" @click="showDetail(record)">详情</a-button>
|
||||
<a-button size="mini" type="primary" status="warning" :disabled="record.status === 2" @click="showPaidModal(record)">
|
||||
补单
|
||||
@@ -145,7 +142,7 @@
|
||||
@cancel="closePaidModal"
|
||||
ok-text="确认补单"
|
||||
cancel-text="取消"
|
||||
width="500px"
|
||||
:width="paidDialogWidth"
|
||||
:mask-closable="false"
|
||||
>
|
||||
<div class="paid-modal-content">
|
||||
@@ -180,12 +177,15 @@ import { listAPI, paidAPI, delOrderApi } from "@/api/modules/order/index";
|
||||
import { List, FormData, Pagination } from "./config";
|
||||
import { Notification } from "@arco-design/web-vue";
|
||||
import { useUserInfoStore } from "@/store/modules/user-info";
|
||||
import DetailModal from "./detail.vue";
|
||||
import DetailModal from "./components/detail.vue";
|
||||
import { useOrderDetail } from "./detail";
|
||||
import { getCryptoColor } from "@/views/rate/common";
|
||||
import { useLayoutModel } from "@/hooks/useLayoutModel";
|
||||
|
||||
const userStores = useUserInfoStore();
|
||||
const { detailVisible, detailData, showDetail, closeDetail } = useOrderDetail();
|
||||
const { dialogWidth } = useLayoutModel();
|
||||
const paidDialogWidth = computed(() => dialogWidth("500px"));
|
||||
const tradeTypeOptions = computed(() => Object.entries(userStores.trade_type).map(([value, label]) => ({ value, label })));
|
||||
|
||||
const statusOptions = [
|
||||
@@ -355,17 +355,15 @@ getOrderList();
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.btn-col {
|
||||
.arco-form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.rotate-icon {
|
||||
transform: rotate(180deg);
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.wallet-name {
|
||||
cursor: help;
|
||||
color: $color-link;
|
||||
|
||||
+68
-61
@@ -1,24 +1,28 @@
|
||||
<template>
|
||||
<div class="rate-list">
|
||||
<div class="snow-page">
|
||||
<div class="snow-inner">
|
||||
<a-form ref="formRef" auto-label-width :model="formData.form">
|
||||
<a-row :gutter="16">
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<div class="snow-page">
|
||||
<div class="snow-inner">
|
||||
<a-form ref="formRef" auto-label-width :model="formData.form">
|
||||
<a-row :gutter="16">
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-form-item field="fiat" label="交易法币">
|
||||
<a-select v-model="formData.form.fiat" placeholder="请选择交易法币" allow-clear allow-search>
|
||||
<a-option v-for="item in tradeFiatOptions" :key="item.value" :value="item.value">
|
||||
{{ item.value }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-form-item field="crypto" label="加密货币">
|
||||
<a-select v-model="formData.form.crypto" placeholder="请选择加密货币" allow-clear allow-search>
|
||||
<a-option v-for="item in tradeCryptoOptions" :key="item.value" :value="item.value">
|
||||
{{ item.value }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-form-item field="datetime" label="同步时间">
|
||||
<a-range-picker
|
||||
v-model="formData.form.datetime"
|
||||
:placeholder="['开始时间', '结束时间']"
|
||||
@@ -27,51 +31,51 @@
|
||||
style="width: 100%"
|
||||
allow-clear
|
||||
/>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-space class="search-btn">
|
||||
<a-button type="primary" @click="getCommonTableList">
|
||||
<template #icon><icon-search /></template>
|
||||
查询
|
||||
</a-button>
|
||||
<a-button @click="onReset">
|
||||
<template #icon><icon-refresh /></template>
|
||||
重置
|
||||
</a-button>
|
||||
<a-button type="primary" status="success" @click="onSync">
|
||||
<template #icon><icon-loop /></template>
|
||||
立刻同步
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-divider :margin="10" />
|
||||
<a-table
|
||||
row-key="key"
|
||||
size="medium"
|
||||
:bordered="{ cell: true }"
|
||||
:scroll="{ x: 1400, y: 600 }"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
v-model:selectedKeys="selectedKeys"
|
||||
:pagination="pagination"
|
||||
@page-change="pageChange"
|
||||
@page-size-change="pageSizeChange"
|
||||
>
|
||||
<template #fiat="{ record }">
|
||||
<span class="fiat-display">
|
||||
{{ getFiatFlag(record.fiat) }} <strong>{{ record.fiat }}</strong>
|
||||
</span>
|
||||
</template>
|
||||
<template #crypto="{ record }">
|
||||
<a-tag :color="getCryptoColor(record.crypto)" bordered>
|
||||
{{ record.crypto }}
|
||||
</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-space class="search-btn" wrap>
|
||||
<a-button type="primary" @click="getCommonTableList">
|
||||
<template #icon><icon-search /></template>
|
||||
查询
|
||||
</a-button>
|
||||
<a-button @click="onReset">
|
||||
<template #icon><icon-refresh /></template>
|
||||
重置
|
||||
</a-button>
|
||||
<a-button type="primary" status="success" @click="onSync">
|
||||
<template #icon><icon-loop /></template>
|
||||
立刻同步
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<a-divider :margin="10" />
|
||||
<a-table
|
||||
row-key="key"
|
||||
size="medium"
|
||||
:bordered="{ cell: true }"
|
||||
:scroll="{ x: 510, y: 600 }"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
v-model:selectedKeys="selectedKeys"
|
||||
:pagination="pagination"
|
||||
@page-change="pageChange"
|
||||
@page-size-change="pageSizeChange"
|
||||
>
|
||||
<template #fiat="{ record }">
|
||||
<span class="fiat-display">
|
||||
{{ getFiatFlag(record.fiat) }} <strong>{{ record.fiat }}</strong>
|
||||
</span>
|
||||
</template>
|
||||
<template #crypto="{ record }">
|
||||
<a-tag :color="getCryptoColor(record.crypto)" bordered>
|
||||
{{ record.crypto }}
|
||||
</a-tag>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -109,12 +113,11 @@ const loading = ref(false);
|
||||
const data = reactive<List[]>([]);
|
||||
|
||||
const columns = [
|
||||
{ title: "ID", dataIndex: "id", align: "center", width: "100" },
|
||||
{ title: "交易法币", align: "center", dataIndex: "fiat", width: "180", slotName: "fiat" },
|
||||
{ title: "加密货币", align: "center", dataIndex: "crypto", width: "180", slotName: "crypto" },
|
||||
{ title: "订单汇率", align: "center", dataIndex: "rate" },
|
||||
{ title: "基准汇率", dataIndex: "raw_rate", align: "center", slotName: "raw_rate" },
|
||||
{ title: "同步时间", dataIndex: "created_at", align: "center", slotName: "created_at" }
|
||||
{ title: "交易法币", align: "center", dataIndex: "fiat", width: 102, slotName: "fiat" },
|
||||
{ title: "加密货币", align: "center", dataIndex: "crypto", width: 92, slotName: "crypto" },
|
||||
{ title: "订单汇率", align: "center", dataIndex: "rate", width: 102 },
|
||||
{ title: "基准汇率", dataIndex: "raw_rate", align: "center", slotName: "raw_rate", width: 102 },
|
||||
{ title: "同步时间", dataIndex: "created_at", align: "center", slotName: "created_at", width: 212 }
|
||||
];
|
||||
|
||||
const getCommonTableList = async () => {
|
||||
@@ -169,6 +172,10 @@ getCommonTableList();
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.search-btn {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.fiat-display {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
+268
-264
@@ -1,273 +1,276 @@
|
||||
<template>
|
||||
<div class="rate-syntax">
|
||||
<div class="snow-page">
|
||||
<div class="snow-inner">
|
||||
<a-row :gutter="16" style="margin: 16px 0">
|
||||
<a-col :span="12">
|
||||
<a-space size="medium">
|
||||
<a-button type="primary" @click="showSyncModal">
|
||||
<template #icon>
|
||||
<icon-settings />
|
||||
</template>
|
||||
同步配置
|
||||
</a-button>
|
||||
<a-button type="primary" @click="showAtomModal" :status="'danger'">
|
||||
<template #icon>
|
||||
<icon-robot-add />
|
||||
</template>
|
||||
支付颗粒度
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-table
|
||||
row-key="key"
|
||||
:size="'medium'"
|
||||
:bordered="{ cell: true }"
|
||||
:scroll="{ x: 1400, y: 600 }"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
v-model:selectedKeys="selectedKeys"
|
||||
:pagination="false"
|
||||
>
|
||||
<template #fiat="{ record }">
|
||||
<span class="fiat-display">
|
||||
{{ getFiatFlag(record.fiat) }} <strong>{{ record.fiat }}</strong>
|
||||
</span>
|
||||
</template>
|
||||
<template #crypto="{ record }">
|
||||
<a-tag :color="getCryptoColor(record.crypto)" :bordered="true">
|
||||
{{ record.crypto }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<template #syntax="{ record }">
|
||||
<div class="syntax-display">
|
||||
<span class="syntax-value">{{ record.syntax || "无" }}</span>
|
||||
<span class="syntax-description">{{ getTableSyntaxDescription(record.syntax) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #optional="{ record }">
|
||||
<a-space>
|
||||
<a-button size="mini" type="primary" @click="onEdit(record)">编辑</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
<div class="snow-page">
|
||||
<div class="snow-inner">
|
||||
<a-row :gutter="16" style="margin: 16px 0">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<a-space size="medium" wrap>
|
||||
<a-button type="primary" @click="showSyncModal">
|
||||
<template #icon>
|
||||
<icon-settings />
|
||||
</template>
|
||||
同步配置
|
||||
</a-button>
|
||||
<a-button type="primary" @click="showAtomModal" :status="'danger'">
|
||||
<template #icon>
|
||||
<icon-robot-add />
|
||||
</template>
|
||||
支付颗粒度
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-table
|
||||
row-key="key"
|
||||
:size="'medium'"
|
||||
:bordered="{ cell: true }"
|
||||
:scroll="{ x: 590, y: 600 }"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
v-model:selectedKeys="selectedKeys"
|
||||
:pagination="false"
|
||||
>
|
||||
<template #fiat="{ record }">
|
||||
<span class="fiat-display">
|
||||
{{ getFiatFlag(record.fiat) }} <strong>{{ record.fiat }}</strong>
|
||||
</span>
|
||||
</template>
|
||||
<template #crypto="{ record }">
|
||||
<a-tag :color="getCryptoColor(record.crypto)" :bordered="true">
|
||||
{{ record.crypto }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<template #syntax="{ record }">
|
||||
<div class="syntax-display">
|
||||
<span class="syntax-value">{{ record.syntax || "无" }}</span>
|
||||
<span class="syntax-description">{{ getTableSyntaxDescription(record.syntax) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #optional="{ record }">
|
||||
<a-space wrap>
|
||||
<a-button size="mini" type="primary" @click="onEdit(record)">编辑</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
|
||||
<!-- 编辑汇率语法模态框 -->
|
||||
<a-modal
|
||||
v-model:visible="editModalVisible"
|
||||
title="编辑汇率语法"
|
||||
@ok="handleEditSubmit"
|
||||
@cancel="handleEditCancel"
|
||||
:ok-loading="editLoading"
|
||||
width="480px"
|
||||
class="edit-modal"
|
||||
>
|
||||
<a-form ref="editFormRef" :model="editForm" layout="vertical">
|
||||
<a-row :gutter="12">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="交易法币">
|
||||
<a-input v-model="editForm.fiat" readonly size="small">
|
||||
<template #prefix>{{ getFiatFlag(editForm.fiat) }}</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="加密货币">
|
||||
<a-tag :color="getCryptoColor(editForm.crypto)" :bordered="true">
|
||||
{{ editForm.crypto }}
|
||||
</a-tag>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item label="语法类型">
|
||||
<a-radio-group v-model="syntaxType" @change="handleSyntaxTypeChange">
|
||||
<a-radio value="">固定数值</a-radio>
|
||||
<a-radio value="+">固定增加</a-radio>
|
||||
<a-radio value="-">固定减少</a-radio>
|
||||
<a-radio value="~">百分比浮动</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="数值">
|
||||
<a-input-number
|
||||
v-model="syntaxValue"
|
||||
:placeholder="getSyntaxPlaceholder()"
|
||||
:min="syntaxType === '~' ? 0.000001 : 0"
|
||||
:max="syntaxType === '~' ? 10 : 999999"
|
||||
:step="syntaxType === '~' ? 0.000001 : 0.01"
|
||||
style="width: 100%"
|
||||
>
|
||||
<template #prefix v-if="syntaxType">
|
||||
<span class="syntax-prefix">{{ syntaxType }}</span>
|
||||
</template>
|
||||
</a-input-number>
|
||||
</a-form-item>
|
||||
|
||||
<div v-if="getFormSyntaxDescription()" class="syntax-tip">
|
||||
<a-typography-text type="secondary">
|
||||
<icon-info-circle style="margin-right: 4px" />
|
||||
{{ getFormSyntaxDescription() }}
|
||||
</a-typography-text>
|
||||
</div>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
|
||||
<!-- 同步频率设置模态框 -->
|
||||
<a-modal
|
||||
v-model:visible="syncModalVisible"
|
||||
title="汇率同步配置"
|
||||
@ok="handleSyncSubmit"
|
||||
@cancel="handleSyncCancel"
|
||||
:ok-loading="syncLoading"
|
||||
width="480px"
|
||||
class="sync-modal"
|
||||
>
|
||||
<a-form ref="syncFormRef" :model="syncForm" layout="vertical">
|
||||
<a-form-item label="同步频率(分钟)">
|
||||
<a-input-number
|
||||
v-model="syncForm.minutes"
|
||||
:min="10"
|
||||
:max="1440"
|
||||
:precision="0"
|
||||
placeholder="请输入同步频率"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="API 接口">
|
||||
<a-select v-model="syncForm.apiUrl" placeholder="请选择 API 接口" style="width: 100%">
|
||||
<a-option v-for="option in apiUrlOptions" :key="option.value" :value="option.value" :label="option.label">
|
||||
{{ option.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="API Key">
|
||||
<a-input v-model="syncForm.apiKey" placeholder="请输入 API Key(可选)" allow-clear style="width: 100%" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="汇率保留天数">
|
||||
<a-input-number
|
||||
v-model="syncForm.historyDays"
|
||||
:min="1"
|
||||
:max="365"
|
||||
:precision="0"
|
||||
placeholder="请输入汇率保留天数"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<div class="sync-tip">
|
||||
<a-typography-text type="secondary">
|
||||
<icon-info-circle style="margin-right: 4px" />
|
||||
同步频率:10-1440分钟,推荐60分钟<br />
|
||||
官方接口:免费但有速率限制,配置
|
||||
<a-link href="https://www.coingecko.com/" target="_blank" :hoverable="false">API Key</a-link>
|
||||
可解除限制<br />
|
||||
开源接口:作者提供的免费缓存接口(落后官方接口3分钟),无速率限制<br />
|
||||
<b class="sync-warning">官方接口特指 CoinGecko,是全球最大的独立加密货币数据聚合平台之一</b>
|
||||
<hr />
|
||||
</a-typography-text>
|
||||
</div>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
|
||||
<!-- 支付颗粒度设置模态框 -->
|
||||
<a-modal
|
||||
v-model:visible="atomModalVisible"
|
||||
title="设置支付颗粒度"
|
||||
@ok="handleAtomSubmit"
|
||||
@cancel="handleAtomCancel"
|
||||
:ok-loading="atomLoading"
|
||||
width="400px"
|
||||
class="atom-modal"
|
||||
>
|
||||
<a-form ref="atomFormRef" :model="atomForm" layout="vertical">
|
||||
<a-form-item label="USDT 颗粒度">
|
||||
<a-input-number
|
||||
v-model="atomForm.usdt"
|
||||
:min="0.000001"
|
||||
:max="100"
|
||||
:precision="undefined"
|
||||
:step="0.000001"
|
||||
placeholder="推荐0.01"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="USDC 颗粒度">
|
||||
<a-input-number
|
||||
v-model="atomForm.usdc"
|
||||
:min="0.000001"
|
||||
:max="100"
|
||||
:precision="undefined"
|
||||
:step="0.000001"
|
||||
placeholder="推荐0.01"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="TRX 颗粒度">
|
||||
<a-input-number
|
||||
v-model="atomForm.trx"
|
||||
:min="0.000001"
|
||||
:max="100"
|
||||
:precision="undefined"
|
||||
:step="0.000001"
|
||||
placeholder="推荐0.01"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="BNB 颗粒度">
|
||||
<a-input-number
|
||||
v-model="atomForm.bnb"
|
||||
:min="0.00000001"
|
||||
:max="100"
|
||||
:precision="undefined"
|
||||
:step="0.000001"
|
||||
placeholder="推荐0.00001"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="ETH 颗粒度">
|
||||
<a-input-number
|
||||
v-model="atomForm.eth"
|
||||
:min="0.00000001"
|
||||
:max="100"
|
||||
:precision="undefined"
|
||||
:step="0.000001"
|
||||
placeholder="推荐0.000001"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<div class="atom-tip">
|
||||
<a-typography-text type="secondary">
|
||||
<icon-info-circle style="margin-right: 4px" />
|
||||
支付数额递增时的最小单位,支付数额的最终保留位数;除非你明确知道其功能含义,一般情况下不推荐修改。
|
||||
</a-typography-text>
|
||||
</div>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</div>
|
||||
|
||||
<!-- 编辑汇率语法模态框 -->
|
||||
<a-modal
|
||||
v-model:visible="editModalVisible"
|
||||
title="编辑汇率语法"
|
||||
@ok="handleEditSubmit"
|
||||
@cancel="handleEditCancel"
|
||||
:ok-loading="editLoading"
|
||||
:width="editDialogWidth"
|
||||
class="edit-modal"
|
||||
>
|
||||
<a-form ref="editFormRef" :model="editForm" layout="vertical">
|
||||
<a-row :gutter="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<a-form-item label="交易法币">
|
||||
<a-input v-model="editForm.fiat" readonly size="small">
|
||||
<template #prefix>{{ getFiatFlag(editForm.fiat) }}</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<a-form-item label="加密货币">
|
||||
<a-tag :color="getCryptoColor(editForm.crypto)" :bordered="true">
|
||||
{{ editForm.crypto }}
|
||||
</a-tag>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item label="语法类型">
|
||||
<a-radio-group v-model="syntaxType" @change="handleSyntaxTypeChange">
|
||||
<a-radio value="">固定数值</a-radio>
|
||||
<a-radio value="+">固定增加</a-radio>
|
||||
<a-radio value="-">固定减少</a-radio>
|
||||
<a-radio value="~">百分比浮动</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="数值">
|
||||
<a-input-number
|
||||
v-model="syntaxValue"
|
||||
:placeholder="getSyntaxPlaceholder()"
|
||||
:min="syntaxType === '~' ? 0.000001 : 0"
|
||||
:max="syntaxType === '~' ? 10 : 999999"
|
||||
:step="syntaxType === '~' ? 0.000001 : 0.01"
|
||||
style="width: 100%"
|
||||
>
|
||||
<template #prefix v-if="syntaxType">
|
||||
<span class="syntax-prefix">{{ syntaxType }}</span>
|
||||
</template>
|
||||
</a-input-number>
|
||||
</a-form-item>
|
||||
|
||||
<div v-if="getFormSyntaxDescription()" class="syntax-tip">
|
||||
<a-typography-text type="secondary">
|
||||
<icon-info-circle style="margin-right: 4px" />
|
||||
{{ getFormSyntaxDescription() }}
|
||||
</a-typography-text>
|
||||
</div>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
|
||||
<!-- 同步频率设置模态框 -->
|
||||
<a-modal
|
||||
v-model:visible="syncModalVisible"
|
||||
title="汇率同步配置"
|
||||
@ok="handleSyncSubmit"
|
||||
@cancel="handleSyncCancel"
|
||||
:ok-loading="syncLoading"
|
||||
:width="syncDialogWidth"
|
||||
class="sync-modal"
|
||||
>
|
||||
<a-form ref="syncFormRef" :model="syncForm" layout="vertical">
|
||||
<a-form-item label="同步频率(分钟)">
|
||||
<a-input-number
|
||||
v-model="syncForm.minutes"
|
||||
:min="10"
|
||||
:max="1440"
|
||||
:precision="0"
|
||||
placeholder="请输入同步频率"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="API 接口">
|
||||
<a-select v-model="syncForm.apiUrl" placeholder="请选择 API 接口" style="width: 100%">
|
||||
<a-option v-for="option in apiUrlOptions" :key="option.value" :value="option.value" :label="option.label">
|
||||
{{ option.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="API Key">
|
||||
<a-input v-model="syncForm.apiKey" placeholder="请输入 API Key(可选)" allow-clear style="width: 100%" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="汇率保留天数">
|
||||
<a-input-number
|
||||
v-model="syncForm.historyDays"
|
||||
:min="1"
|
||||
:max="365"
|
||||
:precision="0"
|
||||
placeholder="请输入汇率保留天数"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<div class="sync-tip">
|
||||
<a-typography-text type="secondary">
|
||||
<icon-info-circle style="margin-right: 4px" />
|
||||
同步频率:10-1440分钟,推荐60分钟<br />
|
||||
官方接口:免费但有速率限制,配置
|
||||
<a-link href="https://www.coingecko.com/" target="_blank" :hoverable="false">API Key</a-link>
|
||||
可解除限制<br />
|
||||
开源接口:作者提供的免费缓存接口(落后官方接口3分钟),无速率限制<br />
|
||||
<hr />
|
||||
<b class="sync-warning">官方接口特指 CoinGecko,是全球最大的独立加密货币数据聚合平台之一</b>
|
||||
</a-typography-text>
|
||||
</div>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
|
||||
<!-- 支付颗粒度设置模态框 -->
|
||||
<a-modal
|
||||
v-model:visible="atomModalVisible"
|
||||
title="设置支付颗粒度"
|
||||
@ok="handleAtomSubmit"
|
||||
@cancel="handleAtomCancel"
|
||||
:ok-loading="atomLoading"
|
||||
:width="atomDialogWidth"
|
||||
class="atom-modal"
|
||||
>
|
||||
<a-form ref="atomFormRef" :model="atomForm" layout="vertical">
|
||||
<a-form-item label="USDT 颗粒度">
|
||||
<a-input-number
|
||||
v-model="atomForm.usdt"
|
||||
:min="0.000001"
|
||||
:max="100"
|
||||
:precision="undefined"
|
||||
:step="0.000001"
|
||||
placeholder="推荐0.01"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="USDC 颗粒度">
|
||||
<a-input-number
|
||||
v-model="atomForm.usdc"
|
||||
:min="0.000001"
|
||||
:max="100"
|
||||
:precision="undefined"
|
||||
:step="0.000001"
|
||||
placeholder="推荐0.01"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="TRX 颗粒度">
|
||||
<a-input-number
|
||||
v-model="atomForm.trx"
|
||||
:min="0.000001"
|
||||
:max="100"
|
||||
:precision="undefined"
|
||||
:step="0.000001"
|
||||
placeholder="推荐0.01"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="BNB 颗粒度">
|
||||
<a-input-number
|
||||
v-model="atomForm.bnb"
|
||||
:min="0.00000001"
|
||||
:max="100"
|
||||
:precision="undefined"
|
||||
:step="0.000001"
|
||||
placeholder="推荐0.00001"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="ETH 颗粒度">
|
||||
<a-input-number
|
||||
v-model="atomForm.eth"
|
||||
:min="0.00000001"
|
||||
:max="100"
|
||||
:precision="undefined"
|
||||
:step="0.000001"
|
||||
placeholder="推荐0.000001"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<div class="atom-tip">
|
||||
<a-typography-text type="secondary">
|
||||
<icon-info-circle style="margin-right: 4px" />
|
||||
支付数额递增时的最小单位,支付数额的最终保留位数;除非你明确知道其功能含义,一般情况下不推荐修改。
|
||||
</a-typography-text>
|
||||
</div>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue";
|
||||
import { computed, ref, reactive } from "vue";
|
||||
import { Message } from "@arco-design/web-vue";
|
||||
import { IconInfoCircle } from "@arco-design/web-vue/es/icon";
|
||||
import { getSyntaxListAPI, setSyntaxAPI } from "@/api/modules/rate/index";
|
||||
import { getsConfAPI, setsConfAPI } from "@/api/modules/conf/index";
|
||||
import { List, EditForm } from "./syntax";
|
||||
import { getFiatFlag, getCryptoColor } from "@/views/rate/common";
|
||||
import { useLayoutModel } from "@/hooks/useLayoutModel";
|
||||
|
||||
const { dialogWidth } = useLayoutModel();
|
||||
const editDialogWidth = computed(() => dialogWidth("480px"));
|
||||
const syncDialogWidth = computed(() => dialogWidth("480px"));
|
||||
const atomDialogWidth = computed(() => dialogWidth("400px"));
|
||||
const selectedKeys = ref<string[]>([]);
|
||||
const loading = ref<boolean>(false);
|
||||
const data = reactive<List[]>([]);
|
||||
@@ -288,7 +291,7 @@ const columns = [
|
||||
title: "交易法币",
|
||||
dataIndex: "fiat",
|
||||
align: "center",
|
||||
width: 160,
|
||||
width: 100,
|
||||
slotName: "fiat",
|
||||
filterable: {
|
||||
filters: [
|
||||
@@ -306,7 +309,7 @@ const columns = [
|
||||
title: "加密货币",
|
||||
dataIndex: "crypto",
|
||||
align: "center",
|
||||
width: 140,
|
||||
width: 100,
|
||||
slotName: "crypto",
|
||||
filterable: {
|
||||
filters: [
|
||||
@@ -324,14 +327,14 @@ const columns = [
|
||||
title: "汇率浮动",
|
||||
dataIndex: "syntax",
|
||||
slotName: "syntax",
|
||||
width: 480
|
||||
width: 300
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
slotName: "optional",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
width: 120
|
||||
width: 90
|
||||
}
|
||||
];
|
||||
|
||||
@@ -686,12 +689,12 @@ getCommonTableList();
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
white-space: nowrap;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.syntax-value {
|
||||
font-weight: 500;
|
||||
color: $color-text-1;
|
||||
min-width: 80px;
|
||||
min-width: 56px;
|
||||
text-align: left;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -700,7 +703,8 @@ getCommonTableList();
|
||||
font-size: 12px;
|
||||
color: $color-text-3;
|
||||
font-style: italic;
|
||||
flex-shrink: 0;
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-row align="center" :gutter="[0, 16]">
|
||||
<a-col :span="24">
|
||||
<a-card title="API设置">
|
||||
<a-alert type="info" style="margin-bottom: 16px">
|
||||
系统兼容彩虹易支付 <strong>submit.php</strong> 接口收单,对接时 PID 固定为 <strong>1000</strong>,KEY
|
||||
则是和对接令牌保持一致。
|
||||
</a-alert>
|
||||
<a-form :model="form" :rules="rules" :style="{ width: '600px' }" @submit="onSubmit">
|
||||
<a-form-item field="api_auth_token" label="对接令牌" extra="API对接的身份验证令牌,请妥善保管">
|
||||
<a-input-group class="token-input-group">
|
||||
<a-input-password v-model="form.api_auth_token" placeholder="请输入 Auth Token" readonly />
|
||||
<a-button type="primary" @click="handleResetToken">重置</a-button>
|
||||
</a-input-group>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="api_app_uri" label="应用URI" extra="API对接的应用URI,前端收银台地址">
|
||||
<a-input v-model="form.api_app_uri" placeholder="http(s)://your-host-uri" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
field="payment_static_path"
|
||||
label="收银台静态资源"
|
||||
extra="收银台静态资源路径,可通过此功能自定义前端收银台样式;不懂请勿修改,否则可能导致收银台异常!【修改重启生效】"
|
||||
>
|
||||
<a-input v-model="form.payment_static_path" placeholder="/var/lib/bepusdt/payment/" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item>
|
||||
<a-button type="primary" html-type="submit">提交</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Message } from "@arco-design/web-vue";
|
||||
import { setsConfAPI, resetApiAuthToken } from "@/api/modules/conf/index";
|
||||
|
||||
const emit = defineEmits(["refresh"]);
|
||||
const data = defineModel() as any;
|
||||
const form = ref({ api_auth_token: "", api_app_uri: "", payment_static_path: "" });
|
||||
const rules = {};
|
||||
|
||||
const handleResetToken = async () => {
|
||||
try {
|
||||
await resetApiAuthToken({});
|
||||
Message.success("令牌重置成功");
|
||||
emit("refresh");
|
||||
} catch {
|
||||
Message.error("令牌重置失败");
|
||||
}
|
||||
};
|
||||
|
||||
const onSubmit = async ({ errors }: ArcoDesign.ArcoSubmit) => {
|
||||
if (errors) return;
|
||||
|
||||
await setsConfAPI([
|
||||
{
|
||||
key: "api_app_uri",
|
||||
value: form.value.api_app_uri
|
||||
},
|
||||
{
|
||||
key: "payment_static_path",
|
||||
value: form.value.payment_static_path
|
||||
}
|
||||
]);
|
||||
|
||||
Message.success("保存成功");
|
||||
|
||||
emit("refresh");
|
||||
};
|
||||
|
||||
watch(
|
||||
() => data.value,
|
||||
() => {
|
||||
form.value.api_auth_token = data.value.api_auth_token;
|
||||
form.value.api_app_uri = data.value.api_app_uri;
|
||||
form.value.payment_static_path = data.value.payment_static_path;
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.row-title {
|
||||
font-size: $font-size-title-1;
|
||||
}
|
||||
|
||||
.token-input-group {
|
||||
width: 100%;
|
||||
|
||||
:deep(.arco-input-wrapper) {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
:deep(.arco-btn) {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="snow-page">
|
||||
<a-spin :loading="loading" tip="loading...">
|
||||
<a-spin :loading="loading" class="container" tip="loading...">
|
||||
<a-card :bordered="false">
|
||||
<a-row align="center">
|
||||
<a-col :span="2">
|
||||
<div>
|
||||
<a-col :span="isMobile ? 24 : 2">
|
||||
<div :class="{ center: isMobile }">
|
||||
<a-avatar :size="100" trigger-type="mask">
|
||||
<img alt="avatar" src="https://avatars.githubusercontent.com/u/49953737?v=4" />
|
||||
<template #trigger-icon>
|
||||
@@ -13,9 +13,9 @@
|
||||
</a-avatar>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="22">
|
||||
<a-space direction="vertical" size="large">
|
||||
<a-descriptions :column="2" title="基本信息" :align="{ label: 'right' }">
|
||||
<a-col :span="isMobile ? 24 : 22">
|
||||
<a-space direction="vertical" size="large" fill class="base-profile-space">
|
||||
<a-descriptions :column="descriptionsColumn(1, 2)" title="基本信息" :align="{ label: 'right' }">
|
||||
<a-descriptions-item label="管理员">
|
||||
{{ Conf.admin_username }}
|
||||
</a-descriptions-item>
|
||||
@@ -33,7 +33,7 @@
|
||||
<a-card class="margin-top" :bordered="false">
|
||||
<a-row align="center">
|
||||
<a-col :span="24">
|
||||
<a-tabs :type="type" :size="size" :active-key="activeTabs" @change="onChangeTab">
|
||||
<a-tabs :type="tabsType" :size="tabsSize" :active-key="activeTabs" @change="onChangeTab">
|
||||
<a-tab-pane key="1" title="基本设置">
|
||||
<Info v-model="Conf" @refresh="refresh" />
|
||||
</a-tab-pane>
|
||||
@@ -58,16 +58,20 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Info from "@/views/system/base/info.vue";
|
||||
import Security from "@/views/system/base/security.vue";
|
||||
import Api from "@/views/system/base/api.vue";
|
||||
import Info from "./components/info.vue";
|
||||
import Security from "./components/security.vue";
|
||||
import Api from "./components/api.vue";
|
||||
import { getsConfAPI } from "@/api/modules/conf/index";
|
||||
import Notifier from "./notifier.vue";
|
||||
import Mqtt from "./mqtt.vue";
|
||||
import Notifier from "./components/notifier.vue";
|
||||
import Mqtt from "./components/mqtt.vue";
|
||||
import { useDevicesSize } from "@/hooks/useDevicesSize";
|
||||
import { useLayoutModel } from "@/hooks/useLayoutModel";
|
||||
|
||||
const route = useRoute();
|
||||
const type = ref("rounded");
|
||||
const size = ref("medium");
|
||||
const { isMobile } = useDevicesSize();
|
||||
const { descriptionsColumn } = useLayoutModel();
|
||||
const tabsType = computed(() => (isMobile.value ? "line" : "rounded"));
|
||||
const tabsSize = computed(() => (isMobile.value ? "small" : "medium"));
|
||||
const activeTabs = ref(route.query.type || "1");
|
||||
|
||||
const onChangeTab = (e: string) => {
|
||||
@@ -121,7 +125,24 @@ getConf();
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.margin-top {
|
||||
margin-top: $padding;
|
||||
}
|
||||
|
||||
.center {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
:deep(.base-setting-form) {
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
min-width: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<a-row align="center" :gutter="[0, 16]">
|
||||
<a-col :span="24">
|
||||
<a-card title="API设置">
|
||||
<a-alert type="info" style="margin-bottom: 16px">
|
||||
系统兼容彩虹易支付 <strong>submit.php</strong> 接口收单,对接时 PID 固定为 <strong>1000</strong>,KEY
|
||||
则是和对接令牌保持一致。
|
||||
</a-alert>
|
||||
<a-form :model="form" :rules="rules" :layout="layoutMode" class="base-setting-form" @submit="onSubmit">
|
||||
<a-form-item field="api_auth_token" label="对接令牌" extra="API对接的身份验证令牌,请妥善保管">
|
||||
<a-input-group class="token-input-group">
|
||||
<a-input-password v-model="form.api_auth_token" placeholder="请输入 Auth Token" readonly />
|
||||
<a-button type="primary" @click="handleResetToken">重置</a-button>
|
||||
</a-input-group>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="api_app_uri" label="应用URI" extra="API对接的应用URI,前端收银台地址">
|
||||
<a-input v-model="form.api_app_uri" placeholder="http(s)://your-host-uri" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
field="payment_static_path"
|
||||
label="收银台静态资源"
|
||||
extra="收银台静态资源路径,可通过此功能自定义前端收银台样式;不懂请勿修改,否则可能导致收银台异常!【修改重启生效】"
|
||||
>
|
||||
<a-input v-model="form.payment_static_path" placeholder="/var/lib/bepusdt/payment/" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item>
|
||||
<a-space>
|
||||
<a-button type="primary" html-type="submit">提交</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useDevicesSize } from "@/hooks/useDevicesSize";
|
||||
|
||||
import { Message } from "@arco-design/web-vue";
|
||||
import { setsConfAPI, resetApiAuthToken } from "@/api/modules/conf/index";
|
||||
|
||||
const emit = defineEmits(["refresh"]);
|
||||
const data = defineModel() as any;
|
||||
const { isMobile } = useDevicesSize();
|
||||
const layoutMode = computed(() => (isMobile.value ? "vertical" : "horizontal"));
|
||||
|
||||
const form = ref({ api_auth_token: "", api_app_uri: "", payment_static_path: "" });
|
||||
const rules = {};
|
||||
|
||||
const handleResetToken = async () => {
|
||||
try {
|
||||
await resetApiAuthToken({});
|
||||
Message.success("令牌重置成功");
|
||||
emit("refresh");
|
||||
} catch {
|
||||
Message.error("令牌重置失败");
|
||||
}
|
||||
};
|
||||
|
||||
const onSubmit = async ({ errors }: ArcoDesign.ArcoSubmit) => {
|
||||
if (errors) return;
|
||||
|
||||
await setsConfAPI([
|
||||
{
|
||||
key: "api_app_uri",
|
||||
value: form.value.api_app_uri
|
||||
},
|
||||
{
|
||||
key: "payment_static_path",
|
||||
value: form.value.payment_static_path
|
||||
}
|
||||
]);
|
||||
|
||||
Message.success("保存成功");
|
||||
|
||||
emit("refresh");
|
||||
};
|
||||
|
||||
watch(
|
||||
() => data.value,
|
||||
() => {
|
||||
form.value.api_auth_token = data.value.api_auth_token;
|
||||
form.value.api_app_uri = data.value.api_app_uri;
|
||||
form.value.payment_static_path = data.value.payment_static_path;
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.row-title {
|
||||
font-size: $font-size-title-1;
|
||||
}
|
||||
|
||||
.token-input-group {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
|
||||
:deep(.arco-input-wrapper) {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
:deep(.arco-btn) {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -2,7 +2,7 @@
|
||||
<a-row align="center" :gutter="[0, 16]">
|
||||
<a-col :span="24">
|
||||
<a-card title="基本信息">
|
||||
<a-form :model="form" :rules="rules" :style="{ width: '600px' }" @submit="onSubmit">
|
||||
<a-form :model="form" :rules="rules" :layout="layoutMode" class="base-setting-form" @submit="onSubmit">
|
||||
<a-form-item
|
||||
field="block_height_max_diff"
|
||||
label="区块最大差值"
|
||||
@@ -73,7 +73,9 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item>
|
||||
<a-button type="primary" html-type="submit">提交</a-button>
|
||||
<a-space>
|
||||
<a-button type="primary" html-type="submit">提交</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
@@ -82,10 +84,15 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useDevicesSize } from "@/hooks/useDevicesSize";
|
||||
import { Message } from "@arco-design/web-vue";
|
||||
import { setsConfAPI } from "@/api/modules/conf/index";
|
||||
|
||||
const emit = defineEmits(["refresh"]);
|
||||
const data = defineModel() as any;
|
||||
const { isMobile } = useDevicesSize();
|
||||
const layoutMode = computed(() => (isMobile.value ? "vertical" : "horizontal"));
|
||||
|
||||
const form = ref({
|
||||
payment_timeout: "",
|
||||
block_height_max_diff: "",
|
||||
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<a-row align="center" :gutter="[0, 16]">
|
||||
<a-col :span="24">
|
||||
<a-card title="MQTT 发布设置">
|
||||
<a-alert type="info" style="margin-bottom: 16px">
|
||||
系统可将扫描到的交易信息发布到 MQTT 服务器,其它系统通过订阅实时获取数据,
|
||||
<a-link href="https://github.com/v03413/BEpusdt/blob/main/docs/api/mqtt.md" target="_blank" :hoverable="false">
|
||||
查看文档
|
||||
</a-link>
|
||||
</a-alert>
|
||||
<a-alert type="warning" style="margin-bottom: 16px">
|
||||
<template #icon><icon-exclamation-circle-fill /></template>
|
||||
目前 MQTT 通信协议为 <strong>MQTT over TCP</strong>,该功能只有在 <strong>Host</strong> 和
|
||||
<strong>Port</strong> 均配置后才会正常启用
|
||||
</a-alert>
|
||||
<a-form :model="form" :rules="rules" :layout="layoutMode" class="base-setting-form" @submit="onSubmit">
|
||||
<a-form-item field="mqtt_host" label="MQTT Host" extra="MQTT 服务器地址">
|
||||
<a-input v-model="form.mqtt_host" placeholder="例如:127.0.0.1" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="mqtt_port" label="MQTT Port" extra="MQTT 服务器端口">
|
||||
<a-input v-model="form.mqtt_port" placeholder="例如:1883" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="mqtt_user" label="用户名" extra="MQTT 连接用户名,无则留空">
|
||||
<a-input v-model="form.mqtt_user" placeholder="请输入用户名" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="mqtt_pass" label="密码" extra="MQTT 连接密码,无则留空">
|
||||
<a-input-password v-model="form.mqtt_pass" placeholder="请输入密码" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
field="mqtt_topic_prefix"
|
||||
label="消息路径前缀"
|
||||
extra="消息发布的 Topic 路径前缀,只允许字母、数字、下划线和斜杠,默认为 bepusdt"
|
||||
>
|
||||
<a-input v-model="form.mqtt_topic_prefix" placeholder="例如:bepusdt" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="mqtt_publish_qos" label="Publish QoS" extra="消息发布服务质量等级">
|
||||
<a-radio-group v-model="form.mqtt_publish_qos">
|
||||
<a-radio value="0">0 - 最多一次</a-radio>
|
||||
<a-radio value="1">1 - 至少一次</a-radio>
|
||||
<a-radio value="2">2 - 恰好一次</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="mqtt_networks" label="区块链网络" extra="选择需要持续监听的区块链网络,多选">
|
||||
<a-checkbox-group v-model="networksSelected" class="mqtt-network-group">
|
||||
<a-checkbox value="tron">Tron</a-checkbox>
|
||||
<a-checkbox value="bsc">Bsc</a-checkbox>
|
||||
<a-checkbox value="polygon">Polygon</a-checkbox>
|
||||
<a-checkbox value="ethereum">Ethereum</a-checkbox>
|
||||
<a-checkbox value="aptos">Aptos</a-checkbox>
|
||||
<a-checkbox value="solana">Solana</a-checkbox>
|
||||
<a-checkbox value="xlayer">XLayer</a-checkbox>
|
||||
<a-checkbox value="plasma">Plasma</a-checkbox>
|
||||
<a-checkbox value="arbitrum">Arbitrum</a-checkbox>
|
||||
<a-checkbox value="base">Base</a-checkbox>
|
||||
</a-checkbox-group>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item>
|
||||
<a-space>
|
||||
<a-button type="primary" html-type="submit">提交</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useDevicesSize } from "@/hooks/useDevicesSize";
|
||||
|
||||
import { Message } from "@arco-design/web-vue";
|
||||
import { setsConfAPI } from "@/api/modules/conf/index";
|
||||
|
||||
const emit = defineEmits(["refresh"]);
|
||||
const data = defineModel() as any;
|
||||
const { isMobile } = useDevicesSize();
|
||||
const layoutMode = computed(() => (isMobile.value ? "vertical" : "horizontal"));
|
||||
|
||||
const rules = {
|
||||
mqtt_topic_prefix: [
|
||||
{
|
||||
validator: (value: string, callback: (error?: string) => void) => {
|
||||
if (!value) return callback();
|
||||
if (!/^[a-zA-Z0-9_/]+$/.test(value)) {
|
||||
return callback("Topic 前缀只允许包含字母、数字、下划线和斜杠");
|
||||
}
|
||||
if (value.startsWith("/") || value.endsWith("/")) {
|
||||
return callback("Topic 前缀不能以斜杠开头或结尾");
|
||||
}
|
||||
if (value.includes("//")) {
|
||||
return callback("Topic 前缀不能包含连续斜杠");
|
||||
}
|
||||
callback();
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const form = ref({
|
||||
mqtt_host: "",
|
||||
mqtt_port: "",
|
||||
mqtt_user: "",
|
||||
mqtt_pass: "",
|
||||
mqtt_publish_qos: "0",
|
||||
mqtt_networks: "",
|
||||
mqtt_topic_prefix: "bepusdt"
|
||||
});
|
||||
|
||||
const networksSelected = computed({
|
||||
get() {
|
||||
return form.value.mqtt_networks ? form.value.mqtt_networks.split(",").filter(Boolean) : [];
|
||||
},
|
||||
set(val: string[]) {
|
||||
form.value.mqtt_networks = val.join(",");
|
||||
}
|
||||
});
|
||||
|
||||
const onSubmit = async ({ errors }: ArcoDesign.ArcoSubmit) => {
|
||||
if (errors) return;
|
||||
|
||||
await setsConfAPI([
|
||||
{ key: "mqtt_host", value: form.value.mqtt_host },
|
||||
{ key: "mqtt_port", value: form.value.mqtt_port },
|
||||
{ key: "mqtt_user", value: form.value.mqtt_user },
|
||||
{ key: "mqtt_pass", value: form.value.mqtt_pass },
|
||||
{ key: "mqtt_publish_qos", value: form.value.mqtt_publish_qos },
|
||||
{ key: "mqtt_networks", value: form.value.mqtt_networks },
|
||||
{ key: "mqtt_topic_prefix", value: form.value.mqtt_topic_prefix || "bepusdt" }
|
||||
]);
|
||||
|
||||
Message.success("保存成功");
|
||||
emit("refresh");
|
||||
};
|
||||
|
||||
watch(
|
||||
() => data.value,
|
||||
() => {
|
||||
form.value.mqtt_host = data.value.mqtt_host ?? "";
|
||||
form.value.mqtt_port = data.value.mqtt_port ?? "";
|
||||
form.value.mqtt_user = data.value.mqtt_user ?? "";
|
||||
form.value.mqtt_pass = data.value.mqtt_pass ?? "";
|
||||
form.value.mqtt_publish_qos = data.value.mqtt_publish_qos ?? "0";
|
||||
form.value.mqtt_networks = data.value.mqtt_networks ?? "";
|
||||
form.value.mqtt_topic_prefix = data.value.mqtt_topic_prefix ?? "bepusdt";
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.mqtt-network-group {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
|
||||
gap: 10px 12px;
|
||||
width: 100%;
|
||||
|
||||
:deep(.arco-checkbox) {
|
||||
min-height: 40px;
|
||||
margin-right: 0;
|
||||
padding: 8px 10px;
|
||||
border: 1px solid $color-border-2;
|
||||
border-radius: 4px;
|
||||
background: $color-fill-1;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
:deep(.arco-checkbox-checked) {
|
||||
border-color: $color-primary;
|
||||
background: rgba(var(--primary-6), 0.08);
|
||||
}
|
||||
|
||||
:deep(.arco-checkbox-label) {
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
+42
-40
@@ -1,54 +1,56 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-row align="center" :gutter="[0, 16]">
|
||||
<a-col :span="24">
|
||||
<a-card title="通知设置">
|
||||
<a-form :model="form" :rules="rules" :style="{ width: '600px' }" @submit="onSubmit">
|
||||
<a-form-item field="notifier_channel" label="通知渠道">
|
||||
<a-select v-model="form.notifier_channel" placeholder="请选择通知渠道" @change="onChannelChange">
|
||||
<a-option
|
||||
v-for="channel in channelConfigs"
|
||||
:key="channel.value"
|
||||
:value="channel.value"
|
||||
:disabled="channel.disabled"
|
||||
>
|
||||
{{ channel.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-row align="center" :gutter="[0, 16]">
|
||||
<a-col :span="24">
|
||||
<a-card title="通知设置">
|
||||
<a-form :model="form" :rules="rules" :layout="layoutMode" class="base-setting-form" @submit="onSubmit">
|
||||
<a-form-item field="notifier_channel" label="通知渠道">
|
||||
<a-select v-model="form.notifier_channel" placeholder="请选择通知渠道" @change="onChannelChange">
|
||||
<a-option
|
||||
v-for="channel in channelConfigs"
|
||||
:key="channel.value"
|
||||
:value="channel.value"
|
||||
:disabled="channel.disabled"
|
||||
>
|
||||
{{ channel.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
<template v-for="field in currentChannelFields" :key="field.key">
|
||||
<a-form-item :field="field.key" :label="field.label">
|
||||
<a-input
|
||||
v-model="form.notifier_params[field.key]"
|
||||
:placeholder="field.placeholder"
|
||||
:type="field.type || 'text'"
|
||||
allow-clear
|
||||
/>
|
||||
</a-form-item>
|
||||
</template>
|
||||
|
||||
<a-form-item>
|
||||
<a-space>
|
||||
<a-button type="primary" html-type="submit">保存配置</a-button>
|
||||
<a-button v-if="form.notifier_channel !== 'none'" type="outline" @click="onTest" :loading="testLoading">
|
||||
推送测试
|
||||
</a-button>
|
||||
</a-space>
|
||||
<template v-for="field in currentChannelFields" :key="field.key">
|
||||
<a-form-item :field="field.key" :label="field.label">
|
||||
<a-input
|
||||
v-model="form.notifier_params[field.key]"
|
||||
:placeholder="field.placeholder"
|
||||
:type="field.type || 'text'"
|
||||
allow-clear
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<a-form-item>
|
||||
<a-space>
|
||||
<a-button type="primary" html-type="submit">保存配置</a-button>
|
||||
<a-button v-if="form.notifier_channel !== 'none'" type="outline" @click="onTest" :loading="testLoading">
|
||||
推送测试
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useDevicesSize } from "@/hooks/useDevicesSize";
|
||||
|
||||
import { Message } from "@arco-design/web-vue";
|
||||
import { notifierAPI, notifierTestAPI } from "@/api/modules/conf/index";
|
||||
|
||||
const emit = defineEmits(["refresh"]);
|
||||
const data = defineModel() as any;
|
||||
const { isMobile } = useDevicesSize();
|
||||
const layoutMode = computed(() => (isMobile.value ? "vertical" : "horizontal"));
|
||||
|
||||
interface FieldConfig {
|
||||
key: string;
|
||||
+48
-36
@@ -1,54 +1,60 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-row align="center" :gutter="[0, 16]">
|
||||
<a-col :span="24">
|
||||
<a-card title="安全设置">
|
||||
<a-form :model="form" :rules="rules" :style="{ width: '600px' }" @submit="onSubmit">
|
||||
<a-form-item field="admin_secure" extra="长度限制:8-18位,必须以 / 开头" label="安全入口">
|
||||
<a-input v-model="form.admin_secure" placeholder="请输入安全入口" allow-clear />
|
||||
</a-form-item>
|
||||
<a-row align="center" :gutter="[0, 16]">
|
||||
<a-col :span="24">
|
||||
<a-card title="安全设置">
|
||||
<a-form :model="form" :rules="rules" :layout="layoutMode" class="base-setting-form" @submit="onSubmit">
|
||||
<a-form-item field="admin_secure" extra="长度限制:8-18位,必须以 / 开头" label="安全入口">
|
||||
<a-input v-model="form.admin_secure" placeholder="请输入安全入口" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="admin_username" label="管理账号">
|
||||
<div class="username-input-wrapper">
|
||||
<a-input v-model="form.admin_username" placeholder="请输入管理账号" allow-clear />
|
||||
<a-button type="text" @click="showPasswordModal" class="password-btn">修改密码</a-button>
|
||||
</div>
|
||||
</a-form-item>
|
||||
<a-form-item field="admin_username" label="管理账号">
|
||||
<div class="username-input-wrapper">
|
||||
<a-input v-model="form.admin_username" placeholder="请输入管理账号" allow-clear />
|
||||
<a-button type="text" @click="showPasswordModal" class="password-btn">修改密码</a-button>
|
||||
</div>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item>
|
||||
<a-form-item>
|
||||
<a-space>
|
||||
<a-button type="primary" html-type="submit">保存设置</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<!-- 修改密码弹窗 -->
|
||||
<a-modal v-model:visible="passwordModalVisible" title="修改密码" @ok="handlePasswordSubmit" @cancel="handlePasswordCancel">
|
||||
<a-form :model="passwordForm" :rules="passwordRules" ref="passwordFormRef">
|
||||
<a-form-item field="password" label="当前密码">
|
||||
<a-input-password v-model="passwordForm.password" placeholder="请输入当前密码" allow-clear />
|
||||
</a-form-item>
|
||||
<!-- 修改密码弹窗 -->
|
||||
<a-modal :width="dialogWidth()" v-model:visible="passwordModalVisible" title="修改密码" @ok="handlePasswordSubmit" @cancel="handlePasswordCancel">
|
||||
<a-form :model="passwordForm" auto-label-width :layout="formLayout" :rules="passwordRules" ref="passwordFormRef">
|
||||
<a-form-item field="password" label="当前密码">
|
||||
<a-input-password v-model="passwordForm.password" placeholder="请输入当前密码" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="new_password" label="新密码">
|
||||
<a-input-password v-model="passwordForm.new_password" placeholder="请输入新密码" allow-clear />
|
||||
</a-form-item>
|
||||
<a-form-item field="new_password" label="新密码">
|
||||
<a-input-password v-model="passwordForm.new_password" placeholder="请输入新密码" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="confirm_password" label="重复新密码">
|
||||
<a-input-password v-model="passwordForm.confirm_password" placeholder="请再次输入新密码" allow-clear />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</div>
|
||||
<a-form-item field="confirm_password" label="重复新密码">
|
||||
<a-input-password v-model="passwordForm.confirm_password" placeholder="请再次输入新密码" allow-clear />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useDevicesSize } from "@/hooks/useDevicesSize";
|
||||
import { useLayoutModel } from "@/hooks/useLayoutModel";
|
||||
|
||||
import { Message } from "@arco-design/web-vue";
|
||||
import { setPasswordAPI } from "@/api/modules/user";
|
||||
import { setsConfAPI } from "@/api/modules/conf/index";
|
||||
|
||||
const emit = defineEmits(["refresh"]);
|
||||
const data = defineModel() as any;
|
||||
const { isMobile } = useDevicesSize();
|
||||
const layoutMode = computed(() => (isMobile.value ? "vertical" : "horizontal"));
|
||||
const { dialogWidth, formLayout } = useLayoutModel();
|
||||
|
||||
// 基础设置表单
|
||||
const form = ref({
|
||||
@@ -222,10 +228,16 @@ watch(
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
min-width: 0;
|
||||
|
||||
:deep(.arco-input-wrapper) {
|
||||
flex: 1;
|
||||
min-width: 180px;
|
||||
}
|
||||
|
||||
.password-btn {
|
||||
flex-shrink: 0;
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,149 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-row align="center" :gutter="[0, 16]">
|
||||
<a-col :span="24">
|
||||
<a-card title="MQTT 发布设置">
|
||||
<a-alert type="info" style="margin-bottom: 16px">
|
||||
系统可将扫描到的交易信息发布到 MQTT 服务器,其它系统通过订阅实时获取数据,
|
||||
<a-link href="https://github.com/v03413/BEpusdt/blob/main/docs/api/mqtt.md" target="_blank" :hoverable="false">
|
||||
查看文档
|
||||
</a-link>
|
||||
</a-alert>
|
||||
<a-alert type="warning" style="margin-bottom: 16px">
|
||||
<template #icon><icon-exclamation-circle-fill /></template>
|
||||
目前 MQTT 通信协议为 <strong>MQTT over TCP</strong>,该功能只有在 <strong>Host</strong> 和
|
||||
<strong>Port</strong> 均配置后才会正常启用
|
||||
</a-alert>
|
||||
<a-form :model="form" :rules="rules" :style="{ width: '600px' }" @submit="onSubmit">
|
||||
<a-form-item field="mqtt_host" label="MQTT Host" extra="MQTT 服务器地址">
|
||||
<a-input v-model="form.mqtt_host" placeholder="例如:127.0.0.1" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="mqtt_port" label="MQTT Port" extra="MQTT 服务器端口">
|
||||
<a-input v-model="form.mqtt_port" placeholder="例如:1883" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="mqtt_user" label="用户名" extra="MQTT 连接用户名,无则留空">
|
||||
<a-input v-model="form.mqtt_user" placeholder="请输入用户名" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="mqtt_pass" label="密码" extra="MQTT 连接密码,无则留空">
|
||||
<a-input-password v-model="form.mqtt_pass" placeholder="请输入密码" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item
|
||||
field="mqtt_topic_prefix"
|
||||
label="消息路径前缀"
|
||||
extra="消息发布的 Topic 路径前缀,只允许字母、数字、下划线和斜杠,默认为 bepusdt"
|
||||
>
|
||||
<a-input v-model="form.mqtt_topic_prefix" placeholder="例如:bepusdt" allow-clear />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="mqtt_publish_qos" label="Publish QoS" extra="消息发布服务质量等级">
|
||||
<a-radio-group v-model="form.mqtt_publish_qos">
|
||||
<a-radio value="0">0 - 最多一次</a-radio>
|
||||
<a-radio value="1">1 - 至少一次</a-radio>
|
||||
<a-radio value="2">2 - 恰好一次</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item field="mqtt_networks" label="区块链网络" extra="选择需要持续监听的区块链网络,多选">
|
||||
<a-checkbox-group v-model="networksSelected">
|
||||
<a-checkbox value="tron">Tron</a-checkbox>
|
||||
<a-checkbox value="bsc">Bsc</a-checkbox>
|
||||
<a-checkbox value="polygon">Polygon</a-checkbox>
|
||||
<a-checkbox value="ethereum">Ethereum</a-checkbox>
|
||||
<a-checkbox value="aptos">Aptos</a-checkbox>
|
||||
<a-checkbox value="solana">Solana</a-checkbox>
|
||||
<a-checkbox value="xlayer">XLayer</a-checkbox>
|
||||
<a-checkbox value="plasma">Plasma</a-checkbox>
|
||||
<a-checkbox value="arbitrum">Arbitrum</a-checkbox>
|
||||
<a-checkbox value="base">Base</a-checkbox>
|
||||
</a-checkbox-group>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item>
|
||||
<a-button type="primary" html-type="submit">提交</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Message } from "@arco-design/web-vue";
|
||||
import { setsConfAPI } from "@/api/modules/conf/index";
|
||||
|
||||
const emit = defineEmits(["refresh"]);
|
||||
const data = defineModel() as any;
|
||||
const rules = {
|
||||
mqtt_topic_prefix: [
|
||||
{
|
||||
validator: (value: string, callback: (error?: string) => void) => {
|
||||
if (!value) return callback();
|
||||
if (!/^[a-zA-Z0-9_/]+$/.test(value)) {
|
||||
return callback("Topic 前缀只允许包含字母、数字、下划线和斜杠");
|
||||
}
|
||||
if (value.startsWith("/") || value.endsWith("/")) {
|
||||
return callback("Topic 前缀不能以斜杠开头或结尾");
|
||||
}
|
||||
if (value.includes("//")) {
|
||||
return callback("Topic 前缀不能包含连续斜杠");
|
||||
}
|
||||
callback();
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const form = ref({
|
||||
mqtt_host: "",
|
||||
mqtt_port: "",
|
||||
mqtt_user: "",
|
||||
mqtt_pass: "",
|
||||
mqtt_publish_qos: "0",
|
||||
mqtt_networks: "",
|
||||
mqtt_topic_prefix: "bepusdt"
|
||||
});
|
||||
|
||||
const networksSelected = computed({
|
||||
get() {
|
||||
return form.value.mqtt_networks ? form.value.mqtt_networks.split(",").filter(Boolean) : [];
|
||||
},
|
||||
set(val: string[]) {
|
||||
form.value.mqtt_networks = val.join(",");
|
||||
}
|
||||
});
|
||||
|
||||
const onSubmit = async ({ errors }: ArcoDesign.ArcoSubmit) => {
|
||||
if (errors) return;
|
||||
|
||||
await setsConfAPI([
|
||||
{ key: "mqtt_host", value: form.value.mqtt_host },
|
||||
{ key: "mqtt_port", value: form.value.mqtt_port },
|
||||
{ key: "mqtt_user", value: form.value.mqtt_user },
|
||||
{ key: "mqtt_pass", value: form.value.mqtt_pass },
|
||||
{ key: "mqtt_publish_qos", value: form.value.mqtt_publish_qos },
|
||||
{ key: "mqtt_networks", value: form.value.mqtt_networks },
|
||||
{ key: "mqtt_topic_prefix", value: form.value.mqtt_topic_prefix || "bepusdt" }
|
||||
]);
|
||||
|
||||
Message.success("保存成功");
|
||||
emit("refresh");
|
||||
};
|
||||
|
||||
watch(
|
||||
() => data.value,
|
||||
() => {
|
||||
form.value.mqtt_host = data.value.mqtt_host ?? "";
|
||||
form.value.mqtt_port = data.value.mqtt_port ?? "";
|
||||
form.value.mqtt_user = data.value.mqtt_user ?? "";
|
||||
form.value.mqtt_pass = data.value.mqtt_pass ?? "";
|
||||
form.value.mqtt_publish_qos = data.value.mqtt_publish_qos ?? "0";
|
||||
form.value.mqtt_networks = data.value.mqtt_networks ?? "";
|
||||
form.value.mqtt_topic_prefix = data.value.mqtt_topic_prefix ?? "bepusdt";
|
||||
}
|
||||
);
|
||||
</script>
|
||||
@@ -24,7 +24,7 @@
|
||||
</template>
|
||||
|
||||
<template #extra>
|
||||
<a-space size="small">
|
||||
<a-space size="small" wrap>
|
||||
<a-button @click="handleReset" :loading="loading" size="small" class="action-btn">
|
||||
<template #icon>
|
||||
<icon-refresh />
|
||||
@@ -52,7 +52,7 @@
|
||||
</div>
|
||||
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<a-form-item
|
||||
field="rpc_endpoint_tron"
|
||||
label="Tron RPC"
|
||||
@@ -74,30 +74,17 @@
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-col :span="24">
|
||||
<a-form-item field="rpc_endpoint_tron_grid_api_key" class="network-form-item">
|
||||
<template #label>
|
||||
<div class="label-with-tip">
|
||||
<span>Tron Grid Api Key</span>
|
||||
<a-tooltip content="配置独立 Api Key 可提高扫块稳定性,多个可用半角符逗号隔开。" position="top">
|
||||
<icon-question-circle class="tip-icon" />
|
||||
</a-tooltip>
|
||||
<span class="optional-tag">(可选)</span>
|
||||
</div>
|
||||
</template>
|
||||
<a-input
|
||||
v-model="formData.rpc_endpoint_tron_grid_api_key"
|
||||
placeholder="请输入 Tron Grid Api Key (可选),多个可用半角符逗号隔开"
|
||||
allow-clear
|
||||
size="small"
|
||||
class="network-input tron-input"
|
||||
>
|
||||
<template #prefix>
|
||||
<div class="input-icon">
|
||||
<icon-safe />
|
||||
</div>
|
||||
</template>
|
||||
<template #suffix>
|
||||
<div class="tron-grid-label">
|
||||
<span class="label-with-tip">
|
||||
<span>Tron Grid Api Key</span>
|
||||
<a-tooltip content="配置独立 Api Key 可提高扫块稳定性,多个可用半角符逗号隔开。" position="top">
|
||||
<icon-question-circle class="tip-icon" />
|
||||
</a-tooltip>
|
||||
<span class="optional-tag">(可选)</span>
|
||||
</span>
|
||||
<a
|
||||
href="https://github.com/v03413/BEpusdt/blob/main/docs/tron-grid/readme.md"
|
||||
target="_blank"
|
||||
@@ -106,8 +93,23 @@
|
||||
<icon-question-circle />
|
||||
获取方法
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<a-textarea
|
||||
v-model="formData.rpc_endpoint_tron_grid_api_key"
|
||||
placeholder="请输入 Tron Grid Api Key (可选),多个可用半角符逗号隔开"
|
||||
allow-clear
|
||||
size="small"
|
||||
class="network-input tron-input tron-grid-api-key-input"
|
||||
:auto-size="{ minRows: 1, maxRows: 6 }"
|
||||
>
|
||||
<template>
|
||||
<div class="input-icon">
|
||||
<icon-safe />
|
||||
</div>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-textarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -123,7 +125,14 @@
|
||||
</div>
|
||||
|
||||
<a-row :gutter="[16, 6]">
|
||||
<a-col v-for="network in networks.filter(n => n.key !== 'rpc_endpoint_tron')" :key="network.key" :span="8">
|
||||
<a-col
|
||||
v-for="network in networks.filter(n => n.key !== 'rpc_endpoint_tron')"
|
||||
:key="network.key"
|
||||
:xs="24"
|
||||
:sm="24"
|
||||
:md="12"
|
||||
:lg="8"
|
||||
>
|
||||
<a-form-item
|
||||
:field="network.key"
|
||||
:label="network.label"
|
||||
@@ -520,10 +529,6 @@ onMounted(() => {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.arco-form-item) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.network-input {
|
||||
@@ -568,6 +573,16 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
.tron-grid-api-key-input {
|
||||
max-width: 100%;
|
||||
|
||||
:deep(textarea) {
|
||||
max-height: 120px;
|
||||
overflow-y: auto;
|
||||
line-height: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.input-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -575,6 +590,15 @@ onMounted(() => {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.tron-grid-label {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
max-width: 100%;
|
||||
min-width: 0;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.label-with-tip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -692,10 +716,6 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.arco-col) {
|
||||
span: 24 !important;
|
||||
}
|
||||
|
||||
.info-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
@@ -4,20 +4,26 @@
|
||||
<a-form ref="formRef" auto-label-width :model="formData.form">
|
||||
<a-row :gutter="16">
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-input v-model="formData.form.name" placeholder="请输入名称" allow-clear />
|
||||
<a-form-item field="name" label="钱包名称">
|
||||
<a-input v-model="formData.form.name" placeholder="请输入名称" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-input v-model="formData.form.address" placeholder="请输入钱包地址" allow-clear />
|
||||
<a-form-item field="qrcode" label="钱包地址">
|
||||
<a-input v-model="formData.form.address" placeholder="请输入钱包地址" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-select v-model="formData.form.trade_type" placeholder="请选择交易类型" allow-clear allow-search>
|
||||
<a-option v-for="item in tradeTypeOptions" :key="item.value" :value="item.value">
|
||||
{{ item.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
<a-form-item field="trade_type" label="交易类型">
|
||||
<a-select v-model="formData.form.trade_type" placeholder="请选择交易类型" allow-clear allow-search>
|
||||
<a-option v-for="item in tradeTypeOptions" :key="item.value" :value="item.value">
|
||||
{{ item.label }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="3">
|
||||
<a-space class="search-btn">
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="6">
|
||||
<a-space class="search-btn" wrap>
|
||||
<a-button type="primary" @click="getCommonTableList">
|
||||
<template #icon><icon-search /></template>
|
||||
查询
|
||||
@@ -26,14 +32,12 @@
|
||||
<template #icon><icon-refresh /></template>
|
||||
重置
|
||||
</a-button>
|
||||
<a-button type="primary" status="success" @click="onAdd">
|
||||
<template #icon><icon-plus /></template>
|
||||
新增钱包
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6" :xxl="3">
|
||||
<a-button type="primary" status="success" @click="onAdd">
|
||||
<template #icon><icon-plus /></template>
|
||||
新增钱包
|
||||
</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
|
||||
@@ -71,7 +75,7 @@
|
||||
</template>
|
||||
|
||||
<template #optional="{ record }">
|
||||
<a-space>
|
||||
<a-space wrap>
|
||||
<a-button size="mini" type="primary" @click="showDetail(record)">详情</a-button>
|
||||
<a-button size="mini" @click="onMod(record)">修改</a-button>
|
||||
<a-popconfirm content="确定删除这条数据吗?" type="warning" @ok="onDelete(record)">
|
||||
@@ -84,9 +88,9 @@
|
||||
</div>
|
||||
|
||||
<!-- 新增钱包对话框 -->
|
||||
<a-modal width="40%" v-model:visible="open" @close="afterClose" @ok="addWallet" @cancel="afterClose">
|
||||
<a-modal :width="formDialogWidth" v-model:visible="open" @close="afterClose" @ok="addWallet" @cancel="afterClose">
|
||||
<template #title>{{ title }}</template>
|
||||
<a-form ref="formRef" auto-label-width :rules="rules" :model="addFrom">
|
||||
<a-form ref="formRef" auto-label-width :layout="formLayout" :rules="rules" :model="addFrom">
|
||||
<a-form-item field="name" label="钱包名称" validate-trigger="blur">
|
||||
<a-input v-model="addFrom.name" placeholder="请输入钱包名称" allow-clear />
|
||||
</a-form-item>
|
||||
@@ -113,9 +117,9 @@
|
||||
</a-modal>
|
||||
|
||||
<!-- 修改钱包对话框 -->
|
||||
<a-modal width="40%" v-model:visible="modOpen" @close="afterModClose" @ok="modWallet" @cancel="afterModClose">
|
||||
<a-modal :width="formDialogWidth" v-model:visible="modOpen" @close="afterModClose" @ok="modWallet" @cancel="afterModClose">
|
||||
<template #title>{{ modTitle }}</template>
|
||||
<a-form ref="modFormRef" auto-label-width :rules="rules" :model="modFrom">
|
||||
<a-form ref="modFormRef" auto-label-width :layout="formLayout" :rules="rules" :model="modFrom">
|
||||
<a-form-item field="name" label="钱包名称" validate-trigger="blur">
|
||||
<a-input v-model="modFrom.name" placeholder="请输入钱包名称" allow-clear />
|
||||
</a-form-item>
|
||||
@@ -149,7 +153,7 @@
|
||||
|
||||
<!-- 详情对话框 -->
|
||||
<a-modal
|
||||
width="680px"
|
||||
:width="detailDialogWidth"
|
||||
v-model:visible="detailVisible"
|
||||
@close="closeDetail"
|
||||
@cancel="closeDetail"
|
||||
@@ -174,7 +178,7 @@
|
||||
</template>
|
||||
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-idcard />
|
||||
@@ -183,7 +187,7 @@
|
||||
<div class="detail-value">{{ detailData.id }}</div>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-user />
|
||||
@@ -195,7 +199,7 @@
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="24">
|
||||
<a-col :xs="24" :sm="24" :md="24">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-location />
|
||||
@@ -209,7 +213,7 @@
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-swap />
|
||||
@@ -220,7 +224,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-col :xs="24" :sm="24" :md="12">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-notification />
|
||||
@@ -247,7 +251,7 @@
|
||||
|
||||
<a-card class="detail-card" title="时间信息" :bordered="false" v-if="detailData.created_at || detailData.updated_at">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12" v-if="detailData.created_at">
|
||||
<a-col :xs="24" :sm="24" :md="12" v-if="detailData.created_at">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-plus-circle />
|
||||
@@ -256,7 +260,7 @@
|
||||
<div class="detail-value">{{ detailData.created_at }}</div>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="12" v-if="detailData.updated_at">
|
||||
<a-col :xs="24" :sm="24" :md="12" v-if="detailData.updated_at">
|
||||
<div class="detail-item">
|
||||
<div class="detail-label">
|
||||
<icon-edit />
|
||||
@@ -277,9 +281,13 @@ import { List, FormData, Pagination, AddForm, ModForm } from "./config";
|
||||
import { Notification } from "@arco-design/web-vue";
|
||||
import { useUserInfoStore } from "@/store/modules/user-info";
|
||||
import { useWalletDetail } from "./detail";
|
||||
import { useLayoutModel } from "@/hooks/useLayoutModel";
|
||||
|
||||
const userStores = useUserInfoStore();
|
||||
const { detailVisible, detailData, showDetail, closeDetail } = useWalletDetail();
|
||||
const { dialogWidth, formLayout } = useLayoutModel();
|
||||
const formDialogWidth = computed(() => dialogWidth("40%"));
|
||||
const detailDialogWidth = computed(() => dialogWidth("680px"));
|
||||
|
||||
const tradeTypeOptions = computed(() => Object.entries(userStores.trade_type).map(([value, label]) => ({ value, label })));
|
||||
|
||||
@@ -531,7 +539,7 @@ getCommonTableList();
|
||||
margin-bottom: 20px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
|
||||
Reference in New Issue
Block a user