@steedos/service-core-objects 3.0.0-beta.8 → 3.0.0-beta.80
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/main/default/client/{topic.client.js → css.client.js} +2 -1
- package/main/default/client/socket.client.js +118 -0
- package/main/default/objectTranslations/base.en/base.en.objectTranslation.yml +2 -0
- package/main/default/objectTranslations/base.zh-CN/base.zh-CN.objectTranslation.yml +2 -0
- package/main/default/objectTranslations/datasources.zh-CN/datasources.zh-CN.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/object_actions.zh-CN/object_actions.zh-CN.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/object_fields.en/object_fields.en.objectTranslation.yml +1 -5
- package/main/default/objectTranslations/object_fields.zh-CN/object_fields.zh-CN.objectTranslation.yml +3 -3
- package/main/default/objectTranslations/object_functions.zh-CN/object_functions.zh-CN.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/object_layouts.zh-CN/object_layouts.zh-CN.objectTranslation.yml +1 -1
- package/main/default/objectTranslations/object_listviews.en/object_listviews.en.objectTranslation.yml +0 -1
- package/main/default/objectTranslations/object_listviews.zh-CN/object_listviews.zh-CN.objectTranslation.yml +2 -3
- package/main/default/objectTranslations/objects.en/objects.en.objectTranslation.yml +13 -18
- package/main/default/objectTranslations/objects.zh-CN/objects.zh-CN.objectTranslation.yml +29 -25
- package/main/default/objects/_base/base.client.js +11 -10
- package/main/default/objects/_base/base.object.js +279 -105
- package/main/default/objects/_base/base.object.yml +8 -0
- package/main/default/objects/announcements.object.yml +68 -0
- package/main/default/objects/apps/apps.object.yml +25 -69
- package/main/default/objects/apps/buttons/disable.button.js +3 -1
- package/main/default/objects/apps/buttons/enable.button.js +3 -1
- package/main/default/objects/audit_records.object.yml +1 -1
- package/main/default/objects/cms_files/cms_files.object.yml +2 -1
- package/main/default/objects/favorites.object.yml +65 -0
- package/main/default/objects/keyvalue/keyvalue.object.yml +1 -0
- package/main/default/objects/logs/logs.object.yml +1 -0
- package/main/default/objects/object_fields/buttons/recomputeFormulaValues.button.js +6 -2
- package/main/default/objects/object_fields/buttons/recomputeSummaryValues.button.js +6 -2
- package/main/default/objects/object_fields/buttons/standard_new.button.js +1 -1
- package/main/default/objects/object_fields/fields/_name.field.yml +1 -0
- package/main/default/objects/object_fields/fields/auto_fill_mapping.$.to.field.yml +28 -13
- package/main/default/objects/object_fields/fields/name.field.yml +1 -0
- package/main/default/objects/object_fields/fields/options.field.yml +1 -0
- package/main/default/objects/object_fields/fields/summary_filters.$.field.field.yml +16 -9
- package/main/default/objects/object_fields/fields/summary_filters.$.operation.field.yml +26 -29
- package/main/default/objects/object_fields/listviews/all.listview.yml +3 -1
- package/main/default/objects/object_fields/listviews/customize.listview.yml +3 -1
- package/main/default/objects/object_functions/fields/script.field.yml +1 -1
- package/main/default/objects/object_listviews/buttons/customize.button.js +36 -30
- package/main/default/objects/object_listviews/buttons/showDesign.button.js +6 -6
- package/main/default/objects/object_listviews/fields/adaptor.field.yml +2 -2
- package/main/default/objects/object_listviews/fields/crudDataFilter.field.yml +10 -0
- package/main/default/objects/object_listviews/fields/enable_amis_schema.field.yml +1 -0
- package/main/default/objects/object_listviews/fields/requestAdaptor.field.yml +2 -2
- package/main/default/objects/object_triggers/fields/handler.field.yml +1 -1
- package/main/default/objects/objects/buttons/custom.button.js +6 -35
- package/main/default/objects/objects/buttons/custom.button.yml +85 -1
- package/main/default/objects/objects/buttons/design_fields_layout.button.yml +1 -1
- package/main/default/objects/objects/buttons/reset.button.yml +2 -1
- package/main/default/objects/objects/buttons/show_object.button.js +2 -29
- package/main/default/objects/objects/fields/compactLayouts.field.yml +2 -2
- package/main/default/objects/objects/fields/enable_audit.field.yml +5 -0
- package/main/default/objects/objects/fields/enable_chatter.field.yml +5 -4
- package/main/default/objects/objects/fields/enable_dataloader.field.yml +0 -1
- package/main/default/objects/objects/fields/enable_enhanced_lookup.field.yml +0 -4
- package/main/default/objects/objects/fields/enable_events.field.yml +2 -2
- package/main/default/objects/objects/fields/enable_files.field.yml +1 -1
- package/main/default/objects/objects/fields/enable_form_tabs.field.yml +1 -2
- package/main/default/objects/objects/fields/enable_inline_edit.field.yml +1 -1
- package/main/default/objects/objects/fields/enable_instances.field.yml +2 -2
- package/main/default/objects/objects/fields/enable_lock_detail.field.yml +0 -1
- package/main/default/objects/objects/fields/enable_notes.field.yml +2 -2
- package/main/default/objects/objects/fields/enable_tasks.field.yml +1 -1
- package/main/default/objects/objects/fields/enable_tree.field.yml +0 -1
- package/main/default/objects/objects/fields/field_groups.field.yml +1 -1
- package/main/default/objects/objects/fields/in_development.field.yml +0 -1
- package/main/default/objects/objects/fields/is_deleted.field.yml +1 -0
- package/main/default/objects/objects/fields/name.field.yml +1 -4
- package/main/default/objects/objects/fields/table_name.field.yml +0 -1
- package/main/default/objects/objects/listviews/all.listview.yml +4 -1
- package/main/default/objects/objects/listviews/customize.listview.yml +3 -1
- package/main/default/objects/objects/listviews/deleted.listview.yml +3 -1
- package/main/default/objects/objects/listviews/metadata.listview.yml +3 -1
- package/main/default/objects/objects/listviews/system.listview.yml +3 -1
- package/main/default/objects/objects/objects.object.yml +1 -1
- package/main/default/objects/permission_set.object.yml +0 -4
- package/main/default/objects/queue_import.object.yml +15 -1
- package/main/default/objects/roles.object.yml +1 -5
- package/main/default/objects/space_users/buttons/standard_edit.button.js +0 -1
- package/main/default/objects/space_users/fields/locale.field.yml +2 -1
- package/main/default/pages/cms_files_preview.page.amis.json +20 -1
- package/main/default/pages/object_detail.page.amis.json +17 -11
- package/main/default/pages/object_fields_form.page.amis.json +0 -11
- package/main/default/pages/object_validation_rules_form.page.amis.json +38 -0
- package/main/default/pages/object_validation_rules_form.page.yml +13 -0
- package/main/default/pages/object_webhooks_form.page.amis.json +1 -1
- package/main/default/pages/space_users_list.page.amis.json +2 -2
- package/main/default/routes/importRecords.router.js +87 -0
- package/main/default/routes/notifications.router.js +113 -0
- package/main/default/routes/object_fields_design.ejs +0 -7
- package/main/default/services/app-design.service.js +2 -1
- package/main/default/services/notifications.service.js +190 -0
- package/main/default/services/users.service.js +1 -1
- package/main/default/triggers/objects_set_default_object_properties_trigger.trigger.yml +9 -6
- package/main/default/triggers/queue_import.trigger.js +16 -0
- package/package.json +4 -3
- package/package.service.js +3 -2
- package/public/platform.css +62 -0
- package/public/topic.css +17 -37
- package/main/default/objectTranslations/flow_positions.en/flow_positions.en.objectTranslation.yml +0 -19
- package/main/default/objectTranslations/flow_positions.zh-CN/flow_positions.zh-CN.objectTranslation.yml +0 -19
- package/main/default/objectTranslations/flow_roles.en/flow_roles.en.objectTranslation.yml +0 -11
- package/main/default/objectTranslations/flow_roles.zh-CN/flow_roles.zh-CN.objectTranslation.yml +0 -14
- package/main/default/objectTranslations/flows.en/flows.en.objectTranslation.yml +0 -317
- package/main/default/objectTranslations/flows.zh-CN/flows.zh-CN.objectTranslation.yml +0 -314
- package/main/default/objects/apps/buttons/amis_edit.button.yml +0 -39
- package/main/default/objects/apps/buttons/amis_new.button.yml +0 -43
- package/main/default/objects/flows/flows.object.yml +0 -1089
- package/main/default/objects/object_actions/buttons/customize.button.js +0 -33
- package/main/default/objects/object_actions/buttons/customize.button.yml +0 -3
- package/main/default/objects/object_listviews/buttons/copy.button.js +0 -58
- package/main/default/objects/object_listviews/buttons/copy.button.yml +0 -3
- package/main/default/objects/object_listviews/buttons/customize.button.yml +0 -3
- package/main/default/objects/process_definition.object.yml +0 -323
- package/main/default/objects/space_users/fields/zoom.field.yml +0 -16
- package/main/default/tabs/admin_process_delegation_rules.tab.yml +0 -24
|
@@ -28,7 +28,9 @@ module.exports = {
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
setTimeout(function(){
|
|
31
|
-
SteedosUI.notification.success(
|
|
31
|
+
SteedosUI.notification.success({
|
|
32
|
+
message: t('steedos_packages.disable.toastr_success')
|
|
33
|
+
});
|
|
32
34
|
window.location.reload()
|
|
33
35
|
}, 100 * 1)
|
|
34
36
|
},
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: favorites
|
|
2
|
+
label: My Favorite
|
|
3
|
+
icon: topic
|
|
4
|
+
hidden: true
|
|
5
|
+
version: 2
|
|
6
|
+
fields:
|
|
7
|
+
name:
|
|
8
|
+
type: text
|
|
9
|
+
label: Name
|
|
10
|
+
required: true
|
|
11
|
+
min: 1
|
|
12
|
+
max: 300
|
|
13
|
+
object_name:
|
|
14
|
+
type: lookup
|
|
15
|
+
label: Object
|
|
16
|
+
reference_to: objects
|
|
17
|
+
reference_to_field: name
|
|
18
|
+
required: true
|
|
19
|
+
readonly: true
|
|
20
|
+
record_type:
|
|
21
|
+
label: Type
|
|
22
|
+
type: select
|
|
23
|
+
options:
|
|
24
|
+
- label: Record
|
|
25
|
+
value: RECORD
|
|
26
|
+
- label: List View
|
|
27
|
+
value: LIST_VIEW
|
|
28
|
+
readonly: true
|
|
29
|
+
record_id:
|
|
30
|
+
type: text
|
|
31
|
+
label: Record ID or List View ID(code)
|
|
32
|
+
hidden: true
|
|
33
|
+
sort_no:
|
|
34
|
+
type: number
|
|
35
|
+
label: Sort Number
|
|
36
|
+
inlineHelpText: High Value First
|
|
37
|
+
actions:
|
|
38
|
+
standard_new:
|
|
39
|
+
visible: false
|
|
40
|
+
list_views:
|
|
41
|
+
all:
|
|
42
|
+
label: All
|
|
43
|
+
filter_scope: space
|
|
44
|
+
filters: [["owner", "=", "{userId}"]]
|
|
45
|
+
sort: [["sort_no", "desc"]]
|
|
46
|
+
columns:
|
|
47
|
+
- name
|
|
48
|
+
- object_name
|
|
49
|
+
- record_type
|
|
50
|
+
- sort_no
|
|
51
|
+
permission_set:
|
|
52
|
+
user:
|
|
53
|
+
allowCreate: true
|
|
54
|
+
allowDelete: true
|
|
55
|
+
allowEdit: true
|
|
56
|
+
allowRead: true
|
|
57
|
+
modifyAllRecords: false
|
|
58
|
+
viewAllRecords: false
|
|
59
|
+
admin:
|
|
60
|
+
allowCreate: true
|
|
61
|
+
allowDelete: true
|
|
62
|
+
allowEdit: true
|
|
63
|
+
allowRead: true
|
|
64
|
+
modifyAllRecords: false
|
|
65
|
+
viewAllRecords: false
|
|
@@ -12,10 +12,14 @@ module.exports = {
|
|
|
12
12
|
}),
|
|
13
13
|
success: function(data){
|
|
14
14
|
if(data.status == 1){
|
|
15
|
-
SteedosUI.notification.error(
|
|
15
|
+
SteedosUI.notification.error({
|
|
16
|
+
message: t('object_fields_function_recomputeFormulaValues_error')
|
|
17
|
+
});
|
|
16
18
|
return;
|
|
17
19
|
}
|
|
18
|
-
SteedosUI.notification.success(
|
|
20
|
+
SteedosUI.notification.success({
|
|
21
|
+
message: t('object_fields_function_recomputeFormulaValues_success')
|
|
22
|
+
});
|
|
19
23
|
},
|
|
20
24
|
error: function(XMLHttpRequest){
|
|
21
25
|
SteedosUI.notification.error({message: XMLHttpRequest.responseJSON.msg});
|
|
@@ -13,10 +13,14 @@ module.exports = {
|
|
|
13
13
|
}),
|
|
14
14
|
success: function(data){
|
|
15
15
|
if(data.status == 1){
|
|
16
|
-
SteedosUI.notification.error(
|
|
16
|
+
SteedosUI.notification.error({
|
|
17
|
+
message: t('object_fields_function_recomputeSummaryValues_error')
|
|
18
|
+
});
|
|
17
19
|
return;
|
|
18
20
|
}
|
|
19
|
-
SteedosUI.notification.success(
|
|
21
|
+
SteedosUI.notification.success({
|
|
22
|
+
message: t('object_fields_function_recomputeSummaryValues_success')
|
|
23
|
+
});
|
|
20
24
|
},
|
|
21
25
|
error: function(XMLHttpRequest){
|
|
22
26
|
SteedosUI.notification.error({message: XMLHttpRequest.responseJSON.msg});
|
|
@@ -21,7 +21,8 @@ filtersFunction: !<tag:yaml.org,2002:js/function> |-
|
|
|
21
21
|
"email": ["email", "text", "textarea"]
|
|
22
22
|
};
|
|
23
23
|
var currentFilter = [];
|
|
24
|
-
|
|
24
|
+
//这里调用getUISchemaSync时传入true强制抓取最新schema是因为:设置自动填充时,如果from中选择了一个刚新建的字段,下面的fromField变量会取不到刚新建的字段,造成设置to属性会报错
|
|
25
|
+
var referenceObject = BuilderAmisObject && BuilderAmisObject.AmisLib && BuilderAmisObject.AmisLib.getUISchemaSync(values.reference_to, true);
|
|
25
26
|
var fromField = referenceObject && referenceObject.fields[values.from];
|
|
26
27
|
|
|
27
28
|
if (values.multiple) {
|
|
@@ -37,20 +38,34 @@ filtersFunction: !<tag:yaml.org,2002:js/function> |-
|
|
|
37
38
|
currentFilter.push(['multiple', '!=', true]);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
|
-
if (fromField
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if(
|
|
46
|
-
currentFilter.push([['
|
|
41
|
+
if (fromField) {
|
|
42
|
+
if(fromField.type == "select"){
|
|
43
|
+
//要注意下拉框字段类型有data_type属性,可能为boolean/number/text/null,默认值为null,表示text类型
|
|
44
|
+
var fromFieldDataType = fromField.data_type || "text";
|
|
45
|
+
currentFilter.push(['type', '=', 'select']);
|
|
46
|
+
if (fromFieldDataType === "text") {
|
|
47
|
+
currentFilter.push([['data_type', '=', 'text'], 'or', ['data_type', '=', null]]);
|
|
47
48
|
}
|
|
48
|
-
else{
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
else {
|
|
50
|
+
currentFilter.push(['data_type', '=', fromFieldDataType]);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else if (fromField.data_type) {
|
|
54
|
+
// 公式字段类型按data_type属性处理
|
|
55
|
+
currentFilter.push(['type', 'in', fieldFilters[fromField.data_type] || fromField.data_type.split()]);
|
|
56
|
+
} else {
|
|
57
|
+
currentFilter.push(['type', 'in', fieldFilters[fromField.type] || fromField.type.split()]);
|
|
58
|
+
if (fromField.type == "lookup" || fromField.type == "master_detail") {
|
|
59
|
+
if(fromField.reference_to === "users"){
|
|
60
|
+
currentFilter.push([['reference_to', '=', "users"],"or", ['reference_to', '=', "space_users"]]);
|
|
51
61
|
}
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
else{
|
|
63
|
+
if (fromField.reference_to) {
|
|
64
|
+
currentFilter.push(['reference_to', '=', fromField.reference_to]);
|
|
65
|
+
}
|
|
66
|
+
if (fromField.reference_to_field) {
|
|
67
|
+
currentFilter.push(['reference_to_field', '=', fromField.reference_to_field]);
|
|
68
|
+
}
|
|
54
69
|
}
|
|
55
70
|
}
|
|
56
71
|
}
|
|
@@ -4,17 +4,24 @@ label: Field
|
|
|
4
4
|
optionsFunction: !<tag:yaml.org,2002:js/function> |-
|
|
5
5
|
function(values
|
|
6
6
|
) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if(
|
|
11
|
-
|
|
7
|
+
var summaryObject = BuilderAmisObject && BuilderAmisObject.AmisLib && BuilderAmisObject.AmisLib.getUISchemaSync(values.summary_object, false);
|
|
8
|
+
var fields = summaryObject && summaryObject.fields;
|
|
9
|
+
let options = [];
|
|
10
|
+
if (fields) {
|
|
11
|
+
_.forEach(fields, function(f, k){
|
|
12
|
+
/*hidden,grid等类型的字段,不需要过滤*/
|
|
13
|
+
if(!_.includes(["grid","object", "[Object]", "[object]", "Object", "avatar", "image", "markdown", "html"], f.type) && !f.hidden){
|
|
14
|
+
/*filters.$.field及flow.current等子字段也不需要过滤*/
|
|
15
|
+
if(k.indexOf(".") < 0){
|
|
16
|
+
options.push({label: f.label || k, value: k})
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
})
|
|
12
20
|
}
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
return options;
|
|
17
22
|
}
|
|
23
|
+
depend_on:
|
|
24
|
+
- summary_object
|
|
18
25
|
showIcon: false
|
|
19
26
|
sort_no: 300
|
|
20
27
|
type: lookup
|
|
@@ -4,39 +4,36 @@ label: Operator
|
|
|
4
4
|
optionsFunction: !<tag:yaml.org,2002:js/function> |-
|
|
5
5
|
function(values
|
|
6
6
|
) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const filter = _.find(values.summary_filters, function (item) {
|
|
16
|
-
return item._id === values._grid_row_id
|
|
17
|
-
})
|
|
18
|
-
if(filter){
|
|
19
|
-
var field = filter.field;
|
|
20
|
-
if(field){
|
|
21
|
-
var object_fields = Creator.getObject(values.summary_object).fields
|
|
22
|
-
var filter_field_type;
|
|
23
|
-
if(object_fields[field]){
|
|
24
|
-
if(Creator.getFieldDataType){
|
|
25
|
-
filter_field_type = Creator.getFieldDataType(object_fields, field);
|
|
26
|
-
}
|
|
27
|
-
else{
|
|
28
|
-
filter_field_type = object_fields[field].type;
|
|
29
|
-
}
|
|
30
|
-
return Steedos.ObjectFieldManager.getSummaryFiltersOperation(filter_field_type);
|
|
31
|
-
}
|
|
7
|
+
var summaryObject = BuilderAmisObject && BuilderAmisObject.AmisLib && BuilderAmisObject.AmisLib.getUISchemaSync(values.summary_object, false);
|
|
8
|
+
var fields = summaryObject && summaryObject.fields;
|
|
9
|
+
var getFieldDataType = function(objectFields, key){
|
|
10
|
+
if (objectFields && key){
|
|
11
|
+
var currentField = objectFields[key];
|
|
12
|
+
var result = currentField && currentField.type;
|
|
13
|
+
if (["formula", "summary"].indexOf(result) > -1){
|
|
14
|
+
result = currentField.data_type;
|
|
32
15
|
}
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
else{
|
|
19
|
+
return "text";
|
|
33
20
|
}
|
|
34
21
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
|
|
23
|
+
let options = [];
|
|
24
|
+
if (fields) {
|
|
25
|
+
const field = api.context.field;
|
|
26
|
+
if(field){
|
|
27
|
+
var filter_field_type = getFieldDataType(fields, field);
|
|
28
|
+
options = Steedos.ObjectFieldManager.getSummaryFiltersOperation(filter_field_type);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return options;
|
|
39
32
|
}
|
|
33
|
+
|
|
34
|
+
depend_on:
|
|
35
|
+
- summary_object
|
|
36
|
+
- field
|
|
40
37
|
showIcon: false
|
|
41
38
|
sort_no: 310
|
|
42
39
|
type: lookup
|
|
@@ -5,7 +5,7 @@ language: javascript
|
|
|
5
5
|
is_wide: true
|
|
6
6
|
required: true
|
|
7
7
|
defaultValue: |-
|
|
8
|
-
// global: {_:lodash, moment, validator, filters}
|
|
8
|
+
// global: {_:lodash, moment, validator, filters, axios, formData, mongodb, sequelize}
|
|
9
9
|
// objects
|
|
10
10
|
// ctx: {input, params, broker, getObject, getUser}
|
|
11
11
|
editorDidMount: >-
|
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
3
|
+
* @Date: 2025-07-07 16:57:37
|
|
4
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5
|
+
* @LastEditTime: 2025-08-19 18:20:44
|
|
6
|
+
*/
|
|
7
|
+
// module.exports = {
|
|
8
|
+
// customize:function (object_name, record_id, fields) {
|
|
9
|
+
// let doc = Creator.odata.get(object_name, record_id);
|
|
10
|
+
// if(!doc.columns || !doc.columns.length){
|
|
11
|
+
// const objectName_label = record_id.split('.');
|
|
12
|
+
// let columns = Creator.getListView(objectName_label[0], objectName_label[1], true).columns;
|
|
13
|
+
// doc.columns = columns || [];
|
|
14
|
+
// }
|
|
15
|
+
// doc.columns = doc.columns.map((item)=>{
|
|
16
|
+
// if(typeof item === 'string'){
|
|
17
|
+
// return { field: item }
|
|
18
|
+
// }
|
|
19
|
+
// return item;
|
|
20
|
+
// })
|
|
21
|
+
// var newRecord = _.pick(doc, Creator.getObjectFieldsName(object_name));
|
|
22
|
+
// delete newRecord.is_system;
|
|
23
|
+
// delete newRecord._id;
|
|
24
|
+
// delete newRecord.record_permissions;
|
|
25
|
+
// newRecord.from_code_id = record_id;
|
|
26
|
+
// Creator.odata.insert(object_name, newRecord, function(result, error){
|
|
27
|
+
// if(result){
|
|
28
|
+
// FlowRouter.go(`/app/-/${object_name}/view/${result._id}`)
|
|
29
|
+
// }
|
|
30
|
+
// });
|
|
25
31
|
|
|
26
|
-
|
|
27
|
-
customizeVisible:function(object_name, record_id, record_permissions, data){
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
// },
|
|
33
|
+
// customizeVisible:function(object_name, record_id, record_permissions, data){
|
|
34
|
+
// var record = data && data.record;
|
|
35
|
+
// return Steedos.Object.base.actions.standard_new.visible(object_name) && record.is_system;
|
|
36
|
+
// }
|
|
37
|
+
// }
|
|
@@ -2,9 +2,12 @@ module.exports = {
|
|
|
2
2
|
showDesign:function (object_name, record_id) {
|
|
3
3
|
document.location = Steedos.absoluteUrl(`/api/amisListviewDesign?id=${record_id}&object=${this.record.object_name}&assetUrls=${Builder.settings.assetUrls}&locale=${Builder.settings.locale}`);
|
|
4
4
|
},
|
|
5
|
-
showDesignVisible:function (object_name, record_id, record_permissions) {
|
|
5
|
+
showDesignVisible:function (object_name, record_id, record_permissions, data) {
|
|
6
6
|
var perms= {};
|
|
7
|
-
var record =
|
|
7
|
+
var record = data && data.record;
|
|
8
|
+
if (!Steedos.isSpaceAdmin()) {
|
|
9
|
+
return false
|
|
10
|
+
}
|
|
8
11
|
if(!record){
|
|
9
12
|
return false;
|
|
10
13
|
}
|
|
@@ -14,10 +17,7 @@ showDesignVisible:function (object_name, record_id, record_permissions) {
|
|
|
14
17
|
if (record_permissions) {
|
|
15
18
|
perms = record_permissions;
|
|
16
19
|
} else {
|
|
17
|
-
|
|
18
|
-
if (record_permissions) {
|
|
19
|
-
perms = record_permissions;
|
|
20
|
-
}
|
|
20
|
+
return false
|
|
21
21
|
}
|
|
22
22
|
return perms["allowEdit"];
|
|
23
23
|
}
|
|
@@ -1,39 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
3
|
+
* @Date: 2025-08-12 17:48:56
|
|
4
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5
|
+
* @LastEditTime: 2025-08-12 17:50:22
|
|
6
|
+
*/
|
|
1
7
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
custom: function(object_name, record_id) {
|
|
4
|
-
$(document.body).addClass('loading');
|
|
5
|
-
let url = `/graphql`;
|
|
6
|
-
const obj = Creator.odata.get("objects", record_id);
|
|
7
|
-
delete obj.record_permissions;
|
|
8
|
-
delete obj["@odata.context"]
|
|
9
|
-
delete obj["@odata.editLink"]
|
|
10
|
-
delete obj["@odata.etag"]
|
|
11
|
-
delete obj["@odata.id"]
|
|
12
|
-
delete obj.idFieldName;
|
|
13
|
-
let options = {
|
|
14
|
-
type: 'post',
|
|
15
|
-
async: true,
|
|
16
|
-
data: JSON.stringify({
|
|
17
|
-
query: `mutation{objects__upsert(id: "${obj.name}", doc: ${JSON.stringify(JSON.stringify(obj))}){_id,name}}`
|
|
18
|
-
}),
|
|
19
|
-
success: function(data) {
|
|
20
|
-
SteedosUI.notification.success({
|
|
21
|
-
message: '对象已自定义。'
|
|
22
|
-
});
|
|
23
|
-
// SteedosUI.router.go({}, "/app/" + Session.get("app_id") + "/" + object_name + "/view/" + data.data.objects__upsert._id);
|
|
24
|
-
FlowRouter.reload()
|
|
25
|
-
$(document.body).removeClass('loading');
|
|
26
|
-
},
|
|
27
|
-
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
|
28
|
-
SteedosUI.notification.error({
|
|
29
|
-
message: '操作失败',
|
|
30
|
-
description: t(XMLHttpRequest.responseJSON.error),
|
|
31
|
-
});
|
|
32
|
-
$(document.body).removeClass('loading');
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
Steedos.authRequest(url, options);
|
|
36
|
-
},
|
|
37
8
|
customVisible: function(object_name, record_id, permission, data) {
|
|
38
9
|
if (Steedos.settings.public.enable_saas) {
|
|
39
10
|
return false;
|