egg-born-module-a-base-sync
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -163,7 +163,3 @@ const require3 = require('require3'); | ||
if (_atomClass) { | ||
if (options.mode === 'search') { | ||
tableName = _atomClass.tableNameFull || _atomClass.tableName; | ||
} else { | ||
tableName = _atomClass.tableName; | ||
} | ||
tableName = this._getTableName({ atomClass: _atomClass, mode: options.mode }); | ||
} | ||
@@ -575,2 +571,15 @@ // select | ||
_upperCaseFirstChar(str) { | ||
if (!str) return ''; | ||
return str.substring(0, 1).toUpperCase() + str.substring(1); | ||
} | ||
_getTableName({ atomClass, mode }) { | ||
mode = this._upperCaseFirstChar(mode); | ||
if (mode === 'Search') { | ||
return atomClass.tableNameSearch || atomClass.tableNameFull || atomClass.tableName; | ||
} | ||
return atomClass[`tableName${mode}`] || atomClass.tableName; | ||
} | ||
} | ||
@@ -577,0 +586,0 @@ |
@@ -147,11 +147,18 @@ const _modulesLocales = {}; | ||
const _atom = _atoms[key].info; | ||
// info | ||
const atomClass = { | ||
name: key, | ||
title: _atom.title || key, | ||
tableName: _atom.tableName || '', | ||
tableNameFull: _atom.tableNameFull, | ||
public: _atom.public ? 1 : 0, | ||
flow: _atom.flow ? 1 : 0, | ||
}; | ||
// tableName | ||
for (const key in _atom) { | ||
if (key.indexOf('tableName') === 0) { | ||
atomClass[key] = _atom[key]; | ||
} | ||
} | ||
// titleLocale | ||
atomClass.titleLocale = ctx.text(atomClass.title); | ||
// ok | ||
atomClasses[key] = atomClass; | ||
@@ -158,0 +165,0 @@ } |
{ | ||
"name": "egg-born-module-a-base-sync", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"title": "Base", | ||
@@ -5,0 +5,0 @@ "eggBornModule": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
967479
14209