biz9-logic 4.9.33 → 4.9.36
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 +9 -8
- package/package.json +1 -1
- package/test.js +8 -33
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -141,6 +141,8 @@ class Demo_Logic {
|
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
if(option.get_item){
|
|
144
|
+
let full_item_list = [];
|
|
145
|
+
|
|
144
146
|
let item_title_list = [];
|
|
145
147
|
if(option.items){
|
|
146
148
|
item_title_list = option.items.split(',');
|
|
@@ -150,13 +152,12 @@ class Demo_Logic {
|
|
|
150
152
|
item_title_list.push(title+" " +Type.get_title(item.categorys[Num.get_id(option.category_count)].category)+" "+ b);
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
|
-
for(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
let child_item = Item_Logic.get_new(item,option.item_data_type);
|
|
155
|
+
for(const child_item_title of item_title_list){
|
|
156
|
+
const cat_item = item.categorys[Num.get_id(option.category_count)];
|
|
157
|
+
if(!cat_item.items){
|
|
158
|
+
cat_item.items = [];
|
|
159
|
+
}
|
|
160
|
+
let child_item = Item_Logic.get_new(child_item_title,option.item_data_type);
|
|
160
161
|
if(option.item_data_type == DataType.PRODUCT){
|
|
161
162
|
child_item.cost = Num.get_id(9000);
|
|
162
163
|
child_item.old_cost = Num.get_id(90000);
|
|
@@ -167,8 +168,8 @@ class Demo_Logic {
|
|
|
167
168
|
child_item.description = "Description "+String(Num.get_id());
|
|
168
169
|
child_item.note = Field_Logic.get_test_note(),
|
|
169
170
|
cat_item.items.push(child_item);
|
|
171
|
+
full_item_list.push(child_item);
|
|
170
172
|
}
|
|
171
|
-
}
|
|
172
173
|
}
|
|
173
174
|
return item;
|
|
174
175
|
};
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -44,43 +44,18 @@ describe("connect", () => {
|
|
|
44
44
|
let option = {get_category:true,category_count:category_count,category_data_type:category_type,categorys:val_category_title?val_category_title:null,
|
|
45
45
|
get_item:true,item_count:item_count,item_data_type:category_type,items:null}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
cat_max = category_title_list.length;
|
|
49
|
-
}else{
|
|
50
|
-
if(category_count.length){
|
|
51
|
-
cat_max = category_count;
|
|
52
|
-
}else{
|
|
53
|
-
cat_max = 0;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
option.item_count = item_count / cat_max;
|
|
57
|
-
for(const item of category_type_title_list){
|
|
47
|
+
for(const item of category_type_title_list){
|
|
58
48
|
post_type_list.push(
|
|
59
49
|
Demo_Logic.get_new_type(item,option));
|
|
60
50
|
}
|
|
61
51
|
|
|
62
|
-
Log.w('post_type_list',post_type_list);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
let post_item_count = 0;
|
|
70
|
-
for(const item_type of post_type_list){
|
|
71
|
-
for(const item_cat of item_type.categorys){
|
|
72
|
-
post_category_count = post_category_count+1;
|
|
73
|
-
if(!item_cat.items){
|
|
74
|
-
item_cat.items = [];
|
|
75
|
-
}
|
|
76
|
-
for(const item_item of item_cat.items){
|
|
77
|
-
post_item_count = post_item_count+1;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
let data = await App_User_Data.post(Url.CMS_DEMO_POST,{data_type:category_type,type_list:post_type_list,option:option});
|
|
82
|
-
alert_prop.current.showValidation("Demo OK. "+ post_type_list.length + " Types "+ category_count+" Categorys "+" "+item_count+" " +" Items");
|
|
83
|
-
*/
|
|
52
|
+
Log.w('44-post_type_list',post_type_list);
|
|
53
|
+
Log.w('55-post_type_list-a',post_type_list.length);
|
|
54
|
+
Log.w('55-post_type_list-b',post_type_list[0].categorys[0].items.length);
|
|
55
|
+
Log.w('55-post_type_list-b',post_type_list[0].categorys[1].items.length);
|
|
56
|
+
Log.w('55-post_type_list-b',post_type_list[0].categorys[2].items.length);
|
|
57
|
+
Log.w('55-post_type_list-b',post_type_list[0].categorys[3].items.length);
|
|
58
|
+
Log.w('55-post_type_list-b',post_type_list[0].categorys[4].items.length);
|
|
84
59
|
console.log('CONNECT-CMS-DEMO-SUCCESS');
|
|
85
60
|
|
|
86
61
|
},
|