From c0a68d6360c6a1abd961c7e1184fee7df5cc0673 Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期四, 20 二月 2025 09:42:07 +0800
Subject: [PATCH] 中空配方tag标签显示,编辑传参

---
 UI-Project/src/views/hollow/hollowequipment.vue |  131 ++++++++++++++++++++++++++++++++++---------
 1 files changed, 103 insertions(+), 28 deletions(-)

diff --git a/UI-Project/src/views/hollow/hollowequipment.vue b/UI-Project/src/views/hollow/hollowequipment.vue
index eb0a183..64a7213 100644
--- a/UI-Project/src/views/hollow/hollowequipment.vue
+++ b/UI-Project/src/views/hollow/hollowequipment.vue
@@ -907,36 +907,36 @@
         <el-table-column prop="casOne" align="center" :label="$t('hellow.casOne')">
           <template #default="scope">  
           <el-tag  
-            :type="scope.row.casOne === 1 ? 'success' : 'danger'"  
+            :type="scope.row.casOne == 1 ? 'success' : 'danger'"
           >  
-          {{ scope.row.casOne === 1 ? $t('hellow.Y') : $t('hellow.F') }}
+          {{ scope.row.casOne == 1 ? $t('hellow.Y') : $t('hellow.F') }}
           </el-tag>  
         </template> 
         </el-table-column>
         <el-table-column prop="casTwo" align="center" :label="$t('hellow.casTwo')">
           <template #default="scope">  
           <el-tag  
-            :type="scope.row.casTwo === 1 ? 'success' : 'danger'"  
+            :type="scope.row.casTwo == 1 ? 'success' : 'danger'"  
           >  
-          {{ scope.row.casTwo === 1 ? $t('hellow.Y') : $t('hellow.F') }}
+          {{ scope.row.casTwo == 1 ? $t('hellow.Y') : $t('hellow.F') }}
           </el-tag>  
         </template> 
         </el-table-column>
         <el-table-column prop="casThree" align="center" :label="$t('hellow.casThree')">
           <template #default="scope">  
           <el-tag  
-            :type="scope.row.casThree === 1 ? 'success' : 'danger'"  
+            :type="scope.row.casThree == 1 ? 'success' : 'danger'"  
           >  
-          {{ scope.row.casThree === 1 ? $t('hellow.Y') : $t('hellow.F') }}
+          {{ scope.row.casThree == 1 ? $t('hellow.Y') : $t('hellow.F') }}
           </el-tag>  
         </template> 
         </el-table-column>
         <el-table-column prop="casFour" align="center" :label="$t('hellow.casFour')">
           <template #default="scope">  
           <el-tag  
-            :type="scope.row.casFour === 1 ? 'success' : 'danger'"  
+            :type="scope.row.casFour == 1 ? 'success' : 'danger'"  
           >  
-          {{ scope.row.casFour === 1 ? $t('hellow.Y') : $t('hellow.F') }}
+          {{ scope.row.casFour == 1 ? $t('hellow.Y') : $t('hellow.F') }}
           </el-tag>  
         </template> 
         </el-table-column>
@@ -948,31 +948,38 @@
         <el-table-column prop="intervalFrameHeightTwo" align="center" :label="$t('hellow.intervalFrameHeightTwo')" min-width="110"/>
         <el-table-column prop="intervalFrameHeightThree" align="center" :label="$t('hellow.intervalFrameHeightThree')" min-width="110"/>
         <el-table-column prop="intervalFrameHeightFour" align="center" :label="$t('hellow.intervalFrameHeightFour')" min-width="110"/>
-        <el-table-column prop="intervalFrameTypeOne" align="center" :label="$t('hellow.intervalFrameTypeOne')" min-width="110">
+        <!-- <el-table-column prop="intervalFrameTypeOne" align="center" :label="$t('hellow.intervalFrameTypeOne')" min-width="110">
           <template #default="scope">  
-         <el-tag :type="getStatusType(scope.row.intervalFrameTypeOne)">  
-          {{ getStatusText(scope.row.intervalFrameTypeOne) }}  
+         <el-tag :type="getStatusTypea(scope.row.intervalFrameTypeOne)">  
+          {{ getStatusTexta(scope.row.intervalFrameTypeOne) }}  
         </el-tag>  
       </template>
-        </el-table-column>
+        </el-table-column> -->
+        <el-table-column prop="intervalFrameTypeOne" align="center" :label="$t('hellow.intervalFrameTypeOne')" min-width="110">
+      <template #default="scope">
+        <el-tag :type="getStatusTypea(scope.row.intervalFrameTypeOne)">
+          {{ getStatusTexta(scope.row.intervalFrameTypeOne) }}
+        </el-tag>
+      </template>
+    </el-table-column>
         <el-table-column prop="intervalFrameTypeTwo" align="center" :label="$t('hellow.intervalFrameTypeTwo')" min-width="110">
           <template #default="scope">  
-         <el-tag :type="getStatusType(scope.row.intervalFrameTypeTwo)">  
-          {{ getStatusText(scope.row.intervalFrameTypeTwo) }}  
+         <el-tag :type="getStatusTypeb(scope.row.intervalFrameTypeTwo)">  
+          {{ getStatusTextb(scope.row.intervalFrameTypeTwo) }}  
         </el-tag>  
       </template>
         </el-table-column>
         <el-table-column prop="intervalFrameTypeThree" align="center" :label="$t('hellow.intervalFrameTypeThree')" min-width="110">
           <template #default="scope">  
-         <el-tag :type="getStatusType(scope.row.intervalFrameTypeThree)">  
-          {{ getStatusText(scope.row.intervalFrameTypeThree) }}  
+         <el-tag :type="getStatusTypec(scope.row.intervalFrameTypeThree)">  
+          {{ getStatusTextc(scope.row.intervalFrameTypeThree) }}  
         </el-tag>  
       </template>
         </el-table-column>
         <el-table-column prop="intervalFrameTypeFour" align="center" :label="$t('hellow.intervalFrameTypeFour')" min-width="110">
           <template #default="scope">  
-         <el-tag :type="getStatusType(scope.row.intervalFrameTypeFour)">  
-          {{ getStatusText(scope.row.intervalFrameTypeFour) }}  
+         <el-tag :type="getStatusTyped(scope.row.intervalFrameTypeFour)">  
+          {{ getStatusTextd(scope.row.intervalFrameTypeFour) }}  
         </el-tag>  
       </template>
         </el-table-column>
@@ -1149,6 +1156,7 @@
 }
 // 澶勭悊缂栬緫鎸夐挳鐐瑰嚮  
 function handleEdit(row) {  
+  window.localStorage.setItem('id', row.id)
     formulaName.value = row.formulaName;
     filmRemove.value = removalMethodMap[row.filmRemove];
     bottomRemove.value = row.bottomRemove;
@@ -1216,21 +1224,84 @@
   mulan.value = true;
   fetchmulan();
 };
-
-function getStatusType(intervalFrameType) {  
-  switch (intervalFrameType) {  
-    case 1:
+function getStatusTypea(intervalFrameTypeOne) {  
+  switch (intervalFrameTypeOne) {  
+    case "1":
       return 'success';  
-    case 5: 
+    case "5": 
       return 'warning';  
+    default:
+      return 'info'; 
   }  
 }  
-function getStatusText(intervalFrameType) {
-  switch (intervalFrameType) {
-    case 1:  
+function getStatusTexta(intervalFrameTypeOne) {
+  switch (intervalFrameTypeOne) {
+    case "1":  
       return t('hellow.intervalFrameTypeb');
-    case 5:  
+    case "5":  
       return t('hellow.intervalFrameTypea'); 
+    default:
+      return '';
+  }  
+}
+function getStatusTypeb(intervalFrameTypeTwo) {  
+  switch (intervalFrameTypeTwo) {  
+    case "1":
+      return 'success';  
+    case "5": 
+      return 'warning';  
+    default:
+      return 'info'; 
+  }  
+}  
+function getStatusTextb(intervalFrameTypeTwo) {
+  switch (intervalFrameTypeTwo) {
+    case "1":  
+      return t('hellow.intervalFrameTypeb');
+    case "5":  
+      return t('hellow.intervalFrameTypea'); 
+    default:
+      return '';
+  }  
+}
+function getStatusTypec(intervalFrameTypeThree) {  
+  switch (intervalFrameTypeThree) { 
+    case "1":
+      return 'success';  
+    case "5": 
+      return 'warning';  
+    default:
+      return 'info'; 
+  }  
+}  
+function getStatusTextc(intervalFrameTypeThree) {
+  switch (intervalFrameTypeThree) {
+    case "1":  
+      return t('hellow.intervalFrameTypeb');
+    case "5":  
+      return t('hellow.intervalFrameTypea'); 
+    default:
+      return '';
+  }  
+}
+function getStatusTyped(intervalFrameTypeFour) {  
+  switch (intervalFrameTypeFour) {  
+    case "1":
+      return 'success';  
+    case "5": 
+      return 'warning';  
+    default:
+      return 'info'; 
+  }  
+}  
+function getStatusTextd(intervalFrameTypeFour) {
+  switch (intervalFrameTypeFour) {
+    case "1":  
+      return t('hellow.intervalFrameTypeb');
+    case "5":  
+      return t('hellow.intervalFrameTypea'); 
+    default:
+      return '';
   }  
 }
 // 棰勮
@@ -1301,6 +1372,8 @@
     if (response.code == 200) {
       ElMessage.success(response.message);
       tableDatax.value = response.data;
+      console.log(response.data);
+      
       titleformulaName.value = response.data.map(item => ({ formulaId: item.id, formulaName: item.formulaName }));
     } else {
       ElMessage.error('Failed to fetch data');
@@ -1403,9 +1476,11 @@
   [t('hellow.intervalFrameTypea')]: 5,
 }
 // 涓┖閰嶆柟淇敼
-const handledit = async () => {
+ const handledit = async() => {  
+  let id = window.localStorage.getItem('id')
   try {
     const response = await request.post('/hollowGlass/hollowFormulaDetails/updateFormulaDetails',{
+      id: id,
       formulaName: formulaName.value,
       filmRemove: removalMethodMapa[filmRemove.value],
       bottomRemove: bottomRemove.value,

--
Gitblit v1.8.0