Commit d5048795 authored by shuiluo's avatar shuiluo

feat: 国际化代码优化和完善

parent fc8aea41
......@@ -2,7 +2,7 @@
<a-select
show-search
class="tw-w-full"
placeholder="input search text"
:placeholder="$t('input.placeholder')"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
......
......@@ -16,11 +16,13 @@ export default {
<style module lang="less">
.container {
max-width: 400px;
> :last-child {
flex: 1;
}
}
.label {
color: rgba(0, 0, 0, 0.85);
width: 6em;
text-align: right;
margin-right: 1em;
......
// 0 中文, 1 英文
export default {
'select.placeholder': ['请选择', 'Please Select'],
'select.startTime': ['开始时间', 'Start Time'],
'select.endTime': ['结束时间', 'End Time'],
'select.region': ['地区', 'Region'],
'select.speciality': ['专业', 'Speciality'],
'select.shiftTypeName': ['班组', 'ShiftTypeName'],
export: ['导出', 'Export'],
'select.routes': ['线路', 'Routes'],
'select.examine': ['巡检状态', 'Examine Status'],
'select.taskType': ['任务类型', 'Task Type'],
'select.examiner': ['巡检人', 'Examiner'],
'select.routeName': ['线路名称', 'RouteName'],
};
......@@ -4,4 +4,14 @@ export default {
'table.reset': ['重置', 'Reset'],
'table.add': ['新增', 'Add'],
'table.search': ['查询', 'Search'],
'input.placeholder': ['请输入', 'Please Input'],
'table.jobTime': ['任务时间', 'Job Time'],
'table.inspectionStartTime': ['巡检开始时间', 'InspectionStartTime'],
'table.inspectionEndTime': ['巡检结束时间', 'InspectionEndTime'],
'table.newTemporaryTask': ['新建临时任务', 'New Temporary Task'],
'table.detail': ['详情', 'Detail'],
'table.progress': ['进度', 'Progress'],
'table.pleaseSelect': ['请选择需要导出的数据', 'Please select the data to export'],
'table.taskDetail': ['任务明细', 'Task Detail'],
'table.taskProgress': ['任务进度', 'Task Progress'],
};
......@@ -10,7 +10,7 @@
:scroll="scroll"
>
<template #search="{ query }">
<MoreItem label="开始时间">
<MoreItem :label="$t('select.startTime')">
<a-date-picker
class="tw-w-full"
show-time
......@@ -19,7 +19,7 @@
/>
</MoreItem>
<MoreItem label="结束时间">
<MoreItem :label="$t('select.endTime')">
<a-date-picker
class="tw-w-full"
show-time
......@@ -27,7 +27,7 @@
valueFormat="YYYY-MM-DD HH:mm:ss"
/>
</MoreItem>
<MoreItem label="地区">
<MoreItem :label="$t('select.region')">
<UrlSelect
url="/ranger/inspection/api/v1/region/list"
v-model="query.regionId"
......@@ -38,31 +38,7 @@
</template>
<template #moreSearch="{ query }">
<MoreItem label="开始时间">
<a-date-picker
class="tw-w-full"
show-time
v-model="query.startTime"
valueFormat="YYYY-MM-DD HH:mm:ss"
/>
</MoreItem>
<MoreItem label="结束时间">
<a-date-picker
class="tw-w-full"
show-time
v-model="query.endTime"
valueFormat="YYYY-MM-DD HH:mm:ss"
/>
</MoreItem>
<MoreItem label="地区">
<UrlSelect
url="/ranger/inspection/api/v1/region/list"
v-model="query.regionId"
labelFiled="regionName"
valueFiled="regionId"
/>
</MoreItem>
<MoreItem label="专业">
<MoreItem :label="$t('select.speciality')">
<UrlSelect
:url="
query.regionId
......@@ -74,7 +50,7 @@
valueFiled="specialityId"
/>
</MoreItem>
<MoreItem label="线路">
<MoreItem :label="$t('select.routes')">
<UrlSelect
:url="
query.regionId
......@@ -86,7 +62,7 @@
v-model="query.routeId"
/>
</MoreItem>
<MoreItem label="班组">
<MoreItem :label="$t('select.shiftTypeName')">
<RequestSelect
:request="getBanZuListApi"
v-model="query.shiftType"
......@@ -94,7 +70,7 @@
valueFiled="paramValue"
/>
</MoreItem>
<MoreItem label="巡检状态">
<MoreItem :label="$t('select.examine')">
<RequestSelect
:request="getBusinessListApi"
v-model="query.inspectionState"
......@@ -102,7 +78,7 @@
valueFiled="paramValue"
/>
</MoreItem>
<MoreItem label="任务类型">
<MoreItem :label="$t('select.taskType')">
<RequestSelect
:request="getTaskTypeApi"
v-model="query.jobType"
......@@ -110,7 +86,7 @@
valueFiled="paramValue"
/>
</MoreItem>
<MoreItem label="巡检人">
<MoreItem :label="$t('select.examiner')">
<SearchSelect
url="/api/v1/users/searching"
searchField="userName"
......@@ -122,7 +98,7 @@
</template>
<template #operation>
<a-button @click="download">导出</a-button>
<a-button @click="download">{{ $t('export') }}</a-button>
</template>
<template #drawer="{ hidden, refresh, type, row }">
......@@ -131,16 +107,16 @@
<Detail v-if="type === 'detail'" :hidden="hidden" :row="row" />
</template>
<a-table-column title="线路名称" data-index="routeName" />
<a-table-column title="专业" data-index="specialityName" />
<a-table-column title="地区" data-index="regionName" />
<a-table-column title="班组" data-index="shiftTypeName" />
<a-table-column title="任务时间" data-index="jobTime" />
<a-table-column title="巡检状态" data-index="inspectionStateName" />
<a-table-column title="任务类型" data-index="jobTypeName" />
<a-table-column title="巡检开始时间" data-index="inspectionStartTime" />
<a-table-column title="巡检结束时间" data-index="inspectionEndTime" />
<a-table-column title="巡检人" data-index="lastInspectionStaffName" />
<a-table-column :title="$t('select.routeName')" data-index="routeName" />
<a-table-column :title="$t('select.speciality')" data-index="specialityName" />
<a-table-column :title="$t('select.region')" data-index="regionName" />
<a-table-column :title="$t('select.shiftTypeName')" data-index="shiftTypeName" width="180px" />
<a-table-column :title="$t('table.jobTime')" data-index="jobTime" />
<a-table-column :title="$t('select.examine')" data-index="inspectionStateName" />
<a-table-column :title="$t('select.taskType')" data-index="jobTypeName" />
<a-table-column :title="$t('table.inspectionStartTime')" data-index="inspectionStartTime" />
<a-table-column :title="$t('table.inspectionEndTime')" data-index="inspectionEndTime" />
<a-table-column :title="$t('select.examiner')" data-index="lastInspectionStaffName" />
</Table>
</template>
......@@ -174,16 +150,16 @@ export default {
getBanZuListApi: () => getStaticDataByTwoParamsApi('rpis_route_schedule', 'shift_type'),
getTaskTypeApi: () => getStaticDataByTwoParamsApi('rpis_route_schedule', 'job_type'),
addBtn: {
title: '新建临时任务',
title: this.$t('table.newTemporaryTask'),
},
buttons: {
options: { fixed: 'right', width: 200 },
data: [
{
label: '详情',
label: this.$t('table.detail'),
click: this.viewDetail,
},
{ label: '进度', click: this.viewProgress },
{ label: this.$t('table.progress'), click: this.viewProgress },
{
type: 'confirm',
url: (row) => `/ranger/inspection/api/v1/jobs/${row.jobId}`,
......@@ -197,7 +173,7 @@ export default {
},
methods: {
async download() {
if (!this.selected?.keys?.length) return this.$message.error('请选择需要导出的数据');
if (!this.selected?.keys?.length) return this.$message.error(this.$t('table.pleaseSelect'));
const url = await getXunJianDownloadUrlApi(this.selected.keys);
downloadFileByUrl(`${this.$fileUrl}${url}`);
},
......@@ -205,10 +181,10 @@ export default {
this.$refs['table'].getData();
},
viewProgress(row) {
this.$refs.table.show({ title: '任务进度', type: 'progress', row });
this.$refs.table.show({ title: this.$t('table.taskProgress'), type: 'progress', row });
},
viewDetail(row) {
this.$refs.table.show({ title: '任务明细', type: 'detail', row });
this.$refs.table.show({ title: this.$t('table.taskDetail'), type: 'detail', row });
},
},
};
......
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