Commit 78d3cadf authored by GuanHua's avatar GuanHua
parents 301a4d93 876341c1
......@@ -6,6 +6,9 @@ import { GlobalConfig } from '@/global/config';
import queryString from 'query-string'
import { QuestionCircleOutlined } from '@ant-design/icons';
import { Tooltip } from 'antd'
import { getIntl } from 'umi';
const intl = getIntl();
function isArray(arr: any) {
return Array.isArray(arr)
......@@ -418,7 +421,7 @@ export const getFieldType = (field) => {
maxLength: field.fieldLength,
"x-component-props": {
help: field.fieldRemark,
placeholder: `请输入${field.fieldLocalName || field.fieldCNName}`,
placeholder: `${intl.formatMessage({ id: 'common.form.input.placeholder' })}${field.fieldLocalName || field.fieldCNName}`,
size: 'large',
...field.attr
}
......@@ -486,7 +489,7 @@ export const getQueryStringParams = (url?: string) => {
// 填充必填的schema message提示
export const padRequiredMessage = (originSchema: ISchema) => {
const messageSwich = (type) => {
return type ? '请选择' : '请输入'
return type ? intl.formatMessage({ id: 'common.text.pleaseSelect' }) : intl.formatMessage({ id: 'common.form.input.placeholder' })
}
const todoFn = (targetSchema) => {
......@@ -576,9 +579,9 @@ export const isJSONStr = str => {
* @param {array} item 需要赋值的值
*/
export const coverColFiltersItem = (
data: Array<{[key: string]: any}>,
data: Array<{ [key: string]: any }>,
dataIndex: string,
item: {[key: string]: any}
item: { [key: string]: any }
) => {
const index = data.findIndex(i => i.dataIndex === dataIndex);
......@@ -642,7 +645,7 @@ export const getIChannelInfo = () => {
* @param url 链接
* @returns
*/
export const getTopDomainByHost = (url: string, isPort = false): string => {
export const getTopDomainByHost = (url: string, isPort = false): string => {
if (!url) return ''
// 如果后缀带有端口号, 可通过第二个参数把端口去掉
const splitUrl = url.replace(/(http|https)\:\/\//, '').split(':')
......@@ -659,7 +662,7 @@ export const getIChannelInfo = () => {
export const clearModalParams = () => {
const currentState = JSON.parse(sessionStorage.getItem("currentState"))
const result = {...currentState, queryParams: {}, current: 1}
const result = { ...currentState, queryParams: {}, current: 1 }
sessionStorage.setItem("currentState", JSON.stringify(result))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment