From 1074b90c6f4660efa306c869b56265d7d77f05f6 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Fri, 30 May 2025 20:51:13 +0800 Subject: [PATCH] feat: mp account --- apps/web-antd/src/views/mp/account/data.ts | 135 +++++++++++ apps/web-antd/src/views/mp/account/index.vue | 209 ++++++++++++++++-- .../src/views/mp/account/modules/form.vue | 82 +++++++ 3 files changed, 403 insertions(+), 23 deletions(-) create mode 100644 apps/web-antd/src/views/mp/account/data.ts create mode 100644 apps/web-antd/src/views/mp/account/modules/form.vue diff --git a/apps/web-antd/src/views/mp/account/data.ts b/apps/web-antd/src/views/mp/account/data.ts new file mode 100644 index 000000000..cbf918cfc --- /dev/null +++ b/apps/web-antd/src/views/mp/account/data.ts @@ -0,0 +1,135 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeGridPropTypes } from '#/adapter/vxe-table'; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'name', + label: '名称', + component: 'Input', + rules: 'required', + componentProps: { + placeholder: '请输入名称', + }, + }, + { + fieldName: 'account', + label: '微信号', + component: 'Input', + help: '在微信公众平台(mp.weixin.qq.com)的菜单 [设置与开发 - 公众号设置 - 账号详情] 中能找到「微信号」', + rules: 'required', + componentProps: { + placeholder: '请输入微信号', + }, + }, + { + fieldName: 'appId', + label: 'appId', + component: 'Input', + help: '在微信公众平台(mp.weixin.qq.com)的菜单 [设置与开发 - 公众号设置 - 基本设置] 中能找到「开发者ID(AppID)」', + rules: 'required', + componentProps: { + placeholder: '请输入appId', + }, + }, + { + fieldName: 'appSecret', + label: 'appSecret', + component: 'Input', + help: '在微信公众平台(mp.weixin.qq.com)的菜单 [设置与开发 - 公众号设置 - 基本设置] 中能找到「开发者密码(AppSecret)」', + rules: 'required', + componentProps: { + placeholder: '请输入appSecret', + }, + }, + { + fieldName: 'token', + label: 'token', + component: 'Input', + rules: 'required', + componentProps: { + placeholder: '请输入token', + }, + }, + { + fieldName: 'aesKey', + label: '消息加解密密钥', + component: 'Input', + componentProps: { + placeholder: '请输入aesKey', + }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + componentProps: { + placeholder: '请输入备注', + }, + }, + ]; +} + +/** 搜索表单配置 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'name', + label: '名称', + component: 'Input', + }, + ]; +} + +/** 表格列配置 */ +export function useGridColumns(): VxeGridPropTypes.Columns { + return [ + { + title: '名称', + field: 'name', + }, + { + title: '微信号', + field: 'account', + }, + { + title: 'appId', + field: 'appId', + }, + { + title: '服务器地址(URL)', + field: 'utl', + slots: { + default: ({ row }) => { + return `http://服务端地址/admin-api/mp/open/${row.appId}`; + }, + }, + }, + { + title: '二维码', + field: 'qrCodeUrl', + slots: { + default: 'qrCodeUrl', + }, + }, + { + title: '备注', + field: 'remark', + }, + { + title: '操作', + width: 260, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-antd/src/views/mp/account/index.vue b/apps/web-antd/src/views/mp/account/index.vue index 34f349e11..cb105a877 100644 --- a/apps/web-antd/src/views/mp/account/index.vue +++ b/apps/web-antd/src/views/mp/account/index.vue @@ -1,31 +1,194 @@ diff --git a/apps/web-antd/src/views/mp/account/modules/form.vue b/apps/web-antd/src/views/mp/account/modules/form.vue new file mode 100644 index 000000000..865c7fab1 --- /dev/null +++ b/apps/web-antd/src/views/mp/account/modules/form.vue @@ -0,0 +1,82 @@ + + +