Browse Source

使用Utils的toChinese进行后端数据汉化

zlSun 1 year ago
parent
commit
287c708ea1
2 changed files with 2 additions and 10 deletions
  1. 1 0
      atlas/js/utils/Utils.js
  2. 1 10
      atlas/js/views/schema/SchemaLayoutView.js

+ 1 - 0
atlas/js/utils/Utils.js

@@ -538,6 +538,7 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
             case "userDescription": return "用户描述";
             case "userDescription": return "用户描述";
             case "viewExpandedText": return "视图拓展文本";
             case "viewExpandedText": return "视图拓展文本";
             case "viewOriginalText": return "视图原始文本";
             case "viewOriginalText": return "视图原始文本";
+            case "type": return "类型";
             default: return name;
             default: return name;
         }
         }
 
 

+ 1 - 10
atlas/js/views/schema/SchemaLayoutView.js

@@ -117,7 +117,7 @@ define([ "require", "backbone", "hbs!tmpl/schema/SchemaTableLayoutView_tmpl", "c
             };
             };
             if (this.schemaTableAttribute) return _.each(_.keys(this.schemaTableAttribute), function(key) {
             if (this.schemaTableAttribute) return _.each(_.keys(this.schemaTableAttribute), function(key) {
                 "position" !== key && (col[key] = {
                 "position" !== key && (col[key] = {
-                    label: that.toChinese(key),
+                    label: Utils.toChinese(key),
                     cell: "html",
                     cell: "html",
                     editable: !1,
                     editable: !1,
                     className: "searchTableName",
                     className: "searchTableName",
@@ -192,15 +192,6 @@ define([ "require", "backbone", "hbs!tmpl/schema/SchemaTableLayoutView_tmpl", "c
         onCheckDeletedEntity: function(e) {
         onCheckDeletedEntity: function(e) {
             e.target.checked ? this.deleteObj.length && this.schemaCollection.fullCollection.reset(this.activeObj.concat(this.deleteObj)) : this.schemaCollection.fullCollection.reset(this.activeObj);
             e.target.checked ? this.deleteObj.length && this.schemaCollection.fullCollection.reset(this.activeObj.concat(this.deleteObj)) : this.schemaCollection.fullCollection.reset(this.activeObj);
         },
         },
-        toChinese: function (e){
-            switch (e){
-                case "name": return "名称";
-                case "owner": return "所有者";
-                case "type": return "类型";
-                case "comment": return "备注";
-                default: return e;
-            }
-        }
     });
     });
     return SchemaTableLayoutView;
     return SchemaTableLayoutView;
 });
 });