owl-cli 7.20.0 → 7.23.0

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.
@@ -211,7 +211,7 @@ var @projectCodeService = (function (pigeon) {
211
211
  value = f.getEnvValue(value, env)
212
212
  f.setValue(field.key, value, data)
213
213
  }
214
- if((value==null || typeof(value)=='undefined') && field.autoGen=='true'){
214
+ if(((!value) || typeof(value)=='undefined') && field.autoGen=='true'){
215
215
  value =$.getUUID()
216
216
  f.setValue(field.key,value,data);
217
217
  }
@@ -246,7 +246,7 @@ var @projectCodeService = (function (pigeon) {
246
246
  value = f.getEnvValue(value, env)
247
247
  row[subField.origKey] = value;
248
248
  }
249
- if((value==null || typeof(value)=='undefined') && subField.autoGen=='true'){
249
+ if(((!value) || typeof(value)=='undefined') && subField.autoGen=='true'){
250
250
  value = $.getUUID()
251
251
  row[subField.origKey] = value;
252
252
  }
@@ -755,6 +755,7 @@ var @projectCodeService = (function (pigeon) {
755
755
  data.owl_lastModifiedUserId = userId;
756
756
  data.owl_lastModifiedIp = ip;
757
757
  data.owl_lastModifiedUserAgent = ua;
758
+ data.obj.owl_modifyTime = new Date().getTime();
758
759
 
759
760
  var key = pigeon.getRKey(data['owl_createTime'], 13)
760
761
  pigeon.deleteFromList(f.getAllListName(), key, id)
package/docs/image.png ADDED
Binary file
package/docs/tree.md ADDED
@@ -0,0 +1,25 @@
1
+ # 树状结构
2
+ ## 概述
3
+ 树状结构是一种常用的组织数据的方式,它将数据组织成一个层级结构,每个节点可以有多个子节点。比如组织架构、文件目录等,商品分类等都可以使用树状结构来组织。
4
+
5
+ ## owl中的树状结构配置
6
+ 在owl框架中,可以使用isTree字段来标识一个实体是否是树状结构的节点。如果isTree为true,则表示该实体是树状结构的节点,否则表示不是。例如:
7
+
8
+ ```
9
+ "#meta": {
10
+ "rem": "组织结构",
11
+ "projectName": "代理商",
12
+ "isTree": true,
13
+ ...
14
+ }
15
+ ```
16
+
17
+ ## 树状结构数据结构关键字段
18
+
19
+ - id:节点的唯一标识符
20
+ - parent_id:父节点的标识符
21
+ - parent_id:父节点的标识符
22
+ - showOnTree:是否在树状结构中显示该节点,默认值为yes。若果为no, 这不会显示在左侧的树状结构中。一般如果叶子节点的数量量很大,会造成左边的树很大,不好搜索,显示也会慢,就可以将叶子节点的showOnTree设置为no,这样就不会显示在左侧的树状结构中,而会显示在右边的列表中。
23
+
24
+ ![alt text](image.png)
25
+
@@ -21,7 +21,7 @@
21
21
  "regionId": "string(16),isId:true,searchable:true,formSize:2,hidden:true;所在地区ID",
22
22
  "regionPath": "linkId,formSize:2,listSize:8,datasource:mall_region,displayField:region_path,fields:id/region_path,toFields:regionId/regionPath;所在地区",
23
23
  "ownerId": "string(16),formSize:2,isId:true,searchable:true;主管理员",
24
- "showOnTree": "choice,values:yes_是/no_否,defaultValue:no,searchable:true;树节点上显示",
24
+ "showOnTree": "choice,values:yes_是/no_否,defaultValue:yes,searchable:true;树节点上显示",
25
25
  "subDomain": "string(16),formSize:2,hidden:true,searchable:true;二级域名",
26
26
  "tag": "string(128),searchable:true,formSize:8;商家标签(说明:多个标签之间可使用竖线分隔)"
27
27
  },
@@ -0,0 +1,25 @@
1
+ //#import $commonService:services/RegionUtil.jsx
2
+ //#import $owl_mall_region:services/modelService.jsx
3
+
4
+ var data = ctx.get("data");
5
+ var id = data.id;
6
+
7
+ // $.log("\nmall_auth_app....autoSetRegionFullPath_addAfter.jsx...begin...id=" + id);
8
+
9
+ var jRegion = owl_mall_regionService.get(id);
10
+ jRegion.region_path = RegionUtil.getRegionPath(jRegion, "name", "");
11
+ owl_mall_regionService.update(jRegion);
12
+
13
+ // $.log("\nmall_auth_app....autoSetRegionFullPath_addAfter.jsx...end...id=" + id);
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
@@ -0,0 +1,23 @@
1
+ //#import $commonService:services/RegionUtil.jsx
2
+ //#import $owl_mall_region:services/modelService.jsx
3
+
4
+ var data = ctx.get("data");
5
+ var id = data.id;
6
+
7
+ // $.log("\nmall_auth_app....autoSetRegionFullPath_updateBefore.jsx...begin...id=" + id);
8
+
9
+ data.region_path = RegionUtil.getRegionPath(data, "name", "");
10
+
11
+ // $.log("\nmall_auth_app....autoSetRegionFullPath_updateBefore.jsx...end...id=" + id);
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
@@ -0,0 +1,81 @@
1
+ {
2
+ "base_info": {
3
+ "#meta": {
4
+ "fieldLabel": "其他信息",
5
+ "showTitle": "no",
6
+ "position": "card",
7
+ "includeKey": "no",
8
+ "span": 2
9
+ },
10
+ "id":"string(16),listSize:14,searchable:true,unique:true,disabled:true,formSize:3;内部ID",
11
+ "pos":"string(16),listSize:4,defaultValue:100,searchable:false,required:true,formSize:1;排序",
12
+ "blank0": "space,formSize:4;空白",
13
+ "region_id":"string(16),listSize:8,searchable:true,required:true,formSize:3;地区ID",
14
+ "name":"string(16),listSize:8,searchable:true,required:true,formSize:3;地区名称",
15
+ "blank1": "space,formSize:2;空白",
16
+ "parent_id": "string(8),searchable:true,disabled:false,formSize:3;上级地区ID",
17
+ "parent_name": "string(8),searchable:true,disabled:true,formSize:3;上级地区名称",
18
+ "blank2": "space,formSize:2;空白",
19
+ "region_path": "string(16),searchable:false,disabled:true,formSize:6;地址全称"
20
+ },
21
+
22
+ "stand_info": {
23
+ "#meta": {
24
+ "fieldLabel": "标准信息",
25
+ "showTitle": "no",
26
+ "position": "card",
27
+ "includeKey": "no",
28
+ "span": 1
29
+ },
30
+ "country_code": "string(8),searchable:true,formSize:8;国家标准编码",
31
+ "country_name": "string(8),searchable:true,formSize:8;国家标准名称"
32
+ },
33
+
34
+ "ext_info": {
35
+ "#meta": {
36
+ "fieldLabel": "其他信息",
37
+ "showTitle": "no",
38
+ "position": "card",
39
+ "includeKey": "no",
40
+ "span": 1
41
+ },
42
+ "owl_createTime":"date,formSize:8,listSize:9,searchable:true,disabled:true;创建时间",
43
+ "owl_createUserId":"date,formSize:8,listSize:8,searchable:true,disabled:true;创建人"
44
+ },
45
+ "_t":"mall_region",
46
+ "#meta":{
47
+ "id": "<%=#region_id%>",
48
+ "rem":"地区管理",
49
+ "isPublic": true,
50
+ "projectName":"地区管理",
51
+ "parent":["platform"],
52
+ "isTree":true,
53
+ "parentField": "parent_id",
54
+ "visitType": [
55
+ "platform"
56
+ ],
57
+ "pos": 9,
58
+ "group": {
59
+ "id": "systemadmin",
60
+ "name": "系统管理",
61
+ "icon": "setting",
62
+ "pos": 30
63
+ },
64
+ "eventHandlers": [
65
+ {
66
+ "handlerId": "mall_region_eventHandlers_autoSetRegionFullPath_addAfter",
67
+ "pageId": "eventHandlers/autoSetRegionFullPath_addAfter.jsx",
68
+ "throwException": true,
69
+ "eventName": "mall_region_add_after",
70
+ "description": "添加后自动生成完整的地区全称"
71
+ },
72
+ {
73
+ "handlerId": "mall_region_eventHandlers_autoSetRegionFullPath_updateAfter",
74
+ "pageId": "eventHandlers/autoSetRegionFullPath_updateBefore.jsx",
75
+ "throwException": true,
76
+ "eventName": "mall_region_update_before",
77
+ "description": "修改前后自动生成完整的地区全称"
78
+ }
79
+ ]
80
+ }
81
+ }
@@ -1,7 +1,10 @@
1
1
  //#import $owl_mall_u:services/modelService.jsx
2
- //#import $org_user:services/modelService.jsx
2
+ //#import $owl_orgs:services/modelService.jsx
3
+ //#import $owl_org_member:services/modelService.jsx
3
4
  //#import @owl:utils/PermissionUtil.jsx
4
5
 
6
+ var pluginId = "addToOrgMemberPlugin";
7
+
5
8
  function main(){
6
9
  var params = JSON.parse($body);
7
10
  var data = params.data;
@@ -9,7 +12,7 @@ function main(){
9
12
 
10
13
 
11
14
  try{
12
- checkBackendPluginPermission("addUserToGroupPlugin");
15
+ checkBackendPluginPermission(pluginId);
13
16
  }catch(errmsg){
14
17
  var ret = {
15
18
  state:"err",
@@ -19,11 +22,6 @@ function main(){
19
22
  return;
20
23
  }
21
24
 
22
-
23
-
24
-
25
-
26
-
27
25
  var mobile = data.mobile;
28
26
  var admin = owl_mall_uService.getUniqueObj('mobile',mobile);
29
27
  if(!admin){
@@ -35,18 +33,30 @@ function main(){
35
33
  if(!admin){
36
34
  var ret = {
37
35
  state:"err",
38
- msg:"手机号不存在"
36
+ msg:"用户不存在"
39
37
  }
40
38
  out.print(JSON.stringify(ret));
41
39
  return;
42
40
  }
43
41
 
44
42
  // 检查用户是否已存在于org_user中
45
- var existingOrgUser = org_userService.getUniqueObj('userId',admin.id);
46
- if(existingOrgUser){
43
+ var existingOrgMember = owl_org_memberService.getUniqueObj('userId',admin.id);
44
+ if(existingOrgMember){
45
+ var ret = {
46
+ state:"err",
47
+ msg:"会员已经存在,请勿重复添加"
48
+ }
49
+ out.print(JSON.stringify(ret));
50
+ return;
51
+ }
52
+
53
+ var env = checklogin();
54
+ var orgId = env.orgId;
55
+ var org = owl_orgsService.get(orgId);
56
+ if(!org){
47
57
  var ret = {
48
58
  state:"err",
49
- msg:"用户已经存在,请勿重复添加"
59
+ msg:"组织不存在"
50
60
  }
51
61
  out.print(JSON.stringify(ret));
52
62
  return;
@@ -56,15 +66,20 @@ function main(){
56
66
  var orgUser = {
57
67
  userId: admin.id,
58
68
  name: admin.name || admin.loginId,
69
+ orgId:org.id,
70
+ orgName:org.name,
59
71
  loginId: admin.loginId,
60
72
  realName: admin.realName,
61
73
  nickName: admin.nickName,
62
74
  mobile: admin.mobile,
63
75
  email: admin.email,
64
- isEnable: 1
76
+ isEnable: 1,
77
+ orgId:env.orgId,
78
+ _orgId:env.orgId,
79
+ _orgIds:env.orgIds || [env.orgId]
65
80
  };
66
81
 
67
- org_userService.add(orgUser);
82
+ owl_org_memberService.add(orgUser);
68
83
 
69
84
  var ret = {
70
85
  state:"ok",
@@ -0,0 +1,84 @@
1
+ {
2
+ "id": "string(12),formSize:2,disabled:true,searchable:true;会员Id",
3
+ "userId": "string(12),isId:true;用户Id",
4
+ "orgId": "string(16),formSize:2,searchable:true,isId:true;所属商家Id",
5
+ "orgName": "string(16),formSize:2,searchable:true,isId:true;所属商家",
6
+ "isEnable": "choice,formSize:2,listSize:4,values:1_正常/0_冻结_#be0027,defaultValue:1,searchable:true,hidden:false;状态",
7
+ "name": "string(12),listSize:5,formSize:2,searchable:true;名称",
8
+ "loginId": "string(12),listSize:5,formSize:2,searchable:true,unique:true;登录Id",
9
+ "realName": "string(12),listSize:5,formSize:2,searchable:true;真实姓名",
10
+ "nickName": "string(12),listSize:5,formSize:2,searchable:true;昵称",
11
+ "mobile": "string(16),listSize:5,inputType:mobile,formSize:2,searchable:true,unique:true;手机",
12
+ "email": "string(64),formSize:2,searchable:true,unique:true;邮箱",
13
+
14
+ "org_member_cat": [
15
+ {
16
+ "#meta": {
17
+ "type": "embed",
18
+ "keyField": "id",
19
+ "fieldLabel": "客户分类",
20
+ "dataSourceModel": "org_member_cat",
21
+ "readOnly": "true",
22
+ "fields": [
23
+ "id",
24
+ "parent_id",
25
+ "name",
26
+ "fullPathIds",
27
+ "fullPathName",
28
+ "parentPathIds"
29
+ ],
30
+ "tab": "50",
31
+ "position": "card",
32
+ "mapping": {
33
+ "id": "id",
34
+ "parent_id": "parent_id",
35
+ "name": "name",
36
+ "fullPathIds": "fullPathIds",
37
+ "fullPathName": "fullPathName",
38
+ "parentPathIds": "parentPathIds"
39
+ }
40
+ },
41
+ "id": "string(10),searchable:true,showList:false;客户分类Id",
42
+ "name": "string(12),searchable:true;客户分类",
43
+ "fullPathName": "string(18),hidden:true;完整路径"
44
+ }
45
+ ],
46
+ "_t": "org_member",
47
+ "#meta": {
48
+ "rem": "客户会员",
49
+ "id": "<%=#orgId + '_' + userId%>",
50
+ "projectName": "电商",
51
+ "changeLogEnabled": true,
52
+
53
+ "parent": [
54
+ "platform"
55
+ ],
56
+ "visitType": [
57
+ "platform"
58
+ ],
59
+
60
+ "pos": 1,
61
+ "group": {
62
+ "id": "mall_user",
63
+ "name": "会员管理",
64
+ "icon": "user",
65
+ "pos": 6
66
+ },
67
+
68
+ "formPlugins": [
69
+ {
70
+ "label": "添加会员",
71
+ "id": "addToOrgMemberPlugin",
72
+ "action": "/owl_org_member/plugins/addToOrgMember.jsx",
73
+ "responseAction": "showMessage",
74
+ "inputForm": {
75
+ "label":"添加会员",
76
+ "fields": {
77
+ "mobile": "string(16),isMobile:true,formSize:8;手机或邮箱或loginId"
78
+ }
79
+ },
80
+ "position": "listItem,form"
81
+ }
82
+ ]
83
+ }
84
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "id": "string(32),isId:true,searchable:true;分类ID",
3
+ "name": "string(32),searchable:true;分类名称",
4
+ "fullPathName": "string(64),searchable:true;完整路径名称",
5
+ "parent_id": "string(32),searchable:true;父级分类ID",
6
+ "showOnTree": "choice,values:yes_是/no_否,defaultValue:yes,searchable:true;树节点上显示",
7
+ "_t": "org_member_cat",
8
+ "#meta": {
9
+ "rem": "客户分类",
10
+ "projectName": "客户分类",
11
+ "parent": ["platform"],
12
+ "isTree": true,
13
+ "parentField": "parent_id",
14
+ "visitType": ["platform"],
15
+ "pos": 1,
16
+ "group": {
17
+ "id": "mall_user",
18
+ "name": "会员管理",
19
+ "icon": "user",
20
+ "pos": 6
21
+ }
22
+
23
+ }
24
+ }
@@ -1,6 +1,8 @@
1
+ //#import session.js
1
2
  //#import $owl_permission:services/modelService.jsx
2
3
  //#import $owlPermission:services/RolesService.jsx
3
-
4
+ //#import $owl_server_token:services/modelService.jsx
5
+ //#import $owl_backend_session:services/modelService.jsx
4
6
  function getPermissions(roleId){
5
7
  var searchArgs = {
6
8
  roleId: roleId
@@ -172,9 +174,7 @@ function checkBackendPluginPermission(pluginId){
172
174
  throw "用户角色异常";
173
175
  }
174
176
 
175
- if(!checkPluginPermissionByRoleId( pluginId,rroleId)){
177
+ if(!checkPluginPermissionByRoleId( pluginId,roleId)){
176
178
  throw "没有权限执行此操作";
177
179
  }
178
-
179
-
180
180
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owl-cli",
3
- "version": "7.20.0",
3
+ "version": "7.23.0",
4
4
  "main": "index.js",
5
5
  "preferGlobal": true,
6
6
  "bin": {
@@ -1,51 +0,0 @@
1
- {
2
- "id": "string(12),formSize:2,disabled:true,searchable:true;客户Id",
3
- "userId": "string(12),isId:true;用户Id",
4
- "orgId": "string(16),formSize:2,searchable:true;所属商家Id",
5
- "orgName": "string(16),formSize:2,searchable:true;所属商家",
6
- "isEnable": "choice,formSize:2,listSize:4,values:1_正常/0_冻结_#be0027,defaultValue:1,searchable:true,hidden:false;状态",
7
- "name": "string(12),listSize:5,formSize:2,searchable:true;名称",
8
- "loginId": "string(12),listSize:5,formSize:2,searchable:true,unique:true;登录Id",
9
- "realName": "string(12),listSize:5,formSize:2,searchable:true;真实姓名",
10
- "nickName": "string(12),listSize:5,formSize:2,searchable:true;昵称",
11
- "mobile": "string(16),listSize:5,inputType:mobile,formSize:2,searchable:true,unique:true;手机",
12
- "email": "string(64),formSize:2,searchable:true,unique:true;邮箱",
13
- "_t": "org_user",
14
- "#meta": {
15
- "rem": "客户管理",
16
- "id": "<%=#orgId + '_' + userId%>",
17
- "projectName": "电商",
18
- "changeLogEnabled": true,
19
-
20
- "parent": [
21
- "platform"
22
- ],
23
- "visitType": [
24
- "platform"
25
- ],
26
-
27
- "pos": 1,
28
- "group": {
29
- "id": "mall_user",
30
- "name": "会员管理",
31
- "icon": "user",
32
- "pos": 6
33
- },
34
-
35
- "formPlugins": [
36
- {
37
- "label": "添加客户",
38
- "id": "addUserToGroupPlugin",
39
- "action": "/owl_org_user/plugins/addUserToGroup.jsx",
40
- "responseAction": "showMessage",
41
- "inputForm": {
42
- "label":"添加客户",
43
- "fields": {
44
- "mobile": "string(16),isMobile:true,formSize:8;手机或邮箱或loginId"
45
- }
46
- },
47
- "position": "listItem,form"
48
- }
49
- ]
50
- }
51
- }