@steedos/service-core-objects 3.0.0-beta.98 → 3.0.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.
- package/README.md +3 -3
- package/main/default/applications/.gitkeep +0 -0
- package/main/default/applications/admin.app.yml +179 -0
- package/main/default/client/socket.client.js +1 -1
- package/main/default/objectTranslations/announcements.en/announcements.en.objectTranslation.yml +37 -0
- package/main/default/objectTranslations/announcements.zh-CN/announcements.zh-CN.objectTranslation.yml +37 -0
- package/main/default/objectTranslations/audit_records.en/audit_records.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/company.en/company.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/logs.en/logs.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/object_fields.en/object_fields.en.objectTranslation.yml +3 -3
- package/main/default/objectTranslations/object_fields.zh-CN/object_fields.zh-CN.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/object_functions.en/object_functions.en.objectTranslation.yml +1 -5
- package/main/default/objectTranslations/object_functions.zh-CN/object_functions.zh-CN.objectTranslation.yml +1 -5
- package/main/default/objectTranslations/objects.en/objects.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/operation_logs.en/operation_logs.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/organizations.en/organizations.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/process_delegation_rules.en/process_delegation_rules.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/reports.en/reports.en.objectTranslation.yml +7 -1
- package/main/default/objectTranslations/reports.zh-CN/reports.zh-CN.objectTranslation.yml +7 -1
- package/main/default/objectTranslations/sessions.en/sessions.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/settings.en/settings.en.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/space_users.en/space_users.en.objectTranslation.yml +1 -1
- package/main/default/objects/_base/base.client.js +113 -114
- package/main/default/objects/_base/base.object.js +225 -217
- package/main/default/objects/_base/base.recordFieldAudit.trigger.js +3 -0
- package/main/default/objects/_base/base.trigger.js +7 -144
- package/main/default/objects/audit_records.object.yml +1 -1
- package/main/default/objects/cms_files/cms_files.object.yml +1 -1
- package/main/default/objects/company/company.object.yml +1 -1
- package/main/default/objects/license.object.yml +13 -33
- package/main/default/objects/logs/logs.object.yml +1 -1
- package/main/default/objects/notifications/fields/related_to.field.yml +12 -4
- package/main/default/objects/object_fields/fields/description.field.yml +11 -2
- package/main/default/objects/object_fields/fields/required.field.yml +1 -1
- package/main/default/objects/object_fields/listviews/all.listview.yml +1 -1
- package/main/default/objects/object_functions/buttons/open_api.button.yml +1 -3
- package/main/default/objects/object_functions/fields/script.field.yml +3 -2
- package/main/default/objects/object_functions/listviews/all.listview.yml +0 -1
- package/main/default/objects/object_functions/listviews/customize.listview.yml +0 -1
- package/main/default/objects/object_functions/object_functions.object.yml +1 -1
- package/main/default/objects/object_listviews/fields/extra_columns.field.yml +1 -1
- package/main/default/objects/object_triggers/fields/handler.field.yml +3 -2
- package/main/default/objects/object_webhooks/object_webhooks.object.yml +1 -1
- package/main/default/objects/objects/buttons/show_object.button.js +1 -1
- package/main/default/objects/permission_set/buttons/copy.button.yml +114 -0
- package/main/default/objects/permission_set/buttons/set_permission_tabs.button.yml +166 -0
- package/main/default/objects/{permission_set.object.yml → permission_set/permission_set.object.yml} +1 -1
- package/main/default/objects/reports.object.yml +125 -258
- package/main/default/objects/roles.object.yml +1 -0
- package/main/default/objects/sessions.object.yml +1 -1
- package/main/default/objects/space_users/buttons/clear_login_tokens.button.yml +1 -1
- package/main/default/objects/space_users/buttons/setPassword.button.js +12 -12
- package/main/default/objects/space_users/fields/password_expired.field.yml +1 -1
- package/main/default/pages/about.page.amis.json +21 -4
- package/main/default/pages/apps_form.page.amis.json +2 -1
- package/main/default/pages/cfs_files_record_preview.page.amis.json +8 -8
- package/main/default/pages/cms_files_preview.page.amis.json +7 -7
- package/main/default/pages/object_detail.page.amis.json +1 -1
- package/main/default/pages/space_users_list.page.amis.json +5 -2
- package/main/default/routes/amis_button_design.router.js +2 -12
- package/main/default/routes/amis_listview_design.router.js +2 -11
- package/main/default/routes/object_fields_design.ejs +2 -1
- package/main/default/routes/object_fields_design.router.js +1 -14
- package/main/default/services/spaces.service.js +1 -1
- package/main/default/services/users.service.js +5 -2
- package/main/default/tabs/admin_bull_dashboard.tab.yml +2 -1
- package/main/default/tabs/admin_object_functions.tab.yml +21 -0
- package/main/default/tabs/admin_swagger.tab.yml +22 -0
- package/main/default/translations/en.translation.yml +2 -2
- package/main/default/triggers/space_users.trigger.js +3 -3
- package/package.json +3 -4
- package/public/platform.css +5 -0
- package/main/default/objectTranslations/forms.en/forms.en.objectTranslation.yml +0 -191
- package/main/default/objectTranslations/forms.zh-CN/forms.zh-CN.objectTranslation.yml +0 -194
- package/main/default/objectTranslations/instances.en/instances.en.objectTranslation.yml +0 -211
- package/main/default/objectTranslations/instances.zh-CN/instances.zh-CN.objectTranslation.yml +0 -208
- package/main/default/objects/object_functions/fields/is_rest.field.yml +0 -5
- package/main/default/objects/spaces/buttons/upgrade.button.js +0 -12
- package/main/default/objects/spaces/buttons/upgrade.button.yml +0 -4
|
@@ -52,120 +52,119 @@ Steedos.StandardObjects = {
|
|
|
52
52
|
return permissions && permissions["allowDelete"];
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
// },
|
|
55
|
+
standard_approve:{
|
|
56
|
+
visible: function (object_name, record_id, record_permissions, props) {
|
|
57
|
+
if (!record_id) {
|
|
58
|
+
/*只在详细界面显示这个action*/
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
var object_workflow, record;
|
|
62
|
+
if (record_permissions && !record_permissions["allowEdit"]) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
record = props.record;
|
|
66
|
+
// record_permissions = Creator.getRecordPermissions(object_name, record, Meteor.userId());
|
|
67
|
+
// if (record_permissions && !record_permissions["allowEdit"]) {
|
|
68
|
+
// return false;
|
|
69
|
+
// }
|
|
70
|
+
object_workflow = _.find(Steedos.object_workflows, function (ow) {
|
|
71
|
+
return ow.object_name === object_name && (!ow.sync_direction || ow.sync_direction == 'both' || ow.sync_direction == 'obj_to_ins');
|
|
72
|
+
});
|
|
73
|
+
if (!object_workflow) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
if (record && record.instances && record.instances.length > 0) {
|
|
77
|
+
return false;
|
|
78
|
+
}else if(record && !_.has(record,'instances') ){
|
|
79
|
+
// 如果record存在,且record的instances字段不存在,则再查询一次
|
|
80
|
+
var queryResult = Steedos.authRequest("/graphql", {
|
|
81
|
+
type: 'POST',
|
|
82
|
+
async: false,
|
|
83
|
+
data: JSON.stringify({
|
|
84
|
+
query: `{record:${object_name}__findOne(id: "${record_id}"){instances}}`
|
|
85
|
+
}),
|
|
86
|
+
contentType: 'application/json',
|
|
87
|
+
error: function () { }
|
|
88
|
+
});
|
|
89
|
+
var recordDoc = queryResult && queryResult.data && queryResult.data.record;
|
|
90
|
+
if (recordDoc && recordDoc.instances && recordDoc.instances.length > 0) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
standard_view_instance:{
|
|
98
|
+
visible: function (object_name, record_id, record_permissions, props) {
|
|
99
|
+
if (!record_id) {
|
|
100
|
+
/*只在详细界面显示这个action*/
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
var record = props.record;
|
|
104
|
+
if (record && !_.isEmpty(record.instances)) {
|
|
105
|
+
return true;
|
|
106
|
+
}else if(record && !_.has(record,'instances') ){
|
|
107
|
+
// 如果record存在且record的instances字段不存在,则再查询一次
|
|
108
|
+
var queryResult = Steedos.authRequest("/graphql", {
|
|
109
|
+
type: 'POST',
|
|
110
|
+
async: false,
|
|
111
|
+
data: JSON.stringify({
|
|
112
|
+
query: `{record:${object_name}__findOne(id: "${record_id}"){instances}}`
|
|
113
|
+
}),
|
|
114
|
+
contentType: 'application/json',
|
|
115
|
+
error: function () { }
|
|
116
|
+
});
|
|
117
|
+
var recordDoc = queryResult && queryResult.data && queryResult.data.record;
|
|
118
|
+
if (recordDoc && recordDoc.instances && recordDoc.instances.length > 0) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return false;
|
|
123
|
+
},
|
|
124
|
+
todo: function () {
|
|
125
|
+
console.log(this)
|
|
126
|
+
var record = this.record.record;
|
|
127
|
+
var data, instanceId, uobj, url;
|
|
128
|
+
if (!record.instances || !record.instances[0]) {
|
|
129
|
+
// 如果record存在且record的instances字段不存在,则再查询一次
|
|
130
|
+
var queryResult = Steedos.authRequest("/graphql", {
|
|
131
|
+
type: 'POST',
|
|
132
|
+
async: false,
|
|
133
|
+
data: JSON.stringify({
|
|
134
|
+
query: `{record:${this.object_name}__findOne(id: "${this.record_id}"){instances}}`
|
|
135
|
+
}),
|
|
136
|
+
contentType: 'application/json',
|
|
137
|
+
error: function () { }
|
|
138
|
+
});
|
|
139
|
+
var recordDoc = queryResult && queryResult.data && queryResult.data.record;
|
|
140
|
+
if (recordDoc && recordDoc.instances && recordDoc.instances.length > 0) {
|
|
141
|
+
instanceId = recordDoc.instances[0]._id;
|
|
142
|
+
}
|
|
143
|
+
} else {
|
|
144
|
+
instanceId = record.instances[0]._id;
|
|
145
|
+
}
|
|
146
|
+
if (!instanceId) {
|
|
147
|
+
console.error('instanceId not exists');
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
Steedos.authRequest(Steedos.absoluteUrl(`api/workflow/instance/check_is_removed/${instanceId}`), {
|
|
151
|
+
type: 'POST',
|
|
152
|
+
async: false,
|
|
153
|
+
data: JSON.stringify({
|
|
154
|
+
objectName: this.object_name,
|
|
155
|
+
recordId: this.record_id
|
|
156
|
+
}),
|
|
157
|
+
contentType: 'application/json',
|
|
158
|
+
success: function (res) {
|
|
159
|
+
Steedos.openWindow(Steedos.absoluteUrl(`api/workflow/instance/${instanceId}`))
|
|
160
|
+
},
|
|
161
|
+
error: function (res) {
|
|
162
|
+
// toastr.error('未找到申请单,可能已被删除,请重新发起审批。');
|
|
163
|
+
FlowRouter.reload();
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
},
|
|
169
168
|
standard_submit_for_approval:{
|
|
170
169
|
visible: function (object_name, record_id) {
|
|
171
170
|
return Steedos.ProcessManager.allowSubmit(object_name, record_id);
|