diff --git a/src/lang/en.ts b/src/lang/en.ts index 7458dd8..a853b50 100644 --- a/src/lang/en.ts +++ b/src/lang/en.ts @@ -269,9 +269,12 @@ export default { total: 'Total Applications Submitted', downloadExcel: 'Download Full Information Table (Excel)', range: 'Set the download range', - startIndex:'start ID', - endIndex:'end ID', + startIndex: 'start ID', + endIndex: 'end ID', download: 'Download', - limit:'Maximum 10 entries can be downloaded at once' + limit: 'Maximum 10 entries can be downloaded at once', + minIndex: 'Minimum ID is 10000', + maxIndex: 'Maximum ID is {maxIndex}', + indexError: 'End ID must be greater than or equal to Start ID' } } diff --git a/src/lang/zh-cn.ts b/src/lang/zh-cn.ts index f0e5a80..db3d07f 100644 --- a/src/lang/zh-cn.ts +++ b/src/lang/zh-cn.ts @@ -261,6 +261,9 @@ export default { startIndex: '起始序号', endIndex: '结束序号', download: '下载', - limit:'一次最多下载10条数据' + limit:'一次最多下载10条数据', + minIndex: '最小序号为10000', + maxIndex: '最大序号为 {maxIndex}', + indexError: '结束序号必须大于或等于起始序号' } } diff --git a/src/views/Preview/index.vue b/src/views/Preview/index.vue index 2f253ee..d368c7a 100644 --- a/src/views/Preview/index.vue +++ b/src/views/Preview/index.vue @@ -38,7 +38,7 @@ {{ $t('Preview.download') }} -

{{ errorMsg }}

+

{{ $t(errorMsg, { maxIndex }) }}

@@ -75,7 +75,7 @@ const isValid = computed(() => { start > 0 && end >= start && end <= maxIndex.value && - subtract(end, start) <= 10 + subtract(end, start) <= 9 ) }) @@ -83,10 +83,10 @@ const isValid = computed(() => { const errorMsg = computed(() => { const { start, end } = range.value if (start === null || end === null) return '' - if (start < 10000) return '起始序号必须大于 10000' - if (end < start) return '结束序号不能小于起始序号' - if (subtract(end, start) > 10) return '起始序号和结束序号相差不能超过10' - if (end > maxIndex.value) return `结束序号不能超过最大值 ${maxIndex.value}` + if (start < 10000) return 'Preview.minIndex' + if (end < start) return 'Preview.indexError' + if (subtract(end, start) > 9) return 'Preview.limit' + if (end > maxIndex.value) return `Preview.maxIndex` return '' }) @@ -274,7 +274,7 @@ onMounted(() => { border-color: #6c5ce7; box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1); } -.tips{ +.tips { text-align: center; margin-bottom: 1.2rem; font-size: 1.4rem;