From 9f658fb63d1c219ae65ffcf13af6efbff5179b00 Mon Sep 17 00:00:00 2001
From: vincentlu <t1341870251@gmail.com>
Date: 星期四, 05 二月 2026 10:46:10 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/page/loc/compDirect.js |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/zy-acs-flow/src/page/loc/compDirect.js b/zy-acs-flow/src/page/loc/compDirect.js
index f9c1bee..697ab1e 100644
--- a/zy-acs-flow/src/page/loc/compDirect.js
+++ b/zy-acs-flow/src/page/loc/compDirect.js
@@ -1,21 +1,15 @@
-const compDirectMap = {
-    1: 'page.loc.enums.compDirect.left',
-    2: 'page.loc.enums.compDirect.right',
-    3: 'page.loc.enums.compDirect.forward',
-};
-
 export const compDirectChoices = [
-    { id: 1, name: compDirectMap[1] },
-    { id: 2, name: compDirectMap[2] },
-    { id: 3, name: compDirectMap[3] },
+    { id: 1, name: 'page.loc.enums.compDirect.left' },
+    { id: 2, name: 'page.loc.enums.compDirect.right' },
+    { id: 3, name: 'page.loc.enums.compDirect.forward' },
 ];
 
 export const getCompDirectLabel = (translate, compDirect, fallback = '-') => {
-    const key = compDirectMap[compDirect];
-    if (!key) {
+    const choice = compDirectChoices.find((item) => item.id === compDirect);
+    if (!choice) {
         return fallback;
     }
     return typeof translate === 'function'
-        ? translate(key, { _: fallback })
-        : key;
+        ? translate(choice.name, { _: fallback })
+        : choice.name;
 };

--
Gitblit v1.9.1