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/pipeProduceStatics/index.vue | 265 +++++++++++++++++++++++++++++++++-------------------
1 files changed, 169 insertions(+), 96 deletions(-)
diff --git a/src/views/mainPlan/pipeProduceStatics/index.vue b/src/views/mainPlan/pipeProduceStatics/index.vue
index 6c54a9d..3b57414 100644
--- a/src/views/mainPlan/pipeProduceStatics/index.vue
+++ b/src/views/mainPlan/pipeProduceStatics/index.vue
@@ -6,52 +6,97 @@
ref="queryRef"
:inline="true"
v-show="showSearch"
- :label-width="locale === 'zh' ? '68px' : '134px'"
+ label-position="left"
>
- <el-row type="flex" justify="left">
- <el-form-item :label="$t('plan.query.statistical')">
- <el-select
- v-model="queryParams.searchType"
- style="width: 200px"
- 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-form-item :label="$t('plan.query.selectDateRange')">
- <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-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-row>
+ <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-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')
+ "
+ >
+ <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")
+ }}</el-button>
+ <el-button icon="Refresh" @click="resetQuery">{{
+ $t("common.common.reset")
+ }}</el-button>
+ </el-form-item>
+ </el-col> -->
+ </el-row>
+ </el-form>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
@@ -75,7 +120,11 @@
>{{ $t("common.common.update") }}</el-button
>
</el-col>
- <right-toolbar @queryTable="handleQuery" :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> -->
@@ -86,7 +135,7 @@
</div>
</template>
-<script setup name="gasProduceStatics">
+<script setup name="PipeProduceStatics">
import {
listUpdateGasProduceStatics,
listGasProduceStatics,
@@ -97,7 +146,7 @@
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 height = ref(document.documentElement.clientHeight - 180 + "px;");
@@ -154,7 +203,14 @@
},
];
queryParams.value.searchType = t("plan.options.monthlyStatic");
- handleQuery();
+ if (
+ (!queryParams.value.monthRange && dayCom.value == false) ||
+ (!queryParams.value.monthDays && dayCom.value == true)
+ ) {
+ return;
+ }
+ // queryParams.value.pageNum = 1;
+ getPipeList();
},
{ immediate: true, deep: true }
);
@@ -189,6 +245,17 @@
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 getPipeList() {
let rowKey = 0;
@@ -209,36 +276,53 @@
major: "piping",
}).then((response) => {
const colList = [];
- let headersOne = [];
- let headersTwo = [];
+ // let headersOne = [];
+ // let headersTwo = [];
if (response.code == "200") {
if (!response.data.planTitle) {
loading.value = false;
return;
}
- headersOne.push(t("plan.table.dateYearMonth"));
- headersTwo.push(t("plan.table.processName"));
- 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,
- });
+ // headersOne.push(t("plan.table.dateYearMonth"));
+ // headersTwo.push(t("plan.table.processName"));
+ if (!dayCom.value) {
+ colList.push({
+ field: "dateCol",
+ title: t("plan.table.dateYearMonth"),
+ fixed: "left",
+ children: [
+ {
+ field: `resourceName`,
+ title: t("plan.table.processName"),
+ width: 250,
+ type: "html",
+ },
+ {
+ field: `resourceGroupName`,
+ title: t("plan.table.applicableFactories"),
+ width: 250,
+ type: "html",
+ },
+ ],
+ 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}`,
@@ -264,27 +348,16 @@
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) => {
@@ -296,24 +369,21 @@
listItem.requireTimes,
listItem.capacityLoad
);
- // 0-100 缁胯壊锛�101-120榛勮壊锛屽ぇ浜�120绾㈣壊
- // 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;
- item[`resourceName`] = 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);
dataList.push(item);
});
@@ -435,6 +505,9 @@
// getList();
</script>
<style lang="scss" scoped>
+.column-with-margin {
+ margin-right: 0px;
+}
.box_container {
width: 100%;
margin: 20px auto;
--
Gitblit v1.9.3