mirror of
https://gitee.com/bootx/dax-pay-ui.git
synced 2025-09-08 21:27:57 +00:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ad58336a82 | ||
![]() |
3df67c1382 | ||
![]() |
c55fc4e223 | ||
![]() |
cc92b65ba9 | ||
![]() |
48c5e5b46b |
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import type { PluginOption } from 'vite'
|
||||
import path from 'path'
|
||||
import { viteThemePlugin, antdDarkThemePlugin, mixLighten, mixDarken, tinycolor } from 'vite-plugin-theme'
|
||||
import { viteThemePlugin, antdDarkThemePlugin, mixLighten, mixDarken, tinycolor } from '@rys-fe/vite-plugin-theme'
|
||||
import { getThemeColors, generateColors } from '../../config/themeConfig'
|
||||
import { generateModifyVars } from '../../generate/generateModifyVars'
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer'
|
||||
|
||||
const modules = import.meta.globEager('./**/*.ts')
|
||||
const modules: Recordable = import.meta.glob('./**/*.ts', { eager: true })
|
||||
|
||||
const mockModules: any[] = []
|
||||
Object.keys(modules).forEach((key) => {
|
||||
|
31
package.json
31
package.json
@@ -9,8 +9,8 @@
|
||||
"bootstrap": "pnpm install",
|
||||
"serve": "npm run dev",
|
||||
"dev": "vite",
|
||||
"build": "cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts",
|
||||
"build:test": "cross-env vite build --mode test && esno ./build/script/postBuild.ts",
|
||||
"build": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 vite build && esno ./build/script/postBuild.ts",
|
||||
"build:test": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode test && esno ./build/script/postBuild.ts",
|
||||
"build:no-cache": "pnpm clean:cache && npm run build",
|
||||
"report": "cross-env REPORT=true npm run build",
|
||||
"type:check": "vue-tsc --noEmit --skipLibCheck",
|
||||
@@ -46,6 +46,7 @@
|
||||
"ant-design-vue": "^3.2.15",
|
||||
"axios": "^0.26.1",
|
||||
"bpmn-js": "^10.3.0",
|
||||
"china-area-data": "^5.0.1",
|
||||
"codemirror": "^5.65.3",
|
||||
"cron-parser": "^4.6.0",
|
||||
"cropperjs": "^1.5.12",
|
||||
@@ -69,10 +70,10 @@
|
||||
"vue": "^3.2.45",
|
||||
"vue-i18n": "^9.1.9",
|
||||
"vue-json-pretty": "^2.0.6",
|
||||
"vue-router": "^4.1.6",
|
||||
"vue-types": "^4.2.1",
|
||||
"vxe-table": "^4.3.5",
|
||||
"xe-utils": "^3.5.6",
|
||||
"vue-router": "^4.0.16",
|
||||
"vue-types": "^4.1.1",
|
||||
"vxe-table": "^4.3.6",
|
||||
"xe-utils": "^3.5.7",
|
||||
"xlsx": "^0.18.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -95,8 +96,8 @@
|
||||
"@types/sortablejs": "^1.10.7",
|
||||
"@typescript-eslint/eslint-plugin": "^5.20.0",
|
||||
"@typescript-eslint/parser": "^5.20.0",
|
||||
"@vitejs/plugin-legacy": "^1.8.1",
|
||||
"@vitejs/plugin-vue": "^2.3.1",
|
||||
"@vitejs/plugin-legacy": "^2.0.0",
|
||||
"@vitejs/plugin-vue": "^3.0.1",
|
||||
"@vitejs/plugin-vue-jsx": "^1.3.10",
|
||||
"@vue/compiler-sfc": "^3.2.33",
|
||||
"@vue/test-utils": "^2.0.0-rc.21",
|
||||
@@ -134,25 +135,25 @@
|
||||
"stylelint-order": "^5.0.0",
|
||||
"ts-node": "^10.7.0",
|
||||
"typescript": "^4.6.3",
|
||||
"vite": "^2.9.5",
|
||||
"vite": "^3.2.5",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-plugin-html": "^3.2.0",
|
||||
"vite-plugin-imagemin": "^0.6.1",
|
||||
"vite-plugin-mkcert": "^1.6.0",
|
||||
"vite-plugin-mkcert": "^1.10.1",
|
||||
"vite-plugin-mock": "^2.9.6",
|
||||
"vite-plugin-purge-icons": "^0.8.1",
|
||||
"vite-plugin-pwa": "^0.11.13",
|
||||
"vite-plugin-purge-icons": "^0.8.2",
|
||||
"vite-plugin-pwa": "^0.12.3",
|
||||
"vite-plugin-style-import": "^2.0.0",
|
||||
"vite-plugin-svg-icons": "^2.0.1",
|
||||
"vite-plugin-theme": "^0.8.6",
|
||||
"@rys-fe/vite-plugin-theme": "^0.8.6",
|
||||
"vite-plugin-vue-setup-extend": "^0.4.0",
|
||||
"vite-plugin-windicss": "^1.8.4",
|
||||
"vite-plugin-windicss": "^1.8.7",
|
||||
"vue-eslint-parser": "^8.3.0",
|
||||
"vue-tsc": "^0.33.9"
|
||||
},
|
||||
"resolutions": {
|
||||
"bin-wrapper": "npm:bin-wrapper-china",
|
||||
"rollup": "^2.56.3",
|
||||
"rollup": "^2.72.0",
|
||||
"gifsicle": "5.2.0"
|
||||
},
|
||||
"repository": {
|
||||
|
@@ -134,7 +134,6 @@
|
||||
})
|
||||
|
||||
const getWrapperHeight = computed(() => {
|
||||
console.log(unref(getProps))
|
||||
if (unref(fullScreenRef)) return undefined
|
||||
return unref(getProps).height
|
||||
})
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { genMessage } from '../helper'
|
||||
import antdLocale from 'ant-design-vue/es/locale/en_US'
|
||||
|
||||
const modules = import.meta.globEager('./en/**/*.ts')
|
||||
const modules: Recordable = import.meta.glob('./en/**/*.ts', { eager: true })
|
||||
export default {
|
||||
message: {
|
||||
...genMessage(modules, 'en'),
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { genMessage } from '../helper'
|
||||
import antdLocale from 'ant-design-vue/es/locale/zh_CN'
|
||||
|
||||
const modules = import.meta.globEager('./zh-CN/**/*.ts')
|
||||
const modules: Recordable = import.meta.glob('./zh-CN/**/*.ts', { eager: true })
|
||||
export default {
|
||||
message: {
|
||||
...genMessage(modules, 'zh-CN'),
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { darkCssIsReady, loadDarkThemeCss } from 'vite-plugin-theme/es/client'
|
||||
import { darkCssIsReady, loadDarkThemeCss } from '@rys-fe/vite-plugin-theme/es/client'
|
||||
import { addClass, hasClass, removeClass } from '/@/utils/domUtils'
|
||||
|
||||
export async function updateDarkTheme(mode: string | null = 'light') {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { getThemeColors, generateColors } from '../../../build/config/themeConfig'
|
||||
|
||||
import { replaceStyleVariables } from 'vite-plugin-theme/es/client'
|
||||
import { mixLighten, mixDarken, tinycolor } from 'vite-plugin-theme/es/colorUtils'
|
||||
import { replaceStyleVariables } from '@rys-fe/vite-plugin-theme/es/client'
|
||||
import { mixLighten, mixDarken, tinycolor } from '@rys-fe/vite-plugin-theme/es/colorUtils'
|
||||
|
||||
export async function changeTheme(color: string) {
|
||||
const colors = generateColors({
|
||||
|
@@ -16,6 +16,13 @@ import { setupI18n } from '/@/locales/setupI18n'
|
||||
import { registerGlobComp } from '/@/components/registerGlobComp'
|
||||
import { useTable } from '/@/components/VxeTable'
|
||||
|
||||
import { isDevMode } from './utils/env'
|
||||
|
||||
// 加快开发模式的加载速度, 去了这句开发模式的暗黑主题会有问题
|
||||
if (isDevMode()) {
|
||||
import('ant-design-vue/es/style')
|
||||
}
|
||||
|
||||
async function bootstrap() {
|
||||
const app = createApp(App)
|
||||
|
||||
|
@@ -42,8 +42,7 @@ export function createPermissionGuard(router: Router) {
|
||||
|
||||
// token 不存在
|
||||
if (!token) {
|
||||
// 您可以在未经许可的情况下访问。您需要将路由元.忽略身份验证设置为 true
|
||||
console.log(to)
|
||||
// 您可以在未经许可的情况下访问。您需要将路由meta中的 忽略身份验证设置为 true
|
||||
if (to.meta.ignoreAuth) {
|
||||
next()
|
||||
return
|
||||
|
@@ -10,7 +10,7 @@ import { router } from '/@/router'
|
||||
import { PermissionModeEnum } from '/@/enums/appEnum'
|
||||
import { pathToRegexp } from 'path-to-regexp'
|
||||
|
||||
const modules = import.meta.globEager('./modules/**/*.ts')
|
||||
const modules: Recordable = import.meta.glob('./modules/**/*.ts', { eager: true })
|
||||
|
||||
const menuModules: MenuModule[] = []
|
||||
|
||||
|
@@ -6,8 +6,8 @@ import { mainOutRoutes } from './mainOut'
|
||||
import { PageEnum } from '/@/enums/pageEnum'
|
||||
import { t } from '/@/hooks/web/useI18n'
|
||||
|
||||
// import.meta.globEager() 直接引入所有的模块 Vite 独有的功能
|
||||
const modules = import.meta.globEager('./modules/**/*.ts')
|
||||
// import.meta.glob() 直接引入所有的模块 Vite 独有的功能
|
||||
const modules: Recordable = import.meta.glob('./modules/**/*.ts', { eager: true })
|
||||
const routeModuleList: AppRouteModule[] = []
|
||||
|
||||
// 加入到路由集合中
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { findAll } from '/@/views/modules/system/dict/DictItem.api'
|
||||
import { findAllByEnable } from '/@/views/modules/system/dict/DictItem.api'
|
||||
import { Dict } from '/#/store'
|
||||
import { store } from '/@/store'
|
||||
|
||||
@@ -18,7 +18,7 @@ export const useDictStore = defineStore({
|
||||
},
|
||||
actions: {
|
||||
initDict() {
|
||||
findAll().then(({ data }) => {
|
||||
findAllByEnable().then(({ data }) => {
|
||||
this.dict = data.map((o) => {
|
||||
return {
|
||||
dictCode: o.dictCode,
|
||||
|
@@ -23,6 +23,16 @@ export function createAggregatePay(obj) {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 组合支付
|
||||
*/
|
||||
export function combinationPay (obj) {
|
||||
return defHttp.post({
|
||||
url: '/cashier/combinationPay',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据业务ID获取支付状态
|
||||
*/
|
||||
|
161
src/views/demo/payment/cashier/CombinationCashier.vue
Normal file
161
src/views/demo/payment/cashier/CombinationCashier.vue
Normal file
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<a-spin :spinning="loading">
|
||||
<div>
|
||||
<a-form ref="formRef" :model="form" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-form-item label="异步支付方式" name="payChannel">
|
||||
<a-radio-group v-model:value="form.payChannel" :default-value="1" button-style="solid">
|
||||
<a-radio-button v-for="o in payChannel" :value="o.code" :key="o.code"> {{ o.label }} </a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单编号" name="businessId">
|
||||
<a-input v-model:value="form.businessId" @search="genOrderNo">
|
||||
<template #addonAfter>
|
||||
<a-button type="link" size="small" @click="genOrderNo"> 生成订单号 </a-button>
|
||||
</template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="订单名称" name="title">
|
||||
<a-input v-model:value="form.title" />
|
||||
</a-form-item>
|
||||
<a-form-item label="异步支付金额" name="asyncAmount">
|
||||
<a-input-number :precision="2" v-model:value="form.asyncAmount" />
|
||||
</a-form-item>
|
||||
<a-form-item label="钱包支付" name="walletAmount">
|
||||
<a-input-number :precision="2" v-model:value="form.walletAmount" />
|
||||
<template #help>
|
||||
<span>钱包余额:{{ wallet.balance }}</span>
|
||||
</template>
|
||||
</a-form-item>
|
||||
<a-form-item label="现金支付" name="cashAmount">
|
||||
<a-input-number :precision="2" v-model:value="form.cashAmount" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: center">
|
||||
<a-button type="primary" @click="pay"> 发起支付 </a-button>
|
||||
</div>
|
||||
</a-spin>
|
||||
<!-- 扫码弹出窗口 -->
|
||||
<cashier-qr-code ref="cashierQrCode" @cancel="handleCancel" />
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { $ref } from 'vue/macros'
|
||||
import { combinationPay, findStatusByBusinessId, findWalletByUser } from '/@/views/demo/payment/cashier/Cashier.api'
|
||||
import { Voucher } from '/@/views/modules/payment/voucher/Voucher.api'
|
||||
import { useMessage } from '/@/hooks/web/useMessage'
|
||||
import { FormInstance } from 'ant-design-vue/lib/form'
|
||||
import { useIntervalFn } from '@vueuse/core'
|
||||
import { onMounted } from 'vue'
|
||||
import CashierQrCode from './CashierQrCode.vue'
|
||||
|
||||
const { createMessage } = useMessage()
|
||||
|
||||
const formRef = $ref<FormInstance>()
|
||||
const cashierQrCode = $ref<any>()
|
||||
|
||||
const labelCol = {
|
||||
sm: { span: 7 },
|
||||
}
|
||||
const wrapperCol = {
|
||||
sm: { span: 13 },
|
||||
}
|
||||
const payChannel = [
|
||||
{ code: 1, label: '支付宝' },
|
||||
{ code: 2, label: '微信' },
|
||||
]
|
||||
let loading = $ref(false)
|
||||
let visible = $ref(false)
|
||||
let wallet = $ref({ balance: 0 })
|
||||
let voucher = $ref<Voucher>({})
|
||||
let form = $ref({
|
||||
payChannel: 1,
|
||||
payWay: 4,
|
||||
businessId: '',
|
||||
title: '测试支付订单',
|
||||
asyncAmount: null,
|
||||
walletAmount: null,
|
||||
cashAmount: null,
|
||||
})
|
||||
const rules = {
|
||||
payChannel: [{ required: true, message: '不可为空' }],
|
||||
businessId: [{ required: true, message: '不可为空' }],
|
||||
title: [{ required: true, message: '不可为空' }],
|
||||
payWay: [{ required: true, message: '不可为空' }],
|
||||
}
|
||||
|
||||
// 检查支付状态
|
||||
const { pause, resume } = useIntervalFn(
|
||||
() => {
|
||||
findStatusByBusinessId(form.businessId).then((res) => {
|
||||
// 成功
|
||||
if (res.data === 1) {
|
||||
createMessage.success('支付成功')
|
||||
handleCancel()
|
||||
}
|
||||
if ([2, 3].includes(res.data)) {
|
||||
createMessage.error('支付失败')
|
||||
handleCancel()
|
||||
}
|
||||
})
|
||||
},
|
||||
1000 * 3,
|
||||
{ immediate: false },
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
|
||||
function init() {
|
||||
findWalletByUser().then(({ data }) => {
|
||||
wallet = data
|
||||
})
|
||||
genOrderNo()
|
||||
}
|
||||
// 生成订单号
|
||||
function genOrderNo() {
|
||||
form.businessId = 'P' + new Date().getTime()
|
||||
}
|
||||
|
||||
function pay() {
|
||||
formRef?.validate().then(async () => {
|
||||
loading = true
|
||||
// 组装支付参数
|
||||
const payModeList = [
|
||||
{ payChannel: form.payChannel, payWay: form.payWay, amount: form.asyncAmount },
|
||||
{ payChannel: 4, amount: form.cashAmount },
|
||||
{ payChannel: 5, amount: form.walletAmount },
|
||||
]
|
||||
// 异步
|
||||
const { data } = await combinationPay({
|
||||
title: form.title,
|
||||
businessId: form.businessId,
|
||||
payModeList: payModeList,
|
||||
}).finally(() => (loading = false))
|
||||
// 同步还是异步支付
|
||||
if (data.asyncPayMode) {
|
||||
if (data.payChannel === 1) {
|
||||
cashierQrCode.init(data.asyncPayInfo.payBody, '请使用支付宝"扫一扫"扫码支付')
|
||||
} else {
|
||||
cashierQrCode.init(data.asyncPayInfo.payBody, '请使用微信"扫一扫"扫码支付')
|
||||
}
|
||||
loading = false
|
||||
resume()
|
||||
} else {
|
||||
createMessage.success('支付成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function handleCancel() {
|
||||
cashierQrCode.handleClose()
|
||||
loading = false
|
||||
genOrderNo()
|
||||
pause()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
@@ -4,7 +4,7 @@
|
||||
<div>
|
||||
<a-form ref="formRef" :model="form" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-form-item label="支付方式" name="payChannel">
|
||||
<a-radio-group v-model:value="form.payChannel" :default-value="1" button-style="solid">
|
||||
<a-radio-group v-model:value="form.payChannel" button-style="solid">
|
||||
<a-radio-button v-for="o in payChannel" :value="o.code" :key="o.code"> {{ o.name }} </a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
@@ -82,16 +82,14 @@
|
||||
// 二维码支付方式
|
||||
amount: 0.01,
|
||||
})
|
||||
const rules = computed(() => {
|
||||
return {
|
||||
payChannel: [{ required: true, message: '不可为空' }],
|
||||
businessId: [{ required: true, message: '不可为空' }],
|
||||
title: [{ required: true, message: '不可为空' }],
|
||||
payWay: [{ required: true, message: '不可为空' }],
|
||||
amount: [{ required: true, message: '不可为空' }],
|
||||
voucherNo: [{ required: true, message: '不可为空' }],
|
||||
}
|
||||
})
|
||||
const rules = {
|
||||
payChannel: [{ required: true, message: '不可为空' }],
|
||||
businessId: [{ required: true, message: '不可为空' }],
|
||||
title: [{ required: true, message: '不可为空' }],
|
||||
payWay: [{ required: true, message: '不可为空' }],
|
||||
amount: [{ required: true, message: '不可为空' }],
|
||||
voucherNo: [{ required: true, message: '不可为空' }],
|
||||
}
|
||||
|
||||
// 检查支付状态
|
||||
const { pause, resume } = useIntervalFn(
|
||||
@@ -168,7 +166,4 @@
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.cashier {
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,197 +0,0 @@
|
||||
<!--<template>-->
|
||||
<!-- <a-card :bordered="false">-->
|
||||
<!-- <a-spin :spinning="loading">-->
|
||||
<!-- <div>-->
|
||||
<!-- <div>-->
|
||||
<!-- <a-form-model-->
|
||||
<!-- ref="form"-->
|
||||
<!-- :model="form"-->
|
||||
<!-- :rules="rules"-->
|
||||
<!-- :label-col="labelCol"-->
|
||||
<!-- :wrapper-col="wrapperCol"-->
|
||||
<!-- >-->
|
||||
<!-- <a-form-model-item label="异步支付方式" prop="payChannel">-->
|
||||
<!-- <a-radio-group v-model="form.payChannel" :default-value="1" button-style="solid">-->
|
||||
<!-- <a-radio-button v-for="o in payChannel" :value="o.code" :key="o.code"> {{ o.name }} </a-radio-button>-->
|
||||
<!-- </a-radio-group>-->
|
||||
<!-- </a-form-model-item>-->
|
||||
<!-- <a-form-model-item label="订单编号" prop="businessId">-->
|
||||
<!-- <a-input-search v-model="form.businessId" @search="genOrderNo">-->
|
||||
<!-- <template #enterButton>-->
|
||||
<!-- <a-button>-->
|
||||
<!-- 生成订单号-->
|
||||
<!-- </a-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- </a-input-search>-->
|
||||
<!-- </a-form-model-item>-->
|
||||
<!-- <a-form-model-item label="订单名称" prop="title">-->
|
||||
<!-- <a-input v-model="form.title" />-->
|
||||
<!-- </a-form-model-item>-->
|
||||
<!-- <a-form-model-item label="异步支付金额" prop="asyncAmount">-->
|
||||
<!-- <a-input-number :precision="2" v-model="form.asyncAmount" />-->
|
||||
<!-- </a-form-model-item>-->
|
||||
<!-- <a-form-model-item label="钱包支付" prop="walletAmount">-->
|
||||
<!-- <a-input-number :precision="2" v-model="form.walletAmount" />-->
|
||||
<!-- <span slot="help">钱包余额:{{ wallet.balance }}</span>-->
|
||||
<!-- </a-form-model-item>-->
|
||||
<!-- <a-form-model-item label="现金支付" prop="cashAmount">-->
|
||||
<!-- <a-input-number :precision="2" v-model="form.cashAmount" />-->
|
||||
<!-- </a-form-model-item>-->
|
||||
<!-- </a-form-model>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div style="display: flex;justify-content: center">-->
|
||||
<!-- <a-button type="primary" @click="pay">-->
|
||||
<!-- 发起支付-->
|
||||
<!-- </a-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </a-spin>-->
|
||||
<!-- <a-modal-->
|
||||
<!-- title="扫码支付"-->
|
||||
<!-- :footer="null"-->
|
||||
<!-- :width="300"-->
|
||||
<!-- :visible="visible"-->
|
||||
<!-- :maskClosable="false"-->
|
||||
<!-- @cancel="handleCancel"-->
|
||||
<!-- >-->
|
||||
<!-- <a-spin :spinning="qrLoading">-->
|
||||
<!-- <vue-qr-->
|
||||
<!-- :size="250"-->
|
||||
<!-- :margin="0"-->
|
||||
<!-- :auto-color="true"-->
|
||||
<!-- :dot-scale="1"-->
|
||||
<!-- :text="payUrl" />-->
|
||||
<!-- </a-spin>-->
|
||||
<!-- </a-modal>-->
|
||||
<!-- </a-card>-->
|
||||
<!--</template>-->
|
||||
|
||||
<!--<script>-->
|
||||
<!--import VueQr from 'vue-qr'-->
|
||||
<!--import { combinationPay } from '@/api/payment/cashier'-->
|
||||
<!--import { findStatusByBusinessId } from '@/api/payment/payment'-->
|
||||
<!--import { findByUser } from '@/api/payment/wallet'-->
|
||||
|
||||
<!--export default {-->
|
||||
<!-- name: 'CombinationCashier',-->
|
||||
<!-- components: {-->
|
||||
<!-- VueQr-->
|
||||
<!-- },-->
|
||||
<!-- data () {-->
|
||||
<!-- return {-->
|
||||
<!-- labelCol: {-->
|
||||
<!-- sm: { span: 7 }-->
|
||||
<!-- },-->
|
||||
<!-- payChannel: [-->
|
||||
<!-- { code: 1, name: '支付宝' },-->
|
||||
<!-- { code: 2, name: '微信' }-->
|
||||
<!-- // { code: 3, name: '云闪付' }-->
|
||||
<!-- ],-->
|
||||
<!-- wrapperCol: {-->
|
||||
<!-- sm: { span: 13 }-->
|
||||
<!-- },-->
|
||||
<!-- loading: false,-->
|
||||
<!-- qrLoading: false,-->
|
||||
<!-- visible: false,-->
|
||||
<!-- title: '扫码支付',-->
|
||||
<!-- wallet: {},-->
|
||||
<!-- form: {-->
|
||||
<!-- payChannel: 1,-->
|
||||
<!-- payWay: 4,-->
|
||||
<!-- businessId: '',-->
|
||||
<!-- title: '测试支付订单',-->
|
||||
<!-- asyncAmount: null,-->
|
||||
<!-- walletAmount: null,-->
|
||||
<!-- cashAmount: null-->
|
||||
<!-- },-->
|
||||
<!-- rules: {-->
|
||||
<!-- payChannel: [{ required: true, message: '不可为空' }],-->
|
||||
<!-- businessId: [{ required: true, message: '不可为空' }],-->
|
||||
<!-- title: [{ required: true, message: '不可为空' }],-->
|
||||
<!-- payWay: [{ required: true, message: '不可为空' }]-->
|
||||
<!-- },-->
|
||||
<!-- payUrl: '',-->
|
||||
<!-- // 定时查询支付状态定时器-->
|
||||
<!-- interval: null-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- methods: {-->
|
||||
<!-- // 初始化-->
|
||||
<!-- init () {-->
|
||||
<!-- this.genOrderNo()-->
|
||||
<!-- findByUser().then(res => {-->
|
||||
<!-- this.wallet = res.data-->
|
||||
<!-- })-->
|
||||
<!-- },-->
|
||||
<!-- // 生成订单号-->
|
||||
<!-- genOrderNo () {-->
|
||||
<!-- this.form.businessId = 'P' + new Date().getTime()-->
|
||||
<!-- },-->
|
||||
<!-- pay () {-->
|
||||
<!-- this.$refs.form.validate(async valid => {-->
|
||||
<!-- if (valid) {-->
|
||||
<!-- this.loading = true-->
|
||||
<!-- // 组装支付参数-->
|
||||
<!-- const payModeList = []-->
|
||||
<!-- // 异步-->
|
||||
<!-- payModeList.push({ payChannel: this.form.payChannel, payWay: this.form.payWay, amount: this.form.asyncAmount })-->
|
||||
<!-- payModeList.push({ payChannel: 4, amount: this.form.cashAmount })-->
|
||||
<!-- payModeList.push({ payChannel: 5, amount: this.form.walletAmount })-->
|
||||
|
||||
<!-- const form = {-->
|
||||
<!-- title: this.form.title,-->
|
||||
<!-- businessId: this.form.businessId,-->
|
||||
<!-- payModeList: payModeList-->
|
||||
<!-- }-->
|
||||
<!-- const { data } = await combinationPay(form)-->
|
||||
<!-- // 同步还是异步支付-->
|
||||
<!-- if (data.asyncPayMode) {-->
|
||||
<!-- this.payUrl = data.asyncPayInfo.payBody-->
|
||||
<!-- this.visible = true-->
|
||||
<!-- this.loading = false-->
|
||||
<!-- this.checkPayStatus()-->
|
||||
<!-- } else {-->
|
||||
<!-- this.$message.success('支付成功')-->
|
||||
<!-- this.handleCancel()-->
|
||||
<!-- }-->
|
||||
<!-- } else {-->
|
||||
<!-- return false-->
|
||||
<!-- }-->
|
||||
<!-- })-->
|
||||
<!-- },-->
|
||||
<!-- handleCancel () {-->
|
||||
<!-- this.visible = false-->
|
||||
<!-- this.loading = false-->
|
||||
<!-- this.init()-->
|
||||
<!-- this.payUrl = ''-->
|
||||
<!-- clearInterval(this.interval)-->
|
||||
<!-- this.interval = null-->
|
||||
<!-- },-->
|
||||
<!-- checkPayStatus () {-->
|
||||
<!-- this.interval = setInterval(() => {-->
|
||||
<!-- findStatusByBusinessId(this.form.businessId).then(res => {-->
|
||||
<!-- // 成功-->
|
||||
<!-- if (res.data === 1) {-->
|
||||
<!-- this.$message.success('支付成功')-->
|
||||
<!-- this.handleCancel()-->
|
||||
<!-- }-->
|
||||
<!-- if ([2, 3].includes(res.data)) {-->
|
||||
<!-- this.$message.error('支付失败')-->
|
||||
<!-- this.handleCancel()-->
|
||||
<!-- }-->
|
||||
<!-- })-->
|
||||
<!-- }, 1000 * 3)-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- created () {-->
|
||||
<!-- this.init()-->
|
||||
<!-- },-->
|
||||
<!-- destroyed () {-->
|
||||
<!-- this.handleCancel()-->
|
||||
<!-- }-->
|
||||
<!--}-->
|
||||
<!--</script>-->
|
||||
|
||||
<!--<style scoped>-->
|
||||
|
||||
<!--</style>-->
|
@@ -27,31 +27,31 @@ export const get = (id) => {
|
||||
*/
|
||||
export interface OperateLog extends BaseEntity {
|
||||
// 操作模块
|
||||
title: string
|
||||
title?: string
|
||||
// 操作人员id
|
||||
operateId: number
|
||||
operateId?: number
|
||||
// 操作人员账号
|
||||
username: string
|
||||
username?: string
|
||||
// 业务类型
|
||||
businessType: string
|
||||
businessType?: string
|
||||
// 请求方法
|
||||
method: string
|
||||
method?: string
|
||||
// 请求方式
|
||||
requestMethod: string
|
||||
requestMethod?: string
|
||||
// 请求url
|
||||
operateUrl: string
|
||||
operateUrl?: string
|
||||
// 操作ip
|
||||
operateIp: string
|
||||
operateIp?: string
|
||||
// 操作地点
|
||||
operateLocation: string
|
||||
operateLocation?: string
|
||||
// 请求参数
|
||||
operateParam: string
|
||||
operateParam?: string
|
||||
// 返回参数
|
||||
operateReturn: string
|
||||
operateReturn?: string
|
||||
// 是否成功
|
||||
success: boolean
|
||||
success?: boolean
|
||||
// 错误提示
|
||||
errorMsg: string
|
||||
errorMsg?: string
|
||||
// 操作时间
|
||||
operateTime: string
|
||||
operateTime?: string
|
||||
}
|
||||
|
@@ -1,8 +1,47 @@
|
||||
<template>
|
||||
<basic-modal v-bind="$attrs" :loading="confirmLoading" width="50%" title="查看" :visible="visible" @cancel="visible = false">
|
||||
<description :column="2" :data="data" :schema="schema" />
|
||||
<a-descriptions title="" :column="{ md: 2, sm: 1, xs: 1 }">
|
||||
<a-descriptions-item label="操作人员账号">
|
||||
{{ data.username }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="操作模块">
|
||||
{{ data.title }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="业务类型">
|
||||
{{ dictConvert('LogBusinessType', data.businessType) }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="请求方式">
|
||||
{{ data.requestMethod }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="请求url">
|
||||
{{ data.operateUrl }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="操作方法">
|
||||
{{ data.method }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="操作ip">
|
||||
{{ data.operateIp }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="操作状态">
|
||||
{{ data.success ? '成功' : '失败' }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="提示消息">
|
||||
{{ data.errorMsg }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="请求参数">
|
||||
{{ data.operateParam }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="响应参数">
|
||||
{{ data.operateReturn }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="操作时间">
|
||||
{{ data.operateTime }}
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
<template #footer>
|
||||
<a-button key="cancel" @click="visible = false">取消</a-button>
|
||||
<a-space>
|
||||
<a-button key="cancel" @click="visible = false">取消</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</basic-modal>
|
||||
</template>
|
||||
@@ -17,7 +56,7 @@
|
||||
|
||||
const { dictConvert } = useDict()
|
||||
|
||||
let data = $ref<OperateLog>()
|
||||
let data = $ref<OperateLog>({})
|
||||
let visible = $ref(false)
|
||||
let confirmLoading = $ref(false)
|
||||
let schema = [
|
||||
|
@@ -85,6 +85,8 @@ export interface Dict extends BaseEntity {
|
||||
code: string
|
||||
// 名称
|
||||
name: string
|
||||
// 是否启用
|
||||
enable?: boolean
|
||||
// 分类标签
|
||||
groupTag: string
|
||||
// 备注
|
||||
|
@@ -18,6 +18,9 @@
|
||||
<a-form-item label="名称" name="name">
|
||||
<a-input v-model:value="form.name" :disabled="showable" placeholder="请输入名称" />
|
||||
</a-form-item>
|
||||
<a-form-item label="是否启用" name="enable">
|
||||
<a-switch checked-children="启用" un-checked-children="停用" v-model:checked="form.enable" :disabled="showable" />
|
||||
</a-form-item>
|
||||
<a-form-item label="分类标签" name="groupTag">
|
||||
<a-input v-model:value="form.groupTag" :disabled="showable" placeholder="请输入分类标签" />
|
||||
</a-form-item>
|
||||
|
@@ -60,6 +60,14 @@ export const findAll = () => {
|
||||
url: '/dict/item/findAll',
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 查询全部已经启用
|
||||
*/
|
||||
export const findAllByEnable = () => {
|
||||
return defHttp.get<Result<Array<DictItem>>>({
|
||||
url: '/dict/item/findAllByEnable',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码是否存在
|
||||
@@ -82,15 +90,17 @@ export function existsByCodeNotId(code, id) {
|
||||
*/
|
||||
export interface DictItem extends BaseEntity {
|
||||
// 字典id
|
||||
dictId: number | null
|
||||
dictId?: number | null
|
||||
// 字典code
|
||||
dictCode: string | null
|
||||
dictCode?: string | null
|
||||
// 字典项code
|
||||
code: string
|
||||
code?: string
|
||||
// 字典项名称
|
||||
name: string
|
||||
name?: string
|
||||
// 是否启用
|
||||
enable?: boolean
|
||||
// 排序
|
||||
sortNo: number
|
||||
sortNo?: number
|
||||
// 备注
|
||||
remark: string
|
||||
remark?: string
|
||||
}
|
||||
|
@@ -24,6 +24,9 @@
|
||||
<a-form-item label="排序" name="sortNo">
|
||||
<a-input-number v-model:value="form.sortNo" :disabled="showable" placeholder="请输入排序" />
|
||||
</a-form-item>
|
||||
<a-form-item label="是否启用" name="enable">
|
||||
<a-switch checked-children="启用" un-checked-children="停用" v-model:checked="form.enable" :disabled="showable" />
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="remark">
|
||||
<a-textarea v-model:value="form.remark" :disabled="showable" placeholder="请输入备注" />
|
||||
</a-form-item>
|
||||
|
@@ -11,6 +11,12 @@
|
||||
<vxe-column type="seq" width="60" />
|
||||
<vxe-column field="code" title="字典项编码" />
|
||||
<vxe-column field="name" title="字典项名称" />
|
||||
<vxe-column field="enable" title="启用状态">
|
||||
<template #default="{ row }">
|
||||
<a-tag v-if="row.enable" color="green">启用</a-tag>
|
||||
<a-tag v-else color="red">停用</a-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="sortNo" title="排序" />
|
||||
<vxe-column field="remark" title="备注" />
|
||||
<vxe-column field="createTime" title="创建时间" />
|
||||
|
@@ -20,6 +20,12 @@
|
||||
<a-tag color="green">{{ row.groupTag || '空' }}</a-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="enable" title="启用状态">
|
||||
<template #default="{ row }">
|
||||
<a-tag v-if="row.enable" color="green">启用</a-tag>
|
||||
<a-tag v-else color="red">停用</a-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="remark" title="备注" />
|
||||
<vxe-column field="createTime" title="创建时间" />
|
||||
<vxe-column fixed="right" width="220" :showOverflow="false" title="操作">
|
||||
|
@@ -81,15 +81,17 @@ export const existsByKeyNotId = (key: string, id) => {
|
||||
*/
|
||||
export interface SystemParam extends BaseEntity {
|
||||
// 参数名称
|
||||
name: string
|
||||
name?: string
|
||||
// 参数键名
|
||||
paramKey: string
|
||||
paramKey?: string
|
||||
// 参数值
|
||||
value: string
|
||||
value?: string
|
||||
// 参数类型
|
||||
type: number
|
||||
type?: number
|
||||
// 是否启用
|
||||
enable?: boolean
|
||||
// 内置参数
|
||||
internal: boolean
|
||||
internal?: boolean
|
||||
// 备注
|
||||
remark: string
|
||||
remark?: string
|
||||
}
|
||||
|
@@ -18,9 +18,6 @@
|
||||
<a-form-item label="参数键名" name="paramKey">
|
||||
<a-input v-model:value="form.paramKey" :disabled="showable" placeholder="请输入参数键名" />
|
||||
</a-form-item>
|
||||
<a-form-item label="参数值" name="value">
|
||||
<a-input v-model:value="form.value" :disabled="showable" placeholder="请输入参数值" />
|
||||
</a-form-item>
|
||||
<a-form-item label="参数类型" name="type">
|
||||
<a-select
|
||||
allowClear
|
||||
@@ -31,6 +28,12 @@
|
||||
placeholder="请选择状态"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否启用" name="enable">
|
||||
<a-switch checked-children="启用" un-checked-children="停用" v-model:checked="form.enable" :disabled="showable" />
|
||||
</a-form-item>
|
||||
<a-form-item v-if="showable" label="系统内置" name="internal">
|
||||
<a-switch checked-children="是" un-checked-children="否" v-model:checked="form.internal" disabled />
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="remark">
|
||||
<a-textarea v-model:value="form.remark" :disabled="showable" placeholder="请输入备注" />
|
||||
</a-form-item>
|
||||
@@ -74,15 +77,16 @@
|
||||
|
||||
// 表单
|
||||
const formRef = $ref<FormInstance>()
|
||||
let form = $ref({
|
||||
let form = $ref<SystemParam>({
|
||||
id: null,
|
||||
name: '',
|
||||
paramKey: '',
|
||||
value: '',
|
||||
enable: true,
|
||||
type: 1,
|
||||
internal: false,
|
||||
remark: '',
|
||||
} as SystemParam)
|
||||
})
|
||||
// 参数类型
|
||||
let paramTypeList = dictDropDownNumber('ParamType')
|
||||
// 校验
|
||||
|
@@ -21,6 +21,12 @@
|
||||
<a-tag>{{ dictConvert('ParamType', row.type) }}</a-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="enable" title="启用状态">
|
||||
<template #default="{ row }">
|
||||
<a-tag v-if="row.enable" color="green">启用</a-tag>
|
||||
<a-tag v-else color="red">停用</a-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="internal" title="内置参数">
|
||||
<template #default="{ row }">
|
||||
<a-tag v-if="row.internal" color="red">是</a-tag>
|
||||
|
@@ -79,7 +79,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
||||
// },
|
||||
// },
|
||||
// Turning off brotliSize display can slightly reduce packaging time
|
||||
brotliSize: false,
|
||||
reportCompressedSize: false,
|
||||
chunkSizeWarningLimit: 2000,
|
||||
},
|
||||
define: {
|
||||
|
Reference in New Issue
Block a user