chengxiangling
2025-05-16 444ba76f4cca8a9df3faf61ab33ec631aec7fbba
src/views/mainPlan/pipeProduceStatics/index.vue
@@ -8,72 +8,84 @@
      v-show="showSearch"
      label-position="left"
    >
      <el-row :gutter="20">
        <el-col :span="8">
          <el-form-item :label="$t('plan.query.statistical')" :style="{ width: '100%' }">
            <el-select
              v-model="queryParams.searchType"
              placeholder="Select"
              @change="handleChangeSelectType"
      <el-form
        class="responsive-form"
        :model="queryParams"
        ref="queryRef"
        :inline="true"
        v-show="showSearch"
        label-position="left"
      >
        <el-row :gutter="20">
          <el-col :span="6">
            <el-form-item
              :label="$t('plan.query.statistical')"
              :style="{ width: '100%' }"
            >
              <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="8">
          <el-form-item
            :label="
              !dayCom
                ? $t('plan.query.selectDateRange')
                : $t('plan.query.selectDateMonth')
            "
            :style="{ width: '100%' }"
          >
            <div v-if="!dayCom">
              <el-date-picker
                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
                v-model="queryParams.monthDays"
                type="month"
                :placeholder="$t('plan.placeholder.selectMonth')"
              />
            </div>
          </el-form-item>
        </el-col>
        <el-col :span="8" v-if="dayCom">
          <el-form-item
            :label="$t('basic.table.applicableFactories')"
            prop="plant"
            :style="{ width: '100%' }"
          >
            <el-select
              clearable
              v-model="queryParams.applicableFactory"
              :placeholder="$t('basic.table.applicableFactories')"
              <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: '100%' }"
              :label="
                !dayCom
                  ? $t('plan.query.selectDateRange')
                  : $t('plan.query.selectDateMonth')
              "
            >
              <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;">
              <div v-if="!dayCom">
                <el-date-picker
                  :style="{ width: '250px' }"
                  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-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")
@@ -83,7 +95,8 @@
            }}</el-button>
          </el-form-item>
        </el-col> -->
      </el-row>
        </el-row>
      </el-form>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
@@ -136,7 +149,7 @@
const { aps_factory } = proxy.useDict("aps_factory");
const loading = ref(false);
const gridRef = ref();
const height = ref(document.documentElement.clientHeight - 180 + "px;");
const height = ref(document.documentElement.clientHeight - 170 + "px;");
const headers = ref([]);
const exportData = ref([]);
const showSearch = ref(true);
@@ -236,9 +249,7 @@
  if (list) {
    return list
      .map((type) => {
        const item = aps_factory.value.find(
          (item) => item.value === type
        );
        const item = aps_factory.value.find((item) => item.value === type);
        return item ? item.label : type;
      })
      .join("");
@@ -295,7 +306,7 @@
          ],
          width: 160,
        });
      }else{
      } else {
        colList.push({
          field: "dateCol",
          title: t("plan.table.dateYearMonth"),
@@ -306,7 +317,7 @@
              title: t("plan.table.processName"),
              width: 250,
              type: "html",
            }
            },
          ],
          width: 160,
        });
@@ -364,11 +375,13 @@
          //   ? `<div class='el-badge'><sup class="el-badge__content is-fixed is-dot"></sup>${key}</div>`
          //   : key;
          if (!dayCom.value) {
            const lastIndex = key.lastIndexOf('_');
            const lastIndex = key.lastIndexOf("_");
            item[`resourceName`] = key.slice(0, lastIndex);
            item[`resourceGroupName`] = formatTypeLabelPlant([key.slice(lastIndex + 1)]);
          }else{
            item[`resourceName`] = key
            item[`resourceGroupName`] = formatTypeLabelPlant([
              key.slice(lastIndex + 1),
            ]);
          } else {
            item[`resourceName`] = key;
          }
        }
        dataList.push(item);