midway-fatcms 0.0.1-beta.50 → 0.0.1-beta.52
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.
|
@@ -232,7 +232,10 @@ let CrudStdService = class CrudStdService extends ApiBaseService_1.ApiBaseServic
|
|
|
232
232
|
return;
|
|
233
233
|
}
|
|
234
234
|
const partialConditionObj = (0, functions_1.parseJsonObject)(partialCondition);
|
|
235
|
-
Object.
|
|
235
|
+
if (Object.keys(partialConditionObj).length > 0) {
|
|
236
|
+
// partialConditionObj 配置的是 condition.xxxx = xx的形式
|
|
237
|
+
_.merge(cfgModel.updateCfg, partialConditionObj);
|
|
238
|
+
}
|
|
236
239
|
}
|
|
237
240
|
async fixSubmitDataByKeepSubmitData(params, cfgModel, appInfo, arg3) {
|
|
238
241
|
if (cfgModel.sqlSimpleName === keys_1.KeysOfSimpleSQL.SIMPLE_INSERT || cfgModel.sqlSimpleName === keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE) {
|
|
@@ -245,8 +248,8 @@ let CrudStdService = class CrudStdService extends ApiBaseService_1.ApiBaseServic
|
|
|
245
248
|
const keepSubmitDataByGlobalStr = _.get(appInfo, 'stdCrudCfgObj.othersSetting.values.keepSubmitData');
|
|
246
249
|
const keepSubmitDataByGlobal = (0, functions_1.parseJsonObject)(keepSubmitDataByGlobalStr);
|
|
247
250
|
//3. 合并
|
|
248
|
-
|
|
249
|
-
|
|
251
|
+
_.merge(submitData, keepSubmitDataByButton);
|
|
252
|
+
_.merge(submitData, keepSubmitDataByGlobal);
|
|
250
253
|
}
|
|
251
254
|
}
|
|
252
255
|
async fixDataFieldTypeBySqlTableField(params, cfgModel, appInfo, arg3) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fixCfgModel = void 0;
|
|
4
|
+
const _ = require("lodash");
|
|
4
5
|
const bizmodels_1 = require("../../models/bizmodels");
|
|
5
6
|
const keys_1 = require("../../libs/crud-pro/models/keys");
|
|
6
7
|
function isSimpleQuery(sqlSimpleName) {
|
|
@@ -71,33 +72,33 @@ function fixCfgModel(cfgModel) {
|
|
|
71
72
|
// 查询语句
|
|
72
73
|
if (isSimpleQuery(sqlSimpleName)) {
|
|
73
74
|
const updateCfgObj = buildUpdateCfgBy(conditionCfgArray, 'condition.created'); // 查询用户本人创建的
|
|
74
|
-
|
|
75
|
+
_.merge(cfgModel.updateCfg, updateCfgObj);
|
|
75
76
|
}
|
|
76
77
|
// 删除语句
|
|
77
78
|
if (sqlSimpleName === keys_1.KeysOfSimpleSQL.SIMPLE_DELETE) {
|
|
78
79
|
const updateCfgObj = buildUpdateCfgBy(conditionCfgArray, 'condition.created'); // 删除用户本人创建的
|
|
79
|
-
|
|
80
|
+
_.merge(cfgModel.updateCfg, updateCfgObj);
|
|
80
81
|
}
|
|
81
82
|
// 插入语句
|
|
82
83
|
if (sqlSimpleName === keys_1.KeysOfSimpleSQL.SIMPLE_INSERT) {
|
|
83
84
|
const updateCfgObj1 = buildUpdateCfgBy(dataCfgArray, 'data.created');
|
|
84
|
-
|
|
85
|
+
_.merge(cfgModel.updateCfg, updateCfgObj1);
|
|
85
86
|
}
|
|
86
87
|
// 更新语句
|
|
87
88
|
if (sqlSimpleName === keys_1.KeysOfSimpleSQL.SIMPLE_UPDATE) {
|
|
88
89
|
const updateCfgObj1 = buildUpdateCfgBy(dataCfgArray, 'data.modified');
|
|
89
90
|
const updateCfgObj2 = buildUpdateCfgBy(conditionCfgArray, 'condition.created'); // 更新用户本人创建的
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
_.merge(cfgModel.updateCfg, updateCfgObj1);
|
|
92
|
+
_.merge(cfgModel.updateCfg, updateCfgObj2);
|
|
92
93
|
}
|
|
93
94
|
// 插入或更新
|
|
94
95
|
if (sqlSimpleName === keys_1.KeysOfSimpleSQL.SIMPLE_INSERT_OR_UPDATE || sqlSimpleName === keys_1.KeysOfSimpleSQL.SIMPLE_INSERT_ON_DUPLICATE_UPDATE) {
|
|
95
96
|
const updateCfgObj1 = buildUpdateCfgBy(dataCfgArray, 'data.created');
|
|
96
97
|
const updateCfgObj2 = buildUpdateCfgBy(dataCfgArray, 'data.modified');
|
|
97
98
|
const updateCfgObj3 = buildUpdateCfgBy(conditionCfgArray, 'condition.created'); // 更新用户本人创建的
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
_.merge(cfgModel.updateCfg, updateCfgObj1);
|
|
100
|
+
_.merge(cfgModel.updateCfg, updateCfgObj2);
|
|
101
|
+
_.merge(cfgModel.updateCfg, updateCfgObj3);
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
exports.fixCfgModel = fixCfgModel;
|