bugfix: 限制10条下载&错误信息i18n

This commit is contained in:
2026-04-15 10:20:13 +08:00
parent 309cf49a54
commit 8c0fe1daf6
3 changed files with 17 additions and 11 deletions

View File

@@ -269,9 +269,12 @@ export default {
total: 'Total Applications Submitted', total: 'Total Applications Submitted',
downloadExcel: 'Download Full Information Table (Excel)', downloadExcel: 'Download Full Information Table (Excel)',
range: 'Set the download range', range: 'Set the download range',
startIndex:'start ID', startIndex: 'start ID',
endIndex:'end ID', endIndex: 'end ID',
download: 'Download', 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'
} }
} }

View File

@@ -261,6 +261,9 @@ export default {
startIndex: '起始序号', startIndex: '起始序号',
endIndex: '结束序号', endIndex: '结束序号',
download: '下载', download: '下载',
limit:'一次最多下载10条数据' limit:'一次最多下载10条数据',
minIndex: '最小序号为10000',
maxIndex: '最大序号为 {maxIndex}',
indexError: '结束序号必须大于或等于起始序号'
} }
} }

View File

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