biz9-logic 4.8.10 → 4.8.21
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 +424 -394
- package/package.json +1 -1
- package/test.js +139 -81
package/index.js
CHANGED
|
@@ -20,200 +20,169 @@ class TemplateType {
|
|
|
20
20
|
static FOOTER='footer';
|
|
21
21
|
}
|
|
22
22
|
class Item_Logic {
|
|
23
|
-
static
|
|
24
|
-
if(option==null){
|
|
25
|
-
option ={get_value:false};
|
|
26
|
-
}
|
|
27
|
-
if(option.get_value == null){
|
|
28
|
-
option.get_value = false;
|
|
29
|
-
}
|
|
23
|
+
static get_test = (title,data_type,id,option)=>{
|
|
30
24
|
if(!data_type){
|
|
31
25
|
data_type=DataType.BLANK;
|
|
32
26
|
}
|
|
33
27
|
if(!id){
|
|
34
28
|
id=0;
|
|
35
29
|
}
|
|
36
|
-
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
item_test.sub_note='sub_note_'+_id;
|
|
46
|
-
item_test.note='note_'+_id;
|
|
47
|
-
item_test.category='category_'+_id;
|
|
48
|
-
item_test.group_id=_id;
|
|
49
|
-
if(option.get_value){
|
|
50
|
-
for(let b=1;b<10;b++){
|
|
51
|
-
item_test['value_'+String(b)] = 'value ' + String(b);
|
|
52
|
-
}
|
|
30
|
+
option = Field_Logic.get_option(data_type,option?option:{});
|
|
31
|
+
let item = DataItem.get_new_full_item(
|
|
32
|
+
DataItem.get_new(data_type,0),
|
|
33
|
+
DataItem.get_new(data_type,0),
|
|
34
|
+
DataItem.get_new(data_type,0),
|
|
35
|
+
Field_Logic.get_test(title,option));
|
|
36
|
+
|
|
37
|
+
if(option.get_item){
|
|
38
|
+
item.items = Sub_Item_Logic.get_test_item_list(item,item,option);
|
|
53
39
|
}
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
-
item_test.author = "Author "+String(Number.get_id());
|
|
57
|
-
item_test.tag = "tag 1, tag 2, tag 3";
|
|
58
|
-
}else if(data_type == DataType.PRODUCT)
|
|
59
|
-
{
|
|
60
|
-
item_test.cost = String(Number.get_id()) + "." + String(Number.get_id());
|
|
61
|
-
item_test.old_cost = String(Number.get_id()) + "." + String(Number.get_id());
|
|
62
|
-
item_test.type = "Type "+String(Number.get_id());
|
|
63
|
-
item_test.sub_type = "Sub Type "+String(Number.get_id());
|
|
64
|
-
item_test.stock = String(Number.get_id(3-1));
|
|
65
|
-
}else if(data_type == DataType.SERVICE)
|
|
66
|
-
{
|
|
67
|
-
item_test.cost = String(Number.get_id()) + "." + String(Number.get_id());
|
|
68
|
-
item_test.old_cost = String(Number.get_id()) + "." + String(Number.get_id());
|
|
69
|
-
item_test.type = "Type "+String(Number.get_id());
|
|
70
|
-
item_test.sub_type = "Sub Type "+String(Number.get_id());
|
|
71
|
-
item_test.stock = String(Number.get_id(3-1));
|
|
72
|
-
}else if(data_type == DataType.EVENT){
|
|
73
|
-
item_test.cost = String(Number.get_id()) + "." + String(Number.get_id());
|
|
74
|
-
item_test.old_cost = String(Number.get_id()) + "." + String(Number.get_id());
|
|
75
|
-
item_test.date = String(String(Number.get_id(2030)) + "-" + String(Number.get_id(13)) + "-" + String(Number.get_id(30))).trim();
|
|
76
|
-
item_test.time = String(Number.get_id(24)) + ":" + String(Number.get_id(59));
|
|
77
|
-
item_test.website = "Website "+String(Number.get_id());
|
|
78
|
-
item_test.location = "Location "+String(Number.get_id());
|
|
79
|
-
item_test.meeting_link = "Meeting Link "+String(Number.get_id());
|
|
80
|
-
item_test.stock = String(Number.get_id(3-1));
|
|
81
|
-
}
|
|
82
|
-
return item_test;
|
|
40
|
+
return item;
|
|
83
41
|
}
|
|
84
|
-
static
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
option = {item_count:9,get_value:false};
|
|
90
|
-
}
|
|
91
|
-
if(option.item_count==null){
|
|
92
|
-
option.item_count = 10;
|
|
93
|
-
}
|
|
94
|
-
if(option.get_value==null){
|
|
95
|
-
option.get_value = false;
|
|
96
|
-
}
|
|
97
|
-
let new_list = [];
|
|
98
|
-
for(let a=1;a<option.item_count;a++){
|
|
99
|
-
new_list.push(DataItem.get_new(data_type,0,Item_Logic.get_test_item(data_type,0,option)));
|
|
42
|
+
static get_test_list = (data_type,option) =>{
|
|
43
|
+
option = Field_Logic.get_option(data_type,option?option:{});
|
|
44
|
+
let item_list = [];
|
|
45
|
+
for(let a=0;a<option.item_count;a++){
|
|
46
|
+
item_list.push(Item_Logic.get_test("Item " +a,data_type,option));
|
|
100
47
|
}
|
|
101
|
-
return
|
|
48
|
+
return item_list;
|
|
102
49
|
}
|
|
103
50
|
}
|
|
104
51
|
class Template_Logic {
|
|
105
52
|
static get_test = (title,option) =>{
|
|
106
|
-
if(!
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if(!option.item_count){
|
|
110
|
-
option.item_count=10;
|
|
111
|
-
}
|
|
112
|
-
if(!option.get_value){
|
|
113
|
-
option.get_value=false;
|
|
114
|
-
}
|
|
115
|
-
if(!option.get_item){
|
|
116
|
-
option.get_item=false;
|
|
53
|
+
if(!title){
|
|
54
|
+
title = "Template "+ Number.get_id();
|
|
55
|
+
option = {};
|
|
117
56
|
}
|
|
57
|
+
option = Field_Logic.get_option(DataType.TEMPLATE,option?option:{});
|
|
118
58
|
let template = DataItem.get_new_full_item(
|
|
119
59
|
DataItem.get_new(DataType.TEMPLATE,0),
|
|
120
60
|
DataItem.get_new(DataType.TEMPLATE,0),
|
|
121
61
|
DataItem.get_new(DataType.TEMPLATE,0),
|
|
122
62
|
Field_Logic.get_test(title,option));
|
|
123
63
|
if(option.get_item){
|
|
124
|
-
template.items =
|
|
125
|
-
let template_sub_title_list = ["Header","Navigation","Body","Footer"];
|
|
126
|
-
for(let a=0;a<template_sub_title_list.length;a++){
|
|
127
|
-
template.items.push(Sub_Item_Logic.get_test(template_sub_title_list[a],template,template,option));
|
|
128
|
-
}
|
|
64
|
+
template.items = Sub_Item_Logic.get_test_item_list(template,template,option);
|
|
129
65
|
}
|
|
130
66
|
return template;
|
|
131
67
|
};
|
|
132
68
|
}
|
|
133
|
-
class
|
|
69
|
+
class Team_Logic {
|
|
134
70
|
static get_test = (title,option) =>{
|
|
135
|
-
if(!
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
71
|
+
if(!title){
|
|
72
|
+
title = "Team "+Number.get_id();
|
|
73
|
+
option = {};
|
|
74
|
+
}
|
|
75
|
+
option = Field_Logic.get_option(DataType.TEAM,option?option:{});
|
|
76
|
+
let team = DataItem.get_new_full_item(
|
|
77
|
+
DataItem.get_new(DataType.TEAM,0),
|
|
78
|
+
DataItem.get_new(DataType.TEAM,0),
|
|
79
|
+
DataItem.get_new(DataType.TEAM,0),
|
|
80
|
+
Field_Logic.get_test(title,option));
|
|
81
|
+
team.members = [];
|
|
82
|
+
if(option.get_member){
|
|
83
|
+
for(let a=0;a<option.member_count;a++){
|
|
84
|
+
team.members.push(Team_Logic.get_test_member("Full Name " + Number.get_id(),team,option));
|
|
85
|
+
}
|
|
143
86
|
}
|
|
144
|
-
|
|
145
|
-
|
|
87
|
+
return team;
|
|
88
|
+
};
|
|
89
|
+
static get_test_member = (title,team,option) =>{
|
|
90
|
+
option = Field_Logic.get_option(DataType.TEAM,option?option:{});
|
|
91
|
+
let team_member = DataItem.get_new_full_item(
|
|
92
|
+
DataItem.get_new(DataType.ITEM,0),
|
|
93
|
+
DataItem.get_new(DataType.TEAM,team.id),
|
|
94
|
+
DataItem.get_new(DataType.TEAM,team.id));
|
|
95
|
+
team_member.title = title;
|
|
96
|
+
team_member.first_name = "First Name "+ Number.get_id();
|
|
97
|
+
team_member.last_name = "Last Name "+ Number.get_id();
|
|
98
|
+
team_member.position = "Position "+ Number.get_id();
|
|
99
|
+
team_member.city = "City "+ Number.get_id();
|
|
100
|
+
team_member.state = "State "+ Number.get_id();
|
|
101
|
+
return team_member;
|
|
102
|
+
};
|
|
103
|
+
static get_test_member_list = (team,option) =>{
|
|
104
|
+
option = Field_Logic.get_option(DataType.TEAM,option?option:{});
|
|
105
|
+
let item_list = [];
|
|
106
|
+
for(let a=0;a<option.member_count;a++){
|
|
107
|
+
item_list.push(Team_Logic.get_test_member("Full Name " +parseInt(a+1),team,option));
|
|
146
108
|
}
|
|
147
|
-
|
|
148
|
-
|
|
109
|
+
return item_list;
|
|
110
|
+
}
|
|
111
|
+
static get_test_list = (option) =>{
|
|
112
|
+
option = Field_Logic.get_option(DataType.TEAM,option?option:{});
|
|
113
|
+
let item_list = [];
|
|
114
|
+
for(let a=0;a<option.team_count;a++){
|
|
115
|
+
item_list.push(Team_Logic.get_test("Team " +parseInt(a+1),option));
|
|
149
116
|
}
|
|
150
|
-
|
|
151
|
-
|
|
117
|
+
return item_list;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
class Page_Logic {
|
|
121
|
+
static get_test = (title,option) =>{
|
|
122
|
+
if(!title){
|
|
123
|
+
title = "Page "+ Number.get_id();
|
|
124
|
+
option = {};
|
|
152
125
|
}
|
|
126
|
+
option = Field_Logic.get_option(DataType.PAGE,option?option:{});
|
|
153
127
|
let page = DataItem.get_new_full_item(
|
|
154
128
|
DataItem.get_new(DataType.PAGE,0),
|
|
155
129
|
DataItem.get_new(DataType.PAGE,0),
|
|
156
130
|
DataItem.get_new(DataType.PAGE,0),
|
|
157
131
|
Field_Logic.get_test(title,option));
|
|
158
|
-
if(option.
|
|
132
|
+
if(option.get_section){
|
|
159
133
|
page.items = Sub_Item_Logic.get_test_section_list(page,page,option);
|
|
160
134
|
}
|
|
161
135
|
return page;
|
|
162
136
|
};
|
|
137
|
+
static get_test_list = (option) =>{
|
|
138
|
+
option = Field_Logic.get_option(DataType.PAGE,option?option:{});
|
|
139
|
+
let item_list = [];
|
|
140
|
+
for(let a=0;a<option.page_count;a++){
|
|
141
|
+
item_list.push(Page_Logic.get_test("Page " +parseInt(a+1),option));
|
|
142
|
+
}
|
|
143
|
+
return item_list;
|
|
144
|
+
}
|
|
163
145
|
}
|
|
164
146
|
class Product_Logic {
|
|
165
|
-
static get_test = (option) =>{
|
|
166
|
-
if(!
|
|
167
|
-
|
|
147
|
+
static get_test = (title,option) =>{
|
|
148
|
+
if(!title){
|
|
149
|
+
title = "Product 1";
|
|
150
|
+
option = {};
|
|
168
151
|
}
|
|
152
|
+
option = Field_Logic.get_option(DataType.PRODUCT,option?option:{});
|
|
169
153
|
let product = DataItem.get_new_full_item(
|
|
170
|
-
DataItem.get_new(DataType.PRODUCT,Number.get_id()),
|
|
171
154
|
DataItem.get_new(DataType.PRODUCT,0),
|
|
172
155
|
DataItem.get_new(DataType.PRODUCT,0),
|
|
173
|
-
|
|
156
|
+
DataItem.get_new(DataType.PRODUCT,0),
|
|
157
|
+
Field_Logic.get_test(title,option));
|
|
174
158
|
product.cost = String(Number.get_id()) + "." + String(Number.get_id());
|
|
175
159
|
product.old_cost = String(Number.get_id()) + "." + String(Number.get_id());
|
|
176
160
|
product.type = "Type "+String(Number.get_id());
|
|
177
161
|
product.sub_type = "Sub Type "+String(Number.get_id());
|
|
178
162
|
product.stock = String(Number.get_id(3-1));
|
|
179
|
-
product.category ="Category " + String(Number.get_id());
|
|
180
163
|
if(option.get_item){
|
|
181
|
-
|
|
164
|
+
product.items = Sub_Item_Logic.get_test_item_list(product,product,option);
|
|
182
165
|
}
|
|
183
166
|
return product;
|
|
184
167
|
};
|
|
185
|
-
static get_test_list=(option)=>{
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
let item_list=[];
|
|
168
|
+
static get_test_list = (option) =>{
|
|
169
|
+
option = Field_Logic.get_option(DataType.PRODUCT,option?option:{});
|
|
170
|
+
let item_list = [];
|
|
190
171
|
for(let a=0;a<option.product_count;a++){
|
|
191
|
-
item_list.push(Product_Logic.get_test(option));
|
|
172
|
+
item_list.push(Product_Logic.get_test("Product "+String(parseInt(a+1)),option));
|
|
192
173
|
}
|
|
193
174
|
return item_list;
|
|
194
|
-
}
|
|
175
|
+
}
|
|
195
176
|
static get_test_list_by_category = (option) =>{
|
|
177
|
+
option = Field_Logic.get_option(DataType.PRODUCT,option?option:{});
|
|
196
178
|
let product_list = [];
|
|
197
|
-
let
|
|
198
|
-
let product_count = 19;
|
|
199
|
-
if(!option){
|
|
200
|
-
option={};
|
|
201
|
-
}
|
|
202
|
-
else{
|
|
203
|
-
if(option.category_count){
|
|
204
|
-
category_count = parseInt(option.category_count);
|
|
205
|
-
}
|
|
206
|
-
if(option.category_count){
|
|
207
|
-
product_count = parseInt(option.product_count);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
let category_list = Category_Logic.get_type_category_list(DataType.PRODUCT,category_count);
|
|
179
|
+
let category_list = Category_Logic.get_type_category_list(DataType.PRODUCT,option.category_count);
|
|
211
180
|
let item_count = 0;
|
|
212
181
|
for(let a=0;a<category_list.length;a++){
|
|
213
|
-
for(let b=0;b<product_count;b++){
|
|
182
|
+
for(let b=0;b<option.product_count;b++){
|
|
214
183
|
item_count++;
|
|
215
|
-
let product = Product_Logic.get_test(
|
|
216
|
-
product.category = category_list[Number.get_id(category_list.length
|
|
184
|
+
let product = Product_Logic.get_test("Product "+String(parseInt(b+1)),option);
|
|
185
|
+
product.category = category_list[Number.get_id(category_list.length+1)].title;
|
|
217
186
|
product_list.push(product);
|
|
218
187
|
}
|
|
219
188
|
}
|
|
@@ -221,82 +190,147 @@ class Product_Logic {
|
|
|
221
190
|
};
|
|
222
191
|
}
|
|
223
192
|
class Service_Logic {
|
|
224
|
-
static get_test = (option) =>{
|
|
225
|
-
if(!
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
if(!option.item_count){
|
|
229
|
-
option.item_count=10;
|
|
193
|
+
static get_test = (title,option) =>{
|
|
194
|
+
if(!title){
|
|
195
|
+
title = "Service 1";
|
|
196
|
+
option = {};
|
|
230
197
|
}
|
|
198
|
+
option = Field_Logic.get_option(DataType.SERVICE,option?option:{});
|
|
231
199
|
let service = DataItem.get_new_full_item(
|
|
232
|
-
DataItem.get_new(DataType.SERVICE,Number.get_id()),
|
|
233
200
|
DataItem.get_new(DataType.SERVICE,0),
|
|
234
201
|
DataItem.get_new(DataType.SERVICE,0),
|
|
235
|
-
|
|
236
|
-
|
|
202
|
+
DataItem.get_new(DataType.SERVICE,0),
|
|
203
|
+
Field_Logic.get_test(title,option));
|
|
237
204
|
service.cost = String(Number.get_id()) + "." + String(Number.get_id());
|
|
238
205
|
service.old_cost = String(Number.get_id()) + "." + String(Number.get_id());
|
|
239
206
|
service.type = "Type "+String(Number.get_id());
|
|
240
207
|
service.sub_type = "Sub Type "+String(Number.get_id());
|
|
241
208
|
service.stock = String(Number.get_id(3-1));
|
|
242
|
-
service.category ="Category " + String(Number.get_id());
|
|
243
209
|
if(option.get_item){
|
|
244
|
-
service.items = Sub_Item_Logic.
|
|
210
|
+
service.items = Sub_Item_Logic.get_test_item_list(service,service,option);
|
|
245
211
|
}
|
|
246
212
|
return service;
|
|
247
213
|
};
|
|
248
|
-
static get_test_list=(option)=>{
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
let item_list=[];
|
|
214
|
+
static get_test_list = (option) =>{
|
|
215
|
+
option = Field_Logic.get_option(DataType.SERVICE,option?option:{});
|
|
216
|
+
let item_list = [];
|
|
253
217
|
for(let a=0;a<option.service_count;a++){
|
|
254
|
-
item_list.push(
|
|
218
|
+
item_list.push(Service_Logic.get_test("Service "+String(parseInt(a+1))),option);
|
|
255
219
|
}
|
|
256
220
|
return item_list;
|
|
257
|
-
}
|
|
221
|
+
}
|
|
258
222
|
static get_test_list_by_category = (option) =>{
|
|
223
|
+
option = Field_Logic.get_option(DataType.SERVICE,option?option:{});
|
|
259
224
|
let service_list = [];
|
|
260
|
-
let
|
|
261
|
-
let
|
|
262
|
-
|
|
263
|
-
option
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
225
|
+
let category_list = Category_Logic.get_type_category_list(DataType.SERVICE,option.category_count);
|
|
226
|
+
let item_count = 0;
|
|
227
|
+
for(let a=0;a<category_list.length;a++){
|
|
228
|
+
for(let b=0;b<option.service_count;b++){
|
|
229
|
+
item_count++;
|
|
230
|
+
let service = Service_Logic.get_test("Service "+String(parseInt(b+1)),option);
|
|
231
|
+
service.category = category_list[Number.get_id(category_list.length+1)].title;
|
|
232
|
+
service_list.push(service);
|
|
268
233
|
}
|
|
269
|
-
|
|
270
|
-
|
|
234
|
+
}
|
|
235
|
+
return [category_list,service_list]
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
class Content_Logic {
|
|
239
|
+
static get_test = (title,option) =>{
|
|
240
|
+
if(!title){
|
|
241
|
+
title = "Content 1";
|
|
242
|
+
option = {};
|
|
243
|
+
}
|
|
244
|
+
option = Field_Logic.get_option(DataType.CONTENT,option?option:{});
|
|
245
|
+
let content = DataItem.get_new_full_item(
|
|
246
|
+
DataItem.get_new(DataType.CONTENT,0),
|
|
247
|
+
DataItem.get_new(DataType.CONTENT,0),
|
|
248
|
+
DataItem.get_new(DataType.CONTENT,0),
|
|
249
|
+
Field_Logic.get_test(title,option));
|
|
250
|
+
if(option.get_item){
|
|
251
|
+
content.items = Sub_Item_Logic.get_test_section_list(content,content,option);
|
|
252
|
+
}
|
|
253
|
+
return content;
|
|
254
|
+
};
|
|
255
|
+
static get_test_list = (option) =>{
|
|
256
|
+
option = Field_Logic.get_option(DataType.CONTENT,option?option:{});
|
|
257
|
+
let item_list = [];
|
|
258
|
+
for(let a=0;a<option.content_count;a++){
|
|
259
|
+
item_list.push(Content_Logic.get_test("Content " +String(parseInt(a+1)),option));
|
|
260
|
+
}
|
|
261
|
+
return item_list;
|
|
262
|
+
}
|
|
263
|
+
static get_test_list_by_category = (option) =>{
|
|
264
|
+
option = Field_Logic.get_option(DataType.CONTENT,option?option:{});
|
|
265
|
+
let content_list = [];
|
|
266
|
+
let category_list = Category_Logic.get_type_category_list(DataType.CONTENT,option.category_count);
|
|
267
|
+
let item_count = 0;
|
|
268
|
+
for(let a=0;a<category_list.length;a++){
|
|
269
|
+
for(let b=0;b<option.content_count;b++){
|
|
270
|
+
item_count++;
|
|
271
|
+
let content = Content_Logic.get_test("Content "+String(parseInt(b+1)),option);
|
|
272
|
+
content.category = category_list[Number.get_id(category_list.length+1)].title;
|
|
273
|
+
content_list.push(content);
|
|
271
274
|
}
|
|
272
275
|
}
|
|
273
|
-
|
|
276
|
+
return [category_list,content_list]
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
class Blog_Post_Logic {
|
|
280
|
+
static get_test = (title,option) =>{
|
|
281
|
+
if(!title){
|
|
282
|
+
title = "Blog Post 1";
|
|
283
|
+
option = {};
|
|
284
|
+
}
|
|
285
|
+
option = Field_Logic.get_option(DataType.BLOG_POST,option?option:{});
|
|
286
|
+
let blog_post = DataItem.get_new_full_item(
|
|
287
|
+
DataItem.get_new(DataType.BLOG_POST,0),
|
|
288
|
+
DataItem.get_new(DataType.BLOG_POST,0),
|
|
289
|
+
DataItem.get_new(DataType.BLOG_POST,0),
|
|
290
|
+
Field_Logic.get_test(title,option));
|
|
291
|
+
blog_post.author="First Name "+ Number.get_id();
|
|
292
|
+
blog_post.tag="tag 1,tag 2,tag 3";
|
|
293
|
+
if(option.get_item){
|
|
294
|
+
blog_post.items = Sub_Item_Logic.get_test_item_list(blog_post,blog_post,option);
|
|
295
|
+
}
|
|
296
|
+
return blog_post;
|
|
297
|
+
};
|
|
298
|
+
static get_test_list = (option) =>{
|
|
299
|
+
option = Field_Logic.get_option(DataType.BLOG_POST,option?option:{});
|
|
300
|
+
let item_list = [];
|
|
301
|
+
for(let a=0;a<option.blog_post_count;a++){
|
|
302
|
+
item_list.push(Blog_Post_Logic.get_test("Blog_Post " +String(parseInt(a+1)),option));
|
|
303
|
+
}
|
|
304
|
+
return item_list;
|
|
305
|
+
}
|
|
306
|
+
static get_test_list_by_category = (option) =>{
|
|
307
|
+
option = Field_Logic.get_option(DataType.BLOG_POST,option?option:{});
|
|
308
|
+
let blog_post_list = [];
|
|
309
|
+
let category_list = Category_Logic.get_type_category_list(DataType.BLOG_POST,option.category_count);
|
|
274
310
|
let item_count = 0;
|
|
275
311
|
for(let a=0;a<category_list.length;a++){
|
|
276
|
-
for(let b=0;b<
|
|
312
|
+
for(let b=0;b<option.blog_post_count;b++){
|
|
277
313
|
item_count++;
|
|
278
|
-
let
|
|
279
|
-
|
|
280
|
-
|
|
314
|
+
let blog_post = Blog_Post_Logic.get_test("Blog_Post "+String(parseInt(b+1)),option);
|
|
315
|
+
blog_post.category = category_list[Number.get_id(category_list.length+1)].title;
|
|
316
|
+
blog_post_list.push(blog_post);
|
|
281
317
|
}
|
|
282
318
|
}
|
|
283
|
-
return [category_list,
|
|
319
|
+
return [category_list,blog_post_list]
|
|
284
320
|
};
|
|
285
321
|
}
|
|
286
322
|
class Event_Logic {
|
|
287
|
-
static get_test = (option) =>{
|
|
288
|
-
if(!
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
if(!option.item_count){
|
|
292
|
-
option.item_count=10;
|
|
323
|
+
static get_test = (title,option) =>{
|
|
324
|
+
if(!title){
|
|
325
|
+
title = "Event " + Number.get_id();
|
|
326
|
+
option = {};
|
|
293
327
|
}
|
|
328
|
+
option = Field_Logic.get_option(DataType.EVENT,option?option:{});
|
|
294
329
|
let event = DataItem.get_new_full_item(
|
|
295
|
-
DataItem.get_new(DataType.EVENT,Number.get_id()),
|
|
296
330
|
DataItem.get_new(DataType.EVENT,0),
|
|
297
331
|
DataItem.get_new(DataType.EVENT,0),
|
|
298
|
-
|
|
299
|
-
|
|
332
|
+
DataItem.get_new(DataType.EVENT,0),
|
|
333
|
+
Field_Logic.get_test(title,option));
|
|
300
334
|
event.cost = String(Number.get_id()) + "." + String(Number.get_id());
|
|
301
335
|
event.old_cost = String(Number.get_id()) + "." + String(Number.get_id());
|
|
302
336
|
event.date = String(String(Number.get_id(2030)) + "-" + String(Number.get_id(13)) + "-" + String(Number.get_id(30))).trim();
|
|
@@ -307,42 +341,28 @@ class Event_Logic {
|
|
|
307
341
|
event.stock = String(Number.get_id(3-1));
|
|
308
342
|
event.category ="Category " + String(Number.get_id());
|
|
309
343
|
if(option.get_item){
|
|
310
|
-
event.items = Sub_Item_Logic.
|
|
344
|
+
event.items = Sub_Item_Logic.get_test_item_list(event,event,option);
|
|
311
345
|
}
|
|
312
346
|
return event;
|
|
313
347
|
};
|
|
314
|
-
static get_test_list=(option)=>{
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
}
|
|
318
|
-
let item_list=[];
|
|
348
|
+
static get_test_list = (option) =>{
|
|
349
|
+
option = Field_Logic.get_option(DataType.EVENT,option?option:{});
|
|
350
|
+
let item_list = [];
|
|
319
351
|
for(let a=0;a<option.event_count;a++){
|
|
320
|
-
item_list.push(Event_Logic.get_test(option));
|
|
352
|
+
item_list.push(Event_Logic.get_test("Event "+String(parseInt(a+1)),option));
|
|
321
353
|
}
|
|
322
354
|
return item_list;
|
|
323
|
-
}
|
|
355
|
+
}
|
|
324
356
|
static get_test_list_by_category = (option) =>{
|
|
357
|
+
option = Field_Logic.get_option(DataType.EVENT,option?option:{});
|
|
325
358
|
let event_list = [];
|
|
326
|
-
let
|
|
327
|
-
let event_count = 19;
|
|
328
|
-
if(!option){
|
|
329
|
-
option={};
|
|
330
|
-
}
|
|
331
|
-
else{
|
|
332
|
-
if(option.category_count){
|
|
333
|
-
category_count = parseInt(option.category_count);
|
|
334
|
-
}
|
|
335
|
-
if(option.category_count){
|
|
336
|
-
event_count = parseInt(option.event_count);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
let category_list = Category_Logic.get_type_category_list(DataType.EVENT,category_count);
|
|
359
|
+
let category_list = Category_Logic.get_type_category_list(DataType.EVENT,option.category_count);
|
|
340
360
|
let item_count = 0;
|
|
341
361
|
for(let a=0;a<category_list.length;a++){
|
|
342
|
-
for(let b=0;b<event_count;b++){
|
|
362
|
+
for(let b=0;b<option.event_count;b++){
|
|
343
363
|
item_count++;
|
|
344
|
-
let event = Event_Logic.get_test(
|
|
345
|
-
event.category = category_list[Number.get_id(category_list.length
|
|
364
|
+
let event = Event_Logic.get_test("Event "+String(parseInt(b+1)),option);
|
|
365
|
+
event.category = category_list[Number.get_id(category_list.length+1)].title;
|
|
346
366
|
event_list.push(event);
|
|
347
367
|
}
|
|
348
368
|
}
|
|
@@ -353,32 +373,120 @@ class Field_Logic {
|
|
|
353
373
|
static get_test = (title,option) =>{
|
|
354
374
|
if(!title){
|
|
355
375
|
title="";
|
|
376
|
+
option={};
|
|
356
377
|
}
|
|
357
378
|
if(!option){
|
|
358
|
-
option={
|
|
379
|
+
option= {};
|
|
359
380
|
}
|
|
360
|
-
if(!option.
|
|
361
|
-
option.
|
|
362
|
-
}
|
|
363
|
-
if(!option.value_count){
|
|
364
|
-
option.value_count=10;
|
|
381
|
+
if(!option.category_title){
|
|
382
|
+
option.category_title = 'Category '+String(Number.get_id());
|
|
365
383
|
}
|
|
366
384
|
let item = {
|
|
367
|
-
date_create:new moment().toISOString(),
|
|
368
|
-
date_save:new moment().toISOString(),
|
|
369
385
|
title:title,
|
|
370
386
|
setting_visible:"1",
|
|
371
387
|
title_url:Str.get_title_url(title),
|
|
388
|
+
category:option.category_title,
|
|
372
389
|
sub_note:"Sub Note "+String(Number.get_id()),
|
|
373
390
|
note:"Note "+String(Number.get_id())
|
|
374
391
|
}
|
|
375
392
|
if(option.get_value){
|
|
376
|
-
|
|
377
|
-
item['value_'+String(b)] = title + ' value ' + String(b);
|
|
378
|
-
}
|
|
393
|
+
item = Field_Logic.get_value_list(item,option);
|
|
379
394
|
}
|
|
380
395
|
return item;
|
|
381
396
|
}
|
|
397
|
+
static get_value_list(item,option){
|
|
398
|
+
for(let b=0;b<option.value_count;b++){
|
|
399
|
+
item['value_'+String(b+1)] = 'value ' + String(b+1);
|
|
400
|
+
item['field_'+String(b+1)] = Str.get_title_url(item['value_'+String(b+1)]);
|
|
401
|
+
item[Str.get_title_url('value ' + String(b+1))] = item.title + ' value ' + String(b+1);
|
|
402
|
+
}
|
|
403
|
+
return item;
|
|
404
|
+
};
|
|
405
|
+
static get_option(data_type,option){
|
|
406
|
+
if(!data_type){
|
|
407
|
+
data_type = DataType.BLANK;
|
|
408
|
+
}
|
|
409
|
+
if(!option){
|
|
410
|
+
option = {get_value:false,get_item:false,get_photo:false,item_count:9,value_count:9};
|
|
411
|
+
}
|
|
412
|
+
if(!option.get_photo){
|
|
413
|
+
option.get_photo=false;
|
|
414
|
+
}
|
|
415
|
+
if(!option.get_value){
|
|
416
|
+
option.get_value=false;
|
|
417
|
+
}
|
|
418
|
+
if(!option.value_count){
|
|
419
|
+
option.value_count=9;
|
|
420
|
+
}
|
|
421
|
+
if(!option.section_count){
|
|
422
|
+
option.section_count=9;
|
|
423
|
+
}
|
|
424
|
+
if(!option.get_item){
|
|
425
|
+
option.get_item=false;
|
|
426
|
+
}
|
|
427
|
+
if(!option.item_count){
|
|
428
|
+
option.item_count=9;
|
|
429
|
+
}
|
|
430
|
+
if(!option.category_count){
|
|
431
|
+
option.category_count=9;
|
|
432
|
+
}
|
|
433
|
+
if(!option.category_title){
|
|
434
|
+
option.category_title=null;
|
|
435
|
+
}
|
|
436
|
+
if(option.data_type==DataType.PAGE){
|
|
437
|
+
if(!option.page_count){
|
|
438
|
+
option.page_count=9;
|
|
439
|
+
}
|
|
440
|
+
if(!option.section_count){
|
|
441
|
+
option.section_count=9;
|
|
442
|
+
}
|
|
443
|
+
if(!option.get_section){
|
|
444
|
+
option.get_section=false;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
if(option.data_type==DataType.PRODUCT){
|
|
448
|
+
if(!option.product_count){
|
|
449
|
+
option.product_count=9;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
if(data_type==DataType.SERVICE){
|
|
453
|
+
if(!option.service_count){
|
|
454
|
+
option.service_count=9;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
if(data_type==DataType.BLOG_POST){
|
|
458
|
+
if(!option.blog_post_count){
|
|
459
|
+
option.blog_post_count=9;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
if(data_type==DataType.EVENT){
|
|
463
|
+
if(!option.event_count){
|
|
464
|
+
option.event_count=9;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
if(data_type==DataType.TEAM){
|
|
468
|
+
if(!option.get_member){
|
|
469
|
+
option.get_member=false;
|
|
470
|
+
}
|
|
471
|
+
if(!option.member_count){
|
|
472
|
+
option.member_count=9;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
if(data_type==DataType.FAQ){
|
|
476
|
+
if(!option.get_question){
|
|
477
|
+
option.get_question=false;
|
|
478
|
+
}
|
|
479
|
+
if(!option.question_count){
|
|
480
|
+
option.question_count=9;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
if(data_type==DataType.CONTENT){
|
|
484
|
+
if(!option.content_count){
|
|
485
|
+
option.content_count=9;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
return option;
|
|
489
|
+
}
|
|
382
490
|
}
|
|
383
491
|
class FieldType {
|
|
384
492
|
static APP_ID='app_id';
|
|
@@ -509,140 +617,72 @@ class DataType {
|
|
|
509
617
|
static VIDEO='video_biz';
|
|
510
618
|
}
|
|
511
619
|
class Blank_Logic {
|
|
512
|
-
static get_test = (option) =>{
|
|
513
|
-
if(!
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
if(!option.item_count){
|
|
517
|
-
option.item_count=10;
|
|
620
|
+
static get_test = (title,option) =>{
|
|
621
|
+
if(!title){
|
|
622
|
+
title = "Blank " + Number.get_id();
|
|
623
|
+
option={};
|
|
518
624
|
}
|
|
625
|
+
option = Field_Logic.get_option(DataType.BLANK,option?option:{});
|
|
519
626
|
let blank = DataItem.get_new_full_item(
|
|
520
|
-
DataItem.get_new(DataType.BLANK,Number.get_id()),
|
|
521
627
|
DataItem.get_new(DataType.BLANK,0),
|
|
522
628
|
DataItem.get_new(DataType.BLANK,0),
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
blank.category ="Category " + String(Number.get_id());
|
|
629
|
+
DataItem.get_new(DataType.BLANK,0),
|
|
630
|
+
Field_Logic.get_test(title,option));
|
|
526
631
|
if(option.get_item){
|
|
527
|
-
blank.items = Sub_Item_Logic.
|
|
632
|
+
blank.items = Sub_Item_Logic.get_test_item_list(blank,blank,option);
|
|
528
633
|
}
|
|
529
634
|
return blank;
|
|
530
635
|
};
|
|
531
|
-
static get_test_list=(option)=>{
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
}
|
|
535
|
-
let item_list=[];
|
|
636
|
+
static get_test_list = (option) =>{
|
|
637
|
+
option = Field_Logic.get_option(DataType.BLANK,option?option:{});
|
|
638
|
+
let item_list = [];
|
|
536
639
|
for(let a=0;a<option.blank_count;a++){
|
|
537
|
-
item_list.push(Blank_Logic.get_test(option));
|
|
640
|
+
item_list.push(Blank_Logic.get_test("Blank " +String(parseInt(a+1)),option));
|
|
538
641
|
}
|
|
539
642
|
return item_list;
|
|
540
|
-
}
|
|
643
|
+
}
|
|
541
644
|
static get_test_list_by_category = (option) =>{
|
|
645
|
+
option = Field_Logic.get_option(DataType.BLANK,option?option:{});
|
|
542
646
|
let blank_list = [];
|
|
543
|
-
let
|
|
544
|
-
let blank_count = 19;
|
|
545
|
-
if(!option){
|
|
546
|
-
option={};
|
|
547
|
-
}
|
|
548
|
-
else{
|
|
549
|
-
if(option.category_count){
|
|
550
|
-
category_count = parseInt(option.category_count);
|
|
551
|
-
}
|
|
552
|
-
if(option.category_count){
|
|
553
|
-
blank_count = parseInt(option.blank_count);
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
let category_list = Category_Logic.get_type_category_list(DataType.BLANK,category_count);
|
|
647
|
+
let category_list = Category_Logic.get_type_category_list(DataType.BLANK,option.category_count);
|
|
557
648
|
let item_count = 0;
|
|
558
649
|
for(let a=0;a<category_list.length;a++){
|
|
559
|
-
for(let b=0;b<blank_count;b++){
|
|
650
|
+
for(let b=0;b<option.blank_count;b++){
|
|
560
651
|
item_count++;
|
|
561
|
-
let blank = Blank_Logic.get_test(
|
|
562
|
-
blank.category = category_list[Number.get_id(category_list.length
|
|
652
|
+
let blank = Blank_Logic.get_test("Blank "+String(parseInt(b+1)),option);
|
|
653
|
+
blank.category = category_list[Number.get_id(category_list.length+1)].title;
|
|
563
654
|
blank_list.push(blank);
|
|
564
655
|
}
|
|
565
656
|
}
|
|
566
657
|
return [category_list,blank_list]
|
|
567
658
|
};
|
|
568
659
|
}
|
|
569
|
-
class
|
|
570
|
-
static get_test = (option) =>{
|
|
571
|
-
if(!
|
|
572
|
-
|
|
573
|
-
}
|
|
574
|
-
if(!option.item_count){
|
|
575
|
-
option.item_count=10;
|
|
576
|
-
}
|
|
577
|
-
let blog_post = DataItem.get_new_full_item(
|
|
578
|
-
DataItem.get_new(DataType.BLOG_POST,Number.get_id()),
|
|
579
|
-
DataItem.get_new(DataType.BLOG_POST,0),
|
|
580
|
-
DataItem.get_new(DataType.BLOG_POST,0),
|
|
581
|
-
Field_Logic.get_test("Blog Post "+Number.get_id(),option));
|
|
582
|
-
blog_post.author="First Name "+ Number.get_id();
|
|
583
|
-
blog_post.tag="tag 1,tag 2,tag 3";
|
|
584
|
-
blog_post.category ="Category " + String(Number.get_id());
|
|
585
|
-
if(option.get_item){
|
|
586
|
-
blog_post.items = Sub_Item_Logic.get_test_section_list(blog_post,blog_post,option);
|
|
587
|
-
}
|
|
588
|
-
return blog_post;
|
|
589
|
-
};
|
|
590
|
-
static get_test_list=(option)=>{
|
|
591
|
-
if(!option){
|
|
592
|
-
option = {blog_post_count:10,get_value:false,get_item:false,value_count:20};
|
|
593
|
-
}
|
|
594
|
-
let item_list=[];
|
|
595
|
-
for(let a=0;a<option.blog_post_count;a++){
|
|
596
|
-
item_list.push(Blog_Post_Logic.get_test(option));
|
|
597
|
-
}
|
|
598
|
-
return item_list;
|
|
599
|
-
};
|
|
600
|
-
static get_test_list_by_category = (option) =>{
|
|
601
|
-
let blog_post_list = [];
|
|
602
|
-
let category_count = 9;
|
|
603
|
-
let blog_post_count = 19;
|
|
604
|
-
if(!option){
|
|
660
|
+
class Faq_Logic {
|
|
661
|
+
static get_test = (title,option) =>{
|
|
662
|
+
if(!title){
|
|
663
|
+
title = "Faq " + Number.get_id();
|
|
605
664
|
option={};
|
|
606
665
|
}
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
category_count = parseInt(option.category_count);
|
|
610
|
-
}
|
|
611
|
-
if(option.category_count){
|
|
612
|
-
blog_post_count = parseInt(option.blog_post_count);
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
let category_list = Category_Logic.get_type_category_list(DataType.BLOG_POST,category_count);
|
|
616
|
-
let item_count = 0;
|
|
617
|
-
for(let a=0;a<category_list.length;a++){
|
|
618
|
-
for(let b=0;b<blog_post_count;b++){
|
|
619
|
-
item_count++;
|
|
620
|
-
let blog_post = Blog_Post_Logic.get_test({item_count:0,blog_post_count:blog_post_count,get_value:false,get_item:false,value_count:20});
|
|
621
|
-
blog_post.category = category_list[Number.get_id(category_list.length-1)].title;
|
|
622
|
-
blog_post_list.push(blog_post);
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
return [category_list,blog_post_list]
|
|
626
|
-
};
|
|
627
|
-
}
|
|
628
|
-
class Faq_Logic {
|
|
629
|
-
static get_test = () =>{
|
|
666
|
+
option = Field_Logic.get_option(DataType.FAQ,option?option:{});
|
|
667
|
+
option.get_value = false;
|
|
630
668
|
let faq = DataItem.get_new_full_item(
|
|
631
|
-
DataItem.get_new(DataType.FAQ,Number.get_id()),
|
|
632
669
|
DataItem.get_new(DataType.FAQ,0),
|
|
633
670
|
DataItem.get_new(DataType.FAQ,0),
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
671
|
+
DataItem.get_new(DataType.FAQ,0),
|
|
672
|
+
Field_Logic.get_test(title,option));
|
|
673
|
+
for(let b=0;b<option.question_count;b++){
|
|
674
|
+
faq['question_'+String(b+1)] = 'question ' + String(b+1);
|
|
675
|
+
faq['field_'+String(b+1)] = Str.get_title_url(faq['question_'+String(b+1)]);
|
|
676
|
+
faq[Str.get_title_url('question ' + String(b+1))] = 'Answer ' + String(b+1);
|
|
677
|
+
}
|
|
678
|
+
|
|
637
679
|
return faq;
|
|
638
680
|
};
|
|
639
681
|
static get_test_list=(option)=>{
|
|
640
|
-
|
|
641
|
-
option = {faq_count:19};
|
|
642
|
-
}
|
|
682
|
+
option = Field_Logic.get_option(DataType.FAQ,option?option:{});
|
|
643
683
|
let item_list = [];
|
|
644
|
-
for(let a=0;a<option.
|
|
645
|
-
item_list.push(
|
|
684
|
+
for(let a=0;a<option.question_count;a++){
|
|
685
|
+
item_list.push(Faq_Logic.get_test("FAQ Questions " +parseInt(a+1),option));
|
|
646
686
|
}
|
|
647
687
|
return item_list;
|
|
648
688
|
};
|
|
@@ -677,15 +717,15 @@ class Review_Logic {
|
|
|
677
717
|
};
|
|
678
718
|
}
|
|
679
719
|
class Business_Logic {
|
|
680
|
-
static get_new = () =>{
|
|
720
|
+
static get_new = (title) =>{
|
|
681
721
|
if(!title){
|
|
682
|
-
title="";
|
|
722
|
+
title="Business "+Number.get_id();
|
|
683
723
|
}
|
|
684
724
|
return DataItem.get_new_full_item(
|
|
685
725
|
DataItem.get_new(DataType.BUSINESS,0),
|
|
686
726
|
DataItem.get_new(DataType.BUSINESS,0),
|
|
687
727
|
DataItem.get_new(DataType.BUSINESS,0),{
|
|
688
|
-
title:
|
|
728
|
+
title:title,
|
|
689
729
|
email:"",
|
|
690
730
|
phone:"",
|
|
691
731
|
address_1:"",
|
|
@@ -700,8 +740,14 @@ class Business_Logic {
|
|
|
700
740
|
twitter:""
|
|
701
741
|
});
|
|
702
742
|
};
|
|
703
|
-
static get_test = () =>{
|
|
704
|
-
|
|
743
|
+
static get_test = (title,option) =>{
|
|
744
|
+
if(!title){
|
|
745
|
+
title="Business "+Number.get_id();
|
|
746
|
+
option={};
|
|
747
|
+
}
|
|
748
|
+
option = Field_Logic.get_option(DataType.BUSINESS,option?option:{});
|
|
749
|
+
Log.w('option',option);
|
|
750
|
+
let item = DataItem.get_new(DataType.BUSINESS,0);
|
|
705
751
|
let city_list = ["Miami","Atlanta","Chicago","Seattle","New York City"];
|
|
706
752
|
let state_list = ["Georgia","New York","Illinois","Washington","Flordia"];
|
|
707
753
|
let business = DataItem.get_new_full_item(
|
|
@@ -740,19 +786,19 @@ class Business_Logic {
|
|
|
740
786
|
}
|
|
741
787
|
}
|
|
742
788
|
class DataItem {
|
|
743
|
-
static get_new = (data_type,id,
|
|
744
|
-
return get_new_item_main(data_type,id,
|
|
789
|
+
static get_new = (data_type,id,option) => {
|
|
790
|
+
return get_new_item_main(data_type,id,option?option:{});
|
|
745
791
|
};
|
|
746
|
-
static get_new_full_item = (item,parent_item,top_item,
|
|
747
|
-
return get_new_full_item_main(item,parent_item,top_item,
|
|
792
|
+
static get_new_full_item = (item,parent_item,top_item,option) => {
|
|
793
|
+
return get_new_full_item_main(item,parent_item,top_item,option?option:{});
|
|
748
794
|
};
|
|
749
|
-
static get_biz = (biz9_config,item,
|
|
750
|
-
return get_biz_item_main(biz9_config,item,
|
|
795
|
+
static get_biz = (biz9_config,item,option)=>{
|
|
796
|
+
return get_biz_item_main(biz9_config,item,option?option:{});
|
|
751
797
|
}
|
|
752
|
-
static get_biz_by_list = (biz9_config,list,
|
|
798
|
+
static get_biz_by_list = (biz9_config,list,option)=>{
|
|
753
799
|
let r_list = [];
|
|
754
800
|
for(let a=0;a<list.length;a++){
|
|
755
|
-
r_list.push(get_biz_item_main(biz9_config,list[a],
|
|
801
|
+
r_list.push(get_biz_item_main(biz9_config,list[a],option));
|
|
756
802
|
}
|
|
757
803
|
return r_list;
|
|
758
804
|
}
|
|
@@ -949,8 +995,8 @@ class Url{
|
|
|
949
995
|
let action_url= "main/crud/get/"+data_type + "/" + key;
|
|
950
996
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,null);
|
|
951
997
|
};
|
|
952
|
-
static get_item_parent_top = (biz9_config,data_type,
|
|
953
|
-
let action_url = "main/crud/get_item_parent_top/"+data_type+"/"+
|
|
998
|
+
static get_item_parent_top = (biz9_config,data_type,id,parent_data_type,parent_id,top_data_type,top_id) => {
|
|
999
|
+
let action_url = "main/crud/get_item_parent_top/"+data_type+"/"+id+"/"+parent_data_type+ "/"+parent_id+"/"+top_data_type+ "/"+top_id;
|
|
954
1000
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,null);
|
|
955
1001
|
};
|
|
956
1002
|
static get_list = (biz9_config,data_type) => {
|
|
@@ -975,42 +1021,45 @@ class Url{
|
|
|
975
1021
|
};
|
|
976
1022
|
}
|
|
977
1023
|
class Obj {
|
|
978
|
-
static
|
|
979
|
-
return
|
|
1024
|
+
static get_search = (biz9_config,data_type,filter,sort_by,page_current,page_size) => {
|
|
1025
|
+
return {data_type:data_type,filter:filter,sort_by:sort_by,page_current:page_current,page_size:page_size};
|
|
980
1026
|
}
|
|
981
1027
|
};
|
|
982
1028
|
class Category_Logic {
|
|
983
|
-
static get_test(option){
|
|
984
|
-
if(!
|
|
985
|
-
|
|
1029
|
+
static get_test = (title,option) =>{
|
|
1030
|
+
if(!title){
|
|
1031
|
+
title="Category 1";
|
|
1032
|
+
option={};
|
|
986
1033
|
}
|
|
1034
|
+
option = Field_Logic.get_option(DataType.CATEGORY,option?option:{});
|
|
987
1035
|
let category = DataItem.get_new_full_item(
|
|
988
|
-
DataItem.get_new(DataType.CATEGORY,Number.get_id()),
|
|
989
1036
|
DataItem.get_new(DataType.CATEGORY,0),
|
|
990
1037
|
DataItem.get_new(DataType.CATEGORY,0),
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
static get_test_list = (option) => {
|
|
996
|
-
if(!option){
|
|
997
|
-
option={category_count:10};
|
|
1038
|
+
DataItem.get_new(DataType.CATEGORY,0),
|
|
1039
|
+
Field_Logic.get_test(title,option));
|
|
1040
|
+
if(option.get_item){
|
|
1041
|
+
category.items = Sub_Item_Logic.get_test_item_list(category,category,option);
|
|
998
1042
|
}
|
|
999
|
-
|
|
1043
|
+
return category;
|
|
1044
|
+
};
|
|
1045
|
+
static get_test_list = (option) =>{
|
|
1046
|
+
option = Field_Logic.get_option(DataType.CATEGORY,option);
|
|
1047
|
+
let item_list = [];
|
|
1000
1048
|
for(let a=0;a<option.category_count;a++){
|
|
1001
|
-
item_list.push(Category_Logic.get_test(option));
|
|
1049
|
+
item_list.push(Category_Logic.get_test("Category " +String(parseInt(a+1)),option));
|
|
1002
1050
|
}
|
|
1003
1051
|
return item_list;
|
|
1004
|
-
}
|
|
1005
|
-
static
|
|
1052
|
+
}
|
|
1053
|
+
static get_test_list_by_type = (type,option) =>{
|
|
1054
|
+
option = Field_Logic.get_option(DataType.CATEGORY,option);
|
|
1006
1055
|
let category_list = [];
|
|
1007
|
-
for(let a=0;a<
|
|
1056
|
+
for(let a=0;a<option.category_count;a++){
|
|
1008
1057
|
let category = DataItem.get_new_full_item(
|
|
1009
|
-
DataItem.get_new(DataType.CATEGORY,"Category "+Number.get_id()),
|
|
1010
1058
|
DataItem.get_new(DataType.CATEGORY,0),
|
|
1011
1059
|
DataItem.get_new(DataType.CATEGORY,0),
|
|
1012
|
-
|
|
1013
|
-
|
|
1060
|
+
DataItem.get_new(DataType.CATEGORY,0),
|
|
1061
|
+
Field_Logic.get_test("Category " +String(parseInt(a+1)),option));
|
|
1062
|
+
category.type = type;
|
|
1014
1063
|
category_list.push(category);
|
|
1015
1064
|
}
|
|
1016
1065
|
return category_list;
|
|
@@ -1024,11 +1073,11 @@ class Category_Logic {
|
|
|
1024
1073
|
};
|
|
1025
1074
|
static get_category_list = () => {
|
|
1026
1075
|
return [
|
|
1027
|
-
{data_type:DataType.BLOG_POST,value:DataType.BLOG_POST,label:"Blog Posts"},
|
|
1028
|
-
{data_type:DataType.CATEGORY,value:DataType.CATEGORY,label:"Category"},
|
|
1029
|
-
{data_type:DataType.CONTENT,value:DataType.CONTENT,label:"Content"}
|
|
1030
|
-
{data_type:DataType.EVENT,value:DataType.EVENT,label:"Events"}
|
|
1031
|
-
{data_type:DataType.GALLERY,value:DataType.GALLERY,label:"Galleries"},
|
|
1076
|
+
{data_type:DataType.BLOG_POST,value:DataType.BLOG_POST,label:"Blog Posts"},
|
|
1077
|
+
{data_type:DataType.CATEGORY,value:DataType.CATEGORY,label:"Category"},
|
|
1078
|
+
{data_type:DataType.CONTENT,value:DataType.CONTENT,label:"Content"},
|
|
1079
|
+
{data_type:DataType.EVENT,value:DataType.EVENT,label:"Events"},
|
|
1080
|
+
{data_type:DataType.GALLERY,value:DataType.GALLERY,label:"Galleries"},
|
|
1032
1081
|
{data_type:DataType.SERVICE,value:DataType.SERVICE,label:"Services"},
|
|
1033
1082
|
{data_type:DataType.PRODUCT,value:DataType.PRODUCT,label:"Product"},
|
|
1034
1083
|
{data_type:DataType.TEMPLATE,value:DataType.TEMPLATE,label:"Template"},
|
|
@@ -1314,13 +1363,16 @@ class Storage {
|
|
|
1314
1363
|
class Sub_Item_Logic {
|
|
1315
1364
|
static get_test(title,parent_item,top_item,option){
|
|
1316
1365
|
if(option==null){
|
|
1317
|
-
option={get_value:true,value_count:
|
|
1366
|
+
option={get_value:true,value_count:9};
|
|
1367
|
+
}
|
|
1368
|
+
if(option.item_count==null){
|
|
1369
|
+
option.item_count = 9;
|
|
1318
1370
|
}
|
|
1319
1371
|
if(option.get_value==null){
|
|
1320
1372
|
option.get_value = true;
|
|
1321
1373
|
}
|
|
1322
1374
|
if(option.value_count==null){
|
|
1323
|
-
option.value_count =
|
|
1375
|
+
option.value_count = 9;
|
|
1324
1376
|
}
|
|
1325
1377
|
let item_title =title;
|
|
1326
1378
|
let item = DataItem.get_new(
|
|
@@ -1336,47 +1388,23 @@ class Sub_Item_Logic {
|
|
|
1336
1388
|
}
|
|
1337
1389
|
);
|
|
1338
1390
|
if(option.get_value){
|
|
1339
|
-
|
|
1340
|
-
item['value_'+String(b)] = item_title+ ' value ' + String(b);
|
|
1341
|
-
}
|
|
1391
|
+
item = Field_Logic.get_value_list(item,option);
|
|
1342
1392
|
}
|
|
1343
1393
|
return item;
|
|
1344
1394
|
}
|
|
1345
|
-
|
|
1346
|
-
static get_test_section_list(parent_item,top_item,option){
|
|
1395
|
+
static get_test_item_list(parent_item,top_item,option){
|
|
1347
1396
|
let new_list = [];
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
if(option.item_count==null){
|
|
1352
|
-
option.item_count = 10;
|
|
1397
|
+
for(let a=0;a<option.item_count;a++){
|
|
1398
|
+
let item_title ="Item " + String(parseInt(a+1));
|
|
1399
|
+
new_list.push(Sub_Item_Logic.get_test(item_title,parent_item,top_item,option));
|
|
1353
1400
|
}
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
let item_title ="Section " + String(a);
|
|
1362
|
-
let sub_item = DataItem.get_new(
|
|
1363
|
-
DataType.ITEM,0, {
|
|
1364
|
-
top_id:top_item.id,
|
|
1365
|
-
top_data_type:top_item.data_type,
|
|
1366
|
-
parent_id:parent_item.id,
|
|
1367
|
-
parent_data_type:parent_item.data_type,
|
|
1368
|
-
title:item_title,
|
|
1369
|
-
title_url:Str.get_title_url(item_title),
|
|
1370
|
-
sub_note:"Sub Note "+String(Number.get_id()),
|
|
1371
|
-
note:"Note "+String(Number.get_id()),
|
|
1372
|
-
}
|
|
1373
|
-
);
|
|
1374
|
-
if(option.get_value){
|
|
1375
|
-
for(let b=1;b<option.value_count;b++){
|
|
1376
|
-
sub_item['value_'+String(b)] = 'Section '+ String(a) + ' value ' + String(b);
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
new_list.push(sub_item);
|
|
1401
|
+
return new_list;
|
|
1402
|
+
}
|
|
1403
|
+
static get_test_section_list(parent_item,top_item,option){
|
|
1404
|
+
let new_list = [];
|
|
1405
|
+
for(let a=0;a<option.section_count;a++){
|
|
1406
|
+
let item_title ="Section " + String(parseInt(a+1));
|
|
1407
|
+
new_list.push(Sub_Item_Logic.get_test(item_title,parent_item,top_item,option));
|
|
1380
1408
|
}
|
|
1381
1409
|
return new_list;
|
|
1382
1410
|
}
|
|
@@ -1390,6 +1418,7 @@ module.exports = {
|
|
|
1390
1418
|
Category_Logic,
|
|
1391
1419
|
Category_Url,
|
|
1392
1420
|
Content_Url,
|
|
1421
|
+
Content_Logic,
|
|
1393
1422
|
Custom_Field_Url,
|
|
1394
1423
|
CMS,
|
|
1395
1424
|
DataItem,
|
|
@@ -1416,6 +1445,7 @@ module.exports = {
|
|
|
1416
1445
|
Schedule,
|
|
1417
1446
|
Stock,
|
|
1418
1447
|
TemplateType,
|
|
1448
|
+
Team_Logic,
|
|
1419
1449
|
Template_Logic,
|
|
1420
1450
|
Url,
|
|
1421
1451
|
};
|