biz9-logic 4.0.32 → 4.0.35
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 +93 -12
- package/package.json +1 -1
- package/test.js +22 -7
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -112,9 +112,9 @@ class Product{
|
|
|
112
112
|
class Service{
|
|
113
113
|
static get_test = (option) =>{
|
|
114
114
|
if(!option){
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
option = {item_count:10,get_value:false,get_item:false};
|
|
116
|
+
}
|
|
117
|
+
if(!option.item_count){
|
|
118
118
|
option.item_count=10;
|
|
119
119
|
}
|
|
120
120
|
let service = DataItem.get_new_full_item(
|
|
@@ -139,19 +139,46 @@ class Service{
|
|
|
139
139
|
};
|
|
140
140
|
static get_test_list=(option)=>{
|
|
141
141
|
if(!option){
|
|
142
|
-
option={service_count:
|
|
142
|
+
option={service_count:10};
|
|
143
143
|
}
|
|
144
144
|
let item_list=[];
|
|
145
145
|
for(let a=0;a<option.service_count;a++){
|
|
146
|
-
item_list.push(Service.get_test());
|
|
146
|
+
item_list.push(Service.get_test(option));
|
|
147
147
|
}
|
|
148
148
|
return item_list;
|
|
149
149
|
};
|
|
150
|
+
static get_test_list_by_category = (option) =>{
|
|
151
|
+
let service_list = [];
|
|
152
|
+
let category_count = 9;
|
|
153
|
+
let service_count = 19;
|
|
154
|
+
if(!option){
|
|
155
|
+
option={};
|
|
156
|
+
}
|
|
157
|
+
else{
|
|
158
|
+
if(option.category_count){
|
|
159
|
+
category_count = parseInt(option.category_count);
|
|
160
|
+
}
|
|
161
|
+
if(option.category_count){
|
|
162
|
+
service_count = parseInt(option.service_count);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
let category_list = Category.get_type_category_list(DataType.SERVICE,category_count);
|
|
166
|
+
let item_count = 0;
|
|
167
|
+
for(let a=0;a<category_list.length;a++){
|
|
168
|
+
for(let b=0;b<service_count;b++){
|
|
169
|
+
item_count++;
|
|
170
|
+
let service = Service.get_test({item_count:0,service_count:service_count,get_value:false,get_item:false});
|
|
171
|
+
service.category = category_list[Number.get_id(category_list.length-1)].title;
|
|
172
|
+
service_list.push(service);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return [category_list,service_list]
|
|
176
|
+
};
|
|
150
177
|
}
|
|
151
178
|
class Event{
|
|
152
179
|
static get_test = (option) =>{
|
|
153
180
|
if(!option){
|
|
154
|
-
option = {item_count:9,
|
|
181
|
+
option = {item_count:9,get_value:false,get_item:false};
|
|
155
182
|
}
|
|
156
183
|
if(!option.item_count){
|
|
157
184
|
option.item_count=10;
|
|
@@ -177,18 +204,45 @@ class Event{
|
|
|
177
204
|
}
|
|
178
205
|
event=Sub_Item.get_test_bind_item_sub_item(event);
|
|
179
206
|
}
|
|
180
|
-
|
|
207
|
+
return event;
|
|
181
208
|
};
|
|
182
209
|
static get_test_list=(option)=>{
|
|
183
210
|
if(!option){
|
|
184
|
-
option={
|
|
211
|
+
option={service_count:10};
|
|
185
212
|
}
|
|
186
213
|
let item_list=[];
|
|
187
214
|
for(let a=0;a<option.event_count;a++){
|
|
188
|
-
item_list.push(Event.get_test());
|
|
215
|
+
item_list.push(Event.get_test(option));
|
|
189
216
|
}
|
|
190
217
|
return item_list;
|
|
191
218
|
};
|
|
219
|
+
static get_test_list_by_category = (option) =>{
|
|
220
|
+
let event_list = [];
|
|
221
|
+
let category_count = 9;
|
|
222
|
+
let event_count = 19;
|
|
223
|
+
if(!option){
|
|
224
|
+
option={};
|
|
225
|
+
}
|
|
226
|
+
else{
|
|
227
|
+
if(option.category_count){
|
|
228
|
+
category_count = parseInt(option.category_count);
|
|
229
|
+
}
|
|
230
|
+
if(option.category_count){
|
|
231
|
+
event_count = parseInt(option.event_count);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
let category_list = Category.get_type_category_list(DataType.EVENT,category_count);
|
|
235
|
+
let item_count = 0;
|
|
236
|
+
for(let a=0;a<category_list.length;a++){
|
|
237
|
+
for(let b=0;b<event_count;b++){
|
|
238
|
+
item_count++;
|
|
239
|
+
let event = Event.get_test({item_count:0,event_count:event_count,get_value:false,get_item:false});
|
|
240
|
+
event.category = category_list[Number.get_id(category_list.length-1)].title;
|
|
241
|
+
event_list.push(event);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return [category_list,event_list]
|
|
245
|
+
};
|
|
192
246
|
}
|
|
193
247
|
class Field{
|
|
194
248
|
static get_test = (title,option) =>{
|
|
@@ -342,7 +396,7 @@ class DataType {
|
|
|
342
396
|
class Blog_Post{
|
|
343
397
|
static get_test = (option) =>{
|
|
344
398
|
if(!option){
|
|
345
|
-
option = {item_count:
|
|
399
|
+
option = {item_count:10,get_value:false,get_item:false};
|
|
346
400
|
}
|
|
347
401
|
if(!option.item_count){
|
|
348
402
|
option.item_count=10;
|
|
@@ -365,7 +419,7 @@ class Blog_Post{
|
|
|
365
419
|
};
|
|
366
420
|
static get_test_list=(option)=>{
|
|
367
421
|
if(!option){
|
|
368
|
-
option = {
|
|
422
|
+
option = {blog_post_count:10,get_value:false,get_item:false};
|
|
369
423
|
}
|
|
370
424
|
let item_list=[];
|
|
371
425
|
for(let a=0;a<option.blog_post_count;a++){
|
|
@@ -373,6 +427,33 @@ class Blog_Post{
|
|
|
373
427
|
}
|
|
374
428
|
return item_list;
|
|
375
429
|
};
|
|
430
|
+
static get_test_list_by_category = (option) =>{
|
|
431
|
+
let blog_post_list = [];
|
|
432
|
+
let category_count = 9;
|
|
433
|
+
let blog_post_count = 19;
|
|
434
|
+
if(!option){
|
|
435
|
+
option={};
|
|
436
|
+
}
|
|
437
|
+
else{
|
|
438
|
+
if(option.category_count){
|
|
439
|
+
category_count = parseInt(option.category_count);
|
|
440
|
+
}
|
|
441
|
+
if(option.category_count){
|
|
442
|
+
blog_post_count = parseInt(option.blog_post_count);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
let category_list = Category.get_type_category_list(DataType.BLOG_POST,category_count);
|
|
446
|
+
let item_count = 0;
|
|
447
|
+
for(let a=0;a<category_list.length;a++){
|
|
448
|
+
for(let b=0;b<blog_post_count;b++){
|
|
449
|
+
item_count++;
|
|
450
|
+
let blog_post = Blog_Post.get_test({item_count:0,blog_post_count:blog_post_count,get_value:false,get_item:false});
|
|
451
|
+
blog_post.category = category_list[Number.get_id(category_list.length-1)].title;
|
|
452
|
+
blog_post_list.push(blog_post);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
return [category_list,blog_post_list]
|
|
456
|
+
};
|
|
376
457
|
}
|
|
377
458
|
class Review{
|
|
378
459
|
static get_test = () =>{
|
|
@@ -585,7 +666,7 @@ class Category {
|
|
|
585
666
|
DataItem.get_new(DataType.CATEGORY,"Category "+Number.get_id()),
|
|
586
667
|
DataItem.get_new(DataType.CATEGORY,0),
|
|
587
668
|
DataItem.get_new(DataType.CATEGORY,0),
|
|
588
|
-
Field.get_test("Category " +Number.get_id()));
|
|
669
|
+
Field.get_test("Category " +Number.get_id(),{get_value:false}));
|
|
589
670
|
category.type = type
|
|
590
671
|
category_list.push(category);
|
|
591
672
|
}
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -49,28 +49,43 @@ describe("connect", () => {
|
|
|
49
49
|
/* --PAGE--END */
|
|
50
50
|
|
|
51
51
|
/* --BLOG_POST--START */
|
|
52
|
+
//let blog_post_list=Blog_Post.get_test_list({category_count:5,blog_post_count:9,get_value:false,get_item:false});
|
|
53
|
+
//let [category_list,blog_post_list]=Blog_Post.get_test_list_by_category({category_count:5,blog_post_count:9});
|
|
54
|
+
//Log.w('blog_post_list',blog_post_list);
|
|
55
|
+
//Log.w('category_list',category_list);
|
|
56
|
+
|
|
52
57
|
//let blog_post = Blog_Post.get_test({item_count:9,blog_post_count:19,get_item:true,get_value:true})
|
|
53
58
|
//let blog_post = Blog_Post.get_test()
|
|
54
|
-
//let blog_post_list=Blog_Post.get_test_list({category_count:5,blog_post_count:9,get_value:true,get_item:true});
|
|
55
59
|
//Log.w('blog_post_list',blog_post_list);
|
|
56
60
|
//Log.w("Blog_Post",blog_post);
|
|
57
61
|
//Log.w("BLog_Post_section_1",blog_post.section_1);
|
|
58
62
|
//Log.w("BLog_Post_section_1_section_1_section_1",blog_post.section_1.section_1.section_1);
|
|
59
63
|
/* --BLOG_POST--END */
|
|
60
64
|
|
|
61
|
-
|
|
62
65
|
/* --PRODUCT--START */
|
|
63
66
|
//let [category_list,product_list]=Product.get_test_list_by_category({category_count:5,product_count:9});
|
|
64
|
-
let product = Product.get_test({item_count:9,product_count:19,get_item:true,get_value:true})
|
|
65
|
-
//let product = Product.get_test()
|
|
66
67
|
//Log.w('product_list',product_list);
|
|
67
68
|
//Log.w('category_list',category_list);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
|
|
70
|
+
//let product = Product.get_test({item_count:9,product_count:19,get_item:true,get_value:true})
|
|
71
|
+
//let product = Product.get_test()
|
|
72
|
+
//Log.w("Product",product);
|
|
73
|
+
//Log.w("Product_section_1",product.section_1);
|
|
74
|
+
//Log.w("Product_section_1_section_1_section_1",product.section_1.section_1.section_1);
|
|
71
75
|
/* --PRODUCT--END */
|
|
72
76
|
|
|
77
|
+
/* --EVENT--START */
|
|
78
|
+
let event_list=Event.get_test_list({category_count:5,event_count:9,get_value:false,get_item:false});
|
|
79
|
+
//let [category_list,event_list]=Event.get_test_list_by_category({category_count:5,event_count:9});
|
|
80
|
+
Log.w('event_list',event_list);
|
|
81
|
+
//Log.w('category_list',category_list);
|
|
82
|
+
/* --EVENT--END */
|
|
83
|
+
|
|
73
84
|
/* --SERVICE--START */
|
|
85
|
+
//let service_list=Service.get_test_list({category_count:5,service_count:9,get_value:false,get_item:false});
|
|
86
|
+
//let [category_list,service_list]=Service.get_test_list_by_category({category_count:5,service_count:9});
|
|
87
|
+
//Log.w('service_list',service_list);
|
|
88
|
+
//Log.w('category_list',category_list);
|
|
74
89
|
/*
|
|
75
90
|
let service = Service.get_test({item_count:9,service_count:19,get_item:true,get_value:true})
|
|
76
91
|
//let service = Service.get_test()
|