feat: 通知管理接口
This commit is contained in:
parent
6b5bd5ee25
commit
841fa8433a
|
|
@ -1,15 +1,37 @@
|
||||||
import { patch, post, get } from '@/utils/request'
|
import { patch, post, get, remove } from '@/utils/request'
|
||||||
import { BindConfig } from '@/views/notice/Template/types'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// 列表
|
// 列表
|
||||||
list: (data: any) => post(`/notifier/config/_query`, data),
|
list: (data: any) => post(`/notifier/config/_query`, data),
|
||||||
// 不分页列表
|
|
||||||
listNoPage: (data: any) => post<BindConfig>(`/notifier/config/_query/no-paging?paging=false`, data),
|
|
||||||
// 详情
|
// 详情
|
||||||
detail: (id: string): any => get(`/notifier/config/${id}`),
|
detail: (id: string): any => get(`/notifier/config/${id}`),
|
||||||
// 新增
|
// 新增
|
||||||
save: (data: any) => post(`/notifier/config`, data),
|
save: (data: any) => post(`/notifier/config`, data),
|
||||||
// 修改
|
// 修改
|
||||||
update: (data: any) => patch(`/notifier/config`, data)
|
update: (data: any) => patch(`/notifier/config`, data),
|
||||||
|
del: (id: string) => remove(`/notifier/config/${id}`),
|
||||||
|
getTemplate: (data: any, id: string) => post(`/notifier/template/${id}/_query`, data),
|
||||||
|
getTemplateDetail: (id: string) => get(`/notifier/template/${id}/detail`),
|
||||||
|
debug: (data: any, configId: string, templateId: string) => post(`/notifier/${configId}/${templateId}/_send`, data),
|
||||||
|
getHistory: (data: any, id: string) => post(`/notify/history/config/${id}/_query`, data),
|
||||||
|
// 获取所有平台用户
|
||||||
|
getPlatformUsers: () => post(`/user/_query/no-paging`, { paging: false }),
|
||||||
|
// 钉钉部门
|
||||||
|
dingTalkDept: (id: string) => get(`/notifier/dingtalk/corp/${id}/departments/tree`),
|
||||||
|
// 钉钉部门人员
|
||||||
|
getDingTalkUsers: (configId: string, deptId: string) => get(`/notifier/dingtalk/corp/${configId}/${deptId}/users`),
|
||||||
|
// 钉钉已经绑定的人员
|
||||||
|
getDingTalkBindUsers: (id: string) => get(`/user/third-party/dingTalk_dingTalkMessage/${id}`),
|
||||||
|
// 钉钉绑定用户
|
||||||
|
dingTalkBindUser: (data: any, id: string) => patch(`/user/third-party/dingTalk_dingTalkMessage/${id}`, data),
|
||||||
|
// 微信部门
|
||||||
|
weChatDept: (id: string) => get(`/notifier/wechat/corp/${id}/departments`),
|
||||||
|
// 微信部门人员
|
||||||
|
getWeChatUsers: (configId: string, deptId: string) => get(`/notifier/wechat/corp/${configId}/${deptId}/users`),
|
||||||
|
// 微信已经绑定的人员
|
||||||
|
getWeChatBindUsers: (id: string) => get(`/user/third-party/weixin_corpMessage/${id}`),
|
||||||
|
// 微信绑定用户
|
||||||
|
weChatBindUser: (data: any, id: string) => patch(`/user/third-party/weixin_corpMessage/${id}`, data),
|
||||||
|
// 解绑
|
||||||
|
unBindUser: (data: any, id: string) => post(`/user/third-party/${id}/_unbind`, data)
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { patch, post, get } from '@/utils/request'
|
import { patch, post, get, remove } from '@/utils/request'
|
||||||
|
import { BindConfig } from '@/views/notice/Template/types'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// 列表
|
// 列表
|
||||||
|
|
@ -8,5 +9,19 @@ export default {
|
||||||
// 新增
|
// 新增
|
||||||
save: (data: any) => post(`/notifier/template`, data),
|
save: (data: any) => post(`/notifier/template`, data),
|
||||||
// 修改
|
// 修改
|
||||||
update: (data: any) => patch(`/notifier/template`, data)
|
update: (data: any) => patch(`/notifier/template`, data),
|
||||||
|
del: (id: any) => remove(`/notifier/template/${id}`),
|
||||||
|
getConfig: (data: any) => post<BindConfig>(`/notifier/config/_query/no-paging?paging=false`, data),
|
||||||
|
getTemplateDetail: (id: string) => get(`/notifier/template/${id}/detail`),
|
||||||
|
debug: (data: any, configId: string, templateId: string) => post(`/notifier/${configId}/${templateId}/_send`, data),
|
||||||
|
getHistory: (data: any, id: string) => post(`/notify/history/template/${id}/_query`, data),
|
||||||
|
// 钉钉/微信, 根据配置获取部门和用户
|
||||||
|
getDept: (type: string, id: string) => get(`/notifier/${type}/corp/${id}/departments`),
|
||||||
|
getUser: (type: string, id: string) => get(`/notifier/${type}/corp/${id}/users`),
|
||||||
|
// 微信获取标签推送
|
||||||
|
getTags: (id: string) => get(`/notifier/wechat/corp/${id}/tags`),
|
||||||
|
// 语音/短信获取阿里云模板
|
||||||
|
getAliTemplate: (id: string) => get(`/notifier/sms/aliyun/${id}/templates`),
|
||||||
|
// 短信获取签名
|
||||||
|
getSigns: (id: string) => get(`/notifier/sms/aliyun/${id}/signs`)
|
||||||
}
|
}
|
||||||
|
|
@ -121,8 +121,7 @@
|
||||||
>
|
>
|
||||||
<!-- <a-input
|
<!-- <a-input
|
||||||
v-model:value="
|
v-model:value="
|
||||||
formData.template.markdown
|
formData.template.markdown?.title
|
||||||
?.title
|
|
||||||
"
|
"
|
||||||
placeholder="请输入标题"
|
placeholder="请输入标题"
|
||||||
/> -->
|
/> -->
|
||||||
|
|
@ -483,7 +482,6 @@ import {
|
||||||
VOICE_TYPE,
|
VOICE_TYPE,
|
||||||
} from '@/views/notice/const';
|
} from '@/views/notice/const';
|
||||||
import templateApi from '@/api/notice/template';
|
import templateApi from '@/api/notice/template';
|
||||||
import configApi from '@/api/notice/config';
|
|
||||||
import Doc from './doc/index';
|
import Doc from './doc/index';
|
||||||
import MonacoEditor from '@/components/MonacoEditor/index.vue';
|
import MonacoEditor from '@/components/MonacoEditor/index.vue';
|
||||||
import Attachments from './components/Attachments.vue';
|
import Attachments from './components/Attachments.vue';
|
||||||
|
|
@ -627,7 +625,7 @@ const getConfigList = async () => {
|
||||||
{ column: 'type$IN', value: formData.value.type },
|
{ column: 'type$IN', value: formData.value.type },
|
||||||
{ column: 'provider', value: formData.value.provider },
|
{ column: 'provider', value: formData.value.provider },
|
||||||
];
|
];
|
||||||
const { result } = await configApi.listNoPage({ terms });
|
const { result } = await templateApi.getConfig({ terms });
|
||||||
configList.value = result;
|
configList.value = result;
|
||||||
};
|
};
|
||||||
getConfigList();
|
getConfigList();
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,17 @@ interface IVariableDefinitions {
|
||||||
format: string;
|
format: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface IMarkDown {
|
||||||
|
text: string;
|
||||||
|
title: string;
|
||||||
|
}
|
||||||
|
interface ILink {
|
||||||
|
title: string;
|
||||||
|
picUrl: string;
|
||||||
|
messageUrl: string;
|
||||||
|
text: string;
|
||||||
|
}
|
||||||
|
|
||||||
export type TemplateFormData = {
|
export type TemplateFormData = {
|
||||||
template: {
|
template: {
|
||||||
// 钉钉消息
|
// 钉钉消息
|
||||||
|
|
@ -23,16 +34,8 @@ export type TemplateFormData = {
|
||||||
message?: string;
|
message?: string;
|
||||||
// 钉钉机器人
|
// 钉钉机器人
|
||||||
messageType?: string;
|
messageType?: string;
|
||||||
markdown?: {
|
markdown?: IMarkDown;
|
||||||
text: string;
|
link?: ILink;
|
||||||
title: string;
|
|
||||||
};
|
|
||||||
link?: {
|
|
||||||
title: string;
|
|
||||||
picUrl: string;
|
|
||||||
messageUrl: string;
|
|
||||||
text: string;
|
|
||||||
};
|
|
||||||
// 微信
|
// 微信
|
||||||
// agentId?: string;
|
// agentId?: string;
|
||||||
// message?: string;
|
// message?: string;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue