Browse Source

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

zlSun 11 tháng trước cách đây
mục cha
commit
287c708ea1
2 tập tin đã thay đổi với 2 bổ sung10 xóa
  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 "viewExpandedText": return "视图拓展文本";
             case "viewOriginalText": return "视图原始文本";
+            case "type": return "类型";
             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) {
                 "position" !== key && (col[key] = {
-                    label: that.toChinese(key),
+                    label: Utils.toChinese(key),
                     cell: "html",
                     editable: !1,
                     className: "searchTableName",
@@ -192,15 +192,6 @@ define([ "require", "backbone", "hbs!tmpl/schema/SchemaTableLayoutView_tmpl", "c
         onCheckDeletedEntity: function(e) {
             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;
 });