Commit 5004a108 authored by shuiluo's avatar shuiluo

线路编排国际化完成

parent 4bc57953
......@@ -16,4 +16,15 @@ export default {
'basic.generateNext': ['生成第二天线路', 'Generate Next Day Line'],
'basic.generateNextError': ['请选择', 'Please Select'],
'basic.executeOnce': ['执行一次', 'Execute Once'],
'basic.staffName': ['姓名', 'StaffName'],
'basic.newLocation': ['新增地点', 'New Location'],
'basic.name': ['名称', 'Name'],
'basic.place': ['地点', 'Place'],
'basic.unit': ['单元', 'Unit'],
'basic.item': ['项目', 'Item'],
'basic.addUnit': ['新增单元', 'Add Unit'],
'basic.addItem': ['新增项目', 'Add Item'],
'basic.topping': ['置顶', 'Topping'],
'basic.setSort': ['设置排序', 'Set Sort'],
'basic.unitNameSeach': ['单元名称/设备编号', 'Unit Name/Equipment Number'],
};
......@@ -63,6 +63,7 @@ export default {
'table.import': ['导入', 'Import'],
'table.takeEffect': ['生效', 'Take Effect'],
'table.operationSucceeded': ['操作成功', 'Operation Succeeded'],
'table.operationFailed': ['操作失败', 'Operation Failed'],
'table.uploadFile': ['上传文件', 'Upload File'],
'table.downloadTemplate': ['下载模板', 'Download Template'],
'table.distributionMode': ['分配方式', 'Distribution Mode'],
......
<template>
<Wraper :hidden="hidden" :refresh="refresh" :onOk="submit">
<Table
......@@ -10,18 +9,18 @@
:width="552"
>
<template #search="{ query }">
<MoreItem label="项目名称">
<a-input v-model="query.inputValue" placeholder="请输入" />
<MoreItem :label="$t('table.itemName')">
<a-input v-model="query.inputValue" :placeholder="$t('input.placeholder')" />
</MoreItem>
</template>
<a-table-column title="项目名称" data-index="itemName" />
<a-table-column title="数据类型">
<a-table-column :title="$t('table.itemName')" data-index="itemName" />
<a-table-column :title="$t('table.dataType')">
<template #default="row">
<span> {{ dataType[row.dataType] }}</span>
</template>
</a-table-column>
<a-table-column title="项目描述" data-index="equipmentCode" />
<a-table-column :title="$t('table.remark')" data-index="equipmentCode" />
</Table>
</Wraper>
</template>
......@@ -66,9 +65,9 @@ export default {
otherQuery: {},
submitData: {},
dataType: {
TEXT: '文本类型',
OPTION: '选项类型',
NUMERIC: '数值类型',
TEXT: this.$t('other.TEXT'),
OPTION: this.$t('other.OPTION'),
NUMERIC: this.$t('other.NUMERIC'),
},
};
},
......@@ -80,8 +79,8 @@ export default {
assembleObjectIdList: this.selected.keys,
});
}
this.$message.warning('请选择');
throw new Error('请选择');
this.$message.warning(this.$t('select.placeholder'));
throw new Error(this.$t('select.placeholder'));
},
},
};
......
......@@ -8,14 +8,14 @@
:width="552"
>
<template #search="{ query }">
<MoreItem label="地点名称">
<a-input v-model="query.inputValue" placeholder="请输入" />
<MoreItem :label="$t('table.placeName')">
<a-input v-model="query.inputValue" :placeholder="$t('input.placeholder')" />
</MoreItem>
</template>
<a-table-column title="地点名称" data-index="placeName" />
<a-table-column title="二维码" data-index="qrCode" />
<a-table-column title="电子标签" data-index="electronicTag" />
<a-table-column :title="$t('table.placeName')" data-index="placeName" />
<a-table-column :title="$t('table.QrCode')" data-index="qrCode" />
<a-table-column :title="$t('table.ElectronicTags')" data-index="electronicTag" />
<!-- <a-table-column v-if="rowKey === 'unitId'" title="单元名称" data-index="unitName" />
<a-table-column v-if="rowKey === 'unitId'" title="设备编号" data-index="equipmentCode" />
......@@ -76,8 +76,8 @@ export default {
assembleObjectIdList: this.selected.keys,
});
}
this.$message.warning('请选择');
throw new Error('请选择');
this.$message.warning(this.$t('select.placeholder'));
throw new Error(this.$t('select.placeholder'));
},
},
};
......
......@@ -8,13 +8,13 @@
:width="552"
>
<template #search="{ query }">
<MoreItem label="搜索">
<a-input v-model="query.inputValue" placeholder="请输入单元名称/设备编号" />
<MoreItem :label="$t('basic.unitNameSeach')">
<a-input v-model="query.inputValue" :placeholder="$t('input.placeholder')" />
</MoreItem>
</template>
<a-table-column title="单元名称" data-index="unitName" />
<a-table-column title="设备编号" data-index="equipmentCode" />
<a-table-column :title="$t('table.unitName')" data-index="unitName" />
<a-table-column :title="$t('table.equipmentCode')" data-index="equipmentCode" />
</Table>
</Wraper>
</template>
......@@ -67,8 +67,8 @@ export default {
assembleObjectIdList: this.selected.keys,
});
}
this.$message.warning('请选择');
throw new Error('请选择');
this.$message.warning(this.$t('select.placeholder'));
throw new Error(this.$t('select.placeholder'));
},
},
};
......
......@@ -13,40 +13,48 @@
:width="400"
>
<template #operation>
<a-button type="primary" @click="addPlace">新增地点</a-button>
<a-button type="primary" @click="addPlace">{{ $t('basic.newLocation') }}</a-button>
</template>
<template #drawer="drawer">
<AddPlace v-if="addType === 'PLACE'" v-bind="drawer" :refresh="refresh" />
<AddUnit v-if="addType === 'UNIT'" v-bind="drawer" :refresh="refresh" />
<AddItem v-if="addType === 'ITEM'" v-bind="drawer" :refresh="refresh" />
</template>
<a-table-column title="名称" :width="150" data-index="assembleObjectName" />
<a-table-column title="顺序" :width="60">
<a-table-column :title="$t('basic.name')" :width="150" data-index="assembleObjectName" />
<a-table-column :title="$t('order')" :width="60">
<template #default="row">
<span v-if="row.assembleObjectType === 'PLACE'">{{ row.assembleOrder }}</span>
<span v-else>-</span>
</template>
</a-table-column>
<a-table-column title="类型" :width="60">
<a-table-column :title="$t('menu.type')" :width="60">
<template #default="row">
<span v-if="row.assembleObjectType === 'PLACE'">地点</span>
<span v-if="row.assembleObjectType === 'UNIT'">单元</span>
<span v-if="row.assembleObjectType === 'ITEM'">项目</span>
<span v-if="row.assembleObjectType === 'PLACE'">{{ $t('basic.place') }}</span>
<span v-if="row.assembleObjectType === 'UNIT'">{{ $t('basic.unit') }}</span>
<span v-if="row.assembleObjectType === 'ITEM'">{{ $t('basic.item') }}</span>
</template>
</a-table-column>
<a-table-column title="免检" :width="60">
<a-table-column :title="$t('table.exemptionType')" :width="60">
<template #default="row">
<span :style="{ color: '#2db7f5' }" v-if="row.exemptionState === 'YES'">是</span>
<span :style="{ color: '#f5222d' }" v-if="row.exemptionState === 'NO'">否</span>
<span :style="{ color: '#2db7f5' }" v-if="row.exemptionState === 'YES'">
{{ $t('table.yes') }}
</span>
<span :style="{ color: '#f5222d' }" v-if="row.exemptionState === 'NO'">
{{ $t('table.no') }}
</span>
</template>
</a-table-column>
<a-table-column title="状态" :width="60">
<a-table-column :title="$t('table.state')" :width="60">
<template #default="row">
<span :style="{ color: '#2db7f5' }" v-if="row.assembleState === 'VALID'">有效</span>
<span :style="{ color: '#f5222d' }" v-if="row.assembleState === 'INVALID'">无效</span>
<span :style="{ color: '#2db7f5' }" v-if="row.assembleState === 'VALID'">
{{ $t('other.tag.valid') }}
</span>
<span :style="{ color: '#f5222d' }" v-if="row.assembleState === 'INVALID'">
{{ $t('other.tag.invalid') }}
</span>
</template>
</a-table-column>
<a-table-column title="描述" data-index="assembleDesc" :width="200" />
<a-table-column :title="$t('table.remark')" data-index="assembleDesc" :width="200" />
<template #other>
<SetOrder ref="setOrder" :afterSubmit="setRouteAssemblesOrder" />
</template>
......@@ -70,39 +78,38 @@ export default {
return {
scroll: { x: 1300, y: 600 },
buttons: {
options: { width: 220, fixed: 'right' },
title: '操作',
options: { width: 250, fixed: 'right' },
data: [
{
label: '新增单元',
label: this.$t('basic.addUnit'),
click: this.addUnit,
isHidden: (row) => {
return row.assembleObjectType !== 'PLACE';
},
},
{
label: '新增项目',
label: this.$t('basic.addItem'),
click: this.addItem,
isHidden: (row) => {
return row.assembleObjectType !== 'UNIT';
},
},
{
label: '置顶',
label: this.$t('basic.topping'),
click: this.toTop,
isHidden: (row) => {
return row.assembleObjectType !== 'PLACE';
},
},
{
label: '排序',
label: this.$t('order'),
click: this.setOrder,
isHidden: (row) => {
return row.assembleObjectType !== 'PLACE';
},
},
{
label: '失效',
label: this.$t('task.invalid'),
click: (row) => this.assembleUpdate(row, 'INVALID'),
isHidden: (row) => {
if (row.assembleObjectType === 'ITEM') {
......@@ -113,7 +120,7 @@ export default {
},
},
{
label: '生效',
label: this.$t('table.takeEffect'),
click: (row) => this.assembleUpdate(row, 'VALID'),
isHidden: (row) => {
if (row.assembleObjectType === 'ITEM') {
......@@ -150,16 +157,16 @@ export default {
addPlace() {
const row = this.getDefaultQuery();
this.addType = 'PLACE';
this.$refs.assembleTable.show({ row, title: '新增地点', type: 'add' });
this.$refs.assembleTable.show({ row, title: this.$t('basic.newLocation'), type: 'add' });
},
addUnit(row) {
this.addType = 'UNIT';
this.$refs.assembleTable.show({ row, title: '新增单元', type: 'add' });
this.$refs.assembleTable.show({ row, title: this.$t('basic.addUnit'), type: 'add' });
},
addItem(row) {
this.addType = 'ITEM';
const newRow = { ...row, regionId: this.row.regionId };
this.$refs.assembleTable.show({ row: newRow, title: '新增项目', type: 'add' });
this.$refs.assembleTable.show({ row: newRow, title: this.$t('basic.addItem'), type: 'add' });
},
async assembleUpdate(row, assembleState) {
......@@ -182,10 +189,10 @@ export default {
};
const resp = await updateRouteAssemblesApi(param);
if (resp) {
this.$message.success('操作成功');
this.$message.success(this.$t('table.operationSucceeded'));
this.refresh();
} else {
this.$message.warning('操作失败');
this.$message.warning(this.$t('table.operationFailed'));
}
},
......@@ -207,12 +214,12 @@ export default {
async setRouteAssemblesOrder(param) {
const resp = setRouteAssemblesOrderApi(param);
if (resp) {
this.$message.success('操作成功');
this.$message.success(this.$t('table.operationSucceeded'));
setTimeout(() => {
this.refresh();
}, 500);
} else {
this.$message.warning('操作失败');
this.$message.warning(this.$t('table.operationFailed'));
}
},
formatData(list) {
......
<template>
<a-modal
v-model="visible"
:title="`设置排序:${row.assembleObjectName}`"
:title="`${$t('basic.setSort')}:${row.assembleObjectName}`"
@ok="handleOk"
destroyOnClose
:zIndex="1010"
>
<a-form-model layout="vertical" :model="form" :rules="rules" ref="form">
<a-form-model-item label="排序" prop="order">
<a-form-model-item :label="$t('menu.order')" prop="order">
<a-input-number :style="{ width: '100%' }" v-model="form.order" :min="1" :max="9999" />
</a-form-model-item>
</a-form-model>
......@@ -20,7 +20,10 @@ export default {
visible: false,
form: {},
rules: {
order: [{ required: true }, { pattern: /^(0|[1-9][0-9]*)$/, message: '请输入正确的排序' }],
order: [
{ required: true },
{ pattern: /^(0|[1-9][0-9]*)$/, message: this.$t('input.error') },
],
},
row: {
assembleObjectName: '',
......
......@@ -6,8 +6,8 @@
:defaultQuery="defaultQuery"
:width="552"
>
<a-table-column title="部门" data-index="orgName" />
<a-table-column title="用户姓名" data-index="staffName" />
<a-table-column :title="$t('table.department')" data-index="orgName" />
<a-table-column :title="$t('basic.staffName')" data-index="staffName" />
</Table>
</template>
......@@ -19,7 +19,6 @@ export default {
watch: {
row: {
handler(val) {
console.log(val);
this.defaultQuery = { specialityId: val.specialityId };
},
deep: true,
......@@ -31,7 +30,5 @@ export default {
defaultQuery: {},
};
},
mounted() {},
methods: {},
};
</script>
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