Commit 4bc57953 authored by shuiluo's avatar shuiluo

feat: 线路配置部分国际化完成

parent 503779fb
export default {
'basic.layout': ['编排', 'Layout'],
'basic.dispatch': ['调度', 'Dispatch'],
'basic.personalDistribution': ['按人分配', 'Personal Distribution'],
'basic.distributionBySpecialty': ['按专业分配', 'Distribution By Specialty'],
'basic.expirationMethod': ['过期方式', 'Expiration Method'],
'basic.expirationMethodError': ['请选择过期方式', 'Please Select Expiration Method'],
'basic.nextTaskBegins': ['下次任务开始过期', 'The Next Task Begins To Expire'],
'basic.oneDay': ['一天后过期', 'Expires In One Day'],
'basic.sevenDay': ['七天后过期', 'Expires In Seven Days'],
'basic.moreDay': ['十五天后过期', 'Expires In 15 Days'],
'basic.notExpired': ['不过期', 'Not Expired'],
'basic.day': ['白班', 'DAY'],
'basic.middle': ['中班', 'MIDDLE'],
'basic.night': ['晚班', 'NIGHT'],
'basic.generateNext': ['生成第二天线路', 'Generate Next Day Line'],
'basic.generateNextError': ['请选择', 'Please Select'],
'basic.executeOnce': ['执行一次', 'Execute Once'],
};
......@@ -5,6 +5,7 @@ import systemLang from './system';
import InputLang from './input';
import OtherLang from './other';
import acronLang from './acron';
import basicLang from './basic';
const zh_CN = {};
const en_US = {};
......@@ -27,5 +28,6 @@ formatLang(systemLang);
formatLang(InputLang);
formatLang(OtherLang);
formatLang(acronLang);
formatLang(basicLang);
export { en_US, zh_CN };
......@@ -4,14 +4,17 @@ export default {
'select.startTime': ['开始时间', 'Start Time'],
'select.endTime': ['结束时间', 'End Time'],
'select.region': ['地区', 'Region'],
'select.regionError': ['请选择地区', 'Please Select Region'],
'select.speciality': ['专业', 'Speciality'],
'select.shiftTypeName': ['班组', 'ShiftTypeName'],
'select.shiftTypeNameError': ['请输入班组名称', 'Pleas Enter ShiftTypeName'],
export: ['导出', 'Export'],
'select.routes': ['线路', 'Routes'],
'select.examine': ['巡检状态', 'Examine Status'],
'select.taskType': ['任务类型', 'Task Type'],
'select.examiner': ['巡检人', 'Examiner'],
'select.routeName': ['线路名称', 'Route Name'],
'select.routeNameError': ['请输入@:select.routeName', 'Please Enter @:select.routeName'],
'select.option.place': ['地点免检', 'Place Exemption'],
'select.option.unit': ['单元免检', 'Unit Exemption'],
};
......@@ -49,6 +49,7 @@ export default {
'table.dataType': ['数据类型', 'Data Type'],
'table.majorName': ['专业名称', 'Major Name'],
'table.major': ['专业', 'Major'],
'table.majorError': ['请选择@:table.major', 'Please Select @:table.major'],
'table.personnel': ['人员', 'Personnel'],
'table.department': ['部门', 'Department'],
'table.exemptionType': ['免检类型', 'Exemption Type'],
......@@ -59,4 +60,13 @@ export default {
'table.time.end': ['结束时间', 'Start End'],
'table.reason': ['原因', 'Reason'],
'table.state': ['状态', 'State'],
'table.import': ['导入', 'Import'],
'table.takeEffect': ['生效', 'Take Effect'],
'table.operationSucceeded': ['操作成功', 'Operation Succeeded'],
'table.uploadFile': ['上传文件', 'Upload File'],
'table.downloadTemplate': ['下载模板', 'Download Template'],
'table.distributionMode': ['分配方式', 'Distribution Mode'],
'table.distributionModeError': ['请选择分配方式', 'Please Select Distribution Mode'],
'table.yes': ['', 'YES'],
'table.no': ['', 'NO'],
};
<template>
<Drawer ref="drawerRef" v-model="visible" title="新增" :onOk="submit" :colesAfter="refresh">
<Drawer ref="drawerRef" v-model="visible" :title="$t('table.add')" :onOk="submit" :colesAfter="refresh">
<a-form-model layout="vertical" :model="form" :rules="rules" ref="DrawerForm">
<a-form-model-item label="班组" prop="shiftType">
<a-select v-model="form.shiftType" :disabled="isView">
<a-select-option key="DAY" value="DAY">白班</a-select-option>
<a-select-option key="MIDDLE" value="MIDDLE">中班</a-select-option>
<a-select-option key="NIGHT" value="NIGHT">晚班</a-select-option>
<a-form-model-item :label="$t('select.shiftTypeName')" prop="shiftType">
<a-select v-model="form.shiftType" :disabled="isView" :placeholder="$t('select.placeholder')">
<a-select-option key="DAY" value="DAY">{{ $t('basic.day') }}</a-select-option>
<a-select-option key="MIDDLE" value="MIDDLE">{{ $t('basic.middle') }}</a-select-option>
<a-select-option key="NIGHT" value="NIGHT">{{ $t('basic.night') }}</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="生成第二天线路" prop="isNextDay">
<a-select v-model="form.isNextDay" :disabled="isView">
<a-select-option key="YES" value="YES"></a-select-option>
<a-select-option key="NO" value="NO"></a-select-option>
<a-form-model-item :label="$t('basic.generateNext')" prop="isNextDay">
<a-select v-model="form.isNextDay" :disabled="isView" :placeholder="$t('select.placeholder')">
<a-select-option key="YES" value="YES">{{ $t('table.yes') }}</a-select-option>
<a-select-option key="NO" value="NO">{{ $t('table.no') }}</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="生成第二天线路" prop="scheduleRule">
<Acron v-model="form.scheduleRule" :disabled="isView" @input="onChang" />
<a-form-model-item :label="$t('basic.generateNext')" prop="scheduleRule">
<Acron
v-model="form.scheduleRule"
:disabled="isView"
@input="onChang"
:placeholder="$t('select.placeholder')"
/>
</a-form-model-item>
<a-form-model-item prop="scheduleDescription">
<a-input v-model="form.scheduleDescription" :disabled="true" />
<a-input
v-model="form.scheduleDescription"
:disabled="true"
:placeholder="$t('input.placeholder')"
/>
</a-form-model-item>
</a-form-model>
</Drawer>
......@@ -48,9 +57,9 @@ export default {
visible: false,
form: {},
rules: {
shiftType: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
isNextDay: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
scheduleRule: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
shiftType: [{ required: true, message: this.$t('select.shiftTypeNameError') }],
isNextDay: [{ required: true, message: this.$t('basic.generateNextError') }],
scheduleRule: [{ required: true, message: this.$t('input.error') }],
},
};
},
......@@ -66,7 +75,7 @@ export default {
},
onChang(val) {
const str = cronstrue.toString(val, { locale: langType[Lang.get().substr(0, 2)] });
this.form = { ...this.form, scheduleDescription: `${str} 执行一次` };
this.form = { ...this.form, scheduleDescription: `${str} ${this.$t('basic.executeOnce')}` };
},
},
};
......
<template>
<Wraper :hidden="hidden" noFooter>
<a-button class="tw-mb-4" type="primary" @click="onAdd">新增</a-button>
<a-button class="tw-mb-4" type="primary" @click="onAdd">{{ $t('table.add') }}</a-button>
<addDrawer ref="addDrawer" :row="row" :refresh="getList" />
<a-list :data-source="data" :grid="{ gutter: 16, xs: 1, sm: 1, md: 1, lg: 1, xl: 1, xxl: 1 }">
<a-list-item slot="renderItem" slot-scope="item">
......@@ -8,11 +8,13 @@
<template #title>
<a-row>
<a-col :span="12">
<a-tag v-if="item.shiftState === 'VALID'" color="#87d068"> 有效 </a-tag>
<a-tag v-else color="#f50"> 无效 </a-tag>
<span v-if="item.shiftType === 'DAY'">白班</span>
<span v-if="item.shiftType === 'MIDDLE'">中班</span>
<span v-if="item.shiftType === 'NIGHT'">晚班</span>
<a-tag v-if="item.shiftState === 'VALID'" color="#87d068">
{{ $t('other.tag.valid') }}
</a-tag>
<a-tag v-else color="#f50">{{ $t('other.tag.invalid') }}</a-tag>
<span v-if="item.shiftType === 'DAY'">{{ $t('basic.day') }}</span>
<span v-if="item.shiftType === 'MIDDLE'">{{ $t('basic.middle') }}</span>
<span v-if="item.shiftType === 'NIGHT'">{{ $t('basic.night') }}</span>
</a-col>
<a-col :span="12" class="tw-text-right">
<a-space>
......@@ -23,20 +25,22 @@
<a
v-if="item.shiftState === 'INVALID'"
@click="() => scheduleUpdateState(item.shiftId, 'VALID')"
>生效</a
>
{{ $t('table.takeEffect') }}
</a>
<a
v-if="item.shiftState === 'VALID'"
@click="() => scheduleUpdateState(item.shiftId, 'INVALID')"
>失效</a
>
{{ $t('task.invalid') }}
</a>
</a-space>
</a-col>
</a-row>
</template>
<div>{{ item.scheduleRule }}</div>
<div>{{ item.scheduleDescription }}</div>
<div>{{ item.isNextDay === 'YES' && '生成第二天线路' }}</div>
<div>{{ item.isNextDay === 'YES' && $t('basic.generateNext') }}</div>
</a-card>
</a-list-item>
</a-list>
......
<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="routeName">
<a-input v-model="form.routeName" :disabled="isView" />
<a-form-model-item :label="$t('select.routeName')" prop="routeName">
<a-input v-model="form.routeName" :disabled="isView" :placeholder="$t('input.placeholder')" />
</a-form-model-item>
<a-form-model-item label="所属地区" prop="regionId">
<a-form-model-item :label="$t('select.region')" prop="regionId">
<UrlSelect
v-model="form.regionId"
url="/ranger/inspection/api/v1/region/list"
......@@ -13,7 +13,7 @@
:disabled="isView"
/>
</a-form-model-item>
<a-form-model-item label="专业" prop="specialityId">
<a-form-model-item :label="$t('table.major')" prop="specialityId">
<UrlSelect
v-model="form.specialityId"
:url="
......@@ -26,23 +26,48 @@
:disabled="isView"
/>
</a-form-model-item>
<a-form-model-item label="分配方式" prop="dispatchType">
<a-select v-model="form.dispatchType" style="width: 100%" :disabled="isView">
<a-select-option key="PERSON" value="PERSON">按人分配</a-select-option>
<a-select-option key="SPECIALITY" value="SPECIALITY">按专业分配</a-select-option>
<a-form-model-item :label="$t('table.distributionMode')" prop="dispatchType">
<a-select
v-model="form.dispatchType"
style="width: 100%"
:disabled="isView"
:placeholder="$t('select.placeholder')"
>
<a-select-option key="PERSON" value="PERSON">
{{ $t('basic.personalDistribution') }}
</a-select-option>
<a-select-option key="SPECIALITY" value="SPECIALITY">
{{ $t('basic.distributionBySpecialty') }}
</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="过期方式" prop="expirationType">
<a-select v-model="form.expirationType" style="width: 100%" :disabled="isView">
<a-select-option key="NEXT" value="NEXT">下次任务开始过期</a-select-option>
<a-select-option key="ONE_DAY" value="ONE_DAY">一天后过期</a-select-option>
<a-select-option key="SEVEN_DAY" value="SEVEN_DAY">七天后过期</a-select-option>
<a-select-option key="FIFTEEN_DAY" value="FIFTEEN_DAY">十五天后过期</a-select-option>
<a-select-option key="NEVER" value="NEVER">不过期</a-select-option>
<a-form-model-item :label="$t('basic.expirationMethod')" prop="expirationType">
<a-select
v-model="form.expirationType"
style="width: 100%"
:disabled="isView"
:placeholder="$t('select.placeholder')"
>
<a-select-option key="NEXT" value="NEXT">
{{ $t('basic.nextTaskBegins') }}
</a-select-option>
<a-select-option key="ONE_DAY" value="ONE_DAY">{{ $t('basic.oneDay') }}</a-select-option>
<a-select-option key="SEVEN_DAY" value="SEVEN_DAY">
{{ $t('basic.sevenDay') }}
</a-select-option>
<a-select-option key="FIFTEEN_DAY" value="FIFTEEN_DAY">
{{ $t('basic.moreDay') }}
</a-select-option>
<a-select-option key="NEVER" value="NEVER">{{ $t('basic.notExpired') }}</a-select-option>
</a-select>
</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
:placeholder="$t('input.placeholder')"
:rows="4"
v-model="form.remark"
:disabled="isView"
/>
</a-form-model-item>
</a-form-model>
</Wraper>
......@@ -56,14 +81,14 @@ import { addRouteInfoApi, updateRouteInfoApi, getRouteInfoApi } from '@/api';
export default {
components: { Wraper, UrlSelect },
props: { hidden: Function, row: Object, type: String, refresh: Function },
data: () => ({
data: (vm) => ({
form: {},
rules: {
routeName: [{ required: true }],
regionId: [{ required: true }],
specialityId: [{ required: true }],
dispatchType: [{ required: true }],
expirationType: [{ required: true }],
routeName: [{ required: true, message: vm.$t('select.routeNameError') }],
regionId: [{ required: true, message: vm.$t('select.regionError') }],
specialityId: [{ required: true, message: vm.$t('table.majorError') }],
dispatchType: [{ required: true, message: vm.$t('table.distributionModeError') }],
expirationType: [{ required: true, message: vm.$t('basic.expirationMethodError') }],
},
}),
......
<template>
<a-modal v-model="visible" title="导入" @ok="handleOk" destroyOnClose>
<a-modal v-model="visible" :title="$t('table.import')" @ok="handleOk" destroyOnClose>
<a-form-model layout="vertical" :model="form" :rules="rules" ref="form">
<a-form-model-item label="组织" prop="orgId">
<a-form-model-item :label="$t('table.organization')" prop="orgId">
<UrlSelect
v-model="form.orgId"
url="/api/v1/users/organizations"
......@@ -9,10 +9,10 @@
valueFiled="orgId"
/>
</a-form-model-item>
<a-form-model-item label="上传文件" prop="file">
<a-form-model-item :label="$t('table.uploadFile')" prop="file">
<Upload v-model="form.file" showUploadList :number="1" />
<template #extra>
<a-button type="link" @click="getTemplate"> 下载模板 </a-button>
<a-button type="link" @click="getTemplate">{{ $t('table.downloadTemplate') }}</a-button>
</template>
</a-form-model-item>
</a-form-model>
......@@ -49,7 +49,7 @@ export default {
const { file, ...rest } = this.form;
await uploadFileRouteApi({ ...rest }, file[0].oFile);
this.afterSubmit && this.afterSubmit();
this.$message.info('操作成功!');
this.$message.info(this.$t('table.operationSucceeded!'));
this.closeModal();
},
closeModal() {
......
......@@ -9,22 +9,23 @@
:scroll="scroll"
>
<template #search="{ query }">
<MoreItem label="状态">
<MoreItem :label="$t('table.state')">
<a-select v-model="query.routeState" style="width: 100%">
<a-select-option key="VALID" value="VALID">有效</a-select-option>
<a-select-option key="INVALID" value="INVALID">无效</a-select-option>
<a-select-option key="VALID" value="VALID">{{ $t('other.tag.valid') }}</a-select-option>
<a-select-option key="INVALID" value="INVALID">
{{ $t('other.tag.invalid') }}
</a-select-option>
</a-select>
</MoreItem>
<MoreItem label="地区">
<MoreItem :label="$t('select.region')">
<UrlSelect
v-model="query.regionId"
url="/ranger/inspection/api/v1/region/list"
labelFiled="regionName"
valueFiled="regionId"
placeholder="选择地区"
/>
</MoreItem>
<MoreItem label="专业">
<MoreItem :label="$t('select.speciality')">
<UrlSelect
v-model="query.specialityId"
:url="
......@@ -34,30 +35,29 @@
"
labelFiled="specialityName"
valueFiled="specialityId"
placeholder="选择专业"
/>
</MoreItem>
<MoreItem label="线路名称">
<a-input v-model="query.inputValue" placeholder="请输入" />
<MoreItem :label="$t('select.routeName')">
<a-input v-model="query.inputValue" :placeholder="$t('input.placeholder')" />
</MoreItem>
</template>
<template #operation>
<a-button type="primary" @click="onImportFlie">导入</a-button>
<a-button type="primary" @click="onImportFlie">{{ $t('table.import') }}</a-button>
<a-button @click="download" :disabled="!(selected.keys && selected.keys.length !== 0)">
导出
{{ $t('export') }}
</a-button>
<a-button
@click="() => onChangeState('VALID')"
:disabled="!(selected.keys && selected.keys.length !== 0)"
>
生效
{{ $t('table.takeEffect') }}
</a-button>
<a-button
@click="() => onChangeState('INVALID')"
:disabled="!(selected.keys && selected.keys.length !== 0)"
>
失效
{{ $t('task.invalid') }}
</a-button>
</template>
......@@ -69,17 +69,17 @@
<!-- <Exempt v-else v-bind="drawer" /> -->
</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="状态">
<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('table.state')">
<template #default="row">
<span v-if="row.routeState === 'VALID'">有效</span>
<span v-if="row.routeState === 'INVALID'">无效</span>
<span v-if="row.routeState === 'VALID'">{{ $t('other.tag.valid') }}</span>
<span v-if="row.routeState === 'INVALID'">{{ $t('other.tag.invalid') }}</span>
</template>
</a-table-column>
<a-table-column title="修改人" data-index="editorName" width="200" />
<a-table-column title="修改时间" data-index="editTime" />
<a-table-column :title="$t('table.reviser')" data-index="editorName" width="200" />
<a-table-column :title="$t('table.revisionTime')" data-index="editTime" />
<template #other>
<ImportFlie ref="importFlie" :afterSubmit="rest" />
</template>
......@@ -103,14 +103,13 @@ export default {
data() {
return {
buttons: {
title: '操作',
options: { width: 200, fixed: 'right' },
data: [
{ label: '编辑', click: this.edit },
{ label: '详情', click: this.view },
{ label: '编排', click: this.assemble },
{ label: '调度', click: this.schedule },
{ label: '人员', click: this.personnel },
{ label: this.$t('table.edit'), click: this.edit },
{ label: this.$t('table.view'), click: this.view },
{ label: this.$t('basic.layout'), click: this.assemble },
{ label: this.$t('basic.dispatch'), click: this.schedule },
{ label: this.$t('table.personnel'), click: this.personnel },
{
type: 'confirm',
url: (row) => `/ranger/inspection/api/v1/routes/${row.routeId}`,
......@@ -127,22 +126,22 @@ 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.view'), type: 'view' });
},
schedule(row) {
this.$refs.table.show({ row, title: '调度', type: 'schedule' });
this.$refs.table.show({ row, title: this.$t('basic.dispatch'), type: 'schedule' });
},
personnel(row) {
this.$refs.table.show({ row, title: '调度', type: 'personnel' });
this.$refs.table.show({ row, title: this.$t('table.personnel'), type: 'personnel' });
},
assemble(row) {
this.$refs.table.show({ row, title: '编排', type: 'assemble', dWidth: 1200 });
this.$refs.table.show({ row, title: this.$t('basic.layout'), type: 'assemble', dWidth: 1200 });
},
async download() {
if (!this.selected?.keys?.length) return this.$message.error('请选择需要导出的数据');
if (!this.selected?.keys?.length) return this.$message.error(this.$t('table.export.tip'));
const resp = await exportRouteData({ routeIdList: this.selected.keys.join(',') });
downloadFile(resp, 'xlsx');
},
......@@ -152,7 +151,7 @@ export default {
routeState: state,
};
await updateRouteStateApi(data);
this.$message.info('操作成功!');
this.$message.info(this.$t('table.operationSucceeded!'));
this.rest();
},
......
......@@ -8,7 +8,10 @@
list-type="picture"
>
<slot>
<a-button v-if="fileList.length < number"> <a-icon type="upload" /> 上传 </a-button>
<a-button v-if="fileList.length < number">
<a-icon type="upload" />
{{ $t('user.upload') }}
</a-button>
</slot>
</a-upload>
</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