搭建结果总览页面骨架
This commit is contained in:
@@ -1,15 +1,77 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="preliminary-check-container">
|
<div class="preliminary-check-container">
|
||||||
<div class="placeholder-content">
|
<div v-if="pageState === 'loading'" class="preliminary-check-state">
|
||||||
<i class="el-icon-data-analysis"></i>
|
<p>结果总览加载中...</p>
|
||||||
<p>结果总览功能开发中...</p>
|
</div>
|
||||||
|
|
||||||
|
<div v-else-if="pageState === 'empty'" class="preliminary-check-state">
|
||||||
|
<p>暂无结果总览数据</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else class="preliminary-check-page">
|
||||||
|
<overview-stats :summary="mockData.summary" />
|
||||||
|
<risk-people-section :section-data="mockData.riskPeople" />
|
||||||
|
<risk-model-section :section-data="mockData.riskModels" />
|
||||||
|
<risk-detail-section :section-data="mockData.riskDetails" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mockOverviewData } from "./preliminaryCheck.mock";
|
||||||
|
|
||||||
|
const OverviewStats = {
|
||||||
|
name: "OverviewStats",
|
||||||
|
props: {
|
||||||
|
summary: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
template: '<section class="overview-stats-placeholder"></section>',
|
||||||
|
};
|
||||||
|
|
||||||
|
const RiskPeopleSection = {
|
||||||
|
name: "RiskPeopleSection",
|
||||||
|
props: {
|
||||||
|
sectionData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
template: '<section class="risk-people-placeholder"></section>',
|
||||||
|
};
|
||||||
|
|
||||||
|
const RiskModelSection = {
|
||||||
|
name: "RiskModelSection",
|
||||||
|
props: {
|
||||||
|
sectionData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
template: '<section class="risk-model-placeholder"></section>',
|
||||||
|
};
|
||||||
|
|
||||||
|
const RiskDetailSection = {
|
||||||
|
name: "RiskDetailSection",
|
||||||
|
props: {
|
||||||
|
sectionData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
template: '<section class="risk-detail-placeholder"></section>',
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "PreliminaryCheck",
|
name: "PreliminaryCheck",
|
||||||
|
components: {
|
||||||
|
OverviewStats,
|
||||||
|
RiskPeopleSection,
|
||||||
|
RiskModelSection,
|
||||||
|
RiskDetailSection,
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
projectId: {
|
projectId: {
|
||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
@@ -24,28 +86,28 @@ export default {
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pageState: "loaded",
|
||||||
|
mockData: mockOverviewData,
|
||||||
|
};
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.preliminary-check-container {
|
.preliminary-check-container {
|
||||||
padding: 40px 20px;
|
|
||||||
background: #fff;
|
|
||||||
min-height: 400px;
|
min-height: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.placeholder-content {
|
.preliminary-check-state {
|
||||||
text-align: center;
|
padding: 40px 20px;
|
||||||
|
background: #fff;
|
||||||
color: #909399;
|
color: #909399;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
i {
|
.preliminary-check-page {
|
||||||
font-size: 48px;
|
min-height: 400px;
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
font-size: 14px;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
export const mockOverviewData = {
|
||||||
|
summary: {},
|
||||||
|
riskPeople: {},
|
||||||
|
riskModels: {},
|
||||||
|
riskDetails: {},
|
||||||
|
};
|
||||||
20
ruoyi-ui/tests/unit/preliminary-check-layout.test.js
Normal file
20
ruoyi-ui/tests/unit/preliminary-check-layout.test.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
const assert = require("assert");
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
const componentPath = path.resolve(
|
||||||
|
__dirname,
|
||||||
|
"../../src/views/ccdiProject/components/detail/PreliminaryCheck.vue"
|
||||||
|
);
|
||||||
|
const source = fs.readFileSync(componentPath, "utf8");
|
||||||
|
|
||||||
|
[
|
||||||
|
"OverviewStats",
|
||||||
|
"RiskPeopleSection",
|
||||||
|
"RiskModelSection",
|
||||||
|
"RiskDetailSection",
|
||||||
|
"pageState",
|
||||||
|
"mockOverviewData",
|
||||||
|
].forEach((token) => {
|
||||||
|
assert(source.includes(token), `结果总览入口缺少结构: ${token}`);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user