Commit 5c0a7573 authored by 孙 楠's avatar 孙 楠

add more i18n messages

parent 2cc20476
......@@ -82,7 +82,7 @@ const ImportListModal = props => {
<div className={styles.pagewrapper}>
<Pagination
total={total}
showTotal={e => `总共 ${e} 条数据`}
showTotal={e => `${$t('total')}${e}${$t('data.records')}`}
pageSize={pageInfo.pageSize}
defaultCurrent={pageInfo.pageNo}
onChange={onChangePage}
......
......@@ -316,7 +316,7 @@ const Complex = props => {
<Pagination
onChange={onPageChange}
total={dataTotal}
showTotal={(total, range) => `第${range[0]}-${range[1]}条 /总共${total}条`}
showTotal={(total, range) => `${$t('no')}${range[0]}-${range[1]}${$t('entries.total')}${total}${$t('entries')}`}
showSizeChanger
pageSize={queryParams.pageSize}
current={queryParams.pageNo}
......
......@@ -103,14 +103,14 @@ const UploadImage = forwardRef((props, ref) => {
if (!canUploadFile && !accept.includes(curType)) {
notification.open({
message: file.name,
description: `文件格式须为${accept.join('')}!`,
description: `${$t('file.format.must.be')}${accept.join('')}!`,
});
return resolve(null);
}
if (file.size > MAX_FILE_SIZE * UNIT) {
notification.open({
message: file.name,
description: `单个文件大小不能超过${MAX_FILE_SIZE}M!`,
description: `${$t('single.file.size.cannot.exceed')}${MAX_FILE_SIZE}M!`,
});
return resolve(null);
}
......
......@@ -29,7 +29,7 @@ export const checkConfirm = () => {
confirm({
title: $t('risk.warning'),
icon: <ExclamationCircleOutlined />,
content: `确定关闭${mt}餐品类型?此餐品类型下关联的商户及商品将一并删除,不可逆请谨慎操作!`,
content: `${$t('confirm.close')}${mt}${$t('delete.food.type.associated.merchantsproducts.will.be.permanently.deleted')}`,
onOk() {
resolve(1);
},
......
......@@ -25,7 +25,7 @@ const MealLimitsFormList = (meals, selectedMealTypes) => (
</Col>
<Col span={24}>
<Form.Item
label={`${mealSections[meal]}订单`}
label={`${mealSections[meal]}${$t('order')}`}
required
labelCol={{ span: 4 }}
wrapperCol={{ span: 20 }}
......
......@@ -5,13 +5,13 @@ import { validateRequired, isCheckPriceTwoDecimal } from '@/utils/validator';
const MealLimit = props => (
// console.log('props :>> ', props);
<Form.Item
label={`${props.label}限额`}
label={`${props.label}${$t('quota')}`}
name={props.name}
initialValue={props.value}
labelCol={{ span: 10 }}
wrapperCol={{ span: 14 }}
rules={[
{ validator: validateRequired, message: `请输入${props.label}限额` },
{ validator: validateRequired, message: `${$t('please.enter')}${props.label}${$t('quota')}` },
{ validator: isCheckPriceTwoDecimal, message: $t('enter.valid.price') },
]}
>
......
This diff is collapsed.
This diff is collapsed.
......@@ -109,7 +109,7 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
const pagination = {
...pageInfo,
total,
showTotal: t => `${t}`,
showTotal: t => `${$t('total')}${t}${$t('entries')}`,
onChange,
onShowSizeChange: onChange,
};
......
......@@ -177,7 +177,7 @@ const StoreManagement = () => {
// 删除
const delEmployee = ({ staffName, id }) => {
confirm({
title: `确认删除企业员工#${staffName || ''}#?`,
title: `${$t('confirm.delete.employee.0')}${staffName || ''}#?`,
onOk() {
deleteEmployee(id);
},
......@@ -255,7 +255,7 @@ const StoreManagement = () => {
const pagination = {
...page,
total,
showTotal: t => `${t}`,
showTotal: t => `${$t('total')}${t}${$t('entries')}`,
onChange,
onShowSizeChange: onChange,
};
......
......@@ -63,7 +63,7 @@ const DraftModal = props => {
const pagination = {
...pageInfo,
total,
showTotal: t => `${t} 项数据`,
showTotal: t => `${$t('total')}${t}${$t('data.items')}`,
onChange,
pageSizeOptions: [4, 20, 50, 100],
showSizeChanger: !0,
......
......@@ -119,7 +119,7 @@ class goodsManage extends Component {
});
if (res) {
const blob = new Blob([res]);
saveAs(blob, `商品明细-${format(new Date(), 'yyyyMMdd')}.xlsx`);
saveAs(blob, `${$t('product.details')}${format(new Date(), 'yyyyMMdd')}.xlsx`);
} else {
notification.error({ message: $t('download.failed') });
}
......
......@@ -216,7 +216,7 @@ class supplyPriceUpdate extends Component {
style={{ marginBottom: 10 }}
onChange={this.onPageChange}
total={tableData.total}
showTotal={total => `共${total}条`}
showTotal={total => `${$t('total')}${total}${$t('entries')}`}
current={pageNo}
pageSize={pageSize}
showSizeChanger
......
......@@ -11,7 +11,7 @@ const ActionBar = options => {
console.log('options.shopId :>> ', options.shopId);
Modal.confirm({
icon: <ExclamationCircleOutlined />,
content: `确认${+state === 6 ? '下架' : '上架'}商品?`,
content: `${$t('confirm')}${+state === 6 ? '下架' : '上架'}${$t('product')}`,
onOk: async () => {
const res = await apiGoodsActionBatch({
skuIds: options.selectedRowKeys,
......
......@@ -257,7 +257,7 @@ const Takeaway = options => {
className={styles['takeawayBox--page']}
onChange={onPageChange}
total={total}
showTotal={o => `共${o}条`}
showTotal={o => `${$t('total')}${o}${$t('entries')}`}
current={pageNo}
pageSize={pageSize}
showSizeChanger
......
......@@ -495,7 +495,7 @@ class goodsManage extends Component {
style={{ marginBottom: 10 }}
onChange={this.onPageChange}
total={tableData.total}
showTotal={total => `共${total}条`}
showTotal={total => `${$t('total')}${total}${$t('entries')}`}
current={pageNo}
pageSize={pageSize}
showSizeChanger
......
......@@ -17,7 +17,7 @@ const InfoAudit = props => {
const obj = {
1: '-',
2: $t('review.passed'),
3: `审核拒绝,${audit.rejectReason}`,
3: `${$t('rejected')}${audit.rejectReason}`,
};
if (audit) {
return obj[audit.status] || '';
......
......@@ -455,5 +455,5 @@ export async function apiDownBiddingTemplate(params) {
responseType: 'arrayBuffer',
});
const blob = new Blob([res]);
saveAs(blob, `自营商品供货价更新表-${format(new Date(), 'yyyy-MM-dd')}.xlsx`);
saveAs(blob, `${$t('selfoperated.product.price.update')}${format(new Date(), 'yyyy-MM-dd')}.xlsx`);
}
......@@ -48,7 +48,7 @@ export function column() {
const onChangeState = async ({ skuId, state }) => {
confirm({
icon: <ExclamationCircleOutlined />,
content: `确认${+state === 6 ? '下架' : '上架'}商品?`,
content: `${$t('confirm')}${+state === 6 ? '下架' : '上架'}${$t('product')}`,
onOk: async () => {
const res = await apiChangeStateGoods({
ids: skuId,
......@@ -251,7 +251,7 @@ export function takeawayColumn(actions) {
const onChangeState = async ({ skuId, state }) => {
confirm({
icon: <ExclamationCircleOutlined />,
content: `确认${+state === 6 ? '下架' : '上架'}商品?`,
content: `${$t('confirm')}${+state === 6 ? '下架' : '上架'}${$t('product')}`,
onOk: async () => {
const res = await apiGoodsActionBatch({
skuIds: [skuId],
......
......@@ -26,7 +26,7 @@ const CustomUpload = props => {
}
}
if (fileList.length >= limit) {
message.warning(`最多上传${limit}个!`);
message.warning(`${$t('maximum.upload')}${limit}${$t('items')}`);
return;
}
......
......@@ -52,7 +52,7 @@ const PaymentMange = props => {
const data = await selfPaymentexportDetail(params);
if (data) {
const blob = new Blob([data]);
saveAs(blob, `账单付款单明细-${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
saveAs(blob, `${$t('bill.payment.details')}${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
} else {
notification.error({ message: $t('download.failed') });
}
......@@ -140,7 +140,7 @@ const PaymentMange = props => {
if (checkedTime(params)) {
const data = await selfPaymentExport(params);
const blob = new Blob([data]);
saveAs(blob, `付款单导出数据-${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
saveAs(blob, `${$t('payment.order.export.data')}${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
}
setloading(false);
};
......
......@@ -63,7 +63,7 @@ const DraftModal = props => {
const pagination = {
...pageInfo,
total,
showTotal: t => `${t} 项数据`,
showTotal: t => `${$t('total')}${t}${$t('data.items')}`,
onChange,
pageSizeOptions: [4, 20, 50, 100],
showSizeChanger: !0,
......
......@@ -119,7 +119,7 @@ class goodsManage extends Component {
});
if (res) {
const blob = new Blob([res]);
saveAs(blob, `商品明细-${format(new Date(), 'yyyyMMdd')}.xlsx`);
saveAs(blob, `${$t('product.details')}${format(new Date(), 'yyyyMMdd')}.xlsx`);
} else {
notification.error({ message: $t('download.failed') });
}
......
......@@ -11,7 +11,7 @@ const ActionBar = options => {
console.log('options.shopId :>> ', options.shopId);
Modal.confirm({
icon: <ExclamationCircleOutlined />,
content: `确认${+state === 6 ? '下架' : '上架'}商品?`,
content: `${$t('confirm')}${+state === 6 ? '下架' : '上架'}${$t('product')}`,
onOk: async () => {
const res = await apiGoodsActionBatch({
skuIds: options.selectedRowKeys,
......
......@@ -257,7 +257,7 @@ const Takeaway = options => {
className={styles['takeawayBox--page']}
onChange={onPageChange}
total={total}
showTotal={o => `共${o}条`}
showTotal={o => `${$t('total')}${o}${$t('entries')}`}
current={pageNo}
pageSize={pageSize}
showSizeChanger
......
......@@ -499,7 +499,7 @@ class popGoodsManage extends Component {
style={{ marginBottom: 10 }}
onChange={this.onPageChange}
total={tableData.total}
showTotal={total => `共${total}条`}
showTotal={total => `${$t('total')}${total}${$t('entries')}`}
current={pageNo}
pageSize={pageSize}
showSizeChanger
......
......@@ -17,7 +17,7 @@ const InfoAudit = props => {
const obj = {
1: '-',
2: $t('review.passed'),
3: `审核拒绝,${audit.rejectReason}`,
3: `${$t('rejected')}${audit.rejectReason}`,
};
if (audit) {
return obj[audit.status] || '';
......
......@@ -455,5 +455,5 @@ export async function apiDownBiddingTemplate(params) {
responseType: 'arrayBuffer',
});
const blob = new Blob([res]);
saveAs(blob, `自营商品供货价更新表-${format(new Date(), 'yyyy-MM-dd')}.xlsx`);
saveAs(blob, `${$t('selfoperated.product.price.update')}${format(new Date(), 'yyyy-MM-dd')}.xlsx`);
}
......@@ -48,7 +48,7 @@ export function column() {
const onChangeState = async ({ skuId, state }) => {
confirm({
icon: <ExclamationCircleOutlined />,
content: `确认${+state === 6 ? '下架' : '上架'}商品?`,
content: `${$t('confirm')}${+state === 6 ? '下架' : '上架'}${$t('product')}`,
onOk: async () => {
const res = await apiChangeStateGoods({
ids: skuId,
......@@ -251,7 +251,7 @@ export function takeawayColumn(actions) {
const onChangeState = async ({ skuId, state }) => {
confirm({
icon: <ExclamationCircleOutlined />,
content: `确认${+state === 6 ? '下架' : '上架'}商品?`,
content: `${$t('confirm')}${+state === 6 ? '下架' : '上架'}${$t('product')}`,
onOk: async () => {
const res = await apiGoodsActionBatch({
skuIds: [skuId],
......
......@@ -68,7 +68,7 @@ export async function downOrder(params) {
responseType: 'arrayBuffer',
});
const blob = new Blob([data]);
saveAs(blob, `商户订单列表-${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
saveAs(blob, `${$t('merchant.order.list')}${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
}
// 批量发货订单
export async function queryToBatchSend(params) {
......@@ -111,7 +111,7 @@ export async function downUploadeOrder(params) {
1: $t('successful.data'),
2: $t('all.data'),
};
saveAs(blob, `批量发货-${status[params.status]}-${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
saveAs(blob, `${$t('batch.shipping')}${status[params.status]}-${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
}
// 延迟发货
export function apiDelayDeliverGoods(data) {
......
......@@ -86,7 +86,7 @@ export const CreateFormInput = props => {
{...roleProps}
{...options}
style={{ width: '100%' }}
placeholder={`请输入${title}`}
placeholder={`${$t('please.enter')}${title}`}
onBlur={e => {
const inputTarget = e.target;
const timer = setTimeout(() => {
......@@ -137,7 +137,7 @@ export const CreateFormInput = props => {
{...roleProps}
{...options}
style={{ width: '100%' }}
placeholder={`请输入${title}`}
placeholder={`${$t('please.enter')}${title}`}
onBlur={e => {
const inputTarget = e.target;
const timer = setTimeout(() => {
......
......@@ -150,7 +150,7 @@ const EditFormTable = forwardRef((props, ref) => {
key={`${dataIndex}_${rowIndex}`}
name={['tableList', rowIndex, dataIndex]}
initialValue={record[dataIndex] || null}
rules={[{ required: roleRules.required, message: `请输入${title}.` }]}
rules={[{ required: roleRules.required, message: `${$t('please.enter')}${title}.` }]}
>
<CreateFormInput
{...otherParams}
......
......@@ -276,7 +276,7 @@ const FormPackage = forwardRef((props, ref) => {
}
arr.push({
uuid: i,
specName: `套餐${i + 1}`,
specName: `${$t('combo')}${i + 1}`,
children,
});
});
......
......@@ -77,7 +77,7 @@ const SpecificationTemplate = (props, _) => {
if (!specId) {
Modal.warning({
maskClosable: true,
title: `请先选择${label}!`,
title: `${$t('please.select.first')}${label}!`,
});
return;
}
......@@ -105,7 +105,7 @@ const SpecificationTemplate = (props, _) => {
options={specList}
style={{ width: 200 }}
fieldNames={{ label: 'specName', value: 'specId' }}
placeholder={`请选择${label}`}
placeholder={`${$t('please.select')}${label}`}
showSearch
filterOption={(input, option) =>
option.specName.toLowerCase().indexOf(input.toLowerCase()) >= 0
......
......@@ -193,7 +193,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
{
required: imgConfig.cardImageList.rule,
type: 'array',
message: `请上传${imgConfig.cardImageList.title}!`,
message: `${$t('please.upload')}${imgConfig.cardImageList.title}!`,
},
]}
>
......@@ -212,7 +212,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
<Form.Item
name={['imageList', key]}
key={key}
label={`商品图片(${key})`}
label={`${$t('product.images')}${key})`}
rules={[
{ required: imgConfig.imageList.rule, type: 'array', message: $t('upload.images') },
]}
......@@ -243,7 +243,7 @@ const FormRuleVPictures = forwardRef((props, ref) => {
{
type: 'array',
required: imgConfig.detailImageList.rule,
message: `请上传${imgConfig.detailImageList.title}!`,
message: `${$t('please.upload')}${imgConfig.detailImageList.title}!`,
},
]}
extra={imgConfig.detailImageList.renderExtra()}
......
......@@ -89,7 +89,7 @@ const UploadCropImage = forwardRef((props, ref) => {
new Promise((resolve, reject) => {
const LtMB = file.size / 1024 / 1024;
if (LtMB > 2) {
warningTip(`[${file.name}] 图片不可以大于2MB`);
warningTip(`[${file.name}${$t('image.size.cannot.exceed.2mb')}`);
resolve(null);
}
getBase64(file, url => {
......@@ -103,7 +103,7 @@ const UploadCropImage = forwardRef((props, ref) => {
resolve(file);
});
image.addEventListener('error', () => {
warningTip(`${file.name}图片上传失败!`);
warningTip(`${file.name}${$t('image.upload.failed')}`);
resolve(null);
});
image.src = url;
......
......@@ -96,7 +96,7 @@ const UploadImage = forwardRef((props, ref) => {
new Promise((resolve, reject) => {
const LtMB = file.size / 1024 / 1024;
if (LtMB > 2) {
warningTip(`[${file.name}] 图片不可以大于2MB`);
warningTip(`[${file.name}${$t('image.size.cannot.exceed.2mb')}`);
resolve(null);
}
getBase64(file, url => {
......@@ -110,7 +110,7 @@ const UploadImage = forwardRef((props, ref) => {
resolve(file);
});
image.addEventListener('error', () => {
warningTip(`${file.name}图片上传失败!`);
warningTip(`${file.name}${$t('image.upload.failed')}`);
resolve(null);
});
image.src = url;
......
......@@ -70,7 +70,7 @@ export const TaskList = (canAddService, canAddNormal, canTakeawayService) => [
rule: true,
limit: 1,
renderExtra(leng) {
return `建议尺寸: ##宽##高 (${leng} / 1) 封面图第一张 `;
return `${$t('recommended.size.widthheight')}${leng}${$t('1.first.cover.image')}`;
},
},
cardImageList: {
......@@ -78,7 +78,7 @@ export const TaskList = (canAddService, canAddNormal, canTakeawayService) => [
rule: true,
limit: 11,
renderExtra(leng) {
return `建议尺寸: ##宽##高,sku商品轮播图(${leng} / 11)`;
return `${$t('recommended.size.widthheight.sku.carousel')}${leng} / 11)`;
},
},
detailImageList: {
......@@ -102,7 +102,7 @@ export const TaskList = (canAddService, canAddNormal, canTakeawayService) => [
rule: true,
limit: 1,
renderExtra(leng) {
return `建议尺寸: ##宽##高 (${leng} / 1) 封面图第一张 `;
return `${$t('recommended.size.widthheight')}${leng}${$t('1.first.cover.image')}`;
},
},
cardImageList: {
......@@ -110,7 +110,7 @@ export const TaskList = (canAddService, canAddNormal, canTakeawayService) => [
rule: true,
limit: 11,
renderExtra(leng) {
return `建议尺寸: ##宽##高,sku商品轮播图(${leng} / 11)`;
return `${$t('recommended.size.widthheight.sku.carousel')}${leng} / 11)`;
},
},
detailImageList: {
......@@ -223,7 +223,7 @@ export const StaticColumns = customer => [
disabeldRender: () => customer.isDisabled,
},
{
title: `重量(${customer.isGold ? 'g' : 'kg'})`,
title: `${$t('weight')}${customer.isGold ? 'g' : 'kg'})`,
dataIndex: 'weight',
editable: true,
batchRole: [1],
......@@ -372,7 +372,7 @@ export const StaticColumnsPop = customer => [
disabeldRender: () => customer.isDisabled,
},
{
title: `重量(${customer.isGold ? 'g' : 'kg'})`,
title: `${$t('weight')}${customer.isGold ? 'g' : 'kg'})`,
dataIndex: 'weight',
editable: true,
batchRole: [1],
......
......@@ -235,7 +235,7 @@ const ServiceGoods = options => {
const sendAsyncHttpRequest = isEdit ? merchantProductEdit : merchantProductAdd;
const addResponse = await sendAsyncHttpRequest(sendData);
if (addResponse.data) {
message.success(`${isEdit ? '修改' : '添加'}成功!`);
message.success(`${isEdit ? '修改' : '添加'}${$t('success')}`);
localStorage.remove(localAutoSaveKey);
handleCancel(true, sendData);
}
......@@ -450,7 +450,7 @@ const ServiceGoods = options => {
txt = $t('kilogram');
}
if (txt) {
message.warning(`商品品类已切换,规格重量单位已自动切换为${txt}`, 6);
message.warning(`${$t('product.category.changed.weight.unit.autoswitched.to')}${txt}`, 6);
}
};
......
......@@ -144,7 +144,7 @@ export const filterSendData = (type, params) => {
item.specs.forEach(itm => {
if (itm?.unit && tempWeightName.includes(itm?.unit)) {
itm.quantity =
`${itm?.quantity}`.indexOf($t('approx')) > -1 ? itm?.quantity : `${itm?.quantity}`;
`${itm?.quantity}`.indexOf($t('approx')) > -1 ? itm?.quantity : `${$t('approx')}${itm?.quantity}`;
}
});
}
......@@ -162,7 +162,7 @@ export const filterSendData = (type, params) => {
}
if (itm?.unit && tempWeightName.includes(itm?.unit)) {
itm.quantity =
`${itm?.quantity}`.indexOf($t('approx')) > -1 ? itm?.quantity : `${itm?.quantity}`;
`${itm?.quantity}`.indexOf($t('approx')) > -1 ? itm?.quantity : `${$t('approx')}${itm?.quantity}`;
}
});
}
......
......@@ -47,7 +47,7 @@ const SettlementSheet = props => {
return true;
}
notification.error({
message: `${billPeriodData.text}帐期最多可选${billPeriodData?.maxlength || 0}`,
message: `${billPeriodData.text}${$t('max.selectable.billing.cycles')}${billPeriodData?.maxlength || 0}${$t('entries')}`,
});
return false;
};
......
......@@ -23,7 +23,7 @@ const repastType = list => {
.filter(item => item !== 4)
.map(item => {
const name = repastTypeList.find(i => i.value === item)?.label;
return name ? `${name}/到店 ` : null;
return name ? `${name}${$t('instore')}` : null;
});
}
return list.map(item => {
......
......@@ -130,7 +130,7 @@ const StoreManagement = () => {
// 删除
const delShop = ({ shopName, id }) => {
confirm({
title: `确认删除企业商户#${shopName || ''}#?`,
title: `${$t('confirm.delete.merchant.0')}${shopName || ''}#?`,
content: $t('note.deleting.shop.removes.all.merchant.products'),
onOk() {
editShop(id);
......@@ -194,7 +194,7 @@ const StoreManagement = () => {
const pagination = {
...page,
total,
showTotal: t => `${t}`,
showTotal: t => `${$t('total')}${t}${$t('entries')}`,
onChange: handleTableChange,
onShowSizeChange: handleTableChange,
};
......
......@@ -167,7 +167,7 @@ const AddressForm = props => {
return (
<Modal
title={`${formData.id ? '修改' : '增加'}售后地址`}
title={`${formData.id ? '修改' : '增加'}${$t('aftersales.address')}`}
visible={visible}
onCancel={() => onCancel()}
onOk={handleSubmit}
......@@ -210,14 +210,14 @@ const AddressForm = props => {
rules: [
{
required: area.required,
message: `请选择${area.name}!`,
message: `${$t('please.select')}${area.name}!`,
},
],
})(
<Select
showSearch
optionFilterProp="label"
placeholder={`请选择${area.name}`}
placeholder={`${$t('please.select')}${area.name}`}
onChange={val => getAddr(val, area.child)}
labelInValue
allowClear
......
......@@ -49,7 +49,7 @@ const CustomerInfo = props => {
if (curren < item.endTime) {
valid = true;
const name = meals[item.mealPeriodType];
notification.error({ message: `${curName}起始时间不能早于${name}截止时间` });
notification.error({ message: `${curName}${$t('start.time.cannot.be.before')}${name}${$t('deadline')}` });
}
});
return valid;
......@@ -145,7 +145,7 @@ const CustomerInfo = props => {
confirm({
title: $t('risk.warning'),
icon: <ExclamationCircleOutlined />,
content: `确定关闭${mt}餐品类型?此餐品类型下关联的商户及商品将一并删除,不可逆请谨慎操作!`,
content: `${$t('confirm.close')}${mt}${$t('delete.food.type.associated.merchantsproducts.will.be.permanently.deleted')}`,
onOk() {
resolve(1);
},
......@@ -343,7 +343,7 @@ const CustomerInfo = props => {
{fields => (
<>
{Object.keys(meals).map(meal => (
<Form.Item label={`${mealSections[meal]}订单`} required wrapperCol={{ span: 20 }}>
<Form.Item label={`${mealSections[meal]}${$t('order')}`} required wrapperCol={{ span: 20 }}>
<Form.List
name={`limit${meal}`}
key={`${meal}limit`}
......
......@@ -5,10 +5,10 @@ import { validateRequired, isCheckPriceTwoDecimal } from '@/utils/validator';
const MealLimit = props => (
<Form.Item
label={`${props.label}限额`}
label={`${props.label}${$t('quota')}`}
name={props.name}
rules={[
{ validator: validateRequired, message: `请输入${props.label}限额` },
{ validator: validateRequired, message: `${$t('please.enter')}${props.label}${$t('quota')}` },
{ validator: isCheckPriceTwoDecimal, message: $t('enter.valid.price') },
]}
>
......
......@@ -168,7 +168,7 @@ export function uploadPropsFn(
return;
}
if (that.state.businessInfo[keyName] && that.state.businessInfo[keyName].length >= limit) {
notification.error({ message: `最多只能上传${limit}个文件!` });
notification.error({ message: `${$t('max.upload.limit')}${limit}${$t('files')}` });
return;
}
const res = await uploadFile([file], type);
......@@ -188,7 +188,7 @@ export function uploadPropsFn(
if (imgList.length <= limit) {
state.businessInfo[keyName] = imgList;
} else {
notification.error({ message: `最多只能上传${limit}个文件!` });
notification.error({ message: `${$t('max.upload.limit')}${limit}${$t('files')}` });
}
return {
businessInfo: state.businessInfo,
......@@ -208,7 +208,7 @@ export function uploadPropsFn(
if (flist.length + imgList.length > limit) {
clearTimeout(timer);
timer = setTimeout(() => {
notification.error({ message: `最多只能上传${limit}个文件!` });
notification.error({ message: `${$t('max.upload.limit')}${limit}${$t('files')}` });
}, 100);
return false;
}
......
......@@ -96,7 +96,7 @@ export default props => {
const seconds = parseInt(timeNumber % 60)
.toString()
.padStart(2, '0');
const str = `${hours}${minutes}${seconds}`;
const str = `${hours}${$t('hours')}${minutes}${$t('minutes')}${seconds}${$t('seconds')}`;
timeString[record.orderId] = str;
const strings = _.cloneDeep(timeString);
setTimeString(strings);
......
......@@ -144,7 +144,7 @@ export default () => {
const enable = +state === 1 ? 0 : 1;
const res = await apiEnableStore({ id, state: enable });
if (res === '0000') {
notification.success({ message: `${state ? '禁用' : '启用'}` });
notification.success({ message: `${$t('completed')}${state ? '禁用' : '启用'}` });
onSearch(refSearch.current?.getFieldValue?.() || {});
}
};
......@@ -344,7 +344,7 @@ export default () => {
style={{ marginBottom: 10 }}
onChange={onPageChange}
total={totalNum}
showTotal={total => `共${total}条`}
showTotal={total => `${$t('total')}${total}${$t('entries')}`}
current={pageNo}
pageSize={pageSize}
showSizeChanger
......
......@@ -37,7 +37,7 @@ const ImageInfo = file =>
new Promise((resolve, reject) => {
const LtMB = file.size / 1024 / 1024;
if (LtMB > 2) {
warningTip(`[${file.name}] 图片不可以大于2MB`);
warningTip(`[${file.name}${$t('image.size.cannot.exceed.2mb')}`);
resolve(null);
}
getBase64(file, url => {
......@@ -51,7 +51,7 @@ const ImageInfo = file =>
resolve(file);
});
image.addEventListener('error', () => {
warningTip(`${file.name}图片上传失败!`);
warningTip(`${file.name}${$t('image.upload.failed')}`);
resolve(null);
});
image.src = url;
......@@ -68,13 +68,13 @@ const isUploadNext = async (imgFileList, id) => {
const filterImage = imgFileList.filter(({ width, height, name }) => {
if (id === 'detailImageList') {
if (width > DETAIL_IMG_MAX_WIDTH) {
warningTip(`[${name}] 详情图宽度不可大于${DETAIL_IMG_MAX_WIDTH}`);
warningTip(`[${name}${$t('detail.image.width.exceeds.limit')}${DETAIL_IMG_MAX_WIDTH}`);
return false;
}
return true;
}
if (width > LOOP_IMG_WIDTH_HEIGHT || height > LOOP_IMG_WIDTH_HEIGHT) {
warningTip(`[${name}] 滑动图尺寸不可大于 ${LOOP_IMG_WIDTH_HEIGHT}*${LOOP_IMG_WIDTH_HEIGHT}`);
warningTip(`[${name}${$t('slider.image.size.exceeds.limit')}${LOOP_IMG_WIDTH_HEIGHT}*${LOOP_IMG_WIDTH_HEIGHT}`);
return false;
}
return true;
......
......@@ -68,7 +68,7 @@ export async function downOrder(params) {
responseType: 'arrayBuffer',
});
const blob = new Blob([data]);
saveAs(blob, `商户订单列表-${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
saveAs(blob, `${$t('merchant.order.list')}${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
}
// 批量发货订单
export async function queryToBatchSend(params) {
......@@ -111,7 +111,7 @@ export async function downUploadeOrder(params) {
1: $t('successful.data'),
2: $t('all.data'),
};
saveAs(blob, `批量发货-${status[params.status]}-${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
saveAs(blob, `${$t('batch.shipping')}${status[params.status]}-${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
}
// 延迟发货
export function apiDelayDeliverGoods(data) {
......
......@@ -87,7 +87,7 @@ const DetailModal = (props, ref) => {
{
title: $t('voucher.code'),
width: 150,
render: (value, record, index) => `券码${index + 1}`,
render: (value, record, index) => `${$t('coupon.code')}${index + 1}`,
},
{
title: $t('validity.period'),
......
......@@ -456,7 +456,7 @@ const OrderList = props => {
<Pagination
onChange={onPageChange}
total={dataTotal}
showTotal={(total, range) => `第${range[0]}-${range[1]}条 /总共${total}条`}
showTotal={(total, range) => `${$t('no')}${range[0]}-${range[1]}${$t('entries.total')}${total}${$t('entries')}`}
pageSize={pagination.pageSize}
current={pagination.pageNo}
/>
......
......@@ -166,7 +166,7 @@ const AddressForm = props => {
return (
<Modal
title={`${formData.id ? '修改' : '增加'}售后地址`}
title={`${formData.id ? '修改' : '增加'}${$t('aftersales.address')}`}
visible={visible}
onCancel={() => onCancel()}
onOk={handleSubmit}
......@@ -198,13 +198,13 @@ const AddressForm = props => {
rules: [
{
required: area.required,
message: `请选择${area.name}!`,
message: `${$t('please.select')}${area.name}!`,
},
],
})(
<Select
showSearch
placeholder={`请选择${area.name}`}
placeholder={`${$t('please.select')}${area.name}`}
onChange={val => getAddr(val, area.child)}
labelInValue
allowClear
......
......@@ -55,7 +55,7 @@ export async function downDetail(params) {
responseType: 'arrayBuffer',
});
const blob = new Blob([data]);
saveAs(blob, `对账明细-${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
saveAs(blob, `${$t('reconciliation.details')}${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
}
export async function detailQuery(params) {
......
......@@ -67,7 +67,7 @@ export async function download(params) {
responseType: 'arrayBuffer',
});
const blob = new Blob([data]);
saveAs(blob, `商户货款结算明细-${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
saveAs(blob, `${$t('merchant.settlement.details')}${format(new Date(), 'yyyyMMddHHmmss')}.xlsx`);
}
// 附件信息
export async function docQuery(settlementNo) {
......
......@@ -38,7 +38,7 @@ const errorHandler = error => {
const errorText = codeMessage[response.status] || response.statusText;
const { status, url } = response;
notification.error({
message: `请求错误 ${status}: ${url}`,
message: `${$t('request.error')}${status}: ${url}`,
description: errorText,
});
}
......
......@@ -96,11 +96,11 @@ export function checkMaxNumber(rule, value, callback) {
if (!value || value === 'undefined') {
callback();
} else if (rule.isInteger && !rsCheck) {
callback(new Error(`请输入[${rule.min}, ${rule.max}]之间的正整数`));
callback(new Error(`${$t('please.enter')}${rule.min}, ${rule.max}${$t('positive.integers.between')}`));
} else if (!Number(value)) {
callback(new Error(`请输入[${rule.min}, ${rule.max}]之间的数字`));
callback(new Error(`${$t('please.enter')}${rule.min}, ${rule.max}${$t('numbers.between')}`));
} else if (value < rule.min || value > rule.max) {
callback(new Error(`请输入[${rule.min}, ${rule.max}]之间的数字`));
callback(new Error(`${$t('please.enter')}${rule.min}, ${rule.max}${$t('numbers.between')}`));
} else {
callback();
}
......@@ -184,7 +184,7 @@ export const isNumberSection = (rule, value, callback) => {
if (!Number(value)) {
callback(new Error($t('numbers.required')));
} else if (rule.min > +value || rule.max < +value) {
callback(new Error(rule.message || `请输入${rule.min}-${rule.max}区间的数字`));
callback(new Error(rule.message || `${$t('please.enter')}${rule.min}-${rule.max}${$t('number.in.range')}`));
} else {
callback();
}
......
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