123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977 |
- <template>
- <div class="app-container">
- <div class="dark-el-input dark-el-button">
- <el-form ref="queryForm" size="small" :inline="true" popper-class="cpp-popper">
- <el-form-item label="预测日期">
- <el-date-picker
- :clearable="false"
- v-model="dateTime"
- type="date"
- :picker-options="expireDateOption"
- placeholder="选择生成日期">
- </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" size="small" style="margin-left: 5px" icon="el-icon-search" @click="dataQuery">
- 查询
- </el-button>
- </el-form-item>
- </el-form>
- </div>
- <el-row>
- <el-col :span="7">
- <div class="divDescribe">调控策略</div>
- <div class="divDescribe">调控截止时间:{{ this.dqEndTime }}</div>
- <div class="divDescribe">调控方式:调控值=原始值*系数+数值</div>
- <div class="divDescribeBtn">
- <div class="dark-el-input dark-el-button">
- <el-button type="primary" size="small" style="margin-left: 5px" @click="quickUse">一键应用</el-button>
- <el-button type="primary" size="small" style="margin-left: 5px" @click="usualSet">设为常用</el-button>
- </div>
- </div>
- <div class="divTable">
- <el-table
- :data="tableData"
- height="550px"
- :loading="loading"
- size="mini"
- style="width: 100%">
- <el-table-column
- prop="time"
- header-align="center"
- align="center"
- label="时间"
- >
- </el-table-column>
- <el-table-column
- prop="xs"
- header-align="center"
- align="center"
- label="系数">
- <template slot-scope="scope">
- <vxe-input type="number" v-model="scope.row.xs" size="small" style="width:100%" min="0"
- placeholder="" @change="setValueByManual(scope.row,scope.$index)"></vxe-input>
- </template>
- </el-table-column>
- <el-table-column
- prop="sz"
- header-align="center"
- align="center"
- label="数值">
- <template slot-scope="scope">
- <vxe-input type="number" v-model="scope.row.sz" size="small" style="width:100%"
- placeholder="" @change="setValueByManual(scope.row,scope.$index)"></vxe-input>
- </template>
- </el-table-column>
- <el-table-column
- prop="ysValue"
- header-align="center"
- align="center"
- label="原始值">
- </el-table-column>
- <el-table-column
- prop="tkValue"
- header-align="center"
- align="center"
- label="调控值"
- :max="capacity"
- :min="0"
- >
- </el-table-column>
- </el-table>
- </div>
- <div class="tkBtn">
- <div class="dark-el-input dark-el-button">
- <el-button type="primary" size="small" style="margin-left: 5px" @click="tkDialog">调控功率</el-button>
- </div>
- </div>
- </el-col>
- <el-col :span="17">
- <div style="float:left;width: 95%;height: 750px" id="tkcharts"></div>
- </el-col>
- </el-row>
- <div class="dark-el-dialog">
- <el-dialog :visible.sync="usualOpen" :before-close="cancelUsual" :close-on-click-modal="false" width="450px"
- height="600px">
- <el-form ref="usualForm" :model="usualForm" width="430px" label-width="70px">
- <el-row class="mb4">
- <el-col :span="24">
- <el-form-item label="常用名称" prop="name">
- <el-input style="width: 100%" v-model="usualForm.usualName" maxlength="15" popper-class="cpp-popper"/>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row class="mb4">
- <el-col>
- <div style="color: #fff">保存常用名可以在一键应用中找到历史调控策略。</div>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="commitUsual">确 定</el-button>
- <el-button @click="cancelUsual">取 消</el-button>
- </div>
- </el-dialog>
- </div>
- <div class="dark-el-dialog">
- <el-dialog :visible.sync="tkOpen" :close-on-click-modal="false" width="700px" height="600px">
- <div class="flex" style="color:#ffffff;">
- 确认对
- <span style="background: #d3a4ff">{{ this.tkrq }}</span>
- 日,
- <span style="background: #d3a4ff">{{ this.stationName }}</span>
- 的短期功率调控,调控后数据将下发到对应场站上报调度。
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="tkCommit">确 定</el-button>
- <el-button @click="tkCancel">取 消</el-button>
- </div>
- </el-dialog>
- </div>
- <!-- 策略选择弹窗 -->
- <div class="dark-el-dialog">
- <el-dialog :visible.sync="quickUseOpen" :before-close="cancelQuickUse" :close-on-click-modal="false"
- style="height: calc(100% - 50px)">
- <div class="reg-config-container flex justify-between">
- <div class="reg-config-con">
- <span class="flex justify-center dialog-text-title">策略选择</span>
- <!-- 策略列表 -->
- <div class="reg-config flex">
- <div class="reg-config-radio" style="margin-top: 15px">
- <el-radio v-model="vradio" label="1" @click.native.prevent="radioChange('1')">快捷选择历史策略:
- </el-radio>
- </div>
- <div class="flex-column reg-config-btu">
- <!-- 循环生成按钮 -->
- <el-button
- v-for="(button, index) in buttons"
- :key="index"
- @click="handleButtonClick(button.usualName)"
- >
- {{ button.usualName }}
- </el-button>
- </div>
- </div>
- <div class="reg-config flex items-center">
- <div class="reg-config-radio">
- <el-radio v-model="vradio" label="2" @click.native.prevent="radioChange('2')">选择历史策略:</el-radio>
- </div>
- <div>
- <el-select ref="selectUsualName" v-model="usualId" placeholder="请选择" popper-class="cpp-popper"
- :disabled="disabled" @change="changeUsualName">
- <el-option
- v-for="item in usualList"
- :key="item.id"
- :label="item.usualName"
- :value="item.id">
- </el-option>
- </el-select>
- </div>
- </div>
- <div id="currentSelectFunction" style="display: none;margin-top: 30px;margin-left: 24px;" class="reg-config flex items-center">
- <div>当前选择策略:</div>
- <div style="width: 215px">
- {{ this.currentStrategy }}
- </div>
- <div>
- <el-button @click="trialPreview">预览</el-button>
- <el-button @click="trialDelete">删除</el-button>
- </div>
- </div>
- <div slot="footer" class="reg-dialog-footer">
- <el-button type="primary" @click="quickUseCommit">一键应用</el-button>
- <el-button @click="cancelQuickUse">取 消</el-button>
- </div>
- </div>
- <!-- <el-divider direction="vertical" style="height: calc(100% - 30px)"></el-divider>-->
- <div>
- <!-- 预览表格 -->
- <span class="flex justify-center dialog-text-title">预览策略展示</span>
- <el-table
- :data="trialData"
- height="550px"
- :loading="loading"
- size="mini"
- style="width: 100%;margin-top: 13px;">
- <el-table-column
- prop="time"
- header-align="center"
- align="center"
- label="时间"
- >
- </el-table-column>
- <el-table-column
- prop="xs"
- header-align="center"
- align="center"
- label="系数">
- </el-table-column>
- <el-table-column
- prop="sz"
- header-align="center"
- align="center"
- label="数值">
- </el-table-column>
- <el-table-column
- prop="ysValue"
- header-align="center"
- align="center"
- label="原始值">
- </el-table-column>
- <el-table-column
- prop="tkValue"
- header-align="center"
- align="center"
- label="调控值"
- :max="capacity"
- :min="0"
- >
- </el-table-column>
- </el-table>
- </div>
- </div>
- </el-dialog>
- </div>
- </div>
- </template>
- <script>
- import * as echarts from "echarts";
- export default {
- name: 'inverterinfo',
- data() {
- return {
- dqEndTime: '',
- markLineData: new Array(),
- visualMapPieces: new Array(),
- trialData: [],
- disabled: true,
- vradio: '1',
- buttons: new Array(),
- usualId: '',
- usualList: [],
- currentStrategy: '',
- stationName: '',
- tkrq: '',
- quickUseOpen: false,
- tkOpen: false,
- usualOpen: false,
- usualForm: {
- usualName: undefined
- },
- expireDateOption: {
- disabledDate(time) {
- return time.getTime() < Date.now()
- }
- },
- loading: false,
- symbolSize: 8,
- capacity: '',
- tkData: [],
- tableData: [],
- hoursArray: [],
- chart: null,
- form: [],
- dateTime: new Date(new Date().toLocaleDateString()).getTime() + (60 * 60 * 24 * 1000),
- stationList: [],
- stationCode: '',
- ysData: [],
- refUpData: [],
- refDownData: [],
- chartOption: {
- backgroundColor: 'transparent',
- title: {
- top: 20,
- text: '短期调控曲线',
- textStyle: {
- fontWeight: 'normal',
- fontSize: 16,
- },
- left: 'center'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- lineStyle: {
- color: '#57617B'
- }
- }
- },
- legend: {
- top: 20,
- icon: 'rect',
- itemWidth: 14,
- itemHeight: 5,
- itemGap: 13,
- data: ['原始值', '调控值', '参考值上限', '参考值下限'],
- right: '4%',
- textStyle: {
- fontSize: 12,
- // color: this.lineColor
- },
- selected: {
- '原始值': true,
- '调控值': true,
- '参考值上限': true,
- '参考值下限': true,
- }
- },
- dataZoom: [{
- show: true,
- realtime: true,
- start: 0,
- end: 100,
- left: "15%",
- right: "15%",
- throttle: 50
- }, {
- type: 'inside'
- }],
- grid: {
- top: 100,
- left: '2%',
- right: '2%',
- bottom: '10%',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- axisLine: {onZero: false},
- }],
- yAxis: [{
- type: 'value',
- name: 'MW',
- axisTick: {
- show: false
- },
- 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)',
- borderWidth: 12
- }
- },
- data: this.ysData
- },
- {
- id: 'a',
- name: '调控值',
- type: 'line',
- showSymbol: false,
- smooth: true,
- symbol: 'circle',
- symbolSize: 10,
- connectNulls: true,
- lineStyle: {
- normal: {
- color: 'rgb(0,136,212)',
- width: 2
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(0,136,212)',
- borderWidth: 50
- }
- },
- data: []
- },
- {
- name: '参考值上限',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- connectNulls: true,
- symbolSize: 5,
- showSymbol: false,
- lineStyle: {
- normal: {
- width: 2,
- type: 'dashed' //设置线条类型
- }
- },
- itemStyle: {
- normal: {
- color: '#00FF00',
- borderWidth: 12
- }
- },
- data: this.refUpData
- },
- {
- name: '参考值下限',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- connectNulls: true,
- symbolSize: 5,
- showSymbol: false,
- lineStyle: {
- normal: {
- width: 2,
- type: 'dashed' //设置线条类型
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(167,27,189)',
- borderWidth: 12
- }
- },
- data: this.refDownData
- },
- ]
- }
- }
- },
- created() {
- this.getStationCode()
- this.getDqEndTime()
- },
- mounted() {
- this.initChart()
- },
- beforeDestroy() {
- if (!this.chart) {
- return
- }
- this.chart.dispose()
- this.chart = null
- },
- computed: {},
- methods: {
- // 策略名称下拉框选择
- changeUsualName(id) {
- const item = this.usualList.find(item => item.id == id)
- let usualName = item ? item.usualName : ''
- this.currentStrategy = usualName
- document.getElementById("currentSelectFunction").style.display = ''
- },
- radioChange(radioValue) {
- document.getElementById("currentSelectFunction").style.display = 'none'
- this.currentStrategy = ''
- this.trialData = []
- if (radioValue == '1') {
- this.vradio = '1'
- this.usualId = ''
- this.disabled = true
- } else {
- this.vradio = '2'
- this.disabled = false
- }
- },
- // 默认常用按钮事件
- handleButtonClick(usualName) {
- if (this.vradio == '1') {
- // 执行常用按钮点击
- this.currentStrategy = usualName
- document.getElementById("currentSelectFunction").style.display = ''
- }
- },
- async executeTrial() {
- const param = {
- "usualName": this.currentStrategy,
- "stationCode": this.tableData[0].stationCode,
- "time": new Date(this.tableData[0].forecastDate).getTime()
- }
- // 获取策略名称的系数和数值
- await this.$axios.get('/dqRegulationController/trialData', {params: param}).then(response => {
- this.trialData = response.data
- })
- },
- // 删除按钮点击
- trialDelete() {
- if (this.currentStrategy == '') {
- this.$message.warning("请选择策略名称进行删除!")
- return
- }
- this.$confirm('是否确认删除【' + this.currentStrategy + '】?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- // 提交名称及系数配置
- const formData = new FormData()
- formData.append('usualName', this.currentStrategy)
- this.$axios.post('/dqUsualController/deleteUsual', formData, {
- headers: {
- 'Content-Type': 'multipart/form-data' // 设置请求头,确保服务器正确解析 FormData
- }
- }).then((res) => {
- this.$message.success('删除策略成功!')
- document.getElementById("currentSelectFunction").style.display = "none"
- this.trialData = []
- // 重新渲染下拉框
- this.renderUsual()
- }).catch((error) => {
- })
- })
- },
- // 预览按钮点击
- trialPreview() {
- if (this.currentStrategy == '') {
- this.$message.warning("请选择策略名称进行预览!")
- return
- }
- this.executeTrial()
- },
- // 一键应用中确定
- async quickUseCommit() {
- if (this.currentStrategy == '') {
- this.$message.warning("请选择策略进行应用!")
- return
- }
- await this.executeTrial()
- // 将列表数据赋值给底层列表
- this.tableData = this.trialData
- // 将预算的调控曲线赋值给底层曲线上
- let tkArray = new Array()
- for (var i = 0; i < this.tableData.length; i++) {
- let array = new Array()
- array.push(this.tableData[i].time)
- array.push(this.tableData[i].tkValue)
- tkArray.push(array)
- }
- this.tkData = tkArray
- this.chartOption.series[1].data = this.tkData
- this.chart.setOption(this.chartOption)
- //再调用updatePosition
- this.updatePosition()
- this.cancelQuickUse()
- },
- // 一键应用中取消按钮
- cancelQuickUse() {
- this.quickUseOpen = false;
- this.trialData = []
- this.currentStrategy = ''
- this.buttons = []
- this.vradio = '1'
- this.disabled = true
- document.getElementById("currentSelectFunction").style.display = 'none'
- },
- renderUsual() {
- this.buttons = []
- this.usualId = ''
- this.currentStrategy = ''
- // 先获取常用下拉框
- this.$axios.get('/dqUsualController/getUsualList').then(response => {
- this.usualList = response.data
- if (this.usualList.length > 0) {
- // 循环list,将前5个给默认常用,将第1个默认选中下拉框
- for (let i = 0; i < this.usualList.length; i++) {
- if (i < 5) {
- this.buttons.push(this.usualList[i])
- }
- }
- }
- })
- },
- quickUse() {
- if (this.tableData.length == 0) {
- this.$message.warning("调控列表为空,不能操作!")
- return
- }
- this.renderUsual()
- this.quickUseOpen = true
- },
- // 点击设为常用按钮触发
- usualSet() {
- if (this.tableData.length == 0) {
- this.$message.warning("调控列表为空,不能操作!")
- return
- }
- this.usualOpen = true
- },
- // 设为常用弹出框保存按钮
- commitUsual() {
- if (this.tableData == undefined || this.tableData.length == 0) {
- this.$message.warning("请查询列表才可以设为常用!")
- return
- }
- if (this.usualForm.usualName == null || this.usualForm.usualName == '' || this.usualForm.usualName == undefined) {
- this.$message.warning("请输入常用名称!")
- return
- } else {
- let tempUsualName = this.usualForm.usualName.trim()
- if (tempUsualName == '') {
- this.$message.warning("请输入常用名称!")
- return
- }
- // 提交名称及系数配置
- const param = {
- "tempShortRegulationDtoList": this.tableData,
- "usualName": tempUsualName
- }
- this.$axios.post('/dqUsualController/saveUsual', param).then((res) => {
- this.$message.success('常用策略保存成功!')
- this.usualOpen = false
- this.resetUsual()
- }).catch((error) => {
- })
- }
- },
- // 表单重置
- resetUsual() {
- this.usualForm = {
- usualName: undefined,
- },
- this.resetForm("usualForm");
- },
- // 取消按钮
- cancelUsual() {
- this.usualOpen = false;
- this.resetUsual();
- },
- tkDialog() {
- // 判断截止时间,超出时间不允许调控
- const now = new Date();
- if (now.getTime() > new Date(this.dqEndTime)) {
- this.$message.warning("截止时间已过,不能进行调控!")
- return
- }
- if (this.tableData.length == 0) {
- this.$message.warning("调控列表为空,不能操作!")
- return
- }
- const date = new Date(this.dateTime); // 如果long是毫秒
- const year = date.getFullYear();
- const month = (date.getMonth() + 1).toString().padStart(2, '0');
- const day = date.getDate().toString().padStart(2, '0');
- this.tkrq = `${year}-${month}-${day}`; // 根据需要可以添加时间部分
- const item = this.stationList.find(item => item.value === this.stationCode)
- this.stationName = item ? item.label : ''
- this.tkOpen = true
- },
- tkCancel() {
- this.tkOpen = false
- },
- // 调控列表提交
- tkCommit() {
- if (this.tableData.length == 0) {
- this.$message.warning("调控列表为空,不能进行提交!")
- return
- }
- // 判断系数和数值2个字段是否有为空
- for (let i = 0; i < this.tableData.length; i++) {
- if (isNaN(this.tableData[i].tkValue)) {
- this.$message.warning(this.tableData[i].time + "存在空值,不能进行提交!")
- return
- }
- }
- // 保存调控值列表
- this.$axios.post('/dqRegulationController/updateDqRegulation', this.tableData).then((res) => {
- this.$message.success('调控功率保存成功!')
- // this.dataQuery()
- }).catch((error) => {
- })
- this.tkOpen = false
- },
- //通过表格内系数或固定值修改 生成曲线以及最终预测结果
- setValueByManual(row, index) {
- if (row.xs !== undefined && row.sz !== undefined) {
- // 计算调控值
- row.tkValue = parseFloat((parseFloat(row.ysValue) * parseFloat(row.xs) + parseFloat(row.sz)).toFixed(2))
- if (row.tkValue < 0) {
- row.tkValue = 0
- }
- if (row.tkValue > this.capacity) {
- row.tkValue = this.capacity
- }
- // 赋值给表格
- this.tableData[index] = row
- // 遍历tableData封装调控曲线数组
- let tkArray = new Array()
- for (var i = 0; i < this.tableData.length; i++) {
- let array = new Array()
- array.push(this.tableData[i].time)
- array.push(this.tableData[i].tkValue)
- tkArray.push(array)
- }
- this.tkData = tkArray
- this.chartOption.series[1].data = this.tkData
- this.chart.setOption(this.chartOption)
- //再调用updatePosition
- this.updatePosition()
- }
- },
- dataQuery() {
- this.loading = true
- let queryParams = {
- "stationCode": this.stationCode,
- "time": Math.round(this.dateTime),
- }
- this.$axios.get('/dqRegulationController/queryData', {params: queryParams}).then(response => {
- this.chart.clear()
- this.capacity = response.data.electricField.capacity
- this.tableData = response.data.tempShortRegulationList
- this.ysData = response.data.ysData
- this.refUpData = response.data.refUpData
- this.refDownData = response.data.refDownData
- this.tkData = response.data.tkDataList
- this.draData()
- this.loading = false
- }).catch(() => {
- this.tableData = []
- this.ysData = []
- this.refUpData = []
- this.refDownData = []
- this.tkData = []
- this.chart.clear()
- this.chartOption.series[0].data = this.ysData
- this.chartOption.series[1].data = this.tkData
- this.chartOption.series[2].data = this.refUpData
- this.chartOption.series[3].data = this.refDownData
- this.chart.setOption(this.chartOption)
- this.loading = false
- });
- },
- draData() {
- let this1 = this;
- this.chartOption.series[0].data = this.ysData
- this.chartOption.series[1].data = this.tkData
- this.chartOption.series[2].data = this.refUpData
- this.chartOption.series[3].data = this.refDownData
- let myChart = this.chart
- let cap = this.capacity
- setTimeout(function () {
- myChart.setOption({
- graphic: this1.tkData.map(function (item, dataIndex) {
- return {
- type: 'circle',
- position: myChart.convertToPixel('grid', item),
- shape: {
- cx: 0,
- cy: 0,
- r: 10
- },
- invisible: true,
- draggable: true,
- ondrag: function (dx, dy,) {
- this1.onPointDragging(dataIndex, [item[0], dx.offsetY], cap);
- },
- onmousemove: function () {
- this1.showTooltip(dataIndex);
- },
- onmouseout: function () {
- this1.hideTooltip(dataIndex);
- },
- z: 100
- };
- })
- });
- }, 0);
- // window.addEventListener('resize', this1.updatePosition);
- myChart.on('dataZoom', this1.updatePosition);
- // 拖动曲线后,将数值重新赋值给表格
- this.chartOption.yAxis[0].max = this.capacity
- myChart.setOption(this.chartOption)
- },
- updatePosition() {
- let this1 = this;
- let myChart = this.chart
- myChart.setOption({
- graphic: this1.tkData.map(function (item, dataIndex) {
- return {
- position: myChart.convertToPixel('grid', item)
- };
- })
- });
- },
- showTooltip(dataIndex) {
- let myChart = this.chart
- myChart.dispatchAction({
- type: 'showTip',
- seriesIndex: 0,
- dataIndex: dataIndex
- });
- },
- hideTooltip(dataIndex) {
- let myChart = this.chart
- myChart.dispatchAction({
- type: 'hideTip'
- });
- },
- onPointDragging(dataIndex, pos, capacity) {
- let this1 = this;
- let myChart = this.chart
- this1.tkData[dataIndex][1] = myChart.convertFromPixel('grid', pos)[1].toFixed(2);
- if (myChart.convertFromPixel('grid', pos)[1].toFixed(2) > capacity) {
- this1.tkData[dataIndex][1] = capacity
- }
- if (myChart.convertFromPixel('grid', pos)[1].toFixed(2) < 0) {
- this1.tkData[dataIndex][1] = 0
- }
- // 赋值调控值字段
- this1.tableData[dataIndex].tkValue = this1.tkData[dataIndex][1]
- // 根据调控值更新表格中数值字段,数值=调控值-(原始值*系数)
- this1.tableData[dataIndex].sz = (this1.tkData[dataIndex][1] - (this1.tableData[dataIndex].ysValue * this1.tableData[dataIndex].xs)).toFixed(2)
- myChart.setOption(this.chartOption)
- // Update data
- myChart.setOption({
- series: [
- {
- id: 'a',
- data: this1.tkData,
- }
- ]
- });
- this.updatePosition()
- },
- // 获取短期截止时间
- getDqEndTime() {
- this.$axios({url: '/dqRegulationController/getDqEndTime', method: 'get'}).then(response => {
- this.dqEndTime = response.data
- })
- },
- 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
- }
- })
- },
- initChart() {
- for (let i = 0; i < 24 * 60; i += 15) {
- let hours = Math.floor(i / 60);
- let minutes = i % 60;
- this.hoursArray.push(`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`);
- }
- this.chartOption.xAxis[0].data = this.hoursArray
- this.chart = echarts.init(document.getElementById('tkcharts'), 'dark')
- this.chart.setOption(this.chartOption)
- },
- }
- }
- </script>
- <style scoped>
- .divDescribe {
- position: relative;
- top: 20px; /* 向下移动15px */
- width: 100%;
- text-align: center
- }
- .divDescribeBtn {
- position: relative;
- top: 25px; /* 向下移动15px */
- width: 100%;
- text-align: right
- }
- .divTable {
- position: relative;
- top: 30px; /* 向下移动15px */
- width: 100%;
- text-align: center
- }
- .tkBtn {
- position: relative;
- top: 50px; /* 向下移动15px */
- width: 100%;
- text-align: center
- }
- .dialog-text-title {
- font-size: 16px;
- font-weight: bold;
- }
- .reg-config-container {
- height: 100%;
- }
- .reg-config-con {
- width: 50%;
- position: relative;
- }
- .reg-config {
- margin-top: 5px;
- }
- .reg-config-radio {
- width: 150px;
- }
- .reg-config-btu {
- width: 215px;
- //height: 190px;
- margin-top: 5px;
- }
- .reg-dialog-footer {
- position: absolute;
- bottom: 0;
- left: 35%;
- //text-align: center;
- }
- /deep/ .reg-config-btu .el-button:first-child {
- margin-top: 5px;
- }
- /deep/ .reg-config-btu .el-button {
- margin-top: 10px;
- }
- /deep/ .reg-config-btu .el-button:last-child {
- margin-bottom: 10px;
- }
- /deep/ .reg-config-btu .el-button + .el-button {
- margin-left: 0px;
- }
- </style>
|