update - 首页

master
yinq 9 months ago
parent 26f99d8c0a
commit fae47815c7

@ -62,7 +62,7 @@ export default {
this.chart = echarts.init(this.$el, 'macarons') this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData) this.setOptions(this.chartData)
}, },
setOptions({expectedData, actualData} = {}) { setOptions({expectedData, actualData,expedData} = {}) {
const week = () =>{ const week = () =>{
let today = new Date(); let today = new Date();
let firstDayOfYear = new Date(today.getFullYear(), 0, 1); let firstDayOfYear = new Date(today.getFullYear(), 0, 1);
@ -77,7 +77,7 @@ export default {
} }
this.chart.setOption({ this.chart.setOption({
title: { title: {
text: `${week()}`, text: `${week()}产量`,
textStyle: { textStyle: {
align: 'center', align: 'center',
color: '#000', color: '#000',
@ -87,7 +87,7 @@ export default {
left: '0%', left: '0%',
}, },
xAxis: { xAxis: {
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], data: ['2023-12-11', '2023-12-12', '2023-12-13', '2023-12-14', '2023-12-15', '2023-12-16', '2023-12-17'],
// boundaryGap: false, // boundaryGap: false,
axisTick: { axisTick: {
show: false show: false
@ -124,7 +124,7 @@ export default {
}, },
series: [ series: [
{ {
name: 'actual1', name: '订单违约率',
type: 'bar', type: 'bar',
yAxisIndex:1, yAxisIndex:1,
itemStyle: { itemStyle: {
@ -144,7 +144,7 @@ export default {
animationEasing: 'quadraticOut' animationEasing: 'quadraticOut'
}, },
{ {
name: 'actual', name: '产量',
smooth: false, smooth: false,
type: 'line', type: 'line',
itemStyle: { itemStyle: {
@ -159,7 +159,7 @@ export default {
} }
} }
}, },
data: actualData, data: expedData,
animationDuration: 1000, animationDuration: 1000,
animationEasing: 'quadraticOut' animationEasing: 'quadraticOut'
} }

@ -76,7 +76,7 @@ export default {
} }
this.chart.setOption({ this.chart.setOption({
title: { title: {
text: `${week()}`, text: `${week()}清单率`,
textStyle: { textStyle: {
align: 'center', align: 'center',
color: '#000', color: '#000',
@ -86,7 +86,7 @@ export default {
left: '0%', left: '0%',
}, },
xAxis: { xAxis: {
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], data: ['2023-12-11', '2023-12-12', '2023-12-13', '2023-12-14', '2023-12-15', '2023-12-16', '2023-12-17'],
boundaryGap: false, boundaryGap: false,
axisTick: { axisTick: {
show: false show: false
@ -117,7 +117,7 @@ export default {
series: [ series: [
{ {
name: 'actual', name: '清单率',
smooth: false, smooth: false,
type: 'line', type: 'line',
itemStyle: { itemStyle: {

@ -9,7 +9,7 @@
<div class="card-panel-text"> <div class="card-panel-text">
计划工单数量 计划工单数量
</div> </div>
<count-to :start-val="0" :end-val="102400" :duration="2600" class="card-panel-num" /> <count-to :start-val="0" :end-val="25" :duration="10" class="card-panel-num" />
</div> </div>
</div> </div>
</el-col> </el-col>
@ -22,7 +22,7 @@
<div class="card-panel-text"> <div class="card-panel-text">
在制工单数量 在制工单数量
</div> </div>
<count-to :start-val="0" :end-val="81212" :duration="3000" class="card-panel-num" /> <count-to :start-val="0" :end-val="12" :duration="2" class="card-panel-num" />
</div> </div>
</div> </div>
</el-col> </el-col>
@ -35,7 +35,7 @@
<div class="card-panel-text"> <div class="card-panel-text">
今日计划产量 今日计划产量
</div> </div>
<count-to :start-val="0" :end-val="9280" :duration="3200" class="card-panel-num" /> <count-to :start-val="0" :end-val="3500" :duration="3500" class="card-panel-num" />
</div> </div>
</div> </div>
</el-col> </el-col>
@ -48,7 +48,7 @@
<div class="card-panel-text"> <div class="card-panel-text">
今日完成产量 今日完成产量
</div> </div>
<count-to :start-val="0" :end-val="13600" :duration="3600" class="card-panel-num" /> <count-to :start-val="0" :end-val="1500" :duration="1500" class="card-panel-num" />
</div> </div>
</div> </div>
</el-col> </el-col>
@ -64,7 +64,7 @@ export default {
}, },
methods: { methods: {
handleSetLineChartData(type) { handleSetLineChartData(type) {
this.$emit('handleSetLineChartData', type) // this.$emit('handleSetLineChartData', type)
} }
} }
} }

@ -58,7 +58,7 @@ export default {
} }
this.chart.setOption({ this.chart.setOption({
title: { title: {
text: `${week()}`, text: `${week()}质量缺陷分布`,
textStyle: { textStyle: {
align: 'center', align: 'center',
color: '#000', color: '#000',

@ -1,10 +1,10 @@
<template> <template>
<div class="dashboard-editor-container"> <div class="dashboard-editor-container">
<panel-group @handleSetLineChartData="handleSetLineChartData" /> <panel-group @handleSetLineChartData="handleSetLineChartData"/>
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;"> <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
<line-chart :chart-data="lineChartData" /> <line-chart :chart-data="lineChartData"/>
</el-row> </el-row>
<el-row :gutter="32"> <el-row :gutter="32">
@ -15,7 +15,7 @@
</el-col> </el-col>
<el-col :xs="24" :sm="24" :lg="8"> <el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper"> <div class="chart-wrapper">
<pie-chart /> <pie-chart/>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -34,8 +34,9 @@ import BarChart from './dashboard/BarChart'
const lineChartData = { const lineChartData = {
newVisitis: { newVisitis: {
expectedData: [100, 120, 161, 134, 105, 160, 165], expectedData: [99, 98, 95, 93, 96, 93, 97],
actualData: [120, 82, 91, 154, 162, 140, 145] actualData: [99, 98, 95, 93, 96, 93, 97],
expedData: [200, 192, 120, 144, 160, 130, 140]
}, },
messages: { messages: {
expectedData: [200, 192, 120, 144, 160, 130, 140], expectedData: [200, 192, 120, 144, 160, 130, 140],
@ -87,7 +88,7 @@ export default {
} }
} }
@media (max-width:1024px) { @media (max-width: 1024px) {
.chart-wrapper { .chart-wrapper {
padding: 8px; padding: 8px;
} }

Loading…
Cancel
Save