Commit e2080128 authored by shuiluo's avatar shuiluo

feat: 任务中心国际化完成

parent 5004a108
...@@ -6,6 +6,7 @@ import InputLang from './input'; ...@@ -6,6 +6,7 @@ import InputLang from './input';
import OtherLang from './other'; import OtherLang from './other';
import acronLang from './acron'; import acronLang from './acron';
import basicLang from './basic'; import basicLang from './basic';
import taskCenterLang from './task_center';
const zh_CN = {}; const zh_CN = {};
const en_US = {}; const en_US = {};
...@@ -29,5 +30,6 @@ formatLang(InputLang); ...@@ -29,5 +30,6 @@ formatLang(InputLang);
formatLang(OtherLang); formatLang(OtherLang);
formatLang(acronLang); formatLang(acronLang);
formatLang(basicLang); formatLang(basicLang);
formatLang(taskCenterLang);
export { en_US, zh_CN }; export { en_US, zh_CN };
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
'table.view': ['查看', 'View'], 'table.view': ['查看', 'View'],
'table.export': ['导出', 'export'], 'table.export': ['导出', 'export'],
'table.placeName': ['地点名称', 'Place Name'], 'table.placeName': ['地点名称', 'Place Name'],
'table.place': ['地点', 'place'], 'table.place': ['地点', 'Place'],
'table.QrCode': ['二维码', 'Qr Code'], 'table.QrCode': ['二维码', 'Qr Code'],
'table.ElectronicTags': ['电子标签', 'Electronic tags'], 'table.ElectronicTags': ['电子标签', 'Electronic tags'],
'table.exemption': ['免检', 'Exemption'], 'table.exemption': ['免检', 'Exemption'],
...@@ -70,4 +70,11 @@ export default { ...@@ -70,4 +70,11 @@ export default {
'table.distributionModeError': ['请选择分配方式', 'Please Select Distribution Mode'], 'table.distributionModeError': ['请选择分配方式', 'Please Select Distribution Mode'],
'table.yes': ['', 'YES'], 'table.yes': ['', 'YES'],
'table.no': ['', 'NO'], 'table.no': ['', 'NO'],
'table.patrolResults': ['巡查结果', 'Patrol Results'],
'table.patrolTime': ['巡查时间', 'Patrol Time'],
'table.collectData': ['采集数据', 'Collect Data'],
'table.referenceValue': ['参考值', 'Reference Value'],
'table.inspectionItems': ['巡检项目', 'Patrol Inspection Items'],
'table.errors': ['异常', 'Errors'],
'table.completionRate': ['完成率', 'Completion Rate'],
}; };
export default {
'task.remarksAndAttachments': ['备注 & 附件', 'Remarks & Attachments'],
'task.images': ['图片', 'Images'],
'task.videos': ['视频', 'Videos'],
};
...@@ -10,42 +10,28 @@ ...@@ -10,42 +10,28 @@
ref="table" ref="table"
> >
<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
v-model="query.startTime" v-model="query.startTime"
valueFormat="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss"
:placeholder="$t('select.placeholder')"
/> />
</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
v-model="query.endTime" v-model="query.endTime"
valueFormat="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss"
:placeholder="$t('select.placeholder')"
/> />
</MoreItem> </MoreItem>
</template> </template>
<template #moreSearch="{ query }"> <template #moreSearch="{ query }">
<MoreItem label="开始时间"> <MoreItem :label="$t('table.place')">
<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 <UrlSelect
v-model="query.placeId" v-model="query.placeId"
:url="`/ranger/inspection/api/v1/place/regions/${row.regionId}/list`" :url="`/ranger/inspection/api/v1/place/regions/${row.regionId}/list`"
...@@ -54,7 +40,7 @@ ...@@ -54,7 +40,7 @@
/> />
</MoreItem> </MoreItem>
<MoreItem label="单元"> <MoreItem :label="$t('table.unit')">
<UrlSelect <UrlSelect
v-model="query.unitId" v-model="query.unitId"
:url=" :url="
...@@ -67,7 +53,7 @@ ...@@ -67,7 +53,7 @@
/> />
</MoreItem> </MoreItem>
<MoreItem label="项目"> <MoreItem :label="$t('table.item')">
<UrlSelect <UrlSelect
v-model="query.itemId" v-model="query.itemId"
:url=" :url="
...@@ -78,7 +64,7 @@ ...@@ -78,7 +64,7 @@
/> />
</MoreItem> </MoreItem>
<MoreItem label="巡检状态"> <MoreItem :label="$t('select.examine')">
<UrlSelect <UrlSelect
v-model="query.inspectionState" v-model="query.inspectionState"
:url="zhuangTaiUrl" :url="zhuangTaiUrl"
...@@ -87,7 +73,7 @@ ...@@ -87,7 +73,7 @@
/> />
</MoreItem> </MoreItem>
<MoreItem label="巡查结果"> <MoreItem :label="$t('table.patrolResults')">
<UrlSelect <UrlSelect
:url="xunChaJieGuoUrl" :url="xunChaJieGuoUrl"
v-model="query.inspectionResultName" v-model="query.inspectionResultName"
...@@ -96,7 +82,7 @@ ...@@ -96,7 +82,7 @@
/> />
</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"
...@@ -111,13 +97,17 @@ ...@@ -111,13 +97,17 @@
<ViewDetailCom v-bind="drawer" /> <ViewDetailCom v-bind="drawer" />
</template> </template>
<a-table-column title="巡检项目" data-index="taskName" /> <a-table-column :title="$t('table.inspectionItems')" data-index="taskName" />
<a-table-column title="参考值" data-index="referenceValue" width="150px" /> <a-table-column :title="$t('table.referenceValue')" data-index="referenceValue" width="150px" />
<a-table-column title="采集数据" data-index="value" width="150px" /> <a-table-column :title="$t('table.collectData')" data-index="value" width="150px" />
<a-table-column title="巡查结果" data-index="inspectionResultName" width="100px" /> <a-table-column
<a-table-column title="巡查时间" data-index="inspectionTime" width="200px" /> :title="$t('table.patrolResults')"
<a-table-column title="巡检人" data-index="inspectionStaffName" width="100px" /> data-index="inspectionResultName"
<a-table-column title="状态" data-index="inspectionStateName" width="100px" /> width="100px"
/>
<a-table-column :title="$t('table.patrolTime')" data-index="inspectionTime" width="200px" />
<a-table-column :title="$t('select.examiner')" data-index="inspectionStaffName" width="100px" />
<a-table-column :title="$t('table.state')" data-index="inspectionStateName" width="100px" />
</Table> </Table>
</Wraper> </Wraper>
</template> </template>
...@@ -139,14 +129,14 @@ export default { ...@@ -139,14 +129,14 @@ export default {
return { return {
scroll: { x: 1200, y: 500 }, scroll: { x: 1200, y: 500 },
buttons: { buttons: {
title: '备注 & 附件', title: this.$t('task.remarksAndAttachments'),
options: { options: {
fixed: 'right', fixed: 'right',
width: 100, width: 100,
}, },
data: [ data: [
{ {
label: '查看', label: this.$t('table.view'),
click: this.viewDetail, click: this.viewDetail,
}, },
], ],
...@@ -166,7 +156,7 @@ export default { ...@@ -166,7 +156,7 @@ export default {
}, },
methods: { methods: {
viewDetail(row) { viewDetail(row) {
this.$refs.table.show({ row, title: '备注 & 附件' }); this.$refs.table.show({ row, title: this.$t('task.remarksAndAttachments') });
}, },
}, },
}; };
......
<template> <template>
<Wraper :hidden="hidden" :onOk="submit" :refresh="refresh"> <Wraper :hidden="hidden" :onOk="submit" :refresh="refresh">
<a-form-model layout="vertical" :model="form" :rules="rules" ref="form"> <a-form-model layout="vertical" :model="form" :rules="rules" ref="form">
<a-form-model-item label="地区" prop="regionId"> <a-form-model-item :label="$t('select.region')" prop="regionId">
<UrlSelect <UrlSelect
url="/ranger/inspection/api/v1/region/list" url="/ranger/inspection/api/v1/region/list"
v-model="form.regionId" v-model="form.regionId"
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="线路" prop="routeId"> <a-form-model-item :label="$t('select.routes')" prop="routeId">
<UrlSelect <UrlSelect
:url="xianLuUrl" :url="xianLuUrl"
labelFiled="routeName" labelFiled="routeName"
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="班组" prop="shiftType"> <a-form-model-item :label="$t('select.shiftTypeName')" prop="shiftType">
<RequestSelect <RequestSelect
:request="getBanZuListApi" :request="getBanZuListApi"
v-model="form.shiftType" v-model="form.shiftType"
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="任务时间" prop="jobTime"> <a-form-model-item :label="$t('table.jobTime')" prop="jobTime">
<a-date-picker <a-date-picker
showTime showTime
class="tw-w-full" class="tw-w-full"
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="巡检人" prop="inspectionIdList"> <a-form-model-item :label="$t('select.examiner')" prop="inspectionIdList">
<SearchSelect <SearchSelect
url="/api/v1/users/searching" url="/api/v1/users/searching"
searchField="userName" searchField="userName"
...@@ -69,11 +69,11 @@ export default { ...@@ -69,11 +69,11 @@ export default {
getBanZuListApi: getStaticDataByTwoParamsApi('rpis_route_schedule', 'shift_type'), getBanZuListApi: getStaticDataByTwoParamsApi('rpis_route_schedule', 'shift_type'),
form: {}, form: {},
rules: { rules: {
inspectionIdList: [{ required: true }], inspectionIdList: [{ required: true, message: this.$t('select.placeholder') }],
jobTime: [{ required: true }], jobTime: [{ required: true, message: this.$t('select.placeholder') }],
shiftType: [{ required: true }], shiftType: [{ required: true, message: this.$t('select.placeholder') }],
routeId: [{ required: true }], routeId: [{ required: true, message: this.$t('select.placeholder') }],
regionId: [{ required: true }], regionId: [{ required: true, message: this.$t('select.regionError') }],
}, },
}; };
}, },
......
...@@ -2,37 +2,33 @@ ...@@ -2,37 +2,33 @@
<Wraper noFooter :hidden="hidden"> <Wraper noFooter :hidden="hidden">
<a-space class="tw-mb-6" size="large"> <a-space class="tw-mb-6" size="large">
<span> <span>
地点 {{ $t('table.place') }}
<span class="tw-text-blue-500 tw-mx-1">{{ row.placeNum }}</span> <span class="tw-text-blue-500 tw-mx-1">{{ row.placeNum }}</span>
</span> </span>
<span> <span>
单元 {{ $t('table.unit') }}
<span class="tw-text-blue-500 tw-mx-1">{{ row.unitNum }}</span> <span class="tw-text-blue-500 tw-mx-1">{{ row.unitNum }}</span>
</span> </span>
<span> <span>
项目 {{ $t('table.item') }}
<span class="tw-text-blue-500 tw-mx-1">{{ row.itemNum }}</span> <span class="tw-text-blue-500 tw-mx-1">{{ row.itemNum }}</span>
</span> </span>
<span> <span>
异常 {{ $t('table.errors') }}
<span class="tw-text-red-500 tw-mx-1">{{ row.abnormalNum }}</span> <span class="tw-text-red-500 tw-mx-1">{{ row.abnormalNum }}</span>
</span> </span>
<span> <span>
完成率 {{ $t('table.completionRate') }}
<span class="tw-text-blue-500 tw-mx-1"> <span class="tw-text-blue-500 tw-mx-1">
{{ row.unitNum ? (row.finishedNum / row.unitNum).toFixed(2) : 0 }} {{ row.unitNum ? (row.finishedNum / row.unitNum).toFixed(2) : 0 }}
</span> </span>
</span> </span>
</a-space> </a-space>
<Table :url="tableUrl" rowKey="progressId" noPadding> <Table :url="tableUrl" rowKey="progressId" noPadding>
<a-table-column title="地点名称" data-index="placeName" /> <a-table-column :title="$t('table.placeName')" data-index="placeName" />
<a-table-column title="开始时间" data-index="inspectionStartTime" /> <a-table-column :title="$t('select.startTime')" data-index="inspectionStartTime" />
<a-table-column title="结束时间" data-index="inspectionEndTime" /> <a-table-column :title="$t('select.endTime')" data-index="inspectionEndTime" />
<a-table-column title="状态" data-index="inspectionStateName" /> <a-table-column :title="$t('table.state')" data-index="inspectionStateName" />
</Table> </Table>
</Wraper> </Wraper>
</template> </template>
...@@ -44,9 +40,6 @@ import Table from '@/components/table/table.vue'; ...@@ -44,9 +40,6 @@ import Table from '@/components/table/table.vue';
export default { export default {
props: { hidden: Function, row: Object }, props: { hidden: Function, row: Object },
components: { Wraper, Table }, components: { Wraper, Table },
mounted() {
console.log(this.row);
},
computed: { computed: {
tableUrl() { tableUrl() {
return `/ranger/inspection/api/v1/jobs/progress?jobId=${this.row.jobId}`; return `/ranger/inspection/api/v1/jobs/progress?jobId=${this.row.jobId}`;
......
<template> <template>
<Wraper noFooter :hidden="hidden"> <Wraper noFooter :hidden="hidden">
<span>备注</span> <span>{{ $t('table.remark') }}</span>
<div style="min-height: 100px" class="tw-font-medium tw-mt-2">{{ detailData.inspectionRemark }}</div> <div style="min-height: 100px" class="tw-font-medium tw-mt-2">{{ detailData.inspectionRemark }}</div>
<a-tabs> <a-tabs>
<!-- Todo --> <!-- Todo -->
<a-tab-pane key="1" tab="图片"></a-tab-pane> <a-tab-pane key="1" :tab="$t('task.images')"></a-tab-pane>
<a-tab-pane key="2" tab="视频"></a-tab-pane> <a-tab-pane key="2" :tab="$t('task.videos')"></a-tab-pane>
</a-tabs> </a-tabs>
</Wraper> </Wraper>
</template> </template>
......
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