From 83a18d21c0ac8ed3711dec3bf2cf0aa099233a68 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Tue, 17 Jan 2023 15:52:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=85=8D=E7=BD=AE=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MonacoEditor/index.vue | 3 +- src/views/notice/Template/Detail/index.vue | 569 +++++++++++++-------- src/views/notice/Template/index.vue | 16 +- src/views/notice/Template/types.d.ts | 19 +- src/views/notice/const.ts | 18 +- 5 files changed, 406 insertions(+), 219 deletions(-) diff --git a/src/components/MonacoEditor/index.vue b/src/components/MonacoEditor/index.vue index 9af9c3b1..4ec0f91d 100644 --- a/src/components/MonacoEditor/index.vue +++ b/src/components/MonacoEditor/index.vue @@ -32,6 +32,7 @@ self.MonacoEnvironment = { const props = defineProps({ modelValue: [String, Number], + theme: { type: String, default: 'vs-dark' }, }); const emit = defineEmits(['update:modelValue']); @@ -48,7 +49,7 @@ onMounted(() => { tabSize: 2, automaticLayout: true, scrollBeyondLastLine: false, - theme: 'vs-dark', // 主题色: vs(默认高亮), vs-dark(黑色), hc-black(高亮黑色) + theme: props.theme, // 主题色: vs(默认高亮), vs-dark(黑色), hc-black(高亮黑色) }); instance.onDidChangeModelContent(() => { diff --git a/src/views/notice/Template/Detail/index.vue b/src/views/notice/Template/Detail/index.vue index e4a6bdc6..5a22ec3e 100644 --- a/src/views/notice/Template/Detail/index.vue +++ b/src/views/notice/Template/Detail/index.vue @@ -31,40 +31,46 @@ + + + + {{ item.label }} + + + + + - - - + diff --git a/src/views/notice/Template/types.d.ts b/src/views/notice/Template/types.d.ts index 664ab4c9..a505514a 100644 --- a/src/views/notice/Template/types.d.ts +++ b/src/views/notice/Template/types.d.ts @@ -16,14 +16,6 @@ interface IVariableDefinitions { } export type TemplateFormData = { - name: string; - type: string; - provider: string; - description: string; - id?: string; - creatorId?: string; - createTime?: number; - configId?: string; template: { // 钉钉消息 agentId?: string; @@ -41,7 +33,7 @@ export type TemplateFormData = { text: string; }; // 微信 - agentId?: string; + // agentId?: string; // message?: string; toParty?: string; toUser?: string; @@ -69,6 +61,13 @@ export type TemplateFormData = { contextAsBody?: boolean; body?: string; }; + name: string; + type: string; + provider: string; + description: string; variableDefinitions: IVariableDefinitions[]; - + id?: string; + creatorId?: string; + createTime?: number; + configId?: string; }; \ No newline at end of file diff --git a/src/views/notice/const.ts b/src/views/notice/const.ts index ec814842..9bd71ca6 100644 --- a/src/views/notice/const.ts +++ b/src/views/notice/const.ts @@ -33,7 +33,7 @@ export const NOTICE_METHOD: INoticeMethod[] = [ }, ]; -// 消息类型 +// 类型 export const MSG_TYPE = { dingTalk: [ { @@ -203,8 +203,20 @@ export const TEMPLATE_FIELD_MAP = { }, webhook: { http: { - contextAsBody: false, + contextAsBody: true, body: '' } }, -}; \ No newline at end of file +}; + +// 钉钉机器人-消息类型 +export const ROBOT_MSG_TYPE = [ + { label: 'markdown', value: 'markdown' }, + { label: 'text', value: 'text' }, + { label: 'link', value: 'link' }, +] +// 语音通知类型 +export const VOICE_TYPE = [ + { label: '语音通知', value: 'voice' }, + { label: '语音验证码', value: 'tts' }, +] \ No newline at end of file