Skip to content

Commit

Permalink
perf 优化各类流水的查询条件
Browse files Browse the repository at this point in the history
  • Loading branch information
xxm1995 committed Mar 14, 2024
1 parent 4d7fbdc commit 29cc176
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ VITE_PUBLIC_PATH=/
# 接口前缀
VITE_GLOB_API_URL_PREFIX=/server

# 接口地址留空即可
# 接口地址
VITE_GLOB_API_URL=

# 跨域代理,您可以配置多个 ,请注意,没有换行符
Expand All @@ -19,5 +19,5 @@ VITE_DROP_CONSOLE=false
# 接口超时时间
VITE_GLOB_API_TIMEOUT=30000

# 文件上传地址
# 文件上传地址 未使用
VITE_GLOB_UPLOAD_URL=/upload
4 changes: 2 additions & 2 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ VITE_PUBLIC_PATH=/
# 接口前缀
VITE_GLOB_API_URL_PREFIX=/server

# 接口地址留空即可
# 接口地址
VITE_GLOB_API_URL=

# 控制台不输出console
Expand All @@ -21,7 +21,7 @@ VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE=false
# 接口超时时间
VITE_GLOB_API_TIMEOUT=30000

# 文件上传地址
# 文件上传地址 未使用
VITE_GLOB_UPLOAD_URL=/upload


Expand Down
4 changes: 2 additions & 2 deletions src/views/login/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<div class="my-auto">
<img :alt="title" src="../../assets/svg/login-box-bg.svg" class="w-1/2 -mt-16 -enter-x" />
<div class="mt-10 font-medium text-white -enter-x">
<span class="inline-block mt-4 text-3xl"> 开箱即用的中后台管理系统</span>
<span class="inline-block mt-4 text-3xl"> 开箱即用的支付网关系统</span>
</div>
<div class="mt-5 font-normal text-white dark:text-gray-500 -enter-x"
>基于Vite+Vue3打造,支持支付收单、工作流(Flowable)、三方对接等模块
>基于Vite+Vue3打造,支持支付宝、微信支付、云闪付等支付方式的统一网关系统
</div>
</div>
</div>
Expand Down
33 changes: 23 additions & 10 deletions src/views/payment/channel/alipay/record/AlipayRecordList.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<div class="m-3 p-3 pt-5 bg-white">
<b-query :query-params="model.queryParam" :fields="fields" @query="queryPage" @reset="resetQueryParams" />
<b-query :query-params="model.queryParam" :fields="fields" :default-item-count="3" @query="queryPage" @reset="resetQueryParams" />
</div>
<div class="m-3 p-3 bg-white">
<vxe-toolbar ref="xToolbar" custom :refresh="{ queryMethod: queryPage }" />
Expand Down Expand Up @@ -44,7 +44,7 @@
</template>

<script setup lang="ts">
import { onMounted } from 'vue'
import { computed, onMounted } from 'vue'
import { $ref } from 'vue/macros'
import { page } from './AlipayRecord.api'
import useTablePage from '/@/hooks/bootx/useTablePage'
Expand All @@ -54,26 +54,32 @@
import AlipayRecordInfo from './AlipayRecordInfo.vue'
import ALink from '/@/components/Link/Link.vue'
import BQuery from '/@/components/Bootx/Query/BQuery.vue'
import { STRING } from '/@/components/Bootx/Query/Query'
import { LIST, QueryField, STRING } from '/@/components/Bootx/Query/Query'
import { LabeledValue } from 'ant-design-vue/lib/select'
// 使用hooks
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, sortChange, sortParam, pages, model, loading } =
useTablePage(queryPage)
const { notification, createMessage, createConfirm } = useMessage()
const { dictConvert, dictDropDown } = useDict()
let alipayRecordInfo = $ref<any>()
const alipayRecordInfo = $ref<any>()
const xTable = $ref<VxeTableInstance>()
const xToolbar = $ref<VxeToolbarInstance>()
const fields = [
{ field: 'title', type: STRING, name: '标题', placeholder: '请输入标题' },
{ field: 'orderId', type: STRING, name: '本地订单ID', placeholder: '请输入完整本地订单ID' },
{ field: 'gatewayOrderNo', type: STRING, name: '网关订单号', placeholder: '请输入完整网关订单号' },
]
let recordTypeList = $ref<LabeledValue[]>([])
const fields = computed(() => {
return [
{ field: 'title', type: STRING, name: '标题', placeholder: '请输入标题' },
{ field: 'orderId', type: STRING, name: '本地订单ID', placeholder: '请输入完整本地订单ID' },
{ field: 'type', type: LIST, name: '记录类型', placeholder: '请选择记录类型', selectList: recordTypeList },
{ field: 'gatewayOrderNo', type: STRING, name: '网关订单号', placeholder: '请输入完整网关订单号' },
] as QueryField[]
})
onMounted(() => {
vxeBind()
initData()
queryPage()
})
Expand All @@ -84,6 +90,13 @@
xTable?.connect(xToolbar as VxeToolbarInstance)
}
/**
* 初始化数据
*/
async function initData() {
recordTypeList = await dictDropDown('AlipayRecordType')
}
/**
* 查看
*/
Expand Down
33 changes: 26 additions & 7 deletions src/views/payment/channel/cash/record/CashRecordList.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<div class="m-3 p-3 pt-5 bg-white">
<b-query :query-params="model.queryParam" :fields="fields" @query="queryPage" @reset="resetQueryParams" />
<b-query :query-params="model.queryParam" :fields="fields" :default-item-count="3" @query="queryPage" @reset="resetQueryParams" />
</div>
<div class="m-3 p-3 bg-white">
<vxe-toolbar ref="xToolbar" custom :refresh="{ queryMethod: queryPage }" />
Expand Down Expand Up @@ -53,33 +53,52 @@
import { VxeTable, VxeTableInstance, VxeToolbarInstance } from 'vxe-table'
import BQuery from '/@/components/Bootx/Query/BQuery.vue'
import { useMessage } from '/@/hooks/web/useMessage'
import { QueryField, STRING } from '/@/components/Bootx/Query/Query'
import { LIST, QueryField, STRING } from '/@/components/Bootx/Query/Query'
import { useDict } from '/@/hooks/bootx/useDict'
import CashRecordInfo from './CashRecordInfo.vue'
import { LabeledValue } from 'ant-design-vue/lib/select'
// 使用hooks
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, sortChange, sortParam, pages, model, loading } =
useTablePage(queryPage)
const { notification, createMessage, createConfirm } = useMessage()
const { dictConvert, dictDropDown } = useDict()
// 查询条件
const fields = computed(() => {
return [{ field: 'orderId', type: STRING, name: '本地订单ID', placeholder: '请输入完整本地订单ID' }] as QueryField[]
})
const xTable = $ref<VxeTableInstance>()
const xToolbar = $ref<VxeToolbarInstance>()
const cashRecordInfo = $ref<any>()
let recordTypeList = $ref<LabeledValue[]>([])
// 查询条件
const fields = computed(() => {
return [
{ field: 'title', type: STRING, name: '标题', placeholder: '请输入标题' },
{ field: 'orderId', type: STRING, name: '本地订单ID', placeholder: '请输入完整本地订单ID' },
{ field: 'type', type: LIST, name: '记录类型', placeholder: '请选择记录类型', selectList: recordTypeList },
] as QueryField[]
})
onMounted(() => {
vxeBind()
initData()
queryPage()
})
/**
* 绑定
*/
function vxeBind() {
xTable?.connect(xToolbar as VxeToolbarInstance)
}
/**
* 初始化数据
*/
async function initData() {
recordTypeList = await dictDropDown('CashRecordType')
}
/**
* 分页查询
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{{ unionPayRecord.gatewayOrderNo }}
</a-descriptions-item>
<a-descriptions-item label="业务类型">
<a-tag>{{ dictConvert('unionPayRecordType', unionPayRecord.type) }}</a-tag>
<a-tag>{{ dictConvert('UnionPayRecordType', unionPayRecord.type) }}</a-tag>
</a-descriptions-item>
<a-descriptions-item label="网关时间">
{{ unionPayRecord.gatewayTime }}
Expand Down
15 changes: 13 additions & 2 deletions src/views/payment/channel/union/record/UnionPayRecordList.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<div class="m-3 p-3 pt-5 bg-white">
<b-query :query-params="model.queryParam" :fields="fields" @query="queryPage" @reset="resetQueryParams" />
<b-query :query-params="model.queryParam" :fields="fields" :default-item-count="3" @query="queryPage" @reset="resetQueryParams" />
</div>
<div class="m-3 p-3 bg-white">
<vxe-toolbar ref="xToolbar" custom :refresh="{ queryMethod: queryPage }" />
Expand Down Expand Up @@ -53,8 +53,9 @@
import { useDict } from '/@/hooks/bootx/useDict'
import ALink from '/@/components/Link/Link.vue'
import BQuery from '/@/components/Bootx/Query/BQuery.vue'
import { STRING } from '/@/components/Bootx/Query/Query'
import { LIST, STRING } from '/@/components/Bootx/Query/Query'
import UnionPayRecordInfo from './UnionPayRecordInfo.vue'
import { LabeledValue } from 'ant-design-vue/lib/select'
// 使用hooks
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, sortChange, sortParam, pages, model, loading } =
Expand All @@ -66,14 +67,17 @@
const xTable = $ref<VxeTableInstance>()
const xToolbar = $ref<VxeToolbarInstance>()
let recordTypeList = $ref<LabeledValue[]>([])
const fields = [
{ field: 'title', type: STRING, name: '标题', placeholder: '请输入标题' },
{ field: 'orderId', type: STRING, name: '本地订单ID', placeholder: '请输入完整本地订单ID' },
{ field: 'type', type: LIST, name: '记录类型', placeholder: '请选择记录类型', selectList: recordTypeList },
{ field: 'gatewayOrderNo', type: STRING, name: '网关订单号', placeholder: '请输入完整网关订单号' },
]
onMounted(() => {
vxeBind()
initData()
queryPage()
})
Expand All @@ -84,6 +88,13 @@
xTable?.connect(xToolbar as VxeToolbarInstance)
}
/**
* 初始化数据
*/
async function initData() {
recordTypeList = await dictDropDown('UnionPayRecordType')
}
/**
* 查看
*/
Expand Down
34 changes: 23 additions & 11 deletions src/views/payment/channel/wechat/record/WechatPayRecordList.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<div class="m-3 p-3 pt-5 bg-white">
<b-query :query-params="model.queryParam" :fields="fields" @query="queryPage" @reset="resetQueryParams" />
<b-query :query-params="model.queryParam" :fields="fields" :default-item-count="3" @query="queryPage" @reset="resetQueryParams" />
</div>
<div class="m-3 p-3 bg-white">
<vxe-toolbar ref="xToolbar" custom :refresh="{ queryMethod: queryPage }" />
Expand Down Expand Up @@ -44,36 +44,42 @@
</template>

<script setup lang="ts">
import { onMounted } from 'vue'
import { computed, onMounted } from 'vue'
import { $ref } from 'vue/macros'
import { page, WechatPayRecord } from './WechatPayRecord.api'
import { page } from './WechatPayRecord.api'
import useTablePage from '/@/hooks/bootx/useTablePage'
import { VxeTable, VxeTableInstance, VxeToolbarInstance } from 'vxe-table'
import { useMessage } from '/@/hooks/web/useMessage'
import { useDict } from '/@/hooks/bootx/useDict'
import WechatPayRecordInfo from './WechatPayRecordInfo.vue'
import ALink from '/@/components/Link/Link.vue'
import BQuery from '/@/components/Bootx/Query/BQuery.vue'
import { STRING } from '/@/components/Bootx/Query/Query'
import { LIST, QueryField, STRING } from '/@/components/Bootx/Query/Query'
import { LabeledValue } from 'ant-design-vue/lib/select'
// 使用hooks
const { handleTableChange, pageQueryResHandel, resetQueryParams, pagination, sortChange, sortParam, pages, model, loading } =
useTablePage(queryPage)
const { notification, createMessage, createConfirm } = useMessage()
const { dictConvert, dictDropDown } = useDict()
let wechatPayRecordInfo = $ref<any>()
const xTable = $ref<VxeTableInstance>()
const xToolbar = $ref<VxeToolbarInstance>()
const wechatPayRecordInfo = $ref<any>()
let recordTypeList = $ref<LabeledValue[]>([])
const fields = [
{ field: 'title', type: STRING, name: '标题', placeholder: '请输入标题' },
{ field: 'orderId', type: STRING, name: '本地订单ID', placeholder: '请输入完整本地订单ID' },
{ field: 'gatewayOrderNo', type: STRING, name: '网关订单号', placeholder: '请输入完整网关订单号' },
]
const fields = computed(() => {
return [
{ field: 'title', type: STRING, name: '标题', placeholder: '请输入标题' },
{ field: 'orderId', type: STRING, name: '本地订单ID', placeholder: '请输入完整本地订单ID' },
{ field: 'type', type: LIST, name: '记录类型', placeholder: '请选择记录类型', selectList: recordTypeList },
{ field: 'gatewayOrderNo', type: STRING, name: '网关订单号', placeholder: '请输入完整网关订单号' },
] as QueryField[]
})
onMounted(() => {
vxeBind()
initData()
queryPage()
})
Expand All @@ -83,6 +89,12 @@
function vxeBind() {
xTable?.connect(xToolbar as VxeToolbarInstance)
}
/**
* 初始化数据
*/
async function initData() {
recordTypeList = await dictDropDown('WechatPayRecordType')
}
/**
* 查看
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@cancel="handleCancel"
>
<a-descriptions bordered title="" :column="{ md: 1, sm: 1, xs: 1 }">
<a-descriptions-item label="商品名称">
<a-descriptions-item label="订单名称">
{{ form.title }}
</a-descriptions-item>
<a-descriptions-item label="交易金额">
Expand Down
4 changes: 2 additions & 2 deletions src/views/payment/order/refund/RefundOrderList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
<a-divider type="vertical" />
<a-link @click="showChannel(row)">通道订单</a-link>
<a-divider type="vertical" />
<!-- 只有退款中的异步订单才可以同步 -->
<a-link :disabled="!(row.asyncPay && row.status === 'progress')" @click="sync(row)">同步</a-link>
<!-- 只有异步订单才可以同步 -->
<a-link :disabled="!row.asyncPay" @click="sync(row)">同步</a-link>
<a-divider type="vertical" />
<!-- 只有退款失败的异步订单才可以重新退款 -->
<a-link :disabled="!(row.asyncPay && row.status === 'fail')" @click="reset(row)">重试</a-link>
Expand Down

0 comments on commit 29cc176

Please sign in to comment.