中英文切换

main
liutao 2 weeks ago
parent 185180f6c5
commit b5d7ac1fd8

@ -3933,7 +3933,9 @@ export default {
validatorNameRequired: 'Template name can not be empty', validatorNameRequired: 'Template name can not be empty',
validatorTypeRequired: 'Template type can not be empty', validatorTypeRequired: 'Template type can not be empty',
design: 'Design', design: 'Design',
designTitle: 'Template Design' designTitle: 'Template Design',
print:'Print',
report:'Report',
}, },
PrintConfig: { PrintConfig: {
moduleName: 'Printer Config', moduleName: 'Printer Config',
@ -5267,6 +5269,15 @@ export default {
batchDelete: 'Batch Delete', batchDelete: 'Batch Delete',
export: 'Export', export: 'Export',
import: 'Import', import: 'Import',
importTitle: 'Import Acquisition Point Type',
importDropText: 'Drop the file here, or ',
importClickUpload: 'click to upload',
importFileTypeTip: 'Only .xls and .xlsx files are supported.',
downloadImportTemplate: 'Download Import Template',
importSelectFile: 'Please select a file to import.',
importFailed: 'Import failed.',
importOnlyOneFile: 'Only one file can be uploaded.',
importTemplateFilename: 'Acquisition Point Type Import Template.xls',
placeholderCode: 'Please enter type code', placeholderCode: 'Please enter type code',
placeholderName: 'Please enter type name', placeholderName: 'Please enter type name',

@ -3403,7 +3403,9 @@ export default {
validatorNameRequired: '模板名称不能为空', validatorNameRequired: '模板名称不能为空',
validatorTypeRequired: '模板类型不能为空', validatorTypeRequired: '模板类型不能为空',
design: '配置', design: '配置',
designTitle: '模板配置' designTitle: '模板配置',
print:'打印',
report:'报表',
}, },
PrintConfig: { PrintConfig: {
moduleName: '打印机配置', moduleName: '打印机配置',
@ -5115,6 +5117,16 @@ export default {
create: '新增', create: '新增',
batchDelete: '批量删除', batchDelete: '批量删除',
export: '导出', export: '导出',
import: '导入',
importTitle: '导入采集点类型',
importDropText: '将文件拖到此处,或',
importClickUpload: '点击上传',
importFileTypeTip: '仅允许导入 xls、xlsx 格式文件。',
downloadImportTemplate: '下载导入模板',
importSelectFile: '请选择导入文件',
importFailed: '导入失败',
importOnlyOneFile: '最多只能上传一个文件',
importTemplateFilename: '采集点类型导入模板.xls',
placeholderCode: '请输入编码', placeholderCode: '请输入编码',
placeholderName: '请输入名称', placeholderName: '请输入名称',

@ -1,5 +1,5 @@
<template> <template>
<Dialog v-model="dialogVisible" title="导入采集点分类" width="400"> <Dialog v-model="dialogVisible" :title="t('DataCollection.DeviceAttributeType.importTitle')" width="400">
<el-upload <el-upload
ref="uploadRef" ref="uploadRef"
v-model:file-list="fileList" v-model:file-list="fileList"
@ -15,24 +15,31 @@
drag drag
> >
<Icon icon="ep:upload" /> <Icon icon="ep:upload" />
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div> <div class="el-upload__text">
{{ t('DataCollection.DeviceAttributeType.importDropText') }}
<em>{{ t('DataCollection.DeviceAttributeType.importClickUpload') }}</em>
</div>
<template #tip> <template #tip>
<div class="el-upload__tip text-center"> <div class="el-upload__tip text-center">
<span>仅允许导入 xlsxlsx 格式文件</span> <span>{{ t('DataCollection.DeviceAttributeType.importFileTypeTip') }}</span>
<el-link <el-link
:underline="false" :underline="false"
style="font-size: 12px; vertical-align: baseline" style="font-size: 12px; vertical-align: baseline"
type="primary" type="primary"
@click="importTemplate" @click="importTemplate"
> >
下载导入模板 {{ t('DataCollection.DeviceAttributeType.downloadImportTemplate') }}
</el-link> </el-link>
</div> </div>
</template> </template>
</el-upload> </el-upload>
<template #footer> <template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm">{{ t('common.ok') }}</el-button> <el-button :disabled="formLoading" type="primary" @click="submitForm">
<el-button @click="dialogVisible = false">{{ t('common.cancel') }}</el-button> {{ t('DataCollection.DeviceAttributeType.import') }}
</el-button>
<el-button @click="dialogVisible = false">
{{ t('DataCollection.DeviceAttributeType.dialogCancel') }}
</el-button>
</template> </template>
</Dialog> </Dialog>
</template> </template>
@ -66,7 +73,7 @@ defineExpose({ open })
const submitForm = async () => { const submitForm = async () => {
if (fileList.value.length === 0) { if (fileList.value.length === 0) {
message.error('请选择导入文件') message.error(t('DataCollection.DeviceAttributeType.importSelectFile'))
return return
} }
uploadHeaders.value = { uploadHeaders.value = {
@ -91,7 +98,7 @@ const submitFormSuccess = (response: any) => {
} }
const submitFormError = (): void => { const submitFormError = (): void => {
message.error('导入失败') message.error(t('DataCollection.DeviceAttributeType.importFailed'))
formLoading.value = false formLoading.value = false
} }
@ -102,11 +109,11 @@ const resetForm = async (): Promise<void> => {
} }
const handleExceed = (): void => { const handleExceed = (): void => {
message.error('最多只能上传一个文件') message.error(t('DataCollection.DeviceAttributeType.importOnlyOneFile'))
} }
const importTemplate = async () => { const importTemplate = async () => {
const res = await DeviceAttributeTypeApi.importTemplate() const res = await DeviceAttributeTypeApi.importTemplate()
download.excel(res, '采集点分类导入模板.xls') download.excel(res, t('DataCollection.DeviceAttributeType.importTemplateFilename'))
} }
</script> </script>

@ -70,7 +70,7 @@
@click="handleImport" @click="handleImport"
v-hasPermi="['iot:device-attribute-type:create']" v-hasPermi="['iot:device-attribute-type:create']"
> >
<Icon icon="ep:upload" class="mr-5px" /> 导入 <Icon icon="ep:upload" class="mr-5px" /> {{ t('DataCollection.DeviceAttributeType.import') }}
</el-button> </el-button>
<el-button <el-button
type="success" type="success"

@ -2,12 +2,14 @@
<ContentWrap> <ContentWrap>
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" min-label-width="68px"> <el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" min-label-width="68px">
<el-form-item :label="t('TemplateManagement.PrintTemplate.templateCode')" prop="templateCode"> <el-form-item :label="t('TemplateManagement.PrintTemplate.templateCode')" prop="templateCode">
<el-input v-model="queryParams.templateCode" <el-input
v-model="queryParams.templateCode"
:placeholder="t('TemplateManagement.PrintTemplate.placeholderTemplateCode')" clearable :placeholder="t('TemplateManagement.PrintTemplate.placeholderTemplateCode')" clearable
@keyup.enter="handleQuery" class="!w-240px" /> @keyup.enter="handleQuery" class="!w-240px" />
</el-form-item> </el-form-item>
<el-form-item :label="t('TemplateManagement.PrintTemplate.templateName')" prop="templateName"> <el-form-item :label="t('TemplateManagement.PrintTemplate.templateName')" prop="templateName">
<el-input v-model="queryParams.templateName" <el-input
v-model="queryParams.templateName"
:placeholder="t('TemplateManagement.PrintTemplate.placeholderTemplateName')" clearable :placeholder="t('TemplateManagement.PrintTemplate.placeholderTemplateName')" clearable
@keyup.enter="handleQuery" class="!w-240px" /> @keyup.enter="handleQuery" class="!w-240px" />
</el-form-item> </el-form-item>
@ -30,17 +32,21 @@
<ContentWrap> <ContentWrap>
<el-tabs v-model="activeName" @tab-click="handleTabClick"> <el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="打印" name="1" /> <el-tab-pane :label="t('TemplateManagement.PrintTemplate.print')" name="1" />
<el-tab-pane label="报表" name="2" /> <el-tab-pane :label="t('TemplateManagement.PrintTemplate.report')" name="2" />
</el-tabs> </el-tabs>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" ref="tableRef" :max-height="planTableMaxHeight" row-key="id" <el-table
v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" ref="tableRef" :max-height="planTableMaxHeight" row-key="id"
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" fixed="left" reserve-selection /> <el-table-column type="selection" width="55" fixed="left" reserve-selection />
<el-table-column :label="t('TemplateManagement.PrintTemplate.templateCode')" align="center" prop="templateCode" <el-table-column
:label="t('TemplateManagement.PrintTemplate.templateCode')" align="center" prop="templateCode"
sortable /> sortable />
<el-table-column :label="t('TemplateManagement.PrintTemplate.templateName')" align="center" prop="templateName" <el-table-column
:label="t('TemplateManagement.PrintTemplate.templateName')" align="center" prop="templateName"
sortable /> sortable />
<el-table-column :label="t('TemplateManagement.PrintTemplate.templateType')" align="center" prop="templateType" <el-table-column
:label="t('TemplateManagement.PrintTemplate.templateType')" align="center" prop="templateType"
sortable> sortable>
<template #default="scope"> <template #default="scope">
<dict-tag :type="activeName === '2' ? 'report_template_type' : 'print_template_type'" :value="scope.row.templateType" /> <dict-tag :type="activeName === '2' ? 'report_template_type' : 'print_template_type'" :value="scope.row.templateType" />
@ -61,7 +67,8 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="t('TemplateManagement.PrintTemplate.remark')" align="center" prop="remark" /> <el-table-column :label="t('TemplateManagement.PrintTemplate.remark')" align="center" prop="remark" />
<el-table-column :label="t('TemplateManagement.PrintTemplate.createTime')" align="center" prop="createTime" <el-table-column
:label="t('TemplateManagement.PrintTemplate.createTime')" align="center" prop="createTime"
:formatter="dateFormatter" width="180px" sortable /> :formatter="dateFormatter" width="180px" sortable />
<el-table-column :label="t('TemplateManagement.PrintTemplate.operate')" align="center" min-width="160px"> <el-table-column :label="t('TemplateManagement.PrintTemplate.operate')" align="center" min-width="160px">
<template #default="scope"> <template #default="scope">
@ -77,7 +84,8 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize" <Pagination
:total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
</ContentWrap> </ContentWrap>

Loading…
Cancel
Save