Merge remote-tracking branch 'yudao/dev' into dev
commit
605c3212d7
|
@ -0,0 +1,71 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MpAccountApi {
|
||||
/** 公众号账号信息 */
|
||||
export interface Account {
|
||||
id?: number;
|
||||
name: string;
|
||||
account: string;
|
||||
appId: string;
|
||||
appSecret: string;
|
||||
token: string;
|
||||
aesKey?: string;
|
||||
qrCodeUrl?: string;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
}
|
||||
|
||||
export interface AccountSimple {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询公众号账号列表 */
|
||||
export function getAccountPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MpAccountApi.Account>>(
|
||||
'/mp/account/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询公众号账号详情 */
|
||||
export function getAccount(id: number) {
|
||||
return requestClient.get<MpAccountApi.Account>(`/mp/account/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 查询公众号账号列表 */
|
||||
export function getSimpleAccountList() {
|
||||
return requestClient.get<MpAccountApi.AccountSimple[]>(
|
||||
'/mp/account/list-all-simple',
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增公众号账号 */
|
||||
export function createAccount(data: MpAccountApi.Account) {
|
||||
return requestClient.post('/mp/account/create', data);
|
||||
}
|
||||
|
||||
/** 修改公众号账号 */
|
||||
export function updateAccount(data: MpAccountApi.Account) {
|
||||
return requestClient.put('/mp/account/update', data);
|
||||
}
|
||||
|
||||
/** 删除公众号账号 */
|
||||
export function deleteAccount(id: number) {
|
||||
return requestClient.delete(`/mp/account/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 生成公众号账号二维码 */
|
||||
export function generateAccountQrCode(id: number) {
|
||||
return requestClient.post(`/mp/account/generate-qr-code?id=${id}`);
|
||||
}
|
||||
|
||||
/** 清空公众号账号 API 配额 */
|
||||
export function clearAccountQuota(id: number) {
|
||||
return requestClient.post(`/mp/account/clear-quota?id=${id}`);
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MpAutoReplyApi {
|
||||
/** 自动回复信息 */
|
||||
export interface AutoReply {
|
||||
id?: number;
|
||||
accountId: number;
|
||||
type: number;
|
||||
keyword: string;
|
||||
content: string;
|
||||
status: number;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询自动回复列表 */
|
||||
export function getAutoReplyPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MpAutoReplyApi.AutoReply>>(
|
||||
'/mp/auto-reply/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询自动回复详情 */
|
||||
export function getAutoReply(id: number) {
|
||||
return requestClient.get<MpAutoReplyApi.AutoReply>(
|
||||
`/mp/auto-reply/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增自动回复 */
|
||||
export function createAutoReply(data: MpAutoReplyApi.AutoReply) {
|
||||
return requestClient.post('/mp/auto-reply/create', data);
|
||||
}
|
||||
|
||||
/** 修改自动回复 */
|
||||
export function updateAutoReply(data: MpAutoReplyApi.AutoReply) {
|
||||
return requestClient.put('/mp/auto-reply/update', data);
|
||||
}
|
||||
|
||||
/** 删除自动回复 */
|
||||
export function deleteAutoReply(id: number) {
|
||||
return requestClient.delete(`/mp/auto-reply/delete?id=${id}`);
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MpDraftApi {
|
||||
/** 草稿文章信息 */
|
||||
export interface Article {
|
||||
title: string;
|
||||
author: string;
|
||||
digest: string;
|
||||
content: string;
|
||||
contentSourceUrl: string;
|
||||
thumbMediaId: string;
|
||||
showCoverPic: number;
|
||||
needOpenComment: number;
|
||||
onlyFansCanComment: number;
|
||||
}
|
||||
|
||||
/** 草稿信息 */
|
||||
export interface Draft {
|
||||
id?: number;
|
||||
accountId: number;
|
||||
mediaId: string;
|
||||
articles: Article[];
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询草稿列表 */
|
||||
export function getDraftPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MpDraftApi.Draft>>('/mp/draft/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建草稿 */
|
||||
export function createDraft(accountId: number, articles: MpDraftApi.Article[]) {
|
||||
return requestClient.post('/mp/draft/create', articles, {
|
||||
params: { accountId },
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新草稿 */
|
||||
export function updateDraft(
|
||||
accountId: number,
|
||||
mediaId: string,
|
||||
articles: MpDraftApi.Article[],
|
||||
) {
|
||||
return requestClient.put('/mp/draft/update', articles, {
|
||||
params: { accountId, mediaId },
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除草稿 */
|
||||
export function deleteDraft(accountId: number, mediaId: string) {
|
||||
return requestClient.delete('/mp/draft/delete', {
|
||||
params: { accountId, mediaId },
|
||||
});
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MpFreePublishApi {
|
||||
/** 自由发布文章信息 */
|
||||
export interface FreePublish {
|
||||
id?: number;
|
||||
accountId: number;
|
||||
mediaId: string;
|
||||
articleId: string;
|
||||
title: string;
|
||||
author: string;
|
||||
digest: string;
|
||||
content: string;
|
||||
thumbUrl: string;
|
||||
status: number;
|
||||
publishTime?: Date;
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询自由发布文章列表 */
|
||||
export function getFreePublishPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MpFreePublishApi.FreePublish>>(
|
||||
'/mp/free-publish/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 删除自由发布文章 */
|
||||
export function deleteFreePublish(accountId: number, articleId: string) {
|
||||
return requestClient.delete('/mp/free-publish/delete', {
|
||||
params: { accountId, articleId },
|
||||
});
|
||||
}
|
||||
|
||||
/** 发布自由发布文章 */
|
||||
export function submitFreePublish(accountId: number, mediaId: string) {
|
||||
return requestClient.post('/mp/free-publish/submit', null, {
|
||||
params: { accountId, mediaId },
|
||||
});
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/** 素材类型枚举 */
|
||||
export enum MaterialType {
|
||||
IMAGE = 1, // 图片
|
||||
THUMB = 4, // 缩略图
|
||||
VIDEO = 3, // 视频
|
||||
VOICE = 2, // 语音
|
||||
}
|
||||
|
||||
export namespace MpMaterialApi {
|
||||
/** 素材信息 */
|
||||
export interface Material {
|
||||
id?: number;
|
||||
accountId: number;
|
||||
type: MaterialType;
|
||||
mediaId: string;
|
||||
url: string;
|
||||
name: string;
|
||||
size: number;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询素材列表 */
|
||||
export function getMaterialPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MpMaterialApi.Material>>(
|
||||
'/mp/material/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 删除永久素材 */
|
||||
export function deletePermanentMaterial(id: number) {
|
||||
return requestClient.delete('/mp/material/delete-permanent', {
|
||||
params: { id },
|
||||
});
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
/** 菜单类型枚举 */
|
||||
export enum MenuType {
|
||||
CLICK = 'click', // 点击推事件
|
||||
LOCATION_SELECT = 'location_select', // 发送位置
|
||||
MEDIA_ID = 'media_id', // 下发消息
|
||||
MINIPROGRAM = 'miniprogram', // 小程序
|
||||
PIC_PHOTO_OR_ALBUM = 'pic_photo_or_album', // 拍照或者相册发图
|
||||
PIC_SYSPHOTO = 'pic_sysphoto', // 系统拍照发图
|
||||
PIC_WEIXIN = 'pic_weixin', // 微信相册发图
|
||||
SCANCODE_PUSH = 'scancode_push', // 扫码推事件
|
||||
SCANCODE_WAITMSG = 'scancode_waitmsg', // 扫码带提示
|
||||
VIEW = 'view', // 跳转URL
|
||||
VIEW_LIMITED = 'view_limited', // 跳转图文消息URL
|
||||
}
|
||||
|
||||
export namespace MpMenuApi {
|
||||
/** 菜单按钮信息 */
|
||||
export interface MenuButton {
|
||||
type: MenuType;
|
||||
name: string;
|
||||
key?: string;
|
||||
url?: string;
|
||||
mediaId?: string;
|
||||
appId?: string;
|
||||
pagePath?: string;
|
||||
subButtons?: MenuButton[];
|
||||
}
|
||||
|
||||
/** 菜单信息 */
|
||||
export interface Menu {
|
||||
accountId: number;
|
||||
menus: MenuButton[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询菜单列表 */
|
||||
export function getMenuList(accountId: number) {
|
||||
return requestClient.get<MpMenuApi.MenuButton[]>('/mp/menu/list', {
|
||||
params: { accountId },
|
||||
});
|
||||
}
|
||||
|
||||
/** 保存菜单 */
|
||||
export function saveMenu(accountId: number, menus: MpMenuApi.MenuButton[]) {
|
||||
return requestClient.post('/mp/menu/save', {
|
||||
accountId,
|
||||
menus,
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除菜单 */
|
||||
export function deleteMenu(accountId: number) {
|
||||
return requestClient.delete('/mp/menu/delete', {
|
||||
params: { accountId },
|
||||
});
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/** 消息类型枚举 */
|
||||
export enum MessageType {
|
||||
IMAGE = 'image', // 图片消息
|
||||
MPNEWS = 'mpnews', // 公众号图文消息
|
||||
MUSIC = 'music', // 音乐消息
|
||||
NEWS = 'news', // 图文消息
|
||||
TEXT = 'text', // 文本消息
|
||||
VIDEO = 'video', // 视频消息
|
||||
VOICE = 'voice', // 语音消息
|
||||
WXCARD = 'wxcard', // 卡券消息
|
||||
}
|
||||
|
||||
export namespace MpMessageApi {
|
||||
/** 消息信息 */
|
||||
export interface Message {
|
||||
id?: number;
|
||||
accountId: number;
|
||||
type: MessageType;
|
||||
openid: string;
|
||||
content: string;
|
||||
mediaId?: string;
|
||||
status: number;
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
}
|
||||
|
||||
/** 发送消息请求 */
|
||||
export interface SendMessageRequest {
|
||||
accountId: number;
|
||||
openid: string;
|
||||
type: MessageType;
|
||||
content: string;
|
||||
mediaId?: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询消息列表 */
|
||||
export function getMessagePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MpMessageApi.Message>>(
|
||||
'/mp/message/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 发送消息 */
|
||||
export function sendMessage(data: MpMessageApi.SendMessageRequest) {
|
||||
return requestClient.post('/mp/message/send', data);
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
import type { PageParam } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MpStatisticsApi {
|
||||
/** 统计查询参数 */
|
||||
export interface StatisticsQuery extends PageParam {
|
||||
accountId: number;
|
||||
beginDate: string;
|
||||
endDate: string;
|
||||
}
|
||||
|
||||
/** 消息发送概况数据 */
|
||||
export interface UpstreamMessage {
|
||||
refDate: string;
|
||||
msgType: string;
|
||||
msgUser: number;
|
||||
msgCount: number;
|
||||
}
|
||||
|
||||
/** 用户增减数据 */
|
||||
export interface UserSummary {
|
||||
refDate: string;
|
||||
userSource: number;
|
||||
newUser: number;
|
||||
cancelUser: number;
|
||||
cumulateUser: number;
|
||||
}
|
||||
|
||||
/** 用户累计数据 */
|
||||
export interface UserCumulate {
|
||||
refDate: string;
|
||||
cumulateUser: number;
|
||||
}
|
||||
|
||||
/** 接口分析数据 */
|
||||
export interface InterfaceSummary {
|
||||
refDate: string;
|
||||
callbackCount: number;
|
||||
failCount: number;
|
||||
totalTimeCost: number;
|
||||
maxTimeCost: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取消息发送概况数据 */
|
||||
export function getUpstreamMessage(params: MpStatisticsApi.StatisticsQuery) {
|
||||
return requestClient.get<MpStatisticsApi.UpstreamMessage[]>(
|
||||
'/mp/statistics/upstream-message',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取用户增减数据 */
|
||||
export function getUserSummary(params: MpStatisticsApi.StatisticsQuery) {
|
||||
return requestClient.get<MpStatisticsApi.UserSummary[]>(
|
||||
'/mp/statistics/user-summary',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取用户累计数据 */
|
||||
export function getUserCumulate(params: MpStatisticsApi.StatisticsQuery) {
|
||||
return requestClient.get<MpStatisticsApi.UserCumulate[]>(
|
||||
'/mp/statistics/user-cumulate',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取接口分析数据 */
|
||||
export function getInterfaceSummary(params: MpStatisticsApi.StatisticsQuery) {
|
||||
return requestClient.get<MpStatisticsApi.InterfaceSummary[]>(
|
||||
'/mp/statistics/interface-summary',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MpTagApi {
|
||||
/** 标签信息 */
|
||||
export interface Tag {
|
||||
id?: number;
|
||||
accountId: number;
|
||||
name: string;
|
||||
count?: number;
|
||||
createTime?: Date;
|
||||
}
|
||||
|
||||
/** 标签分页查询参数 */
|
||||
export interface TagPageQuery extends PageParam {
|
||||
accountId?: number;
|
||||
name?: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建公众号标签 */
|
||||
export function createTag(data: MpTagApi.Tag) {
|
||||
return requestClient.post('/mp/tag/create', data);
|
||||
}
|
||||
|
||||
/** 更新公众号标签 */
|
||||
export function updateTag(data: MpTagApi.Tag) {
|
||||
return requestClient.put('/mp/tag/update', data);
|
||||
}
|
||||
|
||||
/** 删除公众号标签 */
|
||||
export function deleteTag(id: number) {
|
||||
return requestClient.delete('/mp/tag/delete', {
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取公众号标签 */
|
||||
export function getTag(id: number) {
|
||||
return requestClient.get<MpTagApi.Tag>('/mp/tag/get', {
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取公众号标签分页 */
|
||||
export function getTagPage(params: MpTagApi.TagPageQuery) {
|
||||
return requestClient.get<PageResult<MpTagApi.Tag>>('/mp/tag/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取公众号标签精简信息列表 */
|
||||
export function getSimpleTagList() {
|
||||
return requestClient.get<MpTagApi.Tag[]>('/mp/tag/list-all-simple');
|
||||
}
|
||||
|
||||
/** 同步公众号标签 */
|
||||
export function syncTag(accountId: number) {
|
||||
return requestClient.post('/mp/tag/sync', null, {
|
||||
params: { accountId },
|
||||
});
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MpUserApi {
|
||||
/** 用户信息 */
|
||||
export interface User {
|
||||
id?: number;
|
||||
accountId: number;
|
||||
openid: string;
|
||||
nickname: string;
|
||||
avatar: string;
|
||||
sex: number;
|
||||
country: string;
|
||||
province: string;
|
||||
city: string;
|
||||
language: string;
|
||||
subscribe: boolean;
|
||||
subscribeTime?: Date;
|
||||
remark?: string;
|
||||
tagIds?: number[];
|
||||
createTime?: Date;
|
||||
}
|
||||
|
||||
/** 用户分页查询参数 */
|
||||
export interface UserPageQuery extends PageParam {
|
||||
accountId?: number;
|
||||
nickname?: string;
|
||||
tagId?: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 更新公众号粉丝 */
|
||||
export function updateUser(data: MpUserApi.User) {
|
||||
return requestClient.put('/mp/user/update', data);
|
||||
}
|
||||
|
||||
/** 获取公众号粉丝 */
|
||||
export function getUser(id: number) {
|
||||
return requestClient.get<MpUserApi.User>('/mp/user/get', {
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取公众号粉丝分页 */
|
||||
export function getUserPage(params: MpUserApi.UserPageQuery) {
|
||||
return requestClient.get<PageResult<MpUserApi.User>>('/mp/user/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 同步公众号粉丝 */
|
||||
export function syncUser(accountId: number) {
|
||||
return requestClient.post('/mp/user/sync', null, {
|
||||
params: { accountId },
|
||||
});
|
||||
}
|
|
@ -50,16 +50,6 @@ export function useFormSchema(): VbenFormSchema[] {
|
|||
label: '备注',
|
||||
component: 'Textarea',
|
||||
},
|
||||
{
|
||||
fieldName: 'contactNextTime',
|
||||
label: '下次联系时间',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: false,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'x',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -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' },
|
||||
},
|
||||
];
|
||||
}
|
|
@ -1,31 +1,194 @@
|
|||
<script lang="ts" setup>
|
||||
import { Page } from '@vben/common-ui';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { MpAccountApi } from '#/api/mp/account';
|
||||
|
||||
import { Button } from 'ant-design-vue';
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { DocAlert } from '#/components/doc-alert';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
clearAccountQuota,
|
||||
deleteAccount,
|
||||
generateAccountQrCode,
|
||||
getAccountPage,
|
||||
} from '#/api/mp/account';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
import Form from './modules/form.vue';
|
||||
|
||||
const [FormModal, formModalApi] = useVbenModal({
|
||||
connectedComponent: Form,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
/** 刷新表格 */
|
||||
function onRefresh() {
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
/** 创建账号 */
|
||||
function handleCreate() {
|
||||
formModalApi.setData(null).open();
|
||||
}
|
||||
|
||||
/** 编辑账号 */
|
||||
function handleEdit(row: MpAccountApi.Account) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除账号 */
|
||||
async function handleDelete(row: MpAccountApi.Account) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
key: 'action_key_msg',
|
||||
});
|
||||
try {
|
||||
await deleteAccount(row.id as number);
|
||||
message.success({
|
||||
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
|
||||
key: 'action_key_msg',
|
||||
});
|
||||
onRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
/** 生成二维码 */
|
||||
async function handleGenerateQrCode(row: MpAccountApi.Account) {
|
||||
const hideLoading = message.loading({
|
||||
content: '生成二维码',
|
||||
key: 'action_key_msg',
|
||||
});
|
||||
try {
|
||||
await generateAccountQrCode(row.id as number);
|
||||
message.success({
|
||||
content: '生成二维码成功',
|
||||
key: 'action_key_msg',
|
||||
});
|
||||
onRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
/** 清空 API 配额 */
|
||||
async function handleCleanQuota(row: MpAccountApi.Account) {
|
||||
const hideLoading = message.loading({
|
||||
content: '清空 API 配额',
|
||||
key: 'action_key_msg',
|
||||
});
|
||||
try {
|
||||
await clearAccountQuota(row.id as number);
|
||||
message.success({
|
||||
content: '清空 API 配额成功',
|
||||
key: 'action_key_msg',
|
||||
});
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
formOptions: {
|
||||
schema: useGridFormSchema(),
|
||||
},
|
||||
gridOptions: {
|
||||
columns: useGridColumns(),
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
return await getAccountPage({
|
||||
pageNo: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
toolbarConfig: {
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<MpAccountApi.Account>,
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page>
|
||||
<DocAlert title="公众号接入" url="https://doc.iocoder.cn/mp/account/" />
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
target="_blank"
|
||||
href="https://github.com/yudaocode/yudao-ui-admin-vue3"
|
||||
>
|
||||
该功能支持 Vue3 + element-plus 版本!
|
||||
</Button>
|
||||
<br />
|
||||
<Button
|
||||
type="link"
|
||||
target="_blank"
|
||||
href="https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/mp/account/index"
|
||||
>
|
||||
可参考
|
||||
https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/mp/account/index
|
||||
代码,pull request 贡献给我们!
|
||||
</Button>
|
||||
<Page auto-content-height>
|
||||
<FormModal @success="onRefresh" />
|
||||
<Grid table-title="公众号账号列表">
|
||||
<template #toolbar-tools>
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('ui.actionTitle.create', ['公众号账号']),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.ADD,
|
||||
auth: ['mp:account:create'],
|
||||
onClick: handleCreate,
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
<template #qrCodeUrl="{ row }">
|
||||
<a v-if="row.qrCodeUrl" :href="row.qrCodeUrl" target="_blank">
|
||||
<img :src="row.qrCodeUrl" alt="二维码" />
|
||||
</a>
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: '生成二维码',
|
||||
type: 'link',
|
||||
icon: 'qrcode',
|
||||
auth: ['mp:account:qr-code'],
|
||||
onClick: handleGenerateQrCode.bind(null, row),
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
<template #actions="{ row }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('common.edit'),
|
||||
type: 'link',
|
||||
icon: ACTION_ICON.EDIT,
|
||||
auth: ['mp:account:update'],
|
||||
onClick: handleEdit.bind(null, row),
|
||||
},
|
||||
{
|
||||
label: $t('common.delete'),
|
||||
type: 'link',
|
||||
danger: true,
|
||||
icon: ACTION_ICON.DELETE,
|
||||
auth: ['mp:account:delete'],
|
||||
popConfirm: {
|
||||
title: $t('ui.actionMessage.deleteConfirm', [row.name]),
|
||||
confirm: handleDelete.bind(null, row),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '清空 API 配额',
|
||||
type: 'link',
|
||||
danger: true,
|
||||
icon: ACTION_ICON.DELETE,
|
||||
auth: ['mp:account:clear-quota'],
|
||||
popConfirm: {
|
||||
title: '清空 API 配额',
|
||||
confirm: handleCleanQuota.bind(null, row),
|
||||
},
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</Grid>
|
||||
</Page>
|
||||
</template>
|
||||
|
|
|
@ -0,0 +1,82 @@
|
|||
<script lang="ts" setup>
|
||||
import type { MpAccountApi } from '#/api/mp/account';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { createAccount, getAccount, updateAccount } from '#/api/mp/account';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<MpAccountApi.Account>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['公众号账号'])
|
||||
: $t('ui.actionTitle.create', ['公众号账号']);
|
||||
});
|
||||
|
||||
const [Form, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
},
|
||||
formItemClass: 'col-span-2',
|
||||
labelWidth: 120,
|
||||
},
|
||||
layout: 'horizontal',
|
||||
schema: useFormSchema(),
|
||||
showDefaultActions: false,
|
||||
});
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onConfirm() {
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as MpAccountApi.Account;
|
||||
try {
|
||||
await (formData.value?.id ? updateAccount(data) : createAccount(data));
|
||||
// 关闭并提示
|
||||
await modalApi.close();
|
||||
emit('success');
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
if (!isOpen) {
|
||||
formData.value = undefined;
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<MpAccountApi.Account>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
try {
|
||||
formData.value = await getAccount(data.id as number);
|
||||
// 设置到 values
|
||||
await formApi.setValues(formData.value);
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Modal class="w-[600px]" :title="getTitle">
|
||||
<Form class="mx-4" />
|
||||
</Modal>
|
||||
</template>
|
|
@ -0,0 +1,63 @@
|
|||
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: 'accountId',
|
||||
label: '公众号',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
triggerFields: [''],
|
||||
show: () => false,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'name',
|
||||
label: '标签名称',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
componentProps: {
|
||||
placeholder: '请输入名称',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 表格列配置 */
|
||||
export function useGridColumns(): VxeGridPropTypes.Columns {
|
||||
return [
|
||||
{
|
||||
title: '编号',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '标签名称',
|
||||
field: 'name',
|
||||
},
|
||||
{
|
||||
title: '粉丝数',
|
||||
field: 'count',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 140,
|
||||
fixed: 'right',
|
||||
slots: { default: 'actions' },
|
||||
},
|
||||
];
|
||||
}
|
|
@ -1,31 +1,198 @@
|
|||
<script lang="ts" setup>
|
||||
import { Page } from '@vben/common-ui';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { MpTagApi } from '#/api/mp/tag';
|
||||
|
||||
import { Button } from 'ant-design-vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { DocAlert } from '#/components/doc-alert';
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
import { useTabs } from '@vben/hooks';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { getSimpleAccountList } from '#/api/mp/account';
|
||||
import { deleteTag, getTagPage, syncTag } from '#/api/mp/tag';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useGridColumns } from './data';
|
||||
import Form from './modules/form.vue';
|
||||
|
||||
const { push } = useRouter(); // 路由
|
||||
const tabs = useTabs();
|
||||
|
||||
const accountId = ref(-1);
|
||||
const accountOptions = ref<{ label: string; value: number }[]>([]);
|
||||
|
||||
const [FormModal, formModalApi] = useVbenModal({
|
||||
connectedComponent: Form,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
async function getAccountList() {
|
||||
const res = await getSimpleAccountList();
|
||||
if (res.length > 0) {
|
||||
accountId.value = res[0]?.id as number;
|
||||
accountOptions.value = res.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
gridApi.setState({
|
||||
formOptions: {
|
||||
schema: [
|
||||
{
|
||||
fieldName: 'accountId',
|
||||
label: '公众号',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: accountOptions,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
gridApi.formApi.setValues({
|
||||
accountId: accountId.value,
|
||||
});
|
||||
} else {
|
||||
message.error('未配置公众号,请在【公众号管理 -> 账号管理】菜单,进行配置');
|
||||
await push({ name: 'MpAccount' });
|
||||
tabs.closeCurrentTab();
|
||||
}
|
||||
}
|
||||
/** 刷新表格 */
|
||||
function onRefresh() {
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
/** 创建标签 */
|
||||
function handleCreate() {
|
||||
formModalApi.setData({ accountId: accountId.value }).open();
|
||||
}
|
||||
|
||||
/** 编辑标签 */
|
||||
function handleEdit(row: MpTagApi.Tag) {
|
||||
formModalApi.setData({ row, accountId: accountId.value }).open();
|
||||
}
|
||||
|
||||
/** 删除标签 */
|
||||
async function handleDelete(row: MpTagApi.Tag) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
key: 'action_key_msg',
|
||||
});
|
||||
try {
|
||||
await deleteTag(row.id as number);
|
||||
message.success({
|
||||
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
|
||||
key: 'action_key_msg',
|
||||
});
|
||||
onRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
/** 同步标签 */
|
||||
async function handleSync() {
|
||||
const hideLoading = message.loading({
|
||||
content: '是否确认同步标签?',
|
||||
key: 'action_key_msg',
|
||||
});
|
||||
try {
|
||||
await syncTag(accountId.value);
|
||||
message.success({
|
||||
content: '同步标签成功',
|
||||
key: 'action_key_msg',
|
||||
});
|
||||
onRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
formOptions: {
|
||||
schema: [],
|
||||
},
|
||||
gridOptions: {
|
||||
columns: useGridColumns(),
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
accountId.value = formValues.accountId;
|
||||
return await getTagPage({
|
||||
pageNo: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
toolbarConfig: {
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<MpTagApi.Tag>,
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await getAccountList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page>
|
||||
<DocAlert title="公众号标签" url="https://doc.iocoder.cn/mp/tag/" />
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
target="_blank"
|
||||
href="https://github.com/yudaocode/yudao-ui-admin-vue3"
|
||||
>
|
||||
该功能支持 Vue3 + element-plus 版本!
|
||||
</Button>
|
||||
<br />
|
||||
<Button
|
||||
type="link"
|
||||
target="_blank"
|
||||
href="https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/mp/tag/index"
|
||||
>
|
||||
可参考
|
||||
https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/views/mp/tag/index
|
||||
代码,pull request 贡献给我们!
|
||||
</Button>
|
||||
<Page auto-content-height>
|
||||
<FormModal @success="onRefresh" />
|
||||
<Grid table-title="公众号账号列表">
|
||||
<template #toolbar-tools>
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('ui.actionTitle.create', ['公众号账号']),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.ADD,
|
||||
auth: ['mp:tag:create'],
|
||||
onClick: handleCreate,
|
||||
},
|
||||
{
|
||||
label: '同步',
|
||||
type: 'primary',
|
||||
icon: 'lucide:refresh-ccw',
|
||||
auth: ['mp:tag:sync'],
|
||||
onClick: handleSync,
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
<template #actions="{ row }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('common.edit'),
|
||||
type: 'link',
|
||||
icon: ACTION_ICON.EDIT,
|
||||
auth: ['mp:tag:update'],
|
||||
onClick: handleEdit.bind(null, row),
|
||||
},
|
||||
{
|
||||
label: $t('common.delete'),
|
||||
type: 'link',
|
||||
danger: true,
|
||||
icon: ACTION_ICON.DELETE,
|
||||
auth: ['mp:tag:delete'],
|
||||
popConfirm: {
|
||||
title: $t('ui.actionMessage.deleteConfirm', [row.name]),
|
||||
confirm: handleDelete.bind(null, row),
|
||||
},
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</Grid>
|
||||
</Page>
|
||||
</template>
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
<script lang="ts" setup>
|
||||
import type { MpTagApi } from '#/api/mp/tag';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { createTag, getTag, updateTag } from '#/api/mp/tag';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
|
||||
const formData = ref<MpTagApi.Tag>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['标签'])
|
||||
: $t('ui.actionTitle.create', ['标签']);
|
||||
});
|
||||
|
||||
const [Form, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
},
|
||||
formItemClass: 'col-span-2',
|
||||
labelWidth: 120,
|
||||
},
|
||||
layout: 'horizontal',
|
||||
schema: useFormSchema(),
|
||||
showDefaultActions: false,
|
||||
});
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onConfirm() {
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as MpTagApi.Tag;
|
||||
try {
|
||||
await (formData.value?.id ? updateTag(data) : createTag(data));
|
||||
// 关闭并提示
|
||||
await modalApi.close();
|
||||
emit('success');
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
if (!isOpen) {
|
||||
formData.value = undefined;
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<{ accountId: number; row: MpTagApi.Tag }>();
|
||||
if (!data || !data.row || !data.accountId) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
try {
|
||||
formData.value = await getTag(data.row.id as number);
|
||||
// 设置到 values
|
||||
await formApi.setValues(formData.value);
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Modal class="w-[600px]" :title="getTitle">
|
||||
<Form class="mx-4" />
|
||||
</Modal>
|
||||
</template>
|
|
@ -34,7 +34,6 @@ const props = withDefaults(defineProps<AlertProps>(), {
|
|||
bordered: true,
|
||||
buttonAlign: 'end',
|
||||
centered: true,
|
||||
containerClass: 'w-[520px]',
|
||||
});
|
||||
const emits = defineEmits(['closed', 'confirm', 'opened']);
|
||||
const open = defineModel<boolean>('open', { default: false });
|
||||
|
@ -148,7 +147,7 @@ async function handleOpenChange(val: boolean) {
|
|||
:class="
|
||||
cn(
|
||||
containerClass,
|
||||
'left-0 right-0 mx-auto flex max-h-[80%] flex-col p-0 duration-300 sm:rounded-[var(--radius)] md:w-[520px] md:max-w-[80%]',
|
||||
'left-0 right-0 mx-auto flex max-h-[80%] flex-col p-0 duration-300 sm:w-[520px] sm:max-w-[80%] sm:rounded-[var(--radius)]',
|
||||
{
|
||||
'border-border border': bordered,
|
||||
'shadow-3xl': !bordered,
|
||||
|
|
|
@ -80,7 +80,7 @@ defineExpose({
|
|||
v-bind="forwarded"
|
||||
:class="
|
||||
cn(
|
||||
'z-popup bg-background w-full p-6 shadow-lg outline-none sm:rounded-xl',
|
||||
'z-popup bg-background p-6 shadow-lg outline-none sm:rounded-xl',
|
||||
'data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
|
||||
'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95',
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue