Commit 178867f5 authored by 陈浩玮's avatar 陈浩玮

Merge branch 'feature/chw' into 'master'

Feature/chw

See merge request product/kim3-web-vue/starter-web-vue!56
parents 593f5e6f aa2eaa77
...@@ -2,6 +2,8 @@ import selectLang from './select'; ...@@ -2,6 +2,8 @@ import selectLang from './select';
import tableLang from './table'; import tableLang from './table';
import userLang from './user'; import userLang from './user';
import systemLang from './system'; import systemLang from './system';
import InputLang from './input';
import OtherLang from './other';
const zh_CN = {}; const zh_CN = {};
const en_US = {}; const en_US = {};
...@@ -18,5 +20,7 @@ formatLang(selectLang); ...@@ -18,5 +20,7 @@ formatLang(selectLang);
formatLang(tableLang); formatLang(tableLang);
formatLang(userLang); formatLang(userLang);
formatLang(systemLang); formatLang(systemLang);
formatLang(InputLang);
formatLang(OtherLang);
export { en_US, zh_CN }; export { en_US, zh_CN };
// 0 中文, 1 英文
export default {
'input.placeholder': ['请输入', 'Please enter'],
'input.search.one.placeholder': [
'请输入地点名称/二维码/电子标签',
'Please enter location name/QR code/electronic tag',
],
'input.search': ['搜索', 'search'],
'input.error': ['输入的内容有误!', 'Incorrect Input!'],
};
// 0 中文, 1 英文
export default {
'other.tag.valid': ['有效', 'Valid'],
'other.tag.invalid': ['无效', 'Invalid'],
'other.to': ['', 'To'],
'other.normal': ['正常值', 'normal'],
'other.outliers': ['异常值', 'outliers'],
'other.defaultValue': ['默认值', 'Default Value'],
'other.upperLimit': ['上限值', 'Upper Limit'],
'other.lowerLimit': ['下限值', 'Lower Limit'],
'other.TEXT': ['文本类型', 'Text Type'],
'other.OPTION': ['选项类型', 'Option Type'],
'other.NUMERIC': ['数值类型', 'Numeric Type'],
'other.on': ['', 'On'],
'other.off': ['', 'Off'],
};
...@@ -11,5 +11,7 @@ export default { ...@@ -11,5 +11,7 @@ export default {
'select.examine': ['巡检状态', 'Examine Status'], 'select.examine': ['巡检状态', 'Examine Status'],
'select.taskType': ['任务类型', 'Task Type'], 'select.taskType': ['任务类型', 'Task Type'],
'select.examiner': ['巡检人', 'Examiner'], 'select.examiner': ['巡检人', 'Examiner'],
'select.routeName': ['线路名称', 'RouteName'], 'select.routeName': ['线路名称', 'Route Name'],
'select.option.place': ['地点免检', 'Place Exemption'],
'select.option.unit': ['单元免检', 'Unit Exemption'],
}; };
...@@ -19,7 +19,8 @@ export default { ...@@ -19,7 +19,8 @@ export default {
sender: ['发送者', 'Sender'], sender: ['发送者', 'Sender'],
recipient: ['接受者', 'Recipient'], recipient: ['接受者', 'Recipient'],
'table.organization': ['所属组织', 'Organization'], 'table.organization': ['所属组织', 'Organization'],
'table.regionName': ['地区名称', 'RegionName'], 'table.regionName': ['地区名称', 'Region Name'],
'table.region': ['地区', 'Region'],
'table.remark': ['备注', 'Remark'], 'table.remark': ['备注', 'Remark'],
'table.reviser': ['修改人', 'Reviser'], 'table.reviser': ['修改人', 'Reviser'],
'table.revisionTime': ['修改时间', 'Revision Time'], 'table.revisionTime': ['修改时间', 'Revision Time'],
...@@ -33,4 +34,30 @@ export default { ...@@ -33,4 +34,30 @@ export default {
'table.confirmReset': ['确认是否重置', 'Confirm Reset'], 'table.confirmReset': ['确认是否重置', 'Confirm Reset'],
'table.hasSelectedSome': ['已选择{num}项', '{num} have been selected'], 'table.hasSelectedSome': ['已选择{num}项', '{num} have been selected'],
'table.view': ['查看', 'View'], 'table.view': ['查看', 'View'],
'table.export': ['导出', 'export'],
'table.placeName': ['地点名称', 'Place Name'],
'table.place': ['地点', 'place'],
'table.QrCode': ['二维码', 'Qr Code'],
'table.ElectronicTags': ['电子标签', 'Electronic tags'],
'table.exemption': ['免检', 'Exemption'],
'table.export.tip': ['请选择需要导出的数据!', 'Please select the data you want to export!'],
'table.keyword': ['关键字', 'keyword'],
'table.unitName': ['单元名称', 'Unit Name'],
'table.unit': ['单元', 'Unit'],
'table.equipmentCode': ['设备编号', 'Qquipment Code'],
'table.itemName': ['项目名称', 'Item Name'],
'table.item': ['项目', 'Item'],
'table.dataType': ['数据类型', 'Data Type'],
'table.majorName': ['专业名称', 'Major Name'],
'table.major': ['专业', 'Major'],
'table.personnel': ['人员', 'Personnel'],
'table.department': ['部门', 'Department'],
'table.exemptionType': ['免检类型', 'Exemption Type'],
'table.exemptionName': ['免检地点/单元名称', 'Place/Unit Exempted'],
'table.type': ['类型', 'Type'],
'table.time': ['时间', 'Time'],
'table.time.start': ['开始时间', 'Start Time'],
'table.time.end': ['结束时间', 'Start End'],
'table.reason': ['原因', 'Reason'],
'table.state': ['状态', 'State'],
}; };
...@@ -29,4 +29,5 @@ export default { ...@@ -29,4 +29,5 @@ export default {
'user.confirmUnlock': ['确认是否解锁', 'Confirm Whether To Unlock'], 'user.confirmUnlock': ['确认是否解锁', 'Confirm Whether To Unlock'],
'user.locking': ['锁定', 'Locking'], 'user.locking': ['锁定', 'Locking'],
'user.confirmLocked': ['确认是否锁定', 'Confirm Locked'], 'user.confirmLocked': ['确认是否锁定', 'Confirm Locked'],
'user.userName': ['用户姓名', 'User Name'],
}; };
<template> <template>
<Wraper :hidden="hidden" :onOk="submit" :refresh="refresh" :noFooter="isView"> <Wraper :hidden="hidden" :onOk="submit" :refresh="refresh" :noFooter="isView">
<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="exemptionType"> <a-form-model-item :label="$t('table.exemptionType')" prop="exemptionType">
<a-select class="tw-w-full" v-model="form.exemptionType" :disabled="isView"> <a-select
<a-select-option value="PLACE">地点免检</a-select-option> class="tw-w-full"
<a-select-option value="UNIT">单元免检</a-select-option> v-model="form.exemptionType"
:disabled="isView"
:placeholder="$t('select.placeholder')"
>
<a-select-option value="PLACE">{{ $t('select.option.place') }}</a-select-option>
<a-select-option value="UNIT">{{ $t('select.option.unit') }}</a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="所属地区" prop="regionId"> <a-form-model-item :label="$t('table.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"
labelFiled="regionName" labelFiled="regionName"
valueFiled="regionId" valueFiled="regionId"
:disabled="isView" :disabled="isView"
:placeholder="$t('select.placeholder')"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="所属地点" prop="placeId"> <a-form-model-item :label="$t('table.place')" prop="placeId">
<UrlSelect <UrlSelect
v-model="form.placeId" v-model="form.placeId"
:url=" :url="
...@@ -26,23 +32,25 @@ ...@@ -26,23 +32,25 @@
labelFiled="placeName" labelFiled="placeName"
valueFiled="placeId" valueFiled="placeId"
:disabled="isView" :disabled="isView"
:placeholder="$t('select.placeholder')"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="时间" prop="startTime"> <a-form-model-item :label="$t('table.time')" prop="startTime">
<RangeTime <RangeTime
:startTime.sync="form.startTime" :startTime.sync="form.startTime"
:endTime.sync="form.endTime" :endTime.sync="form.endTime"
showTime showTime
:disabled="isView" :disabled="isView"
:placeholder="$t('select.placeholder')"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="免检原因" prop="exemptionReason"> <a-form-model-item :label="$t('table.reason')" prop="exemptionReason">
<a-textarea <a-textarea
placeholder="Basic usage"
:rows="4" :rows="4"
v-model="form.exemptionReason" v-model="form.exemptionReason"
:disabled="isView" :disabled="isView"
:placeholder="$t('input.placeholder')"
/> />
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
...@@ -61,11 +69,11 @@ export default { ...@@ -61,11 +69,11 @@ export default {
data: () => ({ data: () => ({
form: {}, form: {},
rules: { rules: {
exemptionType: [{ required: true }], exemptionType: [{ required: true, message: this.$t('select.placeholder') }],
regionId: [{ required: true }], regionId: [{ required: true, message: this.$t('select.placeholder') }],
placeId: [{ required: true }], placeId: [{ required: true, message: this.$t('select.placeholder') }],
exemptionReason: [{ required: true }], exemptionReason: [{ required: true, message: this.$t('input.placeholder') }],
startTime: [{ required: true }], startTime: [{ required: true, message: this.$t('select.placeholder') }],
}, },
}), }),
......
...@@ -8,21 +8,26 @@ ...@@ -8,21 +8,26 @@
:defaultQuery="defaultQuery" :defaultQuery="defaultQuery"
> >
<template #search="{ query }"> <template #search="{ query }">
<MoreItem label="免检类型"> <MoreItem :label="$t('table.exemptionType')">
<a-select class="tw-w-full" v-model="query.exemptionType"> <a-select
<a-select-option value="PLACE">地点免检</a-select-option> class="tw-w-full"
<a-select-option value="UNIT">单元免检</a-select-option> v-model="query.exemptionType"
:placeholder="$t('select.placeholder')"
>
<a-select-option value="PLACE">{{ $t('select.option.place') }}</a-select-option>
<a-select-option value="UNIT">{{ $t('select.option.unit') }}</a-select-option>
</a-select> </a-select>
</MoreItem> </MoreItem>
<MoreItem label="地区"> <MoreItem :label="$t('table.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"
labelFiled="regionName" labelFiled="regionName"
valueFiled="regionId" valueFiled="regionId"
:placeholder="$t('select.placeholder')"
/> />
</MoreItem> </MoreItem>
<MoreItem label="地点"> <MoreItem :label="$t('table.place')">
<UrlSelect <UrlSelect
v-model="query.placeId" v-model="query.placeId"
:url=" :url="
...@@ -30,14 +35,16 @@ ...@@ -30,14 +35,16 @@
" "
labelFiled="placeName" labelFiled="placeName"
valueFiled="placeId" valueFiled="placeId"
:placeholder="$t('select.placeholder')"
/> />
</MoreItem> </MoreItem>
<MoreItem label="单元" v-if="query.exemptionType === 'UNIT'"> <MoreItem :label="$t('table.unit')" v-if="query.exemptionType === 'UNIT'">
<UrlSelect <UrlSelect
v-model="query.unitId" v-model="query.unitId"
:url="query.placeId ? `/ranger/inspection/api/v1/units/places/${query.placeId}/list` : ''" :url="query.placeId ? `/ranger/inspection/api/v1/units/places/${query.placeId}/list` : ''"
labelFiled="unitName" labelFiled="unitName"
valueFiled="unitId" valueFiled="unitId"
:placeholder="$t('select.placeholder')"
/> />
</MoreItem> </MoreItem>
</template> </template>
...@@ -46,19 +53,21 @@ ...@@ -46,19 +53,21 @@
<AddAndEdit v-bind="drawer" /> <AddAndEdit v-bind="drawer" />
</template> </template>
<a-table-column title="免检地点/单元名称" data-index="exemptionName" /> <a-table-column :title="$t('table.exemptionName')" data-index="exemptionName" />
<a-table-column title="所属地区" data-index="regionName" /> <a-table-column :title="$t('table.region')" data-index="regionName" />
<a-table-column title="类型"> <a-table-column :title="$t('table.type')">
<template #default="row"> <template #default="row">
<span>{{ row.exemptionType === 'PLACE' ? '地点免检' : '单元免检' }}</span> <span>{{
row.exemptionType === 'PLACE' ? $t('select.option.place') : $t('select.option.unit')
}}</span>
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="开始时间" data-index="startTime" /> <a-table-column :title="$t('table.time.start')" data-index="startTime" />
<a-table-column title="结束时间" data-index="endTime" /> <a-table-column :title="$t('table.time.start')" data-index="endTime" />
<a-table-column title="原因" data-index="exemptionReason" /> <a-table-column :title="$t('table.reason')" data-index="exemptionReason" />
<a-table-column title="免检状态" data-index="exemptionStateName" /> <a-table-column :title="$t('table.state')" data-index="exemptionStateName" />
<a-table-column title="修改人" data-index="editorName" /> <a-table-column :title="$t('table.reviser')" data-index="editorName" />
<a-table-column title="修改时间" data-index="editTime" /> <a-table-column :title="$t('table.revisionTime')" data-index="editTime" />
</Table> </Table>
</template> </template>
...@@ -76,8 +85,8 @@ export default { ...@@ -76,8 +85,8 @@ export default {
exemptionType: 'PLACE', exemptionType: 'PLACE',
}, },
buttons: [ buttons: [
{ label: '编辑', click: this.edit }, { label: this.$t('table.edit'), click: this.edit },
{ label: '详情', click: this.view }, { label: this.$t('table.details'), click: this.view },
{ {
type: 'confirm', type: 'confirm',
url: (row) => `ranger/inspection/api/v1/exemptions/${row.exemptionId}`, url: (row) => `ranger/inspection/api/v1/exemptions/${row.exemptionId}`,
...@@ -91,10 +100,10 @@ export default { ...@@ -91,10 +100,10 @@ export default {
this.$refs.table.getData(); this.$refs.table.getData();
}, },
edit(row) { edit(row) {
this.$refs.table.show({ row, title: '编辑', type: 'edit' }); this.$refs.table.show({ row, title: this.$t('table.edit'), type: 'edit' });
}, },
view(row) { view(row) {
this.$refs.table.show({ row, title: '详情', type: 'view' }); this.$refs.table.show({ row, title: this.$t('table.details'), type: 'view' });
}, },
}, },
}; };
......
<template> <template>
<Wraper :hidden="hidden" :onOk="submit" :refresh="refresh" :noFooter="isView"> <Wraper :hidden="hidden" :onOk="submit" :refresh="refresh" :noFooter="isView">
<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="placeName"> <a-form-model-item :label="$t('table.placeholder')" prop="itemName">
<a-input v-model="form.placeName" :disabled="isView" /> <a-input v-model="form.itemName" :disabled="isView" :placeholder="$t('input.placeholder')" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="所属地区" prop="regionId"> <a-form-model-item :label="$t('table.region')" prop="regionId">
<UrlSelect <UrlSelect
v-model="form.regionId" v-model="form.regionId"
url="/ranger/inspection/api/v1/region/list" url="/ranger/inspection/api/v1/region/list"
labelFiled="regionName" labelFiled="regionName"
valueFiled="regionId" valueFiled="regionId"
:disabled="isView" :disabled="isView"
:placeholder="$t('select.placeholder')"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="所属地点" prop="placeId"> <a-form-model-item :label="$t('table.place')" prop="placeId">
<UrlSelect <UrlSelect
v-model="form.placeId" v-model="form.placeId"
:url=" :url="
...@@ -23,28 +24,30 @@ ...@@ -23,28 +24,30 @@
labelFiled="placeName" labelFiled="placeName"
valueFiled="placeId" valueFiled="placeId"
:disabled="isView" :disabled="isView"
:placeholder="$t('select.placeholder')"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="所属单元" prop="unitId"> <a-form-model-item :label="$t('table.unit')" prop="unitId">
<UrlSelect <UrlSelect
v-model="form.unitId" v-model="form.unitId"
:url="form.placeId ? `/ranger/inspection/api/v1/units/places/${form.placeId}/list` : ''" :url="form.placeId ? `/ranger/inspection/api/v1/units/places/${form.placeId}/list` : ''"
labelFiled="unitName" labelFiled="unitName"
valueFiled="unitId" valueFiled="unitId"
:disabled="isView" :disabled="isView"
:placeholder="$t('select.placeholder')"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="数据类型" prop="dataType"> <a-form-model-item :label="$t('table.dataType')" prop="dataType">
<a-select v-model="form.dataType" :disabled="isView"> <a-select v-model="form.dataType" :disabled="isView" :placeholder="$t('select.placeholder')">
<a-select-option key="TEXT" value="TEXT">文本类型</a-select-option> <a-select-option key="TEXT" value="TEXT">{{ $t('other.TEXT') }}</a-select-option>
<a-select-option key="OPTION" value="OPTION">选项类型</a-select-option> <a-select-option key="OPTION" value="OPTION">{{ $t('other.OPTION') }}</a-select-option>
<a-select-option key="NUMERIC" value="NUMERIC">数值类型</a-select-option> <a-select-option key="NUMERIC" value="NUMERIC">{{ $t('other.NUMERIC') }}</a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
<div v-if="form.dataType === 'TEXT'"> <div v-if="form.dataType === 'TEXT'">
<a-form-model-item label="默认值" prop="defaultText"> <a-form-model-item :label="$t('other.defaultValue')" prop="defaultText">
<a-textarea <a-textarea
placeholder="Basic usage" :placeholder="$t('input.placeholder')"
:rows="4" :rows="4"
v-model="form.defaultText" v-model="form.defaultText"
:disabled="isView" :disabled="isView"
...@@ -52,37 +55,56 @@ ...@@ -52,37 +55,56 @@
</a-form-model-item> </a-form-model-item>
</div> </div>
<div v-if="form.dataType === 'OPTION'"> <div v-if="form.dataType === 'OPTION'">
<a-form-model-item label="选项类型" prop="optionType"> <a-form-model-item :label="$t('other.OPTION')" prop="optionType">
<a-select v-model="form.optionType" :disabled="isView"> <a-select
<a-select-option key="TEXT" value="TEXT">开/关</a-select-option> v-model="form.optionType"
:disabled="isView"
:placeholder="$t('select.placeholder')"
>
<a-select-option key="TEXT" value="TEXT">{{
`${$t('other.on')}/${$t('other.off')}`
}}</a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="正常值" prop="normalValue"> <a-form-model-item :label="$t('other.normal')" prop="normalValue">
<a-select v-model="form.normalValue" :disabled="isView"> <a-select
<a-select-option key="1" value="1"></a-select-option> v-model="form.normalValue"
<a-select-option key="0" value="0"></a-select-option> :disabled="isView"
:placeholder="$t('select.placeholder')"
>
<a-select-option key="1" value="1">{{ $t('other.on') }}</a-select-option>
<a-select-option key="0" value="0">{{ $t('other.off') }}</a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="异常值" prop="abnormalValue"> <a-form-model-item
:label="$t('other.outliers')"
prop="abnormalValue"
:placeholder="$t('select.placeholder')"
>
<a-select v-model="form.abnormalValue" :disabled="isView"> <a-select v-model="form.abnormalValue" :disabled="isView">
<a-select-option key="1" value="1"></a-select-option> <a-select-option key="1" value="1">{{ $t('other.on') }}</a-select-option>
<a-select-option key="0" value="0"></a-select-option> <a-select-option key="0" value="0">{{ $t('other.off') }}</a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</div> </div>
<div v-if="form.dataType === 'NUMERIC'"> <div v-if="form.dataType === 'NUMERIC'">
<a-form-model-item label="默认值" prop="defaultValue"> <a-form-model-item :label="$t('other.defaultValue')" prop="defaultValue">
<a-input v-model="form.defaultValue" placeholder="请输入" /> <a-input v-model="form.defaultValue" :placeholder="$t('input.placeholder')" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="上限值" prop="upperLimitValue"> <a-form-model-item :label="$t('other.upperLimit')" prop="upperLimitValue">
<a-input v-model="form.upperLimitValue" placeholder="请输入" /> <a-input v-model="form.upperLimitValue" :placeholder="$t('input.placeholder')" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="下限值" prop="lowerLimitValue"> <a-form-model-item :label="$t('other.lowerLimit')" prop="lowerLimitValue">
<a-input v-model="form.lowerLimitValue" placeholder="请输入" /> <a-input v-model="form.lowerLimitValue" :placeholder="$t('input.placeholder')" />
</a-form-model-item> </a-form-model-item>
</div> </div>
<a-form-model-item label="备注" prop="remark"> <a-form-model-item :label="$t('table.remark')" prop="remark">
<a-textarea placeholder="Basic usage" :rows="4" v-model="form.remark" :disabled="isView" /> <a-textarea
:placeholder="$t('input.placeholder')"
:rows="4"
v-model="form.remark"
:disabled="isView"
/>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
</Wraper> </Wraper>
...@@ -99,11 +121,11 @@ export default { ...@@ -99,11 +121,11 @@ export default {
data() { data() {
let normalValueValidator = (rule, value, callback) => { let normalValueValidator = (rule, value, callback) => {
if (value === '') { if (value === '') {
callback(new Error('Please input the password')); callback(new Error(this.$t('input.placeholder')));
} else { } else {
if (this.form.abnormalValue) { if (this.form.abnormalValue) {
if (value === this.form.abnormalValue) { if (value === this.form.abnormalValue) {
callback(new Error('Please input the password')); callback(new Error(this.$t('input.error')));
} else { } else {
callback(); callback();
} }
...@@ -114,11 +136,11 @@ export default { ...@@ -114,11 +136,11 @@ export default {
}; };
let abnormalValueValidator = (rule, value, callback) => { let abnormalValueValidator = (rule, value, callback) => {
if (value === '') { if (value === '') {
callback(new Error('Please input the password')); callback(new Error(this.$t('input.placeholder')));
} else { } else {
if (this.form.abnormalValue) { if (this.form.abnormalValue) {
if (value === this.form.abnormalValue) { if (value === this.form.abnormalValue) {
callback(new Error('Please input the password')); callback(new Error(this.$t('input.error')));
} else { } else {
callback(); callback();
} }
...@@ -129,25 +151,25 @@ export default { ...@@ -129,25 +151,25 @@ export default {
}; };
let defaultValueValidator = (rule, value, callback) => { let defaultValueValidator = (rule, value, callback) => {
if (value === '') { if (value === '') {
callback(new Error('Please input the password')); callback(new Error(this.$t('input.placeholder')));
} else { } else {
if (this.form.upperLimitValue && this.form.lowerLimitValue) { if (this.form.upperLimitValue && this.form.lowerLimitValue) {
if (this.form.upperLimitValue > value && value > this.form.lowerLimitValue) { if (this.form.upperLimitValue > value && value > this.form.lowerLimitValue) {
callback(); callback();
} else { } else {
callback(new Error('数值错误')); callback(new Error(this.$t('input.error')));
} }
} else if (this.form.upperLimitValue) { } else if (this.form.upperLimitValue) {
if (this.form.upperLimitValue > value) { if (this.form.upperLimitValue > value) {
callback(); callback();
} else { } else {
callback(new Error('数值错误1')); callback(new Error(this.$t('input.error')));
} }
} else if (this.form.lowerLimitValue) { } else if (this.form.lowerLimitValue) {
if (this.form.lowerLimitValue < value) { if (this.form.lowerLimitValue < value) {
callback(); callback();
} else { } else {
callback(new Error('数值错误2')); callback(new Error(this.$t('input.error')));
} }
} else { } else {
callback(); callback();
...@@ -156,25 +178,25 @@ export default { ...@@ -156,25 +178,25 @@ export default {
}; };
let upperLimitValueValidator = (rule, value, callback) => { let upperLimitValueValidator = (rule, value, callback) => {
if (value === '') { if (value === '') {
callback(new Error('Please input the password')); callback(new Error(this.$t('input.placeholder')));
} else { } else {
if (this.form.defaultValue && this.form.lowerLimitValue) { if (this.form.defaultValue && this.form.lowerLimitValue) {
if (this.form.defaultValue < value && value > this.form.lowerLimitValue) { if (this.form.defaultValue < value && value > this.form.lowerLimitValue) {
callback(); callback();
} else { } else {
callback(new Error('数值错误')); callback(new Error(this.$t('input.error')));
} }
} else if (this.form.defaultValue) { } else if (this.form.defaultValue) {
if (this.form.defaultValue < value) { if (this.form.defaultValue < value) {
callback(); callback();
} else { } else {
callback(new Error('数值错误1')); callback(new Error(this.$t('input.error')));
} }
} else if (this.form.lowerLimitValue) { } else if (this.form.lowerLimitValue) {
if (this.form.lowerLimitValue < value) { if (this.form.lowerLimitValue < value) {
callback(); callback();
} else { } else {
callback(new Error('数值错误2')); callback(new Error(this.$t('input.error')));
} }
} else { } else {
callback(); callback();
...@@ -183,25 +205,25 @@ export default { ...@@ -183,25 +205,25 @@ export default {
}; };
let lowerLimitValueValidator = (rule, value, callback) => { let lowerLimitValueValidator = (rule, value, callback) => {
if (value === '') { if (value === '') {
callback(new Error('Please input the password')); callback(new Error(this.$t('input.placeholder')));
} else { } else {
if (this.form.defaultValue && this.form.upperLimitValue) { if (this.form.defaultValue && this.form.upperLimitValue) {
if (this.form.defaultValue > value && value < this.form.upperLimitValue) { if (this.form.defaultValue > value && value < this.form.upperLimitValue) {
callback(); callback();
} else { } else {
callback(new Error('数值错误')); callback(new Error(this.$t('input.error')));
} }
} else if (this.form.defaultValue) { } else if (this.form.defaultValue) {
if (this.form.defaultValue > value) { if (this.form.defaultValue > value) {
callback(); callback();
} else { } else {
callback(new Error('数值错误1')); callback(new Error(this.$t('input.error')));
} }
} else if (this.form.upperLimitValue) { } else if (this.form.upperLimitValue) {
if (this.form.upperLimitValue > value) { if (this.form.upperLimitValue > value) {
callback(); callback();
} else { } else {
callback(new Error('数值错误2')); callback(new Error(this.$t('input.error')));
} }
} else { } else {
callback(); callback();
...@@ -211,23 +233,35 @@ export default { ...@@ -211,23 +233,35 @@ export default {
return { return {
form: {}, form: {},
rules: { rules: {
placeName: [{ required: true }], itemName: [{ required: true, message: this.$t('input.placeholder') }],
placeId: [{ required: true }], placeId: [{ required: true, message: this.$t('input.placeholder') }],
regionId: [{ required: true }], regionId: [{ required: true, message: this.$t('input.placeholder') }],
unitId: [{ required: true }], unitId: [{ required: true, message: this.$t('input.placeholder') }],
dataType: [{ required: true }], dataType: [{ required: true, message: this.$t('input.placeholder') }],
defaultText: [{ required: true }], defaultText: [{ required: true, message: this.$t('input.placeholder') }],
optionType: [{ required: true }], optionType: [{ required: true, message: this.$t('input.placeholder') }],
normalValue: [ normalValue: [
{ required: true }, { required: true, message: this.$t('input.placeholder') },
{ {
validator: normalValueValidator, validator: normalValueValidator,
}, },
], ],
abnormalValue: [{ required: true }, { validator: abnormalValueValidator }], abnormalValue: [
defaultValue: [{ required: true }, { validator: defaultValueValidator }], { required: true, message: this.$t('input.placeholder') },
upperLimitValue: [{ required: true }, { validator: upperLimitValueValidator }], { validator: abnormalValueValidator },
lowerLimitValue: [{ required: true }, { validator: lowerLimitValueValidator }], ],
defaultValue: [
{ required: true, message: this.$t('input.placeholder') },
{ validator: defaultValueValidator },
],
upperLimitValue: [
{ required: true, message: this.$t('input.placeholder') },
{ validator: upperLimitValueValidator },
],
lowerLimitValue: [
{ required: true, message: this.$t('input.placeholder') },
{ validator: lowerLimitValueValidator },
],
}, },
}; };
}, },
......
...@@ -8,15 +8,16 @@ ...@@ -8,15 +8,16 @@
:scroll="{ x: true }" :scroll="{ x: true }"
> >
<template #search="{ query }"> <template #search="{ query }">
<MoreItem label="地区"> <MoreItem :label="$t('table.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"
labelFiled="regionName" labelFiled="regionName"
valueFiled="regionId" valueFiled="regionId"
:placeholder="$t('select.placeholder')"
/> />
</MoreItem> </MoreItem>
<MoreItem label="地点"> <MoreItem :label="$t('table.place')">
<UrlSelect <UrlSelect
v-model="query.placeId" v-model="query.placeId"
:url=" :url="
...@@ -24,18 +25,20 @@ ...@@ -24,18 +25,20 @@
" "
labelFiled="placeName" labelFiled="placeName"
valueFiled="placeId" valueFiled="placeId"
:placeholder="$t('select.placeholder')"
/> />
</MoreItem> </MoreItem>
<MoreItem label="单元"> <MoreItem :label="$t('table.unit')">
<UrlSelect <UrlSelect
v-model="query.unitId" v-model="query.unitId"
:url="query.placeId ? `/ranger/inspection/api/v1/units/places/${query.placeId}/list` : ''" :url="query.placeId ? `/ranger/inspection/api/v1/units/places/${query.placeId}/list` : ''"
labelFiled="unitName" labelFiled="unitName"
valueFiled="unitId" valueFiled="unitId"
:placeholder="$t('select.placeholder')"
/> />
</MoreItem> </MoreItem>
<MoreItem label="项目名称"> <MoreItem :label="$t('table.itemName')">
<a-input v-model="query.inputValue" placeholder="请输入项目名称" /> <a-input v-model="query.inputValue" :placeholder="$t('input.placeholder')" />
</MoreItem> </MoreItem>
</template> </template>
...@@ -47,28 +50,34 @@ ...@@ -47,28 +50,34 @@
<AddAndEdit v-bind="drawer" /> <AddAndEdit v-bind="drawer" />
</template> </template>
<a-table-column title="项目名称" data-index="itemName" /> <a-table-column :title="$t('table.itemName')" data-index="itemName" />
<a-table-column title="所属单元" data-index="unitName" /> <a-table-column :title="$t('table.unitName')" data-index="unitName" />
<a-table-column title="数据类型"> <a-table-column :title="$t('table.dataType')">
<template #default="row"> <template #default="row">
<span> {{ dataType[row.dataType] }}</span> <span> {{ $t(`other.${row.dataType}`) }}</span>
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="项目描述"> <a-table-column :title="$t('table.describe')">
<template #default="row"> <template #default="row">
<span v-if="row.dataType === 'TEXT'"> {{ row.defaultText }}</span> <span v-if="row.dataType === 'TEXT'"> {{ row.defaultText }}</span>
<span v-if="row.dataType === 'OPTION'"> <span v-if="row.dataType === 'OPTION'">
{{ `正常值:${row.normalValue} 异常值:${row.abnormalValue}` }}</span {{
`${$t('other.normal')}:${row.normalValue} ${$t('other.outliers')}:${
row.abnormalValue
}`
}}</span
> >
<span v-if="row.dataType === 'NUMERIC'"> <span v-if="row.dataType === 'NUMERIC'">
{{ {{
`默认值:${row.defaultValue} 上限值:${row.upperLimitValue} 下限值:${row.lowerLimitValue}` `${$t('other.defaultValue')}:${row.defaultValue}
${$t('other.upperLimit')}:${row.upperLimitValue}
${$t('other.lowerLimit')}:${row.lowerLimitValue}`
}}</span }}</span
> >
</template> </template>
</a-table-column> </a-table-column>
<a-table-column title="修改人" data-index="editorName" /> <a-table-column :title="$t('table.reviser')" data-index="editorName" />
<a-table-column title="修改时间" data-index="editTime" /> <a-table-column :title="$t('table.revisionTime')" data-index="editTime" />
</Table> </Table>
</template> </template>
...@@ -83,19 +92,14 @@ export default { ...@@ -83,19 +92,14 @@ export default {
data() { data() {
return { return {
buttons: [ buttons: [
{ label: '编辑', click: this.edit }, { label: this.$t('table.edit'), click: this.edit },
{ label: '详情', click: this.view }, { label: this.$t('table.details'), click: this.view },
{ {
type: 'confirm', type: 'confirm',
url: (row) => `/ranger/inspection/api/v1/items/${row.itemId}`, url: (row) => `/ranger/inspection/api/v1/items/${row.itemId}`,
after: this.refresh, after: this.refresh,
}, },
], ],
dataType: {
TEXT: '文本类型',
OPTION: '选项类型',
NUMERIC: '数值类型',
},
}; };
}, },
methods: { methods: {
...@@ -103,10 +107,10 @@ export default { ...@@ -103,10 +107,10 @@ export default {
this.$refs.table.getData(); this.$refs.table.getData();
}, },
edit(row) { edit(row) {
this.$refs.table.show({ row, title: '编辑', type: 'edit' }); this.$refs.table.show({ row, title: this.$t('table.edit'), type: 'edit' });
}, },
view(row) { view(row) {
this.$refs.table.show({ row, title: '查看', type: 'view' }); this.$refs.table.show({ row, title: this.$t('table.details'), type: 'view' });
}, },
}, },
}; };
......
<template> <template>
<Wraper :hidden="hidden" :onOk="submit" :refresh="refresh" :noFooter="isView"> <Wraper :hidden="hidden" :onOk="submit" :refresh="refresh" :noFooter="isView">
<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="specialityName"> <a-form-model-item :label="$t('table.majorName')" prop="specialityName">
<a-input v-model="form.specialityName" :disabled="isView" /> <a-input
v-model="form.specialityName"
:disabled="isView"
:placeholder="$t('input.placeholder')"
/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="所属地区" prop="regionId"> <a-form-model-item :label="$t('table.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"
labelFiled="regionName" labelFiled="regionName"
valueFiled="regionId" valueFiled="regionId"
:disabled="isView" :disabled="isView"
:placeholder="$t('select.placeholder')"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="备注" prop="remark"> <a-form-model-item :label="$t('table.remark')" prop="remark">
<a-textarea placeholder="Basic usage" :rows="4" v-model="form.remark" :disabled="isView" /> <a-textarea
:placeholder="$t('input.placeholder')"
:rows="4"
v-model="form.remark"
:disabled="isView"
/>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
</Wraper> </Wraper>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
rowKey="userId" rowKey="userId"
:loading="loading" :loading="loading"
> >
<a-table-column title="姓名" data-index="userName" /> <a-table-column :title="$t('user.name')" data-index="userName" />
</a-table> </a-table>
</Wraper> </Wraper>
</template> </template>
......
...@@ -7,16 +7,17 @@ ...@@ -7,16 +7,17 @@
ref="table" ref="table"
> >
<template #search="{ query }"> <template #search="{ query }">
<MoreItem label="地区"> <MoreItem :label="$t('table.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"
labelFiled="regionName" labelFiled="regionName"
valueFiled="regionId" valueFiled="regionId"
:placeholder="$t('select.placeholder')"
/> />
</MoreItem> </MoreItem>
<MoreItem label="专业名称"> <MoreItem :label="$t('table.majorName')">
<a-input v-model="query.specialityName" /> <a-input v-model="query.specialityName" :placeholder="$t('input.placeholder')" />
</MoreItem> </MoreItem>
</template> </template>
...@@ -25,10 +26,10 @@ ...@@ -25,10 +26,10 @@
<AddAndEdit v-bind="drawer" v-else /> <AddAndEdit v-bind="drawer" v-else />
</template> </template>
<a-table-column title="专业名称" data-index="specialityName" /> <a-table-column :title="$t('table.majorName')" data-index="specialityName" />
<a-table-column title="所属地区" data-index="regionName" /> <a-table-column :title="$t('table.regionName')" data-index="regionName" />
<a-table-column title="修改人" data-index="editorName" /> <a-table-column :title="$t('table.reviser')" data-index="editorName" />
<a-table-column title="修改时间" data-index="editTime" /> <a-table-column :title="$t('table.revisionTime')" data-index="editTime" />
</Table> </Table>
</template> </template>
...@@ -44,9 +45,9 @@ export default { ...@@ -44,9 +45,9 @@ export default {
data() { data() {
return { return {
buttons: [ buttons: [
{ label: '编辑', click: this.edit }, { label: this.$t('table.edit'), click: this.edit },
{ label: '详情', click: this.view }, { label: this.$t('table.details'), click: this.view },
{ label: '人员', click: this.showMember }, { label: this.$t('table.personnel'), click: this.showMember },
{ {
type: 'confirm', type: 'confirm',
url: (row) => `/ranger/inspection/api/v1/specialities/${row.specialityId}`, url: (row) => `/ranger/inspection/api/v1/specialities/${row.specialityId}`,
...@@ -60,13 +61,13 @@ export default { ...@@ -60,13 +61,13 @@ export default {
this.$refs.table.getData(); this.$refs.table.getData();
}, },
edit(row) { edit(row) {
this.$refs.table.show({ row, title: '编辑', type: 'edit' }); this.$refs.table.show({ row, title: this.$t('table.edit'), type: 'edit' });
}, },
view(row) { view(row) {
this.$refs.table.show({ row, title: '详情', type: 'view' }); this.$refs.table.show({ row, title: this.$t('table.details'), type: 'view' });
}, },
showMember(row) { showMember(row) {
this.$refs.table.show({ row, title: '人员', type: 'member' }); this.$refs.table.show({ row, title: this.$t('table.personnel'), type: 'member' });
}, },
}, },
}; };
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
<AddMember v-bind="drawer" :specialityId="row.specialityId" /> <AddMember v-bind="drawer" :specialityId="row.specialityId" />
</template> </template>
<a-table-column title="部门" data-index="orgName" /> <a-table-column :title="$t('table.department')" data-index="orgName" />
<a-table-column title="用户姓名" data-index="staffName" /> <a-table-column :title="$t('table.userName')" data-index="staffName" />
</Table> </Table>
</Wraper> </Wraper>
</template> </template>
...@@ -33,8 +33,8 @@ export default { ...@@ -33,8 +33,8 @@ export default {
data() { data() {
return { return {
addBtn: { addBtn: {
text: '添加', text: this.$t('table.add'),
title: '添加', title: this.$t('table.add'),
}, },
buttons: [ buttons: [
{ {
......
<template> <template>
<Wraper :hidden="hidden" :onOk="submit" :refresh="refresh" :noFooter="isView"> <Wraper :hidden="hidden" :onOk="submit" :refresh="refresh" :noFooter="isView">
<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="placeName"> <a-form-model-item :label="$t('table.placeName')" prop="placeName">
<a-input v-model="form.placeName" :disabled="isView" /> <a-input v-model="form.placeName" :disabled="isView" :placeholder="$t('input.placeholder')" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="所属地区" prop="regionId"> <a-form-model-item :label="$t('table.regionName')" prop="regionId">
<UrlSelect <UrlSelect
v-model="form.regionId" v-model="form.regionId"
url="/ranger/inspection/api/v1/region/list" url="/ranger/inspection/api/v1/region/list"
labelFiled="regionName" labelFiled="regionName"
valueFiled="regionId" valueFiled="regionId"
:disabled="isView" :disabled="isView"
:placeholder="$t('select.placeholder')"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="二维码" prop="qrCode"> <a-form-model-item :label="$t('table.QrCode')" prop="qrCode">
<a-input v-model="form.qrCode" :disabled="isView" /> <a-input v-model="form.qrCode" :disabled="isView" :placeholder="$t('input.placeholder')" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="二维码" prop="electronicTag"> <a-form-model-item :label="$t('table.ElectronicTags')" prop="electronicTag">
<a-input v-model="form.electronicTag" :disabled="isView" /> <a-input
v-model="form.electronicTag"
:disabled="isView"
:placeholder="$t('input.placeholder')"
/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="备注" prop="remark"> <a-form-model-item :label="$t('table.remark')" prop="remark">
<a-textarea placeholder="Basic usage" :rows="4" v-model="form.remark" :disabled="isView" /> <a-textarea
:placeholder="$t('input.placeholder')"
:rows="4"
v-model="form.remark"
:disabled="isView"
/>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
</Wraper> </Wraper>
......
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
<a-list-item slot="renderItem" slot-scope="item"> <a-list-item slot="renderItem" slot-scope="item">
<a-card> <a-card>
<template #title> <template #title>
<a-tag v-if="item.exemptionState === 'EFFECTIVE'" color="#87d068"> 有效 </a-tag> <a-tag v-if="item.exemptionState === 'EFFECTIVE'" color="#87d068">
<a-tag v-else color="#f50"> 无效 </a-tag> {{ $t('other.tag.valid') }}
{{ `${item.startTime} 至 ${item.endTime}` }} </a-tag>
<a-tag v-else color="#f50"> {{ t('other.tag.invalid') }} </a-tag>
{{ `${item.startTime} ${$t('other.to')} ${item.endTime}` }}
</template> </template>
{{ item.exemptionReason }} {{ item.exemptionReason }}
</a-card> </a-card>
......
...@@ -8,22 +8,22 @@ ...@@ -8,22 +8,22 @@
ref="table" ref="table"
> >
<template #search="{ query }"> <template #search="{ query }">
<MoreItem label="地区"> <MoreItem :label="$t('select.region')">
<UrlSelect <UrlSelect
v-model="query.regionId" v-model="query.regionId"
url="/ranger/inspection/api/v1/region/list" url="/ranger/inspection/api/v1/region/list"
labelFiled="regionName" labelFiled="regionName"
valueFiled="regionId" valueFiled="regionId"
placeholder="选择地区" :placeholder="$t('select.placeholder')"
/> />
</MoreItem> </MoreItem>
<MoreItem label="搜索"> <MoreItem :label="$t('input.search')">
<a-input v-model="query.inputValue" placeholder="请输入地点名称/二维码/电子标签" /> <a-input v-model="query.inputValue" :placeholder="$t('input.search.one.placeholder')" />
</MoreItem> </MoreItem>
</template> </template>
<template #operation> <template #operation>
<a-button @click="download">导出</a-button> <a-button @click="download">{{ $t('table.export') }}</a-button>
</template> </template>
<template #drawer="drawer"> <template #drawer="drawer">
...@@ -31,12 +31,12 @@ ...@@ -31,12 +31,12 @@
<Exempt v-else v-bind="drawer" /> <Exempt v-else v-bind="drawer" />
</template> </template>
<a-table-column title="地点名称" data-index="placeName" /> <a-table-column :title="$t('table.placeName')" data-index="placeName" />
<a-table-column title="所属地区" data-index="regionName" /> <a-table-column :title="$t('table.regionName')" data-index="regionName" />
<a-table-column title="二维码" data-index="qrCode" /> <a-table-column :title="$t('table.QrCode')" data-index="qrCode" />
<a-table-column title="电子标签" data-index="electronicTag" /> <a-table-column :title="$t('table.ElectronicTags')" data-index="electronicTag" />
<a-table-column title="修改人" data-index="editorName" /> <a-table-column :title="$t('table.reviser')" data-index="editorName" />
<a-table-column title="修改时间" data-index="editTime" /> <a-table-column :title="$t('table.revisionTime')" data-index="editTime" />
</Table> </Table>
</template> </template>
...@@ -53,9 +53,9 @@ export default { ...@@ -53,9 +53,9 @@ export default {
data() { data() {
return { return {
buttons: [ buttons: [
{ label: '编辑', click: this.edit }, { label: this.$t('table.edit'), click: this.edit },
{ label: '详情', click: this.view }, { label: this.$t('table.details'), click: this.view },
{ label: '免检', click: this.exempt }, { label: this.$t('table.exemption'), click: this.exempt },
{ {
type: 'confirm', type: 'confirm',
url: (row) => `/ranger/inspection/api/v1/place/${row.placeId}`, url: (row) => `/ranger/inspection/api/v1/place/${row.placeId}`,
...@@ -70,16 +70,16 @@ export default { ...@@ -70,16 +70,16 @@ export default {
this.$refs.table.getData(); this.$refs.table.getData();
}, },
edit(row) { edit(row) {
this.$refs.table.show({ row, title: '编辑', type: 'edit' }); this.$refs.table.show({ row, title: this.$t('table.edit'), type: 'edit' });
}, },
view(row) { view(row) {
this.$refs.table.show({ row, title: '查看', type: 'view' }); this.$refs.table.show({ row, title: this.$t('table.details'), type: 'view' });
}, },
exempt(row) { exempt(row) {
this.$refs.table.show({ row, title: '免检', type: 'exempt' }); this.$refs.table.show({ row, title: this.$t('table.exemption'), type: 'exempt' });
}, },
download() { download() {
if (!this.selected?.keys?.length) return this.$message.error('请选择需要导出的数据'); if (!this.selected?.keys?.length) return this.$message.error(this.$t('table.export.tip'));
downloadFileByUrl( downloadFileByUrl(
`/ranger/inspection/api/v1/place/exportQrCodeData?placeIdList=${this.selected.keys.join( `/ranger/inspection/api/v1/place/exportQrCodeData?placeIdList=${this.selected.keys.join(
',', ',',
......
<template> <template>
<Wraper :hidden="hidden" :onOk="submit" :refresh="refresh" :noFooter="isView"> <Wraper :hidden="hidden" :onOk="submit" :refresh="refresh" :noFooter="isView">
<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="unitName"> <a-form-model-item :label="$t('table.unitName')" prop="unitName">
<a-input v-model="form.unitName" :disabled="isView" /> <a-input v-model="form.unitName" :disabled="isView" :placeholder="$t('input.placeholder')" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="所属地区" prop="regionId"> <a-form-model-item :label="$t('table.regionName')" 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"
labelFiled="regionName" labelFiled="regionName"
valueFiled="regionId" valueFiled="regionId"
:disabled="isView" :disabled="isView"
:placeholder="$t('select.placeholder')"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="所属地点" prop="placeId"> <a-form-model-item :label="$t('table.placeName')" prop="placeId">
<UrlSelect <UrlSelect
v-model="form.placeId" v-model="form.placeId"
:url=" :url="
...@@ -23,9 +24,10 @@ ...@@ -23,9 +24,10 @@
labelFiled="placeName" labelFiled="placeName"
valueFiled="placeId" valueFiled="placeId"
:disabled="isView" :disabled="isView"
:placeholder="$t('select.placeholder')"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="设备编号" prop="equipmentCode"> <a-form-model-item :label="$t('table.equipmentCode')" prop="equipmentCode">
<SearchSelect <SearchSelect
url="oceanus/api/v1/equipments/list" url="oceanus/api/v1/equipments/list"
searchField="searchKey" searchField="searchKey"
...@@ -33,11 +35,17 @@ ...@@ -33,11 +35,17 @@
labelFiled="equipmentCode" labelFiled="equipmentCode"
valueFiled="equipmentCode" valueFiled="equipmentCode"
:disabled="isView" :disabled="isView"
:placeholder="$t('select.placeholder')"
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="备注" prop="remark"> <a-form-model-item :label="$t('table.remark')" prop="remark">
<a-textarea placeholder="Basic usage" :rows="4" v-model="form.remark" :disabled="isView" /> <a-textarea
:placeholder="$t('input.placeholder')"
:rows="4"
v-model="form.remark"
:disabled="isView"
/>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
</Wraper> </Wraper>
......
<template> <template>
<Table url="/ranger/inspection/api/v1/units" rowKey="unitId" addBtn :buttons="buttons" ref="table"> <Table url="/ranger/inspection/api/v1/units" rowKey="unitId" addBtn :buttons="buttons" ref="table">
<template #search="{ query }"> <template #search="{ query }">
<MoreItem label="地区"> <MoreItem :label="$t('table.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"
labelFiled="regionName" labelFiled="regionName"
valueFiled="regionId" valueFiled="regionId"
:placeholder="$t('select.placeholder')"
/> />
</MoreItem> </MoreItem>
<MoreItem label="地点"> <MoreItem :label="$t('table.place')">
<UrlSelect <UrlSelect
v-model="query.placeId" v-model="query.placeId"
:url=" :url="
...@@ -17,10 +18,11 @@ ...@@ -17,10 +18,11 @@
" "
labelFiled="placeName" labelFiled="placeName"
valueFiled="placeId" valueFiled="placeId"
:placeholder="$t('select.placeholder')"
/> />
</MoreItem> </MoreItem>
<MoreItem label="关键字"> <MoreItem :label="$t('table.unitName')">
<a-input v-model="query.inputValue" /> <a-input v-model="query.inputValue" :placeholder="$t('input.placeholder')" />
</MoreItem> </MoreItem>
</template> </template>
...@@ -28,11 +30,11 @@ ...@@ -28,11 +30,11 @@
<AddAndEdit v-bind="drawer" /> <AddAndEdit v-bind="drawer" />
</template> </template>
<a-table-column title="单元名称" data-index="unitName" /> <a-table-column :title="$t('table.unitName')" data-index="unitName" />
<a-table-column title="所属地点" data-index="placeName" /> <a-table-column :title="$t('table.placeName')" data-index="placeName" />
<a-table-column title="设备编号" data-index="equipmentCode" /> <a-table-column :title="$t('table.equipmentCode')" data-index="equipmentCode" />
<a-table-column title="修改人" data-index="editorName" /> <a-table-column :title="$t('table.reviser')" data-index="editorName" />
<a-table-column title="修改时间" data-index="editTime" /> <a-table-column :title="$t('table.revisionTime')" data-index="editTime" />
</Table> </Table>
</template> </template>
...@@ -47,10 +49,10 @@ export default { ...@@ -47,10 +49,10 @@ export default {
data() { data() {
return { return {
buttons: [ buttons: [
{ label: '编辑', click: this.edit }, { label: this.$t('table.edit'), click: this.edit },
{ label: '详情', click: this.view }, { label: this.$t('table.details'), click: this.view },
{ label: '免检', click: this.view }, { label: this.$t('table.exemption'), click: this.view },
{ label: '文档', click: this.view }, // { label: '文档', click: this.view },
{ {
type: 'confirm', type: 'confirm',
url: (row) => `/ranger/inspection/api/v1/units/${row.unitId}`, url: (row) => `/ranger/inspection/api/v1/units/${row.unitId}`,
...@@ -64,10 +66,10 @@ export default { ...@@ -64,10 +66,10 @@ export default {
this.$refs.table.getData(); this.$refs.table.getData();
}, },
edit(row) { edit(row) {
this.$refs.table.show({ row, title: '编辑', type: 'edit' }); this.$refs.table.show({ row, title: this.$t('table.edit'), type: 'edit' });
}, },
view(row) { view(row) {
this.$refs.table.show({ row, title: '详情', type: 'view' }); this.$refs.table.show({ row, title: this.$t('table.details'), type: 'view' });
}, },
}, },
}; };
......
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