|
@@ -666,6 +666,7 @@ function setupFunc(obj, ownRawObj, baseDir) {
|
|
|
obj.myOwnRawDataObj = ownRawObj;
|
|
|
obj.baseDir = baseDir;
|
|
|
obj.getProperty = ext_getProperty;
|
|
|
+ obj.getSplitProperty = ext_getSplitProperty;
|
|
|
obj.getPicProperty = ext_getPicProperty;
|
|
|
// obj.getPropertyByForeignId = ext_getPropertyByForeignId;
|
|
|
obj.getArrayProperty = ext_getArrayValues;
|
|
@@ -769,6 +770,21 @@ function ext_getProperty(dataKey, propKey) {
|
|
|
return rst;
|
|
|
}
|
|
|
|
|
|
+function ext_getSplitProperty(dataKey, propKey, splitChar, index, dftValue) {
|
|
|
+ const rst = ext_getProperty(dataKey, propKey);
|
|
|
+ for (let idx = 0; idx < rst.length; idx++) {
|
|
|
+ if (typeof rst[idx] === 'string') {
|
|
|
+ const splitArr = rst[idx].split(splitChar);
|
|
|
+ if (splitArr.length > index) {
|
|
|
+ rst[idx] = splitArr[index];
|
|
|
+ } else {
|
|
|
+ rst[idx] = dftValue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+}
|
|
|
+
|
|
|
async function ext_getPicProperty(dataKey, propKey, isPath) {
|
|
|
const rst = [];
|
|
|
const parentObj = this;
|