湖里大屏(质量管理):组件添加监听 质量问题及问题趋势数据渲染

This commit is contained in:
骆乐 2022-08-10 14:13:43 +08:00
parent e04d72d58d
commit 2c32007920
7 changed files with 72 additions and 7 deletions

View File

@ -44,7 +44,7 @@ if (process.env.NODE_ENV == 'development') {
// tag: 本地
// axios.defaults.baseURL = 'http://192.168.34.174:6023/' // 老大本地
axios.defaults.baseURL = 'http://192.168.34.125:6023/'; //杨意本地 http/1.1
// axios.defaults.baseURL = 'http://sp36hf.natappfree.cc/'; //杨
// axios.defaults.baseURL = 'http://q59pa4.natappfree.cc/'; //杨
// axios.defaults.baseURL = 'http://192.168.34.231:6023/'; //杨思瑞本地
// axios.defaults.baseURL = 'http://47.97.202.104:6023/';
// axios.defaults.baseURL = 'http://124.71.178.44:9500/'; // 星璇

View File

@ -36,6 +36,26 @@ export default {
data() {
return { JLineChart: null }
},
watch:{
xData:{
handler(newVal,oldVal){
if(newVal != oldVal){
this.createChart();
}
},
deep:true,
immediate:true,
},
series:{
handler(newVal,oldVal){
if(newVal != oldVal){
this.createChart();
}
},
deep:true,
immediate:true,
}
},
methods: {
createChart() {
const { title, grid, color, xData, series } = this

View File

@ -31,6 +31,26 @@ export default {
mounted() {
this.createRingChart()
},
watch:{
data:{
handler(newVal,oldVal){
if(newVal != oldVal){
this.createRingChart();
}
},
deep:true,
immediate:true,
},
title:{
handler(newVal,oldVal){
if(newVal != oldVal){
this.createRingChart();
}
},
deep:true,
immediate:true,
}
},
methods: {
createRingChart() {
const jRingChart = echarts.init(this.$refs.jRingChart)

View File

@ -39,9 +39,9 @@ export default {
data() {
return {
total:{
totalNum:3412,
jyUrgentLevelNum:26,
ybUrgentLevelNum:58,
totalNum:'',
jyUrgentLevelNum:'',
ybUrgentLevelNum:'',
}
}
},

View File

@ -9,6 +9,7 @@
<script>
import JLineChart from '../jChart/line/JLineChart.vue'
import { selectDangerTypeQualityCountApi } from '@/assets/js/api/dataBoard'
export default {
components: { JLineChart },
props: {
@ -32,6 +33,30 @@ export default {
}
]
}
},
mounted() {
this.getData(2);
},
methods: {
getData(opType) {
let data = {
projectSn: this.$store.state.projectSn,
opType: opType
};
selectDangerTypeQualityCountApi(data).then(res => {
var arr = res.result.list;
if (arr != null) {
var xdata = [];
var ydata = [];
arr.forEach(item => {
xdata.push(item.dangerName);
ydata.push(item.num);
});
this.xData = xdata;
this.series.data = ydata;
}
});
}
}
}
</script>

View File

@ -14,7 +14,7 @@
</div>
<div class="chart">
<JRingChart
:title="{ text: total.ratioNum, subTitle: '即时整改问题' }"
:title="{ text: total.ratioNum, subTitle: '即时整改问题' }"
:color="['#557DEE', '#43D7B5']"
:data="[
{ value: 1, name: '' },
@ -59,11 +59,9 @@ export default {
projectSn: this.projectSn
}
selectQualityStatisticsApi(data).then(res => {
console.log('-------',res)
this.total = res.result.total
let ratio = this.total.totalNum ? ((this.total.closeNum / this.total.totalNum) * 100).toFixed(2) : 0
this.total.ratioNum = ratio + '%'
console.log('------------',this.ratioNum)
})
}
}

View File

@ -176,6 +176,7 @@
:controls="false"
>
</el-input-number>
<!-- 检查频次 选择单位 -->
<el-select
class="smallInput"
v-model="addEditForm.frequencyType"
@ -256,6 +257,7 @@ export default {
data() {
return {
searchForm: {
frequencyType:'', // frequencyType ==7 frequencyType ==6
inspectTypeId: "",
startTime: "",
endTime: "",