midway-fatcms 0.0.1-beta.46 → 0.0.1-beta.47
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.
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RelatedType = exports.CrudMixUtils = void 0;
|
|
4
4
|
const keys_1 = require("../../libs/crud-pro/models/keys");
|
|
5
5
|
const MixinUtils_1 = require("../../libs/crud-pro/utils/MixinUtils");
|
|
6
|
+
const global_config_1 = require("../../libs/global-config/global-config");
|
|
6
7
|
const _ = require("lodash");
|
|
7
8
|
const functions_1 = require("../../libs/utils/functions");
|
|
8
9
|
var RelatedType;
|
|
@@ -248,15 +249,16 @@ class CrudMixUtils {
|
|
|
248
249
|
* @param columnRelation
|
|
249
250
|
*/
|
|
250
251
|
copyUserInfoToRowNoRelatedCode(row, map, columnRelation) {
|
|
251
|
-
const { targetColumns } = columnRelation;
|
|
252
|
+
const { targetColumns, sourceColumn } = columnRelation;
|
|
252
253
|
if (!targetColumns) {
|
|
253
254
|
return;
|
|
254
255
|
}
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
if (!sourceValue) {
|
|
256
|
+
const accountId = _.get(row, sourceColumn);
|
|
257
|
+
if (!accountId) {
|
|
258
258
|
return;
|
|
259
259
|
}
|
|
260
|
+
const { toFatcmsUserAccountId } = global_config_1.GLOBAL_STATIC_CONFIG.getConfig();
|
|
261
|
+
const fatcmsUserAccountId = toFatcmsUserAccountId(accountId);
|
|
260
262
|
const getValue = (code) => {
|
|
261
263
|
if (!map) {
|
|
262
264
|
return null;
|
|
@@ -266,9 +268,9 @@ class CrudMixUtils {
|
|
|
266
268
|
}
|
|
267
269
|
return map[code];
|
|
268
270
|
};
|
|
269
|
-
const isSetArray = copyByArraySourceValue(row,
|
|
271
|
+
const isSetArray = copyByArraySourceValue(row, fatcmsUserAccountId, targetColumns, getValue);
|
|
270
272
|
if (!isSetArray) {
|
|
271
|
-
copyBySingleSourceValue(row,
|
|
273
|
+
copyBySingleSourceValue(row, fatcmsUserAccountId, targetColumns, getValue);
|
|
272
274
|
}
|
|
273
275
|
}
|
|
274
276
|
}
|