Commit d5048795 authored by shuiluo's avatar shuiluo

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

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