Browse Source

配合世利修改报表所需修改问题(报表上报页面新增脚本编辑页面,服务联调;脚本每日运行功能,服务联调);开发黑色版本与白色版本;配合昌胜增加发电能力分析系统中分析报告页面,服务联调,修改查看报告功能及其导出问题;开发黑色版本与白色版本

SunZehao 1 year ago
parent
commit
8b8d39686c

+ 4 - 4
.env.development

@@ -9,11 +9,11 @@ VUE_APP_TITLE = '页面标题'
 # 登录
 VUE_APP_LOGIN_URL = 'http://123.60.219.66:48080'
 # 发电能力分析
-VUE_APP_GENERAT_URL = 'http://123.60.219.66:9002'
-# VUE_APP_GENERAT_URL = 'http://192.168.2.12:9002'
+# VUE_APP_GENERAT_URL = 'http://123.60.219.66:9002'
+VUE_APP_GENERAT_URL = 'http://192.168.2.12:9002'
 # 智能报表
-VUE_APP_REPORT_URL = 'http://123.60.219.66:9001'
-# VUE_APP_REPORT_URL = 'http://192.168.2.3:9001'
+# VUE_APP_REPORT_URL = 'http://123.60.219.66:9001'
+VUE_APP_REPORT_URL = 'http://192.168.2.3:9001'
 # 功率预测
 VUE_APP_BASE_URL = 'http://123.60.219.66:8086'
 

+ 1 - 0
components.d.ts

@@ -29,6 +29,7 @@ declare module 'vue' {
     ElEmpty: typeof import('element-plus/es')['ElEmpty']
     ElForm: typeof import('element-plus/es')['ElForm']
     ElFormItem: typeof import('element-plus/es')['ElFormItem']
+    ElFromItem: typeof import('element-plus/es')['ElFromItem']
     ElHeader: typeof import('element-plus/es')['ElHeader']
     ElIcon: typeof import('element-plus/es')['ElIcon']
     ElInput: typeof import('element-plus/es')['ElInput']

+ 21 - 3
src/api/report.js

@@ -47,10 +47,28 @@ export function deleteScript(parmas) {
 }
 
 // 每天运行一次脚本
-export function dayRunScript(parmas) {
+//列表
+export function scriptTimedrunlist() {
     return httpRequest({
         baseURL: process.env.VUE_APP_REPORT_URL,
-        url: `script/timerun?time=${parmas.time}`,
-        method: 'post'
+        url: `script/timedrun/list`,
+        method: 'get'
+    })
+}
+//删除
+export function deleteTimedrunScript(parmas) {
+    return httpRequest({
+        baseURL: process.env.VUE_APP_REPORT_URL,
+        url: `script/timedrun/delete?scriptid=${parmas.id}`,
+        method: 'get'
+    })
+}
+//运行
+export function dayRunScript(data) {
+    return httpRequest({
+        baseURL: process.env.VUE_APP_REPORT_URL,
+        url: `script/timedrun`,
+        method: 'post',
+        data: data
     })
 }

+ 42 - 6
src/assets/css/eleCss/el-inputB.less

@@ -1,16 +1,23 @@
 .el-select {
     .el-input {
         .el-input__wrapper {
-            background-color: #606266;
+            // background-color: #606266;
+            background-color: transparent;
         }
 
     }
 
+    .el-tag {
+        background-color: #606266;
+        color: #fff;
+    }
+
 }
 
 .el-input {
     .el-input__wrapper {
-        background-color: #606266;
+        // background-color: #606266;
+        background-color: transparent;
     }
 
     .el-input-group__prepend {
@@ -40,7 +47,8 @@ input::-ms-input-placeholder {
 }
 
 .el-date-editor--datetimerange {
-    background-color: #606266;
+    // background-color: #606266;
+    background-color: transparent;
     color: #fff;
     border: 1px solid #fff;
     height: 33px;
@@ -66,10 +74,12 @@ input::-ms-input-placeholder {
 }
 
 .el-date-editor {
-    background-color: #606266;
+    // background-color: #606266;
+    background-color: transparent;
 
     .el-input__wrapper {
-        background-color: #606266;
+        // background-color: #606266;
+        background-color: transparent;
     }
 }
 
@@ -86,8 +96,34 @@ input::-ms-input-placeholder {
 
     .el-input {
         .el-input__wrapper {
-            background-color: #606266;
+            // background-color: #606266;
+            background-color: transparent;
+        }
+
+    }
+}
+
+
+.el-form {
+    .el-form-item {
+        .el-form-item__label {
+            color: #fff;
         }
+    }
+}
 
+.el-tabs {
+    .el-tabs__header {
+        .el-tabs__nav-wrap {
+            .el-tabs__nav-scroll {
+                .el-tabs__item {
+                    color: #fff;
+                }
+
+                .is-active {
+                    color: #409eff;
+                }
+            }
+        }
     }
 }

+ 18 - 0
src/assets/css/eleCss/el-popper.less

@@ -208,6 +208,24 @@
 
 
                     }
+
+                    .el-month-table {
+                        .cell {
+                            color: #B3BDC0 !important;
+                        }
+
+                        .today {
+                            .cell {
+                                color: #409eff !important;
+                            }
+                        }
+
+                        .current {
+                            .cell {
+                                color: #fff !important;
+                            }
+                        }
+                    }
                 }
             }
 

+ 8 - 7
src/views/generatingCapacity/dataAnalysis/combine/index.vue

@@ -350,14 +350,15 @@
             currentNode: ''
         })
         const checkIds = []
-        if (checkedNodes.length) {
-            for (const node of checkedNodes) {
-                if (node.childs && node.childs.length) {
-                    for (const child of node.childs) {
-                        checkIds.push(child.id)
-                    }
+        if (checkedNodes.checkedNodes.length) {
+            let checkArr = checkedNodes.checkedNodes
+            checkArr.forEach(it => {
+                if (it.childs && it.childs.length) {
+                    it.childs.forEach(iv => {
+                        checkIds.push(iv.id)
+                    })
                 }
-            }
+            })
         }
         excelCheckIds.value = checkIds
     }

+ 8 - 7
src/views/generatingCapacity/dataAnalysis/windAnalysis/index.vue

@@ -310,14 +310,15 @@
             currentNode: ''
         })
         const checkIds = []
-        if (checkedNodes.length) {
-            for (const node of checkedNodes) {
-                if (node.childs && node.childs.length) {
-                    for (const child of node.childs) {
-                        checkIds.push(child.id)
-                    }
+        if (checkedNodes.checkedNodes.length) {
+            let checkArr = checkedNodes.checkedNodes
+            checkArr.forEach(it => {
+                if (it.childs && it.childs.length) {
+                    it.childs.forEach(iv => {
+                        checkIds.push(iv.id)
+                    })
                 }
-            }
+            })
         }
         excelCheckIds.value = checkIds
         funSubmit()

+ 8 - 7
src/views/generatingCapacity/dataFilter/process/index.vue

@@ -157,14 +157,15 @@
             currentNode: ''
         })
         const checkIds = []
-        if (checkedNodes.length) {
-            for (const node of checkedNodes) {
-                if (node.childs && node.childs.length) {
-                    for (const child of node.childs) {
-                        checkIds.push(child.id)
-                    }
+        if (checkedNodes.checkedNodes.length) {
+            let checkArr = checkedNodes.checkedNodes
+            checkArr.forEach(it => {
+                if (it.childs && it.childs.length) {
+                    it.childs.forEach(iv => {
+                        checkIds.push(iv.id)
+                    })
                 }
-            }
+            })
         }
         excelCheckIds.value = checkIds
     }

+ 61 - 54
src/views/generatingCapacity/report/fixGetPDF.js

@@ -9,65 +9,72 @@
 // 页面导出为pdf格式
 import html2Canvas from 'html2canvas';
 import jsPDF from 'jspdf';
-
 const htmlToPdf = {
-  getPdf( loading,title,) {
-    // loading = true;
-    console.log(loading);
-    html2Canvas(document.querySelector('#pdfDom'), {
-      allowTaint: false,
-      taintTest: false,
-      logging: false,
-      useCORS: true,
-      dpi: window.devicePixelRatio * 4, //将分辨率提高到特定的DPI 提高四倍
-      scale: 4, //按比例增加分辨率
-    }).then((canvas) => {
-      var pdf = new jsPDF('p', 'mm', 'a4'); //A4纸,纵向
-      var ctx = canvas.getContext('2d'),
-        a4w = 190,
-        a4h = 272, //A4大小,210mm x 297mm,四边各保留10mm的边距,显示区域190x277
-        imgHeight = Math.floor((a4h * canvas.width) / a4w), //按A4显示比例换算一页图像的像素高度
-        renderedHeight = 0;
+    getPdf( loading,title,) {
+        let dom = document.querySelector('#pdfDom')
+        let theme = dom.className ==='block' ? false : true
+        html2Canvas(document.querySelector('#pdfDom'), {
+        allowTaint: false,
+        taintTest: false,
+        logging: false,
+        useCORS: true,
+        dpi: window.devicePixelRatio * 4, //将分辨率提高到特定的DPI 提高四倍
+        scale: 4, //按比例增加分辨率
+        }).then((canvas) => {
+            var pdf = new jsPDF('p', 'mm', 'a4'); //A4纸,纵向
+            if (!theme) { 
+                pdf.setDrawColor(4, 12, 11);
+                pdf.rect(0, 0, pdf.internal.pageSize.getWidth(), pdf.internal.pageSize.getHeight(), 'F');
+            }
+            var ctx = canvas.getContext('2d'),
+                a4w = 190,
+                a4h = 272, //A4大小,210mm x 297mm,四边各保留10mm的边距,显示区域190x277
+                imgHeight = Math.floor((a4h * canvas.width) / a4w), //按A4显示比例换算一页图像的像素高度
+                renderedHeight = 0;
 
-      while (renderedHeight < canvas.height) {
-        var page = document.createElement('canvas');
-        page.width = canvas.width;
-        page.height = Math.min(imgHeight, canvas.height - renderedHeight); //可能内容不足一页
+        while (renderedHeight < canvas.height) {
+            var page = document.createElement('canvas');
+            page.width = canvas.width;
+            page.height = Math.min(imgHeight, canvas.height - renderedHeight); //可能内容不足一页
 
-        //用getImageData剪裁指定区域,并画到前面创建的canvas对象中
-        page
-          .getContext('2d')
-          .putImageData(
-            ctx.getImageData(
-              0,
-              renderedHeight,
-              canvas.width,
-              Math.min(imgHeight, canvas.height - renderedHeight),
-            ),
-            0,
-            0,
-          );
-        pdf.addImage(
-          page.toDataURL('image/jpeg', 1.0),
-          'JPEG',
-          10,
-          10,
-          a4w,
-          Math.min(a4h, (a4w * page.height) / page.width),
-        ); //添加图像到页面,保留10mm边距
+            //用getImageData剪裁指定区域,并画到前面创建的canvas对象中
+            page
+            .getContext('2d')
+            .putImageData(
+                ctx.getImageData(
+                0,
+                renderedHeight,
+                canvas.width,
+                Math.min(imgHeight, canvas.height - renderedHeight),
+                ),
+                0,
+                0,
+            );
+            pdf.addImage(
+            page.toDataURL('image/jpeg', 1.0),
+            'JPEG',
+            10,
+            10,
+            a4w,
+            Math.min(a4h, (a4w * page.height) / page.width),
+            ); //添加图像到页面,保留10mm边距
 
-        renderedHeight += imgHeight;
-        if (renderedHeight < canvas.height) {
-          pdf.addPage(); //如果后面还有内容,添加一个空页
+            renderedHeight += imgHeight;
+            if (renderedHeight < canvas.height) {
+                pdf.addPage(); //如果后面还有内容,添加一个空页
+                if (!theme) { 
+                    pdf.setDrawColor(4, 12, 11);
+                    pdf.rect(0, 0, pdf.internal.pageSize.getWidth(), pdf.internal.pageSize.getHeight(), 'F');
+                }
+            }
+            // delete page;
         }
-        // delete page;
-      }
-      //保存文件
-      pdf.save('发电能力分析' + '.pdf');
-      // loading = false;
-      console.log(loading);
-    });
-  },
+        //保存文件
+        pdf.save('发电能力分析' + '.pdf');
+        // loading = false;
+        console.log(loading);
+        });
+    },
 };
 
 export default htmlToPdf;

+ 98 - 101
src/views/generatingCapacity/report/index.vue

@@ -10,15 +10,9 @@
                             </el-option>
                         </el-select>
                     </el-form-item>
-                    <el-form-item label="开始" class="!mb-0 ml-2">
-                        <el-date-picker v-model="val1" @change="BeginChange(val1)" type="month" value-format="YYYY-MM"
-                            placeholder="选择日期">
-                        </el-date-picker>
-                    </el-form-item>
-                    <el-form-item label="结束" class="!mb-0">
-                        <el-date-picker v-model="value2" @change="EndChange(value2)" type="month" value-format="YYYY-MM"
-                            placeholder="选择日期">
-                        </el-date-picker>
+                    <el-form-item label="选择时间">
+                        <el-date-picker v-model="pickerVal" type="monthrange" value-format="YYYY-MM" range-separator="至"
+                            start-placeholder="开始时间" end-placeholder="结束时间" />
                     </el-form-item>
                     <el-form-item class="!mb-0">
                         <el-button type="primary" @click="addform">查询</el-button>
@@ -44,88 +38,108 @@
             </div>
         </div>
     </div>
-    <el-dialog v-model="centerDialogVisible" title="风电场性能分析报告" width="50%" center :before-close="handleClose"
-        style="padding: 15px 40px;">
-        <div id="pdfDom">
-            <!-- <h3 style="font-weight: bolder; font-size: 18px; color: black;text-aling:center">风电场性能分析报告</h3> -->
-            <p>
-                <span class="ml-5" style="width: 500px;">场站: {{ nbdata.name }}</span>
-                <span class="ml-77">风机型号: {{ nbdata.model }}</span>
-            </p>
-            <p>
-                <span class="ml-5">风机数量: {{ nbdata.quantity }}</span>
-                <span class="ml-87">装机容量(MW): {{ nbdata.capacity }}</span>
-            </p>
-            <p>
-                <span class="ml-5">报告生成日期: {{ time }}</span>
-                <span class="ml-70">数据分析周期: {{ eltime }}</span>
-            </p>
-            <h3 style="font-weight: bolder; font-size: 18px; color: black">概述:</h3>
+    <el-dialog custom-class="windLifeDialog" v-model="centerDialogVisible" width="50%" center
+        :before-close="handleClose" style="padding: 15px 40px;">
+        <div id="pdfDom" :class="!theme ? 'block' : 'white'"
+            :style="!theme ? 'background-color: #040c0b' : 'background-color: #fff'">
+            <h3 style="font-weight: bolder; font-size: 18px;text-aling:center;margin-bottom: 20px;text-align: center"
+                :style="!theme ? 'color: #fff' : 'color: #000'">风电场性能分析报告</h3>
+            <div style="margin-bottom: 20px">
+                <p>
+                    <span class="ml-5" style="width: 500px;">场站: {{ nbdata.name }}</span>
+                    <span class="ml-77">风机型号: {{ nbdata.model }}</span>
+                </p>
+                <p>
+                    <span class="ml-5">风机数量: {{ nbdata.quantity }}</span>
+                    <span class="ml-87">装机容量(MW): {{ nbdata.capacity }}</span>
+                </p>
+                <p>
+                    <span class="ml-5">报告生成日期: {{ time }}</span>
+                    <span class="ml-70">数据分析周期: {{ eltime }}</span>
+                </p>
+            </div>
+            <h3 style="font-weight: bolder; font-size: 18px;margin-bottom: 10px"
+                :style="!theme ? 'color: #fff' : 'color: #000'">概述:</h3>
             <p class="ml-7">
                 报告基于曲线偏差率、静态偏差对风、容量系数、停机时长、分别对场站{{ nbdata.quantity }}台风机进行了性能分析,其中有{{wtcount}}台风机指标严重异常,信息如下:
             </p>
-            <h3 style="font-weight: bolder; font-size: 18px; color: black">
+            <h3 style="font-weight: bolder; font-size: 18px;margin: 10px 0"
+                :style="!theme ? 'color: #fff' : 'color: #000'">
                 1、曲线偏差率
             </h3>
-            <p class="ml-7">
-                曲线偏差率对不同风速区间的实际功率和保证功率做偏差率分析,高偏差率表明存在需要进一步调查潜在问题,偏差率负值表明实际功率低于保证功率
-            </p>
-
-            <el-table :data="curve" :span-method="objectSpanMethod" border style="width: 100%; margin-top: 20px">
-                <el-table-column prop="section" align="center" label="风速区间" width="180" />
-                <el-table-column prop="module" align="center" label="偏差率" />
-                <el-table-column prop="wtidcount" align="center" label="风机数量" />
-                <el-table-column prop="windturbine" align="center" label="风机编号" />
-            </el-table>
-            <h3 style="font-weight: bolder; font-size: 18px; color: black">
+            <div class="warn-table">
+                <p class="ml-7">
+                    曲线偏差率对不同风速区间的实际功率和保证功率做偏差率分析,高偏差率表明存在需要进一步调查潜在问题,偏差率负值表明实际功率低于保证功率
+                </p>
+                <el-table :data="curve" :span-method="objectSpanMethod" border style="width: 100%; margin-top: 20px">
+                    <el-table-column prop="section" align="center" label="风速区间" width="180" />
+                    <el-table-column prop="module" align="center" label="偏差率" />
+                    <el-table-column prop="wtidcount" align="center" label="风机数量" />
+                    <el-table-column prop="windturbine" align="center" label="风机编号" />
+                </el-table>
+            </div>
+            <h3 style="font-weight: bolder; font-size: 18px;margin: 10px 0"
+                :style="!theme ? 'color: #fff' : 'color: #000'">
                 2、静态偏航对风
             </h3>
-            <p class="ml-7">
-                静态偏航对风指风机的叶片与风向之间的偏差,偏差角度过大表明对风存在问题,以下为5-10m风速区间的对风误差
-            </p>
-            <el-table :data="staticwind" :span-method="objectSpanMethod" border style="width: 100%; margin-top: 20px">
-                <el-table-column prop="section" align="center" label="严重程度" width="180" />
-                <el-table-column prop="wtidcount" align="center" label="风机数量" />
-                <!-- <el-table-column prop="amount1" label="风机数量" /> -->
-                <el-table-column prop="windturbine" align="center" label="风机编号" />
-            </el-table>
-            <h3 style="font-weight: bolder; font-size: 18px; color: black">
+            <div class="warn-table">
+                <p class="ml-7">
+                    静态偏航对风指风机的叶片与风向之间的偏差,偏差角度过大表明对风存在问题,以下为5-10m风速区间的对风误差
+                </p>
+                <el-table :data="staticwind" :span-method="objectSpanMethod" border
+                    style="width: 100%; margin-top: 20px">
+                    <el-table-column prop="section" align="center" label="严重程度" width="180" />
+                    <el-table-column prop="wtidcount" align="center" label="风机数量" />
+                    <!-- <el-table-column prop="amount1" label="风机数量" /> -->
+                    <el-table-column prop="windturbine" align="center" label="风机编号" />
+                </el-table>
+            </div>
+            <h3 style="font-weight: bolder; font-size: 18px;margin: 10px 0"
+                :style="!theme ? 'color: #fff' : 'color: #000'">
                 3、容量系数
             </h3>
-            <p class="ml-7">
-                容量系数是风机发电量能力的指标,数值越低,说明发电效率越低
-            </p>
-            <el-table :data="mrlxs" :span-method="objectSpanMethod" border style="width: 100%; margin-top: 20px">
-                <el-table-column prop="section" align="center" label="容量系数" width="180" />
-                <!-- <el-table-column prop="name" label="偏差率" /> -->
-                <el-table-column prop="wtidcount" align="center" label="风机数量" />
-                <el-table-column prop="windturbine" align="center" label="风机编号" />
-            </el-table>
-            <h3 style="font-weight: bolder; font-size: 18px; color: black">
+            <div class="warn-table">
+                <p class="ml-7">
+                    容量系数是风机发电量能力的指标,数值越低,说明发电效率越低
+                </p>
+                <el-table :data="mrlxs" :span-method="objectSpanMethod" border style="width: 100%; margin-top: 20px">
+                    <el-table-column prop="section" align="center" label="容量系数" width="180" />
+                    <!-- <el-table-column prop="name" label="偏差率" /> -->
+                    <el-table-column prop="wtidcount" align="center" label="风机数量" />
+                    <el-table-column prop="windturbine" align="center" label="风机编号" />
+                </el-table>
+            </div>
+            <h3 style="font-weight: bolder; font-size: 18px;margin: 10px 0"
+                :style="!theme ? 'color: #fff' : 'color: #000'">
                 4、桨距角
             </h3>
-            <p class="ml-7">
-                桨距角分析并网开桨和停机收桨,并网状态下桨距角趋近于0度最优,停机状态下桨距角趋近于90度最优
-            </p>
-            <el-table :data="blade" :span-method="objectSpanMethod" border style="width: 100%; margin-top: 20px">
-                <el-table-column prop="section" align="center" label="桨距角" width="180" />
-                <!-- <el-table-column prop="name" label="偏差率" /> -->
-                <el-table-column prop="wtidcount" align="center" label="风机数量" />
-                <el-table-column prop="windturbine" align="center" label="风机编号" />
-            </el-table>
-            <h3 style="font-weight: bolder; font-size: 18px; color: black">
+            <div class="warn-table">
+                <p class="ml-7">
+                    桨距角分析并网开桨和停机收桨,并网状态下桨距角趋近于0度最优,停机状态下桨距角趋近于90度最优
+                </p>
+                <el-table :data="blade" :span-method="objectSpanMethod" border style="width: 100%; margin-top: 20px">
+                    <el-table-column prop="section" align="center" label="桨距角" width="180" />
+                    <!-- <el-table-column prop="name" label="偏差率" /> -->
+                    <el-table-column prop="wtidcount" align="center" label="风机数量" />
+                    <el-table-column prop="windturbine" align="center" label="风机编号" />
+                </el-table>
+            </div>
+            <h3 style="font-weight: bolder; font-size: 18px;margin: 10px 0"
+                :style="!theme ? 'color: #fff' : 'color: #000'">
                 5、停机时间
             </h3>
-            <p class="ml-7">
-                小风速下停机时间越长反应出低风速风机切入不及时,暴风天气不停机反应出风机切出不及时
-            </p>
-            <el-table :data="stoptime" :span-method="objectSpanMethod" border style="width: 100%; margin-top: 20px">
-                <el-table-column prop="section" align="center" label="风速区间" width="180" />
+            <div class="warn-table">
+                <p class="ml-7">
+                    小风速下停机时间越长反应出低风速风机切入不及时,暴风天气不停机反应出风机切出不及时
+                </p>
+                <el-table :data="stoptime" :span-method="objectSpanMethod" border style="width: 100%; margin-top: 20px">
+                    <el-table-column prop="section" align="center" label="风速区间" width="180" />
 
-                <el-table-column prop="wtidcount" align="center" label="风机数量" />
-                <el-table-column prop="remark" align="center" label="累计时间(min)" />
-                <el-table-column prop="windturbine" align="center" label="风机编号" />
-            </el-table>
+                    <el-table-column prop="wtidcount" align="center" label="风机数量" />
+                    <el-table-column prop="remark" align="center" label="累计时间(min)" />
+                    <el-table-column prop="windturbine" align="center" label="风机编号" />
+                </el-table>
+            </div>
             <!-- <h3 style="font-weight: bolder; font-size: 18px; color: black">
     5、损失电量
 </h3>
@@ -143,7 +157,8 @@
     <el-table-column prop="amount1" align="center" label="风机数量" />
     <el-table-column prop="amount2" align="center" label="风机编号" />
 </el-table> -->
-            <h3 style="font-weight: bolder; font-size: 18px; color: black">
+            <h3 style="font-weight: bolder; font-size: 18px;margin: 10px 0"
+                :style="!theme ? 'color: #fff' : 'color: #000'">
                 结论及建议
             </h3>
             <p class="ml-7">
@@ -177,6 +192,7 @@
         useStore
     } from 'vuex';
 
+    const pickerVal = ref([]);
     const curve = ref([]);
     const mrlxs = ref([]);
     const blade = ref([]);
@@ -207,15 +223,15 @@
     /**场站 */
     const stationList = ref([]);
     const funGetStation = async () => {
-        const res = await request.get("/base/station");
+        const res = await httpRequest.get("/base/station");
         stationList.value = res.data;
     };
     /**查询表格数据 */
     const tableData = ref();
     const station = ref("");
     const addform = async () => {
-        const res = await request.get(
-            `/report/list?station=${station.value}&st=${val1.value}&et=${value2.value}`
+        const res = await httpRequest.get(
+            `/report/list?station=${station.value}&st=${pickerVal.value[0]}&et=${pickerVal.value[1]}`
         );
 
         //    res.data.forEach((ele)=>{
@@ -244,7 +260,7 @@
         time.value = row.time;
         //   console.log(index, row)
         centerDialogVisible.value = true;
-        const res = await request.get(
+        const res = await httpRequest.get(
             `/report/info?station=${row.station}&date=${row.time}`
         );
         nbdata.value = res.data.station;
@@ -266,23 +282,6 @@
         hjcount.value = res.data.hjcount;
     };
 
-    const getTime1 = (val) => {
-        //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
-        var date = new Date();
-        var year = date.getFullYear(),
-            month = date.getMonth() + 1,
-            day = date.getDate();
-        month >= 1 && month <= 9 ? (month = "0" + month) : "";
-        day >= 0 && day <= 9 ? (day = "0" + day) : "";
-        var begin = year + "-" + '05';
-        var end = year + "-" + month;
-        if (val == 1) {
-            return begin;
-        } else if (val == 2) {
-            return end;
-        }
-    };
-
     const handleClose = (() => {
         reset();
         centerDialogVisible.value = false;
@@ -314,8 +313,6 @@
     onMounted(() => {
         funGetStation();
         theme.value = store.state.theme
-        val1.value = getTime1(1);
-        value2.value = getTime1(2);
         tableHeight.value = window.innerHeight - 210 + 'px'
         addform()
     });

+ 40 - 9
src/views/intelligentReporting/reporting/index.vue

@@ -62,8 +62,11 @@
                         </el-table-column>
                         <el-table-column align="right">
                             <template #default="scope">
-                                <el-button type="primary" @click="dayRun(scope.row)">运行</el-button>
-                                <el-button type="danger" @click="handleDeleteDayRun(scope.$index)">取消
+                                <el-button type="primary" v-if="!scope.row.isRunning" @click="dayRun(scope.row)">运行
+                                </el-button>
+                                <el-button type="primary" v-else disabled>运行中
+                                </el-button>
+                                <el-button type="danger" @click="handleDeleteDayRun(scope.$index, scope.row)">删除
                                 </el-button>
                             </template>
                         </el-table-column>
@@ -77,7 +80,9 @@
 <script>
     import {
         run,
-        dayRunScript
+        dayRunScript,
+        scriptTimedrunlist,
+        deleteTimedrunScript
     } from '@/api/report';
     import existing from "../existing.vue";
     export default {
@@ -117,7 +122,19 @@
                 }
             }
         },
+        mounted() {
+            this.getDayRunlist()
+        },
         methods: {
+            //获取每日运行列表数据
+            getDayRunlist() {
+                let that = this
+                scriptTimedrunlist().then(datas => {
+                    if (datas) {
+                        that.tableData4 = datas.data
+                    }
+                })
+            },
             onAddItem1() {
                 this.tableData.push(this.childCurrentRow)
             },
@@ -143,20 +160,34 @@
             },
             dayRun(row) {
                 let that = this
-                let params = {
-                    time: row.time
-                }
-                dayRunScript(params).then(res => {
+                dayRunScript(row).then(res => {
                     if (res.code === 0) {
                         that.$message({
                             message: res.msg,
                             type: 'success'
                         });
+                        that.getDayRunlist()
                     }
                 });
             },
-            handleDeleteDayRun(index) {
-                this.tableData4.splice(index, 1)
+            handleDeleteDayRun(index, row) {
+                let that = this
+                if (!row.time) {
+                    that.tableData4.splice(index, 1)
+                } else {
+                    let params = {
+                        id: row.id
+                    }
+                    deleteTimedrunScript(params).then(res => {
+                        if (res.code === 0) {
+                            that.$message({
+                                message: res.msg,
+                                type: 'success'
+                            });
+                            that.getDayRunlist()
+                        }
+                    });
+                }
             },
             getData(data) {
                 console.log("data:", data)