Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add international translation files #304

Merged
merged 5 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/src/locales/lang/en/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
dark: 'Dark',

action: 'Action',

operating: 'Operate',
successful: 'Success',
failed: 'Failed',
warning: 'Warning',
Expand Down
53 changes: 53 additions & 0 deletions web/src/locales/lang/en/retail.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
export default {
selectData: 'Please select a piece of data',
modifyDataPrompt: 'Sorry, only unapproved documents can be edited!',
shipments:{
title: 'Retail Shipments List',
table:{
customer: 'Customer',
receiptNumber: 'Receipt number',
productInformation: 'Product information',
productQuantity: 'Product quantity',
totalAmount: 'Total amount',
amountCollection: 'Amount collection',
changeAmount: 'Change amount',
receiptDate: 'Receipt date',
operator: 'operator',
status: 'status',
},
header:{
settlementAccount: 'Settlement account',
startDate: 'Start date',
endDate: 'End date',
receiptRemark: 'receipt remark',
},
export: {
exportData: 'Retail Shipments Data ',
noData: 'No data available',
}
},
refund:{
title: 'Retail Return List',
table:{
customer: 'Customer',
receiptNumber: 'Receipt number',
productInformation: 'Product information',
totalAmount: 'Total amount',
paymentAmount: 'Payment amount',
changeAmount: 'Change amount',
receiptDate: 'Receipt date',
operator: 'operator',
status: 'status',
},
header:{
settlementAccount: 'Settlement account',
startDate: 'Start date',
endDate: 'End date',
receiptRemark: 'receipt remark',
},
export: {
exportData: 'Retail Return Data ',
noData: 'No data available',
}
}
};
19 changes: 19 additions & 0 deletions web/src/locales/lang/en/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export default {
accountPlaceholder: 'Please input username',
passwordPlaceholder: 'Please input password',
captchaPlaceholder: 'Please input verification code',
correctMobilePlaceholder: 'Please enter the correct phone number',
smsPlaceholder: 'Please input sms code',
mobilePlaceholder: 'Please input mobile',
policyPlaceholder: 'Register after checking',
Expand Down Expand Up @@ -123,5 +124,23 @@ export default {
resetUserPassword: 'Reset User Password',
confirmPasswordReset: 'Are you sure to reset the password to 123456',
deleteUserAccount: 'Delete User Account'
},
table: {
add: 'Add Data',
edit: 'Edit Data',
delete: 'Delete Data',
batchDelete: 'Batch Delete Data',
exportData: 'Export Data',
approve: 'Receipt Approval',
reject: 'Receipt Rejection',
audited: 'Audited',
unaudited: 'Unaudited',
viewReceiptDetails: 'View Receipt Detail',
confirmDelete: 'Are you sure to delete this data?',
confirmExport: 'Confirm Export',
confirmExportTextOne: 'Export',
confirmExportTextTwo: 'piece of data, please be patient.',
confirmExportTextThree: 'If you need to export detailed data (which may take a long time), please check the box below.',
confirmExportTextFour: 'Need to export detailed data',
}
};
2 changes: 1 addition & 1 deletion web/src/locales/lang/zh-CN/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default {
dark: '黑暗主题',

action: '操作',

operating: '操作',
successful: '成功',
warning: '警告',
failed: '失败',
Expand Down
53 changes: 53 additions & 0 deletions web/src/locales/lang/zh-CN/retail.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
export default {
selectData: '请选择一条数据',
modifyDataPrompt: '抱歉,只有未审核的单据才能编辑!',
shipments:{
title: '零售出库列表',
table:{
customer: '会员',
receiptNumber: '单据编号',
productInformation: '商品信息',
productQuantity: '商品数量',
totalAmount: '金额合计',
amountCollection: '收款金额',
changeAmount: '找零金额',
receiptDate: '单据日期',
operator: '操作员',
status: '状态',
},
header:{
settlementAccount: '结算账户',
startDate: '开始日期',
endDate: '结束日期',
receiptRemark: '单据备注',
},
export: {
exportData: '零售出库数据 ',
noData: '无可用数据导出',
}
},
refund:{
title: '零售退货列表',
table:{
customer: '会员',
receiptNumber: '单据编号',
productInformation: '商品信息',
totalAmount: '金额合计',
paymentAmount: '付款金额',
changeAmount: '找零金额',
receiptDate: '单据日期',
operator: '操作员',
status: '状态',
},
header:{
settlementAccount: '结算账户',
startDate: '开始日期',
endDate: '结束日期',
receiptRemark: '单据备注',
},
export: {
exportData: '零售退货数据 ',
noData: '无可用数据导出',
}
}
};
13 changes: 13 additions & 0 deletions web/src/locales/lang/zh-CN/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,18 @@ export default {
resetUserPassword: '重置密码',
confirmPasswordReset: '确定重置密码为123456吗',
deleteUserAccount: '删除账号'
},
table: {
add: '新增',
edit: '编辑',
delete: '删除',
batchDelete: '批量删除',
exportData: '导出数据',
approve: '审核',
reject: '驳回',
audited: '已审核',
unaudited: '未审核',
viewReceiptDetails: '查看单据详情',
confirmDelete: '是否确认删除数据?',
}
};
2 changes: 2 additions & 0 deletions web/src/views/basic/account/BindPhoneModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

<script lang="ts">
import {reactive, ref} from 'vue';
import { useI18n } from '/@/hooks/web/useI18n';
import {Button, Form, FormItem, Input, InputNumber, Modal, Spin} from "ant-design-vue";
import {BasicModal, useModalInner} from '/@/components/Modal';
import {CountdownInput} from "@/components/CountDown";
Expand All @@ -48,6 +49,7 @@ export default {
},
setup(_, context) {
const { createMessage } = useMessage();
const { t } = useI18n();
const userId = ref('');
const title = ref('更换密保手机');
const openBindPhoneModal = ref(false);
Expand Down
42 changes: 22 additions & 20 deletions web/src/views/retail/refund/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,32 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> 新增</a-button>
<a-button type="primary" @click="handleBatchDelete"> 批量删除</a-button>
<a-button type="primary" @click="handleExport"> 导出</a-button>
<a-button type="primary" @click="handleOnStatus(1)"> 审核</a-button>
<a-button type="primary" @click="handleOnStatus(0)"> 反审核</a-button>
<a-button type="primary" @click="handleCreate" v-text="t('sys.table.add')" />
<a-button type="primary" @click="handleBatchDelete" v-text="t('sys.table.batchDelete')" />
<a-button type="primary" @click="handleExport" v-text="t('sys.table.exportData')"/>
<a-button type="primary" @click="handleOnStatus(1)" v-text="t('sys.table.approve')" />
<a-button type="primary" @click="handleOnStatus(0)" v-text="t('sys.table.reject')" />
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'clarity:info-standard-line',
tooltip: '查看单据详情',
tooltip: t('sys.table.viewReceiptDetails'),
onClick: handleView.bind(null, record),
},
{
icon: 'clarity:note-edit-line',
tooltip: t('sys.table.edit'),
onClick: handleEdit.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
color: 'error',
tooltip: t('sys.table.delete'),
popConfirm: {
title: '是否确认删除',
title: t('sys.table.confirmDelete'),
placement: 'left',
confirm: handleDelete.bind(null, record),
},
Expand All @@ -35,17 +37,17 @@
</template>
<template v-else-if="column.key === 'status'">
<Tag :color="record.status === 1 ? 'green' : 'red'">
{{ record.status === 1 ? '已审核' : '未审核' }}
{{ record.status === 1 ? t('sys.table.audited') : t('sys.table.unaudited') }}
</Tag>
</template>
</template>
</BasicTable>
<a-modal v-model:open="openExportData" title="确认导出" :confirm-loading="confirmLoading"
@ok="handleExportOk" @cancel="handleExportCancel" okText="导出">
<a-modal v-model:open="openExportData" :title="t('sys.table.confirmExport')" :confirm-loading="confirmLoading"
@ok="handleExportOk" @cancel="handleExportCancel" :ok-text="t('sys.table.confirmExportTextOne')">
<div style="text-align: center">
<p>即将导出{{dataSum}}条数据,请耐心等待。</p>
<p>如需导出明细数据(可能耗时较长),请勾选下方复选框。</p>
<a-checkbox v-model:checked="exportDetailData">需要导出明细数据</a-checkbox>
<p>{{ t('sys.table.confirmExportTextOne') }} {{ dataSum }} {{ t('sys.table.confirmExportTextTwo') }}</p>
<p>{{ t('sys.table.confirmExportTextThree') }}</p>
<a-checkbox v-model:checked="exportDetailData">{{ t('sys.table.confirmExportTextFour') }}</a-checkbox>
</div>
</a-modal>
<AddEditModal ref="addEditModalRef" @cancel="handleCancel"></AddEditModal>
Expand Down Expand Up @@ -80,7 +82,7 @@ export default defineComponent({
const dataSum = ref<number>(0);
const [receiptViewModal, {openModal: openReceiptViewModal}] = useModal();
const [registerTable, { reload, getSelectRows, getForm, getDataSource }] = useTable({
title: '零售退货列表',
title: t('retail.refund.title'),
rowKey: 'id',
api: getRefundPageList,
columns: columns,
Expand All @@ -98,7 +100,7 @@ export default defineComponent({
showTableSetting: true,
actionColumn: {
width: 80,
title: '操作',
title: t('common.operating'),
dataIndex: 'action',
fixed: undefined,
},
Expand All @@ -111,7 +113,7 @@ export default defineComponent({
async function handleBatchDelete() {
const data = getSelectRows();
if (data.length === 0) {
createMessage.warn('请选择一条数据');
createMessage.warn(t('retail.selectData'));
return;
}
const result = await deleteRefund(data.map((item) => item.id));
Expand All @@ -122,7 +124,7 @@ export default defineComponent({

function handleEdit(record: Recordable) {
if (record.status === 1) {
createMessage.warn('抱歉,只有未审核的单据才能编辑!');
createMessage.warn(t('retail.modifyDataPrompt'));
return;
}
addEditModalRef.value.openAddEditModal(record.id);
Expand Down Expand Up @@ -168,7 +170,7 @@ export default defineComponent({
async function handleOnStatus(newStatus: number) {
const data = getSelectRows();
if (data.length === 0) {
createMessage.warn('请选择一条数据');
createMessage.warn(t('retail.selectData'));
return;
}

Expand All @@ -182,7 +184,7 @@ export default defineComponent({
async function handleExport() {
dataSum.value = getDataSource().length;
if (dataSum.value === 0) {
createMessage.warn('当前查询条件下无数据可导出');
createMessage.warn(t('retail.refund.export.noData'));
return;
}
openExportData.value = true;
Expand All @@ -204,7 +206,7 @@ export default defineComponent({
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
const timestamp = getTimestamp(new Date());
link.download = "零售退货数据" + timestamp + ".xlsx";
link.download = t('retail.refund.export.exportData') + timestamp + ".xlsx";
link.target = "_blank";
link.click();
}
Expand Down
Loading
Loading