Commit bacf4743a97de4256dbf793a422fcb7a1de91455
Merge branch 'feat/alarm-add-dingtalk' into 'main_dev'
feat: 告警联系人新增钉钉字段 See merge request yunteng/thingskit-front!1024
Showing
2 changed files
with
33 additions
and
1 deletions
@@ -120,6 +120,22 @@ export const emailRule: Rule[] = [ | @@ -120,6 +120,22 @@ export const emailRule: Rule[] = [ | ||
120 | }, | 120 | }, |
121 | ]; | 121 | ]; |
122 | 122 | ||
123 | +// 钉钉验证 | ||
124 | +export const dingRule: Rule[] = [ | ||
125 | + { | ||
126 | + validator: (_, value: string) => { | ||
127 | + const reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; | ||
128 | + if (!value) { | ||
129 | + return Promise.resolve(); | ||
130 | + } else if (!reg.test(value)) { | ||
131 | + return Promise.reject('手机号格式不正确'); | ||
132 | + } | ||
133 | + return Promise.resolve(); | ||
134 | + }, | ||
135 | + validateTrigger: 'blur', | ||
136 | + }, | ||
137 | +]; | ||
138 | + | ||
123 | // 中文正则 | 139 | // 中文正则 |
124 | export const ChineseRegexp = /[\u4E00-\u9FA5]/; | 140 | export const ChineseRegexp = /[\u4E00-\u9FA5]/; |
125 | 141 |
1 | import { BasicColumn, FormSchema } from '/@/components/Table'; | 1 | import { BasicColumn, FormSchema } from '/@/components/Table'; |
2 | -import { emailRule, phoneRule } from '/@/utils/rules'; | 2 | +import { dingRule, emailRule, phoneRule } from '/@/utils/rules'; |
3 | import { useComponentRegister } from '/@/components/Form'; | 3 | import { useComponentRegister } from '/@/components/Form'; |
4 | import { OrgTreeSelect } from '../../common/OrgTreeSelect'; | 4 | import { OrgTreeSelect } from '../../common/OrgTreeSelect'; |
5 | useComponentRegister('OrgTreeSelect', OrgTreeSelect); | 5 | useComponentRegister('OrgTreeSelect', OrgTreeSelect); |
@@ -31,6 +31,11 @@ export const columns: BasicColumn[] = [ | @@ -31,6 +31,11 @@ export const columns: BasicColumn[] = [ | ||
31 | width: 180, | 31 | width: 180, |
32 | }, | 32 | }, |
33 | { | 33 | { |
34 | + title: '钉钉', | ||
35 | + dataIndex: 'dingtalk', | ||
36 | + width: 160, | ||
37 | + }, | ||
38 | + { | ||
34 | title: '备注', | 39 | title: '备注', |
35 | dataIndex: 'remark', | 40 | dataIndex: 'remark', |
36 | width: 120, | 41 | width: 120, |
@@ -109,6 +114,17 @@ export const formSchema: FormSchema[] = [ | @@ -109,6 +114,17 @@ export const formSchema: FormSchema[] = [ | ||
109 | }, | 114 | }, |
110 | }, | 115 | }, |
111 | { | 116 | { |
117 | + field: 'dingtalk', | ||
118 | + label: '钉钉', | ||
119 | + component: 'Input', | ||
120 | + helpMessage: '请输入与钉钉相关联的手机号', | ||
121 | + rules: dingRule, | ||
122 | + componentProps: { | ||
123 | + placeholder: '不填默认为手机号码', | ||
124 | + maxLength: 11, | ||
125 | + }, | ||
126 | + }, | ||
127 | + { | ||
112 | field: 'remark', | 128 | field: 'remark', |
113 | label: '备注', | 129 | label: '备注', |
114 | component: 'InputTextArea', | 130 | component: 'InputTextArea', |