From 4f71e431f112442e522a863f706ceeff9ca840cd Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期四, 24 九月 2026 15:39:16 +0800
Subject: [PATCH] feat: 优化工序列表展示,增加已配置参数的工序排序及刷新功能
---
src/views/productionManagement/productionProcess/index.vue | 46 +++++++++++++++++++++++++++++++++++++---------
1 files changed, 37 insertions(+), 9 deletions(-)
diff --git a/src/views/productionManagement/productionProcess/index.vue b/src/views/productionManagement/productionProcess/index.vue
index ee49657..e2d1c56 100644
--- a/src/views/productionManagement/productionProcess/index.vue
+++ b/src/views/productionManagement/productionProcess/index.vue
@@ -309,8 +309,18 @@
import { getDeviceLedger } from "@/api/equipmentManagement/ledger";
import { getBaseParamList } from "@/api/basicData/parameterMaintenance.js";
- // 宸ュ簭鍒楄〃鏁版嵁
- const processValueList = ref([]);
+ // 宸ュ簭鍒楄〃鍘熷鏁版嵁
+ const processListRaw = ref([]);
+ // 宸查厤缃弬鏁扮殑宸ュ簭ID闆嗗悎锛堢粺涓�杞垚瀛楃涓叉瘮杈冿紝閬垮厤ID绫诲瀷涓嶄竴鑷达級
+ const processIdsWithParam = ref(new Set());
+ // 宸ュ簭鍒楄〃锛氬凡閰嶇疆鍙傛暟鐨勫伐搴忔帓鍦ㄥ墠闈紝鍏朵綑淇濇寔鍘熸湁椤哄簭鎺掑湪鍚庨潰
+ const processValueList = computed(() => {
+ return [...processListRaw.value].sort((a, b) => {
+ const aRank = processIdsWithParam.value.has(String(a.id)) ? 0 : 1;
+ const bRank = processIdsWithParam.value.has(String(b.id)) ? 0 : 1;
+ return aRank - bRank;
+ });
+ });
const selectedProcess = ref(null);
const processLoading = ref(false);
const deviceOptions = ref([]);
@@ -487,16 +497,32 @@
},
]);
+ // 鍒锋柊鈥滃凡閰嶇疆鍙傛暟鈥濈殑宸ュ簭鏍囪
+ const refreshProcessParamFlags = () => {
+ return getProcessParamList({})
+ .then(res => {
+ const list = res.data || [];
+ processIdsWithParam.value = new Set(
+ (Array.isArray(list) ? list : [])
+ .map(item => item.technologyOperationId)
+ .filter(id => id !== null && id !== undefined)
+ .map(id => String(id))
+ );
+ })
+ .catch(error => {
+ console.error("鑾峰彇宸ュ簭鍙傛暟鍒楄〃澶辫触", error);
+ });
+ };
+
// 鑾峰彇宸ュ簭鍒楄〃
const getProcessList = () => {
processLoading.value = true;
- getProcessListApi({ size: -1, current: -1 })
- .then(res => {
- processValueList.value = res.data.records || [];
- console.log(
- processValueList.value,
- "reprocessValueList.value==========s"
- );
+ Promise.all([
+ getProcessListApi({ size: -1, current: -1 }),
+ refreshProcessParamFlags(),
+ ])
+ .then(([res]) => {
+ processListRaw.value = res.data.records || [];
})
.catch(() => {
ElMessage.error("鑾峰彇宸ュ簭鍒楄〃澶辫触");
@@ -726,6 +752,7 @@
.then(() => {
ElMessage.success("鍒犻櫎鎴愬姛");
getParamList(selectedProcess.value.id);
+ refreshProcessParamFlags();
})
.catch(() => {
ElMessage.error("鍒犻櫎澶辫触");
@@ -773,6 +800,7 @@
ElMessage.success("娣诲姞鎴愬姛");
paramDialogVisible.value = false;
getParamList(selectedProcess.value.id);
+ refreshProcessParamFlags();
})
.catch(() => {
ElMessage.error("娣诲姞澶辫触");
--
Gitblit v1.9.3