浏览代码

增加短期调控一键应用功能

xusl 6 月之前
父节点
当前提交
cca50c9307

+ 59 - 0
cpp-admin/src/main/java/com/cpp/web/controller/regulation/DqRegulationController.java

@@ -11,6 +11,8 @@ import com.cpp.web.domain.accuracy.AccuracyPassRate;
 import com.cpp.web.domain.enums.DataSourcesEnum;
 import com.cpp.web.domain.enums.DataSourcesEnum;
 import com.cpp.web.domain.enums.ForecastTypeEnum;
 import com.cpp.web.domain.enums.ForecastTypeEnum;
 import com.cpp.web.domain.regulation.TempShortRegulation;
 import com.cpp.web.domain.regulation.TempShortRegulation;
+import com.cpp.web.domain.regulation.TempShortUsual;
+import com.cpp.web.domain.regulation.TempShortUsualDetail;
 import com.cpp.web.domain.station.ElectricField;
 import com.cpp.web.domain.station.ElectricField;
 import com.cpp.web.domain.station.ForecastPowerShortTermStation;
 import com.cpp.web.domain.station.ForecastPowerShortTermStation;
 import com.cpp.web.domain.station.WeatherStationStatusData;
 import com.cpp.web.domain.station.WeatherStationStatusData;
@@ -18,6 +20,8 @@ import com.cpp.web.domain.station.WindTurbineInfo;
 import com.cpp.web.dto.TempShortRegulationDto;
 import com.cpp.web.dto.TempShortRegulationDto;
 import com.cpp.web.service.accuracy.AccuracyPassRateService;
 import com.cpp.web.service.accuracy.AccuracyPassRateService;
 import com.cpp.web.service.regulation.TempShortRegulationService;
 import com.cpp.web.service.regulation.TempShortRegulationService;
+import com.cpp.web.service.regulation.TempShortUsualDetailService;
+import com.cpp.web.service.regulation.TempShortUsualService;
 import com.cpp.web.service.station.ElectricFieldService;
 import com.cpp.web.service.station.ElectricFieldService;
 import com.cpp.web.service.station.ForecastPowerShortTermStationService;
 import com.cpp.web.service.station.ForecastPowerShortTermStationService;
 import com.cpp.web.utils.DateTimeUtil;
 import com.cpp.web.utils.DateTimeUtil;
@@ -48,6 +52,10 @@ public class DqRegulationController {
     TempShortRegulationService tempShortRegulationService;
     TempShortRegulationService tempShortRegulationService;
     @Autowired
     @Autowired
     ElectricFieldService electricFieldService;
     ElectricFieldService electricFieldService;
+    @Autowired
+    TempShortUsualService tempShortUsualService;
+    @Autowired
+    TempShortUsualDetailService tempShortUsualDetailService;
 
 
 
 
 
 
@@ -216,4 +224,55 @@ public class DqRegulationController {
         tempShortRegulationService.saveBatch(tempShortRegulationList);
         tempShortRegulationService.saveBatch(tempShortRegulationList);
         return R.ok();
         return R.ok();
     }
     }
+
+    /**
+     * 试算数据
+     * @param stationCode
+     * @param time
+     * @param usualName 常规策略名称
+     * @return
+     */
+
+    @GetMapping("/trialData")
+    public R trialData(String stationCode, Long time,String usualName) {
+        // 先获取常规策略
+        QueryWrapper<TempShortUsual> tempShortUsualQueryWrapper = new QueryWrapper<>();
+        tempShortUsualQueryWrapper.eq("usual_name", usualName);
+        TempShortUsual tempShortUsual = tempShortUsualService.getOne(tempShortUsualQueryWrapper);
+        QueryWrapper<TempShortUsualDetail> tempShortUsualDetailQueryWrapper = new QueryWrapper<>();
+        tempShortUsualDetailQueryWrapper.eq("usual_id", tempShortUsual.getId());
+        List<TempShortUsualDetail> tempShortUsualDetailList = tempShortUsualDetailService.list(tempShortUsualDetailQueryWrapper);
+        Map<String,TempShortUsualDetail> usualDetailMap = new HashMap<>();
+        for (TempShortUsualDetail tempShortUsualDetail:tempShortUsualDetailList){
+            usualDetailMap.put(tempShortUsualDetail.getTimePoint(),tempShortUsualDetail);
+        }
+        int howLongAgo = DateTimeUtil.getDaysBetweenTwoDate(System.currentTimeMillis(),time);
+        // 获取要调整的短期那天的最后时间
+        long endTime = DateTimeUtil.getDayLastTime(time).getTime();
+        // 获取短期上报数据(原始数据)
+        List<ForecastPowerShortTermStation> forecastPowerShortTermStationList = forecastPowerShortTermStationService.findByForecastTimeBetweenAndForecastHowLongAgoAndStationCode(new Date(time), new Date(endTime), howLongAgo, stationCode);
+        Map<Long, BigDecimal> ysShortMap = new HashMap<>();
+        for (ForecastPowerShortTermStation forecastPowerShortTermStation:forecastPowerShortTermStationList) {
+            ysShortMap.putIfAbsent(forecastPowerShortTermStation.getTime().getTime(), forecastPowerShortTermStation.getFpValue());
+        }
+        Long momentTime = 15 * 60 * 1000L;
+        List<TempShortRegulationDto> trialList = new ArrayList<>();
+        for (Long tempTime = time; tempTime <= endTime; tempTime = tempTime + momentTime) {
+            String timeHHmm = DateUtils.parseDateToStr("HH:mm",new Date(tempTime));
+            TempShortRegulationDto tempShortRegulationDto = new TempShortRegulationDto();
+            tempShortRegulationDto.setTime(timeHHmm);
+            tempShortRegulationDto.setForecastDate(new Date(time));
+            tempShortRegulationDto.setTkDate(new Date());
+            tempShortRegulationDto.setYsValue(ysShortMap.get(tempTime));
+            TempShortUsualDetail tempShortUsualDetail = usualDetailMap.get(timeHHmm);
+            tempShortRegulationDto.setSz(tempShortUsualDetail.getSz());
+            tempShortRegulationDto.setXs(tempShortUsualDetail.getXs());
+            // 计算调控值,调控值=原始值*系数+数值
+            BigDecimal tkValue = ysShortMap.get(tempTime).multiply(tempShortUsualDetail.getXs()).add(tempShortUsualDetail.getSz()).setScale(2, BigDecimal.ROUND_HALF_UP);
+            tempShortRegulationDto.setTkValue(tkValue);
+            tempShortRegulationDto.setStationCode(stationCode);
+            trialList.add(tempShortRegulationDto);
+        }
+        return R.ok(trialList);
+    }
 }
 }

+ 19 - 2
cpp-admin/src/main/java/com/cpp/web/controller/regulation/DqUsualController.java

@@ -8,6 +8,7 @@ import com.cpp.common.utils.SecurityUtils;
 import com.cpp.web.domain.regulation.TempShortRegulation;
 import com.cpp.web.domain.regulation.TempShortRegulation;
 import com.cpp.web.domain.regulation.TempShortUsual;
 import com.cpp.web.domain.regulation.TempShortUsual;
 import com.cpp.web.domain.regulation.TempShortUsualDetail;
 import com.cpp.web.domain.regulation.TempShortUsualDetail;
+import com.cpp.web.domain.station.NwpStation;
 import com.cpp.web.dto.DqUsualDto;
 import com.cpp.web.dto.DqUsualDto;
 import com.cpp.web.dto.TempShortRegulationDto;
 import com.cpp.web.dto.TempShortRegulationDto;
 import com.cpp.web.service.regulation.TempShortUsualDetailService;
 import com.cpp.web.service.regulation.TempShortUsualDetailService;
@@ -16,8 +17,7 @@ import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
 
 
 
 
 /**
 /**
@@ -35,6 +35,11 @@ public class DqUsualController {
     @Autowired
     @Autowired
     TempShortUsualDetailService tempShortUsualDetailService;
     TempShortUsualDetailService tempShortUsualDetailService;
 
 
+    /**
+     * 保存常用策略
+     * @param dqUsualDto
+     * @return
+     */
     @PostMapping("/saveUsual")
     @PostMapping("/saveUsual")
     public R saveUsual(@RequestBody DqUsualDto dqUsualDto) {
     public R saveUsual(@RequestBody DqUsualDto dqUsualDto) {
         String usualName = dqUsualDto.getUsualName();
         String usualName = dqUsualDto.getUsualName();
@@ -68,4 +73,16 @@ public class DqUsualController {
         tempShortUsualDetailService.saveBatch(tempShortUsualDetailList);
         tempShortUsualDetailService.saveBatch(tempShortUsualDetailList);
         return R.ok();
         return R.ok();
     }
     }
+
+    /**
+     * 获取常用策略列表
+     * @return
+     */
+    @GetMapping("/getUsualList")
+    public R getUsualList() {
+        List<TempShortUsual> list = tempShortUsualService.list();
+        // 创建时间倒排序
+        list.sort(Comparator.comparing(TempShortUsual::getCreateTime).reversed());
+        return R.ok(list);
+    }
 }
 }

+ 36 - 10
cpp-ui/src/assets/styles/dark.scss

@@ -1,5 +1,5 @@
 $white: #fff;
 $white: #fff;
-$default-border-color:#2986ce;
+$default-border-color: #2986ce;
 $table-border-color: #3e6b98;
 $table-border-color: #3e6b98;
 $table-header-background-color: #284266;
 $table-header-background-color: #284266;
 
 
@@ -23,12 +23,14 @@ $table-header-background-color: #284266;
     }
     }
   }
   }
 }
 }
-#app,.app-container{
+
+#app, .app-container {
   background-image: url('../images/pageBg.png');
   background-image: url('../images/pageBg.png');
   background-size: cover;
   background-size: cover;
   background-position: center;
   background-position: center;
   background-repeat: no-repeat;
   background-repeat: no-repeat;
 }
 }
+
 .app-title-bg {
 .app-title-bg {
   width: 100%;
   width: 100%;
   background-color: #101C38;
   background-color: #101C38;
@@ -104,6 +106,7 @@ $table-header-background-color: #284266;
 .el-breadcrumb__inner.is-link, .el-breadcrumb__inner a {
 .el-breadcrumb__inner.is-link, .el-breadcrumb__inner a {
   color: $white;
   color: $white;
 }
 }
+
 // 按钮背景
 // 按钮背景
 .cpp-btu-background {
 .cpp-btu-background {
   background-image: url('../images/topRightBtuBg.png');
   background-image: url('../images/topRightBtuBg.png');
@@ -111,6 +114,7 @@ $table-header-background-color: #284266;
   background-repeat: no-repeat;
   background-repeat: no-repeat;
   background-size: 100% 100%;
   background-size: 100% 100%;
 }
 }
+
 /*vxe表格*/
 /*vxe表格*/
 .vxe-table--render-default.border--default .vxe-table--header-wrapper, .vxe-table--render-default.border--full .vxe-table--header-wrapper, .vxe-table--render-default.border--outer .vxe-table--header-wrapper {
 .vxe-table--render-default.border--default .vxe-table--header-wrapper, .vxe-table--render-default.border--full .vxe-table--header-wrapper, .vxe-table--render-default.border--outer .vxe-table--header-wrapper {
   background-color: $table-header-background-color !important;
   background-color: $table-header-background-color !important;
@@ -129,6 +133,7 @@ $table-header-background-color: #284266;
 .vxe-pager--jump, .vxe-pager--total {
 .vxe-pager--jump, .vxe-pager--total {
   color: $white;
   color: $white;
 }
 }
+
 .vxe-table--render-default .vxe-body--row.row--current {
 .vxe-table--render-default .vxe-body--row.row--current {
   background-color: $base-menu-background !important;
   background-color: $base-menu-background !important;
 }
 }
@@ -142,9 +147,10 @@ $table-header-background-color: #284266;
   background-image: linear-gradient($table-border-color, $table-border-color), linear-gradient($table-border-color, $table-border-color) !important;
   background-image: linear-gradient($table-border-color, $table-border-color), linear-gradient($table-border-color, $table-border-color) !important;
 }
 }
 
 
-.vxe-table .vxe-table--header-wrapper .vxe-table--header-border-line, .vxe-table--render-default .vxe-table--border-line,.vxe-pager.is--perfect {
+.vxe-table .vxe-table--header-wrapper .vxe-table--header-border-line, .vxe-table--render-default .vxe-table--border-line, .vxe-pager.is--perfect {
   border: 1px solid $table-border-color !important;
   border: 1px solid $table-border-color !important;
 }
 }
+
 .vxe-table--render-default.border--full .vxe-table--fixed-left-wrapper {
 .vxe-table--render-default.border--full .vxe-table--fixed-left-wrapper {
   border-right: 1px solid $table-border-color !important;
   border-right: 1px solid $table-border-color !important;
   background-image: url('../images/pageBg.png');
   background-image: url('../images/pageBg.png');
@@ -152,6 +158,7 @@ $table-header-background-color: #284266;
   background-position: center;
   background-position: center;
   background-repeat: no-repeat;
   background-repeat: no-repeat;
 }
 }
+
 /*element表格*/
 /*element表格*/
 .el-table, .el-table tr {
 .el-table, .el-table tr {
   background-color: transparent !important;
   background-color: transparent !important;
@@ -209,6 +216,7 @@ $table-header-background-color: #284266;
 /*element 弹窗*/
 /*element 弹窗*/
 .el-dialog__header, .el-dialog__body, .el-dialog__footer {
 .el-dialog__header, .el-dialog__body, .el-dialog__footer {
   //background-color: $base-menu-background !important;
   //background-color: $base-menu-background !important;
+  color: white !important;
   background-color: #406e90 !important;
   background-color: #406e90 !important;
 }
 }
 
 
@@ -219,19 +227,27 @@ $table-header-background-color: #284266;
 .el-form-item__label {
 .el-form-item__label {
   color: $white !important;
   color: $white !important;
 }
 }
+
 .el-dialog__headerbtn:focus .el-dialog__close, .el-dialog__headerbtn:hover .el-dialog__close {
 .el-dialog__headerbtn:focus .el-dialog__close, .el-dialog__headerbtn:hover .el-dialog__close {
   color: #083d5c;
   color: #083d5c;
 }
 }
- .el-dialog__headerbtn .el-dialog__close {
-   color: white;
- }
-.dark-el-dialog{
+
+.el-dialog__headerbtn .el-dialog__close {
+  color: white;
+}
+
+.el-radio__label {
+  color: white;
+}
+
+.dark-el-dialog {
   .el-input__inner {
   .el-input__inner {
     background-color: transparent;
     background-color: transparent;
     border: 1px solid $white;
     border: 1px solid $white;
     color: #cddef1;
     color: #cddef1;
   }
   }
-  .el-button{
+
+  .el-button {
     background-color: transparent !important;
     background-color: transparent !important;
     border-top: none;
     border-top: none;
     border-bottom: none;
     border-bottom: none;
@@ -242,13 +258,18 @@ $table-header-background-color: #284266;
     background-repeat: no-repeat;
     background-repeat: no-repeat;
     color: white;
     color: white;
   }
   }
+
   .el-dialog.is-fullscreen {
   .el-dialog.is-fullscreen {
     background: transparent;
     background: transparent;
   }
   }
+
   .el-table, .el-table tr {
   .el-table, .el-table tr {
     background-color: #083d5c !important;
     background-color: #083d5c !important;
     color: $white !important;
     color: $white !important;
   }
   }
+  .el-radio__input.is-checked + .el-radio__label {
+     color: white;
+  }
 }
 }
 
 
 /*element-tree*/
 /*element-tree*/
@@ -267,7 +288,8 @@ $table-header-background-color: #284266;
   border: 0.001rem solid $default-border-color;
   border: 0.001rem solid $default-border-color;
   background-color: transparent;
   background-color: transparent;
   color: #FFFFFF;
   color: #FFFFFF;
-  .el-table th.el-table__cell{
+
+  .el-table th.el-table__cell {
     background: $table-header-background-color !important;
     background: $table-header-background-color !important;
   }
   }
 }
 }
@@ -302,20 +324,24 @@ $table-header-background-color: #284266;
   color: white !important;
   color: white !important;
   background: transparent;
   background: transparent;
 }
 }
+
 .el-date-editor .el-range-separator {
 .el-date-editor .el-range-separator {
   color: $white !important;
   color: $white !important;
 }
 }
-.el-picker-panel__body-wrapper{
+
+.el-picker-panel__body-wrapper {
   .el-input__inner {
   .el-input__inner {
     background-color: rgba(15, 28, 49, 0.8);
     background-color: rgba(15, 28, 49, 0.8);
     border: 1px solid $default-border-color;
     border: 1px solid $default-border-color;
     color: #cddef1;
     color: #cddef1;
   }
   }
 }
 }
+
 .el-picker-panel__footer {
 .el-picker-panel__footer {
   border-top: 1px solid rgba(29, 128, 218, 1) !important;
   border-top: 1px solid rgba(29, 128, 218, 1) !important;
   background: rgba(30, 84, 128, 0.8) !important;
   background: rgba(30, 84, 128, 0.8) !important;
 }
 }
+
 .cpp-popper {
 .cpp-popper {
   background: rgba(30, 84, 128, 0.8);
   background: rgba(30, 84, 128, 0.8);
   border: 1px solid rgba(29, 128, 218, 1);
   border: 1px solid rgba(29, 128, 218, 1);

+ 212 - 2
cpp-ui/src/views/regulation/dqRegulation/index.vue

@@ -35,7 +35,7 @@
         <div class="divDescribe">调控方式:调控值=原始值*系数+数值</div>
         <div class="divDescribe">调控方式:调控值=原始值*系数+数值</div>
         <div class="divDescribeBtn">
         <div class="divDescribeBtn">
           <div class="dark-el-input dark-el-button">
           <div class="dark-el-input dark-el-button">
-            <el-button type="primary" size="small" style="margin-left: 5px">一键应用</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>
             <el-button type="primary" size="small" style="margin-left: 5px" @click="usualSet">设为常用</el-button>
           </div>
           </div>
         </div>
         </div>
@@ -129,7 +129,6 @@
     </div>
     </div>
     <div class="dark-el-dialog">
     <div class="dark-el-dialog">
       <el-dialog :visible.sync="tkOpen" :close-on-click-modal="false" width="700px" height="600px">
       <el-dialog :visible.sync="tkOpen" :close-on-click-modal="false" width="700px" height="600px">
-
         <div class="flex" style="color:#ffffff;">
         <div class="flex" style="color:#ffffff;">
           确认对
           确认对
           <span style="background: #d3a4ff">{{ this.tkrq }}</span>
           <span style="background: #d3a4ff">{{ this.tkrq }}</span>
@@ -141,9 +140,106 @@
           <el-button type="primary" @click="tkCommit">确 定</el-button>
           <el-button type="primary" @click="tkCommit">确 定</el-button>
           <el-button @click="tkCancel">取 消</el-button>
           <el-button @click="tkCancel">取 消</el-button>
         </div>
         </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>
+<!--  策略列表          -->
+            <div  class="reg-config flex items-center">
+            <el-radio v-model="vradio" label="1" @click.native.prevent="radioChange('1')">快捷选择历史策略:</el-radio>
+            <div>
+              <!-- 循环生成按钮 -->
+              <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">
+              <el-radio v-model="vradio" label="2" @click.native.prevent="radioChange('2')">选择历史策略:</el-radio>
+              <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  class="reg-config flex items-center">
+              <div>当前选择策略:</div>
+              <div style="width: 200px">
+                {{ this.currentStrategy }}
+              </div>
+              <div>
+                <el-button @click="trialClick">预览</el-button>
+                <el-button>删除</el-button>
+              </div>
+            </div>
+            <div slot="footer" class="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>
+<!--   预览表格         -->
+            <el-table
+              :data="trialData"
+              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="系数">
+              </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>
       </el-dialog>
     </div>
     </div>
+
   </div>
   </div>
 </template>
 </template>
 
 
@@ -155,8 +251,16 @@ export default {
   name: 'inverterinfo',
   name: 'inverterinfo',
   data() {
   data() {
     return {
     return {
+      trialData:[],
+      disabled:true,
+      vradio: '1',
+      buttons: new Array(),
+      usualId: '',
+      usualList: [],
+      currentStrategy: '',
       stationName: '',
       stationName: '',
       tkrq: '',
       tkrq: '',
+      quickUseOpen: false,
       tkOpen: false,
       tkOpen: false,
       usualOpen: false,
       usualOpen: false,
       usualForm: {
       usualForm: {
@@ -369,8 +473,107 @@ export default {
   },
   },
   computed: {},
   computed: {},
   methods: {
   methods: {
+    // 策略名称下拉框选择
+    changeUsualName(id){
+      const item = this.usualList.find(item => item.id == id)
+      let usualName = item ? item.usualName : ''
+      this.currentStrategy = usualName
+    },
+    radioChange(radioValue) {
+      this.currentStrategy = ''
+      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
+      }
+    },
+    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
+      })
+    },
+    // 预览按钮点击
+    trialClick(){
+      if (this.currentStrategy==''){
+        this.$message.warning("请选择策略名称进行预览!")
+        return
+      }
+      this.executeTrial()
+    },
+    // 一键应用中确定
+    quickUseCommit(){
+      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=[]
+      console.log(this.trialData)
+      this.currentStrategy=''
+      this.buttons=[]
+      this.vradio='1'
+      this.disabled=true
+    },
+    quickUse() {
+      if (this.tableData.length==0){
+        this.$message.warning("调控列表为空,不能操作!")
+        return
+      }
+
+      // 先获取常用下拉框
+      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])
+            }
+          }
+        }
+      })
+
+      this.quickUseOpen = true
+    },
     // 点击设为常用按钮触发
     // 点击设为常用按钮触发
     usualSet() {
     usualSet() {
+      if (this.tableData.length==0){
+        this.$message.warning("调控列表为空,不能操作!")
+        return
+      }
       this.usualOpen = true
       this.usualOpen = true
     },
     },
     // 设为常用弹出框保存按钮
     // 设为常用弹出框保存按钮
@@ -414,6 +617,10 @@ export default {
       this.resetUsual();
       this.resetUsual();
     },
     },
     tkDialog() {
     tkDialog() {
+      if (this.tableData.length==0){
+        this.$message.warning("调控列表为空,不能操作!")
+        return
+      }
       const date = new Date(this.dateTime); // 如果long是毫秒
       const date = new Date(this.dateTime); // 如果long是毫秒
       const year = date.getFullYear();
       const year = date.getFullYear();
       const month = (date.getMonth() + 1).toString().padStart(2, '0');
       const month = (date.getMonth() + 1).toString().padStart(2, '0');
@@ -656,4 +863,7 @@ export default {
   width: 100%;
   width: 100%;
   text-align: center
   text-align: center
 }
 }
+.reg-config{
+  margin-top: 5px;
+}
 </style>
 </style>