| | |
| | | <div class="kb_body"> |
| | | <div class="kb_background" /> |
| | | <div class="kb_background2" /> |
| | | <div class="kb_head" style="height: 90px">æªæ¥å·¥ååæå¹³å°</div> |
| | | <div class="kb_head" style="height: 90px;z-index: 3;letter-spacing: 4px">æªæ¥å·¥ååæå¹³å°</div> |
| | | <div class="kb_headerPic" /> |
| | | <div class="kb_flex" style="height: 660px"> |
| | | <div class="kb_flex_column"> |
| | |
| | | |
| | | .kb_headerPic { |
| | | position: absolute; |
| | | top: 39px; |
| | | width: 1808px; |
| | | height: 12px; |
| | | background: url("../../assets/images/kb_headtitle2.png") no-repeat; |
| | | margin-left: 56px; |
| | | top: 0px; |
| | | width: 1885px; |
| | | height: 100px; |
| | | //background: url("../../assets/images/kb_headtitle2.png") no-repeat; |
| | | background: url("../../assets/images/index_head.jpg") no-repeat; |
| | | margin-left: 17.5px; |
| | | z-index: 2; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | |
| | | <div class="kb_body"> |
| | | <div class="kb_background" /> |
| | | <div class="kb_background2" /> |
| | | <div class="kb_head" style="height: 90px">æªæ¥å·¥ååæå¹³å°</div> |
| | | <div class="kb_headerPic" /> |
| | | <div class="kb_flex" style="height: 660px"> |
| | | <div class="kb_flex_column"> |
| | | <div class="kb_block"> |
| | | <div id="bar2" style="width: 100%;height: 100%" /> |
| | | </div> |
| | | <div class="kb_block"> |
| | | <div id="line1" style="width: 100%; height: 100%" /> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div id="pie1" class="kb_center_block" /> |
| | | <div id="area" style="width: 760px;height: 360px" /> |
| | | <div class="kb_center_block"> |
| | | <div style="display: flex;justify-content: center"> |
| | | <div class="kb_center_block_children"> |
| | | <div style="font-size: 18px;">129,768</div> |
| | | <div class="box02" /> |
| | | <div>å¨èè½</div> |
| | | </div> |
| | | <div class="kb_center_block_children"> |
| | | <div style="font-size: 18px;">228,702</div> |
| | | <div class="box02" /> |
| | | <div>æèè½</div> |
| | | </div> |
| | | <div class="kb_center_block_children"> |
| | | <div style="font-size: 18px;">337,035</div> |
| | | <div class="box02" /> |
| | | <div>å£èè½</div> |
| | | </div> |
| | | |
| | | <!-- <div class="kb_center_block_children">--> |
| | | <!-- <div>{{ value2 }} äº¿ç«æ¹</div>--> |
| | | <!-- <div class="box01" />--> |
| | | <!-- <div>彿¥æ»èæ°é</div>--> |
| | | <!-- <!– <div class="box02" />–>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="kb_flex_column"> |
| | | <div class="kb_block"> |
| | | <div id="bar3" style="width: 100%;height: 100%" /> |
| | | </div> |
| | | <div class="kb_block"> |
| | | <!-- <div id="custom1" style="width: 100%;height: 100%" />--> |
| | | <div id="barline1" style="width: 100%;height: 100%" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="kb_flex" style="height:330px"> |
| | | <div class="kb_block" style="height: 300px;"> |
| | | <div id="bar1" style="width: 100%; height: 100%" /> |
| | | </div> |
| | | <div class="kb_block" style="height: 300px;width: 740px"> |
| | | <div id="bar4" style="height: 100%;width: 100%;" /> |
| | | </div> |
| | | <div class="kb_block" style="height: 300px;"> |
| | | <div id="pie2" style="height: 100%;width: 50%" /> |
| | | <div id="pie3" style="height: 100%;width: 50%;" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import * as echarts from 'echarts' |
| | | import '@/utils/world' |
| | | import { bar1, bar2, bar3, bar4, barline1, line1, loadEcharts, pie1, pie2 } from '@/utils/myEcharts' |
| | | |
| | | export default { |
| | | name: 'Index', |
| | | data() { |
| | | return { |
| | | colorX: '#c7e7ff', |
| | | colorY: '#7696c5', |
| | | value1: 88088, |
| | | value2: 78792 |
| | | } |
| | | }, |
| | | created() { |
| | | setInterval(() => { |
| | | location.reload() |
| | | }, 1000 * 60 * 60 * 2) |
| | | }, |
| | | mounted() { |
| | | // å è½½ä¸çå°å¾ |
| | | this.loadArea() |
| | | // å è½½ææ |
| | | this.loadAll() |
| | | // // å è½½å³ä¸ |
| | | // this.loadCustom1() |
| | | // setInterval(() => { |
| | | // this.loadCustom1() |
| | | // }, 5000) |
| | | |
| | | setInterval(() => { |
| | | this.value1 = Math.floor(Math.random() * 10000 + 5000) |
| | | this.value2 = Math.floor(Math.random() * 10000 + 5000) |
| | | }, 9000) |
| | | }, |
| | | methods: { |
| | | |
| | | loadAll() { |
| | | // å 载头é¨é¥¼å¾ |
| | | const pie1data = [ |
| | | { |
| | | name: 'éè´é¾æ', |
| | | value: 3 |
| | | }, { |
| | | name: 'è¿ææ£éª', |
| | | value: 95 |
| | | }, { |
| | | name: '彿¥å½æç', |
| | | value: 83 |
| | | }, { |
| | | name: '设å¤OEE', |
| | | value: 91 |
| | | }, { |
| | | name: 'éå®åè´§', |
| | | value: 100 |
| | | } |
| | | ] |
| | | loadEcharts('pie1', pie1(pie1data)) |
| | | |
| | | setInterval(() => { |
| | | // pie1data = [ |
| | | // { |
| | | // name: 'è£
å¤å¶é ', |
| | | // value: Math.floor(Math.random() * 10) + 60 |
| | | // }, { |
| | | // name: 'ç°ä»£ææ', |
| | | // value: Math.floor(Math.random() * 10) + 60 |
| | | // }, { |
| | | // name: 'æ°å¤ªè½æº', |
| | | // value: Math.floor(Math.random() * 20) + 40 |
| | | // }, { |
| | | // name: 'ä¿¡æ¯ææ¯', |
| | | // value: Math.floor(Math.random() * 20) + 40 |
| | | // }, { |
| | | // name: 'åè´¸ç©æµ', |
| | | // value: Math.floor(Math.random() * 20) + 40 |
| | | // } |
| | | // ] |
| | | loadEcharts('pie1', pie1(pie1data)) |
| | | }, 20000) |
| | | |
| | | let bar1data1 = ['92', '90', '96', '98', '99', '97'] |
| | | let bar1data2 = ['70', '60', '50', '40', '30'] |
| | | // å è½½å·¦ä¸ |
| | | loadEcharts('bar1', bar1(bar1data1, bar1data2)) |
| | | setInterval(() => { |
| | | // bar1data1 = [1, 2, 3, 4, 5] |
| | | // bar1data2 = [1, 2, 3, 4, 5] |
| | | bar1data1 = [Math.floor(Math.random() * 8 + 92), Math.floor(Math.random() * 8 + 92), Math.floor(Math.random() * 8 + 92), Math.floor(Math.random() * 8 + 92), Math.floor(Math.random() * 8 + 92), Math.floor(Math.random() * 8 + 92)] |
| | | bar1data2 = [Math.floor(Math.random() * 15 + 70), Math.floor(Math.random() * 15 + 70), Math.floor(Math.random() * 15 + 70), Math.floor(Math.random() * 15 + 70), Math.floor(Math.random() * 15 + 70)] |
| | | loadEcharts('bar1', bar1(bar1data1, bar1data2)) |
| | | }, 15000) |
| | | |
| | | // å è½½å·¦ä¸ |
| | | // let dataY = ['200', '400', '500', '300', '400', '440', '330', '380', '400', '460', '390', '270'] |
| | | const dataY = [8101, 6382, 7541, 7279, 5288, 7562, 7163, 7541, 7541, 7000, 6000, 6500] |
| | | const dataY2 = [5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000)] |
| | | const dataY3 = [5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000), 5000 + Math.floor(Math.random() * 2000)] |
| | | const dataY4 = [3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000)] |
| | | const dataY5 = [3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000), 3000 + Math.floor(Math.random() * 2000)] |
| | | loadEcharts('line1', line1(dataY, dataY2, dataY3, dataY4, dataY5)) |
| | | setInterval(() => { |
| | | // dataY = [ |
| | | // Math.floor(Math.random() * 100 + 200), |
| | | // Math.floor(Math.random() * 100 + 400), |
| | | // Math.floor(Math.random() * 100 + 300), |
| | | // Math.floor(Math.random() * 100 + 400), |
| | | // Math.floor(Math.random() * 100 + 300), |
| | | // Math.floor(Math.random() * 100 + 300), |
| | | // Math.floor(Math.random() * 100 + 200), |
| | | // Math.floor(Math.random() * 100 + 400), |
| | | // Math.floor(Math.random() * 100 + 400), |
| | | // Math.floor(Math.random() * 100 + 300), |
| | | // Math.floor(Math.random() * 100 + 200), |
| | | // Math.floor(Math.random() * 100 + 400) |
| | | // ] |
| | | loadEcharts('line1', line1(dataY, dataY2, dataY3, dataY4, dataY5)) |
| | | }, 18000) |
| | | |
| | | // å è½½å³ä¸ |
| | | let scaleData1 = [ |
| | | { |
| | | 'name': '尺寸', |
| | | 'value': 10 |
| | | }, |
| | | { |
| | | 'name': 'æä½', |
| | | 'value': 20 |
| | | }, |
| | | { |
| | | 'name': 'é¢è²', |
| | | 'value': 20 |
| | | }, |
| | | { |
| | | 'name': 'å伤', |
| | | 'value': 27 |
| | | }, |
| | | { |
| | | 'name': 'æ¯åº', |
| | | 'value': 23 |
| | | } |
| | | ] |
| | | let scaleData2 = [ |
| | | { |
| | | 'name': 'ç©æ', |
| | | 'value': 5 |
| | | }, |
| | | { |
| | | 'name': 'ææ¯', |
| | | 'value': 15 |
| | | }, |
| | | { |
| | | 'name': 'åè´¨', |
| | | 'value': 20 |
| | | }, |
| | | { |
| | | 'name': '设å¤', |
| | | 'value': 30 |
| | | }, { |
| | | 'name': '人å', |
| | | 'value': 20 |
| | | } |
| | | |
| | | ] |
| | | loadEcharts('pie2', pie2('åè´¨å·®å¼æ¯å', scaleData1)) |
| | | loadEcharts('pie3', pie2('å¼å¸¸é¢è¦æ¯å', scaleData2)) |
| | | |
| | | let a1 = 0 |
| | | let a2 = 0 |
| | | let a3 = 0 |
| | | let a4 = 0 |
| | | let a5 = 0 |
| | | a1 = Math.floor(Math.random() * 10 + 10) |
| | | a2 = Math.floor(Math.random() * 20 + 10) |
| | | a3 = Math.floor(Math.random() * 20 + 10) |
| | | a4 = Math.floor(Math.random() * 20 + 10) |
| | | a5 = 100 - a1 - a2 - a3 - a4 |
| | | let b1 = 0 |
| | | let b2 = 0 |
| | | let b3 = 0 |
| | | let b4 = 0 |
| | | let b5 = 0 |
| | | b1 = Math.floor(Math.random() * 10 + 10) |
| | | b2 = Math.floor(Math.random() * 20 + 10) |
| | | b3 = Math.floor(Math.random() * 20 + 10) |
| | | b4 = Math.floor(Math.random() * 20 + 10) |
| | | b5 = 100 - b1 - b2 - b3 - b4 |
| | | setInterval(() => { |
| | | scaleData1 = [ |
| | | { |
| | | 'name': '尺寸', |
| | | 'value': a1 |
| | | }, |
| | | { |
| | | 'name': 'æ¯åº', |
| | | 'value': a2 |
| | | }, |
| | | { |
| | | 'name': 'é¢è²', |
| | | 'value': a3 |
| | | }, |
| | | { |
| | | 'name': 'å伤', |
| | | 'value': a4 |
| | | }, |
| | | { |
| | | 'name': 'å
¶å®', |
| | | 'value': a5 |
| | | } |
| | | ] |
| | | scaleData2 = [ |
| | | { |
| | | 'name': 'ç©æ', |
| | | 'value': b1 |
| | | }, |
| | | { |
| | | 'name': 'ææ¯', |
| | | 'value': b2 |
| | | }, |
| | | { |
| | | 'name': 'åè´¨', |
| | | 'value': b3 |
| | | }, |
| | | { |
| | | 'name': '设å¤', |
| | | 'value': b4 |
| | | }, { |
| | | 'name': '人å', |
| | | 'value': b5 |
| | | } |
| | | ] |
| | | loadEcharts('pie2', pie2('åè´¨å·®å¼æ¯å', scaleData1)) |
| | | loadEcharts('pie3', pie2('å¼å¸¸é¢è¦æ¯å', scaleData2)) |
| | | }, 17000) |
| | | |
| | | let list = [500, 400, 300, 200, 100] |
| | | // å è½½å·¦ä¸ |
| | | loadEcharts('bar2', bar2(list)) |
| | | setInterval(() => { |
| | | list = [Math.floor(Math.random() * 100) + 500, Math.floor(Math.random() * 100) + 400, Math.floor(Math.random() * 100) + 300, Math.floor(Math.random() * 100) + 200, Math.floor(Math.random() * 100) + 100] |
| | | loadEcharts('bar2', bar2(list)) |
| | | }, 26000) |
| | | |
| | | // å è½½å³ä¸ |
| | | loadEcharts('bar3', bar3()) |
| | | setInterval(() => { |
| | | loadEcharts('bar3', bar3()) |
| | | }, 22000) |
| | | // å è½½ä¸ä¸ |
| | | loadEcharts('bar4', bar4()) |
| | | setInterval(() => { |
| | | loadEcharts('bar4', bar4()) |
| | | }, 16500) |
| | | |
| | | loadEcharts('barline1', barline1()) |
| | | setInterval(() => { |
| | | loadEcharts('barline1', barline1()) |
| | | }, 17500) |
| | | }, |
| | | // å è½½å³ä¸ï¼å¼ç¨ï¼ |
| | | loadCustom1() { |
| | | const list = [ |
| | | { |
| | | key: '', |
| | | percent: false, |
| | | value: [ |
| | | { value: 200 + Math.random() * 200 }, |
| | | { value: 400 + Math.random() * 300 }, |
| | | { value: 500 + Math.random() * 200 }, |
| | | { value: 600 + Math.random() * 500 }, |
| | | { value: 700 + Math.random() * 200 }, |
| | | { value: 800 + Math.random() * 100 }, |
| | | { value: 200 + Math.random() * 600 }, |
| | | { value: 400 + Math.random() * 500 } |
| | | // { value: 500 + Math.random() * 500 }, |
| | | // { value: 600 + Math.random() * 200 }, |
| | | // { value: 700 + Math.random() * 100 }, |
| | | // { value: 800 + Math.random() * 200 } |
| | | ] |
| | | }, |
| | | { |
| | | key: 'xxx2', |
| | | percent: false, |
| | | value: [ |
| | | { value: 800 + Math.random() * 200 }, |
| | | { value: 1000 + Math.random() * 300 }, |
| | | { value: 1200 + Math.random() * 200 }, |
| | | { value: 1000 + Math.random() * 500 }, |
| | | { value: 1200 + Math.random() * 200 }, |
| | | { value: 1300 + Math.random() * 100 }, |
| | | { value: 800 + Math.random() * 600 }, |
| | | { value: 1000 + Math.random() * 500 } |
| | | // { value: 1200 + Math.random() * 500 }, |
| | | // { value: 1000 + Math.random() * 200 }, |
| | | // { value: 1200 + Math.random() * 100 }, |
| | | // { value: 1300 + Math.random() * 200 } |
| | | ] |
| | | }, |
| | | |
| | | { |
| | | key: 'ç', |
| | | percent: true, |
| | | value: [ |
| | | { value: 200 }, |
| | | { value: 300 }, |
| | | { value: 400 }, |
| | | { value: 100 }, |
| | | { value: 800 } |
| | | ] |
| | | } |
| | | ] |
| | | const color = ['0,160,231', '26,202,200', '244,213,97', '243,93,94'] |
| | | // const xList = ['1æ', '2æ', '3æ', '4æ', '5æ', '6æ', '7æ', '8æ', '9æ', '10æ', '11æ', '12æ'] |
| | | const xList = ['1æ', '2æ', '3æ', '4æ', '5æ', '6æ', '7æ', '8æ'] |
| | | const seriesData = [] |
| | | const data1 = ['1æ', '1æ', '1æ', '1æ', '1æ', '1æ', '1æ'] |
| | | const data2 = ['2æ', '2æ', '2æ', '1æ', '1æ', '1æ', '1æ'] |
| | | list.forEach((r, i) => { |
| | | if (r.key.indexOf('ç') === -1) { |
| | | var o = { |
| | | name: r.key, |
| | | type: r.percent ? 'line' : 'pictorialBar', |
| | | smooth: false, |
| | | yAxisIndex: r.percent ? 1 : 0, |
| | | showSymbol: true, |
| | | showAllSymbol: true, |
| | | barWidth: 25, |
| | | zlevel: 3, |
| | | lineStyle: { |
| | | normal: { |
| | | width: 2, |
| | | color: `rgba(${color[i]})` |
| | | } |
| | | }, |
| | | areaStyle: { |
| | | normal: { |
| | | color: { |
| | | type: 'linear', |
| | | x: 0, |
| | | y: 0, |
| | | x2: 0, |
| | | y2: 1, |
| | | colorStops: [ |
| | | { |
| | | offset: 0, |
| | | color: `rgba(${color[i]}, 0.0)`// 0% å¤çé¢è² |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: `rgba(${color[i]}, 0.0)` // 100% å¤çé¢è² |
| | | } |
| | | ], |
| | | globalCoord: false // 缺ç为 false |
| | | } // æ¸åé¢è² |
| | | } |
| | | }, |
| | | itemStyle: { |
| | | normal: { |
| | | color: { |
| | | type: 'linear', |
| | | x: 0, |
| | | y: 0, |
| | | x2: 0, |
| | | y2: 1, |
| | | colorStops: [ |
| | | { |
| | | offset: 0, |
| | | color: `rgba(${color[i]}, 1)`// 0% å¤çé¢è² |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: `rgba(${color[i]}, 0.2)` // 100% å¤çé¢è² |
| | | } |
| | | ], |
| | | globalCoord: false // 缺ç为 false |
| | | } // æ¸åé¢è² |
| | | } |
| | | }, |
| | | data: r.value.map(r => r.value) |
| | | } |
| | | |
| | | seriesData.push(o) |
| | | } |
| | | if (r.key.indexOf('ç') !== -1) { |
| | | var o = { |
| | | name: r.key, |
| | | type: r.percent ? 'line' : 'pictorialBar', |
| | | smooth: false, |
| | | yAxisIndex: r.percent ? 1 : 0, |
| | | showSymbol: true, |
| | | showAllSymbol: true, |
| | | barWidth: 35, |
| | | zlevel: 3, |
| | | lineStyle: { |
| | | normal: { |
| | | width: 2, |
| | | color: `rgba(${color[i]})` |
| | | } |
| | | }, |
| | | areaStyle: { |
| | | normal: { |
| | | color: { |
| | | type: 'linear', |
| | | x: 0, |
| | | y: 0, |
| | | x2: 0, |
| | | y2: 1, |
| | | colorStops: [ |
| | | { |
| | | offset: 0, |
| | | color: `rgba(${color[i]}, 0.0)`// 0% å¤çé¢è² |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: `rgba(${color[i]}, 0.0)` // 100% å¤çé¢è² |
| | | } |
| | | ], |
| | | globalCoord: false // 缺ç为 false |
| | | } // æ¸åé¢è² |
| | | } |
| | | }, |
| | | itemStyle: { |
| | | normal: { |
| | | color: { |
| | | type: 'linear', |
| | | x: 0, |
| | | y: 0, |
| | | x2: 0, |
| | | y2: 1, |
| | | colorStops: [ |
| | | { |
| | | offset: 0, |
| | | color: `rgba(${color[i]}, 1)`// 0% å¤çé¢è² |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: `rgba(${color[i]}, 0.2)` // 100% å¤çé¢è² |
| | | } |
| | | ], |
| | | globalCoord: false // 缺ç为 false |
| | | } // æ¸åé¢è² |
| | | } |
| | | }, |
| | | data: data1 |
| | | } |
| | | var o2 = { |
| | | name: r.key, |
| | | type: r.percent ? 'line' : 'pictorialBar', |
| | | smooth: false, |
| | | yAxisIndex: r.percent ? 1 : 0, |
| | | showSymbol: true, |
| | | showAllSymbol: true, |
| | | barWidth: 35, |
| | | zlevel: 3, |
| | | lineStyle: { |
| | | normal: { |
| | | width: 2, |
| | | color: `rgba(${color[i]})` |
| | | } |
| | | }, |
| | | areaStyle: { |
| | | normal: { |
| | | color: { |
| | | type: 'linear', |
| | | x: 0, |
| | | y: 0, |
| | | x2: 0, |
| | | y2: 1, |
| | | colorStops: [ |
| | | { |
| | | offset: 0, |
| | | color: `rgba(${color[i]}, 0.0)`// 0% å¤çé¢è² |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: `rgba(${color[i]}, 0.0)` // 100% å¤çé¢è² |
| | | } |
| | | ], |
| | | globalCoord: false // 缺ç为 false |
| | | } // æ¸åé¢è² |
| | | } |
| | | }, |
| | | itemStyle: { |
| | | normal: { |
| | | lineStyle: { |
| | | width: 2, |
| | | type: 'dotted' |
| | | }, |
| | | color: { |
| | | type: 'linear', |
| | | x: 0, |
| | | y: 0, |
| | | x2: 0, |
| | | y2: 1, |
| | | colorStops: [ |
| | | { |
| | | offset: 0, |
| | | color: `rgba(${color[i]}, 1)`// 0% å¤çé¢è² |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: `rgba(${color[i]}, 0.2)` // 100% å¤çé¢è² |
| | | } |
| | | ], |
| | | globalCoord: false // 缺ç为 false |
| | | } // æ¸åé¢è² |
| | | } |
| | | }, |
| | | data: data2 |
| | | } |
| | | // if (r.percent) { |
| | | // this.$set(o, 'symbolSize', 6) |
| | | // } else { |
| | | // this.$set(o, 'symbol', 'path://M0,10 L10,10 L5,0 L0,10 z') |
| | | // } |
| | | seriesData.push(o) |
| | | seriesData.push(o2) |
| | | } |
| | | // if (i === 0) { |
| | | // xList = r.value.map(r => r.key) |
| | | // } |
| | | if (r.percent) { |
| | | this.$set(o, 'symbolSize', 4) |
| | | } else { |
| | | this.$set(o, 'symbol', 'path://M0,10 L10,10 L5,0 L0,10 z') |
| | | } |
| | | }) |
| | | var option = { |
| | | backgroundColor: 'transparent', |
| | | legend: { |
| | | show: false, |
| | | data: list.map(r => r.key), |
| | | top: 0, |
| | | itemHeight: 8, |
| | | itemWidth: 20, |
| | | textStyle: { |
| | | fontSize: 14, |
| | | color: 'F1F1F3' |
| | | }, |
| | | right: '1%' |
| | | }, |
| | | title: { |
| | | text: '订åå®ææ»æ°', |
| | | left: '50%', |
| | | top: '5%', |
| | | textAlign: 'center', |
| | | textStyle: { |
| | | // color: '#fff', |
| | | color: '#00ffff', |
| | | fontSize: '20', |
| | | fontWeight: 'bolder' |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '4%', |
| | | right: '4%', |
| | | bottom: '4%', |
| | | top: '15%', |
| | | containLabel: true |
| | | }, |
| | | tooltip: { |
| | | show: true, |
| | | trigger: 'axis', // axis , item |
| | | backgroundColor: 'RGBA(0, 0, 0, 0.3)', |
| | | borderColor: 'rgba(0, 151, 251, 0.6)', |
| | | borderWidth: 1, |
| | | borderRadius: 0, |
| | | textStyle: { |
| | | color: '#BCE9FC', |
| | | fontSize: 14, |
| | | align: 'left' |
| | | }, |
| | | formatter: function(params) { |
| | | var res = '' + params[0].name |
| | | var valueMap = new Map() |
| | | for (var i = 0, l = params.length; i < l; i++) { |
| | | if (params[i].value !== '-') { |
| | | valueMap.set(params[i].seriesName, params[i]) |
| | | } |
| | | } |
| | | valueMap.forEach((value, key) => { |
| | | res += '<br/>' + value.marker + value.seriesName + ' : ' + value.value |
| | | }) |
| | | return res |
| | | } |
| | | }, |
| | | xAxis: [ |
| | | { |
| | | type: 'category', |
| | | boundaryGap: true, |
| | | axisLabel: { |
| | | interval: 0, |
| | | formatter: '{value}', |
| | | fontSize: 14, |
| | | margin: 20, |
| | | textStyle: { |
| | | color: this.colorX |
| | | } |
| | | }, |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#032c58' |
| | | } |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | lineStyle: { |
| | | color: '#032c58' |
| | | } |
| | | }, |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | data: xList |
| | | } |
| | | ], |
| | | yAxis: [ |
| | | { |
| | | boundaryGap: false, |
| | | splitNumber: 4, |
| | | type: 'value', |
| | | axisLabel: { |
| | | textStyle: { |
| | | fontSize: 14, |
| | | color: this.colorY |
| | | } |
| | | }, |
| | | name: 'ä¸ï¼åï¼', |
| | | nameTextStyle: { |
| | | color: this.colorY, |
| | | fontSize: 14, |
| | | lineHeight: 20 |
| | | }, |
| | | splitLine: { |
| | | show: false |
| | | }, |
| | | axisLine: { |
| | | show: false |
| | | }, |
| | | axisTick: { |
| | | show: false |
| | | } |
| | | }, |
| | | { |
| | | boundaryGap: false, |
| | | splitNumber: 4, |
| | | type: 'value', |
| | | axisLabel: { |
| | | textStyle: { |
| | | fontSize: 14, |
| | | color: this.colorY |
| | | } |
| | | }, |
| | | nameTextStyle: { |
| | | color: '#fff', |
| | | fontSize: 14, |
| | | lineHeight: 40 |
| | | }, |
| | | splitLine: { |
| | | lineStyle: { |
| | | color: '#032c58' |
| | | } |
| | | }, |
| | | axisLine: { |
| | | show: false, |
| | | lineStyle: { |
| | | color: '#032c58' |
| | | } |
| | | }, |
| | | axisTick: { |
| | | show: false |
| | | } |
| | | } |
| | | ], |
| | | series: seriesData |
| | | } |
| | | |
| | | const myChart = echarts.init(document.getElementById('custom1')) |
| | | |
| | | if (option.textStyle == null) { |
| | | option.textStyle = { |
| | | fontFamily: 'Microsoft YaHei', |
| | | color: '#ffffff' |
| | | } |
| | | } |
| | | |
| | | // 使ç¨åæå®çé
ç½®é¡¹åæ°æ®æ¾ç¤ºå¾è¡¨ã |
| | | myChart.clear() |
| | | myChart.setOption(option, true) |
| | | |
| | | window.addEventListener('resize', function() { |
| | | myChart.resize() |
| | | }) |
| | | |
| | | return myChart |
| | | }, |
| | | // å è½½å°å¾ |
| | | loadArea() { |
| | | // var myChart = echarts.init(document.getElementById(id)) |
| | | |
| | | const mapData = [ |
| | | // ä¸é主 |
| | | // ['Russia', 'ä¿ç½æ¯', '#d6d266'], |
| | | ['China', 'ä¸å½', '#d6d266'], |
| | | // æ¬§æ´²åº |
| | | ['Germany', 'å¾·å½', '#afb4db'], |
| | | ['France', 'æ³å½', '#b7ba6b'], |
| | | ['Spain', '西çç', '#905a3d'], |
| | | ['Portugal', 'è¡èç', '#f05b72'], |
| | | ['Belgium', 'æ¯å©æ¶', '#f15b6c'], |
| | | ['United Kingdom', 'è±æ ¼å
°', '#5c7a29'], |
| | | ['Iceland', 'å°å²', '#b2d235'], |
| | | ['Croatia', 'å
ç½å°äº', '#deab8a'], |
| | | ['Switzerland', 'ç士', '#f05b72'], |
| | | ['Sweden', 'çå
¸', '#fab27b'], |
| | | ['Denmark', '丹麦', '#d71345'], |
| | | ['Serbia', 'å¡å°ç»´äº', '#694d9f'], |
| | | ['Poland', 'æ³¢å
°', '#b3424a'], |
| | | // äºæ´²åº |
| | | ['Korea', 'é©å½', '#f8aba6'], |
| | | ['Japan', 'æ¥æ¬', '#ca8687'], |
| | | ['Iran', '伿', '#b2d235'], |
| | | ['Saudi Arabia', 'æ²ç¹é¿æä¼¯', '#5c7a29'], |
| | | ['Australia', '澳大å©äº', '#bed742'], |
| | | // åç¾åº |
| | | ['Brazil', '巴西', '#ffd400'], |
| | | ['Argentina', 'é¿æ ¹å»·', '#ffce7b'], |
| | | ['Uruguay', '乿å', '#df9464'], |
| | | ['Colombia', 'å¥ä¼¦æ¯äº', '#dea32c'], |
| | | ['Peru', 'ç§é²', '#aa2116'], |
| | | // éæ´²åº |
| | | ['Egypt', 'åå', '#840228'], |
| | | ['Tunisia', 'çªå°¼æ¯', '#ed1941'], |
| | | ['Nigeria', 'å°¼æ¥å©äº', '#007947'], |
| | | ['Morocco', 'æ©æ´å¥', '#73b9a2'], |
| | | ['Senegal', 'å¡å
å å°', '#fcaf17'], |
| | | // ä¸åç¾å åæ¯æµ·å°åº |
| | | ['Costa Rica', '奿¯è¾¾é»å ', '#f3704b'], |
| | | ['Mexico', '墨西å¥', '#8552a1'], |
| | | ['Panama', 'å·´æ¿é©¬', '#ffce7b'] |
| | | ] |
| | | const countrys = function(country, color, name) { |
| | | return { |
| | | name: country, |
| | | value: name, |
| | | itemStyle: { |
| | | borderColor: '#918597', |
| | | areaColor: color |
| | | }, |
| | | |
| | | label: { |
| | | // show: true, |
| | | formatter: function(params) { |
| | | return params.data.value |
| | | }, |
| | | color: '#f5f5f5', |
| | | fontSize: 10 |
| | | }, |
| | | |
| | | emphasis: { |
| | | itemStyle: { |
| | | areaColor: '#2585a6' |
| | | }, |
| | | label: { |
| | | show: true, |
| | | color: '#fff' |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | var countryData = [] |
| | | for (var i = 0; i < mapData.length; i++) { |
| | | countryData.push(countrys(mapData[i][0], mapData[i][2], mapData[i][1])) |
| | | } |
| | | |
| | | const option = { |
| | | // backgroundColor: '#898989', |
| | | backgroundColor: 'transparent', |
| | | // title: { |
| | | // text: 'åºåéå®å æ¯', |
| | | // textStyle: { |
| | | // color: '#fff' |
| | | // } |
| | | // }, |
| | | roam: true, |
| | | |
| | | tooltip: { |
| | | show: true, |
| | | formatter: function(params) { |
| | | return params.data.value |
| | | }, |
| | | borderWidth: 1, |
| | | borderColor: '#fff', |
| | | alwaysShowContent: true |
| | | // triggerOn: 'none', |
| | | }, |
| | | |
| | | series: [{ |
| | | type: 'map', |
| | | mapType: 'world', |
| | | itemStyle: { |
| | | areaColor: '#102b6a' |
| | | }, |
| | | emphasis: { |
| | | itemStyle: { |
| | | areaColor: '#E8D3E3' |
| | | } |
| | | }, |
| | | data: countryData |
| | | |
| | | }] |
| | | } |
| | | |
| | | const myChart = echarts.init(document.getElementById('area')) |
| | | |
| | | if (option.textStyle == null) { |
| | | option.textStyle = { |
| | | fontFamily: 'Microsoft YaHei', |
| | | color: '#ffffff' |
| | | } |
| | | } |
| | | |
| | | // 使ç¨åæå®çé
ç½®é¡¹åæ°æ®æ¾ç¤ºå¾è¡¨ã |
| | | myChart.clear() |
| | | myChart.setOption(option, true) |
| | | |
| | | window.addEventListener('resize', function() { |
| | | myChart.resize() |
| | | }) |
| | | |
| | | let n = 0 |
| | | setInterval(function() { |
| | | myChart.dispatchAction({ |
| | | type: 'showTip', |
| | | seriesIndex: 0, |
| | | name: mapData[n][0] |
| | | |
| | | }) |
| | | myChart.dispatchAction({ |
| | | type: 'mapToggleSelect', |
| | | seriesIndex: 0, |
| | | name: mapData[n][0] |
| | | }) |
| | | n++ |
| | | if (n === mapData.length) { |
| | | n = 0 |
| | | } |
| | | }, 3000) |
| | | |
| | | return myChart |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | $kbBorderColor: rgba(9, 216, 242, 0.4); |
| | | .kb_body { |
| | | width: 1920px; |
| | | height: 1080px; |
| | | background: #000; |
| | | overflow: hidden; |
| | | display: flex; |
| | | flex-direction: column; |
| | | color: #09d8f2; |
| | | |
| | | } |
| | | |
| | | .kb_background { |
| | | position: absolute; |
| | | bottom: 0; |
| | | width: 1920px; |
| | | height: 887px; |
| | | background: url('../../assets/images/body.jpg') no-repeat; |
| | | //background: url('../../assets/images/body.jpg'); |
| | | opacity: 0.4; |
| | | //background: url('../../assets/images/body02.jpg') no-repeat; |
| | | |
| | | } |
| | | .kb_background2 { |
| | | position: absolute; |
| | | top: 0; |
| | | width: 1920px; |
| | | height: 887px; |
| | | background: url('../../assets/images/body.jpg') no-repeat; |
| | | //background: url('../../assets/images/body.jpg'); |
| | | opacity: 0.4; |
| | | //background: url('../../assets/images/body02.jpg') no-repeat; |
| | | |
| | | } |
| | | .kb_flex { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | |
| | | } |
| | | |
| | | .kb_head { |
| | | display: flex; |
| | | justify-content: center; |
| | | line-height: 90px; |
| | | font-size: 40px; |
| | | margin: auto; |
| | | z-index: 2; |
| | | color: #09d8f2; |
| | | letter-spacing: 2px; |
| | | font-weight: bolder; |
| | | } |
| | | |
| | | .kb_headerPic { |
| | | position: absolute; |
| | | top: 39px; |
| | | width: 1808px; |
| | | height: 12px; |
| | | background: url("../../assets/images/kb_headtitle2.png") no-repeat; |
| | | margin-left: 56px; |
| | | z-index: 2; |
| | | } |
| | | |
| | | .kb_flex_column { |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .kb_block { |
| | | height: 50%; |
| | | //border: 1px solid $kbBorderColor; |
| | | width: 550px; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | margin: 10px; |
| | | } |
| | | |
| | | .kb_center_block { |
| | | height: 20%; |
| | | //border: 1px solid $kbBorderColor; |
| | | width: 740px; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | margin: 10px; |
| | | z-index: 2; |
| | | } |
| | | |
| | | .kb_center_block_children { |
| | | height: 120px; |
| | | //border: 1px solid $kbBorderColor; |
| | | width: 240px; |
| | | display: flex; |
| | | z-index: 2; |
| | | justify-content: space-around; |
| | | align-items: center; |
| | | flex-direction: column; |
| | | margin: 10px; |
| | | |
| | | .box01 { |
| | | background: url("../../assets/images/box01.png") no-repeat; |
| | | width: 169px; |
| | | height: 118px; |
| | | margin-top: -17px; |
| | | } |
| | | |
| | | .box02 { |
| | | background: url("../../assets/images/box02.png") no-repeat; |
| | | width: 145px; |
| | | height: 84px; |
| | | } |
| | | } |
| | | </style> |