biz9-logic 4.8.59 → 4.8.64
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 +60 -2
- package/package.json +1 -1
- package/test.js +19 -4
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -43,6 +43,54 @@ class Item_Logic {
|
|
|
43
43
|
}
|
|
44
44
|
return item_list;
|
|
45
45
|
}
|
|
46
|
+
static get_search_query(search){
|
|
47
|
+
let url = "";
|
|
48
|
+
if(search.data_type){
|
|
49
|
+
url = url + "&data_type="+search.data_type;
|
|
50
|
+
}else{
|
|
51
|
+
url = url + "&data_type="+DataType.BLANK;
|
|
52
|
+
}
|
|
53
|
+
if(search.sort_by_key){
|
|
54
|
+
url = url + "&sort_by_key="+search.sort_by_key;
|
|
55
|
+
}else{
|
|
56
|
+
url = url + "&sort_by_key=title";
|
|
57
|
+
}
|
|
58
|
+
if(search.sort_by_value){
|
|
59
|
+
url = url + "&sort_by_value="+search.sort_by_value;
|
|
60
|
+
}else{
|
|
61
|
+
url = url + "&sort_by_value=-1";
|
|
62
|
+
}
|
|
63
|
+
if(search.page_current){
|
|
64
|
+
url = url + "&page_current="+search.page_current;
|
|
65
|
+
}else{
|
|
66
|
+
url = url + "&page_current=1";
|
|
67
|
+
}
|
|
68
|
+
if(search.page_size){
|
|
69
|
+
url = url + "&page_size="+search.page_size;
|
|
70
|
+
}else{
|
|
71
|
+
url = url + "&page_size=9";
|
|
72
|
+
}
|
|
73
|
+
for(let a=1;a<19;a++){
|
|
74
|
+
if(!Str.check_is_null(search['filter_key_'+String(a)])){
|
|
75
|
+
url = url + "&filter_key_"+String(a)+"="+ search['filter_key_'+String(a)];
|
|
76
|
+
url = url + "&filter_value_"+String(a)+"="+ search['filter_value_'+String(a)];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return url;
|
|
80
|
+
}
|
|
81
|
+
static get_search_by_query(query){
|
|
82
|
+
let filter = [];
|
|
83
|
+
let sort_by = [];
|
|
84
|
+
if(query['sort_by_key']){
|
|
85
|
+
sort_by[query['sort_by_key']] = query['sort_by_value'];
|
|
86
|
+
}
|
|
87
|
+
for(let a = 0; a < 19; a++){
|
|
88
|
+
if(query['filter_key_'+a]){
|
|
89
|
+
filter[query['filter_key_'+a]] = query['filter_value_'+a]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return Item_Logic.get_search(query.data_type,filter,sort_by,query.page_current,query.page_size);
|
|
93
|
+
}
|
|
46
94
|
static get_search = (data_type,filter,sort_by,page_current,page_size) => {
|
|
47
95
|
return {data_type:data_type,filter:filter,sort_by:sort_by,page_current:page_current,page_size:page_size};
|
|
48
96
|
}
|
|
@@ -60,9 +108,18 @@ class Template_Logic {
|
|
|
60
108
|
DataItem.get_new(DataType.TEMPLATE,0),
|
|
61
109
|
Field_Logic.get_test(title,option));
|
|
62
110
|
if(option.get_item){
|
|
63
|
-
|
|
111
|
+
let title_list = ['Header','Body','Footer','Navigation']
|
|
112
|
+
//template.items = Sub_Item_Logic.get_test_list(template,template,option);
|
|
113
|
+
template.items = [];
|
|
114
|
+
for(let a = 0; a<title_list.length;a++){
|
|
115
|
+
let item = Sub_Item_Logic.get_test(title_list[a],template,template,option);
|
|
116
|
+
item.items = Sub_Item_Logic.get_test_list(item,template,option);
|
|
117
|
+
item = Sub_Item_Logic.bind_parent_child_list(item,item.items);
|
|
118
|
+
template.items.push(item);
|
|
119
|
+
//template.items.push(Sub_Item_Logic.get_test(title_list[a],template,template,option));
|
|
120
|
+
}
|
|
64
121
|
if(option.get_item_bind){
|
|
65
|
-
|
|
122
|
+
template = Sub_Item_Logic.bind_parent_child_list(template,template.items);
|
|
66
123
|
}
|
|
67
124
|
}
|
|
68
125
|
return template;
|
|
@@ -460,6 +517,7 @@ class Field_Logic {
|
|
|
460
517
|
option.get_value = option.get_value ? true : false;
|
|
461
518
|
option.get_item = option.get_item ? true : false;
|
|
462
519
|
option.get_blank = option.get_blank ? true : false;
|
|
520
|
+
option.get_item_bind = option.get_item_bind ? true : true;
|
|
463
521
|
option.value_count = option.value_count ? option.value_count : 9;
|
|
464
522
|
option.section_count = option.section_count ? option.section_count : 9;
|
|
465
523
|
option.item_count = option.item_count ? option.item_count : 9;
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -82,6 +82,21 @@ describe("connect", () => {
|
|
|
82
82
|
|
|
83
83
|
/* --SEARCH--START */
|
|
84
84
|
//console.log(Url.get_search(DataType.BLOG_POST,{title:-1},{cool:-1},1,10));
|
|
85
|
+
|
|
86
|
+
/*
|
|
87
|
+
let data_type = DataType.PRODUCT;
|
|
88
|
+
let search_filter_key_1 = 'key1';
|
|
89
|
+
let search_filter_value_1 = 'value1';
|
|
90
|
+
let search_filter_key_2 = 'key2';
|
|
91
|
+
let search_filter_value_2 = 'value2';
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
//let query = "?app_id=19&data_type="+data_type+"&sort_by={}&page_current=1&page_size=99&search_filter_key_1="+search_filter_key_1+"&search_filter_value_1="+search_filter_value_1+"&search_filter_key_2="+search_filter_key_2+"&search_filter_value_2="+search_filter_value_2;
|
|
96
|
+
|
|
97
|
+
//Log.w('query',query);
|
|
98
|
+
|
|
99
|
+
|
|
85
100
|
/* --SEARCH--END */
|
|
86
101
|
|
|
87
102
|
/* --CATEGORY--START */
|
|
@@ -172,8 +187,8 @@ describe("connect", () => {
|
|
|
172
187
|
//let product = Product_Logic.get_test({fields:["cool_beanj]})
|
|
173
188
|
//Log.w("product",product);
|
|
174
189
|
//let product_list = Product_Logic.get_test_list({product_count:10,get_blank:true});
|
|
175
|
-
let product_list = Product_Logic.get_test_list();
|
|
176
|
-
Log.w('product_list',product_list);
|
|
190
|
+
//let product_list = Product_Logic.get_test_list();
|
|
191
|
+
//Log.w('product_list',product_list);
|
|
177
192
|
//let [category_list,product_list]=Product.get_test_list_by_category({category_count:5,product_count:9});
|
|
178
193
|
//Log.w('category_list',category_list);
|
|
179
194
|
|
|
@@ -198,11 +213,11 @@ describe("connect", () => {
|
|
|
198
213
|
|
|
199
214
|
/* --TEMPLATE--START */
|
|
200
215
|
//let template = Template_Logic.get_test("Primary",{});
|
|
201
|
-
|
|
216
|
+
let template = Template_Logic.get_test("Primary",{get_value:true,get_item:true});
|
|
202
217
|
/*
|
|
203
218
|
let template_item_list = Template_Logic.get_test("Primary",template,template,{get_value:false,get_item:false,item_count:2});
|
|
204
219
|
*/
|
|
205
|
-
|
|
220
|
+
Log.w('template',template);
|
|
206
221
|
//Log.w('template_item_list',template_item_list);
|
|
207
222
|
/* --TEMPLATE--END */
|
|
208
223
|
|