完成专项核查家庭资产负债实现
This commit is contained in:
16
ruoyi-ui/tests/unit/special-check-detail-expand.test.js
Normal file
16
ruoyi-ui/tests/unit/special-check-detail-expand.test.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const sectionSource = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../src/views/ccdiProject/components/detail/FamilyAssetLiabilitySection.vue"),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
assert(sectionSource.includes("expandedStaffIdCard"), "缺少当前展开员工状态");
|
||||
assert(sectionSource.includes("detailCache"), "缺少详情缓存");
|
||||
assert(sectionSource.includes("getFamilyAssetLiabilityDetail"), "首次展开应请求详情接口");
|
||||
assert(sectionSource.includes("查看详情"), "缺少详情操作入口");
|
||||
assert(!sectionSource.includes("el-dialog"), "不应使用弹窗详情");
|
||||
assert(!sectionSource.includes("el-drawer"), "不应使用抽屉详情");
|
||||
assert(!sectionSource.includes("$router"), "不应通过路由跳转查看详情");
|
||||
33
ruoyi-ui/tests/unit/special-check-detail-layout.test.js
Normal file
33
ruoyi-ui/tests/unit/special-check-detail-layout.test.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const source = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../src/views/ccdiProject/components/detail/FamilyAssetLiabilityDetail.vue"),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
[
|
||||
"收入明细",
|
||||
"资产明细",
|
||||
"负债明细",
|
||||
"本人收入",
|
||||
"配偶收入",
|
||||
"本人资产小计",
|
||||
"配偶资产小计",
|
||||
"本人负债小计",
|
||||
"配偶负债小计",
|
||||
"el-table",
|
||||
"el-empty",
|
||||
].forEach((token) => assert(source.includes(token), token));
|
||||
|
||||
assert(source.includes("missingSelfAssetInfo"), "资产卡片应支持缺少信息判断");
|
||||
assert(source.includes("missingSelfDebtInfo"), "负债卡片应支持缺少信息判断");
|
||||
assert(source.includes('v-if="!assetDetail.missingSelfAssetInfo"'), "资产小计应可隐藏");
|
||||
assert(source.includes('v-if="!debtDetail.missingSelfDebtInfo"'), "负债小计应可隐藏");
|
||||
|
||||
assert(
|
||||
source.includes("grid-template-columns: repeat(3, minmax(0, 1fr));"),
|
||||
"三个详情卡片应横向均分"
|
||||
);
|
||||
assert(source.includes("@media (max-width: 1200px)"), "中小屏应保留响应式回落");
|
||||
@@ -0,0 +1,22 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const source = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../src/api/ccdi/projectSpecialCheck.js"),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
[
|
||||
"getFamilyAssetLiabilityList",
|
||||
"getFamilyAssetLiabilityDetail",
|
||||
"/ccdi/project/special-check/family-asset-liability/list",
|
||||
"/ccdi/project/special-check/family-asset-liability/detail",
|
||||
].forEach((token) => assert(source.includes(token), token));
|
||||
|
||||
const detailStart = source.indexOf("export function getFamilyAssetLiabilityDetail(projectId, staffIdCard)");
|
||||
assert(detailStart >= 0, "缺少详情接口函数定义");
|
||||
|
||||
const detailBlock = source.slice(detailStart, detailStart + 260);
|
||||
assert(detailBlock.includes("projectId"), "详情接口缺少 projectId");
|
||||
assert(detailBlock.includes("staffIdCard"), "详情接口缺少 staffIdCard");
|
||||
25
ruoyi-ui/tests/unit/special-check-family-table.test.js
Normal file
25
ruoyi-ui/tests/unit/special-check-family-table.test.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const source = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../src/views/ccdiProject/components/detail/FamilyAssetLiabilitySection.vue"),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
[
|
||||
"姓名",
|
||||
"身份证号",
|
||||
"所属部门",
|
||||
"家庭总年收入",
|
||||
"家庭总资产",
|
||||
"家庭总负债",
|
||||
"风险情况",
|
||||
"操作",
|
||||
"查看详情",
|
||||
"el-table",
|
||||
"el-table-column",
|
||||
].forEach((token) => assert(source.includes(token), token));
|
||||
|
||||
assert(source.includes("loading"), "列表区块应接收加载状态");
|
||||
assert(source.includes("rows"), "列表区块应消费列表数据");
|
||||
13
ruoyi-ui/tests/unit/special-check-layout.test.js
Normal file
13
ruoyi-ui/tests/unit/special-check-layout.test.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const source = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../src/views/ccdiProject/components/detail/SpecialCheck.vue"),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
assert(!source.includes("专项排查功能开发中"), "不应继续保留占位文案");
|
||||
assert(!source.includes("功能开发中..."), "不应继续保留功能开发中提示");
|
||||
assert(source.includes("员工家庭资产负债专项核查"), "缺少专项核查卡片标题");
|
||||
assert(source.includes("getFamilyAssetLiabilityList"), "主容器应接入真实列表接口");
|
||||
15
ruoyi-ui/tests/unit/special-check-risk-tag.test.js
Normal file
15
ruoyi-ui/tests/unit/special-check-risk-tag.test.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const source = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../src/views/ccdiProject/components/detail/FamilyAssetLiabilitySection.vue"),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
assert(source.includes("el-tag"), "风险情况应使用标签展示");
|
||||
assert(source.includes("resolveRiskTagType"), "缺少风险标签类型映射");
|
||||
assert(source.includes("NORMAL"), "缺少正常风险码映射");
|
||||
assert(source.includes("RISK"), "缺少存在风险码映射");
|
||||
assert(source.includes("HIGH"), "缺少高风险码映射");
|
||||
assert(source.includes("MISSING_INFO"), "缺少缺少信息风险码映射");
|
||||
20
ruoyi-ui/tests/unit/special-check-states.test.js
Normal file
20
ruoyi-ui/tests/unit/special-check-states.test.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const vueSource = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../src/views/ccdiProject/components/detail/SpecialCheck.vue"),
|
||||
"utf8"
|
||||
);
|
||||
const mockSource = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../src/views/ccdiProject/components/detail/specialCheck.mock.js"),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
["loading", "empty", "loaded"].forEach((state) => {
|
||||
assert(vueSource.includes(`pageState === "${state}"`) || vueSource.includes(`pageState === '${state}'`), state);
|
||||
assert(mockSource.includes(`${state}:`), `mock 中缺少 ${state} 状态`);
|
||||
});
|
||||
|
||||
assert(vueSource.includes("el-skeleton"), "加载态应保留骨架屏");
|
||||
assert(vueSource.includes("el-empty"), "空态应保留空态组件");
|
||||
25
ruoyi-ui/tests/unit/special-check-visual-alignment.test.js
Normal file
25
ruoyi-ui/tests/unit/special-check-visual-alignment.test.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const specialCheckSource = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../src/views/ccdiProject/components/detail/SpecialCheck.vue"),
|
||||
"utf8"
|
||||
);
|
||||
const sectionSource = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../src/views/ccdiProject/components/detail/FamilyAssetLiabilitySection.vue"),
|
||||
"utf8"
|
||||
);
|
||||
const detailSource = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../src/views/ccdiProject/components/detail/FamilyAssetLiabilityDetail.vue"),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
assert(!specialCheckSource.includes("功能开发中"), "不应再出现占位文案");
|
||||
assert(sectionSource.includes("section-card"), "列表区块应沿用白卡容器结构");
|
||||
assert(sectionSource.includes("block-header"), "列表区块应沿用标题头结构");
|
||||
assert(sectionSource.includes("block-title"), "列表区块缺少标题样式");
|
||||
assert(sectionSource.includes("block-subtitle"), "列表区块缺少副标题样式");
|
||||
assert(sectionSource.includes(":deep(.family-table th)"), "表格头样式应与结果总览统一");
|
||||
assert(sectionSource.includes("el-tag"), "风险标签应保留标签形态");
|
||||
assert(detailSource.includes("block-title"), "详情区块标题应与结果总览标题层级统一");
|
||||
Reference in New Issue
Block a user