Add file size update after upload
This commit is contained in:
@@ -270,6 +270,7 @@
|
||||
v-model="pullBankInfoForm.dateRange"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
:picker-options="pullBankInfoDatePickerOptions"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@@ -502,6 +503,13 @@ export default {
|
||||
pollingInterval: 5000,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
pullBankInfoDatePickerOptions() {
|
||||
return {
|
||||
disabledDate: (time) => this.isPullBankInfoDateDisabled(time),
|
||||
};
|
||||
},
|
||||
},
|
||||
created() {
|
||||
// 加载初始数据
|
||||
// this.loadInitialData();
|
||||
@@ -860,6 +868,36 @@ export default {
|
||||
this.idCardFileList = [];
|
||||
this.parsingIdCardFile = false;
|
||||
},
|
||||
getPullBankInfoTodayStart() {
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
return today;
|
||||
},
|
||||
getPullBankInfoMaxSelectableDate() {
|
||||
const yesterday = this.getPullBankInfoTodayStart();
|
||||
yesterday.setDate(yesterday.getDate() - 1);
|
||||
return yesterday;
|
||||
},
|
||||
parsePullBankInfoDate(dateValue) {
|
||||
if (!dateValue) return null;
|
||||
const [year, month, day] = String(dateValue)
|
||||
.split("-")
|
||||
.map((item) => Number(item));
|
||||
if (![year, month, day].every(Number.isFinite)) {
|
||||
return null;
|
||||
}
|
||||
return new Date(year, month - 1, day);
|
||||
},
|
||||
isPullBankInfoDateDisabled(time) {
|
||||
return time.getTime() >= this.getPullBankInfoTodayStart().getTime();
|
||||
},
|
||||
hasInvalidPullBankInfoDateRange(dateRange) {
|
||||
const maxSelectableDate = this.getPullBankInfoMaxSelectableDate();
|
||||
return (dateRange || []).some((dateValue) => {
|
||||
const date = this.parsePullBankInfoDate(dateValue);
|
||||
return !date || date.getTime() > maxSelectableDate.getTime();
|
||||
});
|
||||
},
|
||||
buildFinalIdCardList() {
|
||||
return this.parseIdCardText(this.pullBankInfoForm.idCardText);
|
||||
},
|
||||
@@ -877,6 +915,11 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.hasInvalidPullBankInfoDateRange([startDate, endDate])) {
|
||||
this.$message.warning("时间跨度最晚只能选择到昨天");
|
||||
return;
|
||||
}
|
||||
|
||||
this.pullBankInfoLoading = true;
|
||||
|
||||
try {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const componentPath = path.resolve(
|
||||
__dirname,
|
||||
"../../src/views/ccdiProject/components/detail/UploadData.vue"
|
||||
);
|
||||
const source = fs.readFileSync(componentPath, "utf8");
|
||||
|
||||
assert(
|
||||
/:picker-options="pullBankInfoDatePickerOptions"/.test(source),
|
||||
"拉取本行信息日期范围应绑定专用的 picker-options"
|
||||
);
|
||||
|
||||
assert(
|
||||
/pullBankInfoDatePickerOptions/.test(source),
|
||||
"组件脚本中应定义拉取本行信息日期范围的专用配置"
|
||||
);
|
||||
|
||||
assert(
|
||||
/getPullBankInfoMaxSelectableDate/.test(source),
|
||||
"组件脚本中应提供“最晚可选日期”为昨天的统一 helper"
|
||||
);
|
||||
|
||||
console.log("upload-data-pull-bank-info-date-limit test passed");
|
||||
Reference in New Issue
Block a user