| | |
| | | <template> |
| | | <div class="data-container"> |
| | | <wrapper-title :title="'工单数据'" :path="'/work-order-center/maintenance/work-order/work-order'"></wrapper-title> |
| | | <!-- <wrapper-title |
| | | :title="'工单数据'" |
| | | :path="'/work-order-center/maintenance/work-order/work-order'" |
| | | ></wrapper-title> --> |
| | | |
| | | <div class="data-content"> |
| | | <div class="data-panel"> |
| | | <div class="panel-title"> |
| | | <div class="panel-title" style="margin-bottom: 30px"> |
| | | <div class="icon"> |
| | | <img src="@/assets/icons/arrow.png" alt=""> |
| | | <img src="@/assets/icons/arrow.png" alt="" /> |
| | | </div> |
| | | <div class="title"> |
| | | 整体工单数 |
| | | </div> |
| | | <div class="title">整体工单数</div> |
| | | </div> |
| | | <div class="panel-container"> |
| | | <div class="panel-item"> |
| | | <data-hola :holaTitle="`工单总数`" :centerValue="3000" :holaColor="`#4ea8ff`"></data-hola> |
| | | <data-hola |
| | | :holaTitle="`工单总数`" |
| | | :centerValue="workOrderData.totalNum" |
| | | :holaColor="`#4ea8ff`" |
| | | ></data-hola> |
| | | </div> |
| | | <div class="panel-item"> |
| | | <data-hola :holaTitle="`已处理工单数`" :centerValue="1600" :holaColor="`#5dec24`"></data-hola> |
| | | <data-hola |
| | | :holaTitle="`已处理工单数`" |
| | | :centerValue="workOrderData.todoNum" |
| | | :holaColor="`#5dec24`" |
| | | ></data-hola> |
| | | </div> |
| | | <div class="panel-item"> |
| | | <data-hola :holaTitle="`未处理工单数`" :centerValue="200" :holaColor="`#dfc639`"></data-hola> |
| | | <data-hola |
| | | :holaTitle="`未处理工单数`" |
| | | :centerValue="workOrderData.doneNum" |
| | | :holaColor="`#dfc639`" |
| | | ></data-hola> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="data-panel"> |
| | | <div class="panel-title"> |
| | | <div class="panel-title" style="margin: 50px 0 30px 0"> |
| | | <div class="icon"> |
| | | <img src="@/assets/icons/arrow.png" alt=""> |
| | | <img src="@/assets/icons/arrow.png" alt="" /> |
| | | </div> |
| | | <div class="title"> |
| | | 分区工单数 |
| | | </div> |
| | | <div class="title">分区工单数</div> |
| | | </div> |
| | | <div class="echart-container"> |
| | | <div id="barChart" ref="barChart"></div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import * as echarts from 'echarts'; |
| | | import WrapperTitle from '../wrapper-title/index'; |
| | | import DataHola from './components/data-hola'; |
| | | import * as echarts from "echarts"; |
| | | import WrapperTitle from "../wrapper-title/index"; |
| | | import DataHola from "./components/data-hola"; |
| | | let chart = null; |
| | | export default { |
| | | name: 'ScreenData', |
| | | name: "ScreenData", |
| | | components: { |
| | | WrapperTitle, |
| | | DataHola |
| | | DataHola, |
| | | }, |
| | | props: { |
| | | workOrderData: { |
| | | type: Object, |
| | | default: {}, |
| | | }, |
| | | workOrderRegion: { |
| | | type: Array, |
| | | default: null, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | dataList: { |
| | | name: ['富顺县', '荣县', '高新区', '自流井区', '贡井区', '大安区', '沿滩区'], |
| | | data1: [210, 310, 40, 102, 111, 201, 123], |
| | | data2: [20, 30, 10, 10, 11, 21, 5], |
| | | name: [], |
| | | data1: [], |
| | | data2: [], |
| | | }, |
| | | } |
| | | }; |
| | | }, |
| | | methods: { |
| | | initEchart() { |
| | | const option = { |
| | | grid: { |
| | | top: '10%', |
| | | top: "10%", |
| | | right: 0, |
| | | bottom: '17%', |
| | | bottom: "17%", |
| | | }, |
| | | legend: { |
| | | right: 0, |
| | | textStyle: { |
| | | color: '#447ED6' |
| | | } |
| | | color: "#fff", |
| | | }, |
| | | }, |
| | | tooltip: {}, |
| | | xAxis: { |
| | | type: 'category', |
| | | type: "category", |
| | | axisLabel: { |
| | | color: '#447ED6', |
| | | rotate: 45 |
| | | color: "#fff", |
| | | rotate: 45, |
| | | }, |
| | | data: this.dataList.name |
| | | data: this.dataList.name, |
| | | }, |
| | | yAxis: { |
| | | axisLabel: { |
| | | color: '#4D76B0', |
| | | color: "#fff", |
| | | }, |
| | | }, |
| | | series: [ |
| | | { |
| | | type: 'bar', |
| | | name: '已处理工单数', |
| | | stack: 'total', |
| | | type: "bar", |
| | | name: "已处理工单数", |
| | | stack: "total", |
| | | itemStyle: { |
| | | color: '#4ea8ff' |
| | | color: "#4ea8ff", |
| | | }, |
| | | data: this.dataList.data1 |
| | | data: this.dataList.data1, |
| | | }, |
| | | { |
| | | type: 'bar', |
| | | name: '未处理工单数', |
| | | stack: 'total', |
| | | type: "bar", |
| | | name: "未处理工单数", |
| | | stack: "total", |
| | | itemStyle: { |
| | | color: '#dfc639' |
| | | color: "#dfc639", |
| | | }, |
| | | data: this.dataList.data2 |
| | | data: this.dataList.data2, |
| | | }, |
| | | ] |
| | | } |
| | | ], |
| | | }; |
| | | chart.setOption(option, true); |
| | | |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | chart = echarts.init(this.$refs.barChart); |
| | | this.initEchart(); |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | workOrderRegion() { |
| | | let name = []; |
| | | let data1 = []; |
| | | let data2 = []; |
| | | this.workOrderRegion.map((item) => { |
| | | name.push(item.area); |
| | | data1.push(item.todoNum); |
| | | data2.push(item.doneNum); |
| | | }) |
| | | this.dataList.name = name; |
| | | this.dataList.data1 = data1; |
| | | this.dataList.data2 = data2; |
| | | chart = echarts.init(this.$refs.barChart); |
| | | this.initEchart(); |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | |
| | | .data-content { |
| | | flex: 1; |
| | | background: rgba(67, 102, 155, 0.3); |
| | | border: 1px solid rgba(47, 91, 157, 0.8); |
| | | padding: 10px; |
| | | box-sizing: border-box; |
| | | } |
| | | } |
| | | |
| | |
| | | height: 110px; |
| | | } |
| | | } |
| | | </style> |
| | | </style> |