调整上传数据页分页与卡片状态
This commit is contained in:
@@ -27,7 +27,12 @@
|
||||
<!-- 上传模块 -->
|
||||
<div class="upload-section">
|
||||
<div class="upload-cards">
|
||||
<div v-for="card in uploadCards" :key="card.key" class="upload-card">
|
||||
<div
|
||||
v-for="card in uploadCards"
|
||||
:key="card.key"
|
||||
class="upload-card"
|
||||
:class="{ 'is-disabled': card.disabled }"
|
||||
>
|
||||
<div class="card-icon">
|
||||
<i :class="card.icon"></i>
|
||||
</div>
|
||||
@@ -38,6 +43,7 @@
|
||||
:type="card.uploaded ? 'primary' : ''"
|
||||
:icon="card.uploaded ? 'el-icon-view' : 'el-icon-upload2'"
|
||||
:plain="!card.uploaded"
|
||||
:disabled="card.disabled"
|
||||
@click="handleUploadClick(card.key)"
|
||||
>
|
||||
{{ card.btnText }}
|
||||
@@ -49,21 +55,6 @@
|
||||
<!-- 文件上传记录列表 -->
|
||||
<div class="file-list-section">
|
||||
<div class="list-toolbar">
|
||||
<div class="filter-group">
|
||||
<el-select
|
||||
v-model="queryParams.fileStatus"
|
||||
placeholder="文件状态"
|
||||
clearable
|
||||
@change="loadFileList"
|
||||
style="width: 150px"
|
||||
>
|
||||
<el-option label="上传中" value="uploading"></el-option>
|
||||
<el-option label="解析中" value="parsing"></el-option>
|
||||
<el-option label="解析成功" value="parsed_success"></el-option>
|
||||
<el-option label="解析失败" value="parsed_failed"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<el-button icon="el-icon-refresh" @click="handleManualRefresh">刷新</el-button>
|
||||
</div>
|
||||
|
||||
@@ -365,6 +356,7 @@ export default {
|
||||
icon: "el-icon-document",
|
||||
btnText: "上传流水",
|
||||
uploaded: false,
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
key: "credit",
|
||||
@@ -373,6 +365,7 @@ export default {
|
||||
icon: "el-icon-s-data",
|
||||
btnText: "上传征信",
|
||||
uploaded: false,
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
key: "namelist",
|
||||
@@ -381,6 +374,7 @@ export default {
|
||||
icon: "el-icon-s-order",
|
||||
btnText: "选择名单",
|
||||
uploaded: false,
|
||||
disabled: true,
|
||||
},
|
||||
],
|
||||
// 质量指标
|
||||
@@ -422,9 +416,8 @@ export default {
|
||||
listLoading: false,
|
||||
queryParams: {
|
||||
projectId: null,
|
||||
fileStatus: null,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
pageSize: 10,
|
||||
},
|
||||
total: 0,
|
||||
|
||||
@@ -544,7 +537,7 @@ export default {
|
||||
/** 上传卡片点击 */
|
||||
handleUploadClick(key) {
|
||||
const card = this.uploadCards.find((c) => c.key === key);
|
||||
if (!card) return;
|
||||
if (!card || card.disabled) return;
|
||||
|
||||
if (key === "transaction") {
|
||||
// 流水导入 - 打开批量上传弹窗
|
||||
@@ -881,7 +874,6 @@ export default {
|
||||
try {
|
||||
const params = {
|
||||
projectId: this.projectId,
|
||||
fileStatus: this.queryParams.fileStatus,
|
||||
pageNum: this.queryParams.pageNum,
|
||||
pageSize: this.queryParams.pageSize,
|
||||
};
|
||||
@@ -1160,6 +1152,23 @@ export default {
|
||||
box-shadow: 0 4px 12px rgba(24, 144, 255, 0.15);
|
||||
}
|
||||
|
||||
&.is-disabled {
|
||||
background-color: #fafafa;
|
||||
border-color: #ebeef5;
|
||||
opacity: 0.7;
|
||||
|
||||
&:hover {
|
||||
border-color: #ebeef5;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.card-icon,
|
||||
.card-title,
|
||||
.card-desc {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
}
|
||||
|
||||
.card-icon {
|
||||
font-size: 32px;
|
||||
color: #1890ff;
|
||||
@@ -1291,14 +1300,9 @@ export default {
|
||||
|
||||
.list-toolbar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
|
||||
.filter-group {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
35
ruoyi-ui/tests/unit/upload-data-disabled-cards.test.js
Normal file
35
ruoyi-ui/tests/unit/upload-data-disabled-cards.test.js
Normal file
@@ -0,0 +1,35 @@
|
||||
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(
|
||||
/<el-button[\s\S]*?:disabled="card\.disabled"[\s\S]*?@click="handleUploadClick\(card\.key\)"/.test(
|
||||
source
|
||||
),
|
||||
"上传卡片按钮应绑定禁用状态"
|
||||
);
|
||||
|
||||
assert(
|
||||
/key:\s*"credit"[\s\S]*?disabled:\s*true/.test(source),
|
||||
"征信导入卡片应配置为禁用"
|
||||
);
|
||||
|
||||
assert(
|
||||
/key:\s*"namelist"[\s\S]*?disabled:\s*true/.test(source),
|
||||
"名单库选择卡片应配置为禁用"
|
||||
);
|
||||
|
||||
assert(
|
||||
/handleUploadClick\(key\)\s*\{[\s\S]*?if\s*\(!card\s*\|\|\s*card\.disabled\)\s*return;/.test(
|
||||
source
|
||||
),
|
||||
"禁用卡片点击后不应继续执行上传逻辑"
|
||||
);
|
||||
|
||||
console.log("upload-data-disabled-cards test passed");
|
||||
26
ruoyi-ui/tests/unit/upload-data-file-list-settings.test.js
Normal file
26
ruoyi-ui/tests/unit/upload-data-file-list-settings.test.js
Normal file
@@ -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");
|
||||
|
||||
const fileListSectionMatch = source.match(
|
||||
/<div class="file-list-section">([\s\S]*?)<el-table/
|
||||
);
|
||||
assert(fileListSectionMatch, "未找到上传文件列表区域");
|
||||
|
||||
assert(
|
||||
!/<el-select[\s\S]*?queryParams\.fileStatus/.test(fileListSectionMatch[1]),
|
||||
"上传文件列表工具栏不应再显示上传状态筛选框"
|
||||
);
|
||||
|
||||
assert(
|
||||
/queryParams:\s*\{[\s\S]*?pageSize:\s*10\b/.test(source),
|
||||
"上传文件列表分页默认每页应为 10 条"
|
||||
);
|
||||
|
||||
console.log("upload-data-file-list-settings test passed");
|
||||
Reference in New Issue
Block a user