diff --git a/apps/web-antd/package.json b/apps/web-antd/package.json index f9a0862ed..b779d03a9 100644 --- a/apps/web-antd/package.json +++ b/apps/web-antd/package.json @@ -26,6 +26,7 @@ "#/*": "./src/*" }, "dependencies": { + "@ant-design/icons-vue": "catalog:", "@form-create/ant-design-vue": "catalog:", "@form-create/antd-designer": "catalog:", "@tinymce/tinymce-vue": "catalog:", diff --git a/apps/web-antd/src/adapter/form.ts b/apps/web-antd/src/adapter/form.ts index eb1ac968e..d9edaf19c 100644 --- a/apps/web-antd/src/adapter/form.ts +++ b/apps/web-antd/src/adapter/form.ts @@ -68,3 +68,4 @@ export { initSetupVbenForm, useVbenForm, z }; export type VbenFormSchema = FormSchema; export type { VbenFormProps }; +export type FormSchemaGetter = () => VbenFormSchema[]; diff --git a/apps/web-antd/src/api/pay/channel/index.ts b/apps/web-antd/src/api/pay/channel/index.ts index 99a16c05c..eb4c1d99e 100644 --- a/apps/web-antd/src/api/pay/channel/index.ts +++ b/apps/web-antd/src/api/pay/channel/index.ts @@ -27,7 +27,7 @@ export function getChannelPage(params: PageParam) { } /** 查询支付渠道详情 */ -export function getChannel(appId: string, code: string) { +export function getChannel(appId: number, code: string) { return requestClient.get('/pay/channel/get', { params: { appId, code }, }); diff --git a/apps/web-antd/src/api/pay/order/index.ts b/apps/web-antd/src/api/pay/order/index.ts index 984a5d1f6..31ba880d8 100644 --- a/apps/web-antd/src/api/pay/order/index.ts +++ b/apps/web-antd/src/api/pay/order/index.ts @@ -6,8 +6,13 @@ export namespace PayOrderApi { /** 支付订单信息 */ export interface Order { id: number; + no: string; + price: number; + channelFeePrice: number; + refundPrice: number; merchantId: number; appId: number; + appName: string; channelId: number; channelCode: string; merchantOrderId: string; @@ -29,7 +34,9 @@ export namespace PayOrderApi { refundAmount: number; channelUserId: string; channelOrderNo: string; + channelNotifyData: string; createTime: Date; + updateTime: Date; } /** 支付订单分页请求 */ diff --git a/apps/web-antd/src/components/upload/file-upload.vue b/apps/web-antd/src/components/upload/file-upload.vue index 3fbb727b6..5423ab9a3 100644 --- a/apps/web-antd/src/components/upload/file-upload.vue +++ b/apps/web-antd/src/components/upload/file-upload.vue @@ -58,7 +58,7 @@ const props = withDefaults( showDescription: false, }, ); -const emit = defineEmits(['change', 'update:value', 'delete']); +const emit = defineEmits(['change', 'update:value', 'delete', 'returnText']); const { accept, helpText, maxNumber, maxSize } = toRefs(props); const isInnerOperate = ref(false); const { getStringAccept } = useUploadType({ @@ -125,6 +125,10 @@ const handleRemove = async (file: UploadFile) => { }; const beforeUpload = async (file: File) => { + // 使用现代的Blob.text()方法替代FileReader + const fileContent = await file.text(); + emit('returnText', fileContent); + const { maxSize, accept } = props; const isAct = checkFileType(file, accept); if (!isAct) { diff --git a/apps/web-antd/src/views/pay/app/data.ts b/apps/web-antd/src/views/pay/app/data.ts new file mode 100644 index 000000000..dcc83ba04 --- /dev/null +++ b/apps/web-antd/src/views/pay/app/data.ts @@ -0,0 +1,223 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; + +import { DICT_TYPE, getDictOptions } from '#/utils/dict'; + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'name', + label: '应用名', + componentProps: { + placeholder: '请输入应用名', + }, + }, + { + component: 'Select', + fieldName: 'status', + label: '开启状态', + componentProps: { + placeholder: '请选择开启状态', + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + }, + }, + { + component: 'RangePicker', + fieldName: 'createTime', + label: '创建时间', + componentProps: { + placeholder: ['开始日期', '结束日期'], + }, + }, +]; + +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '应用标识', + field: 'appKey', + }, + { + title: '应用名', + field: 'name', + }, + { + title: '开启状态', + field: 'status', + slots: { + default: 'status', + }, + }, + { + title: '支付宝配置', + children: [ + { + title: 'APP 支付', + slots: { + default: 'alipayAppConfig', + }, + }, + { + title: 'PC 网站支付', + slots: { + default: 'alipayPCConfig', + }, + }, + { + title: 'WAP 网站支付', + slots: { + default: 'alipayWAPConfig', + }, + }, + { + title: '扫码支付', + slots: { + default: 'alipayQrConfig', + }, + }, + { + title: '条码支付', + slots: { + default: 'alipayBarConfig', + }, + }, + ], + }, + { + title: '微信配置', + children: [ + { + title: '小程序支付', + slots: { + default: 'wxLiteConfig', + }, + }, + { + title: 'JSAPI 支付', + slots: { + default: 'wxPubConfig', + }, + }, + { + title: 'APP 支付', + slots: { + default: 'wxAppConfig', + }, + }, + { + title: 'Native 支付', + slots: { + default: 'wxNativeConfig', + }, + }, + { + title: 'WAP 网站支付', + slots: { + default: 'wxWapConfig', + }, + }, + { + title: '条码支付', + slots: { + default: 'wxBarConfig', + }, + }, + ], + }, + { + title: '钱包支付配置', + field: 'walletConfig', + slots: { + default: 'walletConfig', + }, + }, + { + title: '模拟支付配置', + field: 'mockConfig', + slots: { + default: 'mockConfig', + }, + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + minWidth: 160, + }, +]; + +export const modalSchema: FormSchemaGetter = () => [ + { + label: '应用编号', + fieldName: 'id', + component: 'Input', + dependencies: { + show: () => false, + triggerFields: [''], + }, + }, + { + label: '应用名', + fieldName: 'name', + component: 'Input', + rules: 'required', + componentProps: { + placeholder: '请输入应用名', + }, + }, + { + label: '应用标识', + fieldName: 'appKey', + component: 'Input', + rules: 'required', + componentProps: { + placeholder: '请输入应用标识', + }, + }, + { + label: '开启状态', + fieldName: 'status', + component: 'RadioGroup', + rules: 'required', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + }, + }, + { + label: '支付结果的回调地址', + fieldName: 'orderNotifyUrl', + component: 'Input', + rules: 'required', + componentProps: { + placeholder: '请输入支付结果的回调地址', + }, + }, + { + label: '退款结果的回调地址', + fieldName: 'refundNotifyUrl', + component: 'Input', + rules: 'required', + componentProps: { + placeholder: '请输入支付结果的回调地址', + }, + }, + { + label: '转账结果的回调地址', + fieldName: 'transferNotifyUrl', + component: 'Input', + rules: 'required', + componentProps: { + placeholder: '请输入转账结果的回调地址', + }, + }, + { + label: '备注', + fieldName: 'remark', + component: 'Textarea', + componentProps: { + rows: 3, + placeholder: '请输入备注', + }, + }, +]; diff --git a/apps/web-antd/src/views/pay/app/index.vue b/apps/web-antd/src/views/pay/app/index.vue index 199d0ebd2..08cfc1b35 100644 --- a/apps/web-antd/src/views/pay/app/index.vue +++ b/apps/web-antd/src/views/pay/app/index.vue @@ -1,31 +1,498 @@ diff --git a/apps/web-antd/src/views/pay/app/modules/app-form.vue b/apps/web-antd/src/views/pay/app/modules/app-form.vue new file mode 100644 index 000000000..3791d15a1 --- /dev/null +++ b/apps/web-antd/src/views/pay/app/modules/app-form.vue @@ -0,0 +1,90 @@ + + diff --git a/apps/web-antd/src/views/pay/app/modules/channel/alipay-channel-form.vue b/apps/web-antd/src/views/pay/app/modules/channel/alipay-channel-form.vue new file mode 100644 index 000000000..a188ce67d --- /dev/null +++ b/apps/web-antd/src/views/pay/app/modules/channel/alipay-channel-form.vue @@ -0,0 +1,163 @@ + +