From b69064b68d2b3ca361123d91d957669220f5f664 Mon Sep 17 00:00:00 2001
From: wkc <978997012@qq.com>
Date: Wed, 11 Mar 2026 09:30:17 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=B5=81=E6=B0=B4=E6=98=8E?=
=?UTF-8?q?=E7=BB=86=E7=AD=9B=E9=80=89=E6=A0=8F=E9=A1=BA=E5=BA=8F=E5=B9=B6?=
=?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=BA=A4=E6=98=93=E7=B1=BB=E5=9E=8B=E7=AD=9B?=
=?UTF-8?q?=E9=80=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/detail/DetailQuery.vue | 130 ++++++++++--------
.../unit/detail-query-filter-layout.test.js | 78 +++++++++++
2 files changed, 153 insertions(+), 55 deletions(-)
create mode 100644 ruoyi-ui/tests/unit/detail-query-filter-layout.test.js
diff --git a/ruoyi-ui/src/views/ccdiProject/components/detail/DetailQuery.vue b/ruoyi-ui/src/views/ccdiProject/components/detail/DetailQuery.vue
index 0bb327e..4b061b1 100644
--- a/ruoyi-ui/src/views/ccdiProject/components/detail/DetailQuery.vue
+++ b/ruoyi-ui/src/views/ccdiProject/components/detail/DetailQuery.vue
@@ -17,31 +17,6 @@
/>
-
-
-
- 匹配空值
-
-
-
-
-
-
- 匹配空值
-
-
-
-
+
+
-
- 匹配空值
-
-
+
+
+
+
+
+
+
-
- 匹配空值
-
- 查询
- 重置
+ 查询
+ 重置
@@ -407,8 +402,6 @@ const createDefaultQueryParams = (projectId) => ({
amountMax: "",
counterpartyAccount: "",
counterpartyAccountEmpty: false,
- transactionType: "",
- transactionTypeEmpty: false,
orderBy: "trxDate",
orderDirection: "desc",
});
@@ -641,8 +634,8 @@ export default {
.query-page-shell {
display: grid;
- grid-template-columns: 320px minmax(0, 1fr);
- gap: 16px;
+ grid-template-columns: 300px minmax(0, 1fr);
+ gap: 12px;
}
.shell-sidebar,
@@ -653,7 +646,7 @@ export default {
}
.shell-sidebar {
- padding: 20px 16px;
+ padding: 16px 14px;
}
.shell-main {
@@ -687,10 +680,16 @@ export default {
}
.filter-form {
- margin-top: 20px;
+ margin-top: 12px;
:deep(.el-form-item) {
- margin-bottom: 18px;
+ margin-bottom: 14px;
+ }
+
+ :deep(.el-form-item__label) {
+ padding-bottom: 6px;
+ line-height: 20px;
+ font-size: 13px;
}
}
@@ -698,14 +697,35 @@ export default {
width: 100%;
}
+.filter-item-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+ margin-bottom: 6px;
+}
+
+.filter-item-label {
+ font-size: 13px;
+ line-height: 20px;
+ color: #606266;
+}
+
.empty-checkbox {
- margin-top: 8px;
+ margin-top: 0;
+ flex-shrink: 0;
+}
+
+:deep(.empty-checkbox .el-checkbox__label) {
+ padding-left: 4px;
+ font-size: 12px;
+ color: #909399;
}
.amount-range {
display: flex;
align-items: center;
- gap: 8px;
+ gap: 6px;
}
.amount-separator {
@@ -715,7 +735,7 @@ export default {
.filter-actions {
display: flex;
- gap: 12px;
+ gap: 8px;
.el-button {
flex: 1;
diff --git a/ruoyi-ui/tests/unit/detail-query-filter-layout.test.js b/ruoyi-ui/tests/unit/detail-query-filter-layout.test.js
new file mode 100644
index 0000000..1e7761c
--- /dev/null
+++ b/ruoyi-ui/tests/unit/detail-query-filter-layout.test.js
@@ -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/DetailQuery.vue"
+);
+const source = fs.readFileSync(componentPath, "utf8");
+
+[
+ ["对方名称", "queryParams.counterpartyNameEmpty"],
+ ["摘要", "queryParams.userMemoEmpty"],
+ ["对方账户", "queryParams.counterpartyAccountEmpty"],
+].forEach(([label, model]) => {
+ const inlineTogglePattern = new RegExp(
+ `[\\s\\S]*?`,
+ "m"
+ );
+
+ assert(
+ inlineTogglePattern.test(source),
+ `${label}筛选项应将匹配空值放到标题同一行`
+ );
+});
+
+const filterOrder = [
+ 'label="交易时间"',
+ 'label="本方主体"',
+ 'label="本方银行"',
+ 'label="本方账号"',
+ 'label="金额区间"',
+ '对方名称',
+ '对方账户',
+ '摘要',
+];
+
+let lastIndex = -1;
+filterOrder.forEach((token) => {
+ const currentIndex = source.indexOf(token);
+ assert.notStrictEqual(currentIndex, -1, `未找到筛选项标识: ${token}`);
+ assert(
+ currentIndex > lastIndex,
+ `筛选项顺序不正确,${token} 应出现在前一项之后`
+ );
+ lastIndex = currentIndex;
+});
+
+assert(
+ !source.includes('placeholder="请输入交易类型"'),
+ "筛选栏不应再显示交易类型输入框"
+);
+
+assert(
+ !source.includes("queryParams.transactionType"),
+ "筛选逻辑不应再保留交易类型参数"
+);
+
+assert(
+ !source.includes("queryParams.transactionTypeEmpty"),
+ "筛选逻辑不应再保留交易类型空值匹配参数"
+);
+
+assert(
+ /\.filter-item-header\s*\{[\s\S]*display:\s*flex;[\s\S]*justify-content:\s*space-between;[\s\S]*margin-bottom:\s*6px;/m.test(
+ source
+ ),
+ "筛选项标题行应使用紧凑的横向布局"
+);
+
+assert(
+ /\.filter-form\s*\{[\s\S]*margin-top:\s*12px;[\s\S]*:deep\(.el-form-item\)\s*\{[\s\S]*margin-bottom:\s*14px;/m.test(
+ source
+ ),
+ "筛选表单应压缩顶部和表单项间距"
+);
+
+console.log("detail-query-filter-layout test passed");