biz9-logic 4.9.95 → 4.9.99
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/biz9_config +2 -2
- package/index.js +46 -2
- package/package.json +1 -1
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -1103,6 +1103,50 @@ class Event_Logic {
|
|
|
1103
1103
|
};
|
|
1104
1104
|
}
|
|
1105
1105
|
class Field_Logic {
|
|
1106
|
+
static get_item_field_value_list = (data) => {
|
|
1107
|
+
let max_value_id = 1;
|
|
1108
|
+
let max_group_id = 1;
|
|
1109
|
+
let full_prop_str = "";
|
|
1110
|
+
for(const prop in data){
|
|
1111
|
+
full_prop_str = String(prop + " "+full_prop_str);
|
|
1112
|
+
}
|
|
1113
|
+
for(let a = 1; a < 30; a++){
|
|
1114
|
+
const exists = Str.check_if_str_exist(full_prop_str,"list_value_"+a);
|
|
1115
|
+
if(exists){
|
|
1116
|
+
if(a>max_value_id){
|
|
1117
|
+
max_value_id = a;
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
for(let b = 1; b < 30; b++){
|
|
1121
|
+
const exists = Str.check_if_str_exist(full_prop_str,"list_value_"+a+"_group_"+b);
|
|
1122
|
+
if(exists){
|
|
1123
|
+
if(b>max_group_id){
|
|
1124
|
+
max_group_id = b;
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
for(let a = 1; a <= max_value_id+1; a++){
|
|
1130
|
+
let sub_check_str = 'list_value_'+a;
|
|
1131
|
+
data[sub_check_str] = [];
|
|
1132
|
+
for(let b = 1; b < max_group_id+1; b++){
|
|
1133
|
+
let full_sub_check_str = sub_check_str+"_group_"+b;
|
|
1134
|
+
let new_item = {};
|
|
1135
|
+
for(const sub_prop in data){
|
|
1136
|
+
if(sub_prop.startsWith(full_sub_check_str)){
|
|
1137
|
+
new_item[sub_prop.replace(full_sub_check_str+"_","")] = data[sub_prop];
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
if(!Obj.check_is_empty(new_item)){
|
|
1141
|
+
data[sub_check_str].push(new_item);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
if(data[sub_check_str].length<=0){
|
|
1145
|
+
delete data[sub_check_str];
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
return data;
|
|
1149
|
+
}
|
|
1106
1150
|
static get_item_field_value_type_list = () => {
|
|
1107
1151
|
return [
|
|
1108
1152
|
{value:'text',label:'Text'},
|
|
@@ -1118,7 +1162,7 @@ class Field_Logic {
|
|
|
1118
1162
|
return !Str.check_is_null(item[Field_Logic.get_field_value_title(value_type,value_id)]) ? item[Field_Logic.get_field_value_title(value_type,value_id)] : []
|
|
1119
1163
|
}
|
|
1120
1164
|
};
|
|
1121
|
-
static get_field_value_title = (value_type,value_id,group_id,
|
|
1165
|
+
static get_field_value_title = (value_type,value_id,group_id,sub_field_title) =>{
|
|
1122
1166
|
switch(value_type){
|
|
1123
1167
|
case Type.FIELD_VALUE_TEXT:
|
|
1124
1168
|
return 'text'+'_value_'+value_id;
|
|
@@ -1130,7 +1174,7 @@ class Field_Logic {
|
|
|
1130
1174
|
return 'image'+'_value_'+value_id;
|
|
1131
1175
|
break;
|
|
1132
1176
|
case Type.FIELD_VALUE_LIST:
|
|
1133
|
-
return 'list'+'_value_'+value_id +'_group_' +group_id+
|
|
1177
|
+
return 'list'+'_value_'+value_id +'_group_' +group_id+"_"+Str.get_title_url(sub_field_title);
|
|
1134
1178
|
break;
|
|
1135
1179
|
default:
|
|
1136
1180
|
return 'text'+'_value_'+value_id;
|