Commit af79ffb2 authored by 高滢's avatar 高滢

feat(首页): 平均检验通过率

parent 56adb865
......@@ -14,3 +14,17 @@ export function selectStandardCategoryStatistics(){
method: 'post'
})
}
export function selectConfidentialityLevelStatistics(){
return request({
url: '/home/statistics/confidentialityLevel',
method: 'post'
})
}
export function selectAverageInspectionRate(){
return request({
url: '/home/statistics/averageInspectionRate',
method: 'post'
})
}
......@@ -97,7 +97,7 @@ export default {
},
data: [
{
value: 54
value: this.value
}
]
},
......
......@@ -5,17 +5,51 @@
></div>
</template>
<script>
import { getDicts } from '../../api/system/dict/data'
import { selectConfidentialityLevelStatistics } from '../../api/system/home'
export default {
name: 'ConfidentialityTasks',
data() {
return {
confidentialityLevel: [],
dictType: [],
chart: null
}
},
watch: {
confidentialityLevel: {
deep: true,
handler() {
this.init()
}
}
},
mounted() {
this.init()
},
created() {
this.getConfidentialityLevelStatistics()
},
methods: {
async getConfidentialityLevelStatistics() {
await getDicts('confidentiality_level').then(res => {
this.dictType = res.data
})
await selectConfidentialityLevelStatistics().then(res => {
this.confidentialityLevel = res.data
this.dictReturn(this.confidentialityLevel, this.dictType)
})
},
dictReturn(a, b) {
a.forEach((aItem, index) => {
b.forEach(bItem => {
if (aItem.name === bItem.dictValue) {
a[index].name = bItem.dictLabel
}
})
})
},
init() {
// 2.初始化
this.chart = this.$echarts.init(this.$refs.chart)
......@@ -74,12 +108,7 @@ export default {
labelLine: {
show: false
},
data: [
{ value: 1048, name: 'A' },
{ value: 735, name: 'B' },
{ value: 580, name: 'C' },
{ value: 484, name: 'D' }
]
data: this.confidentialityLevel
}
]
}
......
......@@ -12,7 +12,7 @@ export default {
name: 'StandardClassification',
data() {
return {
standardCategory: [{ name: '网络安全', value: 1 }],
standardCategory: [],
dictType: [],
chart: null
}
......
......@@ -241,7 +241,7 @@
<div class="cardStyle">
<el-carousel height="460px" :autoplay="false">
<el-carousel-item
v-for="(item, index) in averageTestList"
v-for="(item, index) in averageInspectionRate"
:key="index"
>
<div style="display: flex; justify-content: space-between">
......@@ -249,17 +249,17 @@
<div
style="color: #1a6fd7; font-weight: 700; font-size: 16px"
>
{{ item.standard }}
{{ item.standardNumber }}
</div>
</div>
<AverageTest
v-if="averageTestShow"
:value="item.value"
:value="item.passingRate"
></AverageTest>
<div
style="color: #606266; font-size: 16px; text-align: center"
>
检验项目:{{ item.name }}
检验项目:{{ item.inspectionItems }}
</div>
</el-carousel-item>
</el-carousel>
......@@ -305,7 +305,10 @@ import ConfidentialityTasks from './echartHome/confidentialityTasks.vue'
import UseCaseRisk from './echartHome/useCaseRisk.vue'
import UseCaseTest from './echartHome/useCaseTest.vue'
import AverageTest from './echartHome/averageTest.vue'
import { selectQuantityStatistics } from '../api/system/home'
import {
selectAverageInspectionRate,
selectQuantityStatistics
} from '../api/system/home'
import { getDicts } from '../api/system/dict/data'
export default {
......@@ -338,6 +341,7 @@ export default {
standard: 'GB2020-2023'
}
],
averageInspectionRate: [],
taskCompleted: [
{ name: '张晓刚', value: 90 },
{ name: '王小虎', value: 90 },
......@@ -353,12 +357,18 @@ export default {
}
},
created() {
this.getQuantityStatistics()
this.getAverageInspectionRate()
},
methods: {
getAverageInspectionRate() {
selectAverageInspectionRate().then(res => {
this.averageInspectionRate = res.data
this.$nextTick(() => {
this.averageTestShow = true
})
this.getQuantityStatistics()
})
},
methods: {
getQuantityStatistics() {
selectQuantityStatistics({}).then(res => {
this.quantityStatisticsForm = res.data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment