biz9-logic 3.2.7 → 3.2.9

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.
Files changed (3) hide show
  1. package/biz9_config +1 -1
  2. package/index.js +76 -2
  3. package/package.json +1 -1
package/biz9_config CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='3.3.4'
1
+ VERSION='3.3.6'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -66,7 +66,7 @@ class BiZ_Url {
66
66
  return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
67
67
  };
68
68
  static get_full_item = (biz9_config,item,parent_item,top_item) => {
69
- let action_url= "main/biz_item/get_full/"+item.data_type + "/" + parent_item.id +"/"+parent_item.data_type + "/" + parent_item.id +"/"+top_item.data_type + "/" + top_item.id;
69
+ let action_url= "main/biz_item/get_full/"+item.data_type + "/" + item.id +"/"+parent_item.data_type + "/" + parent_item.id +"/"+top_item.data_type + "/" + top_item.id;
70
70
  return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
71
71
  };
72
72
  }
@@ -120,10 +120,84 @@ class Obj {
120
120
  return get_cloud_filter_obj_main(data_type,filter,sort_by,page_current,page_size);
121
121
  }
122
122
  };
123
+ class CMS {
124
+ static Tab_Edit_Title_General = 'general';
125
+ static Tab_Edit_Title_Photo = 'photo';
126
+ static Tab_Edit_Title_List = 'list';
127
+ static Tab_Edit_Title_Value = 'value';
128
+ static Tab_Edit_Title_Setting = 'setting';
129
+
130
+ static get_new_query_item = (item,parent_item,top_item) => {
131
+ return {
132
+ id: item.id ? item.id : 0,
133
+ data_type:item.data_type ? item.data_type : DataType.DT_BLANK,
134
+ parent_id:parent_item.id ? parent_item.id : 0,
135
+ parent_data_type:parent_item.data_type ? parent_item.data_type : DataType.DT_BLANK,
136
+
137
+ top_id:top_item.id ? top_item.id : 0,
138
+ top_data_type:top_item.data_type ? top_item.data_type : DataType.DT_BLANK
139
+ }
140
+ };
141
+ static get_query_itemz_by_query = (item) => {
142
+ return [];
143
+ };
144
+ static get_query_item_by_page = (item) => {
145
+ return { id:item.id ? item.id : 0, data_type:item.data_type ? item.data_type : DataType.DT_BLANK };
146
+ };
147
+ static get_query_parent_item_by_page = (parent_item) => {
148
+ return { id:parent_item.id ? parent_item.id : 0, data_type:parent_item.data_type ? parent_item.data_type : DataType.DT_BLANK };
149
+ };
150
+ static get_query_top_item_by_page = (top_item) => {
151
+ return { id:top_item.id ? top_item.id : 0, data_type:top_item.data_type ? top_item.data_type : DataType.DT_BLANK };
152
+ };
153
+ static get_query_item_by_query = (query) => {
154
+ return { id:query.get('id') ? query.get('id') : 0, data_type:query.get('data_type') ? query.get('data_type') : DataType.DT_BLANK } ;
155
+ };
156
+ static get_query_parent_item_by_query = (query) => {
157
+ return { id:query.get('parent_id') ? query.get('parent_id') : 0, data_type:query.get('parent_data_type') ? query.get('parent_data_type') : DataType.DT_BLANK } ;
158
+ };
159
+ static get_query_top_item_by_query = (query) => {
160
+ return { id:query.get('top_id') ? query.get('top_id') : 0, data_type:query.get('top_data_type') ? query.get('top_data_type') : DataType.DT_BLANK } ;
161
+ };
162
+ static get_sub_page_title = (title) => {
163
+ switch(title)
164
+ {
165
+ case CMS.Tab_Edit_Title_General:
166
+ return 'General';
167
+ break;
168
+ case CMS.Tab_Edit_Title_Photo:
169
+ return 'Photos';
170
+ break;
171
+ case CMS.Tab_Edit_Title_Value:
172
+ return 'Values';
173
+ break;
174
+ case CMS.Tab_Edit_Title_Setting:
175
+ return 'Settings';
176
+ default:
177
+ return 'N/A';
178
+ }
179
+ }
180
+ static get_page_url = (url,tab_title,item,parent_item,top_item) => {
181
+ return url+"?tab_title="+tab_title
182
+ +"&id="+item.id
183
+ +"&data_type="
184
+ +item.data_type
185
+ +"&parent_id="
186
+ +parent_item.id
187
+ +"&parent_data_type="
188
+ +parent_item.data_type
189
+ +"&top_id="
190
+ +top_item.id
191
+ +"&top_data_type="
192
+ +top_item.data_type;
193
+ }
194
+ }
195
+
123
196
  module.exports = {
124
197
  DataType,
125
198
  DataItem,
126
199
  Url,
127
200
  BiZ_Url,
128
- Obj
201
+ Obj,
202
+ CMS
129
203
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "3.2.7",
3
+ "version": "3.2.9",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"