From 080b57af07028b00257dea0386d2e3b2a9046e67 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 25 Oct 2025 14:24:01 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90ele=E3=80=91mp/account=20?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-ele/src/views/mp/account/data.ts | 143 ++++++++++++++ apps/web-ele/src/views/mp/account/index.vue | 176 ++++++++++++++++++ .../src/views/mp/account/modules/form.vue | 82 ++++++++ 3 files changed, 401 insertions(+) create mode 100644 apps/web-ele/src/views/mp/account/data.ts create mode 100644 apps/web-ele/src/views/mp/account/index.vue create mode 100644 apps/web-ele/src/views/mp/account/modules/form.vue diff --git a/apps/web-ele/src/views/mp/account/data.ts b/apps/web-ele/src/views/mp/account/data.ts new file mode 100644 index 000000000..d52015355 --- /dev/null +++ b/apps/web-ele/src/views/mp/account/data.ts @@ -0,0 +1,143 @@ +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: '请输入消息加解密密钥', + }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + componentProps: { + placeholder: '请输入备注', + }, + }, + ]; +} + +/** 搜索表单配置 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'name', + label: '名称', + component: 'Input', + componentProps: { + placeholder: '请输入名称', + clearable: true, + }, + }, + ]; +} + +/** 表格列配置 */ +export function useGridColumns(): VxeGridPropTypes.Columns { + return [ + { + title: '名称', + field: 'name', + minWidth: 150, + }, + { + title: '微信号', + field: 'account', + minWidth: 180, + }, + { + title: 'appId', + field: 'appId', + minWidth: 180, + }, + { + title: '服务器地址(URL)', + field: 'utl', + minWidth: 360, + slots: { + default: ({ row }) => { + return `http://服务端地址/admin-api/mp/open/${row.appId}`; + }, + }, + }, + { + title: '二维码', + field: 'qrCodeUrl', + minWidth: 120, + cellRender: { name: 'CellImage' }, + }, + { + title: '备注', + field: 'remark', + minWidth: 150, + }, + { + title: '操作', + width: 200, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-ele/src/views/mp/account/index.vue b/apps/web-ele/src/views/mp/account/index.vue new file mode 100644 index 000000000..1de294ebc --- /dev/null +++ b/apps/web-ele/src/views/mp/account/index.vue @@ -0,0 +1,176 @@ + + + diff --git a/apps/web-ele/src/views/mp/account/modules/form.vue b/apps/web-ele/src/views/mp/account/modules/form.vue new file mode 100644 index 000000000..792f9e02b --- /dev/null +++ b/apps/web-ele/src/views/mp/account/modules/form.vue @@ -0,0 +1,82 @@ + + +