Commit af79ffb2 authored by 高滢's avatar 高滢

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

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