1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090 |
- <template>
- <div class="app-container">
- <div class="dark-el-input dark-el-button">
- <el-form ref="queryForm" size="small" :inline="true">
- <el-form-item label="生成日期">
- <el-date-picker
- v-model="dateTime"
- type="date"
- placeholder="选择生成日期" popper-class="cpp-popper"
- :picker-options="pickerOptions"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="场站名称">
- <el-select v-model="stationCode" placeholder="请选择" popper-class="cpp-popper">
- <el-option
- v-for="item in stationList"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" style="margin-left: 5px" icon="el-icon-search" @click="dataQuery">查询
- </el-button>
- <el-button type="primary" style="margin-left: 5px" icon="el-icon-download" @click="exportFile">导出
- </el-button>
- </el-form-item>
- </el-form>
- </div>
- <div style="padding-top: 10px">
- <div style="display: flex">
- <div style="float:left;width: 95%;height: 350px" id="fscharts" ></div>
- </div>
- <div>
- <vxe-table
- highlight-hover-row
- :keep-source="true"
- align="center"
- :loading="loading"
- ref="xTable"
- auto-resize
- highlight-current-row
- border
- resizable
- show-overflow
- :data="tableData.slice((currentPage-1) * pageSize,currentPage * pageSize)">
- <vxe-table-column field="stationCode" title="场站名称" :formatter="stationCodeFormat" width="200px"
- fixed="left"></vxe-table-column>
- <vxe-table-column field="time" title="预测时间" width="180" min-width="150" fixed="left" :formatter="timeFormat"></vxe-table-column>
- <vxe-table-column field="t" title="温度" min-width="90" ></vxe-table-column>
- <vxe-table-column field="rh" title="湿度" min-width="90" ></vxe-table-column>
- <vxe-table-column field="globalRadiation" title="总辐射" min-width="90" ></vxe-table-column>
- <vxe-table-column field="directRadiation" title="直辐射" min-width="90" ></vxe-table-column>
- <vxe-table-column field="diffuseRadiation" title="散辐射" min-width="90" ></vxe-table-column>
- <vxe-table-column field="ws10" title="10米风速" min-width="90" ></vxe-table-column>
- <vxe-table-column field="ws30" title="30米风速" min-width="90" ></vxe-table-column>
- <vxe-table-column field="ws50" title="50米风速" min-width="90" ></vxe-table-column>
- <vxe-table-column field="ws70" title="70米风速" min-width="90" ></vxe-table-column>
- <vxe-table-column field="ws80" title="80米风速" min-width="90" ></vxe-table-column>
- <vxe-table-column field="ws90" title="90米风速" min-width="90" ></vxe-table-column>
- <vxe-table-column field="ws100" title="100米风速" min-width="90" ></vxe-table-column>
- <vxe-table-column field="wd10" title="10米风向" min-width="90" ></vxe-table-column>
- <vxe-table-column field="wd30" title="30米风向" min-width="90" ></vxe-table-column>
- <vxe-table-column field="wd50" title="50米风向" min-width="90" ></vxe-table-column>
- <vxe-table-column field="wd70" title="70米风向" min-width="90" ></vxe-table-column>
- <vxe-table-column field="wd80" title="80米风向" min-width="90" ></vxe-table-column>
- <vxe-table-column field="wd90" title="90米风向" min-width="90" ></vxe-table-column>
- <vxe-table-column field="wd100" title="100米风向" min-width="90" ></vxe-table-column>
- </vxe-table>
- <vxe-pager
- perfect
- :current-page.sync="currentPage"
- :page-size.sync="pageSize"
- :total="total"
- :page-sizes=[10,50,100]
- :layouts="['PrevJump', 'PrevPage','JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']"
- @page-change="handlePageChange"
- >
- </vxe-pager>
- </div>
- </div>
- </div>
- </template>
- <script>
- import * as echarts from "echarts";
- export default {
- name: 'inverterinfo',
- data() {
- return {
- fsChart: null,
- dateTime: new Date(new Date().toLocaleDateString()).getTime(),
- total: 0,
- sortOrder: 'asc',
- pageSize: 7,
- currentPage: 1,
- stationList: [],
- stationCode: [],
- searchForm: {},
- tableData: [],
- loading: false,
- // 日期使用
- pickerOptions: {
- disabledDate: (time) => {
- return time.getTime() > Date.now()
- }
- },
- modId: '',//备用id
- itemStyle: [
- {
- itemStyle: {
- normal: {
- lineStyle: {
- color: '#4A99FF',
- // shadowColor: '#4A99FF',
- // shadowBlur: 10,
- },
- shadowColor: '#4A99FF',
- shadowBlur: 10,
- },
- },
- areaStyle: {
- normal: { // 单项区域填充样式
- color: {
- type: 'linear',
- x: 0, //右
- y: 0, //下
- x2: 1, //左
- y2: 1, //上
- colorStops: [{
- offset: 0,
- color: '#4A99FF'
- }, {
- offset: 0.5,
- color: 'rgba(0,0,0,0)'
- }, {
- offset: 1,
- color: '#4A99FF'
- }],
- globalCoord: false
- },
- opacity: 1 // 区域透明度
- }
- }
- },
- {
- itemStyle: {
- normal: {
- lineStyle: {
- color: '#4BFFFC',
- // shadowColor: '#4BFFFC',
- // shadowBlur: 10,
- },
- shadowColor: '#4BFFFC',
- shadowBlur: 10,
- },
- },
- areaStyle: {
- normal: { // 单项区域填充样式
- color: {
- type: 'linear',
- x: 0, //右
- y: 0, //下
- x2: 1, //左
- y2: 1, //上
- colorStops: [{
- offset: 0,
- color: '#4BFFFC'
- }, {
- offset: 0.5,
- color: 'rgba(0,0,0,0)'
- }, {
- offset: 1,
- color: '#4BFFFC'
- }],
- globalCoord: false
- },
- opacity: 1 // 区域透明度
- }
- }
- },
- {
- itemStyle: {
- normal: {
- lineStyle: {
- color: '#ff654a',
- // shadowColor: '#4A99FF',
- // shadowBlur: 10,
- },
- shadowColor: '#ff654a',
- shadowBlur: 10,
- },
- },
- areaStyle: {
- normal: { // 单项区域填充样式
- color: {
- type: 'linear',
- x: 0, //右
- y: 0, //下
- x2: 1, //左
- y2: 1, //上
- colorStops: [{
- offset: 0,
- color: '#ff654a'
- }, {
- offset: 0.5,
- color: 'rgba(0,0,0,0)'
- }, {
- offset: 1,
- color: '#ff654a'
- }],
- globalCoord: false
- },
- opacity: 1 // 区域透明度
- }
- }
- },
- {
- itemStyle: {
- normal: {
- lineStyle: {
- color: '#edff4a',
- // shadowColor: '#4A99FF',
- // shadowBlur: 10,
- },
- shadowColor: '#edff4a',
- shadowBlur: 10,
- },
- },
- areaStyle: {
- normal: { // 单项区域填充样式
- color: {
- type: 'linear',
- x: 0, //右
- y: 0, //下
- x2: 1, //左
- y2: 1, //上
- colorStops: [{
- offset: 0,
- color: '#edff4a'
- }, {
- offset: 0.5,
- color: 'rgba(0,0,0,0)'
- }, {
- offset: 1,
- color: '#edff4a'
- }],
- globalCoord: false
- },
- opacity: 1 // 区域透明度
- }
- }
- },
- {
- itemStyle: {
- normal: {
- lineStyle: {
- color: '#65ff4a',
- // shadowColor: '#4A99FF',
- // shadowBlur: 10,
- },
- shadowColor: '#65ff4a',
- shadowBlur: 10,
- },
- },
- areaStyle: {
- normal: { // 单项区域填充样式
- color: {
- type: 'linear',
- x: 0, //右
- y: 0, //下
- x2: 1, //左
- y2: 1, //上
- colorStops: [{
- offset: 0,
- color: '#65ff4a'
- }, {
- offset: 0.5,
- color: 'rgba(0,0,0,0)'
- }, {
- offset: 1,
- color: '#65ff4a'
- }],
- globalCoord: false
- },
- opacity: 1 // 区域透明度
- }
- }
- },
- {
- itemStyle: {
- normal: {
- lineStyle: {
- color: '#4affea',
- // shadowColor: '#4A99FF',
- // shadowBlur: 10,
- },
- shadowColor: '#4affea',
- shadowBlur: 10,
- },
- },
- areaStyle: {
- normal: { // 单项区域填充样式
- color: {
- type: 'linear',
- x: 0, //右
- y: 0, //下
- x2: 1, //左
- y2: 1, //上
- colorStops: [{
- offset: 0,
- color: '#4affea'
- }, {
- offset: 0.5,
- color: 'rgba(0,0,0,0)'
- }, {
- offset: 1,
- color: '#4affea'
- }],
- globalCoord: false
- },
- opacity: 1 // 区域透明度
- }
- }
- },
- {
- itemStyle: {
- normal: {
- lineStyle: {
- color: '#894aff',
- // shadowColor: '#4A99FF',
- // shadowBlur: 10,
- },
- shadowColor: '#894aff',
- shadowBlur: 10,
- },
- },
- areaStyle: {
- normal: { // 单项区域填充样式
- color: {
- type: 'linear',
- x: 0, //右
- y: 0, //下
- x2: 1, //左
- y2: 1, //上
- colorStops: [{
- offset: 0,
- color: '#894aff'
- }, {
- offset: 0.5,
- color: 'rgba(0,0,0,0)'
- }, {
- offset: 1,
- color: '#894aff'
- }],
- globalCoord: false
- },
- opacity: 1 // 区域透明度
- }
- }
- },
- {
- itemStyle: {
- normal: {
- lineStyle: {
- color: '#d84aff',
- // shadowColor: '#4A99FF',
- // shadowBlur: 10,
- },
- shadowColor: '#d84aff',
- shadowBlur: 10,
- },
- },
- areaStyle: {
- normal: { // 单项区域填充样式
- color: {
- type: 'linear',
- x: 0, //右
- y: 0, //下
- x2: 1, //左
- y2: 1, //上
- colorStops: [{
- offset: 0,
- color: '#d84aff'
- }, {
- offset: 0.5,
- color: 'rgba(0,0,0,0)'
- }, {
- offset: 1,
- color: '#d84aff'
- }],
- globalCoord: false
- },
- opacity: 1 // 区域透明度
- }
- }
- },
- {
- itemStyle: {
- normal: {
- lineStyle: {
- color: '#ff4aae',
- // shadowColor: '#4A99FF',
- // shadowBlur: 10,
- },
- shadowColor: '#ff4aae',
- shadowBlur: 10,
- },
- },
- areaStyle: {
- normal: { // 单项区域填充样式
- color: {
- type: 'linear',
- x: 0, //右
- y: 0, //下
- x2: 1, //左
- y2: 1, //上
- colorStops: [{
- offset: 0,
- color: '#ff4aae'
- }, {
- offset: 0.5,
- color: 'rgba(0,0,0,0)'
- }, {
- offset: 1,
- color: '#ff4aae'
- }],
- globalCoord: false
- },
- opacity: 1 // 区域透明度
- }
- }
- },
- ],
- colorArr: [{
- start: "rgba(155, 101, 229,",
- end: "rgba(219,44,44,0.5)"
- },
- {
- start: "rgba(71, 173, 245,",
- end: "rgba(231,132,46,0.5)"
- },
- {
- start: "rgba(82, 249, 107,",
- end: "rgba(190,229,50,0.5)"
- },
- {
- start: "rgba(82, 249, 107,",
- end: "rgba(44,214,140,0.5)"
- },
- {
- start: "rgba(82, 249, 107,",
- end: "rgba(43,73,221,0.5)"
- },
- {
- start: "rgba(82, 249, 107,",
- end: "rgba(40,203,203,0.5)"
- },
- {
- start: "rgba(82, 249, 107,",
- end: "rgba(195,42,180,0.5)"
- },
- {
- start: "rgba(82, 249, 107,",
- end: "rgba(231,45,119,0.5)"
- },
- {
- start: "rgba(82, 249, 107,",
- end: "rgba(229,46,46,0.5)"
- },
- ],
- lineStyle: [
- {
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(219,50,51,0.3)'
- }, {
- offset: 0.8,
- color: 'rgba(219, 50, 51, 0)'
- }], false),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(219,50,51)',
- borderColor: 'rgba(219,50,51,0.2)',
- borderWidth: 12
- }
- },
- },
- {
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(219,196,50,0.3)'
- }, {
- offset: 0.8,
- color: 'rgba(219, 50, 51, 0)'
- }], false),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(219,196,50)',
- borderColor: 'rgba(219,196,50,0.2)',
- borderWidth: 12
- }
- },
- },
- {
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(101,219,50,0.3)'
- }, {
- offset: 0.8,
- color: 'rgba(219, 50, 51, 0)'
- }], false),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(101,219,50)',
- borderColor: 'rgba(101,219,50,0.2)',
- borderWidth: 12
- }
- },
- },
- {
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(50,219,171,0.3)'
- }, {
- offset: 0.8,
- color: 'rgba(219, 50, 51, 0)'
- }], false),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(50,219,171)',
- borderColor: 'rgba(50,219,171,0.2)',
- borderWidth: 12
- }
- },
- },
- {
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(50,118,219,0.3)'
- }, {
- offset: 0.8,
- color: 'rgba(219, 50, 51, 0)'
- }], false),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(50,118,219)',
- borderColor: 'rgba(50,118,219,0.2)',
- borderWidth: 12
- }
- },
- },
- {
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(140,50,219,0.3)'
- }, {
- offset: 0.8,
- color: 'rgba(219, 50, 51, 0)'
- }], false),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(140,50,219)',
- borderColor: 'rgba(140,50,219,0.2)',
- borderWidth: 12
- }
- },
- },
- {
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(202,50,219,0.3)'
- }, {
- offset: 0.8,
- color: 'rgba(219, 50, 51, 0)'
- }], false),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(202,50,219)',
- borderColor: 'rgba(202,50,219,0.2)',
- borderWidth: 12
- }
- },
- },
- {
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(50,199,219,0.3)'
- }, {
- offset: 0.8,
- color: 'rgba(219, 50, 51, 0)'
- }], false),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(50,199,219)',
- borderColor: 'rgba(50,199,219,0.2)',
- borderWidth: 12
- }
- },
- },
- {
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(219,143,50,0.3)'
- }, {
- offset: 0.8,
- color: 'rgba(219, 50, 51, 0)'
- }], false),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(219,143,50)',
- borderColor: 'rgba(219,143,50,0.2)',
- borderWidth: 12
- }
- },
- }
- ],
- lineColor: '#3b3b3b',
- }
- },
- created() {
- this.getStationCode()
- },
- mounted() {
- },
- beforeDestroy() {
- if (!this.fsChart) {
- return
- }
- this.fsChart.dispose()
- this.fsChart = null
- },
- computed: {},
- methods: {
- stationCodeFormat({cellValue, row, column}) {
- const item = this.stationList.find(item => item.value === cellValue)
- return item ? item.label : ''
- },
- handlePageChange({currentPage, pageSize}) {
- this.currentPage = currentPage
- this.pageSize = pageSize
- },
- exportFile(){
- if (this.tableData.length>0){
- const item = this.stationList.find(item => item.value === this.stationCode)
- let filename = item.label
- // 文件名日期
- let startTime = this.$moment(this.dateTime).format('YYYY-MM-DD')
- filename=filename+startTime
- this.$refs.xTable.exportData({
- filename: filename,
- type: 'csv',
- isHeader: true,
- isFooter: true,
- data: this.tableData
- })
- }
- else{
- this.$message.error("列表无数据不能导出文件!")
- return
- }
- },
- async dataQuery() {
- if (this.dateTime==undefined){
- this.$message.warning('请选择生成日期')
- return
- }
- let genDate = Math.round(this.dateTime)
- this.loading = true
- let queryParams = {
- "stationCode": this.stationCode,
- "genDate": genDate,
- }
- this.$axios.get('/nwp/queryTableData', {params: queryParams}).then(response => {
- this.tableData = response.data.tableList
- this.total = response.data.tableList.length
- let stationType = response.data.stationType
- let timeList = response.data.timeList
- let radiationData = response.data.radiationData
- if (stationType=='E1'){
- // 光伏
- this.drawGf(timeList,radiationData)
- }
- else{
- // 风电
- this.drawFd(timeList,radiationData)
- }
- this.loading = false
- }).catch(() => {
- this.loading = false
- })
- },
- timeFormat({ cellValue, row, column }) {
- return this.$moment(cellValue).format('YYYY-MM-DD HH:mm')
- },
- getStationCode() {
- this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
- this.stationList = response.data
- if (this.stationList.length > 0) {
- this.stationCode = this.stationList[0].value
- this.dataQuery()
- }
- })
- },
- // 画光伏场辐射图
- drawGf(timeaxis, radiationData) {
- var globalR = []
- var directR = []
- var diffuseR = []
- if (radiationData != null) {
- if (radiationData.globalRs != null) {
- globalR = radiationData.globalRs
- }
- if (radiationData.directRs != null) {
- directR = radiationData.directRs
- }
- if (radiationData.diffuseRs != null) {
- diffuseR = radiationData.diffuseRs
- }
- }
- this.fsChart = echarts.init(document.getElementById('fscharts'),'dark')
- this.fsChart.setOption({}, true)
- this.fsChart.setOption({
- backgroundColor: 'transparent',
- title: {
- top: 20,
- text: 'NWP辐照度',
- textStyle: {
- fontWeight: 'normal',
- fontSize: 16,
- // color: this.lineColor
- },
- left: '1%'
- },
- tooltip: {
- confine: true,
- trigger: 'axis',
- axisPointer: {
- lineStyle: {
- color: '#57617B'
- }
- }
- },
- legend: {
- left:'center',
- top: 20,
- icon: 'rect',
- itemWidth: 14,
- itemHeight: 5,
- itemGap: 13,
- data: ['总辐射', '直辐射', '散辐射'],
- right: '4%',
- textStyle: {
- fontSize: 12,
- // color: this.lineColor
- },
- selected: {
- '总辐射': true,
- '直辐射': true,
- '散辐射': true,
- }
- },
- dataZoom: [{
- show: false,
- realtime: true,
- start: 0,
- end: 100,
- left: "15%",
- right: "15%",
- // textStyle: {
- // color: this.lineColor
- // }
- }, {
- type: 'inside'
- }],
- grid: {
- top: 100,
- left: '2%',
- right: '2%',
- bottom: '10%',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- // axisLine: {
- // lineStyle: {
- // color: this.lineColor
- // }
- // },
- data: timeaxis
- }],
- yAxis: [{
- type: 'value',
- name: '瓦/平方米',
- axisTick: {
- show: false
- },
- // axisLine: {
- // lineStyle: {
- // color: this.lineColor
- // }
- // },
- axisLabel: {
- margin: 10,
- textStyle: {
- fontSize: 14
- }
- },
- splitLine: {
- lineStyle: {
- color: '#57617B'
- }
- }
- }],
- series: [{
- name: '总辐射',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- symbolSize: 5,
- showSymbol: false,
- connectNulls: true,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(219,50,51)',
- borderColor: 'rgba(219,50,51,0.2)',
- borderWidth: 12
- }
- },
- data: globalR
- },
- {
- name: '直辐射',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- symbolSize: 5,
- showSymbol: false,
- connectNulls: true,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(0,136,212)',
- borderColor: 'rgba(0,136,212,0.2)',
- borderWidth: 12
- }
- },
- data: directR
- },
- {
- name: '散辐射',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- connectNulls: true,
- symbolSize: 5,
- showSymbol: false,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(137,189,27)',
- borderColor: 'rgba(137,189,2,0.27)',
- borderWidth: 12
- }
- },
- data: diffuseR
- },
- ]
- })
- },
- // 画风电场风速图
- drawFd(timeaxis, radiationData) {
- this.fsChart = echarts.init(document.getElementById('fscharts'),'dark')
- this.fsChart.setOption({}, true)
- let option = {
- backgroundColor: 'transparent',
- title: {
- top: 20,
- text: 'NWP风速',
- textStyle: {
- fontWeight: 'normal',
- fontSize: 16,
- // color: this.lineColor
- },
- left: '1%'
- },
- tooltip: {
- confine: true,
- trigger: 'axis',
- axisPointer: {
- lineStyle: {
- color: '#57617B'
- }
- }
- },
- legend: {
- left:'center',
- top: 20,
- width: '70%',
- icon: 'rect',
- itemWidth: 14,
- itemHeight: 5,
- itemGap: 13,
- data: [],
- right: '4%',
- textStyle: {
- fontSize: 12,
- // color: this.lineColor
- },
- selected: {}
- },
- dataZoom: [{
- show: false,
- realtime: true,
- start: 0,
- end: 100,
- left: "15%",
- right: "15%",
- // textStyle: {
- // color: this.lineColor
- // }
- }, {
- type: 'inside'
- }],
- grid: {
- top: 100,
- left: '2%',
- right: '2%',
- bottom: '10%',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- // axisLine: {
- // lineStyle: {
- // color: this.lineColor
- // }
- // },
- data: timeaxis
- }],
- yAxis: [{
- type: 'value',
- name: 'm/s',
- axisTick: {
- show: false
- },
- // axisLine: {
- // lineStyle: {
- // color: this.lineColor
- // }
- // },
- axisLabel: {
- margin: 10,
- textStyle: {
- fontSize: 14,
- // color: this.lineColor
- },
- formatter: '{value}',
- },
- splitLine: {
- lineStyle: {
- color: '#57617B'
- }
- }
- }],
- series: []
- }
- var index = 0;
- for (var key in radiationData) {
- for (let i=0;i<radiationData[key].length;i++){
- radiationData[key][i] = radiationData[key][i]==-99?null:radiationData[key][i]
- }
- option.legend.data.push(key)
- var sValue = {
- name: '',
- type: 'line',
- smooth: false,
- symbol: 'circle',
- symbolSize: 5,
- showSymbol: false,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- itemStyle: {},
- data: []
- }
- sValue.name = key
- sValue.data = radiationData[key]
- sValue.itemStyle = this.lineStyle[index].itemStyle
- sValue.connectNulls = true
- option.series.push(sValue)
- index++;
- }
- this.fsChart.setOption(option, true)
- var _this = this
- window.addEventListener("resize", function () {
- _this.fsChart.resize();
- });
- },
- },
- }
- </script>
|