biz9-logic 4.9.93 → 4.9.95
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 +1 -1
- package/index.js +17 -2
- package/package.json +1 -1
- package/test.js +0 -76
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -1118,7 +1118,7 @@ class Field_Logic {
|
|
|
1118
1118
|
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
1119
|
}
|
|
1120
1120
|
};
|
|
1121
|
-
static get_field_value_title = (value_type,value_id) =>{
|
|
1121
|
+
static get_field_value_title = (value_type,value_id,group_id,title) =>{
|
|
1122
1122
|
switch(value_type){
|
|
1123
1123
|
case Type.FIELD_VALUE_TEXT:
|
|
1124
1124
|
return 'text'+'_value_'+value_id;
|
|
@@ -1130,7 +1130,7 @@ class Field_Logic {
|
|
|
1130
1130
|
return 'image'+'_value_'+value_id;
|
|
1131
1131
|
break;
|
|
1132
1132
|
case Type.FIELD_VALUE_LIST:
|
|
1133
|
-
return 'list'+'_value_'+value_id;
|
|
1133
|
+
return 'list'+'_value_'+value_id +'_group_' +group_id+title;
|
|
1134
1134
|
break;
|
|
1135
1135
|
default:
|
|
1136
1136
|
return 'text'+'_value_'+value_id;
|
|
@@ -1190,6 +1190,21 @@ class Field_Logic {
|
|
|
1190
1190
|
}
|
|
1191
1191
|
return item;
|
|
1192
1192
|
}
|
|
1193
|
+
static get_value_list_group(item,value_id,group_id){
|
|
1194
|
+
let full_str = 'list_value_'+value_id+"_group_"+group_id;
|
|
1195
|
+
let new_list = [];
|
|
1196
|
+
Log.w(full_str,full_str);
|
|
1197
|
+
let count = 0;
|
|
1198
|
+
for(const prop in item){
|
|
1199
|
+
let new_item = {};
|
|
1200
|
+
if(prop.startsWith(full_str)){
|
|
1201
|
+
count = count+1;
|
|
1202
|
+
new_item[prop.replace(full_str+"_","")] = item[prop];
|
|
1203
|
+
new_list.push(new_item);
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
return new_list;
|
|
1207
|
+
}
|
|
1193
1208
|
static get_value_list(item,option){
|
|
1194
1209
|
for(let b=0;b<parseInt(option.value_count);b++){
|
|
1195
1210
|
if(option.get_blank == false){
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -29,82 +29,6 @@ const biz9_config ={
|
|
|
29
29
|
describe("connect", () => {
|
|
30
30
|
it("_connect", () => {
|
|
31
31
|
series([
|
|
32
|
-
|
|
33
|
-
function(call) {
|
|
34
|
-
let my_template = {
|
|
35
|
-
title1: "About Us",
|
|
36
|
-
title2: "aboout_link",
|
|
37
|
-
title3: "Categories",
|
|
38
|
-
title4: "category_link",
|
|
39
|
-
title5: "Create Gigs",
|
|
40
|
-
title6: "gigs_link",
|
|
41
|
-
title7: "Home",
|
|
42
|
-
title8: "home_link",
|
|
43
|
-
title9: "Service",
|
|
44
|
-
title10: "service_link",
|
|
45
|
-
title11: "Faq",
|
|
46
|
-
title12: "faq_link",
|
|
47
|
-
title13: "Contact",
|
|
48
|
-
title14: "contact_link"
|
|
49
|
-
};
|
|
50
|
-
/*
|
|
51
|
-
let my_template = {
|
|
52
|
-
title1: "About Us",
|
|
53
|
-
title2: "aboout_link",
|
|
54
|
-
title3: "about_id",
|
|
55
|
-
title4: "Create Gigs",
|
|
56
|
-
title5: "gigs_link",
|
|
57
|
-
title6: "gigs_id",
|
|
58
|
-
title7: "Service",
|
|
59
|
-
title8: "service_link",
|
|
60
|
-
title9: "service_id",
|
|
61
|
-
title10: "Contact",
|
|
62
|
-
title11: "contact_link",
|
|
63
|
-
title12: "contact_id"
|
|
64
|
-
};
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
value_count = 2;
|
|
68
|
-
let new_list = [];
|
|
69
|
-
let row_count = 1;
|
|
70
|
-
for(let a = 1; a < 90; a++){
|
|
71
|
-
if(!Str.check_is_null(my_template['title'+row_count])){
|
|
72
|
-
let item = {};
|
|
73
|
-
item['value_1'] = my_template['title'+row_count];
|
|
74
|
-
if(value_count >=2){
|
|
75
|
-
item['value_2'] = my_template['title'+Number(row_count+1)];
|
|
76
|
-
}
|
|
77
|
-
if(value_count >=3){
|
|
78
|
-
item['value_3'] = my_template['title'+Number(row_count+2)];
|
|
79
|
-
}
|
|
80
|
-
new_list.push(item);
|
|
81
|
-
row_count = row_count + value_count;
|
|
82
|
-
}else{
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/*--work
|
|
87
|
-
list_value_count = 2;
|
|
88
|
-
let title_row = 1;
|
|
89
|
-
let link_row = 2;
|
|
90
|
-
for(let a = 1; a < 900; a++){
|
|
91
|
-
if(!Str.check_is_null(my_template['title'+title_row])){
|
|
92
|
-
new_list.push(
|
|
93
|
-
{
|
|
94
|
-
value_1:my_template['title'+title_row],
|
|
95
|
-
value_2:my_template['title'+link_row]
|
|
96
|
-
});
|
|
97
|
-
title_row = title_row + list_value_count;
|
|
98
|
-
link_row = title_row + 1;
|
|
99
|
-
}else{
|
|
100
|
-
console.log('bbbbbbbbb');
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
*/
|
|
105
|
-
|
|
106
|
-
Log.w('cool',new_list);
|
|
107
|
-
},
|
|
108
32
|
function(call) {
|
|
109
33
|
console.log('CONNECT-BASE-START');
|
|
110
34
|
let data_type = DataType.PRODUCT;
|