diff --git a/public/VideoWeb/Build/APP.data.unityweb b/public/VideoWeb/Build/APP.data.unityweb index a1698de..d98add8 100644 Binary files a/public/VideoWeb/Build/APP.data.unityweb and b/public/VideoWeb/Build/APP.data.unityweb differ diff --git a/public/VideoWeb/Build/APP.framework.js.unityweb b/public/VideoWeb/Build/APP.framework.js.unityweb index e6585aa..09869d8 100644 Binary files a/public/VideoWeb/Build/APP.framework.js.unityweb and b/public/VideoWeb/Build/APP.framework.js.unityweb differ diff --git a/public/VideoWeb/Build/APP.wasm.unityweb b/public/VideoWeb/Build/APP.wasm.unityweb index 94f4911..d259409 100644 Binary files a/public/VideoWeb/Build/APP.wasm.unityweb and b/public/VideoWeb/Build/APP.wasm.unityweb differ diff --git a/src/components/newchart/pieChart.vue b/src/components/newchart/pieChart.vue index f0f100c..33beed3 100644 --- a/src/components/newchart/pieChart.vue +++ b/src/components/newchart/pieChart.vue @@ -56,18 +56,37 @@ export default { // var legend = newVal.type_data.map((ele) => { // return ele.name; // }); - + newVal.type_data.forEach((ele) => { // console.log(JSON.stringify(ele)) - // if (ele.quantity != 0) { + if (ele.quantity != 0) { seriesData.push({ name: getNameFromTargetType(ele.name), value: ele.quantity }); // legend.push(ele.name) - // } + } }); } + // 判断数据是否为空 + if (seriesData.length === 0) { + // 如果为空,动态添加一个默认项 + seriesData = [ + { + value: 0, + name: '无', + label: { show: false }, + itemStyle: { color: '#EFEFEF' }, + emphasis: { + disabled: true, + label: { show: false }, + itemStyle: { + color: '#EFEFEF' + } + } + } + ]; + } let myChart = this.$echarts.getInstanceByDom(this.$refs.pieChart); if (!myChart) { myChart = this.$echarts.init(this.$refs.pieChart); @@ -114,11 +133,6 @@ export default { type: 'pie', center: ['30%', '55%'], radius: '70%', - label: { - normal: { - show: false - } - }, labelLine: { show: false, length: 0, @@ -152,7 +166,8 @@ export default { // }) } }, - mounted() {}, + mounted() { + }, watch: { list: { handler: function (newval, oldVal) { @@ -163,8 +178,8 @@ export default { }); } }, - deep: true - // immediate: true + deep: true, + immediate: true } } }; diff --git a/src/components/sensorFusion/echartsPie.vue b/src/components/sensorFusion/echartsPie.vue index 19d585c..55c43cb 100644 --- a/src/components/sensorFusion/echartsPie.vue +++ b/src/components/sensorFusion/echartsPie.vue @@ -97,13 +97,30 @@ export default { if(seriesData&&seriesData.length>0){ let temp=[]; seriesData.forEach((ele) => { - // if (ele.value != 0) { + if (ele.value != 0) { ele.name = getNameFromTargetType(ele.name); temp.push(ele) - // } + } }) seriesData = temp } + if(!seriesData||seriesData.length==0){ + seriesData = [ + { + value: 0, + name: '无', + label: { show: false }, + itemStyle: { color: '#EFEFEF' }, + emphasis: { + disabled: true, + label: { show: false }, + itemStyle: { + color: '#EFEFEF' + } + } + } + ]; + } var color = [ '#0CD2E6', @@ -240,8 +257,8 @@ export default { }, echartsRef: { handler: function (oldValues, newValues) { - console.log('old', oldValues); - console.log('newV', newValues); + // console.log('old', oldValues); + // console.log('newV', newValues); let that = this; setTimeout(() => { that.$nextTick(() => {