refactor: 优化代码格式,调整导入顺序和内容对齐
parent
95f2d1c9bb
commit
361ae581ae
|
@ -10,7 +10,13 @@ import {
|
||||||
setupVbenVxeTable,
|
setupVbenVxeTable,
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
} from '@vben/plugins/vxe-table';
|
} from '@vben/plugins/vxe-table';
|
||||||
import { erpCountInputFormatter, erpNumberFormatter, formatPast2, isFunction, isString } from '@vben/utils';
|
import {
|
||||||
|
erpCountInputFormatter,
|
||||||
|
erpNumberFormatter,
|
||||||
|
formatPast2,
|
||||||
|
isFunction,
|
||||||
|
isString,
|
||||||
|
} from '@vben/utils';
|
||||||
|
|
||||||
import { ElButton, ElImage, ElPopconfirm, ElSwitch } from 'element-plus';
|
import { ElButton, ElImage, ElPopconfirm, ElSwitch } from 'element-plus';
|
||||||
|
|
||||||
|
@ -285,7 +291,6 @@ setupVbenVxeTable({
|
||||||
return `${erpNumberFormatter(cellValue, digits)}元`;
|
return `${erpNumberFormatter(cellValue, digits)}元`;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
useVbenForm,
|
useVbenForm,
|
||||||
});
|
});
|
||||||
|
|
|
@ -53,8 +53,8 @@ const Description = defineComponent({
|
||||||
{...props}
|
{...props}
|
||||||
border={props.componentProps?.border}
|
border={props.componentProps?.border}
|
||||||
column={props.componentProps?.column}
|
column={props.componentProps?.column}
|
||||||
extra={props.componentProps?.extra}
|
|
||||||
direction={props.componentProps?.direction}
|
direction={props.componentProps?.direction}
|
||||||
|
extra={props.componentProps?.extra}
|
||||||
size={props.componentProps?.size}
|
size={props.componentProps?.size}
|
||||||
title={props.componentProps?.title}
|
title={props.componentProps?.title}
|
||||||
>
|
>
|
||||||
|
|
|
@ -12,9 +12,9 @@ import {
|
||||||
ElButton,
|
ElButton,
|
||||||
ElCard,
|
ElCard,
|
||||||
ElDescriptions,
|
ElDescriptions,
|
||||||
|
ElImage,
|
||||||
ElInput,
|
ElInput,
|
||||||
ElMessage,
|
ElMessage,
|
||||||
ElImage,
|
|
||||||
} from 'element-plus';
|
} from 'element-plus';
|
||||||
|
|
||||||
import { getOrder, submitOrder } from '#/api/pay/order';
|
import { getOrder, submitOrder } from '#/api/pay/order';
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { useRouter } from 'vue-router';
|
||||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||||
import { formatDateTime } from '@vben/utils';
|
import { formatDateTime } from '@vben/utils';
|
||||||
|
|
||||||
import { ElMessage, ElLoading } from 'element-plus';
|
import { ElLoading, ElMessage } from 'element-plus';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { getDemoOrderPage, refundDemoOrder } from '#/api/pay/demo/order';
|
import { getDemoOrderPage, refundDemoOrder } from '#/api/pay/demo/order';
|
||||||
|
|
|
@ -5,7 +5,7 @@ import type { DemoWithdrawApi } from '#/api/pay/demo/withdraw';
|
||||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||||
import { erpPriceInputFormatter } from '@vben/utils';
|
import { erpPriceInputFormatter } from '@vben/utils';
|
||||||
|
|
||||||
import { ElMessage, ElLoading, ElTag } from 'element-plus';
|
import { ElLoading, ElMessage, ElTag } from 'element-plus';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -4,7 +4,13 @@ import { ref } from 'vue';
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { formatDateTime } from '@vben/utils';
|
import { formatDateTime } from '@vben/utils';
|
||||||
|
|
||||||
import { ElDescriptions, ElDescriptionsItem, ElDivider, ElTable, ElTag } from 'element-plus';
|
import {
|
||||||
|
ElDescriptions,
|
||||||
|
ElDescriptionsItem,
|
||||||
|
ElDivider,
|
||||||
|
ElTable,
|
||||||
|
ElTag,
|
||||||
|
} from 'element-plus';
|
||||||
|
|
||||||
import { getNotifyTaskDetail } from '#/api/pay/notify';
|
import { getNotifyTaskDetail } from '#/api/pay/notify';
|
||||||
import { DictTag } from '#/components/dict-tag';
|
import { DictTag } from '#/components/dict-tag';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import type { VbenFormSchema } from '#/adapter/form';
|
import type { VbenFormSchema } from '#/adapter/form';
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { DescriptionItemSchema } from '#/components/description';
|
|
||||||
import type { PayOrderApi } from '#/api/pay/order';
|
import type { PayOrderApi } from '#/api/pay/order';
|
||||||
|
import type { DescriptionItemSchema } from '#/components/description';
|
||||||
|
|
||||||
import { h } from 'vue';
|
import { h } from 'vue';
|
||||||
|
|
||||||
|
@ -175,37 +175,44 @@ export function useDetailSchema(): DescriptionItemSchema[] {
|
||||||
{
|
{
|
||||||
field: 'price',
|
field: 'price',
|
||||||
label: '支付金额',
|
label: '支付金额',
|
||||||
content: (data: PayOrderApi.Order) => `¥${erpPriceInputFormatter(data?.price)}`,
|
content: (data: PayOrderApi.Order) =>
|
||||||
|
`¥${erpPriceInputFormatter(data?.price)}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'channelFeePrice',
|
field: 'channelFeePrice',
|
||||||
label: '手续费',
|
label: '手续费',
|
||||||
content: (data: PayOrderApi.Order) => `¥${erpPriceInputFormatter(data?.channelFeePrice)}`,
|
content: (data: PayOrderApi.Order) =>
|
||||||
|
`¥${erpPriceInputFormatter(data?.channelFeePrice)}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'channelFeeRate',
|
field: 'channelFeeRate',
|
||||||
label: '手续费比例',
|
label: '手续费比例',
|
||||||
content: (data: PayOrderApi.Order) => `${erpPriceInputFormatter(data?.channelFeeRate)}%`,
|
content: (data: PayOrderApi.Order) =>
|
||||||
|
`${erpPriceInputFormatter(data?.channelFeeRate)}%`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'successTime',
|
field: 'successTime',
|
||||||
label: '支付时间',
|
label: '支付时间',
|
||||||
content: (data: PayOrderApi.Order) => formatDateTime(data?.successTime) as string,
|
content: (data: PayOrderApi.Order) =>
|
||||||
|
formatDateTime(data?.successTime) as string,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'expireTime',
|
field: 'expireTime',
|
||||||
label: '失效时间',
|
label: '失效时间',
|
||||||
content: (data: PayOrderApi.Order) => formatDateTime(data?.expireTime) as string,
|
content: (data: PayOrderApi.Order) =>
|
||||||
|
formatDateTime(data?.expireTime) as string,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'createTime',
|
field: 'createTime',
|
||||||
label: '创建时间',
|
label: '创建时间',
|
||||||
content: (data: PayOrderApi.Order) => formatDateTime(data?.createTime) as string,
|
content: (data: PayOrderApi.Order) =>
|
||||||
|
formatDateTime(data?.createTime) as string,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'updateTime',
|
field: 'updateTime',
|
||||||
label: '更新时间',
|
label: '更新时间',
|
||||||
content: (data: PayOrderApi.Order) => formatDateTime(data?.updateTime) as string,
|
content: (data: PayOrderApi.Order) =>
|
||||||
|
formatDateTime(data?.updateTime) as string,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'subject',
|
field: 'subject',
|
||||||
|
@ -241,7 +248,8 @@ export function useDetailSchema(): DescriptionItemSchema[] {
|
||||||
{
|
{
|
||||||
field: 'refundPrice',
|
field: 'refundPrice',
|
||||||
label: '退款金额',
|
label: '退款金额',
|
||||||
content: (data: PayOrderApi.Order) => `¥${erpPriceInputFormatter(data?.refundPrice)}`,
|
content: (data: PayOrderApi.Order) =>
|
||||||
|
`¥${erpPriceInputFormatter(data?.refundPrice)}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'notifyUrl',
|
field: 'notifyUrl',
|
||||||
|
|
|
@ -99,7 +99,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
<template #no="{ row }">
|
<template #no="{ row }">
|
||||||
<div class="flex flex-col gap-1 text-left">
|
<div class="flex flex-col gap-1 text-left">
|
||||||
<p class="text-sm">
|
<p class="text-sm">
|
||||||
<ElTag size="small" type="primary"> 商户</ElTag> {{ row.merchantOrderId }}
|
<ElTag size="small" type="primary"> 商户</ElTag>
|
||||||
|
{{ row.merchantOrderId }}
|
||||||
</p>
|
</p>
|
||||||
<p class="text-sm" v-if="row.no">
|
<p class="text-sm" v-if="row.no">
|
||||||
<ElTag size="small" type="warning">支付</ElTag> {{ row.no }}
|
<ElTag size="small" type="warning">支付</ElTag> {{ row.no }}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PayOrderApi } from '#/api/pay/order';
|
import type { PayOrderApi } from '#/api/pay/order';
|
||||||
|
|
||||||
import { ref, } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue