展会大屏update

机械分厂设备饼图颜色修改
This commit is contained in:
hzz 2023-09-15 19:10:31 +08:00
parent b522a2a3ed
commit c55b9bf9d3
5 changed files with 54 additions and 23 deletions

View File

@ -72,13 +72,24 @@ export const useMicroExhibitionStore = defineStore(Names.MicroExhibition, {
}, },
setcaijian(data) { setcaijian(data) {
data.chart.series = data.chart.series.map((item) => { data.chart.series = data.chart.series.map((item, index) => {
item.type = 'bar' item.type = 'bar'
item.barMaxWidth = 30 item.barMaxWidth = 30
item.label = { item.label = {
show: true, show: true,
position: 'top' position: 'top',
formatter: function (params) {
let unit = '';
if (params.name == '1190269') {
unit = '件'
} else if(params.name == '1050910'){
unit = '米'
}
return params.value + unit;
}
} }
return item return item
}) })
this.caijian = data; this.caijian = data;
@ -90,7 +101,8 @@ export const useMicroExhibitionStore = defineStore(Names.MicroExhibition, {
item.barMaxWidth = 45 item.barMaxWidth = 45
item.label = { item.label = {
show: true, show: true,
position: 'top' position: 'top',
formatter: '{c}只'
} }
return item return item
}) })
@ -106,7 +118,17 @@ export const useMicroExhibitionStore = defineStore(Names.MicroExhibition, {
item.barMaxWidth = 30 item.barMaxWidth = 30
item.label = { item.label = {
show: true, show: true,
position: 'top' position: 'top',
formatter: function (params) {
let unit = '';
let arr = ['RP2011001#', 'RP2011157', '10102109', '10102154']
if (arr.includes(params.name)) {
unit = '片'
} else if(params.name == '1021629'){
unit = '米'
}
return params.value + unit;
}
} }
return item return item
}) })
@ -122,7 +144,8 @@ export const useMicroExhibitionStore = defineStore(Names.MicroExhibition, {
item.barMaxWidth = 30 item.barMaxWidth = 30
item.label = { item.label = {
show: true, show: true,
position: 'top' position: 'top',
formatter: '{c}版'
} }
return item return item
}) })
@ -139,7 +162,8 @@ export const useMicroExhibitionStore = defineStore(Names.MicroExhibition, {
item.barMaxWidth = 30 item.barMaxWidth = 30
item.label = { item.label = {
show: true, show: true,
position: 'top' position: 'top',
formatter: '{c}件'
} }
return item return item
}) })

View File

@ -45,6 +45,7 @@ const init = () => {
fontSize: 16, fontSize: 16,
}, },
}, },
color:['#7CFFB2','#4D9BFF'],
series: [ series: [
{ {
name: "", name: "",

View File

@ -3,7 +3,7 @@
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
import { ref, getCurrentInstance, onMounted,watch } from 'vue' import { ref, getCurrentInstance, onMounted, watch } from 'vue'
const prop = defineProps({ const prop = defineProps({
@ -13,7 +13,7 @@ const prop = defineProps({
}, },
seriesData: { seriesData: {
type: Array, type: Array,
default: [ ] default: []
} }
}) })
@ -28,7 +28,7 @@ const setCharts = () => {
// }, // },
backgroundColor: '#0E0E0E', backgroundColor: '#0E0E0E',
legend: { legend: {
data: ['计划完成','实际完成'], data: ['计划完成', '实际完成'],
}, },
grid:{ grid:{
left:'40', left:'40',
@ -43,21 +43,27 @@ const setCharts = () => {
// rotate: 45, // // rotate: 45, //
// }, // },
}, },
yAxis: { yAxis: [
type: 'value' {
}, type: 'value',
name: '日产量',
// axisLabel: {
// formatter: '{value}%'
// }
}
],
series: prop.seriesData series: prop.seriesData
}; };
charts.setOption(option); charts.setOption(option);
} }
watch(()=>prop.seriesData, (newVal, oldVal) => { watch(() => prop.seriesData, (newVal, oldVal) => {
charts.setOption({ charts.setOption({
series: newVal series: newVal
}); });
},{deep:true}) }, { deep: true })
watch(()=>prop.xData, (newVal, oldVal) => { watch(() => prop.xData, (newVal, oldVal) => {
charts.setOption({ charts.setOption({
xAxis: { xAxis: {
@ -69,7 +75,7 @@ watch(()=>prop.xData, (newVal, oldVal) => {
// }, // },
}, },
}); });
},{deep:true}) }, { deep: true })
onMounted(() => { onMounted(() => {
setCharts() setCharts()
}) })

View File

@ -36,8 +36,8 @@ const prop = defineProps({
default: [ ] default: [ ]
} }
}) })
let header = ['序号', '设备名称', '设备编码', '稼动率', '状态'] let header = ['序号', '设备名称', '设备编码','完成率', '稼动率', '状态']
let columnWidth = [90, 290, 140, 120, 120]; let columnWidth = [90, 290, 140, 120, 120,100];
let sum = 850; let sum = 850;
let computedWidth = (width: number) => { let computedWidth = (width: number) => {
@ -49,7 +49,7 @@ let config = reactive({
oddRowBGC: '#000F1D', oddRowBGC: '#000F1D',
evenRowBGC: '#000F1D', evenRowBGC: '#000F1D',
wrap: [false, false, false, false, false], wrap: [false, false, false, false, false],
columnWidth: [80, 290, 140, 120, 120], columnWidth: [80, 290, 140, 120, 120,100],
align: ['center', 'center', 'center', 'center', 'center', 'center'], align: ['center', 'center', 'center', 'center', 'center', 'center'],
rowNum: 2, rowNum: 2,
waitTime: 3000, waitTime: 3000,

View File

@ -124,8 +124,8 @@ let ringData = computed(() => {
] ]
}) })
let timer = null let timer = null
let dev_caijian_title = ['设备名称', '设备编码', '稼动率', '状态'] let dev_caijian_title = ['设备名称', '设备编码','完成率', '稼动率', '状态']
let dev_tuoxie_title = ['设备编码', '稼动率', '状态'] let dev_tuoxie_title = ['设备编码','完成率', '稼动率', '状态']
let dev_value = [ let dev_value = [
['全自动针梭两用铺布机', '待机', '40层', '1'], ['全自动针梭两用铺布机', '待机', '40层', '1'],
['全自动9公分电脑裁床', '待机', '40层', '0'], ['全自动9公分电脑裁床', '待机', '40层', '0'],