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 +2 -0
- package/core/file/plugins/system/controller.js +13 -11
- package/package.json +1 -1
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:
|
|
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:
|
|
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:
|
|
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
|
|