diff --git a/src/locales/en-US.js b/src/locales/en-US.js index 5526359adde094b1e60c3df0286a7ea469ab95a9..cce61a5186e7b88c46d148d0e726dea221612429 100644 --- a/src/locales/en-US.js +++ b/src/locales/en-US.js @@ -16,11 +16,44 @@ export default { 'validation.phone-number.required': 'Please enter your phone number!', 'validation.phone-number.wrong-format': 'Malformed phone number!', 'validation.verification-code.required': 'Please enter the verification code!', + 'validation.title.required': 'Please enter a title', + 'validation.date.required': 'Please select the start and end date', + 'validation.goal.required': 'Please enter a description of the goal', + 'validation.standard.required': 'Please enter a metric', + 'form.optional': ' (optional) ', + 'form.submit': 'Submit', + 'form.save': 'Save', 'form.email.placeholder': 'Email', 'form.password.placeholder': 'Password', 'form.confirm-password.placeholder': 'Confirm password', 'form.phone-number.placeholder': 'Phone number', 'form.verification-code.placeholder': 'Verification code', + 'form.title.label': 'Title', + 'form.title.placeholder': 'Give the target a name', + 'form.date.label': 'Start and end date', + 'form.date.placeholder.start': 'Start date', + 'form.date.placeholder.end': 'End date', + 'form.goal.label': 'Goal description', + 'form.goal.placeholder': 'Please enter your work goals', + 'form.standard.label': 'Metrics', + 'form.standard.placeholder': 'Please enter a metric', + 'form.client.label': 'Client', + 'form.client.label.tooltip': 'Target service object', + 'form.client.placeholder': + 'Please describe your customer service, internal customers directly @ Name / job number', + 'form.invites.label': 'Inviting critics', + 'form.invites.placeholder': 'Please direct @ Name / job number, you can invite up to 5 people', + 'form.weight.label': 'Weight', + 'form.weight.placeholder': 'Please enter weight', + 'form.public.label': 'Target disclosure', + 'form.public.label.help': 'Customers and invitees are shared by default', + 'form.public.radio.public': 'Public', + 'form.public.radio.partially-public': 'Partially public', + 'form.public.radio.private': 'Private', + 'form.publicUsers.placeholder': 'Open to', + 'form.publicUsers.option.A': 'Colleague A', + 'form.publicUsers.option.B': 'Colleague B', + 'form.publicUsers.option.C': 'Colleague C', 'component.globalHeader.search': 'Search', 'component.globalHeader.search.example1': 'Search example 1', 'component.globalHeader.search.example2': 'Search example 2', @@ -119,6 +152,9 @@ export default { 'app.analysis.table.search-keyword': 'Keyword', 'app.analysis.table.users': 'Users', 'app.analysis.table.weekly-range': 'Weekly Range', + 'app.forms.basic.title': 'Basic form', + 'app.forms.basic.description': + 'Form pages are used to collect or verify information to users, and basic forms are common in scenarios where there are fewer data items.', 'app.settings.menuMap.basic': 'Basic Settings', 'app.settings.menuMap.security': 'Security Settings', 'app.settings.menuMap.binding': 'Account Binding', diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js index b50ece0c05b53be9eeb0cc1334b14d6e223c1274..35219ba157f8607902326e8b17765b7e22044877 100644 --- a/src/locales/zh-CN.js +++ b/src/locales/zh-CN.js @@ -17,11 +17,43 @@ export default { 'validation.phone-number.required': '请输入手机号!', 'validation.phone-number.wrong-format': '手机号格式错误!', 'validation.verification-code.required': '请输入验证码!', + 'validation.title.required': '请输入标题', + 'validation.date.required': '请选择起止日期', + 'validation.goal.required': '请输入目标描述', + 'validation.standard.required': '请输入衡量标准', + 'form.optional': '(选填)', + 'form.submit': '提交', + 'form.save': '保存', 'form.email.placeholder': '邮箱', 'form.password.placeholder': '至少6位密码,区分大小写', 'form.confirm-password.placeholder': '确认密码', 'form.phone-number.placeholder': '位手机号', 'form.verification-code.placeholder': '验证码', + 'form.title.label': '标题', + 'form.title.placeholder': '给目标起个名字', + 'form.date.label': '起止日期', + 'form.date.placeholder.start': '开始日期', + 'form.date.placeholder.end': '结束日期', + 'form.goal.label': '目标描述', + 'form.goal.placeholder': '请输入你的阶段性工作目标', + 'form.standard.label': '衡量标准', + 'form.standard.placeholder': '请输入衡量标准', + 'form.client.label': '客户', + 'form.client.label.tooltip': '目标的服务对象', + 'form.client.placeholder': '请描述你服务的客户,内部客户直接 @姓名/工号', + 'form.invites.label': '邀评人', + 'form.invites.placeholder': '请直接 @姓名/工号,最多可邀请 5 人', + 'form.weight.label': '权重', + 'form.weight.placeholder': '请输入', + 'form.public.label': '目标公开', + 'form.public.label.help': '客户、邀评人默认被分享', + 'form.public.radio.public': '公开', + 'form.public.radio.partially-public': '部分公开', + 'form.public.radio.private': '不公开', + 'form.publicUsers.placeholder': '公开给', + 'form.publicUsers.option.A': '同事甲', + 'form.publicUsers.option.B': '同事乙', + 'form.publicUsers.option.C': '同事丙', 'component.globalHeader.search': '站内搜索', 'component.globalHeader.search.example1': '搜索提示一', 'component.globalHeader.search.example2': '搜索提示二', @@ -120,6 +152,9 @@ export default { 'app.analysis.table.search-keyword': '搜索关键词', 'app.analysis.table.users': '用户数', 'app.analysis.table.weekly-range': '周涨幅', + 'app.forms.basic.title': '基础表单', + 'app.forms.basic.description': + '表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。', 'app.settings.menuMap.basic': '基本设置', 'app.settings.menuMap.security': '安全设置', 'app.settings.menuMap.binding': '账号绑定', diff --git a/src/pages/Forms/BasicForm.js b/src/pages/Forms/BasicForm.js index 12eca38f10801c130fee32efe483c9c8b7a0de04..55833150a1ed63d053e894968d35ac548c3129ae 100644 --- a/src/pages/Forms/BasicForm.js +++ b/src/pages/Forms/BasicForm.js @@ -1,5 +1,6 @@ import React, { PureComponent } from 'react'; import { connect } from 'dva'; +import { formatMessage, FormattedMessage } from 'umi/locale'; import { Form, Input, @@ -65,65 +66,79 @@ class BasicForms extends PureComponent { return ( } + content={} > - + }> {getFieldDecorator('title', { rules: [ { required: true, - message: '请输入标题', + message: formatMessage({ id: 'validation.title.required' }), }, ], - })()} + })()} - + }> {getFieldDecorator('date', { rules: [ { required: true, - message: '请选择起止日期', + message: formatMessage({ id: 'validation.date.required' }), }, ], - })()} + })( + + )} - + }> {getFieldDecorator('goal', { rules: [ { required: true, - message: '请输入目标描述', + message: formatMessage({ id: 'validation.goal.required' }), }, ], })( )} - + }> {getFieldDecorator('standard', { rules: [ { required: true, - message: '请输入衡量标准', + message: formatMessage({ id: 'validation.standard.required' }), }, ], - })()} + })( + + )} - 客户 + - (选填) - + + }> @@ -131,58 +146,84 @@ class BasicForms extends PureComponent { } > {getFieldDecorator('client')( - + )} - 邀评人 - (选填) + + + + } > {getFieldDecorator('invites')( - + )} - 权重 - (选填) + + + + } > - {getFieldDecorator('weight')()} + {getFieldDecorator('weight')( + + )} % - + } + help={} + > {getFieldDecorator('public', { initialValue: '1', })( - 公开 - 部分公开 - 不公开 + + + + + + + + + )} {getFieldDecorator('publicUsers')( - 同事甲 - 同事乙 - 同事丙 + + + + + + + + + )} @@ -190,9 +231,11 @@ class BasicForms extends PureComponent { - 提交 + + + + - 保存