Commit 9ddea3b7 authored by shuiluo's avatar shuiluo

feat: 地区管理国际化完成

parent cdfbe141
<template>
<a-popconfirm :title="title" ok-text="确认" cancel-text="取消" @confirm="confirm">
<a>{{ label }}</a>
<a-popconfirm
:title="title || $t('table.confirmDelete')"
:ok-text="$t('table.confirm')"
:cancel-text="$t('table.cancel')"
@confirm="confirm"
>
<a>{{ label || $t('table.delete') }}</a>
</a-popconfirm>
</template>
......@@ -17,7 +22,6 @@ export default {
},
title: {
type: String,
default: '确认是否删除',
},
onOk: {
type: Function,
......@@ -25,7 +29,6 @@ export default {
},
label: {
type: String,
default: '删除',
},
},
methods: {
......
......@@ -8,9 +8,11 @@
<template>
<a-divider />
<a-space class="tw-justify-end">
<a-button @click="cancel">取消</a-button>
<a-button @click="cancel">{{ $t('table.cancel') }}</a-button>
<slot name="footer" v-if="!noFooter">
<a-button type="primary" @click="ok" :loading="loading">确认</a-button>
<a-button type="primary" @click="ok" :loading="loading">
{{ $t('table.confirm') }}
</a-button>
</slot>
</a-space>
</template>
......
......@@ -9,7 +9,7 @@ export default {
'table.inspectionStartTime': ['巡检开始时间', 'InspectionStartTime'],
'table.inspectionEndTime': ['巡检结束时间', 'InspectionEndTime'],
'table.newTemporaryTask': ['新建临时任务', 'New Temporary Task'],
'table.detail': ['详情', 'Detail'],
'table.details': ['详情', 'Details'],
'table.progress': ['进度', 'Progress'],
'table.pleaseSelect': ['请选择需要导出的数据', 'Please select the data to export'],
'table.taskDetail': ['任务明细', 'Task Detail'],
......@@ -18,4 +18,14 @@ export default {
content: ['内容', 'Content'],
sender: ['发送者', 'Sender'],
recipient: ['接受者', 'Recipient'],
'table.organization': ['所属组织', 'Organization'],
'table.regionName': ['地区名称', 'RegionName'],
'table.remark': ['备注', 'Remark'],
'table.reviser': ['修改人', 'Reviser'],
'table.revisionTime': ['修改时间', 'Revision Time'],
'table.edit': ['编辑', 'Edit'],
'table.confirm': ['确认', 'Confirm'],
'table.cancel': ['取消', 'Cancel'],
'table.delete': ['删除', 'Delete'],
'table.confirmDelete': ['确认是否删除', 'Confirm To Delete']
};
<template>
<Wraper :hidden="hidden" :onOk="submit" :refresh="refresh" :noFooter="isView">
<a-form-model layout="vertical" :model="form" :rules="rules" ref="form">
<a-form-model-item label="地区名称" prop="regionName">
<a-input v-model="form.regionName" :disabled="isView" />
<a-form-model-item :label="$t('table.regionName')" prop="regionName">
<a-input
v-model="form.regionName"
:disabled="isView"
:placeholder="$t('input.placeholder')"
/>
</a-form-model-item>
<a-form-model-item label="所属组织" prop="organizationId">
<a-form-model-item :label="$t('table.organization')" prop="organizationId">
<UrlSelect
url="/api/v1/users/organizations"
labelFiled="orgName"
......@@ -15,8 +19,13 @@
/>
</a-form-model-item>
<a-form-model-item label="备注" prop="remark">
<a-textarea placeholder="Basic usage" :rows="4" v-model="form.remark" :disabled="isView" />
<a-form-model-item :label="$t('table.remark')" prop="remark">
<a-textarea
:rows="4"
v-model="form.remark"
:disabled="isView"
:placeholder="$t('input.placeholder')"
/>
</a-form-model-item>
</a-form-model>
</Wraper>
......
......@@ -7,7 +7,7 @@
ref="table"
>
<template #search="{ query }">
<MoreItem label="所属组织">
<MoreItem :label="$t('table.organization')">
<UrlSelect
v-model="query.organizationId"
url="/api/v1/users/organizations"
......@@ -15,8 +15,8 @@
valueFiled="orgId"
/>
</MoreItem>
<MoreItem label="地区名称">
<a-input v-model="query.regionName" />
<MoreItem :label="$t('table.regionName')">
<a-input v-model="query.regionName" :placeholder="$t('input.placeholder')" />
</MoreItem>
</template>
......@@ -24,11 +24,11 @@
<AddAndEdit v-bind="drawer" />
</template>
<a-table-column title="地区名称" data-index="regionName" />
<a-table-column title="所属组织" data-index="organizationName" />
<a-table-column title="备注" data-index="remark" />
<a-table-column title="修改人" data-index="editorName" />
<a-table-column title="修改时间" data-index="editTime" />
<a-table-column :title="$t('table.regionName')" data-index="regionName" />
<a-table-column :title="$t('table.organization')" data-index="organizationName" />
<a-table-column :title="$t('table.remark')" data-index="remark" />
<a-table-column :title="$t('table.reviser')" data-index="editorName" />
<a-table-column :title="$t('table.revisionTime')" data-index="editTime" />
</Table>
</template>
......@@ -43,8 +43,8 @@ export default {
data() {
return {
buttons: [
{ label: '编辑', click: this.edit },
{ label: '详情', click: this.view },
{ label: this.$t('table.edit'), click: this.edit },
{ label: this.$t('table.details'), click: this.view },
{
type: 'confirm',
url: (row) => `/ranger/inspection/api/v1/region/${row.regionId}`,
......@@ -58,10 +58,10 @@ export default {
this.$refs.table.getData();
},
edit(row) {
this.$refs.table.show({ row, title: '编辑', type: 'edit' });
this.$refs.table.show({ row, title: this.$t('table.edit'), type: 'edit' });
},
view(row) {
this.$refs.table.show({ row, title: '编辑', type: 'view' });
this.$refs.table.show({ row, title: this.$t('table.details'), type: 'view' });
},
},
};
......
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