From af1c9e588f1de0240390648f9bb56aa486870aff Mon Sep 17 00:00:00 2001
From: chengxiangling <291105840@qq.com>
Date: 星期五, 16 五月 2025 17:40:18 +0800
Subject: [PATCH] 提交高度修改;

---
 src/views/mainPlan/gasProduceStatics/index.vue |  650 ++++++++++++++++++++++++++++++----------------------------
 1 files changed, 334 insertions(+), 316 deletions(-)

diff --git a/src/views/mainPlan/gasProduceStatics/index.vue b/src/views/mainPlan/gasProduceStatics/index.vue
index 1417358..8ece8bf 100644
--- a/src/views/mainPlan/gasProduceStatics/index.vue
+++ b/src/views/mainPlan/gasProduceStatics/index.vue
@@ -6,49 +6,84 @@
       ref="queryRef"
       :inline="true"
       v-show="showSearch"
-      label-width="68px"
+      label-position="left"
     >
-      <el-row type="flex" justify="left">
-        <el-form-item label="缁熻鏂瑰紡">
-          <el-select
-            v-model="queryParams.searchType"
-            style="width: 200px"
-            placeholder="Select"
-            @change="handleChangeSelectType"
+      <el-row :gutter="20">
+        <el-col :span="6">
+          <el-form-item :label="$t('plan.query.statistical')" :style="{ width: '100%' }">
+            <el-select
+              v-model="queryParams.searchType"
+              placeholder="Select"
+              @change="handleChangeSelectType"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item
+            :style="{ width: '250px' }"
+            :label="
+              !dayCom
+                ? $t('plan.query.selectDateRange')
+                : $t('plan.query.selectDateMonth')
+            "
           >
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="閫夋嫨鍖洪棿">
-          <div v-if="!dayCom">
-            <el-date-picker
-              v-model="queryParams.monthRange"
-              type="monthrange"
-              range-separator="鑷�"
-              start-placeholder="閫夋嫨寮�濮嬫湀浠�"
-              end-placeholder="閫夋嫨缁撴潫鏈堜唤"
-            />
-          </div>
-          <div v-else>
-            <el-date-picker
-              v-model="queryParams.monthDays"
-              type="month"
-              placeholder="閫夋嫨鏈堜唤"
-            />
-          </div>
-        </el-form-item>
-
-        <el-form-item class="column-with-margin">
-          <el-button type="primary" icon="Search" @click="handleQuery"
-            >鏌ヨ</el-button
+            <div v-if="!dayCom">
+              <el-date-picker
+               :style="{ width: '100%' }"
+                v-model="queryParams.monthRange"
+                type="monthrange"
+                :range-separator="$t('plan.placeholder.to')"
+                :start-placeholder="$t('plan.placeholder.startMonth')"
+                :end-placeholder="$t('plan.placeholder.endMonth')"
+              />
+            </div>
+            <div v-else>
+              <el-date-picker
+                 :style="{ width: '100%' }"
+                v-model="queryParams.monthDays"
+                type="month"
+                :placeholder="$t('plan.placeholder.selectMonth')"
+              />
+            </div>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6" v-if="dayCom">
+          <el-form-item
+            :label="$t('basic.table.applicableFactories')"
+            prop="plant"
+            :style="{ width: '100%' }"
           >
-          <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button>
-        </el-form-item>
+            <el-select
+              clearable
+              v-model="queryParams.applicableFactory"
+              :placeholder="$t('basic.table.applicableFactories')"
+            >
+              <el-option
+                v-for="item in aps_factory"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <!-- <el-col :span="6" style="text-align:right;">
+          <el-form-item class="column-with-margin">
+            <el-button type="primary" icon="Search" @click="handleQuery">{{
+              $t("common.common.query")
+            }}</el-button>
+            <el-button icon="Refresh" @click="resetQuery">{{
+              $t("common.common.reset")
+            }}</el-button>
+          </el-form-item>
+        </el-col> -->
       </el-row>
     </el-form>
     <el-row :gutter="10" class="mb8">
@@ -58,79 +93,59 @@
           plain
           icon="Download"
           @click="handleExport"
-          v-hasPermi="['apsPartRouteStat:export']"
-          >瀵煎嚭</el-button
+          v-hasPermi="['aps:apsGasPipingRouteStat:exportExcel']"
+          :disabled="loading"
+          >{{ $t("common.common.export") }}</el-button
         >
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="info"
+          type="success"
           plain
           icon="Refresh"
           @click="handleRefresh"
-          v-hasPermi="['apsPartRouteStat:edit']"
-          >鏇存柊</el-button
+          v-hasPermi="['aps:apsGasPipingRouteStat:computeCapacity']"
+          :disabled="loading"
+          >{{ $t("common.common.update") }}</el-button
         >
       </el-col>
-      <right-toolbar @queryTable="getList" :search="false"></right-toolbar>
+      <right-toolbar
+        v-model:showSearch="showSearch"
+        @queryTable="handleQuery"
+        @resetTable="resetQuery"
+      ></right-toolbar>
     </el-row>
-    <div class="box_container">
-      <div class="title_text">绠¤矾瑙勫垝浜ц兘璐熻浇缁熻</div>
-      <div class="tabel_container">
-        <vxe-grid
-          ref="gridRef"
-          v-bind="gridOptions"
-          :loading="loading"
-        ></vxe-grid>
-      </div>
-    </div>
-    <div class="box_container">
-      <div class="title_text">姘旀煖瑙勫垝浜ц兘璐熻浇缁熻</div>
-      <div class="tabel_container">
-        <vxe-grid
-          ref="gridRef2"
-          v-bind="gridOptions"
-          :loading="loading"
-        ></vxe-grid>
-      </div>
-    </div>
+    <vxe-grid ref="gridRef" v-bind="gridOptions" :loading="loading"></vxe-grid>
   </div>
 </template>
 
-<script setup name="gasProduceStatics">
+<script setup name="GasProduceStatics">
 import {
   listUpdateGasProduceStatics,
   listGasProduceStatics,
 } from "@/api/mainPlan/gasProduceStatics.js";
 import { ref } from "vue";
 import * as XLSX from "xlsx";
+// import { ElMessage } from "element-plus";
+import { useI18n } from "vue-i18n"; //瑕佸湪js涓娇鐢ㄥ浗闄呭寲
+const { t, locale } = useI18n();
 const { proxy } = getCurrentInstance();
-
+const { aps_factory } = proxy.useDict("aps_factory");
 const loading = ref(false);
 const gridRef = ref();
-const gridRef2 = ref();
-const height = ref(document.documentElement.clientHeight - 400 + "px;");
+const height = ref(document.documentElement.clientHeight - 180 + "px;");
 const headers = ref([]);
-const exportData = ref([]);
+// const exportData = ref([]);
 const showSearch = ref(true);
 const data = reactive({
   queryParams: {
     monthRange: "",
     monthDays: "",
-    searchType: "鎸夋湀缁熻",
+    searchType: t("plan.options.monthlyStatic"),
   },
 });
 let searchTypeValue = ref("month");
-const options = [
-  {
-    value: "month",
-    label: "鎸夋湀缁熻",
-  },
-  {
-    value: "day",
-    label: "鎸夋棩缁熻",
-  },
-];
+let options = ref([]);
 const { queryParams } = toRefs(data);
 const gridOptions = reactive({
   border: true,
@@ -157,10 +172,34 @@
 const dayCom = ref(false);
 let tableColumn = [];
 let tableData = [];
-let merges = [];
+// let merges = [];
+watch(
+  locale,
+  (newLocale) => {
+    options.value = [
+      {
+        value: "month",
+        label: t("plan.options.monthlyStatic"),
+      },
+      {
+        value: "day",
+        label: t("plan.options.dailyStatic"),
+      },
+    ];
+    queryParams.value.searchType = t("plan.options.monthlyStatic");
+    if (
+      (!queryParams.value.monthRange && dayCom.value == false) ||
+      (!queryParams.value.monthDays && dayCom.value == true)
+    ) {
+      return;
+    }
+    // queryParams.value.pageNum = 1;
+    getGasList();
+  },
+  { immediate: true, deep: true }
+);
 function handleChangeSelectType(e) {
-  searchTypeValue.value = e
-  console.log(e,searchTypeValue.value, "sjcsuhcushc");
+  searchTypeValue.value = e;
   if (e === "day") {
     dayCom.value = true;
   } else {
@@ -173,286 +212,238 @@
   const year = dateTime.getFullYear();
   const month = String(dateTime.getMonth() + 1).padStart(2, "0"); // 鏈堜唤浠�0寮�濮嬶紝鎵�浠ラ渶瑕佸姞1锛屽苟鐢╬adStart琛ラ浂
   // 鏍煎紡鍖栧勾浠藉拰鏈堜唤涓� "yyyy-mm" 鏍煎紡鐨勫瓧绗︿覆
-  return`${year}-${month}`;
+  return `${year}-${month}`;
 }
-/** 鏌ヨ闆朵欢缁熻琛ㄥ垪琛� */
-function getPipeList() {
-  let sYearMonth = "";
-  let eYearMonth = "";
-  // let type = "";
-  // options.map((item) => {
-  //   if (queryParams.value.searchType === item.label) {
-  //     type = item.value;
-  //   }
-  // });
+function dateRangeStr(monthRange) {
   // 鍒涘缓涓�涓狣ate瀵硅薄
-  let sDate = new Date(queryParams.value.monthRange[0]);
-  let eDate = new Date(queryParams.value.monthRange[1]);
+  let sDate = new Date(monthRange[0]);
+  let eDate = new Date(monthRange[1]);
   // 鑾峰彇骞翠唤鍜屾湀浠�
   let sYear = sDate.getFullYear();
   let sMonth = sDate.getMonth() + 1; // 鏈堜唤鏄粠0寮�濮嬬殑锛屾墍浠ヨ鍔�1
   let eYear = eDate.getFullYear();
   let eMonth = eDate.getMonth() + 1; // 鏈堜唤鏄粠0寮�濮嬬殑锛屾墍浠ヨ鍔�1
   // 鏍煎紡鍖栦负"YYYY-MM"鐨勫舰寮�
-  sYearMonth = `${sYear}-${sMonth.toString().padStart(2, "0")}`;
-  eYearMonth = `${eYear}-${eMonth.toString().padStart(2, "0")}`;
-  console.log(sYearMonth, eYearMonth, "yearMonth");
-
-  let rowKey = 0;
-  let colKey = 0;
-  headers.value = [];
-  exportData.value = [];
-  tableColumn = [];
-  tableData = [];
-  loading.value = true;
-  listGasProduceStatics({
-    searchStartDate:
-      queryParams.value.searchType === "鎸夋湀缁熻"
-        ? sYearMonth
-        : dateStr(queryParams.value.monthDays),
-    searchEndDate:
-      queryParams.value.searchType === "鎸夋湀缁熻"
-        ? eYearMonth
-        : dateStr(queryParams.value.monthDays),
-    searchType: searchTypeValue.value,
-    major:'piping'
-  }).then((response) => {
-    console.log(response.data.planTable,'responseresponseresponse')
-    const colList = [];
-    let headersOne = [];
-    let headersTwo = [];
-    if(response.code == '200'){
-      if (!response.data.planTitle) {
-        loading.value = false;
-        return;
-      }
-      headersOne.push('鏃ユ湡');
-      headersTwo.push('宸ュ簭鍚嶇О');
-      colList.push({
-          field: 'dateCol',
-          title: '鏃ユ湡',
-          fixed: 'left',
-          children: [
-            { field: `resourceName`, title: '宸ュ簭鍚嶇О', width: 250, type: 'html'},
-          ],
-          width: 160
-        })
-      response.data.planTitle.forEach(item => {
-        headersOne.push(item);
-        headersOne.push('');
-        headersOne.push('');
-        headersTwo.push('璁捐浜ц兘');
-        headersTwo.push('闇�姹備骇鑳�');
-        headersTwo.push('浜ц兘璐熻浇');
-        colKey++
-        colList.push({
-          field: `dateColTime${colKey}`,
-          title: item,
-          children: [
-          { field: `designTimes${colKey}`, title: '璁捐浜ц兘', width: 80},
-          { field: `requireTimes${colKey}`, title: '闇�姹備骇鑳�', width: 80},
-          { field: `capacityLoad${colKey}`, title: '浜ц兘璐熻浇', width: 80, type: 'html'},
-          ],
-          width: 160
-        })
-      });
-
-      headers.value.push(headersOne);
-      headers.value.push(headersTwo);
-
-      const columnList = [...tableColumn, ...colList]
-      const dataList = []
-      let startCol = 1;
-
-      //鑾峰彇map
-      response.data.planTable.map(mapItem => {
-        rowKey++
-        let lastCol = startCol + 2;
-        merges.push({ s: { r: 0, c: startCol }, e: { r: 0, c:  lastCol} });
-        startCol = lastCol + 1;
-        let data = [];
-        const item = {
-          id: `${rowKey}`
-        }
-        for (const [key, listValue] of Object.entries(mapItem)) {
-          data.push(key);
-          
-          let tableKey = 0;
-          let flag = false;
-          listValue.forEach(listItem => {
-
-            tableKey++
-            item[`designTimes${tableKey}`] = listItem.designTimes;
-            item[`requireTimes${tableKey}`] = listItem.requireTimes;
-            item[`capacityLoad${tableKey}`] = listItem.capacityLoad > 100 ? `<font color="red">${listItem.capacityLoad}%</font>` :listItem.capacityLoad+'%';
-            data.push(listItem.designTimes);
-            data.push(listItem.requireTimes);
-            data.push(listItem.capacityLoad+'%');
-            if (listItem.capacityLoad > 100) {
-              flag = true;
-            }
-          });
-
-          item[`resourceName`] = flag ? `<div class='el-badge'><sup class="el-badge__content is-fixed is-dot"></sup>${key}</div>` : key;
-        }
-        exportData.value.push(data);
-        dataList.push(item);
-      });
-        
-      const $grid = gridRef.value
-      if ($grid) {
-        tableColumn = columnList
-        tableData = [...tableData, ...dataList]
-        $grid.loadColumn(tableColumn)
-        $grid.loadData(tableData)
-        gridOptions.loading = false
-      }
-
-      loading.value = false;
-    }
-  });
+  return {
+    sYearMonth: `${sYear}-${sMonth.toString().padStart(2, "0")}`,
+    eYearMonth: `${eYear}-${eMonth.toString().padStart(2, "0")}`,
+  };
 }
+const formatTypeLabelPlant = (list) => {
+  if (list) {
+    return list
+      .map((type) => {
+        const item = aps_factory.value.find((item) => item.value === type);
+        return item ? item.label : type;
+      })
+      .join("");
+  }
+  return "";
+};
 function getGasList() {
-  let sYearMonth = "";
-  let eYearMonth = "";
-  // let type = "";
-  // options.map((item) => {
-  //   if (queryParams.value.searchType === item.label) {
-  //     type = item.value;
-  //   }
-  // });
-  // 鍒涘缓涓�涓狣ate瀵硅薄
-  let sDate = new Date(queryParams.value.monthRange[0]);
-  let eDate = new Date(queryParams.value.monthRange[1]);
-  // 鑾峰彇骞翠唤鍜屾湀浠�
-  let sYear = sDate.getFullYear();
-  let sMonth = sDate.getMonth() + 1; // 鏈堜唤鏄粠0寮�濮嬬殑锛屾墍浠ヨ鍔�1
-  let eYear = eDate.getFullYear();
-  let eMonth = eDate.getMonth() + 1; // 鏈堜唤鏄粠0寮�濮嬬殑锛屾墍浠ヨ鍔�1
-  // 鏍煎紡鍖栦负"YYYY-MM"鐨勫舰寮�
-  sYearMonth = `${sYear}-${sMonth.toString().padStart(2, "0")}`;
-  eYearMonth = `${eYear}-${eMonth.toString().padStart(2, "0")}`;
-  console.log(sYearMonth, eYearMonth, "yearMonth");
-
   let rowKey = 0;
   let colKey = 0;
   headers.value = [];
-  exportData.value = [];
+  // exportData.value = [];
   tableColumn = [];
   tableData = [];
   loading.value = true;
   listGasProduceStatics({
-    searchStartDate:
-      queryParams.value.searchType === "鎸夋湀缁熻"
-        ? sYearMonth
-        : dateStr(queryParams.value.monthDays),
-    searchEndDate:
-      queryParams.value.searchType === "鎸夋湀缁熻"
-        ? eYearMonth
-        : dateStr(queryParams.value.monthDays),
+    searchStartDate: !dayCom.value
+      ? dateRangeStr(queryParams.value.monthRange).sYearMonth
+      : dateStr(queryParams.value.monthDays),
+    searchEndDate: !dayCom.value
+      ? dateRangeStr(queryParams.value.monthRange).eYearMonth
+      : dateStr(queryParams.value.monthDays),
     searchType: searchTypeValue.value,
-    major:'gas'
+    major: "gas",
+    plant: !dayCom.value?"": queryParams.value.applicableFactory
   }).then((response) => {
-    console.log(response.data.planTable,'responseresponseresponse')
     const colList = [];
-    let headersOne = [];
-    let headersTwo = [];
-    if(response.code == '200'){
+    if (response.code == "200") {
       if (!response.data.planTitle) {
         loading.value = false;
         return;
       }
-      headersOne.push('鏃ユ湡');
-      headersTwo.push('宸ュ簭鍚嶇О');
-      colList.push({
-          field: 'dateCol',
-          title: '鏃ユ湡',
-          fixed: 'left',
+      if (!dayCom.value) {
+        colList.push({
+          field: "dateCol",
+          title: t("plan.table.dateYearMonth"),
+          fixed: "left",
           children: [
-            { field: `resourceName`, title: '宸ュ簭鍚嶇О', width: 250, type: 'html'},
+            {
+              field: `resourceName`,
+              title: t("plan.table.processName"),
+              width: 250,
+              type: "html",
+            },
+            {
+              field: `resourceGroupName`,
+              title: t("plan.table.applicableFactories"),
+              width: 250,
+              type: "html",
+            },
           ],
-          width: 160
-        })
-      response.data.planTitle.forEach(item => {
-        headersOne.push(item);
-        headersOne.push('');
-        headersOne.push('');
-        headersTwo.push('璁捐浜ц兘');
-        headersTwo.push('闇�姹備骇鑳�');
-        headersTwo.push('浜ц兘璐熻浇');
-        colKey++
+          width: 160,
+        });
+      }else{
+        colList.push({
+          field: "dateCol",
+          title: t("plan.table.dateYearMonth"),
+          fixed: "left",
+          children: [
+            {
+              field: `resourceName`,
+              title: t("plan.table.processName"),
+              width: 250,
+              type: "html",
+            }
+          ],
+          width: 160,
+        });
+      }
+      response.data.planTitle.forEach((item) => {
+        // headersOne.push(item);
+        // headersOne.push("");
+        // headersOne.push("");
+        // headersTwo.push(t("plan.table.designWorkingHours"));
+        // headersTwo.push(t("plan.table.requiredWorkingHours"));
+        // headersTwo.push(t("plan.table.capacityLoad"));
+        colKey++;
         colList.push({
           field: `dateColTime${colKey}`,
           title: item,
           children: [
-          { field: `designTimes${colKey}`, title: '璁捐浜ц兘', width: 80},
-          { field: `requireTimes${colKey}`, title: '闇�姹備骇鑳�', width: 80},
-          { field: `capacityLoad${colKey}`, title: '浜ц兘璐熻浇', width: 80, type: 'html'},
+            {
+              field: `designTimes${colKey}`,
+              title: t("plan.table.designWorkingHours"),
+              width: 80,
+            },
+            {
+              field: `requireTimes${colKey}`,
+              title: t("plan.table.requiredWorkingHours"),
+              width: 80,
+            },
+            {
+              field: `capacityLoad${colKey}`,
+              title: t("plan.table.capacityLoad"),
+              width: 80,
+              type: "html",
+            },
           ],
-          width: 160
-        })
+          width: 160,
+        });
       });
 
-      headers.value.push(headersOne);
-      headers.value.push(headersTwo);
+      // headers.value.push(headersOne);
+      // headers.value.push(headersTwo);
 
-      const columnList = [...tableColumn, ...colList]
-      const dataList = []
-      let startCol = 1;
+      const columnList = [...tableColumn, ...colList];
+      const dataList = [];
+      // let startCol = 1;
 
       //鑾峰彇map
-      response.data.planTable.map(mapItem => {
-        rowKey++
-        let lastCol = startCol + 2;
-        merges.push({ s: { r: 0, c: startCol }, e: { r: 0, c:  lastCol} });
-        startCol = lastCol + 1;
-        let data = [];
+      response.data.planTable.map((mapItem) => {
+        rowKey++;
+        // let lastCol = startCol + 2;
+        // merges.push({ s: { r: 0, c: startCol }, e: { r: 0, c: lastCol } });
+        // startCol = lastCol + 1;
         const item = {
-          id: `${rowKey}`
-        }
+          id: `${rowKey}`,
+        };
         for (const [key, listValue] of Object.entries(mapItem)) {
-          data.push(key);
-          
+          // data.push(key);
+
           let tableKey = 0;
           let flag = false;
-          listValue.forEach(listItem => {
-
-            tableKey++
+          listValue.forEach((listItem) => {
+            tableKey++;
             item[`designTimes${tableKey}`] = listItem.designTimes;
             item[`requireTimes${tableKey}`] = listItem.requireTimes;
-            item[`capacityLoad${tableKey}`] = listItem.capacityLoad > 100 ? `<font color="red">${listItem.capacityLoad}%</font>` :listItem.capacityLoad+'%';
-            data.push(listItem.designTimes);
-            data.push(listItem.requireTimes);
-            data.push(listItem.capacityLoad+'%');
-            if (listItem.capacityLoad > 100) {
-              flag = true;
-            }
+            item[`capacityLoad${tableKey}`] = formatCapacityLoad(
+              listItem.designTimes,
+              listItem.requireTimes,
+              listItem.capacityLoad
+            );
+            // data.push(listItem.designTimes);
+            // data.push(listItem.requireTimes);
+            // data.push(listItem.capacityLoad + "%");
+            // if (listItem.capacityLoad > 100) {
+            //   flag = true;
+            // }
           });
 
-          item[`resourceName`] = flag ? `<div class='el-badge'><sup class="el-badge__content is-fixed is-dot"></sup>${key}</div>` : key;
+          // item[`resourceName`] = flag
+          //   ? `<div class='el-badge'><sup class="el-badge__content is-fixed is-dot"></sup>${key}</div>`
+          //   : key;
+          if (!dayCom.value) {
+            const lastIndex = key.lastIndexOf('_');
+            item[`resourceName`] = key.slice(0, lastIndex);
+            item[`resourceGroupName`] = formatTypeLabelPlant([key.slice(lastIndex + 1)]);
+          }else{
+            item[`resourceName`] = key
+          }
         }
-        exportData.value.push(data);
+        // exportData.value.push(data);
         dataList.push(item);
       });
-        
-      const $grid = gridRef2.value
+
+      const $grid = gridRef.value;
       if ($grid) {
-        tableColumn = columnList
-        tableData = [...tableData, ...dataList]
-        $grid.loadColumn(tableColumn)
-        $grid.loadData(tableData)
-        gridOptions.loading = false
+        tableColumn = columnList;
+        tableData = [...tableData, ...dataList];
+        $grid.loadColumn(tableColumn);
+        $grid.loadData(tableData);
+        gridOptions.loading = false;
       }
 
       loading.value = false;
     }
   });
+}
+function formatCapacityLoad(designTimes, requireTimes, capacityLoad) {
+  /**
+   * // 0-100 缁胯壊锛�101-120榛勮壊锛屽ぇ浜�120绾㈣壊
+    listItem.capacityLoad <= 100
+      ? `<font color="red">${listItem.capacityLoad}%</font>`
+      : listItem.capacityLoad + "%";
+   */
+  if (designTimes > 0 && capacityLoad > 0 && capacityLoad <= 100) {
+    return `<font color="#85cf60">${capacityLoad}%</font>`;
+  } else if (designTimes > 0 && capacityLoad > 101 && capacityLoad <= 120) {
+    return `<font color="#ecb869">${capacityLoad}%</font>`;
+  } else if (designTimes > 0 && capacityLoad > 120) {
+    return `<font color="#f89c9c">${capacityLoad}%</font>`;
+  } else if (designTimes == 0 && requireTimes > 0) {
+    return `<font color="#f56c6c">error</font>`;
+  } else {
+    return `${capacityLoad}%`;
+  }
 }
 /** 瀵煎嚭鎸夐挳鎿嶄綔 */
 function handleExport() {
+  if (
+    (!queryParams.value.monthRange && dayCom.value == false) ||
+    (!queryParams.value.monthDays && dayCom.value == true)
+  ) {
+    ElMessage({
+      message: t("plan.message.errorMonthEmpty"),
+      type: "error",
+    });
+    return;
+  }
   proxy.download(
     "/aps/apsGasPipingRouteStat/exportExcel",
-    {},
+    {
+      searchStartDate: !dayCom.value
+        ? dateRangeStr(queryParams.value.monthRange).sYearMonth
+        : dateStr(queryParams.value.monthDays),
+      searchEndDate: !dayCom.value
+        ? dateRangeStr(queryParams.value.monthRange).eYearMonth
+        : dateStr(queryParams.value.monthDays),
+      searchType: searchTypeValue.value,
+      major: "gas",
+    },
     `aps_gas_produce_statics_${new Date().getTime()}.xlsx`
   );
 }
@@ -463,34 +454,61 @@
     (!queryParams.value.monthDays && dayCom.value == true)
   ) {
     ElMessage({
-      message: "璇烽�夋嫨骞存湀",
+      message: t("plan.message.errorMonthEmpty"),
       type: "error",
     });
     return;
   }
   // queryParams.value.pageNum = 1;
-  getPipeList();
   getGasList();
 }
 
 /** 閲嶇疆鎸夐挳鎿嶄綔 */
 function resetQuery() {
-  proxy.resetForm("queryRef");
-  handleQuery();
+  queryParams.value.monthRange = "";
+  queryParams.value.monthDays = "";
+  dayCom.value = false;
+  (queryParams.value.searchType = t("plan.options.monthlyStatic")),
+    (searchTypeValue.value = "month");
+  tableData = [];
+  const $grid = gridRef.value;
+  if ($grid) {
+    $grid.loadColumn([]);
+    $grid.loadData([]);
+    gridOptions.loading = false;
+  }
 }
 /** 鍒锋柊鎸夐挳鎿嶄綔 */
 function handleRefresh() {
-  updateStat().then((response) => {
-    if (response.code == "200") {
-        getPipeList();
-        getGasList();
-    }
+  if (
+    (!queryParams.value.monthRange && dayCom.value == false) ||
+    (!queryParams.value.monthDays && dayCom.value == true)
+  ) {
+    ElMessage({
+      message: t("plan.message.errorMonthEmpty"),
+      type: "error",
+    });
+    return;
+  }
+  loading.value = true;
+  listUpdateGasProduceStatics({
+    major: "gas",
+  }).then((response) => {
+    ElMessage({
+      message: t("plan.message.update"),
+      type: "success",
+    });
+    loading.value = false;
+    getGasList();
   });
 }
 
 // getList();
 </script>
 <style lang="scss" scoped>
+.column-with-margin {
+  margin-right: 0px;
+}
 .box_container {
   width: 100%;
   margin: 20px auto;

--
Gitblit v1.9.3