Bläddra i källkod

单机饱和度模块tab2完成

yangxiao 3 år sedan
förälder
incheckning
8636089fb6
2 ändrade filer med 81 tillägg och 11 borttagningar
  1. 3 3
      src/views/wtSaturability/tab1.vue
  2. 78 8
      src/views/wtSaturability/tab2.vue

+ 3 - 3
src/views/wtSaturability/tab1.vue

@@ -120,14 +120,14 @@ export default {
             that.wtArray = res.data;
             that.wtId = res.data[0].id;
             if (!reGetWp) {
-              that.getTab1Data();
+              that.getTabData();
             }
           }
         });
       }
     },
 
-    getTab1Data () {
+    getTabData () {
       let that = this;
       that.API.requestData({
         method: "POST",
@@ -205,7 +205,7 @@ export default {
           msg: '场站与风机为必选项'
         });
       } else {
-        this.getTab1Data();
+        this.getTabData();
       }
     }
   },

+ 78 - 8
src/views/wtSaturability/tab2.vue

@@ -18,6 +18,14 @@
             </el-select>
           </div>
         </div>
+        <div class="query-item">
+					<div class="lable">日期:</div>
+					<div class="search-input">
+						<el-date-picker v-model="recorddate" type="date"
+							value-format="YYYY-MM-DD" placeholder="选择日期" popper-class="date-select">
+						</el-date-picker>
+					</div>
+				</div>
       </div>
       <div class="query-actions">
         <button class="btn green" @click="search">搜索</button>
@@ -27,6 +35,29 @@
       <ComTable height="35vh" :data="tableData"></ComTable>
     </div>
     <Mlc height="300px" :list="chartData" :units="chartUnit" :showLegend="true" />
+    <el-dialog title="月风电功率编辑" v-model="dialogShow" width="85%" top="10vh" custom-class="modal" :close-on-click-modal="true">
+      <el-form class="mg-b-16" label-width="100px" inline>
+        <el-form-item class="mg-b-8" label="风机编号:">
+          <el-input v-model="wtId" readonly placeholder=""></el-input>
+        </el-form-item>
+        <el-form-item class="mg-b-8" label="年份:">
+          <el-input v-model="editItem._year" readonly placeholder=""></el-input>
+        </el-form-item>
+        <el-form-item class="mg-b-8" label="月份:">
+          <el-input v-model="editItem._month" readonly placeholder=""></el-input>
+        </el-form-item>
+        <el-form-item class="mg-b-8" label="风速:">
+          <el-input v-model="editItem.speed" readonly placeholder=""></el-input>
+        </el-form-item>
+        <el-form-item class="mg-b-8" label="实际拟合:">
+          <el-input v-model="editItem.actualpower" placeholder="请输入"></el-input>
+        </el-form-item>
+        <el-form-item class="mg-b-8" label="最优拟合:">
+          <el-input v-model="editItem.optimalpower" placeholder="请输入"></el-input>
+        </el-form-item>
+      </el-form>
+      <button style="width:100%;" class="btn" @click="editWtInfo">修改</button>
+    </el-dialog>
   </div>
 </template>
 
@@ -45,12 +76,16 @@ export default {
 
   // 数据
   data () {
+    const that = this;
     return {
       isAsc: "asc",
       wpArray: [],
       wtArray: [],
       wpId: "",
       wtId: "",
+      editItem:{},
+      dialogShow:false,
+      recorddate:new Date((new Date().getTime() - 3600 * 1000 * 24)).formatDate("yyyy-MM-dd"),
       tableData: {
         column: [
           {
@@ -76,7 +111,22 @@ export default {
             field: "optimalpower",
             is_num: false,
             is_light: false,
-          }
+          },
+          // {
+          //   name: "操作",
+          //   field: "",
+          //   is_num: false,
+          //   is_light: false,
+          //   template() {
+					// 			return "<el-button type='text' style='cursor: pointer;'>修改</el-button>";
+					// 	},
+          //   click(e, row){
+          //     that.editItem = row;
+          //     that.editItem._year = new Date(that.recorddate).getFullYear();
+          //     that.editItem._month = (new Date(that.recorddate).getMonth() + 1);
+          //     that.dialogShow = true;
+          //   }
+          // }
         ],
         data: [],
       },
@@ -120,20 +170,22 @@ export default {
             that.wtArray = res.data;
             that.wtId = res.data[0].id;
             if (!reGetWp) {
-              that.getTab1Data();
+              that.getTabData();
             }
           }
         });
       }
     },
 
-    getTab1Data () {
+    getTabData () {
       let that = this;
       that.API.requestData({
         method: "POST",
-        subUrl: "powersaturation/powersaturationamonutlist",
+        subUrl: "powersaturation/powersaturationmonthlist",
         data: {
-          wtId: that.wtId
+          wtId: that.wtId,
+          year: new Date(that.recorddate).getFullYear(),
+          month: (new Date(that.recorddate).getMonth() + 1)
         },
         success (res) {
           that.tableData.data = res.data.list;
@@ -147,9 +199,11 @@ export default {
       let that = this;
       that.API.requestData({
         method: "POST",
-        subUrl: "powersaturation/powersaturationamonutchart",
+        subUrl: "powersaturation/powersaturationmonthchart",
         data: {
-          wtId: that.wtId
+          wtId: that.wtId,
+          year: new Date(that.recorddate).getFullYear(),
+          month: (new Date(that.recorddate).getMonth() + 1)
         },
         success (res) {
 
@@ -199,13 +253,29 @@ export default {
       });
     },
 
+    // 编辑
+    editWtInfo(){
+      let that = this;
+
+      that.editItem.actualpower += "";
+      that.editItem.optimalpower += "";
+
+      if(!that.editItem.actualpower || !that.editItem.optimalpower){
+        that.BASE.showMsg({
+          msg:"实际拟合与最优拟合不可为空"
+        });
+      }else{
+        
+      }
+    },
+
     search () {
       if (!this.wpId || !this.wtId) {
         this.BASE.showMsg({
           msg: '场站与风机为必选项'
         });
       } else {
-        this.getTab1Data();
+        this.getTabData();
       }
     }
   },