@steedos/standard-object-database 2.3.5 → 2.4.0-beta.11

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.
@@ -70,6 +70,8 @@ fields:
70
70
  value: html
71
71
  - label: Code
72
72
  value: code
73
+ - label: Markdown
74
+ value: markdown
73
75
  - label: Select
74
76
  value: select
75
77
  - label: Boolean
@@ -18,7 +18,7 @@ amis_schema: |-
18
18
  "weight": 0
19
19
  }
20
20
  },
21
- "className": "slds-button slds-button--neutral p-0"
21
+ "className": ""
22
22
  }
23
23
  ],
24
24
  "regions": [
@@ -31,23 +31,14 @@ amis_schema: |-
31
31
  },
32
32
  "tooltip": "重置列表视图Amis Schema",
33
33
  "tooltipPlacement": "top",
34
- "className": "slds-button slds-button--neutral p-0"
34
+ "className": ""
35
35
  }
36
36
  ],
37
37
  "regions": [
38
38
  "body"
39
39
  ],
40
40
  "data": {
41
- "context": {
42
- "rootUrl": "https://5000-steedos-steedosplatform-uwiv6wkdp2o.ws-us77.gitpod.io"
43
- },
44
- "app_id": "",
45
- "tab_id": "",
46
- "object_name": "",
47
- "dataComponentId": "",
48
- "record_id": "",
49
- "record": {},
50
- "permissions": {}
41
+ "context": "${context}"
51
42
  },
52
43
  "id": "u:9a37e91e4b8d",
53
44
  "bodyClassName": "p-0"
@@ -0,0 +1,87 @@
1
+ name: delete_object
2
+ amis_schema: |-
3
+ {
4
+ "type": "service",
5
+ "body": [
6
+ {
7
+ "type": "button",
8
+ "label": "删除",
9
+ "id": "u:delete_object",
10
+ "onEvent": {
11
+ "click": {
12
+ "actions": [
13
+ {
14
+ "actionType": "dialog",
15
+ "dialog": {
16
+ "type": "dialog",
17
+ "title": "删除对象: ${record.label}",
18
+ "body": [
19
+ {
20
+ "type": "tpl",
21
+ "tpl": "<div>\n<div style=\"text-align: left;\">删除一个自定义对象进行以下操作:</div>\n<ul>\n<li style=\"text-align: left;\">删除对象的字段和按钮</li>\n<li style=\"text-align: left;\">删除对象的选项卡和列表视图删除对象的页面布局</li>\n<li style=\"text-align: left;\">删除对象的权限</li>\n<li style=\"text-align: left;\">删除对象的验证规则</li>\n<li style=\"text-align: left;\">删除对象的限制规则</li>\n<li style=\"text-align: left;\">删除对象的共享规则</li>\n<li style=\"text-align: left;\">删除使用该对象的流程映射</li>\n<li style=\"text-align: left;\">删除使用该对象的开放流程</li>\n<li style=\"text-align: left;\">删除使用该对象的页面</li>\n</ul>\n</div>",
22
+ "inline": true,
23
+ "id": "u:6d0819fc0bda"
24
+ }
25
+ ],
26
+ "id": "u:b5c0f98dc113",
27
+ "closeOnEsc": false,
28
+ "closeOnOutside": false,
29
+ "showCloseButton": true,
30
+ "data": {
31
+ "&": "$$",
32
+ "record": "${record}"
33
+ },
34
+ "onEvent": {
35
+ "confirm": {
36
+ "weight": 0,
37
+ "actions": [
38
+ {
39
+ "componentId": "",
40
+ "args": {
41
+ "api": {
42
+ "url": "${context.rootUrl}/graphql",
43
+ "method": "post",
44
+ "data": {
45
+ "&": "$$",
46
+ "record": "${record}"
47
+ },
48
+ "requestAdaptor": "console.log(`api`, api);const record = api.body.record; \napi.data = {\n query: `\n mutation{\n objects__delete(id: \"${record._id}\")\n }\n `\n}",
49
+ "headers": {
50
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
51
+ }
52
+ },
53
+ "messages": {}
54
+ },
55
+ "actionType": "ajax"
56
+ },
57
+ {
58
+ "componentId": "",
59
+ "args": {
60
+ "url": "/app/admin/objects/grid/all"
61
+ },
62
+ "actionType": "link"
63
+ }
64
+ ]
65
+ }
66
+ }
67
+ }
68
+ }
69
+ ],
70
+ "weight": 0
71
+ }
72
+ }
73
+ }
74
+ ],
75
+ "regions": [
76
+ "body"
77
+ ],
78
+ "data": {
79
+ },
80
+ "bodyClassName": "p-0",
81
+ "id": "u:46d1821365fc"
82
+ }
83
+ is_enable: true
84
+ label: 删除
85
+ 'on': record_only_more
86
+ type: amis_button
87
+ visible: true
@@ -1,6 +1,9 @@
1
1
  module.exports = {
2
2
  show_object: function (object_name, record_id, item_element) {
3
3
  var record = this.record || Creator.getObjectById(record_id);
4
+ if(record && record.record){
5
+ record = record.record;
6
+ }
4
7
  if(!record){
5
8
  return toastr.error("未找到记录");
6
9
  }
@@ -19,15 +22,16 @@ module.exports = {
19
22
  }
20
23
  }
21
24
 
22
- window.stores.API.client.sobject(record.name).getConfig().then((res)=>{
23
- if(res.idFieldName){
24
- window.open(Creator.getRelativeUrl("/app/-/" + record.name));
25
- }else{
26
- return toastr.error("请配置主键字段");
27
- }
28
- }).catch(function(err){
29
- return window.toastr.error(err.message);
30
- })
25
+ window.open(Creator.getRelativeUrl("/app/admin/" + record.name));
26
+ // SteedosUI.Object.getUISchema(record.name).then((res)=>{
27
+ // if(res.idFieldName){
28
+ // window.open(Creator.getRelativeUrl("/app/-/" + record.name));
29
+ // }else{
30
+ // return toastr.error("请配置主键字段");
31
+ // }
32
+ // }).catch(function(err){
33
+ // return window.toastr.error(err.message);
34
+ // })
31
35
 
32
36
 
33
37
 
@@ -87,59 +91,59 @@ module.exports = {
87
91
  return true;
88
92
  }
89
93
  },
90
- delete_object: function (object_name, record_id, fields) {
91
- var record = Creator.getObjectRecord(object_name, record_id, 'name');
92
- SteedosUI.showModal(stores.ComponentRegistry.components.ObjectForm, {
93
- name: "remove-object",
94
- title: '删除对象',
95
- width: '540px',
96
- layout: 'horizontal',
97
- modalProps: {
98
- width: "540px",
99
- style: {
100
- width: "540px",
101
- maxWidth: "540px",
102
- minWidth: "480px"
103
- }
104
- },
105
- initialValues:{
106
- md: "删除一个自定义对象进行以下操作:\n\n* 删除对象的字段和按钮\n* 删除对象的选项卡和列表视图\n* 删除对象的页面布局\n* 删除对象的权限\n* 删除对象的验证规则\n* 删除对象的限制规则\n* 删除对象的共享规则\n* 删除使用该对象的流程映射\n* 删除使用该对象的开放流程\n* 删除使用该对象的页面。\n\n\\\n"
107
- },
108
- objectSchema: {
109
- fields: {
110
- md: {
111
- type: 'html',
112
- label: ' ',
113
- is_wide: true,
114
- readonly: true,
115
- }
116
- }
117
- },
118
- onFinish: async (values = {}) => {
119
- return new Promise((resolve, reject) => {
120
- window.$("body").addClass("loading");
121
- Creator.odata.delete(object_name, record_id, function() {
122
- var info= t('creator_record_remove_swal_suc');
123
- window.toastr.success(info);
124
- resolve(true)
125
- if(FlowRouter.current().route.path.endsWith("/:record_id")){
126
- var app_id = Session.get("app_id")
127
- var object_name = Session.get("object_name")
128
- FlowRouter.go(Creator.getListViewUrl(object_name, app_id, 'all'));
129
- }else{
130
- FlowRouter.reload();
131
- }
132
- window.$("body").removeClass("loading");
94
+ // delete_object: function (object_name, record_id, fields) {
95
+ // var record = Creator.getObjectRecord(object_name, record_id, 'name');
96
+ // SteedosUI.showModal(stores.ComponentRegistry.components.ObjectForm, {
97
+ // name: "remove-object",
98
+ // title: '删除对象',
99
+ // width: '540px',
100
+ // layout: 'horizontal',
101
+ // modalProps: {
102
+ // width: "540px",
103
+ // style: {
104
+ // width: "540px",
105
+ // maxWidth: "540px",
106
+ // minWidth: "480px"
107
+ // }
108
+ // },
109
+ // initialValues:{
110
+ // md: "删除一个自定义对象进行以下操作:\n\n* 删除对象的字段和按钮\n* 删除对象的选项卡和列表视图\n* 删除对象的页面布局\n* 删除对象的权限\n* 删除对象的验证规则\n* 删除对象的限制规则\n* 删除对象的共享规则\n* 删除使用该对象的流程映射\n* 删除使用该对象的开放流程\n* 删除使用该对象的页面。\n\n\\\n"
111
+ // },
112
+ // objectSchema: {
113
+ // fields: {
114
+ // md: {
115
+ // type: 'html',
116
+ // label: ' ',
117
+ // is_wide: true,
118
+ // readonly: true,
119
+ // }
120
+ // }
121
+ // },
122
+ // onFinish: async (values = {}) => {
123
+ // return new Promise((resolve, reject) => {
124
+ // window.$("body").addClass("loading");
125
+ // Creator.odata.delete(object_name, record_id, function() {
126
+ // var info= t('creator_record_remove_swal_suc');
127
+ // window.toastr.success(info);
128
+ // resolve(true)
129
+ // if(FlowRouter.current().route.path.endsWith("/:record_id")){
130
+ // var app_id = Session.get("app_id")
131
+ // var object_name = Session.get("object_name")
132
+ // FlowRouter.go(Creator.getListViewUrl(object_name, app_id, 'all'));
133
+ // }else{
134
+ // FlowRouter.reload();
135
+ // }
136
+ // window.$("body").removeClass("loading");
133
137
 
134
- }, function(error) {
135
- toastr.error(error.message);
136
- window.$("body").removeClass("loading");
137
- reject(false);
138
- });
139
- })
140
- }
141
- }, null, { iconPath: '/assets/icons' })
142
- },
138
+ // }, function(error) {
139
+ // toastr.error(error.message);
140
+ // window.$("body").removeClass("loading");
141
+ // reject(false);
142
+ // });
143
+ // })
144
+ // }
145
+ // }, null, { iconPath: '/assets/icons' })
146
+ // },
143
147
  delete_objectVisible: function(object_name, record_id, record_permissions, record){
144
148
  if(!Creator.isSpaceAdmin()){
145
149
  return false
@@ -479,25 +479,25 @@ actions:
479
479
  # label: Export
480
480
  # visible: true
481
481
  # on: record
482
- form:
483
- afterInsert: !!js/function |
484
- function(){
485
- $("body").addClass('loading');
486
- setTimeout(function(){
487
- window.location.reload();
488
- }, 2500);
489
- }
490
- afterView: !!js/function |
491
- function(){
492
- $("div", $(".crm-header-title")).css("display", "inline");
493
- window.stores.API.client.sobject(this.doc.name).getConfig().then((res)=>{
494
- if(!res.idFieldName){
495
- return $(".crm-header-title").append('<span class="text-xs inline-block py-1 px-2.5 leading-none text-center whitespace-nowrap align-baseline font-bold bg-red-600 text-white rounded">'+TAPi18n.__("请配置主键字段")+'</span>')
496
- }
497
- }).catch(function(err){
498
- return console.error(err.message);
499
- });
500
- }
482
+ # form:
483
+ # afterInsert: !!js/function |
484
+ # function(){
485
+ # $("body").addClass('loading');
486
+ # setTimeout(function(){
487
+ # window.location.reload();
488
+ # }, 2500);
489
+ # }
490
+ # afterView: !!js/function |
491
+ # function(){
492
+ # $("div", $(".crm-header-title")).css("display", "inline");
493
+ # window.stores.API.client.sobject(this.doc.name).getConfig().then((res)=>{
494
+ # if(!res.idFieldName){
495
+ # return $(".crm-header-title").append('<span class="text-xs inline-block py-1 px-2.5 leading-none text-center whitespace-nowrap align-baseline font-bold bg-red-600 text-white rounded">'+TAPi18n.__("请配置主键字段")+'</span>')
496
+ # }
497
+ # }).catch(function(err){
498
+ # return console.error(err.message);
499
+ # });
500
+ # }
501
501
  permission_set:
502
502
  user:
503
503
  allowCreate: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-object-database",
3
- "version": "2.3.5",
3
+ "version": "2.4.0-beta.11",
4
4
  "main": "package.service.js",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -15,5 +15,5 @@
15
15
  },
16
16
  "repository": {},
17
17
  "license": "MIT",
18
- "gitHead": "a817e9bda1620c21a3da1876d01238b1fc1df828"
18
+ "gitHead": "17351bad46d1bcf9f334e5763bc78755cab496ba"
19
19
  }
@@ -2,7 +2,7 @@
2
2
  * @Author: sunhaolin@hotoa.com
3
3
  * @Date: 1985-10-26 16:15:00
4
4
  * @LastEditors: sunhaolin@hotoa.com
5
- * @LastEditTime: 2022-07-29 13:29:26
5
+ * @LastEditTime: 2022-12-09 13:41:16
6
6
  * @Description:
7
7
  */
8
8
  "use strict";
@@ -22,7 +22,8 @@ module.exports = {
22
22
  settings: {
23
23
  packageInfo: {
24
24
  path: __dirname,
25
- name: packageName
25
+ name: packageName,
26
+ isPackage: false
26
27
  }
27
28
  },
28
29