[update 全局翻译] 导入导出提示

This commit is contained in:
danshihao
2024-07-16 15:25:19 +08:00
parent f6c371e016
commit bd29582ef7
22 changed files with 115 additions and 84 deletions
@@ -225,7 +225,7 @@ export default {
},
handleExportXls (fileName, fileSuffix = '.xlsx') {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
fileName = this.$t('exportFile')
}
const param = this.getQueryParams()
param.businessId = this.$route.query.id
@@ -235,8 +235,8 @@ export default {
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
title: this.$t('tips'),
content: <span>{this.$t('exportTip')} <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
@@ -245,7 +245,7 @@ export default {
})
downFile('/laws/consultation/exportExcel', param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
this.$message.warning(this.$t('fileDownloadFail'))
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
+13 -3
View File
@@ -20,7 +20,7 @@
</a-col>
</a-row>
</div>
<a-form v-if="toggleSearchStatus" layout="inline" @keyup.enter.native="searchQuery">
<a-form v-if="toggleSearchStatus" layout="inline" @keyup.enter.native="searchQuery" class="form-label">
<a-row :gutter="24">
<a-col :md="(24 / (minLength + 1))"
:sm="(24 / minLength)"
@@ -518,7 +518,7 @@ export default {
// 导出
handleExportXls (fileName, fileSuffix = '.xls') {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
fileName = this.$t('exportFile')
}
const param = this.getQueryParams()
param.resourceType = this.currStandardType
@@ -666,7 +666,7 @@ export default {
file = await this.selectNewestFile(newestFileList)
if (file === null) { // 没有找到文件就退出
console.log('没有找到符合要求的文件!')
this.$message.error('该标准暂无预览文件,请联系标准管理员。')
this.$message.error(this.$t('dashboard.eneralSearch.previewFileNotFound'))
return
}
console.log('seletedFile', file)
@@ -1008,4 +1008,14 @@ export default {
width: calc(100% - 220px);
}
}
// 表单label溢出隐藏
.form-label {
/deep/ .ant-form-item-label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-right: 12px;
}
}
</style>
+5 -5
View File
@@ -256,14 +256,14 @@ export default {
// 导出
handleExportXls (fileName, fileSuffix = '.xls') {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
fileName = this.$t('exportFile')
}
const param = this.getSearchParam()
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
title: this.$t('tips'),
content: <span>{this.$t('exportTip')} <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
@@ -272,7 +272,7 @@ export default {
})
exportGeneralSearch(param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
this.$message.warning(this.$t('fileDownloadFail'))
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
@@ -681,7 +681,7 @@ export default {
file = await this.selectNewestFile(newestFileList)
if (file === null) { // 没有找到文件就退出
console.log('没有找到符合要求的文件!')
this.$message.error('该标准暂无预览文件,请联系标准管理员。')
this.$message.error(this.$t('dashboard.eneralSearch.previewFileNotFound'))
return
}
console.log('seletedFile', file)
@@ -661,7 +661,7 @@ export default {
// 下载导入模板
downTemplate (fileName, fileSuffix = '.xls') {
if (!fileName || typeof fileName !== 'string') {
fileName = '模板文件'
fileName = this.$t('templateFile')
}
downloadFile(this.url.downTemplateUrl, fileName + fileSuffix, { infoId: this.$route.query.infoId })
}
@@ -170,7 +170,7 @@ export default {
// 下载导入模板
downTemplate (fileName, fileSuffix = '.xls') {
if (!fileName || typeof fileName !== 'string') {
fileName = '模板文件'
fileName = this.$t('templateFile')
}
downloadFile(this.downTemplateUrl, fileName + fileSuffix)
}
@@ -453,7 +453,7 @@ export default {
// 导出改成用post
handleExportXls (fileName) {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
fileName = this.$t('exportFile')
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
@@ -462,8 +462,8 @@ export default {
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出,请稍候 <a-spin size="small" /></span>,
title: this.$t('tips'),
content: <span>{this.$t('exportTip')} <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
@@ -472,7 +472,7 @@ export default {
})
postDownFile(this.url.exportXlsUrl, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
this.$message.warning(this.$t('fileDownloadFail'))
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
@@ -496,7 +496,7 @@ export default {
// 带文件导出
handleFileExport (fileName) {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
fileName = this.$t('exportFile')
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
@@ -505,8 +505,8 @@ export default {
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出,请稍候 <a-spin size="small" /></span>,
title: this.$t('tips'),
content: <span>{this.$t('exportTip')} <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
@@ -515,7 +515,7 @@ export default {
})
postDownFile(this.url.exportZipUrl, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
this.$message.warning(this.$t('fileDownloadFail'))
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data]), fileName + '.zip')
@@ -539,7 +539,7 @@ export default {
// 下载导入模板
downTemplate (fileName) {
if (!fileName || typeof fileName !== 'string') {
fileName = '模板文件'
fileName = this.$t('templateFile')
}
downloadFile(this.url.downTemplateUrl, fileName + '.zip')
},
@@ -570,7 +570,7 @@ export default {
// 导出改成用post
handleExportXls (fileName) {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
fileName = this.$t('exportFile')
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
@@ -579,8 +579,8 @@ export default {
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
title: this.$t('tips'),
content: <span>{this.$t('exportTip')} <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
@@ -589,7 +589,7 @@ export default {
})
postDownFile(this.url.exportXlsUrl, param).then((data) => {
if (!data || data.size === 0) {
this.$message.warning('文件下载失败')
this.$message.warning(this.$t('fileDownloadFail'))
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
@@ -613,7 +613,7 @@ export default {
// 带文件导出
handleFileExport (fileName) {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
fileName = this.$t('exportFile')
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
@@ -623,8 +623,8 @@ export default {
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
title: this.$t('tips'),
content: <span>{this.$t('exportTip')} <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
@@ -633,7 +633,7 @@ export default {
})
postDownFile(this.url.exportZipUrl, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
this.$message.warning(this.$t('fileDownloadFail'))
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data]), fileName + '.zip')
@@ -581,14 +581,14 @@ export default {
// 下载分解单上传模板
salvageListTemplateDownload (fileName, fileSuffix = '.xls') {
if (!fileName || typeof fileName !== 'string') {
fileName = '模板文件'
fileName = this.$t('templateFile')
}
downloadFile(this.url.salvageListDownTemplateUrl, fileName + fileSuffix)
},
// 车型项目文件上传模板
carTypeFileTemplateDownload (fileName, fileSuffix = '.xls') {
if (!fileName || typeof fileName !== 'string') {
fileName = '模板文件'
fileName = this.$t('templateFile')
}
downloadFile(this.url.carTypeFileDownTemplateUrl, fileName + fileSuffix)
},
@@ -305,7 +305,7 @@ export default {
},
handleExportXls (fileName, fileSuffix = '.xls') {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
fileName = this.$t('exportFile')
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
@@ -314,8 +314,8 @@ export default {
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
title: this.$t('tips'),
content: <span>{this.$t('exportTip')} <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
@@ -324,7 +324,7 @@ export default {
})
downFile(this.url.exportXlsUrl, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
this.$message.warning(this.$t('fileDownloadFail'))
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
@@ -620,8 +620,8 @@ export default {
// 加一个大的提示
if (!this.loading) {
importModalLoading = this.$info({
title: '提示',
content: <span>正在导入请稍候 <a-spin size="small" /></span>,
title: this.$t('tips'),
content: <span>{this.$t('importTip')} <a-spin size="small" /></span>,
keyboard: false
})
}
@@ -651,7 +651,7 @@ export default {
)
})
} else {
this.$message.success(info.file.response.message || `${info.file.name} 文件上传成功`)
this.$message.success(info.file.response.message || `${info.file.name} ${this.$t('fileUploadSuccess')}`)
}
// 推入表格中
this.dataSourceEvaluate = info.file.response.result.map(item => {
@@ -692,13 +692,13 @@ export default {
})
}
} else {
this.$message.warning(`文件上传失败: ${info.file.msg} `)
this.$message.warning(`${this.$t('fileUploadFailed')}: ${info.file.msg} `)
}
}
},
handleExportXls (fileName, fileSuffix = '.xls') {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
fileName = this.$t('exportFile')
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
@@ -707,8 +707,8 @@ export default {
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
title: this.$t('tips'),
content: <span>{this.$t('exportTip')} <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
@@ -717,7 +717,7 @@ export default {
})
downFile(this.url.exportXlsUrl, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
this.$message.warning(this.$t('fileDownloadFail'))
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
@@ -196,7 +196,7 @@ export default {
},
handleExportXls (fileName, fileSuffix = '.xls') {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
fileName = this.$t('exportFile')
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
@@ -205,8 +205,8 @@ export default {
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
title: this.$t('tips'),
content: <span>{this.$t('exportTip')} <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
@@ -215,7 +215,7 @@ export default {
})
downFile(this.url.exportXlsUrl, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
this.$message.warning(this.$t('fileDownloadFail'))
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
@@ -556,8 +556,8 @@ export default {
// 加一个大的提示
if (!this.loading) {
importModalLoading = this.$info({
title: '提示',
content: <span>正在导入请稍候 <a-spin size="small" /></span>,
title: this.$t('tips'),
content: <span>{this.$t('importTip')} <a-spin size="small" /></span>,
keyboard: false,
// 不显示 知道了 按钮
okButtonProps: {
@@ -587,7 +587,7 @@ export default {
)
})
} else {
this.$message.success(info.file.response.message || `${info.file.name} 文件上传成功`)
this.$message.success(info.file.response.message || `${info.file.name} ${this.$t('fileUploadSuccess')}`)
}
// 前端存储,没有id的数据,前端加上uuid
const data = info.file.response.result || []
@@ -631,7 +631,7 @@ export default {
})
}
} else {
this.$message.warning(`文件上传失败: ${info.file.msg} `)
this.$message.warning(`${this.$t('fileUploadFailed')}: ${info.file.msg} `)
}
}
},
@@ -640,10 +640,10 @@ export default {
const { standardNumber, standardName } = this.standardInfo || {}
if (this.isDistribute) {
// 分发:编号 + 名称 + 解读分发
fileName = `${standardNumber} ${standardName}-解读分发`
fileName = `${standardNumber} ${standardName}-${this.$t('workCenter.standardInterpretationProcess.interpretationDistribution')}`
} else {
// 不分发和汇总:编号 + 名称 + 解读表
fileName = `${standardNumber} ${standardName}-解读表`
fileName = `${standardNumber} ${standardName}-${this.$t('workCenter.standardInterpretationProcess.interpretationTable')}`
}
const param = {
projectId: this.$route.query.projectId,