调整上传数据页头部按钮与导入卡片布局

This commit is contained in:
wkc
2026-03-23 19:58:03 +08:00
parent 29be8a88a8
commit 27aab7f9bc
4 changed files with 204 additions and 199 deletions

View File

@@ -16,13 +16,22 @@ assert(
);
assert(
/key:\s*"credit"[\s\S]*?disabled:\s*true/.test(source),
"征信导入卡片应配置为禁用"
/uploadCards:\s*\[[\s\S]*?key:\s*"transaction"[\s\S]*?btnText:\s*"上传流水"[\s\S]*?disabled:\s*false[\s\S]*?\],/.test(
source
),
"上传卡片区应只保留一张默认可用的流水导入卡片"
);
assert(
/key:\s*"namelist"[\s\S]*?disabled:\s*true/.test(source),
"名单库选择卡片应配置为禁用"
/syncUploadCardDisabledState\(\)\s*\{[\s\S]*?card\.key === "transaction"[\s\S]*?disabled:\s*this\.isProjectTagging/.test(
source
),
"流水导入卡片应在项目打标中时同步置灰"
);
assert(
!/key:\s*"credit"/.test(source) && !/key:\s*"namelist"/.test(source),
"上传卡片区不应再保留征信导入或名单库选择卡片配置"
);
assert(

View File

@@ -0,0 +1,78 @@
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(
/<div class="header-actions">[\s\S]*?@click="handleViewReport"[\s\S]*?>\s*查看报告\s*<\/el-button>[\s\S]*?@click="handleFetchBankInfo"[\s\S]*?>\s*拉取本行信息\s*<\/el-button>[\s\S]*?@click="handleOpenCreditUpload"[\s\S]*?>\s*征信导入\s*<\/el-button>/.test(
source
),
"页面右上角按钮顺序应为查看报告、拉取本行信息、征信导入"
);
assert(
/<el-button[\s\S]*?:disabled="isReportDisabled"[\s\S]*?@click="handleViewReport"[\s\S]*?>\s*查看报告\s*<\/el-button>/.test(
source
),
"查看报告按钮应绑定禁用状态"
);
assert(
/<el-button[\s\S]*?type="primary"[\s\S]*?@click="handleViewReport"[\s\S]*?>\s*查看报告\s*<\/el-button>/.test(
source
),
"查看报告按钮应为重要按钮"
);
assert(
/<el-button[\s\S]*?@click="handleOpenCreditUpload"[\s\S]*?>\s*征信导入\s*<\/el-button>/.test(
source
) &&
!/<el-button[\s\S]*?@click="handleOpenCreditUpload"[\s\S]*?type="primary"[\s\S]*?>\s*征信导入\s*<\/el-button>/.test(
source
),
"征信导入按钮应为默认样式"
);
assert(
/isReportDisabled\(\)\s*\{[\s\S]*?\["0",\s*"3"\]\.includes\(String\(this\.projectInfo\.projectStatus\)\)/.test(
source
),
"项目状态为进行中或打标中时应禁用查看报告"
);
assert(
/uploadCards:\s*\[[\s\S]*?key:\s*"transaction"[\s\S]*?btnText:\s*"上传流水"[\s\S]*?disabled:\s*false[\s\S]*?\],/.test(
source
),
"上传卡片区应只保留流水导入卡片"
);
assert(
!/key:\s*"credit"/.test(source),
"上传卡片区不应再保留征信导入卡片配置"
);
assert(
!/key:\s*"namelist"/.test(source),
"上传卡片区不应再保留名单库选择卡片配置"
);
assert(
/\.upload-cards\s*\{[\s\S]*?justify-content:\s*center;/.test(source),
"单张流水导入卡片应在上传区居中显示"
);
assert(
/\.upload-card\s*\{[\s\S]*?width:\s*420px;[\s\S]*?max-width:\s*100%;/.test(
source
),
"流水导入卡片应加宽到 420px并保持窄屏自适应"
);
console.log("upload-data-header-import-button test passed");