q-koa 13.0.9 → 13.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/app.js CHANGED
@@ -2167,6 +2167,7 @@ APP.getConfig = (app) => ({
2167
2167
  'is_front',
2168
2168
  'is_control',
2169
2169
  'createdid',
2170
+ 'extra',
2170
2171
  ],
2171
2172
  },
2172
2173
  include: [
@@ -2184,6 +2185,7 @@ APP.getConfig = (app) => ({
2184
2185
  'is_front',
2185
2186
  'is_control',
2186
2187
  'createdid',
2188
+ 'extra',
2187
2189
  ],
2188
2190
  },
2189
2191
  },
@@ -186,6 +186,16 @@ exports.showTables = async (ctx) => {
186
186
 
187
187
  if (!target) throw new Error(`检查是否有${_model}/config.js`)
188
188
  const model = target.model ? target.model : _model
189
+
190
+ function getValueByModelName(target, key, defaultValue, model, _model) {
191
+ return lodash.get(
192
+ target,
193
+ key,
194
+ model !== _model
195
+ ? lodash.get(app.config[model], key, defaultValue)
196
+ : defaultValue
197
+ )
198
+ }
189
199
  return {
190
200
  modelName: _model,
191
201
  model,
@@ -200,7 +210,7 @@ exports.showTables = async (ctx) => {
200
210
  // 默认排序
201
211
  defaultOrder: lodash.get(target, 'defaultOrder', []),
202
212
  // 下拉筛选
203
- select: lodash.get(target, 'select', []),
213
+ select: getValueByModelName(target, 'select', [], model, _model),
204
214
  // 是否可以选择批量删除
205
215
  multiple: lodash.get(target, 'multiple', true),
206
216
  // 是否后台拆分sql
@@ -221,17 +231,9 @@ exports.showTables = async (ctx) => {
221
231
  lodash.get(target, 'order', [])
222
232
  ),
223
233
  // reference admin components
224
- reference: lodash.get(
225
- target,
226
- 'reference',
227
- model !== _model ? lodash.get(app.config[model], 'reference', []) : []
228
- ),
234
+ reference: getValueByModelName(target, 'reference', [], model, _model),
229
235
  // reference admin components
230
- personal: lodash.get(
231
- target,
232
- 'personal',
233
- model !== _model ? lodash.get(app.config[model], 'personal', []) : []
234
- ),
236
+ personal: getValueByModelName(target, 'personal', [], model, _model),
235
237
  // sortOrder router
236
238
  sortOrder: lodash.get(target, 'sortOrder', 1),
237
239
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "13.0.9",
3
+ "version": "13.1.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {