biz9-logic 3.5.38 → 3.5.40
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 +186 -52
- package/package.json +1 -1
- package/test.js +16 -11
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -5,13 +5,77 @@ License GNU General Public License v3.0
|
|
|
5
5
|
Description: BiZ9 Framework: Logic-JS
|
|
6
6
|
*/
|
|
7
7
|
const { get_new_item_main,get_data_config_main,get_cloud_url_main,get_biz_item_main,get_cloud_filter_obj_main,get_title_url_main } = require('./main');
|
|
8
|
-
const {Log,Test,Str,DateTime} = require('biz9-utility');
|
|
8
|
+
const { Log,Test,Str,DateTime } = require('biz9-utility');
|
|
9
|
+
|
|
9
10
|
class Message {
|
|
11
|
+
|
|
10
12
|
static SUCCESS="Update Success";
|
|
11
13
|
static LOGIN_GOOD="Login Success";
|
|
12
14
|
static LOGIN_BAD="Login Incorrect";
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class TemplateType {
|
|
19
|
+
|
|
20
|
+
static Primary='primary';
|
|
21
|
+
static Header='header';
|
|
22
|
+
static Navigation='navigation';
|
|
23
|
+
static BODY='body';
|
|
24
|
+
static FOOTER='footer';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
class PageType {
|
|
28
|
+
|
|
29
|
+
static HOME='home';
|
|
30
|
+
static ABOUT='about';
|
|
31
|
+
static CONTACT='contact';
|
|
32
|
+
static SERVICE='service';
|
|
33
|
+
static PRODUCT='product';
|
|
34
|
+
static TEAM='team';
|
|
35
|
+
|
|
36
|
+
static SECTION_1='section_1';
|
|
37
|
+
static SECTION_2='section_2';
|
|
38
|
+
static SECTION_3='section_2';
|
|
39
|
+
static SECTION_4='section_4';
|
|
40
|
+
static SECTION_5='section_5';
|
|
41
|
+
static SECTION_6='section_6';
|
|
42
|
+
static SECTION_7='section_7';
|
|
43
|
+
static SECTION_8='section_8';
|
|
44
|
+
static SECTION_9='section_9';
|
|
45
|
+
static SECTION_10='section_10';
|
|
46
|
+
static SECTION_11='section_11';
|
|
47
|
+
static SECTION_12='section_12';
|
|
48
|
+
static SECTION_13='section_13';
|
|
49
|
+
static SECTION_14='section_14';
|
|
50
|
+
static SECTION_15='section_15';
|
|
51
|
+
static SECTION_16='section_16';
|
|
52
|
+
static SECTION_17='section_17';
|
|
53
|
+
static SECTION_18='section_18';
|
|
54
|
+
static SECTION_19='section_19';
|
|
55
|
+
|
|
56
|
+
static VALUE_1='value_1';
|
|
57
|
+
static VALUE_2='value_2';
|
|
58
|
+
static VALUE_3='value_2';
|
|
59
|
+
static VALUE_4='value_4';
|
|
60
|
+
static VALUE_5='value_5';
|
|
61
|
+
static VALUE_6='value_6';
|
|
62
|
+
static VALUE_7='value_7';
|
|
63
|
+
static VALUE_8='value_8';
|
|
64
|
+
static VALUE_9='value_9';
|
|
65
|
+
static VALUE_10='value_10';
|
|
66
|
+
static VALUE_11='value_11';
|
|
67
|
+
static VALUE_12='value_12';
|
|
68
|
+
static VALUE_13='value_13';
|
|
69
|
+
static VALUE_14='value_14';
|
|
70
|
+
static VALUE_15='value_15';
|
|
71
|
+
static VALUE_16='value_16';
|
|
72
|
+
static VALUE_17='value_17';
|
|
73
|
+
static VALUE_18='value_18';
|
|
74
|
+
static VALUE_19='value_19';
|
|
13
75
|
}
|
|
76
|
+
|
|
14
77
|
class DataType {
|
|
78
|
+
|
|
15
79
|
static get_title = (data_type) => {
|
|
16
80
|
if(!data_type){
|
|
17
81
|
return "";
|
|
@@ -19,36 +83,41 @@ class DataType {
|
|
|
19
83
|
return String(Str.get_title(data_type.replaceAll('_',' ').replaceAll('dt','').replace('biz',''))).trim();
|
|
20
84
|
}
|
|
21
85
|
}
|
|
22
|
-
|
|
23
|
-
static
|
|
24
|
-
static
|
|
25
|
-
static
|
|
26
|
-
static
|
|
27
|
-
static
|
|
28
|
-
static
|
|
29
|
-
static
|
|
30
|
-
static
|
|
31
|
-
static
|
|
32
|
-
static
|
|
33
|
-
static
|
|
34
|
-
static
|
|
35
|
-
static
|
|
36
|
-
static
|
|
37
|
-
static
|
|
38
|
-
static
|
|
39
|
-
static
|
|
40
|
-
static
|
|
41
|
-
static
|
|
42
|
-
static
|
|
43
|
-
static
|
|
86
|
+
|
|
87
|
+
static ADMIN='admin_biz';
|
|
88
|
+
static BLANK='blank_biz';
|
|
89
|
+
static BUSINESS='business_biz';
|
|
90
|
+
static BLOG_POST='blog_post_biz';
|
|
91
|
+
static CART_ITEM="cart_item_biz";
|
|
92
|
+
static CATEGORY='category_biz';
|
|
93
|
+
static CONTENT='content_biz';
|
|
94
|
+
static EVENT='event_biz';
|
|
95
|
+
static GALLERY='gallery_biz';
|
|
96
|
+
static ITEM_MAP='item_map_biz';
|
|
97
|
+
static ITEM='item_biz';
|
|
98
|
+
static ORDER="order_biz";
|
|
99
|
+
static ORDER_ITEM="order_item_biz";
|
|
100
|
+
static PROJECT='project_biz';
|
|
101
|
+
static PRODUCT='product_biz';
|
|
102
|
+
static PHOTO='photo_biz';
|
|
103
|
+
static PAGE='page_biz';
|
|
104
|
+
static REVIEW='review_biz';
|
|
105
|
+
static SERVICE='service_biz';
|
|
106
|
+
static TEMPLATE='template_biz';
|
|
107
|
+
static USER='user_biz';
|
|
108
|
+
static VIDEO='video_biz';
|
|
44
109
|
}
|
|
110
|
+
|
|
45
111
|
class DataItem {
|
|
112
|
+
|
|
46
113
|
static get_new = (data_type,id) => {
|
|
47
114
|
return get_new_item_main(data_type,id);
|
|
48
115
|
};
|
|
116
|
+
|
|
49
117
|
static get_biz = (biz9_config,item,options)=>{
|
|
50
118
|
return get_biz_item_main(biz9_config,item,options);
|
|
51
119
|
}
|
|
120
|
+
|
|
52
121
|
static get_biz_by_list = (biz9_config,list,options)=>{
|
|
53
122
|
let r_list = [];
|
|
54
123
|
for(let a=0;a<list.length;a++){
|
|
@@ -56,76 +125,110 @@ class DataItem {
|
|
|
56
125
|
}
|
|
57
126
|
return r_list;
|
|
58
127
|
}
|
|
128
|
+
|
|
59
129
|
}
|
|
60
130
|
class BiZ_Url {
|
|
131
|
+
|
|
61
132
|
static get_item=(biz9_config,data_type,id)=>{
|
|
62
133
|
let action_url="main/biz_item/get/"+data_type+"/"+id ;
|
|
63
134
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
64
135
|
};
|
|
136
|
+
|
|
65
137
|
static delete_item=(biz9_config,data_type,id)=>{
|
|
66
138
|
let action_url= "main/biz_item/delete/"+data_type+"/"+id ;
|
|
67
139
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
68
140
|
};
|
|
141
|
+
|
|
69
142
|
static get_full_item=(biz9_config,data_type,id)=>{
|
|
70
143
|
let action_url= "main/biz_item/get_full/"+data_type+"/"+id;
|
|
71
144
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
72
145
|
};
|
|
146
|
+
|
|
147
|
+
static get_page=(biz9_config,title_url)=>{
|
|
148
|
+
let action_url= "main/biz_item/get_page/"+title_url;
|
|
149
|
+
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
static get_template=(biz9_config,title_url)=>{
|
|
153
|
+
let action_url= "main/biz_item/get_template/"+title_url;
|
|
154
|
+
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
155
|
+
};
|
|
156
|
+
|
|
73
157
|
}
|
|
158
|
+
|
|
74
159
|
class Url {
|
|
160
|
+
|
|
75
161
|
static get = (biz9_config,action_url,params)=>{
|
|
76
162
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,params);
|
|
77
163
|
}
|
|
164
|
+
|
|
78
165
|
static connect = (biz9_config) => {
|
|
79
166
|
let action_url= "main/test/connect/";
|
|
80
167
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
81
168
|
};
|
|
169
|
+
|
|
82
170
|
static upload_file = (biz9_config,data_type,id) => {
|
|
83
171
|
let action_url= "main/crud/update/"+data_type + "/" + id;
|
|
84
172
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
85
173
|
};
|
|
174
|
+
|
|
86
175
|
static update_item = (biz9_config,data_type,id) => {
|
|
87
176
|
let action_url= "main/crud/update/"+data_type + "/" + id;
|
|
88
177
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
89
178
|
};
|
|
179
|
+
|
|
90
180
|
static get_item = (biz9_config,data_type,id) => {
|
|
91
181
|
let action_url= "main/crud/get/"+data_type + "/" + id;
|
|
92
182
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
93
183
|
};
|
|
184
|
+
|
|
94
185
|
static delete_item = (biz9_config,data_type,id) => {
|
|
95
186
|
let action_url= "main/crud/delete/"+data_type + "/" + id;
|
|
96
187
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
97
188
|
};
|
|
189
|
+
|
|
98
190
|
static get_list = (biz9_config,data_type) => {
|
|
99
191
|
let action_url= "main/crud/get_list/"+data_type;
|
|
100
192
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
101
193
|
};
|
|
194
|
+
|
|
102
195
|
static update_list = (biz9_config,data_type) => {
|
|
103
196
|
let action_url= "main/crud/update_list/"+data_type;
|
|
104
197
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
105
198
|
};
|
|
199
|
+
|
|
106
200
|
static delete_list = (biz9_config,data_type) => {
|
|
107
201
|
let action_url= "main/crud/delete_list/"+data_type;
|
|
108
202
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
109
203
|
};
|
|
204
|
+
|
|
110
205
|
static delete_biz_item = (biz9_config,data_type,id) => {
|
|
111
206
|
let action_url= "main/biz_item/delete/"+data_type + "/" + id;
|
|
112
207
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
113
208
|
};
|
|
209
|
+
|
|
114
210
|
static get_biz_list = (biz9_config,data_type) => {
|
|
115
211
|
let action_url= "main/biz_item/get_list/"+data_type;
|
|
116
212
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
117
213
|
};
|
|
214
|
+
|
|
118
215
|
static delete_biz_list = (biz9_config,data_type) => {
|
|
119
216
|
let action_url= "main/biz_item/delete_list/"+data_type;
|
|
120
217
|
return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
|
|
121
218
|
};
|
|
219
|
+
|
|
122
220
|
}
|
|
221
|
+
|
|
123
222
|
class Obj {
|
|
223
|
+
|
|
124
224
|
static get_filter = (biz9_config,data_type,filter,sort_by,page_current,page_size)=>{
|
|
125
225
|
return get_cloud_filter_obj_main(data_type,filter,sort_by,page_current,page_size);
|
|
126
226
|
}
|
|
227
|
+
|
|
127
228
|
};
|
|
229
|
+
|
|
128
230
|
class Cat {
|
|
231
|
+
|
|
129
232
|
static get_category_drop_down_list_by_list = (cat_list) => {
|
|
130
233
|
let category_list = [];
|
|
131
234
|
for(let a=0;a<cat_list.length;a++){
|
|
@@ -133,58 +236,62 @@ class Cat {
|
|
|
133
236
|
}
|
|
134
237
|
return category_list;
|
|
135
238
|
};
|
|
239
|
+
|
|
136
240
|
static get_category_list = () => {
|
|
137
241
|
return [
|
|
138
242
|
{ value: DataType.BLOG_POST, label: "Blog Posts" },
|
|
139
|
-
{ value: DataType.
|
|
140
|
-
{ value: DataType.
|
|
141
|
-
{ value: DataType.
|
|
142
|
-
{ value: DataType.
|
|
143
|
-
{ value: DataType.
|
|
144
|
-
{ value: DataType.
|
|
243
|
+
{ value: DataType.CONTENT, label: "Content" },
|
|
244
|
+
{ value: DataType.EVENT, label: "Events" },
|
|
245
|
+
{ value: DataType.GALLERY, label: "Galleries" },
|
|
246
|
+
{ value: DataType.SERVICE, label: "Services" },
|
|
247
|
+
{ value: DataType.PRODUCT, label: "Products" },
|
|
248
|
+
{ value: DataType.TEMPLATE, label: "Template" }
|
|
145
249
|
];
|
|
146
250
|
};
|
|
251
|
+
|
|
147
252
|
static get_title_by_type = (data_type) => {
|
|
148
253
|
switch (data_type) {
|
|
149
|
-
case DataType.
|
|
254
|
+
case DataType.EVENT:
|
|
150
255
|
return "Event";
|
|
151
256
|
break;
|
|
152
|
-
case DataType.
|
|
257
|
+
case DataType.GALLERY:
|
|
153
258
|
return "Gallery";
|
|
154
259
|
break;
|
|
155
|
-
case DataType.
|
|
260
|
+
case DataType.PRODUCT:
|
|
156
261
|
return "Product";
|
|
157
262
|
break;
|
|
158
|
-
case DataType.
|
|
263
|
+
case DataType.SERVICE:
|
|
159
264
|
return "Service";
|
|
160
265
|
break;
|
|
161
|
-
case DataType.
|
|
266
|
+
case DataType.EVENT:
|
|
162
267
|
return "Event";
|
|
163
268
|
break;
|
|
164
|
-
case DataType.
|
|
269
|
+
case DataType.PRODUCT:
|
|
165
270
|
return "Product";
|
|
166
271
|
break;
|
|
167
|
-
case DataType.
|
|
272
|
+
case DataType.SERVICE:
|
|
168
273
|
return "Service";
|
|
169
274
|
break;
|
|
170
|
-
case DataType.
|
|
275
|
+
case DataType.CATEGORY:
|
|
171
276
|
return "Category";
|
|
172
277
|
break;
|
|
173
|
-
case DataType.
|
|
278
|
+
case DataType.BLOG_POST:
|
|
174
279
|
return "Blog Post";
|
|
175
280
|
break;
|
|
176
|
-
case DataType.
|
|
281
|
+
case DataType.TEMPLATE:
|
|
177
282
|
return "Template";
|
|
178
283
|
break;
|
|
179
|
-
case DataType.
|
|
284
|
+
case DataType.CONTENT:
|
|
180
285
|
return "Content";
|
|
181
286
|
break;
|
|
182
287
|
default:
|
|
183
288
|
return "Blank";
|
|
184
289
|
}
|
|
185
290
|
}
|
|
291
|
+
|
|
186
292
|
};
|
|
187
293
|
class CMS {
|
|
294
|
+
|
|
188
295
|
static Tab_Edit_Title_General = 'general';
|
|
189
296
|
static Tab_Edit_Title_Photo = 'photo';
|
|
190
297
|
static Tab_Edit_Title_List = 'list';
|
|
@@ -194,49 +301,59 @@ class CMS {
|
|
|
194
301
|
static Tab_Edit_Title_Video = 'video';
|
|
195
302
|
static Tab_Edit_Title_Note = 'note';
|
|
196
303
|
static get_new_query_item_by_item = (item) => {
|
|
304
|
+
|
|
197
305
|
return {
|
|
198
306
|
id: item.id ? item.id : 0,
|
|
199
|
-
data_type:item.data_type ? item.data_type : DataType.
|
|
307
|
+
data_type:item.data_type ? item.data_type : DataType.BLANK,
|
|
200
308
|
|
|
201
309
|
parent_id:item.parent_id ? item.parent_id : 0,
|
|
202
|
-
parent_data_type:item.parent_data_type ? item.parent_data_type : DataType.
|
|
310
|
+
parent_data_type:item.parent_data_type ? item.parent_data_type : DataType.BLANK,
|
|
203
311
|
|
|
204
312
|
top_id:item.top_id ? item.top_id : 0,
|
|
205
|
-
top_data_type:item.top_data_type ? item.top_data_type : DataType.
|
|
313
|
+
top_data_type:item.top_data_type ? item.top_data_type : DataType.BLANK
|
|
206
314
|
}
|
|
207
315
|
};
|
|
316
|
+
|
|
208
317
|
static get_new_query_item = (item,parent_item,top_item) => {
|
|
209
318
|
return {
|
|
210
319
|
id: item.id ? item.id : 0,
|
|
211
|
-
data_type:item.data_type ? item.data_type : DataType.
|
|
320
|
+
data_type:item.data_type ? item.data_type : DataType.BLANK,
|
|
212
321
|
parent_id:parent_item.id ? parent_item.id : 0,
|
|
213
|
-
parent_data_type:parent_item.data_type ? parent_item.data_type : DataType.
|
|
322
|
+
parent_data_type:parent_item.data_type ? parent_item.data_type : DataType.BLANK,
|
|
214
323
|
|
|
215
324
|
top_id:top_item.id ? top_item.id : 0,
|
|
216
|
-
top_data_type:top_item.data_type ? top_item.data_type : DataType.
|
|
325
|
+
top_data_type:top_item.data_type ? top_item.data_type : DataType.BLANK
|
|
217
326
|
}
|
|
218
327
|
};
|
|
328
|
+
|
|
219
329
|
static get_query_itemz_by_query = (item) => {
|
|
220
330
|
return [];
|
|
221
331
|
};
|
|
332
|
+
|
|
222
333
|
static get_query_item_by_page = (item) => {
|
|
223
|
-
return { id:item.id ? item.id : 0, data_type:item.data_type ? item.data_type : DataType.
|
|
334
|
+
return { id:item.id ? item.id : 0, data_type:item.data_type ? item.data_type : DataType.BLANK };
|
|
224
335
|
};
|
|
336
|
+
|
|
225
337
|
static get_query_parent_item_by_page = (parent_item) => {
|
|
226
|
-
return { id:parent_item.id ? parent_item.id : 0, data_type:parent_item.data_type ? parent_item.data_type : DataType.
|
|
338
|
+
return { id:parent_item.id ? parent_item.id : 0, data_type:parent_item.data_type ? parent_item.data_type : DataType.BLANK };
|
|
227
339
|
};
|
|
340
|
+
|
|
228
341
|
static get_query_top_item_by_page = (top_item) => {
|
|
229
|
-
return { id:top_item.id ? top_item.id : 0, data_type:top_item.data_type ? top_item.data_type : DataType.
|
|
342
|
+
return { id:top_item.id ? top_item.id : 0, data_type:top_item.data_type ? top_item.data_type : DataType.BLANK };
|
|
230
343
|
};
|
|
344
|
+
|
|
231
345
|
static get_query_item_by_query = (query) => {
|
|
232
|
-
return { id:query.get('id') ? query.get('id') : 0, data_type:query.get('data_type') ? query.get('data_type') : DataType.
|
|
346
|
+
return { id:query.get('id') ? query.get('id') : 0, data_type:query.get('data_type') ? query.get('data_type') : DataType.BLANK } ;
|
|
233
347
|
};
|
|
348
|
+
|
|
234
349
|
static get_query_parent_item_by_query = (query) => {
|
|
235
|
-
return { id:query.get('parent_id') ? query.get('parent_id') : 0, data_type:query.get('parent_data_type') ? query.get('parent_data_type') : DataType.
|
|
350
|
+
return { id:query.get('parent_id') ? query.get('parent_id') : 0, data_type:query.get('parent_data_type') ? query.get('parent_data_type') : DataType.BLANK } ;
|
|
351
|
+
|
|
236
352
|
};
|
|
237
353
|
static get_query_top_item_by_query = (query) => {
|
|
238
|
-
return { id:query.get('top_id') ? query.get('top_id') : 0, data_type:query.get('top_data_type') ? query.get('top_data_type') : DataType.
|
|
354
|
+
return { id:query.get('top_id') ? query.get('top_id') : 0, data_type:query.get('top_data_type') ? query.get('top_data_type') : DataType.BLANK } ;
|
|
239
355
|
};
|
|
356
|
+
|
|
240
357
|
static get_sub_page_title = (title) => {
|
|
241
358
|
switch(title)
|
|
242
359
|
{
|
|
@@ -266,6 +383,7 @@ class CMS {
|
|
|
266
383
|
break;
|
|
267
384
|
}
|
|
268
385
|
}
|
|
386
|
+
|
|
269
387
|
static get_page_url = (url,tab_title,item,parent_item,top_item,parms) => {
|
|
270
388
|
let r_url="?tab_title="+tab_title
|
|
271
389
|
+"&id="+item.id
|
|
@@ -284,8 +402,10 @@ class CMS {
|
|
|
284
402
|
}
|
|
285
403
|
return url+r_url;
|
|
286
404
|
}
|
|
405
|
+
|
|
287
406
|
}
|
|
288
407
|
class Stock {
|
|
408
|
+
|
|
289
409
|
static get_event_stock_list = () => {
|
|
290
410
|
const r_list=
|
|
291
411
|
[
|
|
@@ -296,6 +416,7 @@ class Stock {
|
|
|
296
416
|
];
|
|
297
417
|
return r_list;
|
|
298
418
|
};
|
|
419
|
+
|
|
299
420
|
static get_event_stock_by_value = (stock_val) => {
|
|
300
421
|
switch(stock_val)
|
|
301
422
|
{
|
|
@@ -313,6 +434,7 @@ class Stock {
|
|
|
313
434
|
break;
|
|
314
435
|
}
|
|
315
436
|
};
|
|
437
|
+
|
|
316
438
|
static get_service_stock_list = () => {
|
|
317
439
|
const r_list=
|
|
318
440
|
[
|
|
@@ -322,6 +444,7 @@ class Stock {
|
|
|
322
444
|
];
|
|
323
445
|
return r_list;
|
|
324
446
|
};
|
|
447
|
+
|
|
325
448
|
static get_service_stock_by_value = (stock_val) => {
|
|
326
449
|
switch(stock_val)
|
|
327
450
|
{
|
|
@@ -336,6 +459,7 @@ class Stock {
|
|
|
336
459
|
break;
|
|
337
460
|
}
|
|
338
461
|
};
|
|
462
|
+
|
|
339
463
|
static get_product_stock_list = () => {
|
|
340
464
|
const r_list=
|
|
341
465
|
[
|
|
@@ -346,6 +470,7 @@ class Stock {
|
|
|
346
470
|
];
|
|
347
471
|
return r_list;
|
|
348
472
|
};
|
|
473
|
+
|
|
349
474
|
static get_product_stock_by_value = (stock_val) => {
|
|
350
475
|
switch(stock_val)
|
|
351
476
|
{
|
|
@@ -369,6 +494,7 @@ class Stock {
|
|
|
369
494
|
|
|
370
495
|
}
|
|
371
496
|
class Schedule {
|
|
497
|
+
|
|
372
498
|
static get_start_date_time = (item) =>{
|
|
373
499
|
if(!item.date){
|
|
374
500
|
item.date = new Date();
|
|
@@ -381,6 +507,7 @@ class Schedule {
|
|
|
381
507
|
item.start_date_time = DateTime.get_full_date_time_by_date_time(item.date,item.time);
|
|
382
508
|
return item;
|
|
383
509
|
}
|
|
510
|
+
|
|
384
511
|
static get_start_date_time_by_list = (list) =>{
|
|
385
512
|
for(let a=0;a<list.length;a++){
|
|
386
513
|
if(!list[a].date){
|
|
@@ -395,8 +522,10 @@ class Schedule {
|
|
|
395
522
|
}
|
|
396
523
|
return list;
|
|
397
524
|
}
|
|
525
|
+
|
|
398
526
|
};
|
|
399
527
|
class Storage {
|
|
528
|
+
|
|
400
529
|
static KEY_ADMIN="key_admin";
|
|
401
530
|
static KEY_USER="key_user";
|
|
402
531
|
static KEY_BUSINESS="key_business";
|
|
@@ -404,15 +533,19 @@ class Storage {
|
|
|
404
533
|
static get = (window,key) => {
|
|
405
534
|
return JSON.parse(window.localStorage.getItem(key));
|
|
406
535
|
}
|
|
536
|
+
|
|
407
537
|
static set = (window,key,obj) => {
|
|
408
538
|
window.localStorage.setItem(key,JSON.stringify(obj));
|
|
409
539
|
}
|
|
540
|
+
|
|
410
541
|
static remove = (window,key) =>{
|
|
411
542
|
window.localStorage.removeItem(key);
|
|
412
543
|
}
|
|
544
|
+
|
|
413
545
|
static clear = (window) =>{
|
|
414
546
|
window.localStorage.clear();
|
|
415
547
|
}
|
|
548
|
+
|
|
416
549
|
}
|
|
417
550
|
module.exports = {
|
|
418
551
|
BiZ_Url,
|
|
@@ -420,6 +553,7 @@ module.exports = {
|
|
|
420
553
|
CMS,
|
|
421
554
|
DataItem,
|
|
422
555
|
DataType,
|
|
556
|
+
PageType,
|
|
423
557
|
Message,
|
|
424
558
|
Obj,
|
|
425
559
|
Storage,
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -28,6 +28,22 @@ const biz9_config ={
|
|
|
28
28
|
describe("connect", () => {
|
|
29
29
|
it("_connect", () => {
|
|
30
30
|
series([
|
|
31
|
+
|
|
32
|
+
function(call) {
|
|
33
|
+
console.log('GET-BiZ-Url-Item-Get-Item-START');
|
|
34
|
+
let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
|
|
35
|
+
let item = DataItem.get_new(DataType.DT_BLANK,0);
|
|
36
|
+
Log.w('item',item);
|
|
37
|
+
//let cloud_url = BiZ_Url.get_item(biz9_config,item.data_type,item.id);
|
|
38
|
+
let title_url = 'primary';
|
|
39
|
+
//let cloud_url = BiZ_Url.get_template(biz9_config,title_url);
|
|
40
|
+
let cloud_url = BiZ_Url.get_page(biz9_config,title_url);
|
|
41
|
+
Log.w('connect_url',cloud_url);
|
|
42
|
+
console.log('GET-BiZ-Url-Item-Get-Item-SUCCESS');
|
|
43
|
+
//call()
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
|
|
31
47
|
function(call) {
|
|
32
48
|
console.log('GET_START_STORAGE-START');
|
|
33
49
|
Log.w('storage-start',Storage.set(Number.get_id()));
|
|
@@ -118,17 +134,6 @@ describe("connect", () => {
|
|
|
118
134
|
},
|
|
119
135
|
|
|
120
136
|
|
|
121
|
-
function(call) {
|
|
122
|
-
console.log('GET-BiZ-Url-Item-Get-Item-START');
|
|
123
|
-
let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
|
|
124
|
-
let item = DataItem.get_new(DataType.DT_BLANK,0);
|
|
125
|
-
Log.w('item',item);
|
|
126
|
-
let cloud_url = BiZ_Url.get_item(biz9_config,item.data_type,item.id);
|
|
127
|
-
Log.w('connect_url',cloud_url);
|
|
128
|
-
console.log('GET-BiZ-Url-Item-Get-Item-SUCCESS');
|
|
129
|
-
//call()
|
|
130
|
-
},
|
|
131
|
-
|
|
132
137
|
|
|
133
138
|
|
|
134
139
|
function(call) {
|