diff --git a/components.d.ts b/components.d.ts index 40a545e5..68ac7aef 100644 --- a/components.d.ts +++ b/components.d.ts @@ -7,12 +7,44 @@ export {} declare module '@vue/runtime-core' { export interface GlobalComponents { + AAlert: typeof import('ant-design-vue/es')['Alert'] + ABadge: typeof import('ant-design-vue/es')['Badge'] + AButton: typeof import('ant-design-vue/es')['Button'] + ACard: typeof import('ant-design-vue/es')['Card'] + ACheckbox: typeof import('ant-design-vue/es')['Checkbox'] + ACheckboxGroup: typeof import('ant-design-vue/es')['CheckboxGroup'] + ACol: typeof import('ant-design-vue/es')['Col'] + ADatePicker: typeof import('ant-design-vue/es')['DatePicker'] + AEmpty: typeof import('ant-design-vue/es')['Empty'] + AForm: typeof import('ant-design-vue/es')['Form'] + AFormItem: typeof import('ant-design-vue/es')['FormItem'] + AInput: typeof import('ant-design-vue/es')['Input'] + AInputNumber: typeof import('ant-design-vue/es')['InputNumber'] + AInputPassword: typeof import('ant-design-vue/es')['InputPassword'] + AModal: typeof import('ant-design-vue/es')['Modal'] + APagination: typeof import('ant-design-vue/es')['Pagination'] + APopconfirm: typeof import('ant-design-vue/es')['Popconfirm'] + ARadioButton: typeof import('ant-design-vue/es')['RadioButton'] + ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup'] + ARow: typeof import('ant-design-vue/es')['Row'] + ASelect: typeof import('ant-design-vue/es')['Select'] + ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] + ASpace: typeof import('ant-design-vue/es')['Space'] + ASpin: typeof import('ant-design-vue/es')['Spin'] + ASwitch: typeof import('ant-design-vue/es')['Switch'] + ATable: typeof import('ant-design-vue/es')['Table'] + ATextarea: typeof import('ant-design-vue/es')['Textarea'] + ATimePicker: typeof import('ant-design-vue/es')['TimePicker'] + ATooltip: typeof import('ant-design-vue/es')['Tooltip'] + ATreeSelect: typeof import('ant-design-vue/es')['TreeSelect'] + AUpload: typeof import('ant-design-vue/es')['Upload'] BadgeStatus: typeof import('./src/components/BadgeStatus/index.vue')['default'] CardBox: typeof import('./src/components/CardBox/index.vue')['default'] FormFormBuilder: typeof import('./src/components/Form/FormBuilder.vue')['default'] GeoComponent: typeof import('./src/components/GeoComponent/index.vue')['default'] MonacoEditor: typeof import('./src/components/MonacoEditor/index.vue')['default'] PermissionButton: typeof import('./src/components/PermissionButton/index.vue')['default'] + RadioCard: typeof import('./src/components/RadioCard/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] SearchItem: typeof import('./src/components/Search/Item.vue')['default'] diff --git a/src/components/RadioCard/index.vue b/src/components/RadioCard/index.vue new file mode 100644 index 00000000..2d27ba0b --- /dev/null +++ b/src/components/RadioCard/index.vue @@ -0,0 +1,71 @@ + + + + + + diff --git a/src/router/menu.ts b/src/router/menu.ts index 8bb794ae..6936fb5f 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -48,6 +48,22 @@ export default [ path: '/search', component: () => import('@/views/demo/Search.vue') }, + { + path: '/notice/Config', + component: () => import('@/views/notice/Config/index.vue') + }, + { + path: '/notice/Config/detail/:id', + component: () => import('@/views/notice/Config/Detail/index.vue') + }, + { + path: '/notice/Template', + component: () => import('@/views/notice/Template/index.vue') + }, + { + path: '/notice/Template/detail/:id', + component: () => import('@/views/notice/Template/Detail/index.vue') + }, // end: 测试用, 可删除 // link 运维管理 @@ -73,7 +89,7 @@ export default [ }, // 初始化 { - path: '/init-home', - component: () => import('@/views/init-home/index.vue') - }, + path: '/init-home', + component: () => import('@/views/init-home/index.vue') + }, ] \ No newline at end of file diff --git a/src/views/notice/Config/Detail/index.vue b/src/views/notice/Config/Detail/index.vue new file mode 100644 index 00000000..c39d92be --- /dev/null +++ b/src/views/notice/Config/Detail/index.vue @@ -0,0 +1,405 @@ + + + + + + diff --git a/src/views/notice/Config/Detail/regionId.ts b/src/views/notice/Config/Detail/regionId.ts new file mode 100644 index 00000000..2437c5f7 --- /dev/null +++ b/src/views/notice/Config/Detail/regionId.ts @@ -0,0 +1,119 @@ +// 数据来源 https://help.aliyun.com/document_detail/188196.html +export default [ + /** 公共云 */ + //中国地区(包含中国香港、中国澳门,不包含中国台湾) + { + value: 'cn-qingdao', + label: '华北1(青岛)', + }, + { + value: 'cn-beijing', + label: '华北2(北京)', + }, + { + value: 'cn-zhangjiakou', + label: '华北3(张家口)', + }, + { + value: 'cn-huhehaote', + label: '华北5(呼和浩特)', + }, + { + value: 'cn-wulanchabu', + label: '华北6(乌兰察布)', + }, + { + value: 'cn-hangzhou', + label: '华东1(杭州)', + }, + { + value: 'cn-shanghai', + label: '华东2(上海)', + }, + { + value: 'cn-nanjing', + label: '华东5 (南京-本地地域)', + }, + { + value: 'cn-fuzhou', + label: '华东6(福州-本地地域)', + }, + { + value: 'cn-shenzhen', + label: '华南1(深圳)', + }, + { + value: 'cn-heyuan', + label: '华南2(河源)', + }, + { + value: 'cn-guangzhou', + label: '华南3(广州)', + }, + { + value: 'cn-chengdu', + label: '西南1(成都)', + }, + { + value: 'cn-hongkong', + label: '中国香港', + }, + + //其他国家和地区 + { + value: 'ap-southeast-1', + label: '新加坡', + }, + { + value: 'ap-southeast-2', + label: '澳大利亚(悉尼)', + }, + { + value: 'ap-southeast-3', + label: '马来西亚(吉隆坡)', + }, + { + value: 'ap-southeast-5', + label: '印度尼西亚(雅加达)', + }, + { + value: 'ap-southeast-6', + label: '菲律宾(马尼拉)', + }, + { + value: 'ap-southeast-7', + label: '泰国(曼谷)', + }, + { + value: 'ap-south-1', + label: '印度(孟买)', + }, + { + value: 'ap-northeast-1', + label: '日本(东京)', + }, + { + value: 'ap-northeast-2', + label: '韩国(首尔)', + }, + { + value: 'us-west-1', + label: '美国(硅谷)', + }, + { + value: 'us-east-1', + label: '美国(弗吉尼亚)', + }, + { + value: 'eu-central-1', + label: '德国(法兰克福)', + }, + { + value: 'eu-west-1', + label: '英国(伦敦)', + }, + { + value: 'me-east-1', + label: '阿联酋(迪拜)', + }, +]; diff --git a/src/views/notice/Config/index.vue b/src/views/notice/Config/index.vue new file mode 100644 index 00000000..c45743e0 --- /dev/null +++ b/src/views/notice/Config/index.vue @@ -0,0 +1,8 @@ + + + + + + diff --git a/src/views/notice/Config/types.d.ts b/src/views/notice/Config/types.d.ts new file mode 100644 index 00000000..4c0f1d6f --- /dev/null +++ b/src/views/notice/Config/types.d.ts @@ -0,0 +1,37 @@ +interface IHeaders { + key: string; + value: string; +} +export type ConfigFormData = { + configuration: { + // 钉钉 + appKey?: string; + appSecret?: string; + url?: string; + // 微信 + corpId?: string; + corpSecret?: string; + // 邮件 + host?: string; + port?: number; + ssl?: boolean; + sender?: string; + username?: string; + password?: string; + // 语音 + regionId?: string; + accessKeyId?: string; + secret?: string; + // 短信 + regionId?: string; + accessKeyId?: string; + secret?: string; + // webhook + // url?: string; + headers?: IHeaders[]; + }; + description: string; + name: string; + provider: string; + type: string; +}; diff --git a/src/views/notice/Template/Detail/index.vue b/src/views/notice/Template/Detail/index.vue new file mode 100644 index 00000000..c2a1ee68 --- /dev/null +++ b/src/views/notice/Template/Detail/index.vue @@ -0,0 +1,8 @@ + + + + + + diff --git a/src/views/notice/Template/index.vue b/src/views/notice/Template/index.vue new file mode 100644 index 00000000..93e4d46b --- /dev/null +++ b/src/views/notice/Template/index.vue @@ -0,0 +1,8 @@ + + + + + + diff --git a/src/views/notice/const.ts b/src/views/notice/const.ts new file mode 100644 index 00000000..47a86c03 --- /dev/null +++ b/src/views/notice/const.ts @@ -0,0 +1,126 @@ +import { getImage } from '@/utils/comm'; + +interface INoticeMethod { + label: string; + value: string; +} + +// 通知方式 +export const NOTICE_METHOD: INoticeMethod[] = [ + { + label: '钉钉', + value: 'dingTalk', + }, + { + label: '微信', + value: 'weixin', + }, + { + label: '邮件', + value: 'email', + }, + { + label: '语音', + value: 'voice', + }, + { + label: '短信', + value: 'sms', + }, + { + label: 'webhook', + value: 'webhook', + }, +]; + +// 消息类型 +export const MSG_TYPE = { + dingTalk: [ + { + label: '钉钉消息', + value: 'dingTalkMessage', + logo: getImage('/notice/dingtalk.png'), + }, + { + label: '群机器人消息', + value: 'dingTalkRobotWebHook', + logo: getImage('/notice/dingTalk-rebot.png'), + }, + ], + weixin: [ + { + label: '企业消息', + value: 'corpMessage', + logo: getImage('/notice/weixin-corp.png'), + }, + // { + // label: '服务号消息', + // value: 'officialMessage' + // logo: getImage('/notice/weixin-official.png'), + // } + ], + voice: [ + { + label: '阿里云语音', + value: 'aliyun', + logo: getImage('/notice/voice.png'), + }, + ], + sms: [ + { + label: '阿里云短信', + value: 'aliyunSms', + logo: getImage('/notice/sms.png'), + }, + ], + webhook: [ + { + label: 'webhook', + value: 'http', + logo: getImage('/notice/webhook.png'), + }, + ], + email: [ + { + label: 'email', + value: 'embedded', + logo: getImage('/notice/email.png'), + }, + ], +} + +// 字段关系映射 +// 配置 +export const CONFIG_FIELD_MAP = { + dingTalk: { + appKey: undefined, + appSecret: undefined, + url: undefined, + }, + weixin: { + corpId: undefined, + corpSecret: undefined, + }, + email: { + host: undefined, + port: 25, + ssl: false, + sender: undefined, + username: undefined, + password: undefined, + }, + voice: { + regionId: undefined, + accessKeyId: undefined, + secret: undefined, + }, + sms: { + regionId: undefined, + accessKeyId: undefined, + secret: undefined, + }, + webhook: { + url: undefined, + headers: [], + }, +}; \ No newline at end of file